Ext.define("KSWN.meta.settings.eds.model.Level",{extend:"Ext.data.TreeModel",proxy:{type:"memory"},fields:[{name:"ismulti",type:"io"},{name:"isuved",type:"io"},{name:"upd",type:"io"},{name:"iconCls",defaultValue:null}]}),Ext.define("KSWN.meta.settings.eds.store.Outcome",{extend:"KSWN.core.data.Store",alias:"store.ks-meta-settings-eds-store-outcome",loadUrl:"Automat/LoadOutcomeEDS",model:"KSWN.core.data.OutcomeTable",responseIdentifierKey:"identifier",responseOutcomeKey:"outcome",autoLoad:!1,updateDataOnLoadParamsChange:!0,isMultiTableOutcome:!0,tablesForSave:["Table1","Table2"]}),Ext.define("KSWN.meta.settings.eds.ViewModel",{extend:"Ext.app.ViewModel",alias:"viewmodel.ks-meta-settings-eds",data:{selectedLevel:null,loadParams:null},formulas:{},stores:{varinatInfoStore:{data:[]},outcomeStore:{type:"ks-meta-settings-eds-store-outcome",loadParams:"{loadParams}",listeners:{outcomeload:"onOutcomeStoreLoad"}},levelsStore:{type:"tree",model:"KSWN.meta.settings.eds.model.Level",sorters:["orders"],listeners:{update:"onLevelsStoreUpdate"}}}}),Ext.define("KSWN.meta.settings.eds.ViewController",{extend:"Ext.app.ViewController",alias:"controller.ks-meta-settings-eds",onOutcomeStoreLoad:function(store){const vm=this.getViewModel(),levelsStore=vm.get("levelsStore"),variantTable=store.findRecord("name","Table1"),levelsTable=store.findRecord("name","Table2");if(variantTable&&vm.set(_.head(variantTable.getTableData())),levelsTable){const levelsData=levelsTable.getTableData(),root=levelsStore.getRoot();root.removeAll(),root.appendChild(KSWN.util.DataUtils.GetTreeDataFromData(levelsData))}},onTitleValueChange:function(){this.getViewModel().set("upd",1)},onLevelsStoreUpdate:function(store,node,operation){operation===Ext.data.Model.EDIT&&node.set("upd",1)}}),Ext.define("KSWN.meta.settings.eds.Panel",{extend:"Ext.panel.Panel",mixins:["KSWN.meta.settings.mixin.AutomatNewVariantEditor"],xtype:"ks-meta-settings-eds-panel",viewModel:"ks-meta-settings-eds",controller:"ks-meta-settings-eds",tablesForSaveVMAliases:{Table2:"levelsStore"},syncInfoHead:!0,bodyPadding:4,layout:"fit",items:[{xtype:"panel",layout:{type:"hbox",align:"stretch"},dockedItems:[{flex:1,dock:"top",layout:{type:"hbox",align:"center"},minHeight:50,bodyPadding:"0 6",items:[{xtype:"textfield",labelAlign:"left",labelWidth:180,flex:1,fieldLabel:KSWN.Locale.naimenovanievarianta,listeners:{change:{fn:"onTitleValueChange",single:!0}},bind:{value:"{name}"}}]}],items:[{xtype:"treepanel",rootVisible:!1,reference:"levelsTree",flex:1,border:1,bodyPadding:8,margin:"0 4 0 0",columns:[{xtype:"treecolumn",flex:1,dataIndex:"name"}],bind:{selection:"{selectedLevel}",store:"{levelsStore}"}},{border:1,flex:1,layout:"fit",items:{xtype:"fieldset",defaultType:"checkboxfield",padding:"35 30",border:0,bind:{disabled:"{!selectedLevel}"},items:[{boxLabel:KSWN.Locale.uvedomitelnayaepneobyazatelnaya,bind:{value:"{selectedLevel.isuved}"}},{boxLabel:KSWN.Locale.neskolkoeptekushchegourovnya,bind:{value:"{selectedLevel.ismulti}"}}]}}]}],initComponent:function(){this.callParent();const{objx:objx}=this;objx.tree=this.lookupReference("levelsTree")}});