(function(){"use strict";u8.Crm.CampaignManagement.prototype.openCampaignInDefaultViewer=function(e){u8.services.actions.execute("A_CampaignDesignerPage",{arguments:{uid:e,link:e}})};u8.Crm.CampaignManagement.prototype.openActivityInDefaultViewer=function(e){u8.services.crud.readLink({uid:e,linkName:"$Link[CM]"},function(a,n){var i=u8.isValidRecordUid(n.uid)?n.uid:e;u8.services.actions.execute("A_CampaignDesignerPage",{arguments:{uid:i,link:e}})})};u8.Crm.CampaignManagement.prototype.copyActivityAndSubTree=function(e,a){var n=this;u8.request("CampaignManagementChannel.CopyActivityAndSubTree",{templateUid:e.templateUid,newStart:e.newStart,campaignUid:e.campaignUid},function(e,i){if(i.error){return a&&a(n,i)}var r=i.response&&i.response.uid;u8.services.crud.notify("Create",{uids:[r],args:{caller:"CampaignManagement",callerOperation:"copyActivityAndSubTree"}});return a&&a(n,{uid:r})})},u8.Crm.CampaignManagement.prototype.startNewCampaignProcess=function(){u8.services.actions.execute("A_NewCampaignProcess_Ent_b71e0f60",{})};u8.Crm.CampaignManagement.prototype.startNewActivityProcess=function(e){var a={};if(e&&e.uid){var n="$Link["+e.uid.infoAreaId+"]";a={link:e.uid,linkName:n}}u8.services.actions.execute("A_NewActivityProcess_Ent_7294d571",a)};u8.Crm.CampaignManagement.prototype.saveAs=function(e,a){var n=this;u8.request("CampaignManagementChannel.SaveAsCampaign",{templateUid:e.templateUid,campaignName:e.campaignName,campaignStartDate:e.campaignStartDate},function(e,i){if(i.error){return a&&a(n,i)}var r=i.response&&i.response.uid;u8.services.crud.notify("Create",{uids:[r],args:{caller:"CampaignManagement",callerOperation:"saveAs"}});return a&&a(n,{uid:r})})};u8.Crm.CampaignManagement.prototype.queryStateLyrisTransferTargetGroupAllowed=function(e){var a="__queryStateLyrisTransferTargetGroupAllowed";var n=e.source&&e.source.uid;var i={disabled:true,done:false};if(n&&u8.isValidRecordUid(n)){if(e.source.hasOwnProperty(a)){var r=e.source[a];if(r&&!u8.equalsRecordUid(n,r.uid)){delete e.source[a]}}if(!e.source.hasOwnProperty(a)){var t=function(i,r){if(r.error){return}var t=r.response;var u=t.lyrisIsEnabled;var s=t.activityExecutionUid&&u8.isValidRecordUid(t.activityExecutionUid);e.source[a]={uid:n,enabled:u&&s};u8.services.cache.put("CampaignManagementChannel.GetLyrisState",r)};var u=u8.services.cache.get("CampaignManagementChannel.GetLyrisState");if(u&&u8.session.environment.isEnterpriseVersion){t(null,u)}else{u8.request("CampaignManagementChannel.GetLyrisState",{activityExecutionUid:n},t)}}if(e.source[a]){i.disabled=!e.source[a].enabled;i.done=true}}else{i.done=true}return i};u8.services.add("campaignManagement",u8.Crm.CampaignManagement)})();