(function(){var e,a={},r=null;page.using={types:["ListView"]};page.commandBindings=$.extend(page.commandBindings,{A_AddMemberToList:o,A_RemoveMemberFromList:d,ListPickerNext:l});page.onLoad=function(){e=this.url.getInfoAreaId();var a=this.url.getArray("recordIds");if(a){n(a)}i();t()};function i(){var a=page.url.params;var r;if(a.BaseListDataPage){r={reader:{endPoint:a.BaseListDataPage}}}var i={infoAreaId:e,fieldGroupName:a.FieldGroupName,link:page.url.getLinkUid(),maxRows:a.MaxRows||a.MaxResultsBase||10,dataProvider:r};var t=new u8.Crm.List(i);var n={model:{menuName:"M_AddMemberToList"}};i={parent:page,canEdit:false,selectionMode:"multi",defaultAction:"A_AddMemberToList",multiSelectMenu:n,model:t,menu:n,header:{headerName:"Empty"},grid:{showDefaultAction:false,view:{dblClickKeyCode:13}}};u8.widget("ListView",$el("baseList"),i);t.update()}function t(){var a=page.url.params;var i=new u8.Crm.List({infoAreaId:e,fieldGroupName:e+"ListPicker",maxRows:a.MaxRows||a.MaxResultsBase||10,dataProvider:{reader:{endPoint:"RecordIdListChannel",arguments:{}}}});r=u8.widget("ListView",$el("selectionList"),{parent:page,canEdit:false,model:i,menu:{model:{menuName:"M_RemoveMemberFromList"}},header:{headerGroupName:"ListPicker",headerName:"ListPicker"},defaultAction:"A_RemoveMemberFromList",grid:{showDefaultAction:false,showMiniDetails:false,view:{allowColumnReordering:false,allowColumnResizing:false,allowSorting:false,dblClickKeyCode:46}}});s()}function n(e){a={};for(var r=0;r<e.length;r++){a[e[r]]=true}}function o(r,i,t){var n=$widget("baseList");var o=n.getSelection({type:"rowsUid"});for(var d=0;o&&d<o.length;d++){if(o[d].infoAreaId==e){a[o[d].recordId]=true}}s();return true}function d(r,i,t){var n=$widget("selectionList");var o=n.getSelection({type:"rowsUid"});for(var d=0;o&&d<o.length;d++){if(o[d].infoAreaId==e){a[o[d].recordId]=false}}s();return true}function s(){var e=r.model;$.extend(e.dataProvider.reader.arguments,{recordIds:u()});e.update()}function l(a,r,i){var t=page.wizard;if(!t){return}i={type:"Dictionary",items:{}};i.items[e+"List"]=u();t.raiseEvent(1,i)}function u(){var e=[];for(var r in a){if(a[r]===true){e.push(r)}}return e}})();