(function(){page.using={texts:["Campaign_Designer"]};page.buttonActions={newQuery:function(){var e=page.url.getUid();var r=this;u8.services.campaignDesigner.getActivityTargetGroupQueryInfo(e,function(e,a){var t=a.isPrivate?"Private":"Public";var i=a.hasQuery?a.queryName:null;var s={queryName:i,scope:t,width:.8,height:.8};r._startTargetGroupGenerationProcess("standardQueryProcess","compose",s)})},newQuickQuery:function(){var e=page.url.getUid();var r=this;u8.services.campaignDesigner.getActivityTargetGroupQueryInfo(e,function(e,a){var t=a.isPrivate?"Private":"Public";var i=a.hasQuery?a.queryUri:null;var s={query:i,scope:t,width:.8,height:.8};r._startTargetGroupGenerationProcess("quickQueryProcess","compose",s)})},loadQuery:function(){var e=page.url.getUid();var r=this;u8.services.campaignDesigner.getActivityTargetGroupQueryInfo(e,function(a,t){var i=t.isPrivate?"Private":"Public";var s=page.url.get("quickQueryProcess");var u=page.url.get("standardQueryProcess");var n={uid:e,quickQueryProcess:s,standardQueryProcess:u,width:.6,height:.6};r._startTargetGroupGenerationProcess("loadQueryProcess","",n)})},changeQuery:function(){u8.Base.Widgets.MessageBox.showQuestion({message:$t("TXT_Campaign_Designer_129"),buttons:"Ok,Cancel"},function(e,r){var a=page.url.getUid();if(r.command==="Ok"){u8.request("CampaignManagementChannel.DetachTargetGroupQuery",{activityUid:a},function(e,r){if(r.error){return}location.reload()})}})},reworkTargetGroup:function(){var e={width:.9,height:.9};this._startTargetGroupGenerationProcess("reworkTargetGroupProcess",null,e)},defineExecutionType:function(){var e={width:.6,height:.6};this._startTargetGroupGenerationProcess("defineActivityExecutionTypeProcess",null,e)},_startTargetGroupGenerationProcess:function(e,r,a){var t=page.url.get(e);var i=page.url.getUid();var s={name:t,stage:r,uid:i};if(a){$.extend(s,a)}u8.services.processHelpers.openPopupProcess(s);page.popup.close()}};page.onFormCreate=function(e){var r=page.url.getUid();var a=e.getComponent("$context");u8.services.campaignDesigner.getActivityTargetGroupQueryInfo(r,function(r,t){var i=t.hasQuery&&!t.isQuickQuery;var s=t.hasQuery&&t.isQuickQuery;var u=!t.hasQuery;var n=t.hasQuery;a.set("hasStandardQuery",i);a.set("hasQuickQuery",s);a.set("hasNoQuery",u);a.set("hasQuery",n);a.set("queryName",t.queryName);if(i||s){var o=i?"img u8-img-query-s":"img u8-img-run-s";var g=i?$t("TXT_Campaign_Designer_162"):$t("TXT_Campaign_Designer_161");var c=e.getWidget("labelCurrentQuery");var p=$("<span/>").addClass(o).css("padding","0 5px 3px 0").css("vertical-align","middle").attr("title",g);$(c.element).before(p)}})};page.onLoad=function(){var e=new u8.Base.Widgets.Form($el("form"),{formName:page.url.get("formName"),parent:page})}})();