(function(){"use strict";var e;page.using={types:["QueryResultSnapshots"]};page.commandBindings={Select:t};page.onLoad=function(){var t=this.url,i=t.getLinkUid(),o=window.query||window.page.query,s=t.get("flavor",page.process?"Select":null),n=t.getBoolean("disableDefaultAction",false);if(!o&&t.get("queryStatement")){o=new u8.Crm.QueryCommand({statement:t.get("queryStatement"),catalogValueEncoding:t.get("catalogValueEncoding")})}if(!o){return}var r=t.get(["virtualInfoAreaReadMode","infoAreaSpecializationMode"],o.virtualInfoAreaReadMode);if(i){o.link=i}$.extend(o,{maxRows:t.get("maxRows"),virtualInfoAreaReadMode:r,catalogValueEncoding:"Numeric"});var l=t.get("menu");var u={results:{query:o,parent:this,autoExecute:true,selectionMode:t.get("selectionMode"),parameterFormTemplateName:t.get("form","QueryParametersTemplate"),grid:{menu:l?{model:{menuName:l}}:null,pageSize:u8.services.queries.getPageSize(),showMenu:!t.getBoolean("hideContextMenu",false),defaultAction:n?"nothing":undefined},form:{catalogParametersAsText:t.getArray("catalogParametersAsText"),executeButton:t.get("alternateExecuteDirectButton")}},header:{isDefault:true,parent:this,headerName:t.get("headerName","QueryRun"),headerGroupName:t.get("headerGroupName","Special"),uid:i,parameters:{1:o.name}}};var d=t.get("resultHeaderName"),c=t.get("resultHeaderGroupName");if(d||c){u.results.grid.header={headerName:d,headerGroupName:c}}if(s){u.results.defaultAction=u8.session.webConfigValues.get("Flavor"+s+"DefaultAction",u.results.defaultAction);if(u.results.grid.menu){u.results.grid.menu.model.menuName=u8.session.webConfigValues.get("Flavor"+s+"Menu",u.results.grid.menu.model.menuName)}}var g=t.get("initialValues");if(g){}var m=this.url.getOptions("listParams",u8.session.webConfigValues["List.ListParams"]);if(m&&!m.isEmpty()){a(u.results,m)}if(u.results.selectionMode){u.results.selectionMode=u.results.selectionMode.toLowerCase()}else{u.results.selectionMode="multi"}var f=this.popup;if(f){var w=f.__data&&f.__data.infoAreaId;$.extend(u.results.grid,{defaultAction:"A_QuerySelectRecord",selectionMode:u.results.selectionMode,showLinks:false,selectInfoAreaId:w,showDefaultAction:false});u.header=null}if(u.header){if(!page.process&&i){$el("header").setAttribute("data-style","page")}var h=new u8.Base.Widgets.Header($el("header"),u.header);u.results.header=h}e=new u8.Crm.Widgets.QueryResultPresenter($el("result"),u.results)};function t(e,t,a){page.proceed({uid:a.uid,uids:a.uids})}function a(e,t){t=u8.services.migration.convertListParams(t);if(t.virtualInfoAreaReadMode){e.query.virtualInfoAreaReadMode=t.virtualInfoAreaReadMode}if("associationMode"in t){e.query.associationMode=t.associationMode}e.grid=u8.tools.clean($.extend({defaultAction:t.defaultAction,canEdit:t.canEdit,virtualInfoAreaReadMode:t.virtualInfoAreaReadMode,showLinks:t.showLinks,showMenu:t.showMenu!==false,showMiniDetails:t.showMiniDetails,showQuickViewAction:t.showQuickViewAction,showPaging:t.showPaging,showSumLine:t.showSumLine,autoSelect:t.autoSelect,countRows:t.countRows,view:u8.tools.clean({allowColumnReordering:t.allowColumnReordering,allowColumnResizing:t.allowColumnResizing,allowSorting:t.allowSorting,collapseInvisibleRows:t.collapseInvisibleRows,editable:t.editable,editOnClick:t.allowEditOnClick,singleClickEdit:t.singleClickEdit})},e.grid));if(!e.selectionMode){e.selectionMode=t.selectionMode&&t.selectionMode.toLowerCase()}}})();