Ext.define('Ext.dd.Registry',{singleton:true,constructor:function(){this.elements={};this.handles={};this.autoIdSeed=0;},getId:function(el,autogen){if(typeof el=="string"){return el;}
var id=el.id;if(!id&&autogen!==false){id="extdd-"+(++this.autoIdSeed);el.id=id;}
return id;},register:function(el,data){data=data||{};if(typeof el=="string"){el=document.getElementById(el);}
data.ddel=el;this.elements[this.getId(el)]=data;if(data.isHandle!==false){this.handles[data.ddel.id]=data;}
if(data.handles){var hs=data.handles,i,len;for(i=0,len=hs.length;i<len;i++){this.handles[this.getId(hs[i])]=data;}}},unregister:function(el){var id=this.getId(el,false),data=this.elements[id],hs,i,len;if(data){delete this.elements[id];if(data.handles){hs=data.handles;for(i=0,len=hs.length;i<len;i++){delete this.handles[this.getId(hs[i],false)];}}}},getHandle:function(id){if(typeof id!="string"){id=id.id;}
return this.handles[id];},getHandleFromEvent:function(e){var t=e.getTarget();return t?this.handles[t.id]:null;},getTarget:function(id){if(typeof id!="string"){id=id.id;}
return this.elements[id];},getTargetFromEvent:function(e){var t=e.getTarget();return t?this.elements[t.id]||this.handles[t.id]:null;}});Ext.define('Ext.view.NodeCache',{constructor:function(view){this.view=view;this.clear();this.el=new Ext.dom.AbstractElement.Fly();},clear:function(removeDom){var me=this,elements=this.elements,i,el;if(removeDom){for(i in elements){el=elements[i];el.parentNode.removeChild(el);}}
me.elements={};me.count=me.startIndex=0;me.endIndex=-1;},fill:function(newElements,startIndex){var me=this,elements=me.elements={},i,len=newElements.length;if(!startIndex){startIndex=0;}
for(i=0;i<len;i++){elements[startIndex+i]=newElements[i];}
me.startIndex=startIndex;me.endIndex=startIndex+len-1;me.count=len;return this;},insert:function(insertPoint,nodes){var me=this,elements=me.elements,i,nodeCount=nodes.length;if(me.count){if(insertPoint<me.count){for(i=me.endIndex+nodeCount;i>=insertPoint+nodeCount;i--){elements[i]=elements[i-nodeCount];elements[i].setAttribute('data-recordIndex',i);}}
me.endIndex=me.endIndex+nodeCount;}
else{me.startIndex=insertPoint;me.endIndex=insertPoint+nodeCount-1;}
for(i=0;i<nodeCount;i++,insertPoint++){elements[insertPoint]=nodes[i];elements[insertPoint].setAttribute('data-recordIndex',insertPoint);}
me.count+=nodeCount;},item:function(index,asDom){var el=this.elements[index],result=null;if(el){result=asDom?this.elements[index]:this.el.attach(this.elements[index]);}
return result;},first:function(asDom){return this.item(this.startIndex,asDom);},last:function(asDom){return this.item(this.endIndex,asDom);},getCount:function(){return this.count;},slice:function(start,end){var elements=this.elements,result=[],i;if(arguments.length<2){end=this.endIndex;}else{end=Math.min(this.endIndex,end-1);}
for(i=start||this.startIndex;i<=end;i++){result.push(elements[i]);}
return result;},replaceElement:function(el,replacement,domReplace){var elements=this.elements,index=(typeof el==='number')?el:this.indexOf(el);if(index>-1){replacement=Ext.getDom(replacement);if(domReplace){el=elements[index];el.parentNode.insertBefore(replacement,el);Ext.removeNode(el);replacement.setAttribute('data-recordIndex',index);}
this.elements[index]=replacement;}
return this;},indexOf:function(el){var elements=this.elements,index;el=Ext.getDom(el);for(index=this.startIndex;index<=this.endIndex;index++){if(elements[index]===el){return index;}}
return-1;},removeRange:function(start,end,removeDom){var me=this,elements=me.elements,el,i,removeCount,fromPos;if(end===undefined){end=me.count;}else{end=Math.min(me.endIndex+1,end+1);}
if(!start){start=0;}
removeCount=end-start;for(i=start,fromPos=end;i<me.endIndex;i++,fromPos++){if(removeDom&&i<end){Ext.removeNode(elements[i]);}
if(fromPos<=me.endIndex){el=elements[i]=elements[fromPos];el.setAttribute('data-recordIndex',i);}
else{delete elements[i];}}
me.count-=removeCount;me.endIndex-=removeCount;},removeElement:function(keys,removeDom){var me=this,inKeys,key,elements=me.elements,el,deleteCount,keyIndex=0,index,fromIndex;if(Ext.isArray(keys)){inKeys=keys;keys=[];deleteCount=inKeys.length;for(keyIndex=0;keyIndex<deleteCount;keyIndex++){key=inKeys[keyIndex];if(typeof key!=='number'){key=me.indexOf(key);}
if(key>=me.startIndex&&key<=me.endIndex){keys[keys.length]=key;}}
Ext.Array.sort(keys);deleteCount=keys.length;}else{if(keys<me.startIndex||keys>me.endIndex){return;}
deleteCount=1;keys=[keys];}
for(index=fromIndex=keys[0],keyIndex=0;index<=me.endIndex;index++,fromIndex++){if(keyIndex<deleteCount&&index===keys[keyIndex]){fromIndex++;keyIndex++;if(removeDom){Ext.removeNode(elements[index]);}}
if(fromIndex<=me.endIndex&&fromIndex>=me.startIndex){el=elements[index]=elements[fromIndex];el.setAttribute('data-recordIndex',index);}else{delete elements[index];}}
me.endIndex-=deleteCount;me.count-=deleteCount;},scroll:function(newRecords,direction,removeCount){var me=this,elements=me.elements,recCount=newRecords.length,i,el,removeEnd,newNodes,nodeContainer=me.view.getNodeContainer(),frag=document.createDocumentFragment();if(direction==-1){for(i=(me.endIndex-removeCount)+1;i<=me.endIndex;i++){el=elements[i];delete elements[i];el.parentNode.removeChild(el);}
me.endIndex-=removeCount;newNodes=me.view.bufferRender(newRecords,me.startIndex-=recCount);for(i=0;i<recCount;i++){elements[me.startIndex+i]=newNodes[i];frag.appendChild(newNodes[i]);}
nodeContainer.insertBefore(frag,nodeContainer.firstChild);}
else{removeEnd=me.startIndex+removeCount;for(i=me.startIndex;i<removeEnd;i++){el=elements[i];delete elements[i];el.parentNode.removeChild(el);}
me.startIndex=i;newNodes=me.view.bufferRender(newRecords,me.endIndex+1);for(i=0;i<recCount;i++){elements[me.endIndex+=1]=newNodes[i];frag.appendChild(newNodes[i]);}
nodeContainer.appendChild(frag);}
me.count=me.endIndex-me.startIndex+1;}});Ext.define('Ext.data.Request',{action:undefined,params:undefined,method:'GET',url:undefined,constructor:function(config){Ext.apply(this,config);}});Ext.define('Ext.Action',{constructor:function(config){this.initialConfig=config;this.itemId=config.itemId=(config.itemId||config.id||Ext.id());this.items=[];},isAction:true,setText:function(text){this.initialConfig.text=text;this.callEach('setText',[text]);},getText:function(){return this.initialConfig.text;},setIconCls:function(cls){this.initialConfig.iconCls=cls;this.callEach('setIconCls',[cls]);},getIconCls:function(){return this.initialConfig.iconCls;},setDisabled:function(v){this.initialConfig.disabled=v;this.callEach('setDisabled',[v]);},enable:function(){this.setDisabled(false);},disable:function(){this.setDisabled(true);},isDisabled:function(){return this.initialConfig.disabled;},setHidden:function(v){this.initialConfig.hidden=v;this.callEach('setVisible',[!v]);},show:function(){this.setHidden(false);},hide:function(){this.setHidden(true);},isHidden:function(){return this.initialConfig.hidden;},setHandler:function(fn,scope){this.initialConfig.handler=fn;this.initialConfig.scope=scope;this.callEach('setHandler',[fn,scope]);},each:function(fn,scope){Ext.each(this.items,fn,scope);},callEach:function(fnName,args){var items=this.items,i=0,len=items.length,item;Ext.suspendLayouts();for(;i<len;i++){item=items[i];item[fnName].apply(item,args);}
Ext.resumeLayouts(true);},addComponent:function(comp){this.items.push(comp);comp.on('destroy',this.removeComponent,this);},removeComponent:function(comp){Ext.Array.remove(this.items,comp);},execute:function(){this.initialConfig.handler.apply(this.initialConfig.scope||Ext.global,arguments);}});Ext.define('MP.form.plugin.FieldHint',{alias:'plugin.fieldhint',cls:'mp-form-fieldhint',align:'bottom',constructor:function(config){if(Ext.isString(config))
config={text:config};Ext.apply(this,config);},init:function(field){if(!field.isFieldLabelable)
Ext.Error.raise('FieldHint plugin has to be used on form fields that implement Ext.form.Labelable.');if(!Ext.isEmpty(this.text)){var markup='<div class="'+(this.cls||'')+'">'+this.text+'</div>';if(this.align=='top')
field.beforeSubTpl=this.getSubTpl(field.beforeSubTpl||'',markup,'');else
field.afterSubTpl=this.getSubTpl(field.afterSubTpl||'','',markup);}},getSubTpl:function(tpl,beforeMarkup,afterMarkup){if(Ext.isString(tpl))
return beforeMarkup+tpl+afterMarkup;else if(!tpl.isTemplate)
tpl=new Ext.XTemplate(tpl);return tpl.set(beforeMarkup+tpl.html+afterMarkup,tpl.compiled);}});Ext.define('Ext.button.Manager',{singleton:true,alternateClassName:'Ext.ButtonToggleManager',groups:{},pressedButton:null,buttonSelector:'.'+Ext.baseCSSPrefix+'btn',init:function(){var me=this;if(!me.initialized){Ext.getDoc().on({keydown:me.onDocumentKeyDown,mouseup:me.onDocumentMouseUp,scope:me});me.initialized=true;}},onDocumentKeyDown:function(e){var k=e.getKey(),btn;if(k===e.SPACE||k===e.ENTER){btn=e.getTarget(this.buttonSelector);if(btn){Ext.getCmp(btn.id).onClick(e);}}},onButtonMousedown:function(button,e){var pressed=this.pressedButton;if(pressed){pressed.onMouseUp(e);}
this.pressedButton=button;},onDocumentMouseUp:function(e){var pressed=this.pressedButton;if(pressed){pressed.onMouseUp(e);this.pressedButton=null;}},toggleGroup:function(btn,state){if(state){var g=this.groups[btn.toggleGroup],length=g.length,i;for(i=0;i<length;i++){if(g[i]!==btn){g[i].toggle(false);}}}},register:function(btn){var me=this,groups=this.groups,group=groups[btn.toggleGroup];me.init();if(!btn.toggleGroup){return;}
if(!group){group=groups[btn.toggleGroup]=[];}
group.push(btn);btn.on('toggle',me.toggleGroup,me);},unregister:function(btn){if(!btn.toggleGroup){return;}
var me=this,group=me.groups[btn.toggleGroup];if(group){Ext.Array.remove(group,btn);btn.un('toggle',me.toggleGroup,me);}},getPressed:function(group){var g=this.groups[group],i=0,len;if(g){for(len=g.length;i<len;i++){if(g[i].pressed===true){return g[i];}}}
return null;}});Ext.define('Ext.app.EventDomain',{requires:['Ext.util.Event'],statics:{instances:{}},isEventDomain:true,constructor:function(){var me=this;Ext.app.EventDomain.instances[me.type]=me;me.bus={};me.monitoredClasses=[];},dispatch:function(target,ev,args){var me=this,bus=me.bus,selectors=bus[ev],selector,controllers,id,events,event,i,ln;if(!selectors){return true;}
for(selector in selectors){if(selectors.hasOwnProperty(selector)&&me.match(target,selector)){controllers=selectors[selector];for(id in controllers){if(controllers.hasOwnProperty(id)){events=controllers[id];for(i=0,ln=events.length;i<ln;i++){event=events[i];if(event.fire.apply(event,args)===false){return false;}}}}}}
return true;},listen:function(selectors,controller){var me=this,bus=me.bus,idProperty=me.idProperty,monitoredClasses=me.monitoredClasses,monitoredClassesCount=monitoredClasses.length,i,tree,list,selector,options,listener,scope,event,listeners,ev;for(selector in selectors){if(selectors.hasOwnProperty(selector)&&(listeners=selectors[selector])){if(idProperty){selector=selector==='*'?selector:selector.substring(1);}
for(ev in listeners){if(listeners.hasOwnProperty(ev)){options=null;listener=listeners[ev];scope=controller;event=new Ext.util.Event(controller,ev);if(Ext.isObject(listener)){options=listener;listener=options.fn;scope=options.scope||controller;delete options.fn;delete options.scope;}
if(typeof listener==='string'){listener=scope[listener];}
event.addListener(listener,scope,options);for(i=monitoredClassesCount;i-->0;){monitoredClasses[i].hasListeners._incr_(ev);}
tree=bus[ev]||(bus[ev]={});tree=tree[selector]||(tree[selector]={});list=tree[controller.id]||(tree[controller.id]=[]);list.push(event);}}}}},match:function(target,selector){var idProperty=this.idProperty;if(idProperty){return selector==='*'||target[idProperty]===selector;}
return false;},monitor:function(observable){var domain=this,prototype=observable.isInstance?observable:observable.prototype,fireEventArgs=prototype.fireEventArgs;domain.monitoredClasses.push(observable);prototype.fireEventArgs=function(ev,args){var ret=fireEventArgs.apply(this,arguments);if(ret!==false){ret=domain.dispatch(this,ev,args);}
return ret;};},unlisten:function(controllerId){var bus=this.bus,controllers,ev,selector,selectors;for(ev in bus){if(bus.hasOwnProperty(ev)&&(selectors=bus[ev])){for(selector in selectors){controllers=selectors[selector];delete controllers[controllerId];}}}}});Ext.define('Ext.Queryable',{isQueryable:true,query:function(selector){selector=selector||'*';return Ext.ComponentQuery.query(selector,this);},queryBy:function(fn,scope){var out=[],items=this.getRefItems(true),i=0,len=items.length,item;for(;i<len;++i){item=items[i];if(fn.call(scope||item,item)!==false){out.push(item);}}
return out;},queryById:function(id){return this.down('#'+id);},child:function(selector){if(selector&&selector.isComponent){selector='#'+Ext.escapeId(selector.getItemId());}
selector=selector||'';return this.query('> '+selector)[0]||null;},down:function(selector){if(selector&&selector.isComponent){selector='#'+Ext.escapeId(selector.getItemId());}
selector=selector||'';return this.query(selector)[0]||null;},getRefItems:function(){return[];}});Ext.define('Ext.ShadowPool',{singleton:true,requires:['Ext.DomHelper'],markup:(function(){return Ext.String.format('<div class="{0}{1}-shadow" role="presentation"></div>',Ext.baseCSSPrefix,Ext.isIE&&!Ext.supports.CSS3BoxShadow?'ie':'css');}()),shadows:[],pull:function(){var sh=this.shadows.shift();if(!sh){sh=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,this.markup));sh.autoBoxAdjust=false;}
return sh;},push:function(sh){this.shadows.push(sh);},reset:function(){var shadows=[].concat(this.shadows),s,sLen=shadows.length;for(s=0;s<sLen;s++){shadows[s].remove();}
this.shadows=[];}});Ext.define('Ext.util.Filter',{id:null,anyMatch:false,exactMatch:false,caseSensitive:false,disabled:false,operator:null,statics:{createFilterFn:function(filters){return filters&&filters.length?function(candidate){var isMatch=true,length=filters.length,i,filter;for(i=0;isMatch&&i<length;i++){filter=filters[i];if(!filter.disabled){isMatch=isMatch&&filter.filterFn.call(filter.scope||filter,candidate);}}
return isMatch;}:function(){return true;};}},operatorFns:{"<":function(candidate){return Ext.coerce(this.getRoot(candidate)[this.property],this.value)<this.value;},"<=":function(candidate){return Ext.coerce(this.getRoot(candidate)[this.property],this.value)<=this.value;},"=":function(candidate){return Ext.coerce(this.getRoot(candidate)[this.property],this.value)==this.value;},">=":function(candidate){return Ext.coerce(this.getRoot(candidate)[this.property],this.value)>=this.value;},">":function(candidate){return Ext.coerce(this.getRoot(candidate)[this.property],this.value)>this.value;},"!=":function(candidate){return Ext.coerce(this.getRoot(candidate)[this.property],this.value)!=this.value;}},constructor:function(config){var me=this;me.initialConfig=config;Ext.apply(me,config);me.filter=me.filter||me.filterFn;if(me.filter===undefined){me.setValue(config.value);}},setValue:function(value){var me=this;me.value=value;if(me.property===undefined||me.value===undefined){}else{me.filter=me.createFilterFn();}
me.filterFn=me.filter;},setFilterFn:function(filterFn){this.filterFn=this.filter=filterFn;},createFilterFn:function(){var me=this,matcher=me.createValueMatcher(),property=me.property;if(me.operator){return me.operatorFns[me.operator];}else{return function(item){var value=me.getRoot(item)[property];return matcher===null?value===null:matcher.test(value);};}},getRoot:function(item){var root=this.root;return root===undefined?item:item[root];},createValueMatcher:function(){var me=this,value=me.value,anyMatch=me.anyMatch,exactMatch=me.exactMatch,caseSensitive=me.caseSensitive,escapeRe=Ext.String.escapeRegex;if(value===null){return value;}
if(!value.exec){value=String(value);if(anyMatch===true){value=escapeRe(value);}else{value='^'+escapeRe(value);if(exactMatch===true){value+='$';}}
value=new RegExp(value,caseSensitive?'':'i');}
return value;},serialize:function(){var me=this,result=Ext.apply({},me.initialConfig);result.value=me.value;return result;}},function(){this.prototype.operatorFns['==']=this.prototype.operatorFns['='];});Ext.define('Ext.data.flash.BinaryXhr',{statics:{flashPluginActivated:function(){Ext.data.flash.BinaryXhr.flashPluginActive=true;Ext.data.flash.BinaryXhr.flashPlugin=document.getElementById("ext-flash-polyfill");Ext.globalEvents.fireEvent("flashready");},flashPluginActive:false,flashPluginInjected:false,connectionIndex:1,liveConnections:{},flashPlugin:null,onFlashStateChange:function(javascriptId,state,data){var connection;connection=this.liveConnections[Number(javascriptId)];if(connection){connection.onFlashStateChange(state,data);}},registerConnection:function(conn){var i=this.connectionIndex;this.conectionIndex=this.connectionIndex+1;this.liveConnections[i]=conn;return i;},injectFlashPlugin:function(){var divTag,pTag,aTag,iTag,me=this,flashLoaderPath,flashObjectPath;iTag=document.createElement("img");iTag.setAttribute("src",window.location.protocol+'//www.adobe.com/images/shared/download_buttons/get_flash_player.gif');iTag.setAttribute("alt","Get Adobe Flash player");aTag=document.createElement("a");aTag.setAttribute("href","http://www.adobe.com/go/getflashplayer");aTag.appendChild(iTag);pTag=document.createElement("p");pTag.innerHTML="To view this page ensure that Adobe Flash Player version 11.1.0 or greater is installed.";divTag=document.createElement("div");divTag.setAttribute("id","ext-flash-polyfill");divTag.appendChild(pTag);divTag.appendChild(iTag);Ext.getBody().dom.appendChild(divTag);flashLoaderPath=[Ext.Loader.getPath('Ext.data.Connection'),'../../../plugins/flash/swfobject.js'].join('/');flashObjectPath="/plugins/flash/FlashPlugin.swf";if(Ext.flashPluginPath){flashObjectPath=Ext.flashPluginPath;}
Ext.Loader.loadScript({url:flashLoaderPath,onLoad:function(){var swfVersionStr="11.4.0";var xiSwfUrlStr="playerProductInstall.swf";var flashvars={};var params={};params.quality="high";params.bgcolor="#ffffff";params.allowscriptaccess="sameDomain";params.allowfullscreen="true";var attributes={};attributes.id="ext-flash-polyfill";attributes.name="polyfill";attributes.align="middle";swfobject.embedSWF(flashObjectPath,"ext-flash-polyfill","0","0",swfVersionStr,xiSwfUrlStr,flashvars,params,attributes);},onError:function(){},scope:me});Ext.globalEvents.addEvents("flashready");Ext.data.flash.BinaryXhr.flashPluginInjected=true;}},readyState:0,status:0,statusText:"",responseBytes:null,javascriptId:null,constructor:function(config){if(!Ext.data.flash.BinaryXhr.flashPluginInjected){Ext.data.flash.BinaryXhr.injectFlashPlugin();}
var me=this;Ext.apply(me,config);me.requestHeaders={};},abort:function(){var me=this;if(me.readyState==4){return;}
me.aborted=true;if(!Ext.data.flash.BinaryXhr.flashPluginActive){Ext.globalEvents.removeListener("flashready",me.onFlashReady,me);return;}
Ext.data.flash.BinaryXhr.flashPlugin.abortRequest(me.javascriptId);delete Ext.data.flash.BinaryXhr.liveConnections[me.javascriptId];},getAllResponseHeaders:function(){var headers=[];Ext.Object.each(this.responseHeaders,function(name,value){headers.push(name+': '+value);});return headers.join('\x0d\x0a');},getResponseHeader:function(header){var headers=this.responseHeaders;return(headers&&headers[header])||null;},open:function(method,url,async,user,password){var me=this;me.method=method;me.url=url;me.async=async!==false;me.user=user;me.password=password;},overrideMimeType:function(mimeType){this.mimeType=mimeType;},send:function(body){var me=this;me.body=body;if(!Ext.data.flash.BinaryXhr.flashPluginActive){Ext.globalEvents.addListener("flashready",me.onFlashReady,me);}else{this.onFlashReady();}},onFlashReady:function(){var me=this,req,status;me.javascriptId=Ext.data.flash.BinaryXhr.registerConnection(me);req={method:me.method,url:me.url,user:me.user,password:me.password,mimeType:me.mimeType,requestHeaders:me.requestHeaders,body:me.body,javascriptId:me.javascriptId};status=Ext.data.flash.BinaryXhr.flashPlugin.postBinary(req);},setReadyState:function(state){var me=this;if(me.readyState!=state){me.readyState=state;me.onreadystatechange();}},setRequestHeader:function(header,value){this.requestHeaders[header]=value;},onreadystatechange:Ext.emptyFn,parseData:function(data){var me=this;this.status=data.status||0;me.responseHeaders={};if(me.mimeType){me.responseHeaders["content-type"]=me.mimeType;}
if(data.reason=="complete"){this.responseBytes=data.data;me.responseHeaders["content-length"]=data.data.length;}else if(data.reason=="error"||data.reason=="securityError"){this.statusText=data.text;me.responseHeaders["content-length"]=0;}},onFlashStateChange:function(state,data){var me=this;if(state==4){me.parseData(data);delete Ext.data.flash.BinaryXhr.liveConnections[me.javascriptId];}
me.setReadyState(state);}});Ext.define('Ext.util.Memento',(function(){function captureOne(src,target,prop,prefix){src[prefix?prefix+prop:prop]=target[prop];}
function removeOne(src,target,prop){delete src[prop];}
function restoreOne(src,target,prop,prefix){var name=prefix?prefix+prop:prop,value=src[name];if(value||src.hasOwnProperty(name)){restoreValue(target,prop,value);}}
function restoreValue(target,prop,value){if(Ext.isDefined(value)){target[prop]=value;}else{delete target[prop];}}
function doMany(doOne,src,target,props,prefix){if(src){if(Ext.isArray(props)){var p,pLen=props.length;for(p=0;p<pLen;p++){doOne(src,target,props[p],prefix);}}else{doOne(src,target,props,prefix);}}}
return{data:null,target:null,constructor:function(target,props){if(target){this.target=target;if(props){this.capture(props);}}},capture:function(props,target,prefix){var me=this;doMany(captureOne,me.data||(me.data={}),target||me.target,props,prefix);},remove:function(props){doMany(removeOne,this.data,null,props);},restore:function(props,clear,target,prefix){doMany(restoreOne,this.data,target||this.target,props,prefix);if(clear!==false){this.remove(props);}},restoreAll:function(clear,target){var me=this,t=target||this.target,data=me.data,prop;for(prop in data){if(data.hasOwnProperty(prop)){restoreValue(t,prop,data[prop]);}}
if(clear!==false){delete me.data;}}};}()));Ext.define('Ext.dd.DragTracker',{uses:['Ext.util.Region'],mixins:{observable:'Ext.util.Observable'},active:false,trackOver:false,tolerance:5,autoStart:false,constructor:function(config){var me=this;Ext.apply(me,config);me.addEvents('mouseover','mouseout','mousedown','mouseup','mousemove','beforedragstart','dragstart','dragend','drag');me.dragRegion=new Ext.util.Region(0,0,0,0);if(me.el){me.initEl(me.el);}
me.mixins.observable.constructor.call(me);if(me.disabled){me.disable();}},initEl:function(el){var me=this;me.el=Ext.get(el);me.handle=Ext.get(me.delegate);me.delegate=me.handle?undefined:me.delegate;if(!me.handle){me.handle=me.el;}
me.handleListeners={scope:me,delegate:me.delegate,mousedown:me.onMouseDown};if(me.trackOver||me.overCls){Ext.apply(me.handleListeners,{mouseover:me.onMouseOver,mouseout:me.onMouseOut});}
me.mon(me.handle,me.handleListeners);},disable:function(){this.disabled=true;},enable:function(){this.disabled=false;},destroy:function(){var me=this;if(me.active){me.endDrag({});}
me.clearListeners();me.mun(me.handle,me.handleListeners);me.el=me.handle=null;},onMouseOver:function(e,target){var me=this;if(!me.disabled){if(Ext.EventManager.contains(e)||me.delegate){me.mouseIsOut=false;if(me.overCls){me.el.addCls(me.overCls);}
me.fireEvent('mouseover',me,e,me.delegate?e.getTarget(me.delegate,target):me.handle);}}},onMouseOut:function(e){var me=this;if(me.mouseIsDown){me.mouseIsOut=true;}else{if(me.overCls){me.el.removeCls(me.overCls);}
me.fireEvent('mouseout',me,e);}},onMouseDown:function(e,target){var me=this,el;if(me.disabled||e.dragTracked){return;}
me.dragTarget=me.delegate?target:me.handle.dom;me.startXY=me.lastXY=e.getXY();me.startRegion=Ext.fly(me.dragTarget).getRegion();if(me.fireEvent('mousedown',me,e)===false||me.fireEvent('beforedragstart',me,e)===false||me.onBeforeStart(e)===false){return;}
me.mouseIsDown=true;e.dragTracked=true;el=me.el.dom;if(Ext.isIE&&el.setCapture){el.setCapture();}
if(me.preventDefault!==false){e.preventDefault();}
Ext.getDoc().on({scope:me,mouseup:me.onMouseUp,mousemove:me.onMouseMove,selectstart:me.stopSelect});if(me.autoStart){me.timer=Ext.defer(me.triggerStart,me.autoStart===true?1000:me.autoStart,me,[e]);}},onMouseMove:function(e,target){var me=this,xy=e.getXY(),s=me.startXY;e.preventDefault();me.lastXY=xy;if(!me.active){if(Math.max(Math.abs(s[0]-xy[0]),Math.abs(s[1]-xy[1]))>me.tolerance){me.triggerStart(e);}else{return;}}
if(me.fireEvent('mousemove',me,e)===false){me.onMouseUp(e);}else{me.onDrag(e);me.fireEvent('drag',me,e);}},onMouseUp:function(e){var me=this;me.mouseIsDown=false;if(me.mouseIsOut){me.mouseIsOut=false;me.onMouseOut(e);}
e.preventDefault();if(Ext.isIE&&document.releaseCapture){document.releaseCapture();}
me.fireEvent('mouseup',me,e);me.endDrag(e);},endDrag:function(e){var me=this,wasActive=me.active;Ext.getDoc().un({mousemove:me.onMouseMove,mouseup:me.onMouseUp,selectstart:me.stopSelect,scope:me});me.clearStart();me.active=false;if(wasActive){me.onEnd(e);me.fireEvent('dragend',me,e);}
me._constrainRegion=Ext.EventObject.dragTracked=null},triggerStart:function(e){var me=this;me.clearStart();me.active=true;me.onStart(e);me.fireEvent('dragstart',me,e);},clearStart:function(){var timer=this.timer;if(timer){clearTimeout(timer);this.timer=null;}},stopSelect:function(e){e.stopEvent();return false;},onBeforeStart:function(e){},onStart:function(xy){},onDrag:function(e){},onEnd:function(e){},getDragTarget:function(){return this.dragTarget;},getDragCt:function(){return this.el;},getConstrainRegion:function(){var me=this;if(me.constrainTo){if(me.constrainTo instanceof Ext.util.Region){return me.constrainTo;}
if(!me._constrainRegion){me._constrainRegion=Ext.fly(me.constrainTo).getViewRegion();}}else{if(!me._constrainRegion){me._constrainRegion=me.getDragCt().getViewRegion();}}
return me._constrainRegion;},getXY:function(constrain){return constrain?this.constrainModes[constrain](this,this.lastXY):this.lastXY;},getOffset:function(constrain){var xy=this.getXY(constrain),s=this.startXY;return[xy[0]-s[0],xy[1]-s[1]];},constrainModes:{point:function(me,xy){var dr=me.dragRegion,constrainTo=me.getConstrainRegion();if(!constrainTo){return xy;}
dr.x=dr.left=dr[0]=dr.right=xy[0];dr.y=dr.top=dr[1]=dr.bottom=xy[1];dr.constrainTo(constrainTo);return[dr.left,dr.top];},dragTarget:function(me,xy){var s=me.startXY,dr=me.startRegion.copy(),constrainTo=me.getConstrainRegion(),adjust;if(!constrainTo){return xy;}
dr.translateBy(xy[0]-s[0],xy[1]-s[1]);if(dr.right>constrainTo.right){xy[0]+=adjust=(constrainTo.right-dr.right);dr.left+=adjust;}
if(dr.left<constrainTo.left){xy[0]+=(constrainTo.left-dr.left);}
if(dr.bottom>constrainTo.bottom){xy[1]+=adjust=(constrainTo.bottom-dr.bottom);dr.top+=adjust;}
if(dr.top<constrainTo.top){xy[1]+=(constrainTo.top-dr.top);}
return xy;}}});Ext.define('Ext.grid.CellContext',{isCellContext:true,constructor:function(view){this.view=view;},setPosition:function(row,col){var me=this;if(arguments.length===1){if(row.view){me.view=row.view;}
col=row.column;row=row.row;}
me.setRow(row);me.setColumn(col);return me;},setRow:function(row){var me=this;if(row!==undefined){if(typeof row==='number'){me.row=Math.max(Math.min(row,me.view.dataSource.getCount()-1),0);me.record=me.view.dataSource.getAt(row);}
else if(row.isModel){me.record=row;me.row=me.view.indexOf(row);}
else if(row.tagName){me.record=me.view.getRecord(row);me.row=me.view.indexOf(me.record);}}},setColumn:function(col){var me=this,columnManager=me.view.ownerCt.columnManager;if(col!==undefined){if(typeof col==='number'){me.column=col;me.columnHeader=columnManager.getHeaderAtIndex(col);}
else if(col.isHeader){me.columnHeader=col;me.column=columnManager.getHeaderIndex(col);}}}});Ext.define('Ext.panel.Proxy',{alternateClassName:'Ext.dd.PanelProxy',moveOnDrag:true,constructor:function(panel,config){var me=this;me.panel=panel;me.id=me.panel.id+'-ddproxy';Ext.apply(me,config);},insertProxy:true,setStatus:Ext.emptyFn,reset:Ext.emptyFn,update:Ext.emptyFn,stop:Ext.emptyFn,sync:Ext.emptyFn,getEl:function(){return this.ghost.el;},getGhost:function(){return this.ghost;},getProxy:function(){return this.proxy;},hide:function(){var me=this;if(me.ghost){if(me.proxy){me.proxy.remove();delete me.proxy;}
me.panel.unghost(null,me.moveOnDrag);delete me.ghost;}},show:function(){var me=this,panelSize;if(!me.ghost){panelSize=me.panel.getSize();me.panel.el.setVisibilityMode(Ext.Element.DISPLAY);me.ghost=me.panel.ghost();if(me.insertProxy){me.proxy=me.panel.el.insertSibling({cls:Ext.baseCSSPrefix+'panel-dd-spacer'});me.proxy.setSize(panelSize);}}},repair:function(xy,callback,scope){this.hide();Ext.callback(callback,scope||this);},moveProxy:function(parentNode,before){if(this.proxy){parentNode.insertBefore(this.proxy.dom,before);}}});Ext.define('Ext.ZIndexManager',{alternateClassName:'Ext.WindowGroup',statics:{zBase:9000},constructor:function(container){var me=this;me.list={};me.zIndexStack=[];me.front=null;if(container){if(container.isContainer){container.on('resize',me._onContainerResize,me);me.zseed=Ext.Number.from(me.rendered?container.getEl().getStyle('zIndex'):undefined,me.getNextZSeed());me.targetEl=container.getTargetEl();me.container=container;}
else{Ext.EventManager.onWindowResize(me._onContainerResize,me);me.zseed=me.getNextZSeed();me.targetEl=Ext.get(container);}}
else{Ext.EventManager.onWindowResize(me._onContainerResize,me);me.zseed=me.getNextZSeed();Ext.onDocumentReady(function(){me.targetEl=Ext.getBody();});}},getNextZSeed:function(){return(Ext.ZIndexManager.zBase+=10000);},setBase:function(baseZIndex){this.zseed=baseZIndex;var result=this.assignZIndices();this._activateLast();return result;},assignZIndices:function(){var a=this.zIndexStack,len=a.length,i=0,zIndex=this.zseed,comp,topModal;for(;i<len;i++){comp=a[i];if(comp&&!comp.hidden){zIndex=comp.setZIndex(zIndex);if(comp.modal){topModal=comp;}}}
if(topModal){this._showModalMask(topModal)}
return zIndex;},_setActiveChild:function(comp,oldFront){var front=this.front,oldPreventFocus=comp.preventFocusOnActivate;if(comp!==front){if(front&&!front.destroying){front.setActive(false,comp);}
this.front=comp;if(comp&&comp!=oldFront){comp.preventFocusOnActivate=comp.preventFocusOnActivate||oldFront&&(oldFront.preventFocusOnActivate||!oldFront.focusOnToFront);comp.setActive(true);if(comp.modal){this._showModalMask(comp);}
comp.preventFocusOnActivate=oldPreventFocus;}}},onComponentHide:function(comp){this._activateLast();},_activateLast:function(){var me=this,stack=me.zIndexStack,i=stack.length-1,comp;for(;i>=0&&stack[i].hidden;--i);if((comp=stack[i])){me._setActiveChild(comp,me.front);if(comp.modal){return;}}
else{if(me.front&&!me.front.destroying){me.front.setActive(false);}
me.front=null;}
for(;i>=0;--i){comp=stack[i];if(comp.isVisible()&&comp.modal){me._showModalMask(comp);return;}}
me._hideModalMask();},_showModalMask:function(comp){var me=this,zIndex=comp.el.getStyle('zIndex')-4,maskTarget=comp.floatParent?comp.floatParent.getTargetEl():comp.container,mask=me.mask,shim=me.maskShim,viewSize;if(!mask){if(Ext.isIE6){shim=me.maskShim=Ext.getBody().createChild({tag:'iframe',cls:Ext.baseCSSPrefix+'shim '+Ext.baseCSSPrefix+'mask-shim'});shim.setVisibilityMode(Ext.Element.DISPLAY);}
mask=me.mask=Ext.getBody().createChild({cls:Ext.baseCSSPrefix+'mask',style:'height:0;width:0'});mask.setVisibilityMode(Ext.Element.DISPLAY);mask.on('click',me._onMaskClick,me);}
mask.maskTarget=maskTarget;viewSize=me.getMaskBox();if(shim){shim.setStyle('zIndex',zIndex);shim.show();shim.setBox(viewSize);}
mask.setStyle('zIndex',zIndex);mask.show();mask.setBox(viewSize);},_hideModalMask:function(){var mask=this.mask,maskShim=this.maskShim;if(mask&&mask.isVisible()){mask.maskTarget=undefined;mask.hide();if(maskShim){maskShim.hide();}}},_onMaskClick:function(){if(this.front){this.front.focus();}},getMaskBox:function(){var maskTarget=this.mask.maskTarget;if(maskTarget.dom===document.body){return{height:Math.max(document.body.scrollHeight,Ext.dom.Element.getDocumentHeight()),width:Math.max(document.body.scrollWidth,document.documentElement.clientWidth),x:0,y:0};}else{return maskTarget.getBox();}},_onContainerResize:function(){var me=this,mask=me.mask,maskShim=me.maskShim,viewSize;if(mask&&mask.isVisible()){mask.hide();if(maskShim){maskShim.hide();}
viewSize=me.getMaskBox();if(maskShim){maskShim.setSize(viewSize);maskShim.show();}
mask.setSize(viewSize);mask.show();}},register:function(comp){var me=this,compAfterHide=comp.afterHide;if(comp.zIndexManager){comp.zIndexManager.unregister(comp);}
comp.zIndexManager=me;me.list[comp.id]=comp;me.zIndexStack.push(comp);comp.afterHide=function(){compAfterHide.apply(comp,arguments);me.onComponentHide(comp);};},unregister:function(comp){var me=this,list=me.list;delete comp.zIndexManager;if(list&&list[comp.id]){delete list[comp.id];delete comp.afterHide;Ext.Array.remove(me.zIndexStack,comp);me._activateLast();}},get:function(id){return id.isComponent?id:this.list[id];},bringToFront:function(comp,preventFocus){var me=this,result=false,zIndexStack=me.zIndexStack;comp=me.get(comp);if(comp!==me.front){Ext.Array.remove(zIndexStack,comp);if(comp.preventBringToFront){zIndexStack.unshift(comp);}else{zIndexStack.push(comp);}
me.assignZIndices();if(!preventFocus){me._activateLast();}
result=true;me.front=comp;if(comp.modal){me._showModalMask(comp);}}
return result;},sendToBack:function(comp){var me=this;comp=me.get(comp);Ext.Array.remove(me.zIndexStack,comp);me.zIndexStack.unshift(comp);me.assignZIndices();this._activateLast();return comp;},hideAll:function(){var list=this.list,item,id;for(id in list){if(list.hasOwnProperty(id)){item=list[id];if(item.isComponent&&item.isVisible()){item.hide();}}}},hide:function(){var i=0,stack=this.zIndexStack,len=stack.length,comp;this.tempHidden=[];for(;i<len;i++){comp=stack[i];if(comp.isVisible()){this.tempHidden.push(comp);comp.el.hide();comp.hidden=true;}}},show:function(){var i=0,tempHidden=this.tempHidden,len=tempHidden?tempHidden.length:0,comp;for(;i<len;i++){comp=tempHidden[i];comp.el.show();comp.hidden=false;comp.setPosition(comp.x,comp.y);}
delete this.tempHidden;},getActive:function(){return this.front;},getBy:function(fn,scope){var r=[],i=0,stack=this.zIndexStack,len=stack.length,comp;for(;i<len;i++){comp=stack[i];if(fn.call(scope||comp,comp)!==false){r.push(comp);}}
return r;},each:function(fn,scope){var list=this.list,id,comp;for(id in list){if(list.hasOwnProperty(id)){comp=list[id];if(comp.isComponent&&fn.call(scope||comp,comp)===false){return;}}}},eachBottomUp:function(fn,scope){var stack=this.zIndexStack,i=0,len=stack.length,comp;for(;i<len;i++){comp=stack[i];if(comp.isComponent&&fn.call(scope||comp,comp)===false){return;}}},eachTopDown:function(fn,scope){var stack=this.zIndexStack,i=stack.length,comp;for(;i-->0;){comp=stack[i];if(comp.isComponent&&fn.call(scope||comp,comp)===false){return;}}},destroy:function(){var me=this,list=me.list,comp,id;for(id in list){if(list.hasOwnProperty(id)){comp=list[id];if(comp.isComponent){comp.destroy();}}}
delete me.zIndexStack;delete me.list;delete me.container;delete me.targetEl;}},function(){Ext.WindowManager=Ext.WindowMgr=new this();});Ext.define('Ext.resizer.Resizer',{mixins:{observable:'Ext.util.Observable'},uses:['Ext.resizer.ResizeTracker','Ext.Component'],alternateClassName:'Ext.Resizable',handleCls:Ext.baseCSSPrefix+'resizable-handle',pinnedCls:Ext.baseCSSPrefix+'resizable-pinned',overCls:Ext.baseCSSPrefix+'resizable-over',wrapCls:Ext.baseCSSPrefix+'resizable-wrap',delimiterRe:/(?:\s*[,;]\s*)|\s+/,dynamic:true,handles:'s e se',height:null,width:null,heightIncrement:0,widthIncrement:0,minHeight:20,minWidth:20,maxHeight:10000,maxWidth:10000,pinned:false,preserveRatio:false,transparent:false,possiblePositions:{n:'north',s:'south',e:'east',w:'west',se:'southeast',sw:'southwest',nw:'northwest',ne:'northeast'},constructor:function(config){var me=this,target,targetEl,tag,handles=me.handles,handleCls,possibles,len,i=0,pos,handleEls=[],eastWestStyle,style,box,targetBaseCls,unselectableCls=Ext.dom.Element.unselectableCls;me.addEvents('beforeresize','resizedrag','resize');if(Ext.isString(config)||Ext.isElement(config)||config.dom){target=config;config=arguments[1]||{};config.target=target;}
me.mixins.observable.constructor.call(me,config);target=me.target;if(target){if(target.isComponent){target.addClsWithUI('resizable');me.el=target.getEl();if(target.minWidth){me.minWidth=target.minWidth;}
if(target.minHeight){me.minHeight=target.minHeight;}
if(target.maxWidth){me.maxWidth=target.maxWidth;}
if(target.maxHeight){me.maxHeight=target.maxHeight;}
if(target.floating){if(!me.hasOwnProperty('handles')){me.handles='n ne e se s sw w nw';}}}else{me.el=me.target=Ext.get(target);}}
else{me.target=me.el=Ext.get(me.el);}
tag=me.el.dom.tagName.toUpperCase();if(tag=='TEXTAREA'||tag=='IMG'||tag=='TABLE'){me.originalTarget=me.target;targetEl=me.el;box=targetEl.getBox();me.target=me.el=me.el.wrap({cls:me.wrapCls,id:me.el.id+'-rzwrap',style:targetEl.getStyles('margin-top','margin-bottom')});me.el.setPositioning(targetEl.getPositioning());targetEl.clearPositioning();me.el.setBox(box);targetEl.setStyle('position','absolute');}
me.el.position();if(me.pinned){me.el.addCls(me.pinnedCls);}
me.resizeTracker=new Ext.resizer.ResizeTracker({disabled:me.disabled,target:me.target,constrainTo:me.constrainTo,overCls:me.overCls,throttle:me.throttle,originalTarget:me.originalTarget,delegate:'.'+me.handleCls,dynamic:me.dynamic,preserveRatio:me.preserveRatio,heightIncrement:me.heightIncrement,widthIncrement:me.widthIncrement,minHeight:me.minHeight,maxHeight:me.maxHeight,minWidth:me.minWidth,maxWidth:me.maxWidth});me.resizeTracker.on({mousedown:me.onBeforeResize,drag:me.onResize,dragend:me.onResizeEnd,scope:me});if(me.handles=='all'){me.handles='n s e w ne nw se sw';}
handles=me.handles=me.handles.split(me.delimiterRe);possibles=me.possiblePositions;len=handles.length;handleCls=me.handleCls+' '+me.handleCls+'-{0}';if(me.target.isComponent){targetBaseCls=me.target.baseCls
handleCls+=' '+targetBaseCls+'-handle '+targetBaseCls+'-handle-{0}';if(Ext.supports.CSS3BorderRadius){handleCls+=' '+targetBaseCls+'-handle-{0}-br';}}
eastWestStyle=Ext.isIE6?' style="height:'+me.el.getHeight()+'px"':'';for(;i<len;i++){if(handles[i]&&possibles[handles[i]]){pos=possibles[handles[i]];if(pos==='east'||pos==='west'){style=eastWestStyle;}else{style='';}
handleEls.push('<div id="',me.el.id,'-',pos,'-handle"',' class="',Ext.String.format(handleCls,pos),' ',unselectableCls,'"',' unselectable="on"',style,'></div>');}}
Ext.DomHelper.append(me.el,handleEls.join(''));for(i=0;i<len;i++){if(handles[i]&&possibles[handles[i]]){pos=possibles[handles[i]];me[pos]=me.el.getById(me.el.id+'-'+pos+'-handle');me[pos].region=pos;if(me.transparent){me[pos].setOpacity(0);}}}
if(Ext.isNumber(me.width)){me.width=Ext.Number.constrain(me.width,me.minWidth,me.maxWidth);}
if(Ext.isNumber(me.height)){me.height=Ext.Number.constrain(me.height,me.minHeight,me.maxHeight);}
if(me.width!==null||me.height!==null){if(me.originalTarget){me.originalTarget.setWidth(me.width);me.originalTarget.setHeight(me.height);}
me.resizeTo(me.width,me.height);}
me.forceHandlesHeight();},disable:function(){this.resizeTracker.disable();},enable:function(){this.resizeTracker.enable();},onBeforeResize:function(tracker,e){var box=this.el.getBox();return this.fireEvent('beforeresize',this,box.width,box.height,e);},onResize:function(tracker,e){var me=this,box=me.el.getBox();me.forceHandlesHeight();return me.fireEvent('resizedrag',me,box.width,box.height,e);},onResizeEnd:function(tracker,e){var me=this,box=me.el.getBox();me.forceHandlesHeight();return me.fireEvent('resize',me,box.width,box.height,e);},resizeTo:function(width,height){var me=this;me.target.setSize(width,height);me.fireEvent('resize',me,width,height,null);},getEl:function(){return this.el;},getTarget:function(){return this.target;},destroy:function(){var me=this,i,handles=me.handles,len=handles.length,positions=me.possiblePositions,handle;me.resizeTracker.destroy();for(i=0;i<len;i++){if(handle=me[positions[handles[i]]]){handle.remove();}}},forceHandlesHeight:function(){var me=this,handle;if(Ext.isIE6){handle=me.east;if(handle){handle.setHeight(me.el.getHeight());}
handle=me.west;if(handle){handle.setHeight(me.el.getHeight());}
me.el.repaint();}}});Ext.define('Ext.fx.target.Target',{isAnimTarget:true,constructor:function(target){this.target=target;this.id=this.getId();},getId:function(){return this.target.id;}});Ext.define('Ext.grid.locking.View',{alternateClassName:'Ext.grid.LockingView',mixins:{observable:'Ext.util.Observable'},isLockingView:true,eventRelayRe:/^(beforeitem|beforecontainer|item|container|cell|refresh)/,constructor:function(config){var me=this,eventNames=[],eventRe=me.eventRelayRe,locked=config.locked.getView(),normal=config.normal.getView(),events,event;Ext.apply(me,{lockedView:locked,normalView:normal,lockedGrid:config.locked,normalGrid:config.normal,panel:config.panel});me.mixins.observable.constructor.call(me,config);events=locked.events;for(event in events){if(events.hasOwnProperty(event)&&eventRe.test(event)){eventNames.push(event);}}
me.relayEvents(locked,eventNames);me.relayEvents(normal,eventNames);normal.on({scope:me,itemmouseleave:me.onItemMouseLeave,itemmouseenter:me.onItemMouseEnter});locked.on({scope:me,itemmouseleave:me.onItemMouseLeave,itemmouseenter:me.onItemMouseEnter});me.panel.on({render:me.onPanelRender,scope:me});},onPanelRender:function(){var me=this,mask=me.loadMask,cfg={target:me.panel,msg:me.loadingText,msgCls:me.loadingCls,useMsg:me.loadingUseMsg,store:me.panel.store};me.el=me.panel.body;me.fireEvent('render',me);if(mask){if(Ext.isObject(mask)){cfg=Ext.apply(cfg,mask);}
me.loadMask=new Ext.LoadMask(cfg);}},getGridColumns:function(){var cols=this.lockedGrid.headerCt.getVisibleGridColumns();return cols.concat(this.normalGrid.headerCt.getVisibleGridColumns());},getEl:function(column){return this.getViewForColumn(column).getEl();},getViewForColumn:function(column){var view=this.lockedView,inLocked;view.headerCt.cascade(function(col){if(col===column){inLocked=true;return false;}});return inLocked?view:this.normalView;},onItemMouseEnter:function(view,record){var me=this,locked=me.lockedView,other=me.normalView,item;if(view.trackOver){if(view!==locked){other=locked;}
item=other.getNode(record,false);other.highlightItem(item);}},onItemMouseLeave:function(view,record){var me=this,locked=me.lockedView,other=me.normalView;if(view.trackOver){if(view!==locked){other=locked;}
other.clearHighlight();}},relayFn:function(name,args){args=args||[];var view=this.lockedView;view[name].apply(view,args);view=this.normalView;view[name].apply(view,args);},getSelectionModel:function(){return this.panel.getSelectionModel();},getStore:function(){return this.panel.store;},getNode:function(nodeInfo,dataRow){return this.normalView.getNode(nodeInfo,dataRow);},getCell:function(record,column){var view=this.getViewForColumn(column),row=view.getNode(record,true);return Ext.fly(row).down(column.getCellSelector());},indexOf:function(record){var result=this.lockedView.indexOf(record);if(!result){result=this.normalView.indexOf(record);}
return result;},focus:function(){var p=this.getSelectionModel().getCurrentPosition(),v=p?p.view:this.normalView;v.focus();},focusRow:function(row){this.normalView.focusRow(row);},focusCell:function(position){position.view.focusCell(position);},isVisible:function(deep){return this.panel.isVisible(deep);},getRecord:function(node){var result=this.lockedView.getRecord(node);if(!result){result=this.normalView.getRecord(node);}
return result;},scrollBy:function(){var normal=this.normalView;normal.scrollBy.apply(normal,arguments);},addElListener:function(eventName,fn,scope){this.relayFn('addElListener',arguments);},refreshNode:function(){this.relayFn('refreshNode',arguments);},refresh:function(){this.relayFn('refresh',arguments);},bindStore:function(){this.relayFn('bindStore',arguments);},addRowCls:function(){this.relayFn('addRowCls',arguments);},removeRowCls:function(){this.relayFn('removeRowCls',arguments);},destroy:function(){var me=this,mask=me.loadMask;me.clearListeners();if(mask&&mask.bindStore){mask.bindStore(null);}}});Ext.define('Ext.util.Renderable',{requires:['Ext.dom.Element'],frameCls:Ext.baseCSSPrefix+'frame',frameIdRegex:/[\-]frame\d+[TMB][LCR]$/,frameElNames:['TL','TC','TR','ML','MC','MR','BL','BC','BR'],frameTpl:['{%this.renderDockedItems(out,values,0);%}','<tpl if="top">','<tpl if="left"><div id="{fgid}TL" class="{frameCls}-tl {baseCls}-tl {baseCls}-{ui}-tl<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tl</tpl>{frameElCls}" role="presentation"></tpl>','<tpl if="right"><div id="{fgid}TR" class="{frameCls}-tr {baseCls}-tr {baseCls}-{ui}-tr<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tr</tpl>{frameElCls}" role="presentation"></tpl>','<div id="{fgid}TC" class="{frameCls}-tc {baseCls}-tc {baseCls}-{ui}-tc<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tc</tpl>{frameElCls}" role="presentation"></div>','<tpl if="right"></div></tpl>','<tpl if="left"></div></tpl>','</tpl>','<tpl if="left"><div id="{fgid}ML" class="{frameCls}-ml {baseCls}-ml {baseCls}-{ui}-ml<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-ml</tpl>{frameElCls}" role="presentation"></tpl>','<tpl if="right"><div id="{fgid}MR" class="{frameCls}-mr {baseCls}-mr {baseCls}-{ui}-mr<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-mr</tpl>{frameElCls}" role="presentation"></tpl>','<div id="{fgid}MC" class="{frameCls}-mc {baseCls}-mc {baseCls}-{ui}-mc<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-mc</tpl>{frameElCls}" role="presentation">','{%this.applyRenderTpl(out, values)%}','</div>','<tpl if="right"></div></tpl>','<tpl if="left"></div></tpl>','<tpl if="bottom">','<tpl if="left"><div id="{fgid}BL" class="{frameCls}-bl {baseCls}-bl {baseCls}-{ui}-bl<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-bl</tpl>{frameElCls}" role="presentation"></tpl>','<tpl if="right"><div id="{fgid}BR" class="{frameCls}-br {baseCls}-br {baseCls}-{ui}-br<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-br</tpl>{frameElCls}" role="presentation"></tpl>','<div id="{fgid}BC" class="{frameCls}-bc {baseCls}-bc {baseCls}-{ui}-bc<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-bc</tpl>{frameElCls}" role="presentation"></div>','<tpl if="right"></div></tpl>','<tpl if="left"></div></tpl>','</tpl>','{%this.renderDockedItems(out,values,1);%}'],frameTableTpl:['{%this.renderDockedItems(out,values,0);%}','<table class="',Ext.plainTableCls,'" cellpadding="0"><tbody>','<tpl if="top">','<tr>','<tpl if="left"><td id="{fgid}TL" class="{frameCls}-tl {baseCls}-tl {baseCls}-{ui}-tl<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tl</tpl>{frameElCls}" role="presentation"></td></tpl>','<td id="{fgid}TC" class="{frameCls}-tc {baseCls}-tc {baseCls}-{ui}-tc<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tc</tpl>{frameElCls}" role="presentation"></td>','<tpl if="right"><td id="{fgid}TR" class="{frameCls}-tr {baseCls}-tr {baseCls}-{ui}-tr<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tr</tpl>{frameElCls}" role="presentation"></td></tpl>','</tr>','</tpl>','<tr>','<tpl if="left"><td id="{fgid}ML" class="{frameCls}-ml {baseCls}-ml {baseCls}-{ui}-ml<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-ml</tpl>{frameElCls}" role="presentation"></td></tpl>','<td id="{fgid}MC" class="{frameCls}-mc {baseCls}-mc {baseCls}-{ui}-mc<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-mc</tpl>{frameElCls}" role="presentation">','{%this.applyRenderTpl(out, values)%}','</td>','<tpl if="right"><td id="{fgid}MR" class="{frameCls}-mr {baseCls}-mr {baseCls}-{ui}-mr<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-mr</tpl>{frameElCls}" role="presentation"></td></tpl>','</tr>','<tpl if="bottom">','<tr>','<tpl if="left"><td id="{fgid}BL" class="{frameCls}-bl {baseCls}-bl {baseCls}-{ui}-bl<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-bl</tpl>{frameElCls}" role="presentation"></td></tpl>','<td id="{fgid}BC" class="{frameCls}-bc {baseCls}-bc {baseCls}-{ui}-bc<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-bc</tpl>{frameElCls}" role="presentation"></td>','<tpl if="right"><td id="{fgid}BR" class="{frameCls}-br {baseCls}-br {baseCls}-{ui}-br<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-br</tpl>{frameElCls}" role="presentation"></td></tpl>','</tr>','</tpl>','</tbody></table>','{%this.renderDockedItems(out,values,1);%}'],afterRender:function(){var me=this,data={},protoEl=me.protoEl,target=me.el,item,pre,hide,contentEl;me.finishRenderChildren();if(me.contentEl){pre=Ext.baseCSSPrefix;hide=pre+'hide-';contentEl=Ext.get(me.contentEl);contentEl.removeCls([pre+'hidden',hide+'display',hide+'offsets',hide+'nosize']);me.getContentTarget().appendChild(contentEl.dom);}
protoEl.writeTo(data);item=data.removed;if(item){target.removeCls(item);}
item=data.cls;if(item.length){target.addCls(item);}
item=data.style;if(data.style){target.setStyle(item);}
me.protoEl=null;if(!me.ownerCt){me.updateLayout();}},afterFirstLayout:function(width,height){var me=this,x=me.x,y=me.y,hasX,hasY,pos,xy;if(!me.ownerLayout){hasX=Ext.isDefined(x);hasY=Ext.isDefined(y);}
if(me.floating&&(!hasX||!hasY)){if(me.floatParent){pos=me.floatParent.getTargetEl().getViewRegion();xy=me.el.getAlignToXY(me.floatParent.getTargetEl(),'c-c');pos.x=xy[0]-pos.x;pos.y=xy[1]-pos.y;}else{xy=me.el.getAlignToXY(me.container,'c-c');pos=me.container.translateXY(xy[0],xy[1]);}
x=hasX?x:pos.x;y=hasY?y:pos.y;hasX=hasY=true;}
if(hasX||hasY){me.setPosition(x,y);}
me.onBoxReady(width,height);},applyRenderSelectors:function(){var me=this,selectors=me.renderSelectors,el=me.el,dom=el.dom,selector;me.applyChildEls(el);if(selectors){for(selector in selectors){if(selectors.hasOwnProperty(selector)&&selectors[selector]){me[selector]=Ext.get(Ext.DomQuery.selectNode(selectors[selector],dom));}}}},beforeRender:function(){var me=this,target=me.getTargetEl(),overflowEl=me.getOverflowEl(),layout=me.getComponentLayout(),overflowStyle=me.getOverflowStyle();me.frame=me.frame||me.alwaysFramed;if(!layout.initialized){layout.initLayout();}
if(overflowEl){overflowEl.setStyle(overflowStyle);me.overflowStyleSet=true;}
me.setUI(me.ui);if(me.disabled){me.disable(true);}},doApplyRenderTpl:function(out,values){var me=values.$comp,tpl;if(!me.rendered){tpl=me.initRenderTpl();tpl.applyOut(values.renderData,out);}},doAutoRender:function(){var me=this;if(!me.rendered){if(me.floating){me.render(document.body);}else{me.render(Ext.isBoolean(me.autoRender)?Ext.getBody():me.autoRender);}}},doRenderContent:function(out,renderData){var me=renderData.$comp;if(me.html){Ext.DomHelper.generateMarkup(me.html,out);delete me.html;}
if(me.tpl){if(!me.tpl.isTemplate){me.tpl=new Ext.XTemplate(me.tpl);}
if(me.data){me.tpl.applyOut(me.data,out);delete me.data;}}},doRenderFramingDockedItems:function(out,renderData,after){var me=renderData.$comp;if(!me.rendered&&me.doRenderDockedItems){renderData.renderData.$skipDockedItems=true;me.doRenderDockedItems.call(this,out,renderData,after);}},finishRender:function(containerIdx){var me=this,tpl,data,el;if(!me.el||me.$pid){if(me.container){el=me.container.getById(me.id,true);}else{el=Ext.getDom(me.id);}
if(!me.el){me.wrapPrimaryEl(el);}else{delete me.$pid;if(!me.el.dom){me.wrapPrimaryEl(me.el);}
el.parentNode.insertBefore(me.el.dom,el);Ext.removeNode(el);}}else if(!me.rendering){tpl=me.initRenderTpl();if(tpl){data=me.initRenderData();tpl.insertFirst(me.getTargetEl(),data);}}
if(!me.container){me.container=Ext.get(me.el.dom.parentNode);}
if(me.ctCls){me.container.addCls(me.ctCls);}
me.onRender(me.container,containerIdx);if(!me.overflowStyleSet){me.getOverflowEl().setStyle(me.getOverflowStyle());}
me.el.setVisibilityMode(Ext.Element[me.hideMode.toUpperCase()]);if(me.overCls){me.el.hover(me.addOverCls,me.removeOverCls,me);}
if(me.hasListeners.render){me.fireEvent('render',me);}
me.afterRender();if(me.hasListeners.afterrender){me.fireEvent('afterrender',me);}
me.initEvents();if(me.hidden){me.el.hide();}},finishRenderChildren:function(){var layout=this.getComponentLayout();layout.finishRender();},getElConfig:function(){var me=this,autoEl=me.autoEl,frameInfo=me.getFrameInfo(),config={tag:'div',tpl:frameInfo?me.initFramingTpl(frameInfo.table):me.initRenderTpl()},protoEl=me.protoEl,i,frameElNames,len,suffix,frameGenId,frameData;me.initStyles(protoEl);protoEl.writeTo(config);protoEl.flush();if(Ext.isString(autoEl)){config.tag=autoEl;}else{Ext.apply(config,autoEl);}
config.id=me.id;if(config.tpl){if(frameInfo){frameElNames=me.frameElNames;len=frameElNames.length;config.tplData=frameData=me.getFrameRenderData();frameData.renderData=me.initRenderData();frameGenId=frameData.fgid;for(i=0;i<len;i++){suffix=frameElNames[i];me.addChildEls({name:'frame'+suffix,id:frameGenId+suffix});}
me.addChildEls({name:'frameBody',id:frameGenId+'MC'});}else{config.tplData=me.initRenderData();}}
return config;},initFramingTpl:function(table){var tpl=this.getFrameTpl(table);if(tpl&&!tpl.applyRenderTpl){this.setupFramingTpl(tpl);}
return tpl;},setupFramingTpl:function(frameTpl){frameTpl.applyRenderTpl=this.doApplyRenderTpl;frameTpl.renderDockedItems=this.doRenderFramingDockedItems;},getInsertPosition:function(position){if(position!==undefined){if(Ext.isNumber(position)){position=this.container.dom.childNodes[position];}
else{position=Ext.getDom(position);}}
return position;},getRenderTree:function(){var me=this;if(!me.hasListeners.beforerender||me.fireEvent('beforerender',me)!==false){me.beforeRender();me.rendering=true;if(me.el){return{tag:'div',id:(me.$pid=Ext.id())};}
return me.getElConfig();}
return null;},initContainer:function(container){var me=this;if(!container&&me.el){container=me.el.dom.parentNode;me.allowDomMove=false;}
me.container=container.dom?container:Ext.get(container);return me.container;},initRenderData:function(){var me=this;return Ext.apply({$comp:me,id:me.id,ui:me.ui,uiCls:me.uiCls,baseCls:me.baseCls,componentCls:me.componentCls,frame:me.frame,childElCls:''},me.renderData);},initRenderTpl:function(){var tpl=this.getTpl('renderTpl');if(tpl&&!tpl.renderContent){this.setupRenderTpl(tpl);}
return tpl;},onRender:function(parentNode,containerIdx){var me=this,x=me.x,y=me.y,lastBox=null,width,height,el=me.el;me.applyRenderSelectors();me.rendering=null;me.rendered=true;if(x!=null){lastBox={x:x};}
if(y!=null){(lastBox=lastBox||{}).y=y;}
if(!me.getFrameInfo()&&Ext.isBorderBox){width=me.width;height=me.height;if(typeof width==='number'){lastBox=lastBox||{};lastBox.width=width;}
if(typeof height==='number'){lastBox=lastBox||{};lastBox.height=height;}}
me.lastBox=el.lastBox=lastBox;},render:function(container,position){var me=this,el=me.el&&(me.el=Ext.get(me.el)),vetoed,tree,nextSibling;Ext.suspendLayouts();container=me.initContainer(container);nextSibling=me.getInsertPosition(position);if(!el){tree=me.getRenderTree();if(me.ownerLayout&&me.ownerLayout.transformItemRenderTree){tree=me.ownerLayout.transformItemRenderTree(tree);}
if(tree){if(nextSibling){el=Ext.DomHelper.insertBefore(nextSibling,tree);}else{el=Ext.DomHelper.append(container,tree);}
me.wrapPrimaryEl(el);}}else{if(!me.hasListeners.beforerender||me.fireEvent('beforerender',me)!==false){me.beforeRender();me.initStyles(el);if(me.allowDomMove!==false){if(nextSibling){container.dom.insertBefore(el.dom,nextSibling);}else{container.dom.appendChild(el.dom);}}}else{vetoed=true;}}
if(el&&!vetoed){me.finishRender(position);}
Ext.resumeLayouts(!me.hidden&&!container.isDetachedBody);},ensureAttachedToBody:function(runLayout){var comp=this,body;while(comp.ownerCt){comp=comp.ownerCt;}
if(comp.container.isDetachedBody){comp.container=body=Ext.getBody();body.appendChild(comp.el.dom);if(runLayout){comp.updateLayout();}
if(typeof comp.x=='number'||typeof comp.y=='number'){comp.setPosition(comp.x,comp.y);}}},setupRenderTpl:function(renderTpl){renderTpl.renderBody=renderTpl.renderContent=this.doRenderContent;},wrapPrimaryEl:function(dom){this.el=Ext.get(dom,true);},initFrame:function(){if(Ext.supports.CSS3BorderRadius||!this.frame){return;}
var me=this,frameInfo=me.getFrameInfo(),frameTpl,frameGenId,frameElNames=me.frameElNames,len=frameElNames.length,i,frameData,suffix;if(frameInfo){frameTpl=me.getFrameTpl(frameInfo.table);frameData=me.getFrameRenderData();frameGenId=frameData.fgid;frameTpl.insertFirst(me.el,frameData);me.frameBody=me.el.down('.'+me.frameCls+'-mc');me.removeChildEls(function(c){return c.id&&me.frameIdRegex.test(c.id);});for(i=0;i<len;i++){suffix=frameElNames[i];me['frame'+suffix]=me.el.getById(frameGenId+suffix);}}},getFrameRenderData:function(){var me=this,frameInfo=me.frameSize,frameGenId=(me.frameGenId||0)+1;me.frameGenId=frameGenId;return{$comp:me,fgid:me.id+'-frame'+frameGenId,ui:me.ui,uiCls:me.uiCls,frameCls:me.frameCls,baseCls:me.baseCls,top:!!frameInfo.top,left:!!frameInfo.left,right:!!frameInfo.right,bottom:!!frameInfo.bottom,frameElCls:''};},updateFrame:function(){if(Ext.supports.CSS3BorderRadius||!this.frame){return;}
var me=this,wasTable=me.frameSize&&me.frameSize.table,oldFrameTL=me.frameTL,oldFrameBL=me.frameBL,oldFrameML=me.frameML,oldFrameMC=me.frameMC,newMCClassName;me.initFrame();if(oldFrameMC){if(me.frame){newMCClassName=me.frameMC.dom.className;oldFrameMC.insertAfter(me.frameMC);me.frameMC.remove();me.frameBody=me.frameMC=oldFrameMC;oldFrameMC.dom.className=newMCClassName;if(wasTable){me.el.query('> table')[1].remove();}
else{if(oldFrameTL){oldFrameTL.remove();}
if(oldFrameBL){oldFrameBL.remove();}
if(oldFrameML){oldFrameML.remove();}}}}
else if(me.frame){me.applyRenderSelectors();}},getFrameInfo:function(){if(Ext.supports.CSS3BorderRadius||!this.frame){return false;}
var me=this,frameInfoCache=me.frameInfoCache,cls=me.getFramingInfoCls()+'-frameInfo',frameInfo=frameInfoCache[cls],max=Math.max,styleEl,match,info,frameTop,frameRight,frameBottom,frameLeft,borderWidthT,borderWidthR,borderWidthB,borderWidthL,paddingT,paddingR,paddingB,paddingL,borderRadiusTL,borderRadiusTR,borderRadiusBR,borderRadiusBL;if(frameInfo==null){styleEl=Ext.fly(me.getStyleProxy(cls),'frame-style-el');info=styleEl.getStyle('font-family');if(info){info=info.split('-');borderRadiusTL=parseInt(info[1],10);borderRadiusTR=parseInt(info[2],10);borderRadiusBR=parseInt(info[3],10);borderRadiusBL=parseInt(info[4],10);borderWidthT=parseInt(info[5],10);borderWidthR=parseInt(info[6],10);borderWidthB=parseInt(info[7],10);borderWidthL=parseInt(info[8],10);paddingT=parseInt(info[9],10);paddingR=parseInt(info[10],10);paddingB=parseInt(info[11],10);paddingL=parseInt(info[12],10);frameTop=max(borderWidthT,max(borderRadiusTL,borderRadiusTR));frameRight=max(borderWidthR,max(borderRadiusTR,borderRadiusBR));frameBottom=max(borderWidthB,max(borderRadiusBL,borderRadiusBR));frameLeft=max(borderWidthL,max(borderRadiusTL,borderRadiusBL));frameInfo={table:info[0].charAt(0)==='t',vertical:info[0].charAt(1)==='v',top:frameTop,right:frameRight,bottom:frameBottom,left:frameLeft,width:frameLeft+frameRight,height:frameTop+frameBottom,maxWidth:max(frameTop,frameRight,frameBottom,frameLeft),border:{top:borderWidthT,right:borderWidthR,bottom:borderWidthB,left:borderWidthL,width:borderWidthL+borderWidthR,height:borderWidthT+borderWidthB},padding:{top:paddingT,right:paddingR,bottom:paddingB,left:paddingL,width:paddingL+paddingR,height:paddingT+paddingB},radius:{tl:borderRadiusTL,tr:borderRadiusTR,br:borderRadiusBR,bl:borderRadiusBL}};}else{frameInfo=false;}
if(me.frame===true&&!frameInfo){Ext.log.error('You have set frame: true explicity on this component ('+me.getXType()+') and it '+'does not have any framing defined in the CSS template. In this case IE cannot figure out '+'what sizes to use and thus framing on this component will be disabled.');}
frameInfoCache[cls]=frameInfo;}
me.frame=!!frameInfo;me.frameSize=frameInfo;return frameInfo;},getFramingInfoCls:function(){return this.baseCls+'-'+this.ui;},getStyleProxy:function(cls){var result=this.styleProxyEl||(Ext.AbstractComponent.prototype.styleProxyEl=Ext.getBody().createChild({style:{position:'absolute',top:'-10000px'}},null,true));result.className=cls;return result;},getFrameTpl:function(table){return this.getTpl(table?'frameTableTpl':'frameTpl');},frameInfoCache:{}});Ext.define('Ext.util.ElementContainer',{childEls:[],constructor:function(){var me=this,childEls;if(me.hasOwnProperty('childEls')){childEls=me.childEls;delete me.childEls;me.addChildEls.apply(me,childEls);}},destroy:function(){var me=this,childEls=me.getChildEls(),child,childName,i,k;for(i=childEls.length;i--;){childName=childEls[i];if(typeof childName!='string'){childName=childName.name;}
child=me[childName];if(child){me[childName]=null;child.remove();}}},addChildEls:function(){var me=this,args=arguments;if(me.hasOwnProperty('childEls')){me.childEls.push.apply(me.childEls,args);}else{me.childEls=me.getChildEls().concat(Array.prototype.slice.call(args));}
me.prune(me.childEls,false);},applyChildEls:function(el,id){var me=this,childEls=me.getChildEls(),baseId,childName,i,selector,value;baseId=(id||me.id)+'-';for(i=childEls.length;i--;){childName=childEls[i];if(typeof childName=='string'){value=el.getById(baseId+childName);}else{if((selector=childName.select)){value=Ext.select(selector,true,el.dom);}else if((selector=childName.selectNode)){value=Ext.get(Ext.DomQuery.selectNode(selector,el.dom));}else{value=el.getById(childName.id||(baseId+childName.itemId));}
childName=childName.name;}
me[childName]=value;}},getChildEls:function(){var me=this,self;if(me.hasOwnProperty('childEls')){return me.childEls;}
self=me.self;return self.$childEls||me.getClassChildEls(self);},getClassChildEls:function(cls){var me=this,result=cls.$childEls,childEls,i,length,forked,mixin,mixins,name,parts,proto,supr,superMixins;if(!result){supr=cls.superclass;if(supr){supr=supr.self;parts=[supr.$childEls||me.getClassChildEls(supr)];superMixins=supr.prototype.mixins||{};}else{parts=[];superMixins={};}
proto=cls.prototype;mixins=proto.mixins;for(name in mixins){if(mixins.hasOwnProperty(name)&&!superMixins.hasOwnProperty(name)){mixin=mixins[name].self;parts.push(mixin.$childEls||me.getClassChildEls(mixin));}}
parts.push(proto.hasOwnProperty('childEls')&&proto.childEls);for(i=0,length=parts.length;i<length;++i){childEls=parts[i];if(childEls&&childEls.length){if(!result){result=childEls;}else{if(!forked){forked=true;result=result.slice(0);}
result.push.apply(result,childEls);}}}
cls.$childEls=result=(result?me.prune(result,!forked):[]);}
return result;},prune:function(childEls,shared){var index=childEls.length,map={},name;while(index--){name=childEls[index];if(typeof name!='string'){name=name.name;}
if(!map[name]){map[name]=1;}else{if(shared){shared=false;childEls=childEls.slice(0);}
Ext.Array.erase(childEls,index,1);}}
return childEls;},removeChildEls:function(testFn){var me=this,old=me.getChildEls(),keepers=(me.childEls=[]),n,i,cel;for(i=0,n=old.length;i<n;++i){cel=old[i];if(!testFn(cel)){keepers.push(cel);}}}});Ext.define('Ext.data.Group',{extend:'Ext.util.Observable',key:undefined,dirty:true,constructor:function(){this.callParent(arguments);this.records=[];},contains:function(record){return Ext.Array.indexOf(this.records,record)!==-1;},add:function(records){Ext.Array.push(this.records,records);this.dirty=true;},remove:function(records){if(!Ext.isArray(records)){records=[records];}
var len=records.length,i;for(i=0;i<len;++i){Ext.Array.remove(this.records,records[i]);}
this.dirty=true;},isDirty:function(){return this.dirty;},hasAggregate:function(){return!!this.aggregate;},setDirty:function(){this.dirty=true;},commit:function(){this.dirty=false;},isCollapsed:function(){return this.collapsed;},getAggregateRecord:function(forceNew){var me=this,Model;if(forceNew===true||me.dirty||!me.aggregate){Model=me.store.model;me.aggregate=new Model();me.aggregate.isSummary=true;}
return me.aggregate;}});Ext.define('MP.form.field.plugin.ClearButton',{alias:'plugin.clearbutton',hideClearButtonWhenEmpty:true,hideClearButtonWhenMouseOut:true,animateClearButton:true,clearOnEscape:true,clearButtonCls:'mp-filterbar-clearbutton',textField:null,animateWithCss3:false,constructor:function(cfg){Ext.apply(this,cfg);this.callParent(arguments);},init:function(textField){this.textField=textField;if(!textField.rendered){textField.on('afterrender',this.handleAfterRender,this);}
else{this.handleAfterRender();}},handleAfterRender:function(textField){this.isTextArea=(this.textField.inputEl.dom.type.toLowerCase()=='textarea');this.createClearButtonEl();this.addListeners();this.repositionClearButton();this.updateClearButtonVisibility();this.addEscListener();},createClearButtonEl:function(){this.clearButtonEl=this.textField.bodyEl.createChild({tag:'div',cls:this.clearButtonCls+'-icon'});if(this.animateClearButton){this.animateWithCss3=this.supportsCssTransition(this.clearButtonEl);}
if(this.animateWithCss3){this.clearButtonEl.addCls(this.clearButtonCls+'-off');}
else{this.clearButtonEl.setStyle('visibility','hidden');}},supportsCssTransition:function(el){var styles=['transitionProperty','WebkitTransitionProperty','MozTransitionProperty','OTransitionProperty','msTransitionProperty','KhtmlTransitionProperty'];var style=el.dom.style;for(var i=0,length=styles.length;i<length;++i){if(style[styles[i]]!=='undefined'){return true;}}
return false;},addEscListener:function(){if(!this.clearOnEscape){return;}
this.textField.inputEl.on('keydown',function(e){if(e.getKey()==Ext.EventObject.ESC){if(this.textField.isExpanded){return;}
if(this.textField.clearValue){Ext.Function.defer(this.textField.clearValue,1,this.textField);}else{Ext.Function.defer(this.textField.setValue,1,this.textField,['']);}
e.stopEvent();}},this);},addListeners:function(){var textField=this.textField;var bodyEl=textField.bodyEl;bodyEl.on('mouseover',this.handleMouseOverInputField,this);bodyEl.on('mouseout',this.handleMouseOutOfInputField,this);textField.on('destroy',this.handleDestroy,this);textField.on('resize',this.repositionClearButton,this);textField.on('change',function(){this.repositionClearButton();this.updateClearButtonVisibility();},this);var clearButtonEl=this.clearButtonEl;clearButtonEl.on('mouseover',this.handleMouseOverClearButton,this);clearButtonEl.on('mouseout',this.handleMouseOutOfClearButton,this);clearButtonEl.on('mousedown',this.handleMouseDownOnClearButton,this);clearButtonEl.on('mouseup',this.handleMouseUpOnClearButton,this);clearButtonEl.on('click',this.handleMouseClickOnClearButton,this);},handleDestroy:function(){this.clearButtonEl.destroy();},handleMouseClickOnClearButton:function(event,htmlElement,object){if(!this.isLeftButton(event)){return;}
if(this.textField.clearValue){this.textField.clearValue();}else{this.textField.setValue('');}
this.textField.focus();},handleMouseOverInputField:function(event,htmlElement,object){this.clearButtonEl.addCls(this.clearButtonCls+'-mouse-over-input');if(event.getRelatedTarget()==this.clearButtonEl.dom){this.clearButtonEl.removeCls(this.clearButtonCls+'-mouse-over-button');this.clearButtonEl.removeCls(this.clearButtonCls+'-mouse-down');}
this.updateClearButtonVisibility();},handleMouseOutOfInputField:function(event,htmlElement,object){this.clearButtonEl.removeCls(this.clearButtonCls+'-mouse-over-input');if(event.getRelatedTarget()==this.clearButtonEl.dom){this.clearButtonEl.addCls(this.clearButtonCls+'-mouse-over-button');}
this.updateClearButtonVisibility();},handleMouseOverClearButton:function(event,htmlElement,object){event.stopEvent();if(this.textField.bodyEl.contains(event.getRelatedTarget())){return;}
this.clearButtonEl.addCls(this.clearButtonCls+'-mouse-over-button');this.updateClearButtonVisibility();},handleMouseOutOfClearButton:function(event,htmlElement,object){event.stopEvent();if(this.textField.bodyEl.contains(event.getRelatedTarget())){return;}
this.clearButtonEl.removeCls(this.clearButtonCls+'-mouse-over-button');this.clearButtonEl.removeCls(this.clearButtonCls+'-mouse-down');this.updateClearButtonVisibility();},handleMouseDownOnClearButton:function(event,htmlElement,object){if(!this.isLeftButton(event)){return;}
this.clearButtonEl.addCls(this.clearButtonCls+'-mouse-down');},handleMouseUpOnClearButton:function(event,htmlElement,object){if(!this.isLeftButton(event)){return;}
this.clearButtonEl.removeCls(this.clearButtonCls+'-mouse-down');},repositionClearButton:function(){var clearButtonEl=this.clearButtonEl;if(!clearButtonEl){return;}
var right=0;if(this.fieldHasScrollBar()){right+=Ext.getScrollBarWidth();}
if(this.textField.triggerWrap){right+=this.textField.getTriggerWidth();}
clearButtonEl.alignTo(this.textField.bodyEl,'tr-tr',[-1*(right+3),5]);},calculateClearButtonPosition:function(textField){var positions=textField.inputEl.getBox(true,true);var top=positions.y;var right=positions.x;if(this.fieldHasScrollBar()){right+=Ext.getScrollBarWidth();}
if(this.textField.triggerWrap){right+=this.textField.getTriggerWidth();if(!this.textField.getTriggerWidth()){Ext.Function.defer(this.repositionClearButton,100,this);}}
if(textField.inputEl.hasCls('ux-icon-combo-input')){right-=20;}
return{right:right,top:top};},fieldHasScrollBar:function(){if(!this.isTextArea){return false;}
var inputEl=this.textField.inputEl;var overflowY=inputEl.getStyle('overflow-y');if(overflowY=='hidden'||overflowY=='visible'){return false;}
if(overflowY=='scroll'){return true;}
if(inputEl.dom.scrollHeight<=inputEl.dom.clientHeight){return false;}
return true;},isButtonCurrentlyVisible:function(){if(this.animateClearButton&&this.animateWithCss3){return this.clearButtonEl.hasCls(this.clearButtonCls+'-on');}
var cachedVisible=Ext.core.Element.data(this.clearButtonEl.dom,'isVisible');if(typeof(cachedVisible)=='boolean'){return cachedVisible;}
return this.clearButtonEl.isVisible();},shouldButtonBeVisible:function(){if(this.hideClearButtonWhenEmpty&&Ext.isEmpty(this.textField.getValue())){return false;}
var clearButtonEl=this.clearButtonEl;if(this.hideClearButtonWhenMouseOut&&!clearButtonEl.hasCls(this.clearButtonCls+'-mouse-over-button')&&!clearButtonEl.hasCls(this.clearButtonCls+'-mouse-over-input')){return false;}
return true;},updateClearButtonVisibility:function(){var oldVisible=this.isButtonCurrentlyVisible();var newVisible=this.shouldButtonBeVisible();var clearButtonEl=this.clearButtonEl;if(oldVisible!=newVisible){if(this.animateClearButton&&this.animateWithCss3){this.clearButtonEl.removeCls(this.clearButtonCls+(oldVisible?'-on':'-off'));clearButtonEl.addCls(this.clearButtonCls+(newVisible?'-on':'-off'));}
else{clearButtonEl.stopAnimation();clearButtonEl.setVisible(newVisible,this.animateClearButton);}
clearButtonEl.setStyle('background-color',this.textField.inputEl.getStyle('background-color'));if(!(this.isTextArea&&Ext.isGecko)&&!Ext.isIE){var deltaPaddingRight=clearButtonEl.getWidth()-this.clearButtonEl.getMargin('l');var currentPaddingRight=this.textField.inputEl.getPadding('r');var factor=(newVisible?+1:-1);this.textField.inputEl.dom.style.paddingRight=(currentPaddingRight+factor*deltaPaddingRight)+'px';}}},isLeftButton:function(event){return event.button===0;}});Ext.define('Ext.grid.ColumnManager',{alternateClassName:['Ext.grid.ColumnModel'],columns:null,constructor:function(headerCt,secondHeaderCt){this.headerCt=headerCt;if(secondHeaderCt){this.secondHeaderCt=secondHeaderCt;}},getColumns:function(){if(!this.columns){this.cacheColumns();}
return this.columns;},getHeaderIndex:function(header){if(header.isGroupHeader){header=header.down(':not([isGroupHeader])');}
return Ext.Array.indexOf(this.getColumns(),header);},getHeaderAtIndex:function(index){var columns=this.getColumns();return columns.length?columns[index]:null;},getHeaderById:function(id){var columns=this.getColumns(),len=columns.length,i,header;for(i=0;i<len;++i){header=columns[i];if(header.getItemId()===id){return header;}}
return null;},getVisibleHeaderClosestToIndex:function(index){var result=this.getHeaderAtIndex(index);if(result&&result.hidden){result=result.next(':not([hidden])')||result.prev(':not([hidden])');}
return result;},cacheColumns:function(){this.columns=this.headerCt.getVisibleGridColumns();if(this.secondHeaderCt){Ext.Array.push(this.columns,this.secondHeaderCt.getVisibleGridColumns());}},invalidate:function(){this.columns=null;if(this.rootColumns){this.rootColumns.invalidate();}}},function(){this.createAlias('indexOf','getHeaderIndex');});Ext.define('Ext.data.validations',{singleton:true,presenceMessage:'must be present',lengthMessage:'is the wrong length',formatMessage:'is the wrong format',inclusionMessage:'is not included in the list of acceptable values',exclusionMessage:'is not an acceptable value',emailMessage:'is not a valid email address',emailRe:/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,presence:function(config,value){if(arguments.length===1){value=config;}
return!!value||value===0||value===false;},length:function(config,value){if(value===undefined||value===null){return false;}
var length=value.length,min=config.min,max=config.max;if((min&&length<min)||(max&&length>max)){return false;}else{return true;}},email:function(config,email){return Ext.data.validations.emailRe.test(email);},format:function(config,value){return!!(config.matcher&&config.matcher.test(value));},inclusion:function(config,value){return config.list&&Ext.Array.indexOf(config.list,value)!=-1;},exclusion:function(config,value){return config.list&&Ext.Array.indexOf(config.list,value)==-1;}});Ext.define('Ext.fx.CubicBezier',{singleton:true,cubicBezierAtTime:function(t,p1x,p1y,p2x,p2y,duration){var cx=3*p1x,bx=3*(p2x-p1x)-cx,ax=1-cx-bx,cy=3*p1y,by=3*(p2y-p1y)-cy,ay=1-cy-by;function sampleCurveX(t){return((ax*t+bx)*t+cx)*t;}
function solve(x,epsilon){var t=solveCurveX(x,epsilon);return((ay*t+by)*t+cy)*t;}
function solveCurveX(x,epsilon){var t0,t1,t2,x2,d2,i;for(t2=x,i=0;i<8;i++){x2=sampleCurveX(t2)-x;if(Math.abs(x2)<epsilon){return t2;}
d2=(3*ax*t2+2*bx)*t2+cx;if(Math.abs(d2)<1e-6){break;}
t2=t2-x2/d2;}
t0=0;t1=1;t2=x;if(t2<t0){return t0;}
if(t2>t1){return t1;}
while(t0<t1){x2=sampleCurveX(t2);if(Math.abs(x2-x)<epsilon){return t2;}
if(x>x2){t0=t2;}else{t1=t2;}
t2=(t1-t0)/2+t0;}
return t2;}
return solve(t,1/(200*duration));},cubicBezier:function(x1,y1,x2,y2){var fn=function(pos){return Ext.fx.CubicBezier.cubicBezierAtTime(pos,x1,y1,x2,y2,1);};fn.toCSS3=function(){return'cubic-bezier('+[x1,y1,x2,y2].join(',')+')';};fn.reverse=function(){return Ext.fx.CubicBezier.cubicBezier(1-x2,1-y2,1-x1,1-y1);};return fn;}});Ext.define('Ext.data.association.Association',{alternateClassName:'Ext.data.Association',primaryKey:'id',associationKeyFunction:null,defaultReaderType:'json',isAssociation:true,initialConfig:null,statics:{AUTO_ID:1000,create:function(association){if(Ext.isString(association)){association={type:association};}
switch(association.type){case'belongsTo':return new Ext.data.association.BelongsTo(association);case'hasMany':return new Ext.data.association.HasMany(association);case'hasOne':return new Ext.data.association.HasOne(association);default:}
return association;}},constructor:function(config){Ext.apply(this,config);var me=this,types=Ext.ModelManager.types,ownerName=config.ownerModel,associatedName=config.associatedModel,ownerModel=types[ownerName],associatedModel=types[associatedName],associationKey=config.associationKey,keyReIdx;if(associationKey){keyReIdx=String(associationKey).search(/[\[\.]/);if(keyReIdx>=0){me.associationKeyFunction=Ext.functionFactory('obj','return obj'+(keyReIdx>0?'.':'')+associationKey);}}
me.initialConfig=config;me.ownerModel=ownerModel;me.associatedModel=associatedModel;Ext.applyIf(me,{ownerName:ownerName,associatedName:associatedName});me.associationId='association'+(++me.statics().AUTO_ID);},getReader:function(){var me=this,reader=me.reader,model=me.associatedModel;if(reader){if(Ext.isString(reader)){reader={type:reader};}
if(reader.isReader){reader.setModel(model);}else{Ext.applyIf(reader,{model:model,type:me.defaultReaderType});}
me.reader=Ext.createByAlias('reader.'+reader.type,reader);}
return me.reader||null;}});Ext.define('Ext.container.Monitor',{target:null,selector:'',scope:null,addHandler:null,removeHandler:null,disabled:0,constructor:function(config){Ext.apply(this,config);},bind:function(target){var me=this;me.target=target;target.on('beforedestroy',me.disable,me);me.onContainerAdd(target);},unbind:function(){var me=this,target=me.target;if(target){target.un('beforedestroy',me.disable,me);}
me.items=null;},disable:function(){++this.disabled;},enable:function(){if(this.disabled>0){--this.disabled;}},handleAdd:function(ct,comp){if(!this.disabled){if(comp.is(this.selector)){this.onItemAdd(comp.ownerCt,comp);}
if(comp.isQueryable){this.onContainerAdd(comp);}}},onItemAdd:function(ct,comp){var me=this,items=me.items,handler=me.addHandler;if(!me.disabled){if(handler){handler.call(me.scope||comp,comp);}
if(items){items.add(comp);}}},onItemRemove:function(ct,comp){var me=this,items=me.items,handler=me.removeHandler;if(!me.disabled){if(handler){handler.call(me.scope||comp,comp);}
if(items){items.remove(comp);}}},onContainerAdd:function(ct,preventChildren){var me=this,items,len,handleAdd=me.handleAdd,handleRemove=me.handleRemove,i,comp;if(ct.isContainer){ct.on('add',handleAdd,me);ct.on('dockedadd',handleAdd,me);ct.on('remove',handleRemove,me);ct.on('dockedremove',handleRemove,me);}
if(preventChildren!==true){items=ct.query(me.selector);for(i=0,len=items.length;i<len;++i){comp=items[i];me.onItemAdd(comp.ownerCt,comp);}}
items=ct.query('container');for(i=0,len=items.length;i<len;++i){me.onContainerAdd(items[i],true);}},handleRemove:function(ct,comp){var me=this;if(!me.disabled){if(comp.is(me.selector)){me.onItemRemove(ct,comp);}
if(comp.isQueryable){me.onContainerRemove(ct,comp);}}},onContainerRemove:function(ct,comp){var me=this,items,i,len,item;if(!comp.isDestroyed&&!comp.destroying&&comp.isContainer){me.removeCtListeners(comp);items=comp.query(me.selector);for(i=0,len=items.length;i<len;++i){item=items[i];me.onItemRemove(item.ownerCt,item);}
items=comp.query('container');for(i=0,len=items.length;i<len;++i){me.removeCtListeners(items[i]);}}else{me.invalidateItems();}},removeCtListeners:function(comp){var me=this;comp.un('add',me.handleAdd,me);comp.un('dockedadd',me.handleAdd,me);comp.un('remove',me.handleRemove,me);comp.un('dockedremove',me.handleRemove,me);},getItems:function(){var me=this,items=me.items;if(!items){items=me.items=new Ext.util.MixedCollection();items.addAll(me.target.query(me.selector));}
return items;},invalidateItems:function(){this.items=null;}});Ext.define('Ext.layout.SizeModel',{constructor:function(config){var me=this,SizeModel=me.self,sizeModelsArray=SizeModel.sizeModelsArray,name;Ext.apply(me,config);me[name=me.name]=true;me.fixed=!(me.auto=me.natural||me.shrinkWrap);sizeModelsArray[me.ordinal=sizeModelsArray.length]=SizeModel[name]=SizeModel.sizeModels[name]=me;},statics:{sizeModelsArray:[],sizeModels:{}},calculated:false,configured:false,constrainedMax:false,constrainedMin:false,natural:false,shrinkWrap:false,calculatedFromConfigured:false,calculatedFromNatural:false,calculatedFromShrinkWrap:false,names:null},function(){var SizeModel=this,sizeModelsArray=SizeModel.sizeModelsArray,i,j,n,pairs,sizeModel;new SizeModel({name:'calculated'});new SizeModel({name:'configured',names:{width:'width',height:'height'}});new SizeModel({name:'natural'});new SizeModel({name:'shrinkWrap'});new SizeModel({name:'calculatedFromConfigured',configured:true,names:{width:'width',height:'height'}});new SizeModel({name:'calculatedFromNatural',natural:true});new SizeModel({name:'calculatedFromShrinkWrap',shrinkWrap:true});new SizeModel({name:'constrainedMax',configured:true,constrained:true,names:{width:'maxWidth',height:'maxHeight'}});new SizeModel({name:'constrainedMin',configured:true,constrained:true,names:{width:'minWidth',height:'minHeight'}});new SizeModel({name:'constrainedDock',configured:true,constrained:true,constrainedByMin:true,names:{width:'dockConstrainedWidth',height:'dockConstrainedHeight'}});for(i=0,n=sizeModelsArray.length;i<n;++i){sizeModel=sizeModelsArray[i];sizeModel.pairsByHeightOrdinal=pairs=[];for(j=0;j<n;++j){pairs.push({width:sizeModel,height:sizeModelsArray[j]});}}});Ext.define('Ext.form.field.VTypes',(function(){var alpha=/^[a-zA-Z_]+$/,alphanum=/^[a-zA-Z0-9_]+$/,email=/^(")?(?:[^\."])(?:(?:[\.])?(?:[\w\-!#$%&'*+/=?^_`{|}~]))*\1@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/,url=/(((^https?)|(^ftp)):\/\/((([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*)|(localhost|LOCALHOST))\/?)/i;return{singleton:true,alternateClassName:'Ext.form.VTypes','email':function(v){return email.test(v);},'emailText':'This field should be an e-mail address in the format "user@example.com"','emailMask':/[\w.\-@'"!#$%&'*+/=?^_`{|}~]/i,'url':function(v){return url.test(v);},'urlText':'This field should be a URL in the format "http:/'+'/www.example.com"','alpha':function(v){return alpha.test(v);},'alphaText':'This field should only contain letters and _','alphaMask':/[a-z_]/i,'alphanum':function(v){return alphanum.test(v);},'alphanumText':'This field should only contain letters, numbers and _','alphanumMask':/[a-z0-9_]/i};}()));Ext.define('Ext.layout.container.boxOverflow.None',{alternateClassName:'Ext.layout.boxOverflow.None',constructor:function(layout,config){this.layout=layout;Ext.apply(this,config);},handleOverflow:Ext.emptyFn,clearOverflow:Ext.emptyFn,beginLayout:Ext.emptyFn,beginLayoutCycle:Ext.emptyFn,calculate:function(ownerContext){var me=this,plan=ownerContext.state.boxPlan,overflow;if(plan&&plan.tooNarrow){overflow=me.handleOverflow(ownerContext);if(overflow){if(overflow.reservedSpace){me.layout.publishInnerCtSize(ownerContext,overflow.reservedSpace);}}}else{me.clearOverflow();}},completeLayout:Ext.emptyFn,finishedLayout:function(ownerContext){var me=this,owner=me.layout.owner,hiddens,hiddenCount;if(owner.hasListeners.overflowchange){hiddens=owner.query('>[hidden]');hiddenCount=hiddens.length;if(hiddenCount!==me.lastHiddenCount){owner.fireEvent('overflowchange',me.lastHiddenCount,hiddenCount,hiddens);me.lastHiddenCount=hiddenCount;}}},onRemove:Ext.emptyFn,getItem:function(item){return this.layout.owner.getComponent(item);},getOwnerType:function(owner){var type;if(owner.isToolbar){type='toolbar';}else if(owner.isTabBar){type='tabbar';}else if(owner.isMenu){type='menu';}else{type=owner.getXType();}
return type;},getPrefixConfig:Ext.emptyFn,getSuffixConfig:Ext.emptyFn,getOverflowCls:function(){return'';}});Ext.define('Ext.util.Queue',{constructor:function(){this.clear();},add:function(obj){var me=this,key=me.getKey(obj);if(!me.map[key]){++me.length;me.items.push(obj);me.map[key]=obj;}
return obj;},clear:function(){var me=this,items=me.items;me.items=[];me.map={};me.length=0;return items;},contains:function(obj){var key=this.getKey(obj);return this.map.hasOwnProperty(key);},getCount:function(){return this.length;},getKey:function(obj){return obj.id;},remove:function(obj){var me=this,key=me.getKey(obj),items=me.items,index;if(me.map[key]){index=Ext.Array.indexOf(items,obj);Ext.Array.erase(items,index,1);delete me.map[key];--me.length;}
return obj;}});Ext.define('Ext.util.Floating',{uses:['Ext.Layer','Ext.window.Window'],focusOnToFront:true,shadow:'sides',constrain:false,constructor:function(dom){var me=this;me.fixed=me.fixed&&!(Ext.isIE6||Ext.isIEQuirks);me.el=new Ext.dom.Layer(Ext.apply({preventSync:true,hideMode:me.hideMode,hidden:me.hidden,shadow:(typeof me.shadow!='undefined')?me.shadow:'sides',shadowOffset:me.shadowOffset,constrain:false,fixed:me.fixed,shim:(me.shim===false)?false:undefined},me.floating),dom);if(me.modal&&!(Ext.FocusManager&&Ext.FocusManager.enabled)){me.mon(me.el,{keydown:me.onKeyDown,scope:me});}
me.mon(me.el,{mousedown:me.onMouseDown,scope:me});me.floating=true;me.registerWithOwnerCt();me.initHierarchyEvents();},initHierarchyEvents:function(){var me=this,syncHidden=this.syncHidden;if(!me.hasHierarchyEventListeners){me.mon(me.hierarchyEventSource,{hide:syncHidden,collapse:syncHidden,show:syncHidden,expand:syncHidden,added:syncHidden,scope:me});me.hasHierarchyEventListeners=true;}},registerWithOwnerCt:function(){var me=this,ownerCt=me.ownerCt,zip=me.zIndexParent;if(zip){zip.unregisterFloatingItem(me);}
zip=me.zIndexParent=me.up('[floating]');me.setFloatParent(ownerCt||zip);delete me.ownerCt;if(zip){zip.registerFloatingItem(me);}else{Ext.WindowManager.register(me);}},onKeyDown:function(e){var me=this,shift,focusables,first,last;if(e.getKey()==Ext.EventObject.TAB){shift=e.shiftKey;focusables=me.el.query(':focusable');first=focusables[0];last=focusables[focusables.length-1];if(first&&last&&e.target===(shift?first:last)){e.stopEvent();(shift?last:first).focus(false,true);}}},onMouseDown:function(e){var focusTask=this.focusTask;if(this.floating&&(!focusTask||!focusTask.id)){this.toFront(!!e.getTarget(':focusable'));}},setFloatParent:function(floatParent){var me=this;me.floatParent=floatParent;if((me.constrain||me.constrainHeader)&&!me.constrainTo){me.constrainTo=floatParent?floatParent.getTargetEl():me.container;}},syncShadow:function(){if(this.floating){this.el.sync(true);}},onBeforeFloatLayout:function(){this.el.preventSync=true;},onAfterFloatLayout:function(){delete this.el.preventSync;this.syncShadow();},syncHidden:function(){var me=this,hidden=me.hidden||!me.rendered,hierarchicallyHidden=me.hierarchicallyHidden=me.isHierarchicallyHidden(),pendingShow=me.pendingShow;if(hidden!==hierarchicallyHidden){if(hierarchicallyHidden){me.hide();me.pendingShow=true;}else if(pendingShow){delete me.pendingShow;if(pendingShow.length){me.show.apply(me,pendingShow);}else{me.show();}}}},setZIndex:function(index){var me=this;me.el.setZIndex(index);index+=10;if(me.floatingDescendants){index=Math.floor(me.floatingDescendants.setBase(index)/100)*100+10000;}
return index;},doConstrain:function(constrainTo){var me=this,xy=me.calculateConstrainedPosition(constrainTo,null,true);if(xy){me.setPosition(xy);}},toFront:function(preventFocus){var me=this,zip=me.zIndexParent,preventFocusSetting=me.preventFocusOnActivate;if(zip&&me.bringParentToFront!==false){zip.toFront(true);}
if(!Ext.isDefined(preventFocus)){preventFocus=!me.focusOnToFront;}
if(preventFocus){me.preventFocusOnActivate=true;}
if(me.zIndexManager.bringToFront(me,preventFocus)){if(!preventFocus){me.focus(false,true);}}
me.preventFocusOnActivate=preventFocusSetting;return me;},setActive:function(active,newActive){var me=this;if(active){if(me.el.shadow&&!me.maximized){me.el.enableShadow(true);}
if(!me.preventFocusOnActivate){me.focus(false,true);}
me.fireEvent('activate',me);}else{if(me.isWindow&&(newActive&&newActive.isWindow)&&me.hideShadowOnDeactivate){me.el.disableShadow();}
me.fireEvent('deactivate',me);}},toBack:function(){this.zIndexManager.sendToBack(this);return this;},center:function(){var me=this,xy;if(me.isVisible()){xy=me.getAlignToXY(me.container,'c-c');me.setPagePosition(xy);}else{me.needsCenter=true;}
return me;},onFloatShow:function(){if(this.needsCenter){this.center();}
delete this.needsCenter;},fitContainer:function(animate){var me=this,parent=me.floatParent,container=parent?parent.getTargetEl():me.container,newBox=container.getViewSize(false),newPosition=parent||(container.dom!==document.body)?[0,0]:container.getXY();newBox.x=newPosition[0];newBox.y=newPosition[1];me.setBox(newBox,animate);}});Ext.define('Ext.layout.ClassList',(function(){var splitWords=Ext.String.splitWords,toMap=Ext.Array.toMap;return{dirty:false,constructor:function(owner){this.owner=owner;this.map=toMap(this.classes=splitWords(owner.el.className));},add:function(cls){var me=this;if(!me.map[cls]){me.map[cls]=true;me.classes.push(cls);if(!me.dirty){me.dirty=true;me.owner.markDirty();}}},addMany:function(classes){Ext.each(splitWords(classes),this.add,this);},contains:function(cls){return this.map[cls];},flush:function(){this.owner.el.className=this.classes.join(' ');this.dirty=false;},remove:function(cls){var me=this;if(me.map[cls]){delete me.map[cls];me.classes=Ext.Array.filter(me.classes,function(c){return c!=cls;});if(!me.dirty){me.dirty=true;me.owner.markDirty();}}},removeMany:function(classes){var me=this,remove=toMap(splitWords(classes));me.classes=Ext.Array.filter(me.classes,function(c){if(!remove[c]){return true;}
delete me.map[c];if(!me.dirty){me.dirty=true;me.owner.markDirty();}
return false;});}};}()));Ext.define('Ext.data.ResultSet',{loaded:true,count:0,total:0,success:false,constructor:function(config){Ext.apply(this,config);this.totalRecords=this.total;if(config.count===undefined){this.count=this.records.length;}}});Ext.define('Ext.util.ProtoElement',(function(){var splitWords=Ext.String.splitWords,toMap=Ext.Array.toMap;return{isProtoEl:true,clsProp:'cls',styleProp:'style',removedProp:'removed',styleIsText:false,constructor:function(config){var me=this;Ext.apply(me,config);me.classList=splitWords(me.cls);me.classMap=toMap(me.classList);delete me.cls;if(Ext.isFunction(me.style)){me.styleFn=me.style;delete me.style;}else if(typeof me.style=='string'){me.style=Ext.Element.parseStyles(me.style);}else if(me.style){me.style=Ext.apply({},me.style);}},flush:function(){this.flushClassList=[];this.removedClasses={};delete this.style;delete this.unselectableAttr;},addCls:function(cls){var me=this,add=(typeof cls==='string')?splitWords(cls):cls,length=add.length,list=me.classList,map=me.classMap,flushList=me.flushClassList,i=0,c;for(;i<length;++i){c=add[i];if(!map[c]){map[c]=true;list.push(c);if(flushList){flushList.push(c);delete me.removedClasses[c];}}}
return me;},hasCls:function(cls){return cls in this.classMap;},removeCls:function(cls){var me=this,list=me.classList,newList=(me.classList=[]),remove=toMap(splitWords(cls)),length=list.length,map=me.classMap,removedClasses=me.removedClasses,i,c;for(i=0;i<length;++i){c=list[i];if(remove[c]){if(removedClasses){if(map[c]){removedClasses[c]=true;Ext.Array.remove(me.flushClassList,c);}}
delete map[c];}else{newList.push(c);}}
return me;},setStyle:function(prop,value){var me=this,style=me.style||(me.style={});if(typeof prop=='string'){if(arguments.length===1){me.setStyle(Ext.Element.parseStyles(prop));}else{style[prop]=value;}}else{Ext.apply(style,prop);}
return me;},unselectable:function(){this.addCls(Ext.dom.Element.unselectableCls);if(Ext.isOpera){this.unselectableAttr=true;}},writeTo:function(to){var me=this,classList=me.flushClassList||me.classList,removedClasses=me.removedClasses,style;if(me.styleFn){style=Ext.apply({},me.styleFn());Ext.apply(style,me.style);}else{style=me.style;}
to[me.clsProp]=classList.join(' ');if(style){to[me.styleProp]=me.styleIsText?Ext.DomHelper.generateStyles(style):style;}
if(removedClasses){removedClasses=Ext.Object.getKeys(removedClasses);if(removedClasses.length){to[me.removedProp]=removedClasses.join(' ');}}
if(me.unselectableAttr){to.unselectable='on';}
return to;}};}()));Ext.define('Ext.data.writer.Writer',{alias:'writer.base',alternateClassName:['Ext.data.DataWriter','Ext.data.Writer'],writeAllFields:true,nameProperty:'name',writeRecordId:true,isWriter:true,constructor:function(config){Ext.apply(this,config);},write:function(request){var operation=request.operation,records=operation.records||[],len=records.length,i=0,data=[];for(;i<len;i++){data.push(this.getRecordData(records[i],operation));}
return this.writeRecords(request,data);},getRecordData:function(record,operation){var isPhantom=record.phantom===true,writeAll=this.writeAllFields||isPhantom,fields=record.fields,fieldItems=fields.items,data={},clientIdProperty=record.clientIdProperty,changes,field,key,mappedIdProperty,f,fLen;if(writeAll){fLen=fieldItems.length;for(f=0;f<fLen;f++){field=fieldItems[f];if(field.persist){this.writeValue(data,field,record);}}}else{changes=record.getChanges();for(key in changes){if(changes.hasOwnProperty(key)){field=fields.get(key);if(field.persist){this.writeValue(data,field,record);}}}}
if(isPhantom){if(clientIdProperty&&operation&&operation.records.length>1){data[clientIdProperty]=record.internalId;}}else if(this.writeRecordId){mappedIdProperty=fields.get(record.idProperty)[this.nameProperty]||record.idProperty;data[mappedIdProperty]=record.getId();}
return data;},writeValue:function(data,field,record){var name=field[this.nameProperty],dateFormat=this.dateFormat||field.dateWriteFormat||field.dateFormat,value=record.get(field.name);if(name==null){name=field.name;}
if(field.serialize){data[name]=field.serialize(value,record);}else if(field.type===Ext.data.Types.DATE&&dateFormat&&Ext.isDate(value)){data[name]=Ext.Date.format(value,dateFormat);}else{data[name]=value;}}});Ext.define('Ext.util.TaskManager',{extend:'Ext.util.TaskRunner',alternateClassName:['Ext.TaskManager'],singleton:true});Ext.define('Ext.util.ClickRepeater',{extend:'Ext.util.Observable',constructor:function(el,config){var me=this;me.el=Ext.get(el);me.el.unselectable();Ext.apply(me,config);me.callParent();me.addEvents("mousedown","click","mouseup");if(!me.disabled){me.disabled=true;me.enable();}
if(me.handler){me.on("click",me.handler,me.scope||me);}},interval:20,delay:250,preventDefault:true,stopDefault:false,timer:0,enable:function(){if(this.disabled){this.el.on('mousedown',this.handleMouseDown,this);if(Ext.isIE&&!(Ext.isIE10p||(Ext.isStrict&&Ext.isIE9))){this.el.on('dblclick',this.handleDblClick,this);}
if(this.preventDefault||this.stopDefault){this.el.on('click',this.eventOptions,this);}}
this.disabled=false;},disable:function(force){if(force||!this.disabled){clearTimeout(this.timer);if(this.pressedCls){this.el.removeCls(this.pressedCls);}
Ext.getDoc().un('mouseup',this.handleMouseUp,this);this.el.removeAllListeners();}
this.disabled=true;},setDisabled:function(disabled){this[disabled?'disable':'enable']();},eventOptions:function(e){if(this.preventDefault){e.preventDefault();}
if(this.stopDefault){e.stopEvent();}},destroy:function(){this.disable(true);Ext.destroy(this.el);this.clearListeners();},handleDblClick:function(e){clearTimeout(this.timer);this.el.blur();this.fireEvent("mousedown",this,e);this.fireEvent("click",this,e);},handleMouseDown:function(e){clearTimeout(this.timer);this.el.blur();if(this.pressedCls){this.el.addCls(this.pressedCls);}
this.mousedownTime=new Date();Ext.getDoc().on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this,e);this.fireEvent("click",this,e);if(this.accelerate){this.delay=400;}
e=new Ext.EventObjectImpl(e);this.timer=Ext.defer(this.click,this.delay||this.interval,this,[e]);},click:function(e){this.fireEvent("click",this,e);this.timer=Ext.defer(this.click,this.accelerate?this.easeOutExpo(Ext.Date.getElapsed(this.mousedownTime),400,-390,12000):this.interval,this,[e]);},easeOutExpo:function(t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},handleMouseOut:function(){clearTimeout(this.timer);if(this.pressedCls){this.el.removeCls(this.pressedCls);}
this.el.on("mouseover",this.handleMouseReturn,this);},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn,this);if(this.pressedCls){this.el.addCls(this.pressedCls);}
this.click();},handleMouseUp:function(e){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn,this);this.el.un("mouseout",this.handleMouseOut,this);Ext.getDoc().un("mouseup",this.handleMouseUp,this);if(this.pressedCls){this.el.removeCls(this.pressedCls);}
this.fireEvent("mouseup",this,e);}});Ext.define('Ext.util.Offset',{statics:{fromObject:function(obj){return new this(obj.x,obj.y);}},constructor:function(x,y){this.x=(x!=null&&!isNaN(x))?x:0;this.y=(y!=null&&!isNaN(y))?y:0;return this;},copy:function(){return new Ext.util.Offset(this.x,this.y);},copyFrom:function(p){this.x=p.x;this.y=p.y;},toString:function(){return"Offset["+this.x+","+this.y+"]";},equals:function(offset){return(this.x==offset.x&&this.y==offset.y);},round:function(to){if(!isNaN(to)){var factor=Math.pow(10,to);this.x=Math.round(this.x*factor)/factor;this.y=Math.round(this.y*factor)/factor;}else{this.x=Math.round(this.x);this.y=Math.round(this.y);}},isZero:function(){return this.x==0&&this.y==0;}});Ext.define('Ext.data.Operation',{synchronous:true,action:undefined,filters:undefined,sorters:undefined,groupers:undefined,start:undefined,limit:undefined,batch:undefined,callback:undefined,scope:undefined,started:false,running:false,complete:false,success:undefined,exception:false,error:undefined,actionCommitRecordsRe:/^(?:create|update)$/i,actionSkipSyncRe:/^destroy$/i,constructor:function(config){Ext.apply(this,config||{});},commitRecords:function(serverRecords){var me=this,commitRecords=me.actionCommitRecordsRe.test(me.action),mc,index,clientRecords,serverRec,clientRec,i,len,modifiedFields,recordModifiedFields;if(!me.actionSkipSyncRe.test(me.action)){clientRecords=me.records;if(clientRecords&&clientRecords.length){if(commitRecords){recordModifiedFields=[];}
if(clientRecords.length>1){if(me.action=='update'||clientRecords[0].clientIdProperty){mc=new Ext.util.MixedCollection();mc.addAll(serverRecords);for(index=clientRecords.length;index--;){clientRec=clientRecords[index];serverRec=mc.findBy(me.matchClientRec,clientRec);modifiedFields=clientRec.copyFrom(serverRec);if(commitRecords){recordModifiedFields.push(modifiedFields);}}}else{for(i=0,len=clientRecords.length;i<len;++i){clientRec=clientRecords[i];serverRec=serverRecords[i];if(clientRec&&serverRec){modifiedFields=me.updateRecord(clientRec,serverRec);if(commitRecords){recordModifiedFields.push(modifiedFields);}}}}}else{modifiedFields=me.updateRecord(clientRecords[0],serverRecords[0]);if(commitRecords){recordModifiedFields[0]=modifiedFields;}}
if(commitRecords){for(index=clientRecords.length;index--;){clientRecords[index].commit(false,recordModifiedFields[index]);}}}}},updateRecord:function(clientRec,serverRec){if(serverRec&&(clientRec.phantom||clientRec.getId()===serverRec.getId())){return clientRec.copyFrom(serverRec);}
return[];},matchClientRec:function(record){var clientRec=this,clientRecordId=clientRec.getId();if(clientRecordId&&record.getId()===clientRecordId){return true;}
return record.internalId===clientRec.internalId;},setStarted:function(){this.started=true;this.running=true;},setCompleted:function(){this.complete=true;this.running=false;},setSuccessful:function(){this.success=true;},setException:function(error){this.exception=true;this.success=false;this.running=false;this.error=error;},hasException:function(){return this.exception===true;},getError:function(){return this.error;},getRecords:function(){var resultSet=this.getResultSet();return this.records||(resultSet?resultSet.records:null);},getResultSet:function(){return this.resultSet;},isStarted:function(){return this.started===true;},isRunning:function(){return this.running===true;},isComplete:function(){return this.complete===true;},wasSuccessful:function(){return this.isComplete()&&this.success===true;},setBatch:function(batch){this.batch=batch;},allowWrite:function(){return this.action!='read';}});Ext.define('Ext.util.Bindable',{bindStore:function(store,initial,propertyName){propertyName=propertyName||'store';var me=this,oldStore=me[propertyName];if(!initial&&oldStore){me.onUnbindStore(oldStore,initial,propertyName);if(store!==oldStore&&oldStore.autoDestroy){oldStore.destroyStore();}else{me.unbindStoreListeners(oldStore);}}
if(store){store=Ext.data.StoreManager.lookup(store);me.bindStoreListeners(store);me.onBindStore(store,initial,propertyName);}
me[propertyName]=store||null;return me;},getStore:function(){return this.store;},unbindStoreListeners:function(store){var listeners=this.storeListeners;if(listeners){store.un(listeners);}},bindStoreListeners:function(store){var me=this,listeners=Ext.apply({},me.getStoreListeners(store));if(!listeners.scope){listeners.scope=me;}
me.storeListeners=listeners;store.on(listeners);},getStoreListeners:Ext.emptyFn,onUnbindStore:Ext.emptyFn,onBindStore:Ext.emptyFn});Ext.define('Ext.form.field.Field',{isFormField:true,disabled:false,submitValue:true,validateOnChange:true,suspendCheckChange:0,initField:function(){this.addEvents('change','validitychange','dirtychange');this.initValue();},initValue:function(){var me=this;me.value=me.transformOriginalValue(me.value);me.originalValue=me.lastValue=me.value;me.suspendCheckChange++;me.setValue(me.value);me.suspendCheckChange--;},transformOriginalValue:Ext.identityFn,getName:function(){return this.name;},getValue:function(){return this.value;},setValue:function(value){var me=this;me.value=value;me.checkChange();return me;},isEqual:function(value1,value2){return String(value1)===String(value2);},isEqualAsString:function(value1,value2){return String(Ext.value(value1,''))===String(Ext.value(value2,''));},getSubmitData:function(){var me=this,data=null;if(!me.disabled&&me.submitValue&&!me.isFileUpload()){data={};data[me.getName()]=''+me.getValue();}
return data;},getModelData:function(){var me=this,data=null;if(!me.disabled&&!me.isFileUpload()){data={};data[me.getName()]=me.getValue();}
return data;},reset:function(){var me=this;me.beforeReset();me.setValue(me.originalValue);me.clearInvalid();delete me.wasValid;},beforeReset:Ext.emptyFn,resetOriginalValue:function(){this.originalValue=this.getValue();this.checkDirty();},checkChange:function(){if(!this.suspendCheckChange){var me=this,newVal=me.getValue(),oldVal=me.lastValue;if(!me.isEqual(newVal,oldVal)&&!me.isDestroyed){me.lastValue=newVal;me.fireEvent('change',me,newVal,oldVal);me.onChange(newVal,oldVal);}}},onChange:function(newVal,oldVal){if(this.validateOnChange){this.validate();}
this.checkDirty();},isDirty:function(){var me=this;return!me.disabled&&!me.isEqual(me.getValue(),me.originalValue);},checkDirty:function(){var me=this,isDirty=me.isDirty();if(isDirty!==me.wasDirty){me.fireEvent('dirtychange',me,isDirty);me.onDirtyChange(isDirty);me.wasDirty=isDirty;}},onDirtyChange:Ext.emptyFn,getErrors:function(value){return[];},isValid:function(){var me=this;return me.disabled||Ext.isEmpty(me.getErrors());},validate:function(){var me=this,isValid=me.isValid();if(isValid!==me.wasValid){me.wasValid=isValid;me.fireEvent('validitychange',me,isValid);}
return isValid;},batchChanges:function(fn){try{this.suspendCheckChange++;fn();}catch(e){throw e;}finally{this.suspendCheckChange--;}
this.checkChange();},isFileUpload:function(){return false;},extractFileInput:function(){return null;},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.define('Ext.util.CSS',function(){var CSS,rules=null,doc=document,camelRe=/(-[a-z])/gi,camelFn=function(m,a){return a.charAt(1).toUpperCase();};return{singleton:true,rules:rules,initialized:false,constructor:function(){CSS=this;},createStyleSheet:function(cssText,id){var ss,head=doc.getElementsByTagName("head")[0],styleEl=doc.createElement("style");styleEl.setAttribute("type","text/css");if(id){styleEl.setAttribute("id",id);}
if(Ext.isIE){head.appendChild(styleEl);ss=styleEl.styleSheet;ss.cssText=cssText;}else{try{styleEl.appendChild(doc.createTextNode(cssText));}catch(e){styleEl.cssText=cssText;}
head.appendChild(styleEl);ss=styleEl.styleSheet?styleEl.styleSheet:(styleEl.sheet||doc.styleSheets[doc.styleSheets.length-1]);}
CSS.cacheStyleSheet(ss);return ss;},removeStyleSheet:function(id){var existing=doc.getElementById(id);if(existing){existing.parentNode.removeChild(existing);}},swapStyleSheet:function(id,url){var ss;CSS.removeStyleSheet(id);ss=doc.createElement("link");ss.setAttribute("rel","stylesheet");ss.setAttribute("type","text/css");ss.setAttribute("id",id);ss.setAttribute("href",url);doc.getElementsByTagName("head")[0].appendChild(ss);},refreshCache:function(){return CSS.getRules(true);},cacheStyleSheet:function(ss){if(!rules){rules=CSS.rules={};}
try{var ssRules=ss.cssRules||ss.rules,i=ssRules.length-1,imports=ss.imports,len=imports?imports.length:0,rule,j;for(j=0;j<len;++j){CSS.cacheStyleSheet(imports[j]);}
for(;i>=0;--i){rule=ssRules[i];if(rule.styleSheet){CSS.cacheStyleSheet(rule.styleSheet);}
CSS.cacheRule(rule,ss);}}catch(e){}},cacheRule:function(cssRule,styleSheet){if(cssRule.styleSheet){return CSS.cacheStyleSheet(cssRule.styleSheet);}
var selectorText=cssRule.selectorText,selectorCount,j;if(selectorText){selectorText=selectorText.split(',');selectorCount=selectorText.length;for(j=0;j<selectorCount;j++){rules[Ext.String.trim(selectorText[j]).toLowerCase()]={parentStyleSheet:styleSheet,cssRule:cssRule};};}},getRules:function(refreshCache){var result={},selector;if(rules===null||refreshCache){CSS.refreshCache();}
for(selector in rules){result[selector]=rules[selector].cssRule;}
return result;},refreshCache:function(){var ds=doc.styleSheets,i=0,len=ds.length;rules=CSS.rules={}
for(;i<len;i++){try{if(!ds[i].disabled){CSS.cacheStyleSheet(ds[i]);}}catch(e){}}},getRule:function(selector,refreshCache,rawCache){var i,result;if(!rules||refreshCache){CSS.refreshCache();}
if(!Ext.isArray(selector)){result=rules[selector.toLowerCase()]
if(result&&!rawCache){result=result.cssRule;}
return result||null;}
for(i=0;i<selector.length;i++){if(rules[selector[i]]){return rawCache?rules[selector[i].toLowerCase()]:rules[selector[i].toLowerCase()].cssRule;}}
return null;},createRule:function(styleSheet,selector,cssText){var result,ruleSet=styleSheet.cssRules||styleSheet.rules,index=ruleSet.length;if(styleSheet.insertRule){styleSheet.insertRule(selector+'{'+cssText+'}',index);}else{styleSheet.addRule(selector,cssText||' ');}
CSS.cacheRule(result=ruleSet[index],styleSheet);return result;},updateRule:function(selector,property,value){var rule,i,styles;if(!Ext.isArray(selector)){rule=CSS.getRule(selector);if(rule){if(arguments.length==2){styles=Ext.Element.parseStyles(property);for(property in styles){rule.style[property.replace(camelRe,camelFn)]=styles[property];}}else{rule.style[property.replace(camelRe,camelFn)]=value;}
return true;}}else{for(i=0;i<selector.length;i++){if(CSS.updateRule(selector[i],property,value)){return true;}}}
return false;},deleteRule:function(selector){var rule=CSS.getRule(selector,false,true),styleSheet,index;if(rule){styleSheet=rule.parentStyleSheet;index=Ext.Array.indexOf(styleSheet.cssRules||styleSheet.rules,rule.cssRule);if(styleSheet.deleteRule){styleSheet.deleteRule(index);}else{styleSheet.removeRule(index);}
delete rules[selector];}}};});Ext.define('Ext.util.KeyMap',{alternateClassName:'Ext.KeyMap',eventName:'keydown',constructor:function(config){var me=this;if((arguments.length!==1)||(typeof config==='string')||config.dom||config.tagName||config===document||config.isComponent){me.legacyConstructor.apply(me,arguments);return;}
Ext.apply(me,config);me.bindings=[];if(!me.target.isComponent){me.target=Ext.get(me.target);}
if(me.binding){me.addBinding(me.binding);}else if(config.key){me.addBinding(config);}
me.enable();},legacyConstructor:function(el,binding,eventName){var me=this;Ext.apply(me,{target:Ext.get(el),eventName:eventName||me.eventName,bindings:[]});if(binding){me.addBinding(binding);}
me.enable();},addBinding:function(binding){var me=this,keyCode=binding.key,i,len;if(me.processing){me.bindings=bindings.slice(0);}
if(Ext.isArray(binding)){for(i=0,len=binding.length;i<len;i++){me.addBinding(binding[i]);}
return;}
me.bindings.push(Ext.apply({keyCode:me.processKeys(keyCode)},binding));},removeBinding:function(binding){var me=this,bindings=me.bindings,len=bindings.length,i,item,keys;if(me.processing){me.bindings=bindings.slice(0);}
keys=me.processKeys(binding.key);for(i=0;i<len;++i){item=bindings[i];if(item.fn===binding.fn&&item.scope===binding.scope){if(binding.alt==item.alt&&binding.crtl==item.crtl&&binding.shift==item.shift){if(Ext.Array.equals(item.keyCode,keys)){Ext.Array.erase(me.bindings,i,1);return;}}}}},processKeys:function(keyCode){var processed=false,key,keys,keyString,len,i;if(Ext.isString(keyCode)){keys=[];keyString=keyCode.toUpperCase();for(i=0,len=keyString.length;i<len;++i){keys.push(keyString.charCodeAt(i));}
keyCode=keys;processed=true;}
if(!Ext.isArray(keyCode)){keyCode=[keyCode];}
if(!processed){for(i=0,len=keyCode.length;i<len;++i){key=keyCode[i];if(Ext.isString(key)){keyCode[i]=key.toUpperCase().charCodeAt(0);}}}
return keyCode;},handleTargetEvent:(function(){var tagRe=/input|textarea/i;return function(event){var me=this,bindings,i,len,target,contentEditable;if(me.enabled){bindings=me.bindings;i=0;len=bindings.length;event=me.processEvent.apply(me||me.processEventScope,arguments);if(me.ignoreInputFields){target=event.target;contentEditable=target.contentEditable;if(tagRe.test(target.tagName)||(contentEditable===''||contentEditable==='true')){return;}}
if(!event.getKey){return event;}
me.processing=true;for(;i<len;++i){me.processBinding(bindings[i],event);}
me.processing=false;}}}()),processEvent:Ext.identityFn,processBinding:function(binding,event){if(this.checkModifiers(binding,event)){var key=event.getKey(),handler=binding.fn||binding.handler,scope=binding.scope||this,keyCode=binding.keyCode,defaultEventAction=binding.defaultEventAction,i,len,keydownEvent=new Ext.EventObjectImpl(event);for(i=0,len=keyCode.length;i<len;++i){if(key===keyCode[i]){if(handler.call(scope,key,event)!==true&&defaultEventAction){keydownEvent[defaultEventAction]();}
break;}}}},checkModifiers:function(binding,e){var keys=['shift','ctrl','alt'],i=0,len=keys.length,val,key;for(;i<len;++i){key=keys[i];val=binding[key];if(!(val===undefined||(val===e[key+'Key']))){return false;}}
return true;},on:function(key,fn,scope){var keyCode,shift,ctrl,alt;if(Ext.isObject(key)&&!Ext.isArray(key)){keyCode=key.key;shift=key.shift;ctrl=key.ctrl;alt=key.alt;}else{keyCode=key;}
this.addBinding({key:keyCode,shift:shift,ctrl:ctrl,alt:alt,fn:fn,scope:scope});},un:function(key,fn,scope){var keyCode,shift,ctrl,alt;if(Ext.isObject(key)&&!Ext.isArray(key)){keyCode=key.key;shift=key.shift;ctrl=key.ctrl;alt=key.alt;}else{keyCode=key;}
this.removeBinding({key:keyCode,shift:shift,ctrl:ctrl,alt:alt,fn:fn,scope:scope});},isEnabled:function(){return this.enabled;},enable:function(){var me=this;if(!me.enabled){me.target.on(me.eventName,me.handleTargetEvent,me);me.enabled=true;}},disable:function(){var me=this;if(me.enabled){me.target.removeListener(me.eventName,me.handleTargetEvent,me);me.enabled=false;}},setDisabled:function(disabled){if(disabled){this.disable();}else{this.enable();}},destroy:function(removeTarget){var me=this,target=me.target;me.bindings=[];me.disable();if(removeTarget===true){if(target.isComponent){target.destroy();}else{target.remove();}}
delete me.target;}});Ext.define('Ext.form.action.Action',{alternateClassName:'Ext.form.Action',submitEmptyText:true,constructor:function(config){if(config){Ext.apply(this,config);}
var params=config.params;if(Ext.isString(params)){this.params=Ext.Object.fromQueryString(params);}},run:Ext.emptyFn,onFailure:function(response){this.response=response;this.failureType=Ext.form.action.Action.CONNECT_FAILURE;this.form.afterAction(this,false);},processResponse:function(response){this.response=response;if(!response.responseText&&!response.responseXML){return true;}
return(this.result=this.handleResponse(response));},getUrl:function(){return this.url||this.form.url;},getMethod:function(){return(this.method||this.form.method||'POST').toUpperCase();},getParams:function(){return Ext.apply({},this.params,this.form.baseParams);},createCallback:function(){var me=this,undef,form=me.form;return{success:me.onSuccess,failure:me.onFailure,scope:me,timeout:(this.timeout*1000)||(form.timeout*1000),upload:form.fileUpload?me.onSuccess:undef};},statics:{CLIENT_INVALID:'client',SERVER_INVALID:'server',CONNECT_FAILURE:'connect',LOAD_FAILURE:'load'}});Ext.define('Ext.util.Sorter',{direction:"ASC",constructor:function(config){var me=this;Ext.apply(me,config);me.updateSortFunction();},createSortFunction:function(sorterFn){var me=this,direction=me.direction||"ASC",modifier=direction.toUpperCase()=="DESC"?-1:1;return function(o1,o2){return modifier*sorterFn.call(me,o1,o2);};},defaultSorterFn:function(o1,o2){var me=this,transform=me.transform,v1=me.getRoot(o1)[me.property],v2=me.getRoot(o2)[me.property];if(transform){v1=transform(v1);v2=transform(v2);}
return v1>v2?1:(v1<v2?-1:0);},getRoot:function(item){return this.root===undefined?item:item[this.root];},setDirection:function(direction){var me=this;me.direction=direction?direction.toUpperCase():direction;me.updateSortFunction();},toggle:function(){var me=this;me.direction=Ext.String.toggle(me.direction,"ASC","DESC");me.updateSortFunction();},updateSortFunction:function(fn){var me=this;fn=fn||me.sorterFn||me.defaultSorterFn;me.sort=me.createSortFunction(fn);},serialize:function(){return{root:this.root,property:this.property,direction:this.direction};}});Ext.define('Ext.data.Batch',{mixins:{observable:'Ext.util.Observable'},autoStart:false,pauseOnException:false,current:-1,total:0,isRunning:false,isComplete:false,hasException:false,constructor:function(config){var me=this;me.mixins.observable.constructor.call(me,config);me.operations=[];me.exceptions=[];},add:function(operation){this.total++;operation.setBatch(this);this.operations.push(operation);return this;},start:function(index){var me=this;if(me.isRunning){return me;}
me.exceptions.length=0;me.hasException=false;me.isRunning=true;return me.runOperation(Ext.isDefined(index)?index:me.current+1);},retry:function(){return this.start(this.current);},runNextOperation:function(){return this.runOperation(this.current+1);},pause:function(){this.isRunning=false;return this;},runOperation:function(index){var me=this,operations=me.operations,operation=operations[index],onProxyReturn;if(operation===undefined){me.isRunning=false;me.isComplete=true;me.fireEvent('complete',me,operations[operations.length-1]);}else{me.current=index;onProxyReturn=function(operation){var hasException=operation.hasException();if(hasException){me.hasException=true;me.exceptions.push(operation);me.fireEvent('exception',me,operation);}
if(hasException&&me.pauseOnException){me.pause();}else{operation.setCompleted();me.fireEvent('operationcomplete',me,operation);me.runNextOperation();}};operation.setStarted();me.proxy[operation.action](operation,onProxyReturn,me);}
return me;}});Ext.define('Ext.draw.Color',{colorToHexRe:/(.*?)rgb\((\d+),\s*(\d+),\s*(\d+)\)/,rgbRe:/\s*rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)\s*/,hexRe:/\s*#([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)\s*/,lightnessFactor:0.2,constructor:function(red,green,blue){var me=this,clamp=Ext.Number.constrain;me.r=clamp(red,0,255);me.g=clamp(green,0,255);me.b=clamp(blue,0,255);},getRed:function(){return this.r;},getGreen:function(){return this.g;},getBlue:function(){return this.b;},getRGB:function(){var me=this;return[me.r,me.g,me.b];},getHSL:function(){var me=this,r=me.r/255,g=me.g/255,b=me.b/255,max=Math.max(r,g,b),min=Math.min(r,g,b),delta=max-min,h,s=0,l=0.5*(max+min);if(min!=max){s=(l<0.5)?delta/(max+min):delta/(2-max-min);if(r==max){h=60*(g-b)/delta;}else if(g==max){h=120+60*(b-r)/delta;}else{h=240+60*(r-g)/delta;}
if(h<0){h+=360;}
if(h>=360){h-=360;}}
return[h,s,l];},getLighter:function(factor){var hsl=this.getHSL();factor=factor||this.lightnessFactor;hsl[2]=Ext.Number.constrain(hsl[2]+factor,0,1);return this.fromHSL(hsl[0],hsl[1],hsl[2]);},getDarker:function(factor){factor=factor||this.lightnessFactor;return this.getLighter(-factor);},toString:function(){var me=this,round=Math.round,r=round(me.r).toString(16),g=round(me.g).toString(16),b=round(me.b).toString(16);r=(r.length==1)?'0'+r:r;g=(g.length==1)?'0'+g:g;b=(b.length==1)?'0'+b:b;return['#',r,g,b].join('');},toHex:function(color){if(Ext.isArray(color)){color=color[0];}
if(!Ext.isString(color)){return'';}
if(color.substr(0,1)==='#'){return color;}
var digits=this.colorToHexRe.exec(color),red,green,blue,rgb;if(Ext.isArray(digits)){red=parseInt(digits[2],10);green=parseInt(digits[3],10);blue=parseInt(digits[4],10);rgb=blue|(green<<8)|(red<<16);return digits[1]+'#'+("000000"+rgb.toString(16)).slice(-6);}
else{return color;}},fromString:function(str){var values,r,g,b,parse=parseInt;if((str.length==4||str.length==7)&&str.substr(0,1)==='#'){values=str.match(this.hexRe);if(values){r=parse(values[1],16)>>0;g=parse(values[2],16)>>0;b=parse(values[3],16)>>0;if(str.length==4){r+=(r*16);g+=(g*16);b+=(b*16);}}}
else{values=str.match(this.rgbRe);if(values){r=values[1];g=values[2];b=values[3];}}
return(typeof r=='undefined')?undefined:new Ext.draw.Color(r,g,b);},getGrayscale:function(){return this.r*0.3+this.g*0.59+this.b*0.11;},fromHSL:function(h,s,l){var C,X,m,i,rgb=[],abs=Math.abs,floor=Math.floor;if(s==0||h==null){rgb=[l,l,l];}
else{h/=60;C=s*(1-abs(2*l-1));X=C*(1-abs(h-2*floor(h/2)-1));m=l-C/2;switch(floor(h)){case 0:rgb=[C,X,0];break;case 1:rgb=[X,C,0];break;case 2:rgb=[0,C,X];break;case 3:rgb=[0,X,C];break;case 4:rgb=[X,0,C];break;case 5:rgb=[C,0,X];break;}
rgb=[rgb[0]+m,rgb[1]+m,rgb[2]+m];}
return new Ext.draw.Color(rgb[0]*255,rgb[1]*255,rgb[2]*255);}},function(){var prototype=this.prototype;this.addStatics({fromHSL:function(){return prototype.fromHSL.apply(prototype,arguments);},fromString:function(){return prototype.fromString.apply(prototype,arguments);},toHex:function(){return prototype.toHex.apply(prototype,arguments);}});});Ext.define('Ext.AbstractPlugin',{disabled:false,isPlugin:true,constructor:function(config){this.pluginConfig=config;Ext.apply(this,config);},clonePlugin:function(overrideCfg){return new this.self(Ext.apply({},overrideCfg,this.pluginConfig));},setCmp:function(cmp){this.cmp=cmp;},getCmp:function(){return this.cmp;},init:Ext.emptyFn,destroy:Ext.emptyFn,enable:function(){this.disabled=false;},disable:function(){this.disabled=true;},onClassExtended:function(cls,data,hooks){var alias=data.alias;if(alias&&!data.ptype){if(Ext.isArray(alias)){alias=alias[0];}
cls.prototype.ptype=alias.split('plugin.')[1];}}});Ext.define('Ext.util.HashMap',{mixins:{observable:'Ext.util.Observable'},generation:0,constructor:function(config){config=config||{};var me=this,keyFn=config.keyFn;me.initialConfig=config;me.addEvents('add','clear','remove','replace');me.mixins.observable.constructor.call(me,config);me.clear(true);if(keyFn){me.getKey=keyFn;}},getCount:function(){return this.length;},getData:function(key,value){if(value===undefined){value=key;key=this.getKey(value);}
return[key,value];},getKey:function(o){return o.id;},add:function(key,value){var me=this;if(arguments.length===1){value=key;key=me.getKey(value);}
if(me.containsKey(key)){return me.replace(key,value);}
me.map[key]=value;++me.length;me.generation++;if(me.hasListeners.add){me.fireEvent('add',me,key,value);}
return value;},replace:function(key,value){var me=this,map=me.map,old;if(arguments.length===1){value=key;key=me.getKey(value);}
if(!me.containsKey(key)){me.add(key,value);}
old=map[key];map[key]=value;me.generation++;if(me.hasListeners.replace){me.fireEvent('replace',me,key,value,old);}
return value;},remove:function(o){var key=this.findKey(o);if(key!==undefined){return this.removeAtKey(key);}
return false;},removeAtKey:function(key){var me=this,value;if(me.containsKey(key)){value=me.map[key];delete me.map[key];--me.length;me.generation++;if(me.hasListeners.remove){me.fireEvent('remove',me,key,value);}
return true;}
return false;},get:function(key){var map=this.map;return map.hasOwnProperty(key)?map[key]:undefined;},clear:function(initial){var me=this;if(initial||me.generation){me.map={};me.length=0;me.generation=initial?0:me.generation+1;}
if(initial!==true&&me.hasListeners.clear){me.fireEvent('clear',me);}
return me;},containsKey:function(key){var map=this.map;return map.hasOwnProperty(key)&&map[key]!==undefined;},contains:function(value){return this.containsKey(this.findKey(value));},getKeys:function(){return this.getArray(true);},getValues:function(){return this.getArray(false);},getArray:function(isKey){var arr=[],key,map=this.map;for(key in map){if(map.hasOwnProperty(key)){arr.push(isKey?key:map[key]);}}
return arr;},each:function(fn,scope){var items=Ext.apply({},this.map),key,length=this.length;scope=scope||this;for(key in items){if(items.hasOwnProperty(key)){if(fn.call(scope,key,items[key],length)===false){break;}}}
return this;},clone:function(){var hash=new this.self(this.initialConfig),map=this.map,key;hash.suspendEvents();for(key in map){if(map.hasOwnProperty(key)){hash.add(key,map[key]);}}
hash.resumeEvents();return hash;},findKey:function(value){var key,map=this.map;for(key in map){if(map.hasOwnProperty(key)&&map[key]===value){return key;}}
return undefined;}});Ext.define('Ext.dom.Layer',{extend:'Ext.Element',uses:['Ext.Shadow'],alternateClassName:'Ext.Layer',statics:{shims:[]},isLayer:true,localXYNames:{get:'getLocalXY',set:'setLocalXY'},constructor:function(config,existingEl){config=config||{};var me=this,dh=Ext.DomHelper,cp=config.parentEl,pel=cp?Ext.getDom(cp):document.body,hm=config.hideMode,cls=Ext.baseCSSPrefix+(config.fixed&&!(Ext.isIE6||Ext.isIEQuirks)?'fixed-layer':'layer');me.el=me;if(existingEl){me.dom=Ext.getDom(existingEl);}
if(!me.dom){me.dom=dh.append(pel,config.dh||{tag:'div',cls:cls});}else{me.addCls(cls);if(!me.dom.parentNode){pel.appendChild(me.dom);}}
if(config.preventSync){me.preventSync=true;}
if(config.id){me.id=me.dom.id=config.id;}else{me.id=Ext.id(me.dom);}
Ext.Element.addToCache(me);if(config.cls){me.addCls(config.cls);}
me.constrain=config.constrain!==false;if(hm){me.setVisibilityMode(Ext.Element[hm.toUpperCase()]);if(me.visibilityMode==Ext.Element.ASCLASS){me.visibilityCls=config.visibilityCls;}}else if(config.useDisplay){me.setVisibilityMode(Ext.Element.DISPLAY);}else{me.setVisibilityMode(Ext.Element.VISIBILITY);}
if(config.shadow){me.shadowOffset=config.shadowOffset||4;me.shadow=new Ext.Shadow({offset:me.shadowOffset,mode:config.shadow,fixed:config.fixed});me.disableShadow();}else{me.shadowOffset=0;}
me.useShim=config.shim!==false&&Ext.useShims;if(config.hidden===true){me.hide();}else{me.show();}},getZIndex:function(){return parseInt((this.getShim()||this).getStyle('z-index'),10);},getShim:function(){var me=this,shim,pn;if(!me.useShim){return null;}
if(!me.shim){shim=me.self.shims.shift();if(!shim){shim=me.createShim();shim.enableDisplayMode('block');shim.hide();}
pn=me.dom.parentNode;if(shim.dom.parentNode!=pn){pn.insertBefore(shim.dom,me.dom);}
me.shim=shim;}
return me.shim;},hideShim:function(){var me=this;if(me.shim){me.shim.setDisplayed(false);me.self.shims.push(me.shim);delete me.shim;}},disableShadow:function(){var me=this;if(me.shadow&&!me.shadowDisabled){me.shadowDisabled=true;me.shadow.hide();me.lastShadowOffset=me.shadowOffset;me.shadowOffset=0;}},enableShadow:function(show){var me=this;if(me.shadow&&me.shadowDisabled){me.shadowDisabled=false;me.shadowOffset=me.lastShadowOffset;delete me.lastShadowOffset;if(show){me.sync(true);}}},sync:function(doShow){var me=this,shadow=me.shadow,shadowPos,shimStyle,shadowSize,shim,xy,x,y,w,h,shimIndex;if(me.preventSync){return;}
if(!me.updating&&me.isVisible()&&(shadow||me.useShim)){shim=me.getShim();xy=me[me.localXYNames.get]();x=xy[0];y=xy[1];w=me.dom.offsetWidth;h=me.dom.offsetHeight;if(shadow&&!me.shadowDisabled){if(doShow&&!shadow.isVisible()){shadow.show(me);}else{shadow.realign(x,y,w,h);}
if(shim){shimIndex=shim.getStyle('z-index');if(shimIndex>me.zindex){me.shim.setStyle('z-index',me.zindex-2);}
shim.show();if(shadow.isVisible()){shadowPos=shadow.el.getXY();shimStyle=shim.dom.style;shadowSize=shadow.el.getSize();if(Ext.supports.CSS3BoxShadow){shadowSize.height+=6;shadowSize.width+=4;shadowPos[0]-=2;shadowPos[1]-=4;}
shimStyle.left=(shadowPos[0])+'px';shimStyle.top=(shadowPos[1])+'px';shimStyle.width=(shadowSize.width)+'px';shimStyle.height=(shadowSize.height)+'px';}else{shim.setSize(w,h);shim[me.localXYNames.set](x,y);}}}else if(shim){shimIndex=shim.getStyle('z-index');if(shimIndex>me.zindex){me.shim.setStyle('z-index',me.zindex-2);}
shim.show();shim.setSize(w,h);shim[me.localXYNames.set](x,y);}}
return me;},remove:function(){this.hideUnders();this.callParent();},beginUpdate:function(){this.updating=true;},endUpdate:function(){this.updating=false;this.sync(true);},hideUnders:function(){if(this.shadow){this.shadow.hide();}
this.hideShim();},constrainXY:function(){if(this.constrain){var vw=Ext.Element.getViewWidth(),vh=Ext.Element.getViewHeight(),s=Ext.getDoc().getScroll(),xy=this.getXY(),x=xy[0],y=xy[1],so=this.shadowOffset,w=this.dom.offsetWidth+so,h=this.dom.offsetHeight+so,moved=false;if((x+w)>vw+s.left){x=vw-w-so;moved=true;}
if((y+h)>vh+s.top){y=vh-h-so;moved=true;}
if(x<s.left){x=s.left;moved=true;}
if(y<s.top){y=s.top;moved=true;}
if(moved){Ext.Layer.superclass.setXY.call(this,[x,y]);this.sync();}}
return this;},getConstrainOffset:function(){return this.shadowOffset;},setVisible:function(visible,animate,duration,callback,easing){var me=this,cb;cb=function(){if(visible){me.sync(true);}
if(callback){callback();}};if(!visible){me.hideUnders(true);}
me.callParent([visible,animate,duration,callback,easing]);if(!animate){cb();}
return me;},beforeFx:function(){this.beforeAction();return this.callParent(arguments);},afterFx:function(){this.callParent(arguments);this.sync(this.isVisible());},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide();}},setLeft:function(left){this.callParent(arguments);return this.sync();},setTop:function(top){this.callParent(arguments);return this.sync();},setLeftTop:function(left,top){this.callParent(arguments);return this.sync();},setLocalX:function(){this.callParent(arguments);return this.sync();},setLocalXY:function(){this.callParent(arguments);return this.sync();},setLocalY:function(){this.callParent(arguments);return this.sync();},setXY:function(xy,animate,duration,callback,easing){var me=this;callback=me.createCB(callback);me.fixDisplay();me.beforeAction();me.callParent([xy,animate,duration,callback,easing]);if(!animate){callback();}
return me;},createCB:function(callback){var me=this,showShadow=me.shadow&&me.shadow.isVisible();return function(){me.constrainXY();me.sync(showShadow);if(callback){callback();}};},setX:function(x,animate,duration,callback,easing){this.setXY([x,this.getY()],animate,duration,callback,easing);return this;},setY:function(y,animate,duration,callback,easing){this.setXY([this.getX(),y],animate,duration,callback,easing);return this;},setSize:function(w,h,animate,duration,callback,easing){var me=this;callback=me.createCB(callback);me.beforeAction();me.callParent([w,h,animate,duration,callback,easing]);if(!animate){callback();}
return me;},setWidth:function(w,animate,duration,callback,easing){var me=this;callback=me.createCB(callback);me.beforeAction();me.callParent([w,animate,duration,callback,easing]);if(!animate){callback();}
return me;},setHeight:function(h,animate,duration,callback,easing){var me=this;callback=me.createCB(callback);me.beforeAction();me.callParent([h,animate,duration,callback,easing]);if(!animate){callback();}
return me;},setBounds:function(x,y,width,height,animate,duration,callback,easing){var me=this;callback=me.createCB(callback);me.beforeAction();if(!animate){Ext.Layer.superclass.setXY.call(me,[x,y]);Ext.Layer.superclass.setSize.call(me,width,height);callback();}else{me.callParent([x,y,width,height,animate,duration,callback,easing]);}
return me;},setZIndex:function(zindex){var me=this;me.zindex=zindex;if(me.getShim()){me.shim.setStyle('z-index',zindex++);}
if(me.shadow){me.shadow.setZIndex(zindex++);}
return me.setStyle('z-index',zindex);},onOpacitySet:function(opacity){var shadow=this.shadow;if(shadow){shadow.setOpacity(opacity);}}});Ext.define('Ext.state.Provider',{mixins:{observable:'Ext.util.Observable'},prefix:'ext-',constructor:function(config){config=config||{};var me=this;Ext.apply(me,config);me.addEvents("statechange");me.state={};me.mixins.observable.constructor.call(me);},get:function(name,defaultValue){return typeof this.state[name]=="undefined"?defaultValue:this.state[name];},clear:function(name){var me=this;delete me.state[name];me.fireEvent("statechange",me,name,null);},set:function(name,value){var me=this;me.state[name]=value;me.fireEvent("statechange",me,name,value);},decodeValue:function(value){var me=this,re=/^(a|n|d|b|s|o|e)\:(.*)$/,matches=re.exec(unescape(value)),all,type,keyValue,values,vLen,v;if(!matches||!matches[1]){return;}
type=matches[1];value=matches[2];switch(type){case'e':return null;case'n':return parseFloat(value);case'd':return new Date(Date.parse(value));case'b':return(value=='1');case'a':all=[];if(value!=''){values=value.split('^');vLen=values.length;for(v=0;v<vLen;v++){value=values[v];all.push(me.decodeValue(value));}}
return all;case'o':all={};if(value!=''){values=value.split('^');vLen=values.length;for(v=0;v<vLen;v++){value=values[v];keyValue=value.split('=');all[keyValue[0]]=me.decodeValue(keyValue[1]);}}
return all;default:return value;}},encodeValue:function(value){var flat='',i=0,enc,len,key;if(value==null){return'e:1';}else if(typeof value=='number'){enc='n:'+value;}else if(typeof value=='boolean'){enc='b:'+(value?'1':'0');}else if(Ext.isDate(value)){enc='d:'+value.toGMTString();}else if(Ext.isArray(value)){for(len=value.length;i<len;i++){flat+=this.encodeValue(value[i]);if(i!=len-1){flat+='^';}}
enc='a:'+flat;}else if(typeof value=='object'){for(key in value){if(typeof value[key]!='function'&&value[key]!==undefined){flat+=key+'='+this.encodeValue(value[key])+'^';}}
enc='o:'+flat.substring(0,flat.length-1);}else{enc='s:'+value;}
return escape(enc);}});Ext.define('Ext.data.IdGenerator',{isGenerator:true,constructor:function(config){var me=this;Ext.apply(me,config);if(me.id){Ext.data.IdGenerator.all[me.id]=me;}},getRecId:function(rec){return rec.modelName+'-'+rec.internalId;},statics:{all:{},get:function(config){var generator,id,type;if(typeof config=='string'){id=type=config;config=null;}else if(config.isGenerator){return config;}else{id=config.id||config.type;type=config.type;}
generator=this.all[id];if(!generator){generator=Ext.create('idgen.'+type,config);}
return generator;}}});Ext.define('Ext.data.SortTypes',{singleton:true,none:Ext.identityFn,stripTagsRE:/<\/?[^>]+>/gi,asText:function(s){return String(s).replace(this.stripTagsRE,"");},asUCText:function(s){return String(s).toUpperCase().replace(this.stripTagsRE,"");},asUCString:function(s){return String(s).toUpperCase();},asDate:function(s){if(!s){return 0;}
if(Ext.isDate(s)){return s.getTime();}
return Date.parse(String(s));},asFloat:function(s){var val=parseFloat(String(s).replace(/,/g,""));return isNaN(val)?0:val;},asInt:function(s){var val=parseInt(String(s).replace(/,/g,""),10);return isNaN(val)?0:val;}});Ext.define('Ext.ElementLoader',{mixins:{observable:'Ext.util.Observable'},uses:['Ext.data.Connection','Ext.Ajax'],statics:{Renderer:{Html:function(loader,response,active){loader.getTarget().update(response.responseText,active.scripts===true);return true;}}},url:null,params:null,baseParams:null,autoLoad:false,target:null,loadMask:false,ajaxOptions:null,scripts:false,isLoader:true,constructor:function(config){var me=this,autoLoad;config=config||{};Ext.apply(me,config);me.setTarget(me.target);me.addEvents('beforeload','exception','load');me.mixins.observable.constructor.call(me);if(me.autoLoad){autoLoad=me.autoLoad;if(autoLoad===true){autoLoad={};}
me.load(autoLoad);}},setTarget:function(target){var me=this;target=Ext.get(target);if(me.target&&me.target!=target){me.abort();}
me.target=target;},getTarget:function(){return this.target||null;},abort:function(){var active=this.active;if(active!==undefined){Ext.Ajax.abort(active.request);if(active.mask){this.removeMask();}
delete this.active;}},removeMask:function(){this.target.unmask();},addMask:function(mask){this.target.mask(mask===true?null:mask);},load:function(options){options=Ext.apply({},options);var me=this,mask=Ext.isDefined(options.loadMask)?options.loadMask:me.loadMask,params=Ext.apply({},options.params),ajaxOptions=Ext.apply({},options.ajaxOptions),callback=options.callback||me.callback,scope=options.scope||me.scope||me;Ext.applyIf(ajaxOptions,me.ajaxOptions);Ext.applyIf(options,ajaxOptions);Ext.applyIf(params,me.params);Ext.apply(params,me.baseParams);Ext.applyIf(options,{url:me.url});Ext.apply(options,{scope:me,params:params,callback:me.onComplete});if(me.fireEvent('beforeload',me,options)===false){return;}
if(mask){me.addMask(mask);}
me.active={options:options,mask:mask,scope:scope,callback:callback,success:options.success||me.success,failure:options.failure||me.failure,renderer:options.renderer||me.renderer,scripts:Ext.isDefined(options.scripts)?options.scripts:me.scripts};me.active.request=Ext.Ajax.request(options);me.setOptions(me.active,options);},setOptions:Ext.emptyFn,onComplete:function(options,success,response){var me=this,active=me.active,scope;if(active){scope=active.scope;if(success){success=me.getRenderer(active.renderer).call(me,me,response,active)!==false;}
if(success){Ext.callback(active.success,scope,[me,response,options]);me.fireEvent('load',me,response,options);}else{Ext.callback(active.failure,scope,[me,response,options]);me.fireEvent('exception',me,response,options);}
Ext.callback(active.callback,scope,[me,success,response,options]);if(active.mask){me.removeMask();}}
delete me.active;},getRenderer:function(renderer){if(Ext.isFunction(renderer)){return renderer;}
return this.statics().Renderer.Html;},startAutoRefresh:function(interval,options){var me=this;me.stopAutoRefresh();me.autoRefresh=setInterval(function(){me.load(options);},interval);},stopAutoRefresh:function(){clearInterval(this.autoRefresh);delete this.autoRefresh;},isAutoRefreshing:function(){return Ext.isDefined(this.autoRefresh);},destroy:function(){var me=this;me.stopAutoRefresh();delete me.target;me.abort();me.clearListeners();}});Ext.define("Ext.form.Labelable",{requires:['Ext.XTemplate'],autoEl:{tag:'table',cellpadding:0},childEls:['labelCell','labelEl','bodyEl','sideErrorCell','errorEl','inputRow'],labelableRenderTpl:['<tr role="presentation" id="{id}-inputRow" <tpl if="inFormLayout">id="{id}"</tpl> class="{inputRowCls}">','<tpl if="labelOnLeft">','<td role="presentation" id="{id}-labelCell" style="{labelCellStyle}" {labelCellAttrs}>','{beforeLabelTpl}','<label id="{id}-labelEl" {labelAttrTpl}<tpl if="inputId"> for="{inputId}"</tpl> class="{labelCls}"','<tpl if="labelStyle"> style="{labelStyle}"</tpl>',' unselectable="on"','>','{beforeLabelTextTpl}','<tpl if="fieldLabel">{fieldLabel}{labelSeparator}</tpl>','{afterLabelTextTpl}','</label>','{afterLabelTpl}','</td>','</tpl>','<td role="presentation" class="{baseBodyCls} {fieldBodyCls} {extraFieldBodyCls}" id="{id}-bodyEl" colspan="{bodyColspan}" role="presentation">','{beforeBodyEl}','<tpl if="labelAlign==\'top\'">','{beforeLabelTpl}','<div role="presentation" id="{id}-labelCell" style="{labelCellStyle}">','<label id="{id}-labelEl" {labelAttrTpl}<tpl if="inputId"> for="{inputId}"</tpl> class="{labelCls}"','<tpl if="labelStyle"> style="{labelStyle}"</tpl>',' unselectable="on"','>','{beforeLabelTextTpl}','<tpl if="fieldLabel">{fieldLabel}{labelSeparator}</tpl>','{afterLabelTextTpl}','</label>','</div>','{afterLabelTpl}','</tpl>','{beforeSubTpl}','{[values.$comp.getSubTplMarkup(values)]}','{afterSubTpl}','<tpl if="msgTarget===\'side\'">','{afterBodyEl}','</td>','<td role="presentation" id="{id}-sideErrorCell" vAlign="{[values.labelAlign===\'top\' && !values.hideLabel ? \'bottom\' : \'middle\']}" style="{[values.autoFitErrors ? \'display:none\' : \'\']}" width="{errorIconWidth}">','<div role="presentation" id="{id}-errorEl" class="{errorMsgCls}" style="display:none"></div>','</td>','<tpl elseif="msgTarget==\'under\'">','<div role="presentation" id="{id}-errorEl" class="{errorMsgClass}" colspan="2" style="display:none"></div>','{afterBodyEl}','</td>','</tpl>','</tr>',{disableFormats:true}],activeErrorsTpl:undefined,htmlActiveErrorsTpl:['<tpl if="errors && errors.length">','<ul class="{listCls}"><tpl for="errors"><li role="alert">{.}</li></tpl></ul>','</tpl>'],plaintextActiveErrorsTpl:['<tpl if="errors && errors.length">','<tpl for="errors"><tpl if="xindex &gt; 1">\n</tpl>{.}</tpl>','</tpl>'],isFieldLabelable:true,formItemCls:Ext.baseCSSPrefix+'form-item',labelCls:Ext.baseCSSPrefix+'form-item-label',errorMsgCls:Ext.baseCSSPrefix+'form-error-msg',baseBodyCls:Ext.baseCSSPrefix+'form-item-body',inputRowCls:Ext.baseCSSPrefix+'form-item-input-row',fieldBodyCls:'',clearCls:Ext.baseCSSPrefix+'clear',invalidCls:Ext.baseCSSPrefix+'form-invalid',fieldLabel:undefined,labelAlign:'left',labelWidth:100,labelPad:5,labelSeparator:':',hideLabel:false,hideEmptyLabel:true,preventMark:false,autoFitErrors:true,msgTarget:'qtip',noWrap:true,labelableInsertions:['beforeBodyEl','afterBodyEl','beforeLabelTpl','afterLabelTpl','beforeSubTpl','afterSubTpl','beforeLabelTextTpl','afterLabelTextTpl','labelAttrTpl'],labelableRenderProps:['allowBlank','id','labelAlign','fieldBodyCls','extraFieldBodyCls','baseBodyCls','clearCls','labelSeparator','msgTarget','inputRowCls'],initLabelable:function(){var me=this,padding=me.padding;if(padding){me.padding=undefined;me.extraMargins=Ext.Element.parseBox(padding);}
if(!me.activeErrorsTpl){if(me.msgTarget=='title'){me.activeErrorsTpl=me.plaintextActiveErrorsTpl;}else{me.activeErrorsTpl=me.htmlActiveErrorsTpl;}}
me.addCls(Ext.plainTableCls);me.addCls(me.formItemCls);me.lastActiveError='';me.addEvents('errorchange');me.enableBubble('errorchange');},trimLabelSeparator:function(){var me=this,separator=me.labelSeparator,label=me.fieldLabel||'',lastChar=label.substr(label.length-1);return lastChar===separator?label.slice(0,-1):label;},getFieldLabel:function(){return this.trimLabelSeparator();},setFieldLabel:function(label){label=label||'';var me=this,separator=me.labelSeparator,labelEl=me.labelEl;me.fieldLabel=label;if(me.rendered){if(Ext.isEmpty(label)&&me.hideEmptyLabel){labelEl.parent().setDisplayed('none');}else{if(separator){label=me.trimLabelSeparator()+separator;}
labelEl.update(label);labelEl.parent().setDisplayed('');}
me.updateLayout();}},getInsertionRenderData:function(data,names){var i=names.length,name,value;while(i--){name=names[i];value=this[name];if(value){if(typeof value!='string'){if(!value.isTemplate){value=Ext.XTemplate.getTpl(this,name);}
value=value.apply(data);}}
data[name]=value||'';}
return data;},getLabelableRenderData:function(){var me=this,data,tempEl,topLabel=me.labelAlign==='top';if(!Ext.form.Labelable.errorIconWidth){tempEl=Ext.getBody().createChild({style:'position:absolute',cls:Ext.baseCSSPrefix+'form-invalid-icon'});Ext.form.Labelable.errorIconWidth=tempEl.getWidth()+tempEl.getMargin('l');tempEl.remove();}
data=Ext.copyTo({inFormLayout:me.ownerLayout&&me.ownerLayout.type==='form',inputId:me.getInputId(),labelOnLeft:!topLabel,hideLabel:!me.hasVisibleLabel(),fieldLabel:me.getFieldLabel(),labelCellStyle:me.getLabelCellStyle(),labelCellAttrs:me.getLabelCellAttrs(),labelCls:me.getLabelCls(),labelStyle:me.getLabelStyle(),bodyColspan:me.getBodyColspan(),externalError:!me.autoFitErrors,errorMsgCls:me.getErrorMsgCls(),errorIconWidth:Ext.form.Labelable.errorIconWidth},me,me.labelableRenderProps,true);me.getInsertionRenderData(data,me.labelableInsertions);return data;},xhooks:{beforeRender:function(){var me=this;me.setFieldDefaults(me.getHierarchyState().fieldDefaults);if(me.ownerLayout){me.addCls(Ext.baseCSSPrefix+me.ownerLayout.type+'-form-item');}},onRender:function(){var me=this,margins,side,style={};if(me.extraMargins){margins=me.el.getMargin();for(side in margins){if(margins.hasOwnProperty(side)){style['margin-'+side]=(margins[side]+me.extraMargins[side])+'px';}}
me.el.setStyle(style);}}},hasVisibleLabel:function(){if(this.hideLabel){return false;}
return!(this.hideEmptyLabel&&!this.getFieldLabel());},getLabelWidth:function(){var me=this;if(!me.hasVisibleLabel()){return 0;}
return me.labelWidth+me.labelPad;},getBodyColspan:function(){var me=this,result;if(me.msgTarget==='side'&&(!me.autoFitErrors||me.hasActiveError())){result=1;}else{result=2;}
if(me.labelAlign!=='top'&&!me.hasVisibleLabel()){result++;}
return result;},getLabelCls:function(){var labelCls=this.labelCls+' '+Ext.dom.Element.unselectableCls,labelClsExtra=this.labelClsExtra;return labelClsExtra?labelCls+' '+labelClsExtra:labelCls;},getLabelCellStyle:function(){var me=this,hideLabelCell=me.hideLabel||(!me.getFieldLabel()&&me.hideEmptyLabel);return hideLabelCell?'display:none;':'';},getErrorMsgCls:function(){var me=this,hideLabelCell=(me.hideLabel||(!me.fieldLabel&&me.hideEmptyLabel));return me.errorMsgCls+(!hideLabelCell&&me.labelAlign==='top'?' '+Ext.baseCSSPrefix+'lbl-top-err-icon':'');},getLabelCellAttrs:function(){var me=this,labelAlign=me.labelAlign,result='';if(labelAlign!=='top'){result='valign="top" halign="'+labelAlign+'" width="'+(me.labelWidth+me.labelPad)+'"';}
return result+' class="'+Ext.baseCSSPrefix+'field-label-cell"';},getLabelStyle:function(){var me=this,labelPad=me.labelPad,labelStyle='';if(me.labelAlign!=='top'){if(me.labelWidth){labelStyle='width:'+me.labelWidth+'px;';}
if(labelPad){labelStyle+='margin-right:'+labelPad+'px;';}}
return labelStyle+(me.labelStyle||'');},getSubTplMarkup:function(){return'';},getInputId:function(){return'';},getActiveError:function(){return this.activeError||'';},hasActiveError:function(){return!!this.getActiveError();},setActiveError:function(msg){this.setActiveErrors(msg);},getActiveErrors:function(){return this.activeErrors||[];},setActiveErrors:function(errors){errors=Ext.Array.from(errors);this.activeError=errors[0];this.activeErrors=errors;this.activeError=this.getTpl('activeErrorsTpl').apply({errors:errors,listCls:Ext.plainListCls});this.renderActiveError();},unsetActiveError:function(){delete this.activeError;delete this.activeErrors;this.renderActiveError();},renderActiveError:function(){var me=this,activeError=me.getActiveError(),hasError=!!activeError;if(activeError!==me.lastActiveError){me.fireEvent('errorchange',me,activeError);me.lastActiveError=activeError;}
if(me.rendered&&!me.isDestroyed&&!me.preventMark){me.el[hasError?'addCls':'removeCls'](me.invalidCls);me.getActionEl().dom.setAttribute('aria-invalid',hasError);if(me.errorEl){me.errorEl.dom.innerHTML=activeError;}}},setFieldDefaults:function(defaults){var key;for(key in defaults){if(!this.hasOwnProperty(key)){this[key]=defaults[key];}}}});Ext.define('Ext.util.TextMetrics',{statics:{shared:null,measure:function(el,text,fixedWidth){var me=this,shared=me.shared;if(!shared){shared=me.shared=new me(el,fixedWidth);}
shared.bind(el);shared.setFixedWidth(fixedWidth||'auto');return shared.getSize(text);},destroy:function(){var me=this;Ext.destroy(me.shared);me.shared=null;}},constructor:function(bindTo,fixedWidth){var me=this,measure=Ext.getBody().createChild({cls:Ext.baseCSSPrefix+'textmetrics'});me.measure=measure;if(bindTo){me.bind(bindTo);}
measure.position('absolute');measure.setLocalXY(-1000,-1000);measure.hide();if(fixedWidth){measure.setWidth(fixedWidth);}},getSize:function(text){var measure=this.measure,size;measure.update(text);size=measure.getSize();measure.update('');return size;},bind:function(el){var me=this;me.el=Ext.get(el);me.measure.setStyle(me.el.getStyles('font-size','font-style','font-weight','font-family','line-height','text-transform','letter-spacing'));},setFixedWidth:function(width){this.measure.setWidth(width);},getWidth:function(text){this.measure.dom.style.width='auto';return this.getSize(text).width;},getHeight:function(text){return this.getSize(text).height;},destroy:function(){var me=this;me.measure.remove();delete me.el;delete me.measure;}},function(){Ext.Element.addMethods({getTextWidth:function(text,min,max){return Ext.Number.constrain(Ext.util.TextMetrics.measure(this.dom,Ext.value(text,this.dom.innerHTML,true)).width,min||0,max||1000000);}});});Ext.define('Ext.dom.CompositeElementLite',{alternateClassName:'Ext.CompositeElementLite',requires:['Ext.dom.Element','Ext.dom.Query'],statics:{importElementMethods:function(){var name,elementPrototype=Ext.dom.Element.prototype,prototype=this.prototype;for(name in elementPrototype){if(typeof elementPrototype[name]=='function'){(function(key){prototype[key]=prototype[key]||function(){return this.invoke(key,arguments);};}).call(prototype,name);}}}},constructor:function(elements,root){this.elements=[];this.add(elements,root);this.el=new Ext.dom.AbstractElement.Fly();},isComposite:true,getElement:function(el){return this.el.attach(el);},transformElement:function(el){return Ext.getDom(el);},getCount:function(){return this.elements.length;},add:function(els,root){var elements=this.elements,i,ln;if(!els){return this;}
if(typeof els=="string"){els=Ext.dom.Element.selectorFunction(els,root);}
else if(els.isComposite){els=els.elements;}
else if(!Ext.isIterable(els)){els=[els];}
for(i=0,ln=els.length;i<ln;++i){elements.push(this.transformElement(els[i]));}
return this;},invoke:function(fn,args){var elements=this.elements,ln=elements.length,element,i;fn=Ext.dom.Element.prototype[fn];for(i=0;i<ln;i++){element=elements[i];if(element){fn.apply(this.getElement(element),args);}}
return this;},item:function(index){var el=this.elements[index],out=null;if(el){out=this.getElement(el);}
return out;},slice:function(){return this.elements.slice.apply(this.elements,arguments);},addListener:function(eventName,handler,scope,opt){var els=this.elements,len=els.length,i,e;for(i=0;i<len;i++){e=els[i];if(e){Ext.EventManager.on(e,eventName,handler,scope||e,opt);}}
return this;},each:function(fn,scope){var me=this,els=me.elements,len=els.length,i,e;for(i=0;i<len;i++){e=els[i];if(e){e=this.getElement(e);if(fn.call(scope||e,e,me,i)===false){break;}}}
return me;},fill:function(els){var me=this;me.elements=[];me.add(els);return me;},insert:function(index,nodes){Ext.Array.insert(this.elements,index,nodes);},filter:function(selector){var me=this,els=me.elements,len=els.length,out=[],i=0,isFunc=typeof selector=='function',add,el;for(;i<len;i++){el=els[i];add=false;if(el){el=me.getElement(el);if(isFunc){add=selector.call(el,el,me,i)!==false;}else{add=el.is(selector);}
if(add){out.push(me.transformElement(el));}}}
me.elements=out;return me;},indexOf:function(el){return Ext.Array.indexOf(this.elements,this.transformElement(el));},replaceElement:function(el,replacement,domReplace){var index=!isNaN(el)?el:this.indexOf(el),d;if(index>-1){replacement=Ext.getDom(replacement);if(domReplace){d=this.elements[index];d.parentNode.insertBefore(replacement,d);Ext.removeNode(d);}
Ext.Array.splice(this.elements,index,1,replacement);}
return this;},clear:function(removeDom){var me=this,els=me.elements,i=els.length-1;if(removeDom){for(;i>=0;i--){Ext.removeNode(els[i]);}}
this.elements=[];},addElements:function(els,root){if(!els){return this;}
if(typeof els=="string"){els=Ext.dom.Element.selectorFunction(els,root);}
var yels=this.elements,eLen=els.length,e;for(e=0;e<eLen;e++){yels.push(Ext.get(els[e]));}
return this;},first:function(){return this.item(0);},last:function(){return this.item(this.getCount()-1);},contains:function(el){return this.indexOf(el)!=-1;},removeElement:function(keys,removeDom){keys=[].concat(keys);var me=this,elements=me.elements,kLen=keys.length,val,el,k;for(k=0;k<kLen;k++){val=keys[k];if((el=(elements[val]||elements[val=me.indexOf(val)]))){if(removeDom){if(el.dom){el.remove();}else{Ext.removeNode(el);}}
Ext.Array.erase(elements,val,1);}}
return me;}},function(){this.importElementMethods();this.prototype.on=this.prototype.addListener;if(Ext.DomQuery){Ext.dom.Element.selectorFunction=Ext.DomQuery.select;}
Ext.dom.Element.select=function(selector,root){var elements;if(typeof selector=="string"){elements=Ext.dom.Element.selectorFunction(selector,root);}
else if(selector.length!==undefined){elements=selector;}
else{}
return new Ext.CompositeElementLite(elements);};Ext.select=function(){return Ext.dom.Element.select.apply(Ext.dom.Element,arguments);};});Ext.define('Ext.data.reader.Reader',{requires:['Ext.data.ResultSet','Ext.XTemplate'],alternateClassName:['Ext.data.Reader','Ext.data.DataReader'],mixins:{observable:'Ext.util.Observable'},totalProperty:'total',successProperty:'success',root:'',implicitIncludes:true,readRecordsOnFailure:true,isReader:true,applyDefaults:true,lastFieldGeneration:null,constructor:function(config){var me=this;me.mixins.observable.constructor.call(me,config);me.fieldCount=0;me.model=Ext.ModelManager.getModel(me.model);if(me.model&&me.model.prototype.fields){me.buildExtractors();}
this.addEvents('exception');},setModel:function(model,setOnProxy){var me=this;me.model=Ext.ModelManager.getModel(model);if(model){me.buildExtractors(true);}
if(setOnProxy&&me.proxy){me.proxy.setModel(me.model,true);}},read:function(response){var data;if(response){data=response.responseText?this.getResponseData(response):this.readRecords(response);}
return data||this.nullResultSet;},readRecords:function(data){var me=this,success,recordCount,records,root,total,value,message;if(me.lastFieldGeneration!==me.model.prototype.fields.generation){me.buildExtractors(true);}
me.rawData=data;data=me.getData(data);success=true;recordCount=0;records=[];if(me.successProperty){value=me.getSuccess(data);if(value===false||value==='false'){success=false;}}
if(me.messageProperty){message=me.getMessage(data);}
if(me.readRecordsOnFailure||success){root=Ext.isArray(data)?data:me.getRoot(data);if(root){total=root.length;}
if(me.totalProperty){value=parseInt(me.getTotal(data),10);if(!isNaN(value)){total=value;}}
if(root){records=me.extractData(root);recordCount=records.length;}}
return new Ext.data.ResultSet({total:total||recordCount,count:recordCount,records:records,success:success,message:message});},extractData:function(root){var me=this,Model=me.model,length=root.length,records=new Array(length),convertedValues,node,record,i;if(!root.length&&Ext.isObject(root)){root=[root];length=1;}
for(i=0;i<length;i++){node=root[i];if(node.isModel){records[i]=node;}else{records[i]=record=new Model(undefined,me.getId(node),node,convertedValues={});record.phantom=false;me.convertRecordData(convertedValues,node,record);if(me.implicitIncludes&&record.associations.length){me.readAssociated(record,node);}}}
return records;},readAssociated:function(record,data){var associations=record.associations.items,i=0,length=associations.length,association,associationData,proxy,reader;for(;i<length;i++){association=associations[i];associationData=this.getAssociatedDataRoot(data,association.associationKeyFunction||association.associationKey||association.name);if(associationData){reader=association.getReader();if(!reader){proxy=association.associatedModel.getProxy();if(proxy){reader=proxy.getReader();}else{reader=new this.constructor({model:association.associatedName});}}
association.read(record,reader,associationData);}}},getAssociatedDataRoot:function(data,associationName){if(Ext.isFunction(associationName)){return associationName(data);}
return data[associationName];},getFields:function(){return this.model.prototype.fields.items;},getData:Ext.identityFn,getRoot:Ext.identityFn,getResponseData:function(response){},onMetaChange:function(meta){var me=this,fields=meta.fields||me.getFields(),newModel,clientIdProperty;me.metaData=meta;me.root=meta.root||me.root;me.idProperty=meta.idProperty||me.idProperty;me.totalProperty=meta.totalProperty||me.totalProperty;me.successProperty=meta.successProperty||me.successProperty;me.messageProperty=meta.messageProperty||me.messageProperty;clientIdProperty=meta.clientIdProperty;if(me.model){me.model.setFields(fields,me.idProperty,clientIdProperty);me.setModel(me.model,true);}
else{newModel=Ext.define("Ext.data.reader.Json-Model"+Ext.id(),{extend:'Ext.data.Model',fields:fields,clientIdProperty:clientIdProperty});if(me.idProperty){newModel.idProperty=me.idProperty;}
me.setModel(newModel,true);}},getIdProperty:function(){var idField=this.model.prototype.idField,idProperty=this.idProperty;if(!idProperty&&idField&&(idProperty=idField.mapping)==null){idProperty=idField.name;}
return idProperty;},buildExtractors:function(force){var me=this,idProp=me.getIdProperty(),totalProp=me.totalProperty,successProp=me.successProperty,messageProp=me.messageProperty,accessor;if(force===true){delete me.convertRecordData;}
if(me.convertRecordData){return;}
if(totalProp){me.getTotal=me.createAccessor(totalProp);}
if(successProp){me.getSuccess=me.createAccessor(successProp);}
if(messageProp){me.getMessage=me.createAccessor(messageProp);}
if(idProp){accessor=me.createAccessor(idProp);me.getId=function(record){var id=accessor.call(me,record);return(id===undefined||id==='')?null:id;};}else{me.getId=function(){return null;};}
me.convertRecordData=me.buildRecordDataExtractor();me.lastFieldGeneration=me.model.prototype.fields.generation;},recordDataExtractorTemplate:['var me = this\n','    ,fields = me.model.prototype.fields\n','    ,value\n','    ,internalId\n','<tpl for="fields">','    ,__field{#} = fields.map["{name}"]\n','</tpl>',';\n','return function(dest, source, record) {\n','<tpl for="fields">','{% var fieldAccessExpression =  this.createFieldAccessExpression(values, "__field" + xindex, "source");','   if (fieldAccessExpression) { %}','    value = {[ this.createFieldAccessExpression(values, "__field" + xindex, "source") ]};\n','<tpl if="hasCustomConvert">','    dest["{name}"] = value === undefined ? __field{#}.convert(__field{#}.defaultValue, record) : __field{#}.convert(value, record);\n','<tpl elseif="defaultValue !== undefined">','    if (value === undefined) {\n','        if (me.applyDefaults) {\n','<tpl if="convert">','            dest["{name}"] = __field{#}.convert(__field{#}.defaultValue, record);\n','<tpl else>','            dest["{name}"] = __field{#}.defaultValue\n','</tpl>','        };\n','    } else {\n','<tpl if="convert">','        dest["{name}"] = __field{#}.convert(value, record);\n','<tpl else>','        dest["{name}"] = value;\n','</tpl>','    };\n','<tpl else>','    if (value !== undefined) {\n','<tpl if="convert">','        dest["{name}"] = __field{#}.convert(value, record);\n','<tpl else>','        dest["{name}"] = value;\n','</tpl>','    }\n','</tpl>','{% } else { %}','<tpl if="defaultValue !== undefined">','<tpl if="convert">','    dest["{name}"] = __field{#}.convert(__field{#}.defaultValue, record);\n','<tpl else>','    dest["{name}"] = __field{#}.defaultValue\n','</tpl>','</tpl>','{% } %}','</tpl>','<tpl if="clientIdProp">','    if (record && (internalId = {[ this.createFieldAccessExpression(\{mapping: values.clientIdProp\}, null, "source") ]})) {\n','        record.{["internalId"]} = internalId;\n','    }\n','</tpl>','};'],buildRecordDataExtractor:function(){var me=this,modelProto=me.model.prototype,templateData={clientIdProp:modelProto.clientIdProperty,fields:modelProto.fields.items};me.recordDataExtractorTemplate.createFieldAccessExpression=function(){return me.createFieldAccessExpression.apply(me,arguments);};return Ext.functionFactory(me.recordDataExtractorTemplate.apply(templateData)).call(me);},destroyReader:function(){var me=this;delete me.proxy;delete me.model;delete me.convertRecordData;delete me.getId;delete me.getTotal;delete me.getSuccess;delete me.getMessage;}},function(){var proto=this.prototype;Ext.apply(proto,{nullResultSet:new Ext.data.ResultSet({total:0,count:0,records:[],success:true,message:''}),recordDataExtractorTemplate:new Ext.XTemplate(proto.recordDataExtractorTemplate)});});Ext.define('Ext.state.Manager',{singleton:true,requires:['Ext.state.Provider'],constructor:function(){this.provider=new Ext.state.Provider();},setProvider:function(stateProvider){this.provider=stateProvider;},get:function(key,defaultValue){return this.provider.get(key,defaultValue);},set:function(key,value){this.provider.set(key,value);},clear:function(key){this.provider.clear(key);},getProvider:function(){return this.provider;}});Ext.define('Ext.util.AbstractMixedCollection',{requires:['Ext.util.Filter'],mixins:{observable:'Ext.util.Observable'},isMixedCollection:true,generation:0,indexGeneration:0,constructor:function(allowFunctions,keyFn){var me=this;if(arguments.length===1&&Ext.isObject(allowFunctions)){me.initialConfig=allowFunctions;Ext.apply(me,allowFunctions);}
else{me.allowFunctions=allowFunctions===true;if(keyFn){me.getKey=keyFn;}
me.initialConfig={allowFunctions:me.allowFunctions,getKey:me.getKey};}
me.items=[];me.map={};me.keys=[];me.indexMap={};me.length=0;me.mixins.observable.constructor.call(me);},allowFunctions:false,add:function(key,obj){var len=this.length,out;if(arguments.length===1){out=this.insert(len,key);}else{out=this.insert(len,key,obj);}
return out;},getKey:function(o){return o.id;},replace:function(key,o){var me=this,old,index;if(arguments.length==1){o=arguments[0];key=me.getKey(o);}
old=me.map[key];if(typeof key=='undefined'||key===null||typeof old=='undefined'){return me.add(key,o);}
me.generation++;index=me.indexOfKey(key);me.items[index]=o;me.map[key]=o;if(me.hasListeners.replace){me.fireEvent('replace',key,old,o);}
return o;},updateKey:function(oldKey,newKey){var me=this,map=me.map,indexMap=me.indexMap,index=me.indexOfKey(oldKey),item;if(index>-1){item=map[oldKey];delete map[oldKey];delete indexMap[oldKey];map[newKey]=item;indexMap[newKey]=index;me.keys[index]=newKey;me.generation++;}},addAll:function(objs){var me=this,key;if(arguments.length>1||Ext.isArray(objs)){me.insert(me.length,arguments.length>1?arguments:objs);}else{for(key in objs){if(objs.hasOwnProperty(key)){if(me.allowFunctions||typeof objs[key]!='function'){me.add(key,objs[key]);}}}}},each:function(fn,scope){var items=Ext.Array.push([],this.items),i=0,len=items.length,item;for(;i<len;i++){item=items[i];if(fn.call(scope||item,item,i,len)===false){break;}}},eachKey:function(fn,scope){var keys=this.keys,items=this.items,i=0,len=keys.length;for(;i<len;i++){fn.call(scope||window,keys[i],items[i],i,len);}},findBy:function(fn,scope){var keys=this.keys,items=this.items,i=0,len=items.length;for(;i<len;i++){if(fn.call(scope||window,items[i],keys[i])){return items[i];}}
return null;},find:function(){if(Ext.isDefined(Ext.global.console)){Ext.global.console.warn('Ext.util.MixedCollection: find has been deprecated. Use findBy instead.');}
return this.findBy.apply(this,arguments);},insert:function(index,key,obj){var out;if(Ext.isIterable(key)){out=this.doInsert(index,key,obj);}else{if(arguments.length>2){out=this.doInsert(index,[key],[obj]);}else{out=this.doInsert(index,[key]);}
out=out[0];}
return out;},doInsert:function(index,keys,objects){var me=this,itemKey,removeIndex,i,len=keys.length,deDupedLen=len,fireAdd=me.hasListeners.add,syncIndices,newKeys={},passedDuplicates,oldKeys,oldObjects;if(objects!=null){me.useLinearSearch=true;}
else{objects=keys;keys=new Array(len);for(i=0;i<len;i++){keys[i]=this.getKey(objects[i]);}}
me.suspendEvents();for(i=0;i<len;i++){itemKey=keys[i];removeIndex=me.indexOfKey(itemKey);if(removeIndex!==-1){if(removeIndex<index){index--;}
me.removeAt(removeIndex);}
if(itemKey!=null){if(newKeys[itemKey]!=null){passedDuplicates=true;deDupedLen--;}
newKeys[itemKey]=i;}}
me.resumeEvents();if(passedDuplicates){oldKeys=keys;oldObjects=objects;keys=new Array(deDupedLen);objects=new Array(deDupedLen);i=0;for(itemKey in newKeys){keys[i]=oldKeys[newKeys[itemKey]];objects[i]=oldObjects[newKeys[itemKey]];i++;}
len=deDupedLen;}
syncIndices=index===me.length&&me.indexGeneration===me.generation;Ext.Array.insert(me.items,index,objects);Ext.Array.insert(me.keys,index,keys);me.length+=len;me.generation++;if(syncIndices){me.indexGeneration=me.generation;}
for(i=0;i<len;i++,index++){itemKey=keys[i];if(itemKey!=null){me.map[itemKey]=objects[i];if(syncIndices){me.indexMap[itemKey]=index;}}
if(fireAdd){me.fireEvent('add',index,objects[i],itemKey);}}
return objects;},remove:function(o){var me=this,removeKey,index;if(!me.useLinearSearch&&(removeKey=me.getKey(o))){index=me.indexOfKey(removeKey);}
else{index=Ext.Array.indexOf(me.items,o);}
return(index===-1)?false:me.removeAt(index);},removeAll:function(items){var me=this,i;if(items||me.hasListeners.remove){if(items){for(i=items.length-1;i>=0;--i){me.remove(items[i]);}}else{while(me.length){me.removeAt(0);}}}else{me.length=me.items.length=me.keys.length=0;me.map={};me.indexMap={};me.generation++;me.indexGeneration=me.generation;}},removeAt:function(index){var me=this,o,key;if(index<me.length&&index>=0){me.length--;o=me.items[index];Ext.Array.erase(me.items,index,1);key=me.keys[index];if(typeof key!='undefined'){delete me.map[key];}
Ext.Array.erase(me.keys,index,1);if(me.hasListeners.remove){me.fireEvent('remove',o,key);}
me.generation++;return o;}
return false;},removeRange:function(index,removeCount){var me=this,o,key,i,limit,syncIndices,trimming;if(index<me.length&&index>=0){if(!removeCount){removeCount=1;}
limit=Math.min(index+removeCount,me.length);removeCount=limit-index;trimming=limit===me.length;syncIndices=trimming&&me.indexGeneration===me.generation;for(i=index;i<limit;i++){key=me.keys[i];if(key!=null){delete me.map[key];if(syncIndices){delete me.indexMap[key];}}}
o=me.items[i-1];me.length-=removeCount;me.generation++;if(syncIndices){me.indexGeneration=me.generation;}
if(trimming){me.items.length=me.keys.length=me.length;}else{me.items.splice(index,removeCount);me.keys.splice(index,removeCount);}
return o;}
return false;},removeAtKey:function(key){var me=this,keys=me.keys,i;if(key==null){for(i=keys.length-1;i>=0;i--){if(keys[i]==null){me.removeAt(i);}}}
else{return me.removeAt(me.indexOfKey(key));}},getCount:function(){return this.length;},indexOf:function(o){var me=this,key;if(o!=null){if(!me.useLinearSearch&&(key=me.getKey(o))){return this.indexOfKey(key);}
return Ext.Array.indexOf(me.items,o);}
return-1;},indexOfKey:function(key){if(!this.map.hasOwnProperty(key)){return-1;}
if(this.indexGeneration!==this.generation){this.rebuildIndexMap();}
return this.indexMap[key];},rebuildIndexMap:function(){var me=this,indexMap=me.indexMap={},keys=me.keys,len=keys.length,i;for(i=0;i<len;i++){indexMap[keys[i]]=i;}
me.indexGeneration=me.generation;},get:function(key){var me=this,mk=me.map[key],item=mk!==undefined?mk:(typeof key=='number')?me.items[key]:undefined;return typeof item!='function'||me.allowFunctions?item:null;},getAt:function(index){return this.items[index];},getByKey:function(key){return this.map[key];},contains:function(o){var me=this,key;if(o!=null){if(!me.useLinearSearch&&(key=me.getKey(o))){return this.map[key]!=null;}
return Ext.Array.indexOf(this.items,o)!==-1;}
return false;},containsKey:function(key){return this.map.hasOwnProperty(key);},clear:function(){var me=this;if(me.generation){me.length=0;me.items=[];me.keys=[];me.map={};me.indexMap={};me.generation++;me.indexGeneration=me.generation;}
if(me.hasListeners.clear){me.fireEvent('clear');}},first:function(){return this.items[0];},last:function(){return this.items[this.length-1];},sum:function(property,root,start,end){var values=this.extractValues(property,root),length=values.length,sum=0,i;start=start||0;end=(end||end===0)?end:length-1;for(i=start;i<=end;i++){sum+=values[i];}
return sum;},collect:function(property,root,allowNull){var values=this.extractValues(property,root),length=values.length,hits={},unique=[],value,strValue,i;for(i=0;i<length;i++){value=values[i];strValue=String(value);if((allowNull||!Ext.isEmpty(value))&&!hits[strValue]){hits[strValue]=true;unique.push(value);}}
return unique;},extractValues:function(property,root){var values=this.items;if(root){values=Ext.Array.pluck(values,root);}
return Ext.Array.pluck(values,property);},hasRange:function(start,end){return(end<this.length);},getRange:function(start,end){var me=this,items=me.items,range=[],len=items.length,tmp,reverse;if(len<1){return range;}
if(start>end){reverse=true;tmp=start;start=end;end=tmp;}
if(start<0){start=0;}
if(end==null||end>=len){end=len-1;}
range=items.slice(start,end+1);if(reverse&&range.length){range.reverse();}
return range;},filter:function(property,value,anyMatch,caseSensitive){var filters=[];if(Ext.isString(property)){filters.push(new Ext.util.Filter({property:property,value:value,anyMatch:anyMatch,caseSensitive:caseSensitive}));}else if(Ext.isArray(property)||property instanceof Ext.util.Filter){filters=filters.concat(property);}
return this.filterBy(Ext.util.Filter.createFilterFn(filters));},filterBy:function(fn,scope){var me=this,newMC=new me.self(me.initialConfig),keys=me.keys,items=me.items,length=items.length,i;newMC.getKey=me.getKey;for(i=0;i<length;i++){if(fn.call(scope||me,items[i],keys[i])){newMC.add(keys[i],items[i]);}}
return newMC;},findIndex:function(property,value,start,anyMatch,caseSensitive){if(Ext.isEmpty(value,false)){return-1;}
value=this.createValueMatcher(value,anyMatch,caseSensitive);return this.findIndexBy(function(o){return o&&value.test(o[property]);},null,start);},findIndexBy:function(fn,scope,start){var me=this,keys=me.keys,items=me.items,i=start||0,len=items.length;for(;i<len;i++){if(fn.call(scope||me,items[i],keys[i])){return i;}}
return-1;},createValueMatcher:function(value,anyMatch,caseSensitive,exactMatch){if(!value.exec){var er=Ext.String.escapeRegex;value=String(value);if(anyMatch===true){value=er(value);}else{value='^'+er(value);if(exactMatch===true){value+='$';}}
value=new RegExp(value,caseSensitive?'':'i');}
return value;},clone:function(){var me=this,copy=new this.self(me.initialConfig);copy.add(me.keys,me.items);return copy;}});Ext.define('Ext.data.Connection',{mixins:{observable:'Ext.util.Observable'},requires:['Ext.data.flash.BinaryXhr'],statics:{requestId:0},url:null,async:true,method:null,username:'',password:'',disableCaching:true,withCredentials:false,binary:false,cors:false,isXdr:false,defaultXdrContentType:'text/plain',disableCachingParam:'_dc',timeout:30000,useDefaultHeader:true,defaultPostHeader:'application/x-www-form-urlencoded; charset=UTF-8',useDefaultXhrHeader:true,defaultXhrHeader:'XMLHttpRequest',constructor:function(config){config=config||{};Ext.apply(this,config);this.requests={};this.mixins.observable.constructor.call(this);},request:function(options){options=options||{};var me=this,scope=options.scope||window,username=options.username||me.username,password=options.password||me.password||'',async,requestOptions,request,headers,xhr;if(me.fireEvent('beforerequest',me,options)!==false){requestOptions=me.setOptions(options,scope);if(me.isFormUpload(options)){me.upload(options.form,requestOptions.url,requestOptions.data,options);return null;}
if(options.autoAbort||me.autoAbort){me.abort();}
async=options.async!==false?(options.async||me.async):false;xhr=me.openRequest(options,requestOptions,async,username,password);if(!me.isXdr){headers=me.setupHeaders(xhr,options,requestOptions.data,requestOptions.params);}
request={id:++Ext.data.Connection.requestId,xhr:xhr,headers:headers,options:options,async:async,binary:options.binary||me.binary,timeout:setTimeout(function(){request.timedout=true;me.abort(request);},options.timeout||me.timeout)};me.requests[request.id]=request;me.latestId=request.id;if(async){if(!me.isXdr){xhr.onreadystatechange=Ext.Function.bind(me.onStateChange,me,[request]);}}
if(me.isXdr){me.processXdrRequest(request,xhr);}
xhr.send(requestOptions.data);if(!async){return me.onComplete(request);}
return request;}else{Ext.callback(options.callback,options.scope,[options,undefined,undefined]);return null;}},processXdrRequest:function(request,xhr){var me=this;delete request.headers;request.contentType=request.options.contentType||me.defaultXdrContentType;xhr.onload=Ext.Function.bind(me.onStateChange,me,[request,true]);xhr.onerror=xhr.ontimeout=Ext.Function.bind(me.onStateChange,me,[request,false]);},processXdrResponse:function(response,xhr){response.getAllResponseHeaders=function(){return[];};response.getResponseHeader=function(){return'';};response.contentType=xhr.contentType||this.defaultXdrContentType;},upload:function(form,url,params,options){form=Ext.getDom(form);options=options||{};var id=Ext.id(),frame=document.createElement('iframe'),hiddens=[],encoding='multipart/form-data',buf={target:form.target,method:form.method,encoding:form.encoding,enctype:form.enctype,action:form.action},addField=function(name,value){hiddenItem=document.createElement('input');Ext.fly(hiddenItem).set({type:'hidden',value:value,name:name});form.appendChild(hiddenItem);hiddens.push(hiddenItem);},hiddenItem,obj,value,name,vLen,v,hLen,h;Ext.fly(frame).set({id:id,name:id,cls:Ext.baseCSSPrefix+'hide-display',src:Ext.SSL_SECURE_URL});document.body.appendChild(frame);if(document.frames){document.frames[id].name=id;}
Ext.fly(form).set({target:id,method:'POST',enctype:encoding,encoding:encoding,action:url||buf.action});if(params){obj=Ext.Object.fromQueryString(params)||{};for(name in obj){if(obj.hasOwnProperty(name)){value=obj[name];if(Ext.isArray(value)){vLen=value.length;for(v=0;v<vLen;v++){addField(name,value[v]);}}else{addField(name,value);}}}}
Ext.fly(frame).on('load',Ext.Function.bind(this.onUploadComplete,this,[frame,options]),null,{single:!Ext.isOpera});form.submit();Ext.fly(form).set(buf);hLen=hiddens.length;for(h=0;h<hLen;h++){Ext.removeNode(hiddens[h]);}},onUploadComplete:function(frame,options){var me=this,response={responseText:'',responseXML:null},callback,success,doc,contentNode;try{doc=frame.contentWindow.document||frame.contentDocument||window.frames[frame.id].document;if(doc){if(Ext.isOpera&&doc.location=='about:blank'){return;}
if(doc.body){if((contentNode=doc.body.firstChild)&&/pre/i.test(contentNode.tagName)){response.responseText=contentNode.textContent;}
else if((contentNode=doc.getElementsByTagName('textarea')[0])){response.responseText=contentNode.value;}
else{response.responseText=doc.body.textContent||doc.body.innerText;}}
response.responseXML=doc.XMLDocument||doc;callback=options.success;success=true;}}catch(e){response.responseText='{success:false,message:"'+Ext.String.trim(e.message||e.description)+'"}';callback=options.failure;success=false;}
me.fireEvent('requestcomplete',me,response,options);Ext.callback(callback,options.scope,[response,options]);Ext.callback(options.callback,options.scope,[options,success,response]);setTimeout(function(){Ext.removeNode(frame);},100);},isFormUpload:function(options){var form=this.getForm(options);if(form){return(options.isUpload||(/multipart\/form-data/i).test(form.getAttribute('enctype')));}
return false;},getForm:function(options){return Ext.getDom(options.form)||null;},setOptions:function(options,scope){var me=this,params=options.params||{},extraParams=me.extraParams,urlParams=options.urlParams,url=options.url||me.url,jsonData=options.jsonData,method,disableCache,data;if(Ext.isFunction(params)){params=params.call(scope,options);}
if(Ext.isFunction(url)){url=url.call(scope,options);}
url=this.setupUrl(options,url);data=options.rawData||options.binaryData||options.xmlData||jsonData||null;if(jsonData&&!Ext.isPrimitive(jsonData)){data=Ext.encode(data);}
if(options.binaryData){if(me.nativeBinaryPostSupport()){data=(new Uint8Array(options.binaryData));if((Ext.isChrome&&Ext.chromeVersion<22)||Ext.isSafari||Ext.isGecko){data=data.buffer;}}}
if(Ext.isObject(params)){params=Ext.Object.toQueryString(params);}
if(Ext.isObject(extraParams)){extraParams=Ext.Object.toQueryString(extraParams);}
params=params+((extraParams)?((params)?'&':'')+extraParams:'');urlParams=Ext.isObject(urlParams)?Ext.Object.toQueryString(urlParams):urlParams;params=this.setupParams(options,params);method=(options.method||me.method||((params||data)?'POST':'GET')).toUpperCase();this.setupMethod(options,method);disableCache=options.disableCaching!==false?(options.disableCaching||me.disableCaching):false;if(method==='GET'&&disableCache){url=Ext.urlAppend(url,(options.disableCachingParam||me.disableCachingParam)+'='+(new Date().getTime()));}
if((method=='GET'||data)&&params){url=Ext.urlAppend(url,params);params=null;}
if(urlParams){url=Ext.urlAppend(url,urlParams);}
return{url:url,method:method,data:data||params||null};},setupUrl:function(options,url){var form=this.getForm(options);if(form){url=url||form.action;}
return url;},setupParams:function(options,params){var form=this.getForm(options),serializedForm;if(form&&!this.isFormUpload(options)){serializedForm=Ext.Element.serializeForm(form);params=params?(params+'&'+serializedForm):serializedForm;}
return params;},setupMethod:function(options,method){if(this.isFormUpload(options)){return'POST';}
return method;},setupHeaders:function(xhr,options,data,params){var me=this,headers=Ext.apply({},options.headers||{},me.defaultHeaders||{}),contentType=me.defaultPostHeader,jsonData=options.jsonData,xmlData=options.xmlData,key,header;if(!headers['Content-Type']&&(data||params)){if(data){if(options.rawData){contentType='text/plain';}else{if(xmlData&&Ext.isDefined(xmlData)){contentType='text/xml';}else if(jsonData&&Ext.isDefined(jsonData)){contentType='application/json';}}}
headers['Content-Type']=contentType;}
if(me.useDefaultXhrHeader&&!headers['X-Requested-With']){headers['X-Requested-With']=me.defaultXhrHeader;}
try{for(key in headers){if(headers.hasOwnProperty(key)){header=headers[key];xhr.setRequestHeader(key,header);}}}catch(e){me.fireEvent('exception',key,header);}
return headers;},newRequest:function(options){var me=this,xhr;if(options.binaryData){if(me.nativeBinaryPostSupport()){xhr=this.getXhrInstance();}else{xhr=new Ext.data.flash.BinaryXhr();}}else if((options.cors||me.cors)&&Ext.isIE&&Ext.ieVersion<=9){xhr=me.getXdrInstance();me.isXdr=true;}else{xhr=me.getXhrInstance();}
return xhr;},openRequest:function(options,requestOptions,async,username,password){var me=this,xhr=me.newRequest(options);if(username){xhr.open(requestOptions.method,requestOptions.url,async,username,password);}else{if(me.isXdr){xhr.open(requestOptions.method,requestOptions.url);}else{xhr.open(requestOptions.method,requestOptions.url,async);}}
if(options.binary||me.binary){if(window.Uint8Array){xhr.responseType='arraybuffer';}else if(xhr.overrideMimeType){xhr.overrideMimeType('text\/plain; charset=x-user-defined');}}
if(options.withCredentials||me.withCredentials){xhr.withCredentials=true;}
return xhr;},getXdrInstance:function(){var xdr;if(Ext.ieVersion>=8){xdr=new XDomainRequest();}else{Ext.Error.raise({msg:'Your browser does not support CORS'});}
return xdr;},getXhrInstance:(function(){var options=[function(){return new XMLHttpRequest();},function(){return new ActiveXObject('MSXML2.XMLHTTP.3.0');},function(){return new ActiveXObject('MSXML2.XMLHTTP');},function(){return new ActiveXObject('Microsoft.XMLHTTP');}],i=0,len=options.length,xhr;for(;i<len;++i){try{xhr=options[i];xhr();break;}catch(e){}}
return xhr;}()),isLoading:function(request){if(!request){request=this.getLatest();}
if(!(request&&request.xhr)){return false;}
var state=request.xhr.readyState;return((request.xhr instanceof Ext.data.flash.BinaryXhr)&&state!=4)||!(state===0||state==4);},abort:function(request){var me=this,xhr;if(!request){request=me.getLatest();}
if(request&&me.isLoading(request)){xhr=request.xhr;try{xhr.onreadystatechange=null;}catch(e){xhr.onreadystatechange=Ext.emptyFn;}
xhr.abort();me.clearTimeout(request);if(!request.timedout){request.aborted=true;}
me.onComplete(request);me.cleanup(request);}},abortAll:function(){var requests=this.requests,id;for(id in requests){if(requests.hasOwnProperty(id)){this.abort(requests[id]);}}},getLatest:function(){var id=this.latestId,request;if(id){request=this.requests[id];}
return request||null;},onStateChange:function(request,xdrResult){var me=this;if((request.xhr&&request.xhr.readyState==4)||me.isXdr){me.clearTimeout(request);me.onComplete(request,xdrResult);me.cleanup(request);Ext.EventManager.idleEvent.fire();}},clearTimeout:function(request){clearTimeout(request.timeout);delete request.timeout;},cleanup:function(request){request.xhr=null;delete request.xhr;},onComplete:function(request,xdrResult){var me=this,options=request.options,result,success,response;try{result=me.parseStatus(request.xhr.status);}catch(e){result={success:false,isException:false};}
success=me.isXdr?xdrResult:result.success;if(success){response=me.createResponse(request);me.fireEvent('requestcomplete',me,response,options);Ext.callback(options.success,options.scope,[response,options]);}else{if(result.isException||request.aborted||request.timedout){response=me.createException(request);}else{response=me.createResponse(request);}
me.fireEvent('requestexception',me,response,options);Ext.callback(options.failure,options.scope,[response,options]);}
Ext.callback(options.callback,options.scope,[options,success,response]);delete me.requests[request.id];return response;},parseStatus:function(status){status=status==1223?204:status;var success=(status>=200&&status<300)||status==304,isException=false;if(!success){switch(status){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:isException=true;break;}}
return{success:success,isException:isException};},createResponse:function(request){var me=this,xhr=request.xhr,isXdr=me.isXdr,headers={},lines=isXdr?[]:xhr.getAllResponseHeaders().replace(/\r\n/g,'\n').split('\n'),count=lines.length,line,index,key,response,byteArray;while(count--){line=lines[count];index=line.indexOf(':');if(index>=0){key=line.substr(0,index).toLowerCase();if(line.charAt(index+1)==' '){++index;}
headers[key]=line.substr(index+1);}}
request.xhr=null;delete request.xhr;response={request:request,requestId:request.id,status:xhr.status,statusText:xhr.statusText,getResponseHeader:function(header){return headers[header.toLowerCase()];},getAllResponseHeaders:function(){return headers;}};if(isXdr){me.processXdrResponse(response,xhr);}
if(request.binary){response.responseBytes=me.getByteArray(xhr);}else{response.responseText=xhr.responseText;response.responseXML=xhr.responseXML;}
xhr=null;return response;},createException:function(request){return{request:request,requestId:request.id,status:request.aborted?-1:0,statusText:request.aborted?'transaction aborted':'communication failure',aborted:request.aborted,timedout:request.timedout};},getByteArray:function(xhr){var response=xhr.response,responseBody=xhr.responseBody,byteArray,responseText,len,i;if(xhr instanceof Ext.data.flash.BinaryXhr){byteArray=xhr.responseBytes;}else if(window.Uint8Array){byteArray=response?new Uint8Array(response):[];}else if(Ext.isIE9p){try{byteArray=new VBArray(responseBody).toArray();}catch(e){byteArray=[];}}else if(Ext.isIE){if(!this.self.vbScriptInjected){this.injectVBScript();}
getIEByteArray(xhr.responseBody,byteArray=[]);}else{byteArray=[];responseText=xhr.responseText;len=responseText.length;for(i=0;i<len;i++){byteArray.push(responseText.charCodeAt(i)&0xFF);}}
return byteArray;},injectVBScript:function(){var scriptTag=document.createElement('script');scriptTag.type='text/vbscript';scriptTag.text=['Function getIEByteArray(byteArray, out)','Dim len, i','len = LenB(byteArray)','For i = 1 to len','out.push(AscB(MidB(byteArray, i, 1)))','Next','End Function'].join('\n');Ext.getHead().dom.appendChild(scriptTag);this.self.vbScriptInjected=true;},nativeBinaryPostSupport:function(){return Ext.isChrome||(Ext.isSafari&&Ext.isDefined(window.Uint8Array))||(Ext.isGecko&&Ext.isDefined(window.Uint8Array));}});Ext.define('Ext.layout.container.boxOverflow.Scroller',{extend:'Ext.layout.container.boxOverflow.None',requires:['Ext.util.ClickRepeater','Ext.Element'],alternateClassName:'Ext.layout.boxOverflow.Scroller',mixins:{observable:'Ext.util.Observable'},animateScroll:false,scrollIncrement:20,wheelIncrement:10,scrollRepeatInterval:60,scrollDuration:400,scrollerCls:Ext.baseCSSPrefix+'box-scroller',constructor:function(layout,config){var me=this;me.layout=layout;Ext.apply(me,config||{});me.mixins.observable.constructor.call(me);me.addEvents('scroll');me.scrollPosition=0;me.scrollSize=0;},getPrefixConfig:function(){var me=this,layout=me.layout,owner=layout.owner,cls;me.initCSSClasses();cls=Ext.layout.container.Box.prototype.innerCls+' '+me.beforeCtCls;if(owner.plain){cls+=' '+me.scrollerCls+'-plain';}
return{cls:cls,cn:{id:owner.id+layout.names.beforeScrollerSuffix,cls:me.scrollerCls+' '+me.beforeScrollerCls,style:'display:none'}};},getSuffixConfig:function(){var me=this,layout=me.layout,owner=layout.owner,cls=Ext.layout.container.Box.prototype.innerCls+' '+me.afterCtCls;if(owner.plain){cls+=' '+me.scrollerCls+'-plain';}
return{cls:cls,cn:{id:owner.id+layout.names.afterScrollerSuffix,cls:me.scrollerCls+' '+me.afterScrollerCls,style:'display:none'}};},getOverflowCls:function(){return Ext.baseCSSPrefix+this.layout.direction+'-box-overflow-body';},initCSSClasses:function(){var me=this,prefix=Ext.baseCSSPrefix,layout=me.layout,names=layout.names,beforeXName=names.beforeX,afterXName=names.afterX,type=me.getOwnerType(layout.owner);me.beforeCtCls=me.beforeCtCls||prefix+'box-scroller-'+beforeXName;me.afterCtCls=me.afterCtCls||prefix+'box-scroller-'+afterXName;me.beforeScrollerCls=me.beforeScrollerCls||prefix+type+'-scroll-'+beforeXName;me.afterScrollerCls=me.afterScrollerCls||prefix+type+'-scroll-'+afterXName;},beginLayout:function(ownerContext){var layout=this.layout;ownerContext.innerCtScrollPos=this.getScrollPosition();this.callParent(arguments);},completeLayout:function(ownerContext){var me=this,plan=ownerContext.state.boxPlan,names=me.layout.names,last;if(plan&&plan.tooNarrow){last=ownerContext.childItems[ownerContext.childItems.length-1];me.scrollSize=last.props[names.x]+last.props[names.width];me.updateScrollButtons();}
this.callParent(arguments);},finishedLayout:function(ownerContext){var me=this,layout=me.layout,scrollPos=Math.min(me.getMaxScrollPosition(),ownerContext.innerCtScrollPos);layout.innerCt[layout.names.setScrollLeft](scrollPos);},handleOverflow:function(ownerContext){var me=this,methodName=me.layout.names.getWidth;me.showScrollers();return{reservedSpace:me.beforeCt[methodName]()+me.afterCt[methodName]()};},captureChildElements:function(){var me=this,el=me.layout.owner.el,before,after,hoverCls,pressedSuffix,pressedCls,hoverSuffix;if(!me.beforeCt){hoverSuffix='-hover';pressedSuffix='-pressed';hoverCls=me.scrollerCls+hoverSuffix;pressedCls=me.scrollerCls+pressedSuffix;before=me.beforeScroller=el.getById(me.layout.owner.id+'-before-scroller');after=me.afterScroller=el.getById(me.layout.owner.id+'-after-scroller');me.beforeCt=before.up('');me.afterCt=after.up('');me.createWheelListener();before.addClsOnOver(hoverCls);before.addClsOnOver(me.beforeScrollerCls+hoverSuffix);before.addClsOnClick(pressedCls);before.addClsOnClick(me.beforeScrollerCls+pressedSuffix);after.addClsOnOver(hoverCls);after.addClsOnOver(me.afterScrollerCls+hoverSuffix);after.addClsOnClick(pressedCls);after.addClsOnClick(me.afterScrollerCls+pressedSuffix);before.setVisibilityMode(Ext.Element.DISPLAY);after.setVisibilityMode(Ext.Element.DISPLAY);me.beforeRepeater=new Ext.util.ClickRepeater(before,{interval:me.scrollRepeatInterval,handler:me.scrollLeft,scope:me});me.afterRepeater=new Ext.util.ClickRepeater(after,{interval:me.scrollRepeatInterval,handler:me.scrollRight,scope:me});}},createWheelListener:function(){var me=this;me.layout.innerCt.on({mousewheel:function(e){me.scrollBy(me.getWheelDelta(e)*me.wheelIncrement*-1,false);},stopEvent:true});},getWheelDelta:function(e){return e.getWheelDelta();},clearOverflow:function(){this.hideScrollers();},showScrollers:function(){var me=this;me.captureChildElements();me.beforeScroller.show();me.afterScroller.show();me.layout.owner.addClsWithUI(me.layout.direction==='vertical'?'vertical-scroller':'scroller');},hideScrollers:function(){var me=this;if(me.beforeScroller!==undefined){me.beforeScroller.hide();me.afterScroller.hide();me.layout.owner.removeClsWithUI(me.layout.direction==='vertical'?'vertical-scroller':'scroller');}},destroy:function(){var me=this;Ext.destroy(me.beforeRepeater,me.afterRepeater,me.beforeScroller,me.afterScroller,me.beforeCt,me.afterCt);},scrollBy:function(delta,animate){this.scrollTo(this.getScrollPosition()+delta,animate);},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this};},updateScrollButtons:function(){var me=this,beforeMeth,afterMeth,beforeCls,afterCls,disabledCls,suffix='-disabled';if(me.beforeScroller==null||me.afterScroller==null){return;}
beforeMeth=me.atExtremeBefore()?'addCls':'removeCls';afterMeth=me.atExtremeAfter()?'addCls':'removeCls';disabledCls=me.scrollerCls+suffix;beforeCls=[disabledCls,me.beforeScrollerCls+suffix];afterCls=[disabledCls,me.afterScrollerCls+suffix];me.beforeScroller[beforeMeth](beforeCls);me.afterScroller[afterMeth](afterCls);me.scrolling=false;},scrollLeft:function(){this.scrollBy(-this.scrollIncrement,false);},scrollRight:function(){this.scrollBy(this.scrollIncrement,false);},getScrollPosition:function(){var me=this,layout=me.layout,result;if(isNaN(me.scrollPosition)){result=layout.innerCt[layout.names.getScrollLeft]();}else{result=me.scrollPosition;}
return result;},getMaxScrollPosition:function(){var me=this,layout=me.layout,maxScrollPos=me.scrollSize-layout.innerCt[layout.names.getWidth]();return(maxScrollPos<0)?0:maxScrollPos;},atExtremeBefore:function(){return!this.getScrollPosition();},atExtremeAfter:function(){return this.getScrollPosition()>=this.getMaxScrollPosition();},scrollTo:function(position,animate){var me=this,layout=me.layout,names=layout.names,oldPosition=me.getScrollPosition(),newPosition=Ext.Number.constrain(position,0,me.getMaxScrollPosition());if(newPosition!=oldPosition&&!me.scrolling){me.scrollPosition=NaN;if(animate===undefined){animate=me.animateScroll;}
layout.innerCt[names.scrollTo](names.beforeScrollX,newPosition,animate?me.getScrollAnim():false);if(animate){me.scrolling=true;}else{me.updateScrollButtons();}
me.fireEvent('scroll',me,newPosition,animate?me.getScrollAnim():false);}},scrollToItem:function(item,animate){var me=this,layout=me.layout,owner=layout.owner,names=layout.names,visibility,box,newPos;item=me.getItem(item);if(item!==undefined){if(item==owner.items.first()){newPos=0}else if(item===owner.items.last()){newPos=me.getMaxScrollPosition();}else{visibility=me.getItemVisibility(item);if(!visibility.fullyVisible){box=item.getBox(false,true);newPos=box[names.x];if(visibility.hiddenEnd){newPos-=(me.layout.innerCt[names.getWidth]()-box[names.width]);}}}
if(newPos!==undefined){me.scrollTo(newPos,animate);}}},getItemVisibility:function(item){var me=this,box=me.getItem(item).getBox(true,true),layout=me.layout,names=layout.names,itemStart=box[names.x],itemEnd=itemStart+box[names.width],scrollStart=me.getScrollPosition(),scrollEnd=scrollStart+layout.innerCt[names.getWidth]();return{hiddenStart:itemStart<scrollStart,hiddenEnd:itemEnd>scrollEnd,fullyVisible:itemStart>scrollStart&&itemEnd<scrollEnd};}});Ext.define('Ext.fx.target.Component',{extend:'Ext.fx.target.Target',type:'component',getPropMethod:{top:function(){return this.getPosition(true)[1];},left:function(){return this.getPosition(true)[0];},x:function(){return this.getPosition()[0];},y:function(){return this.getPosition()[1];},height:function(){return this.getHeight();},width:function(){return this.getWidth();},opacity:function(){return this.el.getStyle('opacity');}},setMethods:{top:'setPosition',left:'setPosition',x:'setPagePosition',y:'setPagePosition',height:'setSize',width:'setSize',opacity:'setOpacity'},getAttr:function(attr,val){return[[this.target,val!==undefined?val:this.getPropMethod[attr].call(this.target)]];},setAttr:function(targetData,isFirstFrame,isLastFrame){var me=this,ln=targetData.length,attrs,attr,o,i,j,targets,left,top,w,h,methodsToCall={},methodProps;for(i=0;i<ln;i++){attrs=targetData[i].attrs;for(attr in attrs){targets=attrs[attr].length;for(j=0;j<targets;j++){o=attrs[attr][j];methodProps=methodsToCall[me.setMethods[attr]]||(methodsToCall[me.setMethods[attr]]={});methodProps.target=o[0];methodProps[attr]=o[1];}}
if(methodsToCall.setPosition){o=methodsToCall.setPosition;left=(o.left===undefined)?undefined:parseFloat(o.left);top=(o.top===undefined)?undefined:parseFloat(o.top);o.target.setPosition(left,top);}
if(methodsToCall.setPagePosition){o=methodsToCall.setPagePosition;o.target.setPagePosition(o.x,o.y);}
if(methodsToCall.setSize){o=methodsToCall.setSize;w=(o.width===undefined)?o.target.getWidth():parseFloat(o.width);h=(o.height===undefined)?o.target.getHeight():parseFloat(o.height);o.target.el.setSize(w,h);if(isLastFrame||me.dynamic){Ext.globalEvents.on({idle:Ext.Function.bind(o.target.setSize,o.target,[w,h]),single:true});}}
if(methodsToCall.setOpacity){o=methodsToCall.setOpacity;o.target.el.setStyle('opacity',o.opacity);}}}});Ext.define('Ext.ComponentLoader',{extend:'Ext.ElementLoader',statics:{Renderer:{Data:function(loader,response,active){var success=true;try{loader.getTarget().update(Ext.decode(response.responseText));}catch(e){success=false;}
return success;},Component:function(loader,response,active){var success=true,target=loader.getTarget(),items=[];try{items=Ext.decode(response.responseText);}catch(e){success=false;}
if(success){target.suspendLayouts();if(active.removeAll){target.removeAll();}
target.add(items);target.resumeLayouts(true);}
return success;}}},target:null,loadMask:false,renderer:'html',setTarget:function(target){var me=this;if(Ext.isString(target)){target=Ext.getCmp(target);}
if(me.target&&me.target!=target){me.abort();}
me.target=target;},removeMask:function(){this.target.setLoading(false);},addMask:function(mask){this.target.setLoading(mask);},setOptions:function(active,options){active.removeAll=Ext.isDefined(options.removeAll)?options.removeAll:this.removeAll;},getRenderer:function(renderer){if(Ext.isFunction(renderer)){return renderer;}
var renderers=this.statics().Renderer;switch(renderer){case'component':return renderers.Component;case'data':return renderers.Data;default:return Ext.ElementLoader.Renderer.Html;}}});Ext.define('Ext.util.LruCache',{extend:'Ext.util.HashMap',constructor:function(config){Ext.apply(this,config);this.callParent([config]);},add:function(key,newValue){var me=this,existingKey=me.findKey(newValue),entry;if(existingKey){me.unlinkEntry(entry=me.map[existingKey]);entry.prev=me.last;entry.next=null;}
else{entry={prev:me.last,next:null,key:key,value:newValue};}
if(me.last){me.last.next=entry;}
else{me.first=entry;}
me.last=entry;me.callParent([key,entry]);me.prune();return newValue;},insertBefore:function(key,newValue,sibling){var me=this,existingKey,entry;if(sibling=this.map[this.findKey(sibling)]){existingKey=me.findKey(newValue);if(existingKey){me.unlinkEntry(entry=me.map[existingKey]);}
else{entry={prev:sibling.prev,next:sibling,key:key,value:newValue};}
if(sibling.prev){entry.prev.next=entry;}else{me.first=entry;}
entry.next=sibling;sibling.prev=entry;me.prune();return newValue;}
else{return me.add(key,newValue);}},get:function(key){var entry=this.map[key];if(entry){if(entry.next){this.moveToEnd(entry);}
return entry.value;}},removeAtKey:function(key){this.unlinkEntry(this.map[key]);return this.callParent(arguments);},clear:function(initial){this.first=this.last=null;return this.callParent(arguments);},unlinkEntry:function(entry){if(entry){if(entry.next){entry.next.prev=entry.prev;}else{this.last=entry.prev;}
if(entry.prev){entry.prev.next=entry.next;}else{this.first=entry.next;}
entry.prev=entry.next=null;}},moveToEnd:function(entry){this.unlinkEntry(entry);if(entry.prev=this.last){this.last.next=entry;}
else{this.first=entry;}
this.last=entry;},getArray:function(isKey){var arr=[],entry=this.first;while(entry){arr.push(isKey?entry.key:entry.value);entry=entry.next;}
return arr;},each:function(fn,scope,reverse){var me=this,entry=reverse?me.last:me.first,length=me.length;scope=scope||me;while(entry){if(fn.call(scope,entry.key,entry.value,length)===false){break;}
entry=reverse?entry.prev:entry.next;}
return me;},findKey:function(value){var key,map=this.map;for(key in map){if(map.hasOwnProperty(key)&&map[key].value===value){return key;}}
return undefined;},clone:function(){var newCache=new this.self(this.initialConfig),map=this.map,key;newCache.suspendEvents();for(key in map){if(map.hasOwnProperty(key)){newCache.add(key,map[key].value);}}
newCache.resumeEvents();return newCache;},prune:function(){var me=this,purgeCount=me.maxSize?(me.length-me.maxSize):0;if(purgeCount>0){for(;me.first&&purgeCount;purgeCount--){me.removeAtKey(me.first.key);}}}});Ext.define('Ext.util.KeyNav',{alternateClassName:'Ext.KeyNav',requires:['Ext.util.KeyMap'],statics:{keyOptions:{left:37,right:39,up:38,down:40,space:32,pageUp:33,pageDown:34,del:46,backspace:8,home:36,end:35,enter:13,esc:27,tab:9}},constructor:function(config){var me=this;if(arguments.length===2){me.legacyConstructor.apply(me,arguments);return;}
me.setConfig(config);},legacyConstructor:function(el,config){this.setConfig(Ext.apply({target:el},config));},setConfig:function(config){var me=this,keymapCfg={target:config.target,ignoreInputFields:config.ignoreInputFields,eventName:me.getKeyEvent('forceKeyDown'in config?config.forceKeyDown:me.forceKeyDown,config.eventName)},map,keyCodes,defaultScope,keyName,binding;if(me.map){me.map.destroy();}
if(config.processEvent){keymapCfg.processEvent=config.processEvent;keymapCfg.processEventScope=config.processEventScope||me;}
if(config.keyMap){map=me.map=config.keyMap;}
else{map=me.map=new Ext.util.KeyMap(keymapCfg);me.destroyKeyMap=true;}
keyCodes=Ext.util.KeyNav.keyOptions;defaultScope=config.scope||me;for(keyName in keyCodes){if(keyCodes.hasOwnProperty(keyName)){if(binding=config[keyName]){if(typeof binding==='function'){binding={handler:binding,defaultEventAction:(config.defaultEventAction!==undefined)?config.defaultEventAction:me.defaultEventAction};}
map.addBinding({key:keyCodes[keyName],handler:Ext.Function.bind(me.handleEvent,binding.scope||defaultScope,binding.handler||binding.fn,true),defaultEventAction:(binding.defaultEventAction!==undefined)?binding.defaultEventAction:me.defaultEventAction});}}}
map.disable();if(!config.disabled){map.enable();}},handleEvent:function(keyCode,event,handler){return handler.call(this,event);},disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,eventName:'keypress',destroy:function(removeEl){if(this.destroyKeyMap){this.map.destroy(removeEl);}
delete this.map;},enable:function(){if(this.map){this.map.enable();this.disabled=false;}},disable:function(){if(this.map){this.map.disable();}
this.disabled=true;},setDisabled:function(disabled){this.map.setDisabled(disabled);this.disabled=disabled;},getKeyEvent:function(forceKeyDown,configuredEventName){if(forceKeyDown||(Ext.EventManager.useKeyDown&&!configuredEventName)){return'keydown';}else{return configuredEventName||this.eventName;}}});Ext.define('Ext.util.Grouper',{extend:'Ext.util.Sorter',isGrouper:true,getGroupString:function(instance){return instance.get(this.property);}});Ext.define("Ext.util.Sortable",{isSortable:true,defaultSortDirection:"ASC",requires:['Ext.util.Sorter'],statics:{createComparator:function(sorters){return sorters&&sorters.length?function(r1,r2){var result=sorters[0].sort(r1,r2),length=sorters.length,i=1;for(;i<length;i++){result=result||sorters[i].sort.call(this,r1,r2);}
return result;}:function(){return 0;};}},initSortable:function(){var me=this,sorters=me.sorters;me.sorters=new Ext.util.AbstractMixedCollection(false,function(item){return item.id||item.property;});if(sorters){me.sorters.addAll(me.decodeSorters(sorters));}},sort:function(sorters,direction,where,doSort){var me=this,sorter,newSorters;if(Ext.isArray(sorters)){doSort=where;where=direction;newSorters=sorters;}
else if(Ext.isObject(sorters)){doSort=where;where=direction;newSorters=[sorters];}
else if(Ext.isString(sorters)){sorter=me.sorters.get(sorters);if(!sorter){sorter={property:sorters,direction:direction};newSorters=[sorter];}
else if(direction===undefined){sorter.toggle();}
else{sorter.setDirection(direction);}}
if(newSorters&&newSorters.length){newSorters=me.decodeSorters(newSorters);if(Ext.isString(where)){if(where==='prepend'){me.sorters.insert(0,newSorters);}
else{me.sorters.addAll(newSorters);}}
else{me.sorters.clear();me.sorters.addAll(newSorters);}}
if(doSort!==false){me.fireEvent('beforesort',me,newSorters);me.onBeforeSort(newSorters);sorters=me.sorters.items;if(sorters.length){me.doSort(me.generateComparator());}}
return sorters;},generateComparator:function(){var sorters=this.sorters.getRange();return sorters.length?this.createComparator(sorters):this.emptyComparator;},emptyComparator:function(){return 0;},onBeforeSort:Ext.emptyFn,decodeSorters:function(sorters){if(!Ext.isArray(sorters)){if(sorters===undefined){sorters=[];}else{sorters=[sorters];}}
var length=sorters.length,Sorter=Ext.util.Sorter,fields=this.model?this.model.prototype.fields:null,field,config,i;for(i=0;i<length;i++){config=sorters[i];if(!(config instanceof Sorter)){if(Ext.isString(config)){config={property:config};}
Ext.applyIf(config,{root:this.sortRoot,direction:"ASC"});if(config.fn){config.sorterFn=config.fn;}
if(typeof config=='function'){config={sorterFn:config};}
if(fields&&!config.transform){field=fields.get(config.property);config.transform=field&&field.sortType!==Ext.identityFn?field.sortType:undefined;}
sorters[i]=new Ext.util.Sorter(config);}}
return sorters;},getSorters:function(){return this.sorters.items;},getFirstSorter:function(){var sorters=this.sorters.items,len=sorters.length,i=0,sorter;for(;i<len;++i){sorter=sorters[i];if(!sorter.isGrouper){return sorter;}}
return null;}},function(){this.prototype.createComparator=this.createComparator;});Ext.define('Ext.draw.Draw',{singleton:true,requires:['Ext.draw.Color'],pathToStringRE:/,?([achlmqrstvxz]),?/gi,pathCommandRE:/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,pathValuesRE:/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,stopsRE:/^(\d+%?)$/,radian:Math.PI/180,availableAnimAttrs:{along:"along",blur:null,"clip-rect":"csv",cx:null,cy:null,fill:"color","fill-opacity":null,"font-size":null,height:null,opacity:null,path:"path",r:null,rotation:"csv",rx:null,ry:null,scale:"csv",stroke:"color","stroke-opacity":null,"stroke-width":null,translation:"csv",width:null,x:null,y:null},is:function(o,type){type=String(type).toLowerCase();return(type=="object"&&o===Object(o))||(type=="undefined"&&typeof o==type)||(type=="null"&&o===null)||(type=="array"&&Array.isArray&&Array.isArray(o))||(Object.prototype.toString.call(o).toLowerCase().slice(8,-1))==type;},ellipsePath:function(sprite){var attr=sprite.attr;return Ext.String.format("M{0},{1}A{2},{3},0,1,1,{0},{4}A{2},{3},0,1,1,{0},{1}z",attr.x,attr.y-attr.ry,attr.rx,attr.ry,attr.y+attr.ry);},rectPath:function(sprite){var attr=sprite.attr;if(attr.radius){return Ext.String.format("M{0},{1}l{2},0a{3},{3},0,0,1,{3},{3}l0,{5}a{3},{3},0,0,1,{4},{3}l{6},0a{3},{3},0,0,1,{4},{4}l0,{7}a{3},{3},0,0,1,{3},{4}z",attr.x+attr.radius,attr.y,attr.width-attr.radius*2,attr.radius,-attr.radius,attr.height-attr.radius*2,attr.radius*2-attr.width,attr.radius*2-attr.height);}
else{return Ext.String.format("M{0},{1}L{2},{1},{2},{3},{0},{3}z",attr.x,attr.y,attr.width+attr.x,attr.height+attr.y);}},path2string:function(){return this.join(",").replace(Ext.draw.Draw.pathToStringRE,"$1");},pathToString:function(arrayPath){return arrayPath.join(",").replace(Ext.draw.Draw.pathToStringRE,"$1");},parsePathString:function(pathString){if(!pathString){return null;}
var paramCounts={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},data=[],me=this;if(me.is(pathString,"array")&&me.is(pathString[0],"array")){data=me.pathClone(pathString);}
if(!data.length){String(pathString).replace(me.pathCommandRE,function(a,b,c){var params=[],name=b.toLowerCase();c.replace(me.pathValuesRE,function(a,b){b&&params.push(+b);});if(name=="m"&&params.length>2){data.push([b].concat(Ext.Array.splice(params,0,2)));name="l";b=(b=="m")?"l":"L";}
while(params.length>=paramCounts[name]){data.push([b].concat(Ext.Array.splice(params,0,paramCounts[name])));if(!paramCounts[name]){break;}}});}
data.toString=me.path2string;return data;},mapPath:function(path,matrix){if(!matrix){return path;}
var x,y,i,ii,j,jj,pathi;path=this.path2curve(path);for(i=0,ii=path.length;i<ii;i++){pathi=path[i];for(j=1,jj=pathi.length;j<jj-1;j+=2){x=matrix.x(pathi[j],pathi[j+1]);y=matrix.y(pathi[j],pathi[j+1]);pathi[j]=x;pathi[j+1]=y;}}
return path;},pathClone:function(pathArray){var res=[],j,jj,i,ii;if(!this.is(pathArray,"array")||!this.is(pathArray&&pathArray[0],"array")){pathArray=this.parsePathString(pathArray);}
for(i=0,ii=pathArray.length;i<ii;i++){res[i]=[];for(j=0,jj=pathArray[i].length;j<jj;j++){res[i][j]=pathArray[i][j];}}
res.toString=this.path2string;return res;},pathToAbsolute:function(pathArray){if(!this.is(pathArray,"array")||!this.is(pathArray&&pathArray[0],"array")){pathArray=this.parsePathString(pathArray);}
var res=[],x=0,y=0,mx=0,my=0,i=0,ln=pathArray.length,r,pathSegment,j,ln2;if(ln&&pathArray[0][0]=="M"){x=+pathArray[0][1];y=+pathArray[0][2];mx=x;my=y;i++;res[0]=["M",x,y];}
for(;i<ln;i++){r=res[i]=[];pathSegment=pathArray[i];if(pathSegment[0]!=pathSegment[0].toUpperCase()){r[0]=pathSegment[0].toUpperCase();switch(r[0]){case"A":r[1]=pathSegment[1];r[2]=pathSegment[2];r[3]=pathSegment[3];r[4]=pathSegment[4];r[5]=pathSegment[5];r[6]=+(pathSegment[6]+x);r[7]=+(pathSegment[7]+y);break;case"V":r[1]=+pathSegment[1]+y;break;case"H":r[1]=+pathSegment[1]+x;break;case"M":mx=+pathSegment[1]+x;my=+pathSegment[2]+y;default:j=1;ln2=pathSegment.length;for(;j<ln2;j++){r[j]=+pathSegment[j]+((j%2)?x:y);}}}
else{j=0;ln2=pathSegment.length;for(;j<ln2;j++){res[i][j]=pathSegment[j];}}
switch(r[0]){case"Z":x=mx;y=my;break;case"H":x=r[1];break;case"V":y=r[1];break;case"M":pathSegment=res[i];ln2=pathSegment.length;mx=pathSegment[ln2-2];my=pathSegment[ln2-1];default:pathSegment=res[i];ln2=pathSegment.length;x=pathSegment[ln2-2];y=pathSegment[ln2-1];}}
res.toString=this.path2string;return res;},pathToRelative:function(pathArray){if(!this.is(pathArray,"array")||!this.is(pathArray&&pathArray[0],"array")){pathArray=this.parsePathString(pathArray);}
var res=[],x=0,y=0,mx=0,my=0,start=0,r,pa,i,j,k,len,ii,jj,kk;if(pathArray[0][0]=="M"){x=pathArray[0][1];y=pathArray[0][2];mx=x;my=y;start++;res.push(["M",x,y]);}
for(i=start,ii=pathArray.length;i<ii;i++){r=res[i]=[];pa=pathArray[i];if(pa[0]!=pa[0].toLowerCase()){r[0]=pa[0].toLowerCase();switch(r[0]){case"a":r[1]=pa[1];r[2]=pa[2];r[3]=pa[3];r[4]=pa[4];r[5]=pa[5];r[6]=+(pa[6]-x).toFixed(3);r[7]=+(pa[7]-y).toFixed(3);break;case"v":r[1]=+(pa[1]-y).toFixed(3);break;case"m":mx=pa[1];my=pa[2];default:for(j=1,jj=pa.length;j<jj;j++){r[j]=+(pa[j]-((j%2)?x:y)).toFixed(3);}}}else{r=res[i]=[];if(pa[0]=="m"){mx=pa[1]+x;my=pa[2]+y;}
for(k=0,kk=pa.length;k<kk;k++){res[i][k]=pa[k];}}
len=res[i].length;switch(res[i][0]){case"z":x=mx;y=my;break;case"h":x+=+res[i][len-1];break;case"v":y+=+res[i][len-1];break;default:x+=+res[i][len-2];y+=+res[i][len-1];}}
res.toString=this.path2string;return res;},path2curve:function(path){var me=this,points=me.pathToAbsolute(path),ln=points.length,attrs={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i,seg,segLn,point;for(i=0;i<ln;i++){points[i]=me.command2curve(points[i],attrs);if(points[i].length>7){points[i].shift();point=points[i];while(point.length){Ext.Array.splice(points,i++,0,["C"].concat(Ext.Array.splice(point,0,6)));}
Ext.Array.erase(points,i,1);ln=points.length;i--;}
seg=points[i];segLn=seg.length;attrs.x=seg[segLn-2];attrs.y=seg[segLn-1];attrs.bx=parseFloat(seg[segLn-4])||attrs.x;attrs.by=parseFloat(seg[segLn-3])||attrs.y;}
return points;},interpolatePaths:function(path,path2){var me=this,p=me.pathToAbsolute(path),p2=me.pathToAbsolute(path2),attrs={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},attrs2={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},fixArc=function(pp,i){if(pp[i].length>7){pp[i].shift();var pi=pp[i];while(pi.length){Ext.Array.splice(pp,i++,0,["C"].concat(Ext.Array.splice(pi,0,6)));}
Ext.Array.erase(pp,i,1);ii=Math.max(p.length,p2.length||0);}},fixM=function(path1,path2,a1,a2,i){if(path1&&path2&&path1[i][0]=="M"&&path2[i][0]!="M"){Ext.Array.splice(path2,i,0,["M",a2.x,a2.y]);a1.bx=0;a1.by=0;a1.x=path1[i][1];a1.y=path1[i][2];ii=Math.max(p.length,p2.length||0);}},i,ii,seg,seg2,seglen,seg2len;for(i=0,ii=Math.max(p.length,p2.length||0);i<ii;i++){p[i]=me.command2curve(p[i],attrs);fixArc(p,i);(p2[i]=me.command2curve(p2[i],attrs2));fixArc(p2,i);fixM(p,p2,attrs,attrs2,i);fixM(p2,p,attrs2,attrs,i);seg=p[i];seg2=p2[i];seglen=seg.length;seg2len=seg2.length;attrs.x=seg[seglen-2];attrs.y=seg[seglen-1];attrs.bx=parseFloat(seg[seglen-4])||attrs.x;attrs.by=parseFloat(seg[seglen-3])||attrs.y;attrs2.bx=(parseFloat(seg2[seg2len-4])||attrs2.x);attrs2.by=(parseFloat(seg2[seg2len-3])||attrs2.y);attrs2.x=seg2[seg2len-2];attrs2.y=seg2[seg2len-1];}
return[p,p2];},command2curve:function(pathCommand,d){var me=this;if(!pathCommand){return["C",d.x,d.y,d.x,d.y,d.x,d.y];}
if(pathCommand[0]!="T"&&pathCommand[0]!="Q"){d.qx=d.qy=null;}
switch(pathCommand[0]){case"M":d.X=pathCommand[1];d.Y=pathCommand[2];break;case"A":pathCommand=["C"].concat(me.arc2curve.apply(me,[d.x,d.y].concat(pathCommand.slice(1))));break;case"S":pathCommand=["C",d.x+(d.x-(d.bx||d.x)),d.y+(d.y-(d.by||d.y))].concat(pathCommand.slice(1));break;case"T":d.qx=d.x+(d.x-(d.qx||d.x));d.qy=d.y+(d.y-(d.qy||d.y));pathCommand=["C"].concat(me.quadratic2curve(d.x,d.y,d.qx,d.qy,pathCommand[1],pathCommand[2]));break;case"Q":d.qx=pathCommand[1];d.qy=pathCommand[2];pathCommand=["C"].concat(me.quadratic2curve(d.x,d.y,pathCommand[1],pathCommand[2],pathCommand[3],pathCommand[4]));break;case"L":pathCommand=["C"].concat(d.x,d.y,pathCommand[1],pathCommand[2],pathCommand[1],pathCommand[2]);break;case"H":pathCommand=["C"].concat(d.x,d.y,pathCommand[1],d.y,pathCommand[1],d.y);break;case"V":pathCommand=["C"].concat(d.x,d.y,d.x,pathCommand[1],d.x,pathCommand[1]);break;case"Z":pathCommand=["C"].concat(d.x,d.y,d.X,d.Y,d.X,d.Y);break;}
return pathCommand;},quadratic2curve:function(x1,y1,ax,ay,x2,y2){var _13=1/3,_23=2/3;return[_13*x1+_23*ax,_13*y1+_23*ay,_13*x2+_23*ax,_13*y2+_23*ay,x2,y2];},rotate:function(x,y,rad){var cos=Math.cos(rad),sin=Math.sin(rad),X=x*cos-y*sin,Y=x*sin+y*cos;return{x:X,y:Y};},arc2curve:function(x1,y1,rx,ry,angle,large_arc_flag,sweep_flag,x2,y2,recursive){var me=this,PI=Math.PI,radian=me.radian,_120=PI*120/180,rad=radian*(+angle||0),res=[],math=Math,mcos=math.cos,msin=math.sin,msqrt=math.sqrt,mabs=math.abs,masin=math.asin,xy,x,y,h,rx2,ry2,k,cx,cy,f1,f2,df,c1,s1,c2,s2,t,hx,hy,m1,m2,m3,m4,newres,i,ln,f2old,x2old,y2old;if(!recursive){xy=me.rotate(x1,y1,-rad);x1=xy.x;y1=xy.y;xy=me.rotate(x2,y2,-rad);x2=xy.x;y2=xy.y;x=(x1-x2)/2;y=(y1-y2)/2;h=(x*x)/(rx*rx)+(y*y)/(ry*ry);if(h>1){h=msqrt(h);rx=h*rx;ry=h*ry;}
rx2=rx*rx;ry2=ry*ry;k=(large_arc_flag==sweep_flag?-1:1)*msqrt(mabs((rx2*ry2-rx2*y*y-ry2*x*x)/(rx2*y*y+ry2*x*x)));cx=k*rx*y/ry+(x1+x2)/2;cy=k*-ry*x/rx+(y1+y2)/2;f1=masin(((y1-cy)/ry).toFixed(7));f2=masin(((y2-cy)/ry).toFixed(7));f1=x1<cx?PI-f1:f1;f2=x2<cx?PI-f2:f2;if(f1<0){f1=PI*2+f1;}
if(f2<0){f2=PI*2+f2;}
if(sweep_flag&&f1>f2){f1=f1-PI*2;}
if(!sweep_flag&&f2>f1){f2=f2-PI*2;}}
else{f1=recursive[0];f2=recursive[1];cx=recursive[2];cy=recursive[3];}
df=f2-f1;if(mabs(df)>_120){f2old=f2;x2old=x2;y2old=y2;f2=f1+_120*(sweep_flag&&f2>f1?1:-1);x2=cx+rx*mcos(f2);y2=cy+ry*msin(f2);res=me.arc2curve(x2,y2,rx,ry,angle,0,sweep_flag,x2old,y2old,[f2,f2old,cx,cy]);}
df=f2-f1;c1=mcos(f1);s1=msin(f1);c2=mcos(f2);s2=msin(f2);t=math.tan(df/4);hx=4/3*rx*t;hy=4/3*ry*t;m1=[x1,y1];m2=[x1+hx*s1,y1-hy*c1];m3=[x2+hx*s2,y2-hy*c2];m4=[x2,y2];m2[0]=2*m1[0]-m2[0];m2[1]=2*m1[1]-m2[1];if(recursive){return[m2,m3,m4].concat(res);}
else{res=[m2,m3,m4].concat(res).join().split(",");newres=[];ln=res.length;for(i=0;i<ln;i++){newres[i]=i%2?me.rotate(res[i-1],res[i],rad).y:me.rotate(res[i],res[i+1],rad).x;}
return newres;}},rotateAndTranslatePath:function(sprite){var alpha=sprite.rotation.degrees,cx=sprite.rotation.x,cy=sprite.rotation.y,dx=sprite.translation.x,dy=sprite.translation.y,path,i,p,xy,j,res=[];if(!alpha&&!dx&&!dy){return this.pathToAbsolute(sprite.attr.path);}
dx=dx||0;dy=dy||0;path=this.pathToAbsolute(sprite.attr.path);for(i=path.length;i--;){p=res[i]=path[i].slice();if(p[0]=="A"){xy=this.rotatePoint(p[6],p[7],alpha,cx,cy);p[6]=xy.x+dx;p[7]=xy.y+dy;}else{j=1;while(p[j+1]!=null){xy=this.rotatePoint(p[j],p[j+1],alpha,cx,cy);p[j]=xy.x+dx;p[j+1]=xy.y+dy;j+=2;}}}
return res;},rotatePoint:function(x,y,alpha,cx,cy){if(!alpha){return{x:x,y:y};}
cx=cx||0;cy=cy||0;x=x-cx;y=y-cy;alpha=alpha*this.radian;var cos=Math.cos(alpha),sin=Math.sin(alpha);return{x:x*cos-y*sin+cx,y:x*sin+y*cos+cy};},pathDimensions:function(path){if(!path||!(path+"")){return{x:0,y:0,width:0,height:0};}
path=this.path2curve(path);var x=0,y=0,X=[],Y=[],i=0,ln=path.length,p,xmin,ymin,xmax,ymax,dim;for(;i<ln;i++){p=path[i];if(p[0]=="M"){x=p[1];y=p[2];X.push(x);Y.push(y);}
else{dim=this.curveDim(x,y,p[1],p[2],p[3],p[4],p[5],p[6]);X=X.concat(dim.min.x,dim.max.x);Y=Y.concat(dim.min.y,dim.max.y);x=p[5];y=p[6];}}
xmin=Math.min.apply(0,X);ymin=Math.min.apply(0,Y);xmax=Math.max.apply(0,X);ymax=Math.max.apply(0,Y);return{x:Math.round(xmin),y:Math.round(ymin),path:path,width:Math.round(xmax-xmin),height:Math.round(ymax-ymin)};},intersectInside:function(path,cp1,cp2){return(cp2[0]-cp1[0])*(path[1]-cp1[1])>(cp2[1]-cp1[1])*(path[0]-cp1[0]);},intersectIntersection:function(s,e,cp1,cp2){var p=[],dcx=cp1[0]-cp2[0],dcy=cp1[1]-cp2[1],dpx=s[0]-e[0],dpy=s[1]-e[1],n1=cp1[0]*cp2[1]-cp1[1]*cp2[0],n2=s[0]*e[1]-s[1]*e[0],n3=1/(dcx*dpy-dcy*dpx);p[0]=(n1*dpx-n2*dcx)*n3;p[1]=(n1*dpy-n2*dcy)*n3;return p;},intersect:function(subjectPolygon,clipPolygon){var me=this,i=0,ln=clipPolygon.length,cp1=clipPolygon[ln-1],outputList=subjectPolygon,cp2,s,e,ln2,inputList,j;for(;i<ln;++i){cp2=clipPolygon[i];inputList=outputList;outputList=[];s=inputList[inputList.length-1];j=0;ln2=inputList.length;for(;j<ln2;j++){e=inputList[j];if(me.intersectInside(e,cp1,cp2)){if(!me.intersectInside(s,cp1,cp2)){outputList.push(me.intersectIntersection(s,e,cp1,cp2));}
outputList.push(e);}
else if(me.intersectInside(s,cp1,cp2)){outputList.push(me.intersectIntersection(s,e,cp1,cp2));}
s=e;}
cp1=cp2;}
return outputList;},bezier:function(a,b,c,d,x){if(x===0){return a;}
else if(x===1){return d;}
var du=1-x,d3=du*du*du,r=x/du;return d3*(a+r*(3*b+r*(3*c+d*r)));},bezierDim:function(a,b,c,d){var points=[],r,A,top,C,delta,bottom,s,min,max,i;if(a+3*c==d+3*b){r=a-b;r/=2*(a-b-b+c);if(r<1&&r>0){points.push(r);}}else{A=a-3*b+3*c-d;top=2*(a-b-b+c);C=a-b;delta=top*top-4*A*C;bottom=A+A;if(delta===0){r=top/bottom;if(r<1&&r>0){points.push(r);}}else if(delta>0){s=Math.sqrt(delta);r=(s+top)/bottom;if(r<1&&r>0){points.push(r);}
r=(top-s)/bottom;if(r<1&&r>0){points.push(r);}}}
min=Math.min(a,d);max=Math.max(a,d);for(i=0;i<points.length;i++){min=Math.min(min,this.bezier(a,b,c,d,points[i]));max=Math.max(max,this.bezier(a,b,c,d,points[i]));}
return[min,max];},curveDim:function(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y){var x=this.bezierDim(p1x,c1x,c2x,p2x),y=this.bezierDim(p1y,c1y,c2y,p2y);return{min:{x:x[0],y:y[0]},max:{x:x[1],y:y[1]}};},getAnchors:function(prevX,prevY,curX,curY,nextX,nextY,value){value=value||4;var M=Math,PI=M.PI,halfPI=PI/2,abs=M.abs,sin=M.sin,cos=M.cos,atan=M.atan,control1Length,control2Length,control1Angle,control2Angle,control1X,control1Y,control2X,control2Y,alpha;control1Length=(curX-prevX)/value;control2Length=(nextX-curX)/value;if((curY>=prevY&&curY>=nextY)||(curY<=prevY&&curY<=nextY)){control1Angle=control2Angle=halfPI;}else{control1Angle=atan((curX-prevX)/abs(curY-prevY));if(prevY<curY){control1Angle=PI-control1Angle;}
control2Angle=atan((nextX-curX)/abs(curY-nextY));if(nextY<curY){control2Angle=PI-control2Angle;}}
alpha=halfPI-((control1Angle+control2Angle)%(PI*2))/2;if(alpha>halfPI){alpha-=PI;}
control1Angle+=alpha;control2Angle+=alpha;control1X=curX-control1Length*sin(control1Angle);control1Y=curY+control1Length*cos(control1Angle);control2X=curX+control2Length*sin(control2Angle);control2Y=curY+control2Length*cos(control2Angle);if((curY>prevY&&control1Y<prevY)||(curY<prevY&&control1Y>prevY)){control1X+=abs(prevY-control1Y)*(control1X-curX)/(control1Y-curY);control1Y=prevY;}
if((curY>nextY&&control2Y<nextY)||(curY<nextY&&control2Y>nextY)){control2X-=abs(nextY-control2Y)*(control2X-curX)/(control2Y-curY);control2Y=nextY;}
return{x1:control1X,y1:control1Y,x2:control2X,y2:control2Y};},smooth:function(originalPath,value){var path=this.path2curve(originalPath),newp=[path[0]],x=path[0][1],y=path[0][2],j,points,i=1,ii=path.length,beg=1,mx=x,my=y,pathi,pathil,pathim,pathiml,pathip,pathipl,begl;for(;i<ii;i++){pathi=path[i];pathil=pathi.length;pathim=path[i-1];pathiml=pathim.length;pathip=path[i+1];pathipl=pathip&&pathip.length;if(pathi[0]=="M"){mx=pathi[1];my=pathi[2];j=i+1;while(path[j][0]!="C"){j++;}
newp.push(["M",mx,my]);beg=newp.length;x=mx;y=my;continue;}
if(pathi[pathil-2]==mx&&pathi[pathil-1]==my&&(!pathip||pathip[0]=="M")){begl=newp[beg].length;points=this.getAnchors(pathim[pathiml-2],pathim[pathiml-1],mx,my,newp[beg][begl-2],newp[beg][begl-1],value);newp[beg][1]=points.x2;newp[beg][2]=points.y2;}
else if(!pathip||pathip[0]=="M"){points={x1:pathi[pathil-2],y1:pathi[pathil-1]};}else{points=this.getAnchors(pathim[pathiml-2],pathim[pathiml-1],pathi[pathil-2],pathi[pathil-1],pathip[pathipl-2],pathip[pathipl-1],value);}
newp.push(["C",x,y,points.x1,points.y1,pathi[pathil-2],pathi[pathil-1]]);x=points.x2;y=points.y2;}
return newp;},findDotAtSegment:function(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y,t){var t1=1-t;return{x:Math.pow(t1,3)*p1x+Math.pow(t1,2)*3*t*c1x+t1*3*t*t*c2x+Math.pow(t,3)*p2x,y:Math.pow(t1,3)*p1y+Math.pow(t1,2)*3*t*c1y+t1*3*t*t*c2y+Math.pow(t,3)*p2y};},snapEnds:function(from,to,stepsMax,prettyNumbers){if(Ext.isDate(from)){return this.snapEndsByDate(from,to,stepsMax);}
var step=(to-from)/stepsMax,level=Math.floor(Math.log(step)/Math.LN10)+1,m=Math.pow(10,level),cur,floor,modulo=Math.round((step%m)*Math.pow(10,2-level)),interval=[[0,15],[10,1],[20,4],[25,2],[50,9],[100,15]],stepCount=0,value,weight,i,topValue,topWeight=1e9,ln=interval.length;floor=Math.floor(from/m)*m;if(from==floor&&floor>0){floor=Math.floor((from-(m/10))/m)*m;}
if(prettyNumbers){for(i=0;i<ln;i++){value=interval[i][0];weight=(value-modulo)<0?1e6:(value-modulo)/interval[i][1];if(weight<topWeight){topValue=value;topWeight=weight;}}
step=Math.floor(step*Math.pow(10,-level))*Math.pow(10,level)+topValue*Math.pow(10,level-2);if(from<0&&to>=0){cur=0;while(cur>from){cur-=step;stepCount++;}
from=+cur.toFixed(10);cur=0;while(cur<to){cur+=step;stepCount++;}
to=+cur.toFixed(10);}else{cur=from=floor;while(cur<to){cur+=step;stepCount++;}}
to=+cur.toFixed(10);}else{from=floor;stepCount=stepsMax;}
return{from:from,to:to,power:level,step:step,steps:stepCount};},snapEndsByDate:function(from,to,stepsMax,lockEnds){var selectedStep=false,scales=[[Ext.Date.MILLI,[1,2,5,10,20,50,100,200,250,500]],[Ext.Date.SECOND,[1,2,5,10,15,30]],[Ext.Date.MINUTE,[1,2,5,10,15,30]],[Ext.Date.HOUR,[1,2,3,4,6,12]],[Ext.Date.DAY,[1,2,7,14]],[Ext.Date.MONTH,[1,2,3,6]]],sLen=scales.length,stop=false,scale,j,yearDiff,s;for(s=0;s<sLen;s++){scale=scales[s];if(!stop){for(j=0;j<scale[1].length;j++){if(to<Ext.Date.add(from,scale[0],scale[1][j]*stepsMax)){selectedStep=[scale[0],scale[1][j]];stop=true;break;}}}}
if(!selectedStep){yearDiff=this.snapEnds(from.getFullYear(),to.getFullYear()+1,stepsMax,lockEnds);selectedStep=[Date.YEAR,Math.round(yearDiff.step)];}
return this.snapEndsByDateAndStep(from,to,selectedStep,lockEnds);},snapEndsByDateAndStep:function(from,to,step,lockEnds){var fromStat=[from.getFullYear(),from.getMonth(),from.getDate(),from.getHours(),from.getMinutes(),from.getSeconds(),from.getMilliseconds()],steps,testFrom,testTo,date,year,month,day,fractionalMonth,stepUnit=step[0],stepValue=step[1];if(lockEnds){testFrom=from;}else{switch(stepUnit){case Ext.Date.MILLI:testFrom=new Date(fromStat[0],fromStat[1],fromStat[2],fromStat[3],fromStat[4],fromStat[5],Math.floor(fromStat[6]/stepValue)*stepValue);break;case Ext.Date.SECOND:testFrom=new Date(fromStat[0],fromStat[1],fromStat[2],fromStat[3],fromStat[4],Math.floor(fromStat[5]/stepValue)*stepValue,0);break;case Ext.Date.MINUTE:testFrom=new Date(fromStat[0],fromStat[1],fromStat[2],fromStat[3],Math.floor(fromStat[4]/stepValue)*stepValue,0,0);break;case Ext.Date.HOUR:testFrom=new Date(fromStat[0],fromStat[1],fromStat[2],Math.floor(fromStat[3]/stepValue)*stepValue,0,0,0);break;case Ext.Date.DAY:testFrom=new Date(fromStat[0],fromStat[1],Math.floor((fromStat[2]-1)/stepValue)*stepValue+1,0,0,0,0);break;case Ext.Date.MONTH:testFrom=new Date(fromStat[0],Math.floor(fromStat[1]/stepValue)*stepValue,1,0,0,0,0);break;default:testFrom=new Date(Math.floor(fromStat[0]/stepValue)*stepValue,0,1,0,0,0,0);break;}}
fractionalMonth=((stepUnit===Ext.Date.MONTH)&&(stepValue==1/2||stepValue==1/3||stepValue==1/4));steps=(fractionalMonth?[]:0);testTo=new Date(testFrom);while(testTo<to){if(fractionalMonth){date=new Date(testTo);year=date.getFullYear();month=date.getMonth();day=date.getDate();switch(stepValue){case 1/2:if(day>=15){day=1;if(++month>11){year++;}}
else{day=15;}
break;case 1/3:if(day>=20){day=1;if(++month>11){year++;}}
else{if(day>=10){day=20}
else{day=10;}}
break;case 1/4:if(day>=22){day=1;if(++month>11){year++;}}
else{if(day>=15){day=22}
else{if(day>=8){day=15}
else{day=8;}}}
break;}
testTo.setYear(year);testTo.setMonth(month);testTo.setDate(day);steps.push(new Date(testTo));}
else{testTo=Ext.Date.add(testTo,stepUnit,stepValue);steps++;}}
if(lockEnds){testTo=to;}
if(fractionalMonth){return{from:+testFrom,to:+testTo,steps:steps};}
else{return{from:+testFrom,to:+testTo,step:(testTo-testFrom)/steps,steps:steps};}},sorter:function(a,b){return a.offset-b.offset;},rad:function(degrees){return degrees%360*Math.PI/180;},degrees:function(radian){return radian*180/Math.PI%360;},withinBox:function(x,y,bbox){bbox=bbox||{};return(x>=bbox.x&&x<=(bbox.x+bbox.width)&&y>=bbox.y&&y<=(bbox.y+bbox.height));},parseGradient:function(gradient){var me=this,type=gradient.type||'linear',angle=gradient.angle||0,radian=me.radian,stops=gradient.stops,stopsArr=[],stop,vector,max,stopObj;if(type=='linear'){vector=[0,0,Math.cos(angle*radian),Math.sin(angle*radian)];max=1/(Math.max(Math.abs(vector[2]),Math.abs(vector[3]))||1);vector[2]*=max;vector[3]*=max;if(vector[2]<0){vector[0]=-vector[2];vector[2]=0;}
if(vector[3]<0){vector[1]=-vector[3];vector[3]=0;}}
for(stop in stops){if(stops.hasOwnProperty(stop)&&me.stopsRE.test(stop)){stopObj={offset:parseInt(stop,10),color:Ext.draw.Color.toHex(stops[stop].color)||'#ffffff',opacity:stops[stop].opacity||1};stopsArr.push(stopObj);}}
Ext.Array.sort(stopsArr,me.sorter);if(type=='linear'){return{id:gradient.id,type:type,vector:vector,stops:stopsArr};}
else{return{id:gradient.id,type:type,centerX:gradient.centerX,centerY:gradient.centerY,focalX:gradient.focalX,focalY:gradient.focalY,radius:gradient.radius,vector:vector,stops:stopsArr};}}});Ext.define('MP.action.Plugin',{extend:'Ext.AbstractPlugin',init:function(component){var me=this;me.component=component;if(!me.shouldDisableAction&&component.shouldDisableAction){me.shouldDisableAction=component.shouldDisableAction.bind(component);}
me.actions=[];if(component.plugged_actions===undefined){var cactions=component.plugged_actions=new Ext.util.MixedCollection();component.getAllActions=function(){return cactions.getRange();};component.findActionById=function(id){return cactions.get(id);};component.initEvents=Ext.Function.createSequence(component.initEvents,function(){if(component.plugins){Ext.each(component.plugins,function(p){if(p.attachActions){p.attachActions();}});}});}
me.initActions();},destroy:function(){delete this.shouldDisableAction;this.callParent(arguments);},initActions:Ext.emptyFn,attachActions:Ext.emptyFn,addAction:function(act){this.actions.push(act);this.component.plugged_actions.add(act.initialConfig.itemId,act);return act;},getActions:function(){return this.actions;},findActionById:function(id){var act=null;Ext.each(this.getActions(),function(a){if(a.initialConfig.itemId==id){act=a;return false;}
return true;});return act;},updateAction:function(act){var disable;if(act.shouldBeDisabled){disable=act.shouldBeDisabled();if(disable!==null){act.setDisabled(disable);return;}}
if(this.shouldDisableAction){disable=this.shouldDisableAction(act);if(disable!==null){act.setDisabled(disable);}}}});Ext.define('Ext.Shadow',{requires:['Ext.ShadowPool'],localXYNames:{get:'getLocalXY',set:'setLocalXY'},constructor:function(config){var me=this,adjusts,offset,rad;Ext.apply(me,config);if(!Ext.isString(me.mode)){me.mode=me.defaultMode;}
offset=me.offset;rad=Math.floor(offset/2);me.opacity=50;switch(me.mode.toLowerCase()){case"drop":if(Ext.supports.CSS3BoxShadow){adjusts={t:offset,l:offset,h:-offset,w:-offset};}
else{adjusts={t:-rad,l:-rad,h:-rad,w:-rad};}
break;case"sides":if(Ext.supports.CSS3BoxShadow){adjusts={t:offset,l:0,h:-offset,w:0};}
else{adjusts={t:-(1+rad),l:1+rad-2*offset,h:-1,w:rad-1};}
break;case"frame":if(Ext.supports.CSS3BoxShadow){adjusts={t:0,l:0,h:0,w:0};}
else{adjusts={t:1+rad-2*offset,l:1+rad-2*offset,h:offset-rad-1,w:offset-rad-1};}
break;case"bottom":if(Ext.supports.CSS3BoxShadow){adjusts={t:offset,l:0,h:-offset,w:0};}
else{adjusts={t:offset,l:0,h:0,w:0};}
break;}
me.adjusts=adjusts;},getShadowSize:function(){var me=this,offset=me.el?me.offset:0,result=[offset,offset,offset,offset],mode=me.mode.toLowerCase();if(me.el&&mode!=='frame'){result[0]=0;if(mode=='drop'){result[3]=0;}}
return result;},offset:4,defaultMode:"drop",boxShadowProperty:(function(){var property='boxShadow',style=document.documentElement.style;if(!('boxShadow'in style)){if('WebkitBoxShadow'in style){property='WebkitBoxShadow';}
else if('MozBoxShadow'in style){property='MozBoxShadow';}}
return property;}()),show:function(target){var me=this,index,xy;target=Ext.get(target);index=(parseInt(target.getStyle("z-index"),10)-1)||0;xy=target[me.localXYNames.get]();if(!me.el){me.el=Ext.ShadowPool.pull();if(me.fixed){me.el.dom.style.position='fixed';}else{me.el.dom.style.position='';}
if(me.el.dom.nextSibling!=target.dom){me.el.insertBefore(target);}}
me.el.setStyle("z-index",me.zIndex||index);if(Ext.isIE&&!Ext.supports.CSS3BoxShadow){me.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity="+me.opacity+") progid:DXImageTransform.Microsoft.Blur(pixelradius="+(me.offset)+")";}
me.realign(xy[0],xy[1],target.dom.offsetWidth,target.dom.offsetHeight);me.el.dom.style.display="block";},isVisible:function(){return this.el?true:false;},realign:function(l,t,targetWidth,targetHeight){if(!this.el){return;}
var adjusts=this.adjusts,el=this.el,targetStyle=el.dom.style,shadowWidth,shadowHeight,sws,shs;el[this.localXYNames.set](l+adjusts.l,t+adjusts.t);shadowWidth=Math.max(targetWidth+adjusts.w,0);shadowHeight=Math.max(targetHeight+adjusts.h,0);sws=shadowWidth+"px";shs=shadowHeight+"px";if(targetStyle.width!=sws||targetStyle.height!=shs){targetStyle.width=sws;targetStyle.height=shs;if(Ext.supports.CSS3BoxShadow){targetStyle[this.boxShadowProperty]='0 0 '+(this.offset+2)+'px #888';}}},hide:function(){var me=this;if(me.el){me.el.dom.style.display="none";Ext.ShadowPool.push(me.el);delete me.el;}},setZIndex:function(z){this.zIndex=z;if(this.el){this.el.setStyle("z-index",z);}},setOpacity:function(opacity){if(this.el){if(Ext.isIE&&!Ext.supports.CSS3BoxShadow){opacity=Math.floor(opacity*100/2)/100;}
this.opacity=opacity;this.el.setOpacity(opacity);}}});Ext.define('Ext.resizer.ResizeTracker',{extend:'Ext.dd.DragTracker',dynamic:true,preserveRatio:false,constrainTo:null,proxyCls:Ext.baseCSSPrefix+'resizable-proxy',constructor:function(config){var me=this,widthRatio,heightRatio,throttledResizeFn;if(!config.el){if(config.target.isComponent){me.el=config.target.getEl();}else{me.el=config.target;}}
this.callParent(arguments);if(me.preserveRatio&&me.minWidth&&me.minHeight){widthRatio=me.minWidth/me.el.getWidth();heightRatio=me.minHeight/me.el.getHeight();if(heightRatio>widthRatio){me.minWidth=me.el.getWidth()*heightRatio;}else{me.minHeight=me.el.getHeight()*widthRatio;}}
if(me.throttle){throttledResizeFn=Ext.Function.createThrottled(function(){Ext.resizer.ResizeTracker.prototype.resize.apply(me,arguments);},me.throttle);me.resize=function(box,direction,atEnd){if(atEnd){Ext.resizer.ResizeTracker.prototype.resize.apply(me,arguments);}else{throttledResizeFn.apply(null,arguments);}};}},onBeforeStart:function(e){this.startBox=this.target.getBox();},getDynamicTarget:function(){var me=this,target=me.target;if(me.dynamic){return target;}else if(!me.proxy){me.proxy=me.createProxy(target);}
me.proxy.show();return me.proxy;},createProxy:function(target){var proxy,cls=this.proxyCls;if(target.isComponent){proxy=target.getProxy().addCls(cls);}else{proxy=target.createProxy({tag:'div',cls:cls,id:target.id+'-rzproxy'},Ext.getBody());}
proxy.removeCls(Ext.baseCSSPrefix+'proxy-el');return proxy;},onStart:function(e){this.activeResizeHandle=Ext.get(this.getDragTarget().id);if(!this.dynamic){this.resize(this.startBox,{horizontal:'none',vertical:'none'});}},onDrag:function(e){if(this.dynamic||this.proxy){this.updateDimensions(e);}},updateDimensions:function(e,atEnd){var me=this,region=me.activeResizeHandle.region,offset=me.getOffset(me.constrainTo?'dragTarget':null),box=me.startBox,ratio,widthAdjust=0,heightAdjust=0,snappedWidth,snappedHeight,adjustX=0,adjustY=0,dragRatio,horizDir=offset[0]<0?'right':'left',vertDir=offset[1]<0?'down':'up',oppositeCorner,axis,newBox,newHeight,newWidth;region=me.convertRegionName(region);switch(region){case'south':heightAdjust=offset[1];axis=2;break;case'north':heightAdjust=-offset[1];adjustY=-heightAdjust;axis=2;break;case'east':widthAdjust=offset[0];axis=1;break;case'west':widthAdjust=-offset[0];adjustX=-widthAdjust;axis=1;break;case'northeast':heightAdjust=-offset[1];adjustY=-heightAdjust;widthAdjust=offset[0];oppositeCorner=[box.x,box.y+box.height];axis=3;break;case'southeast':heightAdjust=offset[1];widthAdjust=offset[0];oppositeCorner=[box.x,box.y];axis=3;break;case'southwest':widthAdjust=-offset[0];adjustX=-widthAdjust;heightAdjust=offset[1];oppositeCorner=[box.x+box.width,box.y];axis=3;break;case'northwest':heightAdjust=-offset[1];adjustY=-heightAdjust;widthAdjust=-offset[0];adjustX=-widthAdjust;oppositeCorner=[box.x+box.width,box.y+box.height];axis=3;break;}
newBox={width:box.width+widthAdjust,height:box.height+heightAdjust,x:box.x+adjustX,y:box.y+adjustY};snappedWidth=Ext.Number.snap(newBox.width,me.widthIncrement);snappedHeight=Ext.Number.snap(newBox.height,me.heightIncrement);if(snappedWidth!=newBox.width||snappedHeight!=newBox.height){switch(region){case'northeast':newBox.y-=snappedHeight-newBox.height;break;case'north':newBox.y-=snappedHeight-newBox.height;break;case'southwest':newBox.x-=snappedWidth-newBox.width;break;case'west':newBox.x-=snappedWidth-newBox.width;break;case'northwest':newBox.x-=snappedWidth-newBox.width;newBox.y-=snappedHeight-newBox.height;}
newBox.width=snappedWidth;newBox.height=snappedHeight;}
if(newBox.width<me.minWidth||newBox.width>me.maxWidth){newBox.width=Ext.Number.constrain(newBox.width,me.minWidth,me.maxWidth);if(adjustX){newBox.x=box.x+(box.width-newBox.width);}}else{me.lastX=newBox.x;}
if(newBox.height<me.minHeight||newBox.height>me.maxHeight){newBox.height=Ext.Number.constrain(newBox.height,me.minHeight,me.maxHeight);if(adjustY){newBox.y=box.y+(box.height-newBox.height);}}else{me.lastY=newBox.y;}
if(me.preserveRatio||e.shiftKey){ratio=me.startBox.width/me.startBox.height;newHeight=Math.min(Math.max(me.minHeight,newBox.width/ratio),me.maxHeight);newWidth=Math.min(Math.max(me.minWidth,newBox.height*ratio),me.maxWidth);if(axis==1){newBox.height=newHeight;}
else if(axis==2){newBox.width=newWidth;}
else{dragRatio=Math.abs(oppositeCorner[0]-this.lastXY[0])/Math.abs(oppositeCorner[1]-this.lastXY[1]);if(dragRatio>ratio){newBox.height=newHeight;}else{newBox.width=newWidth;}
if(region=='northeast'){newBox.y=box.y-(newBox.height-box.height);}else if(region=='northwest'){newBox.y=box.y-(newBox.height-box.height);newBox.x=box.x-(newBox.width-box.width);}else if(region=='southwest'){newBox.x=box.x-(newBox.width-box.width);}}}
if(heightAdjust===0){vertDir='none';}
if(widthAdjust===0){horizDir='none';}
me.resize(newBox,{horizontal:horizDir,vertical:vertDir},atEnd);},getResizeTarget:function(atEnd){return atEnd?this.target:this.getDynamicTarget();},resize:function(box,direction,atEnd){var me=this,target=me.getResizeTarget(atEnd);target.setBox(box);if(me.originalTarget&&(me.dynamic||atEnd)){me.originalTarget.setBox(box);}},onEnd:function(e){this.updateDimensions(e,true);if(this.proxy){this.proxy.hide();}},convertRegionName:function(name){return name;}});Ext.define('Ext.util.ComponentDragger',{extend:'Ext.dd.DragTracker',autoStart:500,constructor:function(comp,config){this.comp=comp;this.initialConstrainTo=config.constrainTo;this.callParent([config]);},onStart:function(e){var me=this,comp=me.comp;me.startPosition=comp.getXY();if(comp.ghost&&!comp.liveDrag){me.proxy=comp.ghost();me.dragTarget=me.proxy.header.el;}
if(me.constrain||me.constrainDelegate){me.constrainTo=me.calculateConstrainRegion();}
if(comp.beginDrag){comp.beginDrag();}},calculateConstrainRegion:function(){var me=this,comp=me.comp,constrainTo=me.initialConstrainTo,constraintInsets=comp.constraintInsets,constrainEl,delegateRegion,elRegion,dragEl=me.proxy?me.proxy.el:comp.el,shadowSize=(!me.constrainDelegate&&dragEl.shadow&&comp.constrainShadow&&!dragEl.shadowDisabled)?dragEl.shadow.getShadowSize():0;if(!(constrainTo instanceof Ext.util.Region)){constrainEl=Ext.fly(constrainTo);constrainTo=constrainEl.getViewRegion();constrainTo.right=constrainTo.left+constrainEl.dom.clientWidth;}else{constrainTo=constrainTo.copy();}
if(constraintInsets){constraintInsets=Ext.isObject(constraintInsets)?constraintInsets:Ext.Element.parseBox(constraintInsets);constrainTo.adjust(constraintInsets.top,constraintInsets.right,constraintInsets.bottom,constraintInsets.length);}
if(shadowSize){constrainTo.adjust(shadowSize[0],-shadowSize[1],-shadowSize[2],shadowSize[3]);}
if(!me.constrainDelegate){delegateRegion=Ext.fly(me.dragTarget).getRegion();elRegion=dragEl.getRegion();constrainTo.adjust(delegateRegion.top-elRegion.top,delegateRegion.right-elRegion.right,delegateRegion.bottom-elRegion.bottom,delegateRegion.left-elRegion.left);}
return constrainTo;},onDrag:function(e){var me=this,comp=(me.proxy&&!me.comp.liveDrag)?me.proxy:me.comp,offset=me.getOffset(me.constrain||me.constrainDelegate?'dragTarget':null);comp.setPagePosition(me.startPosition[0]+offset[0],me.startPosition[1]+offset[1]);},onEnd:function(e){var comp=this.comp;if(comp.isDestroyed||comp.destroying){return;}
if(this.proxy&&!comp.liveDrag){comp.unghost();}
if(comp.endDrag){comp.endDrag();}}});Ext.define('Ext.fx.target.Element',{extend:'Ext.fx.target.Target',type:'element',getElVal:function(el,attr,val){if(val==undefined){if(attr==='x'){val=el.getX();}else if(attr==='y'){val=el.getY();}else if(attr==='scrollTop'){val=el.getScroll().top;}else if(attr==='scrollLeft'){val=el.getScroll().left;}else if(attr==='height'){val=el.getHeight();}else if(attr==='width'){val=el.getWidth();}else{val=el.getStyle(attr);}}
return val;},getAttr:function(attr,val){var el=this.target;return[[el,this.getElVal(el,attr,val)]];},setAttr:function(targetData){var target=this.target,ln=targetData.length,attrs,attr,o,i,j,ln2;for(i=0;i<ln;i++){attrs=targetData[i].attrs;for(attr in attrs){if(attrs.hasOwnProperty(attr)){ln2=attrs[attr].length;for(j=0;j<ln2;j++){o=attrs[attr][j];this.setElVal(o[0],attr,o[1]);}}}}},setElVal:function(element,attr,value){if(attr==='x'){element.setX(value);}else if(attr==='y'){element.setY(value);}else if(attr==='scrollTop'){element.scrollTo('top',value);}else if(attr==='scrollLeft'){element.scrollTo('left',value);}else if(attr==='width'){element.setWidth(value);}else if(attr==='height'){element.setHeight(value);}else{element.setStyle(attr,value);}}});Ext.define('Ext.data.Types',{singleton:true,requires:['Ext.data.SortTypes']},function(){var st=Ext.data.SortTypes;Ext.apply(Ext.data.Types,{stripRe:/[\$,%]/g,AUTO:{sortType:st.none,type:'auto'},STRING:{convert:function(v){var defaultValue=this.useNull?null:'';return(v===undefined||v===null)?defaultValue:String(v);},sortType:st.asUCString,type:'string'},INT:{convert:function(v){if(typeof v=='number'){return parseInt(v);}
return v!==undefined&&v!==null&&v!==''?parseInt(String(v).replace(Ext.data.Types.stripRe,''),10):(this.useNull?null:0);},sortType:st.none,type:'int'},FLOAT:{convert:function(v){if(typeof v==='number'){return v;}
return v!==undefined&&v!==null&&v!==''?parseFloat(String(v).replace(Ext.data.Types.stripRe,''),10):(this.useNull?null:0);},sortType:st.none,type:'float'},BOOL:{convert:function(v){if(typeof v==='boolean'){return v;}
if(this.useNull&&(v===undefined||v===null||v==='')){return null;}
return v==='true'||v==1;},sortType:st.none,type:'bool'},DATE:{convert:function(v){var df=this.dateReadFormat||this.dateFormat,parsed;if(!v){return null;}
if(v instanceof Date){return v;}
if(df){return Ext.Date.parse(v,df);}
parsed=Date.parse(v);return parsed?new Date(parsed):null;},sortType:st.asDate,type:'date'}});Ext.apply(Ext.data.Types,{BOOLEAN:this.BOOL,INTEGER:this.INT,NUMBER:this.FLOAT});});Ext.define('Ext.dom.CompositeElement',{alternateClassName:'Ext.CompositeElement',extend:'Ext.dom.CompositeElementLite',getElement:function(el){return el;},transformElement:function(el){return Ext.get(el);}},function(){Ext.dom.Element.select=function(selector,unique,root){var elements;if(typeof selector=="string"){elements=Ext.dom.Element.selectorFunction(selector,root);}
else if(selector.length!==undefined){elements=selector;}
else{}
return(unique===true)?new Ext.CompositeElement(elements):new Ext.CompositeElementLite(elements);};});Ext.select=Ext.Element.select;Ext.define('Ext.form.action.Submit',{extend:'Ext.form.action.Action',alternateClassName:'Ext.form.Action.Submit',alias:'formaction.submit',type:'submit',run:function(){var me=this,form=me.form;if(me.clientValidation===false||form.isValid()){me.doSubmit();}else{me.failureType=Ext.form.action.Action.CLIENT_INVALID;form.afterAction(me,false);}},doSubmit:function(){var me=this,ajaxOptions=Ext.apply(me.createCallback(),{url:me.getUrl(),method:me.getMethod(),headers:me.headers}),form=me.form,jsonSubmit=me.jsonSubmit||form.jsonSubmit,paramsProp=jsonSubmit?'jsonData':'params',formEl,formInfo;if(form.hasUpload()){formInfo=me.buildForm();ajaxOptions.form=formInfo.formEl;ajaxOptions.isUpload=true;}else{ajaxOptions[paramsProp]=me.getParams(jsonSubmit);}
Ext.Ajax.request(ajaxOptions);if(formInfo){me.cleanup(formInfo);}},cleanup:function(formInfo){var formEl=formInfo.formEl,uploadEls=formInfo.uploadEls,uploadFields=formInfo.uploadFields,len=uploadFields.length,i,field;for(i=0;i<len;++i){field=uploadFields[i];if(!field.clearOnSubmit){field.restoreInput(uploadEls[i]);}}
if(formEl){Ext.removeNode(formEl);}},getParams:function(useModelValues){var falseVal=false,configParams=this.callParent(),fieldParams=this.form.getValues(falseVal,falseVal,this.submitEmptyText!==falseVal,useModelValues);return Ext.apply({},fieldParams,configParams);},buildForm:function(){var me=this,fieldsSpec=[],formSpec,formEl,basicForm=me.form,params=me.getParams(),uploadFields=[],uploadEls=[],fields=basicForm.getFields().items,i,len=fields.length,field,key,value,v,vLen,el;for(i=0;i<len;++i){field=fields[i];if(field.rendered&&field.isFileUpload()){uploadFields.push(field);}}
for(key in params){if(params.hasOwnProperty(key)){value=params[key];if(Ext.isArray(value)){vLen=value.length;for(v=0;v<vLen;v++){fieldsSpec.push(me.getFieldConfig(key,value[v]));}}else{fieldsSpec.push(me.getFieldConfig(key,value));}}}
formSpec={tag:'form',action:me.getUrl(),method:me.getMethod(),target:me.target||'_self',style:'display:none',cn:fieldsSpec};if(uploadFields.length){formSpec.encoding=formSpec.enctype='multipart/form-data';}
formEl=Ext.DomHelper.append(Ext.getBody(),formSpec);len=uploadFields.length;for(i=0;i<len;++i){el=uploadFields[i].extractFileInput();formEl.appendChild(el);uploadEls.push(el);}
return{formEl:formEl,uploadFields:uploadFields,uploadEls:uploadEls};},getFieldConfig:function(name,value){return{tag:'input',type:'hidden',name:name,value:Ext.String.htmlEncode(value)};},onSuccess:function(response){var form=this.form,success=true,result=this.processResponse(response);if(result!==true&&!result.success){if(result.errors){form.markInvalid(result.errors);}
this.failureType=Ext.form.action.Action.SERVER_INVALID;success=false;}
form.afterAction(this,success);},handleResponse:function(response){var form=this.form,errorReader=form.errorReader,rs,errors,i,len,records,result;if(errorReader){rs=errorReader.read(response);records=rs.records;errors=[];if(records){for(i=0,len=records.length;i<len;i++){errors[i]=records[i].data;}}
if(errors.length<1){errors=null;}
result={success:rs.success,errors:errors};}else{try{result=Ext.decode(response.responseText);}catch(e){result={success:false,errors:[]};}}
return result;}});Ext.define('Ext.fx.Queue',{requires:['Ext.util.HashMap'],constructor:function(){this.targets=new Ext.util.HashMap();this.fxQueue={};},getFxDefaults:function(targetId){var target=this.targets.get(targetId);if(target){return target.fxDefaults;}
return{};},setFxDefaults:function(targetId,obj){var target=this.targets.get(targetId);if(target){target.fxDefaults=Ext.apply(target.fxDefaults||{},obj);}},stopAnimation:function(targetId){var me=this,queue=me.getFxQueue(targetId),ln=queue.length;while(ln){queue[ln-1].end();ln--;}},getActiveAnimation:function(targetId){var queue=this.getFxQueue(targetId);return(queue&&!!queue.length)?queue[0]:false;},hasFxBlock:function(targetId){var queue=this.getFxQueue(targetId);return queue&&queue[0]&&queue[0].block;},getFxQueue:function(targetId){if(!targetId){return false;}
var me=this,queue=me.fxQueue[targetId],target=me.targets.get(targetId);if(!target){return false;}
if(!queue){me.fxQueue[targetId]=[];if(target.type!='element'){target.target.on('destroy',function(){me.fxQueue[targetId]=[];});}}
return me.fxQueue[targetId];},queueFx:function(anim){var me=this,target=anim.target,queue,ln;if(!target){return;}
queue=me.getFxQueue(target.getId());ln=queue.length;if(ln){if(anim.concurrent){anim.paused=false;}
else{queue[ln-1].on('afteranimate',function(){anim.paused=false;});}}
else{anim.paused=false;}
anim.on('afteranimate',function(){Ext.Array.remove(queue,anim);if(queue.length===0){me.targets.remove(anim.target);}
if(anim.remove){if(target.type=='element'){var el=Ext.get(target.id);if(el){el.remove();}}}},me,{single:true});queue.push(anim);}});Ext.define('Ext.layout.Layout',{requires:['Ext.XTemplate','Ext.layout.SizeModel'],uses:['Ext.layout.Context'],isLayout:true,initialized:false,running:false,autoSizePolicy:{readsWidth:1,readsHeight:1,setsWidth:0,setsHeight:0},statics:{layoutsByType:{},create:function(layout,defaultType){var ClassManager=Ext.ClassManager,layoutsByType=this.layoutsByType,alias,className,config,layoutClass,type,load;if(!layout||typeof layout==='string'){type=layout||defaultType;config={};}else if(layout.isLayout){return layout;}else{config=layout;type=layout.type||defaultType;}
if(!(layoutClass=layoutsByType[type])){alias='layout.'+type;className=ClassManager.getNameByAlias(alias);if(!className){load=true;}
layoutClass=ClassManager.get(className);if(load||!layoutClass){return ClassManager.instantiateByAlias(alias,config||{});}
layoutsByType[type]=layoutClass;}
return new layoutClass(config);}},constructor:function(config){var me=this;me.id=Ext.id(null,me.type+'-');Ext.apply(me,config);me.layoutCount=0;},beginLayout:Ext.emptyFn,beginLayoutCycle:function(ownerContext){var me=this,context=me.context,changed;if(me.lastWidthModel!=ownerContext.widthModel){if(me.lastWidthModel){changed=true;}
me.lastWidthModel=ownerContext.widthModel;}
if(me.lastHeightModel!=ownerContext.heightModel){if(me.lastWidthModel){changed=true;}
me.lastHeightModel=ownerContext.heightModel;}
if(changed){(context=ownerContext.context).clearTriggers(me,false);context.clearTriggers(me,true);me.triggerCount=0;}},finishedLayout:function(ownerContext){this.lastWidthModel=ownerContext.widthModel;this.lastHeightModel=ownerContext.heightModel;this.ownerContext=null;},redoLayout:Ext.emptyFn,undoLayout:Ext.emptyFn,getAnimatePolicy:function(){return this.animatePolicy;},getItemSizePolicy:function(item){return this.autoSizePolicy;},isItemBoxParent:function(itemContext){return false;},isItemLayoutRoot:function(item){var sizeModel=item.getSizeModel(),width=sizeModel.width,height=sizeModel.height;if(!item.componentLayout.lastComponentSize&&(width.calculated||height.calculated)){return false;}
return!width.shrinkWrap&&!height.shrinkWrap;},isItemShrinkWrap:function(item){return item.shrinkWrap;},isRunning:function(){return!!this.ownerContext;},getItemsRenderTree:function(items,renderCfgs){var length=items.length,i,item,itemConfig,result;if(length){result=[];for(i=0;i<length;++i){item=items[i];if(!item.rendered){if(renderCfgs&&(renderCfgs[item.id]!==undefined)){itemConfig=renderCfgs[item.id];}else{this.configureItem(item);itemConfig=item.getRenderTree();if(renderCfgs){renderCfgs[item.id]=itemConfig;}}
if(itemConfig){result.push(itemConfig);}}}}
return result;},finishRender:Ext.emptyFn,finishRenderItems:function(target,items){var length=items.length,i,item;for(i=0;i<length;i++){item=items[i];if(item.rendering){item.finishRender(i);this.afterRenderItem(item);}}},renderChildren:function(){var me=this,items=me.getLayoutItems(),target=me.getRenderTarget();me.renderItems(items,target);},renderItems:function(items,target){var me=this,ln=items.length,i=0,item;if(ln){Ext.suspendLayouts();for(;i<ln;i++){item=items[i];if(item&&!item.rendered){me.renderItem(item,target,i);}else if(!me.isValidParent(item,target,i)){me.moveItem(item,target,i);}else{me.configureItem(item);}}
Ext.resumeLayouts(true);}},isValidParent:function(item,target,position){var itemDom=item.el?item.el.dom:Ext.getDom(item),targetDom=(target&&target.dom)||target,parentNode=itemDom.parentNode,className;if(parentNode){className=parentNode.className;if(className&&className.indexOf(Ext.baseCSSPrefix+'resizable-wrap')!==-1){itemDom=itemDom.parentNode;}}
if(itemDom&&targetDom){if(typeof position=='number'){position=this.getPositionOffset(position);return itemDom===targetDom.childNodes[position];}
return itemDom.parentNode===targetDom;}
return false;},getPositionOffset:function(position){return position;},configureItem:function(item){item.ownerLayout=this;},renderItem:function(item,target,position){var me=this;if(!item.rendered){me.configureItem(item);item.render(target,position);me.afterRenderItem(item);}},moveItem:function(item,target,position){target=target.dom||target;if(typeof position=='number'){position=target.childNodes[position];}
target.insertBefore(item.el.dom,position||null);item.container=Ext.get(target);this.configureItem(item);},onContentChange:function(){this.owner.updateLayout();return true;},initLayout:function(){this.initialized=true;},setOwner:function(owner){this.owner=owner;},getLayoutItems:function(){return[];},onAdd:function(item){item.ownerLayout=this;},afterRenderItem:Ext.emptyFn,onRemove:Ext.emptyFn,onDestroy:Ext.emptyFn,afterRemove:function(item){var me=this,el=item.el,owner=me.owner,removeClasses;if(item.rendered){removeClasses=[].concat(me.itemCls||[]);if(owner.itemCls){removeClasses=Ext.Array.push(removeClasses,owner.itemCls);}
if(removeClasses.length){el.removeCls(removeClasses);}}
delete item.ownerLayout;},destroy:function(){var me=this,target;if(me.targetCls){target=me.getTarget();if(target){target.removeCls(me.targetCls);}}
me.onDestroy();},sortWeightedItems:function(items,reverseProp){for(var i=0,length=items.length;i<length;++i){items[i].$i=i;}
Ext.Array.sort(items,function(item1,item2){var ret=item2.weight-item1.weight;if(!ret){ret=item1.$i-item2.$i;if(item1[reverseProp]){ret=-ret;}}
return ret;});for(i=0;i<length;++i){delete items[i].$i;}}},function(){var Layout=this;Layout.prototype.sizeModels=Layout.sizeModels=Ext.layout.SizeModel.sizeModels;});Ext.define('Ext.AbstractManager',{requires:['Ext.util.HashMap'],typeName:'type',constructor:function(config){Ext.apply(this,config||{});this.all=new Ext.util.HashMap();this.types={};},get:function(id){return this.all.get(id);},register:function(item){this.all.add(item);},unregister:function(item){this.all.remove(item);},registerType:function(type,cls){this.types[type]=cls;cls[this.typeName]=type;},isRegistered:function(type){return this.types[type]!==undefined;},create:function(config,defaultType){var type=config[this.typeName]||config.type||defaultType,Constructor=this.types[type];return new Constructor(config);},onAvailable:function(id,fn,scope){var all=this.all,item,callback;if(all.containsKey(id)){item=all.get(id);fn.call(scope||item,item);}else{callback=function(map,key,item){if(key==id){fn.call(scope||item,item);all.un('add',callback);}};all.on('add',callback);}},each:function(fn,scope){this.all.each(fn,scope||this);},getCount:function(){return this.all.getCount();}});Ext.require('Ext.fx.CubicBezier',function(){var math=Math,pi=math.PI,pow=math.pow,sin=math.sin,sqrt=math.sqrt,abs=math.abs,backInSeed=1.70158;Ext.define('Ext.fx.Easing',{singleton:true,linear:Ext.identityFn,ease:function(n){var q=0.07813-n/2,alpha=-0.25,Q=sqrt(0.0066+q*q),x=Q-q,X=pow(abs(x),1/3)*(x<0?-1:1),y=-Q-q,Y=pow(abs(y),1/3)*(y<0?-1:1),t=X+Y+0.25;return pow(1-t,2)*3*t*0.1+(1-t)*3*t*t+t*t*t;},easeIn:function(n){return pow(n,1.7);},easeOut:function(n){return pow(n,0.48);},easeInOut:function(n){var q=0.48-n/1.04,Q=sqrt(0.1734+q*q),x=Q-q,X=pow(abs(x),1/3)*(x<0?-1:1),y=-Q-q,Y=pow(abs(y),1/3)*(y<0?-1:1),t=X+Y+0.5;return(1-t)*3*t*t+t*t*t;},backIn:function(n){return n*n*((backInSeed+1)*n-backInSeed);},backOut:function(n){n=n-1;return n*n*((backInSeed+1)*n+backInSeed)+1;},elasticIn:function(n){if(n===0||n===1){return n;}
var p=0.3,s=p/4;return pow(2,-10*n)*sin((n-s)*(2*pi)/p)+1;},elasticOut:function(n){return 1-Ext.fx.Easing.elasticIn(1-n);},bounceIn:function(n){return 1-Ext.fx.Easing.bounceOut(1-n);},bounceOut:function(n){var s=7.5625,p=2.75,l;if(n<(1/p)){l=s*n*n;}else{if(n<(2/p)){n-=(1.5/p);l=s*n*n+0.75;}else{if(n<(2.5/p)){n-=(2.25/p);l=s*n*n+0.9375;}else{n-=(2.625/p);l=s*n*n+0.984375;}}}
return l;}},function(){var easing=Ext.fx.Easing.self,proto=easing.prototype;easing.implement({'back-in':proto.backIn,'back-out':proto.backOut,'ease-in':proto.easeIn,'ease-out':proto.easeOut,'elastic-in':proto.elasticIn,'elastic-out':proto.elasticOut,'bounce-in':proto.bounceIn,'bounce-out':proto.bounceOut,'ease-in-out':proto.easeInOut});});});Ext.define('MP.form.field.plugin.OperatorButton',{extend:'Ext.AbstractPlugin',alias:'plugin.operatorbutton',mixins:{observable:'Ext.util.Observable'},autoHide:true,operatorButtonCls:'mp-operator-button',operator:'like',textField:undefined,operatorSet:{eq:{text:_('Is equal to'),iconCls:'mp-operator-button-eq',value:'='},ne:{text:_('Is not equal to'),iconCls:'mp-operator-button-ne',value:'<>'},gte:{text:_('Greater than or equal'),iconCls:'mp-operator-button-gte',value:'>='},lte:{text:_('Less than or equal'),iconCls:'mp-operator-button-lte',value:'<='},gt:{text:_('Greater than'),iconCls:'mp-operator-button-gt',value:'>'},lt:{text:_('Less than'),iconCls:'mp-operator-button-lt',value:'<'},like:{text:_('Contains'),iconCls:'mp-operator-button-like',value:'~'},start:{text:_('Starts with'),iconCls:'mp-operator-button-start',value:'~='}},constructor:function(config){var me=this;if(config.operator){if(!me.operatorSet[config.operator]){var opset=me.operatorSet;for(var op in opset){if(opset.hasOwnProperty(op)&&opset[op].value==config.operator){config.operator=op;break;}};}}
Ext.apply(me,config);me.mixins.observable.constructor.call(me);me.callParent(arguments);},init:function(textField){var me=this,items=[],oporder=['like','eq','ne','gt','gte','lt','lte','start'];me.operator=me.operatorSet[me.operator]?me.operator:'like';me.task=Ext.create('Ext.util.DelayedTask');for(var i=0,l=oporder.length;i<l;i++){items.push(Ext.apply(Ext.clone(me.operatorSet[oporder[i]]),{handler:me.onOperatorClick,scope:me}));}
me.textField=textField;me.menu=Ext.create('Ext.menu.Menu',{items:items,listeners:{hide:me.onMenuHide,scope:me}});if(!textField.rendered){textField.on('afterrender',me.onFieldRender,me,{single:true});}else{me.onFieldRender();}
me.addEvents('operatorchanged');textField.addEvents('operatorchanged');textField.on({destroy:me.onFieldDestroy,focus:me.onFieldFocus,blur:me.onFieldBlur,resize:me.onFieldResize,scope:me});},onFieldRender:function(textField){var me=this,bodyEl=me.textField.bodyEl,btn;btn=me.operatorButtonEl=me.textField.bodyEl.createChild({tag:'div',cls:me.operatorButtonCls+' '+me.operatorSet[me.operator].iconCls,style:'visibility: hidden;','data-qtip':me.operatorSet[me.operator].text});bodyEl.on('mouseover',me.onFieldMouseOver,me);bodyEl.on('mouseout',me.onFieldMouseOut,me);btn.on('mouseover',me.onButtonMouseOver,me);btn.on('mouseout',me.onButtonMouseOut,me);btn.on('click',me.onButtonClick,me);me.repositionOperatorButton();me.updateOperatorButtonVisibility();},onFieldDestroy:function(){var me=this;me.operatorButtonEl.destroy();me.menu.destroy();},onFieldFocus:function(){var me=this;me.fieldInFocus=true;me.updateOperatorButtonVisibility();},onFieldBlur:function(){var me=this;me.fieldInFocus=false;me.updateOperatorButtonVisibility();},onFieldResize:function(){var me=this;me.repositionOperatorButton();},onFieldMouseOver:function(e){var me=this;if(me.textField.triggerEl){if(e.getRelatedTarget()==me.textField.triggerEl.elements[0].dom){return;}}
me.operatorButtonEl.addCls(me.operatorButtonCls+'-mouse-over-input');if(e.getRelatedTarget()==me.operatorButtonEl.dom){me.operatorButtonEl.removeCls(me.operatorButtonCls+'-mouse-over-button');me.operatorButtonEl.removeCls(me.operatorButtonCls+'-mouse-down');}
me.updateOperatorButtonVisibility();},onFieldMouseOut:function(e){var me=this;if(me.textField.triggerEl){if(e.getRelatedTarget()==me.textField.triggerEl.elements[0].dom){return;}}
me.operatorButtonEl.removeCls(me.operatorButtonCls+'-mouse-over-input');if(e.getRelatedTarget()==me.operatorButtonEl.dom){me.operatorButtonEl.addCls(me.operatorButtonCls+'-mouse-over-button');}
me.updateOperatorButtonVisibility();},onButtonMouseOver:function(e){var me=this;e.stopEvent();if(me.textField.bodyEl.contains(e.getRelatedTarget())){return;}
me.operatorButtonEl.addCls(me.operatorButtonCls+'-mouse-over-button');me.updateOperatorButtonVisibility();},onButtonMouseOut:function(e){var me=this;e.stopEvent();if(me.textField.bodyEl.contains(e.getRelatedTarget())){return;}
me.operatorButtonEl.removeCls(me.operatorButtonCls+'-mouse-over-button');me.operatorButtonEl.removeCls(me.operatorButtonCls+'-mouse-down');me.updateOperatorButtonVisibility();},onButtonClick:function(e){var me=this;if(e.button!==0)return;me.menu.showAt(e.getX(),e.getY(),false);e.stopEvent();},onOperatorClick:function(item){var me=this,opset=me.operatorSet,btn=me.operatorButtonEl,field=me.textField,lastOperator=me.operator;for(var op in opset){if(opset.hasOwnProperty(op))
btn.removeCls(opset[op].iconCls);};btn.addCls(item.iconCls);btn.set({'data-qtip':item.text});me.operator=item.value;field.operator=item.value;field.focus();if(lastOperator!=me.operator){me.textField.fireEvent('operatorchanged',me.textField,me.operator,lastOperator);me.fireEvent('operatorchanged',me.textField,me.operator,lastOperator);}},onMenuHide:function(){var me=this;me.updateOperatorButtonVisibility();},shouldButtonBeVisible:function(){var me=this;if(me.autoHide&&!me.menu.isVisible()&&!me.fieldInFocus&&!me.operatorButtonEl.hasCls(me.operatorButtonCls+'-mouse-over-button')&&!me.operatorButtonEl.hasCls(me.operatorButtonCls+'-mouse-over-input')){return false;}
return true;},updateOperatorButtonVisibility:function(){var me=this,btn=me.operatorButtonEl,padding;var newVisible=me.shouldButtonBeVisible();if(!Ext.isWebKit){padding=(newVisible?18:0);}else{padding=(newVisible||!me.webKitBugFlag?18:0);me.webKitBugFlag=true;}
me.textField.inputEl.applyStyles({'padding-left':padding+'px'});me.task.delay(200,function(){var oldVisible=btn.isVisible();if(oldVisible==newVisible)return;btn.stopAnimation();btn.setVisible(newVisible,{duration:0});if(!Ext.isWebKit){padding=(newVisible?18:0);}else{padding=(newVisible||!me.webKitBugFlag?18:0);me.webKitBugFlag=true;}
me.textField.inputEl.applyStyles({'padding-left':padding+'px'});});},repositionOperatorButton:function(){var me=this,btn=me.operatorButtonEl;if(!btn)return;btn.alignTo(this.textField.bodyEl,'tl-tl',[2,4]);}});Ext.define('Ext.util.Region',{requires:['Ext.util.Offset'],statics:{getRegion:function(el){return Ext.fly(el).getRegion();},from:function(o){return new this(o.top,o.right,o.bottom,o.left);}},constructor:function(t,r,b,l){var me=this;me.y=me.top=me[1]=t;me.right=r;me.bottom=b;me.x=me.left=me[0]=l;},contains:function(region){var me=this;return(region.x>=me.x&&region.right<=me.right&&region.y>=me.y&&region.bottom<=me.bottom);},intersect:function(region){var me=this,t=Math.max(me.y,region.y),r=Math.min(me.right,region.right),b=Math.min(me.bottom,region.bottom),l=Math.max(me.x,region.x);if(b>t&&r>l){return new this.self(t,r,b,l);}
else{return false;}},union:function(region){var me=this,t=Math.min(me.y,region.y),r=Math.max(me.right,region.right),b=Math.max(me.bottom,region.bottom),l=Math.min(me.x,region.x);return new this.self(t,r,b,l);},constrainTo:function(r){var me=this,constrain=Ext.Number.constrain;me.top=me.y=constrain(me.top,r.y,r.bottom);me.bottom=constrain(me.bottom,r.y,r.bottom);me.left=me.x=constrain(me.left,r.x,r.right);me.right=constrain(me.right,r.x,r.right);return me;},adjust:function(t,r,b,l){var me=this;me.top=me.y+=t;me.left=me.x+=l;me.right+=r;me.bottom+=b;return me;},getOutOfBoundOffset:function(axis,p){if(!Ext.isObject(axis)){if(axis=='x'){return this.getOutOfBoundOffsetX(p);}else{return this.getOutOfBoundOffsetY(p);}}else{p=axis;var d=new Ext.util.Offset();d.x=this.getOutOfBoundOffsetX(p.x);d.y=this.getOutOfBoundOffsetY(p.y);return d;}},getOutOfBoundOffsetX:function(p){if(p<=this.x){return this.x-p;}else if(p>=this.right){return this.right-p;}
return 0;},getOutOfBoundOffsetY:function(p){if(p<=this.y){return this.y-p;}else if(p>=this.bottom){return this.bottom-p;}
return 0;},isOutOfBound:function(axis,p){if(!Ext.isObject(axis)){if(axis=='x'){return this.isOutOfBoundX(p);}else{return this.isOutOfBoundY(p);}}else{p=axis;return(this.isOutOfBoundX(p.x)||this.isOutOfBoundY(p.y));}},isOutOfBoundX:function(p){return(p<this.x||p>this.right);},isOutOfBoundY:function(p){return(p<this.y||p>this.bottom);},restrict:function(axis,p,factor){if(Ext.isObject(axis)){var newP;factor=p;p=axis;if(p.copy){newP=p.copy();}
else{newP={x:p.x,y:p.y};}
newP.x=this.restrictX(p.x,factor);newP.y=this.restrictY(p.y,factor);return newP;}else{if(axis=='x'){return this.restrictX(p,factor);}else{return this.restrictY(p,factor);}}},restrictX:function(p,factor){if(!factor){factor=1;}
if(p<=this.x){p-=(p-this.x)*factor;}
else if(p>=this.right){p-=(p-this.right)*factor;}
return p;},restrictY:function(p,factor){if(!factor){factor=1;}
if(p<=this.y){p-=(p-this.y)*factor;}
else if(p>=this.bottom){p-=(p-this.bottom)*factor;}
return p;},getSize:function(){return{width:this.right-this.x,height:this.bottom-this.y};},copy:function(){return new this.self(this.y,this.right,this.bottom,this.x);},copyFrom:function(p){var me=this;me.top=me.y=me[1]=p.y;me.right=p.right;me.bottom=p.bottom;me.left=me.x=me[0]=p.x;return this;},toString:function(){return"Region["+this.top+","+this.right+","+this.bottom+","+this.left+"]";},translateBy:function(x,y){if(arguments.length==1){y=x.y;x=x.x;}
var me=this;me.top=me.y+=y;me.right+=x;me.bottom+=y;me.left=me.x+=x;return me;},round:function(){var me=this;me.top=me.y=Math.round(me.y);me.right=Math.round(me.right);me.bottom=Math.round(me.bottom);me.left=me.x=Math.round(me.x);return me;},equals:function(region){return(this.top==region.top&&this.right==region.right&&this.bottom==region.bottom&&this.left==region.left);}});Ext.define('Ext.grid.plugin.DragDrop',{extend:'Ext.AbstractPlugin',alias:'plugin.gridviewdragdrop',uses:['Ext.view.DragZone','Ext.grid.ViewDropZone'],dragText:'{0} selected row{1}',ddGroup:"GridDD",enableDrop:true,enableDrag:true,containerScroll:false,init:function(view){view.on('render',this.onViewRender,this,{single:true});},destroy:function(){Ext.destroy(this.dragZone,this.dropZone);},enable:function(){var me=this;if(me.dragZone){me.dragZone.unlock();}
if(me.dropZone){me.dropZone.unlock();}
me.callParent();},disable:function(){var me=this;if(me.dragZone){me.dragZone.lock();}
if(me.dropZone){me.dropZone.lock();}
me.callParent();},onViewRender:function(view){var me=this,scrollEl;if(me.enableDrag){if(me.containerScroll){scrollEl=view.getEl();}
me.dragZone=new Ext.view.DragZone({view:view,ddGroup:me.dragGroup||me.ddGroup,dragText:me.dragText,containerScroll:me.containerScroll,scrollEl:scrollEl});}
if(me.enableDrop){me.dropZone=new Ext.grid.ViewDropZone({view:view,ddGroup:me.dropGroup||me.ddGroup});}}});Ext.define('Ext.data.writer.Json',{extend:'Ext.data.writer.Writer',alternateClassName:'Ext.data.JsonWriter',alias:'writer.json',root:undefined,encode:false,allowSingle:true,expandData:false,getExpandedData:function(data){var dataLength=data.length,i=0,item,prop,nameParts,j,tempObj,toObject=function(name,value){var o={};o[name]=value;return o;};for(;i<dataLength;i++){item=data[i];for(prop in item){if(item.hasOwnProperty(prop)){nameParts=prop.split('.');j=nameParts.length-1;if(j>0){tempObj=item[prop];for(;j>0;j--){tempObj=toObject(nameParts[j],tempObj);}
item[nameParts[0]]=item[nameParts[0]]||{};Ext.Object.merge(item[nameParts[0]],tempObj);delete item[prop];}}}}
return data;},writeRecords:function(request,data){var root=this.root;if(this.expandData){data=this.getExpandedData(data);}
if(this.allowSingle&&data.length===1){data=data[0];}
if(this.encode){if(root){request.params[root]=Ext.encode(data);}else{}}else{request.jsonData=request.jsonData||{};if(root){request.jsonData[root]=data;}else{request.jsonData=data;}}
return request;}});Ext.define('Ext.layout.ContextItem',{requires:['Ext.layout.ClassList'],heightModel:null,widthModel:null,sizeModel:null,optOut:false,ownerSizePolicy:null,boxChildren:null,boxParent:null,isBorderBoxValue:null,children:[],dirty:null,dirtyCount:0,hasRawContent:true,isContextItem:true,isTopLevel:false,consumersContentHeight:0,consumersContentWidth:0,consumersContainerHeight:0,consumersContainerWidth:0,consumersHeight:0,consumersWidth:0,ownerCtContext:null,remainingChildDimensions:0,props:null,state:null,wrapsComponent:false,constructor:function(config){var me=this,sizeModels=Ext.layout.SizeModel.sizeModels,configured=sizeModels.configured,shrinkWrap=sizeModels.shrinkWrap,el,lastBox,ownerCt,ownerCtContext,props,sizeModel,target,lastWidth,lastHeight,sameWidth,sameHeight,widthModel,heightModel,optOut;Ext.apply(me,config);el=me.el;me.id=el.id;me.flushedProps={};me.props=props={};me.styles={};target=me.target;if(!target.isComponent){lastBox=el.lastBox;}else{me.wrapsComponent=true;me.framing=target.frameSize||null;me.isComponentChild=target.ownerLayout&&target.ownerLayout.isComponentLayout;lastBox=target.lastBox;ownerCt=target.ownerCt;if(ownerCt&&(ownerCtContext=ownerCt.el&&me.context.items[ownerCt.el.id])){me.ownerCtContext=ownerCtContext;}
me.sizeModel=sizeModel=target.getSizeModel(ownerCtContext&&ownerCtContext.widthModel.pairsByHeightOrdinal[ownerCtContext.heightModel.ordinal]);me.widthModel=widthModel=sizeModel.width;me.heightModel=heightModel=sizeModel.height;if(lastBox&&lastBox.invalid===false){sameWidth=(target.width===(lastWidth=lastBox.width));sameHeight=(target.height===(lastHeight=lastBox.height));if(widthModel===shrinkWrap&&heightModel===shrinkWrap){optOut=true;}else if(widthModel===configured&&sameWidth){optOut=heightModel===shrinkWrap||(heightModel===configured&&sameHeight);}
if(optOut){me.optOut=true;props.width=lastWidth;props.height=lastHeight;}}}
me.lastBox=lastBox;},init:function(full,options){var me=this,oldProps=me.props,oldDirty=me.dirty,ownerCtContext=me.ownerCtContext,ownerLayout=me.target.ownerLayout,firstTime=!me.state,ret=full||firstTime,children,i,n,ownerCt,sizeModel,target,oldHeightModel=me.heightModel,oldWidthModel=me.widthModel,newHeightModel,newWidthModel,remainingCount=0;me.dirty=me.invalid=false;me.props={};me.remainingChildDimensions=0;if(me.boxChildren){me.boxChildren.length=0;}
if(!firstTime){me.clearAllBlocks('blocks');me.clearAllBlocks('domBlocks');}
if(!me.wrapsComponent){return ret;}
target=me.target;me.state={};if(firstTime){if(target.beforeLayout&&target.beforeLayout!==Ext.emptyFn){target.beforeLayout();}
if(!ownerCtContext&&(ownerCt=target.ownerCt)){ownerCtContext=me.context.items[ownerCt.el.id];}
if(ownerCtContext){me.ownerCtContext=ownerCtContext;me.isBoxParent=target.ownerLayout.isItemBoxParent(me);}else{me.isTopLevel=true;}
me.frameBodyContext=me.getEl('frameBody');}else{ownerCtContext=me.ownerCtContext;me.isTopLevel=!ownerCtContext;children=me.children;for(i=0,n=children.length;i<n;++i){children[i].init(true);}}
me.hasRawContent=!(target.isContainer&&target.items.items.length>0);if(full){me.widthModel=me.heightModel=null;sizeModel=target.getSizeModel(ownerCtContext&&ownerCtContext.widthModel.pairsByHeightOrdinal[ownerCtContext.heightModel.ordinal]);if(firstTime){me.sizeModel=sizeModel;}
me.widthModel=sizeModel.width;me.heightModel=sizeModel.height;if(ownerCtContext&&!me.isComponentChild){ownerCtContext.remainingChildDimensions+=2;}}else if(oldProps){me.recoverProp('x',oldProps,oldDirty);me.recoverProp('y',oldProps,oldDirty);if(me.widthModel.calculated){me.recoverProp('width',oldProps,oldDirty);}else if('width'in oldProps){++remainingCount;}
if(me.heightModel.calculated){me.recoverProp('height',oldProps,oldDirty);}else if('height'in oldProps){++remainingCount;}
if(ownerCtContext&&!me.isComponentChild){ownerCtContext.remainingChildDimensions+=remainingCount;}}
if(oldProps&&ownerLayout&&ownerLayout.manageMargins){me.recoverProp('margin-top',oldProps,oldDirty);me.recoverProp('margin-right',oldProps,oldDirty);me.recoverProp('margin-bottom',oldProps,oldDirty);me.recoverProp('margin-left',oldProps,oldDirty);}
if(options){newHeightModel=options.heightModel;newWidthModel=options.widthModel;if(newWidthModel&&newHeightModel&&oldWidthModel&&oldHeightModel){if(oldWidthModel.shrinkWrap&&oldHeightModel.shrinkWrap){if(newWidthModel.constrainedMax&&newHeightModel.constrainedMin){newHeightModel=null;}}}
if(newWidthModel){me.widthModel=newWidthModel;}
if(newHeightModel){me.heightModel=newHeightModel;}
if(options.state){Ext.apply(me.state,options.state);}}
return ret;},initContinue:function(full){var me=this,ownerCtContext=me.ownerCtContext,comp=me.target,widthModel=me.widthModel,hierarchyState=comp.getHierarchyState(),boxParent;if(widthModel.fixed){hierarchyState.inShrinkWrapTable=false;}else{delete hierarchyState.inShrinkWrapTable;}
if(full){if(ownerCtContext&&widthModel.shrinkWrap){boxParent=ownerCtContext.isBoxParent?ownerCtContext:ownerCtContext.boxParent;if(boxParent){boxParent.addBoxChild(me);}}else if(widthModel.natural){me.boxParent=ownerCtContext;}}
return full;},initDone:function(containerLayoutDone){var me=this,props=me.props,state=me.state;if(me.remainingChildDimensions===0){props.containerChildrenSizeDone=true;}
if(containerLayoutDone){props.containerLayoutDone=true;}
if(me.boxChildren&&me.boxChildren.length&&me.widthModel.shrinkWrap){me.el.setWidth(10000);state.blocks=(state.blocks||0)+1;}},initAnimation:function(){var me=this,target=me.target,ownerCtContext=me.ownerCtContext;if(ownerCtContext&&ownerCtContext.isTopLevel){me.animatePolicy=target.ownerLayout.getAnimatePolicy(me);}else if(!ownerCtContext&&target.isCollapsingOrExpanding&&target.animCollapse){me.animatePolicy=target.componentLayout.getAnimatePolicy(me);}
if(me.animatePolicy){me.context.queueAnimation(me);}},addCls:function(newCls){this.getClassList().addMany(newCls);},removeCls:function(removeCls){this.getClassList().removeMany(removeCls);},addBlock:function(name,layout,propName){var me=this,collection=me[name]||(me[name]={}),blockedLayouts=collection[propName]||(collection[propName]={});if(!blockedLayouts[layout.id]){blockedLayouts[layout.id]=layout;++layout.blockCount;++me.context.blockCount;}},addBoxChild:function(boxChildItem){var me=this,children,widthModel=boxChildItem.widthModel;boxChildItem.boxParent=this;boxChildItem.measuresBox=widthModel.shrinkWrap?boxChildItem.hasRawContent:widthModel.natural;if(boxChildItem.measuresBox){children=me.boxChildren;if(children){children.push(boxChildItem);}else{me.boxChildren=[boxChildItem];}}},addPositionStyles:function(styles,props){var x=props.x,y=props.y,count=0;if(x!==undefined){styles.left=x+'px';++count;}
if(y!==undefined){styles.top=y+'px';++count;}
return count;},addTrigger:function(propName,inDom){var me=this,name=inDom?'domTriggers':'triggers',collection=me[name]||(me[name]={}),context=me.context,layout=context.currentLayout,triggers=collection[propName]||(collection[propName]={});if(!triggers[layout.id]){triggers[layout.id]=layout;++layout.triggerCount;triggers=context.triggers[inDom?'dom':'data'];(triggers[layout.id]||(triggers[layout.id]=[])).push({item:this,prop:propName});if(me.props[propName]!==undefined){if(!inDom||!(me.dirty&&(propName in me.dirty))){++layout.firedTriggers;}}}},boxChildMeasured:function(){var me=this,state=me.state,count=(state.boxesMeasured=(state.boxesMeasured||0)+1);if(count==me.boxChildren.length){state.clearBoxWidth=1;++me.context.progressCount;me.markDirty();}},borderNames:['border-top-width','border-right-width','border-bottom-width','border-left-width'],marginNames:['margin-top','margin-right','margin-bottom','margin-left'],paddingNames:['padding-top','padding-right','padding-bottom','padding-left'],trblNames:['top','right','bottom','left'],cacheMissHandlers:{borderInfo:function(me){var info=me.getStyles(me.borderNames,me.trblNames);info.width=info.left+info.right;info.height=info.top+info.bottom;return info;},marginInfo:function(me){var info=me.getStyles(me.marginNames,me.trblNames);info.width=info.left+info.right;info.height=info.top+info.bottom;return info;},paddingInfo:function(me){var item=me.frameBodyContext||me,info=item.getStyles(me.paddingNames,me.trblNames);info.width=info.left+info.right;info.height=info.top+info.bottom;return info;}},checkCache:function(entry){return this.cacheMissHandlers[entry](this);},clearAllBlocks:function(name){var collection=this[name],propName;if(collection){for(propName in collection){this.clearBlocks(name,propName);}}},clearBlocks:function(name,propName){var collection=this[name],blockedLayouts=collection&&collection[propName],context,layout,layoutId;if(blockedLayouts){delete collection[propName];context=this.context;for(layoutId in blockedLayouts){layout=blockedLayouts[layoutId];--context.blockCount;if(!--layout.blockCount&&!layout.pending&&!layout.done){context.queueLayout(layout);}}}},block:function(layout,propName){this.addBlock('blocks',layout,propName);},domBlock:function(layout,propName){this.addBlock('domBlocks',layout,propName);},fireTriggers:function(name,propName){var collection=this[name],triggers=collection&&collection[propName],context=this.context,layout,layoutId;if(triggers){for(layoutId in triggers){layout=triggers[layoutId];++layout.firedTriggers;if(!layout.done&&!layout.blockCount&&!layout.pending){context.queueLayout(layout);}}}},flush:function(){var me=this,dirty=me.dirty,state=me.state,targetEl=me.el;me.dirtyCount=0;if(me.classList&&me.classList.dirty){me.classList.flush();}
if('attributes'in me){targetEl.set(me.attributes);delete me.attributes;}
if('innerHTML'in me){targetEl.innerHTML=me.innerHTML;delete me.innerHTML;}
if(state&&state.clearBoxWidth){state.clearBoxWidth=0;me.el.setStyle('width',null);if(!--state.blocks){me.context.queueItemLayouts(me);}}
if(dirty){delete me.dirty;me.writeProps(dirty,true);}},flushAnimations:function(){var me=this,animateFrom=me.previousSize,target,targetAnim,duration,animateProps,anim,changeCount,j,propsLen,propName,oldValue,newValue;if(animateFrom){target=me.target;targetAnim=target.layout&&target.layout.animate;if(targetAnim){duration=Ext.isNumber(targetAnim)?targetAnim:targetAnim.duration;}
animateProps=Ext.Object.getKeys(me.animatePolicy);anim=Ext.apply({},{from:{},to:{},duration:duration||Ext.fx.Anim.prototype.duration},targetAnim);for(changeCount=0,j=0,propsLen=animateProps.length;j<propsLen;j++){propName=animateProps[j];oldValue=animateFrom[propName];newValue=me.peek(propName);if(oldValue!=newValue){propName=me.translateProps[propName]||propName;anim.from[propName]=oldValue;anim.to[propName]=newValue;++changeCount;}}
if(changeCount){if(me.isCollapsingOrExpanding===1){target.componentLayout.undoLayout(me);}
else{me.writeProps(anim.from);}
me.el.animate(anim);Ext.fx.Manager.getFxQueue(me.el.id)[0].on({afteranimate:function(){if(me.isCollapsingOrExpanding===1){target.componentLayout.redoLayout(me);target.afterCollapse(true);}else if(me.isCollapsingOrExpanding===2){target.afterExpand(true);}}});}}},getBorderInfo:function(){var me=this,info=me.borderInfo;if(!info){me.borderInfo=info=me.checkCache('borderInfo');}
return info;},getClassList:function(){return this.classList||(this.classList=new Ext.layout.ClassList(this));},getEl:function(nameOrEl,owner){var me=this,src,el,elContext;if(nameOrEl){if(nameOrEl.dom){el=nameOrEl;}else{src=me.target;if(owner){src=owner;}
el=src[nameOrEl];if(typeof el=='function'){el=el.call(src);if(el===me.el){return this;}}}
if(el){elContext=me.context.getEl(me,el);}}
return elContext||null;},getFrameInfo:function(){var me=this,info=me.frameInfo,framing,border;if(!info){framing=me.framing;border=me.getBorderInfo();me.frameInfo=info=framing?{top:framing.top+border.top,right:framing.right+border.right,bottom:framing.bottom+border.bottom,left:framing.left+border.left,width:framing.width+border.width,height:framing.height+border.height}:border;}
return info;},getMarginInfo:function(){var me=this,info=me.marginInfo,comp,manageMargins,margins,ownerLayout,ownerLayoutId;if(!info){if(!me.wrapsComponent){info=me.checkCache('marginInfo');}else{comp=me.target;ownerLayout=comp.ownerLayout;ownerLayoutId=ownerLayout?ownerLayout.id:null;manageMargins=ownerLayout&&ownerLayout.manageMargins;info=comp.margin$;if(info&&info.ownerId!==ownerLayoutId){info=null;}
if(!info){info=me.parseMargins(comp,comp.margin)||me.checkCache('marginInfo');if(manageMargins){margins=me.parseMargins(comp,comp.margins,ownerLayout.defaultMargins);if(margins){info={top:info.top+margins.top,right:info.right+margins.right,bottom:info.bottom+margins.bottom,left:info.left+margins.left};}
me.setProp('margin-top',0);me.setProp('margin-right',0);me.setProp('margin-bottom',0);me.setProp('margin-left',0);}
info.ownerId=ownerLayoutId;comp.margin$=info;}
info.width=info.left+info.right;info.height=info.top+info.bottom;}
me.marginInfo=info;}
return info;},clearMarginCache:function(){delete this.marginInfo;delete this.target.margin$;},getPaddingInfo:function(){var me=this,info=me.paddingInfo;if(!info){me.paddingInfo=info=me.checkCache('paddingInfo');}
return info;},getProp:function(propName){var me=this,result=me.props[propName];me.addTrigger(propName);return result;},getDomProp:function(propName){var me=this,result=(me.dirty&&(propName in me.dirty))?undefined:me.props[propName];me.addTrigger(propName,true);return result;},getStyle:function(styleName){var me=this,styles=me.styles,info,value;if(styleName in styles){value=styles[styleName];}else{info=me.styleInfo[styleName];value=me.el.getStyle(styleName);if(info&&info.parseInt){value=parseInt(value,10)||0;}
styles[styleName]=value;}
return value;},getStyles:function(styleNames,altNames){var me=this,styleCache=me.styles,values={},hits=0,n=styleNames.length,i,missing,missingAltNames,name,info,styleInfo,styles,value;altNames=altNames||styleNames;for(i=0;i<n;++i){name=styleNames[i];if(name in styleCache){values[altNames[i]]=styleCache[name];++hits;if(i&&hits==1){missing=styleNames.slice(0,i);missingAltNames=altNames.slice(0,i);}}else if(hits){(missing||(missing=[])).push(name);(missingAltNames||(missingAltNames=[])).push(altNames[i]);}}
if(hits<n){missing=missing||styleNames;missingAltNames=missingAltNames||altNames;styleInfo=me.styleInfo;styles=me.el.getStyle(missing);for(i=missing.length;i--;){name=missing[i];info=styleInfo[name];value=styles[name];if(info&&info.parseInt){value=parseInt(value,10)||0;}
values[missingAltNames[i]]=value;styleCache[name]=value;}}
return values;},hasProp:function(propName){return this.getProp(propName)!=null;},hasDomProp:function(propName){return this.getDomProp(propName)!=null;},invalidate:function(options){this.context.queueInvalidate(this,options);},markDirty:function(){if(++this.dirtyCount==1){this.context.queueFlush(this);}},onBoxMeasured:function(){var boxParent=this.boxParent,state=this.state;if(boxParent&&boxParent.widthModel.shrinkWrap&&!state.boxMeasured&&this.measuresBox){state.boxMeasured=1;boxParent.boxChildMeasured();}},parseMargins:function(comp,margins,defaultMargins){if(margins===true){margins=5;}
var type=typeof margins,ret;if(type=='string'||type=='number'){ret=comp.parseBox(margins);}else if(margins||defaultMargins){ret={top:0,right:0,bottom:0,left:0};if(defaultMargins){Ext.apply(ret,this.parseMargins(comp,defaultMargins));}
if(margins){margins=Ext.apply(ret,comp.parseBox(margins));}}
return ret;},peek:function(propName){return this.props[propName];},recoverProp:function(propName,oldProps,oldDirty){var me=this,props=me.props,dirty;if(propName in oldProps){props[propName]=oldProps[propName];if(oldDirty&&propName in oldDirty){dirty=me.dirty||(me.dirty={});dirty[propName]=oldDirty[propName];}}},redo:function(deep){var me=this,items,len,i;me.revertProps(me.props);if(deep&&me.wrapsComponent){if(me.childItems){for(i=0,items=me.childItems,len=items.length;i<len;i++){items[i].redo(deep);}}
for(i=0,items=me.children,len=items.length;i<len;i++){items[i].redo();}}},removeEl:function(nameOrEl,owner){var me=this,src,el;if(nameOrEl){if(nameOrEl.dom){el=nameOrEl;}else{src=me.target;if(owner){src=owner;}
el=src[nameOrEl];if(typeof el=='function'){el=el.call(src);if(el===me.el){return this;}}}
if(el){me.context.removeEl(me,el);}}},revertProps:function(props){var name,flushed=this.flushedProps,reverted={};for(name in props){if(flushed.hasOwnProperty(name)){reverted[name]=props[name];}}
this.writeProps(reverted);},setAttribute:function(name,value){var me=this;if(!me.attributes){me.attributes={};}
me.attributes[name]=value;me.markDirty();},setBox:function(box){var me=this;if('left'in box){me.setProp('x',box.left);}
if('top'in box){me.setProp('y',box.top);}
me.setSize(box.width,box.height);},setContentHeight:function(height,measured){if(!measured&&this.hasRawContent){return 1;}
return this.setProp('contentHeight',height);},setContentWidth:function(width,measured){if(!measured&&this.hasRawContent){return 1;}
return this.setProp('contentWidth',width);},setContentSize:function(width,height,measured){return this.setContentWidth(width,measured)+
this.setContentHeight(height,measured)==2;},setProp:function(propName,value,dirty){var me=this,valueType=typeof value,borderBox,info;if(valueType=='undefined'||(valueType==='number'&&isNaN(value))){return 0;}
if(me.props[propName]===value){return 1;}
me.props[propName]=value;++me.context.progressCount;if(dirty===false){me.fireTriggers('domTriggers',propName);me.clearBlocks('domBlocks',propName);}else{info=me.styleInfo[propName];if(info){if(!me.dirty){me.dirty={};}
if(propName=='width'||propName=='height'){borderBox=me.isBorderBoxValue;if(borderBox===null){me.isBorderBoxValue=borderBox=!!me.el.isBorderBox();}
if(!borderBox){me.borderInfo||me.getBorderInfo();me.paddingInfo||me.getPaddingInfo();}}
me.dirty[propName]=value;me.markDirty();}}
me.fireTriggers('triggers',propName);me.clearBlocks('blocks',propName);return 1;},setHeight:function(height,dirty){var me=this,comp=me.target,ownerCtContext=me.ownerCtContext,frameBody,frameInfo,min,oldHeight,rem;if(height<0){height=0;}
if(!me.wrapsComponent){if(!me.setProp('height',height,dirty)){return NaN;}}else{min=me.collapsedVert?0:(comp.minHeight||0);height=Ext.Number.constrain(height,min,comp.maxHeight);oldHeight=me.props.height;if(!me.setProp('height',height,dirty)){return NaN;}
if(ownerCtContext&&!me.isComponentChild&&isNaN(oldHeight)){rem=--ownerCtContext.remainingChildDimensions;if(!rem){ownerCtContext.setProp('containerChildrenSizeDone',true);}}
frameBody=me.frameBodyContext;if(frameBody){frameInfo=me.getFrameInfo();frameBody.setHeight(height-frameInfo.height,dirty);}}
return height;},setWidth:function(width,dirty){var me=this,comp=me.target,ownerCtContext=me.ownerCtContext,frameBody,frameInfo,min,oldWidth,rem;if(width<0){width=0;}
if(!me.wrapsComponent){if(!me.setProp('width',width,dirty)){return NaN;}}else{min=me.collapsedHorz?0:(comp.minWidth||0);width=Ext.Number.constrain(width,min,comp.maxWidth);oldWidth=me.props.width
if(!me.setProp('width',width,dirty)){return NaN;}
if(ownerCtContext&&!me.isComponentChild&&isNaN(oldWidth)){rem=--ownerCtContext.remainingChildDimensions;if(!rem){ownerCtContext.setProp('containerChildrenSizeDone',true);}}
frameBody=me.frameBodyContext;if(frameBody){frameInfo=me.getFrameInfo();frameBody.setWidth(width-frameInfo.width,dirty);}}
return width;},setSize:function(width,height,dirty){this.setWidth(width,dirty);this.setHeight(height,dirty);},translateProps:{x:'left',y:'top'},undo:function(deep){var me=this,items,len,i;me.revertProps(me.lastBox);if(deep&&me.wrapsComponent){if(me.childItems){for(i=0,items=me.childItems,len=items.length;i<len;i++){items[i].undo(deep);}}
for(i=0,items=me.children,len=items.length;i<len;i++){items[i].undo();}}},unsetProp:function(propName){var dirty=this.dirty;delete this.props[propName];if(dirty){delete dirty[propName];}},writeProps:function(dirtyProps,flushing){if(!(dirtyProps&&typeof dirtyProps=='object')){Ext.Logger.warn('writeProps expected dirtyProps to be an object');return;}
var me=this,el=me.el,styles={},styleCount=0,styleInfo=me.styleInfo,info,propName,numericValue,width=dirtyProps.width,height=dirtyProps.height,isBorderBox=me.isBorderBoxValue,target=me.target,max=Math.max,paddingWidth=0,paddingHeight=0,hasWidth,hasHeight,isAbsolute,scrollbarSize,style,targetEl;if('displayed'in dirtyProps){el.setDisplayed(dirtyProps.displayed);}
for(propName in dirtyProps){if(flushing){me.fireTriggers('domTriggers',propName);me.clearBlocks('domBlocks',propName);me.flushedProps[propName]=1;}
info=styleInfo[propName];if(info&&info.dom){if(info.suffix&&(numericValue=parseInt(dirtyProps[propName],10))){styles[propName]=numericValue+info.suffix;}
else{styles[propName]=dirtyProps[propName];}
++styleCount;}}
if('x'in dirtyProps||'y'in dirtyProps){if(target.isComponent){target.setPosition(dirtyProps.x,dirtyProps.y);}else{styleCount+=me.addPositionStyles(styles,dirtyProps);}}
if(!isBorderBox&&(width>0||height>0)){if(!me.frameBodyContext){paddingWidth=me.paddingInfo.width;paddingHeight=me.paddingInfo.height;}
if(width){width=max(parseInt(width,10)-(me.borderInfo.width+paddingWidth),0);styles.width=width+'px';++styleCount;}
if(height){height=max(parseInt(height,10)-(me.borderInfo.height+paddingHeight),0);styles.height=height+'px';++styleCount;}}
if(me.wrapsComponent&&Ext.isIE9&&Ext.isStrict){if((hasWidth=width!==undefined&&me.hasOverflowY)||(hasHeight=height!==undefined&&me.hasOverflowX)){isAbsolute=me.isAbsolute;if(isAbsolute===undefined){isAbsolute=false;targetEl=me.target.getTargetEl();style=targetEl.getStyle('position');if(style=='absolute'){style=targetEl.getStyle('box-sizing');isAbsolute=(style=='border-box');}
me.isAbsolute=isAbsolute;}
if(isAbsolute){scrollbarSize=Ext.getScrollbarSize();if(hasWidth){width=parseInt(width,10)+scrollbarSize.width;styles.width=width+'px';++styleCount;}
if(hasHeight){height=parseInt(height,10)+scrollbarSize.height;styles.height=height+'px';++styleCount;}}}}
if(styleCount){el.setStyle(styles);}}},function(){var px={dom:true,parseInt:true,suffix:'px'},isDom={dom:true},faux={dom:false};this.prototype.styleInfo={containerChildrenSizeDone:faux,containerLayoutDone:faux,displayed:faux,done:faux,x:faux,y:faux,columnWidthsDone:faux,left:px,top:px,right:px,bottom:px,width:px,height:px,'border-top-width':px,'border-right-width':px,'border-bottom-width':px,'border-left-width':px,'margin-top':px,'margin-right':px,'margin-bottom':px,'margin-left':px,'padding-top':px,'padding-right':px,'padding-bottom':px,'padding-left':px,'line-height':isDom,display:isDom};});Ext.define('Ext.fx.target.Sprite',{extend:'Ext.fx.target.Target',type:'draw',getFromPrim:function(sprite,attr){var obj;switch(attr){case'rotate':case'rotation':obj=sprite.attr.rotation;return{x:obj.x||0,y:obj.y||0,degrees:obj.degrees||0};case'scale':case'scaling':obj=sprite.attr.scaling;return{x:obj.x||1,y:obj.y||1,cx:obj.cx||0,cy:obj.cy||0};case'translate':case'translation':obj=sprite.attr.translation;return{x:obj.x||0,y:obj.y||0};default:return sprite.attr[attr];}},getAttr:function(attr,val){return[[this.target,val!=undefined?val:this.getFromPrim(this.target,attr)]];},setAttr:function(targetData){var ln=targetData.length,spriteArr=[],attrsConf,attr,attrArr,attrs,sprite,idx,value,i,j,x,y,ln2;for(i=0;i<ln;i++){attrsConf=targetData[i].attrs;for(attr in attrsConf){attrArr=attrsConf[attr];ln2=attrArr.length;for(j=0;j<ln2;j++){sprite=attrArr[j][0];attrs=attrArr[j][1];if(attr==='translate'||attr==='translation'){value={x:attrs.x,y:attrs.y};}
else if(attr==='rotate'||attr==='rotation'){x=attrs.x;if(isNaN(x)){x=null;}
y=attrs.y;if(isNaN(y)){y=null;}
value={degrees:attrs.degrees,x:x,y:y};}else if(attr==='scale'||attr==='scaling'){x=attrs.x;if(isNaN(x)){x=null;}
y=attrs.y;if(isNaN(y)){y=null;}
value={x:x,y:y,cx:attrs.cx,cy:attrs.cy};}
else if(attr==='width'||attr==='height'||attr==='x'||attr==='y'){value=parseFloat(attrs);}
else{value=attrs;}
idx=Ext.Array.indexOf(spriteArr,sprite);if(idx==-1){spriteArr.push([sprite,{}]);idx=spriteArr.length-1;}
spriteArr[idx][1][attr]=value;}}}
ln=spriteArr.length;for(i=0;i<ln;i++){spriteArr[i][0].setAttributes(spriteArr[i][1]);}
this.target.redraw();}});Ext.define('Ext.form.FieldAncestor',{requires:['Ext.container.Monitor'],xhooks:{initHierarchyState:function(hierarchyState){if(this.fieldDefaults){if(hierarchyState.fieldDefaults){hierarchyState.fieldDefaults=Ext.apply(Ext.Object.chain(hierarchyState.fieldDefaults),this.fieldDefaults);}else{hierarchyState.fieldDefaults=this.fieldDefaults;}}}},initFieldAncestor:function(){var me=this;me.addEvents('fieldvaliditychange','fielderrorchange');me.monitor=new Ext.container.Monitor({scope:me,selector:'[isFormField]',addHandler:me.onChildFieldAdd,removeHandler:me.onChildFieldRemove});me.initFieldDefaults();},initMonitor:function(){this.monitor.bind(this);},onChildFieldAdd:function(field){var me=this;me.mon(field,'errorchange',me.handleFieldErrorChange,me);me.mon(field,'validitychange',me.handleFieldValidityChange,me);},onChildFieldRemove:function(field){var me=this;me.mun(field,'errorchange',me.handleFieldErrorChange,me);me.mun(field,'validitychange',me.handleFieldValidityChange,me);},initFieldDefaults:function(){if(!this.fieldDefaults){this.fieldDefaults={};}},handleFieldValidityChange:function(field,isValid){var me=this;if(field!==me){me.fireEvent('fieldvaliditychange',me,field,isValid);me.onFieldValidityChange(field,isValid);}},handleFieldErrorChange:function(labelable,activeError){var me=this;if(labelable!==me){me.fireEvent('fielderrorchange',me,labelable,activeError);me.onFieldErrorChange(labelable,activeError);}},onFieldValidityChange:Ext.emptyFn,onFieldErrorChange:Ext.emptyFn,beforeDestroy:function(){this.monitor.unbind();this.callParent();}});Ext.define('Ext.app.domain.Global',{extend:'Ext.app.EventDomain',singleton:true,type:'global',constructor:function(){var me=this;me.callParent();me.monitor(Ext.globalEvents);},listen:function(listeners,controller){this.callParent([{global:listeners},controller]);},match:function(){return true;}});Ext.define('Ext.layout.component.Component',{extend:'Ext.layout.Layout',type:'component',isComponentLayout:true,nullBox:{},usesContentHeight:true,usesContentWidth:true,usesHeight:true,usesWidth:true,beginLayoutCycle:function(ownerContext,firstCycle){var me=this,owner=me.owner,ownerCtContext=ownerContext.ownerCtContext,heightModel=ownerContext.heightModel,widthModel=ownerContext.widthModel,body=owner.el.dom===document.body,lastBox=owner.lastBox||me.nullBox,lastSize=owner.el.lastBox||me.nullBox,dirty=!body,ownerLayout,v,widthName,heightName;me.callParent(arguments);if(firstCycle){if(me.usesContentWidth){++ownerContext.consumersContentWidth;}
if(me.usesContentHeight){++ownerContext.consumersContentHeight;}
if(me.usesWidth){++ownerContext.consumersWidth;}
if(me.usesHeight){++ownerContext.consumersHeight;}
if(ownerCtContext&&!ownerCtContext.hasRawContent){ownerLayout=owner.ownerLayout;if(ownerLayout.usesWidth){++ownerContext.consumersWidth;}
if(ownerLayout.usesHeight){++ownerContext.consumersHeight;}}}
if(widthModel.configured){widthName=widthModel.names.width;if(!body){dirty=firstCycle?owner[widthName]!==lastSize.width:widthModel.constrained;}
ownerContext.setWidth(owner[widthName],dirty);}else if(ownerContext.isTopLevel){if(widthModel.calculated){v=lastBox.width;ownerContext.setWidth(v,v!=lastSize.width);}
v=lastBox.x;ownerContext.setProp('x',v,v!=lastSize.x);}
if(heightModel.configured){heightName=heightModel.names.height;if(!body){dirty=firstCycle?owner[heightName]!==lastSize.height:heightModel.constrained;}
ownerContext.setHeight(owner[heightName],dirty);}else if(ownerContext.isTopLevel){if(heightModel.calculated){v=lastBox.height;ownerContext.setHeight(v,v!=lastSize.height);}
v=lastBox.y;ownerContext.setProp('y',v,v!=lastSize.y);}},finishedLayout:function(ownerContext){var me=this,elementChildren=ownerContext.children,owner=me.owner,len,i,elContext,lastBox,props;if(elementChildren){len=elementChildren.length;for(i=0;i<len;i++){elContext=elementChildren[i];elContext.el.lastBox=elContext.props;}}
ownerContext.previousSize=me.lastComponentSize;me.lastComponentSize=owner.el.lastBox=props=ownerContext.props;lastBox=owner.lastBox||(owner.lastBox={});lastBox.x=props.x;lastBox.y=props.y;lastBox.width=props.width;lastBox.height=props.height;lastBox.invalid=false;me.callParent(arguments);},notifyOwner:function(ownerContext){var me=this,currentSize=me.lastComponentSize,prevSize=ownerContext.previousSize,args=[currentSize.width,currentSize.height];if(prevSize){args.push(prevSize.width,prevSize.height);}
me.owner.afterComponentLayout.apply(me.owner,args);},getTarget:function(){return this.owner.el;},getRenderTarget:function(){return this.owner.el;},cacheTargetInfo:function(ownerContext){var me=this,targetInfo=me.targetInfo,target;if(!targetInfo){target=ownerContext.getEl('getTarget',me);me.targetInfo=targetInfo={padding:target.getPaddingInfo(),border:target.getBorderInfo()};}
return targetInfo;},measureAutoDimensions:function(ownerContext,dimensions){var me=this,owner=me.owner,containerLayout=owner.layout,heightModel=ownerContext.heightModel,widthModel=ownerContext.widthModel,boxParent=ownerContext.boxParent,isBoxParent=ownerContext.isBoxParent,props=ownerContext.props,isContainer,ret={gotWidth:false,gotHeight:false,isContainer:(isContainer=!ownerContext.hasRawContent)},hv=dimensions||3,zeroWidth,zeroHeight,needed=0,got=0,ready,size,temp;if(widthModel.shrinkWrap&&ownerContext.consumersContentWidth){++needed;zeroWidth=!(hv&1);if(isContainer){if(zeroWidth){ret.contentWidth=0;ret.gotWidth=true;++got;}else if((ret.contentWidth=ownerContext.getProp('contentWidth'))!==undefined){ret.gotWidth=true;++got;}}else{size=props.contentWidth;if(typeof size=='number'){ret.contentWidth=size;ret.gotWidth=true;++got;}else{if(zeroWidth){ready=true;}else if(!ownerContext.hasDomProp('containerChildrenSizeDone')){ready=false;}else if(isBoxParent||!boxParent||boxParent.widthModel.shrinkWrap){ready=true;}else{ready=boxParent.hasDomProp('width');}
if(ready){if(zeroWidth){temp=0;}else if(containerLayout&&containerLayout.measureContentWidth){temp=containerLayout.measureContentWidth(ownerContext);}else{temp=me.measureContentWidth(ownerContext);}
if(!isNaN(ret.contentWidth=temp)){ownerContext.setContentWidth(temp,true);ret.gotWidth=true;++got;}}}}}else if(widthModel.natural&&ownerContext.consumersWidth){++needed;size=props.width;if(typeof size=='number'){ret.width=size;ret.gotWidth=true;++got;}else{if(isBoxParent||!boxParent){ready=true;}else{ready=boxParent.hasDomProp('width');}
if(ready){if(!isNaN(ret.width=me.measureOwnerWidth(ownerContext))){ownerContext.setWidth(ret.width,false);ret.gotWidth=true;++got;}}}}
if(heightModel.shrinkWrap&&ownerContext.consumersContentHeight){++needed;zeroHeight=!(hv&2);if(isContainer){if(zeroHeight){ret.contentHeight=0;ret.gotHeight=true;++got;}else if((ret.contentHeight=ownerContext.getProp('contentHeight'))!==undefined){ret.gotHeight=true;++got;}}else{size=props.contentHeight;if(typeof size=='number'){ret.contentHeight=size;ret.gotHeight=true;++got;}else{if(zeroHeight){ready=true;}else if(!ownerContext.hasDomProp('containerChildrenSizeDone')){ready=false;}else if(owner.noWrap){ready=true;}else if(!widthModel.shrinkWrap){ready=(ownerContext.bodyContext||ownerContext).hasDomProp('width');}else if(isBoxParent||!boxParent||boxParent.widthModel.shrinkWrap){ready=true;}else{ready=boxParent.hasDomProp('width');}
if(ready){if(zeroHeight){temp=0;}else if(containerLayout&&containerLayout.measureContentHeight){temp=containerLayout.measureContentHeight(ownerContext);}else{temp=me.measureContentHeight(ownerContext);}
if(!isNaN(ret.contentHeight=temp)){ownerContext.setContentHeight(temp,true);ret.gotHeight=true;++got;}}}}}else if(heightModel.natural&&ownerContext.consumersHeight){++needed;size=props.height;if(typeof size=='number'){ret.height=size;ret.gotHeight=true;++got;}else{if(isBoxParent||!boxParent){ready=true;}else{ready=boxParent.hasDomProp('width');}
if(ready){if(!isNaN(ret.height=me.measureOwnerHeight(ownerContext))){ownerContext.setHeight(ret.height,false);ret.gotHeight=true;++got;}}}}
if(boxParent){ownerContext.onBoxMeasured();}
ret.gotAll=got==needed;return ret;},measureContentWidth:function(ownerContext){return ownerContext.el.getWidth()-ownerContext.getFrameInfo().width;},measureContentHeight:function(ownerContext){return ownerContext.el.getHeight()-ownerContext.getFrameInfo().height;},measureOwnerHeight:function(ownerContext){return ownerContext.el.getHeight();},measureOwnerWidth:function(ownerContext){return ownerContext.el.getWidth();}});Ext.define('Ext.grid.plugin.HeaderResizer',{extend:'Ext.AbstractPlugin',requires:['Ext.dd.DragTracker','Ext.util.Region'],alias:'plugin.gridheaderresizer',disabled:false,config:{dynamic:false},colHeaderCls:Ext.baseCSSPrefix+'column-header',minColWidth:40,maxColWidth:1000,wResizeCursor:'col-resize',eResizeCursor:'col-resize',init:function(headerCt){this.headerCt=headerCt;headerCt.on('render',this.afterHeaderRender,this,{single:true});},destroy:function(){if(this.tracker){this.tracker.destroy();}},afterHeaderRender:function(){var headerCt=this.headerCt,el=headerCt.el;headerCt.mon(el,'mousemove',this.onHeaderCtMouseMove,this);this.tracker=new Ext.dd.DragTracker({disabled:this.disabled,onBeforeStart:Ext.Function.bind(this.onBeforeStart,this),onStart:Ext.Function.bind(this.onStart,this),onDrag:Ext.Function.bind(this.onDrag,this),onEnd:Ext.Function.bind(this.onEnd,this),tolerance:3,autoStart:300,el:el});},onHeaderCtMouseMove:function(e,t){var me=this,prevSiblings,headerEl,overHeader,resizeHeader,resizeHeaderOwnerGrid,ownerGrid;if(me.headerCt.dragging){if(me.activeHd){me.activeHd.el.dom.style.cursor='';delete me.activeHd;}}else{headerEl=e.getTarget('.'+me.colHeaderCls,3,true);if(headerEl){overHeader=Ext.getCmp(headerEl.id);if(overHeader.isOnLeftEdge(e)){resizeHeader=overHeader.previousNode('gridcolumn:not([hidden]):not([isGroupHeader])')
if(resizeHeader){ownerGrid=me.headerCt.up('tablepanel');resizeHeaderOwnerGrid=resizeHeader.up('tablepanel');if(!((resizeHeaderOwnerGrid===ownerGrid)||((ownerGrid.ownerCt.isXType('tablepanel'))&&ownerGrid.ownerCt.view.lockedGrid===resizeHeaderOwnerGrid))){resizeHeader=null;}}}
else if(overHeader.isOnRightEdge(e)){resizeHeader=overHeader;}
else{resizeHeader=null;}
if(resizeHeader){if(resizeHeader.isGroupHeader){prevSiblings=resizeHeader.getGridColumns();resizeHeader=prevSiblings[prevSiblings.length-1];}
if(resizeHeader&&!(resizeHeader.fixed||(resizeHeader.resizable===false)||me.disabled)){me.activeHd=resizeHeader;overHeader.el.dom.style.cursor=me.eResizeCursor;if(overHeader.triggerEl){overHeader.triggerEl.dom.style.cursor=me.eResizeCursor;}}}else{overHeader.el.dom.style.cursor='';if(overHeader.triggerEl){overHeader.triggerEl.dom.style.cursor='';}
me.activeHd=null;}}}},onBeforeStart:function(e){this.dragHd=this.activeHd;if(!!this.dragHd&&!this.headerCt.dragging){this.tracker.constrainTo=this.getConstrainRegion();return true;}else{this.headerCt.dragging=false;return false;}},getConstrainRegion:function(){var me=this,dragHdEl=me.dragHd.el,rightAdjust=0,nextHd,lockedGrid;if(me.headerCt.forceFit){nextHd=me.dragHd.nextNode('gridcolumn:not([hidden]):not([isGroupHeader])');if(nextHd){if(!me.headerInSameGrid(nextHd)){nextHd=null;}
rightAdjust=nextHd.getWidth()-me.minColWidth;}}
else if((lockedGrid=me.dragHd.up('tablepanel')).isLocked){rightAdjust=me.dragHd.up('[scrollerOwner]').getWidth()-lockedGrid.getWidth()-30;}
else{rightAdjust=me.maxColWidth-dragHdEl.getWidth();}
return me.adjustConstrainRegion(dragHdEl.getRegion(),0,rightAdjust,0,me.minColWidth);},onStart:function(e){var me=this,dragHd=me.dragHd,width=dragHd.el.getWidth(),headerCt=dragHd.getOwnerHeaderCt(),x,y,gridSection,markerOwner,lhsMarker,rhsMarker,markerHeight;me.headerCt.dragging=true;me.origWidth=width;if(!me.dynamic){gridSection=markerOwner=headerCt.up('tablepanel');if(gridSection.ownerLockable){markerOwner=gridSection.ownerLockable;}
x=me.getLeftMarkerX(markerOwner);lhsMarker=markerOwner.getLhsMarker();rhsMarker=markerOwner.getRhsMarker();markerHeight=gridSection.body.getHeight()+headerCt.getHeight();y=headerCt.getOffsetsTo(markerOwner)[1];lhsMarker.setLocalY(y);rhsMarker.setLocalY(y);lhsMarker.setHeight(markerHeight);rhsMarker.setHeight(markerHeight);me.setMarkerX(lhsMarker,x);me.setMarkerX(rhsMarker,x+width);}},onDrag:function(e){var me=this,markerOwner;if(me.dynamic){me.doResize();}else{markerOwner=this.headerCt.up('tablepanel');if(markerOwner.ownerLockable){markerOwner=markerOwner.ownerLockable;}
this.setMarkerX(this.getMovingMarker(markerOwner),this.calculateDragX(markerOwner));}},getMovingMarker:function(markerOwner){return markerOwner.getRhsMarker();},onEnd:function(e){this.headerCt.dragging=false;if(this.dragHd){if(!this.dynamic){var markerOwner=this.headerCt.up('tablepanel');if(markerOwner.ownerLockable){markerOwner=markerOwner.ownerLockable;}
this.setMarkerX(markerOwner.getLhsMarker(),-9999);this.setMarkerX(markerOwner.getRhsMarker(),-9999);}
this.doResize();}},doResize:function(){var me=this,dragHd=me.dragHd,nextHd,offset;if(dragHd){offset=me.tracker.getOffset('point');if(dragHd.flex){delete dragHd.flex;}
Ext.suspendLayouts();me.adjustColumnWidth(offset[0]);if(me.headerCt.forceFit){nextHd=dragHd.nextNode('gridcolumn:not([hidden]):not([isGroupHeader])');if(nextHd&&!me.headerInSameGrid(nextHd)){nextHd=null;}
if(nextHd){delete nextHd.flex;nextHd.setWidth(nextHd.getWidth()-offset[0]);}}
Ext.resumeLayouts(true);}},headerInSameGrid:function(header){var grid=this.dragHd.up('tablepanel');return!!header.up(grid);},disable:function(){this.disabled=true;if(this.tracker){this.tracker.disable();}},enable:function(){this.disabled=false;if(this.tracker){this.tracker.enable();}},calculateDragX:function(markerOwner){return this.tracker.getXY('point')[0]-markerOwner.getX()-markerOwner.el.getBorderWidth('l');},getLeftMarkerX:function(markerOwner){return this.dragHd.getX()-markerOwner.getX()-markerOwner.el.getBorderWidth('l')-1;},setMarkerX:function(marker,x){marker.setLocalX(x);},adjustConstrainRegion:function(region,t,r,b,l){return region.adjust(t,r,b,l);},adjustColumnWidth:function(offsetX){this.dragHd.setWidth(this.origWidth+offsetX);}});Ext.define('Ext.resizer.SplitterTracker',{extend:'Ext.dd.DragTracker',requires:['Ext.util.Region'],enabled:true,overlayCls:Ext.baseCSSPrefix+'resizable-overlay',createDragOverlay:function(){var overlay;overlay=this.overlay=Ext.getBody().createChild({cls:this.overlayCls,html:'&#160;'});overlay.unselectable();overlay.setSize(Ext.Element.getViewWidth(true),Ext.Element.getViewHeight(true));overlay.show();},getPrevCmp:function(){var splitter=this.getSplitter();return splitter.previousSibling(':not([hidden])');},getNextCmp:function(){var splitter=this.getSplitter();return splitter.nextSibling(':not([hidden])');},onBeforeStart:function(e){var me=this,prevCmp=me.getPrevCmp(),nextCmp=me.getNextCmp(),collapseEl=me.getSplitter().collapseEl,target=e.getTarget(),box;if(!prevCmp||!nextCmp){return false;}
if(collapseEl&&target===me.getSplitter().collapseEl.dom){return false;}
if(nextCmp.collapsed||prevCmp.collapsed){return false;}
me.prevBox=prevCmp.getEl().getBox();me.nextBox=nextCmp.getEl().getBox();me.constrainTo=box=me.calculateConstrainRegion();if(!box){return false;}
return box;},onStart:function(e){var splitter=this.getSplitter();this.createDragOverlay();splitter.addCls(splitter.baseCls+'-active');},calculateConstrainRegion:function(){var me=this,splitter=me.getSplitter(),splitWidth=splitter.getWidth(),defaultMin=splitter.defaultSplitMin,orient=splitter.orientation,prevBox=me.prevBox,prevCmp=me.getPrevCmp(),nextBox=me.nextBox,nextCmp=me.getNextCmp(),prevConstrainRegion,nextConstrainRegion,constrainOptions;if(orient==='vertical'){constrainOptions={prevCmp:prevCmp,nextCmp:nextCmp,prevBox:prevBox,nextBox:nextBox,defaultMin:defaultMin,splitWidth:splitWidth};prevConstrainRegion=new Ext.util.Region(prevBox.y,me.getVertPrevConstrainRight(constrainOptions),prevBox.bottom,me.getVertPrevConstrainLeft(constrainOptions));nextConstrainRegion=new Ext.util.Region(nextBox.y,me.getVertNextConstrainRight(constrainOptions),nextBox.bottom,me.getVertNextConstrainLeft(constrainOptions));}else{prevConstrainRegion=new Ext.util.Region(prevBox.y+(prevCmp.minHeight||defaultMin),prevBox.right,(prevCmp.maxHeight?prevBox.y+prevCmp.maxHeight:nextBox.bottom-(nextCmp.minHeight||defaultMin))+splitWidth,prevBox.x);nextConstrainRegion=new Ext.util.Region((nextCmp.maxHeight?nextBox.bottom-nextCmp.maxHeight:prevBox.y+(prevCmp.minHeight||defaultMin))-splitWidth,nextBox.right,nextBox.bottom-(nextCmp.minHeight||defaultMin),nextBox.x);}
return prevConstrainRegion.intersect(nextConstrainRegion);},performResize:function(e,offset){var me=this,splitter=me.getSplitter(),orient=splitter.orientation,prevCmp=me.getPrevCmp(),nextCmp=me.getNextCmp(),owner=splitter.ownerCt,flexedSiblings=owner.query('>[flex]'),len=flexedSiblings.length,vertical=orient==='vertical',i=0,dimension=vertical?'width':'height',totalFlex=0,item,size;for(;i<len;i++){item=flexedSiblings[i];size=vertical?item.getWidth():item.getHeight();totalFlex+=size;item.flex=size;}
offset=vertical?offset[0]:offset[1];if(prevCmp){size=me.prevBox[dimension]+offset;if(prevCmp.flex){prevCmp.flex=size;}else{prevCmp[dimension]=size;}}
if(nextCmp){size=me.nextBox[dimension]-offset;if(nextCmp.flex){nextCmp.flex=size;}else{nextCmp[dimension]=size;}}
owner.updateLayout();},endDrag:function(){var me=this;if(me.overlay){me.overlay.remove();delete me.overlay;}
me.callParent(arguments);},onEnd:function(e){var me=this,splitter=me.getSplitter();splitter.removeCls(splitter.baseCls+'-active');me.performResize(e,me.getResizeOffset());},onDrag:function(e){var me=this,offset=me.getOffset('dragTarget'),splitter=me.getSplitter(),splitEl=splitter.getEl(),orient=splitter.orientation;if(orient==="vertical"){splitEl.setX(me.startRegion.left+offset[0]);}else{splitEl.setY(me.startRegion.top+offset[1]);}},getSplitter:function(){return this.splitter;},getVertPrevConstrainRight:function(o){return(o.prevCmp.maxWidth?o.prevBox.x+o.prevCmp.maxWidth:o.nextBox.right-(o.nextCmp.minWidth||o.defaultMin))+o.splitWidth;},getVertPrevConstrainLeft:function(o){return o.prevBox.x+(o.prevCmp.minWidth||o.defaultMin);},getVertNextConstrainRight:function(o){return o.nextBox.right-(o.nextCmp.minWidth||o.defaultMin);},getVertNextConstrainLeft:function(o){return(o.nextCmp.maxWidth?o.nextBox.right-o.nextCmp.maxWidth:o.prevBox.x+(o.prevBox.minWidth||o.defaultMin))-o.splitWidth;},getResizeOffset:function(){return this.getOffset('dragTarget');}});Ext.define('Ext.fx.target.CompositeElement',{extend:'Ext.fx.target.Element',isComposite:true,constructor:function(target){target.id=target.id||Ext.id(null,'ext-composite-');this.callParent([target]);},getAttr:function(attr,val){var out=[],target=this.target,elements=target.elements,length=elements.length,i,el;for(i=0;i<length;i++){el=elements[i];if(el){el=target.getElement(el);out.push([el,this.getElVal(el,attr,val)]);}}
return out;},setAttr:function(targetData){var target=this.target,ln=targetData.length,elements=target.elements,ln3=elements.length,value,k,attrs,attr,o,i,j,ln2;for(i=0;i<ln;i++){attrs=targetData[i].attrs;for(attr in attrs){if(attrs.hasOwnProperty(attr)){ln2=attrs[attr].length;for(j=0;j<ln2;j++){value=attrs[attr][j][1];for(k=0;k<ln3;++k){el=elements[k];if(el){el=target.getElement(el);this.setElVal(el,attr,value);}}}}}}}});Ext.define('Ext.util.MixedCollection',{extend:'Ext.util.AbstractMixedCollection',mixins:{sortable:'Ext.util.Sortable'},constructor:function(){var me=this;me.callParent(arguments);me.addEvents('sort');me.mixins.sortable.initSortable.call(me);},doSort:function(sorterFn){this.sortBy(sorterFn);},_sort:function(property,dir,fn){var me=this,i,len,dsc=String(dir).toUpperCase()=='DESC'?-1:1,c=[],keys=me.keys,items=me.items,o;fn=fn||function(a,b){return a-b;};for(i=0,len=items.length;i<len;i++){c[c.length]={key:keys[i],value:items[i],index:i};}
Ext.Array.sort(c,function(a,b){return fn(a[property],b[property])*dsc||(a.index<b.index?-1:1);});for(i=0,len=c.length;i<len;i++){o=c[i];items[i]=o.value;keys[i]=o.key;me.indexMap[o.key]=i;}
me.generation++;me.indexGeneration=me.generation;me.fireEvent('sort',me);},sortBy:function(sorterFn){var me=this,items=me.items,item,keys=me.keys,key,length=items.length,i;for(i=0;i<length;i++){items[i].$extCollectionIndex=i;}
Ext.Array.sort(items,function(a,b){return sorterFn(a,b)||(a.$extCollectionIndex<b.$extCollectionIndex?-1:1);});for(i=0;i<length;i++){item=items[i];key=me.getKey(item);keys[i]=key;me.indexMap[key]=i;delete items.$extCollectionIndex;}
me.generation++;me.indexGeneration=me.generation;me.fireEvent('sort',me,items,keys);},findInsertionIndex:function(newItem,sorterFn){var me=this,items=me.items,start=0,end=items.length-1,middle,comparison;if(!sorterFn){sorterFn=me.generateComparator();}
while(start<=end){middle=(start+end)>>1;comparison=sorterFn(newItem,items[middle]);if(comparison>=0){start=middle+1;}else if(comparison<0){end=middle-1;}}
return start;},reorder:function(mapping){var me=this,items=me.items,index=0,length=items.length,order=[],remaining=[],oldIndex;me.suspendEvents();for(oldIndex in mapping){order[mapping[oldIndex]]=items[oldIndex];}
for(index=0;index<length;index++){if(mapping[index]==undefined){remaining.push(items[index]);}}
for(index=0;index<length;index++){if(order[index]==undefined){order[index]=remaining.shift();}}
me.clear();me.addAll(order);me.resumeEvents();me.fireEvent('sort',me);},sortByKey:function(dir,fn){this._sort('key',dir,fn||function(a,b){var v1=String(a).toUpperCase(),v2=String(b).toUpperCase();return v1>v2?1:(v1<v2?-1:0);});}});Ext.define('Ext.layout.container.Container',{alias:['layout.container'],extend:'Ext.layout.Layout',alternateClassName:'Ext.layout.ContainerLayout',mixins:{elementCt:'Ext.util.ElementContainer'},requires:['Ext.XTemplate'],type:'container',beginCollapse:Ext.emptyFn,beginExpand:Ext.emptyFn,animatePolicy:null,childEls:['overflowPadderEl'],renderTpl:['{%this.renderBody(out,values)%}'],usesContainerHeight:true,usesContainerWidth:true,usesHeight:true,usesWidth:true,constructor:function(){this.callParent(arguments);this.mixins.elementCt.constructor.call(this);},destroy:function(){this.callParent();this.mixins.elementCt.destroy.call(this);},beginLayout:function(ownerContext){this.callParent(arguments);ownerContext.targetContext=ownerContext.paddingContext=ownerContext.getEl('getTarget',this);this.cacheChildItems(ownerContext);},beginLayoutCycle:function(ownerContext,firstCycle){var me=this;me.callParent(arguments);if(firstCycle){if(me.usesContainerHeight){++ownerContext.consumersContainerHeight;}
if(me.usesContainerWidth){++ownerContext.consumersContainerWidth;}}},cacheChildItems:function(ownerContext){var context=ownerContext.context,childItems=[],items=this.getVisibleItems(),length=items.length,i;ownerContext.childItems=childItems;ownerContext.visibleItems=items;for(i=0;i<length;++i){childItems.push(context.getCmp(items[i]));}},cacheElements:function(){var owner=this.owner;this.applyChildEls(owner.el,owner.id);},configureItem:function(item){var me=this,itemCls=me.itemCls,ownerItemCls=me.owner.itemCls,addClasses;item.ownerLayout=me;if(itemCls){addClasses=typeof itemCls==='string'?[itemCls]:itemCls;}
if(ownerItemCls){addClasses=Ext.Array.push(addClasses||[],ownerItemCls);}
if(addClasses){item.addCls(addClasses);}},doRenderBody:function(out,renderData){this.renderItems(out,renderData);this.renderContent(out,renderData);},doRenderContainer:function(out,renderData){var me=renderData.$comp.layout,tpl=me.getRenderTpl(),data=me.getRenderData();tpl.applyOut(data,out);},doRenderItems:function(out,renderData){var me=renderData.$layout,tree=me.getRenderTree();if(tree){Ext.DomHelper.generateMarkup(tree,out);}},finishRender:function(){var me=this,target,items;me.callParent();me.cacheElements();target=me.getRenderTarget();items=me.getLayoutItems();me.finishRenderItems(target,items);},notifyOwner:function(){this.owner.afterLayout(this);},getContainerSize:function(ownerContext,inDom){var targetContext=ownerContext.targetContext,frameInfo=targetContext.getFrameInfo(),padding=ownerContext.paddingContext.getPaddingInfo(),got=0,needed=0,gotWidth,gotHeight,width,height;if(!ownerContext.widthModel.shrinkWrap){++needed;width=inDom?targetContext.getDomProp('width'):targetContext.getProp('width');gotWidth=(typeof width=='number');if(gotWidth){++got;width-=frameInfo.width+padding.width;if(width<0){width=0;}}}
if(!ownerContext.heightModel.shrinkWrap){++needed;height=inDom?targetContext.getDomProp('height'):targetContext.getProp('height');gotHeight=(typeof height=='number');if(gotHeight){++got;height-=frameInfo.height+padding.height;if(height<0){height=0;}}}
return{width:width,height:height,needed:needed,got:got,gotAll:got==needed,gotWidth:gotWidth,gotHeight:gotHeight};},getPositionOffset:function(position){if(!this.createsInnerCt){var offset=this.owner.itemNodeOffset;if(offset){position+=offset;}}
return position;},getLayoutItems:function(){var owner=this.owner,items=owner&&owner.items;return(items&&items.items)||[];},getRenderData:function(){var comp=this.owner;return{$comp:comp,$layout:this,ownerId:comp.id};},getRenderedItems:function(){var me=this,target=me.getRenderTarget(),items=me.getLayoutItems(),ln=items.length,renderedItems=[],i,item;for(i=0;i<ln;i++){item=items[i];if(item.rendered&&me.isValidParent(item,target,i)){renderedItems.push(item);}}
return renderedItems;},getRenderTarget:function(){return this.owner.getTargetEl();},getElementTarget:function(){return this.getRenderTarget();},getRenderTpl:function(){var me=this,renderTpl=Ext.XTemplate.getTpl(this,'renderTpl');if(!renderTpl.renderContent){me.owner.setupRenderTpl(renderTpl);}
return renderTpl;},getRenderTree:function(){var result,items=this.owner.items,itemsGen,renderCfgs={};do{itemsGen=items.generation;result=this.getItemsRenderTree(this.getLayoutItems(),renderCfgs);}while(items.generation!==itemsGen);return result;},renderChildren:function(){var me=this,ownerItems=me.owner.items,target=me.getRenderTarget(),itemsGen,items;do{itemsGen=ownerItems.generation;items=me.getLayoutItems();me.renderItems(items,target);}while(ownerItems.generation!==itemsGen);},getScrollbarsNeeded:function(width,height,contentWidth,contentHeight){var scrollbarSize=Ext.getScrollbarSize(),hasWidth=typeof width=='number',hasHeight=typeof height=='number',needHorz=0,needVert=0;if(!scrollbarSize.width){return 0;}
if(hasHeight&&height<contentHeight){needVert=2;width-=scrollbarSize.width;}
if(hasWidth&&width<contentWidth){needHorz=1;if(!needVert&&hasHeight){height-=scrollbarSize.height;if(height<contentHeight){needVert=2;}}}
return needVert+needHorz;},getTarget:function(){return this.owner.getTargetEl();},getVisibleItems:function(){var target=this.getRenderTarget(),items=this.getLayoutItems(),ln=items.length,visibleItems=[],i,item;for(i=0;i<ln;i++){item=items[i];if(item.rendered&&this.isValidParent(item,target,i)&&item.hidden!==true){visibleItems.push(item);}}
return visibleItems;},setupRenderTpl:function(renderTpl){var me=this;renderTpl.renderBody=me.doRenderBody;renderTpl.renderContainer=me.doRenderContainer;renderTpl.renderItems=me.doRenderItems;},getContentTarget:function(){return this.owner.getDefaultContentTarget();}});Ext.define('Ext.form.action.Load',{extend:'Ext.form.action.Action',requires:['Ext.data.Connection'],alternateClassName:'Ext.form.Action.Load',alias:'formaction.load',type:'load',run:function(){Ext.Ajax.request(Ext.apply(this.createCallback(),{method:this.getMethod(),url:this.getUrl(),headers:this.headers,params:this.getParams()}));},onSuccess:function(response){var result=this.processResponse(response),form=this.form;if(result===true||!result.success||!result.data){this.failureType=Ext.form.action.Action.LOAD_FAILURE;form.afterAction(this,false);return;}
form.clearInvalid();form.setValues(result.data);form.afterAction(this,true);},handleResponse:function(response){var reader=this.form.reader,rs,data;if(reader){rs=reader.read(response);data=rs.records&&rs.records[0]?rs.records[0].data:null;return{success:rs.success,data:data};}
return Ext.decode(response.responseText);}});Ext.define('Ext.fx.target.CompositeSprite',{extend:'Ext.fx.target.Sprite',getAttr:function(attr,val){var out=[],sprites=[].concat(this.target.items),length=sprites.length,i,sprite;for(i=0;i<length;i++){sprite=sprites[i];out.push([sprite,val!=undefined?val:this.getFromPrim(sprite,attr)]);}
return out;}});Ext.define('Ext.state.Stateful',{mixins:{observable:'Ext.util.Observable'},requires:['Ext.state.Manager'],stateful:false,saveDelay:100,constructor:function(config){var me=this;config=config||{};if(config.stateful!==undefined){me.stateful=config.stateful;}
if(config.saveDelay!==undefined){me.saveDelay=config.saveDelay;}
me.stateId=me.stateId||config.stateId;if(!me.stateEvents){me.stateEvents=[];}
if(config.stateEvents){me.stateEvents.concat(config.stateEvents);}
this.addEvents('beforestaterestore','staterestore','beforestatesave','statesave');me.mixins.observable.constructor.call(me);if(me.stateful!==false){me.addStateEvents(me.stateEvents);me.initState();}},addStateEvents:function(events){var me=this,i,event,stateEventsByName;if(me.stateful&&me.getStateId()){if(typeof events=='string'){events=Array.prototype.slice.call(arguments,0);}
stateEventsByName=me.stateEventsByName||(me.stateEventsByName={});for(i=events.length;i--;){event=events[i];if(!stateEventsByName[event]){stateEventsByName[event]=1;me.on(event,me.onStateChange,me);}}}},onStateChange:function(){var me=this,delay=me.saveDelay,statics,runner;if(!me.stateful){return;}
if(delay){if(!me.stateTask){statics=Ext.state.Stateful;runner=statics.runner||(statics.runner=new Ext.util.TaskRunner());me.stateTask=runner.newTask({run:me.saveState,scope:me,interval:delay,repeat:1});}
me.stateTask.start();}else{me.saveState();}},saveState:function(){var me=this,id=me.stateful&&me.getStateId(),hasListeners=me.hasListeners,state;if(id){state=me.getState()||{};if(!hasListeners.beforestatesave||me.fireEvent('beforestatesave',me,state)!==false){Ext.state.Manager.set(id,state);if(hasListeners.statesave){me.fireEvent('statesave',me,state);}}}},getState:function(){return null;},applyState:function(state){if(state){Ext.apply(this,state);}},getStateId:function(){var me=this;return me.stateId||(me.autoGenId?null:me.id);},initState:function(){var me=this,id=me.stateful&&me.getStateId(),hasListeners=me.hasListeners,state;if(id){state=Ext.state.Manager.get(id);if(state){state=Ext.apply({},state);if(!hasListeners.beforestaterestore||me.fireEvent('beforestaterestore',me,state)!==false){me.applyState(state);if(hasListeners.staterestore){me.fireEvent('staterestore',me,state);}}}}},savePropToState:function(propName,state,stateName){var me=this,value=me[propName],config=me.initialConfig;if(me.hasOwnProperty(propName)){if(!config||config[propName]!==value){if(state){state[stateName||propName]=value;}
return true;}}
return false;},savePropsToState:function(propNames,state){var me=this,i,n;if(typeof propNames=='string'){me.savePropToState(propNames,state);}else{for(i=0,n=propNames.length;i<n;++i){me.savePropToState(propNames[i],state);}}
return state;},destroy:function(){var me=this,task=me.stateTask;if(task){task.destroy();me.stateTask=null;}
me.clearListeners();}});Ext.define('MP.action.SaveAndResetOnToolbar',{extend:'MP.action.Plugin',uses:['MP.action.SaveAndReset'],attachActions:function(){var me=this,tbar;var sandr=MP.action.SaveAndReset;me.callParent();tbar=me.component.child('#ttoolbar');if(tbar){var saction=me.component.findActionById(sandr.SAVE_ACTION);var raction=me.component.findActionById(sandr.RESTORE_ACTION);tbar.add('->');tbar.add(saction);tbar.add(raction);}}});Ext.define('Ext.ModelManager',{extend:'Ext.AbstractManager',alternateClassName:'Ext.ModelMgr',requires:['Ext.data.association.Association'],singleton:true,typeName:'mtype',associationStack:[],registerType:function(name,config){var proto=config.prototype,model;if(proto&&proto.isModel){model=config;}else{if(!config.extend){config.extend='Ext.data.Model';}
model=Ext.define(name,config);}
this.types[name]=model;return model;},unregisterType:function(name){delete this.types[name];},onModelDefined:function(model){var stack=this.associationStack,length=stack.length,create=[],association,i,created;for(i=0;i<length;i++){association=stack[i];if(association.associatedModel==model.modelName){create.push(association);}}
for(i=0,length=create.length;i<length;i++){created=create[i];this.types[created.ownerModel].prototype.associations.add(Ext.data.association.Association.create(created));Ext.Array.remove(stack,created);}},registerDeferredAssociation:function(association){this.associationStack.push(association);},getModel:function(id){var model=id;if(typeof model=='string'){model=this.types[model];}
return model;},create:function(config,name,id){var Con=typeof name=='function'?name:this.types[name||config.name];return new Con(config,id);}},function(){Ext.regModel=function(){return this.ModelManager.registerType.apply(this.ModelManager,arguments);};});Ext.define('MP.action.StoreAware',{extend:'MP.action.Plugin',init:function(component){var me=this;if(!me.shouldDisableAction){if(component.shouldDisableAction){me.shouldDisableAction=component.shouldDisableAction.bind(component);}else{var store=component.store;if(store&&store.storeId!='ext-empty-store'){if(store.shouldDisableAction){me.shouldDisableAction=store.shouldDisableAction.bind(store);}}else{me.component.on('reconfigure',function(g,s){if(s.shouldDisableAction){me.shouldDisableAction=s.shouldDisableAction.bind(s);}});}}}
me.callParent(arguments);},attachActions:function(){var me=this;var ua=function(){Ext.each(me.getActions(),me.updateAction,me);};me.callParent();var store=me.component.store;if(store&&store.storeId!='ext-empty-store'){store.on({scope:me,update:ua,load:ua,reject:ua,add:ua,datachanged:ua});}else{me.component.on('reconfigure',function(g,s){s.on({scope:me,update:ua,load:ua,reject:ua,add:ua,datachanged:ua});});}
if(me.component.getSelectionModel){var sm=me.component.getSelectionModel();sm.on('selectionchange',ua,me);}}});Ext.define('Ext.data.PageMap',{extend:'Ext.util.LruCache',clear:function(initial){var me=this;me.pageMapGeneration=(me.pageMapGeneration||0)+1;me.callParent(arguments);},forEach:function(fn,scope){var me=this,pageNumbers=Ext.Object.getKeys(me.map),pageCount=pageNumbers.length,i,j,pageNumber,page,pageSize;for(i=0;i<pageCount;i++){pageNumbers[i]=Number(pageNumbers[i]);}
Ext.Array.sort(pageNumbers);scope=scope||me;for(i=0;i<pageCount;i++){pageNumber=pageNumbers[i];page=me.getPage(pageNumber);pageSize=page.length;for(j=0;j<pageSize;j++){if(fn.call(scope,page[j],(pageNumber-1)*me.pageSize+j)===false){return;}}}},findBy:function(fn,scope){var me=this,result=null;scope=scope||me;me.forEach(function(rec,index){if(fn.call(scope,rec,index)){result=rec;return false;}});return result;},findIndexBy:function(fn,scope){var me=this,result=-1;scope=scope||me;me.forEach(function(rec,index){if(fn.call(scope,rec)){result=index;return false;}});return result;},getPageFromRecordIndex:function(){return Ext.data.Store.prototype.getPageFromRecordIndex.apply(this,arguments);},addAll:function(records){this.addPage(1,records);},addPage:function(pageNumber,records){var me=this,lastPage=pageNumber+Math.floor((records.length-1)/me.pageSize),startIdx,page;for(startIdx=0;pageNumber<=lastPage;pageNumber++,startIdx+=me.pageSize){page=Ext.Array.slice(records,startIdx,startIdx+me.pageSize);me.add(pageNumber,page);me.fireEvent('pageAdded',pageNumber,page);}},getCount:function(){var result=this.callParent();if(result){result=(result-1)*this.pageSize+this.last.value.length;}
return result;},indexOf:function(record){return record?record.index:-1;},insert:function(){},remove:function(){},removeAt:function(){},getPage:function(pageNumber){return this.get(pageNumber);},hasRange:function(start,end){var pageNumber=this.getPageFromRecordIndex(start),endPageNumber=this.getPageFromRecordIndex(end);for(;pageNumber<=endPageNumber;pageNumber++){if(!this.hasPage(pageNumber)){return false;}}
return true;},hasPage:function(pageNumber){return!!this.get(pageNumber);},getAt:function(index){return this.getRange(index,index)[0];},getRange:function(start,end){if(!this.hasRange(start,end)){Ext.Error.raise('PageMap asked for range which it does not have');}
var me=this,startPageNumber=me.getPageFromRecordIndex(start),endPageNumber=me.getPageFromRecordIndex(end),dataStart=(startPageNumber-1)*me.pageSize,dataEnd=(endPageNumber*me.pageSize)-1,pageNumber=startPageNumber,result=[],sliceBegin,sliceEnd,doSlice,i=0,len;for(;pageNumber<=endPageNumber;pageNumber++){if(pageNumber==startPageNumber){sliceBegin=start-dataStart;doSlice=true;}else{sliceBegin=0;doSlice=false;}
if(pageNumber==endPageNumber){sliceEnd=me.pageSize-(dataEnd-end);doSlice=true;}
if(doSlice){Ext.Array.push(result,Ext.Array.slice(me.getPage(pageNumber),sliceBegin,sliceEnd));}else{Ext.Array.push(result,me.getPage(pageNumber));}}
for(len=result.length;i<len;i++){result[i].index=start++;}
return result;}});Ext.define('MP.action.AddAndDeleteOnToolbar',{extend:'MP.action.Plugin',uses:['MP.action.AddAndDelete'],attachActions:function(){var me=this,tbar;var addndel=MP.action.AddAndDelete;me.callParent();tbar=me.component.child('#ttoolbar');if(tbar){var anaction=me.component.findActionById(addndel.ADD_ACTION);var draction=me.component.findActionById(addndel.DELETE_ACTION);tbar.add(0,anaction);tbar.add(1,draction);}}});Ext.define('Ext.fx.PropertyHandler',{requires:['Ext.draw.Draw'],statics:{defaultHandler:{pixelDefaultsRE:/width|height|top$|bottom$|left$|right$/i,unitRE:/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/,scrollRE:/^scroll/i,computeDelta:function(from,end,damper,initial,attr){damper=(typeof damper=='number')?damper:1;var unitRE=this.unitRE,match=unitRE.exec(from),start,units;if(match){from=match[1];units=match[2];if(!this.scrollRE.test(attr)&&!units&&this.pixelDefaultsRE.test(attr)){units='px';}}
from=+from||0;match=unitRE.exec(end);if(match){end=match[1];units=match[2]||units;}
end=+end||0;start=(initial!=null)?initial:from;return{from:from,delta:(end-start)*damper,units:units};},get:function(from,end,damper,initialFrom,attr){var ln=from.length,out=[],i,initial,res,j,len;for(i=0;i<ln;i++){if(initialFrom){initial=initialFrom[i][1].from;}
if(Ext.isArray(from[i][1])&&Ext.isArray(end)){res=[];j=0;len=from[i][1].length;for(;j<len;j++){res.push(this.computeDelta(from[i][1][j],end[j],damper,initial,attr));}
out.push([from[i][0],res]);}
else{out.push([from[i][0],this.computeDelta(from[i][1],end,damper,initial,attr)]);}}
return out;},set:function(values,easing){var ln=values.length,out=[],i,val,res,len,j;for(i=0;i<ln;i++){val=values[i][1];if(Ext.isArray(val)){res=[];j=0;len=val.length;for(;j<len;j++){res.push(val[j].from+val[j].delta*easing+(val[j].units||0));}
out.push([values[i][0],res]);}else{out.push([values[i][0],val.from+val.delta*easing+(val.units||0)]);}}
return out;}},stringHandler:{computeDelta:function(from,end,damper,initial,attr){return{from:from,delta:end};},get:function(from,end,damper,initialFrom,attr){var ln=from.length,out=[],i,initial,res,j,len;for(i=0;i<ln;i++){out.push([from[i][0],this.computeDelta(from[i][1],end,damper,initial,attr)]);}
return out;},set:function(values,easing){var ln=values.length,out=[],i,val,res,len,j;for(i=0;i<ln;i++){val=values[i][1];out.push([values[i][0],val.delta]);}
return out;}},color:{rgbRE:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,hexRE:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,hex3RE:/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i,parseColor:function(color,damper){damper=(typeof damper=='number')?damper:1;var out=false,reList=[this.hexRE,this.rgbRE,this.hex3RE],length=reList.length,match,base,re,i;for(i=0;i<length;i++){re=reList[i];base=(i%2===0)?16:10;match=re.exec(color);if(match&&match.length===4){if(i===2){match[1]+=match[1];match[2]+=match[2];match[3]+=match[3];}
out={red:parseInt(match[1],base),green:parseInt(match[2],base),blue:parseInt(match[3],base)};break;}}
return out||color;},computeDelta:function(from,end,damper,initial){from=this.parseColor(from);end=this.parseColor(end,damper);var start=initial?initial:from,tfrom=typeof start,tend=typeof end;if(tfrom=='string'||tfrom=='undefined'||tend=='string'||tend=='undefined'){return end||start;}
return{from:from,delta:{red:Math.round((end.red-start.red)*damper),green:Math.round((end.green-start.green)*damper),blue:Math.round((end.blue-start.blue)*damper)}};},get:function(start,end,damper,initialFrom){var ln=start.length,out=[],i,initial;for(i=0;i<ln;i++){if(initialFrom){initial=initialFrom[i][1].from;}
out.push([start[i][0],this.computeDelta(start[i][1],end,damper,initial)]);}
return out;},set:function(values,easing){var ln=values.length,out=[],i,val,parsedString,from,delta;for(i=0;i<ln;i++){val=values[i][1];if(val){from=val.from;delta=val.delta;val=(typeof val=='object'&&'red'in val)?'rgb('+val.red+', '+val.green+', '+val.blue+')':val;val=(typeof val=='object'&&val.length)?val[0]:val;if(typeof val=='undefined'){return[];}
parsedString=typeof val=='string'?val:'rgb('+[(from.red+Math.round(delta.red*easing))%256,(from.green+Math.round(delta.green*easing))%256,(from.blue+Math.round(delta.blue*easing))%256].join(',')+')';out.push([values[i][0],parsedString]);}}
return out;}},object:{interpolate:function(prop,damper){damper=(typeof damper=='number')?damper:1;var out={},p;for(p in prop){out[p]=parseFloat(prop[p])*damper;}
return out;},computeDelta:function(from,end,damper,initial){from=this.interpolate(from);end=this.interpolate(end,damper);var start=initial?initial:from,delta={},p;for(p in end){delta[p]=end[p]-start[p];}
return{from:from,delta:delta};},get:function(start,end,damper,initialFrom){var ln=start.length,out=[],i,initial;for(i=0;i<ln;i++){if(initialFrom){initial=initialFrom[i][1].from;}
out.push([start[i][0],this.computeDelta(start[i][1],end,damper,initial)]);}
return out;},set:function(values,easing){var ln=values.length,out=[],outObject={},i,from,delta,val,p;for(i=0;i<ln;i++){val=values[i][1];from=val.from;delta=val.delta;for(p in from){outObject[p]=from[p]+delta[p]*easing;}
out.push([values[i][0],outObject]);}
return out;}},path:{computeDelta:function(from,end,damper,initial){damper=(typeof damper=='number')?damper:1;var start;from=+from||0;end=+end||0;start=(initial!=null)?initial:from;return{from:from,delta:(end-start)*damper};},forcePath:function(path){if(!Ext.isArray(path)&&!Ext.isArray(path[0])){path=Ext.draw.Draw.parsePathString(path);}
return path;},get:function(start,end,damper,initialFrom){var endPath=this.forcePath(end),out=[],startLn=start.length,startPathLn,pointsLn,i,deltaPath,initial,j,k,path,startPath;for(i=0;i<startLn;i++){startPath=this.forcePath(start[i][1]);deltaPath=Ext.draw.Draw.interpolatePaths(startPath,endPath);startPath=deltaPath[0];endPath=deltaPath[1];startPathLn=startPath.length;path=[];for(j=0;j<startPathLn;j++){deltaPath=[startPath[j][0]];pointsLn=startPath[j].length;for(k=1;k<pointsLn;k++){initial=initialFrom&&initialFrom[0][1][j][k].from;deltaPath.push(this.computeDelta(startPath[j][k],endPath[j][k],damper,initial));}
path.push(deltaPath);}
out.push([start[i][0],path]);}
return out;},set:function(values,easing){var ln=values.length,out=[],i,j,k,newPath,calcPath,deltaPath,deltaPathLn,pointsLn;for(i=0;i<ln;i++){deltaPath=values[i][1];newPath=[];deltaPathLn=deltaPath.length;for(j=0;j<deltaPathLn;j++){calcPath=[deltaPath[j][0]];pointsLn=deltaPath[j].length;for(k=1;k<pointsLn;k++){calcPath.push(deltaPath[j][k].from+deltaPath[j][k].delta*easing);}
newPath.push(calcPath.join(','));}
out.push([values[i][0],newPath.join(',')]);}
return out;}}}},function(){var props=['outlineColor','backgroundColor','borderColor','borderTopColor','borderRightColor','borderBottomColor','borderLeftColor','fill','stroke'],length=props.length,i=0,prop;for(;i<length;i++){prop=props[i];this[prop]=this.color;}
props=['cursor'];length=props.length;i=0;for(;i<length;i++){prop=props[i];this[prop]=this.stringHandler;}});Ext.define('Ext.ComponentManager',{extend:'Ext.AbstractManager',alternateClassName:'Ext.ComponentMgr',singleton:true,typeName:'xtype',create:function(component,defaultType){if(typeof component=='string'){return Ext.widget(component);}
if(component.isComponent){return component;}
return Ext.widget(component.xtype||defaultType,component);},registerType:function(type,cls){this.types[type]=cls;cls[this.typeName]=type;cls.prototype[this.typeName]=type;}},function(){Ext.getCmp=function(id){return Ext.ComponentManager.get(id);};});Ext.define('Ext.dd.DragDropManager',{singleton:true,requires:['Ext.util.Region'],uses:['Ext.tip.QuickTipManager'],alternateClassName:['Ext.dd.DragDropMgr','Ext.dd.DDM'],ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,mode:0,notifyOccluded:false,dragCls:Ext.baseCSSPrefix+'dd-drag-current',_execOnAll:function(sMethod,args){var i,j,oDD;for(i in this.ids){for(j in this.ids[i]){oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}
oDD[sMethod].apply(oDD,args);}}},_onLoad:function(){this.init();var Event=Ext.EventManager;Event.on(document,"mouseup",this.handleMouseUp,this,true);Event.on(document,"mousemove",this.handleMouseMove,this,true);Event.on(window,"unload",this._onUnload,this,true);Event.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,sGroup){if(!this.initialized){this.init();}
if(!this.ids[sGroup]){this.ids[sGroup]={};}
this.ids[sGroup][oDD.id]=oDD;},removeDDFromGroup:function(oDD,sGroup){if(!this.ids[sGroup]){this.ids[sGroup]={};}
var obj=this.ids[sGroup];if(obj&&obj[oDD.id]){delete obj[oDD.id];}},_remove:function(oDD){for(var g in oDD.groups){if(g&&this.ids[g]&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}}
delete this.handleIds[oDD.id];},regHandle:function(sDDId,sHandleId){if(!this.handleIds[sDDId]){this.handleIds[sDDId]={};}
this.handleIds[sDDId][sHandleId]=sHandleId;},isDragDrop:function(id){return(this.getDDById(id))?true:false;},getRelated:function(p_oDD,bTargetsOnly){var oDDs=[],i,j,dd;for(i in p_oDD.groups){for(j in this.ids[i]){dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}
if(!bTargetsOnly||dd.isTarget){oDDs[oDDs.length]=dd;}}}
return oDDs;},isLegalTarget:function(oDD,oTargetDD){var targets=this.getRelated(oDD,true),i,len;for(i=0,len=targets.length;i<len;++i){if(targets[i].id==oTargetDD.id){return true;}}
return false;},isTypeOfDD:function(oDD){return(oDD&&oDD.__ygDragDrop);},isHandle:function(sDDId,sHandleId){return(this.handleIds[sDDId]&&this.handleIds[sDDId][sHandleId]);},getDDById:function(id){var i,dd;for(i in this.ids){dd=this.ids[i][id];if(dd instanceof Ext.dd.DDTarget){return dd;}}
return null;},handleMouseDown:function(e,oDD){var me=this,el;if(Ext.quickTipsActive){Ext.tip.QuickTipManager.ddDisable();}
if(me.dragCurrent){me.handleMouseUp(e);}
me.currentTarget=e.getTarget();me.dragCurrent=oDD;el=oDD.getEl();if(Ext.isIE9m&&el.setCapture){el.setCapture();}
me.startX=e.getPageX();me.startY=e.getPageY();me.deltaX=me.startX-el.offsetLeft;me.deltaY=me.startY-el.offsetTop;me.dragThreshMet=false;me.clickTimeout=setTimeout(function(){me.startDrag(me.startX,me.startY);},me.clickTimeThresh);},startDrag:function(x,y){var me=this,current=me.dragCurrent,dragEl;clearTimeout(me.clickTimeout);if(current){current.b4StartDrag(x,y);current.startDrag(x,y);dragEl=current.getDragEl();if(dragEl){Ext.fly(dragEl).addCls(me.dragCls);}}
me.dragThreshMet=true;},handleMouseUp:function(e){var me=this;if(Ext.quickTipsActive){Ext.tip.QuickTipManager.ddEnable();}
if(!me.dragCurrent){return;}
if(Ext.isIE&&document.releaseCapture){document.releaseCapture();}
clearTimeout(me.clickTimeout);if(me.dragThreshMet){me.fireEvents(e,true);}
me.stopDrag(e);me.stopEvent(e);},stopEvent:function(e){if(this.stopPropagation){e.stopPropagation();}
if(this.preventDefault){e.preventDefault();}},stopDrag:function(e){var me=this,current=me.dragCurrent,dragEl;if(current){if(me.dragThreshMet){dragEl=current.getDragEl();if(dragEl){Ext.fly(dragEl).removeCls(me.dragCls);}
current.b4EndDrag(e);current.endDrag(e);}
me.dragCurrent.onMouseUp(e);}
me.dragCurrent=null;me.dragOvers={};},handleMouseMove:function(e){var me=this,current=me.dragCurrent,diffX,diffY;if(!current){return true;}
if(!me.dragThreshMet){diffX=Math.abs(me.startX-e.getPageX());diffY=Math.abs(me.startY-e.getPageY());if(diffX>me.clickPixelThresh||diffY>me.clickPixelThresh){me.startDrag(me.startX,me.startY);}}
if(me.dragThreshMet){current.b4Drag(e);current.onDrag(e);if(!current.moveOnly){me.fireEvents(e,false);}}
me.stopEvent(e);return true;},fireEvents:function(e,isDrop){var me=this,dragCurrent=me.dragCurrent,dragEl,oldDragElTop,mousePoint=e.getPoint(),overTarget,overTargetEl,allTargets=[],oldOvers=[],outEvts=[],overEvts=[],dropEvts=[],enterEvts=[],xy,needsSort,i,len,sGroup;if(!dragCurrent||dragCurrent.isLocked()){return;}
if(!me.notifyOccluded&&(!Ext.supports.PointerEvents||Ext.isIE10m||Ext.isOpera)&&!(dragCurrent.deltaX<0||dragCurrent.deltaY<0)){dragEl=dragCurrent.getDragEl();oldDragElTop=dragEl.style.top;dragEl.style.top='-10000px';xy=e.getXY();e.target=document.elementFromPoint(xy[0],xy[1]);dragEl.style.top=oldDragElTop;}
for(i in me.dragOvers){overTarget=me.dragOvers[i];if(!me.isTypeOfDD(overTarget)){continue;}
if(me.notifyOccluded){if(!this.isOverTarget(mousePoint,overTarget,me.mode)){outEvts.push(overTarget);}}
else{if(!e.within(overTarget.getEl())){outEvts.push(overTarget);}}
oldOvers[i]=true;delete me.dragOvers[i];}
for(sGroup in dragCurrent.groups){if("string"!=typeof sGroup){continue;}
for(i in me.ids[sGroup]){overTarget=me.ids[sGroup][i];if(me.isTypeOfDD(overTarget)&&(overTargetEl=overTarget.getEl())&&(overTarget.isTarget)&&(!overTarget.isLocked())&&(Ext.fly(overTargetEl).isVisible(true))&&((overTarget!=dragCurrent)||(dragCurrent.ignoreSelf===false))){if(me.notifyOccluded){if((overTarget.zIndex=me.getZIndex(overTargetEl))!==-1){needsSort=true;}
allTargets.push(overTarget);}
else{if(e.within(overTarget.getEl())){allTargets.push(overTarget);break;}}}}}
if(needsSort){Ext.Array.sort(allTargets,me.byZIndex);}
for(i=0,len=allTargets.length;i<len;i++){overTarget=allTargets[i];if(me.isOverTarget(mousePoint,overTarget,me.mode)){if(isDrop){dropEvts.push(overTarget);}else{if(!oldOvers[overTarget.id]){enterEvts.push(overTarget);}else{overEvts.push(overTarget);}
me.dragOvers[overTarget.id]=overTarget;}
if(!me.notifyOccluded){break;}}}
if(me.mode){if(outEvts.length){dragCurrent.b4DragOut(e,outEvts);dragCurrent.onDragOut(e,outEvts);}
if(enterEvts.length){dragCurrent.onDragEnter(e,enterEvts);}
if(overEvts.length){dragCurrent.b4DragOver(e,overEvts);dragCurrent.onDragOver(e,overEvts);}
if(dropEvts.length){dragCurrent.b4DragDrop(e,dropEvts);dragCurrent.onDragDrop(e,dropEvts);}}else{for(i=0,len=outEvts.length;i<len;++i){dragCurrent.b4DragOut(e,outEvts[i].id);dragCurrent.onDragOut(e,outEvts[i].id);}
for(i=0,len=enterEvts.length;i<len;++i){dragCurrent.onDragEnter(e,enterEvts[i].id);}
for(i=0,len=overEvts.length;i<len;++i){dragCurrent.b4DragOver(e,overEvts[i].id);dragCurrent.onDragOver(e,overEvts[i].id);}
for(i=0,len=dropEvts.length;i<len;++i){dragCurrent.b4DragDrop(e,dropEvts[i].id);dragCurrent.onDragDrop(e,dropEvts[i].id);}}
if(isDrop&&!dropEvts.length){dragCurrent.onInvalidDrop(e);}},getZIndex:function(element){var body=document.body,z,zIndex=-1;element=Ext.getDom(element);while(element!==body){if(!isNaN(z=Number(Ext.fly(element).getStyle('zIndex')))){zIndex=z;}
element=element.parentNode;}
return zIndex;},byZIndex:function(d1,d2){return d1.zIndex<d2.zIndex;},getBestMatch:function(dds){var winner=null,len=dds.length,i,dd;if(len==1){winner=dds[0];}else{for(i=0;i<len;++i){dd=dds[i];if(dd.cursorIsOver){winner=dd;break;}else{if(!winner||winner.overlap.getArea()<dd.overlap.getArea()){winner=dd;}}}}
return winner;},refreshCache:function(groups){var sGroup,i,oDD,loc;for(sGroup in groups){if("string"!=typeof sGroup){continue;}
for(i in this.ids[sGroup]){oDD=this.ids[sGroup][i];if(this.isTypeOfDD(oDD)){loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){if(el){var parent;if(Ext.isIE){try{parent=el.offsetParent;}catch(e){}}else{parent=el.offsetParent;}
if(parent){return true;}}
return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}
if(oDD.getRegion){return oDD.getRegion();}
var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=Ext.Element.getXY(el);}catch(e){}
if(!pos){return null;}
x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new Ext.util.Region(t,r,b,l);},isOverTarget:function(pt,oTarget,intersect){var loc=this.locationCache[oTarget.id],dc,pos,el,curRegion,overlap;if(!loc||!this.useCache){loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}
if(!loc){return false;}
oTarget.cursorIsOver=loc.contains(pt);dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!intersect&&!dc.constrainX&&!dc.constrainY)){return oTarget.cursorIsOver;}
oTarget.overlap=null;pos=dc.getTargetCoord(pt.x,pt.y);el=dc.getDragEl();curRegion=new Ext.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);overlap=curRegion.intersect(loc);if(overlap){oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else{return false;}},_onUnload:function(e,me){Ext.dd.DragDropManager.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}
this._execOnAll("unreg",[]);for(var i in this.elementCache){delete this.elementCache[i];}
this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var oWrapper=this.elementCache[id];if(!oWrapper||!oWrapper.el){oWrapper=this.elementCache[id]=new this.ElementWrapper(Ext.getDom(id));}
return oWrapper;},getElement:function(id){return Ext.getDom(id);},getCss:function(id){var el=Ext.getDom(id);return(el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return Ext.Element.getX(el);},getPosY:function(el){return Ext.Element.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode,s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var doc=window.document,docEl=doc.documentElement,body=doc.body,top=0,left=0;if(Ext.isGecko4){top=window.scrollYOffset;left=window.scrollXOffset;}else{if(docEl&&(docEl.scrollTop||docEl.scrollLeft)){top=docEl.scrollTop;left=docEl.scrollLeft;}else if(body){top=body.scrollTop;left=body.scrollLeft;}}
return{top:top,left:left};},getStyle:function(el,styleProp){return Ext.fly(el).getStyle(styleProp);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(moveEl,targetEl){var aCoord=Ext.Element.getXY(targetEl);Ext.Element.setXY(moveEl,aCoord);},numericSort:function(a,b){return(a-b);},_timeoutCount:0,_addListeners:function(){if(document){this._onLoad();}else{if(this._timeoutCount<=2000){setTimeout(this._addListeners,10);if(document&&document.body){this._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}
return false;}},function(){this._addListeners();});Ext.define('Ext.util.Point',{extend:'Ext.util.Region',statics:{fromEvent:function(e){e=e.browserEvent||e;e=(e.changedTouches&&e.changedTouches.length>0)?e.changedTouches[0]:e;return new this(e.pageX,e.pageY);}},constructor:function(x,y){this.callParent([y,x,y,x]);},toString:function(){return"Point["+this.x+","+this.y+"]";},equals:function(p){return(this.x==p.x&&this.y==p.y);},isWithin:function(p,threshold){if(!Ext.isObject(threshold)){threshold={x:threshold,y:threshold};}
return(this.x<=p.x+threshold.x&&this.x>=p.x-threshold.x&&this.y<=p.y+threshold.y&&this.y>=p.y-threshold.y);},isContainedBy:function(region){if(!(region instanceof Ext.util.Region)){region=Ext.get(region.el||region).getRegion();}
return region.contains(this);},roundedEquals:function(p){return(Math.round(this.x)==Math.round(p.x)&&Math.round(this.y)==Math.round(p.y));}},function(){this.prototype.translate=Ext.util.Region.prototype.translateBy;});Ext.define('Ext.Ajax',{extend:'Ext.data.Connection',singleton:true,autoAbort:false});Ext.define('Ext.data.Field',{requires:['Ext.data.Types','Ext.data.SortTypes'],alias:'data.field',isField:true,constructor:function(config){var me=this,types=Ext.data.Types,st;if(Ext.isString(config)){config={name:config};}
Ext.apply(me,config);st=me.sortType;if(me.type){if(Ext.isString(me.type)){me.type=types[me.type.toUpperCase()]||types.AUTO;}}else{me.type=types.AUTO;}
if(Ext.isString(st)){me.sortType=Ext.data.SortTypes[st];}else if(Ext.isEmpty(st)){me.sortType=me.type.sortType;}
if(!config.hasOwnProperty('convert')){me.convert=me.type.convert;}else if(!me.convert&&me.type.convert&&!config.hasOwnProperty('defaultValue')){me.defaultValue=me.type.convert(me.defaultValue);}
if(config.convert){me.hasCustomConvert=true;}},dateFormat:null,dateReadFormat:null,dateWriteFormat:null,useNull:false,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC",allowBlank:true,persist:true});Ext.define('Ext.fx.target.ElementCSS',{extend:'Ext.fx.target.Element',setAttr:function(targetData,isFirstFrame){var cssArr={attrs:[],duration:[],easing:[]},ln=targetData.length,attributes,attrs,attr,easing,duration,o,i,j,ln2;for(i=0;i<ln;i++){attrs=targetData[i];duration=attrs.duration;easing=attrs.easing;attrs=attrs.attrs;for(attr in attrs){if(Ext.Array.indexOf(cssArr.attrs,attr)==-1){cssArr.attrs.push(attr.replace(/[A-Z]/g,function(v){return'-'+v.toLowerCase();}));cssArr.duration.push(duration+'ms');cssArr.easing.push(easing);}}}
attributes=cssArr.attrs.join(',');duration=cssArr.duration.join(',');easing=cssArr.easing.join(', ');for(i=0;i<ln;i++){attrs=targetData[i].attrs;for(attr in attrs){ln2=attrs[attr].length;for(j=0;j<ln2;j++){o=attrs[attr][j];o[0].setStyle(Ext.supports.CSS3Prefix+'TransitionProperty',isFirstFrame?'':attributes);o[0].setStyle(Ext.supports.CSS3Prefix+'TransitionDuration',isFirstFrame?'':duration);o[0].setStyle(Ext.supports.CSS3Prefix+'TransitionTimingFunction',isFirstFrame?'':easing);o[0].setStyle(attr,o[1]);if(isFirstFrame){o=o[0].dom.offsetWidth;}
else{o[0].on(Ext.supports.CSS3TransitionEnd,function(){this.setStyle(Ext.supports.CSS3Prefix+'TransitionProperty',null);this.setStyle(Ext.supports.CSS3Prefix+'TransitionDuration',null);this.setStyle(Ext.supports.CSS3Prefix+'TransitionTimingFunction',null);},o[0],{single:true});}}}}}});Ext.define('Ext.data.reader.Json',{extend:'Ext.data.reader.Reader',alternateClassName:'Ext.data.JsonReader',alias:'reader.json',root:'',metaProperty:'metaData',useSimpleAccessors:false,readRecords:function(data){var me=this,meta;if(me.getMeta){meta=me.getMeta(data);if(meta){me.onMetaChange(meta);}}else if(data.metaData){me.onMetaChange(data.metaData);}
me.jsonData=data;return me.callParent([data]);},getResponseData:function(response){var data,error;try{data=Ext.decode(response.responseText);return this.readRecords(data);}catch(ex){error=new Ext.data.ResultSet({total:0,count:0,records:[],success:false,message:ex.message});this.fireEvent('exception',this,response,error);Ext.Logger.warn('Unable to parse the JSON returned by the server');return error;}},buildExtractors:function(){var me=this,metaProp=me.metaProperty;me.callParent(arguments);if(me.root){me.getRoot=me.createAccessor(me.root);}else{me.getRoot=Ext.identityFn;}
if(metaProp){me.getMeta=me.createAccessor(metaProp);}},extractData:function(root){var recordName=this.record,data=[],length,i;if(recordName){length=root.length;if(!length&&Ext.isObject(root)){length=1;root=[root];}
for(i=0;i<length;i++){data[i]=root[i][recordName];}}else{data=root;}
return this.callParent([data]);},createAccessor:(function(){var re=/[\[\.]/;return function(expr){if(Ext.isEmpty(expr)){return Ext.emptyFn;}
if(Ext.isFunction(expr)){return expr;}
if(this.useSimpleAccessors!==true){var i=String(expr).search(re);if(i>=0){return Ext.functionFactory('obj','return obj'+(i>0?'.':'')+expr);}}
return function(obj){return obj[expr];};};}()),createFieldAccessExpression:(function(){var re=/[\[\.]/;return function(field,fieldVarName,dataName){var mapping=field.mapping,hasMap=mapping||mapping===0,map=hasMap?mapping:field.name,result,operatorIndex;if(mapping===false){return;}
if(typeof map==='function'){result=fieldVarName+'.mapping('+dataName+', this)';}else if(this.useSimpleAccessors===true||((operatorIndex=String(map).search(re))<0)){if(!hasMap||isNaN(map)){map='"'+map+'"';}
result=dataName+"["+map+"]";}else if(operatorIndex===0){result=dataName+map;}else{var parts=map.split('.'),len=parts.length,i=1,tempResult=dataName+'.'+parts[0],buffer=[tempResult];for(;i<len;i++){tempResult+='.'+parts[i];buffer.push(tempResult);}
result=buffer.join(' && ');}
return result;};}())});Ext.define('Ext.PluginManager',{extend:'Ext.AbstractManager',alternateClassName:'Ext.PluginMgr',singleton:true,typeName:'ptype',create:function(config,defaultType,host){var result;if(config.init){result=config;}else{if(host){config=Ext.apply({},config);config.cmp=host;}
else{host=config.cmp;}
if(config.xclass){result=Ext.create(config);}else{result=Ext.ClassManager.getByAlias(('plugin.'+(config.ptype||defaultType)));if(typeof result==='function'){result=new result(config);}}}
if(result&&host&&result.setCmp&&!result.setCmpCalled){result.setCmp(host);result.setCmpCalled=true;}
return result;},findByType:function(type,defaultsOnly){var matches=[],types=this.types,name,item;for(name in types){if(!types.hasOwnProperty(name)){continue;}
item=types[name];if(item.type==type&&(!defaultsOnly||(defaultsOnly===true&&item.isDefault))){matches.push(item);}}
return matches;}},function(){Ext.preg=function(){return Ext.PluginManager.registerType.apply(Ext.PluginManager,arguments);};});Ext.define('Ext.form.RadioManager',{extend:'Ext.util.MixedCollection',singleton:true,getByName:function(name,formId){return this.filterBy(function(item){return item.name==name&&item.getFormId()==formId;});},getWithValue:function(name,value,formId){return this.filterBy(function(item){return item.name==name&&item.inputValue==value&&item.getFormId()==formId;});},getChecked:function(name,formId){return this.findBy(function(item){return item.name==name&&item.checked&&item.getFormId()==formId;});}});Ext.define('Ext.ComponentQuery',{singleton:true,requires:['Ext.ComponentManager','Ext.dom.Query']},function(){var cq=this,domQueryOperators=Ext.dom.Query.operators,nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/,filterFnPattern=['var r = [],','i = 0,','it = items,','l = it.length,','c;','for (; i < l; i++) {','c = it[i];','if (c.{0}) {','r.push(c);','}','}','return r;'].join(''),filterItems=function(items,operation){return operation.method.apply(this,[items].concat(operation.args));},getItems=function(items,mode){var result=[],i=0,length=items.length,candidate,deep=mode!=='>';for(;i<length;i++){candidate=items[i];if(candidate.getRefItems){result=result.concat(candidate.getRefItems(deep));}}
return result;},getAncestors=function(items){var result=[],i=0,length=items.length,candidate;for(;i<length;i++){candidate=items[i];while(!!(candidate=candidate.getRefOwner())){result.push(candidate);}}
return result;},filterByXType=function(items,xtype,shallow){if(xtype==='*'){return items.slice();}
else{var result=[],i=0,length=items.length,candidate;for(;i<length;i++){candidate=items[i];if(candidate.isXType(xtype,shallow)){result.push(candidate);}}
return result;}},filterByClassName=function(items,className){var result=[],i=0,length=items.length,candidate;for(;i<length;i++){candidate=items[i];if(candidate.hasCls(className)){result.push(candidate);}}
return result;},filterByAttribute=function(items,property,operator,compareTo){var result=[],i=0,length=items.length,mustBeOwnProperty,presenceOnly,candidate,propValue,j,propLen;if(property.charAt(0)==='@'){mustBeOwnProperty=true;property=property.substr(1);}
if(property.charAt(0)==='?'){mustBeOwnProperty=true;presenceOnly=true;property=property.substr(1);}
for(;i<length;i++){candidate=items[i];if(!mustBeOwnProperty||candidate.hasOwnProperty(property)){propValue=candidate[property];if(presenceOnly){result.push(candidate);}
else if(operator==='~='){if(propValue){if(!Ext.isArray(propValue)){propValue=propValue.split(' ');}
for(j=0,propLen=propValue.length;j<propLen;j++){if(domQueryOperators[operator](Ext.coerce(propValue[j],compareTo),compareTo)){result.push(candidate);break;}}}}else if(!compareTo?!!candidate[property]:domQueryOperators[operator](Ext.coerce(propValue,compareTo),compareTo)){result.push(candidate);}}}
return result;},filterById=function(items,id){var result=[],i=0,length=items.length,candidate;for(;i<length;i++){candidate=items[i];if(candidate.getItemId()===id){result.push(candidate);}}
return result;},filterByPseudo=function(items,name,value){return cq.pseudos[name](items,value);},modeRe=/^(\s?([>\^])\s?|\s|$)/,tokenRe=/^(#)?([\w\-]+|\*)(?:\((true|false)\))?/,matchers=[{re:/^\.([\w\-]+)(?:\((true|false)\))?/,method:filterByXType},{re:/^(?:\[((?:@|\?)?[\w\-\$]*[^\^\$\*~%!])\s?(?:(=|.=)\s?['"]?(.*?)["']?)?\])/,method:filterByAttribute},{re:/^#([\w\-]+)/,method:filterById},{re:/^\:([\w\-]+)(?:\(((?:\{[^\}]+\})|(?:(?!\{)[^\s>\/]*?(?!\})))\))?/,method:filterByPseudo},{re:/^(?:\{([^\}]+)\})/,method:filterFnPattern}];cq.Query=Ext.extend(Object,{constructor:function(cfg){cfg=cfg||{};Ext.apply(this,cfg);},execute:function(root){var operations=this.operations,i=0,length=operations.length,operation,workingItems;if(!root){workingItems=Ext.ComponentManager.all.getArray();}
else if(Ext.isIterable(root)){workingItems=root;}
else if(root.isMixedCollection){workingItems=root.items;}
for(;i<length;i++){operation=operations[i];if(operation.mode==='^'){workingItems=getAncestors(workingItems||[root]);}
else if(operation.mode){workingItems=getItems(workingItems||[root],operation.mode);}
else{workingItems=filterItems(workingItems||getItems([root]),operation);}
if(i===length-1){return workingItems;}}
return[];},is:function(component){var operations=this.operations,components=Ext.isArray(component)?component:[component],originalLength=components.length,lastOperation=operations[operations.length-1],ln,i;components=filterItems(components,lastOperation);if(components.length===originalLength){if(operations.length>1){for(i=0,ln=components.length;i<ln;i++){if(Ext.Array.indexOf(this.execute(),components[i])===-1){return false;}}}
return true;}
return false;}});Ext.apply(this,{cache:{},pseudos:{not:function(components,selector){var CQ=Ext.ComponentQuery,i=0,length=components.length,results=[],index=-1,component;for(;i<length;++i){component=components[i];if(!CQ.is(component,selector)){results[++index]=component;}}
return results;},first:function(components){var ret=[];if(components.length>0){ret.push(components[0]);}
return ret;},last:function(components){var len=components.length,ret=[];if(len>0){ret.push(components[len-1]);}
return ret;},focusable:function(cmps){var len=cmps.length,results=[],i=0,c;for(;i<len;i++){c=cmps[i];if(c.isFocusable()){results.push(c);}}
return results;},"nth-child":function(c,a){var result=[],m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a),f=(m[1]||1)-0,l=m[2]-0,i,n,nodeIndex;for(i=0;n=c[i];i++){nodeIndex=i+1;if(f==1){if(l==0||nodeIndex==l){result.push(n);}}else if((nodeIndex+l)%f==0){result.push(n);}}
return result;}},query:function(selector,root){var selectors=selector.split(','),length=selectors.length,i=0,results=[],noDupResults=[],dupMatcher={},query,resultsLn,cmp;for(;i<length;i++){selector=Ext.String.trim(selectors[i]);query=this.cache[selector]||(this.cache[selector]=this.parse(selector));results=results.concat(query.execute(root));}
if(length>1){resultsLn=results.length;for(i=0;i<resultsLn;i++){cmp=results[i];if(!dupMatcher[cmp.id]){noDupResults.push(cmp);dupMatcher[cmp.id]=true;}}
results=noDupResults;}
return results;},is:function(component,selector){if(!selector){return true;}
var selectors=selector.split(','),length=selectors.length,i=0,query;for(;i<length;i++){selector=Ext.String.trim(selectors[i]);query=this.cache[selector]||(this.cache[selector]=this.parse(selector));if(query.is(component)){return true;}}
return false;},parse:function(selector){var operations=[],length=matchers.length,lastSelector,tokenMatch,matchedChar,modeMatch,selectorMatch,i,matcher,method;while(selector&&lastSelector!==selector){lastSelector=selector;tokenMatch=selector.match(tokenRe);if(tokenMatch){matchedChar=tokenMatch[1];if(matchedChar==='#'){operations.push({method:filterById,args:[Ext.String.trim(tokenMatch[2])]});}
else if(matchedChar==='.'){operations.push({method:filterByClassName,args:[Ext.String.trim(tokenMatch[2])]});}
else{operations.push({method:filterByXType,args:[Ext.String.trim(tokenMatch[2]),Boolean(tokenMatch[3])]});}
selector=selector.replace(tokenMatch[0],'');}
while(!(modeMatch=selector.match(modeRe))){for(i=0;selector&&i<length;i++){matcher=matchers[i];selectorMatch=selector.match(matcher.re);method=matcher.method;if(selectorMatch){operations.push({method:Ext.isString(matcher.method)?Ext.functionFactory('items',Ext.String.format.apply(Ext.String,[method].concat(selectorMatch.slice(1)))):matcher.method,args:selectorMatch.slice(1)});selector=selector.replace(selectorMatch[0],'');break;}
if(i===(length-1)){Ext.Error.raise('Invalid ComponentQuery selector: "'+arguments[0]+'"');}}}
if(modeMatch[1]){operations.push({mode:modeMatch[2]||modeMatch[1]});selector=selector.replace(modeMatch[0],'');}}
return new cq.Query({operations:operations});}});});Ext.define('Ext.form.CheckboxManager',{extend:'Ext.util.MixedCollection',singleton:true,getByName:function(name,formId){return this.filterBy(function(item){return item.name==name&&item.getFormId()==formId;});}});Ext.define('Ext.layout.container.Auto',{alias:['layout.auto','layout.autocontainer'],extend:'Ext.layout.container.Container',type:'autocontainer',childEls:['outerCt','innerCt','clearEl'],reserveScrollbar:false,managePadding:true,manageOverflow:false,lastOverflowAdjust:{width:0,height:0},renderTpl:['{% if (!(Ext.isIEQuirks || Ext.isIE7m)) { %}','<span id="{ownerId}-outerCt" style="display:table;">','<div id="{ownerId}-innerCt" style="display:table-cell;height:100%;','vertical-align:top;{%this.renderPadding(out, values)%}" class="{innerCtCls}">','{%this.renderBody(out,values)%}','</div>','</span>','{% } else if (values.shrinkWrapWidth) { %}','<table id="{ownerId}-outerCt" class="'+Ext.plainTableCls+'">','<tr>','<td id="{ownerId}-innerCt" style="vertical-align:top;padding:0;','{%this.renderPadding(out, values)%}" class="{innerCtCls}">','{%this.renderBody(out,values)%}','<div id="{ownerId}-clearEl" class="',Ext.baseCSSPrefix,'clear"','role="presentation"></div>','</td>','</tr>','</table>','{% } else { %}','<div id="{ownerId}-outerCt" style="zoom:1;{%this.renderPadding(out, values)%}">','<div id="{ownerId}-innerCt" style="zoom:1;height:100%;" class="{innerCtCls}">','{%this.renderBody(out,values)%}','<div id="{ownerId}-clearEl" class="',Ext.baseCSSPrefix,'clear"','role="presentation"></div>','</div>','</div>','{% values.$layout.isShrinkWrapTpl = false %}','{% } %}'],tableTpl:['<table id="{ownerId}-outerCt" class="'+Ext.plainTableCls+'">','<tr>','<td id="{ownerId}-innerCt" style="vertical-align:top;padding:0;','{%this.renderPadding(out, values)%}" class="{innerCtCls}">','</td>','</tr>','</table>'],isShrinkWrapTpl:true,beginLayout:function(ownerContext){var me=this,bottomPadding,overflowYStyle,overflowXStyle,needsTable;me.callParent(arguments);me.initContextItems(ownerContext);if(!me.isShrinkWrapTpl){if(ownerContext.widthModel.shrinkWrap){needsTable=true;}
if(Ext.isStrict&&Ext.isIE7){overflowXStyle=me.getOverflowXStyle(ownerContext);if((overflowXStyle==='auto'||overflowXStyle==='scroll')&&ownerContext.paddingContext.getPaddingInfo().right){needsTable=true;}}
if(needsTable){me.insertTableCt(ownerContext);}}
if(!me.isShrinkWrapTpl&&Ext.isIE7&&Ext.isStrict&&!me.clearElHasPadding){bottomPadding=ownerContext.paddingContext.getPaddingInfo().bottom;overflowYStyle=me.getOverflowYStyle(ownerContext);if(bottomPadding&&(overflowYStyle==='auto'||overflowYStyle==='scroll')){me.clearEl.setStyle('height',bottomPadding);me.clearElHasPadding=true;}}},beforeLayoutCycle:function(ownerContext){var comp=this.owner,hierarchyState=comp.hierarchyState,hierarchyStateInner=comp.hierarchyStateInner;if(!hierarchyState||hierarchyState.invalid){hierarchyState=comp.getHierarchyState();hierarchyStateInner=comp.hierarchyStateInner;}
if(ownerContext.widthModel.shrinkWrap&&this.isShrinkWrapTpl){hierarchyStateInner.inShrinkWrapTable=true;}else{delete hierarchyStateInner.inShrinkWrapTable;}},beginLayoutCycle:function(ownerContext){var me=this,outerCt=me.outerCt,lastOuterCtWidth=me.lastOuterCtWidth||'',lastOuterCtHeight=me.lastOuterCtHeight||'',lastOuterCtTableLayout=me.lastOuterCtTableLayout||'',state=ownerContext.state,overflowXStyle,overflowYStyle,outerCtWidth,outerCtHeight,outerCtTableLayout,deferWidth,hierarchyStateInner;me.callParent(arguments);outerCtWidth=outerCtHeight=outerCtTableLayout='';if(!ownerContext.widthModel.shrinkWrap&&me.isShrinkWrapTpl){if(Ext.isIE7m&&Ext.isStrict){overflowYStyle=me.getOverflowYStyle(ownerContext);if(overflowYStyle==='auto'||overflowYStyle==='scroll'){deferWidth=true;}}
if(!deferWidth){outerCtWidth='100%';}
hierarchyStateInner=me.owner.hierarchyStateInner;overflowXStyle=me.getOverflowXStyle(ownerContext);outerCtTableLayout=(hierarchyStateInner.inShrinkWrapTable||overflowXStyle==='auto'||overflowXStyle==='scroll')?'':'fixed';}
if(!ownerContext.heightModel.shrinkWrap&&!Ext.supports.PercentageHeightOverflowBug){outerCtHeight='100%';}
if((outerCtWidth!==lastOuterCtWidth)||me.hasOuterCtPxWidth){outerCt.setStyle('width',outerCtWidth);me.lastOuterCtWidth=outerCtWidth;me.hasOuterCtPxWidth=false;}
if(outerCtTableLayout!==lastOuterCtTableLayout){outerCt.setStyle('table-layout',outerCtTableLayout);me.lastOuterCtTableLayout=outerCtTableLayout;}
if((outerCtHeight!==lastOuterCtHeight)||me.hasOuterCtPxHeight){outerCt.setStyle('height',outerCtHeight);me.lastOuterCtHeight=outerCtHeight;me.hasOuterCtPxHeight=false;}
if(me.hasInnerCtPxHeight){me.innerCt.setStyle('height','');me.hasInnerCtPxHeight=false;}
state.overflowAdjust=state.overflowAdjust||me.lastOverflowAdjust;},calculate:function(ownerContext){var me=this,state=ownerContext.state,containerSize=me.getContainerSize(ownerContext,true),calculatedItems=state.calculatedItems||(state.calculatedItems=me.calculateItems?me.calculateItems(ownerContext,containerSize):true);me.setCtSizeIfNeeded(ownerContext,containerSize);if(calculatedItems&&ownerContext.hasDomProp('containerChildrenSizeDone')){me.calculateContentSize(ownerContext);if(containerSize.gotAll){if(me.manageOverflow&&!ownerContext.state.secondPass&&!me.reserveScrollbar){me.calculateOverflow(ownerContext,containerSize);}
return;}}
me.done=false;},calculateContentSize:function(ownerContext){var me=this,containerDimensions=((ownerContext.widthModel.shrinkWrap?1:0)|(ownerContext.heightModel.shrinkWrap?2:0)),calcWidth=(containerDimensions&1)||undefined,calcHeight=(containerDimensions&2)||undefined,needed=0,props=ownerContext.props;if(calcWidth){if(isNaN(props.contentWidth)){++needed;}else{calcWidth=undefined;}}
if(calcHeight){if(isNaN(props.contentHeight)){++needed;}else{calcHeight=undefined;}}
if(needed){if(calcWidth&&!ownerContext.setContentWidth(me.measureContentWidth(ownerContext))){me.done=false;}
if(calcHeight&&!ownerContext.setContentHeight(me.measureContentHeight(ownerContext))){me.done=false;}}},calculateOverflow:function(ownerContext){var me=this,width,height,scrollbarSize,scrollbars,xauto,yauto,targetEl;xauto=(me.getOverflowXStyle(ownerContext)==='auto');yauto=(me.getOverflowYStyle(ownerContext)==='auto');if(xauto||yauto){scrollbarSize=Ext.getScrollbarSize();targetEl=ownerContext.overflowContext.el.dom;scrollbars=0;if(targetEl.scrollWidth>targetEl.clientWidth){scrollbars|=1;}
if(targetEl.scrollHeight>targetEl.clientHeight){scrollbars|=2;}
width=(yauto&&(scrollbars&2))?scrollbarSize.width:0;height=(xauto&&(scrollbars&1))?scrollbarSize.height:0;if(width!==me.lastOverflowAdjust.width||height!==me.lastOverflowAdjust.height){me.done=false;ownerContext.invalidate({state:{overflowAdjust:{width:width,height:height},overflowState:scrollbars,secondPass:true}});}}},completeLayout:function(ownerContext){this.lastOverflowAdjust=ownerContext.state.overflowAdjust;},doRenderPadding:function(out,renderData){var me=renderData.$layout,owner=renderData.$layout.owner,padding=owner[owner.contentPaddingProperty];if(me.managePadding&&padding){out.push('padding:',owner.unitizeBox(padding));}},finishedLayout:function(ownerContext){var innerCt=this.innerCt;this.callParent(arguments);if(Ext.isIEQuirks||Ext.isIE8m){innerCt.repaint();}
if(Ext.isOpera){innerCt.setStyle('position','relative');innerCt.dom.scrollWidth;innerCt.setStyle('position','');}},getContainerSize:function(ownerContext,inDom){var size=this.callParent(arguments),overflowAdjust=ownerContext.state.overflowAdjust;if(overflowAdjust){size.width-=overflowAdjust.width;size.height-=overflowAdjust.height;}
return size;},getRenderData:function(){var owner=this.owner,data=this.callParent();if((Ext.isIEQuirks||Ext.isIE7m)&&((owner.shrinkWrap&1)||(owner.floating&&!owner.width))){data.shrinkWrapWidth=true;}
return data;},getRenderTarget:function(){return this.innerCt;},getElementTarget:function(){return this.innerCt;},getOverflowXStyle:function(ownerContext){return ownerContext.overflowXStyle||(ownerContext.overflowXStyle=this.owner.scrollFlags.overflowX||ownerContext.overflowContext.getStyle('overflow-x'));},getOverflowYStyle:function(ownerContext){return ownerContext.overflowYStyle||(ownerContext.overflowYStyle=this.owner.scrollFlags.overflowY||ownerContext.overflowContext.getStyle('overflow-y'));},initContextItems:function(ownerContext){var me=this,target=ownerContext.target,customOverflowEl=me.owner.customOverflowEl;ownerContext.outerCtContext=ownerContext.getEl('outerCt',me);ownerContext.innerCtContext=ownerContext.getEl('innerCt',me);if(customOverflowEl){ownerContext.overflowContext=ownerContext.getEl(customOverflowEl);}else{ownerContext.overflowContext=ownerContext.targetContext;}
if(target[target.contentPaddingProperty]!==undefined){ownerContext.paddingContext=me.isShrinkWrapTpl?ownerContext.innerCtContext:ownerContext.outerCtContext;}},initLayout:function(){var me=this,scrollbarWidth=Ext.getScrollbarSize().width,owner=me.owner;me.callParent();if(scrollbarWidth&&me.manageOverflow&&!me.hasOwnProperty('lastOverflowAdjust')){if(owner.autoScroll||me.reserveScrollbar){me.lastOverflowAdjust={width:scrollbarWidth,height:0};}}},insertTableCt:function(ownerContext){var me=this,owner=me.owner,i=0,renderTpl,fragment,childNodes,childLength,targetEl;renderTpl=Ext.XTemplate.getTpl(this,'tableTpl');renderTpl.renderPadding=me.doRenderPadding
me.outerCt.dom.removeChild(me.innerCt.dom);fragment=document.createDocumentFragment();childNodes=me.innerCt.dom.childNodes;childLength=childNodes.length;for(;i<childLength;i++){fragment.appendChild(childNodes[0]);}
targetEl=me.getTarget();targetEl.dom.innerHTML=renderTpl.apply({$layout:me,ownerId:me.owner.id});targetEl.down('td').dom.appendChild(fragment);me.applyChildEls(owner.el,owner.id)
me.isShrinkWrapTpl=true;ownerContext.removeEl(me.outerCt);ownerContext.removeEl(me.innerCt);me.initContextItems(ownerContext);},measureContentHeight:function(ownerContext){var contentHeight=this.outerCt.getHeight(),target=ownerContext.target;if(this.managePadding&&(target[target.contentPaddingProperty]===undefined)){contentHeight+=ownerContext.targetContext.getPaddingInfo().height;}
return contentHeight;},measureContentWidth:function(ownerContext){var dom,style,old,contentWidth,target;if(this.chromeCellMeasureBug){dom=this.innerCt.dom;style=dom.style;old=style.display;if(old=='table-cell'){style.display='';dom.offsetWidth;style.display=old;}}
contentWidth=this.outerCt.getWidth();target=ownerContext.target;if(this.managePadding&&(target[target.contentPaddingProperty]===undefined)){contentWidth+=ownerContext.targetContext.getPaddingInfo().width;}
return contentWidth;},setCtSizeIfNeeded:function(ownerContext,containerSize){var me=this,width=containerSize.width,height=containerSize.height,padding=ownerContext.paddingContext.getPaddingInfo(),targetEl=me.getTarget(),overflowXStyle=me.getOverflowXStyle(ownerContext),overflowYStyle=me.getOverflowYStyle(ownerContext),canOverflowX=(overflowXStyle==='auto'||overflowXStyle==='scroll'),canOverflowY=(overflowYStyle==='auto'||overflowYStyle==='scroll'),scrollbarSize=Ext.getScrollbarSize(),isShrinkWrapTpl=me.isShrinkWrapTpl,manageOverflow=me.manageOverflow,overflowStyleName,needsOuterHeight,needsInnerHeight,needsInnerCtPaddingHeight;if(width&&!ownerContext.widthModel.shrinkWrap&&((Ext.isIE7m&&Ext.isStrict&&isShrinkWrapTpl&&canOverflowY)||(Ext.isIEQuirks&&!isShrinkWrapTpl&&!canOverflowX))){if(!manageOverflow){if(canOverflowY&&(targetEl.dom.scrollHeight>targetEl.dom.clientHeight)){width-=scrollbarSize.width;}}
ownerContext.outerCtContext.setProp('width',width+padding.width);me.hasOuterCtPxWidth=true;}
if(height&&!ownerContext.heightModel.shrinkWrap){if(Ext.supports.PercentageHeightOverflowBug){needsOuterHeight=true;}
if(((Ext.isIE8&&Ext.isStrict)||Ext.isIE7m&&Ext.isStrict&&isShrinkWrapTpl)){needsInnerHeight=true;needsInnerCtPaddingHeight=!Ext.isIE8;}
if((needsOuterHeight||needsInnerHeight)&&canOverflowX&&(targetEl.dom.scrollWidth>targetEl.dom.clientWidth)){height=Math.max(height-scrollbarSize.height,0);}
if(needsOuterHeight){ownerContext.outerCtContext.setProp('height',height+padding.height);me.hasOuterCtPxHeight=true;}
if(needsInnerHeight){if(needsInnerCtPaddingHeight){height+=padding.height;}
ownerContext.innerCtContext.setProp('height',height);me.hasInnerCtPxHeight=true;}}
if(Ext.isIE7&&Ext.isStrict&&!isShrinkWrapTpl&&(overflowYStyle==='auto')){overflowStyleName=(overflowXStyle==='auto')?'overflow-x':'overflow-y';targetEl.setStyle(overflowStyleName,'hidden');targetEl.setStyle(overflowStyleName,'auto');}},setupRenderTpl:function(renderTpl){this.callParent(arguments);renderTpl.renderPadding=this.doRenderPadding;},getContentTarget:function(){return this.innerCt;}},function(){this.prototype.chromeCellMeasureBug=Ext.isChrome&&Ext.chromeVersion>=26;});Ext.define('Ext.data.StoreManager',{extend:'Ext.util.MixedCollection',alternateClassName:['Ext.StoreMgr','Ext.data.StoreMgr','Ext.StoreManager'],singleton:true,uses:['Ext.data.ArrayStore'],register:function(){for(var i=0,s;(s=arguments[i]);i++){this.add(s);}},unregister:function(){for(var i=0,s;(s=arguments[i]);i++){this.remove(this.lookup(s));}},lookup:function(store){if(Ext.isArray(store)){var fields=['field1'],expand=!Ext.isArray(store[0]),data=store,i,len;if(expand){data=[];for(i=0,len=store.length;i<len;++i){data.push([store[i]]);}}else{for(i=2,len=store[0].length;i<=len;++i){fields.push('field'+i);}}
return new Ext.data.ArrayStore({data:data,fields:fields,autoDestroy:true,autoCreated:true,expanded:expand});}
if(Ext.isString(store)){return this.get(store);}else{return Ext.data.AbstractStore.create(store);}},getKey:function(o){return o.storeId;}},function(){Ext.regStore=function(name,config){var store;if(Ext.isObject(name)){config=name;}else{config.storeId=name;}
if(config instanceof Ext.data.Store){store=config;}else{store=new Ext.data.Store(config);}
return Ext.data.StoreManager.register(store);};Ext.getStore=function(name){return Ext.data.StoreManager.lookup(name);};});Ext.define('Ext.layout.component.Dock',{extend:'Ext.layout.component.Component',alias:'layout.dock',alternateClassName:'Ext.layout.component.AbstractDock',type:'dock',horzAxisProps:{name:'horz',oppositeName:'vert',dockBegin:'left',dockEnd:'right',horizontal:true,marginBegin:'margin-left',maxSize:'maxWidth',minSize:'minWidth',pos:'x',setSize:'setWidth',shrinkWrapDock:'shrinkWrapDockWidth',size:'width',sizeModel:'widthModel'},vertAxisProps:{name:'vert',oppositeName:'horz',dockBegin:'top',dockEnd:'bottom',horizontal:false,marginBegin:'margin-top',maxSize:'maxHeight',minSize:'minHeight',pos:'y',setSize:'setHeight',shrinkWrapDock:'shrinkWrapDockHeight',size:'height',sizeModel:'heightModel'},initializedBorders:-1,horizontalCollapsePolicy:{width:true,x:true},verticalCollapsePolicy:{height:true,y:true},finishRender:function(){var me=this,target,items;me.callParent();target=me.getRenderTarget();items=me.getDockedItems();me.finishRenderItems(target,items);},isItemBoxParent:function(itemContext){return true;},isItemShrinkWrap:function(item){return true;},noBorderClasses:[Ext.baseCSSPrefix+'docked-noborder-top',Ext.baseCSSPrefix+'docked-noborder-right',Ext.baseCSSPrefix+'docked-noborder-bottom',Ext.baseCSSPrefix+'docked-noborder-left'],noBorderClassesSides:{top:Ext.baseCSSPrefix+'docked-noborder-top',right:Ext.baseCSSPrefix+'docked-noborder-right',bottom:Ext.baseCSSPrefix+'docked-noborder-bottom',left:Ext.baseCSSPrefix+'docked-noborder-left'},borderWidthProps:{top:'border-top-width',right:'border-right-width',bottom:'border-bottom-width',left:'border-left-width'},handleItemBorders:function(){var me=this,owner=me.owner,borders,docked,lastItems=me.lastDockedItems,oldBorders=me.borders,currentGeneration=owner.dockedItems.generation,noBorderClassesSides=me.noBorderClassesSides,borderWidthProps=me.borderWidthProps,i,ln,item,dock,side,collapsed=me.collapsed;if(me.initializedBorders==currentGeneration||(owner.border&&!owner.manageBodyBorders)){return;}
me.initializedBorders=currentGeneration;me.collapsed=false;me.lastDockedItems=docked=me.getLayoutItems();me.collapsed=collapsed;borders={top:[],right:[],bottom:[],left:[]};for(i=0,ln=docked.length;i<ln;i++){item=docked[i];dock=item.dock;if(item.ignoreBorderManagement){continue;}
if(!borders[dock].satisfied){borders[dock].push(item);borders[dock].satisfied=true;}
if(!borders.top.satisfied&&dock!=='bottom'){borders.top.push(item);}
if(!borders.right.satisfied&&dock!=='left'){borders.right.push(item);}
if(!borders.bottom.satisfied&&dock!=='top'){borders.bottom.push(item);}
if(!borders.left.satisfied&&dock!=='right'){borders.left.push(item);}}
if(lastItems){for(i=0,ln=lastItems.length;i<ln;i++){item=lastItems[i];if(!item.isDestroyed&&!item.ignoreBorderManagement&&!owner.manageBodyBorders){item.removeCls(me.noBorderClasses);}}}
if(oldBorders){for(side in oldBorders){if(owner.manageBodyBorders&&oldBorders[side].satisfied){owner.setBodyStyle(borderWidthProps[side],'');}}}
for(side in borders){ln=borders[side].length;if(!owner.manageBodyBorders){for(i=0;i<ln;i++){borders[side][i].addCls(noBorderClassesSides[side]);}
if((!borders[side].satisfied&&!owner.bodyBorder)||owner.bodyBorder===false){owner.addBodyCls(noBorderClassesSides[side]);}}
else if(borders[side].satisfied){owner.setBodyStyle(borderWidthProps[side],'1px');}}
me.borders=borders;},beforeLayoutCycle:function(ownerContext){var me=this,owner=me.owner,shrinkWrap=me.sizeModels.shrinkWrap,shrinkWrapDock=owner.shrinkWrapDock,collapsedHorz,collapsedVert;if(owner.collapsed){if(owner.collapsedVertical()){collapsedVert=true;ownerContext.measureDimensions=1;}else{collapsedHorz=true;ownerContext.measureDimensions=2;}}
ownerContext.collapsedVert=collapsedVert;ownerContext.collapsedHorz=collapsedHorz;if(collapsedVert){ownerContext.heightModel=shrinkWrap;}else if(collapsedHorz){ownerContext.widthModel=shrinkWrap;}
shrinkWrapDock=shrinkWrapDock===true?3:(shrinkWrapDock||0);ownerContext.shrinkWrapDockHeight=(shrinkWrapDock&1)&&ownerContext.heightModel.shrinkWrap;ownerContext.shrinkWrapDockWidth=(shrinkWrapDock&2)&&ownerContext.widthModel.shrinkWrap;},beginLayout:function(ownerContext){var me=this,owner=me.owner,docked=me.getLayoutItems(),layoutContext=ownerContext.context,dockedItemCount=docked.length,dockedItems,i,item,itemContext,offsets,collapsed,dock;me.callParent(arguments);collapsed=owner.getCollapsed();if(collapsed!==me.lastCollapsedState&&Ext.isDefined(me.lastCollapsedState)){if(me.owner.collapsed){ownerContext.isCollapsingOrExpanding=1;owner.addClsWithUI(owner.collapsedCls);}else{ownerContext.isCollapsingOrExpanding=2;owner.removeClsWithUI(owner.collapsedCls);ownerContext.lastCollapsedState=me.lastCollapsedState;}}
me.lastCollapsedState=collapsed;ownerContext.dockedItems=dockedItems=[];for(i=0;i<dockedItemCount;i++){item=docked[i];if(item.rendered){dock=item.dock;itemContext=layoutContext.getCmp(item);itemContext.dockedAt={x:0,y:0};itemContext.offsets=offsets=Ext.Element.parseBox(item.offsets||0);itemContext.horizontal=dock=='top'||dock=='bottom';offsets.width=offsets.left+offsets.right;offsets.height=offsets.top+offsets.bottom;dockedItems.push(itemContext);}}
ownerContext.bodyContext=ownerContext.getEl('body');},beginLayoutCycle:function(ownerContext){var me=this,docked=ownerContext.dockedItems,len=docked.length,owner=me.owner,frameBody=owner.frameBody,lastHeightModel=me.lastHeightModel,i,item,dock;me.callParent(arguments);if(me.owner.manageHeight){if(me.lastBodyDisplay){owner.body.dom.style.display=me.lastBodyDisplay='';}}else{if(me.lastBodyDisplay!=='inline-block'){owner.body.dom.style.display=me.lastBodyDisplay='inline-block';}
if(lastHeightModel&&lastHeightModel.shrinkWrap&&!ownerContext.heightModel.shrinkWrap){owner.body.dom.style.marginBottom='';}}
if(ownerContext.widthModel.auto){if(ownerContext.widthModel.shrinkWrap){owner.el.setWidth(null);}
owner.body.setWidth(null);if(frameBody){frameBody.setWidth(null);}}
if(ownerContext.heightModel.auto){owner.body.setHeight(null);if(frameBody){frameBody.setHeight(null);}}
if(ownerContext.collapsedVert){ownerContext.setContentHeight(0);}else if(ownerContext.collapsedHorz){ownerContext.setContentWidth(0);}
for(i=0;i<len;i++){item=docked[i].target;dock=item.dock;if(dock=='right'){item.setLocalX(0);}else if(dock!='left'){continue;}}},calculate:function(ownerContext){var me=this,measure=me.measureAutoDimensions(ownerContext,ownerContext.measureDimensions),state=ownerContext.state,horzDone=state.horzDone,vertDone=state.vertDone,bodyContext=ownerContext.bodyContext,framing,horz,vert,forward,backward;ownerContext.borderInfo||ownerContext.getBorderInfo();ownerContext.paddingInfo||ownerContext.getPaddingInfo();ownerContext.frameInfo||ownerContext.getFrameInfo();bodyContext.borderInfo||bodyContext.getBorderInfo();bodyContext.paddingInfo||bodyContext.getPaddingInfo();if(!ownerContext.frameBorder){if(!(framing=ownerContext.framing)){ownerContext.frameBorder=ownerContext.borderInfo;ownerContext.framePadding=ownerContext.paddingInfo;}else{ownerContext.frameBorder=framing.border;ownerContext.framePadding=framing.padding;}}
horz=!horzDone&&me.createAxis(ownerContext,measure.contentWidth,ownerContext.widthModel,me.horzAxisProps,ownerContext.collapsedHorz);vert=!vertDone&&me.createAxis(ownerContext,measure.contentHeight,ownerContext.heightModel,me.vertAxisProps,ownerContext.collapsedVert);for(forward=0,backward=ownerContext.dockedItems.length;backward--;++forward){if(horz){me.dockChild(ownerContext,horz,backward,forward);}
if(vert){me.dockChild(ownerContext,vert,backward,forward);}}
if(horz&&me.finishAxis(ownerContext,horz)){state.horzDone=horzDone=horz;}
if(vert&&me.finishAxis(ownerContext,vert)){state.vertDone=vertDone=vert;}
if(horzDone&&vertDone&&me.finishConstraints(ownerContext,horzDone,vertDone)){me.finishPositions(ownerContext,horzDone,vertDone);}else{me.done=false;}},createAxis:function(ownerContext,contentSize,sizeModel,axisProps,collapsedAxis){var me=this,begin=0,owner=me.owner,maxSize=owner[axisProps.maxSize],minSize=owner[axisProps.minSize]||0,dockBegin=axisProps.dockBegin,dockEnd=axisProps.dockEnd,posProp=axisProps.pos,sizeProp=axisProps.size,hasMaxSize=maxSize!=null,shrinkWrap=sizeModel.shrinkWrap,bodyContext,framing,padding,end;if(shrinkWrap){if(collapsedAxis){end=0;}else{bodyContext=ownerContext.bodyContext;end=contentSize+bodyContext.borderInfo[sizeProp];}}else{framing=ownerContext.frameBorder;padding=ownerContext.framePadding;begin=framing[dockBegin]+padding[dockBegin];end=ownerContext.getProp(sizeProp)-(framing[dockEnd]+padding[dockEnd]);}
return{shrinkWrap:sizeModel.shrinkWrap,sizeModel:sizeModel,initialBegin:begin,begin:begin,end:end,collapsed:collapsedAxis,horizontal:axisProps.horizontal,ignoreFrameBegin:null,ignoreFrameEnd:null,initialSize:end-begin,maxChildSize:0,hasMinMaxConstraints:(minSize||hasMaxSize)&&sizeModel.shrinkWrap,minSize:minSize,maxSize:hasMaxSize?maxSize:1e9,bodyPosProp:me.owner.manageHeight?posProp:axisProps.marginBegin,dockBegin:dockBegin,dockEnd:dockEnd,posProp:posProp,sizeProp:sizeProp,setSize:axisProps.setSize,shrinkWrapDock:ownerContext[axisProps.shrinkWrapDock],sizeModelName:axisProps.sizeModel,dockedPixelsEnd:0};},dockChild:function(ownerContext,axis,backward,forward){var me=this,itemContext=ownerContext.dockedItems[axis.shrinkWrap?backward:forward],item=itemContext.target,dock=item.dock,sizeProp=axis.sizeProp,pos,size;if(item.ignoreParentFrame&&ownerContext.isCollapsingOrExpanding){itemContext.clearMarginCache();}
itemContext.marginInfo||itemContext.getMarginInfo();if(dock==axis.dockBegin){if(axis.shrinkWrap){pos=me.dockOutwardBegin(ownerContext,itemContext,item,axis);}else{pos=me.dockInwardBegin(ownerContext,itemContext,item,axis);}}else if(dock==axis.dockEnd){if(axis.shrinkWrap){pos=me.dockOutwardEnd(ownerContext,itemContext,item,axis);}else{pos=me.dockInwardEnd(ownerContext,itemContext,item,axis);}}else{if(axis.shrinkWrapDock){size=itemContext.getProp(sizeProp)+itemContext.marginInfo[sizeProp];axis.maxChildSize=Math.max(axis.maxChildSize,size);pos=0;}else{pos=me.dockStretch(ownerContext,itemContext,item,axis);}}
itemContext.dockedAt[axis.posProp]=pos;},dockInwardBegin:function(ownerContext,itemContext,item,axis){var pos=axis.begin,sizeProp=axis.sizeProp,ignoreParentFrame=item.ignoreParentFrame,delta,size,dock;if(ignoreParentFrame){axis.ignoreFrameBegin=itemContext;dock=item.dock;delta=ownerContext.frameBorder[dock];pos-=delta+ownerContext.framePadding[dock];}
if(!item.overlay){size=itemContext.getProp(sizeProp)+itemContext.marginInfo[sizeProp];axis.begin+=size;if(ignoreParentFrame){axis.begin-=delta;}}
return pos;},dockInwardEnd:function(ownerContext,itemContext,item,axis){var sizeProp=axis.sizeProp,size=itemContext.getProp(sizeProp)+itemContext.marginInfo[sizeProp],pos=axis.end-size,frameEnd;if(!item.overlay){axis.end=pos;}
if(item.ignoreParentFrame){axis.ignoreFrameEnd=itemContext;frameEnd=ownerContext.frameBorder[item.dock];pos+=frameEnd+ownerContext.framePadding[item.dock];axis.end+=frameEnd;}
return pos;},dockOutwardBegin:function(ownerContext,itemContext,item,axis){var pos=axis.begin,sizeProp=axis.sizeProp,size;if(axis.collapsed){axis.ignoreFrameBegin=axis.ignoreFrameEnd=itemContext;}else if(item.ignoreParentFrame){axis.ignoreFrameBegin=itemContext;}
if(!item.overlay){size=itemContext.getProp(sizeProp)+itemContext.marginInfo[sizeProp];pos-=size;axis.begin=pos;}
return pos;},dockOutwardEnd:function(ownerContext,itemContext,item,axis){var pos=axis.end,sizeProp=axis.sizeProp,size;size=itemContext.getProp(sizeProp)+itemContext.marginInfo[sizeProp];if(axis.collapsed){axis.ignoreFrameBegin=axis.ignoreFrameEnd=itemContext;}else if(item.ignoreParentFrame){axis.ignoreFrameEnd=itemContext;}
if(!item.overlay){axis.end=pos+size;axis.dockedPixelsEnd+=size;}
return pos;},dockStretch:function(ownerContext,itemContext,item,axis){var dock=item.dock,sizeProp=axis.sizeProp,horizontal=dock=='top'||dock=='bottom',border=ownerContext.frameBorder,offsets=itemContext.offsets,padding=ownerContext.framePadding,endProp=horizontal?'right':'bottom',startProp=horizontal?'left':'top',pos=axis.begin+offsets[startProp],margin,size;if(item.stretch!==false){size=axis.end-pos-offsets[endProp];if(item.ignoreParentFrame){pos-=padding[startProp]+border[startProp];size+=padding[sizeProp]+border[sizeProp];}
margin=itemContext.marginInfo;size-=margin[sizeProp];itemContext[axis.setSize](size);}
return pos;},finishAxis:function(ownerContext,axis){if(isNaN(axis.maxChildSize)){return false;}
var axisBegin=axis.begin,size=axis.end-axisBegin,collapsed=axis.collapsed,setSizeMethod=axis.setSize,beginName=axis.dockBegin,endName=axis.dockEnd,padding=ownerContext.framePadding,border=ownerContext.frameBorder,borderBegin=border[beginName],framing=ownerContext.framing,framingBegin=framing&&framing[beginName],paddingBegin=collapsed?0:padding[beginName],sizeProp=axis.sizeProp,ignoreFrameBegin=axis.ignoreFrameBegin,ignoreFrameEnd=axis.ignoreFrameEnd,bodyContext=ownerContext.bodyContext,extraPaddingBegin=Math.max(borderBegin+paddingBegin-framingBegin,0),bodyPos,bodySize,delta,dirty;if(axis.shrinkWrap){bodySize=axis.initialSize;if(framing){delta=-axisBegin+borderBegin+paddingBegin;bodyPos=delta-framingBegin-extraPaddingBegin;}else{bodyPos=-axisBegin;delta=bodyPos+paddingBegin;}
if(!collapsed){size+=padding[sizeProp];}
if(ignoreFrameBegin){delta-=borderBegin;bodyPos-=borderBegin;ignoreFrameBegin.dockedAt[axis.posProp]-=paddingBegin;}else{size+=borderBegin;}
if(collapsed){}else if(ignoreFrameEnd){ignoreFrameEnd.dockedAt[axis.posProp]+=padding[endName];}else{size+=border[endName];}
axis.size=size;if(!axis.horizontal&&!this.owner.manageHeight){dirty=false;}}else{if(framing){delta=0;bodyPos=axisBegin-framingBegin-extraPaddingBegin;}else{delta=-borderBegin;bodyPos=axisBegin-paddingBegin-borderBegin;}
bodySize=size;}
axis.delta=delta;bodyContext[setSizeMethod](bodySize,dirty);bodyContext.setProp(axis.bodyPosProp,bodyPos);return!isNaN(size);},beforeInvalidateShrinkWrapDock:function(itemContext,options){var sizeModelName=options.axis.sizeModelName;if(!itemContext[sizeModelName].constrainedMin){itemContext[sizeModelName]=Ext.layout.SizeModel.calculated;}},afterInvalidateShrinkWrapDock:function(itemContext,options){var axis=options.axis,me=options.layout,pos;if(itemContext[axis.sizeModelName].calculated){pos=me.dockStretch(options.ownerContext,itemContext,itemContext.target,axis);itemContext.setProp(axis.posProp,axis.delta+pos);}},finishConstraints:function(ownerContext,horz,vert){var me=this,sizeModels=me.sizeModels,publishWidth=horz.shrinkWrap,publishHeight=vert.shrinkWrap,owner=me.owner,dirty,height,width,heightModel,widthModel,size,minSize,maxSize,maxChildSize,desiredSize;if(publishWidth){size=horz.size;minSize=horz.collapsed?0:horz.minSize;maxSize=horz.maxSize;maxChildSize=horz.maxChildSize;desiredSize=Math.max(size,maxChildSize);if(desiredSize>maxSize){widthModel=sizeModels.constrainedMax;width=maxSize;}else if(desiredSize<minSize){widthModel=sizeModels.constrainedMin;width=minSize;}else if(size<maxChildSize){widthModel=sizeModels.constrainedDock;owner.dockConstrainedWidth=width=maxChildSize;}else{width=size;}}
if(publishHeight){size=vert.size;minSize=vert.collapsed?0:vert.minSize;maxSize=vert.maxSize;maxChildSize=vert.maxChildSize;desiredSize=Math.max(size,maxChildSize+size-vert.initialSize);if(desiredSize>maxSize){heightModel=sizeModels.constrainedMax;height=maxSize;}else if(desiredSize<minSize){heightModel=sizeModels.constrainedMin;height=minSize;}else if(size<maxChildSize){heightModel=sizeModels.constrainedDock;owner.dockConstrainedHeight=height=maxChildSize;}else{if(!ownerContext.collapsedVert&&!owner.manageHeight){dirty=false;ownerContext.bodyContext.setProp('margin-bottom',vert.dockedPixelsEnd);}
height=size;}}
if(widthModel||heightModel){if(widthModel&&heightModel&&widthModel.constrainedMax&&heightModel.constrainedByMin){ownerContext.invalidate({widthModel:widthModel});return false;}
if(!ownerContext.widthModel.calculatedFromShrinkWrap&&!ownerContext.heightModel.calculatedFromShrinkWrap){ownerContext.invalidate({widthModel:widthModel,heightModel:heightModel});return false;}}else{me.invalidateAxes(ownerContext,horz,vert);}
if(publishWidth){ownerContext.setWidth(width);if(widthModel){ownerContext.widthModel=widthModel;}}
if(publishHeight){ownerContext.setHeight(height,dirty);if(heightModel){ownerContext.heightModel=heightModel;}}
return true;},invalidateAxes:function(ownerContext,horz,vert){var before=this.beforeInvalidateShrinkWrapDock,after=this.afterInvalidateShrinkWrapDock,horzSize=horz.end-horz.begin,vertSize=vert.initialSize,invalidateHorz=horz.shrinkWrapDock&&horz.maxChildSize<horzSize,invalidateVert=vert.shrinkWrapDock&&vert.maxChildSize<vertSize,dockedItems,len,i,itemContext,itemSize,isHorz,axis,sizeProp;if(invalidateHorz||invalidateVert){if(invalidateVert){vert.begin=vert.initialBegin;vert.end=vert.begin+vert.initialSize;}
dockedItems=ownerContext.dockedItems;for(i=0,len=dockedItems.length;i<len;++i){itemContext=dockedItems[i];isHorz=itemContext.horizontal;axis=null;if(invalidateHorz&&isHorz){sizeProp=horz.sizeProp;itemSize=horzSize;axis=horz;}else if(invalidateVert&&!isHorz){sizeProp=vert.sizeProp;itemSize=vertSize;axis=vert;}
if(axis){itemSize-=itemContext.getMarginInfo()[sizeProp];if(itemSize!==itemContext.props[sizeProp]){itemContext.invalidate({before:before,after:after,axis:axis,ownerContext:ownerContext,layout:this});}}}}},finishPositions:function(ownerContext,horz,vert){var dockedItems=ownerContext.dockedItems,length=dockedItems.length,deltaX=horz.delta,deltaY=vert.delta,index,itemContext;for(index=0;index<length;++index){itemContext=dockedItems[index];itemContext.setProp('x',deltaX+itemContext.dockedAt.x);itemContext.setProp('y',deltaY+itemContext.dockedAt.y);}},finishedLayout:function(ownerContext){var me=this,target=ownerContext.target;me.callParent(arguments);if(!ownerContext.animatePolicy){if(ownerContext.isCollapsingOrExpanding===1){target.afterCollapse(false);}else if(ownerContext.isCollapsingOrExpanding===2){target.afterExpand(false);}}},getAnimatePolicy:function(ownerContext){var me=this,lastCollapsedState,policy;if(ownerContext.isCollapsingOrExpanding==1){lastCollapsedState=me.lastCollapsedState;}else if(ownerContext.isCollapsingOrExpanding==2){lastCollapsedState=ownerContext.lastCollapsedState;}
if(lastCollapsedState=='left'||lastCollapsedState=='right'){policy=me.horizontalCollapsePolicy;}else if(lastCollapsedState=='top'||lastCollapsedState=='bottom'){policy=me.verticalCollapsePolicy;}
return policy;},getDockedItems:function(order,beforeBody){var me=this,renderedOnly=(order==='visual'),all=renderedOnly?Ext.ComponentQuery.query('[rendered]',me.owner.dockedItems.items):me.owner.dockedItems.items,sort=all&&all.length&&order!==false,renderOrder,dock,dockedItems,i,isBefore,length;if(beforeBody==null){dockedItems=sort&&!renderedOnly?all.slice():all;}else{dockedItems=[];for(i=0,length=all.length;i<length;++i){dock=all[i].dock;isBefore=(dock=='top'||dock=='left');if(beforeBody?isBefore:!isBefore){dockedItems.push(all[i]);}}
sort=sort&&dockedItems.length;}
if(sort){renderOrder=(order=order||'render')=='render';Ext.Array.sort(dockedItems,function(a,b){var aw,bw;if(renderOrder&&((aw=me.owner.dockOrder[a.dock])!==(bw=me.owner.dockOrder[b.dock]))){if(!(aw+bw)){return aw-bw;}}
aw=me.getItemWeight(a,order);bw=me.getItemWeight(b,order);if((aw!==undefined)&&(bw!==undefined)){return aw-bw;}
return 0;});}
return dockedItems||[];},getItemWeight:function(item,order){var weight=item.weight||this.owner.defaultDockWeights[item.dock];return weight[order]||weight;},getLayoutItems:function(){var me=this,items,itemCount,item,i,result;if(me.owner.collapsed){result=me.owner.getCollapsedDockedItems();}else{items=me.getDockedItems('visual');itemCount=items.length;result=[];for(i=0;i<itemCount;i++){item=items[i];if(!item.hidden){result.push(item);}}}
return result;},measureContentWidth:function(ownerContext){var bodyContext=ownerContext.bodyContext;return bodyContext.el.getWidth()-bodyContext.getBorderInfo().width;},measureContentHeight:function(ownerContext){var bodyContext=ownerContext.bodyContext;return bodyContext.el.getHeight()-bodyContext.getBorderInfo().height;},redoLayout:function(ownerContext){var me=this,owner=me.owner;if(ownerContext.isCollapsingOrExpanding==1){if(owner.reExpander){owner.reExpander.el.show();}
owner.addClsWithUI(owner.collapsedCls);ownerContext.redo(true);}else if(ownerContext.isCollapsingOrExpanding==2){owner.removeClsWithUI(owner.collapsedCls);ownerContext.bodyContext.redo();}},renderChildren:function(){var me=this,items=me.getDockedItems(),target=me.getRenderTarget();me.handleItemBorders();me.renderItems(items,target);},renderItems:function(items,target){var me=this,dockedItemCount=items.length,itemIndex=0,correctPosition=0,staticNodeCount=0,targetNodes=me.getRenderTarget().dom.childNodes,targetChildCount=targetNodes.length,i,j,targetChildNode,item;for(i=0,j=0;i<targetChildCount;i++){targetChildNode=targetNodes[i];if(Ext.fly(targetChildNode).hasCls(Ext.baseCSSPrefix+'resizable-handle')){break;}
for(j=0;j<dockedItemCount;j++){item=items[j];if(item.rendered&&item.el.dom===targetChildNode){break;}}
if(j===dockedItemCount){staticNodeCount++;}}
for(;itemIndex<dockedItemCount;itemIndex++,correctPosition++){item=items[itemIndex];if(itemIndex===correctPosition&&(item.dock==='right'||item.dock==='bottom')){correctPosition+=staticNodeCount;}
if(item&&!item.rendered){me.renderItem(item,target,correctPosition);}
else if(!me.isValidParent(item,target,correctPosition)){me.moveItem(item,target,correctPosition);}}},undoLayout:function(ownerContext){var me=this,owner=me.owner;if(ownerContext.isCollapsingOrExpanding==1){if(owner.reExpander){owner.reExpander.el.hide();}
owner.removeClsWithUI(owner.collapsedCls);ownerContext.undo(true);}else if(ownerContext.isCollapsingOrExpanding==2){owner.addClsWithUI(owner.collapsedCls);ownerContext.bodyContext.undo();}},sizePolicy:{nostretch:{setsWidth:0,setsHeight:0},horz:{shrinkWrap:{setsWidth:1,setsHeight:0,readsWidth:1},stretch:{setsWidth:1,setsHeight:0}},vert:{shrinkWrap:{setsWidth:0,setsHeight:1,readsHeight:1},stretch:{setsWidth:0,setsHeight:1}},stretchV:{setsWidth:0,setsHeight:1},autoStretchH:{readsWidth:1,setsWidth:1,setsHeight:0},autoStretchV:{readsHeight:1,setsWidth:0,setsHeight:1}},getItemSizePolicy:function(item,ownerSizeModel){var me=this,policy=me.sizePolicy,shrinkWrapDock=me.owner.shrinkWrapDock,dock,vertical;if(item.stretch===false){return policy.nostretch;}
dock=item.dock;vertical=(dock=='left'||dock=='right');shrinkWrapDock=shrinkWrapDock===true?3:(shrinkWrapDock||0);if(vertical){policy=policy.vert;shrinkWrapDock=shrinkWrapDock&1;}else{policy=policy.horz;shrinkWrapDock=shrinkWrapDock&2;}
if(shrinkWrapDock){if(!ownerSizeModel){ownerSizeModel=me.owner.getSizeModel();}
if(ownerSizeModel[vertical?'height':'width'].shrinkWrap){return policy.shrinkWrap;}}
return policy.stretch;},configureItem:function(item,pos){this.callParent(arguments);item.addCls(Ext.baseCSSPrefix+'docked');item.addClsWithUI(this.getDockCls(item.dock));},getDockCls:function(dock){return'docked-'+dock;},afterRemove:function(item){this.callParent(arguments);if(this.itemCls){item.el.removeCls(this.itemCls+'-'+item.dock);}
var dom=item.el.dom;if(!item.destroying&&dom){dom.parentNode.removeChild(dom);}
this.childrenChanged=true;},borderCollapseMap:{},getBorderCollapseTable:function(){var me=this,map=me.borderCollapseMap,owner=me.owner,baseCls=owner.baseCls,ui=owner.ui,table;map=map[baseCls]||(map[baseCls]={});table=map[ui];if(!table){baseCls+='-'+ui+'-outer-border-';map[ui]=table=[0,baseCls+'l',baseCls+'b',baseCls+'bl',baseCls+'r',baseCls+'rl',baseCls+'rb',baseCls+'rbl',baseCls+'t',baseCls+'tl',baseCls+'tb',baseCls+'tbl',baseCls+'tr',baseCls+'trl',baseCls+'trb',baseCls+'trbl'];}
return table;}});Ext.define('Ext.data.NodeInterface',{requires:['Ext.data.Field','Ext.data.writer.Json'],statics:{decorate:function(modelClass){var idName,idField,idType;if(typeof modelClass=='string'){modelClass=Ext.ModelManager.getModel(modelClass);}else if(modelClass.isModel){modelClass=Ext.ModelManager.getModel(modelClass.modelName);}
if(modelClass.prototype.isNode){return;}
idName=modelClass.prototype.idProperty;idField=modelClass.prototype.fields.get(idName);idType=modelClass.prototype.fields.get(idName).type.type;modelClass.override(this.getPrototypeBody());this.applyFields(modelClass,[{name:'parentId',type:idType,defaultValue:null,useNull:idField.useNull},{name:'index',type:'int',defaultValue:0,persist:false,convert:null},{name:'depth',type:'int',defaultValue:0,persist:false,convert:null},{name:'expanded',type:'bool',defaultValue:false,persist:false,convert:null},{name:'expandable',type:'bool',defaultValue:true,persist:false,convert:null},{name:'checked',type:'auto',defaultValue:null,persist:false,convert:null},{name:'leaf',type:'bool',defaultValue:false},{name:'cls',type:'string',defaultValue:'',persist:false,convert:null},{name:'iconCls',type:'string',defaultValue:'',persist:false,convert:null},{name:'icon',type:'string',defaultValue:'',persist:false,convert:null},{name:'root',type:'boolean',defaultValue:false,persist:false,convert:null},{name:'isLast',type:'boolean',defaultValue:false,persist:false,convert:null},{name:'isFirst',type:'boolean',defaultValue:false,persist:false,convert:null},{name:'allowDrop',type:'boolean',defaultValue:true,persist:false,convert:null},{name:'allowDrag',type:'boolean',defaultValue:true,persist:false,convert:null},{name:'loaded',type:'boolean',defaultValue:false,persist:false,convert:null},{name:'loading',type:'boolean',defaultValue:false,persist:false,convert:null},{name:'href',type:'string',defaultValue:'',persist:false,convert:null},{name:'hrefTarget',type:'string',defaultValue:'',persist:false,convert:null},{name:'qtip',type:'string',defaultValue:'',persist:false,convert:null},{name:'qtitle',type:'string',defaultValue:'',persist:false,convert:null},{name:'qshowDelay',type:'int',defaultValue:0,persist:false,convert:null},{name:'children',type:'auto',defaultValue:null,persist:false,convert:null}]);},applyFields:function(modelClass,addFields){var modelPrototype=modelClass.prototype,fields=modelPrototype.fields,keys=fields.keys,ln=addFields.length,addField,i;for(i=0;i<ln;i++){addField=addFields[i];if(!Ext.Array.contains(keys,addField.name)){fields.add(new Ext.data.Field(addField));}}},getPrototypeBody:function(){var bubbledEvents={idchanged:true,append:true,remove:true,move:true,insert:true,beforeappend:true,beforeremove:true,beforemove:true,beforeinsert:true,expand:true,collapse:true,beforeexpand:true,beforecollapse:true,sort:true,rootchange:true};return{isNode:true,constructor:function(){var me=this;me.callParent(arguments);me.firstChild=me.lastChild=me.parentNode=me.previousSibling=me.nextSibling=null;me.childNodes=[];return me;},createNode:function(node){if(!node.isModel){node=Ext.ModelManager.create(node,this.modelName);}
if(!node.childNodes){node.firstChild=node.lastChild=node.parentNode=node.previousSibling=node.nextSibling=null;node.childNodes=[];}
return node;},isLeaf:function(){return this.get('leaf')===true;},setFirstChild:function(node){this.firstChild=node;},setLastChild:function(node){this.lastChild=node;},updateInfo:function(commit,info){var me=this,oldDepth=me.data.depth,childInfo={},children=me.childNodes,childCount=children.length,i,phantom=me.phantom,dataObject=me[me.persistenceProperty],propName,newValue,field;if(!info){Ext.Error.raise('NodeInterface expects update info to be passed');}
for(propName in info){field=me.fields.get(propName);newValue=info[propName];if(field&&field.persist){me.dirty=me.dirty||!me.isEqual(dataObject[propName],newValue);}
dataObject[propName]=newValue;}
if(commit){me.commit();me.phantom=phantom;}
if(me.data.depth!==oldDepth){childInfo={depth:me.data.depth+1};for(i=0;i<childCount;i++){children[i].updateInfo(commit,childInfo);}}},isLast:function(){return this.get('isLast');},isFirst:function(){return this.get('isFirst');},hasChildNodes:function(){return!this.isLeaf()&&this.childNodes.length>0;},isExpandable:function(){var me=this;if(me.get('expandable')){return!(me.isLeaf()||(me.isLoaded()&&!me.hasChildNodes()));}
return false;},triggerUIUpdate:function(){this.afterEdit([]);},appendChild:function(node,suppressEvents,commit){var me=this,i,ln,index,oldParent,previousSibling,childInfo={isLast:true,parentId:me.getId(),depth:(me.data.depth||0)+1};if(Ext.isArray(node)){me.callStore('suspendAutoSync');for(i=0,ln=node.length-1;i<ln;i++){me.appendChild(node[i],suppressEvents,commit);}
me.callStore('resumeAutoSync');me.appendChild(node[ln],suppressEvents,commit);}else{node=me.createNode(node);if(suppressEvents!==true&&me.fireEventArgs("beforeappend",[me,node])===false){return false;}
index=me.childNodes.length;oldParent=node.parentNode;if(oldParent){if(suppressEvents!==true&&node.fireEventArgs("beforemove",[node,oldParent,me,index])===false){return false;}
oldParent.removeChild(node,false,false,true);}
Ext.suspendLayouts();index=me.childNodes.length;if(index===0){me.setFirstChild(node);}
me.childNodes[index]=node;node.parentNode=me;node.nextSibling=null;me.setLastChild(node);previousSibling=me.childNodes[index-1];if(previousSibling){node.previousSibling=previousSibling;previousSibling.nextSibling=node;previousSibling.updateInfo(commit,{isLast:false});previousSibling.triggerUIUpdate();}else{node.previousSibling=null;}
childInfo.isFirst=index===0;childInfo.index=index;node.updateInfo(commit,childInfo);if(!me.isLoaded()){me.set('loaded',true);}else if(me.childNodes.length===1){me.triggerUIUpdate();}
if(index&&me.childNodes[index-1].isExpanded()){me.childNodes[index-1].cascadeBy(me.triggerUIUpdate);}
if(!node.isLeaf()&&node.phantom){node.set('loaded',true);}
Ext.resumeLayouts(true);if(suppressEvents!==true){me.fireEventArgs("append",[me,node,index]);if(oldParent){node.fireEventArgs("move",[node,oldParent,me,index]);}}
return node;}},getOwnerTree:function(){var node=this,store;while(node.parentNode){node=node.parentNode;}
store=node.store;if(store){if(store.treeStore){store=store.treeStore;}
if(store.tree){return store.ownerTree;}}
return undefined;},removeChild:function(node,destroy,suppressEvents,isMove){var me=this,index=me.indexOf(node),i,childCount,previousSibling;if(index===-1||(suppressEvents!==true&&me.fireEventArgs("beforeremove",[me,node,!!isMove])===false)){return false;}
Ext.suspendLayouts();Ext.Array.erase(me.childNodes,index,1);if(me.firstChild===node){me.setFirstChild(node.nextSibling);}
if(me.lastChild===node){me.setLastChild(node.previousSibling);}
if(previousSibling=node.previousSibling){node.previousSibling.nextSibling=node.nextSibling;}
if(node.nextSibling){node.nextSibling.previousSibling=node.previousSibling;if(index===0){node.nextSibling.updateInfo(false,{isFirst:true});}
for(i=index,childCount=me.childNodes.length;i<childCount;i++){me.childNodes[i].updateInfo(false,{index:i});}}
else if(previousSibling){previousSibling.updateInfo(false,{isLast:true});if(previousSibling.isExpanded()){previousSibling.cascadeBy(me.triggerUIUpdate);}
else{previousSibling.triggerUIUpdate();}}
if(!me.childNodes.length){me.triggerUIUpdate();}
Ext.resumeLayouts(true);if(suppressEvents!==true){node.removeContext={parentNode:node.parentNode,previousSibling:node.previousSibling,nextSibling:node.nextSibling};node.previousSibling=node.nextSibling=node.parentNode=null;me.fireEventArgs('remove',[me,node,!!isMove]);node.removeContext=null;}
if(destroy){node.destroy(true);}else{node.clear();}
return node;},copy:function(newId,deep){var me=this,result=me.callParent(arguments),len=me.childNodes?me.childNodes.length:0,i;if(deep){for(i=0;i<len;i++){result.appendChild(me.childNodes[i].copy(undefined,true));}}
return result;},clear:function(destroy){var me=this;me.parentNode=me.previousSibling=me.nextSibling=null;if(destroy){me.firstChild=me.lastChild=null;}},destroy:function(silent){var me=this,options=me.destroyOptions,nodes=me.childNodes,nLen=nodes.length,n;if(silent===true){me.clear(true);for(n=0;n<nLen;n++){nodes[n].destroy(true);}
me.childNodes=null;delete me.destroyOptions;me.callParent([options]);}else{me.destroyOptions=silent;me.remove(true);}},insertBefore:function(node,refNode,suppressEvents){var me=this,index=me.indexOf(refNode),oldParent=node.parentNode,refIndex=index,childCount,previousSibling,i;if(!refNode){return me.appendChild(node);}
if(node===refNode){return false;}
node=me.createNode(node);if(suppressEvents!==true&&me.fireEventArgs("beforeinsert",[me,node,refNode])===false){return false;}
if(oldParent===me&&me.indexOf(node)<index){refIndex--;}
if(oldParent){if(suppressEvents!==true&&node.fireEventArgs("beforemove",[node,oldParent,me,index,refNode])===false){return false;}
oldParent.removeChild(node,false,false,true);}
if(refIndex===0){me.setFirstChild(node);}
Ext.Array.splice(me.childNodes,refIndex,0,node);node.parentNode=me;node.nextSibling=refNode;refNode.previousSibling=node;previousSibling=me.childNodes[refIndex-1];if(previousSibling){node.previousSibling=previousSibling;previousSibling.nextSibling=node;}else{node.previousSibling=null;}
node.updateInfo(false,{parentId:me.getId(),index:refIndex,isFirst:refIndex===0,isLast:false,depth:(me.data.depth||0)+1});for(i=refIndex+1,childCount=me.childNodes.length;i<childCount;i++){me.childNodes[i].updateInfo(false,{index:i});}
if(!me.isLoaded()){me.set('loaded',true);}
else if(me.childNodes.length===1){me.triggerUIUpdate();}
if(!node.isLeaf()&&node.phantom){node.set('loaded',true);}
if(suppressEvents!==true){me.fireEventArgs("insert",[me,node,refNode]);if(oldParent){node.fireEventArgs("move",[node,oldParent,me,refIndex,refNode]);}}
return node;},insertChild:function(index,node){var sibling=this.childNodes[index];if(sibling){return this.insertBefore(node,sibling);}
else{return this.appendChild(node);}},remove:function(destroy,suppressEvents){var me=this,parentNode=me.parentNode;if(parentNode){parentNode.removeChild(me,destroy,suppressEvents);}else if(destroy){me.destroy(true);}
return me;},removeAll:function(destroy,suppressEvents,fromParent){var me=this,childNodes=me.childNodes,i=0,len=childNodes.length,node;if(!len){return;}
me.fireEventArgs('bulkremove',[me,childNodes,false]);for(;i<len;++i){node=childNodes[i];node.removeContext={parentNode:node.parentNode,previousSibling:node.previousSibling,nextSibling:node.nextSibling};node.previousSibling=node.nextSibling=node.parentNode=null;me.fireEventArgs('remove',[me,node,false]);node.removeContext=null;if(destroy){node.destroy(true);}
else{node.removeAll(false,suppressEvents,true);}}
me.firstChild=me.lastChild=null;if(fromParent){me.childNodes=null;}else{me.childNodes.length=0;me.triggerUIUpdate();}
return me;},getChildAt:function(index){return this.childNodes[index];},replaceChild:function(newChild,oldChild,suppressEvents){var s=oldChild?oldChild.nextSibling:null;this.removeChild(oldChild,false,suppressEvents);this.insertBefore(newChild,s,suppressEvents);return oldChild;},indexOf:function(child){return Ext.Array.indexOf(this.childNodes,child);},indexOfId:function(id){var childNodes=this.childNodes,len=childNodes.length,i=0;for(;i<len;++i){if(childNodes[i].getId()===id){return i;}}
return-1;},getPath:function(field,separator){field=field||this.idProperty;separator=separator||'/';var path=[this.get(field)],parent=this.parentNode;while(parent){path.unshift(parent.get(field));parent=parent.parentNode;}
return separator+path.join(separator);},getDepth:function(){return this.get('depth');},bubble:function(fn,scope,args){var p=this;while(p){if(fn.apply(scope||p,args||[p])===false){break;}
p=p.parentNode;}},cascade:function(){if(Ext.isDefined(Ext.global.console)){Ext.global.console.warn('Ext.data.Node: cascade has been deprecated. Please use cascadeBy instead.');}
return this.cascadeBy.apply(this,arguments);},cascadeBy:function(fn,scope,args){if(fn.apply(scope||this,args||[this])!==false){var childNodes=this.childNodes,length=childNodes.length,i;for(i=0;i<length;i++){childNodes[i].cascadeBy(fn,scope,args);}}},eachChild:function(fn,scope,args){var childNodes=this.childNodes,length=childNodes.length,i;for(i=0;i<length;i++){if(fn.apply(scope||this,args||[childNodes[i]])===false){break;}}},findChild:function(attribute,value,deep){return this.findChildBy(function(){return this.get(attribute)==value;},null,deep);},findChildBy:function(fn,scope,deep){var cs=this.childNodes,len=cs.length,i=0,n,res;for(;i<len;i++){n=cs[i];if(fn.call(scope||n,n)===true){return n;}
else if(deep){res=n.findChildBy(fn,scope,deep);if(res!==null){return res;}}}
return null;},contains:function(node){return node.isAncestor(this);},isAncestor:function(node){var p=this.parentNode;while(p){if(p===node){return true;}
p=p.parentNode;}
return false;},sort:function(sortFn,recursive,suppressEvent){var cs=this.childNodes,ln=cs.length,i,n,info={isFirst:true};if(ln>0){Ext.Array.sort(cs,sortFn);this.setFirstChild(cs[0]);this.setLastChild(cs[ln-1]);for(i=0;i<ln;i++){n=cs[i];n.previousSibling=cs[i-1];n.nextSibling=cs[i+1];info.isLast=(i===ln-1);info.index=i;n.updateInfo(false,info);info.isFirst=false;if(recursive&&!n.isLeaf()){n.sort(sortFn,true,true);}}
if(suppressEvent!==true){this.fireEventArgs('sort',[this,cs]);}}},isExpanded:function(){return this.get('expanded');},isLoaded:function(){return this.get('loaded');},isLoading:function(){return this.get('loading');},isRoot:function(){return!this.parentNode;},isVisible:function(){var parent=this.parentNode;while(parent){if(!parent.isExpanded()){return false;}
parent=parent.parentNode;}
return true;},expand:function(recursive,callback,scope){var me=this,owner;if(!me.isLeaf()){if(me.isLoading()){me.on('expand',function(){me.expand(recursive,callback,scope);},me,{single:true});}else{if(!me.isExpanded()){me.fireEventArgs('beforeexpand',[me,me.onChildNodesAvailable,me,[recursive,callback,scope]]);}else if(recursive){owner=me.getOwnerTree();me.expandChildren(true,owner?owner.singleExpand:false,callback,scope);}else{Ext.callback(callback,scope||me,[me.childNodes]);}}}else{Ext.callback(callback,scope||me);}},onChildNodesAvailable:function(records,recursive,callback,scope){var me=this,owner;Ext.suspendLayouts();me.set('expanded',true);me.fireEventArgs('expand',[me,me.childNodes,false]);if(recursive){owner=me.getOwnerTree();me.expandChildren(true,owner?owner.singleExpand:false,callback,scope);}else{Ext.callback(callback,scope||me,[me.childNodes]);}
Ext.resumeLayouts(true);},expandChildren:function(recursive,singleExpand,callback,scope){var me=this,i,allNodes=me.childNodes,expandNodes=[],ln=singleExpand?Math.min(allNodes.length,1):allNodes.length,node;for(i=0;i<ln;++i){node=allNodes[i];if(!node.isLeaf()){expandNodes[expandNodes.length]=node;}}
ln=expandNodes.length;for(i=0;i<ln;++i){expandNodes[i].expand(recursive);}
if(callback){Ext.callback(callback,scope||me,[me.childNodes]);}},collapse:function(recursive,callback,scope){var me=this,expanded=me.isExpanded(),len=me.childNodes.length,i,collapseChildren;if(!me.isLeaf()&&((!expanded&&recursive)||me.fireEventArgs('beforecollapse',[me])!==false)){Ext.suspendLayouts();if(me.isExpanded()){if(recursive){collapseChildren=function(){for(i=0;i<len;i++){me.childNodes[i].setCollapsed(true);}};if(callback){callback=Ext.Function.createSequence(collapseChildren,callback);}else{callback=collapseChildren;}}
me.set('expanded',false);me.fireEventArgs('collapse',[me,me.childNodes,false,callback?Ext.Function.bind(callback,scope,[me.childNodes]):null,null]);callback=null;}
else if(recursive){for(i=0;i<len;i++){me.childNodes[i].setCollapsed(true);}}
Ext.resumeLayouts(true);}
Ext.callback(callback,scope||me,[me.childNodes]);},setCollapsed:function(recursive){var me=this,len=me.childNodes.length,i;if(!me.isLeaf()&&me.fireEventArgs('beforecollapse',[me,Ext.emptyFn])!==false){me.data.expanded=false;me.fireEventArgs('collapse',[me,me.childNodes,false,null,null]);if(recursive){for(i=0;i<len;i++){me.childNodes[i].setCollapsed(true);}}}},collapseChildren:function(recursive,callback,scope){var me=this,i,allNodes=me.childNodes,ln=allNodes.length,collapseNodes=[],node;for(i=0;i<ln;++i){node=allNodes[i];if(!node.isLeaf()&&node.isLoaded()&&node.isExpanded()){collapseNodes.push(node);}}
ln=collapseNodes.length;for(i=0;i<ln;++i){node=collapseNodes[i];if(i===ln-1){node.collapse(recursive,callback,scope);}else{node.collapse(recursive);}}},fireEventArgs:function(eventName,args){var fireEventArgs=Ext.data.Model.prototype.fireEventArgs,result,eventSource,tree,treeStore,rootNode;if(bubbledEvents[eventName]){for(eventSource=this;result!==false&&eventSource;eventSource=(rootNode=eventSource).parentNode){if(eventSource.hasListeners[eventName]){result=fireEventArgs.call(eventSource,eventName,args);}}
tree=rootNode.rootOf;if(result!==false&&tree){treeStore=tree.treeStore;if(treeStore&&treeStore.hasListeners[eventName]){result=treeStore.fireEventArgs.call(treeStore,eventName,args);}
if(result!==false&&tree.hasListeners[eventName]){result=tree.fireEventArgs.call(tree,eventName,args);}}
return result;}
else{return fireEventArgs.apply(this,arguments)}},serialize:function(){var result=Ext.data.writer.Json.prototype.getRecordData(this),childNodes=this.childNodes,len=childNodes.length,children,i;if(len>0){children=[];for(i=0;i<len;i++){children.push(childNodes[i].serialize());}
result.children=children;}
return result;}};}}});Ext.define('Ext.layout.component.Auto',{alias:'layout.autocomponent',extend:'Ext.layout.component.Component',type:'autocomponent',setHeightInDom:false,setWidthInDom:false,waitForOuterHeightInDom:false,waitForOuterWidthInDom:false,beginLayoutCycle:function(ownerContext,firstCycle){var me=this,lastWidthModel=me.lastWidthModel,lastHeightModel=me.lastHeightModel,el=me.owner.el;me.callParent(arguments);if(lastWidthModel&&lastWidthModel.fixed&&ownerContext.widthModel.shrinkWrap){el.setWidth(null);}
if(lastHeightModel&&lastHeightModel.fixed&&ownerContext.heightModel.shrinkWrap){el.setHeight(null);}},calculate:function(ownerContext){var me=this,measurement=me.measureAutoDimensions(ownerContext),heightModel=ownerContext.heightModel,widthModel=ownerContext.widthModel,width,height;if(measurement.gotWidth){if(widthModel.shrinkWrap){me.publishOwnerWidth(ownerContext,measurement.contentWidth);}else if(me.publishInnerWidth){me.publishInnerWidth(ownerContext,measurement.width);}}else if(!widthModel.auto&&me.publishInnerWidth){width=me.waitForOuterWidthInDom?ownerContext.getDomProp('width'):ownerContext.getProp('width');if(width===undefined){me.done=false;}else{me.publishInnerWidth(ownerContext,width);}}
if(measurement.gotHeight){if(heightModel.shrinkWrap){me.publishOwnerHeight(ownerContext,measurement.contentHeight);}else if(me.publishInnerHeight){me.publishInnerHeight(ownerContext,measurement.height);}}else if(!heightModel.auto&&me.publishInnerHeight){height=me.waitForOuterHeightInDom?ownerContext.getDomProp('height'):ownerContext.getProp('height');if(height===undefined){me.done=false;}else{me.publishInnerHeight(ownerContext,height);}}
if(!measurement.gotAll){me.done=false;}},calculateOwnerHeightFromContentHeight:function(ownerContext,contentHeight){return contentHeight+ownerContext.getFrameInfo().height;},calculateOwnerWidthFromContentWidth:function(ownerContext,contentWidth){return contentWidth+ownerContext.getFrameInfo().width;},publishOwnerHeight:function(ownerContext,contentHeight){var me=this,owner=me.owner,height=me.calculateOwnerHeightFromContentHeight(ownerContext,contentHeight),constrainedHeight,dirty,heightModel;if(isNaN(height)){me.done=false;}else{constrainedHeight=Ext.Number.constrain(height,owner.minHeight,owner.maxHeight);if(constrainedHeight==height){dirty=me.setHeightInDom;}else{heightModel=me.sizeModels[(constrainedHeight<height)?'constrainedMax':'constrainedMin'];height=constrainedHeight;if(ownerContext.heightModel.calculatedFromShrinkWrap){ownerContext.heightModel=heightModel;}else{ownerContext.invalidate({heightModel:heightModel});}}
ownerContext.setHeight(height,dirty);}},publishOwnerWidth:function(ownerContext,contentWidth){var me=this,owner=me.owner,width=me.calculateOwnerWidthFromContentWidth(ownerContext,contentWidth),constrainedWidth,dirty,widthModel;if(isNaN(width)){me.done=false;}else{constrainedWidth=Ext.Number.constrain(width,owner.minWidth,owner.maxWidth);if(constrainedWidth==width){dirty=me.setWidthInDom;}else{widthModel=me.sizeModels[(constrainedWidth<width)?'constrainedMax':'constrainedMin'];width=constrainedWidth;if(ownerContext.widthModel.calculatedFromShrinkWrap){ownerContext.widthModel=widthModel;}else{ownerContext.invalidate({widthModel:widthModel});}}
ownerContext.setWidth(width,dirty);}}});Ext.define('MP.action.AddAndDelete',{extend:'MP.action.StoreAware',uses:['Ext.Action'],statics:{ADD_ACTION:'add',DELETE_ACTION:'delete'},initActions:function(){var me=this;var ids=me.statics();me.callParent();var grid=me.component;me.addNewRecordAction=me.addAction(new Ext.Action({itemId:ids.ADD_ACTION,text:_('Add new'),tooltip:_('Create a new record.'),iconCls:'mp-add-action-icon',handler:grid.addRecord,scope:grid}));me.deleteRecordAction=me.addAction(new Ext.Action({itemId:ids.DELETE_ACTION,text:_('Delete'),tooltip:_('Delete selected record.'),iconCls:'mp-delete-action-icon',disabled:true,needsSelectedRow:true,scope:grid,handler:grid.deleteRecord}));}});Ext.define('Ext.resizer.BorderSplitterTracker',{extend:'Ext.resizer.SplitterTracker',requires:['Ext.util.Region'],getPrevCmp:null,getNextCmp:null,calculateConstrainRegion:function(){var me=this,splitter=me.splitter,collapseTarget=splitter.collapseTarget,defaultSplitMin=splitter.defaultSplitMin,sizePropCap=splitter.vertical?'Width':'Height',minSizeProp='min'+sizePropCap,maxSizeProp='max'+sizePropCap,getSizeMethod='get'+sizePropCap,neighbors=splitter.neighbors,length=neighbors.length,box=collapseTarget.el.getBox(),left=box.x,top=box.y,right=box.right,bottom=box.bottom,size=splitter.vertical?(right-left):(bottom-top),i,neighbor,minRange,maxRange,maxGrowth,maxShrink,targetSize;minRange=(collapseTarget[minSizeProp]||Math.min(size,defaultSplitMin))-size;maxRange=collapseTarget[maxSizeProp];if(!maxRange){maxRange=1e9;}else{maxRange-=size;}
targetSize=size;for(i=0;i<length;++i){neighbor=neighbors[i];size=neighbor[getSizeMethod]();maxGrowth=size-neighbor[maxSizeProp];maxShrink=size-(neighbor[minSizeProp]||Math.min(size,defaultSplitMin));if(!isNaN(maxGrowth)){if(minRange<maxGrowth){minRange=maxGrowth;}}
if(maxRange>maxShrink){maxRange=maxShrink;}}
if(maxRange-minRange<2){return null;}
box=new Ext.util.Region(top,right,bottom,left);me.constraintAdjusters[me.getCollapseDirection()](box,minRange,maxRange,splitter);me.dragInfo={minRange:minRange,maxRange:maxRange,targetSize:targetSize};return box;},constraintAdjusters:{left:function(box,minRange,maxRange,splitter){box[0]=box.x=box.left=box.right+minRange;box.right+=maxRange+splitter.getWidth();},top:function(box,minRange,maxRange,splitter){box[1]=box.y=box.top=box.bottom+minRange;box.bottom+=maxRange+splitter.getHeight();},bottom:function(box,minRange,maxRange,splitter){box.bottom=box.top-minRange;box.top-=maxRange+splitter.getHeight();},right:function(box,minRange,maxRange,splitter){box.right=box.left-minRange;box[0]=box.x=box.left=box.x-maxRange+splitter.getWidth();}},onBeforeStart:function(e){var me=this,splitter=me.splitter,collapseTarget=splitter.collapseTarget,neighbors=splitter.neighbors,collapseEl=me.getSplitter().collapseEl,target=e.getTarget(),length=neighbors.length,i,neighbor;if(collapseEl&&target===splitter.collapseEl.dom){return false;}
if(collapseTarget.collapsed){return false;}
for(i=0;i<length;++i){neighbor=neighbors[i];if(neighbor.collapsed&&neighbor.isHorz===collapseTarget.isHorz){return false;}}
if(!(me.constrainTo=me.calculateConstrainRegion())){return false;}
return true;},performResize:function(e,offset){var me=this,splitter=me.splitter,collapseDirection=splitter.getCollapseDirection(),collapseTarget=splitter.collapseTarget,adjusters=me.splitAdjusters[splitter.vertical?'horz':'vert'],delta=offset[adjusters.index],dragInfo=me.dragInfo,owner;if(collapseDirection=='right'||collapseDirection=='bottom'){delta=-delta;}
delta=Math.min(Math.max(dragInfo.minRange,delta),dragInfo.maxRange);if(delta){(owner=splitter.ownerCt).suspendLayouts();adjusters.adjustTarget(collapseTarget,dragInfo.targetSize,delta);owner.resumeLayouts(true);}},splitAdjusters:{horz:{index:0,adjustTarget:function(target,size,delta){target.flex=null;target.setSize(size+delta);}},vert:{index:1,adjustTarget:function(target,targetSize,delta){target.flex=null;target.setSize(undefined,targetSize+delta);}}},getCollapseDirection:function(){return this.splitter.getCollapseDirection();}});Ext.define('Ext.container.DockingContainer',{requires:['Ext.util.MixedCollection','Ext.Element'],isDockingContainer:true,defaultDockWeights:{top:{render:1,visual:1},left:{render:3,visual:5},right:{render:5,visual:7},bottom:{render:7,visual:3}},dockOrder:{top:-1,left:-1,right:1,bottom:1},horizontalDocks:0,addDocked:function(items,pos){var me=this,i=0,item,length;items=me.prepareItems(items);length=items.length;for(;i<length;i++){item=items[i];item.dock=item.dock||'top';if(item.dock==='left'||item.dock==='right'){me.horizontalDocks++;}
if(pos!==undefined){i+=pos;me.dockedItems.insert(i,item);}else{me.dockedItems.add(item);}
item.onAdded(me,i);if(me.hasListeners.dockedadd){me.fireEvent('dockedadd',me,item,i);}
if(me.onDockedAdd!==Ext.emptyFn){me.onDockedAdd(item);}}
if(me.rendered&&!me.suspendLayout){me.updateLayout();}
return items;},destroyDockedItems:function(){var dockedItems=this.dockedItems,c;if(dockedItems){while((c=dockedItems.first())){this.removeDocked(c,true);}}},doRenderDockedItems:function(out,renderData,after){var me=renderData.$comp,layout=me.componentLayout,items,tree;if(layout.getDockedItems&&!renderData.$skipDockedItems){items=layout.getDockedItems('render',!after);tree=items&&layout.getItemsRenderTree(items);if(tree){Ext.DomHelper.generateMarkup(tree,out);}}},getDockedComponent:function(comp){if(Ext.isObject(comp)){comp=comp.getItemId();}
return this.dockedItems.get(comp);},getDockedItems:function(selector,beforeBody){var dockedItems=this.getComponentLayout().getDockedItems('render',beforeBody);if(selector&&dockedItems.length){dockedItems=Ext.ComponentQuery.query(selector,dockedItems);}
return dockedItems;},getDockingRefItems:function(deep,containerItems){var selector=deep&&'*,* *',dockedItems=this.getDockedItems(selector,true),items;dockedItems.push.apply(dockedItems,containerItems);items=this.getDockedItems(selector,false);dockedItems.push.apply(dockedItems,items);return dockedItems;},initDockingItems:function(){var me=this,items=me.dockedItems;me.dockedItems=new Ext.util.AbstractMixedCollection(false,me.getComponentId);if(items){me.addDocked(items);}},insertDocked:function(pos,items){this.addDocked(items,pos);},onDockedAdd:Ext.emptyFn,onDockedRemove:Ext.emptyFn,removeDocked:function(item,autoDestroy){var me=this,layout,hasLayout;autoDestroy=autoDestroy===true||(autoDestroy!==false&&me.autoDestroy);if(!me.dockedItems.contains(item)){return item;}
if(item.dock==='left'||item.dock==='right'){me.horizontalDocks--;}
layout=me.componentLayout;hasLayout=layout&&me.rendered;if(hasLayout){layout.onRemove(item);}
me.dockedItems.remove(item);item.onRemoved(item.destroying||autoDestroy);me.onDockedRemove(item);if(autoDestroy){item.destroy();}else if(hasLayout){layout.afterRemove(item);}
if(me.hasListeners.dockedremove){me.fireEvent('dockedremove',me,item);}
if(!me.destroying&&!me.suspendLayout){me.updateLayout();}
return item;},setupDockingRenderTpl:function(renderTpl){renderTpl.renderDockedItems=this.doRenderDockedItems;}});Ext.define('Ext.dd.ScrollManager',{singleton:true,requires:['Ext.dd.DragDropManager'],constructor:function(){var ddm=Ext.dd.DragDropManager;ddm.fireEvents=Ext.Function.createSequence(ddm.fireEvents,this.onFire,this);ddm.stopDrag=Ext.Function.createSequence(ddm.stopDrag,this.onStop,this);this.doScroll=Ext.Function.bind(this.doScroll,this);this.ddmInstance=ddm;this.els={};this.dragEl=null;this.proc={};},onStop:function(e){var sm=Ext.dd.ScrollManager;sm.dragEl=null;sm.clearProc();},triggerRefresh:function(){if(this.ddmInstance.dragCurrent){this.ddmInstance.refreshCache(this.ddmInstance.dragCurrent.groups);}},doScroll:function(){if(this.ddmInstance.dragCurrent){var proc=this.proc,procEl=proc.el,ddScrollConfig=proc.el.ddScrollConfig,inc=ddScrollConfig?ddScrollConfig.increment:this.increment;if(!this.animate){if(procEl.scroll(proc.dir,inc)){this.triggerRefresh();}}else{procEl.scroll(proc.dir,inc,true,this.animDuration,this.triggerRefresh);}}},clearProc:function(){var proc=this.proc;if(proc.id){clearInterval(proc.id);}
proc.id=0;proc.el=null;proc.dir="";},startProc:function(el,dir){this.clearProc();this.proc.el=el;this.proc.dir=dir;var group=el.ddScrollConfig?el.ddScrollConfig.ddGroup:undefined,freq=(el.ddScrollConfig&&el.ddScrollConfig.frequency)?el.ddScrollConfig.frequency:this.frequency;if(group===undefined||this.ddmInstance.dragCurrent.ddGroup==group){this.proc.id=setInterval(this.doScroll,freq);}},onFire:function(e,isDrop){if(isDrop||!this.ddmInstance.dragCurrent){return;}
if(!this.dragEl||this.dragEl!=this.ddmInstance.dragCurrent){this.dragEl=this.ddmInstance.dragCurrent;this.refreshCache();}
var xy=e.getXY(),pt=e.getPoint(),proc=this.proc,els=this.els,id,el,r,c;for(id in els){el=els[id];r=el._region;c=el.ddScrollConfig?el.ddScrollConfig:this;if(r&&r.contains(pt)&&el.isScrollable()){if(r.bottom-pt.y<=c.vthresh){if(proc.el!=el){this.startProc(el,"down");}
return;}else if(r.right-pt.x<=c.hthresh){if(proc.el!=el){this.startProc(el,"left");}
return;}else if(pt.y-r.top<=c.vthresh){if(proc.el!=el){this.startProc(el,"up");}
return;}else if(pt.x-r.left<=c.hthresh){if(proc.el!=el){this.startProc(el,"right");}
return;}}}
this.clearProc();},register:function(el){if(Ext.isArray(el)){for(var i=0,len=el.length;i<len;i++){this.register(el[i]);}}else{el=Ext.get(el);this.els[el.id]=el;}},unregister:function(el){if(Ext.isArray(el)){for(var i=0,len=el.length;i<len;i++){this.unregister(el[i]);}}else{el=Ext.get(el);delete this.els[el.id];}},vthresh:25,hthresh:25,increment:100,frequency:500,animate:true,animDuration:0.4,ddGroup:undefined,refreshCache:function(){var els=this.els,id;for(id in els){if(typeof els[id]=='object'){els[id]._region=els[id].getRegion();}}}});Ext.define('Ext.menu.Manager',{singleton:true,requires:['Ext.util.MixedCollection','Ext.util.KeyMap'],alternateClassName:'Ext.menu.MenuMgr',uses:['Ext.menu.Menu'],menuSelector:'.'+Ext.baseCSSPrefix+'menu',menus:{},groups:{},attached:false,lastShow:new Date(),init:function(){var me=this;me.active=new Ext.util.MixedCollection();Ext.getDoc().addKeyListener(27,function(){if(me.active.length>0){me.hideAll();}},me);},hideAll:function(){var active=this.active,menus,m,mLen;if(active&&active.length>0){menus=Ext.Array.slice(active.items);mLen=menus.length;for(m=0;m<mLen;m++){menus[m].hide();}
return true;}
return false;},onHide:function(m){var me=this,active=me.active;active.remove(m);if(active.length<1){Ext.getDoc().un('mousedown',me.onMouseDown,me);me.attached=false;}},onShow:function(m){var me=this,active=me.active,attached=me.attached;me.lastShow=new Date();active.add(m);if(!attached){Ext.getDoc().on('mousedown',me.onMouseDown,me,{buffer:Ext.isIE9m?10:undefined});me.attached=true;}
m.toFront();},onBeforeHide:function(m){if(m.activeChild){m.activeChild.hide();}
if(m.autoHideTimer){clearTimeout(m.autoHideTimer);delete m.autoHideTimer;}},onBeforeShow:function(m){var active=this.active,parentMenu=m.parentMenu;active.remove(m);if(!parentMenu&&!m.allowOtherMenus){this.hideAll();}
else if(parentMenu&&parentMenu.activeChild&&m!=parentMenu.activeChild){parentMenu.activeChild.hide();}},onMouseDown:function(e){var me=this,active=me.active,lastShow=me.lastShow,doHide=true;if(Ext.Date.getElapsed(lastShow)>50&&active.length>0&&!e.getTarget(me.menuSelector)){if(Ext.isIE9m&&!Ext.getDoc().contains(e.target)){doHide=false;}
if(doHide){me.hideAll();}}},register:function(menu){var me=this;if(!me.active){me.init();}
if(menu.floating){me.menus[menu.id]=menu;menu.on({beforehide:me.onBeforeHide,hide:me.onHide,beforeshow:me.onBeforeShow,show:me.onShow,scope:me});}},get:function(menu){var menus=this.menus;if(typeof menu=='string'){if(!menus){return null;}
return menus[menu];}else if(menu.isMenu){return menu;}else if(Ext.isArray(menu)){return new Ext.menu.Menu({items:menu});}else{return Ext.ComponentManager.create(menu,'menu');}},unregister:function(menu){var me=this,menus=me.menus,active=me.active;delete menus[menu.id];active.remove(menu);menu.un({beforehide:me.onBeforeHide,hide:me.onHide,beforeshow:me.onBeforeShow,show:me.onShow,scope:me});},registerCheckable:function(menuItem){var groups=this.groups,groupId=menuItem.group;if(groupId){if(!groups[groupId]){groups[groupId]=[];}
groups[groupId].push(menuItem);}},unregisterCheckable:function(menuItem){var groups=this.groups,groupId=menuItem.group;if(groupId){Ext.Array.remove(groups[groupId],menuItem);}},onCheckChange:function(menuItem,state){var groups=this.groups,groupId=menuItem.group,i=0,group,ln,curr;if(groupId&&state){group=groups[groupId];ln=group.length;for(;i<ln;i++){curr=group[i];if(curr!=menuItem){curr.setChecked(false);}}}}});Ext.define('Ext.layout.container.Editor',{alias:'layout.editor',extend:'Ext.layout.container.Container',autoSizeDefault:{width:'field',height:'field'},sizePolicies:{$:{$:{readsWidth:1,readsHeight:1,setsWidth:0,setsHeight:0},boundEl:{readsWidth:1,readsHeight:0,setsWidth:0,setsHeight:1}},boundEl:{$:{readsWidth:0,readsHeight:1,setsWidth:1,setsHeight:0},boundEl:{readsWidth:0,readsHeight:0,setsWidth:1,setsHeight:1}}},getItemSizePolicy:function(item){var me=this,autoSize=me.owner.autoSize,key=autoSize&&autoSize.width,policy=me.sizePolicies;policy=policy[key]||policy.$;key=autoSize&&autoSize.height;policy=policy[key]||policy.$;return policy;},calculate:function(ownerContext){var me=this,owner=me.owner,autoSize=owner.autoSize,fieldWidth,fieldHeight;if(autoSize===true){autoSize=me.autoSizeDefault;}
if(autoSize){fieldWidth=me.getDimension(owner,autoSize.width,'getWidth',owner.width);fieldHeight=me.getDimension(owner,autoSize.height,'getHeight',owner.height);}
ownerContext.childItems[0].setSize(fieldWidth,fieldHeight);ownerContext.setWidth(fieldWidth);ownerContext.setHeight(fieldHeight);ownerContext.setContentSize(fieldWidth||owner.field.getWidth(),fieldHeight||owner.field.getHeight());},getDimension:function(owner,type,getMethod,ownerSize){switch(type){case'boundEl':return owner.boundEl[getMethod]();case'field':return undefined;default:return ownerSize;}}});Ext.define('Ext.fx.target.CompositeElementCSS',{extend:'Ext.fx.target.CompositeElement',requires:['Ext.fx.target.ElementCSS'],setAttr:function(){return Ext.fx.target.ElementCSS.prototype.setAttr.apply(this,arguments);}});Ext.define('Ext.data.reader.Array',{extend:'Ext.data.reader.Json',alternateClassName:'Ext.data.ArrayReader',alias:'reader.array',totalProperty:undefined,successProperty:undefined,createFieldAccessExpression:function(field,fieldVarName,dataName){var index=(field.mapping==null)?field.originalIndex:field.mapping,result;if(typeof index==='function'){result=fieldVarName+'.mapping('+dataName+', this)';}else{if(isNaN(index)){index='"'+index+'"';}
result=dataName+"["+index+"]";}
return result;}});Ext.define('Ext.data.Errors',{extend:'Ext.util.MixedCollection',isValid:function(){return this.length===0;},getByField:function(fieldName){var errors=[],error,i;for(i=0;i<this.length;i++){error=this.items[i];if(error.field==fieldName){errors.push(error);}}
return errors;}});Ext.define('Ext.dd.DragDrop',{requires:['Ext.dd.DragDropManager'],constructor:function(id,sGroup,config){if(id){this.init(id,sGroup,config);}},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},moveOnly:false,unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(constrainTo,pad,inContent){if(Ext.isNumber(pad)){pad={left:pad,right:pad,top:pad,bottom:pad};}
pad=pad||this.defaultPadding;var b=Ext.get(this.getEl()).getBox(),ce=Ext.get(constrainTo),s=ce.getScroll(),c,cd=ce.dom,xy,topSpace,leftSpace;if(cd==document.body){c={x:s.left,y:s.top,width:Ext.Element.getViewWidth(),height:Ext.Element.getViewHeight()};}else{xy=ce.getXY();c={x:xy[0],y:xy[1],width:cd.clientWidth,height:cd.clientHeight};}
topSpace=b.y-c.y;leftSpace=b.x-c.x;this.resetConstraints();this.setXConstraint(leftSpace-(pad.left||0),c.width-leftSpace-b.width-(pad.right||0),this.xTickSize);this.setYConstraint(topSpace-(pad.top||0),c.height-topSpace-b.height-(pad.bottom||0),this.yTickSize);},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id);}
return this._domRef;},getDragEl:function(){return Ext.getDom(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Ext.EventManager.on(this.id,"mousedown",this.handleMouseDown,this);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDMInstance=Ext.dd.DragDropManager;this.groups={};if(typeof id!=="string"){id=Ext.id(id);}
this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl(),dx,dy,p;if(!this.DDMInstance.verifyEl(el)){return;}
dx=diffX||0;dy=diffY||0;p=Ext.Element.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Ext.Element.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDMInstance.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];}
this.DDMInstance.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Ext.id(id);}
this.handleElId=id;this.DDMInstance.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Ext.id(id);}
Ext.EventManager.on(id,"mousedown",this.handleMouseDown,this);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){Ext.EventManager.un(this.id,"mousedown",this.handleMouseDown,this);this._domRef=null;this.DDMInstance._remove(this);},destroy:function(){this.unreg();},isLocked:function(){return(this.DDMInstance.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var me=this;if((me.primaryButtonOnly&&e.button!=0)||me.isLocked()){return;}
me.DDMInstance.refreshCache(me.groups);if(me.hasOuterHandles||me.DDMInstance.isOverTarget(e.getPoint(),me)){if(me.clickValidator(e)){me.setStartPosition();me.b4MouseDown(e);me.onMouseDown(e);me.DDMInstance.handleMouseDown(e,me);me.DDMInstance.stopEvent(e);}}},clickValidator:function(e){var target=e.getTarget();return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDMInstance.handleWasClicked(target,this.id)));},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Ext.id(id);}
this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Ext.id(id);}
delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true,nodeName,i,len;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}
valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!Ext.fly(node).hasCls(this.invalidHandleClasses[i]);}
return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={},i;for(i=this.initPageX;i>=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
Ext.Array.sort(this.xTicks,this.DDMInstance.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={},i;for(i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
Ext.Array.sort(this.yTicks,this.DDMInstance.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=iLeft;this.rightConstraint=iRight;this.minX=this.initPageX-iLeft;this.maxX=this.initPageX+iRight;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}
this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=iUp;this.bottomConstraint=iDown;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+iDown;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}
this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0,dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}
if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}
if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{var i,len,next,diff1,diff2;for(i=0,len=tickArray.length;i<len;++i){next=i+1;if(tickArray[next]&&tickArray[next]>=val){diff1=val-tickArray[i];diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}}
return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}});Ext.define('Ext.layout.container.Fit',{extend:'Ext.layout.container.Container',alternateClassName:'Ext.layout.FitLayout',alias:'layout.fit',itemCls:Ext.baseCSSPrefix+'fit-item',targetCls:Ext.baseCSSPrefix+'layout-fit',type:'fit',defaultMargins:{top:0,right:0,bottom:0,left:0},manageMargins:true,sizePolicies:{0:{readsWidth:1,readsHeight:1,setsWidth:0,setsHeight:0},1:{readsWidth:0,readsHeight:1,setsWidth:1,setsHeight:0},2:{readsWidth:1,readsHeight:0,setsWidth:0,setsHeight:1},3:{readsWidth:0,readsHeight:0,setsWidth:1,setsHeight:1}},getItemSizePolicy:function(item,ownerSizeModel){var sizeModel=ownerSizeModel||this.owner.getSizeModel(),mode=(sizeModel.width.shrinkWrap?0:1)|(sizeModel.height.shrinkWrap?0:2);return this.sizePolicies[mode];},beginLayoutCycle:function(ownerContext,firstCycle){var me=this,resetHeight=me.lastHeightModel&&me.lastHeightModel.calculated,resetWidth=me.lastWidthModel&&me.lastWidthModel.calculated,resetSizes=resetWidth||resetHeight,maxChildMinHeight=0,maxChildMinWidth=0,c,childItems,i,item,length,margins,minHeight,minWidth,style,undef;me.callParent(arguments);if(resetSizes&&ownerContext.targetContext.el.dom.tagName.toUpperCase()!='TD'){resetSizes=resetWidth=resetHeight=false;}
childItems=ownerContext.childItems;length=childItems.length;for(i=0;i<length;++i){item=childItems[i];if(firstCycle){c=item.target;minHeight=c.minHeight;minWidth=c.minWidth;if(minWidth||minHeight){margins=item.marginInfo||item.getMarginInfo();minHeight+=margins.height;minWidth+=margins.height;if(maxChildMinHeight<minHeight){maxChildMinHeight=minHeight;}
if(maxChildMinWidth<minWidth){maxChildMinWidth=minWidth;}}}
if(resetSizes){style=item.el.dom.style;if(resetHeight){style.height='';}
if(resetWidth){style.width='';}}}
if(firstCycle){ownerContext.maxChildMinHeight=maxChildMinHeight;ownerContext.maxChildMinWidth=maxChildMinWidth;}
c=ownerContext.target;ownerContext.overflowX=(!ownerContext.widthModel.shrinkWrap&&ownerContext.maxChildMinWidth&&c.scrollFlags.x)||undef;ownerContext.overflowY=(!ownerContext.heightModel.shrinkWrap&&ownerContext.maxChildMinHeight&&c.scrollFlags.y)||undef;},calculate:function(ownerContext){var me=this,childItems=ownerContext.childItems,length=childItems.length,containerSize=me.getContainerSize(ownerContext),info={length:length,ownerContext:ownerContext,targetSize:containerSize},shrinkWrapWidth=ownerContext.widthModel.shrinkWrap,shrinkWrapHeight=ownerContext.heightModel.shrinkWrap,overflowX=ownerContext.overflowX,overflowY=ownerContext.overflowY,scrollbars,scrollbarSize,padding,i,contentWidth,contentHeight;if(overflowX||overflowY){scrollbars=me.getScrollbarsNeeded(overflowX&&containerSize.width,overflowY&&containerSize.height,ownerContext.maxChildMinWidth,ownerContext.maxChildMinHeight);if(scrollbars){scrollbarSize=Ext.getScrollbarSize();if(scrollbars&1){containerSize.height-=scrollbarSize.height;}
if(scrollbars&2){containerSize.width-=scrollbarSize.width;}}}
for(i=0;i<length;++i){info.index=i;me.fitItem(childItems[i],info);}
if(shrinkWrapHeight||shrinkWrapWidth){padding=ownerContext.targetContext.getPaddingInfo();if(shrinkWrapWidth){if(overflowY&&!containerSize.gotHeight){me.done=false;}else{contentWidth=info.contentWidth+padding.width;if(scrollbars&2){contentWidth+=scrollbarSize.width;}
if(!ownerContext.setContentWidth(contentWidth)){me.done=false;}}}
if(shrinkWrapHeight){if(overflowX&&!containerSize.gotWidth){me.done=false;}else{contentHeight=info.contentHeight+padding.height;if(scrollbars&1){contentHeight+=scrollbarSize.height;}
if(!ownerContext.setContentHeight(contentHeight)){me.done=false;}}}}},fitItem:function(itemContext,info){var me=this;if(itemContext.invalid){me.done=false;return;}
info.margins=itemContext.getMarginInfo();info.needed=info.got=0;me.fitItemWidth(itemContext,info);me.fitItemHeight(itemContext,info);if(info.got!=info.needed){me.done=false;}},fitItemWidth:function(itemContext,info){var contentWidth,width;if(info.ownerContext.widthModel.shrinkWrap){width=itemContext.getProp('width')+info.margins.width;contentWidth=info.contentWidth;if(contentWidth===undefined){info.contentWidth=width;}else{info.contentWidth=Math.max(contentWidth,width);}}else if(itemContext.widthModel.calculated){++info.needed;if(info.targetSize.gotWidth){++info.got;this.setItemWidth(itemContext,info);}}
this.positionItemX(itemContext,info);},fitItemHeight:function(itemContext,info){var contentHeight,height;if(info.ownerContext.heightModel.shrinkWrap){height=itemContext.getProp('height')+info.margins.height;contentHeight=info.contentHeight;if(contentHeight===undefined){info.contentHeight=height;}else{info.contentHeight=Math.max(contentHeight,height);}}else if(itemContext.heightModel.calculated){++info.needed;if(info.targetSize.gotHeight){++info.got;this.setItemHeight(itemContext,info);}}
this.positionItemY(itemContext,info);},positionItemX:function(itemContext,info){var margins=info.margins;if(info.index||margins.left){itemContext.setProp('x',margins.left);}
if(margins.width){itemContext.setProp('margin-right',margins.width);}},positionItemY:function(itemContext,info){var margins=info.margins;if(info.index||margins.top){itemContext.setProp('y',margins.top);}
if(margins.height){itemContext.setProp('margin-bottom',margins.height);}},setItemHeight:function(itemContext,info){itemContext.setHeight(info.targetSize.height-info.margins.height);},setItemWidth:function(itemContext,info){itemContext.setWidth(info.targetSize.width-info.margins.width);}});Ext.define('MP.action.SaveAndReset',{extend:'MP.action.StoreAware',uses:['Ext.Action'],statics:{SAVE_ACTION:'save',RESTORE_ACTION:'restore'},initActions:function(){var me=this;var ids=me.statics();me.callParent();var target=me.component;me.saveAction=me.addAction(new Ext.Action({itemId:ids.SAVE_ACTION,disabled:true,text:_('Save'),tooltip:_('Confirm the changes.'),iconCls:'mp-save-action-icon',needsValidState:true,needsDirtyState:true,handler:function(options){var callback=options&&options.callback||null;var scope=options&&options.scope||null;target.commitChanges(callback,scope);}}));me.restoreAction=me.addAction(new Ext.Action({itemId:ids.RESTORE_ACTION,disabled:true,text:_('Restore'),tooltip:_('Rollback the changes.'),iconCls:'mp-restore-action-icon',needsDirtyState:true,handler:function(){target.resetChanges();}}));}});Ext.define('Ext.data.proxy.Proxy',{alias:'proxy.proxy',alternateClassName:['Ext.data.DataProxy','Ext.data.Proxy'],requires:['Ext.data.reader.Json','Ext.data.writer.Json'],uses:['Ext.data.Batch','Ext.data.Operation','Ext.data.Model'],mixins:{observable:'Ext.util.Observable'},batchOrder:'create,update,destroy',batchActions:true,defaultReaderType:'json',defaultWriterType:'json',isProxy:true,isSynchronous:false,constructor:function(config){var me=this;config=config||{};me.proxyConfig=config;me.mixins.observable.constructor.call(me,config);if(me.model!==undefined&&!(me.model instanceof Ext.data.Model)){me.setModel(me.model);}else{if(me.reader){me.setReader(me.reader);}
if(me.writer){me.setWriter(me.writer);}}},setModel:function(model,setOnStore){var me=this;me.model=Ext.ModelManager.getModel(model);me.setReader(this.reader);me.setWriter(this.writer);if(setOnStore&&me.store){me.store.setModel(me.model);}},getModel:function(){return this.model;},setReader:function(reader){var me=this,needsCopy=true,current=me.reader;if(reader===undefined||typeof reader=='string'){reader={type:reader};needsCopy=false;}
if(reader.isReader){reader.setModel(me.model);}else{if(needsCopy){reader=Ext.apply({},reader);}
Ext.applyIf(reader,{proxy:me,model:me.model,type:me.defaultReaderType});reader=Ext.createByAlias('reader.'+reader.type,reader);}
if(reader!==current&&reader.onMetaChange){reader.onMetaChange=Ext.Function.createSequence(reader.onMetaChange,this.onMetaChange,this);}
me.reader=reader;return me.reader;},getReader:function(){return this.reader;},onMetaChange:function(meta){this.fireEvent('metachange',this,meta);},setWriter:function(writer){var me=this,needsCopy=true;if(writer===undefined||typeof writer=='string'){writer={type:writer};needsCopy=false;}
if(!writer.isWriter){if(needsCopy){writer=Ext.apply({},writer);}
Ext.applyIf(writer,{model:me.model,type:me.defaultWriterType});writer=Ext.createByAlias('writer.'+writer.type,writer);}
me.writer=writer;return me.writer;},getWriter:function(){return this.writer;},create:Ext.emptyFn,read:Ext.emptyFn,update:Ext.emptyFn,destroy:Ext.emptyFn,batch:function(options,listeners){var me=this,useBatch=me.batchActions,batch,records,actions,aLen,action,a,r,rLen,record;if(options.operations===undefined){options={operations:options,listeners:listeners};}
if(options.batch){if(Ext.isDefined(options.batch.runOperation)){batch=Ext.applyIf(options.batch,{proxy:me,listeners:{}});}}else{options.batch={proxy:me,listeners:options.listeners||{}};}
if(!batch){batch=new Ext.data.Batch(options.batch);}
batch.on('complete',Ext.bind(me.onBatchComplete,me,[options],0));actions=me.batchOrder.split(',');aLen=actions.length;for(a=0;a<aLen;a++){action=actions[a];records=options.operations[action];if(records){if(useBatch){batch.add(new Ext.data.Operation({action:action,records:records}));}else{rLen=records.length;for(r=0;r<rLen;r++){record=records[r];batch.add(new Ext.data.Operation({action:action,records:[record]}));}}}}
batch.start();return batch;},onBatchComplete:function(batchOptions,batch){var scope=batchOptions.scope||this;if(batch.hasException){if(Ext.isFunction(batchOptions.failure)){Ext.callback(batchOptions.failure,scope,[batch,batchOptions]);}}else if(Ext.isFunction(batchOptions.success)){Ext.callback(batchOptions.success,scope,[batch,batchOptions]);}
if(Ext.isFunction(batchOptions.callback)){Ext.callback(batchOptions.callback,scope,[batch,batchOptions]);}},clone:function(){return new this.self(this.proxyConfig);}});Ext.define('Ext.fx.Manager',{singleton:true,requires:['Ext.util.MixedCollection','Ext.fx.target.Element','Ext.fx.target.ElementCSS','Ext.fx.target.CompositeElement','Ext.fx.target.CompositeElementCSS','Ext.fx.target.Sprite','Ext.fx.target.CompositeSprite','Ext.fx.target.Component'],mixins:{queue:'Ext.fx.Queue'},constructor:function(){var me=this;me.items=new Ext.util.MixedCollection();me.mixins.queue.constructor.call(me);me.taskRunner=new Ext.util.TaskRunner();},interval:16,forceJS:true,createTarget:function(target){var me=this,useCSS3=!me.forceJS&&Ext.supports.Transitions,targetObj;me.useCSS3=useCSS3;if(target){if(target.tagName||Ext.isString(target)||target.isFly){target=Ext.get(target);targetObj=new Ext.fx.target['Element'+(useCSS3?'CSS':'')](target);}
else if(target.dom){targetObj=new Ext.fx.target['Element'+(useCSS3?'CSS':'')](target);}
else if(target.isComposite){targetObj=new Ext.fx.target['CompositeElement'+(useCSS3?'CSS':'')](target);}
else if(target.isSprite){targetObj=new Ext.fx.target.Sprite(target);}
else if(target.isCompositeSprite){targetObj=new Ext.fx.target.CompositeSprite(target);}
else if(target.isComponent){targetObj=new Ext.fx.target.Component(target);}
else if(target.isAnimTarget){return target;}
else{return null;}
me.targets.add(targetObj);return targetObj;}
else{return null;}},addAnim:function(anim){var me=this,items=me.items,task=me.task;items.add(anim.id,anim);if(!task&&items.length){task=me.task={run:me.runner,interval:me.interval,scope:me};me.taskRunner.start(task);}},removeAnim:function(anim){var me=this,items=me.items,task=me.task;items.removeAtKey(anim.id);if(task&&!items.length){me.taskRunner.stop(task);delete me.task;}},runner:function(){var me=this,items=me.items.getRange(),i=0,len=items.length,anim;me.targetArr={};me.timestamp=new Date();for(;i<len;i++){anim=items[i];if(anim.isReady()){me.startAnim(anim);}}
for(i=0;i<len;i++){anim=items[i];if(anim.isRunning()){me.runAnim(anim);}}
me.applyPendingAttrs();},startAnim:function(anim){anim.start(this.timestamp);},runAnim:function(anim){if(!anim){return;}
var me=this,useCSS3=me.useCSS3&&anim.target.type=='element',elapsedTime=me.timestamp-anim.startTime,lastFrame=(elapsedTime>=anim.duration),target,o;target=this.collectTargetData(anim,elapsedTime,useCSS3,lastFrame);if(useCSS3){anim.target.setAttr(target.anims[anim.id].attributes,true);me.collectTargetData(anim,anim.duration,useCSS3,lastFrame);anim.paused=true;target=anim.target.target;if(anim.target.isComposite){target=anim.target.target.last();}
o={};o[Ext.supports.CSS3TransitionEnd]=anim.lastFrame;o.scope=anim;o.single=true;target.on(o);}},collectTargetData:function(anim,elapsedTime,useCSS3,isLastFrame){var targetId=anim.target.getId(),target=this.targetArr[targetId];if(!target){target=this.targetArr[targetId]={id:targetId,el:anim.target,anims:{}};}
target.anims[anim.id]={id:anim.id,anim:anim,elapsed:elapsedTime,isLastFrame:isLastFrame,attributes:[{duration:anim.duration,easing:(useCSS3&&anim.reverse)?anim.easingFn.reverse().toCSS3():anim.easing,attrs:anim.runAnim(elapsedTime)}]};return target;},applyPendingAttrs:function(){var targetArr=this.targetArr,target,targetId,animWrap,anim,animId;for(targetId in targetArr){if(targetArr.hasOwnProperty(targetId)){target=targetArr[targetId];for(animId in target.anims){if(target.anims.hasOwnProperty(animId)){animWrap=target.anims[animId];anim=animWrap.anim;if(animWrap.attributes&&anim.isRunning()){target.el.setAttr(animWrap.attributes,false,animWrap.isLastFrame);if(animWrap.isLastFrame){anim.lastFrame();}}}}}}}});Ext.define('Ext.data.Model',{alternateClassName:'Ext.data.Record',mixins:{observable:'Ext.util.Observable'},requires:['Ext.ModelManager','Ext.data.IdGenerator','Ext.data.Field','Ext.data.Errors','Ext.data.Operation','Ext.data.validations','Ext.util.MixedCollection'],compareConvertFields:function(f1,f2){var f1SpecialConvert=f1.convert&&f1.type&&f1.convert!==f1.type.convert,f2SpecialConvert=f2.convert&&f2.type&&f2.convert!==f2.type.convert;if(f1SpecialConvert&&!f2SpecialConvert){return 1;}
if(!f1SpecialConvert&&f2SpecialConvert){return-1;}
return 0;},itemNameFn:function(item){return item.name;},onClassExtended:function(cls,data,hooks){var onBeforeClassCreated=hooks.onBeforeCreated;hooks.onBeforeCreated=function(cls,data){var me=this,name=Ext.getClassName(cls),prototype=cls.prototype,superCls=cls.prototype.superclass,validations=data.validations||[],fields=data.fields||[],field,associationsConfigs=data.associations||[],addAssociations=function(items,type){var i=0,len,item;if(items){items=Ext.Array.from(items);for(len=items.length;i<len;++i){item=items[i];if(!Ext.isObject(item)){item={model:item};}
item.type=type;associationsConfigs.push(item);}}},idgen=data.idgen,fieldsMixedCollection=new Ext.util.MixedCollection(false,prototype.itemNameFn),associationsMixedCollection=new Ext.util.MixedCollection(false,prototype.itemNameFn),superValidations=superCls.validations,superFields=superCls.fields,superAssociations=superCls.associations,associationConfig,i,ln,dependencies=[],idProperty='idProperty'in data?data.idProperty:prototype.idProperty,idField=idProperty?(idProperty.isField?idProperty:new Ext.data.Field(idProperty)):null,idFieldDefined=false,onFieldAddReplace=function(arg0,arg1,arg2){var newField,pos;if(fieldsMixedCollection.events.add.firing){pos=arg0;newField=arg1;}else{newField=arg2;pos=arg1.originalIndex;}
newField.originalIndex=pos;if(idField&&((newField.mapping&&(newField.mapping===idField.mapping))||(newField.name===idField.name))){prototype.idField=newField;idFieldDefined=true;newField.defaultValue=undefined;}},clsProxy=data.proxy,fieldConvertSortFn=function(){fieldsMixedCollection.sortBy(prototype.compareConvertFields);};cls.modelName=name;prototype.modelName=name;if(superValidations){validations=superValidations.concat(validations);}
data.validations=validations;if(superFields){fields=superFields.items.concat(fields);}
fieldsMixedCollection.on({add:onFieldAddReplace,replace:onFieldAddReplace});for(i=0,ln=fields.length;i<ln;++i){field=fields[i];fieldsMixedCollection.add(field.isField?field:new Ext.data.Field(field));}
if(idField&&!idFieldDefined){prototype.idField=idField;idField.defaultValue=undefined;fieldsMixedCollection.add(idField);}
fieldConvertSortFn();fieldsMixedCollection.on({add:fieldConvertSortFn,replace:fieldConvertSortFn});data.fields=fieldsMixedCollection;if(idgen){data.idgen=Ext.data.IdGenerator.get(idgen);}
addAssociations(data.belongsTo,'belongsTo');delete data.belongsTo;addAssociations(data.hasMany,'hasMany');delete data.hasMany;addAssociations(data.hasOne,'hasOne');delete data.hasOne;if(superAssociations){associationsConfigs=superAssociations.items.concat(associationsConfigs);}
for(i=0,ln=associationsConfigs.length;i<ln;++i){dependencies.push('association.'+associationsConfigs[i].type.toLowerCase());}
if(clsProxy){if(!clsProxy.isProxy){dependencies.push('proxy.'+(clsProxy.type||clsProxy));}}
else if(!cls.prototype.proxy){cls.prototype.proxy=cls.prototype.defaultProxyType;dependencies.push('proxy.'+cls.prototype.defaultProxyType);}
Ext.require(dependencies,function(){Ext.ModelManager.registerType(name,cls);for(i=0,ln=associationsConfigs.length;i<ln;++i){associationConfig=associationsConfigs[i];if(associationConfig.isAssociation){associationConfig=Ext.applyIf({ownerModel:name,associatedModel:associationConfig.model},associationConfig.initialConfig);}else{Ext.apply(associationConfig,{ownerModel:name,associatedModel:associationConfig.model});}
if(Ext.ModelManager.getModel(associationConfig.model)===undefined){Ext.ModelManager.registerDeferredAssociation(associationConfig);}else{associationsMixedCollection.add(Ext.data.association.Association.create(associationConfig));}}
data.associations=associationsMixedCollection;onBeforeClassCreated.call(me,cls,data,hooks);if(clsProxy&&clsProxy.isProxy){cls.setProxy(clsProxy);}
Ext.ModelManager.onModelDefined(cls);});};},inheritableStatics:{setProxy:function(proxy){if(!proxy.isProxy){if(typeof proxy=="string"){proxy={type:proxy};}
proxy=Ext.createByAlias("proxy."+proxy.type,proxy);}
proxy.setModel(this);this.proxy=this.prototype.proxy=proxy;return proxy;},getProxy:function(){var proxy=this.proxy;if(!proxy){proxy=this.prototype.proxy;if(proxy.isProxy){proxy=proxy.clone()}
return this.setProxy(proxy);}
return proxy;},setFields:function(fields,idProperty,clientIdProperty){var me=this,newField,idField,idFieldDefined=false,proto=me.prototype,prototypeFields=proto.fields,superFields=proto.superclass.fields,len,i;if(idProperty){proto.idProperty=idProperty;idField=idProperty.isField?idProperty:new Ext.data.Field(idProperty);}
if(clientIdProperty){proto.clientIdProperty=clientIdProperty;}
if(prototypeFields){prototypeFields.clear();}
else{prototypeFields=me.prototype.fields=new Ext.util.MixedCollection(false,function(field){return field.name;});}
if(superFields){fields=superFields.items.concat(fields);}
for(i=0,len=fields.length;i<len;i++){newField=new Ext.data.Field(fields[i]);if(idField&&((newField.mapping&&(newField.mapping===idField.mapping))||(newField.name===idField.name))){idFieldDefined=true;newField.defaultValue=undefined;}
prototypeFields.add(newField);}
if(idField&&!idFieldDefined){idField.defaultValue=undefined;prototypeFields.add(idField);}
me.fields=prototypeFields;return prototypeFields;},getFields:function(){return this.prototype.fields.items;},load:function(id,config){config=Ext.apply({},config);config=Ext.applyIf(config,{action:'read',id:id});var operation=new Ext.data.Operation(config),scope=config.scope||this,callback;callback=function(operation){var record=null,success=operation.wasSuccessful();if(success){record=operation.getRecords()[0];if(!record.hasId()){record.setId(id);}
Ext.callback(config.success,scope,[record,operation]);}else{Ext.callback(config.failure,scope,[record,operation]);}
Ext.callback(config.callback,scope,[record,operation,success]);};this.getProxy().read(operation,callback,this);}},statics:{PREFIX:'ext-record',AUTO_ID:1,EDIT:'edit',REJECT:'reject',COMMIT:'commit',id:function(rec){var id=[this.PREFIX,'-',this.AUTO_ID++].join('');rec.phantom=true;rec.internalId=id;return id;}},idgen:{isGenerator:true,type:'default',generate:function(){return null;},getRecId:function(rec){return rec.modelName+'-'+rec.internalId;}},editing:false,dirty:false,persistenceProperty:'data',evented:false,isModel:true,phantom:false,idProperty:'id',clientIdProperty:null,defaultProxyType:'ajax',emptyData:[],constructor:function(data,id,raw,convertedData){var me=this,passedId=(id||id===0),hasId,fields,length,field,name,value,newId,persistenceProperty,idProperty=me.idProperty,idField=me.idField,i;me.raw=raw||data;me.modified={};persistenceProperty=me[me.persistenceProperty]=convertedData||{};me.data=me[me.persistenceProperty];me.mixins.observable.constructor.call(me);if(!convertedData){if(data){if(!passedId&&idProperty){id=data[idProperty];hasId=(id||id===0);}}
else{data=me.emptyData;}
fields=me.fields.items;length=fields.length;i=0;if(Ext.isArray(data)){for(;i<length;i++){field=fields[i];name=field.name;value=data[field.originalIndex];if(value===undefined){value=field.defaultValue;}
if(field.convert){value=field.convert(value,me);}
if(value!==undefined){persistenceProperty[name]=value;}}}else{for(;i<length;i++){field=fields[i];name=field.name;value=data[name];if(value===undefined){value=field.defaultValue;}
if(field.convert){value=field.convert(value,me);}
if(value!==undefined){persistenceProperty[name]=value;}}}}
me.stores=[];if(passedId){hasId=true;persistenceProperty[idProperty]=idField&&idField.convert?idField.convert(id):id;}
else if(!hasId){newId=me.idgen.generate();if(newId!=null){me.preventInternalUpdate=true;me.setId(newId);delete me.preventInternalUpdate;}}
me.internalId=hasId?id:Ext.data.Model.id(me);if(typeof me.init=='function'){me.init();}
me.id=me.idgen.getRecId(me);},get:function(field){return this[this.persistenceProperty][field];},_singleProp:{},set:function(fieldName,newValue){var me=this,data=me[me.persistenceProperty],fields=me.fields,modified=me.modified,single=(typeof fieldName=='string'),currentValue,field,idChanged,key,modifiedFieldNames,name,oldId,newId,value,values;if(single){values=me._singleProp;values[fieldName]=newValue;}else{values=fieldName;}
for(name in values){if(values.hasOwnProperty(name)){value=values[name];if(fields&&(field=fields.get(name))&&field.convert){value=field.convert(value,me);}
currentValue=data[name];if(me.isEqual(currentValue,value)){continue;}
data[name]=value;(modifiedFieldNames||(modifiedFieldNames=[])).push(name);if(field&&field.persist){if(modified.hasOwnProperty(name)){if(me.isEqual(modified[name],value)){delete modified[name];me.dirty=false;for(key in modified){if(modified.hasOwnProperty(key)){me.dirty=true;break;}}}}else{me.dirty=true;modified[name]=currentValue;}}
if(name==me.idProperty){idChanged=true;oldId=currentValue;newId=value;}}}
if(single){delete values[fieldName];}
if(idChanged){me.changeId(oldId,newId);}
if(!me.editing&&modifiedFieldNames){me.afterEdit(modifiedFieldNames);}
return modifiedFieldNames||null;},copyFrom:function(sourceRecord){var me=this,fields=me.fields.items,fieldCount=fields.length,modifiedFieldNames=[],field,i=0,myData,sourceData,idProperty=me.idProperty,name,value;if(sourceRecord){myData=me[me.persistenceProperty];sourceData=sourceRecord[sourceRecord.persistenceProperty];for(;i<fieldCount;i++){field=fields[i];name=field.name;if(name!=idProperty){value=sourceData[name];if(value!==undefined&&!me.isEqual(myData[name],value)){myData[name]=value;modifiedFieldNames.push(name);}}}
if(me.phantom&&!sourceRecord.phantom){me.beginEdit();me.setId(sourceRecord.getId());me.endEdit(true);me.commit(true);}}
return modifiedFieldNames;},isEqual:function(a,b){if(a instanceof Date&&b instanceof Date){return a.getTime()===b.getTime();}
return a===b;},beginEdit:function(){var me=this,key,data,o;if(!me.editing){me.editing=true;me.dirtySave=me.dirty;o=me[me.persistenceProperty];data=me.dataSave={};for(key in o){if(o.hasOwnProperty(key)){data[key]=o[key];}}
o=me.modified;data=me.modifiedSave={};for(key in o){if(o.hasOwnProperty(key)){data[key]=o[key];}}}},cancelEdit:function(){var me=this;if(me.editing){me.editing=false;me.modified=me.modifiedSave;me[me.persistenceProperty]=me.dataSave;me.dirty=me.dirtySave;me.modifiedSave=me.dataSave=me.dirtySave=null;}},endEdit:function(silent,modifiedFieldNames){var me=this,dataSave,changed;silent=silent===true;if(me.editing){me.editing=false;dataSave=me.dataSave;me.modifiedSave=me.dataSave=me.dirtySave=null;if(!silent){if(!modifiedFieldNames){modifiedFieldNames=me.getModifiedFieldNames(dataSave);}
changed=me.dirty||modifiedFieldNames.length>0;if(changed){me.afterEdit(modifiedFieldNames);}}}},getModifiedFieldNames:function(saved){var me=this,data=me[me.persistenceProperty],modified=[],key;saved=saved||me.dataSave;for(key in data){if(data.hasOwnProperty(key)){if(!me.isEqual(data[key],saved[key])){modified.push(key);}}}
return modified;},getChanges:function(){var modified=this.modified,changes={},field;for(field in modified){if(modified.hasOwnProperty(field)){changes[field]=this.get(field);}}
return changes;},isModified:function(fieldName){return this.modified.hasOwnProperty(fieldName);},setDirty:function(){var me=this,fields=me.fields.items,fLen=fields.length,field,name,f;me.dirty=true;for(f=0;f<fLen;f++){field=fields[f];if(field.persist){name=field.name;me.modified[name]=me.get(name);}}},reject:function(silent){var me=this,modified=me.modified,field;for(field in modified){if(modified.hasOwnProperty(field)){if(typeof modified[field]!="function"){me[me.persistenceProperty][field]=modified[field];}}}
me.dirty=false;me.editing=false;me.modified={};if(silent!==true){me.afterReject();}},commit:function(silent,modifiedFieldNames){var me=this;me.phantom=me.dirty=me.editing=false;me.modified={};if(silent!==true){me.afterCommit(modifiedFieldNames);}},copy:function(newId){var me=this;return new me.self(me.raw,newId,null,Ext.apply({},me[me.persistenceProperty]));},setProxy:function(proxy){if(!proxy.isProxy){if(typeof proxy==="string"){proxy={type:proxy};}
proxy=Ext.createByAlias("proxy."+proxy.type,proxy);}
proxy.setModel(this.self);this.proxy=proxy;return proxy;},getProxy:function(){return this.hasOwnProperty('proxy')?this.proxy:this.self.getProxy();},validate:function(){var errors=new Ext.data.Errors(),validations=this.validations,validators=Ext.data.validations,length,validation,field,valid,type,i;if(validations){length=validations.length;for(i=0;i<length;i++){validation=validations[i];field=validation.field||validation.name;type=validation.type;valid=validators[type](validation,this.get(field));if(!valid){errors.add({field:field,message:validation.message||validators[type+'Message']});}}}
return errors;},isValid:function(){return this.validate().isValid();},save:function(options){options=Ext.apply({},options);var me=this,action=me.phantom?'create':'update',scope=options.scope||me,stores=me.stores,i=0,storeCount,store,operation,callback;Ext.apply(options,{records:[me],action:action});operation=new Ext.data.Operation(options);callback=function(operation){var success=operation.wasSuccessful();if(success){for(storeCount=stores.length;i<storeCount;i++){store=stores[i];store.fireEvent('write',store,operation);store.fireEvent('datachanged',store);}
Ext.callback(options.success,scope,[me,operation]);}
else{Ext.callback(options.failure,scope,[me,operation]);}
Ext.callback(options.callback,scope,[me,operation,success]);};me.getProxy()[action](operation,callback,me);return me;},destroy:function(options){options=Ext.apply({records:[this],action:'destroy'},options);var me=this,isNotPhantom=me.phantom!==true,scope=options.scope||me,stores,i=0,storeCount,store,args,operation,callback;operation=new Ext.data.Operation(options);callback=function(operation){args=[me,operation];stores=Ext.Array.clone(me.stores);if(operation.wasSuccessful()){for(storeCount=stores.length;i<storeCount;i++){store=stores[i];if(store.remove){store.remove(me,true);}
store.fireEvent('bulkremove',store,[me],[store.indexOf(me)],false);if(isNotPhantom){store.fireEvent('write',store,operation);}}
me.clearListeners();Ext.callback(options.success,scope,args);}else{Ext.callback(options.failure,scope,args);}
Ext.callback(options.callback,scope,args);};if(isNotPhantom){me.getProxy().destroy(operation,callback,me);}
else{operation.complete=operation.success=true;operation.resultSet=me.getProxy().reader.nullResultSet;callback(operation);}
return me;},getId:function(){return this.get(this.idField.name);},getObservableId:function(){return this.id;},setId:function(id){this.set(this.idProperty,id);},changeId:function(oldId,newId){var me=this,hasOldId,hasId,oldInternalId;if(!me.preventInternalUpdate){hasOldId=me.hasId(oldId);hasId=me.hasId(newId);oldInternalId=me.internalId;me.phantom=!hasId;if(hasId!==hasOldId||(hasId&&hasOldId)){me.internalId=hasId?newId:Ext.data.Model.id(me);}
me.fireEvent('idchanged',me,oldId,newId,oldInternalId);me.callStore('onIdChanged',oldId,newId,oldInternalId);}},hasId:function(id){if(arguments.length===0){id=this.getId();}
return!!(id||id===0);},join:function(store){var me=this;if(!me.stores.length){me.stores[0]=store;}else{Ext.Array.include(this.stores,store);}
this.store=this.stores[0];},unjoin:function(store){Ext.Array.remove(this.stores,store);this.store=this.stores[0]||null;},afterEdit:function(modifiedFieldNames){this.callStore('afterEdit',modifiedFieldNames);},afterReject:function(){this.callStore('afterReject');},afterCommit:function(modifiedFieldNames){this.callStore('afterCommit',modifiedFieldNames);},callStore:function(fn){var args=Ext.Array.clone(arguments),stores=this.stores,i=0,len=stores.length,store;args[0]=this;for(;i<len;++i){store=stores[i];if(store&&Ext.isFunction(store[fn])){store[fn].apply(store,args);}}},getData:function(includeAssociated){var me=this,fields=me.fields.items,fLen=fields.length,data={},name,f;for(f=0;f<fLen;f++){name=fields[f].name;data[name]=me.get(name);}
if(includeAssociated===true){Ext.apply(data,me.getAssociatedData());}
return data;},getAssociatedData:function(){return this.prepareAssociatedData({},1);},prepareAssociatedData:function(seenKeys,depth){var me=this,associations=me.associations.items,associationCount=associations.length,associationData={},toRead=[],toReadKey=[],toReadIndex=[],associatedStore,associatedRecords,associatedRecord,o,index,result,seenDepth,associationId,associatedRecordCount,association,i,j,type,name;for(i=0;i<associationCount;i++){association=associations[i];associationId=association.associationId;seenDepth=seenKeys[associationId];if(seenDepth&&seenDepth!==depth){continue;}
seenKeys[associationId]=depth;type=association.type;name=association.name;if(type=='hasMany'){associatedStore=me[association.storeName];associationData[name]=[];if(associatedStore&&associatedStore.getCount()>0){associatedRecords=associatedStore.data.items;associatedRecordCount=associatedRecords.length;for(j=0;j<associatedRecordCount;j++){associatedRecord=associatedRecords[j];associationData[name][j]=associatedRecord.getData();toRead.push(associatedRecord);toReadKey.push(name);toReadIndex.push(j);}}}else if(type=='belongsTo'||type=='hasOne'){associatedRecord=me[association.instanceName];if(associatedRecord!==undefined){associationData[name]=associatedRecord.getData();toRead.push(associatedRecord);toReadKey.push(name);toReadIndex.push(-1);}}}
for(i=0,associatedRecordCount=toRead.length;i<associatedRecordCount;++i){associatedRecord=toRead[i];o=associationData[toReadKey[i]];index=toReadIndex[i];result=associatedRecord.prepareAssociatedData(seenKeys,depth+1);if(index===-1){Ext.apply(o,result);}else{Ext.apply(o[index],result);}}
return associationData;}});Ext.define('Ext.view.TableLayout',{extend:'Ext.layout.component.Auto',requires:['Ext.util.CSS'],alias:['layout.tableview'],type:'tableview',beginLayout:function(ownerContext){var me=this,otherSide=me.owner.lockingPartner,owner=me.owner;me.callParent(arguments);if(otherSide){me.lockedGrid=me.owner.up('[lockable]');me.lockedGrid.needsRowHeightSync=true;if(!ownerContext.lockingPartner){ownerContext.lockingPartner=ownerContext.context.getItem(otherSide,otherSide.el);if(ownerContext.lockingPartner&&!ownerContext.lockingPartner.lockingPartner){ownerContext.lockingPartner.lockingPartner=ownerContext;}}}
ownerContext.headerContext=ownerContext.context.getCmp(me.headerCt);if(me.owner.body.dom){ownerContext.bodyContext=ownerContext.getEl(me.owner.body);}
if(Ext.isWebKit){owner.el.select(owner.getBodySelector()).setStyle('table-layout','auto');}},calculate:function(ownerContext){var me=this,lockingPartner=me.lockingPartner,owner=me.owner,contentHeight=0,emptyEl;if(ownerContext.headerContext.hasProp('columnWidthsDone')){if(!me.setColumnWidths(ownerContext)){me.done=false;return;}
ownerContext.state.columnWidthsSynced=true;if(ownerContext.bodyContext){emptyEl=me.owner.el.down('.'+owner.ownerCt.emptyCls,true);if(!emptyEl){contentHeight=ownerContext.bodyContext.el.dom.offsetHeight;ownerContext.bodyContext.setHeight(contentHeight,false);}else{contentHeight=emptyEl.offsetHeight;}
ownerContext.setProp('contentHeight',contentHeight);}
if(lockingPartner&&!lockingPartner.state.columnWidthsSynced){me.done=false;}else{me.callParent(arguments);}}else{me.done=false;}},measureContentHeight:function(ownerContext){var lockingPartner=ownerContext.lockingPartner;if(!ownerContext.bodyContext||(ownerContext.state.columnWidthsSynced&&(!lockingPartner||lockingPartner.state.columnWidthsSynced))){return this.callParent(arguments);}},setColumnWidths:function(ownerContext){var me=this,owner=me.owner,context=ownerContext.context,columns=me.headerCt.getVisibleGridColumns(),column,i=0,len=columns.length,tableWidth=0,columnLineWidth=0,childContext,colWidth,isContentBox=!Ext.isBorderBox;if(context){context.currentLayout=me;}
for(i=0;i<len;i++){column=columns[i];childContext=context.getCmp(column);colWidth=childContext.props.width;if(isNaN(colWidth)){childContext.getProp('width');return false;}
tableWidth+=colWidth;if(isContentBox&&owner.columnLines){if(!columnLineWidth){columnLineWidth=context.getCmp(column).borderInfo.width||1;}
colWidth-=columnLineWidth;}
owner.body.select(owner.getColumnSizerSelector(column)).setWidth(colWidth);}
owner.el.select(owner.getBodySelector()).setWidth(tableWidth);return true;},finishedLayout:function(){var me=this,owner=me.owner;me.callParent(arguments);if(Ext.isWebKit){owner.el.select(owner.getBodySelector()).setStyle('table-layout','');}
if(owner.refreshCounter&&me.lockedGrid&&me.lockedGrid.syncRowHeight&&me.lockedGrid.needsRowHeightSync){me.lockedGrid.syncRowHeights();me.lockedGrid.needsRowHeightSync=false;}}});Ext.define('Ext.selection.Model',{extend:'Ext.util.Observable',alternateClassName:'Ext.AbstractSelectionModel',requires:['Ext.data.StoreManager'],mixins:{bindable:'Ext.util.Bindable'},allowDeselect:undefined,toggleOnClick:true,selected:null,pruneRemoved:true,suspendChange:0,constructor:function(cfg){var me=this;cfg=cfg||{};Ext.apply(me,cfg);me.addEvents('selectionchange','focuschange');me.modes={SINGLE:true,SIMPLE:true,MULTI:true};me.setSelectionMode(cfg.mode||me.mode);me.selected=new Ext.util.MixedCollection(null,me.getSelectionId);me.callParent(arguments);},bindStore:function(store,initial){var me=this;me.mixins.bindable.bindStore.apply(me,arguments);if(me.store&&!initial){me.refresh();}},getStoreListeners:function(){var me=this;return{add:me.onStoreAdd,clear:me.onStoreClear,bulkremove:me.onStoreRemove,update:me.onStoreUpdate,load:me.onStoreLoad,idchanged:me.onModelIdChanged,refresh:me.onStoreRefresh};},suspendChanges:function(){++this.suspendChange;},resumeChanges:function(){if(this.suspendChange){--this.suspendChange;}},selectAll:function(suppressEvent){var me=this,selections=me.store.getRange(),i=0,len=selections.length,start=me.getSelection().length;me.suspendChanges();for(;i<len;i++){me.doSelect(selections[i],true,suppressEvent);}
me.resumeChanges();if(!suppressEvent){me.maybeFireSelectionChange(me.getSelection().length!==start);}},deselectAll:function(suppressEvent){var me=this,selections=me.getSelection(),selIndexes={},store=me.store,start=selections.length,i,l,rec;for(i=0,l=selections.length;i<l;i++){rec=selections[i];selIndexes[rec.internalId]=store.indexOf(rec);}
selections=Ext.Array.sort(selections,function(r1,r2){var idx1=selIndexes[r1.internalId],idx2=selIndexes[r2.internalId];return idx1<idx2?-1:1;});me.suspendChanges();me.doDeselect(selections,suppressEvent);me.resumeChanges();if(!suppressEvent){me.maybeFireSelectionChange(me.getSelection().length!==start);}},selectWithEvent:function(record,e){var me=this,isSelected=me.isSelected(record),shift=e.shiftKey,ctrl=e.ctrlKey,start=me.selectionStart,selected=me.getSelection(),len=selected.length,allowDeselect=me.allowDeselect,toDeselect,i,item;switch(me.selectionMode){case'MULTI':if(shift&&start){me.selectRange(start,record,ctrl);}else if(ctrl&&isSelected){me.doDeselect(record,false);}else if(ctrl){me.doSelect(record,true,false);}else if(isSelected&&!shift&&!ctrl&&len>1){toDeselect=[];for(i=0;i<len;++i){item=selected[i];if(item!==record){toDeselect.push(item);}}
me.doDeselect(toDeselect);}else if(!isSelected){me.doSelect(record,false);}
break;case'SIMPLE':if(isSelected){me.doDeselect(record);}else{me.doSelect(record,true);}
break;case'SINGLE':if(allowDeselect&&!ctrl){allowDeselect=me.toggleOnClick;}
if(allowDeselect&&isSelected){me.doDeselect(record);}else{me.doSelect(record,false);}
break;}
if(!shift){if(me.isSelected(record)){me.selectionStart=record;}else{me.selectionStart=null;}}},afterKeyNavigate:function(e,record){var me=this,recIdx,fromIdx,isSelected=me.isSelected(record),from=(me.selectionStart&&me.isSelected(me.lastFocused))?me.selectionStart:(me.selectionStart=me.lastFocused),key=e.getCharCode(),isSpace=key===e.SPACE,direction=key===e.UP||key===e.PAGE_UP?'up':(key===e.DOWN||key===e.DOWN?'down':null);switch(me.selectionMode){case'MULTI':if(isSpace){if(e.shiftKey){me.selectRange(from,record,e.ctrlKey);}else{if(isSelected){me.doDeselect(record,e.ctrlKey);me.setLastFocused(null);me.setLastFocused(record);}
else{me.doSelect(record,e.ctrlKey);}}}
else if(e.shiftKey&&from){fromIdx=me.store.indexOf(from);recIdx=me.store.indexOf(record);if(direction==='up'&&fromIdx<=recIdx){me.deselectRange(me.lastFocused,recIdx+1);}
else if(direction==='down'&&fromIdx>=recIdx){me.deselectRange(me.lastFocused,recIdx-1);}
else if(from!==record){me.selectRange(from,record,e.ctrlKey);}
me.lastSelected=record;me.setLastFocused(record);}
else if(e.ctrlKey&&isSelected){me.setLastFocused(record);}
else if(e.ctrlKey){me.setLastFocused(record);}
else{me.doSelect(record,false);}
break;case'SIMPLE':if(isSelected){me.doDeselect(record);}else{me.doSelect(record,true);}
break;case'SINGLE':if(isSpace){if(isSelected){me.doDeselect(record);me.setLastFocused(record);}else{me.doSelect(record);}}
else if(e.ctrlKey){me.setLastFocused(record);}
else if(me.allowDeselect&&isSelected){me.doDeselect(record);}
else{me.doSelect(record,false);}
break;}
if(!e.shiftKey){if(me.isSelected(record)){me.selectionStart=record;}}},selectRange:function(startRow,endRow,keepExisting){var me=this,store=me.store,selected=me.selected.items,result,i,len,toSelect,toDeselect,idx,rec;if(me.isLocked()){return;}
result=me.normalizeRowRange(startRow,endRow);startRow=result[0];endRow=result[1];toSelect=[];for(i=startRow;i<=endRow;i++){if(!me.isSelected(store.getAt(i))){toSelect.push(store.getAt(i));}}
if(!keepExisting){toDeselect=[];me.suspendChanges();for(i=0,len=selected.length;i<len;++i){rec=selected[i];idx=store.indexOf(rec);if(idx<startRow||idx>endRow){toDeselect.push(rec)}}
for(i=0,len=toDeselect.length;i<len;++i){me.doDeselect(toDeselect[i]);}
me.resumeChanges();}
me.doMultiSelect(toSelect,true);},deselectRange:function(startRow,endRow){var me=this,store=me.store,result,i,toDeselect,record;if(me.isLocked()){return;}
result=me.normalizeRowRange(startRow,endRow);startRow=result[0];endRow=result[1];toDeselect=[];for(i=startRow;i<=endRow;i++){record=store.getAt(i);if(me.isSelected(record)){toDeselect.push(record);}}
me.doDeselect(toDeselect);},normalizeRowRange:function(startRow,endRow){var store=this.store,tmp;if(!Ext.isNumber(startRow)){startRow=store.indexOf(startRow);}
startRow=Math.max(0,startRow);if(!Ext.isNumber(endRow)){endRow=store.indexOf(endRow);}
endRow=Math.min(endRow,store.getCount()-1);if(startRow>endRow){tmp=endRow;endRow=startRow;startRow=tmp;}
return[startRow,endRow];},onModelIdChanged:function(store,model,oldId,newId,oldInternalId){this.selected.updateKey(oldInternalId,newId);},select:function(records,keepExisting,suppressEvent){if(Ext.isDefined(records)){this.doSelect(records,keepExisting,suppressEvent);}},deselect:function(records,suppressEvent){this.doDeselect(records,suppressEvent);},doSelect:function(records,keepExisting,suppressEvent){var me=this,record;if(me.locked||!me.store){return;}
if(typeof records==="number"){record=me.store.getAt(records);if(!record){return;}
records=[record];}
if(me.selectionMode=="SINGLE"&&records){record=records.length?records[0]:records;me.doSingleSelect(record,suppressEvent);}else{me.doMultiSelect(records,keepExisting,suppressEvent);}},doMultiSelect:function(records,keepExisting,suppressEvent){var me=this,selected=me.selected,change=false,result,i,len,record,commit;if(me.locked){return;}
records=!Ext.isArray(records)?[records]:records;len=records.length;if(!keepExisting&&selected.getCount()>0){result=me.deselectDuringSelect(records,selected.getRange(),suppressEvent);if(result[0]){me.maybeFireSelectionChange(result[1]>0&&!suppressEvent);return;}}
commit=function(){selected.add(record);change=true;};for(i=0;i<len;i++){record=records[i];if(me.isSelected(record)){continue;}
me.lastSelected=record;me.onSelectChange(record,true,suppressEvent,commit);}
if(!me.preventFocus){me.setLastFocused(record,suppressEvent);}
me.maybeFireSelectionChange(change&&!suppressEvent);},deselectDuringSelect:function(toSelect,selected,suppressEvent){var me=this,len=selected.length,changed=0,failed=false,item,i;me.suspendChanges();for(i=0;i<len;++i){item=selected[i];if(!Ext.Array.contains(toSelect,item)){if(me.doDeselect(item,suppressEvent)){++changed;}else{failed=true;}}}
me.resumeChanges();return[failed,changed];},doDeselect:function(records,suppressEvent){var me=this,selected=me.selected,i=0,len,record,attempted=0,accepted=0,commit;if(me.locked||!me.store){return false;}
if(typeof records==="number"){record=me.store.getAt(records);if(!record){return false;}
records=[record];}else if(!Ext.isArray(records)){records=[records];}
commit=function(){++accepted;selected.remove(record);};len=records.length;me.suspendChanges();for(;i<len;i++){record=records[i];if(me.isSelected(record)){if(me.lastSelected===record){me.lastSelected=selected.last();if(me.lastFocused===record){me.setLastFocused(null);}}
++attempted;me.onSelectChange(record,false,suppressEvent,commit);}}
me.resumeChanges();me.maybeFireSelectionChange(accepted>0&&!suppressEvent);return accepted===attempted;},doSingleSelect:function(record,suppressEvent){var me=this,changed=false,selected=me.selected,commit;if(me.locked){return;}
if(me.isSelected(record)){return;}
if(selected.getCount()){me.suspendChanges();if(!me.doDeselect(me.lastSelected,suppressEvent)){me.resumeChanges();return;}
me.resumeChanges();}
commit=function(){selected.add(record);me.lastSelected=record;changed=true;};me.onSelectChange(record,true,suppressEvent,commit);if(changed){if(!suppressEvent&&!me.preventFocus){me.setLastFocused(record);}
me.maybeFireSelectionChange(!suppressEvent);}},setLastFocused:function(record,supressFocus){var me=this,recordBeforeLast=me.lastFocused;if(record!==recordBeforeLast){me.lastFocused=record;me.onLastFocusChanged(recordBeforeLast,record,supressFocus);}},isFocused:function(record){return record===this.getLastFocused();},maybeFireSelectionChange:function(fireEvent){var me=this;if(fireEvent&&!me.suspendChange){me.fireEvent('selectionchange',me,me.getSelection());}},getLastSelected:function(){return this.lastSelected;},getLastFocused:function(){return this.lastFocused;},getSelection:function(){return this.selected.getRange();},getSelectionMode:function(){return this.selectionMode;},setSelectionMode:function(selMode){selMode=selMode?selMode.toUpperCase():'SINGLE';this.selectionMode=this.modes[selMode]?selMode:'SINGLE';},isLocked:function(){return this.locked;},setLocked:function(locked){this.locked=!!locked;},isRangeSelected:function(startRow,endRow){var me=this,store=me.store,i,result;result=me.normalizeRowRange(startRow,endRow);startRow=result[0];endRow=result[1];for(i=startRow;i<=endRow;i++){if(!me.isSelected(store.getAt(i))){return false;}}
return true;},isSelected:function(record){record=Ext.isNumber(record)?this.store.getAt(record):record;return this.selected.contains(record);},hasSelection:function(){return this.selected.getCount()>0;},getSelectionId:function(record){return record.internalId;},pruneIf:function(){var me=this,selected=me.selected,toRemove=[],len=selected.length,i,item;if(me.pruneRemoved){for(i=0;i<len;i++){item=selected.getAt(i);if(!this.storeHasSelected(item)){toRemove.push(item);}}
if(toRemove.length){for(i=0,len=toRemove.length;i<len;i++){selected.remove(toRemove[i]);}
me.maybeFireSelectionChange(true);}}},storeHasSelected:function(record){var store=this.store,records,len,id,i;if(record.hasId()&&store.getById(record)){return true;}else{records=store.data.items;len=records.length;id=record.internalId;for(i=0;i<len;++i){if(id===records[i].internalId){return true;}}}
return false;},refresh:function(){var me=this,store=me.store,rec,toBeSelected=[],toBeReAdded=[],oldSelections=me.getSelection(),len=oldSelections.length,selection,change,i=0,lastFocused=me.getLastFocused();if(!store){return;}
for(;i<len;i++){selection=oldSelections[i];if(store.indexOf(selection)!==-1){toBeSelected.push(selection);}
else if(!me.pruneRemoved){rec=store.getById(selection.getId());if(rec){toBeSelected.push(rec);}
else{toBeReAdded.push(selection)}}
if(me.mode==='SINGLE'&&toBeReAdded.length){break;}}
if(me.selected.getCount()!=(toBeSelected.length+toBeReAdded.length)){change=true;}
me.clearSelections();if(store.indexOf(lastFocused)!==-1){me.setLastFocused(lastFocused,true);}
if(toBeSelected.length){me.doSelect(toBeSelected,false,true);}
if(toBeReAdded.length){me.selected.addAll(toBeReAdded);if(!me.lastSelected){me.lastSelected=toBeReAdded[toBeReAdded.length-1];}}
me.maybeFireSelectionChange(change);},clearSelections:function(){this.selected.clear();this.lastSelected=null;this.setLastFocused(null);},onStoreAdd:Ext.emptyFn,onStoreClear:function(){if(this.selected.getCount()>0){this.clearSelections();this.maybeFireSelectionChange(true);}},onStoreRemove:function(store,records,indexes,isMove){var me=this;if(me.selectionStart&&Ext.Array.contains(records,me.selectionStart)){me.selectionStart=null;}
if(isMove||me.locked||!me.pruneRemoved){return;}
me.deselectDeletedRecords(records);},deselectDeletedRecords:function(records){var me=this,selected=me.selected,i,length=records.length,removed=0,record;for(i=0;i<length;i++){record=records[i];if(selected.remove(record)){if(me.lastSelected==record){me.lastSelected=null;}
if(me.getLastFocused()==record){me.setLastFocused(null);}
++removed;}}
if(removed){me.maybeFireSelectionChange(true);}},getCount:function(){return this.selected.getCount();},onUpdate:Ext.emptyFn,destroy:function(){this.clearListeners();},onStoreUpdate:Ext.emptyFn,onStoreRefresh:Ext.emptyFn,onStoreLoad:Ext.emptyFn,onSelectChange:function(record,isSelected,suppressEvent,commitFn){var me=this,eventName=isSelected?'select':'deselect';if((suppressEvent||me.fireEvent('before'+eventName,me,record))!==false&&commitFn()!==false){if(!suppressEvent){me.fireEvent(eventName,me,record);}}},onLastFocusChanged:function(oldFocused,newFocused){this.fireEvent('focuschange',this,oldFocused,newFocused);},onEditorKey:Ext.emptyFn,beforeViewRender:function(view){this.views=this.views||[];this.views.push(view);this.bindStore(view.getStore(),true);},bindComponent:Ext.emptyFn});Ext.define('Ext.data.AbstractStore',{requires:['Ext.util.MixedCollection','Ext.data.proxy.Proxy','Ext.data.Operation','Ext.util.Filter'],mixins:{observable:'Ext.util.Observable',sortable:'Ext.util.Sortable'},statics:{create:function(store){if(!store.isStore){if(!store.type){store.type='store';}
store=Ext.createByAlias('store.'+store.type,store);}
return store;}},onClassExtended:function(cls,data,hooks){var model=data.model,onBeforeClassCreated;if(typeof model=='string'){onBeforeClassCreated=hooks.onBeforeCreated;hooks.onBeforeCreated=function(){var me=this,args=arguments;Ext.require(model,function(){onBeforeClassCreated.apply(me,args);});};}},remoteSort:false,remoteFilter:false,autoLoad:undefined,autoSync:false,batchUpdateMode:'operation',filterOnLoad:true,sortOnLoad:true,implicitModel:false,defaultProxyType:'memory',isDestroyed:false,isStore:true,sortRoot:'data',constructor:function(config){var me=this,filters;Ext.apply(me,config);me.removed=[];me.mixins.observable.constructor.apply(me,arguments);me.model=Ext.ModelManager.getModel(me.model);Ext.applyIf(me,{modelDefaults:null});if(!me.model&&me.fields){me.model=Ext.define('Ext.data.Store.ImplicitModel-'+(me.storeId||Ext.id()),{extend:'Ext.data.Model',fields:me.fields,proxy:me.proxy||me.defaultProxyType});delete me.fields;me.implicitModel=true;}
me.setProxy(me.proxy||me.model.getProxy());if(!me.disableMetaChangeEvent){me.proxy.on('metachange',me.onMetaChange,me);}
if(me.id&&!me.storeId){me.storeId=me.id;delete me.id;}
if(me.storeId){Ext.data.StoreManager.register(me);}
me.mixins.sortable.initSortable.call(me);filters=me.decodeFilters(me.filters);me.filters=new Ext.util.MixedCollection();me.filters.addAll(filters);},setProxy:function(proxy){var me=this;if(proxy instanceof Ext.data.proxy.Proxy){proxy.setModel(me.model);}else{if(Ext.isString(proxy)){proxy={type:proxy};}
Ext.applyIf(proxy,{model:me.model});proxy=Ext.createByAlias('proxy.'+proxy.type,proxy);}
me.proxy=proxy;return me.proxy;},getProxy:function(){return this.proxy;},onMetaChange:function(proxy,meta){this.fireEvent('metachange',this,meta);},create:function(data,options){var me=this,instance=Ext.ModelManager.create(Ext.applyIf(data,me.modelDefaults),me.model.modelName),operation;options=options||{};Ext.applyIf(options,{action:'create',records:[instance]});operation=new Ext.data.Operation(options);me.proxy.create(operation,me.onProxyWrite,me);return instance;},read:function(){return this.load.apply(this,arguments);},update:function(options){var me=this,operation;options=options||{};Ext.applyIf(options,{action:'update',records:me.getUpdatedRecords()});operation=new Ext.data.Operation(options);return me.proxy.update(operation,me.onProxyWrite,me);},onProxyWrite:function(operation){var me=this,success=operation.wasSuccessful(),records=operation.getRecords();switch(operation.action){case'create':me.onCreateRecords(records,operation,success);break;case'update':me.onUpdateRecords(records,operation,success);break;case'destroy':me.onDestroyRecords(records,operation,success);break;}
if(success){me.fireEvent('write',me,operation);me.fireEvent('datachanged',me);me.fireEvent('refresh',me);}
Ext.callback(operation.callback,operation.scope||me,[records,operation,success]);},onCreateRecords:Ext.emptyFn,onUpdateRecords:Ext.emptyFn,onDestroyRecords:function(records,operation,success){if(success){this.removed=[];}},destroy:function(options){var me=this,operation;options=options||{};Ext.applyIf(options,{action:'destroy',records:me.getRemovedRecords()});operation=new Ext.data.Operation(options);return me.proxy.destroy(operation,me.onProxyWrite,me);},onBatchOperationComplete:function(batch,operation){return this.onProxyWrite(operation);},onBatchComplete:function(batch,operation){var me=this,operations=batch.operations,length=operations.length,i;me.suspendEvents();for(i=0;i<length;i++){me.onProxyWrite(operations[i]);}
me.resumeEvents();me.fireEvent('datachanged',me);me.fireEvent('refresh',me);},onBatchException:function(batch,operation){},filterNew:function(item){return item.phantom===true&&item.isValid();},getNewRecords:function(){return[];},getUpdatedRecords:function(){return[];},getModifiedRecords:function(){return[].concat(this.getNewRecords(),this.getUpdatedRecords());},filterUpdated:function(item){return item.dirty===true&&item.phantom!==true&&item.isValid();},getRemovedRecords:function(){return this.removed;},filter:function(filters,value){},decodeFilters:function(filters){if(!Ext.isArray(filters)){if(filters===undefined){filters=[];}else{filters=[filters];}}
var length=filters.length,Filter=Ext.util.Filter,config,i;for(i=0;i<length;i++){config=filters[i];if(!(config instanceof Filter)){Ext.apply(config,{root:'data'});if(config.fn){config.filterFn=config.fn;}
if(typeof config=='function'){config={filterFn:config};}
filters[i]=new Filter(config);}}
return filters;},clearFilter:function(supressEvent){},isFiltered:function(){},filterBy:function(fn,scope){},sync:function(options){var me=this,operations={},toCreate=me.getNewRecords(),toUpdate=me.getUpdatedRecords(),toDestroy=me.getRemovedRecords(),needsSync=false;if(toCreate.length>0){operations.create=toCreate;needsSync=true;}
if(toUpdate.length>0){operations.update=toUpdate;needsSync=true;}
if(toDestroy.length>0){operations.destroy=toDestroy;needsSync=true;}
if(needsSync&&me.fireEvent('beforesync',operations)!==false){options=options||{};me.proxy.batch(Ext.apply(options,{operations:operations,listeners:me.getBatchListeners()}));}
return me;},getBatchListeners:function(){var me=this,listeners={scope:me,exception:me.onBatchException};if(me.batchUpdateMode=='operation'){listeners.operationcomplete=me.onBatchOperationComplete;}else{listeners.complete=me.onBatchComplete;}
return listeners;},save:function(){return this.sync.apply(this,arguments);},load:function(options){var me=this,operation;options=Ext.apply({action:'read',filters:me.filters.items,sorters:me.getSorters()},options);me.lastOptions=options;operation=new Ext.data.Operation(options);if(me.fireEvent('beforeload',me,operation)!==false){me.loading=true;me.proxy.read(operation,me.onProxyLoad,me);}
return me;},reload:function(options){return this.load(Ext.apply(this.lastOptions,options));},afterEdit:function(record,modifiedFieldNames){var me=this,i,shouldSync;if(me.autoSync&&!me.autoSyncSuspended){for(i=modifiedFieldNames.length;i--;){if(record.fields.get(modifiedFieldNames[i]).persist){shouldSync=true;break;}}
if(shouldSync){me.sync();}}
me.onUpdate(record,Ext.data.Model.EDIT,modifiedFieldNames);me.fireEvent('update',me,record,Ext.data.Model.EDIT,modifiedFieldNames);},afterReject:function(record){this.onUpdate(record,Ext.data.Model.REJECT,null);this.fireEvent('update',this,record,Ext.data.Model.REJECT,null);},afterCommit:function(record,modifiedFieldNames){if(!modifiedFieldNames){modifiedFieldNames=null;}
this.onUpdate(record,Ext.data.Model.COMMIT,modifiedFieldNames);this.fireEvent('update',this,record,Ext.data.Model.COMMIT,modifiedFieldNames);},onUpdate:Ext.emptyFn,onIdChanged:function(model,oldId,newId,oldInternalId){this.fireEvent('idchanged',this,model,oldId,newId,oldInternalId);},destroyStore:function(){var implicitModelName,me=this;if(!me.isDestroyed){me.clearListeners();if(me.storeId){Ext.data.StoreManager.unregister(me);}
me.clearData();me.data=me.tree=me.sorters=me.filters=me.groupers=null;if(me.reader){me.reader.destroyReader();}
me.proxy=me.reader=me.writer=null;me.isDestroyed=true;if(me.implicitModel){implicitModelName=Ext.getClassName(me.model);Ext.undefine(implicitModelName);Ext.ModelManager.unregisterType(implicitModelName);}else{me.model=null;}}},getState:function(){var me=this,hasState,result,hasGroupers=!!me.groupers,groupers=[],sorters=[],filters=[];if(hasGroupers){me.groupers.each(function(g){groupers[groupers.length]=g.serialize();hasState=true;});}
if(me.sorters){me.sorters.each(function(s){if(hasGroupers&&!me.groupers.contains(s)){sorters[sorters.length]=s.serialize();hasState=true;}});}
if(me.filters&&me.statefulFilters){me.filters.each(function(f){filters[filters.length]=f.serialize();hasState=true;});}
if(hasState){result={};if(groupers.length){result.groupers=groupers;}
if(sorters.length){result.sorters=sorters;}
if(filters.length){result.filters=filters;}
return result;}},applyState:function(state){var me=this,hasSorters=!!me.sorters,hasGroupers=!!me.groupers,hasFilters=!!me.filters,locallySorted;if(hasGroupers&&state.groupers){me.groupers.clear();me.groupers.addAll(me.decodeGroupers(state.groupers));}
if(hasSorters&&state.sorters){me.sorters.clear();me.sorters.addAll(me.decodeSorters(state.sorters));}
if(hasFilters&&state.filters){me.filters.clear();me.filters.addAll(me.decodeFilters(state.filters));}
if(hasSorters&&hasGroupers){me.sorters.insert(0,me.groupers.getRange());}
if(me.autoLoad&&(me.remoteSort||me.remoteGroup||me.remoteFilter)){if(me.autoLoad===true){me.reload();}else{me.reload(me.autoLoad);}}
if(hasFilters&&me.filters.length&&!me.remoteFilter){me.filter();locallySorted=me.sortOnFilter;}
if(hasSorters&&me.sorters.length&&!me.remoteSort&&!locallySorted){me.sort();}},doSort:function(sorterFn){var me=this;if(me.remoteSort){me.load();}else{me.data.sortBy(sorterFn);me.fireEvent('datachanged',me);me.fireEvent('refresh',me);}
me.fireEvent('sort',me,me.sorters.getRange());},clearData:Ext.emptyFn,getCount:Ext.emptyFn,getById:Ext.emptyFn,removeAll:Ext.emptyFn,isLoading:function(){return!!this.loading;},suspendAutoSync:function(){this.autoSyncSuspended=true;},resumeAutoSync:function(){this.autoSyncSuspended=false;}});Ext.define('Ext.layout.component.ProgressBar',{alias:['layout.progressbar'],extend:'Ext.layout.component.Auto',type:'progressbar',beginLayout:function(ownerContext){var me=this,i,textEls;me.callParent(arguments);if(!ownerContext.textEls){textEls=me.owner.textEl;if(textEls.isComposite){ownerContext.textEls=[];textEls=textEls.elements;for(i=textEls.length;i--;){ownerContext.textEls[i]=ownerContext.getEl(Ext.get(textEls[i]));}}else{ownerContext.textEls=[ownerContext.getEl('textEl')];}}},calculate:function(ownerContext){var me=this,i,textEls,width;me.callParent(arguments);if(Ext.isNumber(width=ownerContext.getProp('width'))){width-=ownerContext.getBorderInfo().width;textEls=ownerContext.textEls;for(i=textEls.length;i--;){textEls[i].setWidth(width);}}else{me.done=false;}}});Ext.define('Ext.data.proxy.Server',{extend:'Ext.data.proxy.Proxy',alias:'proxy.server',alternateClassName:'Ext.data.ServerProxy',uses:['Ext.data.Request'],pageParam:'page',startParam:'start',limitParam:'limit',groupParam:'group',groupDirectionParam:'groupDir',sortParam:'sort',filterParam:'filter',directionParam:'dir',idParam:'id',simpleSortMode:false,simpleGroupMode:false,noCache:true,cacheString:"_dc",timeout:30000,constructor:function(config){var me=this;config=config||{};me.callParent([config]);me.extraParams=config.extraParams||{};me.api=Ext.apply({},config.api||me.api);me.nocache=me.noCache;},create:function(){return this.doRequest.apply(this,arguments);},read:function(){return this.doRequest.apply(this,arguments);},update:function(){return this.doRequest.apply(this,arguments);},destroy:function(){return this.doRequest.apply(this,arguments);},setExtraParam:function(name,value){this.extraParams[name]=value;},buildRequest:function(operation){var me=this,params=operation.params=Ext.apply({},operation.params,me.extraParams),request;Ext.applyIf(params,me.getParams(operation));if(operation.id!==undefined&&params[me.idParam]===undefined){params[me.idParam]=operation.id;}
request=new Ext.data.Request({params:params,action:operation.action,records:operation.records,operation:operation,url:operation.url,proxy:me});request.url=me.buildUrl(request);operation.request=request;return request;},processResponse:function(success,operation,request,response,callback,scope){var me=this,reader,result;if(success===true){reader=me.getReader();reader.applyDefaults=operation.action==='read';result=reader.read(me.extractResponseData(response));if(result.success!==false){Ext.apply(operation,{response:response,resultSet:result});operation.commitRecords(result.records);operation.setCompleted();operation.setSuccessful();}else{operation.setException(result.message);me.fireEvent('exception',this,response,operation);}}else{me.setException(operation,response);me.fireEvent('exception',this,response,operation);}
if(typeof callback=='function'){callback.call(scope||me,operation);}
me.afterRequest(request,success);},setException:function(operation,response){operation.setException({status:response.status,statusText:response.statusText});},extractResponseData:Ext.identityFn,applyEncoding:function(value){return Ext.encode(value);},encodeSorters:function(sorters){var min=[],length=sorters.length,i=0;for(;i<length;i++){min[i]={property:sorters[i].property,direction:sorters[i].direction};}
return this.applyEncoding(min);},encodeFilters:function(filters){var min=[],length=filters.length,i=0;for(;i<length;i++){min[i]={property:filters[i].property,value:filters[i].value};}
return this.applyEncoding(min);},getParams:function(operation){var me=this,params={},isDef=Ext.isDefined,groupers=operation.groupers,sorters=operation.sorters,filters=operation.filters,page=operation.page,start=operation.start,limit=operation.limit,simpleSortMode=me.simpleSortMode,simpleGroupMode=me.simpleGroupMode,pageParam=me.pageParam,startParam=me.startParam,limitParam=me.limitParam,groupParam=me.groupParam,groupDirectionParam=me.groupDirectionParam,sortParam=me.sortParam,filterParam=me.filterParam,directionParam=me.directionParam,hasGroups,index;if(pageParam&&isDef(page)){params[pageParam]=page;}
if(startParam&&isDef(start)){params[startParam]=start;}
if(limitParam&&isDef(limit)){params[limitParam]=limit;}
hasGroups=groupParam&&groupers&&groupers.length>0;if(hasGroups){if(simpleGroupMode){params[groupParam]=groupers[0].property;params[groupDirectionParam]=groupers[0].direction||'ASC';}else{params[groupParam]=me.encodeSorters(groupers);}}
if(sortParam&&sorters&&sorters.length>0){if(simpleSortMode){index=0;if(sorters.length>1&&hasGroups){index=1;}
params[sortParam]=sorters[index].property;params[directionParam]=sorters[index].direction;}else{params[sortParam]=me.encodeSorters(sorters);}}
if(filterParam&&filters&&filters.length>0){params[filterParam]=me.encodeFilters(filters);}
return params;},buildUrl:function(request){var me=this,url=me.getUrl(request);if(me.noCache){url=Ext.urlAppend(url,Ext.String.format("{0}={1}",me.cacheString,Ext.Date.now()));}
return url;},getUrl:function(request){return request.url||this.api[request.action]||this.url;},doRequest:function(operation,callback,scope){},afterRequest:Ext.emptyFn,onDestroy:function(){Ext.destroy(this.reader,this.writer);}});Ext.define('Ext.dd.DDTarget',{extend:'Ext.dd.DragDrop',constructor:function(id,sGroup,config){if(id){this.initTarget(id,sGroup,config);}},getDragEl:Ext.emptyFn,isValidHandleChild:Ext.emptyFn,startDrag:Ext.emptyFn,endDrag:Ext.emptyFn,onDrag:Ext.emptyFn,onDragDrop:Ext.emptyFn,onDragEnter:Ext.emptyFn,onDragOut:Ext.emptyFn,onDragOver:Ext.emptyFn,onInvalidDrop:Ext.emptyFn,onMouseDown:Ext.emptyFn,onMouseUp:Ext.emptyFn,setXConstraint:Ext.emptyFn,setYConstraint:Ext.emptyFn,resetConstraints:Ext.emptyFn,clearConstraints:Ext.emptyFn,clearTicks:Ext.emptyFn,setInitPosition:Ext.emptyFn,setDragElId:Ext.emptyFn,setHandleElId:Ext.emptyFn,setOuterHandleElId:Ext.emptyFn,addInvalidHandleClass:Ext.emptyFn,addInvalidHandleId:Ext.emptyFn,addInvalidHandleType:Ext.emptyFn,removeInvalidHandleClass:Ext.emptyFn,removeInvalidHandleId:Ext.emptyFn,removeInvalidHandleType:Ext.emptyFn,toString:function(){return("DDTarget "+this.id);}});Ext.define('Ext.layout.container.Anchor',{alias:'layout.anchor',extend:'Ext.layout.container.Auto',alternateClassName:'Ext.layout.AnchorLayout',type:'anchor',defaultAnchor:'100%',parseAnchorRE:/^(r|right|b|bottom)$/i,manageOverflow:true,beginLayoutCycle:function(ownerContext){var me=this,dimensions=0,anchorSpec,childContext,childItems,i,length,target;me.callParent(arguments);childItems=ownerContext.childItems;length=childItems.length;for(i=0;i<length;++i){childContext=childItems[i];anchorSpec=childContext.target.anchorSpec;if(anchorSpec){if(childContext.widthModel.calculated&&anchorSpec.right){dimensions|=1;}
if(childContext.heightModel.calculated&&anchorSpec.bottom){dimensions|=2;}
if(dimensions==3){break;}}}
ownerContext.anchorDimensions=dimensions;},calculateItems:function(ownerContext,containerSize){var me=this,childItems=ownerContext.childItems,length=childItems.length,gotHeight=containerSize.gotHeight,gotWidth=containerSize.gotWidth,ownerHeight=containerSize.height,ownerWidth=containerSize.width,knownDimensions=(gotWidth?1:0)|(gotHeight?2:0),anchorDimensions=ownerContext.anchorDimensions,anchorSpec,childContext,childMargins,height,i,width;if(!anchorDimensions){return true;}
for(i=0;i<length;i++){childContext=childItems[i];childMargins=childContext.getMarginInfo();anchorSpec=childContext.target.anchorSpec;if(gotWidth&&childContext.widthModel.calculated){width=anchorSpec.right(ownerWidth)-childMargins.width;width=me.adjustWidthAnchor(width,childContext);childContext.setWidth(width);}
if(gotHeight&&childContext.heightModel.calculated){height=anchorSpec.bottom(ownerHeight)-childMargins.height;height=me.adjustHeightAnchor(height,childContext);childContext.setHeight(height);}}
return(knownDimensions&anchorDimensions)===anchorDimensions;},anchorFactory:{offset:function(delta){return function(v){return v+delta;};},ratio:function(ratio){return function(v){return Math.floor(v*ratio);};},standard:function(diff){return function(v){return v-diff;};}},parseAnchor:function(a,start,cstart){if(a&&a!='none'){var factory=this.anchorFactory,delta;if(this.parseAnchorRE.test(a)){return factory.standard(cstart-start);}
if(a.indexOf('%')!=-1){return factory.ratio(parseFloat(a.replace('%',''))*0.01);}
delta=parseInt(a,10);if(!isNaN(delta)){return factory.offset(delta);}}
return null;},adjustWidthAnchor:function(value,childContext){return value;},adjustHeightAnchor:function(value,childContext){return value;},configureItem:function(item){var me=this,owner=me.owner,anchor=item.anchor,anchorsArray,anchorWidth,anchorHeight;me.callParent(arguments);if(!item.anchor&&item.items&&!Ext.isNumber(item.width)&&!(Ext.isIE6&&Ext.isStrict)){item.anchor=anchor=me.defaultAnchor;}
if(owner.anchorSize){if(typeof owner.anchorSize=='number'){anchorWidth=owner.anchorSize;}else{anchorWidth=owner.anchorSize.width;anchorHeight=owner.anchorSize.height;}}else{anchorWidth=owner.initialConfig.width;anchorHeight=owner.initialConfig.height;}
if(anchor){anchorsArray=anchor.split(' ');item.anchorSpec={right:me.parseAnchor(anchorsArray[0],item.initialConfig.width,anchorWidth),bottom:me.parseAnchor(anchorsArray[1],item.initialConfig.height,anchorHeight)};}},sizePolicy:{$:{readsWidth:1,readsHeight:1,setsWidth:0,setsHeight:0},b:{readsWidth:1,readsHeight:0,setsWidth:0,setsHeight:1},r:{$:{readsWidth:0,readsHeight:1,setsWidth:1,setsHeight:0},b:{readsWidth:0,readsHeight:0,setsWidth:1,setsHeight:1}}},getItemSizePolicy:function(item){var anchorSpec=item.anchorSpec,key='$',policy=this.sizePolicy,sizeModel;if(anchorSpec){sizeModel=this.owner.getSizeModel();if(anchorSpec.right&&!sizeModel.width.shrinkWrap){policy=policy.r;}
if(anchorSpec.bottom&&!sizeModel.height.shrinkWrap){key='b';}}
return policy[key];}});Ext.define('Ext.layout.component.Button',{alias:['layout.button'],extend:'Ext.layout.component.Auto',type:'button',htmlRE:/<.*>/,beginLayout:function(ownerContext){var me=this,owner=me.owner,text=owner.text;me.callParent(arguments);ownerContext.btnWrapContext=ownerContext.getEl('btnWrap');ownerContext.btnElContext=ownerContext.getEl('btnEl');ownerContext.btnInnerElContext=ownerContext.getEl('btnInnerEl');ownerContext.btnIconElContext=ownerContext.getEl('btnIconEl');if(text&&me.htmlRE.test(text)){ownerContext.isHtmlText=true;owner.btnInnerEl.setStyle('line-height','normal');owner.btnInnerEl.setStyle('padding-top','');}},beginLayoutCycle:function(ownerContext){var owner=this.owner,lastWidthModel=this.lastWidthModel;this.callParent(arguments);if(lastWidthModel&&!this.lastWidthModel.shrinkWrap&&ownerContext.widthModel.shrinkWrap){owner.btnWrap.setStyle('height','');owner.btnEl.setStyle('height','');owner.btnInnerEl.setStyle('line-height','');}},calculate:function(ownerContext){var me=this,owner=me.owner,btnElContext=ownerContext.btnElContext,btnInnerElContext=ownerContext.btnInnerElContext,btnWrapContext=ownerContext.btnWrapContext,mmax=Math.max,ownerHeight,contentHeight,btnElHeight,innerElHeight;me.callParent(arguments);if(ownerContext.heightModel.shrinkWrap){btnElHeight=owner.btnEl.getHeight();if(ownerContext.isHtmlText){me.centerInnerEl(ownerContext,btnElHeight);me.ieCenterIcon(ownerContext,btnElHeight);}}else{ownerHeight=ownerContext.getProp('height');if(ownerHeight){contentHeight=ownerHeight-ownerContext.getFrameInfo().height-ownerContext.getPaddingInfo().height;btnElHeight=contentHeight;if((owner.menu||owner.split)&&owner.arrowAlign==='bottom'){btnElHeight-=btnWrapContext.getPaddingInfo().bottom;}
innerElHeight=btnElHeight;if((owner.icon||owner.iconCls||owner.glyph)&&(owner.iconAlign==='top'||owner.iconAlign==='bottom')){innerElHeight-=btnInnerElContext.getPaddingInfo().height;}
btnWrapContext.setProp('height',mmax(0,contentHeight));btnElContext.setProp('height',mmax(0,btnElHeight));if(ownerContext.isHtmlText){me.centerInnerEl(ownerContext,btnElHeight);}else{btnInnerElContext.setProp('line-height',mmax(0,innerElHeight)+'px');}
me.ieCenterIcon(ownerContext,btnElHeight);}else if(ownerHeight!==0){me.done=false;}}},centerInnerEl:function(ownerContext,btnElHeight){var me=this,btnInnerElContext=ownerContext.btnInnerElContext,innerElHeight=me.owner.btnInnerEl.getHeight();if(ownerContext.heightModel.shrinkWrap&&(btnElHeight<innerElHeight)){ownerContext.btnElContext.setHeight(innerElHeight);}else if(btnElHeight>innerElHeight){btnInnerElContext.setProp('padding-top',Math.round((btnElHeight-innerElHeight)/2)+
btnInnerElContext.getPaddingInfo().top);}},ieCenterIcon:function(ownerContext,btnElHeight){var iconAlign=this.owner.iconAlign;if((Ext.isIEQuirks||Ext.isIE6)&&(iconAlign==='left'||iconAlign==='right')){ownerContext.btnIconElContext.setHeight(btnElHeight);}},publishInnerWidth:function(ownerContext,width){if(this.owner.getFrameInfo().table){ownerContext.btnInnerElContext.setWidth(width-
ownerContext.getFrameInfo().width-ownerContext.getPaddingInfo().width-
ownerContext.btnWrapContext.getPaddingInfo().width);}}});Ext.define('Ext.dd.DD',{extend:'Ext.dd.DragDrop',requires:['Ext.dd.DragDropManager'],constructor:function(id,sGroup,config){if(id){this.init(id,sGroup,config);}},scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX,y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY),fly=el.dom?el:Ext.fly(el,'_dd'),elSize=fly.getSize(),EL=Ext.Element,vpSize,aCoord,newLeft,newTop;if(!this.deltaSetXY){vpSize=this.cachedViewportSize={width:EL.getDocumentWidth(),height:EL.getDocumentHeight()};aCoord=[Math.max(0,Math.min(oCoord.x,vpSize.width-elSize.width)),Math.max(0,Math.min(oCoord.y,vpSize.height-elSize.height))];fly.setXY(aCoord);newLeft=this.getLocalX(fly);newTop=fly.getLocalY();this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{vpSize=this.cachedViewportSize;this.setLocalXY(fly,Math.max(0,Math.min(oCoord.x+this.deltaSetXY[0],vpSize.width-elSize.width)),Math.max(0,Math.min(oCoord.y+this.deltaSetXY[1],vpSize.height-elSize.height)));}
this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);return oCoord;},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=Ext.Element.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=Ext.Element.getViewHeight(),clientW=Ext.Element.getViewWidth(),st=this.DDMInstance.getScrollTop(),sl=this.DDMInstance.getScrollLeft(),bot=h+y,right=w+x,toBot=(clientH+st-y-this.deltaY),toRight=(clientW+sl-x-this.deltaX),thresh=40,scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}
if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}
if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}
if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX,y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}
if(x>this.maxX){x=this.maxX;}}
if(this.constrainY){if(y<this.minY){y=this.minY;}
if(y>this.maxY){y=this.maxY;}}
x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},applyConfig:function(){this.callParent();this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.autoOffset(e.getPageX(),e.getPageY());},b4Drag:function(e){this.setDragElPos(e.getPageX(),e.getPageY());},toString:function(){return("DD "+this.id);},getLocalX:function(el){return el.getLocalX();},setLocalXY:function(el,x,y){el.setLocalXY(x,y);}});Ext.define('Ext.layout.component.Body',{alias:['layout.body'],extend:'Ext.layout.component.Auto',type:'body',beginLayout:function(ownerContext){this.callParent(arguments);ownerContext.bodyContext=ownerContext.getEl('body');},beginLayoutCycle:function(ownerContext,firstCycle){var me=this,lastWidthModel=me.lastWidthModel,lastHeightModel=me.lastHeightModel,body=me.owner.body;me.callParent(arguments);if(lastWidthModel&&lastWidthModel.fixed&&ownerContext.widthModel.shrinkWrap){body.setWidth(null);}
if(lastHeightModel&&lastHeightModel.fixed&&ownerContext.heightModel.shrinkWrap){body.setHeight(null);}},calculateOwnerHeightFromContentHeight:function(ownerContext,contentHeight){var height=this.callParent(arguments);if(ownerContext.targetContext!=ownerContext){height+=ownerContext.getPaddingInfo().height;}
return height;},calculateOwnerWidthFromContentWidth:function(ownerContext,contentWidth){var width=this.callParent(arguments);if(ownerContext.targetContext!=ownerContext){width+=ownerContext.getPaddingInfo().width;}
return width;},measureContentWidth:function(ownerContext){return ownerContext.bodyContext.setWidth(ownerContext.bodyContext.el.dom.offsetWidth,false);},measureContentHeight:function(ownerContext){return ownerContext.bodyContext.setHeight(ownerContext.bodyContext.el.dom.offsetHeight,false);},publishInnerHeight:function(ownerContext,height){var innerHeight=height-ownerContext.getFrameInfo().height,targetContext=ownerContext.targetContext;if(targetContext!=ownerContext){innerHeight-=ownerContext.getPaddingInfo().height;}
return ownerContext.bodyContext.setHeight(innerHeight,!ownerContext.heightModel.natural);},publishInnerWidth:function(ownerContext,width){var innerWidth=width-ownerContext.getFrameInfo().width,targetContext=ownerContext.targetContext;if(targetContext!=ownerContext){innerWidth-=ownerContext.getPaddingInfo().width;}
ownerContext.bodyContext.setWidth(innerWidth,!ownerContext.widthModel.natural);}});Ext.define('Ext.grid.ColumnComponentLayout',{extend:'Ext.layout.component.Auto',alias:'layout.columncomponent',type:'columncomponent',setWidthInDom:true,beginLayout:function(ownerContext){var me=this;me.callParent(arguments);ownerContext.titleContext=ownerContext.getEl('titleEl');ownerContext.triggerContext=ownerContext.getEl('triggerEl');},beginLayoutCycle:function(ownerContext){var me=this,owner=me.owner;me.callParent(arguments);if(ownerContext.widthModel.shrinkWrap){owner.el.setWidth('');}
var borderRightWidth=owner.isLast&&owner.isSubHeader?'0':'';if(borderRightWidth!==me.lastBorderRightWidth){owner.el.dom.style.borderRightWidth=me.lasBorderRightWidth=borderRightWidth;}
owner.titleEl.setStyle({paddingTop:'',paddingBottom:''});},publishInnerHeight:function(ownerContext,outerHeight){if(!outerHeight){return;}
var me=this,owner=me.owner,innerHeight=outerHeight-ownerContext.getBorderInfo().height,availableHeight=innerHeight,textHeight,titleHeight,pt,pb;if(!owner.noWrap&&!ownerContext.hasDomProp('width')){me.done=false;return;}
if(ownerContext.hasRawContent){titleHeight=availableHeight;textHeight=owner.textEl.getHeight();if(textHeight){availableHeight-=textHeight;if(availableHeight>0){pt=Math.floor(availableHeight/2);pb=availableHeight-pt;ownerContext.titleContext.setProp('padding-top',pt);ownerContext.titleContext.setProp('padding-bottom',pb);}}}
else{titleHeight=owner.titleEl.getHeight();ownerContext.setProp('innerHeight',innerHeight-titleHeight,false);}
if((Ext.isIE6||Ext.isIEQuirks)&&ownerContext.triggerContext){ownerContext.triggerContext.setHeight(titleHeight);}},measureContentHeight:function(ownerContext){return ownerContext.el.dom.offsetHeight;},publishOwnerHeight:function(ownerContext,contentHeight){this.callParent(arguments);if((Ext.isIE6||Ext.isIEQuirks)&&ownerContext.triggerContext){ownerContext.triggerContext.setHeight(contentHeight);}},publishInnerWidth:function(ownerContext,outerWidth){if(!ownerContext.hasRawContent){ownerContext.setProp('innerWidth',outerWidth-ownerContext.getBorderInfo().width,false);}},calculateOwnerHeightFromContentHeight:function(ownerContext,contentHeight){var result=this.callParent(arguments);if(!ownerContext.hasRawContent){if(this.owner.noWrap||ownerContext.hasDomProp('width')){return contentHeight+this.owner.titleEl.getHeight()+ownerContext.getBorderInfo().height;}
return null;}
return result;},calculateOwnerWidthFromContentWidth:function(ownerContext,contentWidth){var owner=this.owner,inner=Math.max(contentWidth,owner.textEl.getWidth()+ownerContext.titleContext.getPaddingInfo().width),padWidth=ownerContext.getPaddingInfo().width,triggerOffset=this.getTriggerOffset(owner,ownerContext);return inner+padWidth+triggerOffset;},getTriggerOffset:function(owner,ownerContext){var width=0;if(ownerContext.widthModel.shrinkWrap&&!owner.menuDisabled){if(owner.query('>:not([hidden])').length===0){width=owner.self.triggerElWidth;}}
return width;}});Ext.define('Ext.layout.component.BoundList',{extend:'Ext.layout.component.Auto',alias:'layout.boundlist',type:'component',beginLayout:function(ownerContext){var me=this,owner=me.owner,toolbar=owner.pagingToolbar;me.callParent(arguments);if(owner.floating){ownerContext.savedXY=owner.getXY();owner.setXY([0,-9999]);}
if(toolbar){ownerContext.toolbarContext=ownerContext.context.getCmp(toolbar);}
ownerContext.listContext=ownerContext.getEl('listEl');},beginLayoutCycle:function(ownerContext){var owner=this.owner;this.callParent(arguments);if(ownerContext.heightModel.auto){owner.el.setHeight('auto');owner.listEl.setHeight('auto');}},getLayoutItems:function(){var toolbar=this.owner.pagingToolbar;return toolbar?[toolbar]:[];},isValidParent:function(){return true;},finishedLayout:function(ownerContext){var xy=ownerContext.savedXY;this.callParent(arguments);if(xy){this.owner.setXY(xy);}},measureContentWidth:function(ownerContext){return this.owner.listEl.getWidth();},measureContentHeight:function(ownerContext){return this.owner.listEl.getHeight();},publishInnerHeight:function(ownerContext,height){var toolbar=ownerContext.toolbarContext,toolbarHeight=0;if(toolbar){toolbarHeight=toolbar.getProp('height');}
if(toolbarHeight===undefined){this.done=false;}else{ownerContext.listContext.setHeight(height-ownerContext.getFrameInfo().height-toolbarHeight);}},calculateOwnerHeightFromContentHeight:function(ownerContext){var height=this.callParent(arguments),toolbar=ownerContext.toolbarContext;if(toolbar){height+=toolbar.getProp('height');}
return height;}});Ext.define('Ext.data.proxy.Client',{extend:'Ext.data.proxy.Proxy',alternateClassName:'Ext.data.ClientProxy',isSynchronous:true,clear:function(){}});Ext.define('Ext.layout.component.field.Field',{extend:'Ext.layout.component.Auto',alias:'layout.field',uses:['Ext.tip.QuickTip','Ext.util.TextMetrics','Ext.util.CSS'],type:'field',naturalSizingProp:'size',beginLayout:function(ownerContext){var me=this,owner=me.owner;me.callParent(arguments);ownerContext.labelStrategy=me.getLabelStrategy();ownerContext.errorStrategy=me.getErrorStrategy();ownerContext.labelContext=ownerContext.getEl('labelEl');ownerContext.bodyCellContext=ownerContext.getEl('bodyEl');ownerContext.inputContext=ownerContext.getEl('inputEl');ownerContext.errorContext=ownerContext.getEl('errorEl');if(Ext.isIE7m&&Ext.isStrict&&ownerContext.inputContext){me.ieInputWidthAdjustment=ownerContext.inputContext.getPaddingInfo().width+ownerContext.inputContext.getBorderInfo().width;}
ownerContext.labelStrategy.prepare(ownerContext,owner);ownerContext.errorStrategy.prepare(ownerContext,owner);},beginLayoutCycle:function(ownerContext){var me=this,owner=me.owner,widthModel=ownerContext.widthModel,ownerNaturalSize=owner[me.naturalSizingProp],width;me.callParent(arguments);if(widthModel.shrinkWrap){me.beginLayoutShrinkWrap(ownerContext);}else if(widthModel.natural){if(typeof ownerNaturalSize=='number'&&!owner.inputWidth){me.beginLayoutFixed(ownerContext,(width=ownerNaturalSize*6.5+20),'px');}
else{me.beginLayoutShrinkWrap(ownerContext);}
ownerContext.setWidth(width,false);}else{me.beginLayoutFixed(ownerContext,'100','%');}},beginLayoutFixed:function(ownerContext,width,suffix){var owner=ownerContext.target,inputEl=owner.inputEl,inputWidth=owner.inputWidth;owner.el.setStyle('table-layout','fixed');owner.bodyEl.setStyle('width',width+suffix);if(inputEl){if(inputWidth){inputEl.setStyle('width',inputWidth+'px');}else{inputEl.setStyle('width',owner.stretchInputElFixed?'100%':'');}}
ownerContext.isFixed=true;},beginLayoutShrinkWrap:function(ownerContext){var owner=ownerContext.target,inputEl=owner.inputEl,inputWidth=owner.inputWidth;if(inputEl&&inputEl.dom){inputEl.dom.removeAttribute('size');if(inputWidth){inputEl.setStyle('width',inputWidth+'px');}else{inputEl.setStyle('width','');}}
owner.el.setStyle('table-layout','auto');owner.bodyEl.setStyle('width','');},finishedLayout:function(ownerContext){var owner=this.owner;this.callParent(arguments);ownerContext.labelStrategy.finishedLayout(ownerContext,owner);ownerContext.errorStrategy.finishedLayout(ownerContext,owner);},calculateOwnerHeightFromContentHeight:function(ownerContext,contentHeight){return contentHeight;},measureContentHeight:function(ownerContext){return ownerContext.el.getHeight();},measureContentWidth:function(ownerContext){return ownerContext.el.getWidth();},measureLabelErrorHeight:function(ownerContext){return ownerContext.labelStrategy.getHeight(ownerContext)+
ownerContext.errorStrategy.getHeight(ownerContext);},onFocus:function(){this.getErrorStrategy().onFocus(this.owner);},getLabelStrategy:function(){var me=this,strategies=me.labelStrategies,labelAlign=me.owner.labelAlign;return strategies[labelAlign]||strategies.base;},getErrorStrategy:function(){var me=this,owner=me.owner,strategies=me.errorStrategies,msgTarget=owner.msgTarget;return!owner.preventMark&&Ext.isString(msgTarget)?(strategies[msgTarget]||strategies.elementId):strategies.none;},labelStrategies:(function(){var base={prepare:function(ownerContext,owner){var cls=owner.labelCls+'-'+owner.labelAlign,labelEl=owner.labelEl;if(labelEl){labelEl.addCls(cls);}},getHeight:function(){return 0;},finishedLayout:Ext.emptyFn};return{base:base,top:Ext.applyIf({getHeight:function(ownerContext){var labelContext=ownerContext.labelContext,props=labelContext.props,height=props.height;if(height===undefined){props.height=height=labelContext.el.getHeight();}
return height;}},base),left:base,right:base};}()),errorStrategies:(function(){function showTip(owner){var tip=Ext.layout.component.field.Field.tip,target;if(tip&&tip.isVisible()){target=tip.activeTarget;if(target&&target.el===owner.getActionEl().dom){tip.toFront(true);}}}
var applyIf=Ext.applyIf,emptyFn=Ext.emptyFn,iconCls=Ext.baseCSSPrefix+'form-invalid-icon',iconWidth,base={prepare:function(ownerContext,owner){var el=owner.errorEl;if(el){el.setDisplayed(false);}},getHeight:function(){return 0;},onFocus:emptyFn,finishedLayout:emptyFn};return{none:base,side:applyIf({prepare:function(ownerContext,owner){var errorEl=owner.errorEl,sideErrorCell=owner.sideErrorCell,displayError=owner.hasActiveError(),tempEl;if(!iconWidth){iconWidth=(tempEl=Ext.getBody().createChild({style:'position:absolute',cls:iconCls})).getWidth();tempEl.remove();}
errorEl.addCls(iconCls);errorEl.set({'data-errorqtip':owner.getActiveError()||''});if(owner.autoFitErrors){errorEl.setDisplayed(displayError);}
else{errorEl.setVisible(displayError);}
if(sideErrorCell&&owner.autoFitErrors){sideErrorCell.setDisplayed(displayError);}
owner.bodyEl.dom.colSpan=owner.getBodyColspan();Ext.layout.component.field.Field.initTip();},onFocus:showTip},base),under:applyIf({prepare:function(ownerContext,owner){var errorEl=owner.errorEl,cls=Ext.baseCSSPrefix+'form-invalid-under';errorEl.addCls(cls);errorEl.setDisplayed(owner.hasActiveError());},getHeight:function(ownerContext){var height=0,errorContext,props;if(ownerContext.target.hasActiveError()){errorContext=ownerContext.errorContext;props=errorContext.props;height=props.height;if(height===undefined){props.height=height=errorContext.el.getHeight();}}
return height;}},base),qtip:applyIf({prepare:function(ownerContext,owner){Ext.layout.component.field.Field.initTip();owner.getActionEl().dom.setAttribute('data-errorqtip',owner.getActiveError()||'');},onFocus:showTip},base),title:applyIf({prepare:function(ownerContext,owner){owner.getActionEl().dom.setAttribute('title',owner.getActiveError()||'');}},base),elementId:applyIf({prepare:function(ownerContext,owner){var targetEl=Ext.fly(owner.msgTarget);if(targetEl){targetEl.dom.innerHTML=owner.getActiveError()||'';targetEl.setDisplayed(owner.hasActiveError());}}},base)};}()),statics:{initTip:function(){var tip=this.tip;if(!tip){tip=this.tip=Ext.create('Ext.tip.QuickTip',{ui:'form-invalid'});tip.tagConfig=Ext.apply({},{attribute:'errorqtip'},tip.tagConfig);}},destroyTip:function(){var tip=this.tip;if(tip){tip.destroy();delete this.tip;}}}});Ext.define('Ext.selection.CellModel',{extend:'Ext.selection.Model',alias:'selection.cellmodel',requires:['Ext.grid.CellContext','Ext.util.KeyNav'],isCellModel:true,enableKeyNav:true,preventWrap:false,noSelection:{row:-1,column:-1},constructor:function(){this.addEvents('deselect','select');this.callParent(arguments);},bindComponent:function(view){var me=this,grid=view.ownerCt;me.primaryView=view;me.views=me.views||[];me.views.push(view);me.bindStore(view.getStore(),true);view.on({cellmousedown:me.onMouseDown,refresh:me.onViewRefresh,scope:me});if(grid.optimizedColumnMove!==false){grid.on('columnmove',me.onColumnMove,me);}
if(me.enableKeyNav){me.initKeyNav(view);}},initKeyNav:function(view){var me=this;if(!view.rendered){view.on('render',Ext.Function.bind(me.initKeyNav,me,[view],0),me,{single:true});return;}
view.el.set({tabIndex:-1});me.keyNav=new Ext.util.KeyNav({target:view.el,ignoreInputFields:true,up:me.onKeyUp,down:me.onKeyDown,right:me.onKeyRight,left:me.onKeyLeft,tab:me.onKeyTab,scope:me});},getHeaderCt:function(){var selection=this.getCurrentPosition(),view=selection?selection.view:this.primaryView;return view.headerCt;},onKeyUp:function(e){this.doMove('up',e);},onKeyDown:function(e){this.doMove('down',e);},onKeyLeft:function(e){this.doMove('left',e);},onKeyRight:function(e){this.doMove('right',e);},doMove:function(direction,e){this.keyNavigation=true;this.move(direction,e);this.keyNavigation=false;},onVetoUIEvent:Ext.emptyFn,select:function(pos,keepExisting,suppressEvent){var me=this,row,oldPos=me.getCurrentPosition(),store=me.view.store;if(pos||pos===0){if(pos.isModel){row=store.indexOf(pos);if(row!==-1){pos={row:row,column:oldPos?oldPos.column:0};}else{pos=null;}}else if(typeof pos==='number'){pos={row:pos,column:0}}}
if(pos){me.selectByPosition(pos,suppressEvent);}else{me.deselect();}},deselect:function(record,suppressEvent){this.selectByPosition(null,suppressEvent);},move:function(dir,e){var me=this,pos=me.getCurrentPosition(),newPos;if(pos){newPos=pos.view.walkCells(pos,dir,e,me.preventWrap);if(newPos){newPos.view=pos.view;return me.setCurrentPosition(newPos);}}},getCurrentPosition:function(){return this.selecting?this.nextSelection:this.selection;},setCurrentPosition:function(pos,suppressEvent){var me=this,last=me.selection;me.lastSelection=last;if(last){if(pos&&(pos.record===last.record&&pos.columnHeader===last.columnHeader&&pos.view===last.view)){pos=null;}else{me.onCellDeselect(me.selection,suppressEvent);}}
if(pos){me.nextSelection=new Ext.grid.CellContext(me.primaryView).setPosition(pos);me.selecting=true;me.onCellSelect(me.nextSelection,suppressEvent);me.selecting=false;return(me.selection=me.nextSelection);}},isCellSelected:function(view,row,column){var me=this,testPos,pos=me.getCurrentPosition();if(pos&&pos.view===view){testPos=new Ext.grid.CellContext(view).setPosition({row:row,column:column});return(testPos.record===pos.record)&&(testPos.columnHeader===pos.columnHeader);}},onStoreRemove:function(store,records,indexes){var me=this,pos=me.getCurrentPosition(),i,length=records.length,index,shuffleCount=0;me.callParent(arguments);if(pos){if(indexes[0]>pos.row){return;}
for(i=0;i<length;i++){index=indexes[i];if(index<pos.row){shuffleCount++;}
else{break;}}
if(shuffleCount){pos.setRow(pos.row-shuffleCount);}}},onMouseDown:function(view,cell,cellIndex,record,row,recordIndex,e){if(recordIndex!==-1){this.setCurrentPosition({view:view,row:row,column:cellIndex});}},onCellSelect:function(position,supressEvent){if(position&&position.row!==undefined&&position.row>-1){this.doSelect(position.record,false,supressEvent);}},onCellDeselect:function(position,supressEvent){if(position&&position.row!==undefined){this.doDeselect(position.record,supressEvent);}},onSelectChange:function(record,isSelected,suppressEvent,commitFn){var me=this,pos,eventName,view;if(isSelected){pos=me.nextSelection;eventName='select';}else{pos=me.lastSelection||me.noSelection;eventName='deselect';}
view=pos.view||me.primaryView;if((suppressEvent||me.fireEvent('before'+eventName,me,record,pos.row,pos.column))!==false&&commitFn()!==false){if(isSelected){view.focusRow(record,true);view.onCellSelect(pos);}else{view.onCellDeselect(pos);delete me.selection;}
if(!suppressEvent){me.fireEvent(eventName,me,record,pos.row,pos.column);}}},onKeyTab:function(e,t){var me=this,pos=me.getCurrentPosition(),editingPlugin;if(pos){editingPlugin=pos.view.editingPlugin;if(editingPlugin&&me.wasEditing){me.onEditorTab(editingPlugin,e)}else{me.move(e.shiftKey?'left':'right',e);}}},onEditorTab:function(editingPlugin,e){var me=this,direction=e.shiftKey?'left':'right',position=me.move(direction,e);if(position){if(editingPlugin.startEdit(position.record,position.columnHeader)){me.wasEditing=false;}
else{me.wasEditing=true;}}},refresh:function(){var pos=this.getCurrentPosition(),selRowIdx;if(pos&&(selRowIdx=this.store.indexOf(this.selected.last()))!==-1){pos.row=selRowIdx;}},onColumnMove:function(headerCt,header,fromIdx,toIdx){var grid=headerCt.up('tablepanel');if(grid){this.onViewRefresh(grid.view);}},onUpdate:function(record){var me=this,pos;if(me.isSelected(record)){pos=me.selecting?me.nextSelection:me.selection;me.view.onCellSelect(pos);}},onViewRefresh:function(view){var me=this,pos=me.getCurrentPosition(),headerCt=view.headerCt,record,columnHeader;if(pos&&pos.view===view){record=pos.record;columnHeader=pos.columnHeader;if(!columnHeader.isDescendantOf(headerCt)){columnHeader=headerCt.queryById(columnHeader.id)||headerCt.down('[text="'+columnHeader.text+'"]')||headerCt.down('[dataIndex="'+columnHeader.dataIndex+'"]');}
if(columnHeader&&(view.store.indexOfId(record.getId())!==-1)){me.setCurrentPosition({row:record,column:columnHeader,view:view});}}},selectByPosition:function(position,suppressEvent){this.setCurrentPosition(position,suppressEvent);}});Ext.define('Ext.dd.DropTarget',{extend:'Ext.dd.DDTarget',requires:['Ext.dd.ScrollManager'],constructor:function(el,config){this.el=Ext.get(el);Ext.apply(this,config);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el);}
this.callParent([this.el.dom,this.ddGroup||this.group,{isTarget:true}]);},dropAllowed:Ext.baseCSSPrefix+'dd-drop-ok',dropNotAllowed:Ext.baseCSSPrefix+'dd-drop-nodrop',isTarget:true,isNotifyTarget:true,notifyEnter:function(dd,e,data){if(this.overClass){this.el.addCls(this.overClass);}
return this.dropAllowed;},notifyOver:function(dd,e,data){return this.dropAllowed;},notifyOut:function(dd,e,data){if(this.overClass){this.el.removeCls(this.overClass);}},notifyDrop:function(dd,e,data){return false;},destroy:function(){this.callParent();if(this.containerScroll){Ext.dd.ScrollManager.unregister(this.el);}}});Ext.define('Ext.selection.RowModel',{extend:'Ext.selection.Model',alias:'selection.rowmodel',requires:['Ext.util.KeyNav'],deltaScroll:5,enableKeyNav:true,ignoreRightMouseSelection:false,constructor:function(){this.addEvents('beforedeselect','beforeselect','deselect','select');this.views=[];this.callParent(arguments);},bindComponent:function(view){var me=this;view.on({itemmousedown:me.onRowMouseDown,itemclick:me.onRowClick,scope:me});if(me.enableKeyNav){me.initKeyNav(view);}},initKeyNav:function(view){var me=this;if(!view.rendered){view.on('render',Ext.Function.bind(me.initKeyNav,me,[view],0),me,{single:true});return;}
view.el.set({tabIndex:-1});me.keyNav=new Ext.util.KeyNav({target:view,ignoreInputFields:true,eventName:'itemkeydown',processEvent:function(view,record,node,index,event){event.record=record;event.recordIndex=index;return event;},up:me.onKeyUp,down:me.onKeyDown,right:me.onKeyRight,left:me.onKeyLeft,pageDown:me.onKeyPageDown,pageUp:me.onKeyPageUp,home:me.onKeyHome,end:me.onKeyEnd,space:me.onKeySpace,enter:me.onKeyEnter,scope:me});},onUpdate:function(record){var me=this,view=me.view,index;if(view&&me.isSelected(record)){index=view.indexOf(record);view.onRowSelect(index);if(record===me.lastFocused){view.onRowFocus(index,true);}}},getRowsVisible:function(){var rowsVisible=false,view=this.views[0],firstRow=view.all.first(),rowHeight,gridViewHeight;if(firstRow){rowHeight=firstRow.getHeight();gridViewHeight=view.el.getHeight();rowsVisible=Math.floor(gridViewHeight/rowHeight);}
return rowsVisible;},onKeyEnd:function(e){var me=this,view=me.views[0];if(view.bufferedRenderer){view.bufferedRenderer.scrollTo(me.store.getCount()-1,false,function(newIdx,newRecord){me.afterKeyNavigate(e,newRecord)});}else{me.afterKeyNavigate(e,view.getRecord(view.all.getCount()-1))}},onKeyHome:function(e){var me=this,view=me.views[0];if(view.bufferedRenderer){view.bufferedRenderer.scrollTo(0,false,function(newIdx,newRecord){me.afterKeyNavigate(e,newRecord)});}else{me.afterKeyNavigate(e,view.getRecord(0));}},onKeyPageUp:function(e){var me=this,view=me.views[0],rowsVisible=me.getRowsVisible(),newIdx,newRecord;if(rowsVisible){if(view.bufferedRenderer){newIdx=Math.max(e.recordIndex-rowsVisible,0);(me.lastKeyEvent||(me.lastKeyEvent=new Ext.EventObjectImpl())).setEvent(e.browserEvent);view.bufferedRenderer.scrollTo(newIdx,false,me.afterBufferedScrollTo,me);}else{newRecord=view.walkRecs(e.record,-rowsVisible);me.afterKeyNavigate(e,newRecord);}}},onKeyPageDown:function(e){var me=this,view=me.views[0],rowsVisible=me.getRowsVisible(),newIdx,newRecord;if(rowsVisible){if(view.bufferedRenderer){newIdx=Math.min(e.recordIndex+rowsVisible,me.store.getCount()-1);(me.lastKeyEvent||(me.lastKeyEvent=new Ext.EventObjectImpl())).setEvent(e.browserEvent);view.bufferedRenderer.scrollTo(newIdx,false,me.afterBufferedScrollTo,me);}else{newRecord=view.walkRecs(e.record,rowsVisible);me.afterKeyNavigate(e,newRecord);}}},onKeySpace:function(e){var record=this.lastFocused;if(record){this.afterKeyNavigate(e,record);}},onKeyEnter:Ext.emptyFn,onKeyUp:function(e){var newRecord=this.views[0].walkRecs(e.record,-1);if(newRecord){this.afterKeyNavigate(e,newRecord);}},onKeyDown:function(e){var newRecord=this.views[0].walkRecs(e.record,1);if(newRecord){this.afterKeyNavigate(e,newRecord);}},afterBufferedScrollTo:function(newIdx,newRecord){this.afterKeyNavigate(this.lastKeyEvent,newRecord)},scrollByDeltaX:function(delta){var view=this.views[0],section=view.up(),hScroll=section.horizontalScroller;if(hScroll){hScroll.scrollByDeltaX(delta);}},onKeyLeft:function(e){this.scrollByDeltaX(-this.deltaScroll);},onKeyRight:function(e){this.scrollByDeltaX(this.deltaScroll);},onRowMouseDown:function(view,record,item,index,e){var me=this;if(index!==-1){if(!me.allowRightMouseSelection(e)){return;}
if(!me.isSelected(record)){me.mousedownAction=true;me.processSelection(view,record,item,index,e);}else{me.mousedownAction=false;}}},onVetoUIEvent:function(type,view,cell,rowIndex,cellIndex,e,record){if(type=='mousedown'){this.mousedownAction=!this.isSelected(record);}},onRowClick:function(view,record,item,index,e){if(this.mousedownAction){this.mousedownAction=false;}else{this.processSelection(view,record,item,index,e);}},processSelection:function(view,record,item,index,e){this.selectWithEvent(record,e);},allowRightMouseSelection:function(e){var disallow=this.ignoreRightMouseSelection&&e.button!==0;if(disallow){disallow=this.hasSelection();}
return!disallow;},onSelectChange:function(record,isSelected,suppressEvent,commitFn){var me=this,views=me.views,viewsLn=views.length,rowIdx=views[0].indexOf(record),eventName=isSelected?'select':'deselect',i=0;if((suppressEvent||me.fireEvent('before'+eventName,me,record,rowIdx))!==false&&commitFn()!==false){for(;i<viewsLn;i++){if(isSelected){views[i].onRowSelect(rowIdx,suppressEvent);}else{views[i].onRowDeselect(rowIdx,suppressEvent);}}
if(!suppressEvent){me.fireEvent(eventName,me,record,rowIdx);}}},onLastFocusChanged:function(oldFocused,newFocused,supressFocus){var views=this.views,viewsLn=views.length,rowIdx,i=0;if(oldFocused){rowIdx=views[0].indexOf(oldFocused);if(rowIdx!=-1){for(;i<viewsLn;i++){views[i].onRowFocus(rowIdx,false,true);}}}
if(newFocused){rowIdx=views[0].indexOf(newFocused);if(rowIdx!=-1){for(i=0;i<viewsLn;i++){views[i].onRowFocus(rowIdx,true,supressFocus);}}}
this.callParent(arguments);},onEditorTab:function(editingPlugin,e){var me=this,view=me.views[0],record=editingPlugin.getActiveRecord(),header=editingPlugin.getActiveColumn(),position=view.getPosition(record,header),direction=e.shiftKey?'left':'right';do{position=view.walkCells(position,direction,e,me.preventWrap);}while(position&&(!position.columnHeader.getEditor(record)||!editingPlugin.startEditByPosition(position)));},getCurrentPosition:function(){var firstSelection=this.selected.items[0];if(firstSelection){return new Ext.grid.CellContext(this.view).setPosition(this.store.indexOf(firstSelection),0);}},selectByPosition:function(position){this.select(this.store.getAt(position.row));},selectNext:function(keepExisting,suppressEvent){var me=this,store=me.store,selection=me.getSelection(),record=selection[selection.length-1],index=me.views[0].indexOf(record)+1,success;if(index===store.getCount()||index===0){success=false;}else{me.doSelect(index,keepExisting,suppressEvent);success=true;}
return success;},selectPrevious:function(keepExisting,suppressEvent){var me=this,selection=me.getSelection(),record=selection[0],index=me.views[0].indexOf(record)-1,success;if(index<0){success=false;}else{me.doSelect(index,keepExisting,suppressEvent);success=true;}
return success;},isRowSelected:function(record,index){return this.isSelected(record);}});Ext.define('Ext.app.domain.Store',{extend:'Ext.app.EventDomain',singleton:true,requires:['Ext.data.AbstractStore'],type:'store',idProperty:'storeId',constructor:function(){var me=this;me.callParent();me.monitor(Ext.data.AbstractStore);}});Ext.define('MP.grid.plugin.FilterBar',{extend:'Ext.AbstractPlugin',alias:'plugin.filterbar',uses:['Ext.button.Button','Ext.container.Container','Ext.data.ArrayStore','Ext.form.field.ComboBox','Ext.form.field.Date','Ext.form.field.Number','Ext.form.field.Text','Ext.form.field.Time','Ext.layout.container.HBox','Ext.util.DelayedTask','Ext.window.MessageBox','MP.data.proxy.Server','MP.form.field.plugin.ClearButton','MP.form.field.plugin.OperatorButton'],mixins:{observable:'Ext.util.Observable'},updateBuffer:800,columnFilteredCls:'mp-filterbar-column-filtered',renderHidden:true,showShowHideButton:true,showHideButtonTooltipDo:_('Show filter bar'),showHideButtonTooltipUndo:_('Hide filter bar'),showHideButtonIconCls:'mp-filterbar-filter-icon',showClearButton:true,showClearAllButton:true,clearAllButtonIconCls:'mp-filterbar-clear-filters-icon',clearAllButtonTooltip:_('Clear all filters'),autoStoresRemoteProperty:'autoStores',autoStoresNullValue:'###NULL###',autoStoresNullText:_('[empty]'),autoUpdateAutoStores:false,enableOperators:true,boolTpl:{xtype:'combo',queryMode:'local',forceSelection:true,triggerAction:'all',editable:false,store:[[true,_('Yes')],[false,_('No')]],operator:'='},dateTpl:{xtype:'datefield',submitFormat:'Y-m-d',operator:'='},timeTpl:{xtype:'timefield',submitFormat:'H:i:s',operator:'='},floatTpl:{xtype:'numberfield',allowDecimals:true,minValue:0,hideTrigger:true,keyNavEnabled:false,mouseWheelEnabled:false,operator:'='},intTpl:{xtype:'numberfield',allowDecimals:false,minValue:0,operator:'='},stringTpl:{xtype:'textfield',operator:'~'},comboTpl:{xtype:'combo',queryMode:'local',forceSelection:true,triggerAction:'all',operator:'='},listTpl:{xtype:'combo',queryMode:'local',forceSelection:true,editable:false,triggerAction:'all',multiSelect:true,operator:'in'},constructor:function(){var me=this;me.mixins.observable.constructor.call(me);me.callParent(arguments);},init:function(grid){var me=this;grid.on({columnresize:me.resizeContainer,columnhide:me.resizeContainer,columnshow:me.resizeContainer,beforedestroy:me.unsetup,reconfigure:me.resetup,scope:me});grid.addEvents('filterupdated');Ext.apply(grid,{filterBar:me,getFilterBar:function(){return this.filterBar;}});me.setup(grid);},setup:function(grid){var me=this;me.grid=grid;me.visible=!me.renderHidden;me.autoStores=Ext.create('Ext.util.MixedCollection');me.autoStoresLoaded=false;me.columns=Ext.create('Ext.util.MixedCollection');me.containers=Ext.create('Ext.util.MixedCollection');me.fields=Ext.create('Ext.util.MixedCollection');me.actionColumn=me.grid.down('actioncolumn')||me.grid.down('actioncolumnpro');me.extraColumn=null;me.clearAllEl=null;me.showHideEl=null;me.task=Ext.create('Ext.util.DelayedTask');me.filterArray=[];me.parseFiltersConfig();me.parseInitialFilters();me.renderExtraColumn();if(grid.rendered){me.renderFilterBar(grid);}else{grid.on('viewready',me.renderFilterBar,me,{single:true});}},unsetup:function(grid){var me=this;if(me.autoStores.getCount()){me.grid.store.un('load',me.fillAutoStores,me);}
me.autoStores.each(function(item){Ext.destroy(item);});me.autoStores.clear();me.autoStores=null;me.columns.each(function(column){if(column.rendered){if(column.getEl().hasCls(me.columnFilteredCls)){column.getEl().removeCls(me.columnFilteredCls);}}},me);me.columns.clear();me.columns=null;me.fields.each(function(item){Ext.destroy(item);});me.fields.clear();me.fields=null;me.containers.each(function(item){Ext.destroy(item);});me.containers.clear();me.containers=null;if(me.clearAllEl){Ext.destroy(me.clearAllEl);me.clearAllEl=null;}
if(me.showHideEl){Ext.destroy(me.showHideEl);me.showHideEl=null;}
if(me.extraColumn){me.grid.headerCt.items.remove(me.extraColumn);me.extraColumn.ownerCt=null;Ext.destroy(me.extraColumn);me.extraColumn=null;}
me.task=null;me.filterArray=null;},resetup:function(grid){var me=this;me.unsetup(grid);me.setup(grid);},parseFiltersConfig:function(){var me=this;var columns=this.grid.headerCt.getGridColumns();me.columns.clear();me.autoStores.clear();Ext.each(columns,function(column){if(column.filter){if(column.filter===true||column.filter==='auto'){var type=me.grid.store.model.prototype.fields.get(column.dataIndex).type.type;if(type=='auto')type='string';column.filter=type;}
if(Ext.isString(column.filter)){column.filter={type:column.filter};}
if(column.filter.type){column.filter=Ext.applyIf(column.filter,me[column.filter.type+'Tpl']);}
if(column.filter.xtype=='combo'&&!column.filter.store){column.autoStore=true;column.filter.store=Ext.create('Ext.data.ArrayStore',{fields:[{name:'text'},{name:'id'}]});me.autoStores.add(column.dataIndex,column.filter.store);column.filter=Ext.apply(column.filter,{displayField:'text',valueField:'id'});}
if(!column.filter.type){switch(column.filter.xtype){case'combo':column.filter.type=(column.filter.multiSelect?'list':'combo');break;case'datefield':column.filter.type='date';break;case'timefield':column.filter.type='time';break;case'numberfield':column.filter.type=(column.filter.allowDecimals?'float':'int');break;default:column.filter.type='string';break;}}
if(!column.filter.operator){column.filter.operator=me[column.filter.type+'Tpl'].operator;}
me.columns.add(column.dataIndex,column);}},me);if(me.autoStores.getCount()){if(me.grid.store.getCount()>0){me.fillAutoStores(me.grid.store);}
if(me.grid.store.remoteFilter){var autoStores=[];me.autoStores.eachKey(function(key,item){autoStores.push(key);});me.grid.store.proxy.extraParams=me.grid.store.proxy.extraParams||{};me.grid.store.proxy.extraParams[me.autoStoresRemoteProperty]=autoStores;}
me.grid.store.on('load',me.fillAutoStores,me);}},fillAutoStores:function(store){var me=this;if(!me.autoUpdateAutoStores&&me.autoStoresLoaded)return;me.autoStores.eachKey(function(key,item){var field=me.fields.get(key);if(field){field.suspendEvents();var fieldValue=field.getValue();}
if(!store.remoteFilter){var data=store.collect(key,true,false).sort();var records=[];Ext.each(data,function(txt){if(Ext.isEmpty(txt)){Ext.Array.insert(records,0,[{text:me.autoStoresNullText,id:me.autoStoresNullValue}]);}else{records.push({text:txt,id:txt});}});item.loadData(records);}else{if(store.proxy.reader.rawData[me.autoStoresRemoteProperty]){var rawdata=store.proxy.reader.rawData[me.autoStoresRemoteProperty];if(rawdata[key]){var recs=[];Ext.each(rawdata[key].sort(),function(txt){if(Ext.isEmpty(txt)){Ext.Array.insert(recs,0,[{text:me.autoStoresNullText,id:me.autoStoresNullValue}]);}else{recs.push({text:txt,id:txt});}});item.loadData(recs);}}}
if(field){field.setValue(fieldValue);field.resumeEvents();}},me);me.autoStoresLoaded=true;if(me.grid.store.remoteFilter&&!me.autoUpdateAutoStores){delete me.grid.store.proxy.extraParams[me.autoStoresRemoteProperty];}},parseInitialFilters:function(){var me=this;me.filterArray=[];me.grid.store.filters.each(function(filter){if(filter.property&&!Ext.isEmpty(filter.value)&&me.columns.get(filter.property)){if(!filter.type)filter.type=me.columns.get(filter.property).filter.type;if(!filter.operator)filter.operator=me.columns.get(filter.property).filter.operator;me.filterArray.push(filter);}},me);},renderExtraColumn:function(){var me=this;if(me.columns.getCount()&&!me.actionColumn&&(me.showClearAllButton||me.showShowHideButton)){var extraColumnCssClass=Ext.baseCSSPrefix+'filter-bar-extra-column-hack';if(!document.getElementById(extraColumnCssClass)){var style=document.createElement('style');var css='tr.'+Ext.baseCSSPrefix+'grid-row td.'+extraColumnCssClass+' { background-color: #ffffff !important; border-color: #ffffff !important; }';style.setAttribute('type','text/css');style.setAttribute('id',extraColumnCssClass);document.body.appendChild(style);if(style.styleSheet){style.styleSheet.cssText=css;}else{var cssNode=document.createTextNode(css);style.appendChild(cssNode);}}
me.extraColumn=Ext.create('Ext.grid.column.Column',{draggable:false,hideable:false,menuDisabled:true,sortable:false,resizable:false,fixed:true,width:28,minWidth:28,maxWidth:28,header:'&nbsp;',tdCls:extraColumnCssClass});me.grid.headerCt.add(me.extraColumn);}},renderFilterBar:function(grid){var me=this;me.containers.clear();me.fields.clear();me.columns.eachKey(function(key,column){var listConfig=Ext.apply(column.filter.listConfig||{},{style:'border-top-width: 1px'});var field,plugins=[];if(me.showClearButton){plugins.push({ptype:'clearbutton'});}
if(me.enableOperators&&column.filter.type!='combo'&&!column.filter.noOperatorPlugin){var operator=null;for(var i=0,l=me.filterArray.length;i<l;i++){var filter=me.filterArray[i];if(filter.operator&&column.dataIndex==filter.property){operator=filter.operator;break;}};plugins.push({ptype:'operatorbutton',operator:operator,listeners:{operatorchanged:function(fld,newop){me.columns.get(fld.dataIndex).filter.operator=newop;if(Ext.isEmpty(fld.getValue()))return;me.applyInstantFilters(fld);}}});}
field=Ext.widget(column.filter.xtype,Ext.apply(column.filter,{dataIndex:key,flex:1,margin:0,fieldStyle:'border-left-width: 0px; border-bottom-width: 0px;',listConfig:listConfig,preventMark:true,msgTarget:'none',checkChangeBuffer:50,enableKeyEvents:true,listeners:{change:me.applyDelayedFilters,select:me.applyInstantFilters,keypress:function(txt,e){if(e.getCharCode()==13){e.stopEvent();me.applyInstantFilters(txt);}
return false;},scope:me},plugins:plugins}));me.fields.add(column.dataIndex,field);var container=Ext.create('Ext.container.Container',{dataIndex:key,layout:'hbox',bodyStyle:'background-color: "transparent";',width:column.getWidth(),items:[field],listeners:{scope:me,element:'el',mousedown:function(e){e.stopPropagation();},click:function(e){e.stopPropagation();},dblclick:function(e){e.stopPropagation();},keydown:function(e){e.stopPropagation();},keypress:function(e){e.stopPropagation();},keyup:function(e){e.stopPropagation();}}});me.containers.add(column.dataIndex,container);container.render(Ext.get(column.id));},me);me.setVisible(me.visible);me.renderButtons();me.showInitialFilters();},renderButtons:function(){var me=this;if(me.showShowHideButton&&me.columns.getCount()){var column=me.actionColumn||me.extraColumn;var buttonEl=column.el.first().first();me.showHideEl=Ext.get(Ext.core.DomHelper.append(buttonEl,{tag:'div',style:'position: absolute; width: 16px; height: 16px; top: 3px; cursor: pointer; left: '
+parseInt((column.el.getWidth()-16)/2)+'px',cls:me.showHideButtonIconCls,'data-qtip':(me.renderHidden?me.showHideButtonTooltipDo:me.showHideButtonTooltipUndo)}));me.showHideEl.on('click',function(){me.setVisible(!me.isVisible());me.showHideEl.set({'data-qtip':(!me.isVisible()?me.showHideButtonTooltipDo:me.showHideButtonTooltipUndo)});});}
if(me.showClearAllButton&&me.columns.getCount()){var ecolumn=me.actionColumn||me.extraColumn;var ebuttonEl=ecolumn.el.first().first();me.clearAllEl=Ext.get(Ext.core.DomHelper.append(ebuttonEl,{tag:'div',style:'position: absolute; width: 16px; height: 16px; top: 25px; cursor: pointer; left: '
+parseInt((ecolumn.el.getWidth()-16)/2)+'px',cls:me.clearAllButtonIconCls,'data-qtip':me.clearAllButtonTooltip}));me.clearAllEl.hide();me.clearAllEl.on('click',function(){me.clearFilters();});}},showInitialFilters:function(){var me=this;Ext.each(me.filterArray,function(filter){var column=me.columns.get(filter.property);var field=me.fields.get(filter.property);if(!column.getEl().hasCls(me.columnFilteredCls)){column.getEl().addCls(me.columnFilteredCls);}
field.suspendEvents();field.setValue(filter.value);field.resumeEvents();});if(me.filterArray.length&&me.showClearAllButton){me.clearAllEl.show({duration:1000});}},resizeContainer:function(headerCt,col){var me=this;var dataIndex=col.dataIndex;if(!dataIndex)return;var item=me.containers.get(dataIndex);if(item&&item.rendered){var itemWidth=item.getWidth();var colWidth=me.columns.get(dataIndex).getWidth();if(itemWidth!=colWidth){item.setWidth(me.columns.get(dataIndex).getWidth());item.doLayout();}}},applyFilters:function(field){if(!field.isValid())return;var me=this,grid=me.grid,column=me.columns.get(field.dataIndex),newVal=(grid.store.remoteFilter?field.getSubmitValue():field.getValue());if(Ext.isArray(newVal)&&newVal.length===0){newVal='';}
var myIndex=-1;Ext.each(me.filterArray,function(item2,index,allItems){if(item2.property===column.dataIndex){myIndex=index;}});if(myIndex!=-1){me.filterArray.splice(myIndex,1);}
if(!Ext.isEmpty(newVal)){if(!grid.store.remoteFilter){var filterFn;switch(column.filter.operator){case'eq':case'=':filterFn=function(item){if(column.filter.type=='date'){return Ext.Date.clearTime(item.get(column.dataIndex),true).getTime()==Ext.Date.clearTime(newVal,true).getTime();}else{return(Ext.isEmpty(item.get(column.dataIndex))?me.autoStoresNullValue:item.get(column.dataIndex))==(Ext.isEmpty(newVal)?me.autoStoresNullValue:newVal);}};break;case'gte':case'>=':filterFn=function(item){if(column.filter.type=='date'){return Ext.Date.clearTime(item.get(column.dataIndex),true).getTime()>=Ext.Date.clearTime(newVal,true).getTime();}else{return(Ext.isEmpty(item.get(column.dataIndex))?me.autoStoresNullValue:item.get(column.dataIndex))>=(Ext.isEmpty(newVal)?me.autoStoresNullValue:newVal);}};break;case'lte':case'<=':filterFn=function(item){if(column.filter.type=='date'){return Ext.Date.clearTime(item.get(column.dataIndex),true).getTime()<=Ext.Date.clearTime(newVal,true).getTime();}else{return(Ext.isEmpty(item.get(column.dataIndex))?me.autoStoresNullValue:item.get(column.dataIndex))<=(Ext.isEmpty(newVal)?me.autoStoresNullValue:newVal);}};break;case'ne':case'<>':filterFn=function(item){if(column.filter.type=='date'){return Ext.Date.clearTime(item.get(column.dataIndex),true).getTime()!=Ext.Date.clearTime(newVal,true).getTime();}else{return(Ext.isEmpty(item.get(column.dataIndex))?me.autoStoresNullValue:item.get(column.dataIndex))!=(Ext.isEmpty(newVal)?me.autoStoresNullValue:newVal);}};break;case'like':case'~':filterFn=function(item){var re=new RegExp(newVal,'i');return re.test(item.get(column.dataIndex));};break;case'in':filterFn=function(item){var re=new RegExp('^'+newVal.join('|')+'$','i');return re.test((Ext.isEmpty(item.get(column.dataIndex))?me.autoStoresNullValue:item.get(column.dataIndex)));};break;}
me.filterArray.push(Ext.create('Ext.util.Filter',{property:column.dataIndex,filterFn:filterFn,me:me}));}else{me.filterArray.push(Ext.create('Ext.util.Filter',{property:column.dataIndex,value:newVal,type:column.filter.type,operator:column.filter.operator}));}
if(!column.getEl().hasCls(me.columnFilteredCls)){column.getEl().addCls(me.columnFilteredCls);}}else{if(column.getEl().hasCls(me.columnFilteredCls)){column.getEl().removeCls(me.columnFilteredCls);}}
grid.store.currentPage=1;if(me.filterArray.length>0){if(!grid.store.remoteFilter)grid.store.clearFilter();grid.store.filters.clear();grid.store.filter(me.filterArray);if(me.clearAllEl){me.clearAllEl.show({duration:1000});}}else{grid.store.clearFilter();if(me.clearAllEl){me.clearAllEl.hide({duration:1000});}}
if(!grid.store.remoteFilter&&me.autoUpdateAutoStores){me.fillAutoStores();}
me.fireEvent('filterupdated',me.filterArray);},applyDelayedFilters:function(field){if(!field.isValid())return;var me=this;me.task.delay(me.updateBuffer,me.applyFilters,me,[field]);},applyInstantFilters:function(field){if(!field.isValid())return;var me=this;me.task.delay(0,me.applyFilters,me,[field]);},getFirstField:function(){var me=this,field=undefined;Ext.each(me.grid.headerCt.getGridColumns(),function(col){if(col.filter){field=me.fields.get(col.dataIndex);return false;}
return true;});return field;},focusFirstField:function(){var me=this;var field=me.getFirstField();if(field){field.focus(false,200);}},clearFilters:function(){var me=this;if(me.filterArray.length===0)return;me.filterArray=[];me.fields.eachKey(function(key,field){field.suspendEvents();field.reset();field.resumeEvents();var column=me.columns.get(key);if(column.getEl().hasCls(me.columnFilteredCls)){column.getEl().removeCls(me.columnFilteredCls);}},me);me.grid.store.clearFilter();if(me.clearAllEl){me.clearAllEl.hide({duration:1000});}
me.fireEvent('filterupdated',me.filterArray);},isVisible:function(){var me=this;return me.visible;},setVisible:function(visible){var me=this;me.containers.each(function(item){item.setVisible(visible);});if(visible){me.focusFirstField();}
me.grid.headerCt.doLayout();me.visible=visible;}});Ext.define('MP.override.grid.ColumnComponentLayout',{override:'Ext.grid.ColumnComponentLayout',publishInnerHeight:function(ownerContext,outerHeight){if(this.owner.filter){return;}
this.callParent(arguments);}});Ext.define('Ext.layout.component.field.Trigger',{alias:'layout.triggerfield',extend:'Ext.layout.component.field.Field',type:'triggerfield',borderWidths:{},beginLayout:function(ownerContext){var me=this,owner=me.owner,flags;ownerContext.triggerWrap=ownerContext.getEl('triggerWrap');me.callParent(arguments);flags=owner.getTriggerStateFlags();if(flags!=owner.lastTriggerStateFlags){owner.lastTriggerStateFlags=flags;me.updateEditState();}},beginLayoutCycle:function(ownerContext){this.callParent(arguments);if(ownerContext.widthModel.shrinkWrap&&!this.owner.inputWidth){ownerContext.inputContext.el.setStyle('width','');}},beginLayoutFixed:function(ownerContext,width,suffix){var me=this,owner=ownerContext.target,ieInputWidthAdjustment=me.ieInputWidthAdjustment||0,inputWidth='100%',triggerWrap=owner.triggerWrap;me.callParent(arguments);owner.inputCell.setStyle('width','100%');if(ieInputWidthAdjustment){me.adjustIEInputPadding(ownerContext);if(suffix==='px'){if(owner.inputWidth){inputWidth=owner.inputWidth-me.getExtraWidth(ownerContext);}else{inputWidth=width-ieInputWidthAdjustment-me.getExtraWidth(ownerContext);}
inputWidth+='px';}}
owner.inputEl.setStyle('width',inputWidth);inputWidth=owner.inputWidth;if(inputWidth){triggerWrap.setStyle('width',inputWidth+(ieInputWidthAdjustment)+'px');}else{triggerWrap.setStyle('width',width+suffix);}
triggerWrap.setStyle('table-layout','fixed');},adjustIEInputPadding:function(ownerContext){this.owner.inputCell.setStyle('padding-right',this.ieInputWidthAdjustment+'px');},getExtraWidth:function(ownerContext){var me=this,owner=me.owner,borderWidths=me.borderWidths,ui=owner.ui+owner.triggerEl.getCount();if(!(ui in borderWidths)){borderWidths[ui]=ownerContext.triggerWrap.getBorderInfo().width}
return borderWidths[ui]+owner.getTriggerWidth();},beginLayoutShrinkWrap:function(ownerContext){var owner=ownerContext.target,emptyString='',inputWidth=owner.inputWidth,triggerWrap=owner.triggerWrap;this.callParent(arguments);if(inputWidth){triggerWrap.setStyle('width',inputWidth+'px');inputWidth=(inputWidth-this.getExtraWidth(ownerContext))+'px';owner.inputEl.setStyle('width',inputWidth);owner.inputCell.setStyle('width',inputWidth);}else{owner.inputCell.setStyle('width',emptyString);owner.inputEl.setStyle('width',emptyString);triggerWrap.setStyle('width',emptyString);triggerWrap.setStyle('table-layout','auto');}},getTextWidth:function(){var me=this,owner=me.owner,inputEl=owner.inputEl,value;value=(inputEl.dom.value||(owner.hasFocus?'':owner.emptyText)||'')+owner.growAppend;return inputEl.getTextWidth(value);},publishOwnerWidth:function(ownerContext,width){var owner=this.owner;this.callParent(arguments);if(!owner.grow&&!owner.inputWidth){width-=this.getExtraWidth(ownerContext);if(owner.labelAlign!='top'){width-=owner.getLabelWidth();}
ownerContext.inputContext.setWidth(width);}},publishInnerHeight:function(ownerContext,height){ownerContext.inputContext.setHeight(height-this.measureLabelErrorHeight(ownerContext));},measureContentWidth:function(ownerContext){var me=this,owner=me.owner,width=me.callParent(arguments),inputContext=ownerContext.inputContext,calcWidth,max,min;if(owner.grow&&!ownerContext.state.growHandled){calcWidth=me.getTextWidth()+ownerContext.inputContext.getFrameInfo().width;max=owner.growMax;min=Math.min(max,width);max=Math.max(owner.growMin,max,min);calcWidth=Ext.Number.constrain(calcWidth,owner.growMin,max);inputContext.setWidth(calcWidth);ownerContext.state.growHandled=true;inputContext.domBlock(me,'width');width=NaN;}else if(!owner.inputWidth){width-=me.getExtraWidth(ownerContext);}
return width;},updateEditState:function(){var me=this,owner=me.owner,inputEl=owner.inputEl,noeditCls=Ext.baseCSSPrefix+'trigger-noedit',displayed,readOnly;if(me.owner.readOnly){inputEl.addCls(noeditCls);readOnly=true;displayed=false;}else{if(me.owner.editable){inputEl.removeCls(noeditCls);readOnly=false;}else{inputEl.addCls(noeditCls);readOnly=true;}
displayed=!me.owner.hideTrigger;}
owner.triggerCell.setDisplayed(displayed);inputEl.dom.readOnly=readOnly;}});Ext.define('MP.data.proxy.Server',{override:'Ext.data.proxy.Server',encodeFilters:function(filters){var min=[],length=filters.length,i=0;for(;i<length;i++){min[i]={property:filters[i].property,value:filters[i].value};if(filters[i].operator){min[i].operator=filters[i].operator;}}
return this.applyEncoding(min);}});Ext.define("MP.data.Model",{override:"Ext.data.Model",getModifiedFields:function(idfname,idfvalue){var me=this;var data=me.data;var fmap=me.fields.map;var modified=me.modified;var cfields={};var dtype=Ext.data.Types.DATE;if(!idfvalue){cfields[idfname]=me.get(idfname);}else if(typeof idfvalue=='function'){cfields[idfname]=idfvalue.call(this);}else{cfields[idfname]=idfvalue;}
var skiprecord=true;for(var fname in modified){if(fname!=idfname){var field=fmap[fname];if(!field||!field.sendBackToServer){continue;}
var fvalue=data[fname];if(Ext.isEmpty(fvalue)){if(!field.allowBlank){return fname;}
var origvalue=modified&&modified[fname];if(Ext.isEmpty(origvalue)){continue;}}
if(field.serialize){cfields[fname]=field.serialize(fvalue,me);}else if(field.type===dtype&&field.dateFormat){cfields[fname]=Ext.Date.format(fvalue,field.dateFormat);}else{cfields[fname]=fvalue;}
skiprecord=false;}}
if(skiprecord){return null;}else{return cfields;}}});Ext.define('Ext.layout.component.field.FieldContainer',{extend:'Ext.layout.component.field.Field',alias:'layout.fieldcontainer',type:'fieldcontainer',waitForOuterHeightInDom:true,waitForOuterWidthInDom:true,beginLayout:function(ownerContext){var owner=this.owner;this.callParent(arguments);ownerContext.hasRawContent=true;owner.bodyEl.setStyle('height','');owner.containerEl.setStyle('height','');ownerContext.containerElContext=ownerContext.getEl('containerEl');},measureContentHeight:function(ownerContext){return ownerContext.hasDomProp('containerLayoutDone')?this.callParent(arguments):NaN;},measureContentWidth:function(ownerContext){return ownerContext.hasDomProp('containerLayoutDone')?this.callParent(arguments):NaN;},publishInnerWidth:function(ownerContext,width){var bodyContext=ownerContext.bodyCellContext,innerWidth=bodyContext.el.getWidth();bodyContext.setWidth(innerWidth,false);ownerContext.containerElContext.setWidth(innerWidth,false);},publishInnerHeight:function(ownerContext,height){var bodyContext=ownerContext.bodyCellContext,containerElContext=ownerContext.containerElContext;height-=this.measureLabelErrorHeight(ownerContext);bodyContext.setHeight(height);containerElContext.setHeight(height);}});Ext.define('Ext.data.proxy.Ajax',{requires:['Ext.util.MixedCollection','Ext.Ajax'],extend:'Ext.data.proxy.Server',alias:'proxy.ajax',alternateClassName:['Ext.data.HttpProxy','Ext.data.AjaxProxy'],actionMethods:{create:'POST',read:'GET',update:'POST',destroy:'POST'},binary:false,doRequest:function(operation,callback,scope){var writer=this.getWriter(),request=this.buildRequest(operation);if(operation.allowWrite()){request=writer.write(request);}
Ext.apply(request,{binary:this.binary,headers:this.headers,timeout:this.timeout,scope:this,callback:this.createRequestCallback(request,operation,callback,scope),method:this.getMethod(request),disableCaching:false});Ext.Ajax.request(request);return request;},getMethod:function(request){return this.actionMethods[request.action];},createRequestCallback:function(request,operation,callback,scope){var me=this;return function(options,success,response){me.processResponse(success,operation,request,response,callback,scope);};}},function(){Ext.data.HttpProxy=this;});Ext.define('Ext.fx.Animator',{mixins:{observable:'Ext.util.Observable'},requires:['Ext.fx.Manager'],isAnimator:true,duration:250,delay:0,delayStart:0,dynamic:false,easing:'ease',running:false,paused:false,damper:1,iterations:1,currentIteration:0,keyframeStep:0,animKeyFramesRE:/^(from|to|\d+%?)$/,constructor:function(config){var me=this;config=Ext.apply(me,config||{});me.config=config;me.id=Ext.id(null,'ext-animator-');me.addEvents('beforeanimate','keyframe','afteranimate');me.mixins.observable.constructor.call(me,config);me.timeline=[];me.createTimeline(me.keyframes);if(me.target){me.applyAnimator(me.target);Ext.fx.Manager.addAnim(me);}},sorter:function(a,b){return a.pct-b.pct;},createTimeline:function(keyframes){var me=this,attrs=[],to=me.to||{},duration=me.duration,prevMs,ms,i,ln,pct,attr;for(pct in keyframes){if(keyframes.hasOwnProperty(pct)&&me.animKeyFramesRE.test(pct)){attr={attrs:Ext.apply(keyframes[pct],to)};if(pct=="from"){pct=0;}
else if(pct=="to"){pct=100;}
attr.pct=parseInt(pct,10);attrs.push(attr);}}
Ext.Array.sort(attrs,me.sorter);ln=attrs.length;for(i=0;i<ln;i++){prevMs=(attrs[i-1])?duration*(attrs[i-1].pct/100):0;ms=duration*(attrs[i].pct/100);me.timeline.push({duration:ms-prevMs,attrs:attrs[i].attrs});}},applyAnimator:function(target){var me=this,anims=[],timeline=me.timeline,ln=timeline.length,anim,easing,damper,attrs,i;if(me.fireEvent('beforeanimate',me)!==false){for(i=0;i<ln;i++){anim=timeline[i];attrs=anim.attrs;easing=attrs.easing||me.easing;damper=attrs.damper||me.damper;delete attrs.easing;delete attrs.damper;anim=new Ext.fx.Anim({target:target,easing:easing,damper:damper,duration:anim.duration,paused:true,to:attrs});anims.push(anim);}
me.animations=anims;me.target=anim.target;for(i=0;i<ln-1;i++){anim=anims[i];anim.nextAnim=anims[i+1];anim.on('afteranimate',function(){this.nextAnim.paused=false;});anim.on('afteranimate',function(){this.fireEvent('keyframe',this,++this.keyframeStep);},me);}
anims[ln-1].on('afteranimate',function(){this.lastFrame();},me);}},start:function(startTime){var me=this,delay=me.delay,delayStart=me.delayStart,delayDelta;if(delay){if(!delayStart){me.delayStart=startTime;return;}
else{delayDelta=startTime-delayStart;if(delayDelta<delay){return;}
else{startTime=new Date(delayStart.getTime()+delay);}}}
if(me.fireEvent('beforeanimate',me)!==false){me.startTime=startTime;me.running=true;me.animations[me.keyframeStep].paused=false;}},lastFrame:function(){var me=this,iter=me.iterations,iterCount=me.currentIteration;iterCount++;if(iterCount<iter){me.startTime=new Date();me.currentIteration=iterCount;me.keyframeStep=0;me.applyAnimator(me.target);me.animations[me.keyframeStep].paused=false;}
else{me.currentIteration=0;me.end();}},end:function(){var me=this;me.fireEvent('afteranimate',me,me.startTime,new Date()-me.startTime);},isReady:function(){return this.paused===false&&this.running===false&&this.iterations>0;},isRunning:function(){return false;}});Ext.define('Ext.layout.component.field.Text',{extend:'Ext.layout.component.field.Field',alias:'layout.textfield',requires:['Ext.util.TextMetrics'],type:'textfield',canGrowWidth:true,beginLayoutCycle:function(ownerContext){this.callParent(arguments);if(ownerContext.heightModel.shrinkWrap){ownerContext.inputContext.el.setStyle('height','');}},measureContentWidth:function(ownerContext){var me=this,owner=me.owner,width=me.callParent(arguments),inputContext=ownerContext.inputContext,inputEl,value,calcWidth,max,min;if(owner.grow&&me.canGrowWidth&&!ownerContext.state.growHandled){inputEl=owner.inputEl;value=Ext.util.Format.htmlEncode(inputEl.dom.value||(owner.hasFocus?'':owner.emptyText)||'');value+=owner.growAppend;calcWidth=inputEl.getTextWidth(value)+inputContext.getFrameInfo().width;max=owner.growMax;min=Math.min(max,width);max=Math.max(owner.growMin,max,min);calcWidth=Ext.Number.constrain(calcWidth,owner.growMin,max);inputContext.setWidth(calcWidth);ownerContext.state.growHandled=true;inputContext.domBlock(me,'width');width=NaN;}
return width;},publishInnerHeight:function(ownerContext,height){ownerContext.inputContext.setHeight(height-this.measureLabelErrorHeight(ownerContext));},beginLayoutFixed:function(ownerContext,width,suffix){var me=this,ieInputWidthAdjustment=me.ieInputWidthAdjustment;if(ieInputWidthAdjustment){me.adjustIEInputPadding(ownerContext);if(suffix==='px'){width-=ieInputWidthAdjustment;}}
me.callParent(arguments);},adjustIEInputPadding:function(ownerContext){this.owner.bodyEl.setStyle('padding-right',this.ieInputWidthAdjustment+'px');}});Ext.define('Ext.selection.DataViewModel',{extend:'Ext.selection.Model',requires:['Ext.util.KeyNav'],deselectOnContainerClick:true,enableKeyNav:true,constructor:function(cfg){this.addEvents('beforedeselect','beforeselect','deselect','select');this.callParent(arguments);},bindComponent:function(view){var me=this,eventListeners={refresh:me.refresh,scope:me};me.view=view;me.bindStore(view.getStore());eventListeners[view.triggerEvent]=me.onItemClick;eventListeners[view.triggerCtEvent]=me.onContainerClick;view.on(eventListeners);if(me.enableKeyNav){me.initKeyNav(view);}},onUpdate:function(record){var view=this.view;if(view&&this.isSelected(record)){view.onItemSelect(record);}},onItemClick:function(view,record,item,index,e){this.selectWithEvent(record,e);},onContainerClick:function(){if(this.deselectOnContainerClick){this.deselectAll();}},initKeyNav:function(view){var me=this;if(!view.rendered){view.on({render:Ext.Function.bind(me.initKeyNav,me,[view]),single:true});return;}
view.el.set({tabIndex:-1});me.keyNav=new Ext.util.KeyNav({target:view.el,ignoreInputFields:true,down:Ext.pass(me.onNavKey,[1],me),right:Ext.pass(me.onNavKey,[1],me),left:Ext.pass(me.onNavKey,[-1],me),up:Ext.pass(me.onNavKey,[-1],me),scope:me});},onNavKey:function(step){step=step||1;var me=this,view=me.view,selected=me.getSelection()[0],numRecords=me.view.store.getCount(),idx;if(selected){idx=view.indexOf(view.getNode(selected))+step;}else{idx=0;}
if(idx<0){idx=numRecords-1;}else if(idx>=numRecords){idx=0;}
me.select(idx);},onSelectChange:function(record,isSelected,suppressEvent,commitFn){var me=this,view=me.view,eventName=isSelected?'select':'deselect';if((suppressEvent||me.fireEvent('before'+eventName,me,record))!==false&&commitFn()!==false){if(view){if(isSelected){view.onItemSelect(record);}else{view.onItemDeselect(record);}}
if(!suppressEvent){me.fireEvent(eventName,me,record);}}},onLastFocusChanged:function(oldFocus,newFocus,suppressFocus){var view=this.view;if(view&&!suppressFocus&&newFocus){view.focusNode(newFocus);this.fireEvent('focuschange',this,oldFocus,newFocus);}},destroy:function(){Ext.destroy(this.keyNav);this.callParent();}});Ext.define('Ext.dd.DDProxy',{extend:'Ext.dd.DD',statics:{dragElId:"ygddfdiv"},constructor:function(id,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}},resizeFrame:true,centerFrame:false,createFrame:function(){var self=this,body=document.body,div,s;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}
div=this.getDragEl();if(!div){div=document.createElement("div");div.id=this.dragElId;s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){this.callParent();this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId);},showFrame:function(iPageX,iPageY){var el=this.getEl(),dragEl=this.getDragEl(),s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}
this.setDragElPos(iPageX,iPageY);Ext.fly(dragEl).show();},_resizeProxy:function(){if(this.resizeFrame){var el=this.getEl();Ext.fly(this.getDragEl()).setSize(el.offsetWidth,el.offsetHeight);}},b4MouseDown:function(e){var x=e.getPageX(),y=e.getPageY();this.autoOffset(x,y);this.setDragElPos(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){Ext.fly(this.getDragEl()).hide();},endDrag:function(e){var lel=this.getEl(),del=this.getDragEl();del.style.visibility="";this.beforeMove();lel.style.visibility="hidden";Ext.dd.DDM.moveToEl(lel,del);del.style.visibility="hidden";lel.style.visibility="";this.afterDrag();},beforeMove:function(){},afterDrag:function(){},toString:function(){return("DDProxy "+this.id);}});Ext.define('Ext.data.proxy.Memory',{extend:'Ext.data.proxy.Client',alias:'proxy.memory',alternateClassName:'Ext.data.MemoryProxy',constructor:function(config){this.callParent([config]);this.setReader(this.reader);},updateOperation:function(operation,callback,scope){var i=0,recs=operation.getRecords(),len=recs.length;for(i;i<len;i++){recs[i].commit();}
operation.setCompleted();operation.setSuccessful();Ext.callback(callback,scope||this,[operation]);},create:function(){this.updateOperation.apply(this,arguments);},update:function(){this.updateOperation.apply(this,arguments);},destroy:function(){this.updateOperation.apply(this,arguments);},read:function(operation,callback,scope){var me=this,resultSet=operation.resultSet=me.getReader().read(me.data),records=resultSet.records,sorters=operation.sorters,groupers=operation.groupers,filters=operation.filters;operation.setCompleted();if(resultSet.success){if(filters&&filters.length){records=resultSet.records=Ext.Array.filter(records,Ext.util.Filter.createFilterFn(filters));}
if(groupers&&groupers.length){sorters=sorters?sorters.concat(groupers):sorters;}
if(sorters&&sorters.length){resultSet.records=Ext.Array.sort(records,Ext.util.Sortable.createComparator(sorters));}
if(me.enablePaging&&operation.start!==undefined&&operation.limit!==undefined){if(operation.start>=resultSet.total){resultSet.success=false;resultSet.count=0;resultSet.records=[];}
else{resultSet.records=Ext.Array.slice(resultSet.records,operation.start,operation.start+operation.limit);resultSet.count=resultSet.records.length;}}}
if(resultSet.success){operation.setSuccessful();}else{me.fireEvent('exception',me,null,operation);}
Ext.callback(callback,scope||me,[operation]);},clear:Ext.emptyFn});Ext.define('Ext.layout.component.field.HtmlEditor',{extend:'Ext.layout.component.field.FieldContainer',alias:['layout.htmleditor'],type:'htmleditor',naturalHeight:150,naturalWidth:300,beginLayout:function(ownerContext){var owner=this.owner,dom;if(Ext.isGecko){dom=owner.textareaEl.dom;this.lastValue=dom.value;dom.value='';}
this.callParent(arguments);ownerContext.toolbarContext=ownerContext.context.getCmp(owner.toolbar);ownerContext.inputCmpContext=ownerContext.context.getCmp(owner.inputCmp);ownerContext.textAreaContext=ownerContext.getEl('textareaEl');ownerContext.iframeContext=ownerContext.getEl('iframeEl');},beginLayoutCycle:function(ownerContext){var me=this,widthModel=ownerContext.widthModel,heightModel=ownerContext.heightModel,owner=me.owner,iframeEl=owner.iframeEl,textareaEl=owner.textareaEl;me.callParent(arguments);if(widthModel.shrinkWrap){iframeEl.setStyle('width','');textareaEl.setStyle('width','');}else if(widthModel.natural){ownerContext.bodyCellContext.setWidth(me.naturalWidth);}
if(heightModel.natural||heightModel.shrinkWrap){iframeEl.setHeight(me.naturalHeight);textareaEl.setHeight(me.naturalHeight);}},finishedLayout:function(){var owner=this.owner;this.callParent(arguments);if(Ext.isIE9m&&Ext.isIEQuirks){owner.el.repaint();}
if(Ext.isGecko){owner.textareaEl.dom.value=this.lastValue;}},publishOwnerWidth:function(ownerContext,width){this.callParent(arguments);width-=ownerContext.inputCmpContext.getBorderInfo().width;ownerContext.textAreaContext.setWidth(width);ownerContext.iframeContext.setWidth(width);},publishInnerWidth:function(ownerContext,width){var border=ownerContext.inputCmpContext.getBorderInfo().width,ieBug=Ext.isStrict&&Ext.isIE8m,natural=ownerContext.widthModel.natural;this.callParent(arguments);width=ownerContext.bodyCellContext.props.width-border;if(natural){if(ieBug){width-=2;}
ownerContext.textAreaContext.setWidth(width);ownerContext.iframeContext.setWidth(width);}else if(ieBug){ownerContext.textAreaContext.setWidth(width);}},publishInnerHeight:function(ownerContext,height){var toolbarHeight=ownerContext.toolbarContext.getProp('height'),sourceEdit=this.owner.sourceEditMode;this.callParent(arguments);height=ownerContext.bodyCellContext.props.height;if(toolbarHeight!==undefined){height-=toolbarHeight+ownerContext.inputCmpContext.getFrameInfo().height;if(Ext.isIE8&&Ext.isStrict){height-=2;}else if(Ext.isIEQuirks&&(Ext.isIE8||Ext.isIE9)){height-=4;}
ownerContext.iframeContext.setHeight(height);ownerContext.textAreaContext.setHeight(height);}else{this.done=false;}}});Ext.define('Ext.layout.component.field.ComboBox',{extend:'Ext.layout.component.field.Trigger',alias:'layout.combobox',requires:['Ext.util.TextMetrics'],type:'combobox',startingWidth:null,getTextWidth:function(){var me=this,owner=me.owner,store=owner.store,field=owner.displayField,storeLn=store.data.length,value='',i=0,n=0,ln,item,width;for(;i<storeLn;i++){item=store.getAt(i).data[field];ln=item.length;if(ln>n){n=ln;value=item;}}
width=Math.max(me.callParent(arguments),owner.inputEl.getTextWidth(value+owner.growAppend));if(!me.startingWidth||owner.removingRecords){me.startingWidth=width;if(width<owner.growMin){owner.defaultListConfig.minWidth=owner.growMin;}
owner.removingRecords=false;}
return(width<me.startingWidth)?me.startingWidth:width;}});Ext.define('Ext.dd.DropZone',{extend:'Ext.dd.DropTarget',requires:['Ext.dd.Registry'],getTargetFromEvent:function(e){return Ext.dd.Registry.getTargetFromEvent(e);},onNodeEnter:function(n,dd,e,data){},onNodeOver:function(n,dd,e,data){return this.dropAllowed;},onNodeOut:function(n,dd,e,data){},onNodeDrop:function(n,dd,e,data){return false;},onContainerOver:function(dd,e,data){return this.dropNotAllowed;},onContainerDrop:function(dd,e,data){return false;},notifyEnter:function(dd,e,data){return this.dropNotAllowed;},notifyOver:function(dd,e,data){var n=this.getTargetFromEvent(e);if(!n){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,data);this.lastOverNode=null;}
return this.onContainerOver(dd,e,data);}
if(this.lastOverNode!=n){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,data);}
this.onNodeEnter(n,dd,e,data);this.lastOverNode=n;}
return this.onNodeOver(n,dd,e,data);},notifyOut:function(dd,e,data){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,data);this.lastOverNode=null;}},notifyDrop:function(dd,e,data){var me=this,n=me.getTargetFromEvent(e),result=n?me.onNodeDrop(n,dd,e,data):me.onContainerDrop(dd,e,data);if(me.lastOverNode){me.onNodeOut(me.lastOverNode,dd,e,data);me.lastOverNode=null;}
return result;},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups);}});Ext.define('Ext.fx.Anim',{mixins:{observable:'Ext.util.Observable'},requires:['Ext.fx.Manager','Ext.fx.Animator','Ext.fx.Easing','Ext.fx.CubicBezier','Ext.fx.PropertyHandler'],isAnimation:true,duration:250,delay:0,delayStart:0,dynamic:false,easing:'ease',damper:1,bezierRE:/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,reverse:false,running:false,paused:false,iterations:1,alternate:false,currentIteration:0,startTime:0,frameCount:0,constructor:function(config){var me=this,curve;config=config||{};if(config.keyframes){return new Ext.fx.Animator(config);}
Ext.apply(me,config);if(me.from===undefined){me.from={};}
me.propHandlers={};me.config=config;me.target=Ext.fx.Manager.createTarget(me.target);me.easingFn=Ext.fx.Easing[me.easing];me.target.dynamic=me.dynamic;if(!me.easingFn){me.easingFn=String(me.easing).match(me.bezierRE);if(me.easingFn&&me.easingFn.length==5){curve=me.easingFn;me.easingFn=Ext.fx.CubicBezier.cubicBezier(+curve[1],+curve[2],+curve[3],+curve[4]);}}
me.id=Ext.id(null,'ext-anim-');me.addEvents('beforeanimate','afteranimate','lastframe');me.mixins.observable.constructor.call(me);Ext.fx.Manager.addAnim(me);},setAttr:function(attr,value){return Ext.fx.Manager.items.get(this.id).setAttr(this.target,attr,value);},initAttrs:function(){var me=this,from=me.from,to=me.to,initialFrom=me.initialFrom||{},out={},start,end,propHandler,attr;for(attr in to){if(to.hasOwnProperty(attr)){start=me.target.getAttr(attr,from[attr]);end=to[attr];if(!Ext.fx.PropertyHandler[attr]){if(Ext.isObject(end)){propHandler=me.propHandlers[attr]=Ext.fx.PropertyHandler.object;}else{propHandler=me.propHandlers[attr]=Ext.fx.PropertyHandler.defaultHandler;}}
else{propHandler=me.propHandlers[attr]=Ext.fx.PropertyHandler[attr];}
out[attr]=propHandler.get(start,end,me.damper,initialFrom[attr],attr);}}
me.currentAttrs=out;},start:function(startTime){var me=this,delay=me.delay,delayStart=me.delayStart,delayDelta;if(delay){if(!delayStart){me.delayStart=startTime;return;}
else{delayDelta=startTime-delayStart;if(delayDelta<delay){return;}
else{startTime=new Date(delayStart.getTime()+delay);}}}
if(me.fireEvent('beforeanimate',me)!==false){me.startTime=startTime;if(!me.paused&&!me.currentAttrs){me.initAttrs();}
me.running=true;me.frameCount=0;}},runAnim:function(elapsedTime){var me=this,attrs=me.currentAttrs,duration=me.duration,easingFn=me.easingFn,propHandlers=me.propHandlers,ret={},easing,values,attr,lastFrame;if(elapsedTime>=duration){elapsedTime=duration;lastFrame=true;}
if(me.reverse){elapsedTime=duration-elapsedTime;}
for(attr in attrs){if(attrs.hasOwnProperty(attr)){values=attrs[attr];easing=lastFrame?1:easingFn(elapsedTime/duration);ret[attr]=propHandlers[attr].set(values,easing);}}
me.frameCount++;return ret;},lastFrame:function(){var me=this,iter=me.iterations,iterCount=me.currentIteration;iterCount++;if(iterCount<iter){if(me.alternate){me.reverse=!me.reverse;}
me.startTime=new Date();me.currentIteration=iterCount;me.paused=false;}
else{me.currentIteration=0;me.end();me.fireEvent('lastframe',me,me.startTime);}},endWasCalled:0,end:function(){if(this.endWasCalled++){return;}
var me=this;me.startTime=0;me.paused=false;me.running=false;Ext.fx.Manager.removeAnim(me);me.fireEvent('afteranimate',me,me.startTime);Ext.callback(me.callback,me.scope,[me,me.startTime]);},isReady:function(){return this.paused===false&&this.running===false&&this.iterations>0;},isRunning:function(){return this.paused===false&&this.running===true&&this.isAnimator!==true;}});Ext.enableFx=true;Ext.define('Ext.layout.component.field.TextArea',{extend:'Ext.layout.component.field.Text',alias:'layout.textareafield',type:'textareafield',canGrowWidth:false,naturalSizingProp:'cols',beginLayout:function(ownerContext){this.callParent(arguments);ownerContext.target.inputEl.setStyle('height','');},measureContentHeight:function(ownerContext){var me=this,owner=me.owner,height=me.callParent(arguments),inputContext,inputEl,value,max,curWidth,calcHeight;if(owner.grow&&!ownerContext.state.growHandled){inputContext=ownerContext.inputContext;inputEl=owner.inputEl;curWidth=inputEl.getWidth(true);value=Ext.util.Format.htmlEncode(inputEl.dom.value)||'&#160;';value+=owner.growAppend;value=value.replace(/\n/g,'<br/>');calcHeight=Ext.util.TextMetrics.measure(inputEl,value,curWidth).height+
inputContext.getBorderInfo().height+inputContext.getPaddingInfo().height;calcHeight=Ext.Number.constrain(calcHeight,owner.growMin,owner.growMax);inputContext.setHeight(calcHeight);ownerContext.state.growHandled=true;inputContext.domBlock(me,'height');height=NaN;}
return height;}});Ext.define('MP.desktop.ShortcutModel',{extend:'Ext.data.Model',requires:['Ext.data.proxy.Ajax'],fields:[{name:'name'},{name:'iconCls'},{name:'moduleId'}]});Ext.define('Ext.selection.CheckboxModel',{alias:'selection.checkboxmodel',extend:'Ext.selection.RowModel',mode:'MULTI',injectCheckbox:0,checkOnly:false,showHeaderCheckbox:undefined,checkSelector:'.'+Ext.baseCSSPrefix+'grid-row-checker',headerWidth:24,checkerOnCls:Ext.baseCSSPrefix+'grid-hd-checker-on',constructor:function(){var me=this;me.callParent(arguments);if(me.mode==='SINGLE'&&me.showHeaderCheckbox!==true){me.showHeaderCheckbox=false;}},beforeViewRender:function(view){var me=this,owner;me.callParent(arguments);if(!me.hasLockedHeader()||view.headerCt.lockedCt){if(me.showHeaderCheckbox!==false){view.headerCt.on('headerclick',me.onHeaderClick,me);}
me.addCheckbox(view,true);owner=view.ownerCt;if(view.headerCt.lockedCt){owner=owner.ownerCt;}
me.mon(owner,'reconfigure',me.onReconfigure,me);}},bindComponent:function(view){var me=this;me.sortable=false;me.callParent(arguments);},hasLockedHeader:function(){var views=this.views,vLen=views.length,v;for(v=0;v<vLen;v++){if(views[v].headerCt.lockedCt){return true;}}
return false;},addCheckbox:function(view,initial){var me=this,checkbox=me.injectCheckbox,headerCt=view.headerCt;if(checkbox!==false){if(checkbox=='first'){checkbox=0;}else if(checkbox=='last'){checkbox=headerCt.getColumnCount();}
Ext.suspendLayouts();if(view.getStore().buffered){me.showHeaderCheckbox=false;}
headerCt.add(checkbox,me.getHeaderConfig());Ext.resumeLayouts();}
if(initial!==true){view.refresh();}},onReconfigure:function(grid,store,columns){if(columns){this.addCheckbox(this.views[0]);}},toggleUiHeader:function(isChecked){var view=this.views[0],headerCt=view.headerCt,checkHd=headerCt.child('gridcolumn[isCheckerHd]'),cls=this.checkerOnCls;if(checkHd){if(isChecked){checkHd.addCls(cls);}else{checkHd.removeCls(cls);}}},onHeaderClick:function(headerCt,header,e){if(header.isCheckerHd){e.stopEvent();var me=this,isChecked=header.el.hasCls(Ext.baseCSSPrefix+'grid-hd-checker-on');me.preventFocus=true;if(isChecked){me.deselectAll();}else{me.selectAll();}
delete me.preventFocus;}},getHeaderConfig:function(){var me=this,showCheck=me.showHeaderCheckbox!==false;return{isCheckerHd:showCheck,text:'&#160;',clickTargetName:'el',width:me.headerWidth,sortable:false,draggable:false,resizable:false,hideable:false,menuDisabled:true,dataIndex:'',cls:showCheck?Ext.baseCSSPrefix+'column-header-checkbox ':'',renderer:Ext.Function.bind(me.renderer,me),editRenderer:me.editRenderer||me.renderEmpty,locked:me.hasLockedHeader()};},renderEmpty:function(){return'&#160;';},refresh:function(){this.callParent(arguments);this.updateHeaderState();},renderer:function(value,metaData,record,rowIndex,colIndex,store,view){var baseCSSPrefix=Ext.baseCSSPrefix;metaData.tdCls=baseCSSPrefix+'grid-cell-special '+baseCSSPrefix+'grid-cell-row-checker';return'<div class="'+baseCSSPrefix+'grid-row-checker">&#160;</div>';},processSelection:function(view,record,item,index,e){var me=this,checker=e.getTarget(me.checkSelector),mode;if(me.checkOnly&&!checker){return;}
if(checker){mode=me.getSelectionMode();if(mode!=='SINGLE'){me.setSelectionMode('SIMPLE');}
me.selectWithEvent(record,e);me.setSelectionMode(mode);}else{me.selectWithEvent(record,e);}},onSelectChange:function(){this.callParent(arguments);if(!this.suspendChange){this.updateHeaderState();}},onStoreLoad:function(){this.callParent(arguments);this.updateHeaderState();},onStoreAdd:function(){this.callParent(arguments);this.updateHeaderState();},onStoreRemove:function(){this.callParent(arguments);this.updateHeaderState();},onStoreRefresh:function(){this.callParent(arguments);this.updateHeaderState();},maybeFireSelectionChange:function(fireEvent){if(fireEvent&&!this.suspendChange){this.updateHeaderState();}
this.callParent(arguments);},resumeChanges:function(){this.callParent();if(!this.suspendChange){this.updateHeaderState();}},updateHeaderState:function(){var me=this,store=me.store,storeCount=store.getCount(),views=me.views,hdSelectStatus=false,selectedCount=0,selected,len,i;if(!store.buffered&&storeCount>0){selected=me.selected;hdSelectStatus=true;for(i=0,len=selected.getCount();i<len;++i){if(!me.storeHasSelected(selected.getAt(i))){break;}
++selectedCount;}
hdSelectStatus=storeCount===selectedCount;}
if(views&&views.length){me.toggleUiHeader(hdSelectStatus);}}});Ext.define('Ext.data.Store',{extend:'Ext.data.AbstractStore',alias:'store.store',requires:['Ext.data.StoreManager','Ext.data.Model','Ext.data.proxy.Ajax','Ext.data.proxy.Memory','Ext.data.reader.Json','Ext.data.writer.Json','Ext.data.PageMap','Ext.data.Group'],uses:['Ext.ModelManager','Ext.util.Grouper'],remoteSort:false,remoteFilter:false,remoteGroup:false,groupField:undefined,groupDir:"ASC",trailingBufferZone:25,leadingBufferZone:200,pageSize:undefined,currentPage:1,clearOnPageLoad:true,loading:false,sortOnFilter:true,buffered:false,purgePageCount:5,clearRemovedOnLoad:true,defaultPageSize:25,defaultViewSize:100,addRecordsOptions:{addRecords:true},statics:{recordIdFn:function(record){return record.internalId;},recordIndexFn:function(record){return record.index;},grouperIdFn:function(grouper){return grouper.id||grouper.property;},groupIdFn:function(group){return group.key;}},constructor:function(config){config=Ext.apply({},config);var me=this,groupers=config.groupers||me.groupers,groupField=config.groupField||me.groupField,proxy,data;data=config.data||me.data;if(data){me.inlineData=data;delete config.data;}
if(!groupers&&groupField){groupers=[{property:groupField,direction:config.groupDir||me.groupDir}];if(config.getGroupString||(me.getGroupString!==Ext.data.Store.prototype.getGroupString)){groupers[0].getGroupString=function(record){return me.getGroupString(record);}}}
delete config.groupers;me.groupers=new Ext.util.MixedCollection(false,Ext.data.Store.grouperIdFn);me.groupers.addAll(me.decodeGroupers(groupers));me.groups=new Ext.util.MixedCollection(false,Ext.data.Store.groupIdFn);me.callParent([config]);if(me.buffered){me.data=new Ext.data.PageMap({store:me,keyFn:Ext.data.Store.recordIdFn,pageSize:me.pageSize,maxSize:me.purgePageCount,listeners:{clear:me.onPageMapClear,scope:me}});me.pageRequests={};me.remoteSort=me.remoteGroup=me.remoteFilter=true;me.sortOnLoad=false;me.filterOnLoad=false;}else{me.data=new Ext.util.MixedCollection({getKey:Ext.data.Store.recordIdFn,maintainIndices:true});me.data.pageSize=me.pageSize;}
if(me.remoteGroup){me.remoteSort=true;}
me.sorters.insert(0,me.groupers.getRange());proxy=me.proxy;data=me.inlineData;if(!me.buffered&&!me.pageSize){me.pageSize=me.defaultPageSize;}
if(data){if(proxy instanceof Ext.data.proxy.Memory){proxy.data=data;me.read();}else{me.add.apply(me,[data]);}
if(me.sorters.items.length&&!me.remoteSort){me.group(null,null,true);}
delete me.inlineData;}
else if(me.autoLoad){Ext.defer(me.load,1,me,[typeof me.autoLoad==='object'?me.autoLoad:undefined]);}},onBeforeSort:function(){var groupers=this.groupers;if(groupers.getCount()>0){this.sort(groupers.items,'prepend',false);}},decodeGroupers:function(groupers){if(!Ext.isArray(groupers)){if(groupers===undefined){groupers=[];}else{groupers=[groupers];}}
var length=groupers.length,Grouper=Ext.util.Grouper,config,i,result=[];for(i=0;i<length;i++){config=groupers[i];if(!(config instanceof Grouper)){if(Ext.isString(config)){config={property:config};}
config=Ext.apply({root:'data',direction:"ASC"},config);if(config.fn){config.sorterFn=config.fn;}
if(typeof config=='function'){config={sorterFn:config};}
result.push(new Grouper(config));}else{result.push(config);}}
return result;},group:function(groupers,direction,suppressEvent){var me=this,grouper,newGroupers;if(groupers){me.sorters.removeAll(me.groupers.items);if(Ext.isArray(groupers)){newGroupers=groupers;}else if(Ext.isObject(groupers)){newGroupers=[groupers];}else if(Ext.isString(groupers)){grouper=me.groupers.get(groupers);if(!grouper){grouper={property:groupers,direction:direction||'ASC'};newGroupers=[grouper];}else if(direction===undefined){grouper.toggle();}else{grouper.setDirection(direction);}}
if(newGroupers&&newGroupers.length){me.groupers.clear();me.groupers.addAll(me.decodeGroupers(newGroupers));}
me.sorters.insert(0,me.groupers.items);}
if(me.remoteGroup){if(me.buffered){me.data.clear();me.loadPage(1,{groupChange:true});}else{me.load({scope:me,callback:suppressEvent?null:me.fireGroupChange});}}else{me.doSort(me.generateComparator());me.constructGroups();if(!suppressEvent){me.fireGroupChange();}}},getGroupField:function(){var first=this.groupers.first(),group;if(first){group=first.property;}
return group;},constructGroups:function(){var me=this,data=this.data.items,len=data.length,groups=me.groups,groupValue,i,group,rec;groups.clear();if(me.isGrouped()){for(i=0;i<len;++i){rec=data[i];groupValue=me.getGroupString(rec);group=groups.get(groupValue);if(!group){group=new Ext.data.Group({key:groupValue,store:me});groups.add(groupValue,group);}
group.add(rec);}}},clearGrouping:function(){var me=this,groupers=me.groupers.items,gLen=groupers.length,g;for(g=0;g<gLen;g++){me.sorters.remove(groupers[g]);}
me.groupers.clear();if(me.remoteGroup){if(me.buffered){me.data.clear();me.loadPage(1,{groupChange:true});}else{me.load({scope:me,callback:me.fireGroupChange});}}else{me.groups.clear();if(me.sorters.length){me.sort();}else{me.fireEvent('datachanged',me);me.fireEvent('refresh',me);}
me.fireGroupChange();}},isGrouped:function(){return this.groupers.getCount()>0;},fireGroupChange:function(){this.fireEvent('groupchange',this,this.groupers);},getGroups:function(requestGroupString){var records=this.data.items,length=records.length,groups=[],pointers={},record,groupStr,group,i;for(i=0;i<length;i++){record=records[i];groupStr=this.getGroupString(record);group=pointers[groupStr];if(group===undefined){group={name:groupStr,children:[]};groups.push(group);pointers[groupStr]=group;}
group.children.push(record);}
return requestGroupString?pointers[requestGroupString]:groups;},getGroupsForGrouper:function(records,grouper){var length=records.length,groups=[],oldValue,newValue,record,group,i;for(i=0;i<length;i++){record=records[i];newValue=grouper.getGroupString(record);if(newValue!==oldValue){group={name:newValue,grouper:grouper,records:[]};groups.push(group);}
group.records.push(record);oldValue=newValue;}
return groups;},getGroupsForGrouperIndex:function(records,grouperIndex){var me=this,groupers=me.groupers,grouper=groupers.getAt(grouperIndex),groups=me.getGroupsForGrouper(records,grouper),length=groups.length,i;if(grouperIndex+1<groupers.length){for(i=0;i<length;i++){groups[i].children=me.getGroupsForGrouperIndex(groups[i].records,grouperIndex+1);}}
for(i=0;i<length;i++){groups[i].depth=grouperIndex;}
return groups;},getGroupData:function(sort){var me=this;if(sort!==false){me.sort();}
return me.getGroupsForGrouperIndex(me.data.items,0);},getGroupString:function(instance){var group=this.groupers.first();if(group){return group.getGroupString(instance);}
return'';},insert:function(index,records){var me=this,sync=false,i,len,record,defaults=me.modelDefaults,out;if(!Ext.isIterable(records)){out=records=[records];}else{out=[];}
len=records.length;if(len){for(i=0;i<len;i++){record=records[i];if(!record.isModel){record=me.createModel(record);}
out[i]=record;if(defaults){record.set(defaults);}
record.join(me);sync=sync||record.phantom===true;}
me.data.insert(index,out);if(me.snapshot){me.snapshot.addAll(out);}
if(me.requireSort){me.suspendEvents();me.sort();me.resumeEvents();}
if(me.isGrouped()){me.updateGroupsOnAdd(out);}
me.fireEvent('add',me,out,index);me.fireEvent('datachanged',me);if(me.autoSync&&sync&&!me.autoSyncSuspended){me.sync();}}
return out;},updateGroupsOnAdd:function(records){var me=this,groups=me.groups,len=records.length,i,groupName,group,rec;for(i=0;i<len;++i){rec=records[i];groupName=me.getGroupString(rec);group=groups.getByKey(groupName);if(!group){group=groups.add(new Ext.data.Group({key:groupName,store:me}));}
group.add(rec);}},updateGroupsOnRemove:function(records){var me=this,groups=me.groups,len=records.length,i,groupName,group,rec;for(i=0;i<len;++i){rec=records[i];groupName=me.getGroupString(rec);group=groups.getByKey(groupName);if(group){group.remove(rec);if(group.records.length===0){groups.remove(group);}}}},updateGroupsOnUpdate:function(record,modifiedFieldNames){var me=this,groupField=me.getGroupField(),groupName=me.getGroupString(record),groups=me.groups,len,i,items,group;if(modifiedFieldNames&&Ext.Array.indexOf(modifiedFieldNames,groupField)!==-1){if(me.buffered){Ext.Error.raise({msg:'Cannot move records between groups in a buffered store record'});}
items=groups.items;for(i=0,len=items.length;i<len;++i){group=items[i];if(group.contains(record)){group.remove(record);break;}}
group=groups.getByKey(groupName);if(!group){group=groups.add(new Ext.data.Group({key:groupName,store:me}));}
group.add(record);me.data.remove(record);me.data.insert(me.data.findInsertionIndex(record,me.generateComparator()),record);for(i=0,len=this.getCount();i<len;i++){me.data.items[i].index=i;}}else{groups.getByKey(groupName).setDirty();}},add:function(arg){var me=this,records,length,isSorted;if(Ext.isArray(arg)){records=arg;}else{records=arguments;}
length=records.length;isSorted=!me.remoteSort&&me.sorters&&me.sorters.items.length;if(isSorted&&length===1){return[me.addSorted(me.createModel(records[0]))];}
if(isSorted){me.requireSort=true;}
records=me.insert(me.data.length,records);delete me.requireSort;return records;},addSorted:function(record){var me=this,index=me.data.findInsertionIndex(record,me.generateComparator());me.insert(index,record);return record;},createModel:function(record){if(!record.isModel){record=Ext.ModelManager.create(record,this.model);}
return record;},onUpdate:function(record,type,modifiedFieldNames){if(this.isGrouped()){this.updateGroupsOnUpdate(record,modifiedFieldNames);}},each:function(fn,scope){var data=this.data.items,dLen=data.length,record,d;for(d=0;d<dLen;d++){record=data[d];if(fn.call(scope||record,record,d,dLen)===false){break;}}},remove:function(records,isMove,silent){isMove=isMove===true;var me=this,sync=false,snapshot=me.snapshot,data=me.data,i=0,length,info=[],allRecords=[],indexes=[],item,isNotPhantom,index,record,removeRange,removeCount,fireRemoveEvent=!silent&&me.hasListeners.remove;if(records.isModel){records=[records];length=1;}
else if(Ext.isIterable(records)){length=records.length;}
else if(typeof records==='object'){removeRange=true;i=records.start;length=records.end+1;removeCount=length-i;}
if(!removeRange){for(i=0;i<length;++i){record=records[i];if(typeof record=='number'){index=record;record=data.getAt(index);}
else{index=me.indexOf(record);}
if(record&&index>-1){info.push({record:record,index:index});}
if(snapshot){snapshot.remove(record);}}
info=Ext.Array.sort(info,function(o1,o2){var index1=o1.index,index2=o2.index;return index1===o2.index2?0:(index1<index2?-1:1);});i=0;length=info.length;}
for(;i<length;i++){if(removeRange){record=data.getAt(i);index=i;}else{item=info[i];record=item.record;index=item.index;}
allRecords.push(record);indexes.push(index);isNotPhantom=record.phantom!==true;if(!isMove&&isNotPhantom){record.removedFrom=index;me.removed.push(record);}
record.unjoin(me);index-=i;sync=sync||isNotPhantom;if(!removeRange){data.removeAt(index);if(fireRemoveEvent){me.fireEvent('remove',me,record,index,!!isMove);}}}
if(removeRange){data.removeRange(records.start,removeCount);}
if(!silent){me.fireEvent('bulkremove',me,allRecords,indexes,!!isMove);me.fireEvent('datachanged',me);}
if(!isMove&&me.autoSync&&sync&&!me.autoSyncSuspended){me.sync();}},removeAt:function(index,count){var me=this,storeCount=me.getCount();if(index<=storeCount){if(arguments.length===1){me.remove([index]);}else if(count){me.remove({start:index,end:Math.min(index+count,storeCount)-1});}}},removeAll:function(silent){var me=this,snapshot=me.snapshot,data=me.data;if(snapshot){snapshot.removeAll(data.getRange());}
if(me.buffered){if(data){if(silent){me.suspendEvent('clear');}
data.clear();if(silent){me.resumeEvent('clear');}}}
else{me.remove({start:0,end:me.getCount()-1},false,silent);if(silent!==true){me.fireEvent('clear',me);}}},load:function(options){var me=this;options=options||{};if(typeof options=='function'){options={callback:options};}
options.groupers=options.groupers||me.groupers.items;options.page=options.page||me.currentPage;options.start=(options.start!==undefined)?options.start:(options.page-1)*me.pageSize;options.limit=options.limit||me.pageSize;options.addRecords=options.addRecords||false;if(me.buffered){options.limit=me.viewSize||me.defaultViewSize;return me.loadToPrefetch(options);}
return me.callParent([options]);},reload:function(options){var me=this,startIdx,endIdx,startPage,endPage,i,waitForReload,bufferZone,records,count=me.getCount();if(!options){options={};}
if(me.buffered){delete me.totalCount;waitForReload=function(){if(me.rangeCached(startIdx,endIdx)){me.loading=false;me.data.un('pageAdded',waitForReload);records=me.data.getRange(startIdx,endIdx);me.fireEvent('load',me,records,true);}};bufferZone=Math.ceil((me.leadingBufferZone+me.trailingBufferZone)/2);startIdx=options.start||(count?me.getAt(0).index:0);endIdx=startIdx+(options.count||(count?count:me.pageSize))-1;startPage=me.getPageFromRecordIndex(Math.max(startIdx-bufferZone,0));endPage=me.getPageFromRecordIndex(endIdx+bufferZone);me.data.clear(true);if(me.fireEvent('beforeload',me,options)!==false){me.loading=true;me.data.on('pageAdded',waitForReload);for(i=startPage;i<=endPage;i++){me.prefetchPage(i,options);}}}else{return me.callParent(arguments);}},onProxyLoad:function(operation){var me=this,resultSet=operation.getResultSet(),records=operation.getRecords(),successful=operation.wasSuccessful();if(me.isDestroyed){return;}
if(resultSet){me.totalCount=resultSet.total;}
me.loading=false;if(successful){me.loadRecords(records,operation);}
if(me.hasListeners.load){me.fireEvent('load',me,records,successful);}
if(me.hasListeners.read){me.fireEvent('read',me,records,successful);}
Ext.callback(operation.callback,operation.scope||me,[records,operation,successful]);},getNewRecords:function(){return this.data.filterBy(this.filterNew).items;},getUpdatedRecords:function(){return this.data.filterBy(this.filterUpdated).items;},filter:function(filters,value){if(Ext.isString(filters)){filters={property:filters,value:value};}
var me=this,decoded=me.decodeFilters(filters),i,doLocalSort=me.sorters.length&&me.sortOnFilter&&!me.remoteSort,length=decoded.length;for(i=0;i<length;i++){me.filters.replace(decoded[i]);}
filters=me.filters.items;if(filters.length){if(me.remoteFilter){delete me.totalCount;if(me.buffered){me.data.clear();me.loadPage(1);}else{me.currentPage=1;me.load();}}else{me.snapshot=me.snapshot||me.data.clone();me.data=me.snapshot.filter(filters);me.constructGroups();if(doLocalSort){me.sort();}else{me.fireEvent('datachanged',me);me.fireEvent('refresh',me);}}
me.fireEvent('filterchange',me,filters);}},clearFilter:function(suppressEvent){var me=this;me.filters.clear();if(me.remoteFilter){if(suppressEvent){return;}
delete me.totalCount;if(me.buffered){me.data.clear();me.loadPage(1);}else{me.currentPage=1;me.load();}}else if(me.isFiltered()){me.data=me.snapshot;delete me.snapshot;me.constructGroups();if(suppressEvent!==true){me.fireEvent('datachanged',me);me.fireEvent('refresh',me);}}
me.fireEvent('filterchange',me,me.filters.items);},removeFilter:function(toRemove,applyFilters){var me=this;if(!me.remoteFilter&&me.isFiltered()){if(toRemove instanceof Ext.util.Filter){me.filters.remove(toRemove);}else{me.filters.removeAtKey(toRemove);}
if(applyFilters!==false){if(me.filters.length){me.filter();}
else{me.clearFilter();}}else{me.fireEvent('filterchange',me,me.filters.items);}}},addFilter:function(filters,applyFilters){var me=this,decoded,i,length;decoded=me.decodeFilters(filters);length=decoded.length;for(i=0;i<length;i++){me.filters.replace(decoded[i]);}
if(applyFilters!==false&&me.filters.length){me.filter();}else{me.fireEvent('filterchange',me,me.filters.items);}},isFiltered:function(){var snapshot=this.snapshot;return!!(snapshot&&snapshot!==this.data);},filterBy:function(fn,scope){var me=this;me.snapshot=me.snapshot||me.data.clone();me.data=me.queryBy(fn,scope||me);me.fireEvent('datachanged',me);me.fireEvent('refresh',me);},queryBy:function(fn,scope){var me=this;return(me.snapshot||me.data).filterBy(fn,scope||me);},query:function(property,value,anyMatch,caseSensitive,exactMatch){var me=this,queryFn=me.createFilterFn(property,value,anyMatch,caseSensitive,exactMatch),results=me.queryBy(queryFn);if(!results){results=new Ext.util.MixedCollection();}
return results;},loadData:function(data,append){var length=data.length,newData=[],i;for(i=0;i<length;i++){newData.push(this.createModel(data[i]));}
this.loadRecords(newData,append?this.addRecordsOptions:undefined);},loadRawData:function(data,append){var me=this,result=me.proxy.reader.read(data),records=result.records;if(result.success){me.totalCount=result.total;me.loadRecords(records,append?me.addRecordsOptions:undefined);}},loadRecords:function(records,options){var me=this,i=0,length=records.length,start,addRecords,snapshot=me.snapshot;if(options){start=options.start;addRecords=options.addRecords;}
if(!addRecords){delete me.snapshot;me.clearData(true);}else if(snapshot){snapshot.addAll(records);}
me.data.addAll(records);if(start!==undefined){for(;i<length;i++){records[i].index=start+i;records[i].join(me);}}else{for(;i<length;i++){records[i].join(me);}}
me.suspendEvents();if(me.filterOnLoad&&!me.remoteFilter){me.filter();}
if(me.sortOnLoad&&!me.remoteSort){me.sort(undefined,undefined,undefined,true);}
me.resumeEvents();if(me.isGrouped()){me.constructGroups();}
me.fireEvent('datachanged',me);me.fireEvent('refresh',me);},loadPage:function(page,options){var me=this;me.currentPage=page;options=Ext.apply({page:page,start:(page-1)*me.pageSize,limit:me.pageSize,addRecords:!me.clearOnPageLoad},options);if(me.buffered){options.limit=me.viewSize||me.defaultViewSize;return me.loadToPrefetch(options);}
me.read(options);},nextPage:function(options){this.loadPage(this.currentPage+1,options);},previousPage:function(options){this.loadPage(this.currentPage-1,options);},clearData:function(isLoad){var me=this,records,i;if(!me.buffered&&me.data){records=me.data.items;i=records.length;while(i--){records[i].unjoin(me);}}
if(me.data){me.data.clear();}
if(isLoad!==true||me.clearRemovedOnLoad){me.removed.length=0;}},loadToPrefetch:function(options){var me=this,i,records,dataSetSize,prefetchOptions=options,startIdx=options.start,endIdx=options.start+options.limit-1,loadEndIdx=Math.min(endIdx,options.start+(me.viewSize||options.limit)-1),startPage=me.getPageFromRecordIndex(Math.max(startIdx-me.trailingBufferZone,0)),endPage=me.getPageFromRecordIndex(endIdx+me.leadingBufferZone),waitForRequestedRange=function(){if(me.rangeCached(startIdx,loadEndIdx)){me.loading=false;records=me.data.getRange(startIdx,loadEndIdx);me.data.un('pageAdded',waitForRequestedRange);if(me.hasListeners.guaranteedrange){me.guaranteeRange(startIdx,loadEndIdx,options.callback,options.scope);}
if(options.callback){options.callback.call(options.scope||me,records,startIdx,endIdx,options);}
me.fireEvent('datachanged',me);me.fireEvent('refresh',me);me.fireEvent('load',me,records,true);if(options.groupChange){me.fireGroupChange();}}};if(me.fireEvent('beforeload',me,options)!==false){delete me.totalCount;me.loading=true;if(options.callback){prefetchOptions=Ext.apply({},options);delete prefetchOptions.callback;}
me.on('prefetch',function(store,records,successful,operation){if(successful){if((dataSetSize=me.getTotalCount())){me.data.on('pageAdded',waitForRequestedRange);loadEndIdx=Math.min(loadEndIdx,dataSetSize-1);endPage=me.getPageFromRecordIndex(Math.min(loadEndIdx+me.leadingBufferZone,dataSetSize-1));for(i=startPage+1;i<=endPage;++i){me.prefetchPage(i,prefetchOptions);}}else{me.fireEvent('datachanged',me);me.fireEvent('refresh',me);me.fireEvent('load',me,records,true);}}
else{me.fireEvent('load',me,records,false);}},null,{single:true});me.prefetchPage(startPage,prefetchOptions);}},prefetch:function(options){var me=this,pageSize=me.pageSize,proxy,operation;if(pageSize){if(me.lastPageSize&&pageSize!=me.lastPageSize){Ext.Error.raise("pageSize cannot be dynamically altered");}
if(!me.data.pageSize){me.data.pageSize=pageSize;}}
else{me.pageSize=me.data.pageSize=pageSize=options.limit;}
me.lastPageSize=pageSize;if(!options.page){options.page=me.getPageFromRecordIndex(options.start);options.start=(options.page-1)*pageSize;options.limit=Math.ceil(options.limit/pageSize)*pageSize;}
if(!me.pageRequests[options.page]){options=Ext.apply({action:'read',filters:me.filters.items,sorters:me.sorters.items,groupers:me.groupers.items,pageMapGeneration:me.data.pageMapGeneration},options);operation=new Ext.data.Operation(options);if(me.fireEvent('beforeprefetch',me,operation)!==false){proxy=me.proxy;me.pageRequests[options.page]=proxy.read(operation,me.onProxyPrefetch,me);if(proxy.isSynchronous){delete me.pageRequests[options.page];}}}
return me;},onPageMapClear:function(){var me=this,loadingFlag=me.wasLoading,reqs=me.pageRequests,req,page;if(me.data.events.pageadded){me.data.events.pageadded.clearListeners();}
me.loading=true;me.totalCount=0;for(page in reqs){if(reqs.hasOwnProperty(page)){req=reqs[page];delete reqs[page];delete req.callback;}}
me.fireEvent('clear',me);me.loading=loadingFlag;},prefetchPage:function(page,options){var me=this,pageSize=me.pageSize||me.defaultPageSize,start=(page-1)*me.pageSize,total=me.totalCount;if(total!==undefined&&me.getCount()===total){return;}
me.prefetch(Ext.applyIf({page:page,start:start,limit:pageSize},options));},onProxyPrefetch:function(operation){var me=this,resultSet=operation.getResultSet(),records=operation.getRecords(),successful=operation.wasSuccessful(),page=operation.page;if(operation.pageMapGeneration===me.data.pageMapGeneration){if(resultSet){me.totalCount=resultSet.total;me.fireEvent('totalcountchange',me.totalCount);}
if(page!==undefined){delete me.pageRequests[page];}
me.loading=false;me.fireEvent('prefetch',me,records,successful,operation);if(successful){me.cachePage(records,operation.page);}
Ext.callback(operation.callback,operation.scope||me,[records,operation,successful]);}},cachePage:function(records,page){var me=this,len=records.length,i;if(!Ext.isDefined(me.totalCount)){me.totalCount=records.length;me.fireEvent('totalcountchange',me.totalCount);}
for(i=0;i<len;i++){records[i].join(me);}
me.data.addPage(page,records);},rangeCached:function(start,end){return this.data&&this.data.hasRange(start,end);},pageCached:function(page){return this.data&&this.data.hasPage(page);},pagePending:function(page){return!!this.pageRequests[page];},rangeSatisfied:function(start,end){return this.rangeCached(start,end);},getPageFromRecordIndex:function(index){return Math.floor(index/this.pageSize)+1;},onGuaranteedRange:function(options){var me=this,totalCount=me.getTotalCount(),start=options.prefetchStart,end=(options.prefetchEnd>totalCount-1)?totalCount-1:options.prefetchEnd,range;end=Math.max(0,end);range=me.data.getRange(start,end);if(options.fireEvent!==false){me.fireEvent('guaranteedrange',range,start,end,options);}
if(options.callback){options.callback.call(options.scope||me,range,start,end,options);}},guaranteeRange:function(start,end,callback,scope,options){options=Ext.apply({callback:callback,scope:scope},options);this.getRange(start,end,options)},prefetchRange:function(start,end){var me=this,startPage,endPage,page;if(!me.rangeCached(start,end)){startPage=me.getPageFromRecordIndex(start);endPage=me.getPageFromRecordIndex(end);me.data.maxSize=me.purgePageCount?(endPage-startPage+1)+me.purgePageCount:0;for(page=startPage;page<=endPage;page++){if(!me.pageCached(page)){me.prefetchPage(page);}}}},primeCache:function(start,end,direction){var me=this;if(direction===-1){start=Math.max(start-me.leadingBufferZone,0);end=Math.min(end+me.trailingBufferZone,me.totalCount-1);}
else if(direction===1){start=Math.max(Math.min(start-me.trailingBufferZone,me.totalCount-me.pageSize),0);end=Math.min(end+me.leadingBufferZone,me.totalCount-1);}
else{start=Math.min(Math.max(Math.floor(start-((me.leadingBufferZone+me.trailingBufferZone)/2)),0),me.totalCount-me.pageSize);end=Math.min(Math.max(Math.ceil(end+((me.leadingBufferZone+me.trailingBufferZone)/2)),0),me.totalCount-1);}
me.prefetchRange(start,end);},sort:function(){var me=this;if(me.buffered&&me.remoteSort){me.data.clear();}
return me.callParent(arguments);},doSort:function(sorterFn){var me=this,range,ln,i;if(me.remoteSort){if(me.buffered){me.data.clear();me.loadPage(1);}else{me.load();}}else{me.data.sortBy(sorterFn);if(!me.buffered){range=me.getRange();ln=range.length;for(i=0;i<ln;i++){range[i].index=i;}}
me.fireEvent('datachanged',me);me.fireEvent('refresh',me);}},find:function(property,value,start,anyMatch,caseSensitive,exactMatch){var fn=this.createFilterFn(property,value,anyMatch,caseSensitive,exactMatch);return fn?this.data.findIndexBy(fn,null,start):-1;},findRecord:function(){var me=this,index=me.find.apply(me,arguments);return index!==-1?me.getAt(index):null;},createFilterFn:function(property,value,anyMatch,caseSensitive,exactMatch){if(Ext.isEmpty(value)){return false;}
value=this.data.createValueMatcher(value,anyMatch,caseSensitive,exactMatch);return function(r){return value.test(r.data[property]);};},findExact:function(property,value,start){return this.data.findIndexBy(function(rec){return rec.isEqual(rec.get(property),value);},this,start);},findBy:function(fn,scope,start){return this.data.findIndexBy(fn,scope,start);},collect:function(dataIndex,allowNull,bypassFilter){var me=this,data=(bypassFilter===true&&me.snapshot)?me.snapshot:me.data;return data.collect(dataIndex,'data',allowNull);},getCount:function(){return this.data.getCount();},getTotalCount:function(){return this.totalCount||0;},getAt:function(index){return this.data.getAt(index);},getRange:function(start,end,options){var me=this,requiredStart,requiredEnd,maxIndex=me.totalCount-1,lastRequestStart=me.lastRequestStart,pageAddHandler,result;options=Ext.apply({prefetchStart:start,prefetchEnd:end},options);if(me.buffered){end=(end>=me.totalCount)?maxIndex:end;requiredStart=start===0?0:start-1;requiredEnd=end===maxIndex?end:end+1;me.lastRequestStart=start;if(me.rangeCached(requiredStart,requiredEnd)){me.onGuaranteedRange(options);result=me.data.getRange(start,end);}
else{me.fireEvent('cachemiss',me,start,end);pageAddHandler=function(page,records){if(me.rangeCached(requiredStart,requiredEnd)){me.fireEvent('cachefilled',me,start,end);me.data.un('pageAdded',pageAddHandler);me.onGuaranteedRange(options);}};me.data.on('pageAdded',pageAddHandler);me.prefetchRange(start,end);}
me.primeCache(start,end,start<lastRequestStart?-1:1);}else{result=me.data.getRange(start,end);if(options.callback){options.callback.call(options.scope||me,result,start,end,options)}}
return result;},getById:function(id){var result=(this.snapshot||this.data).findBy(function(record){return record.getId()===id;});return result;},indexOf:function(record){return this.data.indexOf(record);},indexOfTotal:function(record){var index=record.index;if(index||index===0){return index;}
return this.indexOf(record);},indexOfId:function(id){return this.indexOf(this.getById(id));},first:function(grouped){var me=this;if(grouped&&me.isGrouped()){return me.aggregate(function(records){return records.length?records[0]:undefined;},me,true);}else{return me.data.first();}},last:function(grouped){var me=this;if(grouped&&me.isGrouped()){return me.aggregate(function(records){var len=records.length;return len?records[len-1]:undefined;},me,true);}else{return me.data.last();}},sum:function(field,grouped){var me=this;if(grouped&&me.isGrouped()){return me.aggregate(me.getSum,me,true,[field]);}else{return me.getSum(me.data.items,field);}},getSum:function(records,field){var total=0,i=0,len=records.length;for(;i<len;++i){total+=records[i].get(field);}
return total;},count:function(grouped){var me=this;if(grouped&&me.isGrouped()){return me.aggregate(function(records){return records.length;},me,true);}else{return me.getCount();}},min:function(field,grouped){var me=this;if(grouped&&me.isGrouped()){return me.aggregate(me.getMin,me,true,[field]);}else{return me.getMin(me.data.items,field);}},getMin:function(records,field){var i=1,len=records.length,value,min;if(len>0){min=records[0].get(field);}
for(;i<len;++i){value=records[i].get(field);if(value<min){min=value;}}
return min;},max:function(field,grouped){var me=this;if(grouped&&me.isGrouped()){return me.aggregate(me.getMax,me,true,[field]);}else{return me.getMax(me.data.items,field);}},getMax:function(records,field){var i=1,len=records.length,value,max;if(len>0){max=records[0].get(field);}
for(;i<len;++i){value=records[i].get(field);if(value>max){max=value;}}
return max;},average:function(field,grouped){var me=this;if(grouped&&me.isGrouped()){return me.aggregate(me.getAverage,me,true,[field]);}else{return me.getAverage(me.data.items,field);}},getAverage:function(records,field){var i=0,len=records.length,sum=0;if(records.length>0){for(;i<len;++i){sum+=records[i].get(field);}
return sum/len;}
return 0;},aggregate:function(fn,scope,grouped,args){args=args||[];if(grouped&&this.isGrouped()){var groups=this.getGroups(),len=groups.length,out={},group,i;for(i=0;i<len;++i){group=groups[i];out[group.name]=this.getAggregate(fn,scope||this,group.children,args);}
return out;}else{return this.getAggregate(fn,scope,this.data.items,args);}},getAggregate:function(fn,scope,records,args){args=args||[];return fn.apply(scope||this,[records].concat(args));},onIdChanged:function(rec,oldId,newId,oldInternalId){var snapshot=this.snapshot;if(snapshot){snapshot.updateKey(oldInternalId,newId);}
this.data.updateKey(oldInternalId,newId);this.callParent(arguments);},commitChanges:function(){var me=this,recs=me.getModifiedRecords(),len=recs.length,i=0;for(;i<len;i++){recs[i].commit();}
me.removed.length=0;},filterNewOnly:function(item){return item.phantom===true;},getRejectRecords:function(){return Ext.Array.push(this.data.filterBy(this.filterNewOnly).items,this.getUpdatedRecords());},rejectChanges:function(){var me=this,recs=me.getRejectRecords(),len=recs.length,i=0,rec;for(;i<len;i++){rec=recs[i];rec.reject();if(rec.phantom){me.remove(rec);}}
recs=me.removed;len=recs.length;for(i=0;i<len;i++){rec=recs[i];me.insert(rec.removedFrom||0,rec);rec.reject();}
me.removed.length=0;}},function(){Ext.regStore('ext-empty-store',{fields:[],proxy:'memory'});});Ext.define('Ext.grid.header.DropZone',{extend:'Ext.dd.DropZone',colHeaderCls:Ext.baseCSSPrefix+'column-header',proxyOffsets:[-4,-9],constructor:function(headerCt){this.headerCt=headerCt;this.ddGroup=this.getDDGroup();this.callParent([headerCt.el]);},getDDGroup:function(){return'header-dd-zone-'+this.headerCt.up('[scrollerOwner]').id;},getTargetFromEvent:function(e){return e.getTarget('.'+this.colHeaderCls);},getTopIndicator:function(){if(!this.topIndicator){this.self.prototype.topIndicator=Ext.DomHelper.append(Ext.getBody(),{cls:"col-move-top",html:"&#160;"},true);this.self.prototype.indicatorXOffset=Math.floor((this.topIndicator.dom.offsetWidth+1)/2);}
return this.topIndicator;},getBottomIndicator:function(){if(!this.bottomIndicator){this.self.prototype.bottomIndicator=Ext.DomHelper.append(Ext.getBody(),{cls:"col-move-bottom",html:"&#160;"},true);}
return this.bottomIndicator;},getLocation:function(e,t){var x=e.getXY()[0],region=Ext.fly(t).getRegion(),pos;if((region.right-x)<=(region.right-region.left)/2){pos="after";}else{pos="before";}
return{pos:pos,header:Ext.getCmp(t.id),node:t};},positionIndicator:function(data,node,e){var me=this,dragHeader=data.header,dropLocation=me.getLocation(e,node),targetHeader=dropLocation.header,pos=dropLocation.pos,nextHd,prevHd,topIndicator,bottomIndicator,topAnchor,bottomAnchor,topXY,bottomXY,headerCtEl,minX,maxX,allDropZones,ln,i,dropZone;if(targetHeader===me.lastTargetHeader&&pos===me.lastDropPos){return;}
nextHd=dragHeader.nextSibling('gridcolumn:not([hidden])');prevHd=dragHeader.previousSibling('gridcolumn:not([hidden])');me.lastTargetHeader=targetHeader;me.lastDropPos=pos;if(!targetHeader.draggable&&pos==='before'&&targetHeader.getIndex()===0){return false;}
data.dropLocation=dropLocation;if((dragHeader!==targetHeader)&&((pos==="before"&&nextHd!==targetHeader)||(pos==="after"&&prevHd!==targetHeader))&&!targetHeader.isDescendantOf(dragHeader)){allDropZones=Ext.dd.DragDropManager.getRelated(me);ln=allDropZones.length;i=0;for(;i<ln;i++){dropZone=allDropZones[i];if(dropZone!==me&&dropZone.invalidateDrop){dropZone.invalidateDrop();}}
me.valid=true;topIndicator=me.getTopIndicator();bottomIndicator=me.getBottomIndicator();if(pos==='before'){topAnchor='bc-tl';bottomAnchor='tc-bl';}else{topAnchor='bc-tr';bottomAnchor='tc-br';}
topXY=topIndicator.getAlignToXY(targetHeader.el,topAnchor);bottomXY=bottomIndicator.getAlignToXY(targetHeader.el,bottomAnchor);headerCtEl=me.headerCt.el;minX=headerCtEl.getX()-me.indicatorXOffset;maxX=headerCtEl.getX()+headerCtEl.getWidth();topXY[0]=Ext.Number.constrain(topXY[0],minX,maxX);bottomXY[0]=Ext.Number.constrain(bottomXY[0],minX,maxX);topIndicator.setXY(topXY);bottomIndicator.setXY(bottomXY);topIndicator.show();bottomIndicator.show();}else{me.invalidateDrop();}},invalidateDrop:function(){this.valid=false;this.hideIndicators();},onNodeOver:function(node,dragZone,e,data){var me=this,from=data.header,doPosition,to,fromPanel,toPanel;if(data.header.el.dom===node){doPosition=false;}else{data.isLock=data.isUnlock=false;to=me.getLocation(e,node).header;doPosition=(from.ownerCt===to.ownerCt);if(!doPosition&&(!from.ownerCt.sealed&&!to.ownerCt.sealed)){doPosition=true;fromPanel=from.up('tablepanel');toPanel=to.up('tablepanel');data.isLock=toPanel.isLocked&&!fromPanel.isLocked;data.isUnlock=!toPanel.isLocked&&fromPanel.isLocked;if((data.isUnlock&&from.lockable===false)||(data.isLock&&!from.isLockable())){doPosition=false;}}}
if(doPosition){me.positionIndicator(data,node,e);}else{me.valid=false;}
return me.valid?me.dropAllowed:me.dropNotAllowed;},hideIndicators:function(){var me=this;me.getTopIndicator().hide();me.getBottomIndicator().hide();me.lastTargetHeader=me.lastDropPos=null;},onNodeOut:function(){this.hideIndicators();},onNodeDrop:function(node,dragZone,e,data){if(this.valid){var dragHeader=data.header,dropLocation=data.dropLocation,targetHeader=dropLocation.header,fromCt=dragHeader.ownerCt,localFromIdx=fromCt.items.indexOf(dragHeader),toCt=targetHeader.ownerCt,localToIdx=toCt.items.indexOf(targetHeader),headerCt=this.headerCt,columnManager=headerCt.columnManager,fromIdx=columnManager.getHeaderIndex(dragHeader),toIdx=columnManager.getHeaderIndex(targetHeader),colsToMove=dragHeader.isGroupHeader?dragHeader.query(':not([isGroupHeader])').length:1,sameCt=fromCt===toCt,scrollerOwner,savedWidth;if(dropLocation.pos==='after'){localToIdx++;toIdx+=targetHeader.isGroupHeader?targetHeader.query(':not([isGroupHeader])').length:1;}
if(data.isLock){scrollerOwner=fromCt.up('[scrollerOwner]');scrollerOwner.lock(dragHeader,localToIdx);data.isLock=false;this.onNodeDrop(node,dragZone,e,data);}else if(data.isUnlock){scrollerOwner=fromCt.up('[scrollerOwner]');scrollerOwner.unlock(dragHeader,localToIdx);data.isUnlock=false;this.onNodeDrop(node,dragZone,e,data);}
else{this.invalidateDrop();savedWidth=dragHeader.getWidth();if(sameCt){if(localToIdx===localFromIdx){headerCt.onHeaderMoved(dragHeader,colsToMove,fromIdx,toIdx);return;}
if(localToIdx>localFromIdx){localToIdx-=1;}}
Ext.suspendLayouts();if(sameCt){toCt.move(localFromIdx,localToIdx);}else{fromCt.remove(dragHeader,false);toCt.insert(localToIdx,dragHeader);}
if(toCt.isGroupHeader){if(!sameCt){dragHeader.savedFlex=dragHeader.flex;delete dragHeader.flex;dragHeader.width=savedWidth;}}else{if(dragHeader.savedFlex){dragHeader.flex=dragHeader.savedFlex;delete dragHeader.width;}}
headerCt.purgeCache();Ext.resumeLayouts(true);headerCt.onHeaderMoved(dragHeader,colsToMove,fromIdx,toIdx);}}}});Ext.define('Ext.layout.Context',{requires:['Ext.util.Queue','Ext.layout.ContextItem','Ext.layout.Layout','Ext.fx.Anim','Ext.fx.Manager'],remainingLayouts:0,state:0,constructor:function(config){var me=this;Ext.apply(me,config);me.items={};me.layouts={};me.blockCount=0;me.cycleCount=0;me.flushCount=0;me.calcCount=0;me.animateQueue=me.newQueue();me.completionQueue=me.newQueue();me.finalizeQueue=me.newQueue();me.finishQueue=me.newQueue();me.flushQueue=me.newQueue();me.invalidateData={};me.layoutQueue=me.newQueue();me.invalidQueue=[];me.triggers={data:{},dom:{}};},callLayout:function(layout,methodName){this.currentLayout=layout;layout[methodName](this.getCmp(layout.owner));},cancelComponent:function(comp,isChild,isDestroying){var me=this,components=comp,isArray=!comp.isComponent,length=isArray?components.length:1,i,k,klen,items,layout,newQueue,oldQueue,entry,temp,ownerCtContext;for(i=0;i<length;++i){if(isArray){comp=components[i];}
if(isDestroying&&comp.ownerCt){ownerCtContext=this.items[comp.ownerCt.el.id];if(ownerCtContext){Ext.Array.remove(ownerCtContext.childItems,me.getCmp(comp));}}
if(!isChild){oldQueue=me.invalidQueue;klen=oldQueue.length;if(klen){me.invalidQueue=newQueue=[];for(k=0;k<klen;++k){entry=oldQueue[k];temp=entry.item.target;if(temp!=comp&&!temp.isDescendant(comp)){newQueue.push(entry);}}}}
layout=comp.componentLayout;me.cancelLayout(layout);if(layout.getLayoutItems){items=layout.getLayoutItems();if(items.length){me.cancelComponent(items,true);}}
if(comp.isContainer&&!comp.collapsed){layout=comp.layout;me.cancelLayout(layout);items=layout.getVisibleItems();if(items.length){me.cancelComponent(items,true);}}}},cancelLayout:function(layout){var me=this;me.completionQueue.remove(layout);me.finalizeQueue.remove(layout);me.finishQueue.remove(layout);me.layoutQueue.remove(layout);if(layout.running){me.layoutDone(layout);}
layout.ownerContext=null;},clearTriggers:function(layout,inDom){var id=layout.id,collection=this.triggers[inDom?'dom':'data'],triggers=collection&&collection[id],length=(triggers&&triggers.length)||0,i,item,trigger;for(i=0;i<length;++i){trigger=triggers[i];item=trigger.item;collection=inDom?item.domTriggers:item.triggers;delete collection[trigger.prop][id];}},flush:function(){var me=this,items=me.flushQueue.clear(),length=items.length,i;if(length){++me.flushCount;for(i=0;i<length;++i){items[i].flush();}}},flushAnimations:function(){var me=this,items=me.animateQueue.clear(),len=items.length,i;if(len){for(i=0;i<len;i++){if(items[i].target.animate!==false){items[i].flushAnimations();}}
Ext.fx.Manager.runner();}},flushInvalidates:function(){var me=this,queue=me.invalidQueue,length=queue&&queue.length,comp,components,entry,i;me.invalidQueue=[];if(length){components=[];for(i=0;i<length;++i){comp=(entry=queue[i]).item.target;if(!comp.container.isDetachedBody){components.push(comp);if(entry.options){me.invalidateData[comp.id]=entry.options;}}}
me.invalidate(components,null);}},flushLayouts:function(queueName,methodName,dontClear){var me=this,layouts=dontClear?me[queueName].items:me[queueName].clear(),length=layouts.length,i,layout;if(length){for(i=0;i<length;++i){layout=layouts[i];if(!layout.running){me.callLayout(layout,methodName);}}
me.currentLayout=null;}},getCmp:function(cmp){return this.getItem(cmp,cmp.el);},getEl:function(parent,el){var item=this.getItem(el,el);if(!item.parent){item.parent=parent;if(parent.children.length){parent.children.push(item);}else{parent.children=[item];}}
return item;},getItem:function(target,el){var id=el.id,items=this.items,item=items[id]||(items[id]=new Ext.layout.ContextItem({context:this,target:target,el:el}));return item;},handleFailure:function(){var layouts=this.layouts,layout,key;Ext.failedLayouts=(Ext.failedLayouts||0)+1;for(key in layouts){layout=layouts[key];if(layouts.hasOwnProperty(key)){layout.running=false;layout.ownerContext=null;}}},invalidate:function(components,full){var me=this,isArray=!components.isComponent,containerLayoutDone,firstTime,i,comp,item,items,length,componentLayout,layout,invalidateOptions,token;for(i=0,length=isArray?components.length:1;i<length;++i){comp=isArray?components[i]:components;if(comp.rendered&&!comp.hidden){item=me.getCmp(comp);componentLayout=comp.componentLayout;firstTime=!componentLayout.ownerContext;layout=(comp.isContainer&&!comp.collapsed)?comp.layout:null;invalidateOptions=me.invalidateData[item.id];delete me.invalidateData[item.id];token=item.init(full,invalidateOptions);if(invalidateOptions){me.processInvalidate(invalidateOptions,item,'before');}
if(componentLayout.beforeLayoutCycle){componentLayout.beforeLayoutCycle(item);}
if(layout&&layout.beforeLayoutCycle){layout.beforeLayoutCycle(item);}
token=item.initContinue(token);containerLayoutDone=true;if(componentLayout.getLayoutItems){componentLayout.renderChildren();items=componentLayout.getLayoutItems();if(items.length){me.invalidate(items,true);}}
if(layout){containerLayoutDone=false;layout.renderChildren();items=layout.getVisibleItems();if(items.length){me.invalidate(items,true);}}
item.initDone(containerLayoutDone);me.resetLayout(componentLayout,item,firstTime);if(layout){me.resetLayout(layout,item,firstTime);}
item.initAnimation();if(invalidateOptions){me.processInvalidate(invalidateOptions,item,'after');}}}
me.currentLayout=null;},layoutDone:function(layout){var ownerContext=layout.ownerContext;layout.running=false;if(layout.isComponentLayout){if(ownerContext.measuresBox){ownerContext.onBoxMeasured();}
ownerContext.setProp('done',true);}else{ownerContext.setProp('containerLayoutDone',true);}
--this.remainingLayouts;++this.progressCount;},newQueue:function(){return new Ext.util.Queue();},processInvalidate:function(options,item,name){if(options[name]){var me=this,currentLayout=me.currentLayout;me.currentLayout=options.layout||null;options[name](item,options);me.currentLayout=currentLayout;}},queueAnimation:function(item){this.animateQueue.add(item);},queueCompletion:function(layout){this.completionQueue.add(layout);},queueFinalize:function(layout){this.finalizeQueue.add(layout);},queueFlush:function(item){this.flushQueue.add(item);},chainFns:function(oldOptions,newOptions,funcName){var me=this,oldLayout=oldOptions.layout,newLayout=newOptions.layout,oldFn=oldOptions[funcName],newFn=newOptions[funcName];return function(contextItem){var prev=me.currentLayout;if(oldFn){me.currentLayout=oldLayout;oldFn.call(oldOptions.scope||oldOptions,contextItem,oldOptions);}
me.currentLayout=newLayout;newFn.call(newOptions.scope||newOptions,contextItem,newOptions);me.currentLayout=prev;};},queueInvalidate:function(item,options){var me=this,newQueue=[],oldQueue=me.invalidQueue,index=oldQueue.length,comp,old,oldComp,oldOptions,oldState;if(item.isComponent){item=me.getCmp(comp=item);}else{comp=item.target;}
item.invalid=true;while(index--){old=oldQueue[index];oldComp=old.item.target;if(comp.isDescendant(oldComp)){return;}
if(oldComp==comp){if(!(oldOptions=old.options)){old.options=options;}else if(options){if(options.widthModel){oldOptions.widthModel=options.widthModel;}
if(options.heightModel){oldOptions.heightModel=options.heightModel;}
if(!(oldState=oldOptions.state)){oldOptions.state=options.state;}else if(options.state){Ext.apply(oldState,options.state);}
if(options.before){oldOptions.before=me.chainFns(oldOptions,options,'before');}
if(options.after){oldOptions.after=me.chainFns(oldOptions,options,'after');}}
return;}
if(!oldComp.isDescendant(comp)){newQueue.push(old);}}
newQueue.push({item:item,options:options});me.invalidQueue=newQueue;},queueItemLayouts:function(item){var comp=item.isComponent?item:item.target,layout=comp.componentLayout;if(!layout.pending&&!layout.invalid&&!layout.done){this.queueLayout(layout);}
layout=comp.layout;if(layout&&!layout.pending&&!layout.invalid&&!layout.done){this.queueLayout(layout);}},queueLayout:function(layout){this.layoutQueue.add(layout);layout.pending=true;},removeEl:function(parent,el){var id=el.id,children=parent.children,items=this.items;if(children){Ext.Array.remove(children,items[id]);}
delete items[id];},resetLayout:function(layout,ownerContext,firstTime){var me=this;me.currentLayout=layout;layout.done=false;layout.pending=true;layout.firedTriggers=0;me.layoutQueue.add(layout);if(firstTime){me.layouts[layout.id]=layout;layout.running=true;if(layout.finishedLayout){me.finishQueue.add(layout);}
++me.remainingLayouts;++layout.layoutCount;layout.ownerContext=ownerContext;layout.beginCount=0;layout.blockCount=0;layout.calcCount=0;layout.triggerCount=0;if(!layout.initialized){layout.initLayout();}
layout.beginLayout(ownerContext);}else{++layout.beginCount;if(!layout.running){++me.remainingLayouts;layout.running=true;if(layout.isComponentLayout){ownerContext.unsetProp('done');}
me.completionQueue.remove(layout);me.finalizeQueue.remove(layout);}}
layout.beginLayoutCycle(ownerContext,firstTime);},run:function(){var me=this,flushed=false,watchDog=100;me.flushInvalidates();me.state=1;me.totalCount=me.layoutQueue.getCount();me.flush();while((me.remainingLayouts||me.invalidQueue.length)&&watchDog--){if(me.invalidQueue.length){me.flushInvalidates();}
if(me.runCycle()){flushed=false;}else if(!flushed){me.flush();flushed=true;me.flushLayouts('completionQueue','completeLayout');}else if(!me.invalidQueue.length){me.state=2;break;}
if(!(me.remainingLayouts||me.invalidQueue.length)){me.flush();me.flushLayouts('completionQueue','completeLayout');me.flushLayouts('finalizeQueue','finalizeLayout');}}
return me.runComplete();},runComplete:function(){var me=this;me.state=2;if(me.remainingLayouts){me.handleFailure();return false;}
me.flush();me.flushLayouts('finishQueue','finishedLayout',true);me.flushLayouts('finishQueue','notifyOwner');me.flush();me.flushAnimations();return true;},runCycle:function(){var me=this,layouts=me.layoutQueue.clear(),length=layouts.length,i;++me.cycleCount;me.progressCount=0;for(i=0;i<length;++i){me.runLayout(me.currentLayout=layouts[i]);}
me.currentLayout=null;return me.progressCount>0;},runLayout:function(layout){var me=this,ownerContext=me.getCmp(layout.owner);layout.pending=false;if(ownerContext.state.blocks){return;}
layout.done=true;++layout.calcCount;++me.calcCount;layout.calculate(ownerContext);if(layout.done){me.layoutDone(layout);if(layout.completeLayout){me.queueCompletion(layout);}
if(layout.finalizeLayout){me.queueFinalize(layout);}}else if(!layout.pending&&!layout.invalid&&!(layout.blockCount+layout.triggerCount-layout.firedTriggers)){me.queueLayout(layout);}},setItemSize:function(item,width,height){var items=item,len=1,contextItem,i;if(item.isComposite){items=item.elements;len=items.length;item=items[0];}else if(!item.dom&&!item.el){len=items.length;item=items[0];}
for(i=0;i<len;){contextItem=this.get(item);contextItem.setSize(width,height);item=items[++i];}}});Ext.define('Ext.data.ArrayStore',{extend:'Ext.data.Store',alias:'store.array',requires:['Ext.data.proxy.Memory','Ext.data.reader.Array'],constructor:function(config){config=Ext.apply({proxy:{type:'memory',reader:'array'}},config);this.callParent([config]);},loadData:function(data,append){if(this.expandData===true){var r=[],i=0,ln=data.length;for(;i<ln;i++){r[r.length]=[data[i]];}
data=r;}
this.callParent([data,append]);}},function(){Ext.data.SimpleStore=Ext.data.ArrayStore;});Ext.define('Ext.view.DropZone',{extend:'Ext.dd.DropZone',indicatorHtml:'<div class="'+Ext.baseCSSPrefix+'grid-drop-indicator-left"></div><div class="'+Ext.baseCSSPrefix+'grid-drop-indicator-right"></div>',indicatorCls:Ext.baseCSSPrefix+'grid-drop-indicator',constructor:function(config){var me=this;Ext.apply(me,config);if(!me.ddGroup){me.ddGroup='view-dd-zone-'+me.view.id;}
me.callParent([me.view.el]);},fireViewEvent:function(){var me=this,result;me.lock();result=me.view.fireEvent.apply(me.view,arguments);me.unlock();return result;},getTargetFromEvent:function(e){var node=e.getTarget(this.view.getItemSelector()),mouseY,nodeList,testNode,i,len,box;if(!node){mouseY=e.getPageY();for(i=0,nodeList=this.view.getNodes(),len=nodeList.length;i<len;i++){testNode=nodeList[i];box=Ext.fly(testNode).getBox();if(mouseY<=box.bottom){return testNode;}}}
return node;},getIndicator:function(){var me=this;if(!me.indicator){me.indicator=new Ext.Component({html:me.indicatorHtml,cls:me.indicatorCls,ownerCt:me.view,floating:true,shadow:false});}
return me.indicator;},getPosition:function(e,node){var y=e.getXY()[1],region=Ext.fly(node).getRegion(),pos;if((region.bottom-y)>=(region.bottom-region.top)/2){pos="before";}else{pos="after";}
return pos;},containsRecordAtOffset:function(records,record,offset){if(!record){return false;}
var view=this.view,recordIndex=view.indexOf(record),nodeBefore=view.getNode(recordIndex+offset,true),recordBefore=nodeBefore?view.getRecord(nodeBefore):null;return recordBefore&&Ext.Array.contains(records,recordBefore);},positionIndicator:function(node,data,e){var me=this,view=me.view,pos=me.getPosition(e,node),overRecord=view.getRecord(node),draggingRecords=data.records,indicatorY;if(!Ext.Array.contains(draggingRecords,overRecord)&&(pos=='before'&&!me.containsRecordAtOffset(draggingRecords,overRecord,-1)||pos=='after'&&!me.containsRecordAtOffset(draggingRecords,overRecord,1))){me.valid=true;if(me.overRecord!=overRecord||me.currentPosition!=pos){indicatorY=Ext.fly(node).getY()-view.el.getY()-1;if(pos=='after'){indicatorY+=Ext.fly(node).getHeight();}
me.getIndicator().setWidth(Ext.fly(view.el).getWidth()).showAt(0,indicatorY);me.overRecord=overRecord;me.currentPosition=pos;}}else{me.invalidateDrop();}},invalidateDrop:function(){if(this.valid){this.valid=false;this.getIndicator().hide();}},onNodeOver:function(node,dragZone,e,data){var me=this;if(!Ext.Array.contains(data.records,me.view.getRecord(node))){me.positionIndicator(node,data,e);}
return me.valid?me.dropAllowed:me.dropNotAllowed;},notifyOut:function(node,dragZone,e,data){var me=this;me.callParent(arguments);me.overRecord=me.currentPosition=null
me.valid=false;if(me.indicator){me.indicator.hide();}},onContainerOver:function(dd,e,data){var me=this,view=me.view,count=view.dataSource.getCount();if(count){me.positionIndicator(view.all.last(),data,e);}
else{me.overRecord=me.currentPosition=null;me.getIndicator().setWidth(Ext.fly(view.el).getWidth()).showAt(0,0);me.valid=true;}
return me.dropAllowed;},onContainerDrop:function(dd,e,data){return this.onNodeDrop(dd,null,e,data);},onNodeDrop:function(targetNode,dragZone,e,data){var me=this,dropHandled=false,dropHandlers={wait:false,processDrop:function(){me.invalidateDrop();me.handleNodeDrop(data,me.overRecord,me.currentPosition);dropHandled=true;me.fireViewEvent('drop',targetNode,data,me.overRecord,me.currentPosition);},cancelDrop:function(){me.invalidateDrop();dropHandled=true;}},performOperation=false;if(me.valid){performOperation=me.fireViewEvent('beforedrop',targetNode,data,me.overRecord,me.currentPosition,dropHandlers);if(dropHandlers.wait){return;}
if(performOperation!==false){if(!dropHandled){dropHandlers.processDrop();}}}
return performOperation;},destroy:function(){Ext.destroy(this.indicator);delete this.indicator;this.callParent();}});Ext.define('Ext.data.NodeStore',{extend:'Ext.data.Store',alias:'store.node',requires:['Ext.data.NodeInterface'],isNodeStore:true,node:null,recursive:false,rootVisible:false,isExpandingOrCollapsing:0,constructor:function(config){var me=this,node;config=config||{};Ext.apply(me,config);config.proxy={type:'proxy'};me.callParent([config]);node=me.node;if(node){me.node=null;me.setNode(node);}},getTotalCount:function(){return this.getCount();},setNode:function(node){var me=this;if(me.node&&me.node!=node){me.mun(me.node,{expand:me.onNodeExpand,collapse:me.onNodeCollapse,append:me.onNodeAppend,insert:me.onNodeInsert,bulkremove:me.onBulkRemove,remove:me.onNodeRemove,sort:me.onNodeSort,scope:me});me.node=null;}
if(node){Ext.data.NodeInterface.decorate(node.self);me.removeAll();if(me.rootVisible){me.add(node);}else if(!node.isExpanded()&&me.treeStore.autoLoad!==false){node.expand();}
me.mon(node,{expand:me.onNodeExpand,collapse:me.onNodeCollapse,append:me.onNodeAppend,insert:me.onNodeInsert,bulkremove:me.onBulkRemove,remove:me.onNodeRemove,sort:me.onNodeSort,scope:me});me.node=node;if(node.isExpanded()&&node.isLoaded()){me.onNodeExpand(node,node.childNodes,true);}}},onNodeSort:function(node,childNodes){var me=this;if((me.indexOf(node)!==-1||(node===me.node&&!me.rootVisible)&&node.isExpanded())){Ext.suspendLayouts();me.onNodeCollapse(node,childNodes,true);me.onNodeExpand(node,childNodes,true);Ext.resumeLayouts(true);}},onNodeExpand:function(parent,records,suppressEvent){var me=this,insertIndex=me.indexOf(parent)+1,toAdd=[];if(!suppressEvent){me.fireEvent('beforeexpand',parent,records,insertIndex);}
me.handleNodeExpand(parent,records,toAdd);me.insert(insertIndex,toAdd);if(!suppressEvent){me.fireEvent('expand',parent,records);}},handleNodeExpand:function(parent,records,toAdd){var me=this,ln=records?records.length:0,i,record;if(!me.recursive&&parent!==me.node){return;}
if(parent!==this.node&&!me.isVisible(parent)){return;}
if(ln){for(i=0;i<ln;i++){record=records[i];toAdd.push(record);if(record.isExpanded()){if(record.isLoaded()){me.handleNodeExpand(record,record.childNodes,toAdd);}
else{record.set('expanded',false);record.expand();}}}}},onBulkRemove:function(parent,childNodes,isMove){this.onNodeCollapse(parent,childNodes,true);},onNodeCollapse:function(parent,records,suppressEvent,callback,scope){var me=this,collapseIndex=me.indexOf(parent)+1,node,lastNodeIndexPlus,sibling,found;if(!me.recursive&&parent!==me.node){return;}
if(!suppressEvent){me.fireEvent('beforecollapse',parent,records,collapseIndex,callback,scope);}
if(records.length&&me.data.contains(records[0])){node=parent;while(node.parentNode){sibling=node.nextSibling;if(sibling){found=true;lastNodeIndexPlus=me.indexOf(sibling);break;}else{node=node.parentNode;}}
if(!found){lastNodeIndexPlus=me.getCount();}
me.removeAt(collapseIndex,lastNodeIndexPlus-collapseIndex);}
if(!suppressEvent){me.fireEvent('collapse',parent,records,collapseIndex);}},onNodeAppend:function(parent,node,index){var me=this,refNode,sibling;if(me.isVisible(node)){if(index===0){refNode=parent;}else{sibling=node.previousSibling;while(sibling.isExpanded()&&sibling.lastChild){sibling=sibling.lastChild;}
refNode=sibling;}
me.insert(me.indexOf(refNode)+1,node);if(!node.isLeaf()&&node.isExpanded()){if(node.isLoaded()){me.onNodeExpand(node,node.childNodes,true);}else if(!me.treeStore.fillCount){node.set('expanded',false);node.expand();}}}},onNodeInsert:function(parent,node,refNode){var me=this,index=this.indexOf(refNode);if(index!=-1&&me.isVisible(node)){me.insert(index,node);if(!node.isLeaf()&&node.isExpanded()){if(node.isLoaded()){me.onNodeExpand(node,node.childNodes,true);}
else{node.set('expanded',false);node.expand();}}}},onNodeRemove:function(parent,node,isMove){var me=this;if(me.indexOf(node)!=-1){if(!node.isLeaf()&&node.isExpanded()){node.parentNode=node.removeContext.parentNode;node.nextSibling=node.removeContext.nextSibling;me.onNodeCollapse(node,node.childNodes,true);node.parentNode=node.nextSibling=null;}
me.remove(node);}},isVisible:function(node){var parent=node.parentNode;while(parent){if(parent===this.node&&parent.data.expanded){return true;}
if(!parent.data.expanded){return false;}
parent=parent.parentNode;}
return false;}});Ext.define('Ext.util.Animate',{requires:['Ext.Element','Ext.CompositeElementLite','Ext.fx.Manager','Ext.fx.Anim'],isAnimate:true,animate:function(animObj){var me=this;if(Ext.fx.Manager.hasFxBlock(me.id)){return me;}
Ext.fx.Manager.queueFx(new Ext.fx.Anim(me.anim(animObj)));return this;},anim:function(config){if(!Ext.isObject(config)){return(config)?{}:false;}
var me=this;if(config.stopAnimation){me.stopAnimation();}
Ext.applyIf(config,Ext.fx.Manager.getFxDefaults(me.id));return Ext.apply({target:me,paused:true},config);},stopFx:Ext.Function.alias(Ext.util.Animate,'stopAnimation'),stopAnimation:function(){Ext.fx.Manager.stopAnimation(this.id);return this;},syncFx:function(){Ext.fx.Manager.setFxDefaults(this.id,{concurrent:true});return this;},sequenceFx:function(){Ext.fx.Manager.setFxDefaults(this.id,{concurrent:false});return this;},hasActiveFx:Ext.Function.alias(Ext.util.Animate,'getActiveAnimation'),getActiveAnimation:function(){return Ext.fx.Manager.getActiveAnimation(this.id);}},function(){Ext.applyIf(Ext.Element.prototype,this.prototype);Ext.CompositeElementLite.importElementMethods();});Ext.define('Ext.grid.ViewDropZone',{extend:'Ext.view.DropZone',indicatorHtml:'<div class="'+Ext.baseCSSPrefix+'grid-drop-indicator-left"></div><div class="'+Ext.baseCSSPrefix+'grid-drop-indicator-right"></div>',indicatorCls:Ext.baseCSSPrefix+'grid-drop-indicator',handleNodeDrop:function(data,record,position){var view=this.view,store=view.getStore(),index,records,i,len;if(data.copy){records=data.records;data.records=[];for(i=0,len=records.length;i<len;i++){data.records.push(records[i].copy());}}else{data.view.store.remove(data.records,data.view===view);}
if(record&&position){index=store.indexOf(record);if(position!=='before'){index++;}
store.insert(index,data.records);}
else{store.add(data.records);}
view.getSelectionModel().select(data.records);}});Ext.define('Ext.AbstractComponent',{requires:['Ext.ComponentQuery','Ext.ComponentManager','Ext.util.ProtoElement','Ext.dom.CompositeElement','Ext.PluginManager'],mixins:{positionable:'Ext.util.Positionable',observable:'Ext.util.Observable',animate:'Ext.util.Animate',elementCt:'Ext.util.ElementContainer',renderable:'Ext.util.Renderable',state:'Ext.state.Stateful'},uses:['Ext.PluginManager','Ext.Element','Ext.DomHelper','Ext.XTemplate','Ext.ComponentLoader','Ext.EventManager','Ext.layout.Context','Ext.layout.Layout','Ext.layout.component.Auto','Ext.LoadMask','Ext.ZIndexManager'],statics:{AUTO_ID:1000,pendingLayouts:null,layoutSuspendCount:0,cancelLayout:function(comp,isDestroying){var context=this.runningLayoutContext||this.pendingLayouts;if(context){context.cancelComponent(comp,false,isDestroying);}},flushLayouts:function(){var me=this,context=me.pendingLayouts;if(context&&context.invalidQueue.length){me.pendingLayouts=null;me.runningLayoutContext=context;Ext.override(context,{runComplete:function(){me.runningLayoutContext=null;var result=this.callParent();if(Ext.globalEvents.hasListeners.afterlayout){Ext.globalEvents.fireEvent('afterlayout');}
return result;}});context.run();}},resumeLayouts:function(flush){if(this.layoutSuspendCount&&!--this.layoutSuspendCount){if(flush){this.flushLayouts();}
if(Ext.globalEvents.hasListeners.resumelayouts){Ext.globalEvents.fireEvent('resumelayouts');}}},suspendLayouts:function(){++this.layoutSuspendCount;},updateLayout:function(comp,defer){var me=this,running=me.runningLayoutContext,pending;if(running){running.queueInvalidate(comp);}else{pending=me.pendingLayouts||(me.pendingLayouts=new Ext.layout.Context());pending.queueInvalidate(comp);if(!defer&&!me.layoutSuspendCount&&!comp.isLayoutSuspended()){me.flushLayouts();}}}},isComponent:true,getAutoId:function(){this.autoGenId=true;return++Ext.AbstractComponent.AUTO_ID;},deferLayouts:false,autoGenId:false,renderTpl:'{%this.renderContent(out,values)%}',frameSize:null,tplWriteMode:'overwrite',baseCls:Ext.baseCSSPrefix+'component',disabledCls:Ext.baseCSSPrefix+'item-disabled',ui:'default',uiCls:[],hidden:false,disabled:false,draggable:false,floating:false,hideMode:'display',autoShow:false,autoRender:false,allowDomMove:true,rendered:false,componentLayoutCounter:0,shrinkWrap:2,weight:0,maskOnDisable:true,_isLayoutRoot:false,contentPaddingProperty:'padding',horizontalPosProp:'left',borderBoxCls:Ext.baseCSSPrefix+'border-box',constructor:function(config){var me=this,i,len,xhooks;if(config){Ext.apply(me,config);xhooks=me.xhooks;if(xhooks){delete me.xhooks;Ext.override(me,xhooks);}}else{config={};}
me.initialConfig=config;me.mixins.elementCt.constructor.call(me);me.addEvents('beforeactivate','activate','beforedeactivate','deactivate','added','disable','enable','beforeshow','show','beforehide','hide','removed','beforerender','render','afterrender','boxready','beforedestroy','destroy','resize','move','focus','blur');me.getId();me.setupProtoEl();if(me.cls){me.initialCls=me.cls;me.protoEl.addCls(me.cls);}
if(me.style){me.initialStyle=me.style;me.protoEl.setStyle(me.style);}
me.renderData=me.renderData||{};me.renderSelectors=me.renderSelectors||{};if(me.plugins){me.plugins=me.constructPlugins();}
if(!me.hasListeners){me.hasListeners=new me.HasListeners();}
me.initComponent();Ext.ComponentManager.register(me);me.mixins.observable.constructor.call(me);me.mixins.state.constructor.call(me,config);this.addStateEvents('resize');if(me.plugins){for(i=0,len=me.plugins.length;i<len;i++){me.plugins[i]=me.initPlugin(me.plugins[i]);}}
me.loader=me.getLoader();if(me.renderTo){me.render(me.renderTo);}
if(me.autoShow&&!me.isContained){me.show();}},initComponent:function(){this.plugins=this.constructPlugins();this.setSize(this.width,this.height);},getState:function(){var me=this,state=null,sizeModel=me.getSizeModel();if(sizeModel.width.configured){state=me.addPropertyToState(state,'width');}
if(sizeModel.height.configured){state=me.addPropertyToState(state,'height');}
return state;},addPropertyToState:function(state,propName,value){var me=this,len=arguments.length;if(len==3||me.hasOwnProperty(propName)){if(len<3){value=me[propName];}
if(value!==me.initialConfig[propName]){(state||(state={}))[propName]=value;}}
return state;},show:Ext.emptyFn,animate:function(animObj){var me=this,hasToWidth,hasToHeight,toHeight,toWidth,to,clearWidth,clearHeight,curWidth,w,curHeight,h,isExpanding,wasConstrained,wasConstrainedHeader,passedCallback,oldOverflow;animObj=animObj||{};to=animObj.to||{};if(Ext.fx.Manager.hasFxBlock(me.id)){return me;}
hasToWidth=Ext.isDefined(to.width);if(hasToWidth){toWidth=Ext.Number.constrain(to.width,me.minWidth,me.maxWidth);}
hasToHeight=Ext.isDefined(to.height);if(hasToHeight){toHeight=Ext.Number.constrain(to.height,me.minHeight,me.maxHeight);}
if(!animObj.dynamic&&(hasToWidth||hasToHeight)){curWidth=(animObj.from?animObj.from.width:undefined)||me.getWidth();w=curWidth;curHeight=(animObj.from?animObj.from.height:undefined)||me.getHeight();h=curHeight;isExpanding=false;if(hasToHeight&&toHeight>curHeight){h=toHeight;isExpanding=true;}
if(hasToWidth&&toWidth>curWidth){w=toWidth;isExpanding=true;}
if(hasToHeight||hasToWidth){oldOverflow=me.el.getStyle('overtflow');if(oldOverflow!=='hidden'){me.el.setStyle('overflow','hidden');}}
if(isExpanding){clearWidth=!Ext.isNumber(me.width);clearHeight=!Ext.isNumber(me.height);me.setSize(w,h);me.el.setSize(curWidth,curHeight);if(clearWidth){delete me.width;}
if(clearHeight){delete me.height;}}
if(hasToWidth){to.width=toWidth;}
if(hasToHeight){to.height=toHeight;}}
wasConstrained=me.constrain;wasConstrainedHeader=me.constrainHeader;if(wasConstrained||wasConstrainedHeader){me.constrain=me.constrainHeader=false;passedCallback=animObj.callback;animObj.callback=function(){me.constrain=wasConstrained;me.constrainHeader=wasConstrainedHeader;if(passedCallback){passedCallback.call(animObj.scope||me,arguments);}
if(oldOverflow!=='hidden'){me.el.setStyle('overflow',oldOverflow);}};}
return me.mixins.animate.animate.apply(me,arguments);},setHiddenState:function(hidden){var hierarchyState=this.getHierarchyState();this.hidden=hidden;if(hidden){hierarchyState.hidden=true;}else{delete hierarchyState.hidden;}},onHide:function(){if(this.ownerLayout){this.updateLayout({isRoot:false});}},onShow:function(){this.updateLayout({isRoot:false});},constructPlugin:function(plugin){var me=this;if(typeof plugin=='string'){plugin=Ext.PluginManager.create({},plugin,me);}
else{plugin=Ext.PluginManager.create(plugin,null,me);}
return plugin;},constructPlugins:function(){var me=this,plugins=me.plugins,result,i,len;if(plugins){result=[];if(!Ext.isArray(plugins)){plugins=[plugins];}
for(i=0,len=plugins.length;i<len;i++){result[i]=me.constructPlugin(plugins[i]);}}
me.pluginsInitialized=true;return result;},initPlugin:function(plugin){plugin.init(this);return plugin;},addPlugin:function(plugin){var me=this;plugin=me.constructPlugin(plugin);if(me.plugins){me.plugins.push(plugin);}else{me.plugins=[plugin];}
if(me.pluginsInitialized){me.initPlugin(plugin);}
return plugin;},removePlugin:function(plugin){Ext.Array.remove(this.plugins,plugin);plugin.destroy();},findPlugin:function(ptype){var i,plugins=this.plugins,ln=plugins&&plugins.length;for(i=0;i<ln;i++){if(plugins[i].ptype===ptype){return plugins[i];}}},getPlugin:function(pluginId){var i,plugins=this.plugins,ln=plugins&&plugins.length;for(i=0;i<ln;i++){if(plugins[i].pluginId===pluginId){return plugins[i];}}},beforeLayout:Ext.emptyFn,updateAria:Ext.emptyFn,registerFloatingItem:function(cmp){var me=this;if(!me.floatingDescendants){me.floatingDescendants=new Ext.ZIndexManager(me);}
me.floatingDescendants.register(cmp);},unregisterFloatingItem:function(cmp){var me=this;if(me.floatingDescendants){me.floatingDescendants.unregister(cmp);}},layoutSuspendCount:0,suspendLayouts:function(){var me=this;if(!me.rendered){return;}
if(++me.layoutSuspendCount==1){me.suspendLayout=true;}},resumeLayouts:function(flushOptions){var me=this;if(!me.rendered){return;}
if(!--me.layoutSuspendCount){me.suspendLayout=false;if(flushOptions&&!me.isLayoutSuspended()){me.updateLayout(flushOptions);}}},setupProtoEl:function(){var cls=this.initCls();this.protoEl=new Ext.util.ProtoElement({cls:cls.join(' ')});},initCls:function(){var me=this,cls=[me.baseCls,me.getComponentLayout().targetCls];if(Ext.isDefined(me.cmpCls)){if(Ext.isDefined(Ext.global.console)){Ext.global.console.warn('Ext.Component: cmpCls has been deprecated. Please use componentCls.');}
me.componentCls=me.cmpCls;delete me.cmpCls;}
if(me.componentCls){cls.push(me.componentCls);}else{me.componentCls=me.baseCls;}
return cls;},setUI:function(ui){var me=this,uiCls=me.uiCls,activeUI=me.activeUI,classes;if(ui===activeUI){return;}
if(activeUI){classes=me.removeClsWithUI(uiCls,true);if(classes.length){me.removeCls(classes);}
me.removeUIFromElement();}
else{me.uiCls=[];}
me.ui=ui;me.activeUI=ui;me.addUIToElement();classes=me.addClsWithUI(uiCls,true);if(classes.length){me.addCls(classes);}
if(me.rendered){me.updateLayout();}},addClsWithUI:function(classes,skip){var me=this,clsArray=[],i=0,uiCls=me.uiCls=Ext.Array.clone(me.uiCls),activeUI=me.activeUI,length,cls;if(typeof classes==="string"){classes=(classes.indexOf(' ')<0)?[classes]:Ext.String.splitWords(classes);}
length=classes.length;for(;i<length;i++){cls=classes[i];if(cls&&!me.hasUICls(cls)){uiCls.push(cls);if(activeUI){clsArray=clsArray.concat(me.addUIClsToElement(cls));}}}
if(skip!==true&&activeUI){me.addCls(clsArray);}
return clsArray;},removeClsWithUI:function(classes,skip){var me=this,clsArray=[],i=0,extArray=Ext.Array,remove=extArray.remove,uiCls=me.uiCls=extArray.clone(me.uiCls),activeUI=me.activeUI,length,cls;if(typeof classes==="string"){classes=(classes.indexOf(' ')<0)?[classes]:Ext.String.splitWords(classes);}
length=classes.length;for(i=0;i<length;i++){cls=classes[i];if(cls&&me.hasUICls(cls)){remove(uiCls,cls);if(activeUI){clsArray=clsArray.concat(me.removeUIClsFromElement(cls));}}}
if(skip!==true&&activeUI){me.removeCls(clsArray);}
return clsArray;},hasUICls:function(cls){var me=this,uiCls=me.uiCls||[];return Ext.Array.contains(uiCls,cls);},frameElementsArray:['tl','tc','tr','ml','mc','mr','bl','bc','br'],addUIClsToElement:function(cls){var me=this,baseClsUi=me.baseCls+'-'+me.ui+'-'+cls,result=[Ext.baseCSSPrefix+cls,me.baseCls+'-'+cls,baseClsUi],frameElementsArray,frameElementsLength,i,el,frameElement;if(me.rendered&&me.frame&&!Ext.supports.CSS3BorderRadius){frameElementsArray=me.frameElementsArray;frameElementsLength=frameElementsArray.length;for(i=0;i<frameElementsLength;i++){frameElement=frameElementsArray[i];el=me['frame'+frameElement.toUpperCase()];if(el){el.addCls(baseClsUi+'-'+frameElement);}}}
return result;},removeUIClsFromElement:function(cls){var me=this,baseClsUi=me.baseCls+'-'+me.ui+'-'+cls,result=[Ext.baseCSSPrefix+cls,me.baseCls+'-'+cls,baseClsUi],frameElementsArray,frameElementsLength,i,el,frameElement;if(me.rendered&&me.frame&&!Ext.supports.CSS3BorderRadius){frameElementsArray=me.frameElementsArray;frameElementsLength=frameElementsArray.length;for(i=0;i<frameElementsLength;i++){frameElement=frameElementsArray[i];el=me['frame'+frameElement.toUpperCase()];if(el){el.removeCls(baseClsUi+'-'+frameElement);}}}
return result;},addUIToElement:function(){var me=this,baseClsUI=me.baseCls+'-'+me.ui,frameElementsArray,frameElementsLength,i,el,frameElement;me.addCls(baseClsUI);if(me.rendered&&me.frame&&!Ext.supports.CSS3BorderRadius){frameElementsArray=me.frameElementsArray;frameElementsLength=frameElementsArray.length;for(i=0;i<frameElementsLength;i++){frameElement=frameElementsArray[i];el=me['frame'+frameElement.toUpperCase()];if(el){el.addCls(baseClsUI+'-'+frameElement);}}}},removeUIFromElement:function(){var me=this,baseClsUI=me.baseCls+'-'+me.ui,frameElementsArray,frameElementsLength,i,el,frameElement;me.removeCls(baseClsUI);if(me.rendered&&me.frame&&!Ext.supports.CSS3BorderRadius){frameElementsArray=me.frameElementsArray;frameElementsLength=frameElementsArray.length;for(i=0;i<frameElementsLength;i++){frameElement=frameElementsArray[i];el=me['frame'+frameElement.toUpperCase()];if(el){el.removeCls(baseClsUI+'-'+frameElement);}}}},getTpl:function(name){return Ext.XTemplate.getTpl(this,name);},initStyles:function(targetEl){var me=this,Element=Ext.Element,margin=me.margin,border=me.border,cls=me.cls,style=me.style,x=me.x,y=me.y,width,height;me.initPadding(targetEl);if(margin!=null){targetEl.setStyle('margin',this.unitizeBox((margin===true)?5:margin));}
if(border!=null){me.setBorder(border,targetEl);}
if(cls&&cls!=me.initialCls){targetEl.addCls(cls);me.cls=me.initialCls=null;}
if(style&&style!=me.initialStyle){targetEl.setStyle(style);me.style=me.initialStyle=null;}
if(x!=null){targetEl.setStyle(me.horizontalPosProp,(typeof x=='number')?(x+'px'):x);}
if(y!=null){targetEl.setStyle('top',(typeof y=='number')?(y+'px'):y);}
if(Ext.isBorderBox&&(!me.ownerCt||me.floating)){targetEl.addCls(me.borderBoxCls);}
if(!me.getFrameInfo()){width=me.width;height=me.height;if(width!=null){if(typeof width==='number'){if(Ext.isBorderBox){targetEl.setStyle('width',width+'px');}}else{targetEl.setStyle('width',width);}}
if(height!=null){if(typeof height==='number'){if(Ext.isBorderBox){targetEl.setStyle('height',height+'px');}}else{targetEl.setStyle('height',height);}}}},initPadding:function(targetEl){var me=this,padding=me.padding;if(padding!=null){if(me.layout&&me.layout.managePadding&&me.contentPaddingProperty==='padding'){targetEl.setStyle('padding',0);}else{targetEl.setStyle('padding',this.unitizeBox((padding===true)?5:padding));}}},parseBox:function(box){return Ext.dom.Element.parseBox(box);},unitizeBox:function(box){return Ext.dom.Element.unitizeBox(box);},setMargin:function(margin,preventLayout){var me=this;if(me.rendered){if(!margin&&margin!==0){margin='';}else{if(margin===true){margin=5;}
margin=this.unitizeBox(margin);}
me.getTargetEl().setStyle('margin',margin);if(!preventLayout){me.updateLayout();}}else{me.margin=margin;}},initEvents:function(){var me=this,afterRenderEvents=me.afterRenderEvents,afterRenderEvent,el,property,index,len;if(afterRenderEvents){for(property in afterRenderEvents){el=me[property];if(el&&el.on){afterRenderEvent=afterRenderEvents[property];for(index=0,len=afterRenderEvent.length;index<len;++index){me.mon(el,afterRenderEvent[index]);}}}}
me.addFocusListener();},addFocusListener:function(){var me=this,focusEl=me.getFocusEl(),needsTabIndex;if(focusEl){if(focusEl.isComponent){return focusEl.addFocusListener();}
needsTabIndex=focusEl.needsTabIndex();if(!me.focusListenerAdded&&(!needsTabIndex||Ext.FocusManager.enabled)){if(needsTabIndex){focusEl.dom.tabIndex=-1;}
focusEl.on({focus:me.onFocus,blur:me.onBlur,scope:me});me.focusListenerAdded=true;}}},getFocusEl:Ext.emptyFn,isFocusable:function(){var me=this,focusEl;if((me.focusable!==false)&&(focusEl=me.getFocusEl())&&me.rendered&&!me.destroying&&!me.isDestroyed&&!me.disabled&&me.isVisible(true)){return focusEl.isFocusable(true);}},beforeFocus:Ext.emptyFn,onFocus:function(e){var me=this,focusCls=me.focusCls,focusEl=me.getFocusEl();if(!me.disabled){me.beforeFocus(e);if(focusCls&&focusEl){focusEl.addCls(me.addClsWithUI(focusCls,true));}
if(!me.hasFocus){me.hasFocus=true;me.fireEvent('focus',me,e);}}},beforeBlur:Ext.emptyFn,onBlur:function(e){var me=this,focusCls=me.focusCls,focusEl=me.getFocusEl();if(me.destroying){return;}
me.beforeBlur(e);if(focusCls&&focusEl){focusEl.removeCls(me.removeClsWithUI(focusCls,true));}
if(me.validateOnBlur){me.validate();}
me.hasFocus=false;me.fireEvent('blur',me,e);me.postBlur(e);},postBlur:Ext.emptyFn,is:function(selector){return Ext.ComponentQuery.is(this,selector);},up:function(selector,limit){var result=this.getRefOwner(),limitSelector=typeof limit==='string',limitCount=typeof limit==='number',limitComponent=limit&&limit.isComponent,steps=0;if(selector){for(;result;result=result.getRefOwner()){steps++;if(selector.isComponent){if(result===selector){return result;}}else{if(Ext.ComponentQuery.is(result,selector)){return result;}}
if(limitSelector&&result.is(limit)){return;}
if(limitCount&&steps===limit){return;}
if(limitComponent&&result===limit){return;}}}
return result;},nextSibling:function(selector){var o=this.ownerCt,it,last,idx,c;if(o){it=o.items;idx=it.indexOf(this)+1;if(idx){if(selector){for(last=it.getCount();idx<last;idx++){if((c=it.getAt(idx)).is(selector)){return c;}}}else{if(idx<it.getCount()){return it.getAt(idx);}}}}
return null;},previousSibling:function(selector){var o=this.ownerCt,it,idx,c;if(o){it=o.items;idx=it.indexOf(this);if(idx!=-1){if(selector){for(--idx;idx>=0;idx--){if((c=it.getAt(idx)).is(selector)){return c;}}}else{if(idx){return it.getAt(--idx);}}}}
return null;},previousNode:function(selector,includeSelf){var node=this,ownerCt=node.ownerCt,result,it,i,sib;if(includeSelf&&node.is(selector)){return node;}
if(ownerCt){for(it=ownerCt.items.items,i=Ext.Array.indexOf(it,node)-1;i>-1;i--){sib=it[i];if(sib.query){result=sib.query(selector);result=result[result.length-1];if(result){return result;}}
if(sib.is(selector)){return sib;}}
return ownerCt.previousNode(selector,true);}
return null;},nextNode:function(selector,includeSelf){var node=this,ownerCt=node.ownerCt,result,it,len,i,sib;if(includeSelf&&node.is(selector)){return node;}
if(ownerCt){for(it=ownerCt.items.items,i=Ext.Array.indexOf(it,node)+1,len=it.length;i<len;i++){sib=it[i];if(sib.is(selector)){return sib;}
if(sib.down){result=sib.down(selector);if(result){return result;}}}
return ownerCt.nextNode(selector);}
return null;},getId:function(){return this.id||(this.id='ext-comp-'+(this.getAutoId()));},getItemId:function(){return this.itemId||this.id;},getEl:function(){return this.el;},getTargetEl:function(){return this.frameBody||this.el;},getOverflowEl:function(){return this.getTargetEl();},getOverflowStyle:function(){var me=this,result=null,ox,oy,overflowStyle;if(typeof me.autoScroll==='boolean'){result={overflow:overflowStyle=me.autoScroll?'auto':''};me.scrollFlags={overflowX:overflowStyle,overflowY:overflowStyle,x:true,y:true,both:true};}else{ox=me.overflowX;oy=me.overflowY;if(ox!==undefined||oy!==undefined){result={'overflowX':ox=ox||'','overflowY':oy=oy||''};me.scrollFlags={overflowX:ox,overflowY:oy,x:ox=(ox==='auto'||ox==='scroll'),y:oy=(oy==='auto'||oy==='scroll'),both:ox&&oy};}else{me.scrollFlags={overflowX:'',overflowY:'',x:false,y:false,both:false};}}
if(result&&Ext.isIE7m){result.position='relative';}
return result;},isXType:function(xtype,shallow){if(shallow){return this.xtype===xtype;}
else{return this.xtypesMap[xtype];}},getXTypes:function(){var self=this.self,xtypes,parentPrototype,parentXtypes;if(!self.xtypes){xtypes=[];parentPrototype=this;while(parentPrototype){parentXtypes=parentPrototype.xtypes;if(parentXtypes!==undefined){xtypes.unshift.apply(xtypes,parentXtypes);}
parentPrototype=parentPrototype.superclass;}
self.xtypeChain=xtypes;self.xtypes=xtypes.join('/');}
return self.xtypes;},update:function(htmlOrData,loadScripts,cb){var me=this,isData=(me.tpl&&!Ext.isString(htmlOrData)),el;if(isData){me.data=htmlOrData;}else{me.html=Ext.isObject(htmlOrData)?Ext.DomHelper.markup(htmlOrData):htmlOrData;}
if(me.rendered){el=me.isContainer?me.layout.getRenderTarget():me.getTargetEl();if(isData){me.tpl[me.tplWriteMode](el,htmlOrData||{});}else{el.update(me.html,loadScripts,cb);}
me.updateLayout();}},setVisible:function(visible){return this[visible?'show':'hide']();},isVisible:function(deep){var me=this,hidden;if(me.hidden||!me.rendered||me.isDestroyed){hidden=true;}else if(deep){hidden=me.isHierarchicallyHidden();}
return!hidden;},isHierarchicallyHidden:function(){var child=this,hidden=false,parent,parentHierarchyState;for(;(parent=child.ownerCt||child.floatParent);child=parent){parentHierarchyState=parent.getHierarchyState();if(parentHierarchyState.hidden){hidden=true;break;}
if(child.getHierarchyState().collapseImmune){if(parent.collapsed&&!child.collapseImmune){hidden=true;break;}}else{hidden=!!parentHierarchyState.collapsed;break;}}
return hidden;},onBoxReady:function(width,height){var me=this;if(me.disableOnBoxReady){me.onDisable();}else if(me.enableOnBoxReady){me.onEnable();}
if(me.resizable){me.initResizable(me.resizable);}
if(me.draggable){me.initDraggable();}
if(me.hasListeners.boxready){me.fireEvent('boxready',me,width,height);}},enable:function(silent){var me=this;delete me.disableOnBoxReady;me.removeCls(me.disabledCls);if(me.rendered){me.onEnable();}else{me.enableOnBoxReady=true;}
me.disabled=false;delete me.resetDisable;if(silent!==true){me.fireEvent('enable',me);}
return me;},disable:function(silent){var me=this;delete me.enableOnBoxReady;me.addCls(me.disabledCls);if(me.rendered){me.onDisable();}else{me.disableOnBoxReady=true;}
me.disabled=true;if(silent!==true){delete me.resetDisable;me.fireEvent('disable',me);}
return me;},onEnable:function(){if(this.maskOnDisable){this.el.dom.disabled=false;this.unmask();}},onDisable:function(){var me=this,focusCls=me.focusCls,focusEl=me.getFocusEl();if(focusCls&&focusEl){focusEl.removeCls(me.removeClsWithUI(focusCls,true));}
if(me.maskOnDisable){me.el.dom.disabled=true;me.mask();}},mask:function(){var box=this.lastBox,target=this.getMaskTarget(),args=[];if(box){args[2]=box.height;}
target.mask.apply(target,args);},unmask:function(){this.getMaskTarget().unmask();},getMaskTarget:function(){return this.el;},isDisabled:function(){return this.disabled;},setDisabled:function(disabled){return this[disabled?'disable':'enable']();},isHidden:function(){return this.hidden;},addCls:function(cls){var me=this,el=me.rendered?me.el:me.protoEl;el.addCls.apply(el,arguments);return me;},addClass:function(){return this.addCls.apply(this,arguments);},hasCls:function(cls){var me=this,el=me.rendered?me.el:me.protoEl;return el.hasCls.apply(el,arguments);},removeCls:function(cls){var me=this,el=me.rendered?me.el:me.protoEl;el.removeCls.apply(el,arguments);return me;},addOverCls:function(){var me=this;if(!me.disabled){me.el.addCls(me.overCls);}},removeOverCls:function(){this.el.removeCls(this.overCls);},addListener:function(element,listeners,scope,options){var me=this,fn,option;if(Ext.isString(element)&&(Ext.isObject(listeners)||options&&options.element)){if(options.element){fn=listeners;listeners={};listeners[element]=fn;element=options.element;if(scope){listeners.scope=scope;}
for(option in options){if(options.hasOwnProperty(option)){if(me.eventOptionsRe.test(option)){listeners[option]=options[option];}}}}
if(me[element]&&me[element].on){me.mon(me[element],listeners);}else{me.afterRenderEvents=me.afterRenderEvents||{};if(!me.afterRenderEvents[element]){me.afterRenderEvents[element]=[];}
me.afterRenderEvents[element].push(listeners);}
return;}
return me.mixins.observable.addListener.apply(me,arguments);},removeManagedListenerItem:function(isClear,managedListener,item,ename,fn,scope){var me=this,element=managedListener.options?managedListener.options.element:null;if(element){element=me[element];if(element&&element.un){if(isClear||(managedListener.item===item&&managedListener.ename===ename&&(!fn||managedListener.fn===fn)&&(!scope||managedListener.scope===scope))){element.un(managedListener.ename,managedListener.fn,managedListener.scope);if(!isClear){Ext.Array.remove(me.managedListeners,managedListener);}}}}else{return me.mixins.observable.removeManagedListenerItem.apply(me,arguments);}},getBubbleTarget:function(){return this.ownerCt;},isFloating:function(){return this.floating;},isDraggable:function(){return!!this.draggable;},isDroppable:function(){return!!this.droppable;},onAdded:function(container,pos){var me=this;me.ownerCt=container;if(me.hierarchyState){me.hierarchyState.invalid=true;delete me.hierarchyState;}
if(me.hasListeners.added){me.fireEvent('added',me,container,pos);}},onRemoved:function(destroying){var me=this;if(me.hasListeners.removed){me.fireEvent('removed',me,me.ownerCt);}
delete me.ownerCt;delete me.ownerLayout;},beforeDestroy:Ext.emptyFn,onResize:function(width,height,oldWidth,oldHeight){var me=this;if(me.floating&&me.constrain){me.doConstrain();}
if(me.hasListeners.resize){me.fireEvent('resize',me,width,height,oldWidth,oldHeight);}},setSize:function(width,height){var me=this;if(width&&typeof width=='object'){height=width.height;width=width.width;}
if(typeof width=='number'){me.width=Ext.Number.constrain(width,me.minWidth,me.maxWidth);}else if(width===null){delete me.width;}
if(typeof height=='number'){me.height=Ext.Number.constrain(height,me.minHeight,me.maxHeight);}else if(height===null){delete me.height;}
if(me.rendered&&me.isVisible()){me.updateLayout({isRoot:false});}
return me;},isLayoutRoot:function(){var me=this,ownerLayout=me.ownerLayout;if(!ownerLayout||me._isLayoutRoot||me.floating){return true;}
return ownerLayout.isItemLayoutRoot(me);},isLayoutSuspended:function(){var comp=this,ownerLayout;while(comp){if(comp.layoutSuspendCount||comp.suspendLayout){return true;}
ownerLayout=comp.ownerLayout;if(!ownerLayout){break;}
comp=ownerLayout.owner;}
return false;},updateLayout:function(options){var me=this,defer,lastBox=me.lastBox,isRoot=options&&options.isRoot;if(lastBox){lastBox.invalid=true;}
if(!me.rendered||me.layoutSuspendCount||me.suspendLayout){return;}
if(me.hidden){Ext.AbstractComponent.cancelLayout(me);}else if(typeof isRoot!='boolean'){isRoot=me.isLayoutRoot();}
if(isRoot||!me.ownerLayout||!me.ownerLayout.onContentChange(me)){if(!me.isLayoutSuspended()){defer=(options&&options.hasOwnProperty('defer'))?options.defer:me.deferLayouts;Ext.AbstractComponent.updateLayout(me,defer);}}},getSizeModel:function(ownerCtSizeModel){var me=this,models=Ext.layout.SizeModel,ownerContext=me.componentLayout.ownerContext,width=me.width,height=me.height,typeofWidth,typeofHeight,hasPixelWidth,hasPixelHeight,heightModel,ownerLayout,policy,shrinkWrap,topLevel,widthModel;if(ownerContext){widthModel=ownerContext.widthModel;heightModel=ownerContext.heightModel;}
if(!widthModel||!heightModel){hasPixelWidth=((typeofWidth=typeof width)=='number');hasPixelHeight=((typeofHeight=typeof height)=='number');topLevel=me.floating||!(ownerLayout=me.ownerLayout);if(topLevel){policy=Ext.layout.Layout.prototype.autoSizePolicy;shrinkWrap=me.floating?3:me.shrinkWrap;if(hasPixelWidth){widthModel=models.configured;}
if(hasPixelHeight){heightModel=models.configured;}}else{policy=ownerLayout.getItemSizePolicy(me,ownerCtSizeModel);shrinkWrap=ownerLayout.isItemShrinkWrap(me);}
if(ownerContext){ownerContext.ownerSizePolicy=policy;}
shrinkWrap=(shrinkWrap===true)?3:(shrinkWrap||0);if(topLevel&&shrinkWrap){if(width&&typeofWidth=='string'){shrinkWrap&=2;}
if(height&&typeofHeight=='string'){shrinkWrap&=1;}}
if(shrinkWrap!==3){if(!ownerCtSizeModel){ownerCtSizeModel=me.ownerCt&&me.ownerCt.getSizeModel();}
if(ownerCtSizeModel){shrinkWrap|=(ownerCtSizeModel.width.shrinkWrap?1:0)|(ownerCtSizeModel.height.shrinkWrap?2:0);}}
if(!widthModel){if(!policy.setsWidth){if(hasPixelWidth){widthModel=models.configured;}else{widthModel=(shrinkWrap&1)?models.shrinkWrap:models.natural;}}else if(policy.readsWidth){if(hasPixelWidth){widthModel=models.calculatedFromConfigured;}else{widthModel=(shrinkWrap&1)?models.calculatedFromShrinkWrap:models.calculatedFromNatural;}}else{widthModel=models.calculated;}}
if(!heightModel){if(!policy.setsHeight){if(hasPixelHeight){heightModel=models.configured;}else{heightModel=(shrinkWrap&2)?models.shrinkWrap:models.natural;}}else if(policy.readsHeight){if(hasPixelHeight){heightModel=models.calculatedFromConfigured;}else{heightModel=(shrinkWrap&2)?models.calculatedFromShrinkWrap:models.calculatedFromNatural;}}else{heightModel=models.calculated;}}}
return widthModel.pairsByHeightOrdinal[heightModel.ordinal];},isDescendant:function(ancestor){if(ancestor.isContainer){for(var c=this.ownerCt;c;c=c.ownerCt){if(c===ancestor){return true;}}}
return false;},doComponentLayout:function(){this.updateLayout();return this;},forceComponentLayout:function(){this.updateLayout();},setComponentLayout:function(layout){var currentLayout=this.componentLayout;if(currentLayout&&currentLayout.isLayout&&currentLayout!=layout){currentLayout.setOwner(null);}
this.componentLayout=layout;layout.setOwner(this);},getComponentLayout:function(){var me=this;if(!me.componentLayout||!me.componentLayout.isLayout){me.setComponentLayout(Ext.layout.Layout.create(me.componentLayout,'autocomponent'));}
return me.componentLayout;},afterComponentLayout:function(width,height,oldWidth,oldHeight){var me=this;if(++me.componentLayoutCounter===1){me.afterFirstLayout(width,height);}
if(width!==oldWidth||height!==oldHeight){me.onResize(width,height,oldWidth,oldHeight);}},beforeComponentLayout:function(width,height){return true;},setPosition:function(x,y,animate){var me=this,pos=me.beforeSetPosition.apply(me,arguments);if(pos&&me.rendered){x=pos.x;y=pos.y;if(animate){if(x!==me.getLocalX()||y!==me.getLocalY()){me.stopAnimation();me.animate(Ext.apply({duration:1000,listeners:{afteranimate:Ext.Function.bind(me.afterSetPosition,me,[x,y])},to:{x:x,y:y}},animate));}}else{me.setLocalXY(x,y);me.afterSetPosition(x,y);}}
return me;},beforeSetPosition:function(x,y,animate){var pos,x0;if(x){if(Ext.isNumber(x0=x[0])){animate=y;y=x[1];x=x0;}
else if((x0=x.x)!==undefined){animate=y;y=x.y;x=x0;}}
if(this.constrain||this.constrainHeader){pos=this.calculateConstrainedPosition(null,[x,y],true);if(pos){x=pos[0];y=pos[1];}}
pos={x:this.x=x,y:this.y=y,anim:animate,hasX:x!==undefined,hasY:y!==undefined};return(pos.hasX||pos.hasY)?pos:null;},afterSetPosition:function(x,y){var me=this;me.onPosition(x,y);if(me.hasListeners.move){me.fireEvent('move',me,x,y);}},onPosition:Ext.emptyFn,setWidth:function(width){return this.setSize(width);},setHeight:function(height){return this.setSize(undefined,height);},getSize:function(){return this.el.getSize();},getWidth:function(){return this.el.getWidth();},getHeight:function(){return this.el.getHeight();},getLoader:function(){var me=this,autoLoad=me.autoLoad?(Ext.isObject(me.autoLoad)?me.autoLoad:{url:me.autoLoad}):null,loader=me.loader||autoLoad;if(loader){if(!loader.isLoader){me.loader=new Ext.ComponentLoader(Ext.apply({target:me,autoLoad:autoLoad},loader));}else{loader.setTarget(me);}
return me.loader;}
return null;},setDocked:function(dock,layoutParent){var me=this;me.dock=dock;if(layoutParent&&me.ownerCt&&me.rendered){me.ownerCt.updateLayout();}
return me;},setBorder:function(border,targetEl){var me=this,initial=!!targetEl;if(me.rendered||initial){if(!initial){targetEl=me.el;}
if(!border){border=0;}else if(border===true){border='1px';}else{border=this.unitizeBox(border);}
targetEl.setStyle('border-width',border);if(!initial){me.updateLayout();}}
me.border=border;},onDestroy:function(){var me=this;if(me.monitorResize&&Ext.EventManager.resizeEvent){Ext.EventManager.resizeEvent.removeListener(me.setSize,me);}
Ext.destroy(me.componentLayout,me.loadMask,me.floatingDescendants);},destroy:function(){var me=this,selectors=me.renderSelectors,selector,el;if(!me.isDestroyed){if(!me.hasListeners.beforedestroy||me.fireEvent('beforedestroy',me)!==false){me.destroying=true;me.beforeDestroy();if(me.floating){delete me.floatParent;if(me.zIndexManager){me.zIndexManager.unregister(me);}}else if(me.ownerCt&&me.ownerCt.remove){me.ownerCt.remove(me,false);}
me.stopAnimation();me.onDestroy();Ext.destroy(me.plugins);if(me.hasListeners.destroy){me.fireEvent('destroy',me);}
Ext.ComponentManager.unregister(me);me.mixins.state.destroy.call(me);me.clearListeners();if(me.rendered){if(!me.preserveElOnDestroy){me.el.remove();}
me.mixins.elementCt.destroy.call(me);if(selectors){for(selector in selectors){if(selectors.hasOwnProperty(selector)){el=me[selector];if(el){delete me[selector];el.remove();}}}}
delete me.el;delete me.frameBody;delete me.rendered;}
me.destroying=false;me.isDestroyed=true;}}},isDescendantOf:function(container){return!!this.findParentBy(function(p){return p===container;});},getHierarchyState:function(inner){var me=this,hierarchyState=(inner&&me.hierarchyStateInner)||me.hierarchyState,ownerCt=me.ownerCt,parent,layout,hierarchyStateInner,getInner;if(!hierarchyState||hierarchyState.invalid){parent=me.getRefOwner();if(ownerCt){getInner=me.ownerLayout===ownerCt.layout;}
me.hierarchyState=hierarchyState=Ext.Object.chain(parent?parent.getHierarchyState(getInner):Ext.rootHierarchyState);me.initHierarchyState(hierarchyState);if((layout=me.componentLayout).initHierarchyState){layout.initHierarchyState(hierarchyState);}
if(me.isContainer){me.hierarchyStateInner=hierarchyStateInner=Ext.Object.chain(hierarchyState);layout=me.layout;if(layout&&layout.initHierarchyState){layout.initHierarchyState(hierarchyStateInner,hierarchyState);}
if(inner){hierarchyState=hierarchyStateInner;}}}
return hierarchyState;},initHierarchyState:function(hierarchyState){var me=this;if(me.collapsed){hierarchyState.collapsed=true;}
if(me.hidden){hierarchyState.hidden=true;}
if(me.collapseImmune){hierarchyState.collapseImmune=true;}},getAnchorToXY:function(el,anchor,local,mySize){return el.getAnchorXY(anchor,local,mySize);},getBorderPadding:function(){return this.el.getBorderPadding();},getLocalX:function(){return this.el.getLocalX();},getLocalXY:function(){return this.el.getLocalXY();},getLocalY:function(){return this.el.getLocalY();},getX:function(){return this.el.getX();},getXY:function(){return this.el.getXY();},getY:function(){return this.el.getY();},setLocalX:function(x){this.el.setLocalX(x);},setLocalXY:function(x,y){this.el.setLocalXY(x,y);},setLocalY:function(y){this.el.setLocalY(y);},setX:function(x,animate){this.el.setX(x,animate);},setXY:function(xy,animate){this.el.setXY(xy,animate);},setY:function(y,animate){this.el.setY(y,animate);}},function(){var AbstractComponent=this;AbstractComponent.createAlias({on:'addListener',prev:'previousSibling',next:'nextSibling'});Ext.resumeLayouts=function(flush){AbstractComponent.resumeLayouts(flush);};Ext.suspendLayouts=function(){AbstractComponent.suspendLayouts();};Ext.batchLayouts=function(fn,scope){AbstractComponent.suspendLayouts();fn.call(scope);AbstractComponent.resumeLayouts(true);};});Ext.define('Ext.Component',{alias:['widget.component','widget.box'],extend:'Ext.AbstractComponent',uses:['Ext.util.DelayedTask','Ext.Layer','Ext.resizer.Resizer','Ext.util.ComponentDragger'],mixins:{floating:'Ext.util.Floating'},statics:{DIRECTION_TOP:'top',DIRECTION_RIGHT:'right',DIRECTION_BOTTOM:'bottom',DIRECTION_LEFT:'left',VERTICAL_DIRECTION_Re:/^(?:top|bottom)$/,INVALID_ID_CHARS_Re:/[\.,\s]/g},resizeHandles:'all',floating:false,defaultAlign:'tl-bl?',toFrontOnShow:true,hideMode:'display',offsetsCls:Ext.baseCSSPrefix+'hide-offsets',bubbleEvents:[],defaultComponentLayoutType:'autocomponent',constructor:function(config){var me=this;config=config||{};if(config.initialConfig){if(config.isAction){me.baseAction=config;}
config=config.initialConfig;}
else if(config.tagName||config.dom||Ext.isString(config)){config={applyTo:config,id:config.id||config};}
me.callParent([config]);if(me.baseAction){me.baseAction.addComponent(me);}},initComponent:function(){var me=this;me.callParent();if(me.listeners){me.on(me.listeners);me.listeners=null;}
me.enableBubble(me.bubbleEvents);},afterRender:function(){var me=this;me.callParent();if(!(me.x&&me.y)&&(me.pageX||me.pageY)){me.setPagePosition(me.pageX,me.pageY);}},setAutoScroll:function(scroll){var me=this;me.autoScroll=!!scroll;if(me.rendered){me.getOverflowEl().setStyle(me.getOverflowStyle());}
me.updateLayout();return me;},setOverflowXY:function(overflowX,overflowY){var me=this,argCount=arguments.length;if(argCount){me.overflowX=overflowX||'';if(argCount>1){me.overflowY=overflowY||'';}}
if(me.rendered){me.getOverflowEl().setStyle(me.getOverflowStyle());}
me.updateLayout();return me;},beforeRender:function(){var me=this,floating=me.floating,cls;if(floating){me.addCls(Ext.baseCSSPrefix+'layer');cls=floating.cls;if(cls){me.addCls(cls);}}
return me.callParent();},beforeLayout:function(){this.callParent(arguments);if(this.floating){this.onBeforeFloatLayout();}},afterComponentLayout:function(){this.callParent(arguments);if(this.floating){this.onAfterFloatLayout();}},makeFloating:function(dom){this.mixins.floating.constructor.call(this,dom);},wrapPrimaryEl:function(dom){if(this.floating){this.makeFloating(dom);}else{this.callParent(arguments);}},initResizable:function(resizable){var me=this;resizable=Ext.apply({target:me,dynamic:false,constrainTo:me.constrainTo||(me.floatParent?me.floatParent.getTargetEl():null),handles:me.resizeHandles},resizable);resizable.target=me;me.resizer=new Ext.resizer.Resizer(resizable);},getDragEl:function(){return this.el;},initDraggable:function(){var me=this,dragTarget=(me.resizer&&me.resizer.el!==me.el)?me.resizerComponent=new Ext.Component({el:me.resizer.el,rendered:true,container:me.container}):me,ddConfig=Ext.applyIf({el:dragTarget.getDragEl(),constrainTo:(me.constrain||me.draggable.constrain)?(me.constrainTo||(me.floatParent?me.floatParent.getTargetEl():me.container)):undefined},me.draggable);if(me.constrain||me.constrainDelegate){ddConfig.constrain=me.constrain;ddConfig.constrainDelegate=me.constrainDelegate;}
me.dd=new Ext.util.ComponentDragger(dragTarget,ddConfig);},scrollBy:function(deltaX,deltaY,animate){var el;if((el=this.getTargetEl())&&el.dom){el.scrollBy.apply(el,arguments);}},setLoading:function(load,targetEl){var me=this,config={target:me};if(me.rendered){Ext.destroy(me.loadMask);me.loadMask=null;if(load!==false&&!me.collapsed){if(Ext.isObject(load)){Ext.apply(config,load);}else if(Ext.isString(load)){config.msg=load;}
if(targetEl){Ext.applyIf(config,{useTargetEl:true});}
me.loadMask=new Ext.LoadMask(config);me.loadMask.show();}}
return me.loadMask;},beforeSetPosition:function(){var me=this,pos=me.callParent(arguments),adj;if(pos){adj=me.adjustPosition(pos.x,pos.y);pos.x=adj.x;pos.y=adj.y;}
return pos||null;},afterSetPosition:function(ax,ay){this.onPosition(ax,ay);this.fireEvent('move',this,ax,ay);},showAt:function(x,y,animate){var me=this;if(!me.rendered&&(me.autoRender||me.floating)){me.x=x;me.y=y;return me.show();}
if(me.floating){me.setPosition(x,y,animate);}else{me.setPagePosition(x,y,animate);}
me.show();},showBy:function(cmp,pos,off){var me=this;if(me.floating&&cmp){me.show();if(me.rendered&&!me.hidden){me.alignTo(cmp,pos||me.defaultAlign,off);}}
return me;},setPagePosition:function(x,y,animate){var me=this,p,floatParentBox;if(Ext.isArray(x)){y=x[1];x=x[0];}
me.pageX=x;me.pageY=y;if(me.floating){if(me.isContainedFloater()){floatParentBox=me.floatParent.getTargetEl().getViewRegion();if(Ext.isNumber(x)&&Ext.isNumber(floatParentBox.left)){x-=floatParentBox.left;}
if(Ext.isNumber(y)&&Ext.isNumber(floatParentBox.top)){y-=floatParentBox.top;}}else{p=me.el.translateXY(x,y);x=p.x;y=p.y;}
me.setPosition(x,y,animate);}else{p=me.el.translateXY(x,y);me.setPosition(p.x,p.y,animate);}
return me;},isContainedFloater:function(){return(this.floating&&this.floatParent);},updateBox:function(box){this.setSize(box.width,box.height);this.setPagePosition(box.x,box.y);return this;},getOuterSize:function(){var el=this.el;return{width:el.getWidth()+el.getMargin('lr'),height:el.getHeight()+el.getMargin('tb')};},adjustPosition:function(x,y){var me=this,floatParentBox;if(me.isContainedFloater()){floatParentBox=me.floatParent.getTargetEl().getViewRegion();x+=floatParentBox.left;y+=floatParentBox.top;}
return{x:x,y:y};},getPosition:function(local){var me=this,xy,isContainedFloater=me.isContainedFloater(),floatParentBox;if((local===true)&&!isContainedFloater){return[me.getLocalX(),me.getLocalY()];}
xy=me.getXY();if((local===true)&&isContainedFloater){floatParentBox=me.floatParent.getTargetEl().getViewRegion();xy[0]-=floatParentBox.left;xy[1]-=floatParentBox.top;}
return xy;},getId:function(){var me=this,xtype;if(!me.id){xtype=me.getXType();if(xtype){xtype=xtype.replace(Ext.Component.INVALID_ID_CHARS_Re,'-');}else{xtype=Ext.name.toLowerCase()+'-comp';}
me.id=xtype+'-'+me.getAutoId();}
return me.id;},show:function(animateTarget,cb,scope){var me=this,rendered=me.rendered;if(me.hierarchicallyHidden||(me.floating&&!rendered&&me.isHierarchicallyHidden())){if(!rendered){me.initHierarchyEvents();}
if(arguments.length>1){arguments[0]=null;me.pendingShow=arguments;}else{me.pendingShow=true;}}else if(rendered&&me.isVisible()){if(me.toFrontOnShow&&me.floating){me.toFront();}}else{if(me.fireEvent('beforeshow',me)!==false){me.hidden=false;delete this.getHierarchyState().hidden;Ext.suspendLayouts();if(!rendered&&(me.autoRender||me.floating)){me.doAutoRender();rendered=me.rendered;}
if(rendered){me.beforeShow();Ext.resumeLayouts();me.onShow.apply(me,arguments);me.afterShow.apply(me,arguments);}else{Ext.resumeLayouts(true);}}else{me.onShowVeto();}}
return me;},onShowVeto:Ext.emptyFn,beforeShow:Ext.emptyFn,onShow:function(){var me=this;me.el.show();me.callParent(arguments);if(me.floating){if(me.maximized){me.fitContainer();}
else if(me.constrain){me.doConstrain();}}},getAnimateTarget:function(target){target=target||this.animateTarget;if(target){target=target.isComponent?target.getEl():Ext.get(target);}
return target||null;},afterShow:function(animateTarget,cb,scope){var me=this,myEl=me.el,fromBox,toBox,ghostPanel;animateTarget=me.getAnimateTarget(animateTarget);if(!me.ghost){animateTarget=null;}
if(animateTarget){toBox={x:myEl.getX(),y:myEl.getY(),width:myEl.dom.offsetWidth,height:myEl.dom.offsetHeight};fromBox={x:animateTarget.getX(),y:animateTarget.getY(),width:animateTarget.dom.offsetWidth,height:animateTarget.dom.offsetHeight};myEl.addCls(me.offsetsCls);ghostPanel=me.ghost();ghostPanel.el.stopAnimation();ghostPanel.setX(-10000);me.ghostBox=toBox;ghostPanel.el.animate({from:fromBox,to:toBox,listeners:{afteranimate:function(){delete ghostPanel.componentLayout.lastComponentSize;me.unghost();delete me.ghostBox;myEl.removeCls(me.offsetsCls);me.onShowComplete(cb,scope);}}});}
else{me.onShowComplete(cb,scope);}
me.fireHierarchyEvent('show');},onShowComplete:function(cb,scope){var me=this;if(me.floating){me.toFront();me.onFloatShow();}
Ext.callback(cb,scope||me);me.fireEvent('show',me);delete me.hiddenByLayout;},hide:function(animateTarget,cb,scope){var me=this,continueHide;if(me.pendingShow){delete me.pendingShow;}if(!(me.rendered&&!me.isVisible())){continueHide=(me.fireEvent('beforehide',me)!==false);if(me.hierarchicallyHidden||continueHide){me.hidden=true;me.getHierarchyState().hidden=true;if(me.rendered){me.onHide.apply(me,arguments);}}}
return me;},onHide:function(animateTarget,cb,scope){var me=this,ghostPanel,fromSize,toBox;animateTarget=me.getAnimateTarget(animateTarget);if(!me.ghost){animateTarget=null;}
if(animateTarget){toBox={x:animateTarget.getX(),y:animateTarget.getY(),width:animateTarget.dom.offsetWidth,height:animateTarget.dom.offsetHeight};ghostPanel=me.ghost();ghostPanel.el.stopAnimation();fromSize=me.getSize();ghostPanel.el.animate({to:toBox,listeners:{afteranimate:function(){delete ghostPanel.componentLayout.lastComponentSize;ghostPanel.el.hide();ghostPanel.el.setSize(fromSize);me.afterHide(cb,scope);}}});}
me.el.hide();if(!animateTarget){me.afterHide(cb,scope);}},afterHide:function(cb,scope){var me=this,activeEl=Ext.Element.getActiveElement();me.hiddenByLayout=null;Ext.AbstractComponent.prototype.onHide.call(me);if(activeEl===me.el||me.el.contains(activeEl)){Ext.fly(activeEl).blur();}
Ext.callback(cb,scope||me);me.fireEvent('hide',me);me.fireHierarchyEvent('hide');},onDestroy:function(){var me=this;if(me.rendered){Ext.destroy(me.dd,me.resizer,me.proxy,me.proxyWrap,me.resizerComponent);}
delete me.focusTask;me.callParent();},deleteMembers:function(){var args=arguments,len=args.length,i=0;for(;i<len;++i){delete this[args[i]];}},focus:function(selectText,delay,callback,scope){var me=this,focusEl,focusElDom,containerScrollTop;if(delay){if(!me.focusTask){Ext.Component.prototype.focusTask=new Ext.util.DelayedTask(me.focus);}
me.focusTask.delay(Ext.isNumber(delay)?delay:10,null,me,[selectText,false,callback,scope]);return me;}
if(me.focusTask){me.focusTask.cancel();}
if(me.rendered&&!me.isDestroyed&&me.isVisible(true)&&(focusEl=me.getFocusEl())){if(focusEl.isComponent){return focusEl.focus(selectText,delay);}
if((focusElDom=focusEl.dom)){if(focusEl.needsTabIndex()){focusElDom.tabIndex=-1;}
if(me.floating){containerScrollTop=me.container.dom.scrollTop;}
focusEl.focus();if(selectText===true){focusElDom.select();}
Ext.callback(callback,scope);}
if(me.floating){me.toFront(true);if(containerScrollTop!==undefined){me.container.dom.scrollTop=containerScrollTop;}}}
return me;},cancelFocus:function(){var task=this.focusTask;if(task){task.cancel();}},blur:function(){var focusEl;if(this.rendered&&(focusEl=this.getFocusEl())){focusEl.blur();}
return this;},getEl:function(){return this.el;},getResizeEl:function(){return this.el;},getPositionEl:function(){return this.el;},getActionEl:function(){return this.el;},getVisibilityEl:function(){return this.el;},getRefOwner:function(){return this.ownerCt||this.floatParent;},getBubbleTarget:function(){return this.getRefOwner();},getContentTarget:function(){return this.el;},cloneConfig:function(overrides){overrides=overrides||{};var id=overrides.id||Ext.id(),cfg=Ext.applyIf(overrides,this.initialConfig),self;cfg.id=id;self=Ext.getClass(this);return new self(cfg);},getXType:function(){return this.self.xtype;},findParentBy:function(fn){var p;for(p=this.getBubbleTarget();p&&!fn(p,this);p=p.getBubbleTarget()){}
return p||null;},findParentByType:function(xtype){return Ext.isFunction(xtype)?this.findParentBy(function(p){return p.constructor===xtype;}):this.up(xtype);},bubble:function(fn,scope,args){var p=this;while(p){if(fn.apply(scope||p,args||[p])===false){break;}
p=p.getBubbleTarget();}
return this;},getProxy:function(){var me=this,target;if(!me.proxy){target=Ext.getBody();me.proxy=me.el.createProxy(Ext.baseCSSPrefix+'proxy-el',target,true);}
return me.proxy;},fireHierarchyEvent:function(ename){this.hierarchyEventSource.fireEvent(ename,this);},onAdded:function(){this.callParent(arguments);if(this.hierarchyEventSource.hasListeners.added){this.fireHierarchyEvent('added');}}},function(){this.hierarchyEventSource=this.prototype.hierarchyEventSource=new Ext.util.Observable({events:{hide:true,show:true,collapse:true,expand:true,added:true}});});Ext.define('Ext.app.domain.Component',{extend:'Ext.app.EventDomain',singleton:true,requires:['Ext.Component'],type:'component',constructor:function(){var me=this;me.callParent();me.monitor(Ext.Component);},match:function(target,selector){return target.is(selector);}});Ext.define('Ext.form.Label',{extend:'Ext.Component',alias:'widget.label',requires:['Ext.util.Format'],autoEl:'label',maskOnDisable:false,getElConfig:function(){var me=this;me.html=me.text?Ext.util.Format.htmlEncode(me.text):(me.html||'');return Ext.apply(me.callParent(),{htmlFor:me.forId||''});},setText:function(text,encode){var me=this;encode=encode!==false;if(encode){me.text=text;delete me.html;}else{me.html=text;delete me.text;}
if(me.rendered){me.el.dom.innerHTML=encode!==false?Ext.util.Format.htmlEncode(text):text;me.updateLayout();}
return me;}});Ext.define('Ext.form.field.Base',{extend:'Ext.Component',mixins:{labelable:'Ext.form.Labelable',field:'Ext.form.field.Field'},alias:'widget.field',alternateClassName:['Ext.form.Field','Ext.form.BaseField'],requires:['Ext.util.DelayedTask','Ext.XTemplate','Ext.layout.component.field.Field'],fieldSubTpl:['<input id="{id}" type="{type}" {inputAttrTpl}',' size="1"','<tpl if="name"> name="{name}"</tpl>','<tpl if="value"> value="{[Ext.util.Format.htmlEncode(values.value)]}"</tpl>','<tpl if="placeholder"> placeholder="{placeholder}"</tpl>','{%if (values.maxLength !== undefined){%} maxlength="{maxLength}"{%}%}','<tpl if="readOnly"> readonly="readonly"</tpl>','<tpl if="disabled"> disabled="disabled"</tpl>','<tpl if="tabIdx"> tabIndex="{tabIdx}"</tpl>','<tpl if="fieldStyle"> style="{fieldStyle}"</tpl>',' class="{fieldCls} {typeCls} {editableCls} {inputCls}" autocomplete="off"/>',{disableFormats:true}],subTplInsertions:['inputAttrTpl'],inputType:'text',invalidText:'The value in this field is invalid',fieldCls:Ext.baseCSSPrefix+'form-field',focusCls:'form-focus',dirtyCls:Ext.baseCSSPrefix+'form-dirty',checkChangeEvents:Ext.isIE&&(!document.documentMode||document.documentMode<9)?['change','propertychange','keyup']:['change','input','textInput','keyup','dragdrop'],checkChangeBuffer:50,componentLayout:'field',readOnly:false,readOnlyCls:Ext.baseCSSPrefix+'form-readonly',validateOnBlur:true,hasFocus:false,baseCls:Ext.baseCSSPrefix+'field',maskOnDisable:false,stretchInputElFixed:true,initComponent:function(){var me=this;me.callParent();me.subTplData=me.subTplData||{};me.addEvents('specialkey','writeablechange');me.initLabelable();me.initField();if(!me.name){me.name=me.getInputId();}
if(me.readOnly){me.addCls(me.readOnlyCls);}
me.addCls(Ext.baseCSSPrefix+'form-type-'+me.inputType);},getInputId:function(){return this.inputId||(this.inputId=this.id+'-inputEl');},getSubTplData:function(){var me=this,type=me.inputType,inputId=me.getInputId(),data;data=Ext.apply({id:inputId,cmpId:me.id,name:me.name||inputId,disabled:me.disabled,readOnly:me.readOnly,value:me.getRawValue(),type:type,fieldCls:me.fieldCls,fieldStyle:me.getFieldStyle(),tabIdx:me.tabIndex,inputCls:me.inputCls,typeCls:Ext.baseCSSPrefix+'form-'+(type==='password'?'text':type)},me.subTplData);me.getInsertionRenderData(data,me.subTplInsertions);return data;},applyRenderSelectors:function(){var me=this;me.callParent();me.addChildEls('inputEl');me.inputEl=me.el.getById(me.getInputId());},getSubTplMarkup:function(){return this.getTpl('fieldSubTpl').apply(this.getSubTplData());},initRenderTpl:function(){var me=this;if(!me.hasOwnProperty('renderTpl')){me.renderTpl=me.getTpl('labelableRenderTpl');}
return me.callParent();},initRenderData:function(){return Ext.applyIf(this.callParent(),this.getLabelableRenderData());},setFieldStyle:function(style){var me=this,inputEl=me.inputEl;if(inputEl){inputEl.applyStyles(style);}
me.fieldStyle=style;},getFieldStyle:function(){return Ext.isObject(this.fieldStyle)?Ext.DomHelper.generateStyles(this.fieldStyle):this.fieldStyle||'';},onRender:function(){this.callParent(arguments);this.renderActiveError();},getFocusEl:function(){return this.inputEl;},isFileUpload:function(){return this.inputType==='file';},getSubmitData:function(){var me=this,data=null,val;if(!me.disabled&&me.submitValue&&!me.isFileUpload()){val=me.getSubmitValue();if(val!==null){data={};data[me.getName()]=val;}}
return data;},getSubmitValue:function(){return this.processRawValue(this.getRawValue());},getRawValue:function(){var me=this,v=(me.inputEl?me.inputEl.getValue():Ext.value(me.rawValue,''));me.rawValue=v;return v;},setRawValue:function(value){var me=this;value=Ext.value(me.transformRawValue(value),'');me.rawValue=value;if(me.inputEl){me.inputEl.dom.value=value;}
return value;},transformRawValue:Ext.identityFn,valueToRaw:function(value){return''+Ext.value(value,'');},rawToValue:Ext.identityFn,processRawValue:Ext.identityFn,getValue:function(){var me=this,val=me.rawToValue(me.processRawValue(me.getRawValue()));me.value=val;return val;},setValue:function(value){var me=this;me.setRawValue(me.valueToRaw(value));return me.mixins.field.setValue.call(me,value);},onBoxReady:function(){var me=this;me.callParent();if(me.setReadOnlyOnBoxReady){me.setReadOnly(me.readOnly);}},onDisable:function(){var me=this,inputEl=me.inputEl;me.callParent();if(inputEl){inputEl.dom.disabled=true;if(me.hasActiveError()){me.clearInvalid();me.needsValidateOnEnable=true;}}},onEnable:function(){var me=this,inputEl=me.inputEl;me.callParent();if(inputEl){inputEl.dom.disabled=false;if(me.needsValidateOnEnable){delete me.needsValidateOnEnable;me.forceValidation=true;me.isValid();delete me.forceValidation;}}},setReadOnly:function(readOnly){var me=this,inputEl=me.inputEl;readOnly=!!readOnly;me[readOnly?'addCls':'removeCls'](me.readOnlyCls);me.readOnly=readOnly;if(inputEl){inputEl.dom.readOnly=readOnly;}else if(me.rendering){me.setReadOnlyOnBoxReady=true;}
me.fireEvent('writeablechange',me,readOnly);},fireKey:function(e){if(e.isSpecialKey()){this.fireEvent('specialkey',this,new Ext.EventObjectImpl(e));}},initEvents:function(){var me=this,inputEl=me.inputEl,onChangeTask,onChangeEvent,events=me.checkChangeEvents,e,eLen=events.length,event;if(inputEl){me.mon(inputEl,Ext.EventManager.getKeyEvent(),me.fireKey,me);onChangeTask=new Ext.util.DelayedTask(me.checkChange,me);me.onChangeEvent=onChangeEvent=function(){onChangeTask.delay(me.checkChangeBuffer);};for(e=0;e<eLen;e++){event=events[e];if(event==='propertychange'){me.usesPropertychange=true;}
me.mon(inputEl,event,onChangeEvent);}}
me.callParent();},doComponentLayout:function(){var me=this,inputEl=me.inputEl,usesPropertychange=me.usesPropertychange,ename='propertychange',onChangeEvent=me.onChangeEvent;if(usesPropertychange){me.mun(inputEl,ename,onChangeEvent);}
me.callParent(arguments);if(usesPropertychange){me.mon(inputEl,ename,onChangeEvent);}},onDirtyChange:function(isDirty){this[isDirty?'addCls':'removeCls'](this.dirtyCls);},isValid:function(){var me=this,disabled=me.disabled,validate=me.forceValidation||!disabled;return validate?me.validateValue(me.processRawValue(me.getRawValue())):disabled;},validateValue:function(value){var me=this,errors=me.getErrors(value),isValid=Ext.isEmpty(errors);if(!me.preventMark){if(isValid){me.clearInvalid();}else{me.markInvalid(errors);}}
return isValid;},markInvalid:function(errors){var me=this,oldMsg=me.getActiveError(),active;me.setActiveErrors(Ext.Array.from(errors));active=me.getActiveError();if(oldMsg!==active){me.setError(active);}},clearInvalid:function(){var me=this,hadError=me.hasActiveError();delete me.needsValidateOnEnable;me.unsetActiveError();if(hadError){me.setError('');}},setError:function(active){var me=this,msgTarget=me.msgTarget,prop;if(me.rendered){if(msgTarget=='title'||msgTarget=='qtip'){if(me.rendered){prop=msgTarget=='qtip'?'data-errorqtip':'title';}
me.getActionEl().dom.setAttribute(prop,active||'');}else{me.updateLayout();}}},renderActiveError:function(){var me=this,hasError=me.hasActiveError();if(me.inputEl){me.inputEl[hasError?'addCls':'removeCls'](me.invalidCls+'-field');}
me.mixins.labelable.renderActiveError.call(me);},getActionEl:function(){return this.inputEl||this.el;}});Ext.define('Ext.button.Button',{alias:'widget.button',extend:'Ext.Component',requires:['Ext.button.Manager','Ext.menu.Manager','Ext.util.ClickRepeater','Ext.layout.component.Button','Ext.util.TextMetrics','Ext.util.KeyMap'],mixins:{queryable:'Ext.Queryable'},alternateClassName:'Ext.Button',isButton:true,componentLayout:'button',hidden:false,disabled:false,pressed:false,tabIndex:0,enableToggle:false,menuAlign:'tl-bl?',showEmptyMenu:false,textAlign:'center',clickEvent:'click',preventDefault:true,handleMouseEvents:true,tooltipType:'qtip',baseCls:Ext.baseCSSPrefix+'btn',pressedCls:'pressed',overCls:'over',focusCls:'focus',menuActiveCls:'menu-active',hrefTarget:'_blank',childEls:['btnEl','btnWrap','btnInnerEl','btnIconEl'],renderTpl:['<span id="{id}-btnWrap" class="{baseCls}-wrap','<tpl if="splitCls"> {splitCls}</tpl>','{childElCls}" unselectable="on">','<span id="{id}-btnEl" class="{baseCls}-button">','<span id="{id}-btnInnerEl" class="{baseCls}-inner {innerCls}','{childElCls}" unselectable="on">','{text}','</span>','<span role="img" id="{id}-btnIconEl" class="{baseCls}-icon-el {iconCls}','{childElCls} {glyphCls}" unselectable="on" style="','<tpl if="iconUrl">background-image:url({iconUrl});</tpl>','<tpl if="glyph && glyphFontFamily">font-family:{glyphFontFamily};</tpl>">','<tpl if="glyph">&#{glyph};</tpl><tpl if="iconCls || iconUrl">&#160;</tpl>','</span>','</span>','</span>','<tpl if="closable">','<span id="{id}-closeEl" class="{baseCls}-close-btn" title="{closeText}" tabIndex="0"></span>','</tpl>'],scale:'small',allowedScales:['small','medium','large'],iconAlign:'left',arrowAlign:'right',arrowCls:'arrow',maskOnDisable:false,shrinkWrap:3,frame:true,_triggerRegion:{},initComponent:function(){var me=this;me.autoEl={tag:'a',role:'button',hidefocus:'on',unselectable:'on'};me.addCls('x-unselectable');me.callParent(arguments);me.addEvents('click','toggle','mouseover','mouseout','menushow','menuhide','menutriggerover','menutriggerout','textchange','iconchange','glyphchange');if(me.menu){me.split=true;me.menu=Ext.menu.Manager.get(me.menu);me.menu.ownerButton=me;}
if(me.url){me.href=me.url;}
if(me.href&&!me.hasOwnProperty('preventDefault')){me.preventDefault=false;}
if(Ext.isString(me.toggleGroup)&&me.toggleGroup!==''){me.enableToggle=true;}
if(me.html&&!me.text){me.text=me.html;delete me.html;}
me.glyphCls=me.baseCls+'-glyph';},getActionEl:function(){return this.el;},getFocusEl:function(){return this.el;},onDisable:function(){this.callParent(arguments);},setComponentCls:function(){var me=this,cls=me.getComponentCls();if(!Ext.isEmpty(me.oldCls)){me.removeClsWithUI(me.oldCls);me.removeClsWithUI(me.pressedCls);}
me.oldCls=cls;me.addClsWithUI(cls);},getComponentCls:function(){var me=this,cls;if(me.iconCls||me.icon||me.glyph){cls=[me.text?'icon-text-'+me.iconAlign:'icon'];}else if(me.text){cls=['noicon'];}else{cls=[];}
if(me.pressed){cls[cls.length]=me.pressedCls;}
return cls;},beforeRender:function(){var me=this,autoEl=me.autoEl,href=me.getHref(),hrefTarget=me.hrefTarget;if(!me.disabled){autoEl.tabIndex=me.tabIndex;}
if(href){autoEl.href=href;if(hrefTarget){autoEl.target=hrefTarget;}}
me.callParent();me.oldCls=me.getComponentCls();me.addClsWithUI(me.oldCls);Ext.applyIf(me.renderData,me.getTemplateArgs());},onRender:function(){var me=this,addOnclick,btn,btnListeners;me.doc=Ext.getDoc();me.callParent(arguments);btn=me.el;if(me.tooltip){me.setTooltip(me.tooltip,true);}
if(me.handleMouseEvents){btnListeners={scope:me,mouseover:me.onMouseOver,mouseout:me.onMouseOut,mousedown:me.onMouseDown};if(me.split){btnListeners.mousemove=me.onMouseMove;}}else{btnListeners={scope:me};}
if(me.menu){me.mon(me.menu,{scope:me,show:me.onMenuShow,hide:me.onMenuHide});me.keyMap=new Ext.util.KeyMap({target:me.el,key:Ext.EventObject.DOWN,handler:me.onDownKey,scope:me});}
if(me.repeat){me.mon(new Ext.util.ClickRepeater(btn,Ext.isObject(me.repeat)?me.repeat:{}),'click',me.onRepeatClick,me);}else{if(btnListeners[me.clickEvent]){addOnclick=true;}else{btnListeners[me.clickEvent]=me.onClick;}}
me.mon(btn,btnListeners);if(addOnclick){me.mon(btn,me.clickEvent,me.onClick,me);}
Ext.button.Manager.register(me);},getTemplateArgs:function(){var me=this,glyph=me.glyph,glyphFontFamily=Ext._glyphFontFamily,glyphParts;if(typeof glyph==='string'){glyphParts=glyph.split('@');glyph=glyphParts[0];glyphFontFamily=glyphParts[1];}
return{innerCls:me.getInnerCls(),splitCls:me.getSplitCls(),iconUrl:me.icon,iconCls:me.iconCls,glyph:glyph,glyphCls:glyph?me.glyphCls:'',glyphFontFamily:glyphFontFamily,text:me.text||'&#160;'};},setHref:function(href){this.href=href;this.el.dom.href=this.getHref();},getHref:function(){var me=this,href=me.href;return href?Ext.urlAppend(href,Ext.Object.toQueryString(Ext.apply({},me.params,me.baseParams))):false;},setParams:function(params){this.params=params;this.el.dom.href=this.getHref();},getSplitCls:function(){var me=this;return me.split?(me.baseCls+'-'+me.arrowCls)+' '+(me.baseCls+'-'+me.arrowCls+'-'+me.arrowAlign):'';},getInnerCls:function(){return this.textAlign?this.baseCls+'-inner-'+this.textAlign:'';},setIcon:function(icon){icon=icon||'';var me=this,btnIconEl=me.btnIconEl,oldIcon=me.icon||'';me.icon=icon;if(icon!=oldIcon){if(btnIconEl){btnIconEl.setStyle('background-image',icon?'url('+icon+')':'');me.setComponentCls();if(me.didIconStateChange(oldIcon,icon)){me.updateLayout();}}
me.fireEvent('iconchange',me,oldIcon,icon);}
return me;},setIconCls:function(cls){cls=cls||'';var me=this,btnIconEl=me.btnIconEl,oldCls=me.iconCls||'';me.iconCls=cls;if(oldCls!=cls){if(btnIconEl){btnIconEl.removeCls(oldCls);btnIconEl.addCls(cls);me.setComponentCls();if(me.didIconStateChange(oldCls,cls)){me.updateLayout();}}
me.fireEvent('iconchange',me,oldCls,cls);}
return me;},setGlyph:function(glyph){glyph=glyph||0;var me=this,btnIconEl=me.btnIconEl,oldGlyph=me.glyph,fontFamily,glyphParts;me.glyph=glyph;if(btnIconEl){if(typeof glyph==='string'){glyphParts=glyph.split('@');glyph=glyphParts[0];fontFamily=glyphParts[1]||Ext._glyphFontFamily;}
if(!glyph){btnIconEl.dom.innerHTML='';}else if(oldGlyph!=glyph){btnIconEl.dom.innerHTML='&#'+glyph+';';}
if(fontFamily){btnIconEl.setStyle('font-family',fontFamily);}}
me.fireEvent('glyphchange',me,me.glyph,oldGlyph);return me;},setTooltip:function(tooltip,initial){var me=this;if(me.rendered){if(!initial||!tooltip){me.clearTip();}
if(tooltip){if(Ext.quickTipsActive&&Ext.isObject(tooltip)){Ext.tip.QuickTipManager.register(Ext.apply({target:me.el.id},tooltip));me.tooltip=tooltip;}else{me.el.dom.setAttribute(me.getTipAttr(),tooltip);}}}else{me.tooltip=tooltip;}
return me;},setTextAlign:function(align){var me=this,btnEl=me.btnEl;if(btnEl){btnEl.removeCls(me.baseCls+'-inner-'+me.textAlign);btnEl.addCls(me.baseCls+'-inner-'+align);}
me.textAlign=align;return me;},getTipAttr:function(){return this.tooltipType=='qtip'?'data-qtip':'title';},getRefItems:function(deep){var menu=this.menu,items;if(menu){items=menu.getRefItems(deep);items.unshift(menu);}
return items||[];},clearTip:function(){var me=this,el=me.el;if(Ext.quickTipsActive&&Ext.isObject(me.tooltip)){Ext.tip.QuickTipManager.unregister(el);}else{el.dom.removeAttribute(me.getTipAttr());}},beforeDestroy:function(){var me=this;if(me.rendered){me.clearTip();}
if(me.menu&&me.destroyMenu!==false){Ext.destroy(me.menu);}
Ext.destroy(me.btnInnerEl,me.repeater);me.callParent();},onDestroy:function(){var me=this;if(me.rendered){me.doc.un('mouseover',me.monitorMouseOver,me);delete me.doc;Ext.destroy(me.keyMap);delete me.keyMap;}
Ext.button.Manager.unregister(me);me.callParent();},setHandler:function(handler,scope){this.handler=handler;this.scope=scope;return this;},setText:function(text){text=text||'';var me=this,oldText=me.text||'';if(text!=oldText){me.text=text;if(me.rendered){me.btnInnerEl.update(text||'&#160;');me.setComponentCls();if(Ext.isStrict&&Ext.isIE8){me.el.repaint();}
me.updateLayout();}
me.fireEvent('textchange',me,oldText,text);}
return me;},didIconStateChange:function(old,current){var currentEmpty=Ext.isEmpty(current);return Ext.isEmpty(old)?!currentEmpty:currentEmpty;},getText:function(){return this.text;},toggle:function(state,suppressEvent){var me=this;state=state===undefined?!me.pressed:!!state;if(state!==me.pressed){if(me.rendered){me[state?'addClsWithUI':'removeClsWithUI'](me.pressedCls);}
me.pressed=state;if(!suppressEvent){me.fireEvent('toggle',me,state);Ext.callback(me.toggleHandler,me.scope||me,[me,state]);}}
return me;},maybeShowMenu:function(){var me=this;if(me.menu&&!me.hasVisibleMenu()&&!me.ignoreNextClick){me.showMenu(true);}},showMenu:function(fromEvent){var me=this,menu=me.menu;if(me.rendered){if(me.tooltip&&Ext.quickTipsActive&&me.getTipAttr()!='title'){Ext.tip.QuickTipManager.getQuickTip().cancelShow(me.el);}
if(menu.isVisible()){menu.hide();}
if(!fromEvent||me.showEmptyMenu||menu.items.getCount()>0){menu.showBy(me.el,me.menuAlign);}}
return me;},hideMenu:function(){if(this.hasVisibleMenu()){this.menu.hide();}
return this;},hasVisibleMenu:function(){var menu=this.menu;return menu&&menu.rendered&&menu.isVisible();},onRepeatClick:function(repeat,e){this.onClick(e);},onClick:function(e){var me=this;if(me.preventDefault||(me.disabled&&me.getHref())&&e){e.preventDefault();}
if(e.type!=='keydown'&&e.button!==0){return;}
if(!me.disabled){me.doToggle();me.maybeShowMenu();me.fireHandler(e);}},fireHandler:function(e){var me=this,handler=me.handler;if(me.fireEvent('click',me,e)!==false){if(handler){handler.call(me.scope||me,me,e);}}},doToggle:function(){var me=this;if(me.enableToggle&&(me.allowDepress!==false||!me.pressed)){me.toggle();}},onMouseOver:function(e){var me=this;if(!me.disabled&&!e.within(me.el,true,true)){me.onMouseEnter(e);}},onMouseOut:function(e){var me=this;if(!e.within(me.el,true,true)){if(me.overMenuTrigger){me.onMenuTriggerOut(e);}
me.onMouseLeave(e);}},onMouseMove:function(e){var me=this,el=me.el,over=me.overMenuTrigger,overPosition,triggerRegion;if(me.split){overPosition=(me.arrowAlign==='right')?e.getX()-me.getX():e.getY()-el.getY();triggerRegion=me.getTriggerRegion();if(overPosition>triggerRegion.begin&&overPosition<triggerRegion.end){if(!over){me.onMenuTriggerOver(e);}}else{if(over){me.onMenuTriggerOut(e);}}}},getTriggerRegion:function(){var me=this,region=me._triggerRegion,triggerSize=me.getTriggerSize(),btnSize=me.arrowAlign==='right'?me.getWidth():me.getHeight();region.begin=btnSize-triggerSize;region.end=btnSize;return region;},getTriggerSize:function(){var me=this,size=me.triggerSize,side,sideFirstLetter;if(size==null){side=me.arrowAlign;sideFirstLetter=side.charAt(0);size=me.triggerSize=me.el.getFrameWidth(sideFirstLetter)+me.getBtnWrapFrameWidth(sideFirstLetter)
if(me.frameSize){size=me.triggerSize+=me.frameSize[side];}}
return size;},getBtnWrapFrameWidth:function(side){return this.btnWrap.getFrameWidth(side);},addOverCls:function(){if(!this.disabled){this.addClsWithUI(this.overCls);}},removeOverCls:function(){this.removeClsWithUI(this.overCls);},onMouseEnter:function(e){this.fireEvent('mouseover',this,e);},onMouseLeave:function(e){this.fireEvent('mouseout',this,e);},onMenuTriggerOver:function(e){var me=this,arrowTip=me.arrowTooltip;me.overMenuTrigger=true;if(me.split&&arrowTip){me.btnWrap.dom.setAttribute(me.getTipAttr(),arrowTip);}
me.fireEvent('menutriggerover',me,me.menu,e);},onMenuTriggerOut:function(e){var me=this;delete me.overMenuTrigger;if(me.split&&me.arrowTooltip){me.btnWrap.dom.setAttribute(me.getTipAttr(),'');}
me.fireEvent('menutriggerout',me,me.menu,e);},enable:function(silent){var me=this;me.callParent(arguments);me.removeClsWithUI('disabled');if(me.rendered){me.el.dom.setAttribute('tabIndex',me.tabIndex);}
return me;},disable:function(silent){var me=this;me.callParent(arguments);me.addClsWithUI('disabled');me.removeClsWithUI(me.overCls);if(me.rendered){me.el.dom.removeAttribute('tabIndex');}
if(me.btnInnerEl&&Ext.isIE7m){me.btnInnerEl.repaint();}
return me;},setScale:function(scale){var me=this,ui=me.ui.replace('-'+me.scale,'');if(!Ext.Array.contains(me.allowedScales,scale)){throw('#setScale: scale must be an allowed scale ('+me.allowedScales.join(', ')+')');}
me.scale=scale;me.setUI(ui);},setUI:function(ui){var me=this;if(me.scale&&!ui.match(me.scale)){ui=ui+'-'+me.scale;}
me.callParent([ui]);},onMouseDown:function(e){var me=this;if(Ext.isIE){me.getFocusEl().focus();}
if(!me.disabled&&e.button===0){Ext.button.Manager.onButtonMousedown(me,e);me.addClsWithUI(me.pressedCls);}},onMouseUp:function(e){var me=this;if(e.button===0){if(!me.pressed){me.removeClsWithUI(me.pressedCls);}}},onMenuShow:function(e){var me=this;me.ignoreNextClick=0;me.addClsWithUI(me.menuActiveCls);me.fireEvent('menushow',me,me.menu);},onMenuHide:function(e){var me=this;me.removeClsWithUI(me.menuActiveCls);me.ignoreNextClick=Ext.defer(me.restoreClick,250,me);me.fireEvent('menuhide',me,me.menu);me.focus();},restoreClick:function(){this.ignoreNextClick=0;},onDownKey:function(k,e){var me=this;if(me.menu&&!me.disabled){me.showMenu();e.stopEvent();return false;}}});Ext.define('Ext.ProgressBar',{extend:'Ext.Component',alias:'widget.progressbar',requires:['Ext.Template','Ext.CompositeElement','Ext.TaskManager','Ext.layout.component.ProgressBar'],uses:['Ext.fx.Anim'],baseCls:Ext.baseCSSPrefix+'progress',animate:false,text:'',waitTimer:null,childEls:['bar'],renderTpl:['<tpl if="internalText">','<div class="{baseCls}-text {baseCls}-text-back">{text}</div>','</tpl>','<div id="{id}-bar" class="{baseCls}-bar {baseCls}-bar-{ui}" style="width:{percentage}%">','<tpl if="internalText">','<div class="{baseCls}-text">','<div>{text}</div>','</div>','</tpl>','</div>'],componentLayout:'progressbar',initComponent:function(){this.callParent();this.addEvents("update");},initRenderData:function(){var me=this;return Ext.apply(me.callParent(),{internalText:!me.hasOwnProperty('textEl'),text:me.text||'&#160;',percentage:me.value?me.value*100:0});},onRender:function(){var me=this;me.callParent(arguments);if(me.textEl){me.textEl=Ext.get(me.textEl);me.updateText(me.text);}
else{me.textEl=me.el.select('.'+me.baseCls+'-text');}},updateProgress:function(value,text,animate){var me=this,oldValue=me.value;me.value=value||0;if(text){me.updateText(text);}
if(me.rendered&&!me.isDestroyed){if(animate===true||(animate!==false&&me.animate)){me.bar.stopAnimation();me.bar.animate(Ext.apply({from:{width:(oldValue*100)+'%'},to:{width:(me.value*100)+'%'}},me.animate));}else{me.bar.setStyle('width',(me.value*100)+'%');}}
me.fireEvent('update',me,me.value,text);return me;},updateText:function(text){var me=this;me.text=text;if(me.rendered){me.textEl.update(me.text);}
return me;},applyText:function(text){this.updateText(text);},getText:function(){return this.text;},wait:function(o){var me=this,scope;if(!me.waitTimer){scope=me;o=o||{};me.updateText(o.text);me.waitTimer=Ext.TaskManager.start({run:function(i){var inc=o.increment||10;i-=1;me.updateProgress(((((i+inc)%inc)+1)*(100/inc))*0.01,null,o.animate);},interval:o.interval||1000,duration:o.duration,onStop:function(){if(o.fn){o.fn.apply(o.scope||me);}
me.reset();},scope:scope});}
return me;},isWaiting:function(){return this.waitTimer!==null;},reset:function(hide){var me=this;me.updateProgress(0);me.clearTimer();if(hide===true){me.hide();}
return me;},clearTimer:function(){var me=this;if(me.waitTimer){me.waitTimer.onStop=null;Ext.TaskManager.stop(me.waitTimer);me.waitTimer=null;}},onDestroy:function(){var me=this,bar=me.bar;me.clearTimer();if(me.rendered){if(me.textEl.isComposite){me.textEl.clear();}
Ext.destroyMembers(me,'textEl','progressBar');if(bar&&me.animate){bar.stopAnimation();}}
me.callParent();}});Ext.define('Ext.resizer.Splitter',{extend:'Ext.Component',requires:['Ext.XTemplate'],uses:['Ext.resizer.SplitterTracker'],alias:'widget.splitter',childEls:['collapseEl'],renderTpl:['<tpl if="collapsible===true">','<div id="{id}-collapseEl" class="',Ext.baseCSSPrefix,'collapse-el ',Ext.baseCSSPrefix,'layout-split-{collapseDir}{childElCls}">&#160;','</div>','</tpl>'],baseCls:Ext.baseCSSPrefix+'splitter',collapsedClsInternal:Ext.baseCSSPrefix+'splitter-collapsed',canResize:true,collapsible:false,collapseOnDblClick:true,defaultSplitMin:40,defaultSplitMax:1000,collapseTarget:'next',horizontal:false,vertical:false,size:5,getTrackerConfig:function(){return{xclass:'Ext.resizer.SplitterTracker',el:this.el,splitter:this};},beforeRender:function(){var me=this,target=me.getCollapseTarget();me.callParent();if(target.collapsed){me.addCls(me.collapsedClsInternal);}
if(!me.canResize){me.addCls(me.baseCls+'-noresize');}
Ext.applyIf(me.renderData,{collapseDir:me.getCollapseDirection(),collapsible:me.collapsible||target.collapsible});me.protoEl.unselectable();},onRender:function(){var me=this,collapseEl;me.callParent(arguments);if(me.performCollapse!==false){if(me.renderData.collapsible){me.mon(me.collapseEl,'click',me.toggleTargetCmp,me);}
if(me.collapseOnDblClick){me.mon(me.el,'dblclick',me.toggleTargetCmp,me);}}
me.mon(me.getCollapseTarget(),{collapse:me.onTargetCollapse,expand:me.onTargetExpand,beforeexpand:me.onBeforeTargetExpand,beforecollapse:me.onBeforeTargetCollapse,scope:me});if(me.canResize){me.tracker=Ext.create(me.getTrackerConfig());me.relayEvents(me.tracker,['beforedragstart','dragstart','dragend']);}
collapseEl=me.collapseEl;if(collapseEl){collapseEl.lastCollapseDirCls=me.collapseDirProps[me.collapseDirection].cls;}},getCollapseDirection:function(){var me=this,dir=me.collapseDirection,collapseTarget,idx,items,type;if(!dir){collapseTarget=me.collapseTarget;if(collapseTarget.isComponent){dir=collapseTarget.collapseDirection;}
if(!dir){type=me.ownerCt.layout.type;if(collapseTarget.isComponent){items=me.ownerCt.items;idx=Number(items.indexOf(collapseTarget)===items.indexOf(me)-1)<<1|Number(type==='hbox');}else{idx=Number(me.collapseTarget==='prev')<<1|Number(type==='hbox');}
dir=['bottom','right','top','left'][idx];}
me.collapseDirection=dir;}
me.setOrientation((dir==='top'||dir==='bottom')?'horizontal':'vertical');return dir;},getCollapseTarget:function(){var me=this;return me.collapseTarget.isComponent?me.collapseTarget:me.collapseTarget==='prev'?me.previousSibling():me.nextSibling();},setCollapseEl:function(display){var el=this.collapseEl;if(el){el.setDisplayed(display);}},onBeforeTargetExpand:function(target){this.setCollapseEl('none');},onBeforeTargetCollapse:function(){this.setCollapseEl('none');},onTargetCollapse:function(target){this.el.addCls([this.collapsedClsInternal,this.collapsedCls]);this.setCollapseEl('');},onTargetExpand:function(target){this.el.removeCls([this.collapsedClsInternal,this.collapsedCls]);this.setCollapseEl('');},collapseDirProps:{top:{cls:Ext.baseCSSPrefix+'layout-split-top'},right:{cls:Ext.baseCSSPrefix+'layout-split-right'},bottom:{cls:Ext.baseCSSPrefix+'layout-split-bottom'},left:{cls:Ext.baseCSSPrefix+'layout-split-left'}},orientationProps:{horizontal:{opposite:'vertical',fixedAxis:'height',stretchedAxis:'width'},vertical:{opposite:'horizontal',fixedAxis:'width',stretchedAxis:'height'}},applyCollapseDirection:function(){var me=this,collapseEl=me.collapseEl,collapseDirProps=me.collapseDirProps[me.collapseDirection],cls;if(collapseEl){cls=collapseEl.lastCollapseDirCls;if(cls){collapseEl.removeCls(cls);}
collapseEl.addCls(collapseEl.lastCollapseDirCls=collapseDirProps.cls);}},applyOrientation:function(){var me=this,orientation=me.orientation,orientationProps=me.orientationProps[orientation],defaultSize=me.size,fixedSizeProp=orientationProps.fixedAxis,stretchSizeProp=orientationProps.stretchedAxis,cls=me.baseCls+'-';me[orientation]=true;me[orientationProps.opposite]=false;if(!me.hasOwnProperty(fixedSizeProp)||me[fixedSizeProp]==='100%'){me[fixedSizeProp]=defaultSize;}
if(!me.hasOwnProperty(stretchSizeProp)||me[stretchSizeProp]===defaultSize){me[stretchSizeProp]='100%';}
me.removeCls(cls+orientationProps.opposite);me.addCls(cls+orientation);},setOrientation:function(orientation){var me=this;if(me.orientation!==orientation){me.orientation=orientation;me.applyOrientation();}},updateOrientation:function(){delete this.collapseDirection;this.getCollapseDirection();this.applyCollapseDirection();},toggleTargetCmp:function(e,t){var cmp=this.getCollapseTarget(),placeholder=cmp.placeholder,toggle;if(Ext.isFunction(cmp.expand)&&Ext.isFunction(cmp.collapse)){if(placeholder&&!placeholder.hidden){toggle=true;}else{toggle=!cmp.hidden;}
if(toggle){if(cmp.collapsed){cmp.expand();}else if(cmp.collapseDirection){cmp.collapse();}else{cmp.collapse(this.renderData.collapseDir);}}}},setSize:function(){var me=this;me.callParent(arguments);if(Ext.isIE&&me.el){me.el.repaint();}},beforeDestroy:function(){Ext.destroy(this.tracker);this.callParent();}});Ext.define('Ext.toolbar.Fill',{extend:'Ext.Component',alias:'widget.tbfill',alternateClassName:'Ext.Toolbar.Fill',isFill:true,flex:1});Ext.define('Ext.Img',{extend:'Ext.Component',alias:['widget.image','widget.imagecomponent'],autoEl:'img',baseCls:Ext.baseCSSPrefix+'img',src:'',alt:'',title:'',imgCls:'',initComponent:function(){if(this.glyph){this.autoEl='div';}
this.callParent();},getElConfig:function(){var me=this,config=me.callParent(),glyphFontFamily=Ext._glyphFontFamily,glyph=me.glyph,img,glyphParts;if(me.autoEl=='img'){img=config;}else if(me.glyph){if(typeof glyph==='string'){glyphParts=glyph.split('@');glyph=glyphParts[0];glyphFontFamily=glyphParts[1];}
config.html='&#'+glyph+';';if(glyphFontFamily){config.style='font-family:'+glyphFontFamily;}}else{config.cn=[img={tag:'img',id:me.id+'-img'}];}
if(img){if(me.imgCls){img.cls=(img.cls?img.cls+' ':'')+me.imgCls;}
img.src=me.src||Ext.BLANK_IMAGE_URL;}
if(me.alt){(img||config).alt=me.alt;}
if(me.title){(img||config).title=me.title;}
return config;},onRender:function(){var me=this,el;me.callParent(arguments);el=me.el;me.imgEl=(me.autoEl=='img')?el:el.getById(me.id+'-img');},onDestroy:function(){Ext.destroy(this.imgEl);this.imgEl=null;this.callParent();},setSrc:function(src){var me=this,imgEl=me.imgEl;me.src=src;if(imgEl){imgEl.dom.src=src||Ext.BLANK_IMAGE_URL;}},setGlyph:function(glyph){var me=this,glyphFontFamily=Ext._glyphFontFamily,glyphParts,dom;if(glyph!=me.glyph){if(typeof glyph==='string'){glyphParts=glyph.split('@');glyph=glyphParts[0];glyphFontFamily=glyphParts[1];}
dom=me.el.dom;dom.innerHTML='&#'+glyph+';';if(glyphFontFamily){dom.style='font-family:'+glyphFontFamily;}}}});Ext.define('Ext.layout.container.border.Region',{override:'Ext.Component',initBorderRegion:function(){var me=this;if(!me._borderRegionInited){me._borderRegionInited=true;me.addStateEvents(['changeregion','changeweight']);Ext.override(me,{getState:function(){var state=me.callParent();state=me.addPropertyToState(state,'region');state=me.addPropertyToState(state,'weight');return state;}});}},getOwningBorderContainer:function(){var layout=this.getOwningBorderLayout();return layout&&layout.owner;},getOwningBorderLayout:function(){var layout=this.ownerLayout;return(layout&&layout.isBorderLayout)?layout:null;},setBorderRegion:function(region){var me=this,borderLayout,old=me.region;if(region!==old){borderLayout=me.getOwningBorderLayout();if(borderLayout){var regionFlags=borderLayout.regionFlags[region],placeholder=me.placeholder,splitter=me.splitter,owner=borderLayout.owner,regionMeta=borderLayout.regionMeta,collapsed=me.collapsed||me.floated,delta,items,index;if(me.fireEventArgs('beforechangeregion',[me,region])===false){return old;}
Ext.suspendLayouts();me.region=region;Ext.apply(me,regionFlags);if(me.updateCollapseTool){me.updateCollapseTool();}
if(splitter){Ext.apply(splitter,regionFlags);splitter.updateOrientation();items=owner.items;index=items.indexOf(me);if(index>=0){delta=regionMeta[region].splitterDelta;if(items.getAt(index+delta)!==splitter){items.remove(splitter);index=items.indexOf(me);if(delta>0){++index;}
items.insert(index,splitter);}}}
if(placeholder){if(collapsed){me.expand(false);}
owner.remove(placeholder);me.placeholder=null;if(collapsed){me.collapse(null,false);}}
owner.updateLayout();Ext.resumeLayouts(true);me.fireEventArgs('changeregion',[me,old]);}else{me.region=region;}}
return old;},setRegionWeight:function(weight){var me=this,ownerCt=me.getOwningBorderContainer(),placeholder=me.placeholder,old=me.weight;if(weight!==old){if(me.fireEventArgs('beforechangeweight',[me,weight])!==false){me.weight=weight;if(placeholder){placeholder.weight=weight;}
if(ownerCt){ownerCt.updateLayout();}
me.fireEventArgs('changeweight',[me,old]);}}
return old;}});Ext.define('Ext.LoadMask',{extend:'Ext.Component',alias:'widget.loadmask',mixins:{floating:'Ext.util.Floating',bindable:'Ext.util.Bindable'},uses:['Ext.data.StoreManager'],msg:'Loading...',msgCls:Ext.baseCSSPrefix+'mask-loading',maskCls:Ext.baseCSSPrefix+'mask',useMsg:true,useTargetEl:false,baseCls:Ext.baseCSSPrefix+'mask-msg',childEls:['msgEl','msgTextEl'],renderTpl:['<div id="{id}-msgEl" class="{[values.$comp.msgCls]} ',Ext.baseCSSPrefix,'mask-msg-inner{childElCls}">','<div id="{id}-msgTextEl" class="',Ext.baseCSSPrefix,'mask-msg-text','{childElCls}"></div>','</div>'],floating:{shadow:'frame'},focusOnToFront:false,bringParentToFront:false,constructor:function(config){var me=this,comp;if(arguments.length===2){comp=config;config=arguments[1];}else{comp=config.target;}
if(!comp.isComponent){comp=Ext.get(comp);this.isElement=true;}
me.ownerCt=comp;if(!this.isElement){me.bindComponent(comp);}
me.callParent([config]);if(me.store){me.bindStore(me.store,true);}},bindComponent:function(comp){var me=this,listeners={scope:this,resize:me.sizeMask,added:me.onComponentAdded,removed:me.onComponentRemoved};if(comp.floating){listeners.move=me.sizeMask;me.activeOwner=comp;}else if(comp.ownerCt){me.onComponentAdded(comp.ownerCt);}else{me.preventBringToFront=true;}
me.mon(comp,listeners);me.mon(me.hierarchyEventSource,{show:me.onContainerShow,hide:me.onContainerHide,expand:me.onContainerExpand,collapse:me.onContainerCollapse,scope:me});},onComponentAdded:function(owner){var me=this;delete me.activeOwner;me.floatParent=owner;if(!owner.floating){owner=owner.up('[floating]');}
if(owner){me.activeOwner=owner;me.mon(owner,'move',me.sizeMask,me);}else{me.preventBringToFront=true;}
owner=me.floatParent.ownerCt;if(me.rendered&&me.isVisible()&&owner){me.floatOwner=owner;me.mon(owner,'afterlayout',me.sizeMask,me,{single:true});}},onComponentRemoved:function(owner){var me=this,activeOwner=me.activeOwner,floatOwner=me.floatOwner;if(activeOwner){me.mun(activeOwner,'move',me.sizeMask,me);}
if(floatOwner){me.mun(floatOwner,'afterlayout',me.sizeMask,me);}
delete me.activeOwner;delete me.floatOwner;},afterRender:function(){this.callParent(arguments);this.container=this.floatParent.getContentTarget();},onContainerShow:function(container){if(this.isActiveContainer(container)){this.onComponentShow();}},onContainerHide:function(container){if(this.isActiveContainer(container)){this.onComponentHide();}},onContainerExpand:function(container){if(this.isActiveContainer(container)){this.onComponentShow();}},onContainerCollapse:function(container){if(this.isActiveContainer(container)){this.onComponentHide();}},isActiveContainer:function(container){return this.isDescendantOf(container);},onComponentHide:function(){var me=this;if(me.rendered&&me.isVisible()){me.hide();me.showNext=true;}},onComponentShow:function(){if(this.showNext){this.show();}
delete this.showNext;},sizeMask:function(){var me=this,target;if(me.rendered&&me.isVisible()){me.center();target=me.getMaskTarget();me.getMaskEl().show().setSize(target.getSize()).alignTo(target,'tl-tl');}},bindStore:function(store,initial){var me=this;me.mixins.bindable.bindStore.apply(me,arguments);store=me.store;if(store&&store.isLoading()){me.onBeforeLoad();}},getStoreListeners:function(store){var load=this.onLoad,beforeLoad=this.onBeforeLoad,result={cachemiss:beforeLoad,cachefilled:load};if(!store.proxy.isSynchronous){result.beforeLoad=beforeLoad;result.load=load;}
return result;},onDisable:function(){this.callParent(arguments);if(this.loading){this.onLoad();}},getOwner:function(){return this.ownerCt||this.floatParent;},getMaskTarget:function(){var owner=this.getOwner();return this.useTargetEl?owner.getTargetEl():owner.getEl();},onBeforeLoad:function(){var me=this,owner=me.getOwner(),origin;if(!me.disabled){me.loading=true;if(owner.componentLayoutCounter){me.maybeShow();}else{origin=owner.afterComponentLayout;owner.afterComponentLayout=function(){owner.afterComponentLayout=origin;origin.apply(owner,arguments);me.maybeShow();};}}},maybeShow:function(){var me=this,owner=me.getOwner();if(!owner.isVisible(true)){me.showNext=true;}
else if(me.loading&&owner.rendered){me.show();}},getMaskEl:function(){var me=this;return me.maskEl||(me.maskEl=me.el.insertSibling({cls:me.maskCls,style:{zIndex:me.el.getStyle('zIndex')-2}},'before'));},onShow:function(){var me=this,msgEl=me.msgEl;me.callParent(arguments);me.loading=true;if(me.useMsg){msgEl.show();me.msgTextEl.update(me.msg);}else{msgEl.parent().hide();}},hide:function(){if(this.isElement){this.ownerCt.unmask();this.fireEvent('hide',this);return;}
delete this.showNext;return this.callParent(arguments);},onHide:function(){this.callParent();this.getMaskEl().hide();},show:function(){if(this.isElement){this.ownerCt.mask(this.useMsg?this.msg:'',this.msgCls);this.fireEvent('show',this);return;}
return this.callParent(arguments);},afterShow:function(){this.callParent(arguments);this.sizeMask();},setZIndex:function(index){var me=this,owner=me.activeOwner;if(owner){index=parseInt(owner.el.getStyle('zIndex'),10)+1;}
me.getMaskEl().setStyle('zIndex',index-1);return me.mixins.floating.setZIndex.apply(me,arguments);},onLoad:function(){this.loading=false;this.hide();},onDestroy:function(){var me=this;if(me.isElement){me.ownerCt.unmask();}
Ext.destroy(me.maskEl);me.callParent();}});Ext.define('Ext.FocusManager',{singleton:true,alternateClassName:['Ext.FocusMgr'],mixins:{observable:'Ext.util.Observable'},requires:['Ext.AbstractComponent','Ext.Component','Ext.ComponentManager','Ext.ComponentQuery','Ext.util.HashMap','Ext.util.KeyNav'],enabled:false,focusElementCls:Ext.baseCSSPrefix+'focus-element',focusFrameCls:Ext.baseCSSPrefix+'focus-frame',whitelist:['textfield'],constructor:function(config){var me=this,CQ=Ext.ComponentQuery;me.mixins.observable.constructor.call(me,config);me.addEvents('beforecomponentfocus','componentfocus','disable','enable');me.focusTask=new Ext.util.DelayedTask(me.handleComponentFocus,me);Ext.override(Ext.AbstractComponent,{onFocus:function(){this.callParent(arguments);if(me.enabled&&this.hasFocus){Array.prototype.unshift.call(arguments,this);me.onComponentFocus.apply(me,arguments);}},onBlur:function(){this.callParent(arguments);if(me.enabled&&!this.hasFocus){Array.prototype.unshift.call(arguments,this);me.onComponentBlur.apply(me,arguments);}},onDestroy:function(){this.callParent(arguments);if(me.enabled){Array.prototype.unshift.call(arguments,this);me.onComponentDestroy.apply(me,arguments);}}});Ext.override(Ext.Component,{afterHide:function(){this.callParent(arguments);if(me.enabled){Array.prototype.unshift.call(arguments,this);me.onComponentHide.apply(me,arguments);}}});me.keyNav=new Ext.util.KeyNav(Ext.getDoc(),{disabled:true,scope:me,backspace:me.focusLast,enter:me.navigateIn,esc:me.navigateOut,tab:me.navigateSiblings,space:me.navigateIn,del:me.focusLast,left:me.navigateSiblings,right:me.navigateSiblings,down:me.navigateSiblings,up:me.navigateSiblings});me.focusData={};me.subscribers=new Ext.util.HashMap();me.focusChain={};Ext.apply(CQ.pseudos,{nextFocus:function(cmps,idx,step){step=step||1;idx=parseInt(idx,10);var len=cmps.length,i=idx,c;for(;;){if((i+=step)>=len){i=0;}else if(i<0){i=len-1;}
if(i===idx){return[];}
if((c=cmps[i]).isFocusable()){return[c];}}
return[];},prevFocus:function(cmps,idx){return this.nextFocus(cmps,idx,-1);},root:function(cmps){var len=cmps.length,results=[],i=0,c;for(;i<len;i++){c=cmps[i];if(!c.ownerCt){results.push(c);}}
return results;}});},addXTypeToWhitelist:function(xtype){var me=this;if(Ext.isArray(xtype)){Ext.Array.forEach(xtype,me.addXTypeToWhitelist,me);return;}
if(!Ext.Array.contains(me.whitelist,xtype)){me.whitelist.push(xtype);}},clearComponent:function(cmp){clearTimeout(this.cmpFocusDelay);if(!cmp.isDestroyed){cmp.blur();}},disable:function(){var me=this;if(!me.enabled){return;}
delete me.options;me.enabled=false;me.removeDOM();me.keyNav.disable();me.fireEvent('disable',me);},enable:function(options){var me=this;if(options===true){options={focusFrame:true};}
me.options=options=options||{};if(me.enabled){return;}
me.enabled=true;me.initDOM(options);me.keyNav.enable();me.focusEl.focus();delete me.focusedCmp;me.fireEvent('enable',me);},focusLast:function(e){var me=this;if(me.isWhitelisted(me.focusedCmp)){return true;}
if(me.previousFocusedCmp){me.previousFocusedCmp.focus();}},getRootComponents:function(){var CQ=Ext.ComponentQuery,inline=CQ.query(':focusable:root:not([floating])'),floating=CQ.query(':focusable:root[floating]');floating.sort(function(a,b){return a.el.getZIndex()>b.el.getZIndex();});return floating.concat(inline);},initDOM:function(options){var me=this,cls=me.focusFrameCls,needListeners=Ext.ComponentQuery.query('{getFocusEl()}:not([focusListenerAdded])'),i=0,len=needListeners.length;if(!Ext.isReady){return Ext.onReady(me.initDOM,me);}
for(;i<len;i++){needListeners[i].addFocusListener();}
if(!me.focusEl){me.focusEl=Ext.getBody();me.focusEl.dom.tabIndex=-1;}
if(!me.focusFrame&&options.focusFrame){me.focusFrame=Ext.getBody().createChild({cls:cls,children:[{cls:cls+'-top'},{cls:cls+'-bottom'},{cls:cls+'-left'},{cls:cls+'-right'}],style:'top: -100px; left: -100px;'});me.focusFrame.setVisibilityMode(Ext.Element.DISPLAY);me.focusFrame.hide().setLocalXY(0,0);}},isWhitelisted:function(cmp){return cmp&&Ext.Array.some(this.whitelist,function(x){return cmp.isXType(x);});},navigateIn:function(e){var me=this,focusedCmp=me.focusedCmp,defaultRoot,firstChild;if(me.isWhitelisted(focusedCmp)){return true;}
if(!focusedCmp){defaultRoot=me.getRootComponents()[0];if(defaultRoot){if(defaultRoot.getFocusEl()===me.focusEl){me.focusEl.blur();}
defaultRoot.focus();}}else{firstChild=focusedCmp.hasFocus?Ext.ComponentQuery.query('>:focusable',focusedCmp)[0]:focusedCmp;if(firstChild){firstChild.focus();}else{if(Ext.isFunction(focusedCmp.onClick)){e.button=0;focusedCmp.onClick(e);if(focusedCmp.isVisible(true)){focusedCmp.focus();}else{me.navigateOut();}}}}},navigateOut:function(e){var me=this,parent;if(!me.focusedCmp||!(parent=me.focusedCmp.up(':focusable'))){me.focusEl.focus();}else{parent.focus();}
return true;},navigateSiblings:function(e,source,parent){var me=this,src=source||me,key=e.getKey(),EO=Ext.EventObject,goBack=e.shiftKey||key==EO.LEFT||key==EO.UP,checkWhitelist=key==EO.LEFT||key==EO.RIGHT||key==EO.UP||key==EO.DOWN,nextSelector=goBack?'prev':'next',idx,next,focusedCmp,siblings;focusedCmp=(src.focusedCmp&&src.focusedCmp.comp)||src.focusedCmp;if(!focusedCmp&&!parent){return true;}
if(checkWhitelist&&me.isWhitelisted(focusedCmp)){return true;}
if(!focusedCmp||focusedCmp.is(':root')){siblings=me.getRootComponents();}else{parent=parent||focusedCmp.up();if(parent){siblings=parent.getRefItems();}}
if(siblings){idx=focusedCmp?Ext.Array.indexOf(siblings,focusedCmp):-1;next=Ext.ComponentQuery.query(':'+nextSelector+'Focus('+idx+')',siblings)[0];if(next&&focusedCmp!==next){next.focus();return next;}}},onComponentBlur:function(cmp,e){var me=this;if(me.focusedCmp===cmp){me.previousFocusedCmp=cmp;delete me.focusedCmp;}
if(me.focusFrame){me.focusFrame.hide();}},onComponentFocus:function(cmp,e){var me=this,chain=me.focusChain,parent;if(!cmp.isFocusable()){me.clearComponent(cmp);if(chain[cmp.id]){return;}
parent=cmp.up();if(parent){chain[cmp.id]=true;parent.focus();}
return;}
me.focusChain={};me.focusTask.delay(10,null,null,[cmp,cmp.getFocusEl()]);},handleComponentFocus:function(cmp,focusEl){var me=this,cls,ff,box,bt,bl,bw,bh,ft,fb,fl,fr;if(me.fireEvent('beforecomponentfocus',me,cmp,me.previousFocusedCmp)===false){me.clearComponent(cmp);return;}
me.focusedCmp=cmp;if(me.shouldShowFocusFrame(cmp)){cls='.'+me.focusFrameCls+'-';ff=me.focusFrame;box=(focusEl.dom?focusEl:focusEl.el).getBox();bt=box.top;bl=box.left;bw=box.width;bh=box.height;ft=ff.child(cls+'top');fb=ff.child(cls+'bottom');fl=ff.child(cls+'left');fr=ff.child(cls+'right');ft.setWidth(bw).setLocalXY(bl,bt);fb.setWidth(bw).setLocalXY(bl,bt+bh-2);fl.setHeight(bh-2).setLocalXY(bl,bt+2);fr.setHeight(bh-2).setLocalXY(bl+bw-2,bt+2);ff.show();}
me.fireEvent('componentfocus',me,cmp,me.previousFocusedCmp);},onComponentHide:function(cmp){var me=this,cmpHadFocus=false,focusedCmp=me.focusedCmp,parent;if(focusedCmp){cmpHadFocus=cmp.hasFocus||(cmp.isContainer&&cmp.isAncestor(me.focusedCmp));}
me.clearComponent(cmp);if(cmpHadFocus&&(parent=cmp.up(':focusable'))){parent.focus();}else{me.focusEl.focus();}},onComponentDestroy:function(){},removeDOM:function(){var me=this;if(me.enabled||me.subscribers.length){return;}
Ext.destroy(me.focusFrame);delete me.focusEl;delete me.focusFrame;},removeXTypeFromWhitelist:function(xtype){var me=this;if(Ext.isArray(xtype)){Ext.Array.forEach(xtype,me.removeXTypeFromWhitelist,me);return;}
Ext.Array.remove(me.whitelist,xtype);},setupSubscriberKeys:function(container,keys){var me=this,el=container.getFocusEl(),scope=keys.scope,handlers={backspace:me.focusLast,enter:me.navigateIn,esc:me.navigateOut,scope:me},navSiblings=function(e){if(me.focusedCmp===container){return me.navigateSiblings(e,me,container);}else{return me.navigateSiblings(e);}};Ext.iterate(keys,function(key,cb){handlers[key]=function(e){var ret=navSiblings(e);if(Ext.isFunction(cb)&&cb.call(scope||container,e,ret)===true){return true;}
return ret;};},me);return new Ext.util.KeyNav(el,handlers);},shouldShowFocusFrame:function(cmp){var me=this,opts=me.options||{};if(!me.focusFrame||!cmp){return false;}
if(opts.focusFrame){return true;}
if(me.focusData[cmp.id].focusFrame){return true;}
return false;}});Ext.define('Ext.menu.Item',{extend:'Ext.Component',alias:'widget.menuitem',alternateClassName:'Ext.menu.TextItem',mixins:{queryable:'Ext.Queryable'},activeCls:Ext.baseCSSPrefix+'menu-item-active',ariaRole:'menuitem',canActivate:true,clickHideDelay:0,destroyMenu:true,disabledCls:Ext.baseCSSPrefix+'menu-item-disabled',hideOnClick:true,isMenuItem:true,menuAlign:'tl-tr?',menuExpandDelay:200,menuHideDelay:200,tooltipType:'qtip',arrowCls:Ext.baseCSSPrefix+'menu-item-arrow',childEls:['itemEl','iconEl','textEl','arrowEl'],renderTpl:['<tpl if="plain">','{text}','<tpl else>','<a id="{id}-itemEl"',' class="'+Ext.baseCSSPrefix+'menu-item-link{childElCls}"',' href="{href}"','<tpl if="hrefTarget"> target="{hrefTarget}"</tpl>',' hidefocus="true"',' unselectable="on"','<tpl if="tabIndex">',' tabIndex="{tabIndex}"','</tpl>','>','<div role="img" id="{id}-iconEl" class="'+Ext.baseCSSPrefix+'menu-item-icon {iconCls}','{childElCls} {glyphCls}" style="<tpl if="icon">background-image:url({icon});</tpl>','<tpl if="glyph && glyphFontFamily">font-family:{glyphFontFamily};</tpl>">','<tpl if="glyph">&#{glyph};</tpl>','</div>','<span id="{id}-textEl" class="'+Ext.baseCSSPrefix+'menu-item-text" unselectable="on">{text}</span>','<img id="{id}-arrowEl" src="{blank}" class="{arrowCls}','{childElCls}"/>','</a>','</tpl>'],maskOnDisable:false,activate:function(){var me=this;if(!me.activated&&me.canActivate&&me.rendered&&!me.isDisabled()&&me.isVisible()){me.el.addCls(me.activeCls);me.focus();me.activated=true;me.fireEvent('activate',me);}},getFocusEl:function(){return this.itemEl;},deactivate:function(){var me=this;if(me.activated){me.el.removeCls(me.activeCls);me.blur();me.hideMenu();me.activated=false;me.fireEvent('deactivate',me);}},deferHideMenu:function(){if(this.menu.isVisible()){this.menu.hide();}},cancelDeferHide:function(){clearTimeout(this.hideMenuTimer);},deferHideParentMenus:function(){var ancestor;Ext.menu.Manager.hideAll();if(!Ext.Element.getActiveElement()){ancestor=this.up(':not([hidden])');if(ancestor){ancestor.focus();}}},expandMenu:function(delay){var me=this;if(me.menu){me.cancelDeferHide();if(delay===0){me.doExpandMenu();}else{clearTimeout(me.expandMenuTimer);me.expandMenuTimer=Ext.defer(me.doExpandMenu,Ext.isNumber(delay)?delay:me.menuExpandDelay,me);}}},doExpandMenu:function(){var me=this,menu=me.menu;if(me.activated&&(!menu.rendered||!menu.isVisible())){me.parentMenu.activeChild=menu;menu.parentItem=me;menu.parentMenu=me.parentMenu;menu.showBy(me,me.menuAlign);}},getRefItems:function(deep){var menu=this.menu,items;if(menu){items=menu.getRefItems(deep);items.unshift(menu);}
return items||[];},hideMenu:function(delay){var me=this;if(me.menu){clearTimeout(me.expandMenuTimer);me.hideMenuTimer=Ext.defer(me.deferHideMenu,Ext.isNumber(delay)?delay:me.menuHideDelay,me);}},initComponent:function(){var me=this,prefix=Ext.baseCSSPrefix,cls=[prefix+'menu-item'],menu;me.addEvents('activate','click','deactivate','textchange','iconchange');if(me.plain){cls.push(prefix+'menu-item-plain');}
if(me.cls){cls.push(me.cls);}
me.cls=cls.join(' ');if(me.menu){menu=me.menu;delete me.menu;me.setMenu(menu);}
me.callParent(arguments);},onClick:function(e){var me=this,clickHideDelay=me.clickHideDelay;if(!me.href){e.stopEvent();}
if(me.disabled){return;}
if(me.hideOnClick){if(!clickHideDelay){me.deferHideParentMenus();}else{me.deferHideParentMenusTimer=Ext.defer(me.deferHideParentMenus,clickHideDelay,me);}}
Ext.callback(me.handler,me.scope||me,[me,e]);me.fireEvent('click',me,e);if(!me.hideOnClick){me.focus();}},onRemoved:function(){var me=this;if(me.activated&&me.parentMenu.activeItem===me){me.parentMenu.deactivateActiveItem();}
me.callParent(arguments);me.parentMenu=me.ownerButton=null;},beforeDestroy:function(){var me=this;if(me.rendered){me.clearTip();}
me.callParent();},onDestroy:function(){var me=this;clearTimeout(me.expandMenuTimer);me.cancelDeferHide();clearTimeout(me.deferHideParentMenusTimer);me.setMenu(null);me.callParent(arguments);},beforeRender:function(){var me=this,blank=Ext.BLANK_IMAGE_URL,glyph=me.glyph,glyphFontFamily=Ext._glyphFontFamily,glyphParts,iconCls,arrowCls;me.callParent();if(me.iconAlign==='right'){iconCls=me.checkChangeDisabled?me.disabledCls:'';arrowCls=Ext.baseCSSPrefix+'menu-item-icon-right '+me.iconCls;}else{iconCls=(me.iconCls||'')+(me.checkChangeDisabled?' '+me.disabledCls:'');arrowCls=me.menu?me.arrowCls:'';}
if(typeof glyph==='string'){glyphParts=glyph.split('@');glyph=glyphParts[0];glyphFontFamily=glyphParts[1];}
Ext.applyIf(me.renderData,{href:me.href||'#',hrefTarget:me.hrefTarget,icon:me.icon,iconCls:iconCls,glyph:glyph,glyphCls:glyph?Ext.baseCSSPrefix+'menu-item-glyph':undefined,glyphFontFamily:glyphFontFamily,hasIcon:!!(me.icon||me.iconCls||glyph),iconAlign:me.iconAlign,plain:me.plain,text:me.text,arrowCls:arrowCls,blank:blank,tabIndex:me.tabIndex});},onRender:function(){var me=this;me.callParent(arguments);if(me.tooltip){me.setTooltip(me.tooltip,true);}},setMenu:function(menu,destroyMenu){var me=this,oldMenu=me.menu,arrowEl=me.arrowEl;if(oldMenu){delete oldMenu.parentItem;delete oldMenu.parentMenu;delete oldMenu.ownerItem;if(destroyMenu===true||(destroyMenu!==false&&me.destroyMenu)){Ext.destroy(oldMenu);}}
if(menu){me.menu=Ext.menu.Manager.get(menu);me.menu.ownerItem=me;}else{me.menu=null;}
if(me.rendered&&!me.destroying&&arrowEl){arrowEl[me.menu?'addCls':'removeCls'](me.arrowCls);}},setHandler:function(fn,scope){this.handler=fn||null;this.scope=scope;},setIcon:function(icon){var iconEl=this.iconEl,oldIcon=this.icon;if(iconEl){iconEl.src=icon||Ext.BLANK_IMAGE_URL;}
this.icon=icon;this.fireEvent('iconchange',this,oldIcon,icon);},setIconCls:function(iconCls){var me=this,iconEl=me.iconEl,oldCls=me.iconCls;if(iconEl){if(me.iconCls){iconEl.removeCls(me.iconCls);}
if(iconCls){iconEl.addCls(iconCls);}}
me.iconCls=iconCls;me.fireEvent('iconchange',me,oldCls,iconCls);},setText:function(text){var me=this,el=me.textEl||me.el,oldText=me.text;me.text=text;if(me.rendered){el.update(text||'');me.ownerCt.updateLayout();}
me.fireEvent('textchange',me,oldText,text);},getTipAttr:function(){return this.tooltipType=='qtip'?'data-qtip':'title';},clearTip:function(){if(Ext.quickTipsActive&&Ext.isObject(this.tooltip)){Ext.tip.QuickTipManager.unregister(this.itemEl);}},setTooltip:function(tooltip,initial){var me=this;if(me.rendered){if(!initial){me.clearTip();}
if(Ext.quickTipsActive&&Ext.isObject(tooltip)){Ext.tip.QuickTipManager.register(Ext.apply({target:me.itemEl.id},tooltip));me.tooltip=tooltip;}else{me.itemEl.dom.setAttribute(me.getTipAttr(),tooltip);}}else{me.tooltip=tooltip;}
return me;}});Ext.define('MP.desktop.Wallpaper',{extend:'Ext.Component',alias:'widget.wallpaper',cls:'mp-desktop-wallpaper',html:'<img src="'+Ext.BLANK_IMAGE_URL+'">',style:null,wallpaper:null,stateful:true,stateId:'desk-wallpaper',afterRender:function(){var me=this;me.callParent();me.setWallpaper(me.wallpaper,me.style);},applyState:function(){var me=this,old=me.wallpaper;me.callParent(arguments);if(old!=me.wallpaper){me.setWallpaper(me.wallpaper,me.style);}},getState:function(){return this.wallpaper&&{wallpaper:this.wallpaper,style:this.style};},setWallpaper:function(wallpaper,style){var me=this,imgEl,bkgnd;if(style){me.style=style;}
me.wallpaper=wallpaper;if(me.rendered){imgEl=me.el.dom.firstChild;if(!wallpaper||wallpaper==Ext.BLANK_IMAGE_URL){Ext.fly(imgEl).hide();}else if(me.style=='stretch'){imgEl.src=wallpaper;me.el.removeCls(['mp-desktop-wallpaper-tiled','mp-desktop-wallpaper-centered']);Ext.fly(imgEl).setStyle({width:'100%',height:'100%'}).show();}else if(me.style=='center'){Ext.fly(imgEl).hide();bkgnd='url('+wallpaper+')';me.el.removeCls('mp-desktop-wallpaper-tiled');me.el.addCls('mp-desktop-wallpaper-centered');}else{Ext.fly(imgEl).hide();bkgnd='url('+wallpaper+')';me.el.removeCls('mp-desktop-wallpaper-centered');me.el.addCls('mp-desktop-wallpaper-tiled');}
me.el.setStyle({backgroundImage:bkgnd||''});if(me.stateful){me.saveState();}}
return me;}});Ext.define('Ext.container.AbstractContainer',{extend:'Ext.Component',requires:['Ext.util.MixedCollection','Ext.layout.container.Auto','Ext.ZIndexManager'],mixins:{queryable:'Ext.Queryable'},renderTpl:'{%this.renderContainer(out,values)%}',suspendLayout:false,autoDestroy:true,defaultType:'panel',detachOnRemove:true,isContainer:true,layoutCounter:0,baseCls:Ext.baseCSSPrefix+'container',defaultLayoutType:'auto',initComponent:function(){var me=this;me.addEvents('afterlayout','beforeadd','beforeremove','add','remove');me.callParent();me.getLayout();me.initItems();},initItems:function(){var me=this,items=me.items;me.items=new Ext.util.AbstractMixedCollection(false,me.getComponentId);me.floatingItems=new Ext.util.MixedCollection(false,me.getComponentId);if(items){if(!Ext.isArray(items)){items=[items];}
me.add(items);}},getFocusEl:function(){return this.getTargetEl();},finishRenderChildren:function(){this.callParent();var layout=this.getLayout();if(layout){layout.finishRender();}},beforeRender:function(){var me=this,layout=me.getLayout(),targetCls;me.callParent();if(!layout.initialized){layout.initLayout();}
targetCls=layout.targetCls;if(targetCls){me.applyTargetCls(targetCls);}},applyTargetCls:function(targetCls){this.addCls(targetCls);},afterComponentLayout:function(){var floaters=this.floatingItems.items,floaterCount=floaters.length,i,floater
this.callParent(arguments);for(i=0;i<floaterCount;i++){floater=floaters[i];if(!floater.rendered&&floater.autoShow){floater.show();}}},onPosition:function(){this.callParent(arguments);this.repositionFloatingItems();},onResize:function(){this.callParent(arguments);this.repositionFloatingItems();},repositionFloatingItems:function(){var floaters=this.floatingItems.items,floaterCount=floaters.length,i,floater;for(i=0;i<floaterCount;i++){floater=floaters[i];if(floater.el&&!floater.hidden){floater.setPosition(floater.x,floater.y);}}},setupRenderTpl:function(renderTpl){this.callParent(arguments);this.getLayout().setupRenderTpl(renderTpl);},getDefaultContentTarget:function(){return this.el;},getContentTarget:function(){return this.getLayout().getContentTarget();},setLayout:function(layout){var currentLayout=this.layout;if(currentLayout&&currentLayout.isLayout&&currentLayout!=layout){currentLayout.setOwner(null);}
this.layout=layout;layout.setOwner(this);},getLayout:function(){var me=this;if(!me.layout||!me.layout.isLayout){me.setLayout(Ext.layout.Layout.create(me.layout,me.self.prototype.layout||me.defaultLayoutType));}
return me.layout;},doLayout:function(){this.updateLayout();return this;},afterLayout:function(layout){var me=this;++me.layoutCounter;if(me.hasListeners.afterlayout){me.fireEvent('afterlayout',me,layout);}},prepareItems:function(items,applyDefaults){if(Ext.isArray(items)){items=items.slice();}else{items=[items];}
var me=this,i=0,len=items.length,item;for(;i<len;i++){item=items[i];if(item==null){Ext.Array.erase(items,i,1);--i;--len;}else{if(applyDefaults){item=this.applyDefaults(item);}
item.isContained=me;items[i]=me.lookupComponent(item);delete item.isContained;delete items[i].isContained;}}
return items;},applyDefaults:function(config){var defaults=this.defaults;if(defaults){if(Ext.isFunction(defaults)){defaults=defaults.call(this,config);}
if(Ext.isString(config)){config=Ext.ComponentManager.get(config);}
Ext.applyIf(config,defaults);}
return config;},lookupComponent:function(comp){return(typeof comp=='string')?Ext.ComponentManager.get(comp):Ext.ComponentManager.create(comp,this.defaultType);},getComponentId:function(comp){return comp.getItemId&&comp.getItemId();},add:function(){var me=this,args=Ext.Array.slice(arguments),index=(typeof args[0]=='number')?args.shift():-1,layout=me.getLayout(),addingArray,items,i,length,item,pos,ret;if(args.length==1&&Ext.isArray(args[0])){items=args[0];addingArray=true;}else{items=args;}
if(me.rendered){Ext.suspendLayouts();}
ret=items=me.prepareItems(items,true);length=items.length;if(!addingArray&&length==1){ret=items[0];}
for(i=0;i<length;i++){item=items[i];pos=(index<0)?me.items.length:(index+i);if(item.floating){me.floatingItems.add(item);item.onAdded(me,pos);if(me.hasListeners.add){me.fireEvent('add',me,item,pos);}}else if((!me.hasListeners.beforeadd||me.fireEvent('beforeadd',me,item,pos)!==false)&&me.onBeforeAdd(item)!==false){me.items.insert(pos,item);item.onAdded(me,pos);me.onAdd(item,pos);layout.onAdd(item,pos);if(me.hasListeners.add){me.fireEvent('add',me,item,pos);}}}
me.updateLayout();if(me.rendered){Ext.resumeLayouts(true);}
return ret;},onAdd:Ext.emptyFn,onRemove:Ext.emptyFn,insert:function(index,comp){var compIdx;if(comp&&comp.isComponent){compIdx=this.items.indexOf(comp);if(compIdx!==-1){return this.move(compIdx,index);}}
return this.add(index,comp);},move:function(fromIdx,toIdx){var items=this.items,item;if(fromIdx.isComponent){fromIdx=items.indexOf(fromIdx);}
item=items.removeAt(fromIdx);if(item===false){return false;}
items.insert(toIdx,item);this.onMove(item,fromIdx,toIdx);this.updateLayout();return item;},onMove:Ext.emptyFn,onBeforeAdd:function(item){if(item.ownerCt&&item.ownerCt!==this){item.ownerCt.remove(item,false);}},remove:function(comp,autoDestroy){var me=this,c=me.getComponent(comp);if(c&&(!me.hasListeners.beforeremove||me.fireEvent('beforeremove',me,c)!==false)){me.doRemove(c,autoDestroy);if(me.hasListeners.remove){me.fireEvent('remove',me,c);}
if(!me.destroying&&!c.floating){me.updateLayout();}}
return c;},doRemove:function(component,doDestroy){doDestroy=doDestroy===true||(doDestroy!==false&&this.autoDestroy);var me=this,layout=me.layout,hasLayout=layout&&me.rendered,isDestroying=component.destroying||doDestroy,floating=component.floating;if(floating){me.floatingItems.remove(component);}else{me.items.remove(component);}
if(hasLayout&&!floating){if(layout.running){Ext.AbstractComponent.cancelLayout(component,isDestroying);}
layout.onRemove(component,isDestroying);}
component.onRemoved(isDestroying);me.onRemove(component,isDestroying);if(doDestroy){component.destroy();}
else{if(hasLayout&&!floating){layout.afterRemove(component);}
if(me.detachOnRemove&&component.rendered){me.detachComponent(component);}}},detachComponent:function(component){Ext.getDetachedBody().appendChild(component.getEl());},removeAll:function(autoDestroy){var me=this,removeItems=me.items.items.slice().concat(me.floatingItems.items),items=[],i=0,len=removeItems.length,item;me.suspendLayouts();for(;i<len;i++){item=removeItems[i];me.remove(item,autoDestroy);if(item.ownerCt!==me){items.push(item);}}
me.resumeLayouts(!!len);return items;},getRefItems:function(deep){var me=this,items=me.items.items,len=items.length,i=0,item,result=[];for(;i<len;i++){item=items[i];result[result.length]=item;if(deep&&item.getRefItems){result.push.apply(result,item.getRefItems(true));}}
items=me.floatingItems.items;len=items.length;for(i=0;i<len;i++){item=items[i];result[result.length]=item;if(deep&&item.getRefItems){result.push.apply(result,item.getRefItems(true));}}
return result;},cascade:function(fn,scope,origArgs){var me=this,cs=me.items?me.items.items:[],len=cs.length,i=0,c,args=origArgs?origArgs.concat(me):[me],componentIndex=args.length-1;if(fn.apply(scope||me,args)!==false){for(;i<len;i++){c=cs[i];if(c.cascade){c.cascade(fn,scope,origArgs);}else{args[componentIndex]=c;fn.apply(scope||cs,args);}}}
return this;},isAncestor:function(possibleDescendant){while(possibleDescendant){if(possibleDescendant.ownerCt===this){return true;}
possibleDescendant=possibleDescendant.ownerCt;}},getComponent:function(comp){if(Ext.isObject(comp)){comp=comp.getItemId();}
var c=this.items.get(comp);if(!c&&typeof comp!='number'){c=this.floatingItems.get(comp);}
return c;},contains:function(comp,deep){var result=false;if(deep){this.cascade(function(c){if(c.contains&&c.contains(comp)){result=true;return false;}});return result;}else{return this.items.contains(comp)||this.floatingItems.contains(comp);}},nextChild:function(child,selector){var me=this,result,childIndex=me.items.indexOf(child);if(childIndex!==-1){result=selector?Ext.ComponentQuery(selector,me.items.items.slice(childIndex+1)):me.items.getAt(childIndex+1);if(!result&&me.ownerCt){result=me.ownerCt.nextChild(me,selector);}}
return result;},prevChild:function(child,selector){var me=this,result,childIndex=me.items.indexOf(child);if(childIndex!==-1){result=selector?Ext.ComponentQuery(selector,me.items.items.slice(childIndex+1)):me.items.getAt(childIndex+1);if(!result&&me.ownerCt){result=me.ownerCt.nextChild(me,selector);}}
return result;},enable:function(){this.callParent(arguments);var itemsToDisable=this.getChildItemsToDisable(),length=itemsToDisable.length,item,i;for(i=0;i<length;i++){item=itemsToDisable[i];if(item.resetDisable){item.enable();}}
return this;},disable:function(){this.callParent(arguments);var itemsToDisable=this.getChildItemsToDisable(),length=itemsToDisable.length,item,i;for(i=0;i<length;i++){item=itemsToDisable[i];if(item.resetDisable!==false&&!item.disabled){item.disable();item.resetDisable=true;}}
return this;},getChildItemsToDisable:function(){return this.query('[isFormField],button');},beforeDestroy:function(){var me=this,items=me.items,floatingItems=me.floatingItems,c;if(items){while((c=items.first())){me.doRemove(c,true);}}
if(floatingItems){while((c=floatingItems.first())){me.doRemove(c,true);}}
Ext.destroy(me.layout);me.callParent();}});Ext.define('SoL.component.IFrame',{extend:'Ext.Component',alias:'widget.iframe',loadMask:_('Loading…'),src:'about:blank',renderTpl:['<iframe src="{src}" name="{frameName}" width="100%" height="100%" frameborder="0">','</iframe>'],initComponent:function(){this.callParent();this.frameName=this.frameName||this.id+'-frame';this.addEvents('beforeload','load');Ext.apply(this.renderSelectors,{iframeEl:'iframe'});},initEvents:function(){var me=this;me.callParent();me.iframeEl.on('load',me.onLoad,me);},initRenderData:function(){return Ext.apply(this.callParent(),{src:this.src,frameName:this.frameName});},getBody:function(){var doc=this.getDoc();return doc.body||doc.documentElement;},getDoc:function(){try{return this.getWin().document;}catch(ex){return null;}},getWin:function(){var me=this;return Ext.isIE?me.iframeEl.dom.contentWindow:window.frames[me.frameName];},getFrame:function(){var me=this;return me.iframeEl.dom;},beforeDestroy:function(){this.cleanupListeners(true);this.callParent();},cleanupListeners:function(destroying){var doc,prop;if(this.rendered){try{doc=this.getDoc();if(doc){Ext.EventManager.removeAll(doc);if(destroying){for(prop in doc){if(doc.hasOwnProperty&&doc.hasOwnProperty(prop)){delete doc[prop];}}}}}catch(e){}}},onLoad:function(){var me=this,doc=me.getDoc(),fn=me.onRelayedEvent;if(doc){try{Ext.EventManager.removeAll(doc);Ext.EventManager.on(doc,{mousedown:fn,mousemove:fn,mouseup:fn,click:fn,dblclick:fn,scope:me});}catch(e){}
Ext.EventManager.on(this.getWin(),'beforeunload',me.cleanupListeners,me);this.el.unmask();this.fireEvent('load',this);}else if(me.src&&me.src!==''){this.el.unmask();this.fireEvent('error',this);}},onRelayedEvent:function(event){var iframeEl=this.iframeEl,iframeXY=Ext.Element.getTrueXY(iframeEl),originalEventXY=event.getXY(),eventXY=Ext.EventManager.getPageXY(event.browserEvent);event.xy=[iframeXY[0]+eventXY[0],iframeXY[1]+eventXY[1]];event.injectEvent(iframeEl);event.xy=originalEventXY;},load:function(src){var me=this,text=me.loadMask,frame=me.getFrame();if(me.fireEvent('beforeload',me,src)!==false){if(text&&me.el){me.el.mask(text);}
frame.src=me.src=(src||me.src);}}});Ext.define('Ext.toolbar.Item',{extend:'Ext.Component',alias:'widget.tbitem',alternateClassName:'Ext.Toolbar.Item',enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.define('Ext.toolbar.Spacer',{extend:'Ext.Component',alias:'widget.tbspacer',alternateClassName:'Ext.Toolbar.Spacer',baseCls:Ext.baseCSSPrefix+'toolbar-spacer',focusable:false});Ext.define('Ext.dd.StatusProxy',{extend:'Ext.Component',animRepair:false,childEls:['ghost'],renderTpl:['<div class="'+Ext.baseCSSPrefix+'dd-drop-icon"></div>'+'<div id="{id}-ghost" class="'+Ext.baseCSSPrefix+'dd-drag-ghost"></div>'],repairCls:Ext.baseCSSPrefix+'dd-drag-repair',constructor:function(config){var me=this;config=config||{};Ext.apply(me,{hideMode:'visibility',hidden:true,floating:true,id:me.id||Ext.id(),cls:Ext.baseCSSPrefix+'dd-drag-proxy '+this.dropNotAllowed,shadow:config.shadow||false,renderTo:Ext.getDetachedBody()});me.callParent(arguments);this.dropStatus=this.dropNotAllowed;},dropAllowed:Ext.baseCSSPrefix+'dd-drop-ok',dropNotAllowed:Ext.baseCSSPrefix+'dd-drop-nodrop',setStatus:function(cssClass){cssClass=cssClass||this.dropNotAllowed;if(this.dropStatus!=cssClass){this.el.replaceCls(this.dropStatus,cssClass);this.dropStatus=cssClass;}},reset:function(clearGhost){var me=this,clsPrefix=Ext.baseCSSPrefix+'dd-drag-proxy ';me.el.replaceCls(clsPrefix+me.dropAllowed,clsPrefix+me.dropNotAllowed);me.dropStatus=me.dropNotAllowed;if(clearGhost){me.ghost.update('');}},update:function(html){if(typeof html=="string"){this.ghost.update(html);}else{this.ghost.update("");html.style.margin="0";this.ghost.dom.appendChild(html);}
var el=this.ghost.dom.firstChild;if(el){Ext.fly(el).setStyle('float','none');}},getGhost:function(){return this.ghost;},hide:function(clear){this.callParent();if(clear){this.reset(true);}},stop:function(){if(this.anim&&this.anim.isAnimated&&this.anim.isAnimated()){this.anim.stop();}},sync:function(){this.el.sync();},repair:function(xy,callback,scope){var me=this;me.callback=callback;me.scope=scope;if(xy&&me.animRepair!==false){me.el.addCls(me.repairCls);me.el.hideUnders(true);me.anim=me.el.animate({duration:me.repairDuration||500,easing:'ease-out',to:{x:xy[0],y:xy[1]},stopAnimation:true,callback:me.afterRepair,scope:me});}else{me.afterRepair();}},afterRepair:function(){var me=this;me.hide(true);me.el.removeCls(me.repairCls);if(typeof me.callback=="function"){me.callback.call(me.scope||me);}
delete me.callback;delete me.scope;}});Ext.define('Ext.picker.Color',{extend:'Ext.Component',requires:'Ext.XTemplate',alias:'widget.colorpicker',alternateClassName:'Ext.ColorPalette',componentCls:Ext.baseCSSPrefix+'color-picker',selectedCls:Ext.baseCSSPrefix+'color-picker-selected',itemCls:Ext.baseCSSPrefix+'color-picker-item',value:null,clickEvent:'click',allowReselect:false,colors:['000000','993300','333300','003300','003366','000080','333399','333333','800000','FF6600','808000','008000','008080','0000FF','666699','808080','FF0000','FF9900','99CC00','339966','33CCCC','3366FF','800080','969696','FF00FF','FFCC00','FFFF00','00FF00','00FFFF','00CCFF','993366','C0C0C0','FF99CC','FFCC99','FFFF99','CCFFCC','CCFFFF','99CCFF','CC99FF','FFFFFF'],colorRe:/(?:^|\s)color-(.{6})(?:\s|$)/,renderTpl:['<tpl for="colors">','<a href="#" class="color-{.} {parent.itemCls}" hidefocus="on">','<span class="{parent.itemCls}-inner" style="background:#{.}">&#160;</span>','</a>','</tpl>'],initComponent:function(){var me=this;me.callParent(arguments);me.addEvents('select');if(me.handler){me.on('select',me.handler,me.scope,true);}},initRenderData:function(){var me=this;return Ext.apply(me.callParent(),{itemCls:me.itemCls,colors:me.colors});},onRender:function(){var me=this,clickEvent=me.clickEvent;me.callParent(arguments);me.mon(me.el,clickEvent,me.handleClick,me,{delegate:'a'});if(clickEvent!='click'){me.mon(me.el,'click',Ext.emptyFn,me,{delegate:'a',stopEvent:true});}},afterRender:function(){var me=this,value;me.callParent(arguments);if(me.value){value=me.value;me.value=null;me.select(value,true);}},handleClick:function(event,target){var me=this,color;event.stopEvent();if(!me.disabled){color=target.className.match(me.colorRe)[1];me.select(color.toUpperCase());}},select:function(color,suppressEvent){var me=this,selectedCls=me.selectedCls,value=me.value,el;color=color.replace('#','');if(!me.rendered){me.value=color;return;}
if(color!=value||me.allowReselect){el=me.el;if(me.value){el.down('a.color-'+value).removeCls(selectedCls);}
el.down('a.color-'+color).addCls(selectedCls);me.value=color;if(suppressEvent!==true){me.fireEvent('select',me,color);}}},clear:function(){var me=this,value=me.value,el;if(value&&me.rendered){el=me.el.down('a.color-'+value);el.removeCls(me.selectedCls);}
me.value=null;},getValue:function(){return this.value||null;}});Ext.define('Ext.form.field.Hidden',{extend:'Ext.form.field.Base',alias:['widget.hiddenfield','widget.hidden'],alternateClassName:'Ext.form.Hidden',inputType:'hidden',hideLabel:true,hidden:true,initComponent:function(){this.formItemCls+='-hidden';this.callParent();},isEqual:function(value1,value2){return this.isEqualAsString(value1,value2);},initEvents:Ext.emptyFn,setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.define('Ext.container.Container',{extend:'Ext.container.AbstractContainer',alias:'widget.container',alternateClassName:'Ext.Container',getChildByElement:function(el,deep){var item,itemEl,i=0,it=this.getRefItems(),ln=it.length;el=Ext.getDom(el);for(;i<ln;i++){item=it[i];itemEl=item.getEl();if(itemEl&&((itemEl.dom===el)||itemEl.contains(el))){return(deep&&item.getChildByElement)?item.getChildByElement(el,deep):item;}}
return null;}});Ext.define('Ext.app.EventBus',{singleton:true,requires:['Ext.app.domain.Component'],constructor:function(){var me=this,domains=Ext.app.EventDomain.instances;me.callParent();me.domains=domains;me.bus=domains.component.bus;},control:function(selectors,controller){return this.domains.component.listen(selectors,controller);},listen:function(to,controller){var domains=this.domains,domain;for(domain in to){if(to.hasOwnProperty(domain)){domains[domain].listen(to[domain],controller);}}},unlisten:function(controllerId){var domains=Ext.app.EventDomain.instances,domain;for(domain in domains){domains[domain].unlisten(controllerId);}}});Ext.define('Ext.dd.DragSource',{extend:'Ext.dd.DDProxy',requires:['Ext.dd.StatusProxy','Ext.dd.DragDropManager'],dropAllowed:Ext.baseCSSPrefix+'dd-drop-ok',dropNotAllowed:Ext.baseCSSPrefix+'dd-drop-nodrop',animRepair:true,repairHighlightColor:'c3daf9',constructor:function(el,config){this.el=Ext.get(el);if(!this.dragData){this.dragData={};}
Ext.apply(this,config);if(!this.proxy){this.proxy=new Ext.dd.StatusProxy({id:this.el.id+'-drag-status-proxy',animRepair:this.animRepair});}
this.callParent([this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:false,isTarget:false,scroll:this.scroll===true}]);this.dragging=false;},getDragData:function(e){return this.dragData;},onDragEnter:function(e,id){var target=Ext.dd.DragDropManager.getDDById(id),status;this.cachedTarget=target;if(this.beforeDragEnter(target,e,id)!==false){if(target.isNotifyTarget){status=target.notifyEnter(this,e,this.dragData);this.proxy.setStatus(status);}else{this.proxy.setStatus(this.dropAllowed);}
if(this.afterDragEnter){this.afterDragEnter(target,e,id);}}},beforeDragEnter:function(target,e,id){return true;},onDragOver:function(e,id){var target=this.cachedTarget||Ext.dd.DragDropManager.getDDById(id),status;if(this.beforeDragOver(target,e,id)!==false){if(target.isNotifyTarget){status=target.notifyOver(this,e,this.dragData);this.proxy.setStatus(status);}
if(this.afterDragOver){this.afterDragOver(target,e,id);}}},beforeDragOver:function(target,e,id){return true;},onDragOut:function(e,id){var target=this.cachedTarget||Ext.dd.DragDropManager.getDDById(id);if(this.beforeDragOut(target,e,id)!==false){if(target.isNotifyTarget){target.notifyOut(this,e,this.dragData);}
this.proxy.reset();if(this.afterDragOut){this.afterDragOut(target,e,id);}}
this.cachedTarget=null;},beforeDragOut:function(target,e,id){return true;},onDragDrop:function(e,id){var target=this.cachedTarget||Ext.dd.DragDropManager.getDDById(id);if(this.beforeDragDrop(target,e,id)!==false){if(target.isNotifyTarget){if(target.notifyDrop(this,e,this.dragData)!==false){this.onValidDrop(target,e,id);}else{this.onInvalidDrop(target,e,id);}}else{this.onValidDrop(target,e,id);}
if(this.afterDragDrop){this.afterDragDrop(target,e,id);}}
delete this.cachedTarget;},beforeDragDrop:function(target,e,id){return true;},onValidDrop:function(target,e,id){this.hideProxy();if(this.afterValidDrop){this.afterValidDrop(target,e,id);}},getRepairXY:function(e,data){return this.el.getXY();},onInvalidDrop:function(target,e,id){var me=this;if(!e){e=target;target=null;id=e.getTarget().id;}
if(me.beforeInvalidDrop(target,e,id)!==false){if(me.cachedTarget){if(me.cachedTarget.isNotifyTarget){me.cachedTarget.notifyOut(me,e,me.dragData);}
me.cacheTarget=null;}
me.proxy.repair(me.getRepairXY(e,me.dragData),me.afterRepair,me);if(me.afterInvalidDrop){me.afterInvalidDrop(e,id);}}},afterRepair:function(){var me=this;if(Ext.enableFx){me.el.highlight(me.repairHighlightColor);}
me.dragging=false;},beforeInvalidDrop:function(target,e,id){return true;},handleMouseDown:function(e){if(this.dragging){return;}
var data=this.getDragData(e);if(data&&this.onBeforeDrag(data,e)!==false){this.dragData=data;this.proxy.stop();this.callParent(arguments);}},onBeforeDrag:function(data,e){return true;},onStartDrag:Ext.emptyFn,alignElWithMouse:function(){this.proxy.ensureAttachedToBody(true);return this.callParent(arguments);},startDrag:function(x,y){this.proxy.reset();this.proxy.hidden=false;this.dragging=true;this.proxy.update("");this.onInitDrag(x,y);this.proxy.show();},onInitDrag:function(x,y){var clone=this.el.dom.cloneNode(true);clone.id=Ext.id();this.proxy.update(clone);this.onStartDrag(x,y);return true;},getProxy:function(){return this.proxy;},hideProxy:function(){this.proxy.hide();this.proxy.reset(true);this.dragging=false;},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups);},b4EndDrag:function(e){},endDrag:function(e){this.onEndDrag(this.dragData,e);},onEndDrag:function(data,e){},autoOffset:function(x,y){this.setDelta(-12,-20);},destroy:function(){this.callParent();Ext.destroy(this.proxy);}});Ext.define('Ext.form.field.Checkbox',{extend:'Ext.form.field.Base',alias:['widget.checkboxfield','widget.checkbox'],alternateClassName:'Ext.form.Checkbox',requires:['Ext.XTemplate','Ext.form.CheckboxManager'],componentLayout:'field',stretchInputElFixed:false,childEls:['boxLabelEl'],fieldSubTpl:['<tpl if="boxLabel && boxLabelAlign == \'before\'">','{beforeBoxLabelTpl}','<label id="{cmpId}-boxLabelEl" {boxLabelAttrTpl} class="{boxLabelCls} {boxLabelCls}-{boxLabelAlign}" for="{id}">','{beforeBoxLabelTextTpl}','{boxLabel}','{afterBoxLabelTextTpl}','</label>','{afterBoxLabelTpl}','</tpl>','<input type="{inputTypeAttr}" id="{id}" {inputAttrTpl}','<tpl if="tabIdx"> tabIndex="{tabIdx}"</tpl>','<tpl if="disabled"> disabled="disabled"</tpl>','<tpl if="fieldStyle"> style="{fieldStyle}"</tpl>','<tpl if="ariaAttrs"> {ariaAttrs}</tpl>',' class="{fieldCls} {typeCls} {inputCls} {childElCls}" autocomplete="off" hidefocus="true" />','<tpl if="boxLabel && boxLabelAlign == \'after\'">','{beforeBoxLabelTpl}','<label id="{cmpId}-boxLabelEl" {boxLabelAttrTpl} class="{boxLabelCls} {boxLabelCls}-{boxLabelAlign}" for="{id}">','{beforeBoxLabelTextTpl}','{boxLabel}','{afterBoxLabelTextTpl}','</label>','{afterBoxLabelTpl}','</tpl>',{disableFormats:true,compiled:true}],subTplInsertions:['beforeBoxLabelTpl','afterBoxLabelTpl','beforeBoxLabelTextTpl','afterBoxLabelTextTpl','boxLabelAttrTpl','inputAttrTpl'],isCheckbox:true,focusCls:'form-checkbox-focus',extraFieldBodyCls:Ext.baseCSSPrefix+'form-cb-wrap',checked:false,checkedCls:Ext.baseCSSPrefix+'form-cb-checked',boxLabelCls:Ext.baseCSSPrefix+'form-cb-label',boxLabelAlign:'after',inputValue:'on',checkChangeEvents:[],inputType:'checkbox',inputTypeAttr:'button',onRe:/^on$/i,inputCls:Ext.baseCSSPrefix+'form-cb',initComponent:function(){this.callParent(arguments);this.getManager().add(this);},initValue:function(){var me=this,checked=!!me.checked;me.originalValue=me.lastValue=checked;me.setValue(checked);},getElConfig:function(){var me=this;if(me.isChecked(me.rawValue,me.inputValue)){me.addCls(me.checkedCls);}
return me.callParent();},getFieldStyle:function(){return Ext.isObject(this.fieldStyle)?Ext.DomHelper.generateStyles(this.fieldStyle):this.fieldStyle||'';},getSubTplData:function(){var me=this;return Ext.apply(me.callParent(),{disabled:me.readOnly||me.disabled,boxLabel:me.boxLabel,boxLabelCls:me.boxLabelCls,boxLabelAlign:me.boxLabelAlign,inputTypeAttr:me.inputTypeAttr});},initEvents:function(){var me=this;me.callParent();me.mon(me.inputEl,'click',me.onBoxClick,me);},setBoxLabel:function(boxLabel){var me=this;me.boxLabel=boxLabel;if(me.rendered){me.boxLabelEl.update(boxLabel);}},onBoxClick:function(e){var me=this;if(!me.disabled&&!me.readOnly){this.setValue(!this.checked);}},getRawValue:function(){return this.checked;},getValue:function(){return this.checked;},getSubmitValue:function(){var unchecked=this.uncheckedValue,uncheckedVal=Ext.isDefined(unchecked)?unchecked:null;return this.checked?this.inputValue:uncheckedVal;},isChecked:function(rawValue,inputValue){return(rawValue===true||rawValue==='true'||rawValue==='1'||rawValue===1||(((Ext.isString(rawValue)||Ext.isNumber(rawValue))&&inputValue)?rawValue==inputValue:this.onRe.test(rawValue)));},setRawValue:function(value){var me=this,inputEl=me.inputEl,checked=me.isChecked(value,me.inputValue);if(inputEl){me[checked?'addCls':'removeCls'](me.checkedCls);}
me.checked=me.rawValue=checked;return checked;},setValue:function(checked){var me=this,boxes,i,len,box;if(Ext.isArray(checked)){boxes=me.getManager().getByName(me.name,me.getFormId()).items;len=boxes.length;for(i=0;i<len;++i){box=boxes[i];box.setValue(Ext.Array.contains(checked,box.inputValue));}}else{me.callParent(arguments);}
return me;},valueToRaw:function(value){return value;},onChange:function(newVal,oldVal){var me=this,handler=me.handler;if(handler){handler.call(me.scope||me,me,newVal);}
me.callParent(arguments);},resetOriginalValue:function(fromBoxInGroup){var me=this,boxes,box,len,i;if(!fromBoxInGroup){boxes=me.getManager().getByName(me.name,me.getFormId()).items;len=boxes.length;for(i=0;i<len;++i){box=boxes[i];if(box!==me){boxes[i].resetOriginalValue(true);}}}
me.callParent();},beforeDestroy:function(){this.callParent();this.getManager().removeAtKey(this.id);},getManager:function(){return Ext.form.CheckboxManager;},onEnable:function(){var me=this,inputEl=me.inputEl;me.callParent();if(inputEl){inputEl.dom.disabled=me.readOnly;}},setReadOnly:function(readOnly){var me=this,inputEl=me.inputEl;if(inputEl){inputEl.dom.disabled=!!readOnly||me.disabled;}
me.callParent(arguments);},getFormId:function(){var me=this,form;if(!me.formId){form=me.up('form');if(form){me.formId=form.id;}}
return me.formId;}});Ext.define('Ext.picker.Month',{extend:'Ext.Component',requires:['Ext.XTemplate','Ext.util.ClickRepeater','Ext.Date','Ext.button.Button'],alias:'widget.monthpicker',alternateClassName:'Ext.MonthPicker',childEls:['bodyEl','prevEl','nextEl','buttonsEl','monthEl','yearEl'],renderTpl:['<div id="{id}-bodyEl" class="{baseCls}-body">','<div id="{id}-monthEl" class="{baseCls}-months">','<tpl for="months">','<div class="{parent.baseCls}-item {parent.baseCls}-month">','<a style="{parent.monthStyle}" hidefocus="on" class="{parent.baseCls}-item-inner" href="#">{.}</a>','</div>','</tpl>','</div>','<div id="{id}-yearEl" class="{baseCls}-years">','<div class="{baseCls}-yearnav">','<div class="{baseCls}-yearnav-button-ct">','<a id="{id}-prevEl" class="{baseCls}-yearnav-button {baseCls}-yearnav-prev" href="#" hidefocus="on" ></a>','</div>','<div class="{baseCls}-yearnav-button-ct">','<a id="{id}-nextEl" class="{baseCls}-yearnav-button {baseCls}-yearnav-next" href="#" hidefocus="on" ></a>','</div>','</div>','<tpl for="years">','<div class="{parent.baseCls}-item {parent.baseCls}-year">','<a hidefocus="on" class="{parent.baseCls}-item-inner" href="#">{.}</a>','</div>','</tpl>','</div>','<div class="'+Ext.baseCSSPrefix+'clear"></div>','</div>','<tpl if="showButtons">','<div id="{id}-buttonsEl" class="{baseCls}-buttons">{%','var me=values.$comp, okBtn=me.okBtn, cancelBtn=me.cancelBtn;','okBtn.ownerLayout = cancelBtn.ownerLayout = me.componentLayout;','okBtn.ownerCt = cancelBtn.ownerCt = me;','Ext.DomHelper.generateMarkup(okBtn.getRenderTree(), out);','Ext.DomHelper.generateMarkup(cancelBtn.getRenderTree(), out);','%}</div>','</tpl>'],okText:'OK',cancelText:'Cancel',baseCls:Ext.baseCSSPrefix+'monthpicker',showButtons:true,measureWidth:35,measureMaxHeight:20,smallCls:Ext.baseCSSPrefix+'monthpicker-small',totalYears:10,yearOffset:5,monthOffset:6,initComponent:function(){var me=this;me.selectedCls=me.baseCls+'-selected';me.addEvents('cancelclick','monthclick','monthdblclick','okclick','select','yearclick','yeardblclick');if(me.small){me.addCls(me.smallCls);}
me.setValue(me.value);me.activeYear=me.getYear(new Date().getFullYear()-4,-4);if(me.showButtons){me.okBtn=new Ext.button.Button({text:me.okText,handler:me.onOkClick,scope:me});me.cancelBtn=new Ext.button.Button({text:me.cancelText,handler:me.onCancelClick,scope:me});}
this.callParent();},beforeRender:function(){var me=this,i=0,months=[],shortName=Ext.Date.getShortMonthName,monthLen=me.monthOffset,margin=me.monthMargin,style='';me.callParent();for(;i<monthLen;++i){months.push(shortName(i),shortName(i+monthLen));}
if(Ext.isDefined(margin)){style='margin: 0 '+margin+'px;';}
Ext.apply(me.renderData,{months:months,years:me.getYears(),showButtons:me.showButtons,monthStyle:style});},afterRender:function(){var me=this,body=me.bodyEl,buttonsEl=me.buttonsEl;me.callParent();me.mon(body,'click',me.onBodyClick,me);me.mon(body,'dblclick',me.onBodyClick,me);me.years=body.select('.'+me.baseCls+'-year a');me.months=body.select('.'+me.baseCls+'-month a');me.backRepeater=new Ext.util.ClickRepeater(me.prevEl,{handler:Ext.Function.bind(me.adjustYear,me,[-me.totalYears])});me.prevEl.addClsOnOver(me.baseCls+'-yearnav-prev-over');me.nextRepeater=new Ext.util.ClickRepeater(me.nextEl,{handler:Ext.Function.bind(me.adjustYear,me,[me.totalYears])});me.nextEl.addClsOnOver(me.baseCls+'-yearnav-next-over');me.updateBody();if(!Ext.isDefined(me.monthMargin)){Ext.picker.Month.prototype.monthMargin=me.calculateMonthMargin();}},calculateMonthMargin:function(){var me=this,monthEl=me.monthEl,months=me.months,first=months.first(),itemMargin=first.getMargin('l');while(itemMargin&&me.getLargest()>me.measureMaxHeight){--itemMargin;months.setStyle('margin','0 '+itemMargin+'px');}
return itemMargin;},getLargest:function(months){var largest=0;this.months.each(function(item){var h=item.getHeight();if(h>largest){largest=h;}});return largest;},setValue:function(value){var me=this,active=me.activeYear,offset=me.monthOffset,year,index;if(!value){me.value=[null,null];}else if(Ext.isDate(value)){me.value=[value.getMonth(),value.getFullYear()];}else{me.value=[value[0],value[1]];}
if(me.rendered){year=me.value[1];if(year!==null){if((year<active||year>active+me.yearOffset)){me.activeYear=year-me.yearOffset+1;}}
me.updateBody();}
return me;},getValue:function(){return this.value;},hasSelection:function(){var value=this.value;return value[0]!==null&&value[1]!==null;},getYears:function(){var me=this,offset=me.yearOffset,start=me.activeYear,end=start+offset,i=start,years=[];for(;i<end;++i){years.push(i,i+offset);}
return years;},updateBody:function(){var me=this,years=me.years,months=me.months,yearNumbers=me.getYears(),cls=me.selectedCls,value=me.getYear(null),month=me.value[0],monthOffset=me.monthOffset,year,yearItems,y,yLen,el;if(me.rendered){years.removeCls(cls);months.removeCls(cls);yearItems=years.elements;yLen=yearItems.length;for(y=0;y<yLen;y++){el=Ext.fly(yearItems[y]);year=yearNumbers[y];el.dom.innerHTML=year;if(year==value){el.addCls(cls);}}
if(month!==null){if(month<monthOffset){month=month*2;}else{month=(month-monthOffset)*2+1;}
months.item(month).addCls(cls);}}},getYear:function(defaultValue,offset){var year=this.value[1];offset=offset||0;return year===null?defaultValue:year+offset;},onBodyClick:function(e,t){var me=this,isDouble=e.type=='dblclick';if(e.getTarget('.'+me.baseCls+'-month')){e.stopEvent();me.onMonthClick(t,isDouble);}else if(e.getTarget('.'+me.baseCls+'-year')){e.stopEvent();me.onYearClick(t,isDouble);}},adjustYear:function(offset){if(typeof offset!='number'){offset=this.totalYears;}
this.activeYear+=offset;this.updateBody();},onOkClick:function(){this.fireEvent('okclick',this,this.value);},onCancelClick:function(){this.fireEvent('cancelclick',this);},onMonthClick:function(target,isDouble){var me=this;me.value[0]=me.resolveOffset(me.months.indexOf(target),me.monthOffset);me.updateBody();me.fireEvent('month'+(isDouble?'dbl':'')+'click',me,me.value);me.fireEvent('select',me,me.value);},onYearClick:function(target,isDouble){var me=this;me.value[1]=me.activeYear+me.resolveOffset(me.years.indexOf(target),me.yearOffset);me.updateBody();me.fireEvent('year'+(isDouble?'dbl':'')+'click',me,me.value);me.fireEvent('select',me,me.value);},resolveOffset:function(index,offset){if(index%2===0){return(index/2);}else{return offset+Math.floor(index/2);}},beforeDestroy:function(){var me=this;me.years=me.months=null;Ext.destroyMembers(me,'backRepeater','nextRepeater','okBtn','cancelBtn');me.callParent();},finishRenderChildren:function(){var me=this;this.callParent(arguments);if(this.showButtons){me.okBtn.finishRender();me.cancelBtn.finishRender();}},onDestroy:function(){Ext.destroyMembers(this,'okBtn','cancelBtn');this.callParent();}});Ext.define('Ext.menu.Separator',{extend:'Ext.menu.Item',alias:'widget.menuseparator',canActivate:false,focusable:false,hideOnClick:false,plain:true,separatorCls:Ext.baseCSSPrefix+'menu-item-separator',text:'&#160;',beforeRender:function(ct,pos){var me=this;me.callParent();me.addCls(me.separatorCls);}});Ext.define('Ext.menu.CheckItem',{extend:'Ext.menu.Item',alias:'widget.menucheckitem',checkedCls:Ext.baseCSSPrefix+'menu-item-checked',uncheckedCls:Ext.baseCSSPrefix+'menu-item-unchecked',groupCls:Ext.baseCSSPrefix+'menu-group-icon',hideOnClick:false,checkChangeDisabled:false,childEls:['itemEl','iconEl','textEl','checkEl'],showCheckbox:true,renderTpl:['<tpl if="plain">','{text}','<tpl else>','{%var showCheckbox = values.showCheckbox,','      rightCheckbox = showCheckbox && values.hasIcon && (values.iconAlign !== "left"), textCls = rightCheckbox ? "'+Ext.baseCSSPrefix+'right-check-item-text" : "";%}','<a id="{id}-itemEl" class="'+Ext.baseCSSPrefix+'menu-item-link{childElCls}" href="{href}" <tpl if="hrefTarget">target="{hrefTarget}"</tpl> hidefocus="true" unselectable="on"','<tpl if="tabIndex">',' tabIndex="{tabIndex}"','</tpl>','>','{%if (values.hasIcon && (values.iconAlign !== "left")) {%}','<div role="img" id="{id}-iconEl" class="'+Ext.baseCSSPrefix+'menu-item-icon {iconCls}','{childElCls} {glyphCls}" style="<tpl if="icon">background-image:url({icon});</tpl>','<tpl if="glyph && glyphFontFamily">font-family:{glyphFontFamily};</tpl>">','<tpl if="glyph">&#{glyph};</tpl>','</div>','{%} else if (showCheckbox){%}','<img id="{id}-checkEl" src="{blank}" class="'+Ext.baseCSSPrefix+'menu-item-icon{childElCls}" />','{%}%}','<span id="{id}-textEl" class="'+Ext.baseCSSPrefix+'menu-item-text {[textCls]}{childElCls}" <tpl if="arrowCls">style="margin-right: 17px;"</tpl> >{text}</span>','{%if (rightCheckbox) {%}','<img id="{id}-checkEl" src="{blank}" class="'+Ext.baseCSSPrefix+'menu-item-icon-right{childElCls}" />','{%} else if (values.arrowCls) {%}','<img id="{id}-arrowEl" src="{blank}" class="{arrowCls}{childElCls}"/>','{%}%}','</a>','</tpl>'],initComponent:function(){var me=this;me.checked=!!me.checked;me.addEvents('beforecheckchange','checkchange');me.callParent(arguments);Ext.menu.Manager.registerCheckable(me);if(me.group){me.showCheckbox=false
if(!(me.iconCls||me.icon||me.glyph)){me.iconCls=me.groupCls;}
if(me.initialConfig.hideOnClick!==false){me.hideOnClick=true;}}},beforeRender:function(){this.callParent();this.renderData.showCheckbox=this.showCheckbox;},afterRender:function(){var me=this;me.callParent();me.checked=!me.checked;me.setChecked(!me.checked,true);if(me.checkChangeDisabled){me.disableCheckChange();}},disableCheckChange:function(){var me=this,checkEl=me.checkEl;if(checkEl){checkEl.addCls(me.disabledCls);}
if(!(Ext.isIE10p||(Ext.isIE9&&Ext.isStrict))&&me.rendered){me.el.repaint();}
me.checkChangeDisabled=true;},enableCheckChange:function(){var me=this,checkEl=me.checkEl;if(checkEl){checkEl.removeCls(me.disabledCls);}
me.checkChangeDisabled=false;},onClick:function(e){var me=this;if(!me.disabled&&!me.checkChangeDisabled&&!(me.checked&&me.group)){me.setChecked(!me.checked);}
this.callParent([e]);},onDestroy:function(){Ext.menu.Manager.unregisterCheckable(this);this.callParent(arguments);},setChecked:function(checked,suppressEvents){var me=this;if(me.checked!==checked&&(suppressEvents||me.fireEvent('beforecheckchange',me,checked)!==false)){if(me.el){me.el[checked?'addCls':'removeCls'](me.checkedCls)[!checked?'addCls':'removeCls'](me.uncheckedCls);}
me.checked=checked;Ext.menu.Manager.onCheckChange(me,checked);if(!suppressEvents){Ext.callback(me.checkHandler,me.scope,[me,checked]);me.fireEvent('checkchange',me,checked);}}}});Ext.define('Ext.resizer.BorderSplitter',{extend:'Ext.resizer.Splitter',uses:['Ext.resizer.BorderSplitterTracker'],alias:'widget.bordersplitter',collapseTarget:null,getTrackerConfig:function(){var trackerConfig=this.callParent();trackerConfig.xclass='Ext.resizer.BorderSplitterTracker';return trackerConfig;}});Ext.define('Ext.toolbar.TextItem',{extend:'Ext.toolbar.Item',requires:['Ext.XTemplate'],alias:'widget.tbtext',alternateClassName:'Ext.Toolbar.TextItem',text:'',renderTpl:'{text}',baseCls:Ext.baseCSSPrefix+'toolbar-text',beforeRender:function(){var me=this;me.callParent();Ext.apply(me.renderData,{text:me.text});},setText:function(text){var me=this;me.text=text;if(me.rendered){me.el.update(text);me.updateLayout();}}});Ext.define('Ext.form.field.FileButton',{extend:'Ext.button.Button',alias:'widget.filebutton',childEls:['btnEl','btnWrap','btnInnerEl','btnIconEl','fileInputEl'],inputCls:Ext.baseCSSPrefix+'form-file-input',cls:Ext.baseCSSPrefix+'form-file-btn',preventDefault:false,renderTpl:['<span id="{id}-btnWrap" class="{baseCls}-wrap','<tpl if="splitCls"> {splitCls}</tpl>','{childElCls}" unselectable="on">','<span id="{id}-btnEl" class="{baseCls}-button">','<span id="{id}-btnInnerEl" class="{baseCls}-inner {innerCls}','{childElCls}" unselectable="on">','{text}','</span>','<span role="img" id="{id}-btnIconEl" class="{baseCls}-icon-el {iconCls}','{childElCls} {glyphCls}" unselectable="on" style="','<tpl if="iconUrl">background-image:url({iconUrl});</tpl>','<tpl if="glyph && glyphFontFamily">font-family:{glyphFontFamily};</tpl>">','<tpl if="glyph">&#{glyph};</tpl><tpl if="iconCls || iconUrl">&#160;</tpl>','</span>','</span>','</span>','<input id="{id}-fileInputEl" class="{childElCls} {inputCls}" type="file" size="1" name="{inputName}">'],getTemplateArgs:function(){var args=this.callParent();args.inputCls=this.inputCls;args.inputName=this.inputName;return args;},afterRender:function(){var me=this;me.callParent(arguments);me.fileInputEl.on('change',me.fireChange,me);},fireChange:function(e){this.fireEvent('change',this,e,this.fileInputEl.dom.value);},createFileInput:function(isTemporary){var me=this;me.fileInputEl=me.el.createChild({name:me.inputName,id:!isTemporary?me.id+'-fileInputEl':undefined,cls:me.inputCls,tag:'input',type:'file',size:1});me.fileInputEl.on('change',me.fireChange,me);},reset:function(remove){if(remove){this.fileInputEl.remove();}
this.createFileInput(!remove);},restoreInput:function(el){this.fileInputEl.remove();el=Ext.get(el);this.el.appendChild(el);this.fileInputEl=el;},onDisable:function(){this.callParent();this.fileInputEl.dom.disabled=true;},onEnable:function(){this.callParent();this.fileInputEl.dom.disabled=false;}});Ext.define('Ext.button.Split',{alias:'widget.splitbutton',extend:'Ext.button.Button',alternateClassName:'Ext.SplitButton',arrowCls:'split',split:true,initComponent:function(){this.callParent();this.addEvents("arrowclick");},setArrowHandler:function(handler,scope){this.arrowHandler=handler;this.scope=scope;},onClick:function(e,t){var me=this;e.preventDefault();if(!me.disabled){if(me.overMenuTrigger){me.maybeShowMenu();me.fireEvent("arrowclick",me,e);if(me.arrowHandler){me.arrowHandler.call(me.scope||me,me,e);}}else{me.doToggle();me.fireHandler(e);}}}});Ext.define('Ext.form.field.Text',{extend:'Ext.form.field.Base',alias:'widget.textfield',requires:['Ext.form.field.VTypes','Ext.layout.component.field.Text'],alternateClassName:['Ext.form.TextField','Ext.form.Text'],size:20,growMin:30,growMax:800,growAppend:'W',allowBlank:true,validateBlank:false,allowOnlyWhitespace:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:'The minimum length for this field is {0}',maxLengthText:'The maximum length for this field is {0}',blankText:'This field is required',regexText:'',emptyCls:Ext.baseCSSPrefix+'form-empty-field',requiredCls:Ext.baseCSSPrefix+'form-required-field',componentLayout:'textfield',valueContainsPlaceholder:false,initComponent:function(){var me=this;if(me.allowOnlyWhitespace===false){me.allowBlank=false;}
me.callParent();me.addEvents('autosize','keydown','keyup','keypress');me.addStateEvents('change');me.setGrowSizePolicy();},setGrowSizePolicy:function(){if(this.grow){this.shrinkWrap|=1;}},initEvents:function(){var me=this,el=me.inputEl;me.callParent();if(me.selectOnFocus||me.emptyText){me.mon(el,'mousedown',me.onMouseDown,me);}
if(me.maskRe||(me.vtype&&me.disableKeyFilter!==true&&(me.maskRe=Ext.form.field.VTypes[me.vtype+'Mask']))){me.mon(el,'keypress',me.filterKeys,me);}
if(me.enableKeyEvents){me.mon(el,{scope:me,keyup:me.onKeyUp,keydown:me.onKeyDown,keypress:me.onKeyPress});}},isEqual:function(value1,value2){return this.isEqualAsString(value1,value2);},onChange:function(newVal,oldVal){this.callParent(arguments);this.autoSize();},getSubTplData:function(){var me=this,value=me.getRawValue(),isEmpty=me.emptyText&&value.length<1,maxLength=me.maxLength,placeholder;if(me.enforceMaxLength){if(maxLength===Number.MAX_VALUE){maxLength=undefined;}}else{maxLength=undefined;}
if(isEmpty){if(Ext.supports.Placeholder){placeholder=me.emptyText;}else{value=me.emptyText;me.valueContainsPlaceholder=true;}}
return Ext.apply(me.callParent(),{maxLength:maxLength,readOnly:me.readOnly,placeholder:placeholder,value:value,fieldCls:me.fieldCls+((isEmpty&&(placeholder||value))?' '+me.emptyCls:'')+(me.allowBlank?'':' '+me.requiredCls)});},afterRender:function(){this.autoSize();this.callParent();},onMouseDown:function(e){var me=this;if(!me.hasFocus){me.mon(me.inputEl,'mouseup',Ext.emptyFn,me,{single:true,preventDefault:true});}},processRawValue:function(value){var me=this,stripRe=me.stripCharsRe,newValue;if(stripRe){newValue=value.replace(stripRe,'');if(newValue!==value){me.setRawValue(newValue);value=newValue;}}
return value;},onDisable:function(){this.callParent();if(Ext.isIE){this.inputEl.dom.unselectable='on';}},onEnable:function(){this.callParent();if(Ext.isIE){this.inputEl.dom.unselectable='';}},onKeyDown:function(e){this.fireEvent('keydown',this,e);},onKeyUp:function(e){this.fireEvent('keyup',this,e);},onKeyPress:function(e){this.fireEvent('keypress',this,e);},reset:function(){this.callParent();this.applyEmptyText();},applyEmptyText:function(){var me=this,emptyText=me.emptyText,isEmpty;if(me.rendered&&emptyText){isEmpty=me.getRawValue().length<1&&!me.hasFocus;if(Ext.supports.Placeholder){me.inputEl.dom.placeholder=emptyText;}else if(isEmpty){me.setRawValue(emptyText);me.valueContainsPlaceholder=true;}
if(isEmpty){me.inputEl.addCls(me.emptyCls);}
me.autoSize();}},afterFirstLayout:function(){this.callParent();if(Ext.isIE&&this.disabled){var el=this.inputEl;if(el){el.dom.unselectable='on';}}},beforeFocus:function(){var me=this,inputEl=me.inputEl,emptyText=me.emptyText,isEmpty;me.callParent(arguments);if((emptyText&&!Ext.supports.Placeholder)&&(inputEl.dom.value===me.emptyText&&me.valueContainsPlaceholder)){me.setRawValue('');isEmpty=true;inputEl.removeCls(me.emptyCls);me.valueContainsPlaceholder=false;}else if(Ext.supports.Placeholder){me.inputEl.removeCls(me.emptyCls);}
if(me.selectOnFocus||isEmpty){if(Ext.isWebKit){if(!me.inputFocusTask){me.inputFocusTask=new Ext.util.DelayedTask(me.focusInput,me);}
me.inputFocusTask.delay(1);}else{inputEl.dom.select();}}},focusInput:function(){var input=this.inputEl;if(input){input=input.dom;if(input){input.select();}}},onFocus:function(){var me=this;me.callParent(arguments);if(me.emptyText){me.autoSize();}},postBlur:function(){this.callParent(arguments);this.applyEmptyText();},filterKeys:function(e){if(e.ctrlKey&&!e.altKey){return;}
var key=e.getKey(),charCode=String.fromCharCode(e.getCharCode());if((Ext.isGecko||Ext.isOpera)&&(e.isNavKeyPress()||key===e.BACKSPACE||(key===e.DELETE&&e.button===-1))){return;}
if((!Ext.isGecko&&!Ext.isOpera)&&e.isSpecialKey()&&!charCode){return;}
if(!this.maskRe.test(charCode)){e.stopEvent();}},getState:function(){return this.addPropertyToState(this.callParent(),'value');},applyState:function(state){this.callParent(arguments);if(state.hasOwnProperty('value')){this.setValue(state.value);}},getRawValue:function(){var me=this,v=me.callParent();if(v===me.emptyText&&me.valueContainsPlaceholder){v='';}
return v;},setValue:function(value){var me=this,inputEl=me.inputEl;if(inputEl&&me.emptyText&&!Ext.isEmpty(value)){inputEl.removeCls(me.emptyCls);me.valueContainsPlaceholder=false;}
me.callParent(arguments);me.applyEmptyText();return me;},getErrors:function(value){var me=this,errors=me.callParent(arguments),validator=me.validator,vtype=me.vtype,vtypes=Ext.form.field.VTypes,regex=me.regex,format=Ext.String.format,msg,trimmed,isBlank;value=value||me.processRawValue(me.getRawValue());if(Ext.isFunction(validator)){msg=validator.call(me,value);if(msg!==true){errors.push(msg);}}
trimmed=me.allowOnlyWhitespace?value:Ext.String.trim(value);if(trimmed.length<1||(value===me.emptyText&&me.valueContainsPlaceholder)){if(!me.allowBlank){errors.push(me.blankText);}
if(!me.validateBlank){return errors;}
isBlank=true;}
if(!isBlank&&value.length<me.minLength){errors.push(format(me.minLengthText,me.minLength));}
if(value.length>me.maxLength){errors.push(format(me.maxLengthText,me.maxLength));}
if(vtype){if(!vtypes[vtype](value,me)){errors.push(me.vtypeText||vtypes[vtype+'Text']);}}
if(regex&&!regex.test(value)){errors.push(me.regexText||me.invalidText);}
return errors;},selectText:function(start,end){var me=this,v=me.getRawValue(),doFocus=true,el=me.inputEl.dom,undef,range;if(v.length>0){start=start===undef?0:start;end=end===undef?v.length:end;if(el.setSelectionRange){el.setSelectionRange(start,end);}
else if(el.createTextRange){range=el.createTextRange();range.moveStart('character',start);range.moveEnd('character',end-v.length);range.select();}
doFocus=Ext.isGecko||Ext.isOpera;}
if(doFocus){me.focus();}},autoSize:function(){var me=this;if(me.grow&&me.rendered){me.autoSizing=true;me.updateLayout();}},afterComponentLayout:function(){var me=this,width;me.callParent(arguments);if(me.autoSizing){width=me.inputEl.getWidth();if(width!==me.lastInputWidth){me.fireEvent('autosize',me,width);me.lastInputWidth=width;delete me.autoSizing;}}},onDestroy:function(){var me=this;me.callParent();if(me.inputFocusTask){me.inputFocusTask.cancel();me.inputFocusTask=null;}}});Ext.define('Ext.view.AbstractView',{extend:'Ext.Component',requires:['Ext.LoadMask','Ext.data.StoreManager','Ext.CompositeElementLite','Ext.DomQuery','Ext.selection.DataViewModel'],mixins:{bindable:'Ext.util.Bindable'},inheritableStatics:{getRecord:function(node){return this.getBoundView(node).getRecord(node);},getBoundView:function(node){return Ext.getCmp(node.boundView);}},deferInitialRefresh:true,itemCls:Ext.baseCSSPrefix+'dataview-item',loadingText:'Loading...',loadMask:true,loadingUseMsg:true,selectedItemCls:Ext.baseCSSPrefix+'item-selected',emptyText:"",deferEmptyText:true,trackOver:false,blockRefresh:false,preserveScrollOnRefresh:false,last:false,triggerEvent:'itemclick',triggerCtEvent:'containerclick',addCmpEvents:function(){},initComponent:function(){var me=this,isDef=Ext.isDefined,itemTpl=me.itemTpl,memberFn={};if(itemTpl){if(Ext.isArray(itemTpl)){itemTpl=itemTpl.join('');}else if(Ext.isObject(itemTpl)){memberFn=Ext.apply(memberFn,itemTpl.initialConfig);itemTpl=itemTpl.html;}
if(!me.itemSelector){me.itemSelector='.'+me.itemCls;}
itemTpl=Ext.String.format('<tpl for="."><div class="{0}">{1}</div></tpl>',me.itemCls,itemTpl);me.tpl=new Ext.XTemplate(itemTpl,memberFn);}
me.callParent();me.tpl=me.getTpl('tpl');if(me.overItemCls){me.trackOver=true;}
me.addEvents('beforerefresh','refresh','viewready','itemupdate','itemadd','itemremove');me.addCmpEvents();me.store=Ext.data.StoreManager.lookup(me.store||'ext-empty-store');if(!me.dataSource){me.dataSource=me.store;}
me.bindStore(me.dataSource,true,'dataSource');if(!me.all){me.all=new Ext.CompositeElementLite();}
me.scrollState={top:0,left:0};me.on({scroll:me.onViewScroll,element:'el',scope:me});},onRender:function(){var me=this,mask=me.loadMask,maskStore=me.getMaskStore(),cfg={target:me,msg:me.loadingText,msgCls:me.loadingCls,useMsg:me.loadingUseMsg,store:maskStore};me.callParent(arguments);if(mask&&!maskStore.proxy.isSynchronous){if(Ext.isObject(mask)){cfg=Ext.apply(cfg,mask);}
me.loadMask=new Ext.LoadMask(cfg);me.loadMask.on({scope:me,beforeshow:me.onMaskBeforeShow,hide:me.onMaskHide});}},finishRender:function(){var me=this;me.callParent(arguments);if(!me.up('[collapsed],[hidden]')){me.doFirstRefresh(me.dataSource);}},onBoxReady:function(){var me=this;me.callParent(arguments);if(!me.firstRefreshDone){me.doFirstRefresh(me.dataSource);}},getMaskStore:function(){return this.store;},onMaskBeforeShow:function(){var me=this,loadingHeight=me.loadingHeight;if(loadingHeight&&loadingHeight>me.getHeight()){me.hasLoadingHeight=true;me.oldMinHeight=me.minHeight;me.minHeight=loadingHeight;me.updateLayout();}},onMaskHide:function(){var me=this;if(!me.destroying&&me.hasLoadingHeight){me.minHeight=me.oldMinHeight;me.updateLayout();delete me.hasLoadingHeight;}},beforeRender:function(){this.callParent(arguments);this.getSelectionModel().beforeViewRender(this);},afterRender:function(){this.callParent(arguments);this.getSelectionModel().bindComponent(this);},getSelectionModel:function(){var me=this,mode='SINGLE';if(me.simpleSelect){mode='SIMPLE';}else if(me.multiSelect){mode='MULTI';}
if(!me.selModel||!me.selModel.events){me.selModel=new Ext.selection.DataViewModel(Ext.apply({allowDeselect:me.allowDeselect,mode:mode},me.selModel));}
if(!me.selModel.hasRelaySetup){me.relayEvents(me.selModel,['selectionchange','beforeselect','beforedeselect','select','deselect','focuschange']);me.selModel.hasRelaySetup=true;}
if(me.disableSelection){me.selModel.locked=true;}
return me.selModel;},refresh:function(){var me=this,targetEl,targetParent,oldDisplay,nextSibling,dom,records;if(!me.rendered||me.isDestroyed){return;}
if(!me.hasListeners.beforerefresh||me.fireEvent('beforerefresh',me)!==false){targetEl=me.getTargetEl();records=me.getViewRange();dom=targetEl.dom;if(!me.preserveScrollOnRefresh){targetParent=dom.parentNode;oldDisplay=dom.style.display;dom.style.display='none';nextSibling=dom.nextSibling;targetParent.removeChild(dom);}
if(me.refreshCounter){me.clearViewEl();}else{me.fixedNodes=targetEl.dom.childNodes.length;me.refreshCounter=1;}
me.tpl.append(targetEl,me.collectData(records,me.all.startIndex));if(records.length<1){if(!this.store.loading&&(!me.deferEmptyText||me.hasFirstRefresh)){Ext.core.DomHelper.insertHtml('beforeEnd',targetEl.dom,me.emptyText);}
me.all.clear();}else{me.collectNodes(targetEl.dom);me.updateIndexes(0);}
if(me.hasFirstRefresh){if(me.refreshSelmodelOnRefresh!==false){me.selModel.refresh();}else{me.selModel.pruneIf();}}
me.hasFirstRefresh=true;if(!me.preserveScrollOnRefresh){targetParent.insertBefore(dom,nextSibling);dom.style.display=oldDisplay;}
this.refreshSize();me.fireEvent('refresh',me);if(!me.viewReady){me.viewReady=true;me.fireEvent('viewready',me);}}},collectNodes:function(targetEl){this.all.fill(Ext.query(this.getItemSelector(),Ext.getDom(targetEl)),this.all.startIndex);},getViewRange:function(){return this.dataSource.getRange();},refreshSize:function(){var sizeModel=this.getSizeModel();if(sizeModel.height.shrinkWrap||sizeModel.width.shrinkWrap){this.updateLayout();}},clearViewEl:function(){var me=this,el=me.getTargetEl();if(me.fixedNodes){while(el.dom.childNodes[me.fixedNodes]){el.dom.removeChild(el.dom.childNodes[me.fixedNodes]);}}else{el.update('');}
me.refreshCounter++;},onViewScroll:Ext.emptyFn,onIdChanged:Ext.emptyFn,saveScrollState:function(){if(this.rendered){var dom=this.el.dom,state=this.scrollState;state.left=dom.scrollLeft;state.top=dom.scrollTop;}},restoreScrollState:function(){if(this.rendered){var dom=this.el.dom,state=this.scrollState;dom.scrollLeft=state.left;dom.scrollTop=state.top;}},prepareData:function(data,index,record){var associatedData,attr,hasCopied;if(record){associatedData=record.getAssociatedData();for(attr in associatedData){if(associatedData.hasOwnProperty(attr)){if(!hasCopied){data=Ext.Object.chain(data);hasCopied=true;}
data[attr]=associatedData[attr];}}}
return data;},collectData:function(records,startIndex){var data=[],i=0,len=records.length,record;for(;i<len;i++){record=records[i];data[i]=this.prepareData(record.data,startIndex+i,record);}
return data;},bufferRender:function(records,index){var me=this,div=me.renderBuffer||(me.renderBuffer=document.createElement('div'));me.tpl.overwrite(div,me.collectData(records,index));return Ext.DomQuery.select(me.getItemSelector(),div);},getNodeContainer:function(){return this.getTargetEl();},onUpdate:function(ds,record){var me=this,index,node;if(me.viewReady){index=me.dataSource.indexOf(record);if(index>-1){node=me.bufferRender([record],index)[0];if(me.getNode(record)){me.all.replaceElement(index,node,true);me.updateIndexes(index,index);me.selModel.onUpdate(record);if(me.hasListeners.itemupdate){me.fireEvent('itemupdate',record,index,node);}
return node;}}}},onAdd:function(store,records,index){var me=this,nodes;if(me.rendered){if(me.all.getCount()===0){me.refresh();nodes=me.all.slice();}else{nodes=me.doAdd(records,index);if(me.refreshSelmodelOnRefresh!==false){me.selModel.refresh();}
me.updateIndexes(index);me.refreshSize();}
if(me.hasListeners.itemadd){me.fireEvent('itemadd',records,index,nodes);}}},doAdd:function(records,index){var me=this,nodes=me.bufferRender(records,index,true),all=me.all,count=all.getCount(),i,l;if(count===0){for(i=0,l=nodes.length;i<l;i++){this.getNodeContainer().appendChild(nodes[i]);}}else if(index<count){if(index===0){all.item(index).insertSibling(nodes,'before',true);}else{all.item(index-1).insertSibling(nodes,'after',true);}}else{all.last().insertSibling(nodes,'after',true);}
all.insert(index,nodes);return nodes;},onRemove:function(ds,records,indexes){var me=this,fireItemRemove=me.hasListeners.itemremove,i,record,index;if(me.all.getCount()){if(me.dataSource.getCount()===0){if(fireItemRemove){for(i=indexes.length-1;i>=0;--i){me.fireEvent('itemremove',records[i],indexes[i]);}}
me.refresh();}else{for(i=indexes.length-1;i>=0;--i){record=records[i];index=indexes[i];me.doRemove(record,index);if(fireItemRemove){me.fireEvent('itemremove',record,index);}}
me.updateIndexes(indexes[0]);}
this.refreshSize();}},doRemove:function(record,index){this.all.removeElement(index,true);},refreshNode:function(index){this.onUpdate(this.dataSource,this.dataSource.getAt(index));},updateIndexes:function(startIndex,endIndex){var nodes=this.all.elements,records=this.getViewRange(),i;startIndex=startIndex||0;endIndex=endIndex||((endIndex===0)?0:(nodes.length-1));for(i=startIndex;i<=endIndex;i++){nodes[i].viewIndex=i;nodes[i].viewRecordId=records[i].internalId;if(!nodes[i].boundView){nodes[i].boundView=this.id;}}},getStore:function(){return this.store;},bindStore:function(store,initial,propName){var me=this;me.mixins.bindable.bindStore.apply(me,arguments);if(!initial){me.getSelectionModel().bindStore(store);}
if(me.componentLayoutCounter){me.doFirstRefresh(store);}},doFirstRefresh:function(store){var me=this;me.firstRefreshDone=true;if(store&&!store.loading){if(me.deferInitialRefresh){me.applyFirstRefresh();}else{me.refresh();}}},applyFirstRefresh:function(){var me=this;if(me.isDestroyed){return;}
if(me.up('[isCollapsingOrExpanding]')){Ext.Function.defer(me.applyFirstRefresh,100,me);}else{Ext.Function.defer(function(){if(!me.isDestroyed){me.refresh();}},1);}},onUnbindStore:function(store){this.setMaskBind(null);},onBindStore:function(store,initial,propName){this.setMaskBind(store);if(!initial&&propName==='store'){this.bindStore(store,false,'dataSource');}},setMaskBind:function(store){var mask=this.loadMask;if(mask&&mask.bindStore){mask.bindStore(store);}},getStoreListeners:function(){var me=this;return{idchanged:me.onIdChanged,refresh:me.onDataRefresh,add:me.onAdd,bulkremove:me.onRemove,update:me.onUpdate,clear:me.refresh};},onDataRefresh:function(){this.refreshView();},refreshView:function(){var me=this,blockedByAncestor=!me.firstRefreshDone&&(!me.rendered||me.up('[collapsed],[isCollapsingOrExpanding],[hidden]'));if(blockedByAncestor){me.deferInitialRefresh=false;}else if(me.blockRefresh!==true){me.firstRefreshDone=true;me.refresh();}},findItemByChild:function(node){return Ext.fly(node).findParent(this.getItemSelector(),this.getTargetEl());},findTargetByEvent:function(e){return e.getTarget(this.getItemSelector(),this.getTargetEl());},getSelectedNodes:function(){var nodes=[],records=this.selModel.getSelection(),ln=records.length,i=0;for(;i<ln;i++){nodes.push(this.getNode(records[i]));}
return nodes;},getRecords:function(nodes){var records=[],i=0,len=nodes.length,data=this.dataSource.data;for(;i<len;i++){records[records.length]=data.getByKey(nodes[i].viewRecordId);}
return records;},getRecord:function(node){return this.dataSource.data.getByKey(Ext.getDom(node).viewRecordId);},isSelected:function(node){var r=this.getRecord(node);return this.selModel.isSelected(r);},select:function(records,keepExisting,suppressEvent){this.selModel.select(records,keepExisting,suppressEvent);},deselect:function(records,suppressEvent){this.selModel.deselect(records,suppressEvent);},getNode:function(nodeInfo){if((!nodeInfo&&nodeInfo!==0)||!this.rendered){return null;}
if(Ext.isString(nodeInfo)){return document.getElementById(nodeInfo);}
if(Ext.isNumber(nodeInfo)){return this.all.elements[nodeInfo];}
if(nodeInfo.isModel){return this.getNodeByRecord(nodeInfo);}
return nodeInfo;},getNodeByRecord:function(record){var ns=this.all.elements,ln=ns.length,i=0;for(;i<ln;i++){if(ns[i].viewRecordId===record.internalId){return ns[i];}}
return null;},getNodes:function(start,end){var all=this.all;if(end===undefined){end=all.getCount();}else{end++;}
return all.slice(start||0,end);},indexOf:function(node){node=this.getNode(node);if(!node&&node!==0){return-1;}
if(Ext.isNumber(node.viewIndex)){return node.viewIndex;}
return this.all.indexOf(node);},onDestroy:function(){var me=this;me.all.clear();me.callParent();me.bindStore(null);me.selModel.destroy();},onItemSelect:function(record){var node=this.getNode(record);if(node){Ext.fly(node).addCls(this.selectedItemCls);}},onItemDeselect:function(record){var node=this.getNode(record);if(node){Ext.fly(node).removeCls(this.selectedItemCls);}},getItemSelector:function(){return this.itemSelector;}},function(){Ext.deprecate('extjs','4.0',function(){Ext.view.AbstractView.override({getSelectionCount:function(){if(Ext.global.console){Ext.global.console.warn("DataView: getSelectionCount will be removed, please interact with the Ext.selection.DataViewModel");}
return this.selModel.getSelection().length;},getSelectedRecords:function(){if(Ext.global.console){Ext.global.console.warn("DataView: getSelectedRecords will be removed, please interact with the Ext.selection.DataViewModel");}
return this.selModel.getSelection();},select:function(records,keepExisting,supressEvents){if(Ext.global.console){Ext.global.console.warn("DataView: select will be removed, please access select through a DataView's SelectionModel, ie: view.getSelectionModel().select()");}
var sm=this.getSelectionModel();return sm.select.apply(sm,arguments);},clearSelections:function(){if(Ext.global.console){Ext.global.console.warn("DataView: clearSelections will be removed, please access deselectAll through DataView's SelectionModel, ie: view.getSelectionModel().deselectAll()");}
var sm=this.getSelectionModel();return sm.deselectAll();}});});});Ext.define('Ext.toolbar.Separator',{extend:'Ext.toolbar.Item',alias:'widget.tbseparator',alternateClassName:'Ext.Toolbar.Separator',baseCls:Ext.baseCSSPrefix+'toolbar-separator',focusable:false});Ext.define('MP.form.StandaloneLabel',{extend:'Ext.form.Label',alias:'widget.standalone-label',getElConfig:function(){var me=this;me.html=me.text?Ext.util.Format.htmlEncode(me.text):(me.html||'');return Ext.form.Label.superclass.getElConfig.apply(me);}});Ext.define('Ext.menu.KeyNav',{extend:'Ext.util.KeyNav',requires:['Ext.FocusManager'],constructor:function(config){var me=this;me.menu=config.target;me.callParent([Ext.apply({down:me.down,enter:me.enter,esc:me.escape,left:me.left,right:me.right,space:me.enter,tab:me.tab,up:me.up},config)]);},down:function(e){var me=this,fi=me.menu.focusedItem;if(fi&&e.getKey()==Ext.EventObject.DOWN&&me.isWhitelisted(fi)){return true;}
me.focusNextItem(1);},enter:function(e){var menu=this.menu,focused=menu.focusedItem;if(menu.activeItem){menu.onClick(e);}else if(focused&&focused.isFormField){return true;}},escape:function(e){Ext.menu.Manager.hideAll();},focusNextItem:function(step){var menu=this.menu,items=menu.items,focusedItem=menu.focusedItem,startIdx=focusedItem?items.indexOf(focusedItem):-1,idx=startIdx+step,len=items.length,count=0,item;while(count<len&&idx!==startIdx){if(idx<0){idx=len-1;}else if(idx>=len){idx=0;}
item=items.getAt(idx);if(menu.canActivateItem(item)){menu.setActiveItem(item);break;}
idx+=step;++count;}},isWhitelisted:function(item){return Ext.FocusManager.isWhitelisted(item);},left:function(e){var menu=this.menu,fi=menu.focusedItem;if(fi&&this.isWhitelisted(fi)){return true;}
menu.hide();if(menu.parentMenu){menu.parentMenu.focus();}},right:function(e){var menu=this.menu,fi=menu.focusedItem,ai=menu.activeItem,am;if(fi&&this.isWhitelisted(fi)){return true;}
if(ai){am=menu.activeItem.menu;if(am){ai.expandMenu(0);am.setActiveItem(am.child(':focusable'));}}},tab:function(e){var me=this;if(e.shiftKey){me.up(e);}else{me.down(e);}},up:function(e){var me=this,fi=me.menu.focusedItem;if(fi&&e.getKey()==Ext.EventObject.UP&&me.isWhitelisted(fi)){return true;}
me.focusNextItem(-1);}});Ext.define('Ext.form.field.Display',{extend:'Ext.form.field.Base',alias:'widget.displayfield',requires:['Ext.util.Format','Ext.XTemplate'],alternateClassName:['Ext.form.DisplayField','Ext.form.Display'],fieldSubTpl:['<div id="{id}" role="input" ','<tpl if="fieldStyle"> style="{fieldStyle}"</tpl>',' class="{fieldCls}">{value}</div>',{compiled:true,disableFormats:true}],readOnly:true,fieldCls:Ext.baseCSSPrefix+'form-display-field',fieldBodyCls:Ext.baseCSSPrefix+'form-display-field-body',htmlEncode:false,noWrap:false,validateOnChange:false,initEvents:Ext.emptyFn,submitValue:false,isDirty:function(){return false;},isValid:function(){return true;},validate:function(){return true;},getRawValue:function(){return this.rawValue;},setRawValue:function(value){var me=this;value=Ext.value(value,'');me.rawValue=value;if(me.rendered){me.inputEl.dom.innerHTML=me.getDisplayValue();me.updateLayout();}
return value;},getDisplayValue:function(){var me=this,value=this.getRawValue(),display;if(me.renderer){display=me.renderer.call(me.scope||me,value,me);}else{display=me.htmlEncode?Ext.util.Format.htmlEncode(value):value;}
return display;},getSubTplData:function(){var ret=this.callParent(arguments);ret.value=this.getDisplayValue();return ret;}});Ext.define('Ext.dd.DragZone',{extend:'Ext.dd.DragSource',constructor:function(el,config){var me=this,scroll=me.containerScroll;me.callParent([el,config]);if(scroll){el=me.scrollEl||el;el=Ext.get(el);if(Ext.isObject(scroll)){el.ddScrollConfig=scroll;}
Ext.dd.ScrollManager.register(el);}},getDragData:function(e){return Ext.dd.Registry.getHandleFromEvent(e);},onInitDrag:function(x,y){this.proxy.update(this.dragData.ddel.cloneNode(true));this.onStartDrag(x,y);return true;},getRepairXY:function(e){return Ext.fly(this.dragData.ddel).getXY();},destroy:function(){this.callParent();if(this.containerScroll){Ext.dd.ScrollManager.unregister(this.scrollEl||this.el);}}});Ext.define('Ext.container.Viewport',{extend:'Ext.container.Container',alias:'widget.viewport',requires:['Ext.EventManager'],alternateClassName:'Ext.Viewport',isViewport:true,ariaRole:'application',preserveElOnDestroy:true,viewportCls:Ext.baseCSSPrefix+'viewport',initComponent:function(){var me=this,html=document.body.parentNode,el=me.el=Ext.getBody();Ext.getScrollbarSize();me.width=me.height=undefined;me.callParent(arguments);Ext.fly(html).addCls(me.viewportCls);if(me.autoScroll){Ext.fly(html).setStyle(me.getOverflowStyle());delete me.autoScroll;}
el.setHeight=el.setWidth=Ext.emptyFn;el.dom.scroll='no';me.allowDomMove=false;me.renderTo=me.el;},applyTargetCls:function(targetCls){this.el.addCls(targetCls);},onRender:function(){var me=this;me.callParent(arguments);me.width=Ext.Element.getViewportWidth();me.height=Ext.Element.getViewportHeight();},afterFirstLayout:function(){var me=this;me.callParent(arguments);setTimeout(function(){Ext.EventManager.onWindowResize(me.fireResize,me);},1);},fireResize:function(width,height){if(width!=this.width||height!=this.height){this.setSize(width,height);}},initHierarchyState:function(hierarchyState){this.callParent([this.hierarchyState=Ext.rootHierarchyState]);},beforeDestroy:function(){var me=this;me.removeUIFromElement();me.el.removeCls(me.baseCls);Ext.fly(document.body.parentNode).removeCls(me.viewportCls);me.callParent();}});Ext.define('Ext.panel.Header',{extend:'Ext.container.Container',uses:['Ext.panel.Tool','Ext.util.CSS','Ext.layout.component.Body','Ext.Img'],alias:'widget.header',isHeader:true,defaultType:'tool',indicateDrag:false,weight:-1,componentLayout:'body',childEls:['body'],renderTpl:['<div id="{id}-body" class="{headerCls}-body {baseCls}-body {bodyCls} {bodyTargetCls}','<tpl for="uiCls"> {parent.baseCls}-body-{parent.ui}-{.}</tpl>"','<tpl if="bodyStyle"> style="{bodyStyle}"</tpl>>','{%this.renderContainer(out,values)%}','</div>'],headingTpl:['<span id="{id}-textEl" class="{headerCls}-text {cls}-text {cls}-text-{ui}" unselectable="on">{title}</span>'],shrinkWrap:3,titlePosition:0,headerCls:Ext.baseCSSPrefix+'header',initComponent:function(){var me=this,hasPosition=me.hasOwnProperty('titlePosition'),items=me.items,titlePosition=hasPosition?me.titlePosition:(items?items.length:0),uiClasses=[me.orientation,me.getDockName()],ownerCt=me.ownerCt;me.addEvents('click','dblclick');me.indicateDragCls=me.headerCls+'-draggable';me.title=me.title||'&#160;';me.tools=me.tools||[];items=me.items=(items?Ext.Array.slice(items):[]);me.orientation=me.orientation||'horizontal';me.dock=(me.dock)?me.dock:(me.orientation=='horizontal')?'top':'left';if(ownerCt?(!ownerCt.border&&!ownerCt.frame):!me.border){uiClasses.push(me.orientation+'-noborder');}
me.addClsWithUI(uiClasses);me.addCls([me.headerCls,me.headerCls+'-'+me.orientation]);if(me.indicateDrag){me.addCls(me.indicateDragCls);}
if(me.iconCls||me.icon||me.glyph){me.initIconCmp();if(!hasPosition&&!items.length){++titlePosition;}
items.push(me.iconCmp);}
me.titleCmp=new Ext.Component({ariaRole:'heading',focusable:false,noWrap:true,flex:1,rtl:me.rtl,id:me.id+'_hd',style:me.titleAlign?('text-align:'+me.titleAlign):'',cls:me.headerCls+'-text-container '+
me.baseCls+'-text-container '+
me.baseCls+'-text-container-'+me.ui,renderTpl:me.getTpl('headingTpl'),renderData:{title:me.title,cls:me.baseCls,headerCls:me.headerCls,ui:me.ui},childEls:['textEl'],autoEl:{unselectable:'on'},listeners:{render:me.onTitleRender,scope:me}});me.layout=(me.orientation=='vertical')?{type:'vbox',align:'center',alignRoundingMethod:'ceil'}:{type:'hbox',align:'middle',alignRoundingMethod:'floor'};Ext.Array.push(items,me.tools);me.tools.length=0;me.callParent();if(items.length<titlePosition){titlePosition=items.length;}
me.titlePosition=titlePosition;me.insert(titlePosition,me.titleCmp);me.on({dblclick:me.onDblClick,click:me.onClick,element:'el',scope:me});},initIconCmp:function(){var me=this,cls=[me.headerCls+'-icon',me.baseCls+'-icon',me.iconCls],cfg;if(me.glyph){cls.push(me.baseCls+'-glyph');}
cfg={focusable:false,src:Ext.BLANK_IMAGE_URL,cls:cls,baseCls:me.baseCls+'-icon',id:me.id+'-iconEl',iconCls:me.iconCls,glyph:me.glyph};if(!Ext.isEmpty(me.icon)){delete cfg.iconCls;cfg.src=me.icon;}
me.iconCmp=new Ext.Img(cfg);},beforeRender:function(){this.protoEl.unselectable();this.callParent();},afterLayout:function(){var me=this,frameBR,frameTR,frameTL,xPos;if(me.orientation==='vertical'){me.adjustTitlePosition();frameTR=me.frameTR;if(frameTR){frameBR=me.frameBR;frameTL=me.frameTL;xPos=(me.getWidth()-frameTR.getPadding('r')-
((frameTL)?frameTL.getPadding('l'):me.el.getBorderWidth('l')))+'px';frameBR.setStyle('background-position-x',xPos);frameTR.setStyle('background-position-x',xPos);}
if(Ext.isIE7&&Ext.isStrict&&me.frame){me.el.repaint();}}},beforeLayout:function(){this.callParent();this.syncBeforeAfterTitleClasses();},adjustTitlePosition:function(){var titleCmp=this.titleCmp,titleEl;if(!Ext.isIE9m&&titleCmp){titleEl=titleCmp.el;titleEl.setStyle('left',titleEl.getWidth()+'px');}},onTitleRender:function(){if(this.orientation==='vertical'){this.titleCmp.el.setVertical(90);}},addUIClsToElement:function(cls){var me=this,result=me.callParent(arguments),classes=[me.baseCls+'-body-'+cls,me.baseCls+'-body-'+me.ui+'-'+cls],array,i;if(me.bodyCls){array=me.bodyCls.split(' ');for(i=0;i<classes.length;i++){if(!Ext.Array.contains(array,classes[i])){array.push(classes[i]);}}
me.bodyCls=array.join(' ');}else{me.bodyCls=classes.join(' ');}
return result;},removeUIClsFromElement:function(cls){var me=this,result=me.callParent(arguments),classes=[me.baseCls+'-body-'+cls,me.baseCls+'-body-'+me.ui+'-'+cls],array,i;if(me.bodyCls){array=me.bodyCls.split(' ');for(i=0;i<classes.length;i++){Ext.Array.remove(array,classes[i]);}
me.bodyCls=array.join(' ');}
return result;},addUIToElement:function(){var me=this,array,cls;me.callParent(arguments);cls=me.baseCls+'-body-'+me.ui;if(me.rendered){if(me.bodyCls){me.body.addCls(me.bodyCls);}else{me.body.addCls(cls);}}else{if(me.bodyCls){array=me.bodyCls.split(' ');if(!Ext.Array.contains(array,cls)){array.push(cls);}
me.bodyCls=array.join(' ');}else{me.bodyCls=cls;}}
if(me.titleCmp&&me.titleCmp.rendered){me.titleCmp.addCls(me.baseCls+'-text-container-'+me.ui);}},removeUIFromElement:function(){var me=this,array,cls;me.callParent(arguments);cls=me.baseCls+'-body-'+me.ui;if(me.rendered){if(me.bodyCls){me.body.removeCls(me.bodyCls);}else{me.body.removeCls(cls);}}else{if(me.bodyCls){array=me.bodyCls.split(' ');Ext.Array.remove(array,cls);me.bodyCls=array.join(' ');}else{me.bodyCls=cls;}}
if(me.titleCmp&&me.titleCmp.rendered){me.titleCmp.removeCls(me.baseCls+'-text-container-'+me.ui);}},onClick:function(e){this.fireClickEvent('click',e);},onDblClick:function(e){this.fireClickEvent('dblclick',e);},fireClickEvent:function(type,e){var toolCls='.'+Ext.panel.Tool.prototype.baseCls;if(!e.getTarget(toolCls)){this.fireEvent(type,this,e);}},getFocusEl:function(){return this.el;},getTargetEl:function(){return this.body||this.frameBody||this.el;},applyTargetCls:function(targetCls){this.bodyTargetCls=targetCls;},setTitle:function(title){var me=this,titleCmp=me.titleCmp;me.title=title;if(titleCmp.rendered){titleCmp.textEl.update(me.title||'&#160;');titleCmp.updateLayout();}else{me.titleCmp.on({render:function(){me.setTitle(title);},single:true});}},getMinWidth:function(){var me=this,textEl=me.titleCmp.textEl.dom,result,tools=me.tools,l,i;textEl.style.display='inline';result=textEl.offsetWidth;textEl.style.display='';if(tools&&(l=tools.length)){for(i=0;i<l;i++){if(tools[i].el){result+=tools[i].el.dom.offsetWidth;}}}
if(me.iconCmp){result+=me.iconCmp.el.dom.offsetWidth;}
return result+10;},setIconCls:function(cls){var me=this,isEmpty=!cls||!cls.length,iconCmp=me.iconCmp;me.iconCls=cls;if(!me.iconCmp&&!isEmpty){me.initIconCmp();me.insert(0,me.iconCmp);}else if(iconCmp){if(isEmpty){me.iconCmp.destroy();delete me.iconCmp;}else{iconCmp.removeCls(iconCmp.iconCls);iconCmp.addCls(cls);iconCmp.iconCls=cls;}}},setIcon:function(icon){var me=this,isEmpty=!icon||!icon.length,iconCmp=me.iconCmp;me.icon=icon;if(!me.iconCmp&&!isEmpty){me.initIconCmp();me.insert(0,me.iconCmp);}else if(iconCmp){if(isEmpty){me.iconCmp.destroy();delete me.iconCmp;}else{iconCmp.setSrc(me.icon);}}},setGlyph:function(glyph){var me=this,iconCmp=me.iconCmp;if(!me.iconCmp){me.initIconCmp();me.insert(0,me.iconCmp);}else if(iconCmp){if(glyph){me.iconCmp.setGlyph(glyph);}else{me.iconCmp.destroy();delete me.iconCmp;}}},getTools:function(){return this.tools.slice();},addTool:function(tool){this.add(Ext.ComponentManager.create(tool,'tool'));},syncBeforeAfterTitleClasses:function(){var me=this,items=me.items,childItems=items.items,titlePosition=me.titlePosition,itemCount=childItems.length,itemGeneration=items.generation,syncGen=me.syncBeforeAfterGen,afterCls,beforeCls,i,item;if(syncGen===itemGeneration){return;}
me.syncBeforeAfterGen=itemGeneration;for(i=0;i<itemCount;++i){item=childItems[i];afterCls=item.afterTitleCls||(item.afterTitleCls=item.baseCls+'-after-title')
beforeCls=item.beforeTitleCls||(item.beforeTitleCls=item.baseCls+'-before-title')
if(!me.title||i<titlePosition){if(syncGen){item.removeCls(afterCls);}
item.addCls(beforeCls);}else if(i>titlePosition){if(syncGen){item.removeCls(beforeCls);}
item.addCls(afterCls);}}},onAdd:function(component,index){var tools=this.tools;this.callParent(arguments);if(component.isTool){tools.push(component);tools[component.type]=component;}},initRenderData:function(){return Ext.applyIf(this.callParent(),{bodyCls:this.bodyCls,bodyTargetCls:this.bodyTargetCls,headerCls:this.headerCls});},getDockName:function(){return this.dock;},getFramingInfoCls:function(){var me=this,cls=me.callParent(),owner=me.ownerCt;if(!me.expanding&&(owner&&owner.collapsed)||me.isCollapsedExpander){cls+='-'+owner.collapsedCls;}
return cls+'-'+me.dock;}});Ext.define('Ext.form.field.Trigger',{extend:'Ext.form.field.Text',alias:['widget.triggerfield','widget.trigger'],requires:['Ext.dom.Helper','Ext.util.ClickRepeater','Ext.layout.component.field.Trigger'],alternateClassName:['Ext.form.TriggerField','Ext.form.TwinTriggerField','Ext.form.Trigger'],childEls:[{name:'triggerCell',select:'.'+Ext.baseCSSPrefix+'trigger-cell'},{name:'triggerEl',select:'.'+Ext.baseCSSPrefix+'form-trigger'},'triggerWrap','inputCell'],triggerBaseCls:Ext.baseCSSPrefix+'form-trigger',triggerWrapCls:Ext.baseCSSPrefix+'form-trigger-wrap',triggerNoEditCls:Ext.baseCSSPrefix+'trigger-noedit',hideTrigger:false,editable:true,readOnly:false,repeatTriggerClick:false,autoSize:Ext.emptyFn,monitorTab:true,mimicing:false,triggerIndexRe:/trigger-index-(\d+)/,extraTriggerCls:'',componentLayout:'triggerfield',initComponent:function(){this.wrapFocusCls=this.triggerWrapCls+'-focus';this.callParent(arguments);},getSubTplMarkup:function(values){var me=this,childElCls=values.childElCls,field=me.callParent(arguments);return'<table id="'+me.id+'-triggerWrap" class="'+Ext.baseCSSPrefix+'form-trigger-wrap'+childElCls+'" cellpadding="0" cellspacing="0"><tbody><tr>'+'<td id="'+me.id+'-inputCell" class="'+Ext.baseCSSPrefix+'form-trigger-input-cell'+childElCls+'">'+field+'</td>'+
me.getTriggerMarkup()+'</tr></tbody></table>';},getSubTplData:function(){var me=this,data=me.callParent(),readOnly=me.readOnly===true,editable=me.editable!==false;return Ext.apply(data,{editableCls:(readOnly||!editable)?' '+me.triggerNoEditCls:'',readOnly:!editable||readOnly});},getLabelableRenderData:function(){var me=this,triggerWrapCls=me.triggerWrapCls,result=me.callParent(arguments);return Ext.applyIf(result,{triggerWrapCls:triggerWrapCls,triggerMarkup:me.getTriggerMarkup()});},getTriggerMarkup:function(){var me=this,i=0,hideTrigger=(me.readOnly||me.hideTrigger),triggerCls,triggerBaseCls=me.triggerBaseCls,triggerConfigs=[],unselectableCls=Ext.dom.Element.unselectableCls,style='width:'+me.triggerWidth+'px;'+(hideTrigger?'display:none;':''),cls=me.extraTriggerCls+' '+Ext.baseCSSPrefix+'trigger-cell '+unselectableCls;if(!me.trigger1Cls){me.trigger1Cls=me.triggerCls;}
for(i=0;(triggerCls=me['trigger'+(i+1)+'Cls'])||i<1;i++){triggerConfigs.push({tag:'td',valign:'top',cls:cls,style:style,cn:{cls:[Ext.baseCSSPrefix+'trigger-index-'+i,triggerBaseCls,triggerCls].join(' '),role:'button'}});}
triggerConfigs[0].cn.cls+=' '+triggerBaseCls+'-first';return Ext.DomHelper.markup(triggerConfigs);},disableCheck:function(){return!this.disabled;},beforeRender:function(){var me=this,triggerBaseCls=me.triggerBaseCls,tempEl;if(!me.triggerWidth){tempEl=Ext.getBody().createChild({style:'position: absolute;',cls:Ext.baseCSSPrefix+'form-trigger'});Ext.form.field.Trigger.prototype.triggerWidth=tempEl.getWidth();tempEl.remove();}
me.callParent();if(triggerBaseCls!=Ext.baseCSSPrefix+'form-trigger'){me.addChildEls({name:'triggerEl',select:'.'+triggerBaseCls});}
me.lastTriggerStateFlags=me.getTriggerStateFlags();},onRender:function(){var me=this;me.callParent(arguments);me.doc=Ext.getDoc();me.initTrigger();},getTriggerWidth:function(){var me=this,totalTriggerWidth=0;if(me.triggerWrap&&!me.hideTrigger&&!me.readOnly){totalTriggerWidth=me.triggerEl.getCount()*me.triggerWidth;}
return totalTriggerWidth;},setHideTrigger:function(hideTrigger){if(hideTrigger!=this.hideTrigger){this.hideTrigger=hideTrigger;this.updateLayout();}},setEditable:function(editable){if(editable!=this.editable){this.editable=editable;this.updateLayout();}},setReadOnly:function(readOnly){var me=this,old=me.readOnly;me.callParent(arguments);if(readOnly!=old){me.updateLayout();}},initTrigger:function(){var me=this,triggerWrap=me.triggerWrap,triggerEl=me.triggerEl,disableCheck=me.disableCheck,els,eLen,el,e,idx;if(me.repeatTriggerClick){me.triggerRepeater=new Ext.util.ClickRepeater(triggerWrap,{preventDefault:true,handler:me.onTriggerWrapClick,listeners:{mouseup:me.onTriggerWrapMouseup,scope:me},scope:me});}else{me.mon(triggerWrap,{click:me.onTriggerWrapClick,mouseup:me.onTriggerWrapMouseup,scope:me});}
triggerEl.setVisibilityMode(Ext.Element.DISPLAY);triggerEl.addClsOnOver(me.triggerBaseCls+'-over',disableCheck,me);els=triggerEl.elements;eLen=els.length;for(e=0;e<eLen;e++){el=els[e];idx=e+1;el.addClsOnOver(me['trigger'+(idx)+'Cls']+'-over',disableCheck,me);el.addClsOnClick(me['trigger'+(idx)+'Cls']+'-click',disableCheck,me);}
triggerEl.addClsOnClick(me.triggerBaseCls+'-click',disableCheck,me);},onDestroy:function(){var me=this;Ext.destroyMembers(me,'triggerRepeater','triggerWrap','triggerEl');delete me.doc;me.callParent();},onFocus:function(){var me=this;me.callParent(arguments);if(!me.mimicing){me.bodyEl.addCls(me.wrapFocusCls);me.mimicing=true;me.mon(me.doc,'mousedown',me.mimicBlur,me,{delay:10});if(me.monitorTab){me.on('specialkey',me.checkTab,me);}}},checkTab:function(me,e){if(!this.ignoreMonitorTab&&e.getKey()==e.TAB){this.triggerBlur();}},getTriggerStateFlags:function(){var me=this,state=0;if(me.readOnly){state+=1;}
if(me.editable){state+=2;}
if(me.hideTrigger){state+=4;}
return state;},onBlur:Ext.emptyFn,mimicBlur:function(e){if(!this.isDestroyed&&!this.bodyEl.contains(e.target)&&this.validateBlur(e)){this.triggerBlur(e);}},triggerBlur:function(e){var me=this;me.mimicing=false;me.mun(me.doc,'mousedown',me.mimicBlur,me);if(me.monitorTab&&me.inputEl){me.un('specialkey',me.checkTab,me);}
Ext.form.field.Trigger.superclass.onBlur.call(me,e);if(me.bodyEl){me.bodyEl.removeCls(me.wrapFocusCls);}},validateBlur:function(e){return true;},onTriggerWrapClick:function(){var me=this,targetEl,match,triggerClickMethod,event;event=arguments[me.triggerRepeater?1:0];if(event&&!me.readOnly&&!me.disabled){targetEl=event.getTarget('.'+me.triggerBaseCls,null);match=targetEl&&targetEl.className.match(me.triggerIndexRe);if(match){triggerClickMethod=me['onTrigger'+(parseInt(match[1],10)+1)+'Click']||me.onTriggerClick;if(triggerClickMethod){triggerClickMethod.call(me,event);}}}},onTriggerWrapMouseup:Ext.emptyFn,onTriggerClick:Ext.emptyFn});Ext.define('Ext.layout.container.Border',{extend:'Ext.layout.container.Container',alias:'layout.border',alternateClassName:'Ext.layout.BorderLayout',requires:['Ext.resizer.BorderSplitter','Ext.fx.Anim','Ext.layout.container.border.Region'],targetCls:Ext.baseCSSPrefix+'border-layout-ct',itemCls:[Ext.baseCSSPrefix+'border-item',Ext.baseCSSPrefix+'box-item'],type:'border',isBorderLayout:true,padding:undefined,percentageRe:/(\d+)%/,horzMarginProp:'left',padOnContainerProp:'left',padNotOnContainerProp:'right',axisProps:{horz:{borderBegin:'west',borderEnd:'east',horizontal:true,posProp:'x',sizeProp:'width',sizePropCap:'Width'},vert:{borderBegin:'north',borderEnd:'south',horizontal:false,posProp:'y',sizeProp:'height',sizePropCap:'Height'}},centerRegion:null,manageMargins:true,panelCollapseAnimate:true,panelCollapseMode:'placeholder',regionWeights:{north:20,south:10,center:0,west:-10,east:-20},beginAxis:function(ownerContext,regions,name){var me=this,props=me.axisProps[name],isVert=!props.horizontal,sizeProp=props.sizeProp,totalFlex=0,childItems=ownerContext.childItems,length=childItems.length,center,i,childContext,centerFlex,comp,region,match,size,type,target,placeholder;for(i=0;i<length;++i){childContext=childItems[i];comp=childContext.target;childContext.layoutPos={};if(comp.region){childContext.region=region=comp.region;childContext.isCenter=comp.isCenter;childContext.isHorz=comp.isHorz;childContext.isVert=comp.isVert;childContext.weight=comp.weight||me.regionWeights[region]||0;regions[comp.id]=childContext;if(comp.isCenter){center=childContext;centerFlex=comp.flex;ownerContext.centerRegion=center;continue;}
if(isVert!==childContext.isVert){continue;}
childContext.reverseWeighting=(region==props.borderEnd);size=comp[sizeProp];type=typeof size;if(!comp.collapsed){if(type=='string'&&(match=me.percentageRe.exec(size))){childContext.percentage=parseInt(match[1],10);}else if(comp.flex){totalFlex+=childContext.flex=comp.flex;}}}}
if(center){target=center.target;if((placeholder=target.placeholderFor)){if(!centerFlex&&isVert===placeholder.collapsedVertical()){centerFlex=0;center.collapseAxis=name;}}else if(target.collapsed&&(isVert===target.collapsedVertical())){centerFlex=0;center.collapseAxis=name;}}
if(centerFlex==null){centerFlex=1;}
totalFlex+=centerFlex;return Ext.apply({before:isVert?'top':'left',totalFlex:totalFlex},props);},beginLayout:function(ownerContext){var me=this,items=me.getLayoutItems(),pad=me.padding,type=typeof pad,padOnContainer=false,childContext,item,length,i,regions,collapseTarget,doShow,hidden,region;if(pad){if(type=='string'||type=='number'){pad=Ext.util.Format.parseBox(pad);}}else{pad=ownerContext.getEl('getTargetEl').getPaddingInfo();padOnContainer=true;}
ownerContext.outerPad=pad;ownerContext.padOnContainer=padOnContainer;for(i=0,length=items.length;i<length;++i){item=items[i];collapseTarget=me.getSplitterTarget(item);if(collapseTarget){doShow=undefined;hidden=!!item.hidden;if(!collapseTarget.split){if(collapseTarget.isCollapsingOrExpanding){doShow=!!collapseTarget.collapsed;}}else if(hidden!==collapseTarget.hidden){doShow=!collapseTarget.hidden;}
if(doShow){item.show();}else if(doShow===false){item.hide();}}}
me.callParent(arguments);items=ownerContext.childItems;length=items.length;regions={};ownerContext.borderAxisHorz=me.beginAxis(ownerContext,regions,'horz');ownerContext.borderAxisVert=me.beginAxis(ownerContext,regions,'vert');for(i=0;i<length;++i){childContext=items[i];collapseTarget=me.getSplitterTarget(childContext.target);if(collapseTarget){region=regions[collapseTarget.id]
if(!region){region=ownerContext.getEl(collapseTarget.el,me);region.region=collapseTarget.region;}
childContext.collapseTarget=collapseTarget=region;childContext.weight=collapseTarget.weight;childContext.reverseWeighting=collapseTarget.reverseWeighting;collapseTarget.splitter=childContext;childContext.isHorz=collapseTarget.isHorz;childContext.isVert=collapseTarget.isVert;}}
me.sortWeightedItems(items,'reverseWeighting');me.setupSplitterNeighbors(items);},calculate:function(ownerContext){var me=this,containerSize=me.getContainerSize(ownerContext),childItems=ownerContext.childItems,length=childItems.length,horz=ownerContext.borderAxisHorz,vert=ownerContext.borderAxisVert,pad=ownerContext.outerPad,padOnContainer=ownerContext.padOnContainer,i,childContext,childMargins,size,horzPercentTotal,vertPercentTotal;horz.begin=pad[me.padOnContainerProp];vert.begin=pad.top;horzPercentTotal=horz.end=horz.flexSpace=containerSize.width+(padOnContainer?pad[me.padOnContainerProp]:-pad[me.padNotOnContainerProp]);vertPercentTotal=vert.end=vert.flexSpace=containerSize.height+(padOnContainer?pad.top:-pad.bottom);for(i=0;i<length;++i){childContext=childItems[i];childMargins=childContext.getMarginInfo();if(childContext.isHorz||childContext.isCenter){horz.addUnflexed(childMargins.width);horzPercentTotal-=childMargins.width;}
if(childContext.isVert||childContext.isCenter){vert.addUnflexed(childMargins.height);vertPercentTotal-=childMargins.height;}
if(!childContext.flex&&!childContext.percentage){if(childContext.isHorz||(childContext.isCenter&&childContext.collapseAxis==='horz')){size=childContext.getProp('width');horz.addUnflexed(size);if(childContext.collapseTarget){horzPercentTotal-=size;}}else if(childContext.isVert||(childContext.isCenter&&childContext.collapseAxis==='vert')){size=childContext.getProp('height');vert.addUnflexed(size);if(childContext.collapseTarget){vertPercentTotal-=size;}}}}
for(i=0;i<length;++i){childContext=childItems[i];childMargins=childContext.getMarginInfo();if(childContext.percentage){if(childContext.isHorz){size=Math.ceil(horzPercentTotal*childContext.percentage/100);size=childContext.setWidth(size);horz.addUnflexed(size);}else if(childContext.isVert){size=Math.ceil(vertPercentTotal*childContext.percentage/100);size=childContext.setHeight(size);vert.addUnflexed(size);}}}
for(i=0;i<length;++i){childContext=childItems[i];if(!childContext.isCenter){me.calculateChildAxis(childContext,horz);me.calculateChildAxis(childContext,vert);}}
if(me.finishAxis(ownerContext,vert)+me.finishAxis(ownerContext,horz)<2){me.done=false;}else{me.finishPositions(childItems);}},calculateChildAxis:function(childContext,axis){var collapseTarget=childContext.collapseTarget,setSizeMethod='set'+axis.sizePropCap,sizeProp=axis.sizeProp,childMarginSize=childContext.getMarginInfo()[sizeProp],region,isBegin,flex,pos,size;if(collapseTarget){region=collapseTarget.region;}else{region=childContext.region;flex=childContext.flex;}
isBegin=region==axis.borderBegin;if(!isBegin&&region!=axis.borderEnd){childContext[setSizeMethod](axis.end-axis.begin-childMarginSize);pos=axis.begin;}else{if(flex){size=Math.ceil(axis.flexSpace*(flex/axis.totalFlex));size=childContext[setSizeMethod](size);}else if(childContext.percentage){size=childContext.peek(sizeProp);}else{size=childContext.getProp(sizeProp);}
size+=childMarginSize;if(isBegin){pos=axis.begin;axis.begin+=size;}else{axis.end=pos=axis.end-size;}}
childContext.layoutPos[axis.posProp]=pos;},finishAxis:function(ownerContext,axis){var size=axis.end-axis.begin,center=ownerContext.centerRegion;if(center){center['set'+axis.sizePropCap](size-center.getMarginInfo()[axis.sizeProp]);center.layoutPos[axis.posProp]=axis.begin;}
return Ext.isNumber(size)?1:0;},finishPositions:function(childItems){var length=childItems.length,index,childContext,marginProp=this.horzMarginProp;for(index=0;index<length;++index){childContext=childItems[index];childContext.setProp('x',childContext.layoutPos.x+childContext.marginInfo[marginProp]);childContext.setProp('y',childContext.layoutPos.y+childContext.marginInfo.top);}},getLayoutItems:function(){var owner=this.owner,ownerItems=(owner&&owner.items&&owner.items.items)||[],length=ownerItems.length,items=[],i=0,ownerItem,placeholderFor;for(;i<length;i++){ownerItem=ownerItems[i];placeholderFor=ownerItem.placeholderFor;if(ownerItem.hidden||((!ownerItem.floated||ownerItem.isCollapsingOrExpanding===2)&&!(placeholderFor&&placeholderFor.isCollapsingOrExpanding===2))){items.push(ownerItem);}}
return items;},getPlaceholder:function(comp){return comp.getPlaceholder&&comp.getPlaceholder();},getSplitterTarget:function(splitter){var collapseTarget=splitter.collapseTarget;if(collapseTarget&&collapseTarget.collapsed){return collapseTarget.placeholder||collapseTarget;}
return collapseTarget;},isItemBoxParent:function(itemContext){return true;},isItemShrinkWrap:function(item){return true;},insertSplitter:function(item,index,hidden,splitterCfg){var region=item.region,splitter=Ext.apply({xtype:'bordersplitter',collapseTarget:item,id:item.id+'-splitter',hidden:hidden,canResize:item.splitterResize!==false,splitterFor:item},splitterCfg),at=index+((region==='south'||region==='east')?0:1);if(item.collapseMode==='mini'){splitter.collapsedCls=item.collapsedCls;}
item.splitter=this.owner.add(at,splitter);},onAdd:function(item,index){var me=this,placeholderFor=item.placeholderFor,region=item.region,split,hidden,cfg;me.callParent(arguments);if(region){Ext.apply(item,me.regionFlags[region]);if(item.initBorderRegion){item.initBorderRegion();}
if(region==='center'){me.centerRegion=item;}else{split=item.split;hidden=!!item.hidden;if(typeof split==='object'){cfg=split;split=true;}
if((item.isHorz||item.isVert)&&(split||item.collapseMode=='mini')){me.insertSplitter(item,index,hidden||!split,cfg);}}
if(!item.hasOwnProperty('collapseMode')){item.collapseMode=me.panelCollapseMode;}
if(!item.hasOwnProperty('animCollapse')){if(item.collapseMode!=='placeholder'){item.animCollapse=false;}else{item.animCollapse=me.panelCollapseAnimate;}}}else if(placeholderFor){Ext.apply(item,me.regionFlags[placeholderFor.region]);item.region=placeholderFor.region;item.weight=placeholderFor.weight;}},onDestroy:function(){this.centerRegion=null;this.callParent();},onRemove:function(item){var me=this,region=item.region,splitter=item.splitter;if(region){if(item.isCenter){me.centerRegion=null;}
delete item.isCenter;delete item.isHorz;delete item.isVert;if(splitter){me.owner.doRemove(splitter,true);delete item.splitter;}}
me.callParent(arguments);},regionMeta:{center:{splitterDelta:0},north:{splitterDelta:1},south:{splitterDelta:-1},west:{splitterDelta:1},east:{splitterDelta:-1}},regionFlags:{center:{isCenter:true,isHorz:false,isVert:false},north:{isCenter:false,isHorz:false,isVert:true,collapseDirection:'top'},south:{isCenter:false,isHorz:false,isVert:true,collapseDirection:'bottom'},west:{isCenter:false,isHorz:true,isVert:false,collapseDirection:'left'},east:{isCenter:false,isHorz:true,isVert:false,collapseDirection:'right'}},setupSplitterNeighbors:function(items){var edgeRegions={},length=items.length,touchedRegions=this.touchedRegions,i,j,center,count,edge,comp,region,splitter,touched;for(i=0;i<length;++i){comp=items[i].target;region=comp.region;if(comp.isCenter){center=comp;}else if(region){touched=touchedRegions[region];for(j=0,count=touched.length;j<count;++j){edge=edgeRegions[touched[j]];if(edge){edge.neighbors.push(comp);}}
if(comp.placeholderFor){splitter=comp.placeholderFor.splitter;}else{splitter=comp.splitter;}
if(splitter){splitter.neighbors=[];}
edgeRegions[region]=splitter;}}
if(center){touched=touchedRegions.center;for(j=0,count=touched.length;j<count;++j){edge=edgeRegions[touched[j]];if(edge){edge.neighbors.push(center);}}}},touchedRegions:{center:['north','south','east','west'],north:['north','east','west'],south:['south','east','west'],east:['east','north','south'],west:['west','north','south']},sizePolicies:{vert:{readsWidth:0,readsHeight:1,setsWidth:1,setsHeight:0},horz:{readsWidth:1,readsHeight:0,setsWidth:0,setsHeight:1},flexAll:{readsWidth:0,readsHeight:0,setsWidth:1,setsHeight:1}},getItemSizePolicy:function(item){var me=this,policies=this.sizePolicies,collapseTarget,size,policy,placeholderFor;if(item.isCenter){placeholderFor=item.placeholderFor;if(placeholderFor){if(placeholderFor.collapsedVertical()){return policies.vert;}
return policies.horz;}
if(item.collapsed){if(item.collapsedVertical()){return policies.vert;}
return policies.horz;}
return policies.flexAll;}
collapseTarget=item.collapseTarget;if(collapseTarget){return collapseTarget.isVert?policies.vert:policies.horz;}
if(item.region){if(item.isVert){size=item.height;policy=policies.vert;}else{size=item.width;policy=policies.horz;}
if(item.flex||(typeof size=='string'&&me.percentageRe.test(size))){return policies.flexAll;}
return policy;}
return me.autoSizePolicy;}},function(){var methods={addUnflexed:function(px){this.flexSpace=Math.max(this.flexSpace-px,0);}},props=this.prototype.axisProps;Ext.apply(props.horz,methods);Ext.apply(props.vert,methods);});Ext.define('Ext.form.FieldContainer',{extend:'Ext.container.Container',mixins:{labelable:'Ext.form.Labelable',fieldAncestor:'Ext.form.FieldAncestor'},requires:'Ext.layout.component.field.FieldContainer',alias:'widget.fieldcontainer',componentLayout:'fieldcontainer',componentCls:Ext.baseCSSPrefix+'form-fieldcontainer',customOverflowEl:'containerEl',childEls:['containerEl'],combineLabels:false,labelConnector:', ',combineErrors:false,maskOnDisable:false,invalidCls:'',fieldSubTpl:'<div id="{id}-containerEl" class="{containerElCls}">{%this.renderContainer(out,values)%}</div>',initComponent:function(){var me=this;me.initLabelable();me.initFieldAncestor();me.callParent();me.initMonitor();},getOverflowEl:function(){return this.containerEl;},onAdd:function(labelable){var me=this;if(Ext.isGecko&&me.layout.type==='absolute'&&!me.hideLabel&&me.labelAlign!=='top'){labelable.x+=(me.labelWidth+me.labelPad);}
me.callParent(arguments);if(me.combineLabels){labelable.oldHideLabel=labelable.hideLabel;labelable.hideLabel=true;}
me.updateLabel();},onRemove:function(labelable,isDestroying){var me=this;me.callParent(arguments);if(!isDestroying){if(me.combineLabels){labelable.hideLabel=labelable.oldHideLabel;}
me.updateLabel();}},initRenderTpl:function(){var me=this;if(!me.hasOwnProperty('renderTpl')){me.renderTpl=me.getTpl('labelableRenderTpl');}
return me.callParent();},initRenderData:function(){var me=this,data=me.callParent();data.containerElCls=me.containerElCls;return Ext.applyIf(data,me.getLabelableRenderData());},getFieldLabel:function(){var label=this.fieldLabel||'';if(!label&&this.combineLabels){label=Ext.Array.map(this.query('[isFieldLabelable]'),function(field){return field.getFieldLabel();}).join(this.labelConnector);}
return label;},getSubTplData:function(){var ret=this.initRenderData();Ext.apply(ret,this.subTplData);return ret;},getSubTplMarkup:function(){var me=this,tpl=me.getTpl('fieldSubTpl'),html;if(!tpl.renderContent){me.setupRenderTpl(tpl);}
html=tpl.apply(me.getSubTplData());return html;},updateLabel:function(){var me=this,label=me.labelEl;if(label){me.setFieldLabel(me.getFieldLabel());}},onFieldErrorChange:function(field,activeError){if(this.combineErrors){var me=this,oldError=me.getActiveError(),invalidFields=Ext.Array.filter(me.query('[isFormField]'),function(field){return field.hasActiveError();}),newErrors=me.getCombinedErrors(invalidFields);if(newErrors){me.setActiveErrors(newErrors);}else{me.unsetActiveError();}
if(oldError!==me.getActiveError()){me.doComponentLayout();}}},getCombinedErrors:function(invalidFields){var errors=[],f,fLen=invalidFields.length,field,activeErrors,a,aLen,error,label;for(f=0;f<fLen;f++){field=invalidFields[f];activeErrors=field.getActiveErrors();aLen=activeErrors.length;for(a=0;a<aLen;a++){error=activeErrors[a];label=field.getFieldLabel();errors.push((label?label+': ':'')+error);}}
return errors;},getTargetEl:function(){return this.containerEl;},applyTargetCls:function(targetCls){var containerElCls=this.containerElCls;this.containerElCls=containerElCls?containerElCls+' '+targetCls:targetCls;}});Ext.define('Ext.Editor',{extend:'Ext.container.Container',alias:'widget.editor',requires:['Ext.layout.container.Editor'],layout:'editor',allowBlur:true,revertInvalid:true,value:'',alignment:'c-c?',offsets:[0,0],shadow:'frame',constrain:false,swallowKeys:true,completeOnEnter:true,cancelOnEsc:true,updateEl:false,focusOnToFront:false,hidden:true,baseCls:Ext.baseCSSPrefix+'editor',initComponent:function(){var me=this,field=me.field=Ext.ComponentManager.create(me.field,'textfield');Ext.apply(field,{inEditor:true,msgTarget:field.msgTarget=='title'?'title':'qtip'});me.mon(field,{scope:me,blur:me.onFieldBlur,specialkey:me.onSpecialKey});if(field.grow){me.mon(field,'autosize',me.onFieldAutosize,me,{delay:1});}
me.floating={constrain:me.constrain};me.items=field;me.callParent(arguments);me.addEvents('beforestartedit','startedit','beforecomplete','complete','canceledit','specialkey');},onFieldAutosize:function(){this.updateLayout();},afterRender:function(ct,position){var me=this,field=me.field,inputEl=field.inputEl;me.callParent(arguments);if(inputEl){inputEl.dom.name='';if(me.swallowKeys){inputEl.swallowEvent(['keypress','keydown']);}}},onSpecialKey:function(field,event){var me=this,key=event.getKey(),complete=me.completeOnEnter&&key==event.ENTER,cancel=me.cancelOnEsc&&key==event.ESC;if(complete||cancel){event.stopEvent();Ext.defer(function(){if(complete){me.completeEdit();}else{me.cancelEdit();}
if(field.triggerBlur){field.triggerBlur(event);}},10);}
me.fireEvent('specialkey',me,field,event);},startEdit:function(el,value){var me=this,field=me.field;me.completeEdit();me.boundEl=Ext.get(el);value=Ext.isDefined(value)?value:Ext.String.trim(me.boundEl.dom.innerText||me.boundEl.dom.innerHTML);if(!me.rendered){if(me.ownerCt){me.parentEl=me.ownerCt.el;me.parentEl.position();}
me.render(me.parentEl||document.body);}
if(me.fireEvent('beforestartedit',me,me.boundEl,value)!==false){me.startValue=value;me.show();field.suspendEvents();field.reset();field.setValue(value);field.resumeEvents();me.realign(true);field.focus();if(field.autoSize){field.autoSize();}
me.editing=true;}},realign:function(autoSize){var me=this;if(autoSize===true){me.updateLayout();}
me.alignTo(me.boundEl,me.alignment,me.offsets);},completeEdit:function(remainVisible){var me=this,field=me.field,value;if(!me.editing){return;}
if(field.assertValue){field.assertValue();}
value=me.getValue();if(!field.isValid()){if(me.revertInvalid!==false){me.cancelEdit(remainVisible);}
return;}
if(String(value)===String(me.startValue)&&me.ignoreNoChange){me.hideEdit(remainVisible);return;}
if(me.fireEvent('beforecomplete',me,value,me.startValue)!==false){value=me.getValue();if(me.updateEl&&me.boundEl){me.boundEl.update(value);}
me.hideEdit(remainVisible);me.fireEvent('complete',me,value,me.startValue);}},onShow:function(){var me=this;me.callParent(arguments);if(me.hideEl!==false){me.boundEl.hide();}
me.fireEvent('startedit',me,me.boundEl,me.startValue);},cancelEdit:function(remainVisible){var me=this,startValue=me.startValue,field=me.field,value;if(me.editing){value=me.getValue();field.suspendEvents();me.setValue(startValue);field.resumeEvents();me.hideEdit(remainVisible);me.fireEvent('canceledit',me,value,startValue);}},hideEdit:function(remainVisible){if(remainVisible!==true){this.editing=false;this.hide();}},onFieldBlur:function(field,e){var me=this,target=Ext.Element.getActiveElement();if(me.allowBlur===true&&me.editing&&me.selectSameEditor!==true){me.completeEdit();}
if(Ext.fly(target).isFocusable()||target.getAttribute('tabIndex')){target.focus();}},onHide:function(){var me=this,field=me.field;if(me.editing){me.completeEdit();return;}
if(field.hasFocus&&field.triggerBlur){field.triggerBlur();}
if(field.collapse){field.collapse();}
if(me.hideEl!==false){me.boundEl.show();}
me.callParent(arguments);},setValue:function(value){this.field.setValue(value);},getValue:function(){return this.field.getValue();},beforeDestroy:function(){var me=this;Ext.destroy(me.field);delete me.field;delete me.parentEl;delete me.boundEl;me.callParent(arguments);}});Ext.define('Ext.view.View',{extend:'Ext.view.AbstractView',alternateClassName:'Ext.DataView',alias:'widget.dataview',deferHighlight:Ext.isIE7m?100:0,mouseOverOutBuffer:20,inputTagRe:/^textarea$|^input$/i,inheritableStatics:{EventMap:{mousedown:'MouseDown',mouseup:'MouseUp',click:'Click',dblclick:'DblClick',contextmenu:'ContextMenu',mouseover:'MouseOver',mouseout:'MouseOut',mouseenter:'MouseEnter',mouseleave:'MouseLeave',keydown:'KeyDown',focus:'Focus'}},initComponent:function(){var me=this;me.callParent();if(me.mouseOverOutBuffer){me.handleMouseOverOrOut=Ext.Function.createBuffered(me.handleMouseOverOrOut,me.mouseOverOutBuffer,me);me.lastMouseOverOutEvent=new Ext.EventObjectImpl();}
else if(me.deferHighlight){me.setHighlightedItem=Ext.Function.createBuffered(me.setHighlightedItem,me.deferHighlight,me);}},addCmpEvents:function(){this.addEvents('beforeitemmousedown','beforeitemmouseup','beforeitemmouseenter','beforeitemmouseleave','beforeitemclick','beforeitemdblclick','beforeitemcontextmenu','beforeitemkeydown','itemmousedown','itemmouseup','itemmouseenter','itemmouseleave','itemclick','itemdblclick','itemcontextmenu','itemkeydown','beforecontainermousedown','beforecontainermouseup','beforecontainermouseover','beforecontainermouseout','beforecontainerclick','beforecontainerdblclick','beforecontainercontextmenu','beforecontainerkeydown','containermouseup','containermouseover','containermouseout','containerclick','containerdblclick','containercontextmenu','containerkeydown','selectionchange','beforeselect','beforedeselect','select','deselect','focuschange','highlightitem','unhighlightitem');},getFocusEl:function(){return this.getTargetEl();},afterRender:function(){var me=this,onMouseOverOut=me.mouseOverOutBuffer?me.onMouseOverOut:me.handleMouseOverOrOut;me.callParent();me.mon(me.getTargetEl(),{scope:me,freezeEvent:true,click:me.handleEvent,mousedown:me.handleEvent,mouseup:me.handleEvent,dblclick:me.handleEvent,contextmenu:me.handleEvent,keydown:me.handleEvent,mouseover:onMouseOverOut,mouseout:onMouseOverOut});},onMouseOverOut:function(e){var me=this;me.lastMouseOverOutEvent.setEvent(e.browserEvent,true);me.handleMouseOverOrOut(me.lastMouseOverOutEvent);},handleMouseOverOrOut:function(e){var me=this,isMouseout=e.type==='mouseout',method=isMouseout?e.getRelatedTarget:e.getTarget,nowOverItem=method.call(e,me.itemSelector)||method.call(e,me.dataRowSelector);if(!me.mouseOverItem||nowOverItem!==me.mouseOverItem){if(me.mouseOverItem){e.item=me.mouseOverItem;e.newType='mouseleave';me.handleEvent(e);}
me.mouseOverItem=nowOverItem;if(me.mouseOverItem){e.item=me.mouseOverItem;e.newType='mouseenter';me.handleEvent(e);}}},handleEvent:function(e){var me=this,key=e.type=='keydown'&&e.getKey();if(me.processUIEvent(e)!==false){me.processSpecialEvent(e);}
if(key===e.SPACE){if(!me.inputTagRe.test(e.getTarget().tagName)){e.stopEvent();}}},processItemEvent:Ext.emptyFn,processContainerEvent:Ext.emptyFn,processSpecialEvent:Ext.emptyFn,processUIEvent:function(e){if(!Ext.getBody().isAncestor(e.target)){return;}
var me=this,item=e.getTarget(me.getItemSelector(),me.getTargetEl()),map=this.statics().EventMap,index,record,type=e.type,newType=e.type,sm;if(e.newType){newType=e.newType;item=e.item;}
if(!item&&type=='keydown'){sm=me.getSelectionModel();record=sm.lastFocused||sm.getLastSelected();if(record){item=me.getNode(record,true);}}
if(item){if(!record){record=me.getRecord(item);}
index=me.indexInStore?me.indexInStore(record):me.indexOf(item);if(!record||me.processItemEvent(record,item,index,e)===false){return false;}
if((me['onBeforeItem'+map[newType]](record,item,index,e)===false)||(me.fireEvent('beforeitem'+newType,me,record,item,index,e)===false)||(me['onItem'+map[newType]](record,item,index,e)===false)){return false;}
me.fireEvent('item'+newType,me,record,item,index,e);}
else{if((me.processContainerEvent(e)===false)||(me['onBeforeContainer'+map[type]](e)===false)||(me.fireEvent('beforecontainer'+type,me,e)===false)||(me['onContainer'+map[type]](e)===false)){return false;}
me.fireEvent('container'+type,me,e);}
return true;},onItemMouseEnter:function(record,item,index,e){if(this.trackOver){this.highlightItem(item);}},onItemMouseLeave:function(record,item,index,e){if(this.trackOver){this.clearHighlight();}},onItemMouseDown:Ext.emptyFn,onItemMouseUp:Ext.emptyFn,onItemFocus:Ext.emptyFn,onItemClick:Ext.emptyFn,onItemDblClick:Ext.emptyFn,onItemContextMenu:Ext.emptyFn,onItemKeyDown:Ext.emptyFn,onBeforeItemMouseDown:Ext.emptyFn,onBeforeItemMouseUp:Ext.emptyFn,onBeforeItemFocus:Ext.emptyFn,onBeforeItemMouseEnter:Ext.emptyFn,onBeforeItemMouseLeave:Ext.emptyFn,onBeforeItemClick:Ext.emptyFn,onBeforeItemDblClick:Ext.emptyFn,onBeforeItemContextMenu:Ext.emptyFn,onBeforeItemKeyDown:Ext.emptyFn,onContainerMouseDown:Ext.emptyFn,onContainerMouseUp:Ext.emptyFn,onContainerMouseOver:Ext.emptyFn,onContainerMouseOut:Ext.emptyFn,onContainerClick:Ext.emptyFn,onContainerDblClick:Ext.emptyFn,onContainerContextMenu:Ext.emptyFn,onContainerKeyDown:Ext.emptyFn,onBeforeContainerMouseDown:Ext.emptyFn,onBeforeContainerMouseUp:Ext.emptyFn,onBeforeContainerMouseOver:Ext.emptyFn,onBeforeContainerMouseOut:Ext.emptyFn,onBeforeContainerClick:Ext.emptyFn,onBeforeContainerDblClick:Ext.emptyFn,onBeforeContainerContextMenu:Ext.emptyFn,onBeforeContainerKeyDown:Ext.emptyFn,setHighlightedItem:function(item){var me=this,highlighted=me.highlightedItem,overItemCls=me.overItemCls,beforeOverItemCls=me.beforeOverItemCls,previous;if(highlighted!=item){if(highlighted){Ext.fly(highlighted).removeCls(overItemCls);previous=highlighted.previousSibling;if(beforeOverItemCls&&previous){Ext.fly(previous).removeCls(beforeOverItemCls);}
me.fireEvent('unhighlightitem',me,highlighted);}
me.highlightedItem=item;if(item){Ext.fly(item).addCls(me.overItemCls);previous=item.previousSibling;if(beforeOverItemCls&&previous){Ext.fly(previous).addCls(beforeOverItemCls);}
me.fireEvent('highlightitem',me,item);}}},highlightItem:function(item){this.setHighlightedItem(item);},clearHighlight:function(){this.setHighlightedItem(undefined);},onUpdate:function(store,record){var me=this,node,newNode,highlighted;if(me.viewReady){node=me.getNode(record);newNode=me.callParent(arguments);highlighted=me.highlightedItem;if(highlighted&&highlighted===node){delete me.highlightedItem;if(newNode){me.highlightItem(newNode);}}}},refresh:function(){this.clearHighlight();this.callParent(arguments);},focusNode:function(rec){var me=this,node=me.getNode(rec,true),el=me.el,adjustmentY=0,adjustmentX=0,elRegion=el.getRegion(),nodeRegion;elRegion.bottom=elRegion.top+el.dom.clientHeight;elRegion.right=elRegion.left+el.dom.clientWidth;if(node){nodeRegion=Ext.fly(node).getRegion();if(nodeRegion.top<elRegion.top){adjustmentY=nodeRegion.top-elRegion.top;}else if(nodeRegion.bottom>elRegion.bottom){adjustmentY=nodeRegion.bottom-elRegion.bottom;}
if(nodeRegion.left<elRegion.left){adjustmentX=nodeRegion.left-elRegion.left;}else if(nodeRegion.right>elRegion.right){adjustmentX=nodeRegion.right-elRegion.right;}
if(adjustmentX||adjustmentY){me.scrollBy(adjustmentX,adjustmentY,false);}
el.focus();}}});Ext.define('Ext.form.field.Radio',{extend:'Ext.form.field.Checkbox',alias:['widget.radiofield','widget.radio'],alternateClassName:'Ext.form.Radio',requires:['Ext.form.RadioManager'],isRadio:true,focusCls:'form-radio-focus',inputType:'radio',ariaRole:'radio',formId:null,getGroupValue:function(){var selected=this.getManager().getChecked(this.name,this.getFormId());return selected?selected.inputValue:null;},onBoxClick:function(e){var me=this;if(!me.disabled&&!me.readOnly){this.setValue(true);}},onRemoved:function(){this.callParent(arguments);this.formId=null;},setValue:function(v){var me=this,active;if(Ext.isBoolean(v)){me.callParent(arguments);}else{active=me.getManager().getWithValue(me.name,v,me.getFormId()).getAt(0);if(active){active.setValue(true);}}
return me;},getSubmitValue:function(){return this.checked?this.inputValue:null;},getModelData:function(){return this.getSubmitData();},onChange:function(newVal,oldVal){var me=this,r,rLen,radio,radios;me.callParent(arguments);if(newVal){radios=me.getManager().getByName(me.name,me.getFormId()).items;rLen=radios.length;for(r=0;r<rLen;r++){radio=radios[r];if(radio!==me){radio.setValue(false);}}}},getManager:function(){return Ext.form.RadioManager;}});Ext.define('Ext.app.Controller',{requires:['Ext.app.EventBus','Ext.ModelManager','Ext.data.StoreManager','Ext.ComponentManager','Ext.app.domain.Global','Ext.app.domain.Component','Ext.app.domain.Store'],uses:['Ext.app.domain.Controller'],mixins:{observable:'Ext.util.Observable'},statics:{strings:{model:{getter:'getModel',upper:'Model'},view:{getter:'getView',upper:'View'},controller:{getter:'getController',upper:'Controller'},store:{getter:'getStore',upper:'Store'}},controllerRegex:/^(.*)\.controller\./,createGetter:function(baseGetter,name){return function(){return this[baseGetter](name);};},getGetterName:function(name,kindUpper){var fn='get',parts=name.split('.'),numParts=parts.length,index;for(index=0;index<numParts;index++){fn+=Ext.String.capitalize(parts[index]);}
fn+=kindUpper;return fn;},processDependencies:function(cls,requires,namespace,kind,names){if(!names||!names.length){return;}
var me=this,strings=me.strings[kind],o,absoluteName,shortName,name,j,subLn,getterName,getter;if(!Ext.isArray(names)){names=[names];}
for(j=0,subLn=names.length;j<subLn;j++){name=names[j];o=me.getFullName(name,kind,namespace);absoluteName=o.absoluteName;shortName=o.shortName;requires.push(absoluteName);getterName=me.getGetterName(shortName,strings.upper);cls[getterName]=getter=me.createGetter(strings.getter,name);if(kind!=='controller'){getter['Ext.app.getter']=true;}}},getFullName:function(name,kind,namespace){var shortName=name,sep,absoluteName;if((sep=name.indexOf('@'))>0){shortName=name.substring(0,sep);absoluteName=name.substring(sep+1)+'.'+shortName;}
else if(name.indexOf('.')>0&&(Ext.ClassManager.isCreated(name)||Ext.Loader.isAClassNameWithAKnownPrefix(name))){absoluteName=name;}
else{if(namespace){absoluteName=namespace+'.'+kind+'.'+name;shortName=name;}
else{absoluteName=name;}}
return{absoluteName:absoluteName,shortName:shortName};}},application:null,onClassExtended:function(cls,data,hooks){var onBeforeClassCreated=hooks.onBeforeCreated;hooks.onBeforeCreated=function(cls,data){var Controller=Ext.app.Controller,ctrlRegex=Controller.controllerRegex,requires=[],className,namespace,requires,proto,match;proto=cls.prototype;className=Ext.getClassName(cls);namespace=data.$namespace||Ext.app.getNamespace(className)||((match=ctrlRegex.exec(className))&&match[1]);if(namespace){proto.$namespace=namespace;}
Controller.processDependencies(proto,requires,namespace,'model',data.models);Controller.processDependencies(proto,requires,namespace,'view',data.views);Controller.processDependencies(proto,requires,namespace,'store',data.stores);Controller.processDependencies(proto,requires,namespace,'controller',data.controllers);Ext.require(requires,Ext.Function.pass(onBeforeClassCreated,arguments,this));};},constructor:function(config){var me=this;me.mixins.observable.constructor.call(me,config);if(me.refs){me.ref(me.refs);}
me.eventbus=Ext.app.EventBus;me.initAutoGetters();},initAutoGetters:function(){var proto=this.self.prototype,prop,fn;for(prop in proto){fn=proto[prop];if(fn&&fn['Ext.app.getter']){fn.call(this);}}},doInit:function(app){var me=this;if(!me._initialized){me.init(app);me._initialized=true;}},finishInit:function(app){var me=this,controllers=me.controllers,controller,i,l;if(me._initialized&&controllers&&controllers.length){for(i=0,l=controllers.length;i<l;i++){controller=me.getController(controllers[i]);controller.finishInit(app);}}},init:Ext.emptyFn,onLaunch:Ext.emptyFn,ref:function(refs){var me=this,i=0,length=refs.length,info,ref,fn;refs=Ext.Array.from(refs);me.references=me.references||[];for(;i<length;i++){info=refs[i];ref=info.ref;fn='get'+Ext.String.capitalize(ref);if(!me[fn]){me[fn]=Ext.Function.pass(me.getRef,[ref,info],me);}
me.references.push(ref.toLowerCase());}},addRef:function(refs){this.ref(refs);},getRef:function(ref,info,config){var me=this,refCache=me.refCache||(me.refCache={}),cached=refCache[ref];info=info||{};config=config||{};Ext.apply(info,config);if(info.forceCreate){return Ext.ComponentManager.create(info,'component');}
if(!cached){if(info.selector){refCache[ref]=cached=Ext.ComponentQuery.query(info.selector)[0];}
if(!cached&&info.autoCreate){refCache[ref]=cached=Ext.ComponentManager.create(info,'component');}
if(cached){cached.on('beforedestroy',function(){refCache[ref]=null;});}}
return cached;},hasRef:function(ref){var references=this.references;return references&&Ext.Array.indexOf(references,ref.toLowerCase())!==-1;},control:function(selectors,listeners,controller){var me=this,ctrl=controller,obj;if(Ext.isString(selectors)){obj={};obj[selectors]=listeners;}
else{obj=selectors;ctrl=listeners;}
me.eventbus.control(obj,ctrl||me);},listen:function(to,controller){this.eventbus.listen(to,controller||this);},getController:function(id){var me=this,app=me.application;if(id===me.id){return me;}
return app&&app.getController(id);},getStore:function(name){var storeId,store;storeId=(name.indexOf('@')==-1)?name:name.split('@')[0];store=Ext.StoreManager.get(storeId);if(!store){name=Ext.app.Controller.getFullName(name,'store',this.$namespace);if(name){store=Ext.create(name.absoluteName,{storeId:storeId});}}
return store;},getModel:function(model){var name=Ext.app.Controller.getFullName(model,'model',this.$namespace);return name&&Ext.ModelManager.getModel(name.absoluteName);},getView:function(view){var name=Ext.app.Controller.getFullName(view,'view',this.$namespace);return name&&Ext.ClassManager.get(name.absoluteName);},getApplication:function(){return this.application;}});Ext.define('Ext.panel.DD',{extend:'Ext.dd.DragSource',requires:['Ext.panel.Proxy'],constructor:function(panel,cfg){var me=this;me.panel=panel;me.dragData={panel:panel};me.panelProxy=new Ext.panel.Proxy(panel,cfg);me.proxy=me.panelProxy.proxy;me.callParent([panel.el,cfg]);me.setupEl(panel);},setupEl:function(panel){var me=this,header=panel.header,el=panel.body;if(header){me.setHandleElId(header.id);el=header.el;}
if(el){el.setStyle('cursor','move');me.scroll=false;}else{panel.on('boxready',me.setupEl,me,{single:true});}},showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(x,y){this.panelProxy.show();},b4MouseDown:function(e){var x=e.getPageX(),y=e.getPageY();this.autoOffset(x,y);},onInitDrag:function(x,y){this.onStartDrag(x,y);return true;},createFrame:Ext.emptyFn,getDragEl:function(e){var ghost=this.panelProxy.ghost;if(ghost){return ghost.el.dom;}},endDrag:function(e){this.panelProxy.hide();this.panel.saveState();},autoOffset:function(x,y){x-=this.startPageX;y-=this.startPageY;this.setDelta(x,y);},onInvalidDrop:function(target,e,id){var me=this;if(me.beforeInvalidDrop(target,e,id)!==false){if(me.cachedTarget){if(me.cachedTarget.isNotifyTarget){me.cachedTarget.notifyOut(me,e,me.dragData);}
me.cacheTarget=null;}
if(me.afterInvalidDrop){me.afterInvalidDrop(e,id);}}}});Ext.define('Ext.form.field.TextArea',{extend:'Ext.form.field.Text',alias:['widget.textareafield','widget.textarea'],alternateClassName:'Ext.form.TextArea',requires:['Ext.XTemplate','Ext.layout.component.field.TextArea','Ext.util.DelayedTask'],fieldSubTpl:['<textarea id="{id}" {inputAttrTpl}','<tpl if="name"> name="{name}"</tpl>','<tpl if="rows"> rows="{rows}" </tpl>','<tpl if="cols"> cols="{cols}" </tpl>','<tpl if="placeholder"> placeholder="{placeholder}"</tpl>','<tpl if="size"> size="{size}"</tpl>','<tpl if="maxLength !== undefined"> maxlength="{maxLength}"</tpl>','<tpl if="readOnly"> readonly="readonly"</tpl>','<tpl if="disabled"> disabled="disabled"</tpl>','<tpl if="tabIdx"> tabIndex="{tabIdx}"</tpl>',' class="{fieldCls} {typeCls} {inputCls}" ','<tpl if="fieldStyle"> style="{fieldStyle}"</tpl>',' autocomplete="off">\n','<tpl if="value">{[Ext.util.Format.htmlEncode(values.value)]}</tpl>','</textarea>',{disableFormats:true}],growMin:60,growMax:1000,growAppend:'\n-',cols:20,rows:4,enterIsSpecial:false,preventScrollbars:false,componentLayout:'textareafield',setGrowSizePolicy:Ext.emptyFn,returnRe:/\r/g,inputCls:Ext.baseCSSPrefix+'form-textarea',getSubTplData:function(){var me=this,fieldStyle=me.getFieldStyle(),ret=me.callParent();if(me.grow){if(me.preventScrollbars){ret.fieldStyle=(fieldStyle||'')+';overflow:hidden;height:'+me.growMin+'px';}}
Ext.applyIf(ret,{cols:me.cols,rows:me.rows});return ret;},afterRender:function(){var me=this;me.callParent(arguments);me.needsMaxCheck=me.enforceMaxLength&&me.maxLength!==Number.MAX_VALUE&&!Ext.supports.TextAreaMaxLength;if(me.needsMaxCheck){me.inputEl.on('paste',me.onPaste,me);}},transformRawValue:function(value){return this.stripReturns(value);},transformOriginalValue:function(value){return this.stripReturns(value);},getValue:function(){return this.stripReturns(this.callParent());},valueToRaw:function(value){value=this.stripReturns(value);return this.callParent([value]);},stripReturns:function(value){if(value&&typeof value==='string'){value=value.replace(this.returnRe,'');}
return value;},onPaste:function(e){var me=this;if(!me.pasteTask){me.pasteTask=new Ext.util.DelayedTask(me.pasteCheck,me);}
me.pasteTask.delay(1);},pasteCheck:function(){var me=this,value=me.getValue(),max=me.maxLength;if(value.length>max){value=value.substr(0,max);me.setValue(value);}},fireKey:function(e){var me=this,key=e.getKey(),value;if(e.isSpecialKey()&&(me.enterIsSpecial||(key!==e.ENTER||e.hasModifier()))){me.fireEvent('specialkey',me,e);}
if(me.needsMaxCheck&&key!==e.BACKSPACE&&key!==e.DELETE&&!e.isNavKeyPress()&&!me.isCutCopyPasteSelectAll(e,key)){value=me.getValue();if(value.length>=me.maxLength){e.stopEvent();}}},isCutCopyPasteSelectAll:function(e,key){if(e.ctrlKey){return key===e.A||key===e.C||key===e.V||key===e.X;}
return false;},autoSize:function(){var me=this,height;if(me.grow&&me.rendered){me.updateLayout();height=me.inputEl.getHeight();if(height!==me.lastInputHeight){me.fireEvent('autosize',me,height);me.lastInputHeight=height;}}},initAria:function(){this.callParent(arguments);this.getActionEl().dom.setAttribute('aria-multiline',true);},beforeDestroy:function(){var task=this.pasteTask;if(task){task.cancel();this.pasteTask=null;}
this.callParent();}});Ext.define('MP.desktop.TrayClock',{extend:'Ext.toolbar.TextItem',alias:'widget.trayclock',cls:'mp-desktop-trayclock',html:'&#160;',timeFormat:_('D d M, g:i A'),tpl:'{time}',initComponent:function(){var me=this;me.callParent();if(typeof(me.tpl)=='string'){me.tpl=new Ext.XTemplate(me.tpl);}},afterRender:function(){var me=this;Ext.Function.defer(me.updateTime,100,me);me.callParent();},onDestroy:function(){var me=this;if(me.timer){window.clearTimeout(me.timer);me.timer=null;}
me.callParent();},updateTime:function(){var me=this,time=Ext.Date.format(new Date(),me.timeFormat),text=me.tpl.apply({time:time});if(me.lastText!=text){me.setText(text);me.lastText=text;}
me.timer=Ext.Function.defer(me.updateTime,10000,me);}});Ext.define('Ext.picker.Date',{extend:'Ext.Component',requires:['Ext.XTemplate','Ext.button.Button','Ext.button.Split','Ext.util.ClickRepeater','Ext.util.KeyNav','Ext.EventObject','Ext.fx.Manager','Ext.picker.Month'],alias:'widget.datepicker',alternateClassName:'Ext.DatePicker',childEls:['innerEl','eventEl','prevEl','nextEl','middleBtnEl','footerEl'],border:true,renderTpl:['<div id="{id}-innerEl" role="grid">','<div role="presentation" class="{baseCls}-header">','<a id="{id}-prevEl" class="{baseCls}-prev {baseCls}-arrow" href="#" role="button" title="{prevText}" hidefocus="on" ></a>','<div class="{baseCls}-month" id="{id}-middleBtnEl">{%this.renderMonthBtn(values, out)%}</div>','<a id="{id}-nextEl" class="{baseCls}-next {baseCls}-arrow" href="#" role="button" title="{nextText}" hidefocus="on" ></a>','</div>','<table id="{id}-eventEl" class="{baseCls}-inner" cellspacing="0" role="grid">','<thead role="presentation"><tr role="row">','<tpl for="dayNames">','<th role="columnheader" class="{parent.baseCls}-column-header" title="{.}">','<div class="{parent.baseCls}-column-header-inner">{.:this.firstInitial}</div>','</th>','</tpl>','</tr></thead>','<tbody role="presentation"><tr role="row">','<tpl for="days">','{#:this.isEndOfWeek}','<td role="gridcell" id="{[Ext.id()]}">','<a role="presentation" hidefocus="on" class="{parent.baseCls}-date" href="#"></a>','</td>','</tpl>','</tr></tbody>','</table>','<tpl if="showToday">','<div id="{id}-footerEl" role="presentation" class="{baseCls}-footer">{%this.renderTodayBtn(values, out)%}</div>','</tpl>','</div>',{firstInitial:function(value){return Ext.picker.Date.prototype.getDayInitial(value);},isEndOfWeek:function(value){value--;var end=value%7===0&&value!==0;return end?'</tr><tr role="row">':'';},renderTodayBtn:function(values,out){Ext.DomHelper.generateMarkup(values.$comp.todayBtn.getRenderTree(),out);},renderMonthBtn:function(values,out){Ext.DomHelper.generateMarkup(values.$comp.monthBtn.getRenderTree(),out);}}],todayText:'Today',ariaTitle:'Date Picker: {0}',ariaTitleDateFormat:'F d, Y',todayTip:'{0} (Spacebar)',minText:'This date is before the minimum date',maxText:'This date is after the maximum date',disabledDaysText:'Disabled',disabledDatesText:'Disabled',nextText:'Next Month (Control+Right)',prevText:'Previous Month (Control+Left)',monthYearText:'Choose a month (Control+Up/Down to move years)',monthYearFormat:'F Y',startDay:0,showToday:true,disableAnim:false,baseCls:Ext.baseCSSPrefix+'datepicker',longDayFormat:'F d, Y',focusOnShow:false,focusOnSelect:true,initHour:12,numDays:42,initComponent:function(){var me=this,clearTime=Ext.Date.clearTime;me.selectedCls=me.baseCls+'-selected';me.disabledCellCls=me.baseCls+'-disabled';me.prevCls=me.baseCls+'-prevday';me.activeCls=me.baseCls+'-active';me.cellCls=me.baseCls+'-cell';me.nextCls=me.baseCls+'-prevday';me.todayCls=me.baseCls+'-today';if(!me.format){me.format=Ext.Date.defaultFormat;}
if(!me.dayNames){me.dayNames=Ext.Date.dayNames;}
me.dayNames=me.dayNames.slice(me.startDay).concat(me.dayNames.slice(0,me.startDay));me.callParent();me.value=me.value?clearTime(me.value,true):clearTime(new Date());me.addEvents('select');me.initDisabledDays();},beforeRender:function(){var me=this,days=new Array(me.numDays),today=Ext.Date.format(new Date(),me.format);if(me.up('menu')){me.addCls(Ext.baseCSSPrefix+'menu');}
me.monthBtn=new Ext.button.Split({ownerCt:me,ownerLayout:me.getComponentLayout(),text:'',tooltip:me.monthYearText,listeners:{click:me.showMonthPicker,arrowclick:me.showMonthPicker,scope:me}});if(me.showToday){me.todayBtn=new Ext.button.Button({ownerCt:me,ownerLayout:me.getComponentLayout(),text:Ext.String.format(me.todayText,today),tooltip:Ext.String.format(me.todayTip,today),tooltipType:'title',handler:me.selectToday,scope:me});}
me.callParent();Ext.applyIf(me,{renderData:{}});Ext.apply(me.renderData,{dayNames:me.dayNames,showToday:me.showToday,prevText:me.prevText,nextText:me.nextText,days:days});me.protoEl.unselectable();},finishRenderChildren:function(){var me=this;me.callParent();me.monthBtn.finishRender();if(me.showToday){me.todayBtn.finishRender();}},onRender:function(container,position){var me=this;me.callParent(arguments);me.cells=me.eventEl.select('tbody td');me.textNodes=me.eventEl.query('tbody td a');me.mon(me.eventEl,{scope:me,mousewheel:me.handleMouseWheel,click:{fn:me.handleDateClick,delegate:'a.'+me.baseCls+'-date'}});},initEvents:function(){var me=this,eDate=Ext.Date,day=eDate.DAY;me.callParent();me.prevRepeater=new Ext.util.ClickRepeater(me.prevEl,{handler:me.showPrevMonth,scope:me,preventDefault:true,stopDefault:true});me.nextRepeater=new Ext.util.ClickRepeater(me.nextEl,{handler:me.showNextMonth,scope:me,preventDefault:true,stopDefault:true});me.keyNav=new Ext.util.KeyNav(me.eventEl,Ext.apply({scope:me,left:function(e){if(e.ctrlKey){me.showPrevMonth();}else{me.update(eDate.add(me.activeDate,day,-1));}},right:function(e){if(e.ctrlKey){me.showNextMonth();}else{me.update(eDate.add(me.activeDate,day,1));}},up:function(e){if(e.ctrlKey){me.showNextYear();}else{me.update(eDate.add(me.activeDate,day,-7));}},down:function(e){if(e.ctrlKey){me.showPrevYear();}else{me.update(eDate.add(me.activeDate,day,7));}},pageUp:function(e){if(e.altKey){me.showPrevYear();}else{me.showPrevMonth();}},pageDown:function(e){if(e.altKey){me.showNextYear();}else{me.showNextMonth();}},tab:function(e){me.doCancelFieldFocus=true;me.handleTabClick(e);delete me.doCancelFieldFocus;return true;},enter:function(e){e.stopPropagation();return true;},home:function(e){me.update(eDate.getFirstDateOfMonth(me.activeDate));},end:function(e){me.update(eDate.getLastDateOfMonth(me.activeDate));}},me.keyNavConfig));if(me.showToday){me.todayKeyListener=me.eventEl.addKeyListener(Ext.EventObject.SPACE,me.selectToday,me);}
me.update(me.value);},handleTabClick:function(e){var me=this,t=me.getSelectedDate(me.activeDate),handler=me.handler;if(!me.disabled&&t.dateValue&&!Ext.fly(t.parentNode).hasCls(me.disabledCellCls)){me.doCancelFocus=me.focusOnSelect===false;me.setValue(new Date(t.dateValue));delete me.doCancelFocus;me.fireEvent('select',me,me.value);if(handler){handler.call(me.scope||me,me,me.value);}
me.onSelect();}},getSelectedDate:function(date){var me=this,t=date.getTime(),cells=me.cells,cls=me.selectedCls,cellItems=cells.elements,c,cLen=cellItems.length,cell;cells.removeCls(cls);for(c=0;c<cLen;c++){cell=Ext.fly(cellItems[c]);if(cell.dom.firstChild.dateValue==t){return cell.dom.firstChild;}}
return null;},initDisabledDays:function(){var me=this,dd=me.disabledDates,re='(?:',len,d,dLen,dI;if(!me.disabledDatesRE&&dd){len=dd.length-1;dLen=dd.length;for(d=0;d<dLen;d++){dI=dd[d];re+=Ext.isDate(dI)?'^'+Ext.String.escapeRegex(Ext.Date.dateFormat(dI,me.format))+'$':dI;if(d!=len){re+='|';}}
me.disabledDatesRE=new RegExp(re+')');}},setDisabledDates:function(dd){var me=this;if(Ext.isArray(dd)){me.disabledDates=dd;me.disabledDatesRE=null;}else{me.disabledDatesRE=dd;}
me.initDisabledDays();me.update(me.value,true);return me;},setDisabledDays:function(dd){this.disabledDays=dd;return this.update(this.value,true);},setMinDate:function(dt){this.minDate=dt;return this.update(this.value,true);},setMaxDate:function(dt){this.maxDate=dt;return this.update(this.value,true);},setValue:function(value){this.value=Ext.Date.clearTime(value,true);return this.update(this.value);},getValue:function(){return this.value;},getDayInitial:function(value){return value.substr(0,1);},focus:function(){this.update(this.activeDate);},onEnable:function(){this.callParent();this.setDisabledStatus(false);this.update(this.activeDate);},onDisable:function(){this.callParent();this.setDisabledStatus(true);},setDisabledStatus:function(disabled){var me=this;me.keyNav.setDisabled(disabled);me.prevRepeater.setDisabled(disabled);me.nextRepeater.setDisabled(disabled);if(me.showToday){me.todayKeyListener.setDisabled(disabled);me.todayBtn.setDisabled(disabled);}},getActive:function(){return this.activeDate||this.value;},runAnimation:function(isHide){var picker=this.monthPicker,options={duration:200,callback:function(){if(isHide){picker.hide();}else{picker.show();}}};if(isHide){picker.el.slideOut('t',options);}else{picker.el.slideIn('t',options);}},hideMonthPicker:function(animate){var me=this,picker=me.monthPicker;if(picker){if(me.shouldAnimate(animate)){me.runAnimation(true);}else{picker.hide();}}
return me;},showMonthPicker:function(animate){var me=this,picker;if(me.rendered&&!me.disabled){picker=me.createMonthPicker();picker.setValue(me.getActive());picker.setSize(me.getSize());picker.setPosition(-1,-1);if(me.shouldAnimate(animate)){me.runAnimation(false);}else{picker.show();}}
return me;},shouldAnimate:function(animate){return Ext.isDefined(animate)?animate:!this.disableAnim;},createMonthPicker:function(){var me=this,picker=me.monthPicker;if(!picker){me.monthPicker=picker=new Ext.picker.Month({renderTo:me.el,floating:true,shadow:false,small:me.showToday===false,listeners:{scope:me,cancelclick:me.onCancelClick,okclick:me.onOkClick,yeardblclick:me.onOkClick,monthdblclick:me.onOkClick}});if(!me.disableAnim){picker.el.setStyle('display','none');}
me.on('beforehide',Ext.Function.bind(me.hideMonthPicker,me,[false]));}
return picker;},onOkClick:function(picker,value){var me=this,month=value[0],year=value[1],date=new Date(year,month,me.getActive().getDate());if(date.getMonth()!==month){date=Ext.Date.getLastDateOfMonth(new Date(year,month,1));}
me.setValue(date);me.hideMonthPicker();},onCancelClick:function(){this.selectedUpdate(this.activeDate);this.hideMonthPicker();},showPrevMonth:function(e){return this.setValue(Ext.Date.add(this.activeDate,Ext.Date.MONTH,-1));},showNextMonth:function(e){return this.setValue(Ext.Date.add(this.activeDate,Ext.Date.MONTH,1));},showPrevYear:function(){return this.setValue(Ext.Date.add(this.activeDate,Ext.Date.YEAR,-1));},showNextYear:function(){return this.setValue(Ext.Date.add(this.activeDate,Ext.Date.YEAR,1));},handleMouseWheel:function(e){e.stopEvent();if(!this.disabled){var delta=e.getWheelDelta();if(delta>0){this.showPrevMonth();}else if(delta<0){this.showNextMonth();}}},handleDateClick:function(e,t){var me=this,handler=me.handler;e.stopEvent();if(!me.disabled&&t.dateValue&&!Ext.fly(t.parentNode).hasCls(me.disabledCellCls)){me.doCancelFocus=me.focusOnSelect===false;me.setValue(new Date(t.dateValue));delete me.doCancelFocus;me.fireEvent('select',me,me.value);if(handler){handler.call(me.scope||me,me,me.value);}
me.onSelect();}},onSelect:function(){if(this.hideOnSelect){this.hide();}},selectToday:function(){var me=this,btn=me.todayBtn,handler=me.handler;if(btn&&!btn.disabled){me.setValue(Ext.Date.clearTime(new Date()));me.fireEvent('select',me,me.value);if(handler){handler.call(me.scope||me,me,me.value);}
me.onSelect();}
return me;},selectedUpdate:function(date){var me=this,t=date.getTime(),cells=me.cells,cls=me.selectedCls,cellItems=cells.elements,c,cLen=cellItems.length,cell;cells.removeCls(cls);for(c=0;c<cLen;c++){cell=Ext.fly(cellItems[c]);if(cell.dom.firstChild.dateValue==t){me.fireEvent('highlightitem',me,cell);cell.addCls(cls);if(me.isVisible()&&!me.doCancelFocus){Ext.fly(cell.dom.firstChild).focus(50);}
break;}}},fullUpdate:function(date){var me=this,cells=me.cells.elements,textNodes=me.textNodes,disabledCls=me.disabledCellCls,eDate=Ext.Date,i=0,extraDays=0,visible=me.isVisible(),newDate=+eDate.clearTime(date,true),today=+eDate.clearTime(new Date()),min=me.minDate?eDate.clearTime(me.minDate,true):Number.NEGATIVE_INFINITY,max=me.maxDate?eDate.clearTime(me.maxDate,true):Number.POSITIVE_INFINITY,ddMatch=me.disabledDatesRE,ddText=me.disabledDatesText,ddays=me.disabledDays?me.disabledDays.join(''):false,ddaysText=me.disabledDaysText,format=me.format,days=eDate.getDaysInMonth(date),firstOfMonth=eDate.getFirstDateOfMonth(date),startingPos=firstOfMonth.getDay()-me.startDay,previousMonth=eDate.add(date,eDate.MONTH,-1),longDayFormat=me.longDayFormat,prevStart,current,disableToday,tempDate,setCellClass,html,cls,formatValue,value;if(startingPos<0){startingPos+=7;}
days+=startingPos;prevStart=eDate.getDaysInMonth(previousMonth)-startingPos;current=new Date(previousMonth.getFullYear(),previousMonth.getMonth(),prevStart,me.initHour);if(me.showToday){tempDate=eDate.clearTime(new Date());disableToday=(tempDate<min||tempDate>max||(ddMatch&&format&&ddMatch.test(eDate.dateFormat(tempDate,format)))||(ddays&&ddays.indexOf(tempDate.getDay())!=-1));if(!me.disabled){me.todayBtn.setDisabled(disableToday);me.todayKeyListener.setDisabled(disableToday);}}
setCellClass=function(cell,cls){value=+eDate.clearTime(current,true);cell.title=eDate.format(current,longDayFormat);cell.firstChild.dateValue=value;if(value==today){cls+=' '+me.todayCls;cell.title=me.todayText;me.todayElSpan=Ext.DomHelper.append(cell.firstChild,{tag:'span',cls:Ext.baseCSSPrefix+'hide-clip',html:me.todayText},true);}
if(value==newDate){cls+=' '+me.selectedCls;me.fireEvent('highlightitem',me,cell);if(visible&&me.floating){Ext.fly(cell.firstChild).focus(50);}}
if(value<min){cls+=' '+disabledCls;cell.title=me.minText;}
else if(value>max){cls+=' '+disabledCls;cell.title=me.maxText;}
else if(ddays&&ddays.indexOf(current.getDay())!==-1){cell.title=ddaysText;cls+=' '+disabledCls;}
else if(ddMatch&&format){formatValue=eDate.dateFormat(current,format);if(ddMatch.test(formatValue)){cell.title=ddText.replace('%0',formatValue);cls+=' '+disabledCls;}}
cell.className=cls+' '+me.cellCls;};for(;i<me.numDays;++i){if(i<startingPos){html=(++prevStart);cls=me.prevCls;}else if(i>=days){html=(++extraDays);cls=me.nextCls;}else{html=i-startingPos+1;cls=me.activeCls;}
textNodes[i].innerHTML=html;current.setDate(current.getDate()+1);setCellClass(cells[i],cls);}
me.monthBtn.setText(Ext.Date.format(date,me.monthYearFormat));},update:function(date,forceRefresh){var me=this,active=me.activeDate;if(me.rendered){me.activeDate=date;if(!forceRefresh&&active&&me.el&&active.getMonth()==date.getMonth()&&active.getFullYear()==date.getFullYear()){me.selectedUpdate(date,active);}else{me.fullUpdate(date,active);}}
return me;},beforeDestroy:function(){var me=this;if(me.rendered){Ext.destroy(me.todayKeyListener,me.keyNav,me.monthPicker,me.monthBtn,me.nextRepeater,me.prevRepeater,me.todayBtn);delete me.textNodes;delete me.cells.elements;}
me.callParent();},onShow:function(){this.callParent(arguments);if(this.focusOnShow){this.focus();}}});Ext.define('Ext.layout.container.boxOverflow.Menu',{extend:'Ext.layout.container.boxOverflow.None',requires:['Ext.toolbar.Separator','Ext.button.Button'],alternateClassName:'Ext.layout.boxOverflow.Menu',noItemsMenuText:'<div class="'+Ext.baseCSSPrefix+'toolbar-no-items">(None)</div>',constructor:function(layout){var me=this;me.callParent(arguments);me.triggerButtonCls=me.triggerButtonCls||Ext.baseCSSPrefix+'box-menu-after';me.menuItems=[];},beginLayout:function(ownerContext){this.callParent(arguments);this.clearOverflow(ownerContext);},beginLayoutCycle:function(ownerContext,firstCycle){this.callParent(arguments);if(!firstCycle){this.clearOverflow(ownerContext);this.layout.cacheChildItems(ownerContext);}},onRemove:function(comp){Ext.Array.remove(this.menuItems,comp);},getSuffixConfig:function(){var me=this,layout=me.layout,owner=layout.owner,oid=owner.id;me.menu=new Ext.menu.Menu({listeners:{scope:me,beforeshow:me.beforeMenuShow}});me.menuTrigger=new Ext.button.Button({id:oid+'-menu-trigger',cls:Ext.layout.container.Box.prototype.innerCls+' '+me.triggerButtonCls+' '+Ext.baseCSSPrefix+'toolbar-item',plain:owner.usePlainButtons,ownerCt:owner,ownerLayout:layout,iconCls:Ext.baseCSSPrefix+me.getOwnerType(owner)+'-more-icon',ui:owner instanceof Ext.toolbar.Toolbar?'default-toolbar':'default',menu:me.menu,showEmptyMenu:true,getSplitCls:function(){return'';}});return me.menuTrigger.getRenderTree();},getOverflowCls:function(){return Ext.baseCSSPrefix+this.layout.direction+'-box-overflow-body';},handleOverflow:function(ownerContext){var me=this,layout=me.layout,names=layout.names,plan=ownerContext.state.boxPlan,posArgs=[null,null];me.showTrigger(ownerContext);if(me.layout.direction!=='vertical'){posArgs[names.heightIndex]=(plan.maxSize-me.menuTrigger[names.getHeight]())/2;me.menuTrigger.setPosition.apply(me.menuTrigger,posArgs);}
return{reservedSpace:me.triggerTotalWidth};},captureChildElements:function(){var me=this,menuTrigger=me.menuTrigger,names=me.layout.names;if(menuTrigger.rendering){menuTrigger.finishRender();me.triggerTotalWidth=menuTrigger[names.getWidth]()+menuTrigger.el.getMargin(names.parallelMargins);}},_asLayoutRoot:{isRoot:true},clearOverflow:function(ownerContext){var me=this,items=me.menuItems,item,i=0,length=items.length,owner=me.layout.owner,asLayoutRoot=me._asLayoutRoot;owner.suspendLayouts();me.captureChildElements();me.hideTrigger();owner.resumeLayouts();for(;i<length;i++){item=items[i];item.suspendLayouts();item.show();item.resumeLayouts(asLayoutRoot);}
items.length=0;},showTrigger:function(ownerContext){var me=this,layout=me.layout,owner=layout.owner,names=layout.names,startProp=names.x,sizeProp=names.width,plan=ownerContext.state.boxPlan,available=plan.targetSize[sizeProp],childItems=ownerContext.childItems,len=childItems.length,menuTrigger=me.menuTrigger,childContext,comp,i,props;menuTrigger.suspendLayouts();menuTrigger.show();menuTrigger.resumeLayouts(me._asLayoutRoot);available-=me.triggerTotalWidth;owner.suspendLayouts();me.menuItems.length=0;for(i=0;i<len;i++){childContext=childItems[i];props=childContext.props;if(props[startProp]+props[sizeProp]>available){comp=childContext.target;me.menuItems.push(comp);comp.hide();}}
owner.resumeLayouts();},hideTrigger:function(){var menuTrigger=this.menuTrigger;if(menuTrigger){menuTrigger.hide();}},beforeMenuShow:function(menu){var me=this,items=me.menuItems,i=0,len=items.length,item,prev,needsSep=function(group,prev){return group.isXType('buttongroup')&&!(prev instanceof Ext.toolbar.Separator);};menu.suspendLayouts();me.clearMenu();menu.removeAll();for(;i<len;i++){item=items[i];if(!i&&(item instanceof Ext.toolbar.Separator)){continue;}
if(prev&&(needsSep(item,prev)||needsSep(prev,item))){menu.add('-');}
me.addComponentToMenu(menu,item);prev=item;}
if(menu.items.length<1){menu.add(me.noItemsMenuText);}
menu.resumeLayouts();},createMenuConfig:function(component,hideOnClick){var me=this,config=Ext.apply({},component.initialConfig),group=component.toggleGroup;Ext.copyTo(config,component,['iconCls','icon','itemId','disabled','handler','scope','menu','tabIndex']);Ext.apply(config,{text:component.overflowText||component.text,hideOnClick:hideOnClick,destroyMenu:false,listeners:{}});if(component.isFormField){config.value=component.getValue();config.listeners.change=function(c,newVal,oldVal){component.setValue(newVal);}}
else if(group||component.enableToggle){Ext.apply(config,{hideOnClick:false,group:group,checked:component.pressed,handler:function(item,e){component.onClick(e);}});}
if(component.isButton&&!component.changeListenersAdded){component.on({textchange:me.onButtonAttrChange,iconchange:me.onButtonAttrChange,toggle:me.onButtonToggle});component.changeListenersAdded=true;}
delete config.margin;delete config.ownerCt;delete config.xtype;delete config.id;delete config.itemId;return config;},onButtonAttrChange:function(btn){var clone=btn.overflowClone;clone.suspendLayouts();clone.setText(btn.text);clone.setIcon(btn.icon);clone.setIconCls(btn.iconCls);clone.resumeLayouts(true);},onButtonToggle:function(btn,state){if(btn.overflowClone.checked!==state){btn.overflowClone.setChecked(state);}},addComponentToMenu:function(menu,component){var me=this,i,items,iLen;if(component instanceof Ext.toolbar.Separator){menu.add('-');}else if(component.isComponent){if(component.isXType('splitbutton')){component.overflowClone=menu.add(me.createMenuConfig(component,true));}else if(component.isXType('button')){component.overflowClone=menu.add(me.createMenuConfig(component,!component.menu));}else if(component.isXType('buttongroup')){items=component.items.items;iLen=items.length;for(i=0;i<iLen;i++){me.addComponentToMenu(menu,items[i]);}}else{component.overflowClone=menu.add(Ext.create(Ext.getClassName(component),me.createMenuConfig(component)));}}},clearMenu:function(){var menu=this.menu,items,i,iLen,item;if(menu&&menu.items){items=menu.items.items;iLen=items.length;for(i=0;i<iLen;i++){item=items[i];if(item.setMenu){item.setMenu(null);}}}},destroy:function(){var trigger=this.menuTrigger;if(trigger&&!this.layout.owner.items.contains(trigger)){delete trigger.ownerCt;}
Ext.destroy(this.menu,trigger);}});Ext.define('Ext.app.domain.Controller',{extend:'Ext.app.EventDomain',singleton:true,requires:['Ext.app.Controller'],type:'controller',idProperty:'id',constructor:function(){var me=this;me.callParent();me.monitor(Ext.app.Controller);}});Ext.define('Ext.form.field.File',{extend:'Ext.form.field.Trigger',alias:['widget.filefield','widget.fileuploadfield'],alternateClassName:['Ext.form.FileUploadField','Ext.ux.form.FileUploadField','Ext.form.File'],requires:['Ext.form.field.FileButton'],buttonText:'Browse...',buttonOnly:false,buttonMargin:3,clearOnSubmit:true,extraFieldBodyCls:Ext.baseCSSPrefix+'form-file-wrap',readOnly:true,triggerNoEditCls:'',componentLayout:'triggerfield',childEls:['browseButtonWrap'],onRender:function(){var me=this,id=me.id,inputEl;me.callParent(arguments);inputEl=me.inputEl;inputEl.dom.name='';me.button=new Ext.form.field.FileButton(Ext.apply({renderTo:id+'-browseButtonWrap',ownerCt:me,ownerLayout:me.componentLayout,id:id+'-button',ui:me.ui,disabled:me.disabled,text:me.buttonText,style:me.buttonOnly?'':me.getButtonMarginProp()+me.buttonMargin+'px',inputName:me.getName(),listeners:{scope:me,change:me.onFileChange}},me.buttonConfig));me.fileInputEl=me.button.fileInputEl;if(me.buttonOnly){me.inputCell.setDisplayed(false);}
me.browseButtonWrap.dom.style.width=(me.browseButtonWrap.dom.lastChild.offsetWidth+me.button.getEl().getMargin('lr'))+'px';if(Ext.isIE){me.button.getEl().repaint();}},getTriggerMarkup:function(){return'<td id="'+this.id+'-browseButtonWrap"></td>';},onFileChange:function(button,e,value){this.lastValue=null;Ext.form.field.File.superclass.setValue.call(this,value);},setValue:Ext.emptyFn,reset:function(){var me=this,clear=me.clearOnSubmit;if(me.rendered){me.button.reset(clear);me.fileInputEl=me.button.fileInputEl;if(clear){me.inputEl.dom.value='';}}
me.callParent();},onShow:function(){this.callParent();this.button.updateLayout();},onDisable:function(){this.callParent();this.button.disable();},onEnable:function(){this.callParent();this.button.enable();},isFileUpload:function(){return true;},extractFileInput:function(){var fileInput=this.button.fileInputEl.dom;this.reset();return fileInput;},restoreInput:function(el){var button=this.button;button.restoreInput(el);this.fileInputEl=button.fileInputEl;},onDestroy:function(){Ext.destroyMembers(this,'button');delete this.fileInputEl;this.callParent();},getButtonMarginProp:function(){return'margin-left:';}});Ext.define('SoL.view.Competitors.Actions',{extend:'MP.action.SaveAndReset',uses:['Ext.Action'],statics:{ADD_COMPETITOR_ACTION:'add_competitor',PRINT_COMPETITORS_ACTION:'print_competitors',PRINT_BADGES_ACTION:'print_badges'},initActions:function(){var me=this,ids=me.statics(),tourney=me.module.tourney;me.callParent();me.addCompetitorAction=me.addAction(new Ext.Action({itemId:ids.ADD_COMPETITOR_ACTION,text:_('Add…'),tooltip:_('Show selectable players.'),iconCls:'add-user-icon',disabled:tourney.readOnly||tourney.prized,hidden:tourney.readOnly||tourney.prized,scope:me.component,handler:me.component.showOtherPlayers}));me.printCompetitorsAction=me.addAction(new Ext.Action({itemId:ids.PRINT_COMPETITORS_ACTION,text:_('Competitors'),tooltip:_('Print current list of participants.'),iconCls:'print-icon',handler:function(){var url='/pdf/participants/'+me.module.tourney.idtourney;window.location.assign(url);}}));me.printBadgesAction=me.addAction(new Ext.Action({itemId:ids.PRINT_BADGES_ACTION,text:_('Badges'),tooltip:_('Print participant badges.'),iconCls:'print-icon',hidden:tourney.readOnly||tourney.prized,handler:function(){var url='pdf/badges/'+me.module.tourney.idtourney;window.location.assign(url);}}));},attachActions:function(){var me=this,tourney=me.module.tourney;me.callParent();var panel=me.component.up('panel'),tbar=panel.child('#ttoolbar');if(!tourney.readOnly){tbar.add(0,me.addCompetitorAction,' ',me.printBadgesAction,me.printCompetitorsAction,'->',me.saveAction,me.restoreAction);}else{tbar.add(0,me.printBadgesAction,me.printCompetitorsAction);}
if(!me.module.tourney.prized&&!me.module.tourney.readOnly){var store=me.component.store;store.on('update',function(s,r,action){if(action=='edit'){me.saveAction.setDisabled(false);me.restoreAction.setDisabled(false);panel.setWidth(420);}});store.on('load',function(){me.saveAction.setDisabled(true);me.restoreAction.setDisabled(true);panel.setWidth(panel.initialConfig.width);});store.on('reject',function(){me.saveAction.setDisabled(true);me.restoreAction.setDisabled(true);panel.setWidth(panel.initialConfig.width);});}}});Ext.define('SoL.view.Competitors.PlayersActions',{extend:'MP.action.StoreAware',uses:['Ext.Action','SoL.module.Tourneys'],statics:{INSERT_PLAYERS_ACTION:'insert_players',TOGGLE_SHOW_ALL_PLAYERS_ACTION:'show_all_players'},initActions:function(){var me=this,ids=me.statics();me.callParent();me.insertPlayersAction=me.addAction(new Ext.Action({itemId:ids.INSERT_PLAYERS_ACTION,text:_('Insert selected players'),tooltip:_('Subscribe selected players to the tourney if not already present.'),iconCls:'add-group-icon',disabled:true,needsSelectedRow:true,needsCleanStore:true,handler:function(){me.insertSelectedPlayers();}}));me.toggleShowAllPlayersAction=me.addAction(new Ext.Action({itemId:ids.TOGGLE_SHOW_ALL_PLAYERS_ACTION,text:_('Show all players'),tooltip:_('Toggle between all players or only active ones, whose participated to at least a tourney organized by the current club in the last year.'),iconCls:'magnify-icon',handler:function(){me.toggleShowAllPlayers();}}));},attachActions:function(){var me=this;me.callParent();var tbar=me.component.addDocked({xtype:'toolbar',dock:'bottom',ui:'footer',layout:{pack:'end'}})[0];tbar.add(me.insertPlayersAction,me.toggleShowAllPlayersAction);me.toggleShowAllPlayers(true);},toggleShowAllPlayers:function(setup){var me=this,component=me.component,store=component.store,tourney=me.competitors.ownerCt.module.tourney,win=component.up();if(!component.orig_dataURL)
component.orig_dataURL=component.dataURL;if(setup||!me.show_active_players){me.toggleShowAllPlayersAction.setText(_('Show all players'));me.show_active_players=true;var today=new Date(),oneyearago=new Date(today.getFullYear()-1,today.getMonth(),today.getDate());store.proxy.url=Ext.String.urlAppend(component.orig_dataURL,'played4club='+tourney.IDClub);store.stickyFilter({id:'lastplayed',property:'LastPlayed',value:SoL.module.Tourneys.dateToISO(oneyearago),operator:">="});win.setTitle(Ext.String.format(_("Players of last year's “{0}” tourneys"),tourney.Club));}else{me.toggleShowAllPlayersAction.setText(_('Show only active players'));me.show_active_players=false;store.proxy.url=component.orig_dataURL;store.stickyFilters.removeAtKey('lastplayed');store.filters.removeAtKey('lastplayed');store.load();win.setTitle(_('All players'));}},insertSelectedPlayers:function(){var me=this,grid=me.component,sels=grid.getSelectionModel().getSelection(),competitor,nplayers=0,tourney=me.competitors.ownerCt.module.tourney,idtourney=tourney.idtourney,playersperteam=tourney.PlayersPerTeam,deststore=me.competitors.store,ids=me.player_ids;Ext.each(sels,function(record){var idplayer=record.get('idplayer');var present=false;deststore.each(function(comp){if(idplayer==comp.get('idplayer1')||idplayer==comp.get('idplayer2')||idplayer==comp.get('idplayer3')||idplayer==comp.get('idplayer4')){present=true;return false;}else{return true;}});if(!present){if(nplayers===0){competitor=deststore.add({retired:false,player1Nationality:record.get('nationality')})[0];competitor.set('idtourney',idtourney);competitor.set('player1FirstName',record.get('firstname'));competitor.set('player1LastName',record.get('lastname'));competitor.set('player1Sex',record.get('sex'));}
nplayers++;competitor.set('idplayer'+nplayers,idplayer);competitor.set('player'+nplayers+'FullName',SoL.module.Players.full_name(record));if(nplayers==playersperteam){nplayers=0;}
ids.push(idplayer);}});deststore.sort();me.competitors.refresh();grid.store.stickyFilter({id:'ids',property:'idplayer',value:ids.join(','),operator:'<>'});Ext.each(grid.plugins,function(p){if(p.ptype=='filterbar'){var field=p.fields.get('firstname');if(field){field.selectText();field.focus(false,200);}
return false;}
return true;});}});Ext.define('SoL.view.Competitors',{extend:'Ext.view.View',requires:['SoL.view.Competitors.Actions'],alias:'widget.competitors-dataview',autoScroll:true,tpl:['<ul>','<tpl for=".">','<li class="competitor{dirtyCls} {Icon}"','    id="competitor_{idplayer1}"','    cid="{cid}"','    data-qtip="'+_('Double click to withdraw this competitor.')+'">','<span class="player" id="player_{idplayer1}">','{player1FullName}','</span>','<tpl if="idplayer2">','<tpl if="idplayer3">, <tpl else> '+_('and')+' </tpl>','<span class="player" id="player_{idplayer2}">','{player2FullName}','</span>','</tpl>','<tpl if="idplayer3">','<tpl if="idplayer4">, <tpl else> '+_('and')+' </tpl>','<span class="player" id="player_{idplayer3}">','{player3FullName}','</span>','</tpl>','<tpl if="idplayer4"> '+_('and')+' ','<span class="player" id="player_{idplayer4}">','{player4FullName}','</span>','</tpl>','<tpl if="rate">','<span class="rate"> ({rate})</span>','</tpl>','<span class="sol-flags-icon sol-flag-{player1Nationality}',' competitor-flag" data-qtip="{player1Country}"></span>','</li>','</tpl>','</ul>','<div class="x-clear"></div>'],itemSelector:'li.competitor',statics:{getConfig:function(callback,errorcb,config){var me=this,dataURL='/tourney/competitors',dataview={xtype:'competitors-dataview',id:'competitors-view',plugins:[Ext.create('SoL.view.Competitors.Actions',{module:me})]};if(config.tourney.PlayersPerTeam>1&&!config.tourney.prized&&!config.tourney.readOnly){dataview.listeners={destroy:function(v){v.dragZone.destroy();},render:function(v){v.dragZone=new Ext.dd.DragZone(v.getEl(),{ddGroup:'player',getDragData:function(e){var player=e.getTarget('span.player',10,true);if(player){var container=player.parent(),cid=container.dom.attributes.cid.nodeValue,idcompetitor=parseInt(cid,10),competitor,xy=player.getXY(),sourceEl=player.dom,d=sourceEl.cloneNode(true);d.id=Ext.id();if(isNaN(idcompetitor)){competitor=v.store.data.findBy(function(r){return r.id===cid;});}else{competitor=v.store.getById(idcompetitor);}
return{sourceEl:sourceEl,sourceCompetitor:competitor,repairXY:xy,ddel:d};}else{return null;}},getRepairXY:function(){return this.dragData.repairXY;}});if(config.tourney.currentturn===0){Ext.create('SoL.view.Competitors.PlayerDrop',v);}}};}
if(config.tourney.PlayersPerTeam==1&&!config.tourney.prized){dataview.listeners={render:function(v){if(config.tourney.currentturn===0){Ext.create('SoL.view.Competitors.PlayerDrop',v);}}};}
var cfg=config.Competitors={dockedItems:[{xtype:'toolbar',dock:'top',itemId:'ttoolbar',enableOverflow:true}],items:[dataview],layout:'fit',title:_('Competitors'),xtype:'panel'};MP.data.MetaData.fetch(dataURL,me,function(metadata){var model,overrides={rate:{sendback:false}};model=Ext.define('MP.data.ImplicitModel-'+Ext.id(),{extend:'Ext.data.Model',fields:metadata.fields(overrides),idProperty:metadata.primary_key});dataview.store=Ext.create('MP.data.Store',{model:model,proxy:{type:'ajax',url:dataURL,reader:{type:'json',idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,root:metadata.root_slot}},autoDestroy:true,remoteSort:false,sorters:['player1LastName','player1FirstName'],pageSize:999,listeners:{beforeload:function(store,operation){operation.sorters=undefined;}}});dataview.store.implicitModel=true;callback(cfg);});}},initEvents:function(){var me=this,tourney=me.ownerCt.module.tourney;me.on({itemdblclick:function(view,competitor){var prized=tourney.prized;if(prized){return;}
var players=[],he=competitor.get('player1Sex')=='M'?_('he'):_('she');for(var i=1;i<=4;i++){var fn=competitor.get('player'+i+'FullName');if(fn){players.push(fn);}}
Ext.Msg.confirm(_('Confirm competitor withdraw'),Ext.String.format(ngettext("Do you confirm the withdraw of {0}?<br/>Doing so {1} won't play further matches!","Do you confirm the withdraw of {0}?<br/>Doing so they won't play further matches!",players.length),Ext.toSentence(players,_('and')),he),function(response){if('yes'==response){if(me.ownerCt.module.tourney.currentturn===0){view.store.deleteRecord(competitor);}else{competitor.set('retired',true);}
view.refresh();}});}});},prepareData:function(data,index,record){var me=this,tourney=me.ownerCt.module.tourney,ppt=tourney.PlayersPerTeam,dirty;me.callParent(data,index,record);if(record.data.retired){dirty='retired-competitor';}else{dirty=me.store.classifyRecord(record,null,null,me.store);}
if(ppt>1){var nplayers=1;if(record.get('idplayer2')){nplayers++;if(record.get('idplayer3')){nplayers++;if(record.get('idplayer4')){nplayers++;}}}
if(nplayers!=ppt){data.Icon='group-error-icon';}else{data.Icon='group-icon';}}else{data.Icon=record.data.player1Sex=='F'?'fuser-icon':'user-icon';}
data.dirtyCls=dirty===''?'':' '+dirty;data.cid=record.data.idcompetitor||record.id;return data;},showOtherPlayers:function(){var me=this,otheractions,module=me.ownerCt.module.app.getModule('players-win'),idp,ids=[];me.store.each(function(comp){ids.push(comp.get('idplayer1'));if((idp=comp.get('idplayer2'))){ids.push(idp);if((idp=comp.get('idplayer3'))){ids.push(idp);if((idp=comp.get('idplayer4'))){ids.push(idp);}}}});otheractions=Ext.create('SoL.view.Competitors.PlayersActions',{competitors:me,player_ids:ids});module.createOrShowWindow('competitors',ids,otheractions);},commitChanges:function(callback,scope){var me=this;me.store.commitChanges('/bio/saveChanges',me.store.proxy.reader.idProperty,callback,scope);},resetChanges:function(){var me=this;me.store.rejectChanges();me.refresh();}});Ext.define('SoL.view.Competitors.PlayerDrop',{extend:'Ext.dd.DropTarget',uses:['MP.window.Notification'],group:'player',dropAllowedRemove:"x-dd-drop-ok-del",dropAllowedAdd:"x-dd-drop-ok-add",constructor:function(view){var me=this;me.callParent([view.el,{}]);me.store=view.store;me.dataview=view;me.tourney=view.ownerCt.module.tourney;me.playersperteam=me.tourney.PlayersPerTeam;},isAnyPlayerAlreadyPresent:function(sels){var me=this,present=false;function is_present(comp,id){if(id==comp.get("idplayer1")||id==comp.get("idplayer2")||id==comp.get("idplayer3")||id==comp.get("idplayer4")){present=true;return false;}else
return null;}
for(var i=0;!present&&i<sels.length;i++){var id=sels[i].get("idplayer");me.store.each(function(comp){return is_present(comp,id);});}
return present;},notifyEnter:function(source,e,data){var me=this,r;if((r=me.notifyOver(source,e,data))!=me.dropNotAllowed){me.callParent(source,e,data);return r;}else{return me.dropNotAllowed;}},notifyOver:function(source,e,data){var me=this,target=e.getTarget('.competitor'),idplayer1,index,comp,nplayers;if(me.tourney.readOnly){return me.dropNotAllowed;}
if(me.playersperteam==1&&target){return me.dropNotAllowed;}
var sels=data.records;if(sels){if(me.isAnyPlayerAlreadyPresent(sels)){return me.dropNotAllowed;}
if(target){idplayer1=parseInt(target.id.split('_')[1],10);index=me.store.find('idplayer1',idplayer1);comp=me.store.getAt(index);nplayers=1;if(comp.get("idplayer2")){nplayers++;if(comp.get("idplayer3")){nplayers++;if(comp.get("idplayer4")){nplayers++;}}}
return((nplayers<me.playersperteam)?me.dropAllowedAdd:me.dropNotAllowed);}else{return me.dropAllowedAdd;}}else{if(target&&data.sourceEl==target.firstChild){return me.dropNotAllowed;}else{if(target){idplayer1=parseInt(target.id.split('_')[1],10);index=me.store.find('idplayer1',idplayer1);comp=me.store.getAt(index);nplayers=1;if(comp.get("idplayer2")){nplayers++;if(comp.get("idplayer3")){nplayers++;if(comp.get("idplayer4")){nplayers++;}}}
return((nplayers<me.playersperteam)?me.dropAllowedAdd:me.dropNotAllowed);}else{return me.dropAllowedRemove;}}}},notifyDrop:function(source,e,data){var me=this,target=e.getTarget('.competitor'),full_name=SoL.module.Players.full_name,idplayer,idplayer1,index,comp,nplayers,spos,others,sc,i,idp;if(me.tourney.readOnly){return false;}
if(me.playersperteam==1&&target){return false;}
var sels=data.records;if(sels){if(me.isAnyPlayerAlreadyPresent(sels)){return false;}
if(target){idplayer1=parseInt(target.id.split('_')[1],10);index=me.store.find('idplayer1',idplayer1);comp=me.store.getAt(index);nplayers=1;if(comp.get('idplayer2')){nplayers++;if(comp.get('idplayer3')){nplayers++;if(comp.get('idplayer4')){nplayers++;}}}
if((nplayers+sels.length)<=me.playersperteam){Ext.each(sels,function(r){nplayers++;if(nplayers==1){comp.set('player1Nationality',r.get('nationality'));comp.set('player1FirstName',r.get('firstname'));comp.set('player1LastName',r.get('lastname'));comp.set('player1Sex',r.get('sex'));}
comp.set('idplayer'+nplayers,r.get('idplayer'));comp.set('player'+nplayers+'FullName',full_name(r));},me);}else{return false;}}else{nplayers=0;Ext.each(sels,function(r){if(nplayers===0){comp=me.store.add({retired:false,player1Nationality:r.get('nationality')})[0];comp.set('idtourney',me.tourney.idtourney);comp.set('player1FirstName',r.get('firstname'));comp.set('player1LastName',r.get('lastname'));comp.set('player1Sex',r.get('sex'));}
nplayers++;comp.set('idplayer'+nplayers,r.get('idplayer'));comp.set('player'+nplayers+'FullName',full_name(r));if(nplayers==me.playersperteam){nplayers=0;}});}
var ids=[];me.store.each(function(r){for(var j=0;j<4;j++){idp=r.get('idplayer'+j);if(idp&&idp!==''){ids.push(idp);}}});sels[0].store.stickyFilter({id:'ids',property:'idplayer',value:ids.join(','),operator:'<>'});}else{if(!target){idplayer=parseInt(data.sourceEl.id.split('_')[1],10);others=true;sc=data.sourceCompetitor;if(!sc){return false;}
if(sc.get("idplayer1")==idplayer){spos=1;if(!(idp=sc.get("idplayer2"))||idp===''){others=false;}}else if(sc.get("idplayer2")==idplayer){spos=2;}else if(sc.get("idplayer3")==idplayer){spos=3;}else{spos=4;}
if(spos==1&&!others){me.store.deleteRecord(sc);}else{for(i=spos;i<4;i++){sc.set('idplayer'+i,sc.get('idplayer'+(i+1)));sc.set('player'+i+'FullName',sc.get('player'+(i+1)+'FullName'));}
sc.set('idplayer4',null);sc.set('player4FullName',null);}}else{idplayer1=parseInt(target.id.split('_')[1],10);if(!data.sourceCompetitor){return false;}
if(idplayer1==data.sourceCompetitor.get("idplayer1")){return false;}
index=me.store.find('idplayer1',idplayer1);comp=me.store.getAt(index);nplayers=1;if(comp.get("idplayer2")){nplayers++;if(comp.get("idplayer3")){nplayers++;if(comp.get("idplayer4")){nplayers++;}}}
if(nplayers<me.playersperteam){idplayer=parseInt(data.sourceEl.id.split('_')[1],10);var fnplayer;sc=data.sourceCompetitor;others=true;if(sc.get("idplayer1")==idplayer){spos=1;if(!sc.get("idplayer2")||sc.get("idplayer2")===''){others=false;}}else if(sc.get("idplayer2")==idplayer){spos=2;}else if(sc.get("idplayer3")==idplayer){spos=3;}else{spos=4;}
fnplayer=sc.get('player'+spos+'FullName');if(spos==1&&!others){me.store.deleteRecord(sc);}else{for(i=spos;i<4;i++){sc.set('idplayer'+i,sc.get('idplayer'+(i+1)));sc.set('player'+i+'FullName',sc.get('player'+(i+1)+'FullName'));}
sc.set('idplayer4',null);sc.set('player4FullName',null);}
nplayers++;comp.set('idplayer'+nplayers,idplayer);comp.set('player'+nplayers+'FullName',fnplayer);}}}
me.dataview.store.sort();me.dataview.refresh();return true;}});Ext.define('SoL.view.Boards.Actions',{extend:'MP.action.SaveAndReset',uses:['Ext.Action'],attachActions:function(){var me=this;me.callParent();var panel=me.component.up('panel'),tbar=panel.child('#ttoolbar');tbar.add(0,'->',me.saveAction,me.restoreAction);if(!panel.module.tourney.prized){var store=me.component.store;store.on('update',function(s,r,action){if(action=='edit'){me.saveAction.setDisabled(false);me.restoreAction.setDisabled(false);}});store.on('load',function(){me.saveAction.setDisabled(true);me.restoreAction.setDisabled(true);});store.on('reject',function(){me.saveAction.setDisabled(true);me.restoreAction.setDisabled(true);});}}});Ext.define('SoL.view.Boards',{extend:'Ext.view.View',requires:['SoL.view.Boards.Actions'],alias:'widget.boards-dataview',autoHeight:true,autoScroll:true,ddGroup:'competitor',deferEmptyText:false,emptyText:_('Only new round pairings can be manually adjusted.'),itemSelector:'div.board',singleSelect:true,tpl:['<tpl for=".">','  <div class="board{dirtyCls}" id="match_{idcompetitor1}" mid="{idmatch}">','    <span class="board-number">{boardNo}</span>','    <span class="competitor" id="c_1_{idcompetitor1}">','      {competitor1FullName}','    </span>','    <span class="carrom-board"></span>','    <span class="competitor" id="c_2_{idcompetitor2}">','      {competitor2FullName}','    </span>','  </div>','</tpl>','<div class="x-clear"></div>'],statics:{getConfig:function(callback,errorcb,config){var me=this,dataURL='/tourney/boards',dataview={saveChangesURL:'/bio/saveChanges',xtype:'boards-dataview',id:'boards-view',listeners:{destroy:function(v){v.dragZone.destroy();},render:function(v){v.dragZone=new Ext.dd.DragZone(v.getEl(),{ddGroup:'competitor',getDragData:function(e){var player=e.getTarget('span.competitor',10,true);if(player){var container=player.parent();var idmatch=parseInt(container.dom.attributes.mid.nodeValue,10);var match=v.store.getById(idmatch);var xy=player.getXY();var sourceEl=player.dom;var d=sourceEl.cloneNode(true);d.id=Ext.id();return{sourceEl:sourceEl,sourceMatch:match,repairXY:xy,ddel:d};}else{return null;}},getRepairXY:function(){return this.dragData.repairXY;}});}},plugins:[Ext.create('SoL.view.Boards.Actions')]},cfg=config.Boards={dockedItems:[{xtype:'toolbar',dock:'top',itemId:'ttoolbar',enableOverflow:true}],hidden:config.tourney.readOnly,items:[dataview],layout:'fit',title:_('Current round pairings'),titleCollapse:false,floatable:false,xtype:'panel',toggleCollapse:function(event){var me=this,res;if(me.collapsed||me.floatedFromCollapse){me.toggled_with_altkey=event&&event.altKey;res=me.expand();delete me.toggled_with_altkey;}else
res=me.collapse();return res;}};MP.data.MetaData.fetch(dataURL,me,function(metadata){var overrides={},model;model=Ext.define('MP.data.ImplicitModel-'+Ext.id(),{extend:'Ext.data.Model',fields:metadata.fields(overrides),idProperty:metadata.primary_key});dataview.store=Ext.create('MP.data.Store',{model:model,proxy:{type:'ajax',url:dataURL,reader:{type:'json',idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,root:metadata.root_slot}},autoDestroy:true,pageSize:999});dataview.store.implicitModel=true;callback(cfg);});}},initEvents:function(){var me=this;me.callParent(arguments);me.ownerCt.on('beforeexpand',function(){var tourney=me.ownerCt.module.tourney;if((tourney.currentturn==1&&tourney.rankedturn===0)||(me.up().toggled_with_altkey&&(tourney.currentturn-1)===tourney.rankedturn)){me.setHeight(275);if(!me.competitorDrop){me.competitorDrop=new SoL.view.Boards.CompetitorDrop(me);}
me.store.load();}else{me.setHeight(80);me.store.removeAll();}});},prepareData:function(data,index,record){var me=this,dirty=me.store.classifyRecord(record);me.callParent(data,index,record);data.dirtyCls=dirty===''?'':' '+dirty;data.boardNo=Ext.String.format(_('Carromboard #{0}'),data.board);return data;},commitChanges:function(callback,scope){var me=this;me.store.commitChanges('/bio/saveChanges',me.store.proxy.reader.idProperty,function(){me.ownerCt.module.reloadMatches();if(callback){callback();}},scope);},resetChanges:function(){var me=this;me.store.rejectChanges();me.refresh();}});Ext.define('SoL.view.Boards.CompetitorDrop',{extend:'Ext.dd.DropTarget',uses:['MP.window.Notification'],group:'competitor',constructor:function(view){var me=this;me.callParent([view.el,{}]);me.store=view.store;me.dataview=view;me.tourney=view.ownerCt.module.tourney;},notifyEnter:function(source,e,data){var me=this,r;if((r=me.notifyOver(source,e,data))!=me.dropNotAllowed){me.callParent(source,e,data);return r;}else{return me.dropNotAllowed;}},notifyOver:function(source,e,data){var target=e.getTarget('.competitor',10,true);if(!target){return this.dropNotAllowed;}
var tcontainer=target.parent(),targetId=parseInt(tcontainer.dom.attributes.mid.nodeValue,10),targetMatch=this.store.getById(targetId),targetOpps,ids,scomp,idscomp,oscomp,tcomp,idtcomp,otcomp,osOpps;ids=String(data.sourceEl.id).split('_');scomp=parseInt(ids[1],10);idscomp=parseInt(ids[2],10);ids=String(target.id).split('_');tcomp=parseInt(ids[1],10);idtcomp=parseInt(ids[2],10);oscomp=scomp==1?2:1;osOpps=data.sourceMatch.get('competitor'+oscomp+'Opponents');otcomp=tcomp==1?2:1;targetOpps=targetMatch.get('competitor'+otcomp+'Opponents');return((target&&idscomp!=idtcomp&&targetOpps.indexOf(idscomp)<0&&osOpps.indexOf(idtcomp)<0)?this.dropAllowed:this.dropNotAllowed);},notifyDrop:function(source,e,data){var me=this,target=e.getTarget('.competitor',10,true);if(!target||me.notifyOver(source,e,data)==me.dropNotAllowed){return false;}
var tcontainer=target.parent(),targetId=parseInt(tcontainer.dom.attributes.mid.nodeValue,10),targetMatch=this.store.getById(targetId),sourceMatch=data.sourceMatch,ids,scomp,idscomp,tcomp,idtcomp,sfullname,sopps;ids=String(data.sourceEl.id).split('_');scomp=parseInt(ids[1],10);idscomp=parseInt(ids[2],10);ids=String(target.id).split('_');tcomp=parseInt(ids[1],10);idtcomp=parseInt(ids[2],10);sfullname=sourceMatch.get('competitor'+scomp+'FullName');sopps=sourceMatch.get('competitor'+scomp+'Opponents');if(scomp==1&&!idtcomp){sourceMatch.set('idcompetitor1',sourceMatch.get('idcompetitor2'));sourceMatch.set('competitor1FullName',sourceMatch.get('competitor2FullName'));sourceMatch.set('competitor1Opponents',sourceMatch.get('competitor2Opponents'));sourceMatch.set('idcompetitor2',null);sourceMatch.set('competitor2FullName',targetMatch.get('competitor'+tcomp+'FullName'));sourceMatch.set('competitor2Opponents',"");}else{sourceMatch.set('idcompetitor'+scomp,idtcomp);sourceMatch.set('competitor'+scomp+'FullName',targetMatch.get('competitor'+tcomp+'FullName'));sourceMatch.set('competitor'+scomp+'Opponents',targetMatch.get('competitor'+tcomp+'Opponents'));}
if(!sourceMatch.get('idcompetitor2')){if(!sourceMatch.get('score1')){sourceMatch.set('score1',targetMatch.get('score1'));}}
if(tcomp==1&&!idscomp){targetMatch.set('idcompetitor1',targetMatch.get('idcompetitor2'));targetMatch.set('competitor1FullName',targetMatch.get('competitor2FullName'));targetMatch.set('competitor1Opponents',targetMatch.get('competitor2Opponents'));targetMatch.set('idcompetitor2',null);targetMatch.set('competitor2FullName',sfullname);targetMatch.set('competitor2Opponents',sopps);}else{targetMatch.set('idcompetitor'+tcomp,idscomp);targetMatch.set('competitor'+tcomp+'FullName',sfullname);targetMatch.set('competitor'+tcomp+'Opponents',sopps);}
if(!targetMatch.get('idcompetitor2')){if(!targetMatch.get('score1')){targetMatch.set('score1',sourceMatch.get('score1'));}}
if(sourceMatch.get('idcompetitor2')){sourceMatch.set('score1',0);}
if(targetMatch.get('idcompetitor2')){targetMatch.set('score1',0);}
this.dataview.refresh();return true;}});Ext.define('Ext.view.DragZone',{extend:'Ext.dd.DragZone',containerScroll:false,constructor:function(config){var me=this,view,ownerCt,el;Ext.apply(me,config);if(!me.ddGroup){me.ddGroup='view-dd-zone-'+me.view.id;}
view=me.view;ownerCt=view.ownerCt;if(ownerCt){el=ownerCt.getTargetEl().dom;}else{el=view.el.dom.parentNode;}
me.callParent([el]);me.ddel=Ext.get(document.createElement('div'));me.ddel.addCls(Ext.baseCSSPrefix+'grid-dd-wrap');},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);this.view.mon(this.view,{itemmousedown:this.onItemMouseDown,scope:this});},onValidDrop:function(target,e,id){this.callParent();target.el.focus();},onItemMouseDown:function(view,record,item,index,e){if(!this.isPreventDrag(e,record,item,index)){if(view.focusRow){view.focusRow(record);}
this.handleMouseDown(e);}},isPreventDrag:function(e){return false;},getDragData:function(e){var view=this.view,item=e.getTarget(view.getItemSelector());if(item){return{copy:view.copy||(view.allowCopy&&e.ctrlKey),event:new Ext.EventObjectImpl(e),view:view,ddel:this.ddel,item:item,records:view.getSelectionModel().getSelection(),fromPosition:Ext.fly(item).getXY()};}},onInitDrag:function(x,y){var me=this,data=me.dragData,view=data.view,selectionModel=view.getSelectionModel(),record=view.getRecord(data.item);if(!selectionModel.isSelected(record)){selectionModel.select(record,true);}
data.records=selectionModel.getSelection();me.ddel.update(me.getDragText());me.proxy.update(me.ddel.dom);me.onStartDrag(x,y);return true;},getDragText:function(){var count=this.dragData.records.length;return Ext.String.format(this.dragText,count,count==1?'':'s');},getRepairXY:function(e,data){return data?data.fromPosition:false;}});Ext.define('MP.controller.Login',{extend:'Ext.app.Controller',uses:['MP.data.MetaData','MP.desktop.App'],init:function(){this.control({'loginwindow textfield':{specialkey:this.keyenter},'loginwindow button[action=login]':{click:this.login}});},refs:[{ref:'loginwindow',selector:'loginwindow'},{ref:'loginbutton',selector:'loginwindow button[action=login]'}],keyenter:function(field,e){var value=field.getValue();if(e.getKey()===e.ENTER&&!Ext.isEmpty(value)){this.login(this.getLoginbutton());}},createUserDesktop:function(user){var me=this;var dapp=Ext.create(me.applicationClass||'MP.desktop.App',{user:user});dapp.on('ready',function(){var win=me.getLoginwindow();win.down('form').getEl().unmask();win.hide();});dapp.on('logout',function(){var win=me.getLoginwindow();var panel=win.down('form');panel.getForm().reset();dapp.desktop.windows.each(function(w){w.destroy();});dapp.desktop.hide();dapp.desktop.destroy();MP.data.MetaData.clearCache();win.show();});return dapp;},login:function(button){var me=this;var panel=button.up('window').down('form');var form=panel.getForm();if(form.isValid()){panel.getEl().mask(_("Authentication..."));form.submit({success:function(f,a){var user=a.result;me.createUserDesktop(user);},failure:function(f,a){f.owner.el.unmask();Ext.Msg.alert(_('Error'),a.result?a.result.message:_('No response from the server'));}});}}});Ext.define('Ext.form.field.Picker',{extend:'Ext.form.field.Trigger',alias:'widget.pickerfield',alternateClassName:'Ext.form.Picker',requires:['Ext.util.KeyNav'],matchFieldWidth:true,pickerAlign:'tl-bl?',openCls:Ext.baseCSSPrefix+'pickerfield-open',editable:true,initComponent:function(){this.callParent();this.addEvents('expand','collapse','select');},initEvents:function(){var me=this;me.callParent();me.keyNav=new Ext.util.KeyNav(me.inputEl,{down:me.onDownArrow,esc:{handler:me.onEsc,scope:me,defaultEventAction:false},scope:me,forceKeyDown:true});if(!me.editable){me.mon(me.inputEl,'click',me.onTriggerClick,me);}
if(Ext.isGecko){me.inputEl.dom.setAttribute('autocomplete','off');}},onEsc:function(e){if(Ext.isIE){e.preventDefault();}
if(this.isExpanded){this.collapse();e.stopEvent();}},onDownArrow:function(e){if(!this.isExpanded){this.onTriggerClick();}},expand:function(){var me=this,bodyEl,picker,collapseIf;if(me.rendered&&!me.isExpanded&&!me.isDestroyed){me.expanding=true;bodyEl=me.bodyEl;picker=me.getPicker();collapseIf=me.collapseIf;picker.show();me.isExpanded=true;me.alignPicker();bodyEl.addCls(me.openCls);me.mon(Ext.getDoc(),{mousewheel:collapseIf,mousedown:collapseIf,scope:me});Ext.EventManager.onWindowResize(me.alignPicker,me);me.fireEvent('expand',me);me.onExpand();delete me.expanding;}},onExpand:Ext.emptyFn,alignPicker:function(){var me=this,picker=me.getPicker();if(me.isExpanded){if(me.matchFieldWidth){picker.setWidth(me.bodyEl.getWidth());}
if(picker.isFloating()){me.doAlign();}}},doAlign:function(){var me=this,picker=me.picker,aboveSfx='-above',isAbove;me.picker.alignTo(me.triggerWrap,me.pickerAlign,me.pickerOffset);isAbove=picker.el.getY()<me.inputEl.getY();me.bodyEl[isAbove?'addCls':'removeCls'](me.openCls+aboveSfx);picker[isAbove?'addCls':'removeCls'](picker.baseCls+aboveSfx);},collapse:function(){if(this.isExpanded&&!this.isDestroyed){var me=this,openCls=me.openCls,picker=me.picker,doc=Ext.getDoc(),collapseIf=me.collapseIf,aboveSfx='-above';picker.hide();me.isExpanded=false;me.bodyEl.removeCls([openCls,openCls+aboveSfx]);picker.el.removeCls(picker.baseCls+aboveSfx);doc.un('mousewheel',collapseIf,me);doc.un('mousedown',collapseIf,me);Ext.EventManager.removeResizeListener(me.alignPicker,me);me.fireEvent('collapse',me);me.onCollapse();}},onCollapse:Ext.emptyFn,collapseIf:function(e){var me=this;if(!me.isDestroyed&&!e.within(me.bodyEl,false,true)&&!e.within(me.picker.el,false,true)&&!me.isEventWithinPickerLoadMask(e)){me.collapse();}},getPicker:function(){var me=this;return me.picker||(me.picker=me.createPicker());},createPicker:Ext.emptyFn,onTriggerClick:function(){var me=this;if(!me.readOnly&&!me.disabled){if(me.isExpanded){me.collapse();}else{me.expand();}
me.inputEl.focus();}},triggerBlur:function(){var picker=this.picker;this.callParent(arguments);if(picker&&picker.isVisible()){picker.hide();}},mimicBlur:function(e){var me=this,picker=me.picker;if(!picker||!e.within(picker.el,false,true)&&!me.isEventWithinPickerLoadMask(e)){me.callParent(arguments);}},onDestroy:function(){var me=this,picker=me.picker;Ext.EventManager.removeResizeListener(me.alignPicker,me);Ext.destroy(me.keyNav);if(picker){delete picker.pickerField;picker.destroy();}
me.callParent();},isEventWithinPickerLoadMask:function(e){var loadMask=this.picker.loadMask;return loadMask?e.within(loadMask.maskEl,false,true)||e.within(loadMask.el,false,true):false;}});Ext.define('Ext.layout.container.Box',{alias:['layout.box'],extend:'Ext.layout.container.Container',alternateClassName:'Ext.layout.BoxLayout',requires:['Ext.layout.container.boxOverflow.None','Ext.layout.container.boxOverflow.Menu','Ext.layout.container.boxOverflow.Scroller','Ext.util.Format','Ext.dd.DragDropManager'],defaultMargins:{top:0,right:0,bottom:0,left:0},padding:0,pack:'start',flex:undefined,stretchMaxPartner:undefined,alignRoundingMethod:'round',type:'box',scrollOffset:0,itemCls:Ext.baseCSSPrefix+'box-item',targetCls:Ext.baseCSSPrefix+'box-layout-ct',targetElCls:Ext.baseCSSPrefix+'box-target',innerCls:Ext.baseCSSPrefix+'box-inner',availableSpaceOffset:0,reserveOffset:true,manageMargins:true,createsInnerCt:true,childEls:['innerCt','targetEl'],renderTpl:['{%var oc,l=values.$comp.layout,oh=l.overflowHandler;','if (oh.getPrefixConfig!==Ext.emptyFn) {','if(oc=oh.getPrefixConfig())dh.generateMarkup(oc, out)','}%}','<div id="{ownerId}-innerCt" class="{[l.innerCls]} {[oh.getOverflowCls()]}" role="presentation">','<div id="{ownerId}-targetEl" class="{targetElCls}">','{%this.renderBody(out, values)%}','</div>','</div>','{%if (oh.getSuffixConfig!==Ext.emptyFn) {','if(oc=oh.getSuffixConfig())dh.generateMarkup(oc, out)','}%}',{disableFormats:true,definitions:'var dh=Ext.DomHelper;'}],constructor:function(config){var me=this,type;me.callParent(arguments);me.flexSortFn=Ext.Function.bind(me.flexSort,me);me.initOverflowHandler();type=typeof me.padding;if(type=='string'||type=='number'){me.padding=Ext.util.Format.parseBox(me.padding);me.padding.height=me.padding.top+me.padding.bottom;me.padding.width=me.padding.left+me.padding.right;}},_percentageRe:/^\s*(\d+(?:\.\d*)?)\s*[%]\s*$/,getItemSizePolicy:function(item,ownerSizeModel){var me=this,policy=me.sizePolicy,align=me.align,flex=item.flex,key=align,names=me.names,width=item[names.width],height=item[names.height],percentageRe=me._percentageRe,percentageWidth=percentageRe.test(width),isStretch=(align=='stretch'),isStretchMax=(align=='stretchmax'),constrain=me.constrainAlign;if(!ownerSizeModel&&(isStretch||flex||percentageWidth||(constrain&&!isStretchMax))){ownerSizeModel=me.owner.getSizeModel();}
if(isStretch){if(!percentageRe.test(height)&&ownerSizeModel[names.height].shrinkWrap){key='stretchmax';}}else if(!isStretchMax){if(percentageRe.test(height)){key='stretch';}else if(constrain&&!ownerSizeModel[names.height].shrinkWrap){key='stretchmax';}else{key='';}}
if(flex||percentageWidth){if(!ownerSizeModel[names.width].shrinkWrap){policy=policy.flex;}}
return policy[key];},flexSort:function(a,b){var maxWidthName=this.names.maxWidth,minWidthName=this.names.minWidth,infiniteValue=Infinity,aTarget=a.target,bTarget=b.target,result=0,aMin,bMin,aMax,bMax,hasMin,hasMax;aMax=aTarget[maxWidthName]||infiniteValue;bMax=bTarget[maxWidthName]||infiniteValue;aMin=aTarget[minWidthName]||0;bMin=bTarget[minWidthName]||0;hasMin=isFinite(aMin)||isFinite(bMin);hasMax=isFinite(aMax)||isFinite(bMax);if(hasMin||hasMax){if(hasMax){result=aMax-bMax;}
if(result===0&&hasMin){result=bMin-aMin;}}
return result;},isItemBoxParent:function(itemContext){return true;},isItemShrinkWrap:function(item){return true;},roundFlex:function(width){return Math.ceil(width);},beginCollapse:function(child){var me=this;if(me.direction==='vertical'&&child.collapsedVertical()){child.collapseMemento.capture(['flex']);delete child.flex;}else if(me.direction==='horizontal'&&child.collapsedHorizontal()){child.collapseMemento.capture(['flex']);delete child.flex;}},beginExpand:function(child){child.collapseMemento.restore(['flex']);},beginLayout:function(ownerContext){var me=this,owner=me.owner,smp=owner.stretchMaxPartner,style=me.innerCt.dom.style,names=me.names;ownerContext.boxNames=names;me.overflowHandler.beginLayout(ownerContext);if(typeof smp==='string'){smp=Ext.getCmp(smp)||owner.query(smp)[0];}
ownerContext.stretchMaxPartner=smp&&ownerContext.context.getCmp(smp);me.callParent(arguments);ownerContext.innerCtContext=ownerContext.getEl('innerCt',me);me.scrollParallel=owner.scrollFlags[names.x];me.scrollPerpendicular=owner.scrollFlags[names.y];if(me.scrollParallel){me.scrollPos=owner.getTargetEl().dom[names.scrollLeft];}
style.width='';style.height='';},beginLayoutCycle:function(ownerContext,firstCycle){var me=this,align=me.align,names=ownerContext.boxNames,pack=me.pack,heightModelName=names.heightModel;me.overflowHandler.beginLayoutCycle(ownerContext,firstCycle);me.callParent(arguments);ownerContext.parallelSizeModel=ownerContext[names.widthModel];ownerContext.perpendicularSizeModel=ownerContext[heightModelName];ownerContext.boxOptions={align:align={stretch:align=='stretch',stretchmax:align=='stretchmax',center:align==names.center,bottom:align==names.afterY},pack:pack={center:pack=='center',end:pack=='end'}};if(align.stretch&&ownerContext.perpendicularSizeModel.shrinkWrap){align.stretchmax=true;align.stretch=false;}
align.nostretch=!(align.stretch||align.stretchmax);if(ownerContext.parallelSizeModel.shrinkWrap){pack.center=pack.end=false;}
me.cacheFlexes(ownerContext);me.targetEl.setWidth(20000);},cacheFlexes:function(ownerContext){var me=this,names=ownerContext.boxNames,widthModelName=names.widthModel,heightModelName=names.heightModel,nostretch=ownerContext.boxOptions.align.nostretch,totalFlex=0,childItems=ownerContext.childItems,i=childItems.length,flexedItems=[],minWidth=0,minWidthName=names.minWidth,percentageRe=me._percentageRe,percentageWidths=0,percentageHeights=0,child,childContext,flex,match;while(i--){childContext=childItems[i];child=childContext.target;if(childContext[widthModelName].calculated){childContext.flex=flex=child.flex;if(flex){totalFlex+=flex;flexedItems.push(childContext);minWidth+=child[minWidthName]||0;}else{match=percentageRe.exec(child[names.width]);childContext.percentageParallel=parseFloat(match[1])/100;++percentageWidths;}}
if(nostretch&&childContext[heightModelName].calculated){match=percentageRe.exec(child[names.height]);childContext.percentagePerpendicular=parseFloat(match[1])/100;++percentageHeights;}}
ownerContext.flexedItems=flexedItems;ownerContext.flexedMinSize=minWidth;ownerContext.totalFlex=totalFlex;ownerContext.percentageWidths=percentageWidths;ownerContext.percentageHeights=percentageHeights;Ext.Array.sort(flexedItems,me.flexSortFn);},calculate:function(ownerContext){var me=this,targetSize=me.getContainerSize(ownerContext),names=ownerContext.boxNames,state=ownerContext.state,plan=state.boxPlan||(state.boxPlan={}),targetContext=ownerContext.targetContext;plan.targetSize=targetSize;if(!ownerContext.parallelSizeModel.shrinkWrap&&!targetSize[names.gotWidth]){me.done=false;return;}
if(!state.parallelDone){state.parallelDone=me.calculateParallel(ownerContext,names,plan);}
if(!state.perpendicularDone){state.perpendicularDone=me.calculatePerpendicular(ownerContext,names,plan);}
if(state.parallelDone&&state.perpendicularDone){if(me.owner.dock&&(Ext.isIE7m||Ext.isIEQuirks)&&!me.owner.width&&!me.horizontal){plan.isIEVerticalDock=true;plan.calculatedWidth=plan.maxSize+ownerContext.getPaddingInfo().width+ownerContext.getFrameInfo().width;if(targetContext!==ownerContext){plan.calculatedWidth+=targetContext.getPaddingInfo().width;}}
me.publishInnerCtSize(ownerContext,me.reserveOffset?me.availableSpaceOffset:0);if(me.done&&(ownerContext.childItems.length>1||ownerContext.stretchMaxPartner)&&ownerContext.boxOptions.align.stretchmax&&!state.stretchMaxDone){me.calculateStretchMax(ownerContext,names,plan);state.stretchMaxDone=true;}
me.overflowHandler.calculate(ownerContext);}else{me.done=false;}},calculateParallel:function(ownerContext,names,plan){var me=this,widthName=names.width,childItems=ownerContext.childItems,beforeXName=names.beforeX,afterXName=names.afterX,setWidthName=names.setWidth,childItemsLength=childItems.length,flexedItems=ownerContext.flexedItems,flexedItemsLength=flexedItems.length,pack=ownerContext.boxOptions.pack,padding=me.padding,containerWidth=plan.targetSize[widthName],totalMargin=0,left=padding[beforeXName],nonFlexWidth=left+padding[afterXName]+me.scrollOffset+
(me.reserveOffset?me.availableSpaceOffset:0),scrollbarWidth=Ext.getScrollbarSize()[names.width],i,childMargins,remainingWidth,remainingFlex,childContext,flex,flexedWidth,contentWidth,mayNeedScrollbarAdjust,childWidth,percentageSpace;if(scrollbarWidth&&me.scrollPerpendicular&&ownerContext.parallelSizeModel.shrinkWrap&&!ownerContext.boxOptions.align.stretch&&!ownerContext.perpendicularSizeModel.shrinkWrap){if(!ownerContext.state.perpendicularDone){return false;}
mayNeedScrollbarAdjust=true;}
for(i=0;i<childItemsLength;++i){childContext=childItems[i];childMargins=childContext.marginInfo||childContext.getMarginInfo();totalMargin+=childMargins[widthName];if(!childContext[names.widthModel].calculated){childWidth=childContext.getProp(widthName);nonFlexWidth+=childWidth;if(isNaN(nonFlexWidth)){return false;}}}
nonFlexWidth+=totalMargin;if(ownerContext.percentageWidths){percentageSpace=containerWidth-totalMargin;if(isNaN(percentageSpace)){return false;}
for(i=0;i<childItemsLength;++i){childContext=childItems[i];if(childContext.percentageParallel){childWidth=Math.ceil(percentageSpace*childContext.percentageParallel);childWidth=childContext.setWidth(childWidth);nonFlexWidth+=childWidth;}}}
if(ownerContext.parallelSizeModel.shrinkWrap){plan.availableSpace=0;plan.tooNarrow=false;}else{plan.availableSpace=containerWidth-nonFlexWidth;plan.tooNarrow=plan.availableSpace<ownerContext.flexedMinSize;if(plan.tooNarrow&&Ext.getScrollbarSize()[names.height]&&me.scrollParallel&&ownerContext.state.perpendicularDone){ownerContext.state.perpendicularDone=false;for(i=0;i<childItemsLength;++i){childItems[i].invalidate();}}}
contentWidth=nonFlexWidth;remainingWidth=plan.availableSpace;remainingFlex=ownerContext.totalFlex;for(i=0;i<flexedItemsLength;i++){childContext=flexedItems[i];flex=childContext.flex;flexedWidth=me.roundFlex((flex/remainingFlex)*remainingWidth);flexedWidth=childContext[setWidthName](flexedWidth);contentWidth+=flexedWidth;remainingWidth=Math.max(0,remainingWidth-flexedWidth);remainingFlex-=flex;}
if(pack.center){left+=remainingWidth/2;if(left<0){left=0;}}else if(pack.end){left+=remainingWidth;}
for(i=0;i<childItemsLength;++i){childContext=childItems[i];childMargins=childContext.marginInfo;left+=childMargins[beforeXName];childContext.setProp(names.x,left);left+=childMargins[afterXName]+childContext.props[widthName];}
contentWidth+=ownerContext.targetContext.getPaddingInfo()[widthName];ownerContext.state.contentWidth=contentWidth;if(mayNeedScrollbarAdjust&&(ownerContext.peek(names.contentHeight)>plan.targetSize[names.height])){contentWidth+=scrollbarWidth;ownerContext[names.hasOverflowY]=true;ownerContext.target.componentLayout[names.setWidthInDom]=true;ownerContext[names.invalidateScrollY]=Ext.isStrict&&Ext.isIE8;}
ownerContext[names.setContentWidth](contentWidth);return true;},calculatePerpendicular:function(ownerContext,names,plan){var me=this,heightShrinkWrap=ownerContext.perpendicularSizeModel.shrinkWrap,targetSize=plan.targetSize,childItems=ownerContext.childItems,childItemsLength=childItems.length,mmax=Math.max,heightName=names.height,setHeightName=names.setHeight,beforeYName=names.beforeY,topPositionName=names.y,padding=me.padding,top=padding[beforeYName],availHeight=targetSize[heightName]-top-padding[names.afterY],align=ownerContext.boxOptions.align,isStretch=align.stretch,isStretchMax=align.stretchmax,isCenter=align.center,isBottom=align.bottom,constrain=me.constrainAlign,maxHeight=0,hasPercentageSizes=0,onBeforeInvalidateChild=me.onBeforeConstrainInvalidateChild,onAfterInvalidateChild=me.onAfterConstrainInvalidateChild,scrollbarHeight=Ext.getScrollbarSize().height,childTop,i,childHeight,childMargins,diff,height,childContext,stretchMaxPartner,stretchMaxChildren,shrinkWrapParallelOverflow,percentagePerpendicular;if(isStretch||((isCenter||isBottom)&&!heightShrinkWrap)){if(isNaN(availHeight)){return false;}}
if(me.scrollParallel&&plan.tooNarrow){if(heightShrinkWrap){shrinkWrapParallelOverflow=true;}else{availHeight-=scrollbarHeight;plan.targetSize[heightName]-=scrollbarHeight;}}
if(isStretch){height=availHeight;}else{for(i=0;i<childItemsLength;i++){childContext=childItems[i];childMargins=(childContext.marginInfo||childContext.getMarginInfo())[heightName];if(!(percentagePerpendicular=childContext.percentagePerpendicular)){childHeight=childContext.getProp(heightName);}else{++hasPercentageSizes;if(heightShrinkWrap){continue;}else{childHeight=percentagePerpendicular*availHeight-childMargins;childHeight=childContext[names.setHeight](childHeight);}}
if(!heightShrinkWrap&&constrain&&childContext[names.heightModel].shrinkWrap&&childHeight>availHeight){childContext.invalidate({before:onBeforeInvalidateChild,after:onAfterInvalidateChild,layout:me,childHeight:availHeight,names:names});ownerContext.state.parallelDone=false;}
if(isNaN(maxHeight=mmax(maxHeight,childHeight+childMargins,childContext.target[names.minHeight]||0))){return false;}}
if(shrinkWrapParallelOverflow){maxHeight+=scrollbarHeight;ownerContext[names.hasOverflowX]=true;ownerContext.target.componentLayout[names.setHeightInDom]=true;ownerContext[names.invalidateScrollX]=Ext.isStrict&&Ext.isIE8;}
stretchMaxPartner=ownerContext.stretchMaxPartner;if(stretchMaxPartner){ownerContext.setProp('maxChildHeight',maxHeight);stretchMaxChildren=stretchMaxPartner.childItems;if(stretchMaxChildren&&stretchMaxChildren.length){maxHeight=mmax(maxHeight,stretchMaxPartner.getProp('maxChildHeight'));if(isNaN(maxHeight)){return false;}}}
ownerContext[names.setContentHeight](maxHeight+me.padding[heightName]+
ownerContext.targetContext.getPaddingInfo()[heightName]);if(shrinkWrapParallelOverflow){maxHeight-=scrollbarHeight;}
plan.maxSize=maxHeight;if(isStretchMax){height=maxHeight;}else if(isCenter||isBottom||hasPercentageSizes){if(constrain){height=heightShrinkWrap?maxHeight:availHeight;}else{height=heightShrinkWrap?maxHeight:mmax(availHeight,maxHeight);}
height-=ownerContext.innerCtContext.getBorderInfo()[heightName];}}
for(i=0;i<childItemsLength;i++){childContext=childItems[i];childMargins=childContext.marginInfo||childContext.getMarginInfo();childTop=top+childMargins[beforeYName];if(isStretch){childContext[setHeightName](height-childMargins[heightName]);}else{percentagePerpendicular=childContext.percentagePerpendicular;if(heightShrinkWrap&&percentagePerpendicular){childMargins=childContext.marginInfo||childContext.getMarginInfo();childHeight=percentagePerpendicular*height-childMargins[heightName];childHeight=childContext.setHeight(childHeight);}
if(isCenter){diff=height-childContext.props[heightName];if(diff>0){childTop=top+Math[me.alignRoundingMethod](diff/2);}}else if(isBottom){childTop=mmax(0,height-childTop-childContext.props[heightName]);}}
childContext.setProp(topPositionName,childTop);}
return true;},onBeforeConstrainInvalidateChild:function(childContext,options){var heightModelName=options.names.heightModel;if(!childContext[heightModelName].constrainedMin){childContext[heightModelName]=Ext.layout.SizeModel.calculated;}},onAfterConstrainInvalidateChild:function(childContext,options){var names=options.names;childContext.setProp(names.beforeY,0);if(childContext[names.heightModel].calculated){childContext[names.setHeight](options.childHeight);}},calculateStretchMax:function(ownerContext,names,plan){var me=this,heightName=names.height,widthName=names.width,childItems=ownerContext.childItems,length=childItems.length,height=plan.maxSize,onBeforeStretchMaxInvalidateChild=me.onBeforeStretchMaxInvalidateChild,onAfterStretchMaxInvalidateChild=me.onAfterStretchMaxInvalidateChild,childContext,props,i,childHeight;for(i=0;i<length;++i){childContext=childItems[i];props=childContext.props;childHeight=height-childContext.getMarginInfo()[heightName];if(childHeight!=props[heightName]||childContext[names.heightModel].constrained){childContext.invalidate({before:onBeforeStretchMaxInvalidateChild,after:onAfterStretchMaxInvalidateChild,layout:me,childWidth:props[widthName],childHeight:childHeight,childX:props.x,childY:props.y,names:names});}}},onBeforeStretchMaxInvalidateChild:function(childContext,options){var heightModelName=options.names.heightModel;if(!childContext[heightModelName].constrainedMax){childContext[heightModelName]=Ext.layout.SizeModel.calculated;}},onAfterStretchMaxInvalidateChild:function(childContext,options){var names=options.names,childHeight=options.childHeight,childWidth=options.childWidth;childContext.setProp('x',options.childX);childContext.setProp('y',options.childY);if(childContext[names.heightModel].calculated){childContext[names.setHeight](childHeight);}
if(childContext[names.widthModel].calculated){childContext[names.setWidth](childWidth);}},completeLayout:function(ownerContext){var me=this,names=ownerContext.boxNames,invalidateScrollX=ownerContext.invalidateScrollX,invalidateScrollY=ownerContext.invalidateScrollY,dom,el,overflowX,overflowY,styles;me.overflowHandler.completeLayout(ownerContext);if(invalidateScrollX||invalidateScrollY){el=me.getTarget();dom=el.dom;styles=dom.style;if(invalidateScrollX){overflowX=el.getStyle('overflowX');if(overflowX=='auto'){overflowX=styles.overflowX;styles.overflowX='scroll';}else{invalidateScrollX=false;}}
if(invalidateScrollY){overflowY=el.getStyle('overflowY');if(overflowY=='auto'){overflowY=styles.overflowY;styles.overflowY='scroll';}else{invalidateScrollY=false;}}
if(invalidateScrollX||invalidateScrollY){dom.scrollWidth;if(invalidateScrollX){styles.overflowX=overflowX;}
if(invalidateScrollY){styles.overflowY=overflowY;}}}
if(me.scrollParallel){me.owner.getTargetEl().dom[names.scrollLeft]=me.scrollPos;}},finishedLayout:function(ownerContext){this.overflowHandler.finishedLayout(ownerContext);this.callParent(arguments);this.targetEl.setWidth(ownerContext.innerCtContext.props.width);},publishInnerCtSize:function(ownerContext,reservedSpace){var me=this,names=ownerContext.boxNames,heightName=names.height,widthName=names.width,align=ownerContext.boxOptions.align,dock=me.owner.dock,padding=me.padding,plan=ownerContext.state.boxPlan,targetSize=plan.targetSize,height=targetSize[heightName],innerCtContext=ownerContext.innerCtContext,innerCtWidth=(ownerContext.parallelSizeModel.shrinkWrap||(plan.tooNarrow&&me.scrollParallel)?ownerContext.state.contentWidth-ownerContext.targetContext.getPaddingInfo()[widthName]:targetSize[widthName])-(reservedSpace||0),innerCtHeight;if(align.stretch){innerCtHeight=height;}else{innerCtHeight=plan.maxSize+padding[names.beforeY]+padding[names.afterY]+innerCtContext.getBorderInfo()[heightName];if(!ownerContext.perpendicularSizeModel.shrinkWrap&&(align.center||align.bottom)){innerCtHeight=Math.max(height,innerCtHeight);}}
innerCtContext[names.setWidth](innerCtWidth);innerCtContext[names.setHeight](innerCtHeight);if(isNaN(innerCtWidth+innerCtHeight)){me.done=false;}
if(plan.calculatedWidth&&(dock=='left'||dock=='right')){ownerContext.setWidth(plan.calculatedWidth,true,true);}},onRemove:function(comp){var me=this;me.callParent(arguments);if(me.overflowHandler){me.overflowHandler.onRemove(comp);}
if(comp.layoutMarginCap==me.id){delete comp.layoutMarginCap;}},initOverflowHandler:function(){var me=this,handler=me.overflowHandler,handlerType,constructor;if(typeof handler=='string'){handler={type:handler};}
handlerType='None';if(handler&&handler.type!==undefined){handlerType=handler.type;}
constructor=Ext.layout.container.boxOverflow[handlerType];if(constructor[me.type]){constructor=constructor[me.type];}
me.overflowHandler=Ext.create('Ext.layout.container.boxOverflow.'+handlerType,me,handler);},getRenderTarget:function(){return this.targetEl;},getElementTarget:function(){return this.innerCt;},destroy:function(){Ext.destroy(this.innerCt,this.overflowHandler);this.callParent(arguments);},getRenderData:function(){var data=this.callParent();data.targetElCls=this.targetElCls;return data;}});Ext.define('Ext.form.field.Spinner',{extend:'Ext.form.field.Trigger',alias:'widget.spinnerfield',alternateClassName:'Ext.form.Spinner',requires:['Ext.util.KeyNav'],trigger1Cls:Ext.baseCSSPrefix+'form-spinner-up',trigger2Cls:Ext.baseCSSPrefix+'form-spinner-down',spinUpEnabled:true,spinDownEnabled:true,keyNavEnabled:true,mouseWheelEnabled:true,repeatTriggerClick:true,onSpinUp:Ext.emptyFn,onSpinDown:Ext.emptyFn,triggerTpl:'<td style="{triggerStyle}" class="{triggerCls}">'+'<div class="'+Ext.baseCSSPrefix+'trigger-index-0 '+Ext.baseCSSPrefix+'form-trigger '+Ext.baseCSSPrefix+'form-spinner-up {spinnerUpCls} {childElCls}" role="button"></div>'+'<div class="'+Ext.baseCSSPrefix+'trigger-index-1 '+Ext.baseCSSPrefix+'form-trigger '+Ext.baseCSSPrefix+'form-spinner-down {spinnerDownCls} {childElCls}" role="button"></div>'+'</td>'+'</tr>',initComponent:function(){this.callParent();this.addEvents('spin','spinup','spindown');},onRender:function(){var me=this,triggers;me.callParent(arguments);triggers=me.triggerEl;me.spinUpEl=triggers.item(0);me.spinDownEl=triggers.item(1);me.triggerCell=me.spinUpEl.parent();if(me.keyNavEnabled){me.spinnerKeyNav=new Ext.util.KeyNav(me.inputEl,{scope:me,up:me.spinUp,down:me.spinDown});}
if(me.mouseWheelEnabled){me.mon(me.bodyEl,'mousewheel',me.onMouseWheel,me);}},getSubTplMarkup:function(values){var me=this,childElCls=values.childElCls,field=Ext.form.field.Base.prototype.getSubTplMarkup.apply(me,arguments);return'<table id="'+me.id+'-triggerWrap" class="'+Ext.baseCSSPrefix+'form-trigger-wrap'+childElCls+'" cellpadding="0" cellspacing="0">'+'<tbody>'+'<tr><td id="'+me.id+'-inputCell" class="'+Ext.baseCSSPrefix+'form-trigger-input-cell'+childElCls+'">'+field+'</td>'+
me.getTriggerMarkup()+'</tbody></table>';},getTriggerMarkup:function(){return this.getTpl('triggerTpl').apply(this.getTriggerData());},getTriggerData:function(){var me=this,hideTrigger=(me.readOnly||me.hideTrigger);return{triggerCls:Ext.baseCSSPrefix+'trigger-cell',triggerStyle:hideTrigger?'display:none':'',spinnerUpCls:!me.spinUpEnabled?me.trigger1Cls+'-disabled':'',spinnerDownCls:!me.spinDownEnabled?me.trigger2Cls+'-disabled':''};},getTriggerWidth:function(){var me=this,totalTriggerWidth=0;if(me.triggerWrap&&!me.hideTrigger&&!me.readOnly){totalTriggerWidth=me.triggerWidth;}
return totalTriggerWidth;},onTrigger1Click:function(){this.spinUp();},onTrigger2Click:function(){this.spinDown();},onTriggerWrapMouseup:function(){this.inputEl.focus();},spinUp:function(){var me=this;if(me.spinUpEnabled&&!me.disabled){me.fireEvent('spin',me,'up');me.fireEvent('spinup',me);me.onSpinUp();}},spinDown:function(){var me=this;if(me.spinDownEnabled&&!me.disabled){me.fireEvent('spin',me,'down');me.fireEvent('spindown',me);me.onSpinDown();}},setSpinUpEnabled:function(enabled){var me=this,wasEnabled=me.spinUpEnabled;me.spinUpEnabled=enabled;if(wasEnabled!==enabled&&me.rendered){me.spinUpEl[enabled?'removeCls':'addCls'](me.trigger1Cls+'-disabled');}},setSpinDownEnabled:function(enabled){var me=this,wasEnabled=me.spinDownEnabled;me.spinDownEnabled=enabled;if(wasEnabled!==enabled&&me.rendered){me.spinDownEl[enabled?'removeCls':'addCls'](me.trigger2Cls+'-disabled');}},onMouseWheel:function(e){var me=this,delta;if(me.hasFocus){delta=e.getWheelDelta();if(delta>0){me.spinUp();}else if(delta<0){me.spinDown();}
e.stopEvent();}},onDestroy:function(){Ext.destroyMembers(this,'spinnerKeyNav','spinUpEl','spinDownEl');this.callParent();}});Ext.define('Ext.grid.CellEditor',{extend:'Ext.Editor',constructor:function(config){config=Ext.apply({},config);if(config.field){config.field.monitorTab=false;}
this.callParent([config]);},onShow:function(){var me=this,innerCell=me.boundEl.first();if(innerCell){if(me.isForTree){innerCell=innerCell.child(me.treeNodeSelector);}
innerCell.hide();}
me.callParent(arguments);},onHide:function(){var me=this,innerCell=me.boundEl.first();if(innerCell){if(me.isForTree){innerCell=innerCell.child(me.treeNodeSelector);}
innerCell.show();}
me.callParent(arguments);},afterRender:function(){var me=this,field=me.field;me.callParent(arguments);if(field.isCheckbox){field.mon(field.inputEl,{mousedown:me.onCheckBoxMouseDown,click:me.onCheckBoxClick,scope:me});}},onCheckBoxMouseDown:function(){this.completeEdit=Ext.emptyFn;},onCheckBoxClick:function(){delete this.completeEdit;this.field.focus(false,10);},realign:function(autoSize){var me=this,boundEl=me.boundEl,innerCell=boundEl.first(),width=boundEl.getWidth(),offsets=Ext.Array.clone(me.offsets),grid=me.grid,xOffset;if(me.isForTree){xOffset=me.getTreeNodeOffset(innerCell);width-=Math.abs(xOffset);offsets[0]+=xOffset;}
if(grid.columnLines){width-=boundEl.getBorderWidth('rl');}
if(autoSize===true){me.field.setWidth(width);}
me.alignTo(innerCell,me.alignment,offsets);},getTreeNodeOffset:function(innerCell){return innerCell.child(this.treeNodeSelector).getOffsetsTo(innerCell)[0];},onEditorTab:function(e){var field=this.field;if(field.onEditorTab){field.onEditorTab(e);}},alignment:"l-l",hideEl:false,cls:Ext.baseCSSPrefix+'small-editor '+
Ext.baseCSSPrefix+'grid-editor '+
Ext.baseCSSPrefix+'grid-cell-editor',treeNodeSelector:'.'+Ext.baseCSSPrefix+'tree-node-text',shim:false,shadow:false});Ext.define('Ext.grid.header.DragZone',{extend:'Ext.dd.DragZone',colHeaderSelector:'.'+Ext.baseCSSPrefix+'column-header',colInnerSelector:'.'+Ext.baseCSSPrefix+'column-header-inner',maxProxyWidth:120,constructor:function(headerCt){this.headerCt=headerCt;this.ddGroup=this.getDDGroup();this.callParent([headerCt.el]);this.proxy.el.addCls(Ext.baseCSSPrefix+'grid-col-dd');},getDDGroup:function(){return'header-dd-zone-'+this.headerCt.up('[scrollerOwner]').id;},getDragData:function(e){if(e.getTarget(this.colInnerSelector)){var header=e.getTarget(this.colHeaderSelector),headerCmp,ddel;if(header){headerCmp=Ext.getCmp(header.id);if(!this.headerCt.dragging&&headerCmp.draggable&&!(headerCmp.isOnLeftEdge(e)||headerCmp.isOnRightEdge(e))){ddel=document.createElement('div');ddel.innerHTML=Ext.getCmp(header.id).text;return{ddel:ddel,header:headerCmp};}}}
return false;},onBeforeDrag:function(){return!(this.headerCt.dragging||this.disabled);},onInitDrag:function(){this.headerCt.dragging=true;this.callParent(arguments);},onDragDrop:function(){this.headerCt.dragging=false;this.callParent(arguments);},afterRepair:function(){this.callParent();this.headerCt.dragging=false;},getRepairXY:function(){return this.dragData.header.el.getXY();},disable:function(){this.disabled=true;},enable:function(){this.disabled=false;}});Ext.define('Ext.view.Table',{extend:'Ext.view.View',alias:'widget.tableview',requires:['Ext.grid.CellContext','Ext.view.TableLayout','Ext.view.NodeCache','Ext.util.DelayedTask','Ext.util.MixedCollection'],componentLayout:'tableview',baseCls:Ext.baseCSSPrefix+'grid-view',firstCls:Ext.baseCSSPrefix+'grid-cell-first',lastCls:Ext.baseCSSPrefix+'grid-cell-last',headerRowSelector:'tr.'+Ext.baseCSSPrefix+'grid-header-row',selectedItemCls:Ext.baseCSSPrefix+'grid-row-selected',beforeSelectedItemCls:Ext.baseCSSPrefix+'grid-row-before-selected',selectedCellCls:Ext.baseCSSPrefix+'grid-cell-selected',focusedItemCls:Ext.baseCSSPrefix+'grid-row-focused',beforeFocusedItemCls:Ext.baseCSSPrefix+'grid-row-before-focused',tableFocusedFirstCls:Ext.baseCSSPrefix+'grid-table-focused-first',tableSelectedFirstCls:Ext.baseCSSPrefix+'grid-table-selected-first',tableOverFirstCls:Ext.baseCSSPrefix+'grid-table-over-first',overItemCls:Ext.baseCSSPrefix+'grid-row-over',beforeOverItemCls:Ext.baseCSSPrefix+'grid-row-before-over',altRowCls:Ext.baseCSSPrefix+'grid-row-alt',dirtyCls:Ext.baseCSSPrefix+'grid-dirty-cell',rowClsRe:new RegExp('(?:^|\\s*)'+Ext.baseCSSPrefix+'grid-row-(first|last|alt)(?:\\s+|$)','g'),cellRe:new RegExp(Ext.baseCSSPrefix+'grid-cell-([^\\s]+) ',''),positionBody:true,trackOver:true,getRowClass:null,stripeRows:true,markDirty:true,tpl:'{%values.view.tableTpl.applyOut(values, out)%}',tableTpl:['{%','var view=values.view,tableCls=["'+Ext.baseCSSPrefix+'" + view.id + "-table '+Ext.baseCSSPrefix+'grid-table"];','if (view.columnLines) tableCls[tableCls.length]=view.ownerCt.colLinesCls;','if (view.rowLines) tableCls[tableCls.length]=view.ownerCt.rowLinesCls;','%}','<table role="presentation" id="{view.id}-table" class="{[tableCls.join(" ")]}" border="0" cellspacing="0" cellpadding="0" style="{tableStyle}" tabIndex="-1">','{[view.renderColumnSizer(out)]}','{[view.renderTHead(values, out)]}','{[view.renderTFoot(values, out)]}','<tbody id="{view.id}-body">','{%','view.renderRows(values.rows, values.viewStartIndex, out);','%}','</tbody>','</table>',{priority:0}],rowTpl:['{%','var dataRowCls = values.recordIndex === -1 ? "" : " '+Ext.baseCSSPrefix+'grid-data-row";','%}','<tr role="row" {[values.rowId ? ("id=\\"" + values.rowId + "\\"") : ""]} ','data-boundView="{view.id}" ','data-recordId="{record.internalId}" ','data-recordIndex="{recordIndex}" ','class="{[values.itemClasses.join(" ")]} {[values.rowClasses.join(" ")]}{[dataRowCls]}" ','{rowAttr:attributes} tabIndex="-1">','<tpl for="columns">'+'{%','parent.view.renderCell(values, parent.record, parent.recordIndex, xindex - 1, out, parent)','%}','</tpl>','</tr>',{priority:0}],cellTpl:['<td role="gridcell" class="{tdCls}" {tdAttr} id="{[Ext.id()]}">','<div {unselectableAttr} class="'+Ext.baseCSSPrefix+'grid-cell-inner {innerCls}"','style="text-align:{align};<tpl if="style">{style}</tpl>">{value}</div>','</td>',{priority:0}],refreshSelmodelOnRefresh:false,tableValues:{},rowValues:{itemClasses:[],rowClasses:[]},cellValues:{classes:[Ext.baseCSSPrefix+'grid-cell '+Ext.baseCSSPrefix+'grid-td']},renderBuffer:document.createElement('div'),constructor:function(config){if(config.grid.isTree){config.baseCls=Ext.baseCSSPrefix+'tree-view';}
this.callParent([config]);},initComponent:function(){var me=this,scroll=me.scroll;this.addEvents('beforecellclick','cellclick','beforecelldblclick','celldblclick','beforecellcontextmenu','cellcontextmenu','beforecellmousedown','cellmousedown','beforecellmouseup','cellmouseup','beforecellkeydown','cellkeydown');me.body=new Ext.dom.Element.Fly();me.body.id=me.id+'gridBody';me.autoScroll=undefined;if(!me.trackOver){me.overItemCls=null;me.beforeOverItemCls=null;}
if(scroll===true||scroll==='both'){me.autoScroll=true;}else if(scroll==='horizontal'){me.overflowX='auto';}else if(scroll==='vertical'){me.overflowY='auto';}
me.selModel.view=me;me.headerCt.view=me;me.grid.view=me;me.initFeatures(me.grid);delete me.grid;me.tpl=me.getTpl('tpl');me.itemSelector=me.getItemSelector();me.all=new Ext.view.NodeCache(me);me.callParent();},moveColumn:function(fromIdx,toIdx,colsToMove){var me=this,fragment=(colsToMove>1)?document.createDocumentFragment():undefined,destinationCellIdx=toIdx,colCount=me.getGridColumns().length,lastIndex=colCount-1,doFirstLastClasses=(me.firstCls||me.lastCls)&&(toIdx===0||toIdx==colCount||fromIdx===0||fromIdx==lastIndex),i,j,rows,len,tr,cells,tables;if(me.rendered&&toIdx!==fromIdx){rows=me.el.query(me.getDataRowSelector());if(toIdx>fromIdx&&fragment){destinationCellIdx-=colsToMove;}
for(i=0,len=rows.length;i<len;i++){tr=rows[i];cells=tr.childNodes;if(doFirstLastClasses){if(cells.length===1){Ext.fly(cells[0]).addCls(me.firstCls);Ext.fly(cells[0]).addCls(me.lastCls);continue;}
if(fromIdx===0){Ext.fly(cells[0]).removeCls(me.firstCls);Ext.fly(cells[1]).addCls(me.firstCls);}else if(fromIdx===lastIndex){Ext.fly(cells[lastIndex]).removeCls(me.lastCls);Ext.fly(cells[lastIndex-1]).addCls(me.lastCls);}
if(toIdx===0){Ext.fly(cells[0]).removeCls(me.firstCls);Ext.fly(cells[fromIdx]).addCls(me.firstCls);}else if(toIdx===colCount){Ext.fly(cells[lastIndex]).removeCls(me.lastCls);Ext.fly(cells[fromIdx]).addCls(me.lastCls);}}
if(fragment){for(j=0;j<colsToMove;j++){fragment.appendChild(cells[fromIdx]);}
tr.insertBefore(fragment,cells[destinationCellIdx]||null);}else{tr.insertBefore(cells[fromIdx],cells[destinationCellIdx]||null);}}
tables=me.el.query(me.getBodySelector());for(i=0,len=tables.length;i<len;i++){tr=tables[i];if(fragment){for(j=0;j<colsToMove;j++){fragment.appendChild(tr.childNodes[fromIdx]);}
tr.insertBefore(fragment,tr.childNodes[destinationCellIdx]||null);}else{tr.insertBefore(tr.childNodes[fromIdx],tr.childNodes[destinationCellIdx]||null);}}}},scrollToTop:Ext.emptyFn,addElListener:function(eventName,fn,scope){this.mon(this,eventName,fn,scope,{element:'el'});},getGridColumns:function(){return this.ownerCt.columnManager.getColumns();},getHeaderAtIndex:function(index){return this.ownerCt.columnManager.getHeaderAtIndex(index);},getCell:function(record,column){var row=this.getNode(record,true);return Ext.fly(row).down(column.getCellSelector());},getFeature:function(id){var features=this.featuresMC;if(features){return features.get(id);}},findFeature:function(ftype){if(this.features){return Ext.Array.findBy(this.features,function(feature){if(feature.ftype===ftype){return true;}});}},initFeatures:function(grid){var me=this,i,features,feature,len;me.tableTpl=Ext.XTemplate.getTpl(this,'tableTpl');me.rowTpl=Ext.XTemplate.getTpl(this,'rowTpl');me.cellTpl=Ext.XTemplate.getTpl(this,'cellTpl');me.featuresMC=new Ext.util.MixedCollection();features=me.features=me.constructFeatures();len=features?features.length:0;for(i=0;i<len;i++){feature=features[i];feature.view=me;feature.grid=grid;me.featuresMC.add(feature);feature.init(grid);}},renderTHead:function(values,out){var headers=values.view.headerFns,len,i;if(headers){for(i=0,len=headers.length;i<len;++i){headers[i].call(this,values,out);}}},addHeaderFn:function(){var headers=this.headerFns;if(!headers){headers=this.headerFns=[];}
headers.push(fn);},renderTFoot:function(values,out){var footers=values.view.footerFns,len,i;if(footers){for(i=0,len=footers.length;i<len;++i){footers[i].call(this,values,out);}}},addFooterFn:function(fn){var footers=this.footerFns;if(!footers){footers=this.footerFns=[];}
footers.push(fn);},addTableTpl:function(newTpl){return this.addTpl('tableTpl',newTpl);},addRowTpl:function(newTpl){return this.addTpl('rowTpl',newTpl);},addCellTpl:function(newTpl){return this.addTpl('cellTpl',newTpl);},addTpl:function(which,newTpl){var me=this,tpl,prevTpl;newTpl=Ext.Object.chain(newTpl);if(!newTpl.isTemplate){newTpl.applyOut=me.tplApplyOut;}
for(tpl=me[which];newTpl.priority<tpl.priority;tpl=tpl.nextTpl){prevTpl=tpl;}
if(prevTpl){prevTpl.nextTpl=newTpl;}
else{me[which]=newTpl;}
newTpl.nextTpl=tpl;return newTpl;},tplApplyOut:function(values,out){if(this.before){if(this.before(values,out)===false){return;}}
this.nextTpl.applyOut(values,out);if(this.after){this.after(values,out);}},constructFeatures:function(){var me=this,features=me.features,feature,result,i=0,len;if(features){result=[];len=features.length;for(;i<len;i++){feature=features[i];if(!feature.isFeature){feature=Ext.create('feature.'+feature.ftype,feature);}
result[i]=feature;}}
return result;},beforeRender:function(){var me=this;me.callParent();if(!me.enableTextSelection){me.protoEl.unselectable();}},onViewScroll:function(e,t){this.callParent(arguments);this.fireEvent('bodyscroll',e,t);},createRowElement:function(record,index){var me=this,div=me.renderBuffer;me.tpl.overwrite(div,me.collectData([record],index));return Ext.fly(div).down(me.getNodeContainerSelector(),true).firstChild;},bufferRender:function(records,index){var me=this,div=me.renderBuffer;me.tpl.overwrite(div,me.collectData(records,index));return Ext.Array.toArray(Ext.fly(div).down(me.getNodeContainerSelector(),true).childNodes);},collectData:function(records,startIndex){this.rowValues.view=this;return{view:this,rows:records,viewStartIndex:startIndex,tableStyle:this.bufferedRenderer?('position:absolute;top:'+this.bufferedRenderer.bodyTop):''};},collectNodes:function(targetEl){this.all.fill(this.getNodeContainer().childNodes,this.all.startIndex);},refreshSize:function(){var me=this,grid,bodySelector=me.getBodySelector();if(bodySelector){me.body.attach(me.el.child(bodySelector,true));}
if(!me.hasLoadingHeight){grid=me.up('tablepanel');Ext.suspendLayouts();me.callParent();grid.updateLayout();Ext.resumeLayouts(true);}},statics:{getBoundView:function(node){return Ext.getCmp(node.getAttribute('data-boundView'));}},getRecord:function(node){node=this.getNode(node);if(node){var recordIndex=node.getAttribute('data-recordIndex');if(recordIndex){recordIndex=parseInt(recordIndex,10);if(recordIndex>-1){return this.store.data.getAt(recordIndex);}}
return this.dataSource.data.get(node.getAttribute('data-recordId'));}},indexOf:function(node){node=this.getNode(node,false);if(!node&&node!==0){return-1;}
return this.all.indexOf(node);},indexInStore:function(node){node=this.getNode(node,true);if(!node&&node!==0){return-1;}
var recordIndex=node.getAttribute('data-recordIndex');if(recordIndex){return parseInt(recordIndex,10);}
return this.dataSource.indexOf(this.getRecord(node));},renderRows:function(rows,viewStartIndex,out){var rowValues=this.rowValues,rowCount=rows.length,i;rowValues.view=this;rowValues.columns=this.ownerCt.columnManager.getColumns();for(i=0;i<rowCount;i++,viewStartIndex++){rowValues.itemClasses.length=rowValues.rowClasses.length=0;this.renderRow(rows[i],viewStartIndex,out);}
rowValues.view=rowValues.columns=rowValues.record=null;},renderColumnSizer:function(out){var columns=this.getGridColumns(),len=columns.length,i,column,width;for(i=0;i<len;i++){column=columns[i];width=column.hidden?0:(column.lastBox?column.lastBox.width:Ext.grid.header.Container.prototype.defaultWidth);out.push('<colgroup><col class="',Ext.baseCSSPrefix,'grid-cell-',columns[i].getItemId(),'" style="width:'+width+'px"></colgroup>');}},renderRow:function(record,rowIdx,out){var me=this,isMetadataRecord=rowIdx===-1,selModel=me.selModel,rowValues=me.rowValues,itemClasses=rowValues.itemClasses,rowClasses=rowValues.rowClasses,cls,rowTpl=me.rowTpl;rowValues.record=record;rowValues.recordId=record.internalId;rowValues.recordIndex=rowIdx;rowValues.rowId=me.getRowId(record);rowValues.itemCls=rowValues.rowCls='';if(!rowValues.columns){rowValues.columns=me.ownerCt.columnManager.getColumns();}
itemClasses.length=rowClasses.length=0;if(!isMetadataRecord){itemClasses[0]=Ext.baseCSSPrefix+"grid-row";if(selModel&&selModel.isRowSelected){if(selModel.isRowSelected(rowIdx+1)){itemClasses.push(me.beforeSelectedItemCls);}
if(selModel.isRowSelected(record)){itemClasses.push(me.selectedItemCls);}}
if(me.stripeRows&&rowIdx%2!==0){rowClasses.push(me.altRowCls);}
if(me.getRowClass){cls=me.getRowClass(record,rowIdx,null,me.dataSource);if(cls){rowClasses.push(cls);}}}
if(out){rowTpl.applyOut(rowValues,out);}else{return rowTpl.apply(rowValues);}},renderCell:function(column,record,recordIndex,columnIndex,out){var me=this,selModel=me.selModel,cellValues=me.cellValues,classes=cellValues.classes,fieldValue=record.data[column.dataIndex],cellTpl=me.cellTpl,value,clsInsertPoint;cellValues.record=record;cellValues.column=column;cellValues.recordIndex=recordIndex;cellValues.columnIndex=columnIndex;cellValues.cellIndex=columnIndex;cellValues.align=column.align;cellValues.tdCls=column.tdCls;cellValues.innerCls=column.innerCls;cellValues.style=cellValues.tdAttr="";cellValues.unselectableAttr=me.enableTextSelection?'':'unselectable="on"';if(column.renderer&&column.renderer.call){value=column.renderer.call(column.scope||me.ownerCt,fieldValue,cellValues,record,recordIndex,columnIndex,me.dataSource,me);if(cellValues.css){record.cssWarning=true;cellValues.tdCls+=' '+cellValues.css;delete cellValues.css;}}else{value=fieldValue;}
cellValues.value=(value==null||value==='')?'&#160;':value;classes[1]=Ext.baseCSSPrefix+'grid-cell-'+column.getItemId();clsInsertPoint=2;if(column.tdCls){classes[clsInsertPoint++]=column.tdCls;}
if(me.markDirty&&record.isModified(column.dataIndex)){classes[clsInsertPoint++]=me.dirtyCls;}
if(column.isFirstVisible){classes[clsInsertPoint++]=me.firstCls;}
if(column.isLastVisible){classes[clsInsertPoint++]=me.lastCls;}
if(!me.enableTextSelection){classes[clsInsertPoint++]=Ext.baseCSSPrefix+'unselectable';}
classes[clsInsertPoint++]=cellValues.tdCls;if(selModel&&selModel.isCellSelected&&selModel.isCellSelected(me,recordIndex,columnIndex)){classes[clsInsertPoint++]=(me.selectedCellCls);}
classes.length=clsInsertPoint;cellValues.tdCls=classes.join(' ');cellTpl.applyOut(cellValues,out);cellValues.column=null;},getNode:function(nodeInfo,dataRow){var fly,result=this.callParent(arguments);if(result&&result.tagName){if(dataRow){if(!(fly=Ext.fly(result)).is(this.dataRowSelector)){return fly.down(this.dataRowSelector,true);}}else if(dataRow===false){if(!(fly=Ext.fly(result)).is(this.itemSelector)){return fly.up(this.itemSelector,null,true);}}}
return result;},getRowId:function(record){return this.id+'-record-'+record.internalId;},constructRowId:function(internalId){return this.id+'-record-'+internalId;},getNodeById:function(id,dataRow){id=this.constructRowId(id);return this.retrieveNode(id,dataRow);},getNodeByRecord:function(record,dataRow){var id=this.getRowId(record);return this.retrieveNode(id,dataRow);},retrieveNode:function(id,dataRow){var result=this.el.getById(id,true),itemSelector=this.itemSelector,fly;if(dataRow===false&&result){if(!(fly=Ext.fly(result)).is(itemSelector)){return fly.up(itemSelector,null,true);}}
return result;},updateIndexes:Ext.emptyFn,bodySelector:'table',nodeContainerSelector:'tbody',itemSelector:'tr.'+Ext.baseCSSPrefix+'grid-row',dataRowSelector:'tr.'+Ext.baseCSSPrefix+'grid-data-row',cellSelector:'td.'+Ext.baseCSSPrefix+'grid-cell',sizerSelector:'col.'+Ext.baseCSSPrefix+'grid-cell',innerSelector:'div.'+Ext.baseCSSPrefix+'grid-cell-inner',getNodeContainer:function(){return this.el.down(this.nodeContainerSelector,true);},getBodySelector:function(){return this.bodySelector+'.'+Ext.baseCSSPrefix+this.id+'-table';},getNodeContainerSelector:function(){return this.nodeContainerSelector;},getColumnSizerSelector:function(header){return this.sizerSelector+'-'+header.getItemId();},getItemSelector:function(){return this.itemSelector;},getDataRowSelector:function(){return this.dataRowSelector;},getCellSelector:function(header){var result=this.cellSelector;if(header){result+='-'+header.getItemId();}
return result;},getCellInnerSelector:function(header){return this.getCellSelector(header)+' '+this.innerSelector;},addRowCls:function(rowInfo,cls){var row=this.getNode(rowInfo,false);if(row){Ext.fly(row).addCls(cls);}},removeRowCls:function(rowInfo,cls){var row=this.getNode(rowInfo,false);if(row){Ext.fly(row).removeCls(cls);}},setHighlightedItem:function(item){var me=this,highlighted=me.highlightedItem;if(highlighted&&me.el.isAncestor(highlighted)&&me.isRowStyleFirst(highlighted)){me.getRowStyleTableEl(highlighted).removeCls(me.tableOverFirstCls);}
if(item&&me.isRowStyleFirst(item)){me.getRowStyleTableEl(item).addCls(me.tableOverFirstCls);}
me.callParent(arguments);},onRowSelect:function(rowIdx){var me=this;me.addRowCls(rowIdx,me.selectedItemCls);if(me.isRowStyleFirst(rowIdx)){me.getRowStyleTableEl(rowIdx).addCls(me.tableSelectedFirstCls);}else{me.addRowCls(rowIdx-1,me.beforeSelectedItemCls);}},onRowDeselect:function(rowIdx){var me=this;me.removeRowCls(rowIdx,[me.selectedItemCls,me.focusedItemCls]);if(me.isRowStyleFirst(rowIdx)){me.getRowStyleTableEl(rowIdx).removeCls([me.tableFocusedFirstCls,me.tableSelectedFirstCls]);}else{me.removeRowCls(rowIdx-1,[me.beforeFocusedItemCls,me.beforeSelectedItemCls]);}},onCellSelect:function(position){var cell=this.getCellByPosition(position);if(cell){cell.addCls(this.selectedCellCls);this.scrollCellIntoView(cell);}},onCellDeselect:function(position){var cell=this.getCellByPosition(position,true);if(cell){Ext.fly(cell).removeCls(this.selectedCellCls);}},getCellByPosition:function(position,returnDom){if(position){var row=this.getNode(position.row,true),header=this.ownerCt.columnManager.getHeaderAtIndex(position.column);if(header&&row){return Ext.fly(row).down(this.getCellSelector(header),returnDom);}}
return false;},getFocusEl:function(){var me=this,result;if(me.refreshCounter){result=me.focusedRow;if(!(result&&me.el.contains(result))){if(me.all.getCount()&&(result=me.getNode(me.all.item(0).dom,true))){me.focusRow(result);}else{result=me.body;}}}else{return me.el;}
return Ext.get(result);},onRowFocus:function(rowIdx,highlight,supressFocus){var me=this;if(highlight){me.addRowCls(rowIdx,me.focusedItemCls);if(me.isRowStyleFirst(rowIdx)){me.getRowStyleTableEl(rowIdx).addCls(me.tableFocusedFirstCls);}else{me.addRowCls(rowIdx-1,me.beforeFocusedItemCls);}
if(!supressFocus){me.focusRow(rowIdx);}}else{me.removeRowCls(rowIdx,me.focusedItemCls);if(me.isRowStyleFirst(rowIdx)){me.getRowStyleTableEl(rowIdx).removeCls(me.tableFocusedFirstCls);}else{me.removeRowCls(rowIdx-1,me.beforeFocusedItemCls);}}
if((Ext.isIE6||Ext.isIE7)&&!me.ownerCt.rowLines){me.repaintRow(rowIdx)}},focus:function(selectText,delay){var me=this,saveScroll=Ext.isIE&&!delay,scrollPos;if(saveScroll){scrollPos=me.el.dom.scrollLeft;}
this.callParent(arguments);if(saveScroll){me.el.dom.scrollLeft=scrollPos;}},focusRow:function(row,delay){var me=this,rowIdx,gridCollapsed=me.ownerCt&&me.ownerCt.collapsed,record;if(me.isVisible(true)&&!gridCollapsed&&(row=me.getNode(row,true))){me.scrollRowIntoView(row);record=me.getRecord(row);rowIdx=me.indexInStore(row);me.selModel.setLastFocused(record);me.focusedRow=row;me.focus(false,delay,function(){me.fireEvent('rowfocus',record,row,rowIdx);});}},scrollRowIntoView:function(row){row=this.getNode(row,true);if(row){Ext.fly(row).scrollIntoView(this.el,false);}},focusCell:function(position){var me=this,cell=me.getCellByPosition(position),record=me.getRecord(position.row);me.focusRow(record);if(cell){me.scrollCellIntoView(cell);me.fireEvent('cellfocus',record,cell,position);}},scrollCellIntoView:function(cell){if(cell.row!=null&&cell.column!=null){cell=this.getCellByPosition(cell);}
if(cell){Ext.fly(cell).scrollIntoView(this.el,true);}},scrollByDelta:function(delta,dir){dir=dir||'scrollTop';var elDom=this.el.dom;elDom[dir]=(elDom[dir]+=delta);},isDataRow:function(row){return Ext.fly(row).hasCls(Ext.baseCSSPrefix+'grid-data-row');},syncRowHeights:function(firstRow,secondRow){firstRow=Ext.get(firstRow);secondRow=Ext.get(secondRow);firstRow.dom.style.height=secondRow.dom.style.height='';var me=this,rowTpl=me.rowTpl,firstRowHeight=firstRow.dom.offsetHeight,secondRowHeight=secondRow.dom.offsetHeight;if(firstRowHeight!==secondRowHeight){while(rowTpl){if(rowTpl.syncRowHeights){if(rowTpl.syncRowHeights(firstRow,secondRow)===false){break;}}
rowTpl=rowTpl.nextTpl;}
firstRowHeight=firstRow.dom.offsetHeight;secondRowHeight=secondRow.dom.offsetHeight;if(firstRowHeight!==secondRowHeight){firstRow=firstRow.down('[data-recordId]')||firstRow;secondRow=secondRow.down('[data-recordId]')||secondRow;if(firstRow&&secondRow){firstRow.dom.style.height=secondRow.dom.style.height='';firstRowHeight=firstRow.dom.offsetHeight;secondRowHeight=secondRow.dom.offsetHeight;if(firstRowHeight>secondRowHeight){firstRow.setHeight(firstRowHeight);secondRow.setHeight(firstRowHeight);}else if(secondRowHeight>firstRowHeight){firstRow.setHeight(secondRowHeight);secondRow.setHeight(secondRowHeight);}}}}},onIdChanged:function(store,rec,oldId,newId,oldInternalId){var me=this,rowDom;if(me.viewReady){rowDom=me.getNodeById(oldInternalId);if(rowDom){rowDom.setAttribute('data-recordId',rec.internalId);rowDom.id=me.getRowId(rec);}}},onUpdate:function(store,record,operation,changedFieldNames){var me=this,rowTpl=me.rowTpl,index,oldRow,oldRowDom,newRowDom,newAttrs,attLen,attName,attrIndex,overItemCls,beforeOverItemCls,focusedItemCls,beforeFocusedItemCls,selectedItemCls,beforeSelectedItemCls,columns;if(me.viewReady){oldRowDom=me.getNodeByRecord(record,false);if(oldRowDom){overItemCls=me.overItemCls;beforeOverItemCls=me.overItemCls;focusedItemCls=me.focusedItemCls;beforeFocusedItemCls=me.beforeFocusedItemCls;selectedItemCls=me.selectedItemCls;beforeSelectedItemCls=me.beforeSelectedItemCls;index=me.indexInStore(record);oldRow=Ext.fly(oldRowDom,'_internal');newRowDom=me.createRowElement(record,index);if(oldRow.hasCls(overItemCls)){Ext.fly(newRowDom).addCls(overItemCls);}
if(oldRow.hasCls(beforeOverItemCls)){Ext.fly(newRowDom).addCls(beforeOverItemCls);}
if(oldRow.hasCls(focusedItemCls)){Ext.fly(newRowDom).addCls(focusedItemCls);}
if(oldRow.hasCls(beforeFocusedItemCls)){Ext.fly(newRowDom).addCls(beforeFocusedItemCls);}
if(oldRow.hasCls(selectedItemCls)){Ext.fly(newRowDom).addCls(selectedItemCls);}
if(oldRow.hasCls(beforeSelectedItemCls)){Ext.fly(newRowDom).addCls(beforeSelectedItemCls);}
columns=me.ownerCt.columnManager.getColumns();if(Ext.isIE9m&&oldRowDom.mergeAttributes){oldRowDom.mergeAttributes(newRowDom,true);}else{newAttrs=newRowDom.attributes;attLen=newAttrs.length;for(attrIndex=0;attrIndex<attLen;attrIndex++){attName=newAttrs[attrIndex].name;if(attName!=='id'){oldRowDom.setAttribute(attName,newAttrs[attrIndex].value);}}}
if(columns.length){me.updateColumns(record,me.getNode(oldRowDom,true),me.getNode(newRowDom,true),columns,changedFieldNames);}
while(rowTpl){if(rowTpl.syncContent){if(rowTpl.syncContent(oldRowDom,newRowDom)===false){break;}}
rowTpl=rowTpl.nextTpl;}
me.fireEvent('itemupdate',record,index,oldRowDom);me.refreshSize();}}},updateColumns:function(record,oldRowDom,newRowDom,columns,changedFieldNames){var me=this,newAttrs,attLen,attName,attrIndex,colCount=columns.length,colIndex,column,oldCell,newCell,row,editingPlugin=me.editingPlugin||(me.lockingPartner&&me.ownerCt.ownerLockable.view.editingPlugin),isEditing=editingPlugin&&editingPlugin.editing,cellSelector=me.getCellSelector();if(oldRowDom.mergeAttributes){oldRowDom.mergeAttributes(newRowDom,true);}else{newAttrs=newRowDom.attributes;attLen=newAttrs.length;for(attrIndex=0;attrIndex<attLen;attrIndex++){attName=newAttrs[attrIndex].name;if(attName!=='id'){oldRowDom.setAttribute(attName,newAttrs[attrIndex].value);}}}
for(colIndex=0;colIndex<colCount;colIndex++){column=columns[colIndex];if(me.shouldUpdateCell(record,column,changedFieldNames)){cellSelector=me.getCellSelector(column);oldCell=Ext.DomQuery.selectNode(cellSelector,oldRowDom);newCell=Ext.DomQuery.selectNode(cellSelector,newRowDom);if(isEditing){Ext.fly(oldCell).syncContent(newCell);}
else{row=oldCell.parentNode;row.insertBefore(newCell,oldCell);row.removeChild(oldCell);}}}},shouldUpdateCell:function(record,column,changedFieldNames){if(column.hasCustomRenderer||!changedFieldNames){return true;}
if(changedFieldNames){var len=changedFieldNames.length,i,field;for(i=0;i<len;++i){field=changedFieldNames[i];if(field===column.dataIndex||field===record.idProperty){return true;}}}
return false;},refresh:function(){var me=this,hasFocus=me.el&&me.el.isAncestor(Ext.Element.getActiveElement());me.callParent(arguments);me.headerCt.setSortState();if(me.el&&!me.all.getCount()&&me.headerCt&&me.headerCt.tooNarrow){me.el.createChild({style:'position:absolute;height:1px;width:1px;left:'+(me.headerCt.getFullWidth()-1)+'px'});}
if(hasFocus){me.selModel.onLastFocusChanged(null,me.selModel.lastFocused);}},processItemEvent:function(record,row,rowIndex,e){if(this.indexInStore(row)!==-1){var me=this,cell=e.getTarget(me.getCellSelector(),row),cellIndex,map=me.statics().EventMap,selModel=me.getSelectionModel(),type=e.type,features=me.features,len=features.length,i,result,feature,header;if(type=='keydown'&&!cell&&selModel.getCurrentPosition){cell=me.getCellByPosition(selModel.getCurrentPosition(),true);}
if(cell){if(!cell.parentNode){return false;}
header=me.getHeaderByCell(cell);cellIndex=Ext.Array.indexOf(me.getGridColumns(),header);}else{cellIndex=-1;}
result=me.fireEvent('uievent',type,me,cell,rowIndex,cellIndex,e,record,row);if(result===false||me.callParent(arguments)===false){me.selModel.onVetoUIEvent(type,me,cell,rowIndex,cellIndex,e,record,row);return false;}
for(i=0;i<len;++i){feature=features[i];if(feature.wrapsItem){if(feature.vetoEvent(record,row,rowIndex,e)===false){me.processSpecialEvent(e);return false;}}}
if(type=='mouseover'||type=='mouseout'){return true;}
if(!cell){return true;}
return!((me['onBeforeCell'+map[type]](cell,cellIndex,record,row,rowIndex,e)===false)||(me.fireEvent('beforecell'+type,me,cell,cellIndex,record,row,rowIndex,e)===false)||(me['onCell'+map[type]](cell,cellIndex,record,row,rowIndex,e)===false)||(me.fireEvent('cell'+type,me,cell,cellIndex,record,row,rowIndex,e)===false));}else{this.processSpecialEvent(e);return false;}},processSpecialEvent:function(e){var me=this,features=me.features,ln=features.length,type=e.type,i,feature,prefix,featureTarget,beforeArgs,args,panel=me.ownerCt;me.callParent(arguments);if(type=='mouseover'||type=='mouseout'){return;}
for(i=0;i<ln;i++){feature=features[i];if(feature.hasFeatureEvent){featureTarget=e.getTarget(feature.eventSelector,me.getTargetEl());if(featureTarget){prefix=feature.eventPrefix;beforeArgs=feature.getFireEventArgs('before'+prefix+type,me,featureTarget,e);args=feature.getFireEventArgs(prefix+type,me,featureTarget,e);if((me.fireEvent.apply(me,beforeArgs)===false)||(panel.fireEvent.apply(panel,beforeArgs)===false)||(me.fireEvent.apply(me,args)===false)||(panel.fireEvent.apply(panel,args)===false)){return false;}}}}
return true;},onCellMouseDown:Ext.emptyFn,onCellMouseUp:Ext.emptyFn,onCellClick:Ext.emptyFn,onCellDblClick:Ext.emptyFn,onCellContextMenu:Ext.emptyFn,onCellKeyDown:Ext.emptyFn,onBeforeCellMouseDown:Ext.emptyFn,onBeforeCellMouseUp:Ext.emptyFn,onBeforeCellClick:Ext.emptyFn,onBeforeCellDblClick:Ext.emptyFn,onBeforeCellContextMenu:Ext.emptyFn,onBeforeCellKeyDown:Ext.emptyFn,expandToFit:function(header){this.autoSizeColumn(header);},autoSizeColumn:function(header){if(Ext.isNumber(header)){header=this.getGridColumns[header];}
if(header){if(header.isGroupHeader){header.autoSize();return;}
delete header.flex;header.setWidth(this.getMaxContentWidth(header));}},getMaxContentWidth:function(header){var me=this,cells=me.el.query(header.getCellInnerSelector()),originalWidth=header.getWidth(),i=0,ln=cells.length,hasPaddingBug=Ext.supports.ScrollWidthInlinePaddingBug,columnSizer=me.body.select(me.getColumnSizerSelector(header)),max=Math.max,paddingAdjust,maxWidth;if(hasPaddingBug&&ln>0){paddingAdjust=me.getCellPaddingAfter(cells[0]);}
columnSizer.setWidth(1);maxWidth=header.textEl.dom.offsetWidth+header.titleEl.getPadding('lr');for(;i<ln;i++){maxWidth=max(maxWidth,cells[i].scrollWidth);}
if(hasPaddingBug){maxWidth+=paddingAdjust;}
maxWidth=max(maxWidth,40);columnSizer.setWidth(originalWidth);return maxWidth;},getPositionByEvent:function(e){var me=this,cellNode=e.getTarget(me.cellSelector),rowNode=e.getTarget(me.itemSelector),record=me.getRecord(rowNode),header=me.getHeaderByCell(cellNode);return me.getPosition(record,header);},getHeaderByCell:function(cell){if(cell){var match=cell.className.match(this.cellRe);if(match&&match[1]){return this.ownerCt.columnManager.getHeaderById(match[1]);}}
return false;},walkCells:function(pos,direction,e,preventWrap,verifierFn,scope){if(!pos){return false;}
var me=this,row=pos.row,column=pos.column,rowCount=me.dataSource.getCount(),lastCol=me.ownerCt.columnManager.getColumns().length-1,newRow=row,newColumn=column,activeHeader=me.ownerCt.columnManager.getHeaderAtIndex(column);if(!activeHeader||activeHeader.hidden||!rowCount){return false;}
e=e||{};direction=direction.toLowerCase();switch(direction){case'right':if(column===lastCol){if(preventWrap||row===rowCount-1){return false;}
if(!e.ctrlKey){newRow=me.walkRows(row,1);if(newRow!==row){newColumn=0;}}}else{if(!e.ctrlKey){newColumn=column+1;}else{newColumn=lastCol;}}
break;case'left':if(column===0){if(preventWrap||row===0){return false;}
if(!e.ctrlKey){newRow=me.walkRows(row,-1);if(newRow!==row){newColumn=lastCol;}}}else{if(!e.ctrlKey){newColumn=column-1;}else{newColumn=0;}}
break;case'up':if(row===0){return false;}else{if(!e.ctrlKey){newRow=me.walkRows(row,-1);}else{newRow=me.walkRows(-1,1);}}
break;case'down':if(row===rowCount-1){return false;}else{if(!e.ctrlKey){newRow=me.walkRows(row,1);}else{newRow=me.walkRows(rowCount,-1);}}
break;}
if(verifierFn&&verifierFn.call(scope||me,{row:newRow,column:newColumn})!==true){return false;}else{return new Ext.grid.CellContext(me).setPosition(newRow,newColumn);}},walkRows:function(startRow,distance){var me=this,moved=0,lastValid=startRow,node,last=(me.dataSource.buffered?me.dataSource.getTotalCount():me.dataSource.getCount())-1,limit=(distance<0)?0:last,increment=limit?1:-1,result=startRow;do{if(limit?result>=limit:result<=0){return lastValid||limit;}
result+=increment;if((node=Ext.fly(me.getNode(result,true)))&&node.isVisible(true)){moved+=increment;lastValid=result;}}while(moved!==distance);return result;},walkRecs:function(startRec,distance){var me=this,moved=0,lastValid=startRec,node,last=(me.store.buffered?me.store.getTotalCount():me.store.getCount())-1,limit=(distance<0)?0:last,increment=limit?1:-1,testIndex=me.store.indexOf(startRec),rec;do{if(limit?testIndex>=limit:testIndex<=0){return lastValid;}
testIndex+=increment;rec=me.store.getAt(testIndex);if((node=Ext.fly(me.getNodeByRecord(rec,true)))&&node.isVisible(true)){moved+=increment;lastValid=rec;}}while(moved!==distance);return lastValid;},getFirstVisibleRowIndex:function(){var me=this,count=(me.dataSource.buffered?me.dataSource.getTotalCount():me.dataSource.getCount()),result=me.indexOf(me.all.first())-1;do{result+=1;if(result===count){return;}}while(!Ext.fly(me.getNode(result,true)).isVisible(true));return result;},getLastVisibleRowIndex:function(){var me=this,result=me.indexOf(me.all.last());do{result-=1;if(result===-1){return;}}while(!Ext.fly(me.getNode(result,true)).isVisible(true));return result;},getHeaderCt:function(){return this.headerCt;},getPosition:function(record,header){return new Ext.grid.CellContext(this).setPosition(record,header);},beforeDestroy:function(){var me=this;if(me.rendered){me.el.removeAllListeners();}
me.callParent(arguments);},onDestroy:function(){var me=this,features=me.featuresMC,len,i;if(features){for(i=0,len=features.getCount();i<len;++i){features.getAt(i).destroy();}}
me.featuresMC=null;this.callParent(arguments);},onAdd:function(ds,records,index){this.callParent(arguments);this.doStripeRows(index);},onRemove:function(ds,records,indexes){this.callParent(arguments);this.doStripeRows(indexes[0]);},doStripeRows:function(startRow,endRow){var me=this,rows,rowsLn,i,row;if(me.rendered&&me.stripeRows){rows=me.getNodes(startRow,endRow);for(i=0,rowsLn=rows.length;i<rowsLn;i++){row=rows[i];row.className=row.className.replace(me.rowClsRe,' ');startRow++;if(startRow%2===0){row.className+=(' '+me.altRowCls);}}}},repaintRow:function(rowIdx){var node=this.getNode(rowIdx),tds=node.childNodes,i=tds.length;while(i--){tds[i].className=tds[i].className;}},getRowStyleTableEl:function(item){var me=this;if(!item.tagName){item=this.getNode(item);}
return(me.isGrouping?Ext.fly(item):this.el).down('table.x-grid-table');},isRowStyleFirst:function(item){var me=this,index;if(item===-1){return false;}
if(!item.tagName){index=item;item=this.getNode(item);}else{index=me.indexOf(item);}
return(!index||me.isGrouping&&Ext.fly(item).hasCls(Ext.baseCSSPrefix+'grid-group-row'));},getCellPaddingAfter:function(cell){return Ext.fly(cell).getPadding('r');}});Ext.define('Ext.tree.View',{extend:'Ext.view.Table',alias:'widget.treeview',requires:['Ext.data.NodeStore'],isTreeView:true,loadingCls:Ext.baseCSSPrefix+'grid-tree-loading',expandedCls:Ext.baseCSSPrefix+'grid-tree-node-expanded',leafCls:Ext.baseCSSPrefix+'grid-tree-node-leaf',expanderSelector:'.'+Ext.baseCSSPrefix+'tree-expander',checkboxSelector:'.'+Ext.baseCSSPrefix+'tree-checkbox',expanderIconOverCls:Ext.baseCSSPrefix+'tree-expander-over',nodeAnimWrapCls:Ext.baseCSSPrefix+'tree-animator-wrap',blockRefresh:true,loadMask:false,rootVisible:true,deferInitialRefresh:false,expandDuration:250,collapseDuration:250,toggleOnDblClick:true,stripeRows:false,uiFields:['expanded','loaded','checked','expandable','leaf','icon','iconCls','loading','qtip','qtitle'],treeRowTpl:['{%','this.processRowValues(values);','this.nextTpl.applyOut(values, out, parent);','delete values.rowAttr["data-qtip"];','delete values.rowAttr["data-qtitle"];','%}',{priority:10,processRowValues:function(rowValues){var record=rowValues.record,view=rowValues.view,qtip=record.get('qtip'),qtitle=record.get('qttle');rowValues.rowAttr={};if(qtip){rowValues.rowAttr['data-qtip']=qtip;}
if(qtitle){rowValues.rowAttr['data-qtitle']=qtitle;}
if(record.isExpanded()){rowValues.rowClasses.push(view.expandedCls);}
if(record.isLeaf()){rowValues.rowClasses.push(view.leafCls);}
if(record.isLoading()){rowValues.rowClasses.push(view.loadingCls);}}}],initComponent:function(){var me=this,treeStore=me.panel.getStore(),store=me.store;if(me.initialConfig.animate===undefined){me.animate=Ext.enableFx;}
if(!store||store===treeStore){me.store=store=new Ext.data.NodeStore({treeStore:treeStore,recursive:true,rootVisible:me.rootVisible});}
if(me.node){me.setRootNode(me.node);}
me.animQueue={};me.animWraps={};me.addEvents('afteritemexpand','afteritemcollapse','nodedragover');me.callParent(arguments);me.addRowTpl(Ext.XTemplate.getTpl(me,'treeRowTpl'));},onBeforeFill:function(treeStore,fillRoot){this.store.suspendEvents();},onFillComplete:function(treeStore,fillRoot,newNodes){var me=this,store=me.store,start=store.indexOf(newNodes[0]);store.resumeEvents();fillRoot.triggerUIUpdate();if(!newNodes.length||start===-1){return;}
me.onAdd(me.store,newNodes,start);me.refreshPartner();},onBeforeSort:function(){this.store.suspendEvents();},onSort:function(o){if(o.isStore){this.store.resumeEvents();this.refresh();this.refreshPartner();}},refreshPartner:function(){var partner=this.lockingPartner;if(partner){partner.refresh();}},getMaskStore:function(){return this.panel.getStore();},afterRender:function(){var me=this;me.callParent(arguments);me.el.on({scope:me,delegate:me.expanderSelector,mouseover:me.onExpanderMouseOver,mouseout:me.onExpanderMouseOut,click:{delegate:me.checkboxSelector,fn:me.onCheckboxChange,scope:me}});},afterComponentLayout:function(){this.callParent(arguments);var stretcher=this.stretcher;if(stretcher){stretcher.setWidth((this.getWidth()-Ext.getScrollbarSize().width));}},processUIEvent:function(e){if(e.getTarget('.'+this.nodeAnimWrapCls,this.el)){return false;}
return this.callParent(arguments);},onClear:function(){this.store.removeAll();},setRootNode:function(node){var me=this;me.store.setNode(node);me.node=node;},onCheckboxChange:function(e,t){var me=this,item=e.getTarget(me.getItemSelector(),me.getTargetEl());if(item){me.onCheckChange(me.getRecord(item));}},onCheckChange:function(record){var checked=record.get('checked');if(Ext.isBoolean(checked)){checked=!checked;record.set('checked',checked);this.fireEvent('checkchange',record,checked);}},getChecked:function(){var checked=[];this.node.cascadeBy(function(rec){if(rec.get('checked')){checked.push(rec);}});return checked;},isItemChecked:function(rec){return rec.get('checked');},createAnimWrap:function(record,index){var me=this,node=me.getNode(record),tmpEl,nodeEl,columnSizer=[];me.renderColumnSizer(columnSizer);nodeEl=Ext.get(node);tmpEl=nodeEl.insertSibling({tag:'tr',html:['<td colspan="'+me.panel.headerCt.getColumnCount()+'">','<div class="'+me.nodeAnimWrapCls+'">','<table class="'+Ext.baseCSSPrefix+me.id+'-table '+Ext.baseCSSPrefix+'grid-table" style="border:0" cellspacing="0" cellpadding="0">',columnSizer.join(''),'<tbody></tbody></table>','</div>','</td>'].join('')},'after');return{record:record,node:node,el:tmpEl,expanding:false,collapsing:false,animating:false,animateEl:tmpEl.down('div'),targetEl:tmpEl.down('tbody')};},getAnimWrap:function(parent,bubble){if(!this.animate){return null;}
var wraps=this.animWraps,wrap=wraps[parent.internalId];if(bubble!==false){while(!wrap&&parent){parent=parent.parentNode;if(parent){wrap=wraps[parent.internalId];}}}
return wrap;},doAdd:function(records,index){var me=this,nodes=me.bufferRender(records,index,true),record=records[0],parent=record.parentNode,all=me.all,relativeIndex,animWrap=me.getAnimWrap(parent),targetEl,children,len;if(!animWrap||!animWrap.expanding){return me.callParent(arguments);}
parent=animWrap.record;targetEl=animWrap.targetEl;children=targetEl.dom.childNodes;len=children.length;relativeIndex=index-me.indexInStore(parent)-1;if(!len||relativeIndex>=len){targetEl.appendChild(nodes);}
else{Ext.fly(children[relativeIndex]).insertSibling(nodes,'before',true);}
all.insert(index,nodes);if(animWrap.isAnimating){me.onExpand(parent);}},onRemove:function(ds,records,indexes){var me=this,empty,i;if(me.viewReady){empty=me.store.getCount()===0;if(empty){me.refresh();}
else{for(i=indexes.length-1;i>=0;--i){me.doRemove(records[i],indexes[i]);}}
if(me.hasListeners.itemremove){for(i=indexes.length-1;i>=0;--i){me.fireEvent('itemremove',records[i],indexes[i]);}}}},doRemove:function(record,index){var me=this,all=me.all,animWrap=me.getAnimWrap(record),item=all.item(index),node=item?item.dom:null;if(!node||!animWrap||!animWrap.collapsing){return me.callParent(arguments);}
animWrap.targetEl.dom.insertBefore(node,animWrap.targetEl.dom.firstChild);all.removeElement(index);},onBeforeExpand:function(parent,records,index){var me=this,animWrap;if(me.rendered&&me.all.getCount()&&me.animate){if(me.getNode(parent)){animWrap=me.getAnimWrap(parent,false);if(!animWrap){animWrap=me.animWraps[parent.internalId]=me.createAnimWrap(parent);animWrap.animateEl.setHeight(0);}
else if(animWrap.collapsing){animWrap.targetEl.select(me.itemSelector).remove();}
animWrap.expanding=true;animWrap.collapsing=false;}}},onExpand:function(parent){var me=this,queue=me.animQueue,id=parent.getId(),node=me.getNode(parent),index=node?me.indexOf(node):-1,animWrap,animateEl,targetEl,fromHeight=Ext.isIEQuirks?1:0
if(me.singleExpand){me.ensureSingleExpand(parent);}
if(index===-1){return;}
animWrap=me.getAnimWrap(parent,false);if(!animWrap){parent.isExpandingOrCollapsing=false;me.fireEvent('afteritemexpand',parent,index,node);me.refreshSize();return;}
animateEl=animWrap.animateEl;targetEl=animWrap.targetEl;animateEl.stopAnimation();queue[id]=true;animateEl.dom.style.height=fromHeight+'px';animateEl.animate({from:{height:fromHeight},to:{height:targetEl.getHeight()},duration:me.expandDuration,listeners:{afteranimate:function(){var items=targetEl.query(me.itemSelector);if(items.length){animWrap.el.insertSibling(items,'before',true);}
animWrap.el.remove();me.refreshSize();delete me.animWraps[animWrap.record.internalId];delete queue[id];}},callback:function(){parent.isExpandingOrCollapsing=false;me.fireEvent('afteritemexpand',parent,index,node);}});animWrap.isAnimating=true;},onBeforeCollapse:function(parent,records,index,callback,scope){var me=this,animWrap;if(me.rendered&&me.all.getCount()){if(me.animate){if(Ext.Array.contains(parent.stores,me.store)){animWrap=me.getAnimWrap(parent);if(!animWrap){animWrap=me.animWraps[parent.internalId]=me.createAnimWrap(parent,index);}
else if(animWrap.expanding){animWrap.targetEl.select(this.itemSelector).remove();}
animWrap.expanding=false;animWrap.collapsing=true;animWrap.callback=callback;animWrap.scope=scope;}}else{me.onCollapseCallback=callback;me.onCollapseScope=scope;}}},onCollapse:function(parent){var me=this,queue=me.animQueue,id=parent.getId(),node=me.getNode(parent),index=node?me.indexOf(node):-1,animWrap=me.getAnimWrap(parent),animateEl;if(!me.all.getCount()||!Ext.Array.contains(parent.stores,me.store)){return;}
if(!animWrap){parent.isExpandingOrCollapsing=false;me.fireEvent('afteritemcollapse',parent,index,node);me.refreshSize();Ext.callback(me.onCollapseCallback,me.onCollapseScope);me.onCollapseCallback=me.onCollapseScope=null;return;}
animateEl=animWrap.animateEl;queue[id]=true;animateEl.stopAnimation();animateEl.animate({to:{height:Ext.isIEQuirks?1:0},duration:me.collapseDuration,listeners:{afteranimate:function(){animWrap.el.remove();me.refreshSize();delete me.animWraps[animWrap.record.internalId];delete queue[id];}},callback:function(){parent.isExpandingOrCollapsing=false;me.fireEvent('afteritemcollapse',parent,index,node);Ext.callback(animWrap.callback,animWrap.scope);animWrap.callback=animWrap.scope=null;}});animWrap.isAnimating=true;},isAnimating:function(node){return!!this.animQueue[node.getId()];},expand:function(record,deep,callback,scope){var me=this,doAnimate=!!me.animate,result;if(!doAnimate||!record.isExpandingOrCollapsing){if(!record.isLeaf()){record.isExpandingOrCollapsing=doAnimate;}
Ext.suspendLayouts();result=record.expand(deep,callback,scope);Ext.resumeLayouts(true);return result;}},collapse:function(record,deep,callback,scope){var me=this,doAnimate=!!me.animate;if(!doAnimate||!record.isExpandingOrCollapsing){if(!record.isLeaf()){record.isExpandingOrCollapsing=doAnimate;}
return record.collapse(deep,callback,scope);}},toggle:function(record,deep,callback,scope){if(record.isExpanded()){this.collapse(record,deep,callback,scope);}else{this.expand(record,deep,callback,scope);}},onItemDblClick:function(record,item,index){var me=this,editingPlugin=me.editingPlugin;me.callParent(arguments);if(me.toggleOnDblClick&&record.isExpandable()&&!(editingPlugin&&editingPlugin.clicksToEdit===2)){me.toggle(record);}},onBeforeItemMouseDown:function(record,item,index,e){if(e.getTarget(this.expanderSelector,item)){return false;}
return this.callParent(arguments);},onItemClick:function(record,item,index,e){if(e.getTarget(this.expanderSelector,item)&&record.isExpandable()){this.toggle(record,e.ctrlKey);return false;}
return this.callParent(arguments);},onExpanderMouseOver:function(e,t){e.getTarget(this.cellSelector,10,true).addCls(this.expanderIconOverCls);},onExpanderMouseOut:function(e,t){e.getTarget(this.cellSelector,10,true).removeCls(this.expanderIconOverCls);},getStoreListeners:function(){var me=this,listeners=me.callParent(arguments);return Ext.apply(listeners,{beforeexpand:me.onBeforeExpand,expand:me.onExpand,beforecollapse:me.onBeforeCollapse,collapse:me.onCollapse,write:me.onStoreWrite,datachanged:me.onStoreDataChanged});},onBindStore:function(){var me=this,treeStore=me.getTreeStore();me.callParent(arguments);me.mon(treeStore,{scope:me,beforefill:me.onBeforeFill,fillcomplete:me.onFillComplete});if(!treeStore.remoteSort){me.mon(treeStore,{scope:me,beforesort:me.onBeforeSort,sort:me.onSort});}},onUnbindStore:function(){var me=this,treeStore=me.getTreeStore();me.callParent(arguments);me.mun(treeStore,{scope:me,beforefill:me.onBeforeFill,fillcomplete:me.onFillComplete});if(!treeStore.remoteSort){me.mun(treeStore,{scope:me,beforesort:me.onBeforeSort,sort:me.onSort});}},getTreeStore:function(){return this.panel.store;},ensureSingleExpand:function(node){var parent=node.parentNode;if(parent){parent.eachChild(function(child){if(child!==node&&child.isExpanded()){child.collapse();}});}},shouldUpdateCell:function(record,column,changedFieldNames){if(changedFieldNames){var i=0,len=changedFieldNames.length;for(;i<len;++i){if(Ext.Array.contains(this.uiFields,changedFieldNames[i])){return true;}}}
return this.callParent(arguments);},onStoreWrite:function(store,operation){var treeStore=this.panel.store;treeStore.fireEvent('write',treeStore,operation);},onStoreDataChanged:function(store,operation){var treeStore=this.panel.store;treeStore.fireEvent('datachanged',treeStore);}});Ext.define('Ext.grid.plugin.BufferedRendererTableView',{override:'Ext.view.Table',onAdd:function(store,records,index){var me=this,bufferedRenderer=me.bufferedRenderer,rows=me.all;if(me.rendered&&bufferedRenderer&&(rows.getCount()+records.length)>bufferedRenderer.viewSize){if(index<rows.startIndex+bufferedRenderer.viewSize&&(index+records.length)>rows.startIndex){me.refreshView();}
else{bufferedRenderer.stretchView(me,bufferedRenderer.getScrollHeight());}}
else{me.callParent([store,records,index]);}},onRemove:function(store,records,indices){var me=this,bufferedRenderer=me.bufferedRenderer;me.callParent([store,records,indices]);if(me.rendered&&bufferedRenderer){if(me.dataSource.getCount()>bufferedRenderer.viewSize){me.refreshView();}
else{bufferedRenderer.stretchView(me,bufferedRenderer.getScrollHeight());}}},onDataRefresh:function(){var me=this;if(me.bufferedRenderer){me.all.clear();me.bufferedRenderer.onStoreClear();}
me.callParent();}});Ext.define('Ext.form.field.Number',{extend:'Ext.form.field.Spinner',alias:'widget.numberfield',alternateClassName:['Ext.form.NumberField','Ext.form.Number'],allowExponential:true,allowDecimals:true,decimalSeparator:'.',submitLocaleSeparator:true,decimalPrecision:2,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,step:1,minText:'The minimum value for this field is {0}',maxText:'The maximum value for this field is {0}',nanText:'{0} is not a valid number',negativeText:'The value cannot be negative',baseChars:'0123456789',autoStripChars:false,initComponent:function(){var me=this;me.callParent();me.setMinValue(me.minValue);me.setMaxValue(me.maxValue);},getErrors:function(value){var me=this,errors=me.callParent(arguments),format=Ext.String.format,num;value=Ext.isDefined(value)?value:this.processRawValue(this.getRawValue());if(value.length<1){return errors;}
value=String(value).replace(me.decimalSeparator,'.');if(isNaN(value)){errors.push(format(me.nanText,value));}
num=me.parseValue(value);if(me.minValue===0&&num<0){errors.push(this.negativeText);}
else if(num<me.minValue){errors.push(format(me.minText,me.minValue));}
if(num>me.maxValue){errors.push(format(me.maxText,me.maxValue));}
return errors;},rawToValue:function(rawValue){var value=this.fixPrecision(this.parseValue(rawValue));if(value===null){value=rawValue||null;}
return value;},valueToRaw:function(value){var me=this,decimalSeparator=me.decimalSeparator;value=me.parseValue(value);value=me.fixPrecision(value);value=Ext.isNumber(value)?value:parseFloat(String(value).replace(decimalSeparator,'.'));value=isNaN(value)?'':String(value).replace('.',decimalSeparator);return value;},getSubmitValue:function(){var me=this,value=me.callParent();if(!me.submitLocaleSeparator){value=value.replace(me.decimalSeparator,'.');}
return value;},onChange:function(){this.toggleSpinners();this.callParent(arguments);},toggleSpinners:function(){var me=this,value=me.getValue(),valueIsNull=value===null,enabled;if(me.spinUpEnabled||me.spinUpDisabledByToggle){enabled=valueIsNull||value<me.maxValue;me.setSpinUpEnabled(enabled,true);}
if(me.spinDownEnabled||me.spinDownDisabledByToggle){enabled=valueIsNull||value>me.minValue;me.setSpinDownEnabled(enabled,true);}},setMinValue:function(value){var me=this,allowed;me.minValue=Ext.Number.from(value,Number.NEGATIVE_INFINITY);me.toggleSpinners();if(me.disableKeyFilter!==true){allowed=me.baseChars+'';if(me.allowExponential){allowed+=me.decimalSeparator+'e+-';}
else{if(me.allowDecimals){allowed+=me.decimalSeparator;}
if(me.minValue<0){allowed+='-';}}
allowed=Ext.String.escapeRegex(allowed);me.maskRe=new RegExp('['+allowed+']');if(me.autoStripChars){me.stripCharsRe=new RegExp('[^'+allowed+']','gi');}}},setMaxValue:function(value){this.maxValue=Ext.Number.from(value,Number.MAX_VALUE);this.toggleSpinners();},parseValue:function(value){value=parseFloat(String(value).replace(this.decimalSeparator,'.'));return isNaN(value)?null:value;},fixPrecision:function(value){var me=this,nan=isNaN(value),precision=me.decimalPrecision;if(nan||!value){return nan?'':value;}else if(!me.allowDecimals||precision<=0){precision=0;}
return parseFloat(Ext.Number.toFixed(parseFloat(value),precision));},beforeBlur:function(){var me=this,v=me.parseValue(me.getRawValue());if(!Ext.isEmpty(v)){me.setValue(v);}},setSpinUpEnabled:function(enabled,internal){this.callParent(arguments);if(!internal){delete this.spinUpDisabledByToggle;}else{this.spinUpDisabledByToggle=!enabled;}},onSpinUp:function(){var me=this;if(!me.readOnly){me.setSpinValue(Ext.Number.constrain(me.getValue()+me.step,me.minValue,me.maxValue));}},setSpinDownEnabled:function(enabled,internal){this.callParent(arguments);if(!internal){delete this.spinDownDisabledByToggle;}else{this.spinDownDisabledByToggle=!enabled;}},onSpinDown:function(){var me=this;if(!me.readOnly){me.setSpinValue(Ext.Number.constrain(me.getValue()-me.step,me.minValue,me.maxValue));}},setSpinValue:function(value){var me=this,len;if(me.enforceMaxLength){if(me.fixPrecision(value).toString().length>me.maxLength){return;}}
me.setValue(value);}});Ext.define('SoL.controller.Login',{extend:'MP.controller.Login',uses:['SoL.desktop.App','SoL.window.Login','SoL.window.LostPassword','SoL.window.Signin'],applicationClass:'SoL.desktop.App',init:function(){var me=this;me.callParent(arguments);me.control({'loginwindow button[action=signin]':{click:me.signin},'loginwindow button[action=lostpassword]':{click:me.lostPassword}});},_doCreateUserDesktop:function(user){var me=this;var app=MP.controller.Login.prototype.createUserDesktop.call(me,user);app.on('ready',function(){Ext.Ajax.request({url:'/data/countries',success:function(response){var result=Ext.decode(response.responseText);var root=result.root;var c,cd={};for(var i=0,l=result.count;i<l;i++){c=root[i];cd[c.code]=c.name;}
SoL.form.field.FlagsCombo.countries=cd;}});});},createUserDesktop:function(user){var me=this;var reload=user.reload_l10n;delete user.reload_l10n;if(reload){Ext.Loader.loadScript({url:'/catalog',onLoad:function(){Ext.Loader.loadScript({url:'/extjs-l10n',onLoad:function(){me._doCreateUserDesktop(user);}});}});}else{me._doCreateUserDesktop(user);}},signin:function(button){if(__signin__){Ext.create('SoL.window.Signin',{}).show();}},lostPassword:function(button){if(__password_reset__){Ext.create('SoL.window.LostPassword',{}).show();}}});Ext.define('Ext.grid.View',{extend:'Ext.view.Table',alias:'widget.gridview',stripeRows:true,autoScroll:true});Ext.define('Ext.form.field.Date',{extend:'Ext.form.field.Picker',alias:'widget.datefield',requires:['Ext.picker.Date'],alternateClassName:['Ext.form.DateField','Ext.form.Date'],format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d|n-j|n/j",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerCls:Ext.baseCSSPrefix+'form-date-trigger',showToday:true,useStrict:undefined,initTime:'12',initTimeFormat:'H',matchFieldWidth:false,startDay:0,initComponent:function(){var me=this,isString=Ext.isString,min,max;min=me.minValue;max=me.maxValue;if(isString(min)){me.minValue=me.parseDate(min);}
if(isString(max)){me.maxValue=me.parseDate(max);}
me.disabledDatesRE=null;me.initDisabledDays();me.callParent();},initValue:function(){var me=this,value=me.value;if(Ext.isString(value)){me.value=me.rawToValue(value);}
me.callParent();},initDisabledDays:function(){if(this.disabledDates){var dd=this.disabledDates,len=dd.length-1,re="(?:",d,dLen=dd.length,date;for(d=0;d<dLen;d++){date=dd[d];re+=Ext.isDate(date)?'^'+Ext.String.escapeRegex(date.dateFormat(this.format))+'$':date;if(d!==len){re+='|';}}
this.disabledDatesRE=new RegExp(re+')');}},setDisabledDates:function(dd){var me=this,picker=me.picker;me.disabledDates=dd;me.initDisabledDays();if(picker){picker.setDisabledDates(me.disabledDatesRE);}},setDisabledDays:function(dd){var picker=this.picker;this.disabledDays=dd;if(picker){picker.setDisabledDays(dd);}},setMinValue:function(dt){var me=this,picker=me.picker,minValue=(Ext.isString(dt)?me.parseDate(dt):dt);me.minValue=minValue;if(picker){picker.minText=Ext.String.format(me.minText,me.formatDate(me.minValue));picker.setMinDate(minValue);}},setMaxValue:function(dt){var me=this,picker=me.picker,maxValue=(Ext.isString(dt)?me.parseDate(dt):dt);me.maxValue=maxValue;if(picker){picker.maxText=Ext.String.format(me.maxText,me.formatDate(me.maxValue));picker.setMaxDate(maxValue);}},getErrors:function(value){var me=this,format=Ext.String.format,clearTime=Ext.Date.clearTime,errors=me.callParent(arguments),disabledDays=me.disabledDays,disabledDatesRE=me.disabledDatesRE,minValue=me.minValue,maxValue=me.maxValue,len=disabledDays?disabledDays.length:0,i=0,svalue,fvalue,day,time;value=me.formatDate(value||me.processRawValue(me.getRawValue()));if(value===null||value.length<1){return errors;}
svalue=value;value=me.parseDate(value);if(!value){errors.push(format(me.invalidText,svalue,Ext.Date.unescapeFormat(me.format)));return errors;}
time=value.getTime();if(minValue&&time<clearTime(minValue).getTime()){errors.push(format(me.minText,me.formatDate(minValue)));}
if(maxValue&&time>clearTime(maxValue).getTime()){errors.push(format(me.maxText,me.formatDate(maxValue)));}
if(disabledDays){day=value.getDay();for(;i<len;i++){if(day===disabledDays[i]){errors.push(me.disabledDaysText);break;}}}
fvalue=me.formatDate(value);if(disabledDatesRE&&disabledDatesRE.test(fvalue)){errors.push(format(me.disabledDatesText,fvalue));}
return errors;},rawToValue:function(rawValue){return this.parseDate(rawValue)||rawValue||null;},valueToRaw:function(value){return this.formatDate(this.parseDate(value));},safeParse:function(value,format){var me=this,utilDate=Ext.Date,result=null,strict=me.useStrict,parsedDate;if(utilDate.formatContainsHourInfo(format)){result=utilDate.parse(value,format,strict);}else{parsedDate=utilDate.parse(value+' '+me.initTime,format+' '+me.initTimeFormat,strict);if(parsedDate){result=utilDate.clearTime(parsedDate);}}
return result;},getSubmitValue:function(){var format=this.submitFormat||this.format,value=this.getValue();return value?Ext.Date.format(value,format):'';},parseDate:function(value){if(!value||Ext.isDate(value)){return value;}
var me=this,val=me.safeParse(value,me.format),altFormats=me.altFormats,altFormatsArray=me.altFormatsArray,i=0,len;if(!val&&altFormats){altFormatsArray=altFormatsArray||altFormats.split('|');len=altFormatsArray.length;for(;i<len&&!val;++i){val=me.safeParse(value,altFormatsArray[i]);}}
return val;},formatDate:function(date){return Ext.isDate(date)?Ext.Date.dateFormat(date,this.format):date;},createPicker:function(){var me=this,format=Ext.String.format;return new Ext.picker.Date({pickerField:me,ownerCt:me.ownerCt,renderTo:document.body,floating:true,hidden:true,focusOnShow:true,minDate:me.minValue,maxDate:me.maxValue,disabledDatesRE:me.disabledDatesRE,disabledDatesText:me.disabledDatesText,disabledDays:me.disabledDays,disabledDaysText:me.disabledDaysText,format:me.format,showToday:me.showToday,startDay:me.startDay,minText:format(me.minText,me.formatDate(me.minValue)),maxText:format(me.maxText,me.formatDate(me.maxValue)),listeners:{scope:me,select:me.onSelect},keyNavConfig:{esc:function(){me.collapse();}}});},onDownArrow:function(e){this.callParent(arguments);if(this.isExpanded){this.getPicker().focus();}},onSelect:function(m,d){var me=this;me.setValue(d);me.fireEvent('select',me,d);me.collapse();},onExpand:function(){var value=this.getValue();this.picker.setValue(Ext.isDate(value)?value:new Date());},onCollapse:function(){this.focus(false,60);},beforeBlur:function(){var me=this,v=me.parseDate(me.getRawValue()),focusTask=me.focusTask;if(focusTask){focusTask.cancel();}
if(v){me.setValue(v);}}});Ext.define('Ext.layout.container.VBox',{alias:['layout.vbox'],extend:'Ext.layout.container.Box',alternateClassName:'Ext.layout.VBoxLayout',align:'left',constrainAlign:false,type:'vbox',direction:'vertical',horizontal:false,names:{beforeX:'top',beforeScrollX:'top',beforeScrollerSuffix:'-before-scroller',afterScrollerSuffix:'-after-scroller',leftCap:'Top',afterX:'bottom',width:'height',contentWidth:'contentHeight',minWidth:'minHeight',maxWidth:'maxHeight',widthCap:'Height',widthModel:'heightModel',widthIndex:1,x:'y',scrollLeft:'scrollTop',overflowX:'overflowY',hasOverflowX:'hasOverflowY',invalidateScrollX:'invalidateScrollY',parallelMargins:'tb',center:'center',beforeY:'left',afterY:'right',height:'width',contentHeight:'contentWidth',minHeight:'minWidth',maxHeight:'maxWidth',heightCap:'Width',heightModel:'widthModel',heightIndex:0,y:'x',overflowY:'overflowX',hasOverflowY:'hasOverflowX',invalidateScrollY:'invalidateScrollX',perpendicularMargins:'lr',getWidth:'getHeight',getHeight:'getWidth',setWidth:'setHeight',setHeight:'setWidth',gotWidth:'gotHeight',gotHeight:'gotWidth',setContentWidth:'setContentHeight',setContentHeight:'setContentWidth',setWidthInDom:'setHeightInDom',setHeightInDom:'setWidthInDom',getScrollLeft:'getScrollTop',setScrollLeft:'setScrollTop',scrollTo:'scrollTo'},sizePolicy:{flex:{'':{readsWidth:1,readsHeight:0,setsWidth:0,setsHeight:1},stretch:{readsWidth:0,readsHeight:0,setsWidth:1,setsHeight:1},stretchmax:{readsWidth:1,readsHeight:0,setsWidth:1,setsHeight:1}},'':{readsWidth:1,readsHeight:1,setsWidth:0,setsHeight:0},stretch:{readsWidth:0,readsHeight:1,setsWidth:1,setsHeight:0},stretchmax:{readsWidth:1,readsHeight:1,setsWidth:1,setsHeight:0}}});Ext.define('Ext.layout.container.HBox',{alias:['layout.hbox'],extend:'Ext.layout.container.Box',alternateClassName:'Ext.layout.HBoxLayout',align:'top',constrainAlign:false,type:'hbox',direction:'horizontal',horizontal:true,names:{beforeX:'left',beforeScrollX:'left',beforeScrollerSuffix:'-before-scroller',afterScrollerSuffix:'-after-scroller',leftCap:'Left',afterX:'right',width:'width',contentWidth:'contentWidth',minWidth:'minWidth',maxWidth:'maxWidth',widthCap:'Width',widthModel:'widthModel',widthIndex:0,x:'x',scrollLeft:'scrollLeft',overflowX:'overflowX',hasOverflowX:'hasOverflowX',invalidateScrollX:'invalidateScrollX',parallelMargins:'lr',center:'middle',beforeY:'top',afterY:'bottom',height:'height',contentHeight:'contentHeight',minHeight:'minHeight',maxHeight:'maxHeight',heightCap:'Height',heightModel:'heightModel',heightIndex:1,y:'y',overflowY:'overflowY',hasOverflowY:'hasOverflowY',invalidateScrollY:'invalidateScrollY',perpendicularMargins:'tb',getWidth:'getWidth',getHeight:'getHeight',setWidth:'setWidth',setHeight:'setHeight',gotWidth:'gotWidth',gotHeight:'gotHeight',setContentWidth:'setContentWidth',setContentHeight:'setContentHeight',setWidthInDom:'setWidthInDom',setHeightInDom:'setHeightInDom',getScrollLeft:'getScrollLeft',setScrollLeft:'setScrollLeft',scrollTo:'scrollTo'},sizePolicy:{flex:{'':{readsWidth:0,readsHeight:1,setsWidth:1,setsHeight:0},stretch:{readsWidth:0,readsHeight:0,setsWidth:1,setsHeight:1},stretchmax:{readsWidth:0,readsHeight:1,setsWidth:1,setsHeight:1}},'':{readsWidth:1,readsHeight:1,setsWidth:0,setsHeight:0},stretch:{readsWidth:1,readsHeight:0,setsWidth:0,setsHeight:1},stretchmax:{readsWidth:1,readsHeight:1,setsWidth:0,setsHeight:1}}});Ext.define('Ext.grid.plugin.HeaderReorderer',{extend:'Ext.AbstractPlugin',requires:['Ext.grid.header.DragZone','Ext.grid.header.DropZone'],alias:'plugin.gridheaderreorderer',init:function(headerCt){this.headerCt=headerCt;headerCt.on({render:this.onHeaderCtRender,single:true,scope:this});},destroy:function(){Ext.destroy(this.dragZone,this.dropZone);},onHeaderCtRender:function(){var me=this;me.dragZone=new Ext.grid.header.DragZone(me.headerCt);me.dropZone=new Ext.grid.header.DropZone(me.headerCt);if(me.disabled){me.dragZone.disable();}},enable:function(){this.disabled=false;if(this.dragZone){this.dragZone.enable();}},disable:function(){this.disabled=true;if(this.dragZone){this.dragZone.disable();}}});Ext.define('Ext.grid.ColumnLayout',{extend:'Ext.layout.container.HBox',alias:'layout.gridcolumn',type:'gridcolumn',reserveOffset:false,firstHeaderCls:Ext.baseCSSPrefix+'column-header-first',lastHeaderCls:Ext.baseCSSPrefix+'column-header-last',initLayout:function(){if(!this.scrollbarWidth){this.self.prototype.scrollbarWidth=Ext.getScrollbarSize().width;}
this.grid=this.owner.up('[scrollerOwner]');this.callParent();},beginLayout:function(ownerContext){var me=this,owner=me.owner,grid=me.grid,view=grid.view,items=me.getVisibleItems(),len=items.length,firstCls=me.firstHeaderCls,lastCls=me.lastHeaderCls,i,item;if(grid.lockable){if(owner.up('tablepanel')===view.normalGrid){view=view.normalGrid.getView();}else{view=null;}}
for(i=0;i<len;i++){item=items[i];item.isLast=false;item.removeCls([firstCls,lastCls]);if(i===0){item.addCls(firstCls);}
if(i===len-1){item.addCls(lastCls);item.isLast=true;}}
me.callParent(arguments);if(!owner.isColumn&&Ext.getScrollbarSize().width&&!grid.collapsed&&view&&view.rendered&&(ownerContext.viewTable=view.body.dom)){ownerContext.viewContext=ownerContext.context.getCmp(view);}},roundFlex:function(width){return Math.floor(width);},calculate:function(ownerContext){this.callParent(arguments);if(ownerContext.state.parallelDone&&(!this.owner.forceFit||ownerContext.flexedItems.length)){ownerContext.setProp('columnWidthsDone',true);}
if(ownerContext.viewContext){ownerContext.state.tableHeight=ownerContext.viewTable.offsetHeight;}},completeLayout:function(ownerContext){var me=this,owner=me.owner,state=ownerContext.state;me.callParent(arguments);if(!ownerContext.flexedItems.length&&!state.flexesCalculated&&owner.forceFit&&me.convertWidthsToFlexes(ownerContext)){me.cacheFlexes(ownerContext);ownerContext.invalidate({state:{flexesCalculated:true}});}else{ownerContext.setProp('columnWidthsDone',true);}},convertWidthsToFlexes:function(ownerContext){var me=this,totalWidth=0,calculated=me.sizeModels.calculated,childItems,len,i,childContext,item;childItems=ownerContext.childItems;len=childItems.length;for(i=0;i<len;i++){childContext=childItems[i];item=childContext.target;totalWidth+=childContext.props.width;if(!(item.fixed||item.resizable===false)){item.flex=ownerContext.childItems[i].flex=childContext.props.width;item.width=null;childContext.widthModel=calculated;}}
return totalWidth!==ownerContext.props.width;},getContainerSize:function(ownerContext){var me=this,result,viewContext=ownerContext.viewContext,viewHeight;if(me.owner.isColumn){result=me.getColumnContainerSize(ownerContext);}
else{result=me.callParent(arguments);if(viewContext&&!viewContext.heightModel.shrinkWrap&&viewContext.target.componentLayout.ownerContext){viewHeight=viewContext.getProp('height');if(isNaN(viewHeight)){me.done=false;}else if(ownerContext.state.tableHeight>viewHeight){result.width-=Ext.getScrollbarSize().width;ownerContext.state.parallelDone=false;viewContext.invalidate();}}}
return result;},getColumnContainerSize:function(ownerContext){var padding=ownerContext.paddingContext.getPaddingInfo(),got=0,needed=0,gotWidth,gotHeight,width,height;if(!ownerContext.widthModel.shrinkWrap){++needed;width=ownerContext.getProp('innerWidth');gotWidth=(typeof width=='number');if(gotWidth){++got;width-=padding.width;if(width<0){width=0;}}}
if(!ownerContext.heightModel.shrinkWrap){++needed;height=ownerContext.getProp('innerHeight');gotHeight=(typeof height=='number');if(gotHeight){++got;height-=padding.height;if(height<0){height=0;}}}
return{width:width,height:height,needed:needed,got:got,gotAll:got==needed,gotWidth:gotWidth,gotHeight:gotHeight};},publishInnerCtSize:function(ownerContext){var me=this,size=ownerContext.state.boxPlan.targetSize,cw=ownerContext.peek('contentWidth'),view;me.owner.tooNarrow=ownerContext.state.boxPlan.tooNarrow;if((cw!=null)&&!me.owner.isColumn){size.width=cw;view=me.owner.ownerCt.view;if(view.scrollFlags.y){size.width+=Ext.getScrollbarSize().width;}}
return me.callParent(arguments);}});Ext.define('Ext.grid.plugin.BufferedRendererTreeView',{override:'Ext.tree.View',onRemove:function(store,records,indices){var me=this;if(me.rendered&&me.bufferedRenderer){me.refreshView();}
else{me.callParent([store,records,indices]);}}});Ext.define('Ext.toolbar.Toolbar',{extend:'Ext.container.Container',requires:['Ext.toolbar.Fill','Ext.layout.container.HBox','Ext.layout.container.VBox'],uses:['Ext.toolbar.Separator'],alias:'widget.toolbar',alternateClassName:'Ext.Toolbar',isToolbar:true,baseCls:Ext.baseCSSPrefix+'toolbar',ariaRole:'toolbar',defaultType:'button',vertical:false,enableOverflow:false,menuTriggerCls:Ext.baseCSSPrefix+'toolbar-more-icon',trackMenus:true,itemCls:Ext.baseCSSPrefix+'toolbar-item',statics:{shortcuts:{'-':'tbseparator',' ':'tbspacer'},shortcutsHV:{0:{'->':{xtype:'tbfill',height:0}},1:{'->':{xtype:'tbfill',width:0}}}},initComponent:function(){var me=this;if(!me.layout&&me.enableOverflow){me.layout={overflowHandler:'Menu'};}
if(me.dock==='right'||me.dock==='left'){me.vertical=true;}
me.layout=Ext.applyIf(Ext.isString(me.layout)?{type:me.layout}:me.layout||{},{type:me.vertical?'vbox':'hbox',align:me.vertical?'stretchmax':'middle'});if(me.vertical){me.addClsWithUI('vertical');}
if(me.ui==='footer'){me.ignoreBorderManagement=true;}
me.callParent();me.addEvents('overflowchange');},getRefItems:function(deep){var me=this,items=me.callParent(arguments),layout=me.layout,handler;if(deep&&me.enableOverflow){handler=layout.overflowHandler;if(handler&&handler.menu){items=items.concat(handler.menu.getRefItems(deep));}}
return items;},lookupComponent:function(c){var args=arguments;if(typeof c=='string'){var T=Ext.toolbar.Toolbar,shortcut=T.shortcutsHV[this.vertical?1:0][c]||T.shortcuts[c];if(typeof shortcut=='string'){c={xtype:shortcut};}else if(shortcut){c=Ext.apply({},shortcut);}else{c={xtype:'tbtext',text:c};}
this.applyDefaults(c);args=[c];}
return this.callParent(args);},applyDefaults:function(c){if(!Ext.isString(c)){c=this.callParent(arguments);}
return c;},trackMenu:function(item,remove){if(this.trackMenus&&item.menu){var method=remove?'mun':'mon',me=this;me[method](item,'mouseover',me.onButtonOver,me);me[method](item,'menushow',me.onButtonMenuShow,me);me[method](item,'menuhide',me.onButtonMenuHide,me);}},onBeforeAdd:function(component){var me=this,isButton=component.isButton;if(isButton&&me.defaultButtonUI&&component.ui==='default'&&!component.hasOwnProperty('ui')){component.ui=me.defaultButtonUI;}else if((isButton||component.isFormField)&&me.ui!=='footer'){component.ui=component.ui+'-toolbar';component.addCls(component.baseCls+'-toolbar');}
if(component instanceof Ext.toolbar.Separator){component.setUI((me.vertical)?'vertical':'horizontal');}
me.callParent(arguments);},onAdd:function(component){this.callParent(arguments);this.trackMenu(component);},onRemove:function(c){this.callParent(arguments);this.trackMenu(c,true);},getChildItemsToDisable:function(){return this.items.getRange();},onButtonOver:function(btn){if(this.activeMenuBtn&&this.activeMenuBtn!=btn){this.activeMenuBtn.hideMenu();btn.showMenu();this.activeMenuBtn=btn;}},onButtonMenuShow:function(btn){this.activeMenuBtn=btn;},onButtonMenuHide:function(btn){delete this.activeMenuBtn;}});Ext.define('Ext.panel.AbstractPanel',{extend:'Ext.container.Container',mixins:{docking:'Ext.container.DockingContainer'},requires:['Ext.util.MixedCollection','Ext.Element','Ext.toolbar.Toolbar'],baseCls:Ext.baseCSSPrefix+'panel',isPanel:true,contentPaddingProperty:'bodyPadding',shrinkWrapDock:false,componentLayout:'dock',childEls:['body'],renderTpl:['{% this.renderDockedItems(out,values,0); %}',(Ext.isIE7m||Ext.isIEQuirks)?'<div style="position:relative"></div>':'','<div id="{id}-body" class="{baseCls}-body<tpl if="bodyCls"> {bodyCls}</tpl>',' {baseCls}-body-{ui}<tpl if="uiCls">','<tpl for="uiCls"> {parent.baseCls}-body-{parent.ui}-{.}</tpl>','</tpl>{childElCls}"','<tpl if="bodyStyle"> style="{bodyStyle}"</tpl>>','{%this.renderContainer(out,values);%}','</div>','{% this.renderDockedItems(out,values,1); %}'],bodyPosProps:{x:'x',y:'y'},border:true,emptyArray:[],initComponent:function(){this.initBorderProps();this.callParent();},initBorderProps:function(){var me=this;if(me.frame&&me.border&&me.bodyBorder===undefined){me.bodyBorder=false;}
if(me.frame&&me.border&&(me.bodyBorder===false||me.bodyBorder===0)){me.manageBodyBorders=true;}},beforeDestroy:function(){this.destroyDockedItems();this.callParent();},initItems:function(){this.callParent();this.initDockingItems();},initRenderData:function(){var me=this,data=me.callParent();me.initBodyStyles();me.protoBody.writeTo(data);delete me.protoBody;return data;},getComponent:function(comp){var component=this.callParent(arguments);if(component===undefined&&!Ext.isNumber(comp)){component=this.getDockedComponent(comp);}
return component;},getProtoBody:function(){var me=this,body=me.protoBody;if(!body){me.protoBody=body=new Ext.util.ProtoElement({cls:me.bodyCls,style:me.bodyStyle,clsProp:'bodyCls',styleProp:'bodyStyle',styleIsText:true});}
return body;},initBodyStyles:function(){var me=this,body=me.getProtoBody();if(me.bodyPadding!==undefined){if(me.layout.managePadding){body.setStyle('padding',0);}else{body.setStyle('padding',this.unitizeBox((me.bodyPadding===true)?5:me.bodyPadding));}}
me.initBodyBorder();},initBodyBorder:function(){var me=this;if(me.frame&&me.bodyBorder){if(!Ext.isNumber(me.bodyBorder)){me.bodyBorder=1;}
me.getProtoBody().setStyle('border-width',this.unitizeBox(me.bodyBorder));}},getCollapsedDockedItems:function(){var me=this;return me.header===false||me.collapseMode=='placeholder'?me.emptyArray:[me.getReExpander()];},setBodyStyle:function(style,value){var me=this,body=me.rendered?me.body:me.getProtoBody();if(Ext.isFunction(style)){style=style();}
if(arguments.length==1){if(Ext.isString(style)){style=Ext.Element.parseStyles(style);}
body.setStyle(style);}else{body.setStyle(style,value);}
return me;},addBodyCls:function(cls){var me=this,body=me.rendered?me.body:me.getProtoBody();body.addCls(cls);return me;},removeBodyCls:function(cls){var me=this,body=me.rendered?me.body:me.getProtoBody();body.removeCls(cls);return me;},addUIClsToElement:function(cls){var me=this,result=me.callParent(arguments);me.addBodyCls([Ext.baseCSSPrefix+cls,me.baseCls+'-body-'+cls,me.baseCls+'-body-'+me.ui+'-'+cls]);return result;},removeUIClsFromElement:function(cls){var me=this,result=me.callParent(arguments);me.removeBodyCls([Ext.baseCSSPrefix+cls,me.baseCls+'-body-'+cls,me.baseCls+'-body-'+me.ui+'-'+cls]);return result;},addUIToElement:function(){var me=this;me.callParent(arguments);me.addBodyCls(me.baseCls+'-body-'+me.ui);},removeUIFromElement:function(){var me=this;me.callParent(arguments);me.removeBodyCls(me.baseCls+'-body-'+me.ui);},getTargetEl:function(){return this.body;},applyTargetCls:function(targetCls){this.getProtoBody().addCls(targetCls);},getRefItems:function(deep){var items=this.callParent(arguments);return this.getDockingRefItems(deep,items);},setupRenderTpl:function(renderTpl){this.callParent(arguments);this.setupDockingRenderTpl(renderTpl);}});Ext.define('Ext.toolbar.Paging',{extend:'Ext.toolbar.Toolbar',alias:'widget.pagingtoolbar',alternateClassName:'Ext.PagingToolbar',requires:['Ext.toolbar.TextItem','Ext.form.field.Number'],mixins:{bindable:'Ext.util.Bindable'},displayInfo:false,prependButtons:false,displayMsg:'Displaying {0} - {1} of {2}',emptyMsg:'No data to display',beforePageText:'Page',afterPageText:'of {0}',firstText:'First Page',prevText:'Previous Page',nextText:'Next Page',lastText:'Last Page',refreshText:'Refresh',inputItemWidth:30,getPagingItems:function(){var me=this;return[{itemId:'first',tooltip:me.firstText,overflowText:me.firstText,iconCls:Ext.baseCSSPrefix+'tbar-page-first',disabled:true,handler:me.moveFirst,scope:me},{itemId:'prev',tooltip:me.prevText,overflowText:me.prevText,iconCls:Ext.baseCSSPrefix+'tbar-page-prev',disabled:true,handler:me.movePrevious,scope:me},'-',me.beforePageText,{xtype:'numberfield',itemId:'inputItem',name:'inputItem',cls:Ext.baseCSSPrefix+'tbar-page-number',allowDecimals:false,minValue:1,hideTrigger:true,enableKeyEvents:true,keyNavEnabled:false,selectOnFocus:true,submitValue:false,isFormField:false,width:me.inputItemWidth,margins:'-1 2 3 2',listeners:{scope:me,keydown:me.onPagingKeyDown,blur:me.onPagingBlur}},{xtype:'tbtext',itemId:'afterTextItem',text:Ext.String.format(me.afterPageText,1)},'-',{itemId:'next',tooltip:me.nextText,overflowText:me.nextText,iconCls:Ext.baseCSSPrefix+'tbar-page-next',disabled:true,handler:me.moveNext,scope:me},{itemId:'last',tooltip:me.lastText,overflowText:me.lastText,iconCls:Ext.baseCSSPrefix+'tbar-page-last',disabled:true,handler:me.moveLast,scope:me},'-',{itemId:'refresh',tooltip:me.refreshText,overflowText:me.refreshText,iconCls:Ext.baseCSSPrefix+'tbar-loading',handler:me.doRefresh,scope:me}];},initComponent:function(){var me=this,pagingItems=me.getPagingItems(),userItems=me.items||me.buttons||[];if(me.prependButtons){me.items=userItems.concat(pagingItems);}else{me.items=pagingItems.concat(userItems);}
delete me.buttons;if(me.displayInfo){me.items.push('->');me.items.push({xtype:'tbtext',itemId:'displayItem'});}
me.callParent();me.addEvents('change','beforechange');me.on('beforerender',me.onLoad,me,{single:true});me.bindStore(me.store||'ext-empty-store',true);},updateInfo:function(){var me=this,displayItem=me.child('#displayItem'),store=me.store,pageData=me.getPageData(),count,msg;if(displayItem){count=store.getCount();if(count===0){msg=me.emptyMsg;}else{msg=Ext.String.format(me.displayMsg,pageData.fromRecord,pageData.toRecord,pageData.total);}
displayItem.setText(msg);}},onLoad:function(){var me=this,pageData,currPage,pageCount,afterText,count,isEmpty,item;count=me.store.getCount();isEmpty=count===0;if(!isEmpty){pageData=me.getPageData();currPage=pageData.currentPage;pageCount=pageData.pageCount;afterText=Ext.String.format(me.afterPageText,isNaN(pageCount)?1:pageCount);}else{currPage=0;pageCount=0;afterText=Ext.String.format(me.afterPageText,0);}
Ext.suspendLayouts();item=me.child('#afterTextItem');if(item){item.setText(afterText);}
item=me.getInputItem();if(item){item.setDisabled(isEmpty).setValue(currPage);}
me.setChildDisabled('#first',currPage===1||isEmpty);me.setChildDisabled('#prev',currPage===1||isEmpty);me.setChildDisabled('#next',currPage===pageCount||isEmpty);me.setChildDisabled('#last',currPage===pageCount||isEmpty);me.setChildDisabled('#refresh',false);me.updateInfo();Ext.resumeLayouts(true);if(me.rendered){me.fireEvent('change',me,pageData);}},setChildDisabled:function(selector,disabled){var item=this.child(selector);if(item){item.setDisabled(disabled);}},getPageData:function(){var store=this.store,totalCount=store.getTotalCount();return{total:totalCount,currentPage:store.currentPage,pageCount:Math.ceil(totalCount/store.pageSize),fromRecord:((store.currentPage-1)*store.pageSize)+1,toRecord:Math.min(store.currentPage*store.pageSize,totalCount)};},onLoadError:function(){if(!this.rendered){return;}
this.setChildDisabled('#refresh',false);},getInputItem:function(){return this.child('#inputItem');},readPageFromInput:function(pageData){var inputItem=this.getInputItem(),pageNum=false,v;if(inputItem){v=inputItem.getValue();pageNum=parseInt(v,10);if(!v||isNaN(pageNum)){inputItem.setValue(pageData.currentPage);return false;}}
return pageNum;},onPagingFocus:function(){var inputItem=this.getInputItem();if(inputItem){inputItem.select();}},onPagingBlur:function(e){var inputItem=this.getInputItem(),curPage;if(inputItem){curPage=this.getPageData().currentPage;inputItem.setValue(curPage);}},onPagingKeyDown:function(field,e){var me=this,k=e.getKey(),pageData=me.getPageData(),increment=e.shiftKey?10:1,pageNum;if(k==e.RETURN){e.stopEvent();pageNum=me.readPageFromInput(pageData);if(pageNum!==false){pageNum=Math.min(Math.max(1,pageNum),pageData.pageCount);if(me.fireEvent('beforechange',me,pageNum)!==false){me.store.loadPage(pageNum);}}}else if(k==e.HOME||k==e.END){e.stopEvent();pageNum=k==e.HOME?1:pageData.pageCount;field.setValue(pageNum);}else if(k==e.UP||k==e.PAGE_UP||k==e.DOWN||k==e.PAGE_DOWN){e.stopEvent();pageNum=me.readPageFromInput(pageData);if(pageNum){if(k==e.DOWN||k==e.PAGE_DOWN){increment*=-1;}
pageNum+=increment;if(pageNum>=1&&pageNum<=pageData.pageCount){field.setValue(pageNum);}}}},beforeLoad:function(){if(this.rendered){this.setChildDisabled('#refresh',true);}},moveFirst:function(){if(this.fireEvent('beforechange',this,1)!==false){this.store.loadPage(1);}},movePrevious:function(){var me=this,prev=me.store.currentPage-1;if(prev>0){if(me.fireEvent('beforechange',me,prev)!==false){me.store.previousPage();}}},moveNext:function(){var me=this,total=me.getPageData().pageCount,next=me.store.currentPage+1;if(next<=total){if(me.fireEvent('beforechange',me,next)!==false){me.store.nextPage();}}},moveLast:function(){var me=this,last=me.getPageData().pageCount;if(me.fireEvent('beforechange',me,last)!==false){me.store.loadPage(last);}},doRefresh:function(){var me=this,current=me.store.currentPage;if(me.fireEvent('beforechange',me,current)!==false){me.store.loadPage(current);}},getStoreListeners:function(){return{beforeload:this.beforeLoad,load:this.onLoad,exception:this.onLoadError};},unbind:function(store){this.bindStore(null);},bind:function(store){this.bindStore(store);},onDestroy:function(){this.unbind();this.callParent();}});Ext.define('Ext.grid.header.Container',{extend:'Ext.container.Container',requires:['Ext.grid.ColumnLayout','Ext.grid.plugin.HeaderResizer','Ext.grid.plugin.HeaderReorderer'],uses:['Ext.grid.column.Column','Ext.grid.ColumnManager','Ext.menu.Menu','Ext.menu.CheckItem','Ext.menu.Separator'],border:true,alias:'widget.headercontainer',baseCls:Ext.baseCSSPrefix+'grid-header-ct',dock:'top',weight:100,defaultType:'gridcolumn',detachOnRemove:false,defaultWidth:100,sortAscText:'Sort Ascending',sortDescText:'Sort Descending',sortClearText:'Clear Sort',columnsText:'Columns',headerOpenCls:Ext.baseCSSPrefix+'column-header-open',menuSortAscCls:Ext.baseCSSPrefix+'hmenu-sort-asc',menuSortDescCls:Ext.baseCSSPrefix+'hmenu-sort-desc',menuColsIcon:Ext.baseCSSPrefix+'cols-icon',triStateSort:false,ddLock:false,dragging:false,sortable:true,enableColumnHide:true,initComponent:function(){var me=this;me.headerCounter=0;me.plugins=me.plugins||[];if(!me.isColumn){if(me.enableColumnResize){me.resizer=new Ext.grid.plugin.HeaderResizer();me.plugins.push(me.resizer);}
if(me.enableColumnMove){me.reorderer=new Ext.grid.plugin.HeaderReorderer();me.plugins.push(me.reorderer);}}
if(me.isColumn&&(!me.items||me.items.length===0)){me.isContainer=false;me.layout={type:'container',calculate:Ext.emptyFn};}
else{me.layout=Ext.apply({type:'gridcolumn',align:'stretch'},me.initialConfig.layout);if(me.isRootHeader){me.grid.columnManager=me.columnManager=new Ext.grid.ColumnManager(me);}}
me.defaults=me.defaults||{};Ext.applyIf(me.defaults,{triStateSort:me.triStateSort,sortable:me.sortable});me.menuTask=new Ext.util.DelayedTask(me.updateMenuDisabledState,me);me.callParent();me.addEvents('columnresize','headerclick','headercontextmenu','headertriggerclick','columnmove','columnhide','columnshow','columnschanged','sortchange','menucreate');},isLayoutRoot:function(){if(this.hiddenHeaders){return false;}
return this.callParent();},getOwnerHeaderCt:function(){var me=this;return me.isRootHeader?me:me.up('[isRootHeader]');},onDestroy:function(){var me=this;if(me.menu){me.menu.un('hide',me.onMenuHide,me);}
me.menuTask.cancel();Ext.destroy(me.resizer,me.reorderer);me.callParent();},applyColumnsState:function(columns){if(!columns||!columns.length){return;}
var me=this,items=me.items.items,count=items.length,i=0,length=columns.length,c,col,columnState,index;for(c=0;c<length;c++){columnState=columns[c];for(index=count;index--;){col=items[index];if(col.getStateId&&col.getStateId()==columnState.id){if(i!==index){me.moveHeader(index,i);}
if(col.applyColumnState){col.applyColumnState(columnState);}
++i;break;}}}},getColumnsState:function(){var me=this,columns=[],state;me.items.each(function(col){state=col.getColumnState&&col.getColumnState();if(state){columns.push(state);}});return columns;},onAdd:function(c){var me=this;if(!c.headerId){c.headerId=c.initialConfig.id||Ext.id(null,'header-');}
if(!c.getStateId()){c.stateId=c.initialConfig.id||('h'+(++me.headerCounter));}
if(Ext.global.console&&Ext.global.console.warn){if(!me._usedIDs){me._usedIDs={};}
if(me._usedIDs[c.headerId]){Ext.global.console.warn(this.$className,'attempted to reuse an existing id',c.headerId);}
me._usedIDs[c.headerId]=true;}
me.callParent(arguments);me.onColumnsChanged();},onMove:function(){this.callParent(arguments);this.onColumnsChanged();},onShow:function(){this.callParent(arguments);this.onColumnsChanged();},onColumnsChanged:function(){var headerCt=this;while(headerCt){headerCt.purgeCache();if(headerCt.isRootHeader){break;}
headerCt=headerCt.ownerCt;}
if(headerCt&&headerCt.rendered){headerCt.fireEvent('columnschanged',headerCt);}},onRemove:function(c){var me=this,ownerCt=me.ownerCt;me.callParent(arguments);if(!me._usedIDs){me._usedIDs={};}
delete me._usedIDs[c.headerId];if(!me.destroying){me.onColumnsChanged();if(me.isGroupHeader&&!me.items.getCount()&&ownerCt){me.detachComponent(c);Ext.suspendLayouts();ownerCt.remove(me);Ext.resumeLayouts(true);}}},applyDefaults:function(config){var ret;if(config&&!config.isComponent&&config.xtype=='rownumberer'){ret=config;}else{ret=this.callParent(arguments);if(!config.isGroupHeader&&!('width'in ret)&&!ret.flex){ret.width=this.defaultWidth;}}
return ret;},setSortState:function(){var store=this.up('[store]').store,first=store.getFirstSorter(),hd;if(first){hd=this.down('gridcolumn[dataIndex='+first.property+']');if(hd){hd.setSortState(first.direction,false,true);}}else{this.clearOtherSortStates(null);}},getHeaderMenu:function(){var menu=this.getMenu(),item;if(menu){item=menu.child('#columnItem');if(item){return item.menu;}}
return null;},onHeaderVisibilityChange:function(header,visible){var me=this,menu=me.getHeaderMenu(),item;me.purgeCache();if(menu){item=me.getMenuItemForHeader(menu,header);if(item){item.setChecked(visible,true);}
if(menu.isVisible()){me.menuTask.delay(50);}}},updateMenuDisabledState:function(menu){var me=this,columns=me.query(':not([hidden])'),i,len=columns.length,item,checkItem,method;if(!menu){menu=me.getMenu();}
for(i=0;i<len;++i){item=columns[i];checkItem=me.getMenuItemForHeader(menu,item);if(checkItem){method=item.isHideable()?'enable':'disable';if(checkItem.menu){method+='CheckChange';}
checkItem[method]();}}},getMenuItemForHeader:function(menu,header){return header?menu.down('menucheckitem[headerId='+header.id+']'):null;},onHeaderShow:function(header){var me=this,gridSection=me.ownerCt;if(me.forceFit){delete me.flex;}
me.onHeaderVisibilityChange(header,true);if(!header.isGroupHeader){if(gridSection){gridSection.onHeaderShow(me,header);}}
me.fireEvent('columnshow',me,header);me.fireEvent('columnschanged',this);},onHeaderHide:function(header){var me=this,gridSection=me.ownerCt;me.onHeaderVisibilityChange(header,false);if(!header.isGroupHeader){if(gridSection){gridSection.onHeaderHide(me,header);}}
me.fireEvent('columnhide',me,header);me.fireEvent('columnschanged',this);},tempLock:function(){this.ddLock=true;Ext.Function.defer(function(){this.ddLock=false;},200,this);},onHeaderResize:function(header,w,suppressFocus){var me=this,view=me.view,gridSection=me.ownerCt;if(view&&view.body.dom){me.tempLock();if(gridSection){gridSection.onHeaderResize(me,header,w);}}
me.fireEvent('columnresize',this,header,w);},onHeaderClick:function(header,e,t){header.fireEvent('headerclick',this,header,e,t);this.fireEvent('headerclick',this,header,e,t);},onHeaderContextMenu:function(header,e,t){header.fireEvent('headercontextmenu',this,header,e,t);this.fireEvent('headercontextmenu',this,header,e,t);},onHeaderTriggerClick:function(header,e,t){var me=this;if(header.fireEvent('headertriggerclick',me,header,e,t)!==false&&me.fireEvent('headertriggerclick',me,header,e,t)!==false){me.showMenuBy(t,header);}},showMenuBy:function(t,header){var menu=this.getMenu(),ascItem=menu.down('#ascItem'),descItem=menu.down('#descItem'),sortableMth;menu.activeHeader=menu.ownerButton=header;header.setMenuActive(true);sortableMth=header.sortable?'enable':'disable';if(ascItem){ascItem[sortableMth]();}
if(descItem){descItem[sortableMth]();}
menu.showBy(t);},onMenuHide:function(menu){menu.activeHeader.setMenuActive(false);},moveHeader:function(fromIdx,toIdx){this.tempLock();this.onHeaderMoved(this.move(fromIdx,toIdx),1,fromIdx,toIdx);},purgeCache:function(){var me=this,menu=me.menu;me.gridDataColumns=me.hideableColumns=null;if(me.columnManager){me.columnManager.invalidate();}
if(menu&&menu.hidden){menu.hide();menu.destroy();me.menu=null;}},onHeaderMoved:function(header,colsToMove,fromIdx,toIdx){var me=this,gridSection=me.ownerCt;if(gridSection&&gridSection.onHeaderMove){gridSection.onHeaderMove(me,header,colsToMove,fromIdx,toIdx);}
me.fireEvent("columnmove",me,header,fromIdx,toIdx);},getMenu:function(){var me=this;if(!me.menu){me.menu=new Ext.menu.Menu({hideOnParentHide:false,items:me.getMenuItems(),listeners:{hide:me.onMenuHide,scope:me}});me.fireEvent('menucreate',me,me.menu);}
me.updateMenuDisabledState(me.menu);return me.menu;},getMenuItems:function(){var me=this,menuItems=[],hideableColumns=me.enableColumnHide?me.getColumnMenu(me):null;if(me.sortable){menuItems=[{itemId:'ascItem',text:me.sortAscText,cls:me.menuSortAscCls,handler:me.onSortAscClick,scope:me},{itemId:'descItem',text:me.sortDescText,cls:me.menuSortDescCls,handler:me.onSortDescClick,scope:me}];}
if(hideableColumns&&hideableColumns.length){if(me.sortable){menuItems.push('-');}
menuItems.push({itemId:'columnItem',text:me.columnsText,cls:me.menuColsIcon,menu:hideableColumns,hideOnClick:false});}
return menuItems;},onSortAscClick:function(){var menu=this.getMenu(),activeHeader=menu.activeHeader;activeHeader.setSortState('ASC');},onSortDescClick:function(){var menu=this.getMenu(),activeHeader=menu.activeHeader;activeHeader.setSortState('DESC');},getColumnMenu:function(headerContainer){var menuItems=[],i=0,item,items=headerContainer.query('>gridcolumn[hideable]'),itemsLn=items.length,menuItem;for(;i<itemsLn;i++){item=items[i];menuItem=new Ext.menu.CheckItem({text:item.menuText||item.text,checked:!item.hidden,hideOnClick:false,headerId:item.id,menu:item.isGroupHeader?this.getColumnMenu(item):undefined,checkHandler:this.onColumnCheckChange,scope:this});menuItems.push(menuItem);item.on({destroy:Ext.Function.bind(menuItem.destroy,menuItem)});}
return menuItems;},onColumnCheckChange:function(checkItem,checked){var header=Ext.getCmp(checkItem.headerId);header[checked?'show':'hide']();},getColumnCount:function(){return this.getGridColumns().length;},getFullWidth:function(){var fullWidth=0,headers=this.getVisibleGridColumns(),headersLn=headers.length,i=0,header;for(;i<headersLn;i++){header=headers[i];if(header.getDesiredWidth){fullWidth+=header.getDesiredWidth()||0;}else{fullWidth+=header.getWidth();}}
return fullWidth;},clearOtherSortStates:function(activeHeader){var headers=this.getGridColumns(),headersLn=headers.length,i=0;for(;i<headersLn;i++){if(headers[i]!==activeHeader){headers[i].setSortState(null,true);}}},getVisibleGridColumns:function(){var allColumns=this.getGridColumns(),result=[],len=allColumns.length,i;for(i=0;i<len;i++){if(!allColumns[i].hidden){result[result.length]=allColumns[i];}}
return result;},getGridColumns:function(inResult,hiddenAncestor){if(!inResult&&this.gridDataColumns){return this.gridDataColumns;}
var me=this,result=inResult||[],items,i,len,item,lastVisibleColumn;hiddenAncestor=hiddenAncestor||me.hidden;if(me.items){items=me.items.items;for(i=0,len=items.length;i<len;i++){item=items[i];if(item.isGroupHeader){item.getGridColumns(result,hiddenAncestor);}else{item.hiddenAncestor=hiddenAncestor;result.push(item);}}}
if(!inResult){me.gridDataColumns=result;}
if(!inResult&&len){for(i=0,len=result.length;i<len;i++){item=result[i];item.isFirstVisible=item.isLastVisible=false;if(!(item.hidden||item.hiddenAncestor)){if(!lastVisibleColumn){item.isFirstVisible=true;}
lastVisibleColumn=item;}}
if(lastVisibleColumn){lastVisibleColumn.isLastVisible=true;}}
return result;},getHideableColumns:function(){var me=this,result=me.hideableColumns;if(!result){result=me.hideableColumns=me.query('[hideable]');}
return result;},getHeaderIndex:function(header){return this.columnManager.getHeaderIndex(header);},getHeaderAtIndex:function(index){return this.columnManager.getHeaderAtIndex(index);},getVisibleHeaderClosestToIndex:function(index){return this.columnManager.getVisibleHeaderClosestToIndex(index);},autoSizeColumn:function(header){var view=this.view;if(view){view.autoSizeColumn(header);}}});Ext.define('Ext.grid.plugin.BufferedRenderer',{extend:'Ext.AbstractPlugin',requires:['Ext.grid.plugin.BufferedRendererTableView','Ext.grid.plugin.BufferedRendererTreeView'],alias:'plugin.bufferedrenderer',lockableScope:'both',percentageFromEdge:0.35,variableRowHeight:false,numFromEdge:8,trailingBufferZone:10,leadingBufferZone:20,synchronousRender:true,scrollToLoadBuffer:200,viewSize:0,rowHeight:21,position:0,lastScrollDirection:1,bodyTop:0,init:function(grid){var me=this,view=grid.view,viewListeners={scroll:{fn:me.onViewScroll,element:'el',scope:me},boxready:me.onViewResize,resize:me.onViewResize,refresh:me.onViewRefresh,scope:me,destroyable:true};if(!me.variableRowHeight&&grid.ownerLockable){grid.ownerLockable.syncRowHeight=false;}
if(grid.isTree||grid.ownerLockable&&grid.ownerLockable.isTree){view.blockRefresh=false;view.loadMask=true;}
if(view.positionBody){viewListeners.refresh=me.onViewRefresh;}
me.grid=grid;me.view=view;view.bufferedRenderer=me;view.preserveScrollOnRefresh=true;me.bindStore(view.dataSource);view.getViewRange=function(){return me.getViewRange();};me.position=0;me.gridListeners=grid.on('reconfigure',me.onReconfigure,me);me.viewListeners=view.on(viewListeners);},bindStore:function(store){var me=this;if(me.store){me.unbindStore();}
me.storeListeners=store.on({scope:me,clear:me.onStoreClear,destroyable:true});me.store=store;if(me.view.componentLayout.layoutCount){me.onViewResize(me.view,0,me.view.getHeight());}},onReconfigure:function(grid,store){if(store&&store!==this.store){this.bindStore(store);}},unbindStore:function(){this.storeListeners.destroy();this.store=null;},onStoreClear:function(){var me=this;if(me.view.rendered&&!me.store.isDestroyed){if(me.scrollTop!==0){me.ignoreNextScrollEvent=true;me.view.el.dom.scrollTop=me.bodyTop=me.scrollTop=0;}
me.position=me.scrollHeight=0;me.lastScrollDirection=me.scrollOffset=null;delete me.rowHeight;}},onViewRefresh:function(){var me=this,view=me.view,oldScrollHeight=me.scrollHeight,scrollHeight;if(view.all.getCount()){delete me.rowHeight;}
scrollHeight=me.getScrollHeight();if(!oldScrollHeight||scrollHeight!=oldScrollHeight){me.stretchView(view,scrollHeight);}
if(me.scrollTop!==view.el.dom.scrollTop){me.onViewScroll();}else{me.setBodyTop(me.bodyTop);if(view.all.getCount()){me.viewSize=0;me.onViewResize(view,null,view.getHeight());}}},onViewResize:function(view,width,height,oldWidth,oldHeight){if(!oldHeight||height!==oldHeight){var me=this,newViewSize;newViewSize=Math.ceil(height/me.rowHeight)+me.trailingBufferZone+me.leadingBufferZone;me.viewSize=me.setViewSize(newViewSize);}},stretchView:function(view,scrollRange){var me=this,recordCount=(me.store.buffered?me.store.getTotalCount():me.store.getCount());if(me.stretcher){me.stretcher.dom.style.marginTop=(scrollRange-1)+'px';}else{var el=view.el;if(view.refreshCounter){view.fixedNodes++;}
if(recordCount&&(me.view.all.endIndex===recordCount-1)){scrollRange=me.bodyTop+view.body.dom.offsetHeight;}
this.stretcher=el.createChild({style:{width:'1px',height:'1px','marginTop':(scrollRange-1)+'px',left:0,position:'absolute'}},el.dom.firstChild);}},setViewSize:function(viewSize){if(viewSize!==this.viewSize){this.scrollTop=this.view.el.dom.scrollTop;var me=this,store=me.store,elCount=me.view.all.getCount(),start,end,lockingPartner=me.lockingPartner;me.viewSize=store.viewSize=viewSize;if(elCount){start=me.view.all.startIndex;end=Math.min(start+viewSize-1,(store.buffered?store.getTotalCount():store.getCount())-1);if(lockingPartner){lockingPartner.disable();}
me.renderRange(start,end);if(lockingPartner){lockingPartner.enable();}}}
return viewSize;},getViewRange:function(){var me=this,rows=me.view.all,store=me.store;if(store.data.getCount()){return store.getRange(rows.startIndex,rows.startIndex+(me.viewSize||me.store.defaultViewSize)-1);}else{return[];}},scrollTo:function(recordIdx,doSelect,callback,scope){var me=this,view=me.view,viewDom=view.el.dom,store=me.store,total=store.buffered?store.getTotalCount():store.getCount(),startIdx,endIdx,targetRec,targetRow,tableTop;recordIdx=Math.min(Math.max(recordIdx,0),total-1);startIdx=Math.max(Math.min(recordIdx-((me.leadingBufferZone+me.trailingBufferZone)/2),total-me.viewSize+1),0);tableTop=startIdx*me.rowHeight;endIdx=Math.min(startIdx+me.viewSize-1,total-1);store.getRange(startIdx,endIdx,{callback:function(range,start,end){me.renderRange(start,end,true);targetRec=store.data.getRange(recordIdx,recordIdx)[0];targetRow=view.getNode(targetRec,false);view.body.dom.style.top=tableTop+'px';me.position=me.scrollTop=viewDom.scrollTop=tableTop=Math.min(Math.max(0,tableTop-view.body.getOffsetsTo(targetRow)[1]),viewDom.scrollHeight-viewDom.clientHeight);if(Ext.isIE){viewDom.scrollTop=tableTop;}
if(doSelect){view.selModel.select(targetRec);}
if(callback){callback.call(scope||me,recordIdx,targetRec);}}});},onViewScroll:function(e,t){var me=this,store=me.store,totalCount=(store.buffered?store.getTotalCount():store.getCount()),vscrollDistance,scrollDirection,scrollTop=me.scrollTop=me.view.el.dom.scrollTop,scrollHandled=false;if(me.ignoreNextScrollEvent){me.ignoreNextScrollEvent=false;return;}
if(!(me.disabled||totalCount<me.viewSize)){vscrollDistance=scrollTop-me.position;scrollDirection=vscrollDistance>0?1:-1;if(Math.abs(vscrollDistance)>=20||(scrollDirection!==me.lastScrollDirection)){me.lastScrollDirection=scrollDirection;me.handleViewScroll(me.lastScrollDirection);scrollHandled=true;}}
if(!scrollHandled){if(me.lockingPartner&&me.lockingPartner.scrollTop!==scrollTop){me.lockingPartner.view.el.dom.scrollTop=scrollTop;}}},handleViewScroll:function(direction){var me=this,rows=me.view.all,store=me.store,viewSize=me.viewSize,totalCount=(store.buffered?store.getTotalCount():store.getCount()),requestStart,requestEnd;if(direction==-1){if(rows.startIndex){if((me.getFirstVisibleRowIndex()-rows.startIndex)<me.numFromEdge){requestStart=Math.max(0,me.getLastVisibleRowIndex()+me.trailingBufferZone-viewSize);}}}
else{if(rows.endIndex<totalCount-1){if((rows.endIndex-me.getLastVisibleRowIndex())<me.numFromEdge){requestStart=Math.max(0,me.getFirstVisibleRowIndex()-me.trailingBufferZone);}}}
if(requestStart!=null){requestEnd=Math.min(requestStart+viewSize-1,totalCount-1);if(requestStart!==rows.startIndex||requestEnd!==rows.endIndex){me.renderRange(requestStart,requestEnd);return;}}
if(me.lockingPartner&&me.lockingPartner.view.el&&me.lockingPartner.scrollTop!==me.scrollTop){me.lockingPartner.view.el.dom.scrollTop=me.scrollTop;}},renderRange:function(start,end,forceSynchronous){var me=this,store=me.store;if(store.rangeCached(start,end)){me.cancelLoad();if(me.synchronousRender||forceSynchronous){me.onRangeFetched(null,start,end);}else{if(!me.renderTask){me.renderTask=new Ext.util.DelayedTask(me.onRangeFetched,me,null,false);}
me.renderTask.delay(1,null,null,[null,start,end]);}}
else{me.attemptLoad(start,end);}},onRangeFetched:function(range,start,end,fromLockingPartner){var me=this,view=me.view,oldStart,rows=view.all,removeCount,increment=0,calculatedTop=start*me.rowHeight,top,lockingPartner=me.lockingPartner;if(view.isDestroyed){return;}
if(!range){range=me.store.getRange(start,end);if(!range){return;}}
if(start>rows.endIndex||end<rows.startIndex){rows.clear(true);top=calculatedTop;}
if(!rows.getCount()){view.doAdd(range,start);}
else if(end>rows.endIndex){removeCount=Math.max(start-rows.startIndex,0);if(me.variableRowHeight){increment=rows.item(rows.startIndex+removeCount,true).offsetTop;}
rows.scroll(Ext.Array.slice(range,rows.endIndex+1-start),1,removeCount,start,end);if(me.variableRowHeight){top=me.bodyTop+increment;}else{top=calculatedTop;}}
else{removeCount=Math.max(rows.endIndex-end,0);oldStart=rows.startIndex;rows.scroll(Ext.Array.slice(range,0,rows.startIndex-start),-1,removeCount,start,end);if(me.variableRowHeight){top=me.bodyTop-rows.item(oldStart,true).offsetTop;}else{top=calculatedTop;}}
me.position=me.scrollTop;if(view.positionBody){me.setBodyTop(top,calculatedTop);}
if(lockingPartner&&!lockingPartner.disabled&&!fromLockingPartner){lockingPartner.onRangeFetched(range,start,end,true);if(lockingPartner.scrollTop!==me.scrollTop){lockingPartner.view.el.dom.scrollTop=me.scrollTop;}}},setBodyTop:function(bodyTop,calculatedTop){var me=this,view=me.view,store=me.store,body=view.body.dom,delta;bodyTop=Math.floor(bodyTop);if(calculatedTop!==undefined){delta=bodyTop-calculatedTop;bodyTop=calculatedTop;}
body.style.position='absolute';body.style.top=(me.bodyTop=bodyTop)+'px';if(delta){me.scrollTop=me.position=view.el.dom.scrollTop-=delta;}
if(view.all.endIndex===(store.buffered?store.getTotalCount():store.getCount())-1){me.stretchView(view,me.bodyTop+body.offsetHeight);}},getFirstVisibleRowIndex:function(startRow,endRow,viewportTop,viewportBottom){var me=this,view=me.view,rows=view.all,elements=rows.elements,clientHeight=view.el.dom.clientHeight,target,targetTop;if(rows.getCount()&&me.variableRowHeight){if(!arguments.length){startRow=rows.startIndex;endRow=rows.endIndex;viewportTop=me.scrollTop;viewportBottom=viewportTop+clientHeight;if(me.bodyTop>viewportBottom||me.bodyTop+view.body.getHeight()<viewportTop){return Math.floor(me.scrollTop/me.rowHeight);}
target=startRow+Math.min(me.numFromEdge+((me.lastScrollDirection==-1)?me.leadingBufferZone:me.trailingBufferZone),Math.floor((endRow-startRow)/2));}else{target=startRow+Math.floor((endRow-startRow)/2);}
targetTop=me.bodyTop+elements[target].offsetTop;if(targetTop+elements[target].offsetHeight<viewportTop){return me.getFirstVisibleRowIndex(target+1,endRow,viewportTop,viewportBottom);}
if(targetTop<=viewportTop){return target;}
else if(target!==startRow){return me.getFirstVisibleRowIndex(startRow,target-1,viewportTop,viewportBottom);}}
return Math.floor(me.scrollTop/me.rowHeight);},getLastVisibleRowIndex:function(startRow,endRow,viewportTop,viewportBottom){var me=this,view=me.view,rows=view.all,elements=rows.elements,clientHeight=view.el.dom.clientHeight,target,targetTop,targetBottom;if(rows.getCount()&&me.variableRowHeight){if(!arguments.length){startRow=rows.startIndex;endRow=rows.endIndex;viewportTop=me.scrollTop;viewportBottom=viewportTop+clientHeight;if(me.bodyTop>viewportBottom||me.bodyTop+view.body.getHeight()<viewportTop){return Math.floor(me.scrollTop/me.rowHeight)+Math.ceil(clientHeight/me.rowHeight);}
target=endRow-Math.min(me.numFromEdge+((me.lastScrollDirection==1)?me.leadingBufferZone:me.trailingBufferZone),Math.floor((endRow-startRow)/2));}else{target=startRow+Math.floor((endRow-startRow)/2);}
targetTop=me.bodyTop+elements[target].offsetTop;if(targetTop>viewportBottom){return me.getLastVisibleRowIndex(startRow,target-1,viewportTop,viewportBottom);}
targetBottom=targetTop+elements[target].offsetHeight;if(targetBottom>=viewportBottom){return target;}
else if(target!==endRow){return me.getLastVisibleRowIndex(target+1,endRow,viewportTop,viewportBottom);}}
return me.getFirstVisibleRowIndex()+Math.ceil(clientHeight/me.rowHeight);},getScrollHeight:function(){var me=this,view=me.view,store=me.store,doCalcHeight=!me.hasOwnProperty('rowHeight'),storeCount=me.store.getCount();if(!storeCount){return 0;}
if(doCalcHeight){if(view.all.getCount()){me.rowHeight=Math.floor(view.body.getHeight()/view.all.getCount());}}
return this.scrollHeight=Math.floor((store.buffered?store.getTotalCount():store.getCount())*me.rowHeight);},attemptLoad:function(start,end){var me=this;if(me.scrollToLoadBuffer){if(!me.loadTask){me.loadTask=new Ext.util.DelayedTask(me.doAttemptLoad,me,[]);}
me.loadTask.delay(me.scrollToLoadBuffer,me.doAttemptLoad,me,[start,end]);}else{me.store.getRange(start,end,{callback:me.onRangeFetched,scope:me,fireEvent:false});}},cancelLoad:function(){if(this.loadTask){this.loadTask.cancel();}},doAttemptLoad:function(start,end){this.store.getRange(start,end,{callback:this.onRangeFetched,scope:this,fireEvent:false});},destroy:function(){var me=this,view=me.view;if(view&&view.el){view.el.un('scroll',me.onViewScroll,me);}
Ext.destroy(me.viewListeners,me.storeListeners,me.gridListeners);}});Ext.define('Ext.grid.column.Column',{extend:'Ext.grid.header.Container',alias:'widget.gridcolumn',requires:['Ext.util.KeyNav','Ext.grid.ColumnComponentLayout','Ext.grid.ColumnLayout'],alternateClassName:'Ext.grid.Column',baseCls:Ext.baseCSSPrefix+'column-header',hoverCls:Ext.baseCSSPrefix+'column-header-over',handleWidth:4,sortState:null,possibleSortStates:['ASC','DESC'],childEls:['titleEl','triggerEl','textEl'],noWrap:true,renderTpl:'<div id="{id}-titleEl" {tipMarkup}class="'+Ext.baseCSSPrefix+'column-header-inner">'+'<span id="{id}-textEl" class="'+Ext.baseCSSPrefix+'column-header-text'+'{childElCls}">'+'{text}'+'</span>'+'<tpl if="!menuDisabled">'+'<div id="{id}-triggerEl" class="'+Ext.baseCSSPrefix+'column-header-trigger'+'{childElCls}"></div>'+'</tpl>'+'</div>'+'{%this.renderContainer(out,values)%}',dataIndex:null,text:'&#160;',menuText:null,emptyCellText:'&#160;',sortable:true,resizable:true,hideable:true,menuDisabled:false,renderer:false,editRenderer:false,align:'left',draggable:true,tooltipType:'qtip',initDraggable:Ext.emptyFn,tdCls:'',isHeader:true,isColumn:true,ascSortCls:Ext.baseCSSPrefix+'column-header-sort-ASC',descSortCls:Ext.baseCSSPrefix+'column-header-sort-DESC',componentLayout:'columncomponent',groupSubHeaderCls:Ext.baseCSSPrefix+'group-sub-header',groupHeaderCls:Ext.baseCSSPrefix+'group-header',clickTargetName:'titleEl',detachOnRemove:true,initResizable:Ext.emptyFn,initComponent:function(){var me=this,renderer,listeners;if(me.header!=null){me.text=me.header;me.header=null;}
if(!me.triStateSort){me.possibleSortStates.length=2;}
if(me.columns!=null){me.isGroupHeader=true;me.items=me.columns;me.columns=me.flex=me.width=null;me.cls=(me.cls||'')+' '+me.groupHeaderCls;me.sortable=me.resizable=false;me.align='center';}else{if(me.flex){me.minWidth=me.minWidth||Ext.grid.plugin.HeaderResizer.prototype.minColWidth;}}
me.addCls(Ext.baseCSSPrefix+'column-header-align-'+me.align);renderer=me.renderer;if(renderer){if(typeof renderer=='string'){me.renderer=Ext.util.Format[renderer];}
me.hasCustomRenderer=true;}else if(me.defaultRenderer){me.scope=me;me.renderer=me.defaultRenderer;}
me.callParent(arguments);listeners={element:me.clickTargetName,click:me.onTitleElClick,contextmenu:me.onTitleElContextMenu,mouseenter:me.onTitleMouseOver,mouseleave:me.onTitleMouseOut,scope:me};if(me.resizable){listeners.dblclick=me.onTitleElDblClick;}
me.on(listeners);},onAdd:function(child){if(child.isColumn){child.isSubHeader=true;child.addCls(this.groupSubHeaderCls);}
if(this.hidden){child.hide();}
this.callParent(arguments);},onRemove:function(child){if(child.isSubHeader){child.isSubHeader=false;child.removeCls(this.groupSubHeaderCls);}
this.callParent(arguments);},initRenderData:function(){var me=this,tipMarkup='',tip=me.tooltip,attr=me.tooltipType=='qtip'?'data-qtip':'title';if(!Ext.isEmpty(tip)){tipMarkup=attr+'="'+tip+'" ';}
return Ext.applyIf(me.callParent(arguments),{text:me.text,menuDisabled:me.menuDisabled,tipMarkup:tipMarkup});},applyColumnState:function(state){var me=this;me.applyColumnsState(state.columns);if(state.hidden!=null){me.hidden=state.hidden;}
if(state.locked!=null){me.locked=state.locked;}
if(state.sortable!=null){me.sortable=state.sortable;}
if(state.width!=null){me.flex=null;me.width=state.width;}else if(state.flex!=null){me.width=null;me.flex=state.flex;}},getColumnState:function(){var me=this,items=me.items.items,iLen=items?items.length:0,i,columns=[],state={id:me.getStateId()};me.savePropsToState(['hidden','sortable','locked','flex','width'],state);if(me.isGroupHeader){for(i=0;i<iLen;i++){columns.push(items[i].getColumnState());}
if(columns.length){state.columns=columns;}}else if(me.isSubHeader&&me.ownerCt.hidden){delete me.hidden;}
if('width'in state){delete state.flex;}
return state;},getStateId:function(){return this.stateId||this.headerId;},setText:function(text){this.text=text;if(this.rendered){this.textEl.update(text);}},getIndex:function(){return this.isGroupColumn?false:this.getOwnerHeaderCt().getHeaderIndex(this);},getVisibleIndex:function(){return this.isGroupColumn?false:Ext.Array.indexOf(this.getOwnerHeaderCt().getVisibleGridColumns(),this);},beforeRender:function(){var me=this,grid=me.up('tablepanel');me.callParent();if(grid&&(!me.sortable||grid.sortableColumns===false)&&!me.groupable&&!me.lockable&&(grid.enableColumnHide===false||!me.getOwnerHeaderCt().getHideableColumns().length)){me.menuDisabled=true;}
me.protoEl.unselectable();},afterRender:function(){var me=this,triggerEl=me.triggerEl,triggerWidth;me.callParent(arguments);if(!Ext.isIE8||!Ext.isStrict){me.mon(me.getFocusEl(),{focus:me.onTitleMouseOver,blur:me.onTitleMouseOut,scope:me});}
if(triggerEl&&me.self.triggerElWidth===undefined){triggerEl.setStyle('display','block');me.self.triggerElWidth=triggerEl.getWidth();triggerEl.setStyle('display','');}
me.keyNav=new Ext.util.KeyNav(me.el,{enter:me.onEnterKey,down:me.onDownKey,scope:me});},afterComponentLayout:function(width,height,oldWidth,oldHeight){var me=this,ownerHeaderCt=me.getOwnerHeaderCt();me.callParent(arguments);if(ownerHeaderCt&&(oldWidth!=null||me.flex)&&width!==oldWidth){ownerHeaderCt.onHeaderResize(me,width,true);}},onDestroy:function(){var me=this;Ext.destroy(me.textEl,me.keyNav,me.field);me.keyNav=null;me.callParent(arguments);},onTitleMouseOver:function(){this.titleEl.addCls(this.hoverCls);},onTitleMouseOut:function(){this.titleEl.removeCls(this.hoverCls);},onDownKey:function(e){if(this.triggerEl){this.onTitleElClick(e,this.triggerEl.dom||this.el.dom);}},onEnterKey:function(e){this.onTitleElClick(e,this.el.dom);},onTitleElDblClick:function(e,t){var me=this,prev,leafColumns;if(me.isOnLeftEdge(e)){prev=me.previousNode('gridcolumn:not([hidden]):not([isGroupHeader])');if(prev&&prev.getOwnerHeaderCt()===me.getOwnerHeaderCt()){prev.autoSize();}}
else if(me.isOnRightEdge(e)){if(me.isGroupHeader&&e.getPoint().isContainedBy(me.layout.innerCt)){leafColumns=me.query('gridcolumn:not([hidden]):not([isGroupHeader])');this.getOwnerHeaderCt().autoSizeColumn(leafColumns[leafColumns.length-1]);return;}
me.autoSize();}},autoSize:function(){var me=this,leafColumns,numLeaves,i,headerCt;if(me.isGroupHeader){leafColumns=me.query('gridcolumn:not([hidden]):not([isGroupHeader])');numLeaves=leafColumns.length;headerCt=this.getOwnerHeaderCt();Ext.suspendLayouts();for(i=0;i<numLeaves;i++){headerCt.autoSizeColumn(leafColumns[i]);}
Ext.resumeLayouts(true);return;}
this.getOwnerHeaderCt().autoSizeColumn(this);},onTitleElClick:function(e,t){var me=this,ownerHeaderCt=me.getOwnerHeaderCt();if(ownerHeaderCt&&!ownerHeaderCt.ddLock){if(me.triggerEl&&(e.target===me.triggerEl.dom||t===me.triggerEl.dom||e.within(me.triggerEl))){ownerHeaderCt.onHeaderTriggerClick(me,e,t);}else if(e.getKey()||(!me.isOnLeftEdge(e)&&!me.isOnRightEdge(e))){me.toggleSortState();ownerHeaderCt.onHeaderClick(me,e,t);}}},onTitleElContextMenu:function(e,t){var me=this,ownerHeaderCt=me.getOwnerHeaderCt();if(ownerHeaderCt&&!ownerHeaderCt.ddLock){ownerHeaderCt.onHeaderContextMenu(me,e,t);}},processEvent:function(type,view,cell,recordIndex,cellIndex,e){return this.fireEvent.apply(this,arguments);},toggleSortState:function(){var me=this,idx,nextIdx;if(me.sortable){idx=Ext.Array.indexOf(me.possibleSortStates,me.sortState);nextIdx=(idx+1)%me.possibleSortStates.length;me.setSortState(me.possibleSortStates[nextIdx]);}},doSort:function(state){var tablePanel=this.up('tablepanel'),store=tablePanel.store;if(tablePanel.ownerLockable&&store.isNodeStore){store=tablePanel.ownerLockable.lockedGrid.store;}
store.sort({property:this.getSortParam(),direction:state});},getSortParam:function(){return this.dataIndex;},setSortState:function(state,skipClear,initial){var me=this,ascCls=me.ascSortCls,descCls=me.descSortCls,ownerHeaderCt=me.getOwnerHeaderCt(),oldSortState=me.sortState;state=state||null;if(!me.sorting&&oldSortState!==state&&(me.getSortParam()!=null)){if(state&&!initial){me.sorting=true;me.doSort(state);me.sorting=false;}
switch(state){case'DESC':me.addCls(descCls);me.removeCls(ascCls);break;case'ASC':me.addCls(ascCls);me.removeCls(descCls);break;default:me.removeCls([ascCls,descCls]);}
if(ownerHeaderCt&&!me.triStateSort&&!skipClear){ownerHeaderCt.clearOtherSortStates(me);}
me.sortState=state;if(me.triStateSort||state!=null){ownerHeaderCt.fireEvent('sortchange',ownerHeaderCt,me,state);}}},isHideable:function(){var result={hideCandidate:this,result:this.hideable};if(result.result){this.ownerCt.bubble(this.hasOtherMenuEnabledChildren,null,[result]);}
return result.result;},hasOtherMenuEnabledChildren:function(result){var visibleChildren,count;if(!this.isXType('headercontainer')){result.result=false;return false;}
visibleChildren=this.query('>:not([hidden]):not([menuDisabled])');count=visibleChildren.length;if(Ext.Array.contains(visibleChildren,result.hideCandidate)){count--;}
if(count){return false;}
result.hideCandidate=this;},isLockable:function(){var result={result:this.lockable!==false};if(result.result){this.ownerCt.bubble(this.hasMultipleVisibleChildren,null,[result]);}
return result.result;},isLocked:function(){return this.locked||!!this.up('[isColumn][locked]','[isRootHeader]');},hasMultipleVisibleChildren:function(result){if(!this.isXType('headercontainer')){result.result=false;return false;}
if(this.query('>:not([hidden])').length>1){return false;}},hide:function(fromOwner){var me=this,ownerHeaderCt=me.getOwnerHeaderCt(),owner=me.ownerCt,ownerIsGroup,item,items,len,i;if(!me.isVisible()){return me;}
if(!ownerHeaderCt){me.callParent();return me;}
if(ownerHeaderCt.forceFit){me.visibleSiblingCount=ownerHeaderCt.getVisibleGridColumns().length-1;if(me.flex){me.savedWidth=me.getWidth();me.flex=null;}}
ownerIsGroup=owner.isGroupHeader;if(ownerIsGroup&&!fromOwner){items=owner.query('>:not([hidden])');if(items.length===1&&items[0]==me){me.ownerCt.hide();return;}}
Ext.suspendLayouts();if(me.isGroupHeader){items=me.items.items;for(i=0,len=items.length;i<len;i++){item=items[i];if(!item.hidden){item.hide(true);}}}
me.callParent();ownerHeaderCt.onHeaderHide(me);Ext.resumeLayouts(true);return me;},show:function(fromOwner,fromChild){var me=this,ownerHeaderCt=me.getOwnerHeaderCt(),ownerCt=me.ownerCt,items,len,i,item,myWidth,availFlex,totalFlex,oldLen,defaultWidth=Ext.grid.header.Container.prototype.defaultWidth;if(me.isVisible()){return me;}
if(!me.rendered){me.hidden=false;return;}
availFlex=ownerHeaderCt.el.getViewSize().width-(ownerHeaderCt.view.el.dom.scrollHeight>ownerHeaderCt.view.el.dom.clientHeight?Ext.getScrollbarSize().width:0);if(ownerHeaderCt.forceFit){items=Ext.ComponentQuery.query(':not([flex])',ownerHeaderCt.getVisibleGridColumns());if(items.length){me.width=me.savedWidth||me.width||defaultWidth;}
else{items=ownerHeaderCt.getVisibleGridColumns();len=items.length;oldLen=me.visibleSiblingCount;myWidth=(me.savedWidth||me.width||defaultWidth);myWidth=Math.min(myWidth*(oldLen/len),defaultWidth,Math.max(availFlex-(len*defaultWidth),defaultWidth));me.width=null;me.flex=myWidth;availFlex-=myWidth;totalFlex=0;for(i=0;i<len;i++){item=items[i];item.flex=(item.width||item.getWidth());totalFlex+=item.flex;item.width=null;}
for(i=0;i<len;i++){item=items[i];item.flex=item.flex/totalFlex*availFlex;}}}
Ext.suspendLayouts();if(me.isSubHeader&&ownerCt.hidden){ownerCt.show(false,true);}
me.callParent(arguments);if(me.isGroupHeader&&fromChild!==true&&!me.query(':not([hidden])').length){items=me.items.items;for(i=0,len=items.length;i<len;i++){item=items[i];if(item.hidden){item.show(true);}}}
Ext.resumeLayouts(true);ownerCt=me.getOwnerHeaderCt();if(ownerCt){ownerCt.onHeaderShow(me);}},getDesiredWidth:function(){var me=this;if(me.rendered&&me.componentLayout&&me.componentLayout.lastComponentSize){return me.componentLayout.lastComponentSize.width;}
else if(me.flex){return me.width;}
else{return me.width;}},getCellSelector:function(){return'.'+Ext.baseCSSPrefix+'grid-cell-'+this.getItemId();},getCellInnerSelector:function(){return this.getCellSelector()+' .'+Ext.baseCSSPrefix+'grid-cell-inner';},isOnLeftEdge:function(e){return(e.getXY()[0]-this.getX()<=this.handleWidth);},isOnRightEdge:function(e){return(this.getX()+this.getWidth()-e.getXY()[0]<=this.handleWidth);},setMenuActive:function(isMenuOpen){this.titleEl[isMenuOpen?'addCls':'removeCls'](this.headerOpenCls);}});Ext.define('Ext.view.BoundList',{extend:'Ext.view.View',alias:'widget.boundlist',alternateClassName:'Ext.BoundList',requires:['Ext.layout.component.BoundList','Ext.toolbar.Paging'],mixins:{queryable:'Ext.Queryable'},pageSize:0,baseCls:Ext.baseCSSPrefix+'boundlist',itemCls:Ext.baseCSSPrefix+'boundlist-item',listItemCls:'',shadow:false,trackOver:true,refreshed:0,deferInitialRefresh:false,componentLayout:'boundlist',childEls:['listEl'],renderTpl:['<div id="{id}-listEl" class="{baseCls}-list-ct ',Ext.dom.Element.unselectableCls,'" style="overflow:auto"></div>','{%','var me=values.$comp, pagingToolbar=me.pagingToolbar;','if (pagingToolbar) {','pagingToolbar.ownerLayout = me.componentLayout;','Ext.DomHelper.generateMarkup(pagingToolbar.getRenderTree(), out);','}','%}',{disableFormats:true}],initComponent:function(){var me=this,baseCls=me.baseCls,itemCls=me.itemCls;me.selectedItemCls=baseCls+'-selected';if(me.trackOver){me.overItemCls=baseCls+'-item-over';}
me.itemSelector="."+itemCls;if(me.floating){me.addCls(baseCls+'-floating');}
if(!me.tpl){me.tpl=new Ext.XTemplate('<ul class="'+Ext.plainListCls+'"><tpl for=".">','<li role="option" unselectable="on" class="'+itemCls+'">'+me.getInnerTpl(me.displayField)+'</li>','</tpl></ul>');}else if(!me.tpl.isTemplate){me.tpl=new Ext.XTemplate(me.tpl);}
if(me.pageSize){me.pagingToolbar=me.createPagingToolbar();}
me.callParent();},beforeRender:function(){var me=this;me.callParent(arguments);if(me.up('menu')){me.addCls(Ext.baseCSSPrefix+'menu');}},getRefOwner:function(){return this.pickerField||this.callParent();},getRefItems:function(){return this.pagingToolbar?[this.pagingToolbar]:[];},createPagingToolbar:function(){return Ext.widget('pagingtoolbar',{id:this.id+'-paging-toolbar',pageSize:this.pageSize,store:this.dataSource,border:false,ownerCt:this,ownerLayout:this.getComponentLayout()});},finishRenderChildren:function(){var toolbar=this.pagingToolbar;this.callParent(arguments);if(toolbar){toolbar.finishRender();}},refresh:function(){var me=this,tpl=me.tpl,toolbar=me.pagingToolbar,rendered=me.rendered;tpl.field=me.pickerField;tpl.store=me.store;me.callParent();tpl.field=tpl.store=null;if(rendered&&toolbar&&toolbar.rendered&&!me.preserveScrollOnRefresh){me.el.appendChild(toolbar.el);}
if(rendered&&Ext.isIE6&&Ext.isStrict){me.listEl.repaint();}},bindStore:function(store,initial){var toolbar=this.pagingToolbar;this.callParent(arguments);if(toolbar){toolbar.bindStore(store,initial);}},getTargetEl:function(){return this.listEl||this.el;},getInnerTpl:function(displayField){return'{'+displayField+'}';},onDestroy:function(){Ext.destroyMembers(this,'pagingToolbar','listEl');this.callParent();}});Ext.define('MP.toolbar.Paging',{extend:'Ext.toolbar.Paging',uses:['Ext.toolbar.*'],getPagingItems:function(){var me=this;var items=me.callParent();items.unshift(_('Page size'),{xtype:'numberfield',inputAttrTpl:' data-qtip="'
+_('Double click to adjust the number to fit grid height.')
+'" ',itemId:'sizeItem',name:'sizeItem',cls:Ext.baseCSSPrefix+'tbar-page-number',allowDecimals:false,minValue:1,hideTrigger:true,enableKeyEvents:true,keyNavEnabled:false,selectOnFocus:true,submitValue:false,isFormField:false,width:me.inputItemWidth,margins:'-1 2 3 2',listeners:{scope:me,keydown:me.onPageSizeChange}},'-');return items;},onPageSizeChange:function(field,e){var me=this;var k=e.getKey();if(k==e.RETURN||k==e.TAB){var v=field.getValue();var pagesize=parseInt(v,10);var s=me.store;e.stopEvent();if(!v||isNaN(pagesize)){field.setValue(me.pageSize);}else{if(pagesize!=s.pageSize){var firstrec=s.pageSize*(s.currentPage-1)+1;var newpage=Math.ceil(firstrec/pagesize);s.pageSize=pagesize;s.loadPage(newpage);}}}},bindStore:function(store){this.callParent(arguments);if(store){this.child('#sizeItem').setValue(store.pageSize);}}});Ext.define('Ext.panel.Panel',{extend:'Ext.panel.AbstractPanel',requires:['Ext.panel.Header','Ext.fx.Anim','Ext.util.KeyMap','Ext.panel.DD','Ext.XTemplate','Ext.layout.component.Dock','Ext.util.Memento'],alias:'widget.panel',alternateClassName:'Ext.Panel',collapsedCls:'collapsed',animCollapse:Ext.enableFx,minButtonWidth:75,collapsed:false,collapseFirst:true,hideCollapseTool:false,titleCollapse:undefined,floatable:true,collapsible:undefined,closable:false,closeAction:'destroy',placeholderCollapseHideMode:Ext.Element.VISIBILITY,preventHeader:false,header:undefined,headerPosition:'top',frame:false,frameHeader:true,manageHeight:true,constrain:false,constrainHeader:false,initComponent:function(){var me=this;me.addEvents('beforeclose','close',"beforeexpand","beforecollapse","expand","collapse",'titlechange','iconchange','iconclschange','glyphchange','float','unfloat');if(me.collapsible){this.addStateEvents(['expand','collapse']);}
if(me.unstyled){me.setUI('plain');}
if(me.frame){me.setUI(me.ui+'-framed');}
me.bridgeToolbars();me.callParent();me.collapseDirection=me.collapseDirection||me.headerPosition||Ext.Component.DIRECTION_TOP;me.hiddenOnCollapse=new Ext.dom.CompositeElement();},beforeDestroy:function(){var me=this;Ext.destroy(me.placeholder,me.ghostPanel,me.dd);me.callParent();},initAria:function(){this.callParent();this.initHeaderAria();},getFocusEl:function(){return this.el;},initHeaderAria:function(){var me=this,el=me.el,header=me.header;if(el&&header){el.dom.setAttribute('aria-labelledby',header.titleCmp.id);}},getHeader:function(){return this.header;},setTitle:function(newTitle){var me=this,oldTitle=me.title,header=me.header,reExpander=me.reExpander,placeholder=me.placeholder;me.title=newTitle;if(header){if(header.isHeader){header.setTitle(newTitle);}else{header.title=newTitle;}}else if(me.rendered){me.updateHeader();}
if(reExpander){reExpander.setTitle(newTitle);}
if(placeholder&&placeholder.setTitle){placeholder.setTitle(newTitle);}
me.fireEvent('titlechange',me,newTitle,oldTitle);},setIconCls:function(newIconCls){var me=this,oldIconCls=me.iconCls,header=me.header,placeholder=me.placeholder;me.iconCls=newIconCls;if(header){if(header.isHeader){header.setIconCls(newIconCls);}else{header.iconCls=newIconCls;}}else{me.updateHeader();}
if(placeholder&&placeholder.setIconCls){placeholder.setIconCls(newIconCls);}
me.fireEvent('iconclschange',me,newIconCls,oldIconCls);},setIcon:function(newIcon){var me=this,oldIcon=me.icon,header=me.header,placeholder=me.placeholder;me.icon=newIcon;if(header){if(header.isHeader){header.setIcon(newIcon);}else{header.icon=newIcon;}}else{me.updateHeader();}
if(placeholder&&placeholder.setIcon){placeholder.setIcon(newIcon);}
me.fireEvent('iconchange',me,newIcon,oldIcon);},setGlyph:function(newGlyph){var me=this,oldGlyph=me.glyph,header=me.header,placeholder=me.placeholder;me.glyph=newGlyph;if(header){if(header.isHeader){header.setGlyph(newGlyph);}else{header.glyph=newGlyph;}}else{me.updateHeader();}
if(placeholder&&placeholder.setGlyph){placeholder.setIcon(newGlyph);}
me.fireEvent('glyphchange',me,newGlyph,oldGlyph);},bridgeToolbars:function(){var me=this,docked=[],fbar,fbarDefaults,minButtonWidth=me.minButtonWidth;function initToolbar(toolbar,pos,useButtonAlign){if(Ext.isArray(toolbar)){toolbar={xtype:'toolbar',items:toolbar};}
else if(!toolbar.xtype){toolbar.xtype='toolbar';}
toolbar.dock=pos;if(pos=='left'||pos=='right'){toolbar.vertical=true;}
if(useButtonAlign){toolbar.layout=Ext.applyIf(toolbar.layout||{},{pack:{left:'start',center:'center'}[me.buttonAlign]||'end'});}
return toolbar;}
if(me.tbar){docked.push(initToolbar(me.tbar,'top'));me.tbar=null;}
if(me.bbar){docked.push(initToolbar(me.bbar,'bottom'));me.bbar=null;}
if(me.buttons){me.fbar=me.buttons;me.buttons=null;}
if(me.fbar){fbar=initToolbar(me.fbar,'bottom',true);fbar.ui='footer';if(minButtonWidth){fbarDefaults=fbar.defaults;fbar.defaults=function(config){var defaults=fbarDefaults||{};if((!config.xtype||config.xtype==='button'||(config.isComponent&&config.isXType('button')))&&!('minWidth'in defaults)){defaults=Ext.apply({minWidth:minButtonWidth},defaults);}
return defaults;};}
docked.push(fbar);me.fbar=null;}
if(me.lbar){docked.push(initToolbar(me.lbar,'left'));me.lbar=null;}
if(me.rbar){docked.push(initToolbar(me.rbar,'right'));me.rbar=null;}
if(me.dockedItems){if(!Ext.isArray(me.dockedItems)){me.dockedItems=[me.dockedItems];}
me.dockedItems=me.dockedItems.concat(docked);}else{me.dockedItems=docked;}},isPlaceHolderCollapse:function(){return this.collapseMode=='placeholder';},onBoxReady:function(){this.callParent();if(this.collapsed){this.setHiddenDocked();}},beforeRender:function(){var me=this,wasCollapsed;me.callParent();me.initTools();if(!(me.preventHeader||(me.header===false))){me.updateHeader();}
if(me.collapsed){if(me.isPlaceHolderCollapse()){if(!me.hidden){me.setHiddenState(true);me.preventCollapseFire=true;me.placeholderCollapse();delete me.preventCollapseFire;wasCollapsed=me.collapsed;me.collapsed=false;}}else{me.beginCollapse();me.addClsWithUI(me.collapsedCls);}}
if(wasCollapsed){me.collapsed=wasCollapsed;}},initTools:function(){var me=this,tools=me.tools,i,tool;me.tools=[];for(i=tools&&tools.length;i;){--i;me.tools[i]=tool=tools[i];tool.toolOwner=me;}
if(me.collapsible&&!(me.hideCollapseTool||me.header===false||me.preventHeader)){me.collapseDirection=me.collapseDirection||me.headerPosition||'top';me.collapseTool=me.expandTool=Ext.widget({xtype:'tool',handler:me.toggleCollapse,scope:me});me.updateCollapseTool();if(me.collapseFirst){me.tools.unshift(me.collapseTool);}}
me.addTools();if(me.closable){me.addClsWithUI('closable');me.addTool(Ext.widget({xtype:'tool',type:'close',handler:Ext.Function.bind(me.close,me,[])}));}
if(me.collapseTool&&!me.collapseFirst){me.addTool(me.collapseTool);}},addTools:Ext.emptyFn,updateCollapseTool:function(){var me=this,collapseTool=me.collapseTool;if(collapseTool){if(me.collapsed&&!me.isPlaceHolderCollapse()){collapseTool.setType('expand-'+me.getOppositeDirection(me.collapseDirection));}else{collapseTool.setType('collapse-'+me.collapseDirection);}}},close:function(){if(this.fireEvent('beforeclose',this)!==false){this.doClose();}},doClose:function(){this.fireEvent('close',this);this[this.closeAction]();},updateHeader:function(force){var me=this,header=me.header,title=me.title,tools=me.tools,icon=me.icon||me.iconCls,vertical=me.headerPosition==='left'||me.headerPosition==='right';if(Ext.isObject(header)||(header!==false&&(force||(title||icon)||(tools&&tools.length)||(me.collapsible&&!me.titleCollapse)))){if(header&&header.isHeader){header.show();}else{header=me.header=Ext.widget(Ext.apply({xtype:'header',title:title,titleAlign:me.titleAlign,orientation:vertical?'vertical':'horizontal',dock:me.headerPosition||'top',textCls:me.headerTextCls,iconCls:me.iconCls,icon:me.icon,glyph:me.glyph,baseCls:me.baseCls+'-header',tools:tools,ui:me.ui,id:me.id+'_header',overCls:me.headerOverCls,indicateDrag:me.draggable,frame:(me.frame||me.alwaysFramed)&&me.frameHeader,ignoreParentFrame:me.frame||me.overlapHeader,ignoreBorderManagement:me.frame||me.ignoreHeaderBorderManagement,ownerCt:me,listeners:me.collapsible&&me.titleCollapse?{click:me.toggleCollapse,scope:me}:null},me.header));me.addDocked(header,0);}
me.initHeaderAria();}else if(header){header.hide();}},setUI:function(ui){var me=this;me.callParent(arguments);if(me.header&&me.header.rendered){me.header.setUI(ui);}},getDefaultContentTarget:function(){return this.body;},getTargetEl:function(){var me=this;return me.body||me.protoBody||me.frameBody||me.el;},isVisible:function(deep){var me=this;if(me.collapsed&&me.placeholder){return me.placeholder.isVisible(deep);}
return me.callParent(arguments);},onHide:function(){var me=this;if(me.collapsed&&me.placeholder){me.placeholder.hide();}else{me.callParent(arguments);}},onShow:function(){var me=this;if(me.collapsed&&me.isPlaceHolderCollapse()){me.setHiddenState(true);me.placeholderCollapse();}else{me.callParent(arguments);}},onRemoved:function(destroying){var me=this;if(me.placeholder&&!destroying){me.ownerCt.remove(me.placeholder,false);}
me.callParent(arguments);},addTool:function(tools){if(!Ext.isArray(tools)){tools=[tools];}
var me=this,header=me.header,t,tLen=tools.length,tool;for(t=0;t<tLen;t++){tool=tools[t];tool.toolOwner=me;if(header&&header.isHeader){header.addTool(tool);}else{me.tools.push(tool);}}
me.updateHeader();},getOppositeDirection:function(d){var c=Ext.Component;switch(d){case c.DIRECTION_TOP:return c.DIRECTION_BOTTOM;case c.DIRECTION_RIGHT:return c.DIRECTION_LEFT;case c.DIRECTION_BOTTOM:return c.DIRECTION_TOP;case c.DIRECTION_LEFT:return c.DIRECTION_RIGHT;}},getWidthAuthority:function(){if(this.collapsed&&this.collapsedHorizontal()){return 1;}
return this.callParent();},getHeightAuthority:function(){if(this.collapsed&&this.collapsedVertical()){return 1;}
return this.callParent();},collapsedHorizontal:function(){var dir=this.getCollapsed();return dir==='left'||dir==='right';},collapsedVertical:function(){var dir=this.getCollapsed();return dir==='top'||dir==='bottom';},restoreDimension:function(){var dir=this.collapseDirection;return(dir==='top'||dir==='bottom')?'height':'width';},getCollapsed:function(){var me=this;if(me.collapsed===true){return me.collapseDirection;}
return me.collapsed;},getState:function(){var me=this,state=me.callParent(),memento;state=me.addPropertyToState(state,'collapsed');if(me.collapsed){memento=me.collapseMemento;memento=memento&&memento.data;if(me.collapsedVertical()){if(state){delete state.height;}
if(memento){state=me.addPropertyToState(state,'height',memento.height);}}else{if(state){delete state.width;}
if(memento){state=me.addPropertyToState(state,'width',memento.width);}}}
return state;},findReExpander:function(direction){var me=this,c=Ext.Component,dockedItems=me.dockedItems.items,dockedItemCount=dockedItems.length,comp,i;if(me.collapseMode==='mini'){return;}
switch(direction){case c.DIRECTION_TOP:case c.DIRECTION_BOTTOM:for(i=0;i<dockedItemCount;i++){comp=dockedItems[i];if(!comp.hidden){if(comp.isHeader&&(!comp.dock||comp.dock==='top'||comp.dock==='bottom')){return comp;}}}
break;case c.DIRECTION_LEFT:case c.DIRECTION_RIGHT:for(i=0;i<dockedItemCount;i++){comp=dockedItems[i];if(!comp.hidden){if(comp.isHeader&&(comp.dock==='left'||comp.dock==='right')){return comp;}}}
break;default:throw('Panel#findReExpander must be passed a valid collapseDirection');}},getReExpander:function(direction){var me=this,collapseDir=direction||me.collapseDirection,reExpander=me.reExpander||me.findReExpander(collapseDir);me.expandDirection=me.getOppositeDirection(collapseDir);if(!reExpander){me.reExpander=reExpander=me.createReExpander(collapseDir,{dock:collapseDir,cls:Ext.baseCSSPrefix+'docked '+me.baseCls+'-'+me.ui+'-collapsed',isCollapsedExpander:true});me.dockedItems.insert(0,reExpander);}
return reExpander;},createReExpander:function(direction,defaults){var me=this,isLeft=direction==='left',isRight=direction==='right',isVertical=isLeft||isRight,result=Ext.apply({hideMode:'offsets',title:me.title||'&#160;',titleAlign:me.titleAlign,orientation:isVertical?'vertical':'horizontal',textCls:me.headerTextCls,icon:me.icon,iconCls:me.iconCls,glyph:me.glyph,baseCls:me.self.prototype.baseCls+'-header',ui:me.ui,frame:me.frame&&me.frameHeader,ignoreParentFrame:me.frame||me.overlapHeader,indicateDrag:me.draggable,collapseImmune:true,ownerCt:me.ownerCt,ownerLayout:me.componentLayout,margin:me.margin},defaults);if(me.collapseMode==='mini'){if(isVertical){result.width=1;}else{result.height=1;}}
if(!me.hideCollapseTool){if(isLeft||(isRight&&me.isPlaceHolderCollapse())){result.titlePosition=1;}
result.tools=[{xtype:'tool',type:'expand-'+me.getOppositeDirection(direction),uiCls:['top'],handler:me.toggleCollapse,scope:me}];}
result=new Ext.panel.Header(result);result.addClsWithUI(me.getHeaderCollapsedClasses(result));return result;},getHeaderCollapsedClasses:function(header){var me=this,collapsedCls=me.collapsedCls,collapsedClasses;collapsedClasses=[collapsedCls,collapsedCls+'-'+header.getDockName()];if(me.border&&(!me.frame||(me.frame&&Ext.supports.CSS3BorderRadius))){collapsedClasses.push(collapsedCls+'-border-'+header.getDockName());}
return collapsedClasses;},beginCollapse:function(){var me=this,lastBox=me.lastBox,rendered=me.rendered,collapseMemento=me.collapseMemento||(me.collapseMemento=new Ext.util.Memento(me)),sizeModel=me.getSizeModel(),header=me.header,reExpander;collapseMemento.capture(['height','minHeight','width','minWidth']);if(lastBox){collapseMemento.capture(me.restoreDimension(),lastBox,'last.');}
if(me.collapsedVertical()){if(sizeModel.width.shrinkWrap){me.width=rendered?me.getWidth():me.width||me.minWidth||100;}
delete me.height;me.minHeight=0;}else if(me.collapsedHorizontal()){if(sizeModel.height.shrinkWrap){me.height=rendered?me.getHeight():me.height||me.minHeight||100;}
delete me.width;me.minWidth=0;}
if(me.ownerCt){me.ownerCt.getLayout().beginCollapse(me);}
if(!me.isPlaceHolderCollapse()&&header!==false){if(header===(reExpander=me.getReExpander())){header.collapseImmune=true;header.getHierarchyState().collapseImmune=true;header.addClsWithUI(me.getHeaderCollapsedClasses(header));if(header.rendered){header.updateFrame();}}else if(reExpander.el){reExpander.el.show();reExpander.hidden=false;}}
if(me.resizer){me.resizer.disable();}},beginExpand:function(){var me=this,lastBox=me.lastBox,collapseMemento=me.collapseMemento,restoreDimension=this.restoreDimension(),header=me.header,reExpander;if(collapseMemento){collapseMemento.restore(['minHeight','minWidth',restoreDimension]);if(lastBox){collapseMemento.restore(restoreDimension,true,lastBox,'last.');}}
if(me.ownerCt){me.ownerCt.getLayout().beginExpand(me);}
if(!me.isPlaceHolderCollapse()&&header!==false){if(header===(reExpander=me.getReExpander())){delete header.collapseImmune;delete header.getHierarchyState().collapseImmune;header.removeClsWithUI(me.getHeaderCollapsedClasses(header));if(header.rendered){header.expanding=true;header.updateFrame();delete header.expanding;}}else{reExpander.hidden=true;reExpander.el.hide();}}
if(me.resizer){me.resizer.enable();}},collapse:function(direction,animate){var me=this,collapseDir=direction||me.collapseDirection,ownerCt=me.ownerCt;if(me.isCollapsingOrExpanding){return me;}
if(arguments.length<2){animate=me.animCollapse;}
if(me.collapsed||me.fireEvent('beforecollapse',me,direction,animate)===false){return me;}
if(ownerCt&&me.isPlaceHolderCollapse()){return me.placeholderCollapse(direction,animate);}
me.collapsed=collapseDir;me.beginCollapse();me.getHierarchyState().collapsed=true;me.fireHierarchyEvent('collapse');return me.doCollapseExpand(1,animate);},doCollapseExpand:function(flags,animate){var me=this,originalAnimCollapse=me.animCollapse,ownerLayout=me.ownerLayout;me.animCollapse=animate;me.isCollapsingOrExpanding=flags;if(animate){me.addCls(Ext.baseCSSPrefix+'animating-size');}
if(ownerLayout&&!animate){ownerLayout.onContentChange(me);}else{me.updateLayout({isRoot:true});}
me.animCollapse=originalAnimCollapse;return me;},afterCollapse:function(animated){var me=this,ownerLayout=me.ownerLayout;me.isCollapsingOrExpanding=0;me.updateCollapseTool();if(animated){me.removeCls(Ext.baseCSSPrefix+'animating-size');}
if(ownerLayout&&animated){ownerLayout.onContentChange(me);}
me.setHiddenDocked();me.fireEvent('collapse',me);},setHiddenDocked:function(){var me=this,toHide=me.hiddenOnCollapse,items=me.getDockedItems(),len=items.length,i=0,item,reExpander;if(me.header!==false){reExpander=me.getReExpander();}
toHide.add(me.body);for(;i<len;i++){item=items[i];if(item&&item!==reExpander&&item.el){toHide.add(item.el);}}
toHide.setStyle('visibility','hidden');},restoreHiddenDocked:function(){var toShow=this.hiddenOnCollapse;toShow.setStyle('visibility','');toShow.clear();},getPlaceholder:function(direction){var me=this,collapseDir=direction||me.collapseDirection,listeners=null,placeholder=me.placeholder,floatable=me.floatable,titleCollapse=me.titleCollapse;if(!placeholder){if(floatable||(me.collapsible&&titleCollapse)){listeners={click:{fn:(!titleCollapse&&floatable)?me.floatCollapsedPanel:me.toggleCollapse,element:'el',scope:me}};}
me.placeholder=placeholder=Ext.widget(me.createReExpander(collapseDir,{id:me.id+'-placeholder',listeners:listeners}));}
if(!placeholder.placeholderFor){if(!placeholder.isComponent){me.placeholder=placeholder=me.lookupComponent(placeholder);}
Ext.applyIf(placeholder,{margins:me.margins,placeholderFor:me});placeholder.addCls([Ext.baseCSSPrefix+'region-collapsed-placeholder',Ext.baseCSSPrefix+'region-collapsed-'+collapseDir+'-placeholder',me.collapsedCls]);}
return placeholder;},placeholderCollapse:function(direction,animate){var me=this,ownerCt=me.ownerCt,collapseDir=direction||me.collapseDirection,floatCls=Ext.baseCSSPrefix+'border-region-slide-in',placeholder=me.getPlaceholder(collapseDir),slideInDirection;me.isCollapsingOrExpanding=1;me.setHiddenState(true);me.collapsed=collapseDir;if(placeholder.rendered){if(placeholder.el.dom.parentNode!==me.el.dom.parentNode){me.el.dom.parentNode.insertBefore(placeholder.el.dom,me.el.dom);}
placeholder.hidden=false;placeholder.el.show();ownerCt.updateLayout();}else{ownerCt.insert(ownerCt.items.indexOf(me),placeholder);}
if(me.rendered){me.el.setVisibilityMode(me.placeholderCollapseHideMode);if(animate){me.el.addCls(floatCls);placeholder.el.hide();slideInDirection=me.convertCollapseDir(collapseDir);me.el.slideOut(slideInDirection,{preserveScroll:true,duration:Ext.Number.from(animate,Ext.fx.Anim.prototype.duration),listeners:{afteranimate:function(){me.el.removeCls(floatCls);placeholder.el.show().setStyle('display','none').slideIn(slideInDirection,{easing:'linear',duration:100,listeners:{afteranimate:function(){placeholder.focus();me.isCollapsingOrExpanding=0;me.fireEvent('collapse',me);}}});}}});}else{me.el.hide();me.isCollapsingOrExpanding=0;me.fireEvent('collapse',me);}}else{me.isCollapsingOrExpanding=0;if(!me.preventCollapseFire){me.fireEvent('collapse',me);}}
return me;},floatCollapsedPanel:function(){var me=this,placeholder=me.placeholder,ps=placeholder.getSize(),myBox,floatCls=Ext.baseCSSPrefix+'border-region-slide-in',collapsed=me.collapsed,layoutOwner=me.ownerCt||me,slideDirection;if(me.isSliding){return;}
if(me.el.hasCls(floatCls)){me.slideOutFloatedPanel();return;}
me.isSliding=true;placeholder.el.hide();placeholder.hidden=true;me.el.show();me.setHiddenState(false);me.collapsed=false;layoutOwner.updateLayout();myBox=me.getBox(false,true);placeholder.el.show();placeholder.hidden=false;me.el.hide();me.setHiddenState(true);me.collapsed=collapsed;layoutOwner.updateLayout();me.slideOutTask=me.slideOutTask||new Ext.util.DelayedTask(me.slideOutFloatedPanel,me);placeholder.el.on('mouseleave',me.onMouseLeaveFloated,me);me.el.on('mouseleave',me.onMouseLeaveFloated,me);placeholder.el.on('mouseenter',me.onMouseEnterFloated,me);me.el.on('mouseenter',me.onMouseEnterFloated,me);me.el.addCls(floatCls);me.floated=true;if(me.collapseTool){me.collapseTool.el.hide();}
switch(me.collapsed){case'top':me.setLocalXY(myBox.x,myBox.y+ps.height-1);break;case'right':me.setLocalXY(myBox.x-ps.width+1,myBox.y);break;case'bottom':me.setLocalXY(myBox.x,myBox.y-ps.height+1);break;case'left':me.setLocalXY(myBox.x+ps.width-1,myBox.y);break;}
slideDirection=me.convertCollapseDir(me.collapsed);me.floatedFromCollapse=me.collapsed;me.collapsed=false;me.setHiddenState(false);me.el.slideIn(slideDirection,{preserveScroll:true,duration:Ext.Number.from(me.animCollapse,Ext.fx.Anim.prototype.duration),listeners:{afteranimate:function(){me.isSliding=false;me.fireEvent('float',me);}}});},onMouseLeaveFloated:function(e){this.slideOutTask.delay(500);},onMouseEnterFloated:function(e){this.slideOutTask.cancel();},isLayoutRoot:function(){if(this.floatedFromCollapse){return true;}
return this.callParent();},slideOutFloatedPanel:function(){var me=this,compEl=this.el,collapseDirection;if(me.isSliding||me.isDestroyed){return;}
me.isSliding=true;me.floated=false;me.slideOutFloatedPanelBegin();if(typeof me.collapsed=='string'){collapseDirection=me.convertCollapseDir(me.collapsed);}
compEl.slideOut(collapseDirection,{preserveScroll:true,duration:Ext.Number.from(me.animCollapse,Ext.fx.Anim.prototype.duration),listeners:{afteranimate:function(){me.slideOutFloatedPanelEnd();me.el.removeCls(Ext.baseCSSPrefix+'border-region-slide-in');}}});},slideOutFloatedPanelBegin:function(){var me=this,placeholderEl=me.placeholder.el,el=me.el;me.collapsed=me.floatedFromCollapse;me.setHiddenState(true);me.floatedFromCollapse=null;placeholderEl.un('mouseleave',me.onMouseLeaveFloated,me);el.un('mouseleave',me.onMouseLeaveFloated,me);placeholderEl.un('mouseenter',me.onMouseEnterFloated,me);el.un('mouseenter',me.onMouseEnterFloated,me);},slideOutFloatedPanelEnd:function(){var me=this;if(me.collapseTool){me.collapseTool.el.show();}
me.slideOutTask.cancel();me.isSliding=false;me.fireEvent('unfloat',me);},expand:function(animate){var me=this;if(me.isCollapsingOrExpanding){return me;}
if(!arguments.length){animate=me.animCollapse;}
if(!me.collapsed&&!me.floatedFromCollapse){return me;}
if(me.fireEvent('beforeexpand',me,animate)===false){return me;}
delete this.getHierarchyState().collapsed;if(me.isPlaceHolderCollapse()){return me.placeholderExpand(animate);}
me.restoreHiddenDocked();me.beginExpand();me.collapsed=false;return me.doCollapseExpand(2,animate);},placeholderExpand:function(animate){var me=this,collapseDir=me.collapsed,floatCls=Ext.baseCSSPrefix+'border-region-slide-in',finalPos,floatedPos,center=me.ownerLayout?me.ownerLayout.centerRegion:null;if(Ext.AbstractComponent.layoutSuspendCount){animate=false;}
if(me.floatedFromCollapse){floatedPos=me.getPosition(true);me.slideOutFloatedPanelBegin();me.slideOutFloatedPanelEnd();me.floated=false;}
if(animate){Ext.suspendLayouts();me.placeholder.hide();me.el.show();me.collapsed=false;me.setHiddenState(false);if(center&&!floatedPos){center.hidden=true;}
Ext.resumeLayouts(true);center.hidden=false;me.el.addCls(floatCls);me.isCollapsingOrExpanding=2;if(floatedPos){finalPos=me.getXY();me.setLocalXY(floatedPos[0],floatedPos[1]);me.setXY([finalPos[0],finalPos[1]],{duration:Ext.Number.from(animate,Ext.fx.Anim.prototype.duration),listeners:{afteranimate:function(){me.el.removeCls(floatCls);me.isCollapsingOrExpanding=0;me.fireEvent('expand',me);}}});}
else{me.el.hide();me.placeholder.el.show();me.placeholder.hidden=false;me.setHiddenState(false);me.el.slideIn(me.convertCollapseDir(collapseDir),{preserveScroll:true,duration:Ext.Number.from(animate,Ext.fx.Anim.prototype.duration),listeners:{afteranimate:function(){me.el.removeCls(floatCls);me.placeholder.hide();me.updateLayout();me.isCollapsingOrExpanding=0;me.fireEvent('expand',me);}}});}}else{me.floated=me.collapsed=false;me.el.removeCls(floatCls);Ext.suspendLayouts();me.placeholder.hide();me.show();Ext.resumeLayouts(true);me.fireEvent('expand',me);}
return me;},afterExpand:function(animated){var me=this,ownerLayout=me.ownerLayout;me.isCollapsingOrExpanding=0;me.updateCollapseTool();if(animated){me.removeCls(Ext.baseCSSPrefix+'animating-size');}
if(ownerLayout&&animated){ownerLayout.onContentChange(me);}
me.fireEvent('expand',me);me.fireHierarchyEvent('expand');},setBorder:function(border,targetEl){if(targetEl){return;}
var me=this,header=me.header;if(!border){border=0;}else if(border===true){border='1px';}else{border=me.unitizeBox(border);}
if(header){if(header.isHeader){header.setBorder(border);}else{header.border=border;}}
if(me.rendered&&me.bodyBorder!==false){me.body.setStyle('border-width',border);}
me.updateLayout();me.border=border;},toggleCollapse:function(){return(this.collapsed||this.floatedFromCollapse)?this.expand():this.collapse();},getKeyMap:function(){return this.keyMap||(this.keyMap=new Ext.util.KeyMap(Ext.apply({target:this.el},this.keys)));},initDraggable:function(){if(this.simpleDrag){this.initSimpleDraggable();}
else{this.dd=new Ext.panel.DD(this,Ext.isBoolean(this.draggable)?null:this.draggable);}},initSimpleDraggable:function(){var me=this,ddConfig,dd;if(!me.header){me.updateHeader(true);}
if(me.header){ddConfig=Ext.applyIf({el:me.el,delegate:'#'+Ext.escapeId(me.header.id)},me.draggable);if(me.constrain||me.constrainHeader){ddConfig.constrain=me.constrain;ddConfig.constrainDelegate=me.constrainHeader;ddConfig.constrainTo=me.constrainTo||me.container;}
dd=me.dd=new Ext.util.ComponentDragger(this,ddConfig);me.relayEvents(dd,['dragstart','drag','dragend']);if(me.maximized){dd.disable();}}},ghostTools:function(){var tools=[],header=this.header,headerTools=header?header.query('tool[hidden=false]'):[],t,tLen,tool;if(headerTools.length){t=0;tLen=headerTools.length;for(;t<tLen;t++){tool=headerTools[t];tools.push({type:tool.type});}}else{tools=[{type:'placeholder'}];}
return tools;},ghost:function(cls){var me=this,ghostPanel=me.ghostPanel,box=me.getBox(),header;if(!ghostPanel){ghostPanel=new Ext.panel.Panel({renderTo:Ext.getBody(),floating:{shadow:false},frame:me.frame&&!me.alwaysFramed,alwaysFramed:me.alwaysFramed,overlapHeader:me.overlapHeader,headerPosition:me.headerPosition,baseCls:me.baseCls,cls:me.baseCls+'-ghost '+(cls||'')});me.ghostPanel=ghostPanel;}else{ghostPanel.el.show();}
me.ghostPanel.hidden=false;ghostPanel.floatParent=me.floatParent;if(me.floating){ghostPanel.zIndexManager.assignZIndices();}else{ghostPanel.toFront();}
if(!(me.preventHeader||(me.header===false))){header=ghostPanel.header;if(header){header.suspendLayouts();Ext.Array.forEach(header.query('tool'),header.remove,header);header.resumeLayouts();}
ghostPanel.addTool(me.ghostTools());ghostPanel.setTitle(me.title);if(me.iconCls){ghostPanel.setIconCls(me.iconCls);}else if(me.icon){ghostPanel.setIcon(me.icon);}else if(me.glyph){ghostPanel.setGlyph(me.glyph);}
ghostPanel.header.addCls(Ext.baseCSSPrefix+'header-ghost');}
ghostPanel.setPagePosition(box.x,box.y);ghostPanel.setSize(box.width,box.height);me.el.hide();return ghostPanel;},unghost:function(show,matchPosition){var me=this;if(!me.ghostPanel){return;}
if(show!==false){me.el.show();if(matchPosition!==false){me.setPagePosition(me.ghostPanel.getXY());if(me.hideMode=='offsets'){delete me.el.hideModeStyles;}}
Ext.defer(me.focus,10,me);}
me.ghostPanel.el.hide();me.ghostPanel.hidden=true;},beginDrag:function(){if(this.floatingDescendants){this.floatingDescendants.hide();}},endDrag:function(){if(this.floatingDescendants){this.floatingDescendants.show();}},initResizable:function(){this.callParent(arguments);if(this.collapsed){this.resizer.disable();}},convertCollapseDir:function(collapseDir){return collapseDir.substr(0,1);}},function(){this.prototype.animCollapse=Ext.enableFx;});Ext.define('Ext.grid.locking.HeaderContainer',{extend:'Ext.grid.header.Container',requires:['Ext.grid.ColumnManager'],constructor:function(lockable){var me=this,events,event,eventNames=[],lockedGrid=lockable.lockedGrid,normalGrid=lockable.normalGrid;me.lockable=lockable;me.callParent();lockedGrid.columnManager.rootColumns=normalGrid.columnManager.rootColumns=lockable.columnManager=me.columnManager=new Ext.grid.ColumnManager(lockedGrid.headerCt,normalGrid.headerCt);events=lockedGrid.headerCt.events;for(event in events){if(events.hasOwnProperty(event)){eventNames.push(event);}}
me.relayEvents(lockedGrid.headerCt,eventNames);me.relayEvents(normalGrid.headerCt,eventNames);},getRefItems:function(){return this.lockable.lockedGrid.headerCt.getRefItems().concat(this.lockable.normalGrid.headerCt.getRefItems());},getGridColumns:function(){return this.lockable.lockedGrid.headerCt.getGridColumns().concat(this.lockable.normalGrid.headerCt.getGridColumns());},getColumnsState:function(){var me=this,locked=me.lockable.lockedGrid.headerCt.getColumnsState(),normal=me.lockable.normalGrid.headerCt.getColumnsState();return locked.concat(normal);},applyColumnsState:function(columns){var me=this,lockedGrid=me.lockable.lockedGrid,lockedHeaderCt=lockedGrid.headerCt,normalHeaderCt=me.lockable.normalGrid.headerCt,lockedCols=Ext.Array.toValueMap(lockedHeaderCt.items.items,'headerId'),normalCols=Ext.Array.toValueMap(normalHeaderCt.items.items,'headerId'),locked=[],normal=[],lockedWidth=1,length=columns.length,i,existing,lockedDefault,col;for(i=0;i<length;i++){col=columns[i];lockedDefault=lockedCols[col.id];existing=lockedDefault||normalCols[col.id];if(existing){if(existing.applyColumnState){existing.applyColumnState(col);}
if(existing.locked===undefined){existing.locked=!!lockedDefault;}
if(existing.locked){locked.push(existing);if(!existing.hidden&&typeof existing.width=='number'){lockedWidth+=existing.width;}}else{normal.push(existing);}}}
if(locked.length+normal.length==lockedHeaderCt.items.getCount()+normalHeaderCt.items.getCount()){lockedHeaderCt.removeAll(false);normalHeaderCt.removeAll(false);lockedHeaderCt.add(locked);normalHeaderCt.add(normal);lockedGrid.setWidth(lockedWidth);}}});Ext.define('Ext.grid.column.Number',{extend:'Ext.grid.column.Column',alias:['widget.numbercolumn'],requires:['Ext.util.Format'],alternateClassName:'Ext.grid.NumberColumn',format:'0,000.00',defaultRenderer:function(value){return Ext.util.Format.number(value,this.format);}});Ext.define('Ext.menu.Menu',{extend:'Ext.panel.Panel',alias:'widget.menu',requires:['Ext.layout.container.Fit','Ext.layout.container.VBox','Ext.menu.CheckItem','Ext.menu.Item','Ext.menu.KeyNav','Ext.menu.Manager','Ext.menu.Separator'],enableKeyNav:true,allowOtherMenus:false,ariaRole:'menu',floating:true,constrain:true,hidden:true,hideMode:'visibility',ignoreParentClicks:false,isMenu:true,showSeparator:true,minWidth:undefined,defaultMinWidth:120,initComponent:function(){var me=this,prefix=Ext.baseCSSPrefix,cls=[prefix+'menu'],bodyCls=me.bodyCls?[me.bodyCls]:[],isFloating=me.floating!==false;me.addEvents('click','mouseenter','mouseleave','mouseover');Ext.menu.Manager.register(me);if(me.plain){cls.push(prefix+'menu-plain');}
me.cls=cls.join(' ');bodyCls.push(prefix+'menu-body',Ext.dom.Element.unselectableCls);me.bodyCls=bodyCls.join(' ');if(!me.layout){me.layout={type:'vbox',align:'stretchmax',overflowHandler:'Scroller'};}
if(isFloating){if(me.minWidth===undefined){me.minWidth=me.defaultMinWidth;}}else{me.hidden=!!me.initialConfig.hidden;me.constrain=false;}
me.callParent(arguments);},registerWithOwnerCt:function(){if(this.floating){this.ownerCt=null;Ext.WindowManager.register(this);}},initHierarchyEvents:Ext.emptyFn,isVisible:function(){return this.callParent();},getHierarchyState:function(){var result=this.callParent();result.hidden=this.hidden;return result;},beforeRender:function(){this.callParent(arguments);if(!this.getSizeModel().width.shrinkWrap){this.layout.align='stretch';}},onBoxReady:function(){var me=this;me.callParent(arguments);if(me.showSeparator){me.iconSepEl=me.layout.getElementTarget().insertFirst({cls:Ext.baseCSSPrefix+'menu-icon-separator',html:'&#160;'});}
me.mon(me.el,{click:me.onClick,mouseover:me.onMouseOver,scope:me});me.mouseMonitor=me.el.monitorMouseLeave(100,me.onMouseLeave,me);if(me.enableKeyNav){me.keyNav=new Ext.menu.KeyNav({target:me,keyMap:me.getKeyMap()});}},getRefOwner:function(){return this.parentMenu||this.ownerButton||this.callParent(arguments);},canActivateItem:function(item){return item&&!item.isDisabled()&&item.isVisible()&&(item.canActivate||item.getXTypes().indexOf('menuitem')<0);},deactivateActiveItem:function(andBlurFocusedItem){var me=this,activeItem=me.activeItem,focusedItem=me.focusedItem;if(activeItem){activeItem.deactivate();if(!activeItem.activated){delete me.activeItem;}}
if(focusedItem&&andBlurFocusedItem){focusedItem.blur();delete me.focusedItem;}},getFocusEl:function(){return this.focusedItem||this.el;},hide:function(){this.deactivateActiveItem(true);this.callParent(arguments);},getItemFromEvent:function(e){return this.getChildByElement(e.getTarget());},lookupComponent:function(cmp){var me=this;if(typeof cmp=='string'){cmp=me.lookupItemFromString(cmp);}else if(Ext.isObject(cmp)){cmp=me.lookupItemFromObject(cmp);}
cmp.minWidth=cmp.minWidth||me.minWidth;return cmp;},lookupItemFromObject:function(cmp){var me=this,prefix=Ext.baseCSSPrefix,cls;if(!cmp.isComponent){if(!cmp.xtype){cmp=Ext.create('Ext.menu.'+(Ext.isBoolean(cmp.checked)?'Check':'')+'Item',cmp);}else{cmp=Ext.ComponentManager.create(cmp,cmp.xtype);}}
if(cmp.isMenuItem){cmp.parentMenu=me;}
if(!cmp.isMenuItem&&!cmp.dock){cls=[prefix+'menu-item-cmp'];if(!me.plain&&(cmp.indent!==false||cmp.iconCls==='no-icon')){cls.push(prefix+'menu-item-indent');}
if(cmp.rendered){cmp.el.addCls(cls);}else{cmp.cls=(cmp.cls||'')+' '+cls.join(' ');}}
return cmp;},lookupItemFromString:function(cmp){return(cmp=='separator'||cmp=='-')?new Ext.menu.Separator():new Ext.menu.Item({canActivate:false,hideOnClick:false,plain:true,text:cmp});},onClick:function(e){var me=this,item;if(me.disabled){e.stopEvent();return;}
item=(e.type==='click')?me.getItemFromEvent(e):me.activeItem;if(item&&item.isMenuItem){if(!item.menu||!me.ignoreParentClicks){item.onClick(e);}else{e.stopEvent();}}
if(!item||item.disabled){item=undefined;}
me.fireEvent('click',me,item,e);},onDestroy:function(){var me=this;Ext.menu.Manager.unregister(me);me.parentMenu=me.ownerButton=null;if(me.rendered){me.el.un(me.mouseMonitor);Ext.destroy(me.keyNav);me.keyNav=null;}
me.callParent(arguments);},onMouseLeave:function(e){var me=this;me.deactivateActiveItem();if(me.disabled){return;}
me.fireEvent('mouseleave',me,e);},onMouseOver:function(e){var me=this,fromEl=e.getRelatedTarget(),mouseEnter=!me.el.contains(fromEl),item=me.getItemFromEvent(e),parentMenu=me.parentMenu,parentItem=me.parentItem;if(mouseEnter&&parentMenu){parentMenu.setActiveItem(parentItem);parentItem.cancelDeferHide();parentMenu.mouseMonitor.mouseenter();}
if(me.disabled){return;}
if(item&&!item.activated){me.setActiveItem(item);if(item.activated&&item.expandMenu){item.expandMenu();}}
if(mouseEnter){me.fireEvent('mouseenter',me,e);}
me.fireEvent('mouseover',me,item,e);},setActiveItem:function(item){var me=this;if(item&&(item!=me.activeItem)){me.deactivateActiveItem();if(me.canActivateItem(item)){if(item.activate){item.activate();if(item.activated){me.activeItem=item;me.focusedItem=item;me.focus();}}else{item.focus();me.focusedItem=item;}}
item.el.scrollIntoView(me.layout.getRenderTarget());}},showBy:function(cmp,pos,off){var me=this;me.callParent(arguments);if(!me.hidden){me.setVerticalPosition();}
return me;},beforeShow:function(){var me=this,viewHeight;if(me.floating){me.savedMaxHeight=me.maxHeight;viewHeight=me.container.getViewSize().height;me.maxHeight=Math.min(me.maxHeight||viewHeight,viewHeight);}
me.callParent(arguments);},afterShow:function(){var me=this;me.callParent(arguments);if(me.floating){me.maxHeight=me.savedMaxHeight;}},setVerticalPosition:function(){var me=this,max,y=me.getY(),returnY=y,height=me.getHeight(),viewportHeight=Ext.Element.getViewportHeight().height,parentEl=me.el.parent(),viewHeight=parentEl.getViewSize().height,normalY=y-parentEl.getScroll().top;parentEl=null;if(me.floating){max=me.maxHeight?me.maxHeight:viewHeight-normalY;if(height>viewHeight){returnY=y-normalY;}else if(max<height){returnY=y-(height-max);}else if((y+height)>viewportHeight){returnY=viewportHeight-height;}}
me.setY(returnY);}});Ext.define('Ext.grid.column.Boolean',{extend:'Ext.grid.column.Column',alias:['widget.booleancolumn'],alternateClassName:'Ext.grid.BooleanColumn',trueText:'true',falseText:'false',undefinedText:'&#160;',defaultRenderer:function(value){if(value===undefined){return this.undefinedText;}
if(!value||value==='false'){return this.falseText;}
return this.trueText;}});Ext.define('Ext.grid.column.Date',{extend:'Ext.grid.column.Column',alias:['widget.datecolumn'],requires:['Ext.Date'],alternateClassName:'Ext.grid.DateColumn',initComponent:function(){if(!this.format){this.format=Ext.Date.defaultFormat;}
this.callParent(arguments);},defaultRenderer:function(value){return Ext.util.Format.date(value,this.format);}});Ext.define('Ext.grid.column.CheckColumn',{extend:'Ext.grid.column.Column',alternateClassName:'Ext.ux.CheckColumn',alias:'widget.checkcolumn',align:'center',stopSelection:true,tdCls:Ext.baseCSSPrefix+'grid-cell-checkcolumn',innerCls:Ext.baseCSSPrefix+'grid-cell-inner-checkcolumn',clickTargetName:'el',constructor:function(){this.addEvents('beforecheckchange','checkchange');this.scope=this;this.callParent(arguments);},processEvent:function(type,view,cell,recordIndex,cellIndex,e,record,row){var me=this,key=type==='keydown'&&e.getKey(),mousedown=type=='mousedown';if(!me.disabled&&(mousedown||(key==e.ENTER||key==e.SPACE))){var dataIndex=me.dataIndex,checked=!record.get(dataIndex);if(me.fireEvent('beforecheckchange',me,recordIndex,checked)!==false){record.set(dataIndex,checked);me.fireEvent('checkchange',me,recordIndex,checked);if(mousedown){e.stopEvent();}
if(!me.stopSelection){view.selModel.selectByPosition({row:recordIndex,column:cellIndex});}
return false;}else{return!me.stopSelection;}}else{return me.callParent(arguments);}},onEnable:function(silent){var me=this;me.callParent(arguments);me.up('tablepanel').el.select('.'+Ext.baseCSSPrefix+'grid-cell-'+me.id).removeCls(me.disabledCls);if(!silent){me.fireEvent('enable',me);}},onDisable:function(silent){var me=this;me.callParent(arguments);me.up('tablepanel').el.select('.'+Ext.baseCSSPrefix+'grid-cell-'+me.id).addCls(me.disabledCls);if(!silent){me.fireEvent('disable',me);}},renderer:function(value,meta){var cssPrefix=Ext.baseCSSPrefix,cls=[cssPrefix+'grid-checkcolumn'];if(this.disabled){meta.tdCls+=' '+this.disabledCls;}
if(value){cls.push(cssPrefix+'grid-checkcolumn-checked');}
return'<img class="'+cls.join(' ')+'" src="'+Ext.BLANK_IMAGE_URL+'"/>';}});Ext.define('Ext.view.BoundListKeyNav',{extend:'Ext.util.KeyNav',requires:'Ext.view.BoundList',constructor:function(el,config){var me=this;me.boundList=config.boundList;me.callParent([el,Ext.apply({},config,me.defaultHandlers)]);},defaultHandlers:{up:function(){var me=this,boundList=me.boundList,allItems=boundList.all,oldItem=boundList.highlightedItem,oldItemIdx=oldItem?boundList.indexOf(oldItem):-1,newItemIdx=oldItemIdx>0?oldItemIdx-1:allItems.getCount()-1;me.highlightAt(newItemIdx);},down:function(){var me=this,boundList=me.boundList,allItems=boundList.all,oldItem=boundList.highlightedItem,oldItemIdx=oldItem?boundList.indexOf(oldItem):-1,newItemIdx=oldItemIdx<allItems.getCount()-1?oldItemIdx+1:0;me.highlightAt(newItemIdx);},pageup:function(){},pagedown:function(){},home:function(){this.highlightAt(0);},end:function(){var me=this;me.highlightAt(me.boundList.all.getCount()-1);},enter:function(e){this.selectHighlighted(e);}},highlightAt:function(index){var boundList=this.boundList,item=boundList.all.item(index);if(item){item=item.dom;boundList.highlightItem(item);boundList.getTargetEl().scrollChildIntoView(item,false);}},selectHighlighted:function(e){var me=this,boundList=me.boundList,highlighted=boundList.highlightedItem,selModel=boundList.getSelectionModel();if(highlighted){selModel.selectWithEvent(boundList.getRecord(highlighted),e);}}});Ext.define('Ext.picker.Time',{extend:'Ext.view.BoundList',alias:'widget.timepicker',requires:['Ext.data.Store','Ext.Date'],increment:15,format:"g:i A",displayField:'disp',initDate:[2008,0,1],componentCls:Ext.baseCSSPrefix+'timepicker',loadMask:false,initComponent:function(){var me=this,dateUtil=Ext.Date,clearTime=dateUtil.clearTime,initDate=me.initDate;me.absMin=clearTime(new Date(initDate[0],initDate[1],initDate[2]));me.absMax=dateUtil.add(clearTime(new Date(initDate[0],initDate[1],initDate[2])),'mi',(24*60)-1);me.store=me.createStore();me.store.addFilter(me.rangeFilter=new Ext.util.Filter({id:'time-picker-filter'}),false);me.updateList();me.callParent();},setMinValue:function(value){this.minValue=value;this.updateList();},setMaxValue:function(value){this.maxValue=value;this.updateList();},normalizeDate:function(date){var initDate=this.initDate;date.setFullYear(initDate[0],initDate[1],initDate[2]);return date;},updateList:function(){var me=this,min=me.normalizeDate(me.minValue||me.absMin),max=me.normalizeDate(me.maxValue||me.absMax);me.rangeFilter.setFilterFn(function(record){var date=record.get('date');return date>=min&&date<=max;});me.store.filter();},createStore:function(){var me=this,utilDate=Ext.Date,times=[],min=me.absMin,max=me.absMax;while(min<=max){times.push({disp:utilDate.dateFormat(min,me.format),date:min});min=utilDate.add(min,'mi',me.increment);}
return new Ext.data.Store({fields:['disp','date'],data:times});},focusNode:function(rec){return false;}});Ext.define('Ext.window.Window',{extend:'Ext.panel.Panel',alternateClassName:'Ext.Window',requires:['Ext.util.ComponentDragger','Ext.util.Region','Ext.EventManager'],alias:'widget.window',baseCls:Ext.baseCSSPrefix+'window',resizable:true,draggable:true,constrain:false,constrainHeader:false,plain:false,minimizable:false,maximizable:false,minHeight:50,minWidth:50,expandOnShow:true,collapsible:false,closable:true,hidden:true,autoRender:true,hideMode:'offsets',floating:true,itemCls:Ext.baseCSSPrefix+'window-item',initialAlphaNum:/^[a-z0-9]/,overlapHeader:true,ignoreHeaderBorderManagement:true,alwaysFramed:true,isRootCfg:{isRoot:true},isWindow:true,initComponent:function(){var me=this;me.frame=false;me.callParent();me.addEvents('resize','maximize','minimize','restore');if(me.plain){me.addClsWithUI('plain');}
if(me.modal){me.ariaRole='dialog';}
me.addStateEvents(['maximize','restore','resize','dragend']);},getElConfig:function(){var me=this,elConfig;elConfig=me.callParent();elConfig.tabIndex=-1;return elConfig;},getState:function(){var me=this,state=me.callParent()||{},maximized=!!me.maximized,ghostBox=me.ghostBox,pos;state.maximized=maximized;if(maximized){pos=me.restorePos;}else if(ghostBox){pos=[ghostBox.x,ghostBox.y];}else{pos=me.getPosition();}
Ext.apply(state,{size:maximized?me.restoreSize:me.getSize(),pos:pos});return state;},applyState:function(state){var me=this;if(state){me.maximized=state.maximized;if(me.maximized){me.hasSavedRestore=true;me.restoreSize=state.size;me.restorePos=state.pos;}else{Ext.apply(me,{width:state.size.width,height:state.size.height,x:state.pos[0],y:state.pos[1]});}}},onRender:function(ct,position){var me=this;me.callParent(arguments);me.focusEl=me.el;if(me.maximizable){me.header.on({scope:me,dblclick:me.toggleMaximize});}},afterRender:function(){var me=this,header=me.header,keyMap;me.callParent();if(me.maximized){me.maximized=false;me.maximize();if(header){header.removeCls(header.indicateDragCls)}}
if(me.closable){keyMap=me.getKeyMap();keyMap.on(27,me.onEsc,me);}else{keyMap=me.keyMap;}
if(keyMap&&me.hidden){keyMap.disable();}},initDraggable:function(){this.initSimpleDraggable();},initResizable:function(){this.callParent(arguments);if(this.maximized){this.resizer.disable();}},onEsc:function(k,e){if(!Ext.FocusManager||!Ext.FocusManager.enabled||Ext.FocusManager.focusedCmp===this){e.stopEvent();this.close();}},beforeDestroy:function(){var me=this;if(me.rendered){delete this.animateTarget;me.hide();Ext.destroy(me.keyMap);}
me.callParent();},addTools:function(){var me=this;me.callParent();if(me.minimizable){me.addTool({type:'minimize',handler:Ext.Function.bind(me.minimize,me,[])});}
if(me.maximizable){me.addTool({type:'maximize',handler:Ext.Function.bind(me.maximize,me,[])});me.addTool({type:'restore',handler:Ext.Function.bind(me.restore,me,[]),hidden:true});}},getFocusEl:function(){return this.getDefaultFocus();},getDefaultFocus:function(){var me=this,result,defaultComp=me.defaultButton||me.defaultFocus,selector;if(defaultComp!==undefined){if(Ext.isNumber(defaultComp)){result=me.query('button')[defaultComp];}
else if(Ext.isString(defaultComp)){selector=defaultComp;if(selector.match(me.initialAlphaNum)){result=me.down('#'+selector);}
if(!result){result=me.down(selector);}}
else if(defaultComp.focus){result=defaultComp;}}
return result||me.el;},onFocus:function(){var me=this,focusDescendant;if((Ext.FocusManager&&Ext.FocusManager.enabled)||((focusDescendant=me.getDefaultFocus())===me)){me.callParent(arguments);}else{focusDescendant.focus();}},onShow:function(){var me=this;me.callParent(arguments);if(me.expandOnShow){me.expand(false);}
me.syncMonitorWindowResize();if(me.keyMap){me.keyMap.enable();}},doClose:function(){var me=this;if(me.hidden){me.fireEvent('close',me);if(me.closeAction=='destroy'){this.destroy();}}else{me.hide(me.animateTarget,me.doClose,me);}},afterHide:function(){var me=this;me.syncMonitorWindowResize();if(me.keyMap){me.keyMap.disable();}
me.callParent(arguments);},onWindowResize:function(){var me=this,sizeModel;if(me.maximized){me.fitContainer();}else{sizeModel=me.getSizeModel();if(sizeModel.width.natural||sizeModel.height.natural){me.updateLayout();}
me.doConstrain();}},minimize:function(){this.fireEvent('minimize',this);return this;},resumeHeaderLayout:function(changed){this.header.resumeLayouts(changed?this.isRootCfg:null);},afterCollapse:function(){var me=this,header=me.header,tools=me.tools;if(header&&me.maximizable){header.suspendLayouts();tools.maximize.hide();tools.restore.hide();this.resumeHeaderLayout(true);}
if(me.resizer){me.resizer.disable();}
me.callParent(arguments);},afterExpand:function(){var me=this,header=me.header,tools=me.tools,changed;if(header){header.suspendLayouts();if(me.maximized){tools.restore.show();changed=true;}else if(me.maximizable){tools.maximize.show();changed=true;}
this.resumeHeaderLayout(changed);}
if(me.resizer){me.resizer.enable();}
me.callParent(arguments);},maximize:function(animate){var me=this,header=me.header,tools=me.tools,changed;if(!me.maximized){me.expand(false);if(!me.hasSavedRestore){me.restoreSize=me.getSize();me.restorePos=me.getPosition(true);}
if(header){header.suspendLayouts();if(tools.maximize){tools.maximize.hide();changed=true;}
if(tools.restore){tools.restore.show();changed=true;}
if(me.collapseTool){me.collapseTool.hide();changed=true;}
me.resumeHeaderLayout(changed);}
me.maximized=true;me.el.disableShadow();if(me.dd){me.dd.disable();if(header){header.removeCls(header.indicateDragCls)}}
if(me.resizer){me.resizer.disable();}
me.el.addCls(Ext.baseCSSPrefix+'window-maximized');me.container.addCls(Ext.baseCSSPrefix+'window-maximized-ct');me.syncMonitorWindowResize();me.fitContainer(animate=(animate||!!me.animateTarget)?{callback:function(){me.fireEvent('maximize',me);}}:null);if(!animate){me.fireEvent('maximize',me);}}
return me;},restore:function(animate){var me=this,tools=me.tools,header=me.header,newBox=me.restoreSize,changed;if(me.maximized){me.hasSavedRestore=null;me.removeCls(Ext.baseCSSPrefix+'window-maximized');if(header){header.suspendLayouts();if(tools.restore){tools.restore.hide();changed=true;}
if(tools.maximize){tools.maximize.show();changed=true;}
if(me.collapseTool){me.collapseTool.show();changed=true;}
me.resumeHeaderLayout(changed);}
me.maximized=false;newBox.x=me.restorePos[0];newBox.y=me.restorePos[1];me.setBox(newBox,animate=(animate||!!me.animateTarget)?{callback:function(){me.el.enableShadow(true);me.fireEvent('restore',me);}}:null);me.restorePos=me.restoreSize=null;if(me.dd){me.dd.enable();if(header){header.addCls(header.indicateDragCls)}}
if(me.resizer){me.resizer.enable();}
me.container.removeCls(Ext.baseCSSPrefix+'window-maximized-ct');me.syncMonitorWindowResize();if(!animate){me.el.enableShadow(true);me.fireEvent('restore',me);}}
return me;},syncMonitorWindowResize:function(){var me=this,currentlyMonitoring=me._monitoringResize,yes=me.monitorResize||me.constrain||me.constrainHeader||me.maximized,veto=me.hidden||me.destroying||me.isDestroyed;if(yes&&!veto){if(!currentlyMonitoring){Ext.EventManager.onWindowResize(me.onWindowResize,me,{delay:1});me._monitoringResize=true;}}else if(currentlyMonitoring){Ext.EventManager.removeResizeListener(me.onWindowResize,me);me._monitoringResize=false;}},toggleMaximize:function(){return this[this.maximized?'restore':'maximize']();}});Ext.define('Ext.tip.Tip',{extend:'Ext.panel.Panel',alternateClassName:'Ext.Tip',minWidth:40,maxWidth:500,shadow:"sides",defaultAlign:"tl-bl?",constrainPosition:true,autoRender:true,hidden:true,baseCls:Ext.baseCSSPrefix+'tip',floating:{shadow:true,shim:true},focusOnToFront:false,closeAction:'hide',ariaRole:'tooltip',alwaysFramed:true,frameHeader:false,initComponent:function(){var me=this;me.floating=Ext.apply({},{shadow:me.shadow,constrain:me.constrainPosition},me.self.prototype.floating);me.callParent(arguments);me.constrain=me.constrain||me.constrainPosition;},showAt:function(xy){var me=this;this.callParent(arguments);if(me.isVisible()){me.setPagePosition(xy[0],xy[1]);if(me.constrainPosition||me.constrain){me.doConstrain();}
me.toFront(true);}},initDraggable:function(){var me=this;me.draggable={el:me.getDragEl(),delegate:me.header.el,constrain:me,constrainTo:me.el.dom.parentNode};Ext.Component.prototype.initDraggable.call(me);},ghost:undefined,unghost:undefined});Ext.define('Ext.grid.plugin.Editing',{alias:'editing.editing',extend:'Ext.AbstractPlugin',requires:['Ext.grid.column.Column','Ext.util.KeyNav'],mixins:{observable:'Ext.util.Observable'},clicksToEdit:2,triggerEvent:undefined,relayedEvents:['beforeedit','edit','validateedit','canceledit'],defaultFieldXType:'textfield',editStyle:'',constructor:function(config){var me=this;me.addEvents('beforeedit','edit','validateedit','canceledit');me.callParent(arguments);me.mixins.observable.constructor.call(me);me.on("edit",function(editor,e){me.fireEvent("afteredit",editor,e);});},init:function(grid){var me=this;me.grid=grid;me.view=grid.view;me.initEvents();me.mon(grid,{reconfigure:me.onReconfigure,scope:me,beforerender:{fn:me.onReconfigure,single:true,scope:me}});grid.relayEvents(me,me.relayedEvents);if(me.grid.ownerLockable){me.grid.ownerLockable.relayEvents(me,me.relayedEvents);}
grid.isEditable=true;grid.editingPlugin=grid.view.editingPlugin=me;},onReconfigure:function(){var grid=this.grid;grid=grid.ownerLockable?grid.ownerLockable:grid;this.initFieldAccessors(grid.getView().getGridColumns());},destroy:function(){var me=this,grid=me.grid;Ext.destroy(me.keyNav);me.clearListeners();if(grid){me.removeFieldAccessors(grid.columnManager.getColumns());grid.editingPlugin=grid.view.editingPlugin=me.grid=me.view=me.editor=me.keyNav=null;}},getEditStyle:function(){return this.editStyle;},initFieldAccessors:function(columns){if(columns.isGroupHeader){columns=columns.getGridColumns();}
else if(!Ext.isArray(columns)){columns=[columns];}
var me=this,c,cLen=columns.length,column;for(c=0;c<cLen;c++){column=columns[c];if(!column.getEditor){column.getEditor=function(record,defaultField){return me.getColumnField(this,defaultField);};}
if(!column.hasEditor){column.hasEditor=function(){return me.hasColumnField(this);};}
if(!column.setEditor){column.setEditor=function(field){me.setColumnField(this,field);};}}},removeFieldAccessors:function(columns){if(columns.isGroupHeader){columns=columns.getGridColumns();}
else if(!Ext.isArray(columns)){columns=[columns];}
var c,cLen=columns.length,column;for(c=0;c<cLen;c++){column=columns[c];column.getEditor=column.hasEditor=column.setEditor=null;}},getColumnField:function(columnHeader,defaultField){var field=columnHeader.field;if(!(field&&field.isFormField)){field=columnHeader.field=this.createColumnField(columnHeader,defaultField);}
return field;},hasColumnField:function(columnHeader){return!!columnHeader.field;},setColumnField:function(columnHeader,field){columnHeader.field=field;columnHeader.field=this.createColumnField(columnHeader);},createColumnField:function(columnHeader,defaultField){var field=columnHeader.field;if(!field&&columnHeader.editor){field=columnHeader.editor;columnHeader.editor=null;}
if(!field&&defaultField){field=defaultField;}
if(field){if(field.isFormField){field.column=columnHeader;}else{if(Ext.isString(field)){field={name:columnHeader.dataIndex,xtype:field,column:columnHeader};}else{field=Ext.apply({name:columnHeader.dataIndex,column:columnHeader},field);}
field=Ext.ComponentManager.create(field,this.defaultFieldXType);}
columnHeader.field=field;}
return field;},initEvents:function(){var me=this;me.initEditTriggers();me.initCancelTriggers();},initCancelTriggers:Ext.emptyFn,initEditTriggers:function(){var me=this,view=me.view;if(me.triggerEvent=='cellfocus'){me.mon(view,'cellfocus',me.onCellFocus,me);}else if(me.triggerEvent=='rowfocus'){me.mon(view,'rowfocus',me.onRowFocus,me);}else{if(view.getSelectionModel().isCellModel){view.onCellFocus=Ext.Function.bind(me.beforeViewCellFocus,me);}
me.mon(view,me.triggerEvent||('cell'+(me.clicksToEdit===1?'click':'dblclick')),me.onCellClick,me);}
me.initAddRemoveHeaderEvents()
view.on('render',me.initKeyNavHeaderEvents,me,{single:true});},beforeViewCellFocus:function(position){if(this.view.selModel.keyNavigation||!this.editing||!this.isCellEditable||!this.isCellEditable(position.row,position.columnHeader)){this.view.focusCell.apply(this.view,arguments);}},onRowFocus:function(record,row,rowIdx){this.startEdit(row,0);},onCellFocus:function(record,cell,position){this.startEdit(position.row,position.column);},onCellClick:function(view,cell,colIdx,record,row,rowIdx,e){if(!view.expanderSelector||!e.getTarget(view.expanderSelector)){this.startEdit(record,view.ownerCt.columnManager.getHeaderAtIndex(colIdx));}},initAddRemoveHeaderEvents:function(){var me=this;me.mon(me.grid.headerCt,{scope:me,add:me.onColumnAdd,remove:me.onColumnRemove,columnmove:me.onColumnMove});},initKeyNavHeaderEvents:function(){var me=this;me.keyNav=Ext.create('Ext.util.KeyNav',me.view.el,{enter:me.onEnterKey,esc:me.onEscKey,scope:me});},onColumnAdd:function(ct,column){this.initFieldAccessors(column);},onColumnRemove:function(ct,column){this.removeFieldAccessors(column);},onColumnMove:function(headerCt,column,fromIdx,toIdx){this.initFieldAccessors(column);},onEnterKey:function(e){var me=this,grid=me.grid,selModel=grid.getSelectionModel(),record,pos,columnHeader;if(selModel.getCurrentPosition&&(pos=selModel.getCurrentPosition())){record=pos.record;columnHeader=pos.columnHeader;}
else{record=selModel.getLastSelected();columnHeader=grid.columnManager.getHeaderAtIndex(0);}
if(record&&columnHeader){me.startEdit(record,columnHeader);}},onEscKey:function(e){return this.cancelEdit();},beforeEdit:Ext.emptyFn,startEdit:function(record,columnHeader){var me=this,context,layoutView=me.grid.lockable?me.grid:me.view;if(!layoutView.componentLayoutCounter){layoutView.on({boxready:Ext.Function.bind(me.startEdit,me,[record,columnHeader]),single:true});return false;}
if(me.grid.collapsed||!me.grid.view.isVisible(true)){return false;}
context=me.getEditingContext(record,columnHeader);if(context==null){return false;}
if(!me.preventBeforeCheck){if(me.beforeEdit(context)===false||me.fireEvent('beforeedit',me,context)===false||context.cancel){return false;}}
me.editing=true;return context;},getEditingContext:function(record,columnHeader){var me=this,grid=me.grid,view=me.view,gridRow=view.getNode(record,true),rowIdx,colIdx;if(!gridRow){return;}
columnHeader=grid.columnManager.getVisibleHeaderClosestToIndex(Ext.isNumber(columnHeader)?columnHeader:columnHeader.getVisibleIndex());if(!columnHeader){return;}
colIdx=columnHeader.getVisibleIndex();if(Ext.isNumber(record)){rowIdx=record;record=view.getRecord(gridRow);}else{rowIdx=view.indexOf(gridRow);}
if(!record){return;}
return{grid:grid,view:view,store:view.dataSource,record:record,field:columnHeader.dataIndex,value:record.get(columnHeader.dataIndex),row:gridRow,column:columnHeader,rowIdx:rowIdx,colIdx:colIdx};},cancelEdit:function(){var me=this;me.editing=false;me.fireEvent('canceledit',me,me.context);},completeEdit:function(){var me=this;if(me.editing&&me.validateEdit()){me.fireEvent('edit',me,me.context);}
me.context=null;me.editing=false;},validateEdit:function(){var me=this,context=me.context;return me.fireEvent('validateedit',me,context)!==false&&!context.cancel;}});Ext.define('Ext.panel.Table',{extend:'Ext.panel.Panel',alias:'widget.tablepanel',uses:['Ext.selection.RowModel','Ext.selection.CellModel','Ext.selection.CheckboxModel','Ext.grid.plugin.BufferedRenderer','Ext.grid.header.Container','Ext.grid.locking.Lockable'],extraBaseCls:Ext.baseCSSPrefix+'grid',extraBodyCls:Ext.baseCSSPrefix+'grid-body',layout:'fit',hasView:false,viewType:null,selType:'rowmodel',scroll:true,deferRowRender:true,sortableColumns:true,enableLocking:false,scrollerOwner:true,enableColumnMove:true,sealedColumns:false,enableColumnResize:true,rowLines:true,colLinesCls:Ext.baseCSSPrefix+'grid-with-col-lines',rowLinesCls:Ext.baseCSSPrefix+'grid-with-row-lines',noRowLinesCls:Ext.baseCSSPrefix+'grid-no-row-lines',hiddenHeaderCtCls:Ext.baseCSSPrefix+'grid-header-ct-hidden',hiddenHeaderCls:Ext.baseCSSPrefix+'grid-header-hidden',resizeMarkerCls:Ext.baseCSSPrefix+'grid-resize-marker',emptyCls:Ext.baseCSSPrefix+'grid-empty',initComponent:function(){var me=this,headerCtCfg=me.columns||me.colModel,view,i,len,store=me.store=Ext.data.StoreManager.lookup(me.store||'ext-empty-store'),columns;if(me.columnLines){me.addCls(me.colLinesCls);}
me.addCls(me.rowLines?me.rowLinesCls:me.noRowLinesCls);if(headerCtCfg instanceof Ext.grid.header.Container){headerCtCfg.isRootHeader=true;me.headerCt=headerCtCfg;}else{if(me.enableLocking||me.hasLockedColumns(headerCtCfg)){me.self.mixin('lockable',Ext.grid.locking.Lockable);me.injectLockable();}
else{if(Ext.isArray(headerCtCfg)){headerCtCfg={items:headerCtCfg};}
Ext.apply(headerCtCfg,{grid:me,forceFit:me.forceFit,sortable:me.sortableColumns,enableColumnMove:me.enableColumnMove,enableColumnResize:me.enableColumnResize,sealed:me.sealedColumns,isRootHeader:true});if(Ext.isDefined(me.enableColumnHide)){headerCtCfg.enableColumnHide=me.enableColumnHide;}
if(!me.headerCt){me.headerCt=new Ext.grid.header.Container(headerCtCfg);}}}
me.columns=me.headerCt.getGridColumns();me.scrollTask=new Ext.util.DelayedTask(me.syncHorizontalScroll,me);me.addEvents('reconfigure','viewready');me.bodyCls=me.bodyCls||'';me.bodyCls+=(' '+me.extraBodyCls);me.cls=me.cls||'';me.cls+=(' '+me.extraBaseCls);delete me.autoScroll;if(!me.hasView){columns=me.headerCt.getGridColumns();if(store.buffered&&!store.remoteSort){for(i=0,len=columns.length;i<len;i++){columns[i].sortable=false;}}
if(me.hideHeaders){me.headerCt.height=0;me.headerCt.hiddenHeaders=true;me.headerCt.addCls(me.hiddenHeaderCtCls);me.addCls(me.hiddenHeaderCls);if(Ext.isIEQuirks){me.headerCt.style={display:'none'};}}
me.relayHeaderCtEvents(me.headerCt);me.features=me.features||[];if(!Ext.isArray(me.features)){me.features=[me.features];}
me.dockedItems=[].concat(me.dockedItems||[]);me.dockedItems.unshift(me.headerCt);me.viewConfig=me.viewConfig||{};view=me.getView();me.items=[view];me.hasView=true;if(!me.hideHeaders){view.on({scroll:{fn:me.onHorizontalScroll,element:'el',scope:me}});}
me.bindStore(store,true);me.mon(view,{viewready:me.onViewReady,refresh:me.onRestoreHorzScroll,scope:me});}
me.relayEvents(me.view,['beforeitemmousedown','beforeitemmouseup','beforeitemmouseenter','beforeitemmouseleave','beforeitemclick','beforeitemdblclick','beforeitemcontextmenu','itemmousedown','itemmouseup','itemmouseenter','itemmouseleave','itemclick','itemdblclick','itemcontextmenu','beforecellclick','cellclick','beforecelldblclick','celldblclick','beforecellcontextmenu','cellcontextmenu','beforecellmousedown','cellmousedown','beforecellmouseup','cellmouseup','beforecellkeydown','cellkeydown','beforecontainermousedown','beforecontainermouseup','beforecontainermouseover','beforecontainermouseout','beforecontainerclick','beforecontainerdblclick','beforecontainercontextmenu','containermouseup','containermouseover','containermouseout','containerclick','containerdblclick','containercontextmenu','selectionchange','beforeselect','select','beforedeselect','deselect']);me.callParent(arguments);me.addStateEvents(['columnresize','columnmove','columnhide','columnshow','sortchange','filterchange']);if(!me.lockable&&me.headerCt){me.headerCt.on('afterlayout',me.onRestoreHorzScroll,me);}},hasLockedColumns:function(columns){var i,len,column;if(Ext.isObject(columns)){columns=columns.items;}
for(i=0,len=columns.length;i<len;i++){column=columns[i];if(!column.processed&&column.locked){return true;}}},relayHeaderCtEvents:function(headerCt){this.relayEvents(headerCt,['columnresize','columnmove','columnhide','columnshow','columnschanged','sortchange','headerclick','headercontextmenu','headertriggerclick']);},getState:function(){var me=this,state=me.callParent(),storeState=me.store.getState();state=me.addPropertyToState(state,'columns',me.headerCt.getColumnsState());if(storeState){state.storeState=storeState;}
return state;},applyState:function(state){var me=this,sorter=state.sort,storeState=state.storeState,store=me.store,columns=state.columns;delete state.columns;me.callParent(arguments);if(columns){me.headerCt.applyColumnsState(columns);}
if(sorter){if(store.remoteSort){store.sort({property:sorter.property,direction:sorter.direction,root:sorter.root},null,false);}else{store.sort(sorter.property,sorter.direction);}}
else if(storeState){store.applyState(storeState);}},getStore:function(){return this.store;},getView:function(){var me=this,sm;if(!me.view){sm=me.getSelectionModel();Ext.widget(Ext.apply({grid:me,deferInitialRefresh:me.deferRowRender!==false,trackOver:me.trackMouseOver!==false,scroll:me.scroll,xtype:me.viewType,store:me.store,headerCt:me.headerCt,columnLines:me.columnLines,rowLines:me.rowLines,selModel:sm,features:me.features,panel:me,emptyText:me.emptyText||''},me.viewConfig));if(me.view.emptyText){me.view.emptyText='<div class="'+me.emptyCls+'">'+me.view.emptyText+'</div>';}
me.view.getComponentLayout().headerCt=me.headerCt;me.mon(me.view,{uievent:me.processEvent,scope:me});sm.view=me.view;me.headerCt.view=me.view;}
return me.view;},setAutoScroll:Ext.emptyFn,processEvent:function(type,view,cell,recordIndex,cellIndex,e,record,row){var me=this,header;if(cellIndex!==-1){header=me.columnManager.getColumns()[cellIndex];return header.processEvent.apply(header,arguments);}},determineScrollbars:function(){},invalidateScroller:function(){},scrollByDeltaY:function(yDelta,animate){this.getView().scrollBy(0,yDelta,animate);},scrollByDeltaX:function(xDelta,animate){this.getView().scrollBy(xDelta,0,animate);},afterCollapse:function(){var me=this;me.saveScrollPos();me.saveScrollPos();me.callParent(arguments);},afterExpand:function(){var me=this;me.callParent(arguments);me.restoreScrollPos();me.restoreScrollPos();},saveScrollPos:Ext.emptyFn,restoreScrollPos:Ext.emptyFn,onHeaderResize:function(){this.delayScroll();},onHeaderMove:function(headerCt,header,colsToMove,fromIdx,toIdx){var me=this;if(me.optimizedColumnMove===false){me.view.refresh();}
else{me.view.moveColumn(fromIdx,toIdx,colsToMove);}
me.delayScroll();},onHeaderHide:function(headerCt,header){this.view.refresh();this.delayScroll();},onHeaderShow:function(headerCt,header){this.view.refresh();this.delayScroll();},delayScroll:function(){var target=this.getScrollTarget().el;if(target){this.scrollTask.delay(10,null,null,[target.dom.scrollLeft]);}},onViewReady:function(){this.fireEvent('viewready',this);},onRestoreHorzScroll:function(){var left=this.scrollLeftPos;if(left){this.syncHorizontalScroll(left,true);}},getScrollerOwner:function(){var rootCmp=this;if(!this.scrollerOwner){rootCmp=this.up('[scrollerOwner]');}
return rootCmp;},getLhsMarker:function(){var me=this;return me.lhsMarker||(me.lhsMarker=Ext.DomHelper.append(me.el,{cls:me.resizeMarkerCls},true));},getRhsMarker:function(){var me=this;return me.rhsMarker||(me.rhsMarker=Ext.DomHelper.append(me.el,{cls:me.resizeMarkerCls},true));},getSelectionModel:function(){var me=this,selModel=me.selModel,applyMode,mode,type;if(!selModel){selModel={};applyMode=true;}
if(!selModel.events){type=selModel.selType||me.selType;applyMode=!selModel.mode;selModel=me.selModel=Ext.create('selection.'+type,selModel);}
if(me.simpleSelect){mode='SIMPLE';}else if(me.multiSelect){mode='MULTI';}
Ext.applyIf(selModel,{allowDeselect:me.allowDeselect});if(mode&&applyMode){selModel.setSelectionMode(mode);}
if(!selModel.hasRelaySetup){me.relayEvents(selModel,['selectionchange','beforeselect','beforedeselect','select','deselect']);selModel.hasRelaySetup=true;}
if(me.disableSelection){selModel.locked=true;}
return selModel;},getScrollTarget:function(){var owner=this.getScrollerOwner(),items=owner.query('tableview');return items[1]||items[0];},onHorizontalScroll:function(event,target){this.syncHorizontalScroll(target.scrollLeft);},syncHorizontalScroll:function(left,setBody){var me=this,scrollTarget;setBody=setBody===true;if(me.rendered&&(setBody||left!==me.scrollLeftPos)){if(setBody){scrollTarget=me.getScrollTarget();scrollTarget.el.dom.scrollLeft=left;}
me.headerCt.el.dom.scrollLeft=left;me.scrollLeftPos=left;}},onStoreLoad:Ext.emptyFn,getEditorParent:function(){return this.body;},bindStore:function(store,initial){var me=this,view=me.getView(),bufferedStore=store&&store.buffered,bufferedRenderer;me.store=store;bufferedRenderer=me.findPlugin('bufferedrenderer');if(bufferedRenderer){me.verticalScroller=bufferedRenderer;if(bufferedRenderer.store){bufferedRenderer.bindStore(store);}}else if(bufferedStore){me.verticalScroller=bufferedRenderer=me.addPlugin(Ext.apply({ptype:'bufferedrenderer'},me.initialConfig.verticalScroller));}
if(view.store!==store){if(initial){view.bindStore(store,false,'dataSource');}else{view.bindStore(store,false);}}
me.mon(store,{load:me.onStoreLoad,scope:me});me.storeRelayers=me.relayEvents(store,['filterchange']);if(bufferedRenderer){me.invalidateScrollerOnRefresh=false;}
if(me.invalidateScrollerOnRefresh!==undefined){view.preserveScrollOnRefresh=!me.invalidateScrollerOnRefresh;}},unbindStore:function(){var me=this,store=me.store;if(store){me.store=null;me.mun(store,{load:me.onStoreLoad,scope:me});Ext.destroy(me.storeRelayers);}},reconfigure:function(store,columns){var me=this,view=me.getView(),originalDeferinitialRefresh,oldStore=me.store,headerCt=me.headerCt,oldColumns=headerCt?headerCt.items.getRange():me.columns;if(columns){columns=Ext.Array.slice(columns);}
me.fireEvent('beforereconfigure',me,store,columns,oldStore,oldColumns);if(me.lockable){me.reconfigureLockable(store,columns);}else{Ext.suspendLayouts();if(columns){delete me.scrollLeftPos;headerCt.removeAll();headerCt.add(columns);}
if(store&&(store=Ext.StoreManager.lookup(store))!==oldStore){if(me.store){me.unbindStore();}
originalDeferinitialRefresh=view.deferInitialRefresh;view.deferInitialRefresh=false;me.bindStore(store);view.deferInitialRefresh=originalDeferinitialRefresh;}else{me.getView().refresh();}
headerCt.setSortState();Ext.resumeLayouts(true);}
me.fireEvent('reconfigure',me,store,columns,oldStore,oldColumns);},beforeDestroy:function(){var task=this.scrollTask;if(task){task.cancel();this.scrollTask=null;}
this.callParent();},onDestroy:function(){if(this.lockable){this.destroyLockable();}
this.callParent();}});Ext.define('MP.desktop.Desktop',{extend:'Ext.panel.Panel',alias:'widget.desktop',uses:['Ext.util.MixedCollection','Ext.menu.Menu','Ext.view.View','Ext.window.Window','MP.desktop.TaskBar','MP.desktop.Wallpaper'],activeWindowCls:'mp-desktop-active-win',inactiveWindowCls:'mp-desktop-inactive-win',lastActiveWindow:null,border:false,html:'&#160;',layout:'fit',xTickSize:1,yTickSize:1,app:null,shortcuts:null,shortcutItemSelector:'div.mp-desktop-shortcut',shortcutTpl:['<tpl for=".">','<div class="mp-desktop-shortcut" id="{name}-shortcut">','<div class="mp-desktop-shortcut-icon {iconCls}">','<img src="',Ext.BLANK_IMAGE_URL,'" title="{name}">','</div>','<span class="mp-desktop-shortcut-text">{name}</span>','</div>','</tpl>','<div class="x-clear"></div>'],taskbarConfig:null,wallpaper:null,wallpaperStyle:null,windowMenu:null,initComponent:function(){var me=this;me.windowMenu=new Ext.menu.Menu(me.createWindowMenu());me.bbar=me.taskbar=new MP.desktop.TaskBar(me.taskbarConfig);me.taskbar.windowMenu=me.windowMenu;me.windows=new Ext.util.MixedCollection();me.contextMenu=new Ext.menu.Menu(me.createDesktopMenu());me.items=[{xtype:'wallpaper',id:me.id+'_wallpaper',style:me.wallpaperStyle},me.createDataView()];me.callParent();me.shortcutsView=me.items.getAt(1);me.shortcutsView.on('itemclick',me.onShortcutItemClick,me);var wallpaper=me.wallpaper;me.wallpaper=me.items.getAt(0);if(wallpaper){me.setWallpaper(wallpaper,me.wallpaperStyle);}},afterRender:function(){var me=this;me.callParent();me.el.on('contextmenu',me.onDesktopMenu,me);},createDataView:function(){var me=this;return{xtype:'dataview',overItemCls:'x-view-over',trackOver:true,itemSelector:me.shortcutItemSelector,store:me.shortcuts,style:{position:'absolute'},x:0,y:0,tpl:new Ext.XTemplate(me.shortcutTpl)};},createDesktopMenu:function(){var me=this,ret={items:me.contextMenuItems||[]};if(ret.items.length){ret.items.push('-');}
ret.items.push({text:_('Tile'),handler:me.tileWindows,scope:me,minWindows:1},{text:_('Cascade'),handler:me.cascadeWindows,scope:me,minWindows:1});return ret;},createWindowMenu:function(){var me=this;return{defaultAlign:'br-tr',items:[{text:_('Restore'),handler:me.onWindowMenuRestore,scope:me},{text:_('Minimize'),handler:me.onWindowMenuMinimize,scope:me},{text:_('Maximize'),handler:me.onWindowMenuMaximize,scope:me},'-',{text:_('Close'),handler:me.onWindowMenuClose,scope:me}],listeners:{beforeshow:me.onWindowMenuBeforeShow,hide:me.onWindowMenuHide,scope:me}};},onDesktopMenu:function(e){var me=this,menu=me.contextMenu;e.stopEvent();if(!menu.rendered){menu.on('beforeshow',me.onDesktopMenuBeforeShow,me);}
menu.showAt(e.getXY());menu.doConstrain();},onDesktopMenuBeforeShow:function(menu){var me=this,count=me.windows.getCount();menu.items.each(function(item){var min=item.minWindows||0;item.setDisabled(count<min);});},onShortcutItemClick:function(dataView,record){var me=this,module=me.app.getModule(record.data.moduleId);if(module){module.createOrShowWindow();}},onWindowClose:function(win){var me=this;me.windows.remove(win);me.taskbar.removeTaskButton(win.taskButton);me.updateActiveWindow();},onWindowMenuBeforeShow:function(menu){var items=menu.items.items,win=menu.theWin;items[0].setDisabled(win.maximized!==true&&win.hidden!==true);items[1].setDisabled(win.minimized===true);items[2].setDisabled(win.maximized===true||win.hidden===true);},onWindowMenuClose:function(){var me=this,win=me.windowMenu.theWin;win.close();},onWindowMenuHide:function(menu){Ext.defer(function(){menu.theWin=null;},1);},onWindowMenuMaximize:function(){var me=this,win=me.windowMenu.theWin;win.maximize();win.toFront();},onWindowMenuMinimize:function(){var me=this,win=me.windowMenu.theWin;win.minimize();},onWindowMenuRestore:function(){var me=this,win=me.windowMenu.theWin;me.restoreWindow(win);},getWallpaper:function(){return this.wallpaper.wallpaper;},setTickSize:function(xTickSize,yTickSize){var me=this,xt=me.xTickSize=xTickSize,yt=me.yTickSize=(arguments.length>1)?yTickSize:xt;me.windows.each(function(win){var dd=win.dd,resizer=win.resizer;dd.xTickSize=xt;dd.yTickSize=yt;resizer.widthIncrement=xt;resizer.heightIncrement=yt;});},setWallpaper:function(wallpaper,style){this.wallpaper.setWallpaper(wallpaper,style);return this;},cascadeWindows:function(){var x=0,y=0,zmgr=this.getDesktopZIndexManager();zmgr.eachBottomUp(function(win){if(win.isWindow&&win.isVisible()&&!win.maximized){win.setPosition(x,y);x+=20;y+=20;}});},getReasonableWindowSize:function(width,height,align){var me=this;var desktop_width=me.getWidth(true);var desktop_height=me.getHeight(true)-me.taskbar.getHeight();var max_width,max_height,result;if(width===undefined){width=800;}
if(height===undefined){height=640;}
max_width=desktop_width;if(max_width>1600){max_width=1024;}else if(max_width>1024){max_width=800;}else{max_width-=40;}
max_height=desktop_height;if(max_height>1024){max_height=800;}else if(max_height>800){max_height=640;}else{max_height-=40;}
result={width:width<max_width?width:max_width,height:height<max_height?height:max_height};if(align){switch(align){case'N':result.y=10;break;case'S':result.y=desktop_height-result.height-10;break;case'W':result.x=10;break;case'E':result.x=desktop_width-result.width-10;break;case'NW':result.x=10;result.y=10;break;case'NE':result.x=desktop_width-result.width-10;result.y=10;break;case'SW':result.x=10;result.y=desktop_height-result.height-10;break;case'SE':result.x=desktop_width-result.width-10;result.y=desktop_height-result.height-10;break;default:break;}}
return result;},createWindow:function(config,cls){var me=this,win,cfg=Ext.applyIf(config||{},{stateful:false,isWindow:true,constrainHeader:true,minimizable:true,maximizable:true,layout:'fit',animCollapse:false,onEsc:Ext.emptyFn});cls=cls||Ext.window.Window;win=me.add(new cls(cfg));me.windows.add(win);win.taskButton=me.taskbar.addTaskButton(win);win.animateTarget=win.taskButton.el;win.on({activate:me.updateActiveWindow,beforeshow:me.updateActiveWindow,deactivate:me.updateActiveWindow,minimize:me.minimizeWindow,destroy:me.onWindowClose,scope:me});win.on({boxready:function(){win.dd.xTickSize=me.xTickSize;win.dd.yTickSize=me.yTickSize;if(win.resizer){win.resizer.widthIncrement=me.xTickSize;win.resizer.heightIncrement=me.yTickSize;}},single:true});win.doClose=function(){win.doClose=Ext.emptyFn;win.el.disableShadow();win.el.fadeOut({listeners:{afteranimate:function(){win.destroy();}}});};win.toggleMaximize=function(){if(!this.maximized){var curpos=win.getPosition(true);var cursize=win.getSize();var vs=win.container.getViewSize();win.setPosition(curpos[0],0);win.setSize(cursize.width,vs.height-me.taskbar.getHeight());}};return win;},getActiveWindow:function(){var win=null,zmgr=this.getDesktopZIndexManager();if(zmgr){zmgr.eachTopDown(function(comp){if(comp.isWindow&&!comp.hidden){win=comp;return false;}
return true;});}
return win;},getDesktopZIndexManager:function(){var windows=this.windows;return(windows.getCount()&&windows.getAt(0).zIndexManager)||null;},getWindow:function(id){return this.windows.get(id);},minimizeWindow:function(win){win.minimized=true;win.hide();},restoreWindow:function(win){if(win.isVisible()){win.restore();win.toFront();}else{win.show();}
return win;},tileWindows:function(){var me=this,availWidth=me.body.getWidth(true);var x=me.xTickSize,y=me.yTickSize,nextY=y;me.windows.each(function(win){if(win.isVisible()&&!win.maximized){var w=win.el.getWidth();if(x>me.xTickSize&&x+w>availWidth){x=me.xTickSize;y=nextY;}
win.setPosition(x,y);x+=w+me.xTickSize;nextY=Math.max(nextY,y+win.el.getHeight()+me.yTickSize);}});},updateActiveWindow:function(){var me=this,activeWindow=me.getActiveWindow(),last=me.lastActiveWindow;if(activeWindow===last){return;}
if(last){if(last.el&&last.el.dom){last.addCls(me.inactiveWindowCls);last.removeCls(me.activeWindowCls);}
last.active=false;}
me.lastActiveWindow=activeWindow;if(activeWindow){activeWindow.addCls(me.activeWindowCls);activeWindow.removeCls(me.inactiveWindowCls);activeWindow.minimized=false;activeWindow.active=true;}
me.taskbar.setActiveButton(activeWindow&&activeWindow.taskButton);}});Ext.define('Ext.grid.locking.Lockable',{alternateClassName:'Ext.grid.Lockable',requires:['Ext.grid.locking.View','Ext.grid.header.Container','Ext.grid.locking.HeaderContainer','Ext.view.Table'],syncRowHeight:true,headerCounter:0,scrollDelta:40,lockedGridCls:Ext.baseCSSPrefix+'grid-inner-locked',unlockText:'Unlock',lockText:'Lock',bothCfgCopy:['invalidateScrollerOnRefresh','hideHeaders','enableColumnHide','enableColumnMove','enableColumnResize','sortableColumns','columnLines','rowLines'],normalCfgCopy:['verticalScroller','verticalScrollDock','verticalScrollerType','scroll'],lockedCfgCopy:[],determineXTypeToCreate:function(lockedSide){var me=this,typeToCreate,xtypes,xtypesLn,xtype,superxtype;if(me.subGridXType){typeToCreate=me.subGridXType;}else{if(!lockedSide){return'gridpanel';}
xtypes=this.getXTypes().split('/');xtypesLn=xtypes.length;xtype=xtypes[xtypesLn-1];superxtype=xtypes[xtypesLn-2];if(superxtype!=='tablepanel'){typeToCreate=superxtype;}else{typeToCreate=xtype;}}
return typeToCreate;},injectLockable:function(){this.lockable=true;this.hasView=true;var me=this,scrollbarHeight=Ext.getScrollbarSize().height,store=me.store=Ext.StoreManager.lookup(me.store),selModel=me.getSelectionModel(),allFeatures,allPlugins,lockedGrid,normalGrid,i,columns,lockedHeaderCt,normalHeaderCt,lockedView,normalView,listeners,bufferedRenderer=me.findPlugin('bufferedrenderer');allFeatures=me.constructLockableFeatures();if(me.features){me.features=null;}
allPlugins=me.constructLockablePlugins();me.plugins=allPlugins.topPlugins;lockedGrid=Ext.apply({id:me.id+'-locked',isLocked:true,ownerLockable:me,xtype:me.determineXTypeToCreate(true),store:store,scrollerOwner:false,animate:false,scroll:scrollbarHeight?false:'vertical',selModel:selModel,border:false,cls:me.lockedGridCls,isLayoutRoot:function(){return false;},features:allFeatures.lockedFeatures,plugins:allPlugins.lockedPlugins},me.lockedGridConfig);normalGrid=Ext.apply({id:me.id+'-normal',isLocked:false,ownerLockable:me,xtype:me.determineXTypeToCreate(),store:store,scrollerOwner:false,selModel:selModel,border:false,isLayoutRoot:function(){return false;},features:allFeatures.normalFeatures,plugins:allPlugins.normalPlugins},me.normalGridConfig);me.addCls(Ext.baseCSSPrefix+'grid-locked');Ext.copyTo(normalGrid,me,me.bothCfgCopy,true);Ext.copyTo(lockedGrid,me,me.bothCfgCopy,true);Ext.copyTo(normalGrid,me,me.normalCfgCopy,true);Ext.copyTo(lockedGrid,me,me.lockedCfgCopy,true);for(i=0;i<me.normalCfgCopy.length;i++){delete me[me.normalCfgCopy[i]];}
for(i=0;i<me.lockedCfgCopy.length;i++){delete me[me.lockedCfgCopy[i]];}
me.addEvents('processcolumns','lockcolumn','unlockcolumn');me.addStateEvents(['lockcolumn','unlockcolumn']);columns=me.processColumns(me.columns);lockedGrid.width=columns.lockedWidth+Ext.num(selModel.headerWidth,0)+(columns.locked.items.length?1:0);lockedGrid.columns=columns.locked;normalGrid.columns=columns.normal;normalGrid.flex=1;lockedGrid.viewConfig=me.lockedViewConfig||{};lockedGrid.viewConfig.loadingUseMsg=false;lockedGrid.viewConfig.loadMask=false;if(scrollbarHeight){lockedGrid.viewConfig.style='border-bottom:'+scrollbarHeight+'px solid #f6f6f6;'+(lockedGrid.viewConfig.style||'');}
normalGrid.viewConfig=me.normalViewConfig||{};normalGrid.viewConfig.loadMask=false;Ext.applyIf(lockedGrid.viewConfig,me.viewConfig);Ext.applyIf(normalGrid.viewConfig,me.viewConfig);me.lockedGrid=Ext.ComponentManager.create(lockedGrid);if(me.isTree){me.lockedGrid.getView().animate=false;normalGrid.store=me.lockedGrid.view.store;normalGrid.deferRowRender=false;normalGrid.viewConfig.stripeRows=me.lockedGrid.view.stripeRows;normalGrid.rowLines=me.lockedGrid.rowLines;}
lockedView=me.lockedGrid.getView();normalGrid.viewConfig.lockingPartner=lockedView;me.normalGrid=Ext.ComponentManager.create(normalGrid);lockedView.lockingPartner=normalView=me.normalGrid.getView();me.view=new Ext.grid.locking.View({loadingText:normalView.loadingText,loadingCls:normalView.loadingCls,loadingUseMsg:normalView.loadingUseMsg,loadMask:me.loadMask!==false,locked:me.lockedGrid,normal:me.normalGrid,panel:me});listeners=bufferedRenderer?{}:{scroll:{fn:me.onLockedViewScroll,element:'el',scope:me}};if(scrollbarHeight){me.lockedGrid.on({afterlayout:me.afterLockedViewLayout,scope:me});lockedView.getOverflowStyle();if(lockedView.scrollFlags.y){me.lockedGrid.headerCt.forceFit=true;}
else{listeners.mousewheel={fn:me.onLockedViewMouseWheel,element:'el',scope:me};}}
lockedView.on(listeners);listeners=bufferedRenderer?{}:{scroll:{fn:me.onNormalViewScroll,element:'el',scope:me},scope:me};normalView.on(listeners);lockedHeaderCt=me.lockedGrid.headerCt;normalHeaderCt=me.normalGrid.headerCt;me.headerCt=me.view.headerCt=new Ext.grid.locking.HeaderContainer(me);lockedHeaderCt.lockedCt=true;lockedHeaderCt.lockableInjected=true;normalHeaderCt.lockableInjected=true;lockedHeaderCt.on({add:{buffer:1,scope:me,fn:me.onLockedHeaderAdd},columnshow:me.onLockedHeaderShow,columnhide:me.onLockedHeaderHide,sortchange:me.onLockedHeaderSortChange,columnresize:me.onLockedHeaderResize,scope:me});normalHeaderCt.on({sortchange:me.onNormalHeaderSortChange,scope:me});me.modifyHeaderCt();me.items=[me.lockedGrid,me.normalGrid];me.relayHeaderCtEvents(lockedHeaderCt);me.relayHeaderCtEvents(normalHeaderCt);me.storeRelayers=me.relayEvents(store,['filterchange']);me.layout={type:'hbox',align:'stretch'};},getLockingViewConfig:function(){return{xclass:'Ext.grid.locking.View',locked:this.lockedGrid,normal:this.normalGrid,panel:this};},processColumns:function(columns){var i,len,column,cp=this.dummyHdrCtr||(this.self.prototype.dummyHdrCtr=new Ext.grid.header.Container()),lockedHeaders=[],normalHeaders=[],lockedHeaderCt={itemId:'lockedHeaderCt',stretchMaxPartner:'^^>>#normalHeaderCt',items:lockedHeaders},normalHeaderCt={itemId:'normalHeaderCt',stretchMaxPartner:'^^>>#lockedHeaderCt',items:normalHeaders},result={lockedWidth:0,locked:lockedHeaderCt,normal:normalHeaderCt};if(Ext.isObject(columns)){Ext.applyIf(lockedHeaderCt,columns);Ext.applyIf(normalHeaderCt,columns);Ext.apply(cp,columns);columns=columns.items;}
for(i=0,len=columns.length;i<len;++i){column=columns[i];if(!column.isComponent){column=cp.lookupComponent(cp.applyDefaults(column));}
column.processed=true;if(column.locked||column.autoLock){if(!column.hidden){result.lockedWidth+=this.getColumnWidth(column)||cp.defaultWidth;}
lockedHeaders.push(column);}else{normalHeaders.push(column);}
if(!column.headerId){column.headerId=(column.initialConfig||column).id||('h'+(++this.headerCounter));}}
this.fireEvent('processcolumns',this,lockedHeaders,normalHeaders);return result;},getColumnWidth:function(column){var result=column.width||0,subcols,len,i;if(!result&&column.isGroupHeader){subcols=column.items.items;len=subcols.length;for(i=0;i<len;i++){result+=this.getColumnWidth(subcols[i]);}}
return result;},afterLockedViewLayout:function(){var me=this,lockedView=me.lockedGrid.getView(),lockedViewEl=lockedView.el.dom,spacerHeight=(me.normalGrid.headerCt.tooNarrow?Ext.getScrollbarSize().height:0);if(lockedView.scrollFlags.x&&lockedViewEl.scrollWidth>lockedViewEl.clientWidth){spacerHeight=0;}
lockedView.el.dom.style.borderBottomWidth=spacerHeight+'px';if(!Ext.isBorderBox){lockedView.el.setHeight(lockedView.lastBox.height);}},onLockedViewMouseWheel:function(e){var me=this,scrollDelta=-me.scrollDelta,deltaY=scrollDelta*e.getWheelDeltas().y,vertScrollerEl=me.lockedGrid.getView().el.dom,verticalCanScrollDown,verticalCanScrollUp;if(!me.ignoreMousewheel){if(vertScrollerEl){verticalCanScrollDown=vertScrollerEl.scrollTop!==vertScrollerEl.scrollHeight-vertScrollerEl.clientHeight;verticalCanScrollUp=vertScrollerEl.scrollTop!==0;}
if((deltaY<0&&verticalCanScrollUp)||(deltaY>0&&verticalCanScrollDown)){e.stopEvent();vertScrollerEl.scrollTop+=deltaY;me.normalGrid.getView().el.dom.scrollTop=vertScrollerEl.scrollTop;me.onNormalViewScroll();}}},onLockedViewScroll:function(){var me=this,lockedView=me.lockedGrid.getView(),normalView=me.normalGrid.getView(),normalDom=normalView.el.dom,lockedDom=lockedView.el.dom,normalTable,lockedTable;if(normalDom.scrollTop!==lockedDom.scrollTop){normalDom.scrollTop=lockedDom.scrollTop;if(me.store.buffered){lockedTable=lockedView.el.child('table',true);normalTable=normalView.el.child('table',true);normalTable.style.position='absolute';normalTable.style.top=lockedTable.style.top;}}},onNormalViewScroll:function(){var me=this,lockedView=me.lockedGrid.getView(),normalView=me.normalGrid.getView(),normalDom=normalView.el.dom,lockedDom=lockedView.el.dom,normalTable,lockedTable;if(normalDom.scrollTop!==lockedDom.scrollTop){lockedDom.scrollTop=normalDom.scrollTop;if(me.store.buffered){lockedTable=lockedView.el.child('table',true);normalTable=normalView.el.child('table',true);lockedTable.style.position='absolute';lockedTable.style.top=normalTable.style.top;}}},syncRowHeights:function(){var me=this,i,lockedView=me.lockedGrid.getView(),normalView=me.normalGrid.getView(),lockedRowEls=lockedView.all.slice(),normalRowEls=normalView.all.slice(),ln=lockedRowEls.length,scrollTop;if(normalRowEls.length===ln){for(i=0;i<ln;i++){normalView.syncRowHeights(lockedRowEls[i],normalRowEls[i]);}
scrollTop=normalView.el.dom.scrollTop;normalView.el.dom.scrollTop=scrollTop;lockedView.el.dom.scrollTop=scrollTop;}},modifyHeaderCt:function(){var me=this;me.lockedGrid.headerCt.getMenuItems=me.getMenuItems(me.lockedGrid.headerCt.getMenuItems,true);me.normalGrid.headerCt.getMenuItems=me.getMenuItems(me.normalGrid.headerCt.getMenuItems,false);me.lockedGrid.headerCt.showMenuBy=Ext.Function.createInterceptor(me.lockedGrid.headerCt.showMenuBy,me.showMenuBy);me.normalGrid.headerCt.showMenuBy=Ext.Function.createInterceptor(me.normalGrid.headerCt.showMenuBy,me.showMenuBy);},onUnlockMenuClick:function(){this.unlock();},onLockMenuClick:function(){this.lock();},showMenuBy:function(t,header){var menu=this.getMenu(),unlockItem=menu.down('#unlockItem'),lockItem=menu.down('#lockItem'),sep=unlockItem.prev();if(header.lockable===false){sep.hide();unlockItem.hide();lockItem.hide();}else{sep.show();unlockItem.show();lockItem.show();if(!unlockItem.initialConfig.disabled){unlockItem.setDisabled(header.lockable===false);}
if(!lockItem.initialConfig.disabled){lockItem.setDisabled(!header.isLockable());}}},getMenuItems:function(getMenuItems,locked){var me=this,unlockText=me.unlockText,lockText=me.lockText,unlockCls=Ext.baseCSSPrefix+'hmenu-unlock',lockCls=Ext.baseCSSPrefix+'hmenu-lock',unlockHandler=Ext.Function.bind(me.onUnlockMenuClick,me),lockHandler=Ext.Function.bind(me.onLockMenuClick,me);return function(){var o=getMenuItems.call(this);o.push('-',{itemId:'unlockItem',cls:unlockCls,text:unlockText,handler:unlockHandler,disabled:!locked});o.push({itemId:'lockItem',cls:lockCls,text:lockText,handler:lockHandler,disabled:locked});return o;};},syncLockedWidth:function(){var me=this,locked=me.lockedGrid,lockedView=locked.view,lockedViewEl=lockedView.el.dom,normal=me.normalGrid,lockedColCount=locked.headerCt.getVisibleGridColumns().length,normalColCount=normal.headerCt.getVisibleGridColumns().length;Ext.suspendLayouts();if(normalColCount){normal.show();if(lockedColCount){if(!locked.headerCt.forceFit){delete locked.flex;locked.setWidth(locked.headerCt.getFullWidth());}
locked.addCls(me.lockedGridCls);locked.show();}else{locked.getView().refresh();locked.hide();}
lockedView.el.setStyle(lockedView.getOverflowStyle());me.ignoreMousewheel=lockedView.scrollFlags.y;}
else{normal.hide();lockedViewEl.style.borderBottomWidth='0';locked.flex=1;delete locked.width;locked.removeCls(me.lockedGridCls);locked.show();lockedView.el.setStyle(normal.view.getOverflowStyle());me.ignoreMousewheel=true;}
Ext.resumeLayouts(true);return[lockedColCount,normalColCount];},onLockedHeaderAdd:function(){if(!this.ignoreAddLockedColumn){this.syncLockedWidth();}},onLockedHeaderResize:function(){this.syncLockedWidth();},onLockedHeaderHide:function(){this.syncLockedWidth();},onLockedHeaderShow:function(){this.syncLockedWidth();},onLockedHeaderSortChange:function(headerCt,header,sortState){if(sortState){this.normalGrid.headerCt.clearOtherSortStates(null,true);}},onNormalHeaderSortChange:function(headerCt,header,sortState){if(sortState){this.lockedGrid.headerCt.clearOtherSortStates(null,true);}},lock:function(activeHd,toIdx){var me=this,normalGrid=me.normalGrid,lockedGrid=me.lockedGrid,normalHCt=normalGrid.headerCt,lockedHCt=lockedGrid.headerCt,refreshFlags,ownerCt;activeHd=activeHd||normalHCt.getMenu().activeHeader;ownerCt=activeHd.ownerCt;if(!activeHd.isLockable()){return;}
if(activeHd.flex){activeHd.width=activeHd.getWidth();activeHd.flex=null;}
Ext.suspendLayouts();ownerCt.remove(activeHd,false);activeHd.locked=true;me.ignoreAddLockedColumn=true;if(Ext.isDefined(toIdx)){lockedHCt.insert(toIdx,activeHd);}else{lockedHCt.add(activeHd);}
me.ignoreAddLockedColumn=false;refreshFlags=me.syncLockedWidth();if(refreshFlags[0]){lockedGrid.getView().refresh();}
if(refreshFlags[1]){normalGrid.getView().refresh();}
Ext.resumeLayouts(true);me.fireEvent('lockcolumn',me,activeHd);},unlock:function(activeHd,toIdx){var me=this,normalGrid=me.normalGrid,lockedGrid=me.lockedGrid,normalHCt=normalGrid.headerCt,lockedHCt=lockedGrid.headerCt,refreshFlags;if(!Ext.isDefined(toIdx)){toIdx=0;}
activeHd=activeHd||lockedHCt.getMenu().activeHeader;Ext.suspendLayouts();activeHd.ownerCt.remove(activeHd,false);activeHd.locked=false;normalHCt.insert(toIdx,activeHd);refreshFlags=me.syncLockedWidth();if(refreshFlags[0]){lockedGrid.getView().refresh();}
if(refreshFlags[1]){normalGrid.getView().refresh();}
Ext.resumeLayouts(true);me.fireEvent('unlockcolumn',me,activeHd);},reconfigureLockable:function(store,columns){var me=this,oldStore=me.store,lockedGrid=me.lockedGrid,normalGrid=me.normalGrid;Ext.suspendLayouts();if(columns){lockedGrid.headerCt.removeAll();normalGrid.headerCt.removeAll();columns=me.processColumns(columns);me.ignoreAddLockedColumn=true;lockedGrid.headerCt.add(columns.locked.items);me.ignoreAddLockedColumn=false;normalGrid.headerCt.add(columns.normal.items);me.syncLockedWidth();}
if(store&&store!==oldStore){store=Ext.data.StoreManager.lookup(store);me.store=store;lockedGrid.bindStore(store);normalGrid.bindStore(store);}else{lockedGrid.getView().refresh();normalGrid.getView().refresh();}
Ext.resumeLayouts(true);},constructLockableFeatures:function(){var features=this.features,feature,featureClone,lockedFeatures,normalFeatures,i=0,len;if(features){lockedFeatures=[];normalFeatures=[];len=features.length;for(;i<len;i++){feature=features[i];if(!feature.isFeature){feature=Ext.create('feature.'+feature.ftype,feature);}
switch(feature.lockableScope){case'locked':lockedFeatures.push(feature);break;case'normal':normalFeatures.push(feature);break;default:feature.lockableScope='both';lockedFeatures.push(feature);normalFeatures.push(featureClone=feature.clone());featureClone.lockingPartner=feature;feature.lockingPartner=featureClone;}}}
return{normalFeatures:normalFeatures,lockedFeatures:lockedFeatures};},constructLockablePlugins:function(){var plugins=this.plugins,plugin,normalPlugin,lockedPlugin,topPlugins,lockedPlugins,normalPlugins,i=0,len;if(plugins){topPlugins=[];lockedPlugins=[];normalPlugins=[];len=plugins.length;for(;i<len;i++){plugin=plugins[i];switch(plugin.lockableScope){case'both':lockedPlugins.push(lockedPlugin=plugin.clonePlugin());normalPlugins.push(normalPlugin=plugin.clonePlugin());lockedPlugin.lockingPartner=normalPlugin;normalPlugin.lockingPartner=lockedPlugin;Ext.destroy(plugin);break;case'locked':lockedPlugins.push(plugin);break;case'normal':normalPlugins.push(plugin);break;default:topPlugins.push(plugin);}}}
return{topPlugins:topPlugins,normalPlugins:normalPlugins,lockedPlugins:lockedPlugins};},destroyLockable:function(){Ext.destroy(this.view);}},function(){this.borrow(Ext.AbstractComponent,['constructPlugin']);});Ext.define('SoL.window.Signin',{extend:'Ext.Window',uses:'Ext.form.Panel',title:_('Complete the form to request a new account'),titleAlign:'center',width:400,autoHeight:true,closable:true,resizable:false,draggable:false,layout:'fit',border:false,modal:true,initComponent:function(){var me=this;Ext.apply(me,{items:[{xtype:'form',plain:true,frame:true,border:0,bodyPadding:5,url:'/auth/signin',items:me.getFormFields()}]});me.callParent();},buttons:['->',{text:_("Register"),type:"submit",formBind:true,handler:function(button){var win=button.up('window'),panel=win.down('form'),form=panel.getForm();if(form.isValid()){panel.getEl().mask(_("Registration…"));form.submit({headers:{'X-CSRF-Token':__csrf_token__},success:function(f,a){Ext.Msg.show({title:_('Registration succeeded'),msg:_('An email has been sent to the given address, you should receive it shortly: please check your inbox and follow the link within two days to confirm the account.'),icon:Ext.Msg.INFO,buttons:Ext.Msg.OK,fn:function(){win.close();}});},failure:function(f,a){f.owner.el.unmask();Ext.Msg.alert(_('Error'),a.result?a.result.message:_('No response from the server'));if(a.result&&a.result.errors){form.markInvalid(a.result.errors);}}});}}}],defaultFocus:'email',getFormFields:function(){var flds=['code','name'],displayField='name',model=Ext.define('MP.data.ImplicitModel-'+Ext.id(),{extend:'Ext.data.Model',fields:flds,idProperty:'code'}),lstore=Ext.create('Ext.data.Store',{model:model,autoLoad:true,proxy:{type:'ajax',url:'/data/languages',reader:{type:'json',root:'root',idProperty:'code',totalProperty:'count'}}});lstore.implicitModel=true;return[{itemId:'email',xtype:'textfield',fieldLabel:_('Email'),name:'email',allowBlank:false,anchor:'100%',selectOnFocus:true,vtype:'email'},{xtype:'textfield',fieldLabel:_('Password'),name:'password',allowBlank:false,inputType:'password',minLength:6,anchor:'100%',selectOnFocus:true},{xtype:'textfield',fieldLabel:_('First name'),name:'firstname',allowBlank:false,anchor:'100%',selectOnFocus:true},{xtype:'textfield',fieldLabel:_('Last name'),name:'lastname',allowBlank:false,anchor:'100%',selectOnFocus:true},{xtype:'combo',fieldLabel:_('Language'),name:'language',store:lstore,valueField:'code',displayField:'name',loadingText:_('Loading…'),typeAhead:true,forceSelection:true,allowBlank:true,anchor:'100%',minChars:0},{xtype:'container',height:'auto',margin:'20 15 5 15',style:{textAlign:'center'},html:_('By registering, you <strong>agree</strong> with the <a href="/static/manual/en/privacy.html" target="_blank">SoL privacy policy</a>.')}];}});Ext.define('MP.desktop.StartMenu',{extend:'Ext.panel.Panel',requires:['Ext.menu.Menu','Ext.toolbar.Toolbar'],ariaRole:'menu',cls:'x-menu mp-desktop-start-menu',defaultAlign:'bl-tl',iconCls:'user',floating:true,shadow:true,width:300,initComponent:function(){var me=this,menu=me.menu;me.menu=new Ext.menu.Menu({cls:'mp-desktop-start-menu-body',border:false,floating:false,items:menu});me.menu.layout.align='stretch';me.items=[me.menu];me.layout='fit';Ext.menu.Manager.register(me);me.callParent();me.toolbar=new Ext.toolbar.Toolbar(Ext.apply({dock:'right',cls:'mp-desktop-start-menu-toolbar',vertical:true,width:100,listeners:{add:function(tb,c){c.on({click:function(){me.hide();}});}}},me.toolConfig));me.toolbar.layout.align='stretch';me.addDocked(me.toolbar);delete me.toolItems;},addMenuItem:function(){var cmp=this.menu;cmp.add.apply(cmp,arguments);},addToolItem:function(){var cmp=this.toolbar;cmp.add.apply(cmp,arguments);}});Ext.define('SoL.window.LostPassword',{extend:'Ext.Window',uses:'Ext.form.Panel',title:_('Lost password'),titleAlign:'center',width:400,autoHeight:true,closable:true,resizable:false,draggable:false,layout:'fit',border:false,modal:true,initComponent:function(){var me=this;Ext.apply(me,{items:[{xtype:'form',plain:true,frame:true,border:0,bodyPadding:5,url:'/auth/lostPassword',items:me.getFormFields()}]});me.callParent();},buttons:['->',{text:_("Confirm"),type:"submit",formBind:true,handler:function(button){var win=button.up('window'),panel=win.down('form'),form=panel.getForm();if(form.isValid()){panel.getEl().mask(_("Requesting password reset…"));form.submit({headers:{'X-CSRF-Token':__csrf_token__},success:function(f,a){Ext.Msg.show({title:_('Request succeeded'),msg:_('An email has been sent to the given address, you should receive it shortly: please check your inbox and follow the link within two days to renew your password.'),icon:Ext.Msg.INFO,buttons:Ext.Msg.OK,fn:function(){win.close();}});},failure:function(f,a){f.owner.el.unmask();Ext.Msg.alert(_('Error'),a.result?a.result.message:_('No response from the server'));if(a.result&&a.result.errors){form.markInvalid(a.result.errors);}}});}}}],defaultFocus:'email',getFormFields:function(){return[{itemId:'email',xtype:'textfield',fieldLabel:_('Email'),name:'email',allowBlank:false,anchor:'100%',selectOnFocus:true,vtype:'email'}];}});Ext.define('SoL.window.Help',{extend:'Ext.window.Window',uses:['SoL.component.IFrame'],layout:'fit',width:800,height:640,maximizable:true,iconCls:'help-icon',initComponent:function(){var me=this;me.items=[{xtype:'iframe'}];me.callParent();},onShow:function(){var me=this;var iframe=me.items.getAt(0);this.callParent();iframe.load(me.help_url);}});Ext.define('Ext.grid.plugin.CellEditing',{alias:'plugin.cellediting',extend:'Ext.grid.plugin.Editing',requires:['Ext.grid.CellEditor','Ext.util.DelayedTask'],lockableScope:'both',init:function(grid){var me=this,lockingPartner=me.lockingPartner;me.callParent(arguments);if(lockingPartner){if(lockingPartner.editors){me.editors=lockingPartner.editors;}else{me.editors=lockingPartner.editors=new Ext.util.MixedCollection(false,function(editor){return editor.editorId;});}}else{me.editors=new Ext.util.MixedCollection(false,function(editor){return editor.editorId;});}},onReconfigure:function(grid,store,columns){if(columns){this.editors.clear();}
this.callParent();},destroy:function(){var me=this;if(me.editors){me.editors.each(Ext.destroy,Ext);me.editors.clear();}
me.callParent(arguments);},onBodyScroll:function(){var me=this,ed=me.getActiveEditor(),scroll=me.view.el.getScroll();if(ed&&ed.editing&&ed.editingPlugin===me){if(scroll.top!==me.scroll.top){if(ed.field){if(ed.field.triggerBlur){ed.field.triggerBlur();}else{ed.field.blur();}}}
else{ed.realign();}}
me.scroll=scroll;},initCancelTriggers:function(){var me=this,grid=me.grid,view=grid.view;me.mon(view,'bodyscroll',me.onBodyScroll,me);me.mon(grid,{columnresize:me.cancelEdit,columnmove:me.cancelEdit,scope:me});},isCellEditable:function(record,columnHeader){var me=this,context=me.getEditingContext(record,columnHeader);if(me.grid.view.isVisible(true)&&context){columnHeader=context.column;record=context.record;if(columnHeader&&me.getEditor(record,columnHeader)){return true;}}},startEdit:function(record,columnHeader,context){var me=this,ed;if(!context){me.preventBeforeCheck=true;context=me.callParent(arguments);delete me.preventBeforeCheck;if(context===false){return false;}}
if(context&&me.grid.view.isVisible(true)){record=context.record;columnHeader=context.column;me.completeEdit();if(columnHeader&&!columnHeader.getEditor(record)){return false;}
me.context=context;context.originalValue=context.value=record.get(columnHeader.dataIndex);if(me.beforeEdit(context)===false||me.fireEvent('beforeedit',me,context)===false||context.cancel){return false;}
ed=me.getEditor(record,columnHeader);me.grid.view.cancelFocus();me.view.scrollCellIntoView(me.getCell(record,columnHeader));if(ed){me.showEditor(ed,context,context.value);return true;}
return false;}},showEditor:function(ed,context,value){var me=this,record=context.record,columnHeader=context.column,sm=me.grid.getSelectionModel(),selection=sm.getCurrentPosition(),otherView=selection&&selection.view;if(otherView&&otherView!==me.view){return me.lockingPartner.showEditor(ed,me.lockingPartner.getEditingContext(selection.record,selection.columnHeader),value);}
me.setEditingContext(context);me.setActiveEditor(ed);me.setActiveRecord(record);me.setActiveColumn(columnHeader);if(sm.selectByPosition&&(!selection||selection.column!==context.colIdx||selection.row!==context.rowIdx)){sm.selectByPosition({row:context.rowIdx,column:context.colIdx,view:me.view});}
ed.startEdit(me.getCell(record,columnHeader),value,context);me.editing=true;me.scroll=me.view.el.getScroll();},completeEdit:function(){var activeEd=this.getActiveEditor();if(activeEd){activeEd.completeEdit();this.editing=false;}},setEditingContext:function(context){this.context=context;if(this.lockingPartner){this.lockingPartner.context=context;}},setActiveEditor:function(ed){this.activeEditor=ed;if(this.lockingPartner){this.lockingPartner.activeEditor=ed;}},getActiveEditor:function(){return this.activeEditor;},setActiveColumn:function(column){this.activeColumn=column;if(this.lockingPartner){this.lockingPartner.activeColumn=column;}},getActiveColumn:function(){return this.activeColumn;},setActiveRecord:function(record){this.activeRecord=record;if(this.lockingPartner){this.lockingPartner.activeRecord=record;}},getActiveRecord:function(){return this.activeRecord;},getEditor:function(record,column){var me=this,editors=me.editors,editorId=column.getItemId(),editor=editors.getByKey(editorId),editorOwner=me.grid.ownerLockable||me.grid;if(!editor){editor=column.getEditor(record);if(!editor){return false;}
if(editor instanceof Ext.grid.CellEditor){editor.floating=true;}
else{editor=new Ext.grid.CellEditor({floating:true,editorId:editorId,field:editor});}
editorOwner.add(editor);editor.on({scope:me,specialkey:me.onSpecialKey,complete:me.onEditComplete,canceledit:me.cancelEdit});column.on('removed',me.cancelActiveEdit,me);editors.add(editor);}
if(column.isTreeColumn){editor.isForTree=column.isTreeColumn;editor.addCls(Ext.baseCSSPrefix+'tree-cell-editor')}
editor.grid=me.grid;editor.editingPlugin=me;return editor;},cancelActiveEdit:function(column){var context=this.context
if(context&&context.column===column){this.cancelEdit();}},setColumnField:function(column,field){var ed=this.editors.getByKey(column.getItemId());Ext.destroy(ed,column.field);this.editors.removeAtKey(column.getItemId());this.callParent(arguments);},getCell:function(record,column){return this.grid.getView().getCell(record,column);},onSpecialKey:function(ed,field,e){var sm;if(e.getKey()===e.TAB){e.stopEvent();if(ed){ed.onEditorTab(e);}
sm=ed.up('tablepanel').getSelectionModel();if(sm.onEditorTab){return sm.onEditorTab(ed.editingPlugin,e);}}},onEditComplete:function(ed,value,startValue){var me=this,activeColumn=me.getActiveColumn(),context=me.context,record;if(activeColumn){record=context.record;me.setActiveEditor(null);me.setActiveColumn(null);me.setActiveRecord(null);context.value=value;if(!me.validateEdit()){return;}
if(!record.isEqual(value,startValue)){record.set(activeColumn.dataIndex,value);}
context.view.focus(false,true);me.fireEvent('edit',me,context);me.editing=false;}},cancelEdit:function(){var me=this,activeEd=me.getActiveEditor();me.setActiveEditor(null);me.setActiveColumn(null);me.setActiveRecord(null);if(activeEd){activeEd.cancelEdit();me.context.view.focus();me.callParent(arguments);return;}
return true;},startEditByPosition:function(position){if(!position.isCellContext){position=new Ext.grid.CellContext(this.view).setPosition(position);}
position.setColumn(this.view.getHeaderCt().getVisibleHeaderClosestToIndex(position.column).getIndex());return this.startEdit(position.record,position.columnHeader);}});Ext.define('MP.window.Notification',{extend:'Ext.window.Window',alias:'widget.mpNotification',cls:'mp-notification-window',autoClose:true,autoHeight:true,plain:false,draggable:false,shadow:false,focus:Ext.emptyFn,manager:null,useXAxis:false,position:'br',spacing:6,paddingX:30,paddingY:10,slideInAnimation:'easeIn',slideBackAnimation:'bounceOut',slideInDuration:1500,slideBackDuration:1000,hideDuration:500,autoCloseDelay:7000,stickOnClick:true,stickWhileHover:true,isHiding:false,isFading:false,destroyAfterHide:false,closeOnMouseOut:false,xPos:0,yPos:0,statics:{defaultManager:{el:null}},initComponent:function(){var me=this;if(Ext.isDefined(me.corner)){me.position=me.corner;}
if(Ext.isDefined(me.slideDownAnimation)){me.slideBackAnimation=me.slideDownAnimation;}
if(Ext.isDefined(me.autoDestroyDelay)){me.autoCloseDelay=me.autoDestroyDelay;}
if(Ext.isDefined(me.autoHideDelay)){me.autoCloseDelay=me.autoHideDelay;}
if(Ext.isDefined(me.autoHide)){me.autoClose=me.autoHide;}
if(Ext.isDefined(me.slideInDelay)){me.slideInDuration=me.slideInDelay;}
if(Ext.isDefined(me.slideDownDelay)){me.slideBackDuration=me.slideDownDelay;}
if(Ext.isDefined(me.fadeDelay)){me.hideDuration=me.fadeDelay;}
me.position=me.position.replace(/c/,'');me.updateAlignment(me.position);me.setManager(me.manager);me.callParent(arguments);},onRender:function(){var me=this;me.callParent(arguments);me.el.hover(function(){me.mouseIsOver=true;},function(){me.mouseIsOver=false;if(me.closeOnMouseOut){me.closeOnMouseOut=false;me.close();}},me);},updateAlignment:function(position){var me=this;switch(position){case'br':me.paddingFactorX=-1;me.paddingFactorY=-1;me.siblingAlignment="br-br";if(me.useXAxis){me.managerAlignment="bl-br";}else{me.managerAlignment="tr-br";}
break;case'bl':me.paddingFactorX=1;me.paddingFactorY=-1;me.siblingAlignment="bl-bl";if(me.useXAxis){me.managerAlignment="br-bl";}else{me.managerAlignment="tl-bl";}
break;case'tr':me.paddingFactorX=-1;me.paddingFactorY=1;me.siblingAlignment="tr-tr";if(me.useXAxis){me.managerAlignment="tl-tr";}else{me.managerAlignment="br-tr";}
break;case'tl':me.paddingFactorX=1;me.paddingFactorY=1;me.siblingAlignment="tl-tl";if(me.useXAxis){me.managerAlignment="tr-tl";}else{me.managerAlignment="bl-tl";}
break;case'b':me.paddingFactorX=0;me.paddingFactorY=-1;me.siblingAlignment="b-b";me.useXAxis=0;me.managerAlignment="t-b";break;case't':me.paddingFactorX=0;me.paddingFactorY=1;me.siblingAlignment="t-t";me.useXAxis=0;me.managerAlignment="b-t";break;case'l':me.paddingFactorX=1;me.paddingFactorY=0;me.siblingAlignment="l-l";me.useXAxis=1;me.managerAlignment="r-l";break;case'r':me.paddingFactorX=-1;me.paddingFactorY=0;me.siblingAlignment="r-r";me.useXAxis=1;me.managerAlignment="l-r";break;}},getXposAlignedToManager:function(){var me=this;var xPos=0;if(me.manager&&me.manager.el&&me.manager.el.dom){if(!me.useXAxis){return me.el.getLeft();}else{if(me.position=='br'||me.position=='tr'||me.position=='r'){xPos+=me.manager.el.getAnchorXY('r')[0];xPos-=(me.el.getWidth()+me.paddingX);}else{xPos+=me.manager.el.getAnchorXY('l')[0];xPos+=me.paddingX;}}}
return xPos;},getYposAlignedToManager:function(){var me=this;var yPos=0;if(me.manager&&me.manager.el&&me.manager.el.dom){if(me.useXAxis){return me.el.getTop();}else{if(me.position=='br'||me.position=='bl'||me.position=='b'){yPos+=me.manager.el.getAnchorXY('b')[1];yPos-=(me.el.getHeight()+me.paddingY);}else{yPos+=me.manager.el.getAnchorXY('t')[1];yPos+=me.paddingY;}}}
return yPos;},getXposAlignedToSibling:function(sibling){var me=this;if(me.useXAxis){if(me.position=='tl'||me.position=='bl'||me.position=='l'){return(sibling.xPos+sibling.el.getWidth()+sibling.spacing);}else{return(sibling.xPos-me.el.getWidth()-me.spacing);}}else{return me.el.getLeft();}},getYposAlignedToSibling:function(sibling){var me=this;if(me.useXAxis){return me.el.getTop();}else{if(me.position=='tr'||me.position=='tl'||me.position=='t'){return(sibling.yPos+sibling.el.getHeight()+sibling.spacing);}else{return(sibling.yPos-me.el.getHeight()-sibling.spacing);}}},getNotifications:function(alignment){var me=this;if(!me.manager.notifications[alignment]){me.manager.notifications[alignment]=[];}
return me.manager.notifications[alignment];},setManager:function(manager){var me=this;me.manager=manager;if(typeof me.manager=='string'){me.manager=Ext.getCmp(me.manager);}
if(!me.manager){me.manager=me.statics().defaultManager;if(!me.manager.el){me.manager.el=Ext.getBody();}}
if(typeof me.manager.notifications=='undefined'){me.manager.notifications={};}},beforeShow:function(){var me=this;if(me.stickOnClick){if(me.body&&me.body.dom){Ext.fly(me.body.dom).on('click',function(){me.cancelAutoClose();me.addCls('notification-fixed');},me);}}
if(me.autoClose){me.task=new Ext.util.DelayedTask(me.doAutoClose,me);me.task.delay(me.autoCloseDelay);}
me.el.setX(-10000);me.el.setOpacity(1);},afterShow:function(){var me=this;me.callParent(arguments);var notifications=me.getNotifications(me.managerAlignment);if(notifications.length){me.el.alignTo(notifications[notifications.length-1].el,me.siblingAlignment,[0,0]);me.xPos=me.getXposAlignedToSibling(notifications[notifications.length-1]);me.yPos=me.getYposAlignedToSibling(notifications[notifications.length-1]);}else{me.el.alignTo(me.manager.el,me.managerAlignment,[(me.paddingX*me.paddingFactorX),(me.paddingY*me.paddingFactorY)],false);me.xPos=me.getXposAlignedToManager();me.yPos=me.getYposAlignedToManager();}
Ext.Array.include(notifications,me);me.el.animate({from:{x:me.el.getX(),y:me.el.getY()},to:{x:me.xPos,y:me.yPos,opacity:1},easing:me.slideInAnimation,duration:me.slideInDuration,dynamic:true});me.toFront();},slideBack:function(){var me=this;var notifications=me.getNotifications(me.managerAlignment);var index=Ext.Array.indexOf(notifications,me);if(!me.isHiding&&me.el&&me.manager&&me.manager.el&&me.manager.el.dom&&me.manager.el.isVisible()){if(index){me.xPos=me.getXposAlignedToSibling(notifications[index-1]);me.yPos=me.getYposAlignedToSibling(notifications[index-1]);}else{me.xPos=me.getXposAlignedToManager();me.yPos=me.getYposAlignedToManager();}
me.stopAnimation();me.el.animate({to:{x:me.xPos,y:me.yPos},easing:me.slideBackAnimation,duration:me.slideBackDuration,dynamic:true});}},cancelAutoClose:function(){var me=this;if(me.autoClose){me.task.cancel();}},doAutoClose:function(){var me=this;if(!(me.stickWhileHover&&me.mouseIsOver)){me.close();}else{me.closeOnMouseOut=true;}},removeFromManager:function(){var me=this;if(me.manager){var notifications=me.getNotifications(me.managerAlignment);var index=Ext.Array.indexOf(notifications,me);if(index!=-1){Ext.Array.erase(notifications,index,1);for(;index<notifications.length;index++){notifications[index].slideBack();}}}},hide:function(){var me=this;if(me.isHiding){if(!me.isFading){me.callParent(arguments);me.isHiding=false;}}else{me.isHiding=true;me.isFading=true;me.cancelAutoClose();if(me.el){me.el.fadeOut({opacity:0,easing:'easeIn',duration:me.hideDuration,remove:me.destroyAfterHide,listeners:{afteranimate:function(){me.isFading=false;me.removeCls('notification-fixed');me.removeFromManager();me.hide(me.animateTarget,me.doClose,me);}}});}}
return me;},destroy:function(){var me=this;if(!me.hidden){me.destroyAfterHide=true;me.hide(me.animateTarget,me.doClose,me);}else{me.callParent(arguments);}}});Ext.define('SoL.window.ChangeLanguage',{extend:'Ext.Window',uses:'Ext.form.Panel',title:_('Change your account UI language'),titleAlign:'center',width:400,autoHeight:true,closable:true,resizable:false,draggable:false,layout:'fit',border:false,modal:true,currentLanguage:null,initComponent:function(){var me=this;Ext.apply(me,{items:[{xtype:'form',plain:true,frame:true,border:0,bodyPadding:5,url:'/auth/changeLanguage',fieldDefaults:{labelWidth:150},items:me.getFormFields()}]});me.callParent();},buttons:['->',{text:_("Confirm"),type:"submit",formBind:true,handler:function(button){var win=button.up('window'),panel=win.down('form'),form=panel.getForm();if(form.isValid()){panel.getEl().mask(_("Changing UI language…"));form.submit({success:function(f,a){Ext.Msg.show({title:_('Change succeeded'),msg:_('Your account UI language has been successfully updated, it will be used at your next login.'),icon:Ext.Msg.INFO,buttons:Ext.Msg.OK,fn:function(){win.close();}});},failure:function(f,a){f.owner.el.unmask();Ext.Msg.alert(_('Error'),a.result?a.result.message:_('No response from the server'));if(a.result&&a.result.errors){form.markInvalid(a.result.errors);}}});}}}],getFormFields:function(){var me=this,flds=['code','name'],displayField='name',model=Ext.define('MP.data.ImplicitModel-'+Ext.id(),{extend:'Ext.data.Model',fields:flds,idProperty:'code'}),lstore=Ext.create('Ext.data.Store',{model:model,autoLoad:true,proxy:{type:'ajax',url:'/data/languages',reader:{type:'json',root:'root',idProperty:'code',totalProperty:'count'}},listeners:{load:function(){var f;if(me.currentLanguage){f=me.down('form').form.getFields().get(1);f.suspendEvents();f.setValue(me.currentLanguage);f.resumeEvents();}else{f=me.down('form').form.getFields().get(0);f.suspendEvents();f.setValue(true);f.resumeEvents();}}}});lstore.implicitModel=true;return[{xtype:'checkbox',fieldLabel:_('Use browser setting'),name:'use_browser_setting',listeners:{change:function(cb,value){var f=me.down('form').form.getFields().get(1);f.suspendEvents();f.setValue(value?null:me.currentLanguage);f.resumeEvents();}}},{xtype:'combo',fieldLabel:_('Language'),name:'language',store:lstore,valueField:'code',displayField:'name',loadingText:_('Loading…'),selectOnFocus:true,allowBlank:true,anchor:'100%',listeners:{select:function(c,value){var f=me.down('form').form.getFields().get(0);f.suspendEvents();f.setValue(!value);f.resumeEvents();}}},{xtype:'container',height:'auto',margin:'20 15 5 15',style:{textAlign:'center'},html:[_('If you change this setting, it will be applied at your <b>next</b> login.')].join('')}];}});Ext.define('Ext.grid.Panel',{extend:'Ext.panel.Table',requires:['Ext.grid.View'],alias:['widget.gridpanel','widget.grid'],alternateClassName:['Ext.list.ListView','Ext.ListView','Ext.grid.GridPanel'],viewType:'gridview',lockable:false,rowLines:true});Ext.define('Ext.tip.ToolTip',{extend:'Ext.tip.Tip',alias:'widget.tooltip',alternateClassName:'Ext.ToolTip',autoHide:true,showDelay:500,hideDelay:200,dismissDelay:5000,trackMouse:false,anchorToTarget:true,anchorOffset:0,targetCounter:0,quickShowInterval:250,initComponent:function(){var me=this;me.callParent(arguments);me.lastActive=new Date();me.setTarget(me.target);me.origAnchor=me.anchor;},onRender:function(ct,position){var me=this;me.callParent(arguments);me.anchorCls=Ext.baseCSSPrefix+'tip-anchor-'+me.getAnchorPosition();me.anchorEl=me.el.createChild({cls:Ext.baseCSSPrefix+'tip-anchor '+me.anchorCls});},setTarget:function(target){var me=this,t=Ext.get(target),tg;if(me.target){tg=Ext.get(me.target);me.mun(tg,'mouseover',me.onTargetOver,me);me.mun(tg,'mouseout',me.onTargetOut,me);me.mun(tg,'mousemove',me.onMouseMove,me);}
me.target=t;if(t){me.mon(t,{freezeEvent:true,mouseover:me.onTargetOver,mouseout:me.onTargetOut,mousemove:me.onMouseMove,scope:me});}
if(me.anchor){me.anchorTarget=me.target;}},onMouseMove:function(e){var me=this,t=me.delegate?e.getTarget(me.delegate):me.triggerElement=true,xy;if(t){me.targetXY=e.getXY();if(t===me.triggerElement){if(!me.hidden&&me.trackMouse){xy=me.getTargetXY();if(me.constrainPosition){xy=me.el.adjustForConstraints(xy,me.el.parent());}
me.setPagePosition(xy);}}else{me.hide();me.lastActive=new Date(0);me.onTargetOver(e);}}else if((!me.closable&&me.isVisible())&&me.autoHide!==false){me.hide();}},getTargetXY:function(){var me=this,mouseOffset,offsets,xy,dw,dh,de,bd,scrollX,scrollY,axy,sz,constrainPosition;if(me.delegate){me.anchorTarget=me.triggerElement;}
if(me.anchor){me.targetCounter++;offsets=me.getOffsets();xy=(me.anchorToTarget&&!me.trackMouse)?me.getAlignToXY(me.anchorTarget,me.getAnchorAlign()):me.targetXY;dw=Ext.Element.getViewWidth()-5;dh=Ext.Element.getViewHeight()-5;de=document.documentElement;bd=document.body;scrollX=(de.scrollLeft||bd.scrollLeft||0)+5;scrollY=(de.scrollTop||bd.scrollTop||0)+5;axy=[xy[0]+offsets[0],xy[1]+offsets[1]];sz=me.getSize();constrainPosition=me.constrainPosition;me.anchorEl.removeCls(me.anchorCls);if(me.targetCounter<2&&constrainPosition){if(axy[0]<scrollX){if(me.anchorToTarget){me.defaultAlign='l-r';if(me.mouseOffset){me.mouseOffset[0]*=-1;}}
me.anchor='left';return me.getTargetXY();}
if(axy[0]+sz.width>dw){if(me.anchorToTarget){me.defaultAlign='r-l';if(me.mouseOffset){me.mouseOffset[0]*=-1;}}
me.anchor='right';return me.getTargetXY();}
if(axy[1]<scrollY){if(me.anchorToTarget){me.defaultAlign='t-b';if(me.mouseOffset){me.mouseOffset[1]*=-1;}}
me.anchor='top';return me.getTargetXY();}
if(axy[1]+sz.height>dh){if(me.anchorToTarget){me.defaultAlign='b-t';if(me.mouseOffset){me.mouseOffset[1]*=-1;}}
me.anchor='bottom';return me.getTargetXY();}}
me.anchorCls=Ext.baseCSSPrefix+'tip-anchor-'+me.getAnchorPosition();me.anchorEl.addCls(me.anchorCls);me.targetCounter=0;return axy;}else{mouseOffset=me.getMouseOffset();return(me.targetXY)?[me.targetXY[0]+mouseOffset[0],me.targetXY[1]+mouseOffset[1]]:mouseOffset;}},getMouseOffset:function(){var me=this,offset=me.anchor?[0,0]:[15,18];if(me.mouseOffset){offset[0]+=me.mouseOffset[0];offset[1]+=me.mouseOffset[1];}
return offset;},getAnchorPosition:function(){var me=this,m;if(me.anchor){me.tipAnchor=me.anchor.charAt(0);}else{m=me.defaultAlign.match(/^([a-z]+)-([a-z]+)(\?)?$/);me.tipAnchor=m[1].charAt(0);}
switch(me.tipAnchor){case't':return'top';case'b':return'bottom';case'r':return'right';}
return'left';},getAnchorAlign:function(){switch(this.anchor){case'top':return'tl-bl';case'left':return'tl-tr';case'right':return'tr-tl';default:return'bl-tl';}},getOffsets:function(){var me=this,mouseOffset,offsets,ap=me.getAnchorPosition().charAt(0);if(me.anchorToTarget&&!me.trackMouse){switch(ap){case't':offsets=[0,9];break;case'b':offsets=[0,-13];break;case'r':offsets=[-13,0];break;default:offsets=[9,0];break;}}else{switch(ap){case't':offsets=[-15-me.anchorOffset,30];break;case'b':offsets=[-19-me.anchorOffset,-13-me.el.dom.offsetHeight];break;case'r':offsets=[-15-me.el.dom.offsetWidth,-13-me.anchorOffset];break;default:offsets=[25,-13-me.anchorOffset];break;}}
mouseOffset=me.getMouseOffset();offsets[0]+=mouseOffset[0];offsets[1]+=mouseOffset[1];return offsets;},onTargetOver:function(e){var me=this,delegate=me.delegate,t;if(me.disabled||e.within(me.target.dom,true)){return;}
t=delegate?e.getTarget(delegate):true;if(t){me.triggerElement=t;me.triggerEvent=e;me.clearTimer('hide');me.targetXY=e.getXY();me.delayShow();}},delayShow:function(){var me=this;if(me.hidden&&!me.showTimer){if(Ext.Date.getElapsed(me.lastActive)<me.quickShowInterval){me.show();}else{me.showTimer=Ext.defer(me.showFromDelay,me.showDelay,me);}}
else if(!me.hidden&&me.autoHide!==false){me.show();}},showFromDelay:function(){this.fromDelayShow=true;this.show();delete this.fromDelayShow;},onShowVeto:function(){this.callParent();delete this.triggerElement;this.clearTimer('show');},onTargetOut:function(e){var me=this,triggerEl=me.triggerElement,target=triggerEl===true?me.target:triggerEl;if(me.disabled||!triggerEl||e.within(target,true)){return;}
if(me.showTimer){me.clearTimer('show');me.triggerElement=null;}
if(me.autoHide!==false){me.delayHide();}},delayHide:function(){var me=this;if(!me.hidden&&!me.hideTimer){me.hideTimer=Ext.defer(me.hide,me.hideDelay,me);}},hide:function(){var me=this;me.clearTimer('dismiss');me.lastActive=new Date();if(me.anchorEl){me.anchorEl.hide();}
me.callParent(arguments);delete me.triggerElement;},show:function(){var me=this;this.callParent();if(this.hidden===false){me.setPagePosition(-10000,-10000);if(me.anchor){me.anchor=me.origAnchor;}
if(!me.calledFromShowAt){me.showAt(me.getTargetXY());}
if(me.anchor){me.syncAnchor();me.anchorEl.show();}else{me.anchorEl.hide();}}},showAt:function(xy){var me=this;me.lastActive=new Date();me.clearTimers();me.calledFromShowAt=true;if(!me.isVisible()){this.callParent(arguments);}
if(me.isVisible()){me.setPagePosition(xy[0],xy[1]);if(me.constrainPosition||me.constrain){me.doConstrain();}
me.toFront(true);me.el.sync(true);if(me.dismissDelay&&me.autoHide!==false){me.dismissTimer=Ext.defer(me.hide,me.dismissDelay,me);}
if(me.anchor){me.syncAnchor();if(!me.anchorEl.isVisible()){me.anchorEl.show();}}else{me.anchorEl.hide();}}
delete me.calledFromShowAt;},syncAnchor:function(){var me=this,anchorPos,targetPos,offset;switch(me.tipAnchor.charAt(0)){case't':anchorPos='b';targetPos='tl';offset=[20+me.anchorOffset,1];break;case'r':anchorPos='l';targetPos='tr';offset=[-1,12+me.anchorOffset];break;case'b':anchorPos='t';targetPos='bl';offset=[20+me.anchorOffset,-1];break;default:anchorPos='r';targetPos='tl';offset=[1,12+me.anchorOffset];break;}
me.anchorEl.alignTo(me.el,anchorPos+'-'+targetPos,offset);me.anchorEl.setStyle('z-index',parseInt(me.el.getZIndex(),10)||0+1).setVisibilityMode(Ext.Element.DISPLAY);},setPagePosition:function(x,y){var me=this;me.callParent(arguments);if(me.anchor){me.syncAnchor();}},_timerNames:{},clearTimer:function(name){var me=this,names=me._timerNames,propName=names[name]||(names[name]=name+'Timer'),timer=me[propName];if(timer){clearTimeout(timer);me[propName]=null;}},clearTimers:function(){var me=this;me.clearTimer('show');me.clearTimer('dismiss');me.clearTimer('hide');},onShow:function(){var me=this;me.callParent();me.mon(Ext.getDoc(),'mousedown',me.onDocMouseDown,me);},onHide:function(){var me=this;me.callParent();me.mun(Ext.getDoc(),'mousedown',me.onDocMouseDown,me);},onDocMouseDown:function(e){var me=this;if(!me.closable&&!e.within(me.el.dom)){me.disable();Ext.defer(me.doEnable,100,me);}},doEnable:function(){if(!this.isDestroyed){this.enable();}},onDisable:function(){this.callParent();this.clearTimers();this.hide();},beforeDestroy:function(){var me=this;me.clearTimers();Ext.destroy(me.anchorEl);delete me.anchorEl;delete me.target;delete me.anchorTarget;delete me.triggerElement;me.callParent();},onDestroy:function(){Ext.getDoc().un('mousedown',this.onDocMouseDown,this);this.callParent();}});Ext.define('SoL.window.ChangePassword',{extend:'Ext.Window',uses:'Ext.form.Panel',title:_('Change your account password'),titleAlign:'center',width:400,autoHeight:true,closable:true,resizable:false,draggable:false,layout:'fit',border:false,modal:true,initComponent:function(){var me=this;Ext.apply(me,{items:[{xtype:'form',plain:true,frame:true,border:0,bodyPadding:5,url:'/auth/changePassword',items:me.getFormFields()}]});me.callParent();},buttons:['->',{text:_("Confirm"),type:"submit",formBind:true,handler:function(button){var win=button.up('window'),panel=win.down('form'),form=panel.getForm();if(form.isValid()){panel.getEl().mask(_("Changing password…"));form.submit({success:function(f,a){Ext.Msg.show({title:_('Change succeeded'),msg:_('Your account password has been successfully updated.'),icon:Ext.Msg.INFO,buttons:Ext.Msg.OK,fn:function(){win.close();}});},failure:function(f,a){f.owner.el.unmask();Ext.Msg.alert(_('Error'),a.result?a.result.message:_('No response from the server'));if(a.result&&a.result.errors){form.markInvalid(a.result.errors);}}});}}}],defaultFocus:'oldpassword',getFormFields:function(){return[{xtype:'textfield',fieldLabel:_('Old password'),name:'oldpassword',allowBlank:false,inputType:'password',minLength:6,anchor:'100%',selectOnFocus:true},{xtype:'textfield',fieldLabel:_('New password'),name:'newpassword',allowBlank:false,inputType:'password',minLength:6,anchor:'100%',selectOnFocus:true}];}});Ext.define('SoL.window.ResetPassword',{extend:'Ext.Window',uses:'Ext.form.Panel',title:_('Reset lost password'),titleAlign:'center',width:400,autoHeight:true,closable:false,resizable:false,draggable:false,layout:'fit',border:false,modal:true,initComponent:function(){var me=this;Ext.apply(me,{items:[{xtype:'form',plain:true,frame:true,border:0,bodyPadding:5,url:'/auth/resetPassword',baseParams:{token:window.location.hash.substr(16)},items:me.getFormFields()}]});me.callParent();},buttons:['->',{text:_("Change password"),type:"submit",formBind:true,handler:function(button){var win=button.up('window'),panel=win.down('form'),form=panel.getForm();if(form.isValid()){panel.getEl().mask(_("Changing password…"));form.submit({success:function(f,a){Ext.Msg.show({title:_('Password changed'),msg:_('Your password has been successfully changed, you will be redirected to the authentication panel.'),icon:Ext.Msg.INFO,buttons:Ext.Msg.OK,fn:function(){win.close();window.location.assign(a.result.location);}});},failure:function(f,a){f.owner.el.unmask();Ext.Msg.alert(_('Error'),a.result?a.result.message:_('No response from the server'));if(a.result&&a.result.errors){form.markInvalid(a.result.errors);}}});}}}],defaultFocus:'password',getFormFields:function(){return[{xtype:'textfield',fieldLabel:_('New password'),name:'password',allowBlank:false,inputType:'password',minLength:6,anchor:'100%',selectOnFocus:true}];}});Ext.define('Ext.window.MessageBox',{extend:'Ext.window.Window',requires:['Ext.toolbar.Toolbar','Ext.form.field.Text','Ext.form.field.TextArea','Ext.form.field.Display','Ext.button.Button','Ext.layout.container.Anchor','Ext.layout.container.HBox','Ext.ProgressBar'],alias:'widget.messagebox',OK:1,YES:2,NO:4,CANCEL:8,OKCANCEL:9,YESNO:6,YESNOCANCEL:14,INFO:Ext.baseCSSPrefix+'message-box-info',WARNING:Ext.baseCSSPrefix+'message-box-warning',QUESTION:Ext.baseCSSPrefix+'message-box-question',ERROR:Ext.baseCSSPrefix+'message-box-error',hideMode:'offsets',closeAction:'hide',resizable:false,title:'&#160;',defaultMinWidth:250,defaultMaxWidth:600,defaultMinHeight:110,defaultMaxHeight:500,minWidth:null,maxWidth:null,minHeight:null,maxHeight:null,constrain:true,cls:[Ext.baseCSSPrefix+'message-box',Ext.baseCSSPrefix+'hide-offsets'],layout:{type:'vbox',align:'stretch'},shrinkWrapDock:true,defaultTextHeight:75,minProgressWidth:250,minPromptWidth:250,buttonText:{ok:'OK',yes:'Yes',no:'No',cancel:'Cancel'},buttonIds:['ok','yes','no','cancel'],titleText:{confirm:'Confirm',prompt:'Prompt',wait:'Loading...',alert:'Attention'},iconHeight:35,iconWidth:50,makeButton:function(btnIdx){var btnId=this.buttonIds[btnIdx];return new Ext.button.Button({handler:this.btnCallback,itemId:btnId,scope:this,text:this.buttonText[btnId],minWidth:75});},btnCallback:function(btn){var me=this,value,field;if(me.cfg.prompt||me.cfg.multiline){if(me.cfg.multiline){field=me.textArea;}else{field=me.textField;}
value=field.getValue();field.reset();}
me.hide();me.userCallback(btn.itemId,value,me.cfg);},hide:function(){var me=this,cls=me.cfg.cls;me.dd.endDrag();me.progressBar.reset();if(cls){me.removeCls(cls);}
me.callParent(arguments);},constructor:function(cfg){var me=this;me.callParent(arguments);me.minWidth=me.defaultMinWidth=(me.minWidth||me.defaultMinWidth);me.maxWidth=me.defaultMaxWidth=(me.maxWidth||me.defaultMaxWidth);me.minHeight=me.defaultMinHeight=(me.minHeight||me.defaultMinHeight);me.maxHeight=me.defaultMaxHeight=(me.maxHeight||me.defaultMaxHeight);},initComponent:function(cfg){var me=this,baseId=me.id,i,button;me.title='&#160;';me.topContainer=new Ext.container.Container({layout:'hbox',padding:10,style:{overflow:'hidden'},items:[me.iconComponent=new Ext.Component({width:me.iconWidth,height:me.iconHeight}),me.promptContainer=new Ext.container.Container({flex:1,layout:'anchor',items:[me.msg=new Ext.form.field.Display({id:baseId+'-displayfield',cls:me.baseCls+'-text'}),me.textField=new Ext.form.field.Text({id:baseId+'-textfield',anchor:'100%',enableKeyEvents:true,listeners:{keydown:me.onPromptKey,scope:me}}),me.textArea=new Ext.form.field.TextArea({id:baseId+'-textarea',anchor:'100%',height:75})]})]});me.progressBar=new Ext.ProgressBar({id:baseId+'-progressbar',margins:'0 10 10 10'});me.items=[me.topContainer,me.progressBar];me.msgButtons=[];for(i=0;i<4;i++){button=me.makeButton(i);me.msgButtons[button.itemId]=button;me.msgButtons.push(button);}
me.bottomTb=new Ext.toolbar.Toolbar({id:baseId+'-toolbar',ui:'footer',dock:'bottom',layout:{pack:'center'},items:[me.msgButtons[0],me.msgButtons[1],me.msgButtons[2],me.msgButtons[3]]});me.dockedItems=[me.bottomTb];me.on('close',me.onClose,me);me.callParent();},onClose:function(){var btn=this.header.child('[type=close]');btn.itemId='cancel';this.btnCallback(btn);delete btn.itemId;},onPromptKey:function(textField,e){var me=this;if(e.keyCode===e.RETURN||e.keyCode===10){if(me.msgButtons.ok.isVisible()){me.msgButtons.ok.handler.call(me,me.msgButtons.ok);}else if(me.msgButtons.yes.isVisible()){me.msgButtons.yes.handler.call(me,me.msgButtons.yes);}}},reconfigure:function(cfg){var me=this,buttons=0,hideToolbar=true,oldButtonText=me.buttonText,resizer=me.resizer,resizeTracker,width,height,i,textArea,textField,msg,progressBar,msgButtons;me.updateButtonText();cfg=cfg||{};me.cfg=cfg;if(cfg.width){width=cfg.width;}
if(cfg.height){height=cfg.height;}
me.minWidth=cfg.minWidth||me.defaultMinWidth;me.maxWidth=cfg.maxWidth||me.defaultMaxWidth;me.minHeight=cfg.minHeight||me.defaultMinHeight;me.maxHeight=cfg.maxHeight||me.defaultMaxHeight;if(resizer){resizeTracker=resizer.resizeTracker;resizer.minWidth=resizeTracker.minWidth=me.minWidth;resizer.maxWidth=resizeTracker.maxWidth=me.maxWidth;resizer.minHeight=resizeTracker.minHeight=me.minHeight;resizer.maxHeight=resizeTracker.maxHeight=me.maxHeight;}
delete me.defaultFocus;if(cfg.defaultFocus){me.defaultFocus=cfg.defaultFocus;}
me.animateTarget=cfg.animateTarget||undefined;me.modal=cfg.modal!==false;me.setTitle(cfg.title||'');me.setIconCls(cfg.iconCls||'');if(Ext.isObject(cfg.buttons)){me.buttonText=cfg.buttons;buttons=0;}else{me.buttonText=cfg.buttonText||me.buttonText;buttons=Ext.isNumber(cfg.buttons)?cfg.buttons:0;}
buttons=buttons|me.updateButtonText();me.buttonText=oldButtonText;Ext.suspendLayouts();delete me.width;delete me.height;if(width||height){if(width){me.setWidth(width);}
if(height){me.setHeight(height);}}
me.hidden=false;if(!me.rendered){me.render(Ext.getBody());}
me.closable=cfg.closable!==false&&!cfg.wait;me.header.child('[type=close]').setVisible(me.closable);if(!cfg.title&&!me.closable&&!cfg.iconCls){me.header.hide();}else{me.header.show();}
me.liveDrag=!cfg.proxyDrag;me.userCallback=Ext.Function.bind(cfg.callback||cfg.fn||Ext.emptyFn,cfg.scope||Ext.global);me.setIcon(cfg.icon,cfg.iconWidth,cfg.iconHeight);msg=me.msg;if(cfg.msg){msg.setValue(cfg.msg);msg.show();}else{msg.hide();}
textArea=me.textArea;textField=me.textField;if(cfg.prompt||cfg.multiline){me.multiline=cfg.multiline;if(cfg.multiline){textArea.setValue(cfg.value);textArea.setHeight(cfg.defaultTextHeight||me.defaultTextHeight);textArea.show();textField.hide();me.defaultFocus=textArea;}else{textField.setValue(cfg.value);textArea.hide();textField.show();me.defaultFocus=textField;}}else{textArea.hide();textField.hide();}
progressBar=me.progressBar;if(cfg.progress||cfg.wait){progressBar.show();me.updateProgress(0,cfg.progressText);if(cfg.wait===true){progressBar.wait(cfg.waitConfig);}}else{progressBar.hide();}
msgButtons=me.msgButtons;for(i=0;i<4;i++){if(buttons&Math.pow(2,i)){if(!me.defaultFocus){me.defaultFocus=msgButtons[i];}
msgButtons[i].show();hideToolbar=false;}else{msgButtons[i].hide();}}
if(hideToolbar){me.bottomTb.hide();}else{me.bottomTb.show();}
Ext.resumeLayouts(true);},updateButtonText:function(){var me=this,buttonText=me.buttonText,buttons=0,btnId,btn;for(btnId in buttonText){if(buttonText.hasOwnProperty(btnId)){btn=me.msgButtons[btnId];if(btn){if(me.cfg&&me.cfg.buttonText){buttons=buttons|Math.pow(2,Ext.Array.indexOf(me.buttonIds,btnId));}
if(btn.text!=buttonText[btnId]){btn.setText(buttonText[btnId]);}}}}
return buttons;},show:function(cfg){var me=this,visibleFocusables;if(Ext.AbstractComponent.layoutSuspendCount){Ext.on({resumelayouts:function(){me.show(cfg);},single:true});return me;}
me.reconfigure(cfg);if(cfg.cls){me.addCls(cfg.cls);}
visibleFocusables=me.query('textfield:not([hidden]),textarea:not([hidden]),button:not([hidden])');me.preventFocusOnActivate=!visibleFocusables.length;me.hidden=true;me.callParent();return me;},onShow:function(){this.callParent(arguments);this.center();},updateText:function(text){this.msg.setValue(text);},setIcon:function(icon,width,height){var me=this,iconCmp=me.iconComponent,cls=me.messageIconCls;if(cls){iconCmp.removeCls(cls);}
if(icon){iconCmp.show();iconCmp.setSize(width||me.iconWidth,height||me.iconHeight);iconCmp.addCls(Ext.baseCSSPrefix+'dlg-icon');iconCmp.addCls(me.messageIconCls=icon);}else{iconCmp.removeCls(Ext.baseCSSPrefix+'dlg-icon');iconCmp.hide();}
return me;},updateProgress:function(value,progressText,msg){this.progressBar.updateProgress(value,progressText);if(msg){this.updateText(msg);}
return this;},onEsc:function(){if(this.closable!==false){this.callParent(arguments);}},confirm:function(cfg,msg,fn,scope){if(Ext.isString(cfg)){cfg={title:cfg,icon:this.QUESTION,msg:msg,buttons:this.YESNO,callback:fn,scope:scope};}
return this.show(cfg);},prompt:function(cfg,msg,fn,scope,multiline,value){if(Ext.isString(cfg)){cfg={prompt:true,title:cfg,minWidth:this.minPromptWidth,msg:msg,buttons:this.OKCANCEL,callback:fn,scope:scope,multiline:multiline,value:value};}
return this.show(cfg);},wait:function(cfg,title,config){if(Ext.isString(cfg)){cfg={title:title,msg:cfg,closable:false,wait:true,modal:true,minWidth:this.minProgressWidth,waitConfig:config};}
return this.show(cfg);},alert:function(cfg,msg,fn,scope){if(Ext.isString(cfg)){cfg={title:cfg,msg:msg,buttons:this.OK,fn:fn,scope:scope,minWidth:this.minWidth};}
return this.show(cfg);},progress:function(cfg,msg,progressText){if(Ext.isString(cfg)){cfg={title:cfg,msg:msg,progress:true,progressText:progressText};}
return this.show(cfg);}},function(){Ext.MessageBox=Ext.Msg=new this();});Ext.define('Ext.form.field.ComboBox',{extend:'Ext.form.field.Picker',requires:['Ext.util.DelayedTask','Ext.EventObject','Ext.view.BoundList','Ext.view.BoundListKeyNav','Ext.data.StoreManager','Ext.layout.component.field.ComboBox'],alternateClassName:'Ext.form.ComboBox',alias:['widget.combobox','widget.combo'],mixins:{bindable:'Ext.util.Bindable'},componentLayout:'combobox',triggerCls:Ext.baseCSSPrefix+'form-arrow-trigger',hiddenName:'',hiddenDataCls:Ext.baseCSSPrefix+'hide-display '+Ext.baseCSSPrefix+'form-data-hidden',fieldSubTpl:['<div class="{hiddenDataCls}" role="presentation"></div>','<input id="{id}" type="{type}" {inputAttrTpl} class="{fieldCls} {typeCls} {editableCls}" autocomplete="off"','<tpl if="value"> value="{[Ext.util.Format.htmlEncode(values.value)]}"</tpl>','<tpl if="name"> name="{name}"</tpl>','<tpl if="placeholder"> placeholder="{placeholder}"</tpl>','<tpl if="size"> size="{size}"</tpl>','<tpl if="maxLength !== undefined"> maxlength="{maxLength}"</tpl>','<tpl if="readOnly"> readonly="readonly"</tpl>','<tpl if="disabled"> disabled="disabled"</tpl>','<tpl if="tabIdx"> tabIndex="{tabIdx}"</tpl>','<tpl if="fieldStyle"> style="{fieldStyle}"</tpl>','/>',{compiled:true,disableFormats:true}],getSubTplData:function(){var me=this;Ext.applyIf(me.subTplData,{hiddenDataCls:me.hiddenDataCls});return me.callParent(arguments);},afterRender:function(){var me=this;me.callParent(arguments);me.setHiddenValue(me.value);},multiSelect:false,delimiter:', ',displayField:'text',triggerAction:'all',allQuery:'',queryParam:'query',queryMode:'remote',queryCaching:true,pageSize:0,anyMatch:false,caseSensitive:false,autoSelect:true,typeAhead:false,typeAheadDelay:250,selectOnTab:true,forceSelection:false,growToLongestValue:true,defaultListConfig:{loadingHeight:70,minWidth:70,maxHeight:300,shadow:'sides'},ignoreSelection:0,removingRecords:null,resizeComboToGrow:function(){var me=this;return me.grow&&me.growToLongestValue;},initComponent:function(){var me=this,isDefined=Ext.isDefined,store=me.store,transform=me.transform,transformSelect,isLocalMode;Ext.applyIf(me.renderSelectors,{hiddenDataEl:'.'+me.hiddenDataCls.split(' ').join('.')});this.addEvents('beforequery','select','beforeselect','beforedeselect');if(transform){transformSelect=Ext.getDom(transform);if(transformSelect){if(!me.store){store=Ext.Array.map(Ext.Array.from(transformSelect.options),function(option){return[option.value,option.text];});}
if(!me.name){me.name=transformSelect.name;}
if(!('value'in me)){me.value=transformSelect.value;}}}
me.bindStore(store||'ext-empty-store',true);store=me.store;if(store.autoCreated){me.queryMode='local';me.valueField=me.displayField='field1';if(!store.expanded){me.displayField='field2';}}
if(!isDefined(me.valueField)){me.valueField=me.displayField;}
isLocalMode=me.queryMode==='local';if(!isDefined(me.queryDelay)){me.queryDelay=isLocalMode?10:500;}
if(!isDefined(me.minChars)){me.minChars=isLocalMode?0:4;}
if(!me.displayTpl){me.displayTpl=new Ext.XTemplate('<tpl for=".">'+'{[typeof values === "string" ? values : values["'+me.displayField+'"]]}'+'<tpl if="xindex < xcount">'+me.delimiter+'</tpl>'+'</tpl>');}else if(Ext.isString(me.displayTpl)){me.displayTpl=new Ext.XTemplate(me.displayTpl);}
me.callParent();me.doQueryTask=new Ext.util.DelayedTask(me.doRawQuery,me);if(me.store.getCount()>0){me.setValue(me.value);}
if(transformSelect){me.render(transformSelect.parentNode,transformSelect);Ext.removeNode(transformSelect);delete me.renderTo;}},getStore:function(){return this.store;},beforeBlur:function(){this.doQueryTask.cancel();this.assertValue();},assertValue:function(){var me=this,value=me.getRawValue(),rec,currentValue;if(me.forceSelection){if(me.multiSelect){if(value!==me.getDisplayValue()){me.setValue(me.lastSelection);}}else{rec=me.findRecordByDisplay(value);if(rec){currentValue=me.value;if(!me.findRecordByValue(currentValue)){me.select(rec,true);}}else{me.setValue(me.lastSelection);}}}
me.collapse();},onTypeAhead:function(){var me=this,displayField=me.displayField,record=me.store.findRecord(displayField,me.getRawValue()),boundList=me.getPicker(),newValue,len,selStart;if(record){newValue=record.get(displayField);len=newValue.length;selStart=me.getRawValue().length;boundList.highlightItem(boundList.getNode(record));if(selStart!==0&&selStart!==len){me.setRawValue(newValue);me.selectText(selStart,newValue.length);}}},resetToDefault:Ext.emptyFn,beforeReset:function(){this.callParent();if(this.queryFilter&&!this.queryFilter.disabled){this.queryFilter.disabled=true;this.store.filter();}},onUnbindStore:function(store){var me=this,picker=me.picker;if(me.queryFilter){me.store.removeFilter(me.queryFilter);}
if(!store&&picker){picker.bindStore(null);}},onBindStore:function(store,initial){var picker=this.picker;if(!initial){this.resetToDefault();}
if(picker){picker.bindStore(store);}},getStoreListeners:function(){var me=this;return{beforeload:me.onBeforeLoad,clear:me.onClear,datachanged:me.onDataChanged,load:me.onLoad,exception:me.onException,remove:me.onRemove};},onBeforeLoad:function(){++this.ignoreSelection;},onDataChanged:function(){var me=this;if(me.resizeComboToGrow()){me.updateLayout();}},onClear:function(){var me=this;if(me.resizeComboToGrow()){me.removingRecords=true;me.onDataChanged();}},onRemove:function(){var me=this;if(me.resizeComboToGrow()){me.removingRecords=true;}},onException:function(){if(this.ignoreSelection>0){--this.ignoreSelection;}
this.collapse();},onLoad:function(store,records,success){var me=this;if(me.ignoreSelection>0){--me.ignoreSelection;}
if(success&&!store.lastOptions.rawQuery){if(me.value==null){if(me.store.getCount()){me.doAutoSelect();}else{me.setValue(me.value);}}else{me.setValue(me.value);}}},doRawQuery:function(){this.doQuery(this.getRawValue(),false,true);},doQuery:function(queryString,forceAll,rawQuery){var me=this,queryPlan=me.beforeQuery({query:queryString||'',rawQuery:rawQuery,forceAll:forceAll,combo:me,cancel:false});if(queryPlan===false||queryPlan.cancel){return false;}
if(me.queryCaching&&queryPlan.query===me.lastQuery){me.expand();}
else{me.lastQuery=queryPlan.query;if(me.queryMode==='local'){me.doLocalQuery(queryPlan);}else{me.doRemoteQuery(queryPlan);}}
return true;},beforeQuery:function(queryPlan){var me=this;if(me.fireEvent('beforequery',queryPlan)===false){queryPlan.cancel=true;}
else if(!queryPlan.cancel){if(queryPlan.query.length<me.minChars&&!queryPlan.forceAll){queryPlan.cancel=true;}}
return queryPlan;},doLocalQuery:function(queryPlan){var me=this,queryString=queryPlan.query;if(!me.queryFilter){me.queryFilter=new Ext.util.Filter({id:me.id+'-query-filter',anyMatch:me.anyMatch,caseSensitive:me.caseSensitive,root:'data',property:me.displayField});me.store.addFilter(me.queryFilter,false);}
if(queryString||!queryPlan.forceAll){me.queryFilter.disabled=false;me.queryFilter.setValue(me.enableRegEx?new RegExp(queryString):queryString);}
else{me.queryFilter.disabled=true;}
me.store.filter();if(me.store.getCount()){me.expand();}else{me.collapse();}
me.afterQuery(queryPlan);},doRemoteQuery:function(queryPlan){var me=this,loadCallback=function(){me.afterQuery(queryPlan);};me.expand();if(me.pageSize){me.loadPage(1,{rawQuery:queryPlan.rawQuery,callback:loadCallback});}else{me.store.load({params:me.getParams(queryPlan.query),rawQuery:queryPlan.rawQuery,callback:loadCallback});}},afterQuery:function(queryPlan){var me=this;if(me.store.getCount()){if(me.typeAhead){me.doTypeAhead();}
if(me.getRawValue()!==me.getDisplayValue()){me.ignoreSelection++;me.picker.getSelectionModel().deselectAll();me.ignoreSelection--;}
if(queryPlan.rawQuery){me.syncSelection();if(me.picker&&!me.picker.getSelectionModel().hasSelection()){me.doAutoSelect();}}else{me.doAutoSelect();}}},loadPage:function(pageNum,options){this.store.loadPage(pageNum,Ext.apply({params:this.getParams(this.lastQuery)},options));},onPageChange:function(toolbar,newPage){this.loadPage(newPage);return false;},getParams:function(queryString){var params={},param=this.queryParam;if(param){params[param]=queryString;}
return params;},doAutoSelect:function(){var me=this,picker=me.picker,lastSelected,itemNode;if(picker&&me.autoSelect&&me.store.getCount()>0){lastSelected=picker.getSelectionModel().lastSelected;itemNode=picker.getNode(lastSelected||0);if(itemNode){picker.highlightItem(itemNode);picker.listEl.scrollChildIntoView(itemNode,false);}}},doTypeAhead:function(){if(!this.typeAheadTask){this.typeAheadTask=new Ext.util.DelayedTask(this.onTypeAhead,this);}
if(this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.typeAheadTask.delay(this.typeAheadDelay);}},onTriggerClick:function(){var me=this;if(!me.readOnly&&!me.disabled){if(me.isExpanded){me.collapse();}else{me.onFocus({});if(me.triggerAction==='all'){me.doQuery(me.allQuery,true);}else if(me.triggerAction==='last'){me.doQuery(me.lastQuery,true);}else{me.doQuery(me.getRawValue(),false,true);}}
me.inputEl.focus();}},onPaste:function(){var me=this;if(!me.readOnly&&!me.disabled&&me.editable){me.doQueryTask.delay(me.queryDelay);}},onKeyUp:function(e,t){var me=this,key=e.getKey();if(!me.readOnly&&!me.disabled&&me.editable){me.lastKey=key;if(!e.isSpecialKey()||key==e.BACKSPACE||key==e.DELETE){me.doQueryTask.delay(me.queryDelay);}}
if(me.enableKeyEvents){me.callParent(arguments);}},initEvents:function(){var me=this;me.callParent();if(!me.enableKeyEvents){me.mon(me.inputEl,'keyup',me.onKeyUp,me);}
me.mon(me.inputEl,'paste',me.onPaste,me);},onDestroy:function(){Ext.destroy(this.listKeyNav);this.bindStore(null);this.callParent();},onAdded:function(){var me=this;me.callParent(arguments);if(me.picker){me.picker.ownerCt=me.up('[floating]');me.picker.registerWithOwnerCt();}},createPicker:function(){var me=this,picker,pickerCfg=Ext.apply({xtype:'boundlist',pickerField:me,selModel:{mode:me.multiSelect?'SIMPLE':'SINGLE'},floating:true,hidden:true,store:me.store,displayField:me.displayField,focusOnToFront:false,pageSize:me.pageSize,tpl:me.tpl},me.listConfig,me.defaultListConfig);picker=me.picker=Ext.widget(pickerCfg);if(me.pageSize){picker.pagingToolbar.on('beforechange',me.onPageChange,me);}
me.mon(picker,{itemclick:me.onItemClick,refresh:me.onListRefresh,scope:me});me.mon(picker.getSelectionModel(),{beforeselect:me.onBeforeSelect,beforedeselect:me.onBeforeDeselect,selectionchange:me.onListSelectionChange,scope:me});return picker;},alignPicker:function(){var me=this,picker=me.getPicker(),heightAbove=me.getPosition()[1]-Ext.getBody().getScroll().top,heightBelow=Ext.Element.getViewHeight()-heightAbove-me.getHeight(),space=Math.max(heightAbove,heightBelow);if(picker.height){delete picker.height;picker.updateLayout();}
if(picker.getHeight()>space-5){picker.setHeight(space-5);}
me.callParent();},onListRefresh:function(){if(!this.expanding){this.alignPicker();}
this.syncSelection();},onItemClick:function(picker,record){var me=this,selection=me.picker.getSelectionModel().getSelection(),valueField=me.valueField;if(!me.multiSelect&&selection.length){if(record.get(valueField)===selection[0].get(valueField)){me.displayTplData=[record.data];me.setRawValue(me.getDisplayValue());me.collapse();}}},onBeforeSelect:function(list,record){return this.fireEvent('beforeselect',this,record,record.index);},onBeforeDeselect:function(list,record){return this.fireEvent('beforedeselect',this,record,record.index);},onListSelectionChange:function(list,selectedRecords){var me=this,isMulti=me.multiSelect,hasRecords=selectedRecords.length>0;if(!me.ignoreSelection&&me.isExpanded){if(!isMulti){Ext.defer(me.collapse,1,me);}
if(isMulti||hasRecords){me.setValue(selectedRecords,false);}
if(hasRecords){me.fireEvent('select',me,selectedRecords);}
me.inputEl.focus();}},onExpand:function(){var me=this,keyNav=me.listKeyNav,selectOnTab=me.selectOnTab,picker=me.getPicker();if(keyNav){keyNav.enable();}else{keyNav=me.listKeyNav=new Ext.view.BoundListKeyNav(this.inputEl,{boundList:picker,forceKeyDown:true,tab:function(e){if(selectOnTab){this.selectHighlighted(e);me.triggerBlur();}
return true;},enter:function(e){var selModel=picker.getSelectionModel(),count=selModel.getCount();this.selectHighlighted(e);if(!me.multiSelect&&count===selModel.getCount()){me.collapse();}}});}
if(selectOnTab){me.ignoreMonitorTab=true;}
Ext.defer(keyNav.enable,1,keyNav);me.inputEl.focus();},onCollapse:function(){var me=this,keyNav=me.listKeyNav;if(keyNav){keyNav.disable();me.ignoreMonitorTab=false;}},select:function(r,assert){var me=this,picker=me.picker,doSelect=true,fireSelect;if(r&&r.isModel&&assert===true&&picker){fireSelect=!picker.getSelectionModel().isSelected(r);}
me.setValue(r,true);if(fireSelect){me.fireEvent('select',me,r);}},findRecord:function(field,value){var ds=this.store,idx=ds.findExact(field,value);return idx!==-1?ds.getAt(idx):false;},findRecordByValue:function(value){return this.findRecord(this.valueField,value);},findRecordByDisplay:function(value){return this.findRecord(this.displayField,value);},setValue:function(value,doSelect){var me=this,valueNotFoundText=me.valueNotFoundText,inputEl=me.inputEl,i,len,record,dataObj,matchedRecords=[],displayTplData=[],processedValue=[];if(me.store.loading){me.value=value;me.setHiddenValue(me.value);return me;}
value=Ext.Array.from(value);for(i=0,len=value.length;i<len;i++){record=value[i];if(!record||!record.isModel){record=me.findRecordByValue(record);}
if(record){matchedRecords.push(record);displayTplData.push(record.data);processedValue.push(record.get(me.valueField));}
else{if(!me.forceSelection){processedValue.push(value[i]);dataObj={};dataObj[me.displayField]=value[i];displayTplData.push(dataObj);}
else if(Ext.isDefined(valueNotFoundText)){displayTplData.push(valueNotFoundText);}}}
me.setHiddenValue(processedValue);me.value=me.multiSelect?processedValue:processedValue[0];if(!Ext.isDefined(me.value)){me.value=null;}
me.displayTplData=displayTplData;me.lastSelection=me.valueModels=matchedRecords;if(inputEl&&me.emptyText&&!Ext.isEmpty(value)){inputEl.removeCls(me.emptyCls);}
me.setRawValue(me.getDisplayValue());me.checkChange();if(doSelect!==false){me.syncSelection();}
me.applyEmptyText();return me;},setHiddenValue:function(values){var me=this,name=me.hiddenName,i,dom,childNodes,input,valueCount,childrenCount;if(!me.hiddenDataEl||!name){return;}
values=Ext.Array.from(values);dom=me.hiddenDataEl.dom;childNodes=dom.childNodes;input=childNodes[0];valueCount=values.length;childrenCount=childNodes.length;if(!input&&valueCount>0){me.hiddenDataEl.update(Ext.DomHelper.markup({tag:'input',type:'hidden',name:name}));childrenCount=1;input=dom.firstChild;}
while(childrenCount>valueCount){dom.removeChild(childNodes[0]);--childrenCount;}
while(childrenCount<valueCount){dom.appendChild(input.cloneNode(true));++childrenCount;}
for(i=0;i<valueCount;i++){childNodes[i].value=values[i];}},getDisplayValue:function(){return this.displayTpl.apply(this.displayTplData);},getValue:function(){var me=this,picker=me.picker,rawValue=me.getRawValue(),value=me.value;if(me.getDisplayValue()!==rawValue){value=rawValue;me.value=me.displayTplData=me.valueModels=null;if(picker){me.ignoreSelection++;picker.getSelectionModel().deselectAll();me.ignoreSelection--;}}
return value;},getSubmitValue:function(){var value=this.getValue();if(Ext.isEmpty(value)){value='';}
return value;},isEqual:function(v1,v2){var fromArray=Ext.Array.from,i,len;v1=fromArray(v1);v2=fromArray(v2);len=v1.length;if(len!==v2.length){return false;}
for(i=0;i<len;i++){if(v2[i]!==v1[i]){return false;}}
return true;},clearValue:function(){this.setValue([]);},syncSelection:function(){var me=this,picker=me.picker,selection,selModel,values=me.valueModels||[],vLen=values.length,v,value;if(picker){selection=[];for(v=0;v<vLen;v++){value=values[v];if(value&&value.isModel&&me.store.indexOf(value)>=0){selection.push(value);}}
me.ignoreSelection++;selModel=picker.getSelectionModel();selModel.deselectAll();if(selection.length){selModel.select(selection,undefined,true);}
me.ignoreSelection--;}},onEditorTab:function(e){var keyNav=this.listKeyNav;if(this.selectOnTab&&keyNav){keyNav.selectHighlighted(e);}}});Ext.define('MP.window.Login',{extend:'Ext.Window',alias:'widget.loginwindow',requires:'MP.form.StandaloneLabel',uses:'Ext.form.Panel',title:_('Please login'),titleAlign:'center',width:400,autoHeight:true,closable:false,resizable:false,draggable:false,layout:'fit',border:false,modal:true,initComponent:function(){var me=this;Ext.apply(me,{items:[{xtype:'form',plain:true,frame:true,border:0,bodyPadding:5,url:'/auth/login',items:me.getFormFields()}]});me.callParent();},buttons:[{xtype:'standalone-label',text:__title__+' '+__version__},'->',{text:_("Login"),type:"submit",action:"login",formBind:true}],defaultFocus:'username',getFormFields:function(){return[{itemId:'username',xtype:'textfield',fieldLabel:_('Username'),name:'username',allowBlank:false,anchor:'100%',selectOnFocus:true},{xtype:'textfield',fieldLabel:_('Password'),name:'password',allowBlank:false,inputType:'password',anchor:'100%',selectOnFocus:true}];}});Ext.define('SoL.window.Login',{extend:'MP.window.Login',uses:['Ext.form.field.VTypes'],width:450,initComponent:function(){var me=this;me.callParent(arguments);if(!Ext.form.field.VTypes.emailorusername){var username_rx=/^\w+$/;Ext.apply(Ext.form.field.VTypes,{emailorusername:function(val,field){return username_rx.test(val)||Ext.form.field.VTypes.email(val);},emailorusernameText:_('This field must be a valid email address'),emailorusernameMask:Ext.form.field.VTypes.emailMask});}
var version=me.getDockedItems('toolbar[dock="bottom"] > label')[0];if(__admin_email__){version.setText(Ext.String.format('<a href="{0}" target="_blank">{1}</a> &mdash; <a href="mailto:{2}?subject=SoL">{3}</a>',"https://gitlab.com/metapensiero/SoL/blob/master/CHANGES.rst",version.text,__admin_email__,'\uD83D\uDCE7 admin…'),false);}else{version.setText(Ext.String.format('<a href="{0}" target="_blank">{1}</a> &mdash; <a href="{2}" target="_blank">{3}</a>',"https://gitlab.com/metapensiero/SoL/blob/master/CHANGES.rst",version.text,"/static/manual/index.html",_('About…')),false);}
var tbitems=me.getDockedItems('toolbar[dock="bottom"]')[0];if(__signin__){tbitems.insert(2,{xtype:'button',text:_('Register…'),tooltip:_('Create a new account.'),action:'signin',formBind:false});}
if(__password_reset__){tbitems.insert(2,{xtype:'button',text:_('Lost password?'),tooltip:_('Request a reset of the password.'),action:'lostpassword',formBind:false});}},getFormFields:function(){var me=this,fields=me.callParent();fields[0].fieldLabel=_('Email address');fields[0].vtype='emailorusername';fields.unshift({xtype:'container',height:100,html:['<a href="/lit" data-qtip="',_('Go to the light HTML only interface…').replace(/"/g,'”'),'" target="_blank">','  <img src="/static/images/logo.png"','       style="margin-top: 15px; margin-left: 20px; float: left;">','</a>','<div style="margin-top: 25px; text-align: center;">','<b>Scarry On Line</b><br/><br/>',_('Carrom tournaments management'),'</div>'].join('')});return fields;}});Ext.define('Ext.form.field.Time',{extend:'Ext.form.field.ComboBox',alias:'widget.timefield',requires:['Ext.form.field.Date','Ext.picker.Time','Ext.view.BoundListKeyNav','Ext.Date'],alternateClassName:['Ext.form.TimeField','Ext.form.Time'],triggerCls:Ext.baseCSSPrefix+'form-time-trigger',minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A",increment:15,pickerMaxHeight:300,selectOnTab:true,snapToIncrement:false,initDate:'1/1/2008',initDateFormat:'j/n/Y',ignoreSelection:0,queryMode:'local',displayField:'disp',valueField:'date',initComponent:function(){var me=this,min=me.minValue,max=me.maxValue;if(min){me.setMinValue(min);}
if(max){me.setMaxValue(max);}
me.displayTpl=new Ext.XTemplate('<tpl for=".">'+'{[typeof values === "string" ? values : this.formatDate(values["'+me.displayField+'"])]}'+'<tpl if="xindex < xcount">'+me.delimiter+'</tpl>'+'</tpl>',{formatDate:Ext.Function.bind(me.formatDate,me)});this.callParent();},transformOriginalValue:function(value){if(Ext.isString(value)){return this.rawToValue(value);}
return value;},isEqual:function(v1,v2){return Ext.Date.isEqual(v1,v2);},setMinValue:function(value){var me=this,picker=me.picker;me.setLimit(value,true);if(picker){picker.setMinValue(me.minValue);}},setMaxValue:function(value){var me=this,picker=me.picker;me.setLimit(value,false);if(picker){picker.setMaxValue(me.maxValue);}},setLimit:function(value,isMin){var me=this,d,val;if(Ext.isString(value)){d=me.parseDate(value);}
else if(Ext.isDate(value)){d=value;}
if(d){val=Ext.Date.clearTime(new Date(me.initDate));val.setHours(d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds());}
else{val=null;}
me[isMin?'minValue':'maxValue']=val;},rawToValue:function(rawValue){return this.parseDate(rawValue)||rawValue||null;},valueToRaw:function(value){return this.formatDate(this.parseDate(value));},getErrors:function(value){var me=this,format=Ext.String.format,errors=me.callParent(arguments),minValue=me.minValue,maxValue=me.maxValue,date;value=me.formatDate(value||me.processRawValue(me.getRawValue()));if(value===null||value.length<1){return errors;}
date=me.parseDate(value);if(!date){errors.push(format(me.invalidText,value,Ext.Date.unescapeFormat(me.format)));return errors;}
if(minValue&&date<minValue){errors.push(format(me.minText,me.formatDate(minValue)));}
if(maxValue&&date>maxValue){errors.push(format(me.maxText,me.formatDate(maxValue)));}
return errors;},formatDate:function(){return Ext.form.field.Date.prototype.formatDate.apply(this,arguments);},parseDate:function(value){var me=this,val=value,altFormats=me.altFormats,altFormatsArray=me.altFormatsArray,i=0,len;if(value&&!Ext.isDate(value)){val=me.safeParse(value,me.format);if(!val&&altFormats){altFormatsArray=altFormatsArray||altFormats.split('|');len=altFormatsArray.length;for(;i<len&&!val;++i){val=me.safeParse(value,altFormatsArray[i]);}}}
if(val&&me.snapToIncrement){val=new Date(Ext.Number.snap(val.getTime(),me.increment*60*1000));}
return val;},safeParse:function(value,format){var me=this,utilDate=Ext.Date,parsedDate,result=null;if(utilDate.formatContainsDateInfo(format)){result=utilDate.parse(value,format);}else{parsedDate=utilDate.parse(me.initDate+' '+value,me.initDateFormat+' '+format);if(parsedDate){result=parsedDate;}}
return result;},getSubmitValue:function(){var me=this,format=me.submitFormat||me.format,value=me.getValue();return value?Ext.Date.format(value,format):null;},createPicker:function(){var me=this,picker;me.listConfig=Ext.apply({xtype:'timepicker',selModel:{mode:'SINGLE'},cls:undefined,minValue:me.minValue,maxValue:me.maxValue,increment:me.increment,format:me.format,maxHeight:me.pickerMaxHeight},me.listConfig);picker=me.callParent();me.bindStore(picker.store);return picker;},onItemClick:function(picker,record){var me=this,selected=picker.getSelectionModel().getSelection();if(selected.length>0){selected=selected[0];if(selected&&Ext.Date.isEqual(record.get('date'),selected.get('date'))){me.collapse();}}},onListSelectionChange:function(list,recordArray){if(recordArray.length){var me=this,val=recordArray[0].get('date');if(!me.ignoreSelection){me.skipSync=true;me.setValue(val);me.skipSync=false;me.fireEvent('select',me,val);me.picker.clearHighlight();me.collapse();me.inputEl.focus();}}},syncSelection:function(){var me=this,picker=me.picker,toSelect,selModel,value,data,d,dLen,rec;if(picker&&!me.skipSync){picker.clearHighlight();value=me.getValue();selModel=picker.getSelectionModel();me.ignoreSelection++;if(value===null){selModel.deselectAll();}else if(Ext.isDate(value)){data=picker.store.data.items;dLen=data.length;for(d=0;d<dLen;d++){rec=data[d];if(Ext.Date.isEqual(rec.get('date'),value)){toSelect=rec;break;}}
selModel.select(toSelect);}
me.ignoreSelection--;}},postBlur:function(){var me=this,val=me.getValue();me.callParent(arguments);if(me.wasValid&&val){me.setRawValue(me.formatDate(val));}},setValue:function(){this.getPicker();return this.callParent(arguments);},getValue:function(){return this.parseDate(this.callParent(arguments));}});Ext.define('SoL.form.field.FlagsCombo',{extend:'Ext.form.field.ComboBox',alias:'widget.flagscombo',requires:['Ext.data.ArrayStore'],valueField:'code',displayField:'name',triggerAction:'all',queryMode:'local',typeAhead:true,forceSelection:true,minChars:0,statics:{renderer:function(value){var country=SoL.form.field.FlagsCombo.countries[value];if(country){return'<div class="sol-flags-icon'
+' sol-flag-'+value+'">'
+country+'</div>';}else{return value;}}},initComponent:function(){var me=this;var array=[];delete me.maxLength;me.tpl=new Ext.XTemplate('<tpl for=".">','<div class="x-boundlist-item sol-flags-icon',' sol-flag-{code}">{name}</div></tpl>');var countries=SoL.form.field.FlagsCombo.countries;for(var code in countries){array.push([code,countries[code]]);}
me.store=new Ext.data.ArrayStore({fields:['code','name'],data:array,sorters:[{property:'name'}]});me.callParent();},onRender:function(){var me=this;me.callParent(arguments);me.triggerWrap.el.applyStyles({position:'relative'});me.el.down('input.x-form-field').addCls('sol-flags-icon');me.icon=Ext.core.DomHelper.append(me.el.down('td.x-form-trigger-input-cell'),{tag:'div',style:'position:absolute; top:3px; left:3px;'});},setIconCls:function(){var me=this;if(me.rendered){var value=me.getValue();if(value){var country=SoL.form.field.FlagsCombo.countries[value];if(country){me.icon.className='sol-flags-icon sol-flag-'+value;}else{me.icon.className='';}}else{me.icon.className='';}}else{me.on('render',me.setIconCls,me,{single:true});}},setValue:function(value,doSelect){var me=this;me.callParent([value,doSelect]);me.setIconCls();}});Ext.define('Ext.form.Basic',{extend:'Ext.util.Observable',alternateClassName:'Ext.form.BasicForm',requires:['Ext.util.MixedCollection','Ext.form.action.Load','Ext.form.action.Submit','Ext.window.MessageBox','Ext.data.Errors','Ext.util.DelayedTask'],constructor:function(owner,config){var me=this,reader;me.owner=owner;me.checkValidityTask=new Ext.util.DelayedTask(me.checkValidity,me);me.checkDirtyTask=new Ext.util.DelayedTask(me.checkDirty,me);me.monitor=new Ext.container.Monitor({selector:'[isFormField]',scope:me,addHandler:me.onFieldAdd,removeHandler:me.onFieldRemove});me.monitor.bind(owner);Ext.apply(me,config);if(Ext.isString(me.paramOrder)){me.paramOrder=me.paramOrder.split(/[\s,|]/);}
reader=me.reader;if(reader&&!reader.isReader){if(typeof reader==='string'){reader={type:reader};}
me.reader=Ext.createByAlias('reader.'+reader.type,reader);}
reader=me.errorReader;if(reader&&!reader.isReader){if(typeof reader==='string'){reader={type:reader};}
me.errorReader=Ext.createByAlias('reader.'+reader.type,reader);}
me.addEvents('beforeaction','actionfailed','actioncomplete','validitychange','dirtychange');me.callParent();},initialize:function(){this.initialized=true;this.onValidityChange(!this.hasInvalidField());},timeout:30,paramsAsHash:false,waitTitle:'Please Wait...',trackResetOnLoad:false,wasDirty:false,destroy:function(){var me=this,mon=me.monitor;if(mon){mon.unbind();me.monitor=null;}
me.clearListeners();me.checkValidityTask.cancel();me.checkDirtyTask.cancel();},onFieldAdd:function(field){var me=this;me.mon(field,'validitychange',me.checkValidityDelay,me);me.mon(field,'dirtychange',me.checkDirtyDelay,me);if(me.initialized){me.checkValidityDelay();}},onFieldRemove:function(field){var me=this;me.mun(field,'validitychange',me.checkValidityDelay,me);me.mun(field,'dirtychange',me.checkDirtyDelay,me);if(me.initialized){me.checkValidityDelay();}},getFields:function(){return this.monitor.getItems();},getBoundItems:function(){var boundItems=this._boundItems;if(!boundItems||boundItems.getCount()===0){boundItems=this._boundItems=new Ext.util.MixedCollection();boundItems.addAll(this.owner.query('[formBind]'));}
return boundItems;},hasInvalidField:function(){return!!this.getFields().findBy(function(field){var preventMark=field.preventMark,isValid;field.preventMark=true;isValid=field.isValid();field.preventMark=preventMark;return!isValid;});},isValid:function(){var me=this,invalid;Ext.suspendLayouts();invalid=me.getFields().filterBy(function(field){return!field.validate();});Ext.resumeLayouts(true);return invalid.length<1;},checkValidity:function(){var me=this,valid=!me.hasInvalidField();if(valid!==me.wasValid){me.onValidityChange(valid);me.fireEvent('validitychange',me,valid);me.wasValid=valid;}},checkValidityDelay:function(){this.checkValidityTask.delay(10);},onValidityChange:function(valid){var boundItems=this.getBoundItems(),items,i,iLen,cmp;if(boundItems){items=boundItems.items;iLen=items.length;for(i=0;i<iLen;i++){cmp=items[i];if(cmp.disabled===valid){cmp.setDisabled(!valid);}}}},isDirty:function(){return!!this.getFields().findBy(function(f){return f.isDirty();});},checkDirtyDelay:function(){this.checkDirtyTask.delay(10);},checkDirty:function(){var dirty=this.isDirty();if(dirty!==this.wasDirty){this.fireEvent('dirtychange',this,dirty);this.wasDirty=dirty;}},hasUpload:function(){return!!this.getFields().findBy(function(f){return f.isFileUpload();});},doAction:function(action,options){if(Ext.isString(action)){action=Ext.ClassManager.instantiateByAlias('formaction.'+action,Ext.apply({},options,{form:this}));}
if(this.fireEvent('beforeaction',this,action)!==false){this.beforeAction(action);Ext.defer(action.run,100,action);}
return this;},submit:function(options){options=options||{};var me=this,action;if(options.standardSubmit||me.standardSubmit){action='standardsubmit';}else{action=me.api?'directsubmit':'submit';}
return me.doAction(action,options);},load:function(options){return this.doAction(this.api?'directload':'load',options);},updateRecord:function(record){record=record||this._record;if(!record){return this;}
var fields=record.fields.items,values=this.getFieldValues(),obj={},i=0,len=fields.length,name;for(;i<len;++i){name=fields[i].name;if(values.hasOwnProperty(name)){obj[name]=values[name];}}
record.beginEdit();record.set(obj);record.endEdit();return this;},loadRecord:function(record){this._record=record;return this.setValues(record.getData());},getRecord:function(){return this._record;},beforeAction:function(action){var me=this,waitMsg=action.waitMsg,maskCls=Ext.baseCSSPrefix+'mask-loading',fields=me.getFields().items,f,fLen=fields.length,field,waitMsgTarget;for(f=0;f<fLen;f++){field=fields[f];if(field.isFormField&&field.syncValue){field.syncValue();}}
if(waitMsg){waitMsgTarget=me.waitMsgTarget;if(waitMsgTarget===true){me.owner.el.mask(waitMsg,maskCls);}else if(waitMsgTarget){waitMsgTarget=me.waitMsgTarget=Ext.get(waitMsgTarget);waitMsgTarget.mask(waitMsg,maskCls);}else{me.floatingAncestor=me.owner.up('[floating]');if(me.floatingAncestor){me.savePreventFocusOnActivate=me.floatingAncestor.preventFocusOnActivate;me.floatingAncestor.preventFocusOnActivate=true;}
Ext.MessageBox.wait(waitMsg,action.waitTitle||me.waitTitle);}}},afterAction:function(action,success){var me=this;if(action.waitMsg){var messageBox=Ext.MessageBox,waitMsgTarget=me.waitMsgTarget;if(waitMsgTarget===true){me.owner.el.unmask();}else if(waitMsgTarget){waitMsgTarget.unmask();}else{messageBox.hide();}}
if(me.floatingAncestor){me.floatingAncestor.preventFocusOnActivate=me.savePreventFocusOnActivate;}
if(success){if(action.reset){me.reset();}
Ext.callback(action.success,action.scope||action,[me,action]);me.fireEvent('actioncomplete',me,action);}else{Ext.callback(action.failure,action.scope||action,[me,action]);me.fireEvent('actionfailed',me,action);}},findField:function(id){return this.getFields().findBy(function(f){return f.id===id||f.getName()===id;});},markInvalid:function(errors){var me=this,e,eLen,error,value,key;function mark(fieldId,msg){var field=me.findField(fieldId);if(field){field.markInvalid(msg);}}
if(Ext.isArray(errors)){eLen=errors.length;for(e=0;e<eLen;e++){error=errors[e];mark(error.id,error.msg);}}else if(errors instanceof Ext.data.Errors){eLen=errors.items.length;for(e=0;e<eLen;e++){error=errors.items[e];mark(error.field,error.message);}}else{for(key in errors){if(errors.hasOwnProperty(key)){value=errors[key];mark(key,value,errors);}}}
return this;},setValues:function(values){var me=this,v,vLen,val,field;function setVal(fieldId,val){var field=me.findField(fieldId);if(field){field.setValue(val);if(me.trackResetOnLoad){field.resetOriginalValue();}}}
Ext.suspendLayouts();if(Ext.isArray(values)){vLen=values.length;for(v=0;v<vLen;v++){val=values[v];setVal(val.id,val.value);}}else{Ext.iterate(values,setVal);}
Ext.resumeLayouts(true);return this;},getValues:function(asString,dirtyOnly,includeEmptyText,useDataValues){var values={},fields=this.getFields().items,f,fLen=fields.length,isArray=Ext.isArray,field,data,val,bucket,name;for(f=0;f<fLen;f++){field=fields[f];if(!dirtyOnly||field.isDirty()){data=field[useDataValues?'getModelData':'getSubmitData'](includeEmptyText);if(Ext.isObject(data)){for(name in data){if(data.hasOwnProperty(name)){val=data[name];if(includeEmptyText&&val===''){val=field.emptyText||'';}
if(values.hasOwnProperty(name)){bucket=values[name];if(!isArray(bucket)){bucket=values[name]=[bucket];}
if(isArray(val)){values[name]=bucket.concat(val);}else{bucket.push(val);}}else{values[name]=val;}}}}}}
if(asString){values=Ext.Object.toQueryString(values);}
return values;},getFieldValues:function(dirtyOnly){return this.getValues(false,dirtyOnly,false,true);},clearInvalid:function(){Ext.suspendLayouts();var me=this,fields=me.getFields().items,f,fLen=fields.length;for(f=0;f<fLen;f++){fields[f].clearInvalid();}
Ext.resumeLayouts(true);return me;},reset:function(resetRecord){Ext.suspendLayouts();var me=this,fields=me.getFields().items,f,fLen=fields.length;for(f=0;f<fLen;f++){fields[f].reset();}
Ext.resumeLayouts(true);if(resetRecord===true){delete me._record;}
return me;},applyToFields:function(obj){var fields=this.getFields().items,f,fLen=fields.length;for(f=0;f<fLen;f++){Ext.apply(fields[f],obj);}
return this;},applyIfToFields:function(obj){var fields=this.getFields().items,f,fLen=fields.length;for(f=0;f<fLen;f++){Ext.applyIf(fields[f],obj);}
return this;}});Ext.define('MP.desktop.TaskBar',{extend:'Ext.toolbar.Toolbar',requires:['Ext.button.Button','Ext.resizer.Splitter','Ext.menu.Menu','MP.desktop.StartMenu'],alias:'widget.taskbar',cls:'mp-desktop-taskbar',startBtnText:_('Menu'),initComponent:function(){var me=this;me.startMenu=new MP.desktop.StartMenu(me.startConfig);me.quickStart=new Ext.toolbar.Toolbar(me.getQuickStart());me.windowBar=new Ext.toolbar.Toolbar(me.getWindowBarConfig());me.tray=new Ext.toolbar.Toolbar(me.getTrayConfig());me.items=[{xtype:'button',cls:'mp-desktop-start-button',iconCls:'mp-desktop-start-button-icon',menu:me.startMenu,menuAlign:'bl-tl',text:me.startBtnText},me.quickStart,{xtype:'splitter',html:'&#160;',height:14,width:2,cls:'x-toolbar-separator x-toolbar-separator-horizontal'},me.windowBar,'-',me.tray];me.callParent();},afterLayout:function(){var me=this;me.callParent();me.windowBar.el.on('contextmenu',me.onButtonContextMenu,me);},getQuickStart:function(){var me=this,ret={minWidth:20,width:90,items:[],enableOverflow:true};Ext.each(this.quickStart,function(item){ret.items.push({tooltip:{text:item.name,align:'bl-tl'},overflowText:item.name,iconCls:item.iconCls,moduleId:item.moduleId,handler:me.onQuickStartClick,scope:me});});return ret;},getTrayConfig:function(){var ret={width:120,items:this.trayItems};delete this.trayItems;return ret;},getWindowBarConfig:function(){return{flex:1,cls:'mp-desktop-desktop-windowbar',items:['&#160;'],layout:{overflowHandler:'Scroller'}};},getWindowBtnFromEl:function(el){var c=this.windowBar.getChildByElement(el);return c||null;},onQuickStartClick:function(btn){var module=this.app.getModule(btn.moduleId);if(module){module.createOrShowWindow();}},onButtonContextMenu:function(e){var me=this,t=e.getTarget(),btn=me.getWindowBtnFromEl(t);if(btn){e.stopEvent();me.windowMenu.theWin=btn.win;me.windowMenu.showBy(t);}},onWindowBtnClick:function(btn){var win=btn.win;if(win.minimized||win.hidden){btn.disable();win.show(null,function(){btn.enable();});}else if(win.active){btn.disable();win.on('hide',function(){btn.enable();},null,{single:true});win.minimize();}else{win.toFront();}},addTaskButton:function(win){var config={iconCls:win.iconCls,enableToggle:true,toggleGroup:'all',width:140,margins:'0 2 0 3',text:Ext.util.Format.ellipsis(win.title,20),listeners:{click:this.onWindowBtnClick,scope:this},win:win};var cmp=this.windowBar.add(config);cmp.toggle(true);return cmp;},removeTaskButton:function(btn){var found,me=this;me.windowBar.items.each(function(item){if(item===btn){found=item;}
return!found;});if(found){me.windowBar.remove(found);}
return found;},setActiveButton:function(btn){if(btn){btn.toggle(true);}else{this.windowBar.items.each(function(item){if(item.isButton){item.toggle(false);}});}}});Ext.define('MP.desktop.App',{mixins:{observable:'Ext.util.Observable'},requires:['Ext.container.Viewport','Ext.window.MessageBox','Ext.util.Format'],uses:['Ext.util.Point','MP.desktop.ShortcutModel','MP.desktop.Desktop','MP.desktop.TrayClock'],isReady:false,modules:null,useQuickTips:true,statics:{request:function(method,url,params,callback,error_callback){Ext.Ajax.request({url:url,params:params,method:method,disableCaching:true,success:function(r){var res=Ext.decode(r.responseText);if(!res){Ext.MessageBox.alert(_("Couldn't fetch configuration"),_('Cannot decode JSON object obtained from ')+url);if(error_callback)error_callback(r);}else{if(res.success!==false){callback(res);}else{Ext.MessageBox.alert(_("Remote failure"),_('Unsuccessful response from ')+url);if(error_callback)error_callback(r);}}},failure:function(r){if(r.status>=400){Ext.MessageBox.alert(r.statusText,r.responseText);}else{var res=r.responseText&&Ext.decode(r.responseText);if(res){Ext.MessageBox.alert(Ext.String.format(_('Communication error ({0} {1})'),r.status,r.statusText),res.message);}else{Ext.MessageBox.alert(_('Communication error'),r.statusText);}}
if(error_callback)error_callback(r);}});}},constructor:function(config){var me=this;me.addEvents('ready','beforeunload');me.mixins.observable.constructor.call(this,config);if(Ext.isReady){Ext.Function.defer(me.init,10,me);}else{Ext.onReady(me.init,me);}},init:function(){var me=this,desktopCfg;if(me.useQuickTips){Ext.QuickTips.init();}
me.modules=me.getModules();desktopCfg=me.getDesktopConfig();me.desktop=Ext.create(me.desktopClass||'MP.desktop.Desktop',desktopCfg);me.viewport=Ext.create('Ext.container.Viewport',{layout:'fit',items:[me.desktop]});Ext.EventManager.on(window,'beforeunload',me.onUnload,me);me.isReady=true;me.fireEvent('ready',me);this.addEvents('logout');},getContextMenuItems:function(){return[];},getDesktopConfig:function(){var me=this,cfg={app:me,taskbarConfig:me.getTaskbarConfig(),contextMenuItems:me.getContextMenuItems(),shortcuts:Ext.create('Ext.data.Store',{model:'MP.desktop.ShortcutModel',data:me.user.shortcuts||[]})};return Ext.apply(cfg,me.desktopConfig);},getModules:function(){var me=this,modules=[];Ext.each(me.user.modules,function(module){modules.push(Ext.create(module,{app:me}));});return modules;},getToolConfig:function(){var me=this;return{width:100,items:[{text:_('Logout'),tooltip:_('Terminate the application.'),iconCls:'logout',handler:me.onLogout,scope:me}]};},getStartConfig:function(){var me=this,menu,launcher,cfg={app:me,menu:[],title:me.user.fullname,iconCls:me.user.is_admin?'admin':me.user.is_manager?'manager':'user',height:300,toolConfig:me.getToolConfig()};Ext.apply(cfg,me.startConfig);Ext.each(me.modules,function(module){launcher=module.launcher;if(launcher){var orighandler=launcher.handler;if(!orighandler){orighandler=module.createOrShowWindow;}
launcher.handler=function(){orighandler.call(module);};menu=cfg.menu;if(module.launcherPath){var paths=module.launcherPath.split('/');for(var i=0,npaths=paths.length;i<npaths;i++){var pchunk=paths[i];var submenu=null;for(var j=0,jlen=menu.length;j<jlen;j++){if(menu[j].text===pchunk){submenu=menu[j].menu;break;}}
if(!submenu){submenu={handler:Ext.emptyFn,iconCls:'submenu',menu:[],text:paths[i]};menu.push(submenu);menu=submenu.menu;}else{menu=submenu;}}}
menu.push(module.launcher);}});return cfg;},getTaskbarConfig:function(){var me=this,cfg={app:me,startConfig:me.getStartConfig(),quickStart:me.user.quickstart||[],trayItems:[{xtype:'trayclock',flex:1}]};return Ext.apply(cfg,me.taskbarConfig);},getModule:function(id){var ms=this.modules;for(var i=0,len=ms.length;i<len;i++){var m=ms[i];if(m.id==id){return m;}}
return null;},onReady:function(fn,scope){if(this.isReady){fn.call(scope,this);}else{this.on({ready:fn,scope:scope,single:true});}},getDesktop:function(){return this.desktop;},onUnload:function(e){if(this.fireEvent('beforeunload',this)===false){e.stopEvent();}},onLogout:function(){var me=this;Ext.Msg.confirm(_('Terminate Session'),_('Are you sure you want to logout?'),function(bid){if(bid==='yes'){var maskel=me.getDesktop().getEl();maskel.mask('<span id="pbar"></span>');var pbar=Ext.create('Ext.ProgressBar',{text:_("Please Wait..."),width:180,renderTo:'pbar',value:1});Ext.Ajax.request({url:'/auth/logout',method:'GET',success:function(){pbar.reset(true);maskel.unmask();me.fireEvent('logout',me);},failure:function(response){pbar.reset(true);maskel.unmask();me.fireEvent('logout',me);console.error('Something went wrong: ',response);}});}});}});Ext.define('Ext.tip.QuickTip',{extend:'Ext.tip.ToolTip',alias:'widget.quicktip',alternateClassName:'Ext.QuickTip',interceptTitles:false,title:'&#160;',tagConfig:{namespace:'data-',attribute:'qtip',width:'qwidth',target:'target',title:'qtitle',hide:'hide',cls:'qclass',align:'qalign',anchor:'anchor',showDelay:'qshowDelay'},initComponent:function(){var me=this;me.target=me.target||Ext.getDoc();me.targets=me.targets||{};me.callParent();},register:function(config){var configs=Ext.isArray(config)?config:arguments,i=0,len=configs.length,target,j,targetLen;for(;i<len;i++){config=configs[i];target=config.target;if(target){if(Ext.isArray(target)){for(j=0,targetLen=target.length;j<targetLen;j++){this.targets[Ext.id(target[j])]=config;}}else{this.targets[Ext.id(target)]=config;}}}},unregister:function(el){delete this.targets[Ext.id(el)];},cancelShow:function(el){var me=this,activeTarget=me.activeTarget;el=Ext.get(el).dom;if(me.isVisible()){if(activeTarget&&activeTarget.el==el){me.hide();}}else if(activeTarget&&activeTarget.el==el){me.clearTimer('show');}},getTipCfg:function(e){var t=e.getTarget(),titleText=t.title,cfg;if(this.interceptTitles&&titleText&&Ext.isString(titleText)){t.qtip=titleText;t.removeAttribute("title");e.preventDefault();return{text:titleText};}
else{cfg=this.tagConfig;t=e.getTarget('['+cfg.namespace+cfg.attribute+']');if(t){return{target:t,text:t.getAttribute(cfg.namespace+cfg.attribute)};}}},onTargetOver:function(e){var me=this,target=e.getTarget(me.delegate),hasShowDelay,delay,elTarget,cfg,ns,tipConfig,autoHide,targets,targetEl,value,key;if(me.disabled){return;}
me.targetXY=e.getXY();if(!target||target.nodeType!==1||target==document.documentElement||target==document.body){return;}
if(me.activeTarget&&((target==me.activeTarget.el)||Ext.fly(me.activeTarget.el).contains(target))){if(me.targetTextEmpty()){me.onShowVeto();delete me.activeTarget;}else{me.clearTimer('hide');me.show();}
return;}
if(target){targets=me.targets;for(key in targets){if(targets.hasOwnProperty(key)){value=targets[key];targetEl=Ext.fly(value.target);if(targetEl&&(targetEl.dom===target||targetEl.contains(target))){elTarget=targetEl.dom;break;}}}
if(elTarget){me.activeTarget=me.targets[elTarget.id];me.activeTarget.el=target;me.anchor=me.activeTarget.anchor;if(me.anchor){me.anchorTarget=target;}
hasShowDelay=parseInt(me.activeTarget.showDelay,10);if(hasShowDelay){delay=me.showDelay;me.showDelay=hasShowDelay;}
me.delayShow();if(hasShowDelay){me.showDelay=delay;}
return;}}
elTarget=Ext.fly(target,'_quicktip-target');cfg=me.tagConfig;ns=cfg.namespace;tipConfig=me.getTipCfg(e);if(tipConfig){if(tipConfig.target){target=tipConfig.target;elTarget=Ext.fly(target,'_quicktip-target');}
autoHide=elTarget.getAttribute(ns+cfg.hide);me.activeTarget={el:target,text:tipConfig.text,width:+elTarget.getAttribute(ns+cfg.width)||null,autoHide:autoHide!="user"&&autoHide!=='false',title:elTarget.getAttribute(ns+cfg.title),cls:elTarget.getAttribute(ns+cfg.cls),align:elTarget.getAttribute(ns+cfg.align),showDelay:parseInt(elTarget.getAttribute(ns+cfg.showDelay),10)};me.anchor=elTarget.getAttribute(ns+cfg.anchor);if(me.anchor){me.anchorTarget=target;}
hasShowDelay=parseInt(me.activeTarget.showDelay,10);if(hasShowDelay){delay=me.showDelay;me.showDelay=hasShowDelay;}
me.delayShow();if(hasShowDelay){me.showDelay=delay;}}},onTargetOut:function(e){var me=this,active=me.activeTarget,hasHideDelay,delay;if(active&&e.within(me.activeTarget.el)&&!me.getTipCfg(e)){return;}
me.clearTimer('show');delete me.activeTarget;if(me.autoHide!==false){hasHideDelay=active&&parseInt(active.hideDelay,10);if(hasHideDelay){delay=me.hideDelay;me.hideDelay=hasHideDelay;}
me.delayHide();if(hasHideDelay){me.hideDelay=delay;}}},targetTextEmpty:function(){var me=this,target=me.activeTarget,cfg=me.tagConfig,el,text;if(target){el=target.el;if(el){text=el.getAttribute(cfg.namespace+cfg.attribute);if(!text&&!me.targets[target.target]){return true;}}}
return false;},show:function(){var me=this,fromDelay=me.fromDelayShow;if(fromDelay&&me.targetTextEmpty()){me.onShowVeto();delete me.activeTarget;return;}
me.callParent(arguments);},showAt:function(xy){var me=this,target=me.activeTarget,header=me.header,cls;if(target){if(!me.rendered){me.render(Ext.getBody());me.activeTarget=target;}
me.suspendLayouts();if(target.title){me.setTitle(target.title);header.show();}else if(header){header.hide();}
me.update(target.text);me.autoHide=target.autoHide;me.dismissDelay=target.dismissDelay||me.dismissDelay;if(target.mouseOffset){xy[0]+=target.mouseOffset[0];xy[1]+=target.mouseOffset[1];}
cls=me.lastCls;if(cls){me.removeCls(cls);delete me.lastCls;}
cls=target.cls;if(cls){me.addCls(cls);me.lastCls=cls;}
me.setWidth(target.width);if(me.anchor){me.constrainPosition=false;}else if(target.align){xy=me.getAlignToXY(target.el,target.align);me.constrainPosition=false;}else{me.constrainPosition=true;}
me.resumeLayouts(true);}
me.callParent([xy]);},hide:function(){delete this.activeTarget;this.callParent();}});Ext.define('MP.data.MetaData',{requires:['Ext.Ajax','Ext.window.MessageBox','Ext.util.Format'],uses:['Ext.form.field.*','Ext.grid.column.Boolean','Ext.grid.column.Date','Ext.grid.column.Number','Ext.data.Store','Ext.data.proxy.Ajax','Ext.data.reader.Json','Ext.util.MixedCollection','MP.desktop.App'],statics:{cache:{},fetch:function(url,scope,callback,error_callback){var me=this;var cache=me.cache;var md=cache[url];if(md){callback.call(scope,md);}else{this.request(url,{metadata:'metadata',limit:0},function(metadata){md=new MP.data.MetaData(metadata);cache[url]=md;callback.call(scope,md);},error_callback);}},clearCache:function(){var cache=this.cache;for(var url in cache){if(cache.hasOwnProperty(url)){delete cache[url];}}},request:function(url,params,callback,error_callback){MP.desktop.App.request('GET',url,params,function(result){if(Ext.isObject(result.metadata))
callback(result.metadata);else{Ext.MessageBox.alert(_("Couldn't fetch configuration"),_('Invalid response from ')+url);if(error_callback)error_callback(result);}});},renderBoolean:function(value){return(value===true)?_('Yes'):_('No');},renderDate:function(value){return Ext.util.Format.date(value,_('m/d/Y'));},renderTime:function(value){return Ext.util.Format.date(value,_('g:i A'));},renderTimestamp:function(value){return Ext.util.Format.date(value,_('m/d/Y g:i:s A'));}},validFieldName:/^[a-z][a-z0-9_]+$/,constructor:function(metadata){var me=this;me.primary_key=metadata.primary_key;me.count_slot=metadata.count_slot;me.root_slot=metadata.root_slot;me.success_slot=metadata.success_slot;me.fields_info=new Ext.util.MixedCollection(false,function(info){return info.name;});me.fields_info.addAll(metadata.fields);},fields:function(overrides){var me=this;var fields=[];var typemap={'integer':'int','numeric':'float'};me.fields_info.each(function(info){var override={};if(overrides){Ext.Object.merge(override,overrides[info.name],overrides['*']);}
var sendback=(info.sendback===true||info.name.match(me.validFieldName))&&(override.sendback!==false);var field={name:info.name,type:typemap[info.type]||'auto',useNull:info.nullable||override.nullable,allowBlank:info.nullable||override.nullable,sendBackToServer:sendback};if(info.type==='date'){field.dateFormat=info.format;}
fields.push(field);});return fields;},columns:function(overrides,editable){var me=this;var editors=null;var columns=[];if(editable===undefined){editable=true;}
if(editable){editors=me.editors(Ext.apply({},overrides,{'*':{fieldLabel:null}}));}
me.fields_info.each(function(info){var readonly;var override={hidden:info.hidden};var column={text:info.label,tooltip:info.hint,dataIndex:info.name,sortable:true,flex:info.flex};if(overrides){var cfg=overrides[info.name];var dfl=overrides['*'];if(dfl){if(Ext.isFunction(dfl)){dfl=dfl.call(this,info);}
Ext.apply(override,dfl);delete override.editor;}
if(cfg){if(Ext.isFunction(cfg)){cfg=cfg.call(this,info);}
Ext.apply(override,cfg);delete override.editor;}}
if(editable){if(override.readonly!==undefined){readonly=override.readonly;}else{readonly=info.readonly;}}else{readonly=true;}
if(info.dictionary){var dict;if(Ext.isArray(info.dictionary)){dict={};Ext.each(info.dictionary,function(v){dict[v[0]]=v[1];});}else{dict=info.dictionary;}
column.renderer=Ext.bind(function(value){return this[value];},dict);var store;if(Ext.isArray(info.dictionary)){store=[].concat(info.dictionary);}else{var sortby=0;var d=info.dictionary;store=[];for(var k in d){if(k=='__sort_by__'){sortby=(d[k]=='value'?1:0);}else{store.push([k,d[k]]);}}
store.sort(function(a,b){a=a[sortby];b=b[sortby];return a<b?-1:(a>b?1:0);});}
column.filter={xtype:'combo',store:store,triggerAction:'all',typeAhead:true,forceSelection:true,allowBlank:true,minChars:0};}else if(info.lookup&&info.lookup.url){var lup=info.lookup;var idField=lup.idField||'id';var flds=[idField];var displayField=lup.displayField;var otherFields=lup.otherFields;if(displayField){flds.push(displayField);}
if(otherFields){if(!Ext.isArray(otherFields)){otherFields=otherFields.split(',');}
flds=flds.concat(otherFields);}
var model=Ext.define('MP.data.ImplicitModel-'+Ext.id(),{extend:'Ext.data.Model',fields:flds,idProperty:idField});var remoteFilter=lup.remoteFilter===undefined?true:lup.remoteFilter;var remoteSort=lup.remoteSort===undefined?true:lup.remoteSort;var lstore=Ext.create('Ext.data.Store',{model:model,pageSize:lup.pageSize===undefined?999:lup.pageSize,autoLoad:!remoteFilter||!remoteSort,remoteFilter:remoteFilter,remoteSort:remoteSort,sorters:lup.sorters,proxy:{type:'ajax',url:lup.url,filterParam:'filters',reader:{type:'json',root:lup.resultSlot||'root',idProperty:idField,totalProperty:lup.countSlot||'count'}}});lstore.implicitModel=true;var listConfig={};if(lup.innerTpl){listConfig.getInnerTpl=Ext.bind(function(){return this.innerTpl;},lup);}
if(lup.pageSize!==undefined){listConfig.createPagingToolbar=function(){return Ext.widget('pagingtoolbar',{id:this.id+'-paging-toolbar',pageSize:this.pageSize,store:this.dataSource,border:false,ownerCt:this,ownerLayout:this.getComponentLayout(),getPagingItems:function(){var items;items=Ext.toolbar.Paging.prototype.getPagingItems.call(this);items=Ext.Array.filter(items,function(i){return i.itemId=='first'||i.itemId=='prev'||i.itemId=='next'||i.itemId=='last';});items.unshift('->');items.push('->');return items;}});};}
column.filter={xtype:'combo',store:lstore,displayField:displayField||idField,loadingText:_('Loading...'),triggerAction:'all',typeAhead:true,forceSelection:true,allowBlank:true,minChars:0,pageSize:lup.pageSize,listConfig:listConfig};}else if(info.type==='string'){var password=info.password===true;if(password){column.renderer=function(){return'*****';};column.filter=false;}else{column.filter=true;}}else if(info.type==='boolean'){if(readonly){column.xtype='booleancolumn';}else{column.xtype='checkcolumn';}
column.filter={type:'bool',noOperatorPlugin:true};}else if(info.type==='date'){column.xtype='datecolumn';column.renderer=(info.timestamp?MP.data.MetaData.renderTimestamp:(info.time?MP.data.MetaData.renderTime:MP.data.MetaData.renderDate));column.filter={type:info.time?'time':'date'};}else{if(info.decimals){var decimals=info.decimals;column.renderer=function(v){if(v!=''&&v!=null){return v.toFixed(decimals);}else{return v;}};column.filter={type:'float'};}else{column.filter={type:'int'};}}
if(info.align!==undefined){column.align=info.align;}
if(info.width!==undefined){column.width=info.width;}
if(info.sortable!==undefined){column.sortable=info.sortable;}
if(!readonly&&editors&&info.name in editors){column.editor=editors[info.name];column.editor.fieldLabel=null;}
Ext.Object.merge(column,override);columns.push(column);});return columns;},editors:function(overrides){var me=this;var editors={};me.fields_info.each(function(info){var readonly;var override={};var editor={fieldLabel:info.label,name:info.name};if(overrides){var cfg=overrides[info.name];var dfl=overrides['*'];if(dfl&&dfl.editor){dfl=dfl.editor;if(Ext.isFunction(dfl)){dfl=dfl.call(this,info);}
Ext.apply(override,dfl);}
if(cfg&&cfg.editor){cfg=cfg.editor;if(Ext.isFunction(cfg)){cfg=cfg.call(this,info);}
Ext.apply(override,cfg);}}
if(override.readonly!==undefined){readonly=override.readonly;}else{readonly=info.readonly;}
if(readonly)
return;var nullable=info.nullable;if(override.nullable!==undefined){nullable=override.nullable;delete override['nullable'];}
if(info.dictionary){var store;if(Ext.isArray(info.dictionary)){store=[].concat(info.dictionary);}else{var sortby=0;var dict=info.dictionary;store=[];for(var k in dict){if(k=='__sort_by__'){sortby=(dict[k]=='value'?1:0);}else{store.push([k,dict[k]]);}}
store.sort(function(a,b){a=a[sortby];b=b[sortby];return a<b?-1:(a>b?1:0);});}
Ext.apply(editor,{xtype:'combo',store:store,triggerAction:'all',typeAhead:true,forceSelection:true,allowBlank:nullable});}else if(info.lookup){var lup=info.lookup;if(lup.url){var idField=lup.idField||'id';var flds=[idField];var displayField=lup.displayField;var otherFields=lup.otherFields;if(displayField){flds.push(displayField);}
if(otherFields){if(!Ext.isArray(otherFields)){otherFields=otherFields.split(',');}
flds=flds.concat(otherFields);}
var model=Ext.define('MP.data.ImplicitModel-'+Ext.id(),{extend:'Ext.data.Model',fields:flds,idProperty:idField});var remoteFilter=lup.remoteFilter===undefined?true:lup.remoteFilter;var remoteSort=lup.remoteSort===undefined?true:lup.remoteSort;var lstore=Ext.create('Ext.data.Store',{model:model,pageSize:lup.pageSize===undefined?999:lup.pageSize,autoLoad:!remoteFilter||!remoteSort,remoteFilter:remoteFilter,remoteSort:remoteSort,sorters:lup.sorters,proxy:{type:'ajax',url:lup.url,filterParam:'filters',reader:{type:'json',root:lup.resultSlot||'root',idProperty:idField,totalProperty:lup.countSlot||'count'}}});lstore.implicitModel=true;var listConfig={};if(lup.innerTpl){listConfig.getInnerTpl=Ext.bind(function(){return this.innerTpl;},lup);}
if(lup.pageSize!==undefined){listConfig.createPagingToolbar=function(){return Ext.widget('pagingtoolbar',{id:this.id+'-paging-toolbar',pageSize:this.pageSize,store:this.dataSource,border:false,ownerCt:this,ownerLayout:this.getComponentLayout(),getPagingItems:function(){var items;items=Ext.toolbar.Paging.prototype.getPagingItems.call(this);items=Ext.Array.filter(items,function(i){return i.itemId=='first'||i.itemId=='prev'||i.itemId=='next'||i.itemId=='last';});items.unshift('->');items.push('->');return items;}});};}
Ext.apply(editor,{xtype:'combo',store:lstore,lookupFor:lup.lookupField||idField,displayField:displayField||idField,loadingText:_('Loading...'),triggerAction:'all',typeAhead:true,selectOnFocus:true,allowBlank:nullable,minChars:3,pageSize:lup.pageSize,listConfig:listConfig});}else{Ext.apply(editor,{xtype:'triggerfield',triggerClass:'x-form-search-trigger'});}}else if(info.type==='string'){if(info.length){Ext.apply(editor,{xtype:'textfield',allowBlank:nullable,inputType:info.password===true?'password':'text',selectOnFocus:info.password===true,vtype:info.vtype,vtypeText:info.vtypeText,maxLength:info.length,enforceMaxLength:true,regex:info.regexp?new RegExp(info.regexp):undefined});}else{Ext.apply(editor,{xtype:'textareafield',allowBlank:nullable});}
if(info.uppercase){editor.listeners={change:function(field,newValue){field.setValue(newValue.toUpperCase());}};}}else if(info.type==='boolean'){Ext.apply(editor,{xtype:'checkbox',cls:'x-grid-checkheader-editor'});}else if(info.type==='date'){if(info.time){Ext.apply(editor,{xtype:'timefield',allowBlank:nullable,format:_('g:i A')});}else{Ext.apply(editor,{xtype:'datefield',allowBlank:nullable,format:(info.timestamp?_('m/d/Y g:i:s A'):_('m/d/Y'))});}}else{Ext.apply(editor,{xtype:'numberfield',selectOnFocus:true,allowBlank:nullable});if(info.decimals!==undefined){editor.allowDecimals=info.decimals!=0;editor.decimalPrecision=info.decimals;}}
if(typeof info.width!='undefined'){editor.width=info.width;}
if(typeof info.height!='undefined'){editor.height=info.height;}
if(typeof info.anchor!='undefined'){editor.anchor=info.anchor;}
if(typeof info.min!='undefined'){editor.minValue=info.min;}
if(typeof info.max!='undefined'){editor.maxValue=info.max;}
Ext.Object.merge(editor,override);editors[info.name]=editor;});return editors;}});Ext.define('MP.data.AbstractStore',{override:'Ext.data.AbstractStore',load:function(options){var me=this,operation;options=Ext.apply({action:'read',filters:me.filters.items},options);if(me.remoteSort){options.sorters=me.getSorters();}
me.lastOptions=options;operation=new Ext.data.Operation(options);if(me.fireEvent('beforeload',me,operation)!==false){me.loading=true;me.proxy.read(operation,me.onProxyLoad,me);}
return me;}});Ext.define("MP.data.Store",{extend:"Ext.data.Store",requires:["Ext.window.MessageBox","MP.window.Notification","MP.data.Model"],newRecordCls:'mp-new-record',dirtyRecordCls:'mp-dirty-record',deletedRecordCls:'mp-deleted-record',constructor:function(config){var me=this;config=Ext.merge({listeners:{add:function(store,recs){if(!store._add_recs){store._add_recs=[];}
store._add_recs=store._add_recs.concat(recs);},remove:function(store,rec){if(!store._del_recs){store._del_recs=[];}
if(store._del_recs.indexOf(rec)==-1){store._del_recs.push(rec);}
Ext.Array.remove(store._add_recs,rec);Ext.Array.remove(store._upd_recs,rec);},update:function(store,rec,op){if(op===Ext.data.Model.REJECT)
return;if(store._add_recs&&store._add_recs.indexOf(rec)!=-1)
return;if(store._del_recs&&store._del_recs.indexOf(rec)!=-1)
return;if(!store._upd_recs){store._upd_recs=[];}
if(store._upd_recs.indexOf(rec)==-1){store._upd_recs.push(rec);}},load:function(store){store._add_recs=[];store._del_recs=[];store._upd_recs=[];},clear:function(store){store._add_recs=[];store._del_recs=[];store._upd_recs=[];}}},config);var stickyFilters=me.decodeFilters(config.stickyFilters);delete config.stickyFilters;me.stickyFilters=new Ext.util.MixedCollection();me.stickyFilters.addAll(stickyFilters);me.callParent([config]);me.filters.addAll(me.stickyFilters.items);me.filters.on('clear',function(){me.filters.addAll(me.stickyFilters.items);});me.addEvents("reject");},removeRecordFromLists:function(record){if(this._add_recs&&this._add_recs.indexOf(record)!=-1){Ext.Array.remove(this._add_recs,record);}else if(this._del_recs&&this._del_recs.indexOf(record)!=-1){Ext.Array.remove(this._del_recs,record);}else if(this._upd_recs&&this._upd_recs.indexOf(record)!=-1){Ext.Array.remove(this._upd_recs,record);}},afterCommit:function(record){this.removeRecordFromLists(record);this.callParent([record]);},afterReject:function(record){var justadded=this._add_recs&&this._add_recs.indexOf(record)!=-1;this.removeRecordFromLists(record);if(!justadded){this.callParent([record]);}else{this.remove(record);if(this._del_recs){Ext.Array.remove(this._del_recs,record);}}},rejectChanges:function(suppressEvent){this.callParent();var a=this._add_recs.slice(0);for(var i=0,len=a.length;i<len;i++){a[i].reject();}
if(this._del_recs&&this._del_recs.length){this._del_recs=[];if(!suppressEvent){this.fireEvent("datachanged",this);}}
if(this._upd_recs&&this._upd_recs.length){this._upd_recs=[];if(!suppressEvent){this.fireEvent("datachanged",this);}}
if(!suppressEvent){this.fireEvent("reject",this);}},getRejectRecords:function(){var recs=[],push=Ext.Array.push;if(this._add_recs&&this._add_recs.length){push(recs,this._add_recs);}
if(this._upd_recs&&this._upd_recs.length){push(recs,this._upd_recs);}
if(this._del_recs&&this._del_recs.length){push(recs,this._del_recs);}
return recs;},getNewRecords:function(){return this._add_recs||[];},getUpdatedRecords:function(){return this._upd_recs||[];},getDeletedRecords:function(){return this._del_recs||[];},isModified:function(){var modified=false;if(this.data.length>0){modified=(this._upd_recs&&this._upd_recs.length>0||(this._add_recs&&this._add_recs.length>0)||(this._del_recs&&this._del_recs.length>0));}
return modified;},getChanges:function(changes,idfield,idfvalue,deletions_only){var modified;var deleted;if(!changes){modified=[];deleted=[];changes={modified_records:modified,deleted_records:deleted};}else{modified=changes.modified_records;if(!modified){modified=[];changes.modified_records=modified;}
deleted=changes.deleted_records;if(!deleted){deleted=[];changes.deleted_records=deleted;}}
if(this.isModified()){if(!deletions_only){var add_or_mod=[];var recs=this.getModifiedRecords();var len=recs.length;add_or_mod=add_or_mod.concat(this._add_recs||[]);for(var aomi=0;aomi<len;aomi++){var rec=recs[aomi];if(!rec.isValid()){Ext.Msg.show({title:_('Validation error'),msg:_("At least one record didn't satisfy validation constraints"),buttons:Ext.Msg.CANCEL,icon:Ext.Msg.WARNING});return null;}
if(add_or_mod.indexOf(rec)==-1){add_or_mod.push(rec);}}
for(var mi=0;mi<add_or_mod.length;mi++){var aom=add_or_mod[mi];var cfields,idfname;if(typeof idfield=='function'){idfname=idfield.call(aom);}else{idfname=idfield;}
cfields=aom.getModifiedFields(idfname,idfvalue);if(cfields){if(Ext.isObject(cfields)){modified.push([idfname,cfields]);}else{Ext.Msg.show({title:_('Validation error'),msg:Ext.String.format(_("The field “{0}” cannot be left empty"),cfields),buttons:Ext.Msg.CANCEL,icon:Ext.Msg.WARNING});return null;}}}}
var drds=this._del_recs||[];for(var di=0;di<drds.length;di++){deleted.push([idfield,drds[di].get(idfield)]);}}
if(modified.length>0||deleted.length>0){return changes;}else{return null;}},commitChanges:function(url,idfield,callback,scope,deletions_only){var me=this;var changes=me.getChanges(null,idfield,null,deletions_only);if(!changes){return;}
var mrecs=changes.modified_records||[];var drecs=changes.deleted_records||[];Ext.create("MP.window.Notification",{position:'br',title:_('Writing changes...'),html:_('Please wait'),iconCls:'waiting-icon'}).show();var o={url:url,method:'POST',callback:function(options,success,response){if(true!==success){var msg=response.statusText;if(msg=='Internal Server Error'){msg=_('Internal server error!');}else if(msg=='communication failure'){msg=_('Communication failure!');}
Ext.create("MP.window.Notification",{position:'br',title:_('Error'),html:msg,iconCls:'alert-icon'}).show();return;}
try{var r=Ext.decode(response.responseText);}catch(e){Ext.create("MP.window.Notification",{position:'br',title:_('Error'),html:_('Unrecognized response'),iconCls:'alert-icon'}).show();me.showError(response.responseText,_('Cannot decode JSON object'));return;}
if(true!==r.success){Ext.create("MP.window.Notification",{position:'br',title:_('Error'),html:_('Write failed'),iconCls:'alert-icon'}).show();me.showError(r.message||_('Unknown error'));return;}
Ext.create("MP.window.Notification",{position:'br',title:_('Done'),html:_('Changes committed successfully.'),iconCls:'done-icon'}).show();me.reload();if(callback){callback.call(scope||me);}},scope:me,params:{deleted_records:Ext.encode(drecs),modified_records:Ext.encode(mrecs)}};Ext.Ajax.request(o);},showError:function(msg,title){Ext.Msg.show({title:title||_('Error'),msg:Ext.util.Format.ellipsis(msg,2000),icon:Ext.Msg.ERROR,buttons:Ext.Msg.OK,minWidth:1200>String(msg).length?360:600});},classifyRecord:function(rec){if(this._del_recs&&this._del_recs.indexOf(rec)!=-1){return this.deletedRecordCls;}else if(this._add_recs&&this._add_recs.indexOf(rec)!=-1){return this.newRecordCls;}else if(this._upd_recs&&this._upd_recs.indexOf(rec)!=-1){return this.dirtyRecordCls;}
return'';},deleteRecord:function(rec){if(!this._del_recs){this._del_recs=[];}
if(this._add_recs.indexOf(rec)!=-1){this.remove(rec);Ext.Array.remove(this._del_recs,rec);this.fireEvent("datachanged",this);}else if(this._del_recs.indexOf(rec)==-1){this._del_recs.push(rec);if(this._upd_recs){Ext.Array.remove(this._upd_recs,rec);}
this.fireEvent("update",this,rec,Ext.data.Record.EDIT,[]);this.fireEvent("datachanged",this);}},createNewRecord:function(initialdata){var me=this;if(me.model){var data={};var fnames=me.model.prototype.fields.keys;if(initialdata){Ext.apply(data,initialdata);}
for(var fi=0,fl=fnames.length;fi<fl;fi++){var name=fnames[fi];if(typeof data[name]=='undefined'){data[name]=null;}}
var record=new me.model(data);if(initialdata){var modified=record.modified;for(var fname in initialdata){modified[fname]=undefined;}}
return record;}else{return false;}},getTotalCount:function(){return(this.totalCount||0)+(this._add_recs?this._add_recs.length:0);},shouldDisableAction:function(act){if(!act.setDisabled){return null;}
var cfg=act.initialConfig;if(this.isModified()){if(cfg.needsDirtyState===false||cfg.needsCleanStore===true){return true;}}else{if(cfg.needsDirtyState===true||cfg.needsCleanStore===false){return true;}}
return false;},stickyFilter:function(filters,value,noImmediateReload){if(Ext.isString(filters)){filters={property:filters,value:value};}else{noImmediateReload=value;}
var me=this,decoded=me.decodeFilters(filters),i=0,length=decoded.length;for(;i<length;i++){me.stickyFilters.replace(decoded[i]);}
if(noImmediateReload){me.filters.addAll(me.stickyFilters.items);}else{me.filter(decoded);}},clearStickyFilter:function(suppressEvent){var me=this;var slen=me.stickyFilters.length;var sitems=me.stickyFilters.items;for(var s=0;s<slen;s++){var si=sitems[s];var flen=me.filters.length;var fitems=me.filters.items;for(var f=0;f<flen;f++){var fi=fitems[f];if(fi.property==si.property&&fi.value==si.value){me.filters.removeAt(f);break;}}}
me.stickyFilters.clear();if(me.remoteFilter){if(suppressEvent){return;}
delete me.totalCount;if(me.buffered){me.pageMap.clear();me.loadPage(1);}else{me.currentPage=1;me.load();}}else if(me.isFiltered()){me.data=me.snapshot.clone();delete me.snapshot;if(suppressEvent!==true){me.fireEvent('datachanged',me);me.fireEvent('refresh',me);}}}});Ext.define('MP.grid.Custom',{extend:'Ext.grid.Panel',requires:['MP.data.Store'],uses:['MP.data.MetaData','Ext.data.proxy.Ajax'],layout:'fit',border:false,header:false,stateful:false,dataURL:null,saveChangesURL:null,idProperty:'id',totalProperty:'count',successProperty:'success',rootProperty:'root',fields:null,columns:null,newRecordData:null,remoteSort:true,storeAutoLoad:undefined,sorters:undefined,remoteGroup:false,groupers:undefined,autoShowAllEditors:true,pageSize:25,selType:'rowmodel',initComponent:function(){var me=this;if(!me.fields){MP.data.MetaData.fetch(me.dataURL,me,me.configure);}else{if(!me.store){me.store=me.createStore();}}
if(me.otherButtons){me.buttons=me.otherButtons.concat(me.buttons||[]);}
me.columns={items:me.columns};me.callParent();},configure:function(metadata){var me=this;var store;Ext.apply(me,{idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,rootProperty:metadata.root_slot});store=me.createStore(metadata);if(me.headerCt){me.reconfigure(store,metadata.columns(me.metadataOverrides));}else{me.store=store;me.columns=metadata.columns(me.metadataOverrides);}},createStore:function(metadata){var me=this;var model,store;var fields=metadata?metadata.fields(me.overrides):me.fields;model=Ext.define('MP.data.ImplicitModel-'+Ext.id(),{extend:'Ext.data.Model',fields:fields,idProperty:me.idProperty});store=Ext.create('MP.data.Store',{model:model,pageSize:me.pageSize,proxy:{type:'ajax',url:me.dataURL,sortParam:'sorters',extraParams:me.extraParams,reader:{type:'json',idProperty:me.idProperty,totalProperty:me.totalProperty,successProperty:me.successProperty,root:me.rootProperty}},remoteSort:me.remoteSort,sorters:me.sorters,remoteFilter:true,stickyFilters:me.stickyFilters,filters:me.filters,remoteGroup:me.remoteGroup,groupers:me.groupers,autoLoad:me.storeAutoLoad,autoDestroy:true});store.implicitModel=true;return store;},initEvents:function(){var me=this;me.callParent();me.view.getRowClass=me.classifyRecord;var sm=me.getSelectionModel();sm.on('select',me.onSelectRow,me);sm.on('deselect',me.onDeselectRow,me);},classifyRecord:function(rec,rowIndex,rowParams,store){return store.classifyRecord(rec);},onSelectRow:Ext.emptyFn,onDeselectRow:Ext.emptyFn,onStoreLoad:function(){var me=this;var sm=me.getSelectionModel();me.callParent();if(sm.store){sm.deselectAll();}},getAllActions:function(){return[];},shouldDisableAction:function(act){var me=this;var disable=me.store.shouldDisableAction(act);if(disable===false){var cfg=act.initialConfig;var nsels=me.getSelectionModel().getCount();if(cfg.needsSelectedRow===true){disable=nsels===0;}else if(cfg.needsOneSelectedRow===true){disable=nsels!=1;}}
return disable;},addRecord:function(index){var me=this;var rindex;if(typeof index=='number'){rindex=index;}else{rindex=0;}
var store=me.store;var newdata=me.newRecordData||{};if(typeof newdata=='function'){newdata=newdata();}
var rec=store.createNewRecord(newdata);if(rec){store.insert(rindex,rec);if(me.autoShowAllEditors){var hc=me.headerCt;var gc=hc.getGridColumns();var cc=gc.length;for(var i=0;i<cc;i++){var c=gc[i];if(c.dataIndex){var f=c.field||c.editor;if(f!==undefined&&c.hidden===true){c.show();}else if(f===undefined&&c.hidden!==true){c.hide();}}}}
me.getSelectionModel().select([rec]);return rec;}
return false;},deleteRecord:function(){var me=this;var sm=me.getSelectionModel();var count=sm.getCount();var title=ngettext('Delete {0} record?','Delete {0} records?',count);var msg=ngettext('Do you really want to delete selected record?','Do you really want to delete selected records?',count);Ext.Msg.show({title:Ext.String.format(title,count),msg:msg,icon:Ext.Msg.QUESTION,buttons:Ext.Msg.YESNO,scope:me,fn:function(response){if('yes'==response){Ext.each(sm.getSelection(),function(record){record.store.deleteRecord(record);});sm.clearSelections();if(me.immediateDeletions){me.commitChanges(null,null,true);}}}});},commitChanges:function(callback,scope,deletions_only){var me=this;if(me.editingPlugin){me.editingPlugin.completeEdit();}
me.store.commitChanges(me.saveChangesURL||me.dataURL,me.idProperty,callback,scope,deletions_only);},resetChanges:function(){var me=this;if(me.editingPlugin){me.editingPlugin.completeEdit();}
me.store.rejectChanges();me.view.doStripeRows(0);},getColumnByName:function(name){var me=this;var hc=me.headerCt;var gc=hc.getGridColumns();var cc=gc.length;for(var i=0;i<cc;i++){var c=gc[i];if(c.dataIndex==name){return c;}}}});Ext.define('Ext.tip.QuickTipManager',{requires:['Ext.tip.QuickTip'],singleton:true,alternateClassName:'Ext.QuickTips',disabled:false,init:function(autoRender,config){var me=this;if(!me.tip){if(!Ext.isReady){Ext.onReady(function(){Ext.tip.QuickTipManager.init(autoRender,config);});return;}
var tipConfig=Ext.apply({disabled:me.disabled,id:'ext-quicktips-tip'},config),className=tipConfig.className,xtype=tipConfig.xtype;if(className){delete tipConfig.className;}else if(xtype){className='widget.'+xtype;delete tipConfig.xtype;}
if(autoRender!==false){tipConfig.renderTo=document.body;}
me.tip=Ext.create(className||'Ext.tip.QuickTip',tipConfig);Ext.quickTipsActive=true;}},destroy:function(){Ext.destroy(this.tip);this.tip=undefined;},ddDisable:function(){var me=this,tip=me.tip;if(tip&&!me.disabled){tip.disable();}},ddEnable:function(){var me=this,tip=me.tip;if(tip&&!me.disabled){tip.enable();}},enable:function(){var me=this,tip=me.tip;if(tip){tip.enable();}
me.disabled=false;},disable:function(){var me=this,tip=me.tip;if(tip){tip.disable();}
me.disabled=true;},isEnabled:function(){var tip=this.tip;return tip!==undefined&&!tip.disabled;},getQuickTip:function(){return this.tip;},register:function(){var tip=this.tip;tip.register.apply(tip,arguments);},unregister:function(){var tip=this.tip;tip.unregister.apply(tip,arguments);},tips:function(){var tip=this.tip;tip.register.apply(tip,arguments);}});Ext.define('SoL.desktop.App',{extend:'MP.desktop.App',uses:['SoL.window.ChangeLanguage','SoL.window.ChangePassword'],desktopConfig:{wallpaper:'/static/images/wallpapers/sol4.png',wallpaperStyle:'center'},getStartConfig:function(){var me=this,config=me.callParent();config.height=(me.user.is_admin||me.user.user_id===null)?185:260;return config;},getToolConfig:function(){var me=this,config=me.callParent(),upload_module=me.getModule('upload-win');config.items.unshift({text:_('Scorecards'),tooltip:_('Print one sheet of blank scorecards.'),iconCls:'print-icon',handler:function(){var url='/pdf/scorecards/blank';window.location.assign(url);}},'-',{text:_('Manual'),tooltip:_('Show user manual.'),iconCls:'help-icon',handler:function(){window.open(_('/static/manual/en/index.html'),"_blank");}},{text:_('Rules'),tooltip:_('Carrom playing rules.'),iconCls:'info-icon',handler:function(){window.open(_('/static/manual/en/rules.html'),"_blank");}},!me.user.is_admin?{text:_('Donate'),tooltip:_('Support SoL development through a donation.'),iconCls:'money-euro-icon',handler:function(){window.open(_('/static/manual/en/development.html#donations'),"_blank");}}:null,!me.user.is_admin?{text:_('Issues'),tooltip:_('Propose enhancements or report issues.'),iconCls:'bug-link-icon',handler:function(){window.open('https://gitlab.com/metapensiero/SoL/-/issues',"_blank");}}:null,'-');if(!me.user.is_admin&&me.user.user_id!==null){config.items.splice(config.items.length-1,0,{text:_('Password'),tooltip:_('Change your account password.'),iconCls:'edit-pwd-icon',handler:function(){Ext.create('SoL.window.ChangePassword',{}).show();}});config.items.splice(config.items.length-1,0,{text:_('Language'),tooltip:_('Change your account UI language.'),iconCls:'comment-icon',handler:function(){Ext.create('SoL.window.ChangeLanguage',{currentLanguage:me.user.ui_language}).show();}});}
if(upload_module){config.items.unshift({iconCls:upload_module.iconCls,text:_('Upload'),tooltip:upload_module.getLauncherTooltip(),handler:upload_module.createOrShowWindow,scope:upload_module});}
return config;}});Ext.define('MP.desktop.Module',{extend:'Ext.util.Observable',requires:['MP.data.MetaData','Ext.window.MessageBox'],dataURL:null,pageSize:25,constructor:function(config){this.callParent([config]);this.init();},createOrShowWindow:Ext.emptyFn,createLauncher:function(){var me=this,text=me.getLauncherText();if(text){var tooltip=me.getLauncherTooltip();return{iconCls:me.iconCls,text:text,tooltip:tooltip};}else
return null;},getLauncherText:function(){var me=this;var text=me.launcherText;if(typeof text=='function')
text=text.call(me);return text;},getLauncherTooltip:function(){var me=this;var tooltip=me.launcherTooltip;if(typeof tooltip=='function')
tooltip=tooltip.call(me);return tooltip;},init:function(){var me=this;me.launcher=me.createLauncher();},fetchFieldsAndColumns:function(callback,scope,url,overrides,error_callback){var me=this;MP.data.MetaData.fetch(url||me.dataURL,me,function(metadata){callback.call(scope||me,metadata.fields(overrides),metadata.columns(overrides),metadata.primary_key,metadata.success_slot,metadata.root_slot,metadata.count_slot);},error_callback);},configure:function(functions,callback,config){var me=this;var maskel=me.app.getDesktop().getEl();var count=functions.length;var step=1/(count*2+1);var value=0;maskel.mask('<span id="pbar"></span>');var pbar=Ext.create('Ext.ProgressBar',{text:_("Initializing..."),width:180,renderTo:'pbar'});Ext.each(functions,function(f){var keepgoing=true;value+=step;pbar.updateProgress(value);f.call(me,function(){value+=step;pbar.updateProgress(value);count--;if(!count){value+=step;pbar.updateProgress(value);callback.call(me,function(){pbar.reset(true);maskel.unmask();},config);}},function(){pbar.reset(true);maskel.unmask();keepgoing=false;},config);return keepgoing;});}});Ext.define('Ext.form.Panel',{extend:'Ext.panel.Panel',mixins:{fieldAncestor:'Ext.form.FieldAncestor'},alias:'widget.form',alternateClassName:['Ext.FormPanel','Ext.form.FormPanel'],requires:['Ext.form.Basic','Ext.util.TaskRunner'],layout:'anchor',ariaRole:'form',basicFormConfigs:['api','baseParams','errorReader','jsonSubmit','method','paramOrder','paramsAsHash','reader','standardSubmit','timeout','trackResetOnLoad','url','waitMsgTarget','waitTitle'],initComponent:function(){var me=this;if(me.frame){me.border=false;}
me.initFieldAncestor();me.callParent();me.relayEvents(me.form,['beforeaction','actionfailed','actioncomplete','validitychange','dirtychange']);if(me.pollForChanges){me.startPolling(me.pollInterval||500);}},initItems:function(){this.callParent();this.initMonitor();this.form=this.createForm();},afterFirstLayout:function(){this.callParent(arguments);this.form.initialize();},createForm:function(){var cfg={},props=this.basicFormConfigs,len=props.length,i=0,prop;for(;i<len;++i){prop=props[i];cfg[prop]=this[prop];}
return new Ext.form.Basic(this,cfg);},getForm:function(){return this.form;},loadRecord:function(record){return this.getForm().loadRecord(record);},getRecord:function(){return this.getForm().getRecord();},updateRecord:function(record){return this.getForm().updateRecord(record);},getValues:function(asString,dirtyOnly,includeEmptyText,useDataValues){return this.getForm().getValues(asString,dirtyOnly,includeEmptyText,useDataValues);},isDirty:function(){return this.form.isDirty();},isValid:function(){return this.form.isValid();},hasInvalidField:function(){return this.form.hasInvalidField();},beforeDestroy:function(){this.stopPolling();this.form.destroy();this.callParent();},load:function(options){this.form.load(options);},submit:function(options){this.form.submit(options);},startPolling:function(interval){this.stopPolling();var task=new Ext.util.TaskRunner(interval);task.start({interval:0,run:this.checkChange,scope:this});this.pollTask=task;},stopPolling:function(){var task=this.pollTask;if(task){task.stopAll();delete this.pollTask;}},checkChange:function(){var fields=this.form.getFields().items,f,fLen=fields.length;for(f=0;f<fLen;f++){fields[f].checkChange();}}});Ext.define('MP.form.Panel',{extend:'Ext.form.Panel',requires:['MP.form.plugin.FieldHint'],statics:{getDefaultEditorSettingsFunction:function(anchor){return function(info){var cfg={anchor:anchor||'95%'};var hint=info.hint||'';if(!info.nullable){cfg.labelClsExtra='mp-form-mandatory-field';if(hint!==''){hint+=' ';}
hint+=_('[Mandatory]');}
if(hint!==''){cfg.plugins=[{ptype:'fieldhint',text:hint}];}
return cfg;};}},updateRecord:function(record){var me=this;record=record||this._record;if(!record){return this;}
var fields=me.getForm().getFields().items;record.beginEdit();for(var i=0,len=fields.length;i<len;++i){var field=fields[i];if(field.lookupFor){var fname=field.lookupFor;if(field.getRawValue()===''){record.set(fname,null);}else if(!Ext.isEmpty(field.lastSelection)){var iname=field.store.proxy.reader.idProperty;var srec=field.lastSelection[0];var luvalue=srec.get(iname);record.set(fname,luvalue);}}}
record.endEdit();return me.callParent([record]);}});Ext.define('MP.grid.Basic',{extend:'MP.grid.Custom',uses:['MP.action.SaveAndReset','MP.action.SaveAndResetOnToolbar','MP.grid.plugin.FilterBar','MP.toolbar.Paging'],alias:'widget.basic-grid',noTopToolbar:false,noBottomToolbar:false,noFilterbar:false,clicksToEdit:2,initComponent:function(){var me=this;if(!me.noFilterbar){var filterbarplugin={ptype:'filterbar',showShowHideButton:true,showClearAllButton:true};if(Ext.isArray(me.plugins)){me.plugins.unshift(filterbarplugin);}else{me.plugins=[filterbarplugin];}}
if(!me.readOnly&&!me.noSaveAndResetActions){var sractions=Ext.create('MP.action.SaveAndReset');var sbplugin=Ext.create('MP.action.SaveAndResetOnToolbar');if(Ext.isArray(me.plugins)){me.plugins.unshift(sractions,sbplugin);}else{me.plugins=[sractions,sbplugin];}}
var ditems=[];if(!me.noTopToolbar){ditems.push({xtype:'toolbar',dock:'top',itemId:'ttoolbar'});}
if(!me.noBottomToolbar){ditems.push(Ext.create('MP.toolbar.Paging',{dock:'bottom',displayInfo:true,itemId:'ptoolbar'}));}
if(ditems.length>0){if(Ext.isArray(me.dockedItems)){me.dockedItems.push(ditems);}else{me.dockedItems=ditems;}}
me.callParent();if(!me.noBottomToolbar){var toolbar=me.child('#ptoolbar');var sizeitem=toolbar.child('#sizeItem');if(me.store&&me.store.storeId!='ext-empty-store'){toolbar.bindStore(me.store);}else{me.on('reconfigure',function(grid,store){toolbar.bindStore(store);});}
sizeitem.on('render',function(c){c.getEl().on({dblclick:function(){var s=me.store;var anode=me.view.getNode(0);var gridh=me.view.getHeight();var rowh,pagesize;if(anode){rowh=Ext.fly(anode).getHeight()+1;}else{rowh=22;}
pagesize=Math.floor(gridh/rowh);if(pagesize!=s.pageSize){var firstrec=s.pageSize*(s.currentPage-1)+1;var newpage=Math.ceil(firstrec/pagesize);s.pageSize=pagesize;sizeitem.setValue(pagesize);s.loadPage(newpage);}}});});}}});Ext.define('Ext.app.Application',{extend:'Ext.app.Controller',requires:['Ext.tip.QuickTipManager'],scope:undefined,enableQuickTips:true,appFolder:'app',appProperty:'app',namespaces:[],autoCreateViewport:false,paths:null,onClassExtended:function(cls,data,hooks){var Controller=Ext.app.Controller,proto=cls.prototype,requires=[],onBeforeClassCreated,paths,namespace,ns,appFolder;namespace=data.name||cls.superclass.name;appFolder=data.appFolder||cls.superclass.appFolder;if(namespace){data.$namespace=namespace;Ext.app.addNamespaces(namespace);}
if(data.namespaces){Ext.app.addNamespaces(data.namespaces);}
if(!data['paths processed']){if(namespace&&appFolder){Ext.Loader.setPath(namespace,appFolder);}
paths=data.paths;if(paths){for(ns in paths){if(paths.hasOwnProperty(ns)){Ext.Loader.setPath(ns,paths[ns]);}}}}
else{delete data['paths processed'];}
if(data.autoCreateViewport){Controller.processDependencies(proto,requires,namespace,'view',['Viewport']);}
if(requires.length){onBeforeClassCreated=hooks.onBeforeCreated;hooks.onBeforeCreated=function(cls,data){var args=Ext.Array.clone(arguments);Ext.require(requires,function(){return onBeforeClassCreated.apply(this,args);});};}},constructor:function(config){var me=this;me.callParent(arguments);me.doInit(me);me.initNamespace();me.initControllers();me.onBeforeLaunch();me.finishInitControllers();},initNamespace:function(){var me=this,appProperty=me.appProperty,ns;ns=Ext.namespace(me.name);if(ns){ns.getApplication=function(){return me;};if(appProperty){if(!ns[appProperty]){ns[appProperty]=me;}}}},initControllers:function(){var me=this,controllers=Ext.Array.from(me.controllers);me.controllers=new Ext.util.MixedCollection();for(var i=0,ln=controllers.length;i<ln;i++){me.getController(controllers[i]);}},finishInitControllers:function(){var me=this,controllers,i,l;controllers=me.controllers.getRange();for(i=0,l=controllers.length;i<l;i++){controllers[i].finishInit(me);}},launch:Ext.emptyFn,onBeforeLaunch:function(){var me=this,controllers,c,cLen,controller;if(me.enableQuickTips){me.initQuickTips();}
if(me.autoCreateViewport){me.initViewport();}
me.launch.call(me.scope||me);me.launched=true;me.fireEvent('launch',me);controllers=me.controllers.items;cLen=controllers.length;for(c=0;c<cLen;c++){controller=controllers[c];controller.onLaunch(me);}},getModuleClassName:function(name,kind){return Ext.app.Controller.getFullName(name,kind,this.name).absoluteName;},initQuickTips:function(){Ext.tip.QuickTipManager.init();},initViewport:function(){var viewport=this.getView('Viewport');if(viewport){viewport.create();}},getController:function(name){var me=this,controllers=me.controllers,className,controller;controller=controllers.get(name);if(!controller){className=me.getModuleClassName(name,'controller');controller=Ext.create(className,{application:me,id:name});controllers.add(controller);if(me._initialized){controller.doInit(me);}}
return controller;},getApplication:function(){return this;}});Ext.define('Ext.panel.Tool',{extend:'Ext.Component',requires:['Ext.tip.QuickTipManager'],alias:'widget.tool',isTool:true,baseCls:Ext.baseCSSPrefix+'tool',disabledCls:Ext.baseCSSPrefix+'tool-disabled',toolPressedCls:Ext.baseCSSPrefix+'tool-pressed',toolOverCls:Ext.baseCSSPrefix+'tool-over',ariaRole:'button',childEls:['toolEl'],renderTpl:['<img role="presentation" id="{id}-toolEl" src="{blank}" class="{baseCls}-img {baseCls}-{type}'+'{childElCls}" role="presentation"/>'],toolOwner:null,tooltipType:'qtip',stopEvent:true,height:15,width:15,initComponent:function(){var me=this;me.addEvents('click');me.type=me.type||me.id;Ext.applyIf(me.renderData,{baseCls:me.baseCls,blank:Ext.BLANK_IMAGE_URL,type:me.type});me.tooltip=me.tooltip||me.qtip;me.callParent();},afterRender:function(){var me=this,attr;me.callParent(arguments);me.el.on({click:me.onClick,mousedown:me.onMouseDown,mouseover:me.onMouseOver,mouseout:me.onMouseOut,scope:me});if(me.tooltip){if(Ext.quickTipsActive&&Ext.isObject(me.tooltip)){Ext.tip.QuickTipManager.register(Ext.apply({target:me.id},me.tooltip));}
else{attr=me.tooltipType=='qtip'?'data-qtip':'title';me.el.dom.setAttribute(attr,me.tooltip);}}},getFocusEl:function(){return this.el;},setType:function(type){var me=this,oldType=me.type;me.type=type;if(me.rendered){if(oldType){me.toolEl.removeCls(me.baseCls+'-'+oldType);}
me.toolEl.addCls(me.baseCls+'-'+type);}else{me.renderData.type=type;}
return me;},onClick:function(e,target){var me=this;if(me.disabled){return false;}
me.el.removeCls(me.toolPressedCls);me.el.removeCls(me.toolOverCls);if(me.stopEvent!==false){e.stopEvent();}
if(me.handler){Ext.callback(me.handler,me.scope||me,[e,target,me.ownerCt,me]);}else if(me.callback){Ext.callback(me.callback,me.scope||me,[me.toolOwner||me.ownerCt,me,e]);}
me.fireEvent('click',me,e);return true;},onDestroy:function(){if(Ext.quickTipsActive&&Ext.isObject(this.tooltip)){Ext.tip.QuickTipManager.unregister(this.id);}
this.callParent();},onMouseDown:function(){if(this.disabled){return false;}
this.el.addCls(this.toolPressedCls);},onMouseOver:function(){if(this.disabled){return false;}
this.el.addCls(this.toolOverCls);},onMouseOut:function(){this.el.removeCls(this.toolOverCls);}});Ext.define('SoL.module.Upload',{extend:'MP.desktop.Module',requires:['Ext.form.Panel','Ext.form.field.File'],uses:['MP.window.Notification'],id:'upload-win',iconCls:'upload-icon',launcherText:null,launcherTooltip:function(){return _('<b>Upload</b><br />Upload tourneys data.');},uploadURL:"/bio/upload",createOrShowWindow:function(){var me=this,desktop=me.app.getDesktop(),win=desktop.getWindow(me.id);if(win){win.destroy();}
var winWidth=315,winHeight=110,form=new Ext.form.Panel({frame:true,bodyPadding:'10 10 0',defaults:{labelWidth:50,anchor:'100%'},items:[{xtype:'fileuploadfield',buttonText:_('Browse'),emptyText:_('Select archive'),allowBlank:false,blankText:_('This field is required'),fieldLabel:_('File'),name:'archive',buttonCfg:{text:'',iconCls:'upload-browse-icon'},listeners:{afterrender:function(fld){var el=fld.fileInputEl.dom;el.setAttribute('accept','application/zip,application/gzip');}}}],buttons:[{text:_('Cancel'),handler:function(){win.destroy();}},{text:_('Confirm'),formBind:true,handler:function(){if(form.getForm().isValid()){Ext.create("MP.window.Notification",{position:'br',html:_('Uploading…'),title:_('Please wait'),iconCls:'waiting-icon'}).show();form.getForm().submit({url:me.uploadURL,waitMsg:_('Uploading…'),success:function(fp,o){if(o.result.success){Ext.create("MP.window.Notification",{position:'br',html:o.result.message,title:_('Done'),iconCls:'done-icon'}).show();}else{Ext.create("MP.window.Notification",{position:'br',html:o.result.message,title:_('Error'),iconCls:'alert-icon'}).show();}},failure:function(fp,o){Ext.create("MP.window.Notification",{position:'br',html:_("Couldn't upload selected file:")
+"<br/>"+o.result.message,title:_('Error'),iconCls:'alert-icon'}).show();}});}}}]});win=desktop.createWindow({id:me.id,title:_('Upload'),iconCls:'upload-icon',width:winWidth,height:winHeight,layout:'fit',minimizable:false,maximizable:false,taskbuttonTooltip:me.getLauncherTooltip(),items:[form]});win.show();}});Ext.define('Ext.form.field.HtmlEditor',{extend:'Ext.form.FieldContainer',mixins:{field:'Ext.form.field.Field'},alias:'widget.htmleditor',alternateClassName:'Ext.form.HtmlEditor',requires:['Ext.tip.QuickTipManager','Ext.picker.Color','Ext.layout.container.VBox','Ext.toolbar.Item','Ext.toolbar.Toolbar','Ext.util.Format','Ext.layout.component.field.HtmlEditor'],componentLayout:'htmleditor',componentTpl:['{beforeTextAreaTpl}','<textarea id="{id}-textareaEl" name="{name}" tabIndex="-1" {inputAttrTpl}',' class="{textareaCls}" autocomplete="off">','{[Ext.util.Format.htmlEncode(values.value)]}','</textarea>','{afterTextAreaTpl}','{beforeIFrameTpl}','<iframe id="{id}-iframeEl" name="{iframeName}" frameBorder="0" {iframeAttrTpl}',' src="{iframeSrc}" class="{iframeCls}"></iframe>','{afterIFrameTpl}',{disableFormats:true}],stretchInputElFixed:true,subTplInsertions:['beforeTextAreaTpl','afterTextAreaTpl','beforeIFrameTpl','afterIFrameTpl','iframeAttrTpl','inputAttrTpl'],enableFormat:true,enableFontSize:true,enableColors:true,enableAlignments:true,enableLists:true,enableSourceEdit:true,enableLinks:true,enableFont:true,createLinkText:'Please enter the URL for the link:',defaultLinkValue:'http:/'+'/',fontFamilies:['Arial','Courier New','Tahoma','Times New Roman','Verdana'],defaultValue:(Ext.isOpera||Ext.isIE6)?'&#160;':'&#8203;',extraFieldBodyCls:Ext.baseCSSPrefix+'html-editor-wrap',initialized:false,activated:false,sourceEditMode:false,iframePad:3,hideMode:'offsets',maskOnDisable:true,containerElCls:Ext.baseCSSPrefix+'html-editor-container',initComponent:function(){var me=this;me.addEvents('initialize','activate','beforesync','beforepush','sync','push','editmodechange');me.items=[me.createToolbar(),me.createInputCmp()];me.layout={type:'vbox',align:'stretch'};me.callParent(arguments);me.initField();},createInputCmp:function(){this.inputCmp=Ext.widget(this.getInputCmpCfg());return this.inputCmp;},getInputCmpCfg:function(){var me=this,id=me.id+'-inputCmp',data={id:id,name:me.name,textareaCls:Ext.baseCSSPrefix+'hidden',value:me.value,iframeName:Ext.id(),iframeSrc:Ext.SSL_SECURE_URL,iframeCls:Ext.baseCSSPrefix+'htmleditor-iframe'};me.getInsertionRenderData(data,me.subTplInsertions);return{flex:1,xtype:'component',tpl:me.getTpl('componentTpl'),childEls:['iframeEl','textareaEl'],id:id,cls:Ext.baseCSSPrefix+'html-editor-input',data:data};},createToolbar:function(){this.toolbar=Ext.widget(this.getToolbarCfg());return this.toolbar;},getToolbarCfg:function(){var me=this,items=[],i,tipsEnabled=Ext.quickTipsActive&&Ext.tip.QuickTipManager.isEnabled(),baseCSSPrefix=Ext.baseCSSPrefix,fontSelectItem,undef;function btn(id,toggle,handler){return{itemId:id,cls:baseCSSPrefix+'btn-icon',iconCls:baseCSSPrefix+'edit-'+id,enableToggle:toggle!==false,scope:me,handler:handler||me.relayBtnCmd,clickEvent:'mousedown',tooltip:tipsEnabled?me.buttonTips[id]||undef:undef,overflowText:me.buttonTips[id].title||undef,tabIndex:-1};}
if(me.enableFont&&!Ext.isSafari2){fontSelectItem=Ext.widget('component',{itemId:'fontSelect',renderTpl:['<select id="{id}-selectEl" class="'+baseCSSPrefix+'font-select">','</select>'],childEls:['selectEl'],afterRender:function(){me.fontSelect=this.selectEl;Ext.Component.prototype.afterRender.apply(this,arguments);},onDisable:function(){var selectEl=this.selectEl;if(selectEl){selectEl.dom.disabled=true;}
Ext.Component.prototype.onDisable.apply(this,arguments);},onEnable:function(){var selectEl=this.selectEl;if(selectEl){selectEl.dom.disabled=false;}
Ext.Component.prototype.onEnable.apply(this,arguments);},listeners:{change:function(){me.win.focus();me.relayCmd('fontName',me.fontSelect.dom.value);me.deferFocus();},element:'selectEl'}});items.push(fontSelectItem,'-');}
if(me.enableFormat){items.push(btn('bold'),btn('italic'),btn('underline'));}
if(me.enableFontSize){items.push('-',btn('increasefontsize',false,me.adjustFont),btn('decreasefontsize',false,me.adjustFont));}
if(me.enableColors){items.push('-',{itemId:'forecolor',cls:baseCSSPrefix+'btn-icon',iconCls:baseCSSPrefix+'edit-forecolor',overflowText:me.buttonTips.forecolor.title,tooltip:tipsEnabled?me.buttonTips.forecolor||undef:undef,tabIndex:-1,menu:Ext.widget('menu',{plain:true,items:[{xtype:'colorpicker',allowReselect:true,focus:Ext.emptyFn,value:'000000',plain:true,clickEvent:'mousedown',handler:function(cp,color){me.relayCmd('forecolor',Ext.isWebKit||Ext.isIE?'#'+color:color);this.up('menu').hide();}}]})},{itemId:'backcolor',cls:baseCSSPrefix+'btn-icon',iconCls:baseCSSPrefix+'edit-backcolor',overflowText:me.buttonTips.backcolor.title,tooltip:tipsEnabled?me.buttonTips.backcolor||undef:undef,tabIndex:-1,menu:Ext.widget('menu',{plain:true,items:[{xtype:'colorpicker',focus:Ext.emptyFn,value:'FFFFFF',plain:true,allowReselect:true,clickEvent:'mousedown',handler:function(cp,color){if(Ext.isGecko){me.execCmd('useCSS',false);me.execCmd('hilitecolor','#'+color);me.execCmd('useCSS',true);me.deferFocus();}else{me.relayCmd(Ext.isOpera?'hilitecolor':'backcolor',Ext.isWebKit||Ext.isIE||Ext.isOpera?'#'+color:color);}
this.up('menu').hide();}}]})});}
if(me.enableAlignments){items.push('-',btn('justifyleft'),btn('justifycenter'),btn('justifyright'));}
if(!Ext.isSafari2){if(me.enableLinks){items.push('-',btn('createlink',false,me.createLink));}
if(me.enableLists){items.push('-',btn('insertorderedlist'),btn('insertunorderedlist'));}
if(me.enableSourceEdit){items.push('-',btn('sourceedit',true,function(btn){me.toggleSourceEdit(!me.sourceEditMode);}));}}
for(i=0;i<items.length;i++){if(items[i].itemId!=='sourceedit'){items[i].disabled=true;}}
return{xtype:'toolbar',defaultButtonUI:me.defaultButtonUI,cls:Ext.baseCSSPrefix+'html-editor-tb',enableOverflow:true,items:items,listeners:{click:function(e){e.preventDefault();},element:'el'}};},getMaskTarget:function(){return Ext.isGecko?this.inputCmp.el:this.bodyEl;},setReadOnly:function(readOnly){var me=this,textareaEl=me.textareaEl,iframeEl=me.iframeEl,body;me.readOnly=readOnly;if(textareaEl){textareaEl.dom.readOnly=readOnly;}
if(me.initialized){body=me.getEditorBody();if(Ext.isIE){iframeEl.setDisplayed(false);body.contentEditable=!readOnly;iframeEl.setDisplayed(true);}else{me.setDesignMode(!readOnly);}
if(body){body.style.cursor=readOnly?'default':'text';}
me.disableItems(readOnly);}},getDocMarkup:function(){var me=this,h=me.iframeEl.getHeight()-me.iframePad*2,oldIE=Ext.isIE8m;return Ext.String.format((oldIE?'':'<!DOCTYPE html>')
+'<html><head><style type="text/css">'
+(Ext.isOpera?'p{margin:0}':'')
+'body{border:0;margin:0;padding:{0}px;direction:'+(me.rtl?'rtl;':'ltr;')
+(oldIE?Ext.emptyString:'min-')
+'height:{1}px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;cursor:text;background-color:white;'
+(Ext.isIE?'':'font-size:12px;font-family:{2}')
+'}</style></head><body></body></html>',me.iframePad,h,me.defaultFont);},getEditorBody:function(){var doc=this.getDoc();return doc.body||doc.documentElement;},getDoc:function(){return(!Ext.isIE&&this.iframeEl.dom.contentDocument)||this.getWin().document;},getWin:function(){return Ext.isIE?this.iframeEl.dom.contentWindow:window.frames[this.iframeEl.dom.name];},initDefaultFont:function(){var me=this,selIdx=0,fonts,font,select,option,i,len,lower;if(!me.defaultFont){font=me.textareaEl.getStyle('font-family');font=Ext.String.capitalize(font.split(',')[0]);fonts=Ext.Array.clone(me.fontFamilies);Ext.Array.include(fonts,font);fonts.sort();me.defaultFont=font;select=me.down('#fontSelect').selectEl.dom;for(i=0,len=fonts.length;i<len;++i){font=fonts[i];lower=font.toLowerCase();option=new Option(font,lower);if(font==me.defaultFont){selIdx=i;}
option.style.fontFamily=lower;if(Ext.isIE){select.add(option);}else{select.options.add(option);}}
select.options[selIdx].selected=true;}},isEqual:function(value1,value2){return this.isEqualAsString(value1,value2);},afterRender:function(){var me=this,inputCmp=me.inputCmp;me.callParent(arguments);me.iframeEl=inputCmp.iframeEl;me.textareaEl=inputCmp.textareaEl;me.inputEl=me.iframeEl;if(me.enableFont){me.initDefaultFont();}
me.monitorTask=Ext.TaskManager.start({run:me.checkDesignMode,scope:me,interval:100});me.relayCmd('fontName',me.defaultFont);},initFrameDoc:function(){var me=this,doc,task;Ext.TaskManager.stop(me.monitorTask);doc=me.getDoc();me.win=me.getWin();doc.open();doc.write(me.getDocMarkup());doc.close();task={run:function(){var doc=me.getDoc();if(doc.body||doc.readyState==='complete'){Ext.TaskManager.stop(task);me.setDesignMode(true);Ext.defer(me.initEditor,10,me);}},interval:10,duration:10000,scope:me};Ext.TaskManager.start(task);},checkDesignMode:function(){var me=this,doc=me.getDoc();if(doc&&(!doc.editorInitialized||me.getDesignMode()!=='on')){me.initFrameDoc();}},setDesignMode:function(mode){var me=this,doc=me.getDoc();if(doc){if(me.readOnly){mode=false;}
doc.designMode=(/on|true/i).test(String(mode).toLowerCase())?'on':'off';}},getDesignMode:function(){var doc=this.getDoc();return!doc?'':String(doc.designMode).toLowerCase();},disableItems:function(disabled){var items=this.getToolbar().items.items,i,iLen=items.length,item;for(i=0;i<iLen;i++){item=items[i];if(item.getItemId()!=='sourceedit'){item.setDisabled(disabled);}}},toggleSourceEdit:function(sourceEditMode){var me=this,iframe=me.iframeEl,textarea=me.textareaEl,hiddenCls=Ext.baseCSSPrefix+'hidden',btn=me.getToolbar().getComponent('sourceedit');if(!Ext.isBoolean(sourceEditMode)){sourceEditMode=!me.sourceEditMode;}
me.sourceEditMode=sourceEditMode;if(btn.pressed!==sourceEditMode){btn.toggle(sourceEditMode);}
if(sourceEditMode){me.disableItems(true);me.syncValue();iframe.addCls(hiddenCls);textarea.removeCls(hiddenCls);textarea.dom.removeAttribute('tabIndex');textarea.focus();me.inputEl=textarea;}else{if(me.initialized){me.disableItems(me.readOnly);}
me.pushValue();iframe.removeCls(hiddenCls);textarea.addCls(hiddenCls);textarea.dom.setAttribute('tabIndex',-1);me.deferFocus();me.inputEl=iframe;}
me.fireEvent('editmodechange',me,sourceEditMode);me.updateLayout();},createLink:function(){var url=prompt(this.createLinkText,this.defaultLinkValue);if(url&&url!=='http:/'+'/'){this.relayCmd('createlink',url);}},clearInvalid:Ext.emptyFn,setValue:function(value){var me=this,textarea=me.textareaEl,inputCmp=me.inputCmp;me.mixins.field.setValue.call(me,value);if(value===null||value===undefined){value='';}
if(textarea){textarea.dom.value=value;}
me.pushValue();if(!me.rendered&&me.inputCmp){me.inputCmp.data.value=value;}
return me;},cleanHtml:function(html){html=String(html);if(Ext.isWebKit){html=html.replace(/\sclass="(?:Apple-style-span|Apple-tab-span|khtml-block-placeholder)"/gi,'');}
if(html.charCodeAt(0)===parseInt(this.defaultValue.replace(/\D/g,''),10)){html=html.substring(1);}
return html;},syncValue:function(){var me=this,body,changed,html,bodyStyle,match,textElDom;if(me.initialized){body=me.getEditorBody();html=body.innerHTML;textElDom=me.textareaEl.dom;if(Ext.isWebKit){bodyStyle=body.getAttribute('style');match=bodyStyle.match(/text-align:(.*?);/i);if(match&&match[1]){html='<div style="'+match[0]+'">'+html+'</div>';}}
html=me.cleanHtml(html);if(me.fireEvent('beforesync',me,html)!==false){if(Ext.isGecko&&textElDom.value===''&&html==='<br>'){html='';}
if(textElDom.value!==html){textElDom.value=html;changed=true;}
me.fireEvent('sync',me,html);if(changed){me.checkChange();}}}},getValue:function(){var me=this,value;if(!me.sourceEditMode){me.syncValue();}
value=me.rendered?me.textareaEl.dom.value:me.value;me.value=value;return value;},pushValue:function(){var me=this,v;if(me.initialized){v=me.textareaEl.dom.value||'';if(!me.activated&&v.length<1){v=me.defaultValue;}
if(me.fireEvent('beforepush',me,v)!==false){me.getEditorBody().innerHTML=v;if(Ext.isGecko){me.setDesignMode(false);me.setDesignMode(true);}
me.fireEvent('push',me,v);}}},deferFocus:function(){this.focus(false,true);},getFocusEl:function(){var me=this,win=me.win;return win&&!me.sourceEditMode?win:me.textareaEl;},focus:function(selectText,delay){var me=this,value,focusEl;if(delay){if(!me.focusTask){me.focusTask=new Ext.util.DelayedTask(me.focus);}
me.focusTask.delay(Ext.isNumber(delay)?delay:10,null,me,[selectText,false]);}
else{if(selectText){if(me.textareaEl&&me.textareaEl.dom){value=me.textareaEl.dom.value;}
if(value&&value.length){me.execCmd('selectall',true);}}
focusEl=me.getFocusEl();if(focusEl&&focusEl.focus){focusEl.focus();}}
return me;},initEditor:function(){try{var me=this,dbody=me.getEditorBody(),ss=me.textareaEl.getStyles('font-size','font-family','background-image','background-repeat','background-color','color'),doc,fn;ss['background-attachment']='fixed';dbody.bgProperties='fixed';Ext.DomHelper.applyStyles(dbody,ss);doc=me.getDoc();if(doc){try{Ext.EventManager.removeAll(doc);}catch(e){}}
fn=Ext.Function.bind(me.onEditorEvent,me);Ext.EventManager.on(doc,{mousedown:fn,dblclick:fn,click:fn,keyup:fn,buffer:100});fn=me.onRelayedEvent;Ext.EventManager.on(doc,{mousedown:fn,mousemove:fn,mouseup:fn,click:fn,dblclick:fn,scope:me});if(Ext.isGecko){Ext.EventManager.on(doc,'keypress',me.applyCommand,me);}
if(me.fixKeys){Ext.EventManager.on(doc,'keydown',me.fixKeys,me);}
if(me.fixKeysAfter){Ext.EventManager.on(doc,'keyup',me.fixKeysAfter,me);}
if(Ext.isIE9&&Ext.isStrict){Ext.EventManager.on(doc.documentElement,'focus',me.focus,me);}
if(Ext.isIE8m||(Ext.isIE9&&!Ext.isStrict)){Ext.EventManager.on(doc,'focusout',function(){me.savedSelection=doc.selection.type!=='None'?doc.selection.createRange():null;},me);Ext.EventManager.on(doc,'focusin',function(){if(me.savedSelection){me.savedSelection.select();}},me);}
Ext.EventManager.onWindowUnload(me.beforeDestroy,me);doc.editorInitialized=true;me.initialized=true;me.pushValue();me.setReadOnly(me.readOnly);me.fireEvent('initialize',me);}catch(ex){}},beforeDestroy:function(){var me=this,monitorTask=me.monitorTask,doc,prop;if(monitorTask){Ext.TaskManager.stop(monitorTask);}
if(me.rendered){Ext.EventManager.removeUnloadListener(me.beforeDestroy,me);try{doc=me.getDoc();if(doc){Ext.EventManager.removeAll(Ext.fly(doc));for(prop in doc){if(doc.hasOwnProperty&&doc.hasOwnProperty(prop)){delete doc[prop];}}}}catch(e){}
delete me.iframeEl;delete me.textareaEl;delete me.toolbar;delete me.inputCmp;}
me.callParent();},onRelayedEvent:function(event){var iframeEl=this.iframeEl,iframeXY=Ext.Element.getTrueXY(iframeEl),originalEventXY=event.getXY(),eventXY=Ext.EventManager.getPageXY(event.browserEvent);event.xy=[iframeXY[0]+eventXY[0],iframeXY[1]+eventXY[1]];event.injectEvent(iframeEl);event.xy=originalEventXY;},onFirstFocus:function(){var me=this,selection,range;me.activated=true;me.disableItems(me.readOnly);if(Ext.isGecko){me.win.focus();selection=me.win.getSelection();if(!selection.focusNode||selection.focusNode.nodeType!==3){range=selection.getRangeAt(0);range.selectNodeContents(me.getEditorBody());range.collapse(true);me.deferFocus();}
try{me.execCmd('useCSS',true);me.execCmd('styleWithCSS',false);}catch(e){}}
me.fireEvent('activate',me);},adjustFont:function(btn){var adjust=btn.getItemId()==='increasefontsize'?1:-1,size=this.getDoc().queryCommandValue('FontSize')||'2',isPxSize=Ext.isString(size)&&size.indexOf('px')!==-1,isSafari;size=parseInt(size,10);if(isPxSize){if(size<=10){size=1+adjust;}
else if(size<=13){size=2+adjust;}
else if(size<=16){size=3+adjust;}
else if(size<=18){size=4+adjust;}
else if(size<=24){size=5+adjust;}
else{size=6+adjust;}
size=Ext.Number.constrain(size,1,6);}else{isSafari=Ext.isSafari;if(isSafari){adjust*=2;}
size=Math.max(1,size+adjust)+(isSafari?'px':0);}
this.relayCmd('FontSize',size);},onEditorEvent:function(e){this.updateToolbar();},updateToolbar:function(){var me=this,i,l,btns,doc,name,queriedName,fontSelect,toolbarSubmenus;if(me.readOnly){return;}
if(!me.activated){me.onFirstFocus();return;}
btns=me.getToolbar().items.map;doc=me.getDoc();if(me.enableFont&&!Ext.isSafari2){queriedName=doc.queryCommandValue('fontName');name=(queriedName?queriedName.split(",")[0].replace(/^'/,'').replace(/'$/,''):me.defaultFont).toLowerCase();fontSelect=me.fontSelect.dom;if(name!==fontSelect.value||name!=queriedName){fontSelect.value=name;}}
function updateButtons(){var state;for(i=0,l=arguments.length,name;i<l;i++){name=arguments[i];try{state=doc.queryCommandState(name);}
catch(e){state=false;}
btns[name].toggle(state);}}
if(me.enableFormat){updateButtons('bold','italic','underline');}
if(me.enableAlignments){updateButtons('justifyleft','justifycenter','justifyright');}
if(!Ext.isSafari2&&me.enableLists){updateButtons('insertorderedlist','insertunorderedlist');}
toolbarSubmenus=me.toolbar.query('menu');for(i=0;i<toolbarSubmenus.length;i++){toolbarSubmenus[i].hide();}
me.syncValue();},relayBtnCmd:function(btn){this.relayCmd(btn.getItemId());},relayCmd:function(cmd,value){Ext.defer(function(){var me=this;if(!this.isDestroyed){me.win.focus();me.execCmd(cmd,value);me.updateToolbar();}},10,this);},execCmd:function(cmd,value){var me=this,doc=me.getDoc();doc.execCommand(cmd,false,(value==undefined?null:value));me.syncValue();},applyCommand:function(e){if(e.ctrlKey){var me=this,c=e.getCharCode(),cmd;if(c>0){c=String.fromCharCode(c);switch(c){case'b':cmd='bold';break;case'i':cmd='italic';break;case'u':cmd='underline';break;}
if(cmd){me.win.focus();me.execCmd(cmd);me.deferFocus();e.preventDefault();}}}},insertAtCursor:function(text){var me=this,range;if(me.activated){me.win.focus();if(Ext.isIE){range=me.getDoc().selection.createRange();if(range){range.pasteHTML(text);me.syncValue();me.deferFocus();}}else{me.execCmd('InsertHTML',text);me.deferFocus();}}},fixKeys:(function(){if(Ext.isIE){return function(e){var me=this,k=e.getKey(),doc=me.getDoc(),readOnly=me.readOnly,range,target;if(k===e.TAB){e.stopEvent();if(!readOnly){range=doc.selection.createRange();if(range){if(range.collapse){range.collapse(true);range.pasteHTML('&#160;&#160;&#160;&#160;');}
me.deferFocus();}}}
else if(k===e.ENTER){if(!readOnly){range=doc.selection.createRange();if(range){target=range.parentElement();if(!target||target.tagName.toLowerCase()!=='li'){e.stopEvent();range.pasteHTML('<br />');range.collapse(false);range.select();}}}}};}
if(Ext.isOpera){return function(e){var me=this,k=e.getKey(),readOnly=me.readOnly;if(k===e.TAB){e.stopEvent();if(!readOnly){me.win.focus();me.execCmd('InsertHTML','&#160;&#160;&#160;&#160;');me.deferFocus();}}};}
return null;}()),fixKeysAfter:(function(){if(Ext.isIE){return function(e){var me=this,k=e.getKey(),doc=me.getDoc(),readOnly=me.readOnly,innerHTML;if(!readOnly&&(k===e.BACKSPACE||k===e.DELETE)){innerHTML=doc.body.innerHTML;if(innerHTML==='<p>&nbsp;</p>'||innerHTML==='<P>&nbsp;</P>'){doc.body.innerHTML='';}}}}
return null;}()),getToolbar:function(){return this.toolbar;},buttonTips:{bold:{title:'Bold (Ctrl+B)',text:'Make the selected text bold.',cls:Ext.baseCSSPrefix+'html-editor-tip'},italic:{title:'Italic (Ctrl+I)',text:'Make the selected text italic.',cls:Ext.baseCSSPrefix+'html-editor-tip'},underline:{title:'Underline (Ctrl+U)',text:'Underline the selected text.',cls:Ext.baseCSSPrefix+'html-editor-tip'},increasefontsize:{title:'Grow Text',text:'Increase the font size.',cls:Ext.baseCSSPrefix+'html-editor-tip'},decreasefontsize:{title:'Shrink Text',text:'Decrease the font size.',cls:Ext.baseCSSPrefix+'html-editor-tip'},backcolor:{title:'Text Highlight Color',text:'Change the background color of the selected text.',cls:Ext.baseCSSPrefix+'html-editor-tip'},forecolor:{title:'Font Color',text:'Change the color of the selected text.',cls:Ext.baseCSSPrefix+'html-editor-tip'},justifyleft:{title:'Align Text Left',text:'Align text to the left.',cls:Ext.baseCSSPrefix+'html-editor-tip'},justifycenter:{title:'Center Text',text:'Center text in the editor.',cls:Ext.baseCSSPrefix+'html-editor-tip'},justifyright:{title:'Align Text Right',text:'Align text to the right.',cls:Ext.baseCSSPrefix+'html-editor-tip'},insertunorderedlist:{title:'Bullet List',text:'Start a bulleted list.',cls:Ext.baseCSSPrefix+'html-editor-tip'},insertorderedlist:{title:'Numbered List',text:'Start a numbered list.',cls:Ext.baseCSSPrefix+'html-editor-tip'},createlink:{title:'Hyperlink',text:'Make the selected text a hyperlink.',cls:Ext.baseCSSPrefix+'html-editor-tip'},sourceedit:{title:'Source Edit',text:'Switch to source editing mode.',cls:Ext.baseCSSPrefix+'html-editor-tip'}}});Ext.define('MP.grid.ColumnManager',{override:'Ext.grid.ColumnManager',cacheColumns:function()
{this.columns=this.headerCt.getGridColumns();if(this.secondHeaderCt)
{Ext.Array.push(this.columns,this.secondHeaderCt.getGridColumns());}}});Ext.define('MP.view.Table',{override:'Ext.view.Table',walkCells:function(pos,direction,e,preventWrap,verifierFn,scope){if(!pos){return false;}
var me=this,row=pos.row,column=pos.column,rowCount=me.dataSource.getCount(),cmgr=me.ownerCt.columnManager,lastCol=cmgr.getColumns().length-1,newRow=row,newColumn=column,activeHeader=cmgr.getHeaderAtIndex(column);if(!activeHeader||activeHeader.hidden||!rowCount){return false;}
for(var lch=cmgr.getHeaderAtIndex(lastCol);lastCol&&lch&&lch.hidden;lch=cmgr.getHeaderAtIndex(--lastCol));e=e||{};direction=direction.toLowerCase();switch(direction){case'right':if(column===lastCol){if(preventWrap||row===rowCount-1){return false;}
if(!e.ctrlKey){newRow=me.walkRows(row,1);if(newRow!==row){newColumn=0;}}}else{if(!e.ctrlKey){newColumn=column+1;}else{newColumn=lastCol;}}
break;case'left':if(column===0){if(preventWrap||row===0){return false;}
if(!e.ctrlKey){newRow=me.walkRows(row,-1);if(newRow!==row){newColumn=lastCol;}}}else{if(!e.ctrlKey){newColumn=column-1;}else{newColumn=0;}}
break;case'up':if(row===0){return false;}else{if(!e.ctrlKey){newRow=me.walkRows(row,-1);}else{newRow=me.walkRows(-1,1);}}
break;case'down':if(row===rowCount-1){return false;}else{if(!e.ctrlKey){newRow=me.walkRows(row,1);}else{newRow=me.walkRows(rowCount,-1);}}
break;}
if(verifierFn&&verifierFn.call(scope||me,{row:newRow,column:newColumn})!==true){return false;}else{return new Ext.grid.CellContext(me).setPosition(newRow,newColumn);}}});Ext.define('MP.grid.Editable',{extend:'MP.grid.Basic',requires:['Ext.grid.plugin.CellEditing','MP.action.AddAndDelete'],noAddAndDelete:false,initComponent:function(){var me=this;if(!me.readOnly){Ext.each(me.columns,function(c){if(c.editor&&c.editor.lookupFor){var fname=c.editor.lookupFor;var iname=c.editor.store.proxy.reader.idProperty;var listeners={change:function(combo){if(combo.getRawValue()===''){var record=me.getSelectionModel().getSelection()[0];record.set(fname,null);}},select:function(combo,selected){var record=me.getSelectionModel().getSelection()[0];record.set(fname,selected[0].get(iname));}};if(c.editor.isComponent){c.editor.on(listeners);}else{if(c.editor.listeners){Ext.apply(c.editor.listeners,listeners);}else{c.editor.listeners=listeners;}}}});var cellEditing=null;if(me.clicksToEdit){cellEditing=Ext.create('Ext.grid.plugin.CellEditing',{clicksToEdit:me.clicksToEdit});}
if(!me.plugins){me.plugins=[];}
if(cellEditing){me.plugins.push(cellEditing);me.on('hide',function(){me.editingPlugin.completeEdit();});}
if(!me.noAddAndDelete){me.plugins.push(Ext.create('MP.action.AddAndDelete'));}}
me.callParent();},initEvents:function(){var me=this;me.callParent();if(!me.readOnly){me.on("itemcontextmenu",function(view,record,item,index,e){var items=[];var addndel=MP.action.AddAndDelete;Ext.each(me.getAllActions(),function(act){if(act.itemId!=addndel.ADD_ACTION&&act.itemId!=addndel.DELETE_ACTION&&act.initialConfig&&act.initialConfig.handler&&act.initialConfig.needsOneSelectedRow&&!act.isDisabled()){items.push({text:act.initialConfig.text,tooltip:act.initialConfig.tooltip,iconCls:act.initialConfig.iconCls,handler:act.execute.bind(act)});}});e.stopEvent();if(items.length>0){var pm=new Ext.menu.Menu({items:items});var coords=e.getXY();pm.showAt([coords[0],coords[1]]);}});}}});Ext.define('MP.grid.Panel',{extend:'MP.grid.Editable',uses:['MP.action.AddAndDeleteOnToolbar'],alias:'widget.editable-grid',initComponent:function(){var me=this;me.callParent();if(!me.noAddAndDelete){this.plugins.unshift(Ext.create('MP.action.AddAndDeleteOnToolbar'));}}});Ext.define('SoL.module.Clubs.Actions',{extend:'MP.action.StoreAware',uses:['Ext.Action','Ext.form.field.File','MP.form.Panel','MP.window.Notification','SoL.window.Help'],statics:{EDIT_CLUB_ACTION:'edit_club',DOWNLOAD_TOURNEYS_ACTION:'download_tourneys',SHOW_CHAMPIONSHIPS_ACTION:'show_championships',SHOW_MEMBERS_ACTION:'show_members',SHOW_ASSOCIATES_ACTION:'show_associates',SHOW_HOSTED_TOURNEYS_ACTION:'show_hosted_tourneys',SHOW_USERS_ACTION:'show_users',SHOW_LIT_PAGE_ACTION:'show_lit'},initActions:function(){var me=this;var ids=me.statics();me.callParent();me.editClub=me.addAction(new Ext.Action({itemId:ids.EDIT_CLUB_ACTION,text:_('Modify'),tooltip:_('Edit selected club.'),iconCls:'edit-record-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];me.showEditClubWindow(record);}}));me.showChampionships=me.addAction(new Ext.Action({itemId:ids.SHOW_CHAMPIONSHIPS_ACTION,text:_('Championships'),tooltip:_('Show championships organized by this club.'),iconCls:'championships-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idclub=record.get('idclub'),club=record.get('description'),prizes=record.get('prizes'),couplings=record.get('couplings'),idrating=record.get('idrating'),rating=record.get('Rating'),module=me.module.app.getModule('championships-win');module.createOrShowWindow('clubs',idclub,club,prizes,couplings,idrating,rating);}}));me.showMembers=me.addAction(new Ext.Action({itemId:ids.SHOW_MEMBERS_ACTION,text:_('Members'),tooltip:_('Show players members of this club.'),iconCls:'players-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idclub=record.get('idclub'),club=record.get('description'),module=me.module.app.getModule('players-win');module.createOrShowWindow('clubs',idclub,club);}}));me.showAssociates=me.addAction(new Ext.Action({itemId:ids.SHOW_ASSOCIATES_ACTION,text:_('Associates'),tooltip:_('Show players associated with this federation.'),iconCls:'players-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idclub=record.get('idclub'),club=record.get('description'),module=me.module.app.getModule('players-win');module.createOrShowWindow('clubs',idclub,club,true);}}));me.downloadTourneys=me.addAction(new Ext.Action({itemId:ids.DOWNLOAD_TOURNEYS_ACTION,text:_('Download'),tooltip:_('Download data of all the tourneys in every championship organized by this club.'),iconCls:'download-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idclub=record.get('idclub'),url='/bio/dump?idclub='+idclub;window.open(url,"_blank");}}));me.showLitPage=me.addAction(new Ext.Action({itemId:ids.SHOW_LIT_PAGE_ACTION,text:_('Lit page'),tooltip:_('Show the corresponding Lit page.'),iconCls:'lit-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],guid=record.get('guid'),url='/lit/club/'+guid;window.open(url,"_blank");}}));var show_users=new Ext.Action({itemId:ids.SHOW_USERS_ACTION,text:_('Users'),tooltip:_('Show users associated to this club.'),iconCls:'users-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idclub=record.get('idclub'),club=record.get('description'),module=me.module.app.getModule('clubusers-win');module.createOrShowWindow(idclub,club);}});show_users.isDisabled=function(){var record=me.component.getSelectionModel().getSelection()[0],currentuser=me.module.app.user;return(!currentuser.is_admin&&record.get('idowner')!==null&&record.get('idowner')!==currentuser.user_id);};me.showUsers=me.addAction(show_users);me.showHostedTourneys=me.addAction(new Ext.Action({itemId:ids.SHOW_HOSTED_TOURNEYS_ACTION,text:_('Tourneys'),tooltip:_('Show tourneys hosted by this club.'),iconCls:'tourneys-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idclub=record.get('idclub'),club=record.get('description'),module=me.module.app.getModule('tourneys-win');module.createOrShowWindow('clubs',idclub,club);}}));},attachActions:function(){var me=this;me.callParent();var tbar=me.component.child('#ttoolbar');tbar.add(2,' ',me.editClub,me.showChampionships,me.showHostedTourneys,{text:_('Players'),iconCls:'players-icon',menu:{items:[me.showMembers,me.showAssociates]}},me.downloadTourneys);me.component.on({itemdblclick:function(){if(!me.editClub.isDisabled())
me.editClub.execute();}});me.component.store.on({add:function(store,records){var record=records[0];me.showEditClubWindow(record);}});},shouldDisableAction:function(act){var me=this,disable=me.component.shouldDisableAction(act),statics=me.statics(),currentuser=me.module.app.user;if(!disable){var record=me.component.getSelectionModel().getSelection()[0];switch(act.itemId){case statics.EDIT_CLUB_ACTION:case statics.SHOW_USERS_ACTION:if(!currentuser.is_admin&&record.get('idowner')!==null&&record.get('idowner')!==currentuser.user_id)
disable=true;break;case statics.SHOW_ASSOCIATES_ACTION:if(!record.get('isfederation'))
disable=true;break;default:break;}}
return disable;},readImageAsDataURL:function(event,elt,form){var file=elt.files[0];if(file.type.split('/')[0]=='image'){var reader=new FileReader();form._emblem=file.name;reader.onload=function(e){var img=e.target.result;if(img.length>(512000*1.33)){Ext.MessageBox.alert(_('Error'),_('Image too big, max 512k allowed'));form._emblem=null;}else{form.down('image').setSrc(img);}};reader.onerror=function(){Ext.MessageBox.alert(_('Error'),_('Sorry, could not read image file')
+': '+reader.error);form._emblem=null;};reader.readAsDataURL(file);}else{Ext.MessageBox.alert(_('Error'),_('Only image files allowed'));}},deleteImage:function(form){form._emblem='';form.down('image').setSrc('');},showEditClubWindow:function(record){var me=this,desktop=me.module.app.getDesktop(),win=desktop.getWindow('edit-club-win');if(win){win.destroy();}
var metadata=me.module.config.metadata,size=desktop.getReasonableWindowSize(1000,310),editors=metadata.editors({'*':{editor:MP.form.Panel.getDefaultEditorSettingsFunction('100%')},description:{editor:{minLength:6}},nationality:{editor:{xtype:'flagscombo'}},Rating:{editor:{listeners:{beforequery:function(queryPlan){var store=queryPlan.combo.store;var idclub=record.get('idclub');if(idclub){store.addFilter({id:'currentclub',property:'idclub',value:"NULL,"+idclub,operator:'='},false);}}}}}}),form=Ext.create('MP.form.Panel',{autoScroll:true,fieldDefaults:{labelWidth:100,margin:'15 10 0 10'},items:[{xtype:'container',layout:'hbox',items:[{xtype:'container',layout:'anchor',minHeight:245,flex:1,items:[editors.description,editors.siteurl,editors.email,editors.nationality,editors.Rating]},{xtype:'container',layout:'anchor',minHeight:245,flex:1,items:[editors.isfederation,editors.couplings,editors.prizes,editors.Owner]},{xtype:'container',style:'text-align: center;',minHeight:245,width:170,items:[{xtype:'image',margin:'10 10 0 10',border:1,style:{maxWidth:'150px',maxHeight:'150px',borderColor:'lightgray',borderStyle:'solid'}},{xtype:'filefield',name:'emblem',fieldLabel:'',labelWidth:0,buttonOnly:true,buttonText:_('Change emblem…'),style:'text-align: center;',listeners:{afterrender:function(fld){var el=fld.fileInputEl.dom;el.setAttribute('accept','image/*');},el:{change:{fn:function(event,elt){if(elt.files.length)
me.readImageAsDataURL(event,elt,form);}}}}},{xtype:'button',text:_('Delete emblem'),handler:function(){me.deleteImage(form);}}]}]}],buttons:[{text:_('Cancel'),handler:function(){if(record.phantom){record.store.deleteRecord(record);}
win.close();}},{text:_('Confirm'),formBind:true,handler:function(){if(form.isValid()){form.updateRecord(record);if(form._emblem!==undefined){record.set('emblem',form._emblem);record.modified['emblem']='';record.set('image',form.down('image').src);}
win.close();Ext.create("MP.window.Notification",{position:'t',width:260,title:_('Changes have been applied…'),html:_('Your changes have been applied <strong>locally</strong>.<br/><br/>To make them permanent you must click on the <blink>Save</blink> button.'),iconCls:'info-icon'}).show();}}}]});win=desktop.createWindow({id:'edit-club-win',title:_('Edit club'),iconCls:me.module.iconCls,width:size.width,height:size.height,modal:true,items:form,closable:false,minimizable:false,maximizable:false,resizable:false,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640),wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/clubs.html#insert-and-edit'),title:_('Help on club insert/edit')});wh.show();}}]});form.loadRecord(record);if(!Ext.isEmpty(record.get('emblem'))||!Ext.isEmpty(record.get('image'))){var emblem=form.down('image');if(!Ext.isEmpty(record.get('image'))){emblem.setSrc(record.get('image'));}else{emblem.setSrc('/lit/emblem/'+record.get('emblem'));}}
win.show();}});Ext.define('SoL.module.Clubs',{extend:'MP.desktop.Module',requires:['MP.grid.Panel'],uses:['SoL.module.Clubs.Actions','SoL.module.ClubUsers','SoL.module.Users','SoL.form.field.FlagsCombo','SoL.window.Help'],id:'clubs-win',iconCls:'clubs-icon',launcherText:function(){return _('Clubs');},launcherTooltip:function(){return _('<b>Clubs</b><br />Basic clubs management.');},config:{xtype:'editable-grid',pageSize:14,autoShowAllEditors:false,clicksToEdit:0,dataURL:'/data/clubs',saveChangesURL:'/bio/saveChanges',sorters:['description'],stripeRows:true,selModel:{mode:'MULTI'}},getConfig:function(callback){var me=this,cfg=me.config;if(!cfg.metadata){MP.data.MetaData.fetch(cfg.dataURL,me,function(metadata){var overrides={Owner:{filter:false},nationality:{renderer:SoL.form.field.FlagsCombo.renderer,filter:{type:'combo',xtype:'flagscombo',noOperatorPlugin:true,editable:true},editor:{xtype:'flagscombo'}}},fields=metadata.fields(overrides);fields.push({name:'image',type:'string',sendBackToServer:true});Ext.apply(cfg,{metadata:metadata,fields:fields,columns:metadata.columns(overrides,false),idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,rootProperty:metadata.root_slot,plugins:[Ext.create('SoL.module.Clubs.Actions',{module:me}),Ext.create('SoL.module.Users.AssignOwnership',{module:me})]});callback(cfg);me.app.on('logout',function(){delete cfg.metadata;},me,{single:true});});}else{callback(cfg);}},createOrShowWindow:function(caller,id,description){var me=this,config=me.config,desktop=me.app.getDesktop(),win=desktop.getWindow(me.id);if(win){win.destroy();}
me.configure([me.getConfig],function(done){var size=desktop.getReasonableWindowSize(770,447,"NW"),filteredOn='';if(caller=='championships'){config=Ext.apply({filters:[{property:'idclub',value:id,operator:'='}]},config);}else if(caller=='users'){filteredOn=' ('+Ext.String.format(_('owned by {0}'),description)+')';config=Ext.apply({filters:[{property:'idowner',value:id,operator:'='}]},config);}
win=desktop.createWindow({id:me.id,title:(me.windowTitle||me.getLauncherText())+filteredOn,taskbuttonTooltip:me.getLauncherTooltip(),iconCls:me.iconCls,items:[config],x:size.x,y:size.y,width:size.width,height:size.height,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640);var wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/clubs.html'),title:_('Help on clubs management')});wh.show();}}]});var grid=win.child('editable-grid');grid.store.load({params:{start:0,limit:me.pageSize},callback:function(){win.on({show:done,single:true});win.show();}});var da=grid.findActionById('delete');da.shouldBeDisabled=me.shouldDisableDeleteAction.bind(grid);});},shouldDisableDeleteAction:function(){var grid=this,sm=grid.getSelectionModel(),currentuser=grid.up().up().app.user;if(sm.getCount()>0){var selrecs=sm.getSelection(),disable=false;for(var i=selrecs.length-1;i>=0;i--){var record=selrecs[i];if(record.get('Championships')>0||(!currentuser.is_admin&&record.get('idowner')!==null&&currentuser.user_id!==record.get('idowner'))){disable=true;break;}}
return disable;}else{return true;}}});Ext.define('SoL.module.MyClubs',{extend:'SoL.module.Clubs',id:'my-clubs-win',iconCls:'clubs-icon',launcherText:null,init:function(){var me=this,user=me.app.user;if(!me.config.orig_dataURL)me.config.orig_dataURL=me.config.dataURL;me.config.dataURL=Ext.String.urlAppend(me.config.orig_dataURL,'filter_by_idowner='+(user.is_admin?'NULL':user.user_id));me.windowTitle=Ext.String.format(_('Clubs managed by {0}'),user.fullname);me.callParent();}});Ext.define('SoL.module.Tourneys.Actions',{extend:'MP.action.StoreAware',uses:['Ext.Action','MP.form.Panel','MP.window.Notification'],statics:{EDIT_TOURNEY_ACTION:'edit_tourney',DOWNLOAD_TOURNEY_ACTION:'download_tourney',REPLAY_TOURNEY_ACTION:'duplicate_tourney',CREATE_KNOCKOUT_TOURNEY_ACTION:'create_knockout_tourney',SHOW_TOURNEY_ACTION:'show_tourney',SHOW_CHAMPIONSHIP_ACTION:'show_championship',MANAGE_COMPETITORS_ACTION:'manage_competitors',SHOW_LIT_PAGE_ACTION:'show_lit',PRINT_BOARDLABELS_ACTION:'print_boardlabels',PRINT_PLAYBILL_ACTION:'print_playbill'},initActions:function(){var me=this,ids=me.statics();me.callParent();me.editTourneyAction=me.addAction(new Ext.Action({itemId:ids.EDIT_TOURNEY_ACTION,text:_('Modify'),tooltip:_('Edit selected tourney.'),iconCls:'edit-record-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];me.showEditTourneyWindow(record);}}));me.showTourneyAction=me.addAction(new Ext.Action({itemId:ids.SHOW_TOURNEY_ACTION,text:_('Details'),tooltip:_('Show details of this tourney.'),iconCls:'show-tourney-detail-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],module=me.module.app.getModule('tourney-win');module.createOrShowWindow(record);var desktop=me.module.app.getDesktop(),win=desktop.getWindow(me.module.id);if(win){win.destroy();}}}));me.showChampionshipAction=me.addAction(new Ext.Action({itemId:ids.SHOW_CHAMPIONSHIP_ACTION,text:_('Championship'),tooltip:_('Show the championship this tourney belongs.'),iconCls:'championships-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idchampionship=record.get('idchampionship'),module=me.module.app.getModule('championships-win');module.createOrShowWindow('tourneys',idchampionship);}}));me.manageTourneyCompetitorsAction=me.addAction(new Ext.Action({itemId:ids.MANAGE_COMPETITORS_ACTION,text:_('Competitors'),tooltip:_("Manage tourney competitors, allowing player substitutions, even after prize-giving.<br>Use with <b>caution</b> only when you <i>know what you're doing</i>!"),iconCls:'edit-user-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idtourney=record.get('idtourney'),tourney=record.get('description'),championship=record.get('Championship'),date=record.get('date'),ppt=record.get('PlayersPerTeam'),module=me.module.app.getModule('competitors-win');module.createOrShowWindow(idtourney,tourney,date,championship,ppt);}}));me.duplicateTourneyAction=me.addAction(new Ext.Action({itemId:ids.REPLAY_TOURNEY_ACTION,text:_('Replay again'),tooltip:_('Duplicate selected tourney and its competitors on today.'),iconCls:'replay-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];me.duplicateTourney(record);}}));me.createKnockoutTourneyAction=me.addAction(new Ext.Action({itemId:ids.CREATE_KNOCKOUT_TOURNEY_ACTION,text:_('Create knockout tourney'),tooltip:_('Create a knockout tourney from the selected one.'),iconCls:'replay-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];me.createKnockoutTourney(record);}}));me.downloadTourneyAction=me.addAction(new Ext.Action({itemId:ids.DOWNLOAD_TOURNEY_ACTION,text:_('Download'),tooltip:_('Download this tourney data.'),iconCls:'download-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idtourney=record.get('idtourney'),url='/bio/dump?idtourney='+idtourney;window.open(url,"_blank");}}));me.showLitPageAction=me.addAction(new Ext.Action({itemId:ids.SHOW_LIT_PAGE_ACTION,text:_('Lit page'),tooltip:_('Show the corresponding Lit page.'),iconCls:'lit-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],guid=record.get('guid'),url='/lit/tourney/'+guid;window.open(url,"_blank");}}));me.printBoardLabelsAction=me.addAction(new Ext.Action({itemId:ids.PRINT_BOARDLABELS_ACTION,text:_('Board labels'),tooltip:_('Print board labels for this tourney, to allow self-insertion of matches results.'),iconCls:'print-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];me.printBoardLabels(record);}}));me.printPlaybillAction=me.addAction(new Ext.Action({itemId:ids.PRINT_PLAYBILL_ACTION,text:_('Playbill'),tooltip:_('Print the tourney playbill with QRCode to reach its Lit page.'),iconCls:'print-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idtourney=record.get('idtourney'),url='/pdf/playbill/'+idtourney;window.open(url,'_blank');}}));},attachActions:function(){var me=this,args=[];me.callParent();var tbar=me.component.child('#ttoolbar');if(me.component.noAddAndDelete){args.push(0);}else{args.push(2);args.push(' ');}
args.push(me.editTourneyAction,me.showTourneyAction,me.manageTourneyCompetitorsAction,me.duplicateTourneyAction,me.showChampionshipAction);tbar.add.apply(tbar,args);me.component.on({itemdblclick:function(){if(!me.editTourneyAction.isDisabled())
me.editTourneyAction.execute();}});me.component.store.on({add:function(store,records){var record=records[0];me.showEditTourneyWindow(record);}});},shouldDisableAction:function(act){var me=this,disable=me.component.shouldDisableAction(act),statics=me.statics(),currentuser=me.module.app.user,record;if(!disable&&!currentuser.is_admin){if(act.itemId==statics.EDIT_TOURNEY_ACTION||act.itemId==statics.MANAGE_COMPETITORS_ACTION){record=me.component.getSelectionModel().getSelection()[0];if(record.get('idowner')!==null&&record.get('idowner')!==currentuser.user_id)
disable=true;}}
if(!disable&&act.itemId==statics.CREATE_KNOCKOUT_TOURNEY_ACTION){record=me.component.getSelectionModel().getSelection()[0];if(!record.get('prized')||record.get('system')=='knockout')
disable=true;}
return disable;},showEditTourneyWindow:function(record){var me=this,desktop=me.module.app.getDesktop(),win=desktop.getWindow('edit-tourney-win');if(win){win.destroy();}
var metadata=me.module.config.metadata,size=desktop.getReasonableWindowSize(800,590),editors=metadata.editors({'*':{editor:MP.form.Panel.getDefaultEditorSettingsFunction('100%')},description:{editor:{minLength:6}},Championship:{editor:{listeners:{beforequery:function(queryPlan){var store=queryPlan.combo.store;var idclub=me.module.idclub;if(idclub){store.addFilter({id:'currentclub',property:'idclub',value:idclub,operator:'='},false);}},select:function(combo,records){record.data['IDClub']=records[0].get('idclub');}}}},Rating:{editor:{queryCaching:false,listeners:{beforequery:function(queryPlan){var store=queryPlan.combo.store;var idclub=record.get('IDClub');if(idclub){store.addFilter({id:'currentclub',property:'idclub',value:"NULL,"+idclub,operator:'='},false);}}}}}}),form=Ext.create('MP.form.Panel',{autoScroll:true,fieldDefaults:{labelWidth:100,margin:'15 10 0 10'},items:[{xtype:'container',layout:'hbox',items:[{xtype:'container',layout:'anchor',flex:1,items:[editors.date,editors.description,editors.Championship,editors.HostingClub,editors.location,editors.socialurl,editors.Rating,editors.system,editors.finals,editors.finalkind]},{xtype:'container',layout:'anchor',flex:1,items:[editors.duration,editors.prealarm,editors.couplings,editors.delaytoppairing,editors.delaycompatriotpairing,editors.phantomscore,editors.retirements,editors.Owner]}]}],buttons:[{text:_('Cancel'),handler:function(){if(record.phantom){record.store.deleteRecord(record);}
win.close();}},{text:_('Confirm'),formBind:true,handler:function(){if(form.isValid()){form.updateRecord(record);win.close();Ext.create("MP.window.Notification",{position:'t',width:260,title:_('Changes have been applied…'),html:_('Your changes have been applied <strong>locally</strong>.<br/><br/>To make them permanent you must click on the <blink>Save</blink> button.'),iconCls:'info-icon'}).show();}}}]});win=desktop.createWindow({id:'edit-tourney-win',title:_('Edit tourney'),iconCls:me.module.iconCls,width:size.width,height:size.height,modal:true,items:form,closable:false,minimizable:false,maximizable:false,resizable:false,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640),wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/tourneys.html#insert-and-edit'),title:_('Help on tourney insert/edit')});wh.show();}}]});form.loadRecord(record);win.show();},duplicateTourney:function(record){var me=this,idtourney=record.get('idtourney');Ext.Msg.confirm(_('Confirm tourney duplication'),_('The selected tourney, with its competitors but not the matches, will be replicated on the current day. Do you confirm?'),function(response){if('yes'==response){Ext.create("MP.window.Notification",{position:'br',html:_('Replicating selected tourney…'),title:_('Please wait'),iconCls:'waiting-icon'}).show();Ext.Ajax.request({url:'/tourney/replayToday',params:{idtourney:idtourney},success:function(result){var res=Ext.decode(result.responseText),newid,store,prevOptions;if(res&&res.success){Ext.create("MP.window.Notification",{position:'br',iconCls:'done-icon',title:_('Done'),html:res.message}).show();newid=res.new_idtourney;store=me.component.store;prevOptions=Ext.apply({},store.lastOptions);store.reload({callback:function(records){for(var i=0;i<records.length;i++){if(records[i].getId()==newid){me.showEditTourneyWindow(records[i]);break;}}
store.lastOptions=prevOptions;}});}else{Ext.create("MP.window.Notification",{position:'br',iconCls:'alert-icon',title:_('Error'),html:res?res.message:_('Cannot decode JSON object')}).show();}},failure:function(result){Ext.create("MP.window.Notification",{position:'br',iconCls:'alert-icon',title:_('Error'),html:result.statusText}).show();}});}});},createKnockoutTourney:function(record){var me=this,win,form,winWidth=215,winHeight=110,top_players;var handler=function(){var frm=form.getForm();if(frm.isValid()){var ncompetitors=frm.getFields().items[0].getValue();win.destroy();Ext.create("MP.window.Notification",{position:'br',html:_('Replicating selected tourney…'),title:_('Please wait'),iconCls:'waiting-icon'}).show();Ext.Ajax.request({url:'/tourney/createKnockout',params:{idtourney:record.get('idtourney'),ncompetitors:ncompetitors},success:function(result){var res=Ext.decode(result.responseText),newid,store,prevOptions;if(res&&res.success){Ext.create("MP.window.Notification",{position:'br',iconCls:'done-icon',title:_('Done'),html:res.message}).show();newid=res.new_idtourney;store=me.component.store;prevOptions=Ext.apply({},store.lastOptions);store.reload({callback:function(records){for(var i=0;i<records.length;i++){if(records[i].getId()==newid){me.showEditTourneyWindow(records[i]);break;}}
store.lastOptions=prevOptions;}});}else{Ext.create("MP.window.Notification",{position:'br',iconCls:'alert-icon',title:_('Error'),html:res?res.message:_('Cannot decode JSON object')}).show();}},failure:function(result){Ext.create("MP.window.Notification",{position:'br',iconCls:'alert-icon',title:_('Error'),html:result.statusText}).show();}});}};var onKeyDown=function(field,event){if(event.keyCode===event.RETURN||event.keyCode===10){handler();}};var onSpinUp=function(field){var value=top_players,p2=Math.trunc(Math.log2(value));value=Math.pow(2,p2+1);top_players=value;field.setValue(value-1);};var onSpinDown=function(field){var value=top_players,p2=Math.trunc(Math.log2(value));value=Math.pow(2,p2-1);top_players=value;field.setValue(value+1);};var validator=function(value){value=parseInt(value,10);var p2=Math.log2(value);if(p2>0&&p2!=Math.trunc(p2)){return _("Must be a power-of-two, i.e. 2, 4, 8, 16...");}else{top_players=value;return true;}};var ncompetitors=record.get('Participants')/record.get('PlayersPerTeam'),maxcompetitors=Math.pow(2,Math.trunc(Math.log2(ncompetitors)));top_players=Math.min(16,maxcompetitors);form=new Ext.form.Panel({frame:true,bodyPadding:'10 10 0',defaults:{labelWidth:90,anchor:'100%'},items:[{xtype:'numberfield',itemId:'ncompetitors',allowBlank:false,allowDecimals:false,minValue:2,maxValue:maxcompetitors,value:top_players,validator:validator,enableKeyEvents:true,fieldLabel:_('Top competitors'),listeners:{keydown:onKeyDown,spinup:onSpinUp,spindown:onSpinDown}}],buttons:[{text:_('Cancel'),handler:function(){win.destroy();}},{text:_('Confirm'),formBind:true,handler:handler}]});win=me.module.app.getDesktop().createWindow({title:_('Create knockout tourney'),width:winWidth,height:winHeight,layout:'fit',minimizable:false,maximizable:false,items:[form],defaultFocus:'ncompetitors'});win.show();},printBoardLabels:function(record){var me=this,idtourney=record.get('idtourney'),current_competitors=record.get('Participants')/record.get('PlayersPerTeam'),url='/pdf/boardlabels/'+idtourney,win,form,winWidth=245,winHeight=110;var handler=function(){var frm=form.getForm();if(frm.isValid()){var flds=frm.getFields(),nboards=flds.items[0].getValue();url+='?nboards='+nboards;win.destroy();window.open(url,"_blank");}};var onKeyDown=function(field,event){if(event.keyCode===event.RETURN||event.keyCode===10){handler();}};form=new Ext.form.Panel({frame:true,bodyPadding:'10 10 0',defaults:{labelWidth:120,anchor:'100%'},items:[{xtype:'numberfield',itemId:'nboards',allowBlank:false,allowDecimals:false,minValue:1,value:Math.trunc(current_competitors/2)||1,enableKeyEvents:true,fieldLabel:_('Number of carromboards'),listeners:{keydown:onKeyDown,scope:me}}],buttons:[{text:_('Cancel'),handler:function(){win.destroy();}},{text:_('Confirm'),formBind:true,handler:handler}]});win=me.module.app.getDesktop().createWindow({title:_('Print carromboard labels'),width:winWidth,height:winHeight,layout:'fit',minimizable:false,maximizable:false,items:[form],defaultFocus:'nboards'});win.show();}});Ext.define('SoL.module.Tourneys',{extend:'MP.desktop.Module',requires:['MP.grid.Panel'],uses:['SoL.module.Tourneys.Actions','SoL.module.Users','SoL.window.Help'],statics:{dateToISO:function(date){var year=''+date.getFullYear(),month=''+(date.getMonth()+1),day=''+date.getDate();if(month.length<2){month='0'+month;}
if(day.length<2){day='0'+day;}
return year+'-'+month+'-'+day;}},id:'tourneys-win',iconCls:'tourneys-icon',launcherText:function(){return _('Tourneys');},launcherTooltip:function(){return _('<b>Tourneys</b><br />Basic tourneys management.');},config:{xtype:'editable-grid',pageSize:14,autoShowAllEditors:false,clicksToEdit:0,dataURL:'/data/tourneys',saveChangesURL:'/bio/saveChanges',sorters:[{property:'date',direction:'DESC'}],stripeRows:true,selModel:{mode:'MULTI'}},getConfig:function(callback){var me=this,cfg=me.config;if(!cfg.metadata){MP.data.MetaData.fetch(cfg.dataURL,me,function(metadata){var overrides={Owner:{filter:false}};Ext.apply(cfg,{metadata:metadata,fields:metadata.fields(overrides),columns:metadata.columns(overrides,false),idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,rootProperty:metadata.root_slot,plugins:[Ext.create('SoL.module.Tourneys.Actions',{module:me}),Ext.create('SoL.module.Users.AssignOwnership',{module:me})]});callback(cfg);me.app.on('logout',function(){delete cfg.metadata;},me,{single:true});});}else{callback(cfg);}},createOrShowWindow:function(caller,id,description,idclub,club,couplings,closed,idrating,rating){var me=this,config=me.config,desktop=me.app.getDesktop(),win=desktop.getWindow(me.id);if(win){win.destroy();}
me.idclub=idclub;me.configure([me.getConfig],function(done){var size=desktop.getReasonableWindowSize(920,421,"NE"),filteredOn;if(club){filteredOn=' ('+Ext.String.format(_('in championship {0}, organized by {1}'),description,club)+')';}else if(description){var explanation;switch(caller){case'championships':explanation=_('in championship');break;case'clubs':explanation=_('hosted by');break;case'players':explanation=_('played by');break;case'ratings':explanation=_('related with');break;case'users':explanation=_('owned by');break;default:explanation='';break;}
if(explanation!==''){explanation+=' ';}
filteredOn=' ('+explanation+description+')';}else{filteredOn='';}
config=Ext.apply({newRecordData:{date:new Date(),currentturn:0,rankedturn:0,prized:false,duration:45,prealarm:5,phantomscore:25,finals:0,delaytoppairing:1,delaycompatriotpairing:false,couplings:couplings||'serial',retirements:'none',system:'swiss'},filters:[{property:'date',value:SoL.module.Tourneys.dateToISO(new Date()),operator:'<='}]},config);if(caller=='championships'){Ext.apply(config.newRecordData,{idchampionship:id,Championship:description,idrating:idrating,Rating:rating});Ext.apply(config,{noAddAndDelete:closed,stickyFilters:[{property:'idchampionship',value:id,operator:'='}]});}else if(caller=='ratings'){Ext.apply(config.newRecordData,{idrating:id,Rating:description});Ext.apply(config,{stickyFilters:[{property:'idrating',value:id,operator:'='}]});}else if(caller=='players'){Ext.apply(config,{noAddAndDelete:true,extraParams:{idplayer:id}});}else if(caller=='users'){Ext.apply(config,{stickyFilters:[{property:'idowner',value:id,operator:'='}]});}else if(caller=='clubs'){Ext.apply(config,{stickyFilters:[{property:'idhostingclub',value:id,operator:'='}]});}
win=desktop.createWindow({id:me.id,title:(me.windowTitle||me.getLauncherText())+filteredOn,taskbuttonTooltip:me.getLauncherTooltip(),iconCls:me.iconCls,items:[config],x:size.x,y:size.y,width:size.width,height:size.height,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640);var wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/tourneys.html'),title:_('Help on tourneys management')});wh.show();}}]});var grid=win.child('editable-grid');grid.store.load({params:{start:0,limit:me.pageSize},callback:function(){win.on({show:done,single:true});win.show();}});var da=grid.findActionById('delete');if(da)
da.shouldBeDisabled=me.shouldDisableDeleteAction.bind(grid);});},shouldDisableDeleteAction:function(){var grid=this,sm=grid.getSelectionModel(),currentuser=grid.up().up().app.user;if(sm.getCount()>0){var selrecs=sm.getSelection(),disable=false;for(var i=selrecs.length-1;i>=0;i--){var record=selrecs[i];if(!currentuser.is_admin&&record.get('idowner')!==null&&currentuser.user_id!==record.get('idowner')){disable=true;break;}}
return disable;}else{return true;}}});Ext.define('SoL.module.MyTourneys',{extend:'SoL.module.Tourneys',id:'my-tourneys-win',iconCls:'tourneys-icon',launcherText:null,init:function(){var me=this,user=me.app.user;if(!me.config.orig_dataURL)me.config.orig_dataURL=me.config.dataURL;me.config.dataURL=Ext.String.urlAppend(me.config.orig_dataURL,'filter_by_idowner='+(user.is_admin?'NULL':user.user_id));me.windowTitle=Ext.String.format(_('Tourneys managed by {0}'),user.fullname);me.callParent();}});Ext.define('SoL.module.Ratings.Actions',{extend:'MP.action.StoreAware',uses:['Ext.Action','MP.form.Panel','MP.window.Notification','SoL.window.Help'],statics:{EDIT_RATING_ACTION:'edit_rating',RECOMPUTE_RATING_ACTION:'recompute_rating',DOWNLOAD_TOURNEYS_ACTION:'download_tourneys',SHOW_TOURNEYS_ACTION:'show_tourneys',SHOW_PLAYERS_ACTION:'show_players',SHOW_RANKING_ACTION:'show_ranking',SHOW_LIT_PAGE_ACTION:'show_lit'},initActions:function(){var me=this,ids=me.statics();me.callParent();me.editRating=me.addAction(new Ext.Action({itemId:ids.EDIT_RATING_ACTION,text:_('Modify'),tooltip:_('Edit selected rating.'),iconCls:'edit-record-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];me.showEditRatingWindow(record);}}));me.showTourneys=me.addAction(new Ext.Action({itemId:ids.SHOW_TOURNEYS_ACTION,text:_('Tourneys'),tooltip:_('Show tourneys related to the selected rating.'),iconCls:'show-tourneys-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idrating=record.get('idrating'),rating=record.get('description'),module=me.module.app.getModule('tourneys-win');module.createOrShowWindow('ratings',idrating,rating);}}));me.showPlayers=me.addAction(new Ext.Action({itemId:ids.SHOW_PLAYERS_ACTION,text:_('Players'),tooltip:_('Show rated players in the selected rating.'),iconCls:'rated-players-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idrating=record.get('idrating'),rating=record.get('description'),module=me.module.app.getModule('rated-players-win');module.createOrShowWindow(idrating,rating);}}));me.recomputeRating=me.addAction(new Ext.Action({itemId:ids.RECOMPUTE_RATING_ACTION,text:_('Recompute'),tooltip:_('Recompute the selected rating from scratch.'),iconCls:'recompute-rating-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idrating=record.get('idrating');Ext.create("MP.window.Notification",{position:'br',html:_('Recomputing…'),title:_('Please wait'),iconCls:'waiting-icon'}).show();Ext.Ajax.request({url:'/bio/recomputeRating',params:{idrating:idrating},success:function(response){var result=Ext.decode(response.responseText);if(result.success){var store=me.component.store;Ext.create("MP.window.Notification",{position:'br',html:result.message,title:_('Done'),iconCls:'done-icon'}).show();store.loadPage(store.currentPage);}else{Ext.create("MP.window.Notification",{position:'br',html:result.message,title:_('Error'),iconCls:'alert-icon'}).show();}},failure:function(response){Ext.create("MP.window.Notification",{position:'br',html:response.responseText,title:_('Error'),iconCls:'alert-icon'}).show();}});}}));me.downloadTourneys=me.addAction(new Ext.Action({itemId:ids.DOWNLOAD_TOURNEYS_ACTION,text:_('Download'),tooltip:_('Download all tourneys related to this rating.'),iconCls:'download-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idrating=record.get('idrating'),url='/bio/dump?idrating='+idrating;window.open(url,"_blank");}}));me.showRatingRanking=me.addAction(new Ext.Action({itemId:ids.SHOW_RANKING_ACTION,text:_('Ranking'),tooltip:_('Print this rating ranking.'),iconCls:'print-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idrating=record.get('idrating'),url='/pdf/ratingranking/'+idrating;window.open(url,"_blank");}}));me.showLitPage=me.addAction(new Ext.Action({itemId:ids.SHOW_LIT_PAGE_ACTION,text:_('Lit page'),tooltip:_('Show the corresponding Lit page.'),iconCls:'lit-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],guid=record.get('guid'),url='/lit/rating/'+guid;window.open(url,"_blank");}}));},attachActions:function(){var me=this;me.callParent();var tbar=me.component.child('#ttoolbar');tbar.add(2,' ',me.editRating,me.showTourneys,me.showPlayers,me.recomputeRating,me.downloadTourneys,me.showRatingRanking);me.component.on({itemdblclick:function(){if(!me.editRating.isDisabled())
me.editRating.execute();}});me.component.store.on({add:function(store,records){var record=records[0];me.showEditRatingWindow(record);}});},shouldDisableAction:function(act){var me=this,disable=me.component.shouldDisableAction(act),statics=me.statics(),currentuser=me.module.app.user;if(!disable){var record=me.component.getSelectionModel().getSelection()[0];switch(act.itemId){case statics.RECOMPUTE_RATING_ACTION:case statics.SHOW_TOURNEYS_ACTION:if(record.get('level')=='0')
disable=true;break;case statics.EDIT_RATING_ACTION:if(record.get('level')=='0')
disable=true;else if(!currentuser.is_admin&&record.get('idowner')!==null&&record.get('idowner')!==currentuser.user_id)
disable=true;break;default:break;}}
return disable;},showEditRatingWindow:function(record){var me=this,desktop=me.module.app.getDesktop(),win=desktop.getWindow('edit-rating-win'),currentuser=me.module.app.user,canchange=currentuser.is_admin;if(win){win.destroy();}
var metadata=me.module.config.metadata,size=desktop.getReasonableWindowSize(800,440),editors=metadata.editors({'*':{editor:MP.form.Panel.getDefaultEditorSettingsFunction()},tau:{editor:{disabled:!canchange}},default_rate:{editor:{disabled:!canchange}},default_deviation:{editor:{disabled:!canchange}},default_volatility:{editor:{disabled:!canchange}},lower_rate:{editor:{disabled:!canchange}},higher_rate:{editor:{disabled:!canchange}},outcomes:{editor:{disabled:!canchange}}});editors.level.store.splice(0,1);var form=Ext.create('MP.form.Panel',{autoScroll:true,fieldDefaults:{labelWidth:150,margin:'15 0 0 20'},items:[{xtype:'container',layout:'hbox',items:[{xtype:'container',layout:'anchor',flex:1,items:[editors.description,editors.level,editors.inherit,editors.tau,editors.default_rate,editors.default_deviation]},{xtype:'container',layout:'anchor',flex:1,items:[editors.default_volatility,editors.outcomes,editors.lower_rate,editors.higher_rate,editors.Club,editors.Owner]}]}],buttons:[{text:_('Cancel'),handler:function(){if(record.phantom){record.store.deleteRecord(record);}
win.close();}},{text:_('Confirm'),formBind:true,handler:function(){if(form.isValid()){form.updateRecord(record);win.close();Ext.create("MP.window.Notification",{position:'t',width:260,title:_('Changes have been applied…'),html:_('Your changes have been applied <strong>locally</strong>.<br/><br/>To make them permanent you must click on the <blink>Save</blink> button.'),iconCls:'info-icon'}).show();}}}]});win=desktop.createWindow({id:'edit-rating-win',title:_('Edit rating'),iconCls:me.module.iconCls,width:size.width,height:size.height,modal:true,items:form,closable:false,minimizable:false,maximizable:false,resizable:false,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640),wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/ratings.html#insert-and-edit'),title:_('Help on ratings insert/edit')});wh.show();}}]});form.loadRecord(record);win.show();}});Ext.define('SoL.module.Ratings',{extend:'MP.desktop.Module',requires:['MP.grid.Panel'],uses:['SoL.module.Ratings.Actions','SoL.module.Users','SoL.window.Help'],id:'ratings-win',iconCls:'ratings-icon',launcherText:function(){return _('Ratings');},launcherTooltip:function(){return _('<b>Ratings</b><br />Basic ratings management.');},config:{xtype:'editable-grid',pageSize:14,autoShowAllEditors:false,clicksToEdit:0,dataURL:'/data/ratings',saveChangesURL:'/bio/saveChanges',sorters:['description'],stripeRows:true,selModel:{mode:'MULTI'}},getConfig:function(callback){var me=this,cfg=me.config;if(!cfg.metadata){MP.data.MetaData.fetch(cfg.dataURL,me,function(metadata){var overrides={Owner:{filter:false}};Ext.apply(cfg,{metadata:metadata,fields:metadata.fields(overrides),columns:metadata.columns(overrides,false),idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,rootProperty:metadata.root_slot,plugins:[Ext.create('SoL.module.Ratings.Actions',{module:me}),Ext.create('SoL.module.Users.AssignOwnership',{module:me})]});callback(cfg);me.app.on('logout',function(){delete cfg.metadata;},me,{single:true});});}else{callback(cfg);}},createOrShowWindow:function(caller,id,description){var me=this,config=me.config,desktop=me.app.getDesktop(),win=desktop.getWindow(me.id);if(win){win.destroy();}
me.configure([me.getConfig],function(done){var size=desktop.getReasonableWindowSize(850,421,"S"),filteredOn='';me.config.newRecordData={tau:0.5,default_rate:1500,default_deviation:350,default_volatility:0.06};if(caller=='users'){filteredOn=' ('+Ext.String.format(_('owned by {0}'),description)+')';config=Ext.apply({filters:[{property:'idowner',value:id,operator:'='}]},config);}
win=desktop.createWindow({id:me.id,title:(me.windowTitle||me.getLauncherText())+filteredOn,taskbuttonTooltip:me.getLauncherTooltip(),iconCls:me.iconCls,items:[config],x:size.x,y:size.y,width:size.width,height:size.height,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640);var wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/ratings.html'),title:_('Help on ratings management')});wh.show();}}]});var grid=win.child('editable-grid');grid.store.load({params:{start:0,limit:me.pageSize},callback:function(){win.on({show:done,single:true});win.show();}});var da=grid.findActionById('delete');da.shouldBeDisabled=me.shouldDisableDeleteAction.bind(grid);});},shouldDisableDeleteAction:function(){var grid=this,sm=grid.getSelectionModel(),currentuser=grid.up().up().app.user;if(sm.getCount()>0){var selrecs=sm.getSelection(),disable=false;for(var i=selrecs.length-1;i>=0;i--){var record=selrecs[i];if(record.get('Tourneys')>0||(!currentuser.is_admin&&record.get('idowner')!==null&&currentuser.user_id!==record.get('idowner'))){disable=true;break;}}
return disable;}else{return true;}}});Ext.define('SoL.module.MyRatings',{extend:'SoL.module.Ratings',id:'my-ratings-win',iconCls:'ratings-icon',launcherText:null,init:function(){var me=this,user=me.app.user;if(!me.config.orig_dataURL)me.config.orig_dataURL=me.config.dataURL;me.config.dataURL=Ext.String.urlAppend(me.config.orig_dataURL,'filter_by_idowner='+(user.is_admin?'NULL':user.user_id));me.windowTitle=Ext.String.format(_('Ratings managed by {0}'),user.fullname);me.callParent();}});Ext.define('SoL.module.Users.AssignOwnership',{extend:'MP.action.StoreAware',uses:['Ext.Action','MP.form.Panel','MP.window.Notification'],statics:{ASSIGN_OWNERSHIP_ACTION:'assign_ownership'},initActions:function(){var me=this;var ids=me.statics();me.callParent();me.assignOwnershipAction=me.addAction(new Ext.Action({itemId:ids.ASSIGN_OWNERSHIP_ACTION,text:_('Assign'),tooltip:_('Assign ownership of selected records.'),iconCls:'owner-icon',disabled:true,needsSelectedRow:true,handler:function(){me.assignOwnership();}}));},attachActions:function(){var me=this;me.callParent();if(me.module.app.user.is_admin||me.module.app.user.is_ownersadmin){var tbar=me.component.child('#ttoolbar');tbar.add(tbar.items.length-3,me.assignOwnershipAction);}},assignOwnership:function(){var me=this,desktop=me.module.app.getDesktop(),win,winWidth=390,winHeight=110,model=Ext.define('MP.data.ImplicitModel-'+Ext.id(),{extend:'Ext.data.Model',fields:['iduser','Fullname'],idProperty:'iduser'}),lstore=Ext.create('Ext.data.Store',{model:model,pageSize:999,autoLoad:false,remoteFilter:true,proxy:{type:'ajax',url:'/data/owners',filterParam:'filters',reader:{type:'json',root:'root',idProperty:'iduser'}}});lstore.implicitModel=true;var form=new Ext.form.Panel({frame:true,bodyPadding:'10 10 0',defaults:{labelWidth:90,anchor:'100%'},items:[{xtype:'combo',store:lstore,valueField:'iduser',displayField:'Fullname',buttonText:_('Browse'),emptyText:_('Select responsible'),allowBlank:false,triggerAction:'all',typeAhead:true,forceSelection:true,fieldLabel:_('Owner')}],buttons:[{text:_('Cancel'),handler:function(){win.destroy();}},{text:_('Confirm'),formBind:true,handler:function(){var frm=form.getForm();if(frm.isValid()){var combo=frm.getFields().getAt(0),sels=me.component.getSelectionModel().getSelection();Ext.each(sels,function(record){record.set('idowner',combo.value);record.set('Owner',combo.getRawValue());});win.destroy();}}}]});win=desktop.createWindow({id:me.id,title:_('Assign ownership'),iconCls:'upload-icon',width:winWidth,height:winHeight,layout:'fit',minimizable:false,maximizable:false,modal:true,items:[form]});win.show();}});Ext.define('SoL.module.Users.Actions',{extend:'MP.action.StoreAware',uses:['Ext.Action','MP.form.Panel','MP.window.Notification','SoL.module.Players','SoL.window.Help'],statics:{EDIT_USER_ACTION:'edit_user',SHOW_OWNED_CLUBS:'show_owned_clubs',SHOW_OWNED_CHAMPIONSHIPS:'show_owned_championships',SHOW_OWNED_PLAYERS:'show_owned_players',SHOW_OWNED_RATINGS:'show_owned_ratings',SHOW_OWNED_TOURNEYS:'show_owned_tourneys'},initActions:function(){var me=this;var ids=me.statics();me.callParent();me.editUser=me.addAction(new Ext.Action({itemId:ids.EDIT_USER_ACTION,text:_('Modify'),tooltip:_('Edit selected user.'),iconCls:'edit-record-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];me.showEditUserWindow(record);}}));me.showOwnedClubs=me.addAction(new Ext.Action({itemId:ids.SHOW_OWNED_CLUBS,text:_('Clubs'),tooltip:_('Show clubs owned by the selected user.'),iconCls:'clubs-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],iduser=record.get('iduser'),user=SoL.module.Players.full_name(record),module=me.module.app.getModule('clubs-win');module.createOrShowWindow('users',iduser,user);}}));me.showOwnedChampionships=me.addAction(new Ext.Action({itemId:ids.SHOW_OWNED_CHAMPIONSHIPS,text:_('Championships'),tooltip:_('Show championships owned by the selected user.'),iconCls:'championships-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],iduser=record.get('iduser'),user=SoL.module.Players.full_name(record),module=me.module.app.getModule('championships-win');module.createOrShowWindow('users',iduser,user);}}));me.showOwnedPlayers=me.addAction(new Ext.Action({itemId:ids.SHOW_OWNED_PLAYERS,text:_('Players'),tooltip:_('Show players owned by the selected user.'),iconCls:'players-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],iduser=record.get('iduser'),user=SoL.module.Players.full_name(record),module=me.module.app.getModule('players-win');module.createOrShowWindow('users',iduser,user);}}));me.showOwnedRatings=me.addAction(new Ext.Action({itemId:ids.SHOW_OWNED_RATINGS,text:_('Ratings'),tooltip:_('Show ratings owned by the selected user.'),iconCls:'ratings-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],iduser=record.get('iduser'),user=SoL.module.Players.full_name(record),module=me.module.app.getModule('ratings-win');module.createOrShowWindow('users',iduser,user);}}));me.showOwnedTourneys=me.addAction(new Ext.Action({itemId:ids.SHOW_OWNED_TOURNEYS,text:_('Tourneys'),tooltip:_('Show tourneys owned by the selected user.'),iconCls:'tourneys-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],iduser=record.get('iduser'),user=SoL.module.Players.full_name(record),module=me.module.app.getModule('tourneys-win');module.createOrShowWindow('users',iduser,user);}}));},attachActions:function(){var me=this;me.callParent();var tbar=me.component.child('#ttoolbar');tbar.add(2,' ',me.editUser,me.showOwnedClubs,me.showOwnedChampionships,me.showOwnedPlayers,me.showOwnedRatings,me.showOwnedTourneys);me.component.on({itemdblclick:function(){if(!me.editUser.isDisabled())
me.editUser.execute();}});me.component.store.on({add:function(store,records){var record=records[0];me.showEditUserWindow(record);}});},shouldDisableAction:function(act){var me=this,disable=me.component.shouldDisableAction(act),statics=me.statics(),currentuser=me.module.app.user;if(!disable){switch(act.itemId){case statics.EDIT_USER_ACTION:if(!currentuser.is_admin)
disable=true;break;default:break;}}
return disable;},showEditUserWindow:function(record){var me=this,desktop=me.module.app.getDesktop(),win=desktop.getWindow('edit-user-win');if(win){win.destroy();}
var metadata=me.module.config.metadata,size=desktop.getReasonableWindowSize(600,460),editors=metadata.editors({'*':{editor:MP.form.Panel.getDefaultEditorSettingsFunction('100%')},Language:{editor:{queryMode:'local'}},password:{editor:{minLength:6}}}),form=Ext.create('MP.form.Panel',{autoScroll:true,fieldDefaults:{labelWidth:100,margin:'15 10 0 10'},items:[{xtype:'container',layout:'anchor',minHeight:245,flex:1,items:[editors.email,editors.password,editors.firstname,editors.lastname,editors.Language,editors.ownersadmin,editors.playersmanager,editors.state]}],buttons:[{text:_('Cancel'),handler:function(){if(record.phantom){record.store.deleteRecord(record);}
win.close();}},{text:_('Confirm'),formBind:true,handler:function(){if(form.isValid()){form.updateRecord(record);win.close();Ext.create("MP.window.Notification",{position:'t',width:260,title:_('Changes have been applied…'),html:_('Your changes have been applied <strong>locally</strong>.<br/><br/>To make them permanent you must click on the <blink>Save</blink> button.'),iconCls:'info-icon'}).show();}}}]});win=desktop.createWindow({id:'edit-user-win',title:_('Edit user'),iconCls:me.module.iconCls,width:size.width,height:size.height,modal:true,items:form,closable:false,minimizable:false,maximizable:false,resizable:false,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640),wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/users.html#insert-and-edit'),title:_('Help on user insert/edit')});wh.show();}}]});form.loadRecord(record);win.show();}});Ext.define('SoL.module.Users',{extend:'MP.desktop.Module',requires:['MP.grid.Panel'],uses:['SoL.module.Users.Actions','SoL.window.Help'],id:'users-win',iconCls:'users-icon',launcherText:function(){return _('Users');},launcherTooltip:function(){return _('<b>Users</b><br />Basic users management.');},config:{xtype:'editable-grid',pageSize:14,autoShowAllEditors:false,clicksToEdit:0,dataURL:'/data/users',saveChangesURL:'/bio/saveChanges',sorters:['lastname','firstname'],stripeRows:true,selModel:{mode:'MULTI'},newRecordData:{state:'C'}},getConfig:function(callback){var me=this,cfg=me.config;if(!cfg.metadata){MP.data.MetaData.fetch(cfg.dataURL,me,function(metadata){var overrides={},fields=metadata.fields(overrides);Ext.apply(cfg,{metadata:metadata,fields:fields,columns:metadata.columns(overrides,false),idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,rootProperty:metadata.root_slot,plugins:[Ext.create('SoL.module.Users.Actions',{module:me})]});callback(cfg);me.app.on('logout',function(){delete cfg.metadata;},me,{single:true});});}else{callback(cfg);}},createOrShowWindow:function(iduser){var me=this,config=me.config,desktop=me.app.getDesktop(),win=desktop.getWindow(me.id);if(win){win.destroy();}
me.configure([me.getConfig],function(done){var size=desktop.getReasonableWindowSize(780,421,"C");win=desktop.createWindow({id:me.id,title:me.windowTitle||me.getLauncherText(),taskbuttonTooltip:me.getLauncherTooltip(),iconCls:me.iconCls,items:[config],x:size.x,y:size.y,width:size.width,height:size.height,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640);var wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/users.html'),title:_('Help on users management')});wh.show();}}]});var grid=win.child('editable-grid');grid.store.load({params:{start:0,limit:me.pageSize},callback:function(){win.on({show:done,single:true});win.show();}});var da=grid.findActionById('delete');da.shouldBeDisabled=me.shouldDisableDeleteAction.bind(grid);});},shouldDisableDeleteAction:function(){var grid=this,sm=grid.getSelectionModel(),currentuser=grid.up().up().app.user;if(sm.getCount()>0){var disable=!currentuser.is_admin;return disable;}else{return true;}}});Ext.define('SoL.module.Players.Actions',{extend:'MP.action.StoreAware',uses:['Ext.Action','Ext.form.field.File','Ext.form.field.VTypes','MP.form.Panel','MP.window.Notification','SoL.window.Help'],statics:{EDIT_PLAYER_ACTION:'edit_player',SHOW_TOURNEYS_ACTION:'show_tourneys',SHOW_DUPLICATED_ACTION:'show_duplicates',SHOW_DISTRIBUTION_ACTION:'show_distribution',SHOW_LIT_PAGE_ACTION:'show_lit',SET_AGREED_PRIVACY_ACTION:'set_agreed_privacy'},initActions:function(){var me=this,ids=me.statics();me.callParent();me.editPlayer=me.addAction(new Ext.Action({itemId:ids.EDIT_PLAYER_ACTION,text:_('Modify'),tooltip:_('Edit selected player.'),iconCls:'edit-record-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];me.showEditPlayerWindow(record);}}));me.showDuplicatedPlayers=me.addAction(new Ext.Action({itemId:ids.SHOW_DUPLICATED_ACTION,text:_('Duplicates'),tooltip:_('Show possibly duplicated players that should be merged together.'),iconCls:'dup-users-icon',needsCleanStore:true,handler:function(){var store=me.component.store,win=me.component.up();if(this.dups){store.proxy.url=me.component.dataURL;store.load();this.setText(_('Duplicates'));this.dups=false;win.setTitle(_('Players'));}else{var filterbar=me.component.findPlugin('filterbar');if(filterbar){filterbar.clearFilters();}
store.proxy.url=Ext.String.urlAppend(me.component.dataURL,'dups=1');store.load();this.setText(_('Show all'));this.dups=true;win.setTitle(_('Possibly duplicated players'));}}}));me.showTourneys=me.addAction(new Ext.Action({itemId:ids.SHOW_TOURNEYS_ACTION,text:_('Tourneys'),tooltip:_('Show tourneys played by the selected player.'),iconCls:'show-tourneys-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idplayer=record.get('idplayer'),player=SoL.module.Players.full_name(record),module=me.module.app.getModule('tourneys-win');module.createOrShowWindow('players',idplayer,player);}}));me.showDistribution=me.addAction(new Ext.Action({itemId:ids.SHOW_DISTRIBUTION_ACTION,text:_('Distribution'),tooltip:_('Show players distribution around the globe.'),iconCls:'players-distribution-icon',handler:function(){var desktop=me.module.app.getDesktop(),url='/svg/playersdist?'+Ext.Object.toQueryString({width:Math.floor(desktop.getWidth()*0.8),height:Math.floor(desktop.getHeight()*0.8)});window.open(url,"_blank");}}));me.showLitPage=me.addAction(new Ext.Action({itemId:ids.SHOW_LIT_PAGE_ACTION,text:_('Lit page'),tooltip:_('Show the corresponding Lit page.'),iconCls:'lit-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],guid=record.get('guid'),url='/lit/player/'+guid;window.open(url,"_blank");}}));me.setAgreedPrivacy=me.addAction(new Ext.Action({itemId:ids.SET_AGREED_PRIVACY_ACTION,text:_('Privacy'),tooltip:_('Make the selected players “discernible” in public views.'),iconCls:'agreed-privacy-icon',disabled:true,needsSelectedRow:true,handler:function(){var sels=me.component.getSelectionModel().getSelection(),currentuser=me.module.app.user,all_owned=true;if(!currentuser.is_admin){Ext.each(sels,function(record){if(record.get('idowner')!==null&&record.get('idowner')!==currentuser.user_id){all_owned=false;return false;}
return true;});}
if(all_owned){Ext.each(sels,function(record){record.set('agreedprivacy','A');});Ext.create("MP.window.Notification",{position:'t',width:260,title:_('Changes have been applied…'),html:_('Your changes have been applied <strong>locally</strong>.<br/><br/>To make them permanent you must click on the <blink>Save</blink> button.'),iconCls:'info-icon'}).show();}else{Ext.create("MP.window.Notification",{position:'br',width:260,title:_('Unauthorized'),html:_('At least one of the selected players does not belong to you, and thus cannot be modified, sorry!'),iconCls:'alert-icon'}).show();}}}));},attachActions:function(){var me=this,currentuser=me.module.app.user;me.callParent();var tbar=me.component.child('#ttoolbar');if(currentuser.is_playersmanager)
tbar.add(2,' ',me.editPlayer,me.showTourneys,me.showDuplicatedPlayers,me.showDistribution,me.setAgreedPrivacy);else
tbar.add(0,me.showTourneys,me.showDistribution);me.component.on({itemdblclick:function(){if(!me.editPlayer.isDisabled())
me.editPlayer.execute();}});me.component.store.on({add:function(store,records){var record=records[0];me.showEditPlayerWindow(record);}});},shouldDisableAction:function(act){var me=this,disable=me.component.shouldDisableAction(act),statics=me.statics(),currentuser=me.module.app.user;if(!disable&&!currentuser.is_admin){if(act.itemId==statics.EDIT_PLAYER_ACTION){if(!me.module.app.user.is_playersmanager)
disable=true;else{var record=me.component.getSelectionModel().getSelection()[0];if(record.get('idowner')!==null&&record.get('idowner')!==currentuser.user_id)
disable=true;}}}
return disable;},readImageAsDataURL:function(event,elt,form){var file=elt.files[0];if(file.type.split('/')[0]=='image'){var reader=new FileReader();form._portrait=file.name;reader.onload=function(e){var img=e.target.result;if(img.length>(512000*1.33)){Ext.MessageBox.alert(_('Error'),_('Image too big, max 512k allowed'));form._portrait=null;}else{form.down('image').setSrc(img);}};reader.onerror=function(){Ext.MessageBox.alert(_('Error'),_('Sorry, could not read image file')
+': '+reader.error);form._portrait=null;};reader.readAsDataURL(file);}else{Ext.MessageBox.alert(_('Error'),_('Only image files allowed'));}},deleteImage:function(form){form._portrait='';form.down('image').setSrc('');},showEditPlayerWindow:function(record){var me=this,desktop=me.module.app.getDesktop(),win=desktop.getWindow('edit-player-win');if(win){win.destroy();}
var metadata=me.module.config.metadata,size=desktop.getReasonableWindowSize(1000,420),editors=metadata.editors({'*':{editor:MP.form.Panel.getDefaultEditorSettingsFunction('100%')},firstname:{editor:{minLength:2}},lastname:{editor:{minLength:2}},nationality:{editor:{xtype:'flagscombo'}},Language:{editor:{queryMode:'local'}}}),secondcoleditors=[editors.Language,editors.nationality,editors.citizenship,editors.Club,editors.Federation,editors.Owner];if(me.module.app.user.is_admin||me.module.app.user.is_ownersadmin)
secondcoleditors.push(editors.ownersadmin);var form=Ext.create('MP.form.Panel',{autoScroll:true,fieldDefaults:{labelWidth:100,margin:'15 10 0 10'},items:[{xtype:'container',layout:'hbox',items:[{xtype:'container',layout:'anchor',minHeight:245,flex:1,items:[editors.firstname,editors.lastname,editors.nickname,editors.sex,editors.birthdate,editors.email,editors.agreedprivacy]},{xtype:'container',layout:'anchor',minHeight:245,flex:1,items:secondcoleditors},{xtype:'container',style:'text-align: center;',minHeight:245,width:170,items:[{xtype:'image',margin:'50 10 0 10',border:1,style:{maxWidth:'150px',maxHeight:'150px',borderColor:'lightgray',borderStyle:'solid'}},{xtype:'filefield',name:'emblem',fieldLabel:'',labelWidth:0,buttonOnly:true,buttonText:_('Change portrait…'),style:'text-align: center;',listeners:{afterrender:function(fld){var el=fld.fileInputEl.dom;el.setAttribute('accept','image/*');},el:{change:{fn:function(event,elt){if(elt.files.length)
me.readImageAsDataURL(event,elt,form);}}}}},{xtype:'button',text:_('Delete portrait'),handler:function(){me.deleteImage(form);}}]}]}],buttons:[{text:_('Cancel'),handler:function(){if(record.phantom){record.store.deleteRecord(record);}
win.close();}},{text:_('Confirm'),formBind:true,handler:function(){if(form.isValid()){form.updateRecord(record);if(form._portrait!==undefined){record.set('portrait',form._portrait);record.modified['portrait']='';record.set('image',form.down('image').src);}
win.close();Ext.create("MP.window.Notification",{position:'t',width:260,title:_('Changes have been applied…'),html:_('Your changes have been applied <strong>locally</strong>.<br/><br/>To make them permanent you must click on the <blink>Save</blink> button.'),iconCls:'info-icon'}).show();}}}]});win=desktop.createWindow({id:'edit-player-win',title:_('Edit player'),iconCls:me.module.iconCls,width:size.width,height:size.height,modal:true,items:form,closable:false,minimizable:false,maximizable:false,resizable:false,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640);var wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/players.html#insert-and-edit'),title:_('Help on player insert/edit')});wh.show();}}]});form.loadRecord(record);if(!Ext.isEmpty(record.get('portrait'))||!Ext.isEmpty(record.get('image'))){var portrait=form.down('image');if(!Ext.isEmpty(record.get('image'))){portrait.setSrc(record.get('image'));}else{portrait.setSrc('/lit/portrait/'+record.get('portrait'));}}
win.show();}});Ext.define('SoL.module.Players',{extend:'MP.desktop.Module',requires:['MP.grid.Panel'],uses:['Ext.grid.plugin.DragDrop','SoL.form.field.FlagsCombo','SoL.module.Players.Actions','SoL.module.Players.MergePlugin','SoL.module.Users','SoL.window.Help'],statics:{full_name:function(player,html){var lastname=player.get('lastname'),firstname=player.get('firstname'),nickname=player.get('nickname'),format=function(fmt,data){return fmt.replace(/\{(\w+)\}/g,function(m,i){return data[i];});};if(nickname){var nnlower=nickname.toLowerCase(),fnlower=firstname.toLowerCase(),lnlower=lastname.toLowerCase();if(nnlower!=fnlower&&nnlower!=lnlower){nickname=format('“{nickname}”',{nickname:nickname});}else{nickname='';}}else{nickname='';}
if(html!==false){if(nickname!==''){return format(_('<b>{lastname}</b> {firstname} {nickname}'),{lastname:lastname,firstname:firstname,nickname:nickname});}else{return format(_('<b>{lastname}</b> {firstname}'),{lastname:lastname,firstname:firstname});}}else{if(nickname!==''){return format(_('{lastname} {firstname} {nickname}'),{lastname:lastname,firstname:firstname,nickname:nickname});}else{return format(_('{lastname} {firstname}'),{lastname:lastname,firstname:firstname});}}}},id:'players-win',iconCls:'players-icon',launcherText:function(){return _('Players');},launcherTooltip:function(){return _('<b>Players</b><br />Basic players management.');},config:{xtype:'editable-grid',pageSize:23,autoShowAllEditors:false,clicksToEdit:0,dataURL:'/data/players',saveChangesURL:'/bio/saveChanges',sorters:['lastname','firstname'],stripeRows:true,selType:'checkboxmodel',viewConfig:{plugins:{ptype:'mergeplayers'}}},getConfig:function(callback){var me=this;var cfg=me.config;if(!cfg.metadata){MP.data.MetaData.fetch(cfg.dataURL,me,function(metadata){var overrides={Owner:{filter:false},nationality:{renderer:SoL.form.field.FlagsCombo.renderer,filter:{type:'combo',xtype:'flagscombo',noOperatorPlugin:true,editable:true},editor:{xtype:'flagscombo'}}};var fields=metadata.fields(overrides);fields.push({name:'image',type:'string',sendBackToServer:true});Ext.apply(cfg,{metadata:metadata,fields:fields,columns:metadata.columns(overrides,false),idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,rootProperty:metadata.root_slot,plugins:[Ext.create('SoL.module.Players.Actions',{module:me}),Ext.create('SoL.module.Users.AssignOwnership',{module:me})]});callback(cfg);me.app.on('logout',function(){delete cfg.metadata;},me,{single:true});});}else{callback(cfg);}},createOrShowWindow:function(caller,id,description,isfederation){var me=this,config=me.config,desktop=me.app.getDesktop(),win=desktop.getWindow(me.id),currentuser=me.app.user;if(win){win.destroy();}
me.configure([me.getConfig],function(done){var size=desktop.getReasonableWindowSize(800,640,"SE"),filteredOn='';config=Ext.apply({selModel:{listeners:{selectionchange:function(model,records){var num=records.length;var seltext='';if(num>0){seltext=' ('+Ext.String.format(ngettext('{0} selected','{0} selected',num),num)+')';}
win.setTitle((me.windowTitle||me.getLauncherText())
+filteredOn+seltext);}}}},config);if(!currentuser.is_playersmanager)
config.noAddAndDelete=true;if(caller=='clubs'){if(isfederation){filteredOn=' ('+Ext.String.format(_('associated with {0}'),description)+')';Ext.apply(config,{newRecordData:{idfederation:id,Federation:description},stickyFilters:[{property:'idfederation',value:id,operator:'='}]});}else{filteredOn=' ('+Ext.String.format(_('members of {0}'),description)+')';Ext.apply(config,{newRecordData:{idclub:id,Club:description},stickyFilters:[{property:'idclub',value:id,operator:'='}]});}}else if(caller=='competitors'){if(id&&id.length>0){config.stickyFilters=[{id:'ids',property:"idplayer",value:id.join(','),operator:'<>'}];}
if(description){if(description.isPlugin){config.plugins=[description].concat(config.plugins);}else{config.buttons=description;}}}else if(caller=='users'){filteredOn=' ('+Ext.String.format(_('owned by {0}'),description)+')';config=Ext.apply({filters:[{property:'idowner',value:id,operator:'='}]},config);}
win=desktop.createWindow({id:me.id,title:(me.windowTitle||me.getLauncherText())+filteredOn,taskbuttonTooltip:me.getLauncherTooltip(),iconCls:me.iconCls,items:[config],x:size.x,y:size.y,width:size.width,height:size.height,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640);var wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/players.html'),title:_('Help on players management')});wh.show();}}]});var grid=win.child('editable-grid');grid.store.load({params:{start:0,limit:me.pageSize},callback:function(){win.on({show:done,single:true});win.show();}});if(currentuser.is_playersmanager){var da=grid.findActionById('delete');da.shouldBeDisabled=me.shouldDisableDeleteAction.bind(grid);}});},shouldDisableDeleteAction:function(){var grid=this,sm=grid.getSelectionModel(),currentuser=grid.up().up().app.user;if(sm.getCount()>0){var selrecs=sm.getSelection(),disable=false;for(var i=selrecs.length-1;i>=0;i--){var record=selrecs[i];if(!currentuser.is_admin&&record.get('idowner')!==null&&currentuser.user_id!==record.get('idowner')){disable=true;break;}}
return disable;}else{return true;}}});Ext.define('SoL.module.Players.MergePlugin',{extend:'Ext.grid.plugin.DragDrop',alias:'plugin.mergeplayers',uses:['Ext.view.DragZone','SoL.module.Players.MergeTarget'],ddGroup:'player',onViewRender:function(view){var me=this,scrollEl;if(me.enableDrag){if(me.containerScroll){scrollEl=view.getEl();}
me.dragZone=new Ext.view.DragZone({view:view,ddGroup:me.dragGroup||me.ddGroup,containerScroll:me.containerScroll,scrollEl:scrollEl,getDragText:function(){var count=this.dragData.records.length;var msg=ngettext('{0} player','{0} players',count);return Ext.String.format(msg,count);}});}
if(me.enableDrop){me.dropZone=new SoL.module.Players.MergeTarget({view:view,ddGroup:me.dropGroup||me.ddGroup});}}});Ext.define('SoL.module.Players.MergeTarget',{extend:'Ext.dd.DropTarget',uses:['MP.window.Notification'],constructor:function(config){var me=this;Ext.apply(me,config);me.callParent([me.view.el]);},_allowDrop:function(source,e,data){var me=this;if(!e.hasModifier()||data.records.length===0){return false;}
var node=e.getTarget(me.view.getItemSelector());if(!node){return false;}
var app=me.view.up().up().up().app,currentuser=app.user;if(!currentuser.is_admin){for(var i=data.records.length-1;i>=0;i--){if(currentuser.user_id!=data.records[i].get('idowner')){return false;}}}
var trec=me.view.getRecord(node),tid=trec.get('idplayer'),sids=[];Ext.each(data.records,function(r){sids.push(r.get('idplayer'));});if(sids.indexOf(tid)>=0){return false;}
return[trec,data.records];},notifyDrop:function(source,e,data){var me=this,r=me._allowDrop(source,e,data);if(r===false){return false;}
var tdesc=SoL.module.Players.full_name(r[0]),tid=r[0].get('idplayer'),sdescs=[],sids=[];Ext.each(data.records,function(p){sdescs.push(SoL.module.Players.full_name(p));sids.push(p.get('idplayer'));});var howmany=sids.length;Ext.MessageBox.confirm(_('Confirm players merge'),Ext.String.format(ngettext('Player {0} will be replaced by {1} everywhere, if possible. Do you confirm?','Players {0} will be replaced by {1} everywhere, if possible. Do you confirm?',howmany),Ext.toSentence(sdescs,_('and')),tdesc),function(response){if('yes'==response){Ext.create("MP.window.Notification",{position:'br',html:_('Merging selected players…'),title:_('Please wait'),iconCls:'waiting-icon'}).show();Ext.Ajax.request({url:'/bio/mergePlayers',params:{tid:tid,sids:sids},method:'POST',success:function(result){var res=Ext.decode(result.responseText);var success,msg;if(res){success=res.success;msg=res.message;}else{success=false;msg=_('Cannot decode JSON object');}
if(success){Ext.create("MP.window.Notification",{position:'br',iconCls:'done-icon',title:_('Done'),html:msg}).show();me.view.store.reload();}else{Ext.create("MP.window.Notification",{position:'br',iconCls:'alert-icon',title:_('Error'),html:msg}).show();}},failure:function(result){Ext.create("MP.window.Notification",{position:'br',iconCls:'alert-icon',title:_('Error'),html:result.statusText}).show();}});}});return true;},notifyOver:function(source,e,data){return this._allowDrop(source,e,data)===false?this.dropNotAllowed:this.dropAllowed;}});Ext.define('SoL.module.MyPlayers',{extend:'SoL.module.Players',id:'my-players-win',iconCls:'players-icon',launcherText:null,init:function(){var me=this,user=me.app.user;if(!me.config.orig_dataURL)me.config.orig_dataURL=me.config.dataURL;me.config.dataURL=Ext.String.urlAppend(me.config.orig_dataURL,'filter_by_idowner='+(user.is_admin?'NULL':user.user_id));me.windowTitle=Ext.String.format(_('Players managed by {0}'),user.fullname);me.callParent();}});var nonEmptyValueRE=/\S/;Ext.apply(Ext.form.field.VTypes,{nonempty:function(val,field){return nonEmptyValueRE.test(val);},nonemptyText:_('This field cannot be empty, must contain at least one non-space character')});Ext.define('SoL.module.Tourney',{extend:'MP.desktop.Module',requires:['MP.grid.Panel'],uses:['Ext.layout.container.Border','SoL.view.Tourney','SoL.window.Help'],id:'tourney-win',iconCls:'tourney-icon',launcherText:null,launcherTooltip:function(){return _('<b>Tourney</b><br />Tourney management.');},createOrShowWindow:function(tourney){var me=this,desktop=me.app.getDesktop(),win=desktop.getWindow(me.id),winWidth=desktop.getWidth(),winHeight=desktop.getHeight()-desktop.taskbar.getHeight(),currentuser=me.app.user,readonly=(!currentuser.is_admin&&tourney.get('idowner')!=currentuser.user_id);if(win){win.destroy();}
me.tourney=tourney.getData();me.tourney.readOnly=readonly;me.configure(SoL.view.Tourney.configurators(),function(done,config){var tfilter={filter_by_idtourney:me.tourney.idtourney};Ext.apply(config.Boards,{collapsed:true,collapsible:true,module:me,region:'south',split:true,extraParams:tfilter});config.Boards.items[0].store.proxy.extraParams=tfilter;Ext.apply(config.Competitors,{collapsed:me.tourney.currentturn>0,collapsible:true,module:me,region:'west',split:true,width:winWidth*0.3<281?winWidth*0.3:280});config.Competitors.items[0].store.proxy.extraParams=tfilter;Ext.apply(config.Matches,{border:false,module:me,region:'center',extraParams:tfilter});Ext.apply(config.Ranking,{collapsed:!(me.tourney.prized||me.tourney.currentturn!==0),collapsible:true,module:me,region:'east',split:true,width:(winWidth*0.3<351?winWidth*0.3:350)
+(me.tourney.prized?150:0),extraParams:tfilter});win=desktop.createWindow({id:me.id,title:(me.tourney.Championship
+': "'
+me.tourney.description
+'", '+
MP.data.MetaData.renderDate(me.tourney.date)),taskbuttonTooltip:me.getLauncherTooltip(),iconCls:me.iconCls,width:winWidth,height:winHeight,layout:'border',items:[config.Boards,config.Competitors,config.Matches,config.Ranking],tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640),wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/tourney.html'),title:_('Help on tourney management')});wh.show();}},{type:'pin',tooltip:_('Show the corresponding Lit page.'),callback:function(){var url='/lit/tourney/'+me.tourney.guid;window.open(url,"_blank");}}]});var mgrid=me.matches_grid=win.query('editable-grid[dataURL=/tourney/matches]')[0],rgrid=win.query('editable-grid[dataURL=/tourney/ranking]')[0],cview=win.query('competitors-dataview')[0];rgrid.store.on('beforeload',function(store,operation){operation.sorters=undefined;});var updtitle=function(store){var nrecs=store.data.length,eastp=cview.ownerCt;eastp.setTitle(Ext.String.format(_('Competitors ({0})'),nrecs));};cview.store.on('add',updtitle);cview.store.on('load',updtitle);cview.store.on('remove',updtitle);var ready=-3;var cb=function(){ready++;if(ready===0){win.on('show',function(){done();rgrid.store.on('load',function(){if(me.tourney.rankedturn>0||me.tourney.GeneratedTurns){cview.ownerCt.collapse();rgrid.expand();}else{cview.ownerCt.expand();rgrid.collapse();}});},me,{single:true});win.show();}};mgrid.store.on({load:function(s,recs,opts){if(!mgrid.focusedCompetitor){var ordinalp=SoL.view.Matches.ordinalp;if(Ext.isEmpty(recs)){mgrid.setTitle(Ext.String.format(_('Matches')));}else if(recs[0].get('final')){mgrid.setTitle(Ext.String.format(_('Matches {0} final round'),ordinalp(recs[0].get('turn'))));}else{mgrid.setTitle(Ext.String.format(_('Matches {0} round'),ordinalp(recs[0].get('turn'))));}}}});cview.store.on('load',function(s,recs){me.tourney.participants=recs.length;mgrid.updateActions();});cview.store.load({callback:cb});mgrid.store.load({callback:cb});rgrid.store.load({callback:cb});me.reloadRanking=function(turn){var ep=rgrid.store.proxy.extraParams;if(turn&&turn!=me.tourney.rankedturn){ep['turn']=turn<me.tourney.rankedturn?turn:me.tourney.rankedturn;}else{delete ep['turn'];}
rgrid.store.reload();};me.reloadMatches=function(){mgrid.store.reload();};rgrid.store.on('load',function(){mgrid.updateActions();});me.togglePlayerDetail=function(grid,record){var idc=record.get('idcompetitor'),mstore=mgrid.store;if(mstore.isModified()){return;}
if(!mgrid.focusedCompetitor||mgrid.focusedCompetitor!=idc){mgrid.setTitle(Ext.String.format(_('Matches played by {0}'),record.get('description')));mstore.clearFilter(true);if(!mgrid.focusedCompetitor){mgrid.child('toolbar[dock="left"]').hide();mgrid.getColumnByName('turn').show();mgrid.getColumnByName('board').hide();mstore.load({scope:mstore,callback:function(){this.filterBy(function(rec){return rec.get('idcompetitor1')==idc||rec.get('idcompetitor2')==idc;});}});}else{mstore.filterBy(function(rec){return rec.get('idcompetitor1')==idc||rec.get('idcompetitor2')==idc;});}
mgrid.focusedCompetitor=idc;}else{var turn=mgrid.filteredTurn||me.tourney.currentturn;mgrid.child('toolbar[dock="left"]').show();mgrid.getColumnByName('turn').hide();mgrid.getColumnByName('board').show();mstore.filter({id:'turn',property:'turn',value:turn,operator:'='});mgrid.focusedCompetitor=null;}};if(!me.tourney.prized&&!readonly){var newturn=mgrid.findActionById('new_turn'),printbadges=cview.findActionById('print_badges'),printfbadges=rgrid.findActionById('print_final_badges'),printfcards=rgrid.findActionById('print_final_cards'),rsave=rgrid.findActionById('save'),rrestore=rgrid.findActionById('restore');cview.store.on('update',function(store,record,action){if(action=='commit'||action=='reject'){newturn.setDisabled(false);}else{newturn.setDisabled(true);}});cview.store.on('reject',function(){newturn.setDisabled(false);});mgrid.store.on('update',function(store,record,action){if(action=='commit'||action=='reject'){newturn.setDisabled(false);}else{newturn.setDisabled(true);}});mgrid.store.on('reject',function(){newturn.setDisabled(false);});rgrid.store.on('load',function(){var prized=me.tourney.prized,finals=me.tourney.finals;printbadges.setHidden(prized);printfbadges.setHidden(!prized);printfcards.setDisabled(!me.tourney.finalturns);printfcards.setHidden(me.tourney.system=='knockout'||finals===0||(finals&&prized)||(!finals&&!prized));rsave.setHidden(!prized);rrestore.setHidden(!prized);});}},{tourney:me.tourney});}});Ext.define('SoL.module.Championships.Actions',{extend:'MP.action.StoreAware',uses:['Ext.Action','MP.form.Panel','MP.window.Notification','SoL.window.Help'],statics:{EDIT_CHAMPIONSHIP_ACTION:'edit_championship',DOWNLOAD_TOURNEYS_ACTION:'download_tourneys',SHOW_TOURNEYS_ACTION:'show_tourneys',SHOW_CLUB_ACTION:'show_club',SHOW_RANKING_ACTION:'show_ranking',SHOW_LIT_PAGE_ACTION:'show_lit'},initActions:function(){var me=this,ids=me.statics();me.callParent();me.editChampionship=me.addAction(new Ext.Action({itemId:ids.EDIT_CHAMPIONSHIP_ACTION,text:_('Modify'),tooltip:_('Edit selected championship.'),iconCls:'edit-record-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];me.showEditChampionshipWindow(record);}}));me.showTourneys=me.addAction(new Ext.Action({itemId:ids.SHOW_TOURNEYS_ACTION,text:_('Tourneys'),tooltip:_('Show tourneys of this championship.'),iconCls:'show-tourneys-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idchampionship=record.get('idchampionship'),championship=record.get('description'),couplings=record.get('couplings'),idclub=record.get('idclub'),club=record.get('Club'),idrating=record.get('idrating'),rating=record.get('Rating'),closed=record.get('closed'),module=me.module.app.getModule('tourneys-win');module.createOrShowWindow('championships',idchampionship,championship,idclub,club,couplings,closed,idrating,rating);}}));me.showClub=me.addAction(new Ext.Action({itemId:ids.SHOW_CLUB_ACTION,text:_('Club'),tooltip:_('Show the club this championship belongs.'),iconCls:'clubs-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idclub=record.get('idclub'),module=me.module.app.getModule('clubs-win');module.createOrShowWindow('championships',idclub);}}));me.downloadTourneys=me.addAction(new Ext.Action({itemId:ids.DOWNLOAD_TOURNEYS_ACTION,text:_('Download'),tooltip:_('Download this whole championship of tourneys data.'),iconCls:'download-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idchampionship=record.get('idchampionship'),url='/bio/dump?idchampionship='+idchampionship;window.open(url,"_blank");}}));me.showChampionshipRanking=me.addAction(new Ext.Action({itemId:ids.SHOW_RANKING_ACTION,text:_('Ranking'),tooltip:_('Print this championship ranking.'),iconCls:'print-icon',disabled:true,needsOneSelectedRow:true,needsCleanStore:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],idchampionship=record.get('idchampionship'),url='/pdf/championshipranking/'+idchampionship;window.open(url,"_blank");}}));me.showLitPage=me.addAction(new Ext.Action({itemId:ids.SHOW_LIT_PAGE_ACTION,text:_('Lit page'),tooltip:_('Show the corresponding Lit page.'),iconCls:'lit-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0],guid=record.get('guid'),url='/lit/championship/'+guid;window.open(url,"_blank");}}));},attachActions:function(){var me=this;me.callParent();var tbar=me.component.child('#ttoolbar');tbar.add(2,' ',me.editChampionship,me.showTourneys,me.showClub,me.downloadTourneys,me.showChampionshipRanking);me.component.on({itemdblclick:function(){if(!me.editChampionship.isDisabled())
me.editChampionship.execute();}});me.component.store.on({add:function(store,records){var record=records[0];me.showEditChampionshipWindow(record);}});},shouldDisableAction:function(act){var me=this,disable=me.component.shouldDisableAction(act),statics=me.statics(),currentuser=me.module.app.user;if(!disable&&!currentuser.is_admin){if(act.itemId==statics.EDIT_CHAMPIONSHIP_ACTION){var record=me.component.getSelectionModel().getSelection()[0];if(record.get('idowner')!==null&&record.get('idowner')!==currentuser.user_id)
disable=true;}}
return disable;},showEditChampionshipWindow:function(record){var me=this,desktop=me.module.app.getDesktop(),win=desktop.getWindow('edit-championship-win');if(win){win.destroy();}
var metadata=me.module.config.metadata,size=desktop.getReasonableWindowSize(800,430),editors=metadata.editors({'*':{editor:MP.form.Panel.getDefaultEditorSettingsFunction()},description:{editor:{minLength:6}},Previous:{editor:{listeners:{beforequery:function(queryPlan){var store=queryPlan.combo.store,clubf=form.getForm().findField(editors.Club.name),idclub;if(!Ext.isEmpty(clubf.lastSelection)){var iname=clubf.store.proxy.reader.idProperty,srec=clubf.lastSelection[0];idclub=srec.get(iname);}else{idclub=record.get('idclub');}
store.addFilter([{id:'currentclub',property:'idclub',value:idclub,operator:'='},{id:'currentchampionship',property:'idchampionship',value:record.get('idchampionship'),operator:'<>'}],false);delete queryPlan.combo.lastQuery;}}}},Rating:{editor:{queryCaching:false,listeners:{beforequery:function(queryPlan){var store=queryPlan.combo.store;var idclub=record.get('idclub');if(idclub){store.addFilter({id:'currentclub',property:'idclub',value:"NULL,"+idclub,operator:'='},false);}}}}}}),form=Ext.create('MP.form.Panel',{autoScroll:true,fieldDefaults:{labelWidth:150,margin:'15 10 0 10'},items:[{xtype:'container',layout:'hbox',items:[{xtype:'container',layout:'anchor',flex:1,items:[editors.description,editors.Club,editors.playersperteam,editors.skipworstprizes,editors.trainingboards]},{xtype:'container',layout:'anchor',flex:1,items:[editors.Rating,editors.couplings,editors.prizes,editors.closed,editors.Previous,editors.Owner]}]}],buttons:[{text:_('Cancel'),handler:function(){if(record.phantom){record.store.deleteRecord(record);}
win.close();}},{text:_('Confirm'),formBind:true,handler:function(){if(form.isValid()){form.updateRecord(record);win.close();Ext.create("MP.window.Notification",{position:'t',width:260,title:_('Changes have been applied…'),html:_('Your changes have been applied <strong>locally</strong>.<br/><br/>To make them permanent you must click on the <blink>Save</blink> button.'),iconCls:'info-icon'}).show();}}}]});win=desktop.createWindow({id:'edit-championship-win',title:_('Edit championship'),iconCls:me.module.iconCls,width:size.width,height:size.height,modal:true,items:form,closable:false,minimizable:false,maximizable:false,resizable:false,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640),wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/championships.html#insert-and-edit'),title:_('Help on championship insert/edit')});wh.show();}}]});form.loadRecord(record);win.show();}});Ext.define('SoL.module.Championships',{extend:'MP.desktop.Module',requires:['MP.grid.Panel'],uses:['SoL.module.Championships.Actions','SoL.module.Users','SoL.window.Help'],id:'championships-win',iconCls:'championships-icon',launcherText:function(){return _('Championships');},launcherTooltip:function(){return _('<b>Championships</b><br />Basic championships management.');},config:{xtype:'editable-grid',pageSize:14,autoShowAllEditors:false,clicksToEdit:0,dataURL:'/data/championships',saveChangesURL:'/bio/saveChanges',sorters:['closed','description'],stripeRows:true,selModel:{mode:'MULTI'}},getConfig:function(callback){var me=this,cfg=me.config;if(!cfg.metadata){MP.data.MetaData.fetch(cfg.dataURL,me,function(metadata){var overrides={Owner:{filter:false}};Ext.apply(cfg,{metadata:metadata,fields:metadata.fields(overrides),columns:metadata.columns(overrides,false),idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,rootProperty:metadata.root_slot,plugins:[Ext.create('SoL.module.Championships.Actions',{module:me}),Ext.create('SoL.module.Users.AssignOwnership',{module:me}),]});callback(cfg);me.app.on('logout',function(){delete cfg.metadata;},me,{single:true});});}else{callback(cfg);}},createOrShowWindow:function(caller,id,description,prizes,couplings,idrating,rating){var me=this,config=me.config,desktop=me.app.getDesktop(),win=desktop.getWindow(me.id);if(win){win.destroy();}
me.configure([me.getConfig],function(done){var size=desktop.getReasonableWindowSize(740,421,"SW"),filteredOn='';config=Ext.apply({newRecordData:{prizes:prizes||'fixed',couplings:couplings||'serial',skipworstprizes:0,playersperteam:1,closed:false}},config);if(caller=='clubs'){filteredOn=' ('+Ext.String.format(_('organized by {0}'),description)+')';config.newRecordData.idclub=id;config.newRecordData.Club=description;config.newRecordData.idrating=idrating;config.newRecordData.Rating=rating;config.stickyFilters=[{property:'idclub',value:id,operator:'='}];}else if(caller=='tourneys'){config.filters=[{property:'idchampionship',value:id,operator:'='}];}else if(caller=='users'){filteredOn=' ('+Ext.String.format(_('owned by {0}'),description)+')';config.filters=[{property:'idowner',value:id,operator:'='}];}
win=desktop.createWindow({id:me.id,title:(me.windowTitle||me.getLauncherText())+filteredOn,taskbuttonTooltip:me.getLauncherTooltip(),iconCls:me.iconCls,items:[config],x:size.x,y:size.y,width:size.width,height:size.height,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640),wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/championships.html'),title:_('Help on championships management')});wh.show();}}]});var grid=win.child('editable-grid');grid.store.load({params:{start:0,limit:me.pageSize},callback:function(){win.on({show:done,single:true});win.show();}});var da=grid.findActionById('delete');da.shouldBeDisabled=me.shouldDisableDeleteAction.bind(grid);});},shouldDisableDeleteAction:function(){var grid=this,sm=grid.getSelectionModel(),currentuser=grid.up().up().app.user;if(sm.getCount()>0){var selrecs=sm.getSelection(),disable=false;for(var i=selrecs.length-1;i>=0;i--){var record=selrecs[i];if(record.get('Tourneys')>0||(!currentuser.is_admin&&record.get('idowner')!==null&&currentuser.user_id!==record.get('idowner'))){disable=true;break;}}
return disable;}else{return true;}}});Ext.define('SoL.module.MyChampionships',{extend:'SoL.module.Championships',id:'my-championships-win',iconCls:'championships-icon',launcherText:null,init:function(){var me=this,user=me.app.user;if(!me.config.orig_dataURL)me.config.orig_dataURL=me.config.dataURL;me.config.dataURL=Ext.String.urlAppend(me.config.orig_dataURL,'filter_by_idowner='+(user.is_admin?'NULL':user.user_id));me.windowTitle=Ext.String.format(_('Championships managed by {0}'),user.fullname);me.callParent();}});Ext.define('SoL.view.Matches.Actions',{extend:'MP.action.StoreAware',uses:['Ext.Action','MP.window.Notification',],statics:{NEW_TURN_ACTION:'new_turn',FINAL_TURN_ACTION:'final_turn',SHOW_PRE_COUNTDOWN_ACTION:'show_pre_countdown',SHOW_COUNTDOWN_ACTION:'show_countdown',PRINT_CARDS_ACTION:'print_cards',PRINT_RESULTS_ACTION:'print_results',PRINT_ALL_RESULTS_ACTION:'print_all_results',PRINT_MATCHES_ACTION:'print_matches',SEND_TRAINING_MATCH_EMAILS_ACTION:'send_training_match_emails',REFRESH_ACTION:'refresh',EDIT_MATCH_ACTION:'edit_match',SELF_EDIT_MATCH_ACTION:'html_edit_match',SELF_EDIT_COMP1_ACTION:'html_edit_comp1',SELF_EDIT_COMP2_ACTION:'html_edit_comp2'},initActions:function(){var me=this,ids=me.statics(),tourney=me.module.tourney,is_tbaaa=tourney.couplings==='all'&&tourney.TrainingBoards;me.callParent();me.newTurnAction=me.addAction(new Ext.Action({itemId:ids.NEW_TURN_ACTION,text:is_tbaaa?_('Rounds'):_('New round'),tooltip:is_tbaaa?_('Create all possible rounds.'):_('Create next round.'),iconCls:'new-turn-icon',disabled:(is_tbaaa?tourney.GeneratedTurns:tourney.currentturn!=tourney.rankedturn),hidden:tourney.readOnly,scope:me.component,handler:me.component.newTurn}));me.finalTurnAction=me.addAction(new Ext.Action({itemId:ids.FINAL_TURN_ACTION,text:_('Final round'),tooltip:_('Create final round.'),iconCls:'new-turn-icon',disabled:tourney.currentturn!=tourney.rankedturn,hidden:tourney.readOnly||!tourney.finals||tourney.system==='knockout',scope:me.component,handler:me.component.finalTurn}));me.showPreCountdownAction=me.addAction(new Ext.Action({itemId:ids.SHOW_PRE_COUNTDOWN_ACTION,text:_('Prepare'),tooltip:_('Show a countdown while preparing for the next round.'),iconCls:'pre-countdown-icon',disabled:tourney.readOnly,hidden:tourney.readOnly,scope:me.component,handler:me.component.showPreCountdown}));me.showCountdownAction=me.addAction(new Ext.Action({itemId:ids.SHOW_COUNTDOWN_ACTION,text:_('Play'),tooltip:_('Show a countdown for the current round.'),iconCls:'countdown-icon',disabled:tourney.readOnly,hidden:tourney.readOnly,scope:me.component,handler:me.component.showGameCountdown}));me.printCardsAction=me.addAction(new Ext.Action({itemId:ids.PRINT_CARDS_ACTION,text:_('Scorecards'),tooltip:_('Print current round scorecards.'),iconCls:'print-icon',disabled:tourney.readOnly,hidden:tourney.readOnly,scope:me.component,handler:me.component.printCards}));me.printResultsAction=me.addAction(new Ext.Action({itemId:ids.PRINT_RESULTS_ACTION,text:_('Results'),tooltip:_('Print selected round results.'),iconCls:'print-icon',handler:function(){var turn=me.component.filteredTurn,url='/pdf/results/'+tourney.idtourney;if(turn)url+='?turn='+turn;window.location.assign(url);}}));me.printAllResultsAction=me.addAction(new Ext.Action({itemId:ids.PRINT_ALL_RESULTS_ACTION,text:_('All results'),tooltip:_('Print results of all played rounds.'),iconCls:'print-icon',handler:function(){var url='/pdf/results/'+tourney.idtourney+'?turn=all';window.location.assign(url);}}));me.printMatchesAction=me.addAction(new Ext.Action({itemId:ids.PRINT_MATCHES_ACTION,text:_('Matches'),tooltip:_('Print selected round matches.'),iconCls:'print-icon',disabled:tourney.readOnly,hidden:tourney.readOnly,handler:function(){var turn=me.component.filteredTurn,url='/pdf/matches/'+tourney.idtourney;if(turn)url+='?turn='+turn;window.location.assign(url);}}));me.sendTrainingURLsAction=me.addAction(new Ext.Action({itemId:ids.SEND_TRAINING_MATCH_EMAILS_ACTION,text:_('Send emails'),tooltip:_('Send emails to allow competitors to self compile their scores.'),iconCls:'send-email-icon',disabled:tourney.readOnly||tourney.currentturn!=tourney.rankedturn,hidden:tourney.readOnly||!tourney.TrainingBoards,scope:me.component,handler:me.component.sendTrainingURLs}));me.refreshAction=me.addAction(new Ext.Action({itemId:ids.REFRESH_ACTION,text:_('Refresh'),tooltip:_('Reload matches from the database and possibly update the ranking.'),icon:'/desktop/extjs/resources/ext-theme-classic/images/grid/refresh.gif',disabled:tourney.readOnly,hidden:tourney.readOnly,needsCleanStore:true,handler:function(){var store=me.module.matches_grid.store;if(!store.isModified()){store.on({single:true,load:me.component.maybeUpdateRanking,scope:me.component});store.reload();}}}));me.editMatchAction=me.addAction(new Ext.Action({itemId:ids.EDIT_MATCH_ACTION,text:_('Boards details'),tooltip:_('Show or edit per-board results of the selected match.'),iconCls:'edit-record-icon',disabled:true,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];me.component.showEditMatchWindow(record);}}));if(!tourney.TrainingBoards){me.selfEditMatchAction=me.addAction(new Ext.Action({itemId:ids.SELF_EDIT_MATCH_ACTION,text:_('Digital scorecard'),tooltip:_('Show the digital scorecard that allows the competitors of selected match to self-insert their per-board results.'),iconCls:'edit-record-icon',disabled:true,hidden:tourney.readOnly,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];Ext.Ajax.request({url:'/tourney/getBoardSelfEditURL',params:{idtourney:tourney.idtourney,board:record.get('board')},success:function(r){var res=Ext.decode(r.responseText);if(!res){Ext.MessageBox.alert(_("Comunication error"),_('Cannot decode JSON object'));}else{if(res.success){window.open(res.url,"_blank");}else{Ext.MessageBox.alert(_('Error'),res.message);}}}});}}));}else{me.selfEditComp1Action=me.addAction(new Ext.Action({itemId:ids.SELF_EDIT_COMP1_ACTION,text:_('Competitor 1 digital scorecard'),tooltip:_('Show the digital scorecard that allows the first competitor of the selected match to self-insert own per-board results.'),iconCls:'edit-record-icon',disabled:true,hidden:tourney.readOnly,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];Ext.Ajax.request({url:'/tourney/getCompetitor1SelfEditURL',params:{idmatch:record.get('idmatch')},success:function(r){var res=Ext.decode(r.responseText);if(!res){Ext.MessageBox.alert(_("Comunication error"),_('Cannot decode JSON object'));}else{if(res.success){window.open(res.url,"_blank");}else{Ext.MessageBox.alert(_('Error'),res.message);}}}});}}));me.selfEditComp2Action=me.addAction(new Ext.Action({itemId:ids.SELF_EDIT_COMP2_ACTION,text:_('Competitor 2 digital scorecard'),tooltip:_('Show the digital scorecard that allows the second competitor of the selected match to self-insert own per-board results.'),iconCls:'edit-record-icon',disabled:true,hidden:tourney.readOnly,needsOneSelectedRow:true,handler:function(){var record=me.component.getSelectionModel().getSelection()[0];Ext.Ajax.request({url:'/tourney/getCompetitor2SelfEditURL',params:{idmatch:record.get('idmatch')},success:function(r){var res=Ext.decode(r.responseText);if(!res){Ext.MessageBox.alert(_("Comunication error"),_('Cannot decode JSON object'));}else{if(res.success){window.open(res.url,"_blank");}else{Ext.MessageBox.alert(_('Error'),res.message);}}}});}}));}},attachActions:function(){var me=this,tourney=me.module.tourney;me.callParent();var tbar=me.component.child('#ttoolbar');tbar.add(0,me.editMatchAction,me.showPreCountdownAction,me.newTurnAction,me.finalTurnAction,tourney.TrainingBoards?me.sendTrainingURLsAction:null,me.printMatchesAction,me.printCardsAction,me.showCountdownAction,me.printResultsAction,me.printAllResultsAction);tbar.add(tbar.items.length-2,me.refreshAction);me.component.on({itemdblclick:function(){if(!me.editMatchAction.isDisabled())
me.editMatchAction.execute();}});},shouldDisableAction:function(act){var me=this,statics=me.statics(),disable=false;if(act.itemId==statics.EDIT_MATCH_ACTION){var tourney=me.module.tourney,grid=me.component;disable=(!tourney.currentturn||grid.getSelectionModel().getSelection().length!=1);if(!disable&&(tourney.prized||tourney.readOnly)&&grid.getSelectionModel().getSelection()[0].get('coins1_1')===null){disable=true;}}else if(act.itemId==statics.REFRESH_ACTION){disable=me.module.matches_grid.store.shouldDisableAction(act);}
return disable;}});Ext.define('SoL.view.Matches',{extend:'MP.grid.Panel',alias:'widget.matches-grid',requires:['SoL.view.Matches.Actions'],clicksToEdit:1,statics:{ordinal:function(num){var r;switch(num){case 1:r=_('the first');break;case 2:r=_('the second');break;case 3:r=_('the third');break;case 4:r=_('the fourth');break;case 5:r=_('the fifth');break;case 6:r=_('the sixth');break;case 7:r=_('the seventh');break;case 8:r=_('the eighth');break;case 9:r=_('the ninth');break;case 10:r=_('the tenth');break;case 11:r=_('the eleventh');break;case 12:r=_('the twelfth');break;case 13:r=_('the thirteenth');break;case 14:r=_('the fourteenth');break;case 15:r=_('the fifteenth');break;case 16:r=_('the sixteenth');break;default:r=num+'';break;}
return r;},ordinalp:function(num){var r;switch(num){case 1:r=_('of the first');break;case 2:r=_('of the second');break;case 3:r=_('of the third');break;case 4:r=_('of the fourth');break;case 5:r=_('of the fifth');break;case 6:r=_('of the sixth');break;case 7:r=_('of the seventh');break;case 8:r=_('of the eighth');break;case 9:r=_('of the ninth');break;case 10:r=_('of the tenth');break;case 11:r=_('of the eleventh');break;case 12:r=_('of the twelfth');break;case 13:r=_('of the thirteenth');break;case 14:r=_('of the fourteenth');break;case 15:r=_('of the fifteenth');break;case 16:r=_('of the sixteenth');break;default:r=num+'';break;}
return r;},getConfig:function(callback,errorcb,config){var me=this,ordinal=SoL.view.Matches.ordinal,ordinalp=SoL.view.Matches.ordinalp,is_tbaaa=(config.tourney.couplings==='all'&&config.tourney.TrainingBoards),genturns=(is_tbaaa?config.tourney.GeneratedTurns:config.tourney.currentturn),cfg=config.Matches={dataURL:'/tourney/matches',filters:[{id:'turn',property:'turn',value:config.tourney.currentturn,operator:'='}],header:true,layout:'fit',lbar:[],noAddAndDelete:true,noBottomToolbar:true,noFilterbar:true,pageSize:999,plugins:[Ext.create('SoL.view.Matches.Actions',{module:me})],saveChangesURL:'/bio/saveChanges',sorters:['turn','board'],title:(genturns?Ext.String.format(_('Matches {0} round'),ordinalp(genturns)):_('Matches')),xtype:'matches-grid'};function apply_filter(btn){me.matches_grid.filterOnTurn(btn.turn);}
for(var i=1;i<=genturns;i++){cfg.lbar.push({itemId:'turn-'+i,text:i,cls:i==config.tourney.currentturn?'active-turn':'',tooltip:Ext.String.format(_('Show the matches {0} round.'),ordinalp(i)),turn:i,handler:apply_filter});}
cfg.lbar.push('-',{iconCls:'icon-cross',tooltip:_('Remove last round.'),handler:function(btn){var grid=btn.up().up();var turn=config.tourney.currentturn;if(turn){var title=_('Delete last round?');var msg=Ext.String.format(_('Do you really want to delete {0} round?<br/>This is <b>NOT</b> revertable!'),ordinal(turn));Ext.Msg.confirm(title,msg,function(response){if('yes'==response){grid.deleteTurn(turn);}});}}});function decorate_winner(val,meta,record,rowIndex,colIndex,store){if(record.get('score1')>record.get('score2'))
meta.tdCls+=' winner1';else if(record.get('score1')<record.get('score2'))
meta.tdCls+=' winner2';return val;};function decorate_winner_c1(val,meta,record,rowIndex,colIndex,store){if(record.get('score1')>record.get('score2'))
meta.tdCls+=' winner';return val;};function decorate_winner_c2(val,meta,record,rowIndex,colIndex,store){if(record.get('score1')<record.get('score2'))
meta.tdCls+=' winner';return val;};MP.data.MetaData.fetch(cfg.dataURL
+'?filter_by_idtourney='+config.tourney.idtourney,me,function(metadata){var overrides={description:{renderer:decorate_winner},score1:{renderer:decorate_winner_c1,editor:{hideTrigger:true}},score2:{renderer:decorate_winner_c2,editor:{hideTrigger:true}}};Ext.apply(cfg,{metadata:metadata,fields:metadata.fields(overrides),columns:metadata.columns(overrides),idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,rootProperty:metadata.root_slot});callback(cfg);});}},initEvents:function(){var me=this,tourney=me.module.tourney;me.callParent();me.on("beforeedit",function(editor,event){var ordinal=SoL.view.Matches.ordinal,ordinalp=SoL.view.Matches.ordinalp;if(tourney.prized)
return false;var rec=event.record,phantom=rec.get("idcompetitor2")===null;if(!me.allowEditPreviousTurns&&rec.get("turn")<tourney.currentturn){Ext.Msg.confirm(_('Confirm edit of old round results'),Ext.String.format(_('Do you confirm you want to edit the results {0} round, even if the'
+' ranking is currently at {1}?<br/>Doing so the ranking will be'
+' updated but following rounds pairing will remain unchanged!'),ordinalp(rec.get("turn")),ordinal(tourney.currentturn)),function(response){if(response=='yes'){me.allowEditPreviousTurns=true;me.editingPlugin.startEdit(event.rowIdx,me.getColumnByName('score1'));Ext.create("MP.window.Notification",{position:'tl',title:_('Changing old results'),html:Ext.String.format(_('You are now allowed to change the results {0} round'),ordinalp(rec.get("turn"))),iconCls:'info-icon'}).show();}});}
if(tourney.couplings==='all'&&tourney.TrainingBoards)
return true;else
return(!phantom&&(rec.get("turn")==tourney.currentturn||me.allowEditPreviousTurns===true));});var rownum='',gotoRowNum=Ext.Function.createBuffered(function(){var sm=me.getSelectionModel(),row=parseInt(rownum,10)-1,ep=me.editingPlugin;sm.select(row);if(ep){ep.startEdit(row,me.getColumnByName('score1'));}
rownum='';},400);me.jumpToRecordKeyMap=new Ext.util.KeyMap({target:me.getView(),eventName:'itemkeydown',processEvent:function(view,record,node,index,event){return event;},binding:{key:"1234567890",fn:function(keyCode,e){rownum=rownum+(e.getKey()-48);gotoRowNum();}}});},classifyRecord:function(rec,rowIndex,rowParams,store){var result=store.classifyRecord(rec);if(result===''&&rec.get('score1')==0&&rec.get('score2')==0){result='incomplete-record';}
return result;},onDestroy:function(){if(this.jumpToRecordKeyMap){Ext.destroy(this.jumpToRecordKeyMap);delete this.jumpToRecordKeyMap;}
this.callParent();},_newTurn:function(url){var me=this,ordinalp=me.statics().ordinalp,tourney=me.module.tourney,lbar=me.child('toolbar[dock="left"]');me.allowEditPreviousTurns=false;if(me.focusedCompetitor){lbar.show();me.getColumnByName('turn').hide();me.getColumnByName('board').show();me.filterOnTurn(tourney.currentturn);me.focusedCompetitor=null;}
Ext.Ajax.request({url:url,params:{idtourney:tourney.idtourney},success:function(r){var res=Ext.decode(r.responseText);if(!res){Ext.MessageBox.alert(_("Comunication error"),_('Cannot decode JSON object'));}else{if(res.success){var cturn=res.currentturn;tourney.currentturn=cturn;tourney.rankedturn=res.rankedturn;tourney.finalturns=res.finalturns;tourney.prized=res.prized;tourney.GeneratedTurns=res.generated_turns;while(cturn<=res.generated_turns){lbar.insert(cturn-1,Ext.create('Ext.button.Button',{itemId:'turn-'+cturn,text:cturn,tooltip:Ext.String.format(_('Show the matches {0} round.'),ordinalp(cturn)),turn:cturn,handler:function(btn){me.filterOnTurn(btn.turn);}}));cturn+=1;}
me.filterOnTurn(res.currentturn);me.updateActions();}else{Ext.MessageBox.alert(_('Error'),res.message);}}}});},newTurn:function(){this._newTurn('/tourney/newTurn');},finalTurn:function(){this._newTurn('/tourney/finalTurn');},deleteTurn:function(turn){var me=this,tourney=me.module.tourney;me.allowEditPreviousTurns=false;Ext.Ajax.request({url:'/tourney/deleteFromTurn',params:{idtourney:tourney.idtourney,fromturn:turn},success:function(r){var res=Ext.decode(r.responseText);if(!res){Ext.MessageBox.alert(_("Comunication error"),_('Cannot decode JSON object'));}else{if(res.success){var lbar=me.child('toolbar[dock="left"]');tourney.currentturn=res.currentturn;tourney.rankedturn=res.rankedturn;tourney.finalturns=res.finalturns;tourney.prized=res.prized;if(turn>1){me.filterOnTurn(turn-1);}else{me.setTitle(_('Matches'));me.store.removeAll();me.module.reloadRanking();}
while(turn<=tourney.GeneratedTurns){lbar.remove('turn-'+turn,true);turn+=1;}
tourney.GeneratedTurns=res.currentturn;me.updateActions();}else{Ext.MessageBox.alert(_('Error'),res.message);}}}});},filterOnTurn:function(turn){var me=this,store=me.store,tourney=me.module.tourney;if(store.isModified()){Ext.MessageBox.alert(_('Uncommitted changes'),_('There are uncommitted changes, cannot switch to a different round!'));return;}
me.allowEditPreviousTurns=false;store.filter({id:'turn',property:'turn',value:turn,operator:'='});me.child('toolbar[dock="left"]').cascade(function(btn){if(btn.turn==turn){btn.addCls('active-turn');}else{btn.removeCls('active-turn');}});me.module.reloadRanking(turn);if(turn!=tourney.currentturn){me.filteredTurn=turn;}else{delete me.filteredTurn;}},printCards:function(){var me=this,tourney=me.module.tourney,url='/pdf/scorecards/'+tourney.idtourney,win,form,winWidth=215,winHeight=110,now=new Date(),minValue=now,maxValue=Ext.Date.add(now,Ext.Date.HOUR,2);if(minValue.getDate()!=maxValue.getDate()){minValue=maxValue=undefined;}
var handler=function(){var frm=form.getForm();if(frm.isValid()){var startts=frm.getFields().items[0].getValue(),starttime=startts.getTime(),tzoffset=startts.getTimezoneOffset();url+='?starttime='+starttime+'&tzoffset='+tzoffset;win.destroy();window.location.assign(url);}};var onKeyDown=function(field,event){if(event.keyCode===event.RETURN||event.keyCode===10){handler();}};form=new Ext.form.Panel({frame:true,bodyPadding:'10 10 0',defaults:{labelWidth:50,anchor:'100%'},items:[{xtype:'timefield',itemId:'starttime',increment:5,allowBlank:false,minValue:minValue,maxValue:maxValue,value:Ext.Date.add(now,Ext.Date.MINUTE,10+(5-now.getMinutes()%5)),enableKeyEvents:true,listeners:{keydown:onKeyDown,scope:me}}],buttons:[{text:_('Cancel'),handler:function(){win.destroy();}},{text:_('Confirm'),formBind:true,handler:handler}]});win=me.module.app.getDesktop().createWindow({title:_('Estimated start'),width:winWidth,height:winHeight,layout:'fit',minimizable:false,maximizable:false,items:[form],defaultFocus:'starttime'});win.show();},maybeUpdateRanking:function(){var me=this,tourney=me.module.tourney;if(!(tourney.couplings==='all'&&tourney.TrainingBoards)){var complete_scores=true;me.store.each(function(rec){if(rec.get("score1")===0&&rec.get("score2")===0){complete_scores=false;me.getSelectionModel().select([rec]);Ext.create("MP.window.Notification",{position:'tl',width:260,title:_('Incomplete scores'),html:_('There is at least one match without result: the ranking will <strong>not</strong> be recomputed until you insert all of them!'),iconCls:'alert-icon'}).show();return false;}else
return true;});if(complete_scores)
me.updateRanking();}},commitChanges:function(){var me=this;me.store.on({single:true,load:me.maybeUpdateRanking,scope:me});me.store.commitChanges(me.saveChangesURL,'idmatch');},updateRanking:function(){var me=this,tourney=me.module.tourney;Ext.Ajax.request({url:'/tourney/updateRanking',params:{idtourney:tourney.idtourney},success:function(r){var res=Ext.decode(r.responseText);if(!res){Ext.MessageBox.alert(_("Comunication error"),_('Cannot decode JSON object'));}else{if(res.success){tourney.currentturn=res.currentturn;tourney.rankedturn=res.rankedturn;tourney.finalturns=res.finalturns;tourney.prized=res.prized;me.module.reloadRanking();me.updateActions();}else{Ext.MessageBox.alert(_('Error'),res.message);}}}});},sendTrainingURLs:function(){var me=this,tourney=me.module.tourney;Ext.Ajax.request({url:'/tourney/sendTrainingURLs',params:{idtourney:tourney.idtourney},success:function(r){var res=Ext.decode(r.responseText);if(!res){Ext.MessageBox.alert(_("Comunication error"),_('Cannot decode JSON object'));}else{if(res.success){Ext.create("MP.window.Notification",{position:'tl',width:260,title:_('Emails have been sent…'),html:_('All competitors have been notified with a link to insert their results.'),iconCls:'info-icon'}).show();}else{Ext.MessageBox.alert(_('Error'),res.message);}}}});},showGameCountdown:function(){var me=this,tourney=me.module.tourney,url='/tourney/countdown?idtourney='+tourney.idtourney;window.open(url,"SoL Countdown");},showPreCountdown:function(){var me=this,tourney=me.module.tourney,url='/tourney/pre_countdown?idtourney='+tourney.idtourney,win,form,winWidth=245,winHeight=140;var handler=function(){var frm=form.getForm();if(frm.isValid()){var flds=frm.getFields(),duration=flds.items[0].getValue(),prealarm=flds.items[1].getValue();url+='&duration='+duration+'&prealarm='+prealarm;win.destroy();window.open(url,"SoL Countdown");}};var onKeyDown=function(field,event){if(event.keyCode===event.RETURN||event.keyCode===10){handler();}};form=new Ext.form.Panel({frame:true,bodyPadding:'10 10 0',defaults:{labelWidth:50,anchor:'100%'},items:[{xtype:'numberfield',itemId:'duration',fieldLabel:_('Minutes'),allowBlank:false,allowDecimals:false,minValue:1,value:15,step:5,enableKeyEvents:true,listeners:{keydown:onKeyDown,scope:me}},{xtype:'numberfield',itemId:'prealarm',fieldLabel:_('Prealarm'),allowBlank:false,allowDecimals:false,minValue:0,value:2,enableKeyEvents:true,listeners:{keydown:onKeyDown,scope:me}}],buttons:[{text:_('No'),handler:function(){win.destroy();}},{text:_('Yes'),formBind:true,handler:handler}]});win=me.module.app.getDesktop().createWindow({title:_('Show countdown to next round?'),width:winWidth,height:winHeight,layout:'fit',minimizable:false,maximizable:false,items:[form],defaultFocus:'duration'});win.show();},updateActions:function(){var me=this,tourney=me.module.tourney,is_tbaaa=tourney.couplings==='all'&&tourney.TrainingBoards,pre=me.findActionById('show_pre_countdown'),nta=me.findActionById('new_turn'),fta=me.findActionById('final_turn'),clk=me.findActionById('show_countdown'),mtc=me.findActionById('print_matches'),pca=me.findActionById('print_cards'),res=me.findActionById('print_results'),all=me.findActionById('print_all_results'),save=me.findActionById('save'),restore=me.findActionById('restore'),stme=me.findActionById('send_training_match_emails'),lbar=me.child('toolbar[dock="left"]');pre.setDisabled(tourney.currentturn!=0&&(tourney.prized||tourney.readOnly||tourney.currentturn==tourney.rankedturn));pre.setHidden(tourney.prized||tourney.readOnly);if(is_tbaaa){nta.setDisabled(!tourney.participants);nta.setHidden(tourney.GeneratedTurns>0);}else{nta.setDisabled(!tourney.participants||(tourney.currentturn>0&&tourney.currentturn!=tourney.rankedturn));nta.setHidden(tourney.prized||tourney.readOnly||(tourney.system=='knockout'&&tourney.currentturn==Math.log2(tourney.participants)));}
fta.setDisabled(!tourney.participants||tourney.finalturns||(tourney.currentturn>0&&tourney.currentturn!=tourney.rankedturn));fta.setHidden(tourney.prized||!tourney.finals||tourney.readOnly||tourney.system==='knockout');clk.setDisabled(tourney.prized||tourney.readOnly||tourney.currentturn==tourney.rankedturn);clk.setHidden(tourney.prized||tourney.readOnly);mtc.setDisabled(tourney.currentturn==0);pca.setDisabled(tourney.currentturn==0);pca.setHidden(tourney.prized||tourney.readOnly);res.setDisabled(tourney.rankedturn==0);all.setDisabled(tourney.rankedturn==0);save.setHidden(tourney.prized||tourney.readOnly);restore.setHidden(tourney.prized||tourney.readOnly);stme.setDisabled(tourney.prized||tourney.readOnly||tourney.currentturn==tourney.rankedturn);lbar.cascade(function(btn){if(btn.xtype=='tbseparator'||btn.iconCls=='icon-cross'){btn.setVisible(!tourney.readOnly&&((!tourney.prized&&tourney.currentturn>0)||tourney.finalturns));}});},recomputeScores:function(field,newValue,oldValue){var me=this,total1=0,total2=0,columns=me.matchEditForm.child('container').query('container'),c1column=columns[0],c2column=columns[2],qcolumn=columns[1];for(var i=1;i<10;i++){var coins1=c1column.getComponent('coins1_'+i).getValue()||0,coins2=c2column.getComponent('coins2_'+i).getValue()||0,queen=qcolumn&&qcolumn.getComponent('queen_'+i).getValue();if(coins1&&coins2){Ext.Msg.alert(Ext.String.format(_('Result of board {0} is not valid'),i),_("Either one or the other player's coins must be equal to 0!"));break;}
if(coins1)
total1+=coins1;if(coins2)
total2+=coins2;if(coins1==0&&coins2==0){if(queen=='1')
total1+=total1<22?3:1;else if(queen=='2')
total2+=total2<22?3:1;}else{if(queen=='1'&&coins1>coins2&&total1<22)
total1+=3;else if(queen=='2'&&coins1<coins2&&total2<22)
total2+=3;}}
if(total1>25)total1=25;if(total2>25)total2=25;c1column.getComponent('score1').setValue(total1);c2column.getComponent('score2').setValue(total2);},recomputeAverages:function(field,newValue,oldValue){var me=this,nboards=me.module.tourney.TrainingBoards,total1=0,total2=0,columns=me.matchEditForm.child('container').query('container'),c1column=columns[0],c2column=columns[1],completed1=true,completed2=true,average1,average2;for(var i=1;i<=nboards;i++){var coins1=c1column.getComponent('coins1_'+i).getValue(),coins2=c2column.getComponent('coins2_'+i).getValue();if(completed1&&coins1===null){completed1=false;}
if(completed2&&coins2===null){completed2=false;}
if(coins1!==null){total1+=coins1;}
if(coins2!==null){total2+=coins2;}}
if(completed1){average1=total1/nboards;c1column.getComponent('avg1').setValue(average1);}
if(completed2){average2=total2/nboards;c2column.getComponent('avg2').setValue(average2);}
if(completed1&&completed2){var score1=Math.round(average2),score2=Math.round(average1);if(score1>25||score2>25){if(score1>score2){score1=25;if(score2>=score1){score2=24;}}else if(score1<score2){score2=25;if(score1>=score2){score1=24;}}else{score1=25;score2=25;}}
if(score1==score2&&total1!=total2){if(total1>total2){if(score1>0){score1-=1;}else{score2+=1;}}else{if(score2>0){score2-=1;}else{score1+=1;}}}
c1column.getComponent('score1').setValue(score1);c2column.getComponent('score2').setValue(score2);}},showEditMatchWindow:function(record){var me=this,desktop=me.module.app.getDesktop(),win=desktop.getWindow('edit-match-win');if(win){win.destroy();}
var metadata=me.module.matches_grid.metadata,tourney=me.module.tourney,trainingboards=tourney.TrainingBoards,size=desktop.getReasonableWindowSize(trainingboards?400:600,150),editors=metadata.editors({'*':{editor:MP.form.Panel.getDefaultEditorSettingsFunction('100%')}}),column1=[],column2=trainingboards?null:[],column3=[],tabindex=1,is_tbaaa=tourney.couplings==='all'&&tourney.TrainingBoards,disabled=(!is_tbaaa&&me.filteredTurn)||tourney.prized||tourney.readOnly,form;for(var i=1;i<=(trainingboards||9);i++){var c1=editors['coins1_'+i],c2=editors['coins2_'+i],q;if(c1&&c2){if(!trainingboards){q=editors['queen_'+i];if(i>1&&q)
q.plugins=[];}
if(i>1){c1.plugins=[];c2.plugins=[];size.height+=35;}else{size.height+=60;}
c1.itemId='coins1_'+i;c1.tabIndex=tabindex++;c1.disabled=disabled;column1.push(c1);if(!trainingboards){q.itemId='queen_'+i;q.tabIndex=tabindex++;q.disabled=disabled;column2.push(q);}
c2.itemId='coins2_'+i;if(!trainingboards){c2.tabIndex=tabindex++;}else{c2.tabIndex=tabindex+trainingboards;}
c2.disabled=disabled;column3.push(c2);c1.listeners={change:{fn:trainingboards?me.recomputeAverages:me.recomputeScores,scope:me}};c2.listeners={change:{fn:trainingboards?me.recomputeAverages:me.recomputeScores,scope:me}};if(!trainingboards)
q.listeners={change:{fn:me.recomputeScores,scope:me}};}else break;}
if(trainingboards){size.height+=35;column1.push({xtype:'displayfield',fieldLabel:_('A1'),itemId:'avg1',value:'—'});column3.push({xtype:'displayfield',fieldLabel:_('A2'),itemId:'avg2',value:'—'});tabindex+=trainingboards+1;}
editors.score1.tabIndex=tabindex++;editors.score2.tabIndex=tabindex++;editors.score1.itemId='score1';editors.score2.itemId='score2';editors.score1.disabled=disabled;editors.score2.disabled=disabled;column1.push(editors.score1);column3.push(editors.score2);form=Ext.create('MP.form.Panel',{autoScroll:true,fieldDefaults:{labelWidth:40,margin:'15 10 0 10'},items:[{xtype:'container',layout:'hbox',items:[{xtype:'container',layout:'anchor',flex:1,items:column1},column2!==null?{xtype:'container',layout:'anchor',width:210,items:column2}:null,{xtype:'container',layout:'anchor',flex:1,items:column3}]}],buttons:[{text:_('Cancel'),handler:function(){win.close();}},!disabled?{text:_('Confirm'),formBind:true,handler:function(){if(disabled){win.close();}else if(form.isValid()){form.updateRecord(record);win.close();Ext.create("MP.window.Notification",{position:'t',width:260,title:_('Changes have been applied…'),html:_('Your changes have been applied <strong>locally</strong>.<br/><br/>To make them permanent you must click on the <blink>Save</blink> button.'),iconCls:'info-icon'}).show();}}}:null]});me.matchEditForm=form;win=desktop.createWindow({id:'edit-match-win',title:record.get('description'),iconCls:me.module.iconCls,width:size.width,height:size.height,modal:true,items:form,closable:false,minimizable:false,maximizable:false,resizable:false});form.loadRecord(record);win.show();}});Ext.define('SoL.view.Ranking.Actions',{extend:'MP.action.Plugin',uses:['Ext.Action'],statics:{BY_NATIONALITY_ACTION:'by_nationality',PRINT_RANKING_ACTION:'print_ranking',PRINT_NATIONAL_RANKING_ACTION:'print_national_ranking',PRINT_WOMEN_RANKING_ACTION:'print_women_ranking',PRINT_UNDER_RANKING_ACTION:'print_under_ranking',PRINT_FINAL_BADGES_ACTION:'print_final_badges',PRINT_FINAL_CARDS_ACTION:'print_final_cards',PRIZE_GIVING_ACTION:'prize_giving'},initActions:function(){var me=this,ids=me.statics(),tourney=me.module.tourney,tprized=tourney.prized;me.callParent();me.byNationalityAction=me.addAction(new Ext.Action({itemId:ids.BY_NATIONALITY_ACTION,text:_('By nationality'),tooltip:_("Toggle between normal ranking and grouped by competitor's nationality."),iconCls:'toggle-by-nation-icon',handler:function(){me.component.toggleView(me.byNationalityAction);}}));me.printRankingAction=me.addAction(new Ext.Action({itemId:ids.PRINT_RANKING_ACTION,text:_('Ranking'),tooltip:_('Print current ranking.'),iconCls:'print-icon',handler:function(){var turn=me.component.store.proxy.extraParams.turn,url='/pdf/ranking/'+tourney.idtourney;if(turn)url+='?turn='+turn;window.location.assign(url);}}));me.printNationalRankingAction=me.addAction(new Ext.Action({itemId:ids.PRINT_NATIONAL_RANKING_ACTION,text:_('National ranking'),tooltip:_('Print current national ranking.'),iconCls:'print-icon',handler:function(){var turn=me.component.store.proxy.extraParams.turn,url='/pdf/nationalranking/'+tourney.idtourney;if(turn)url+='?turn='+turn;window.location.assign(url);}}));me.printWomenRankingAction=me.addAction(new Ext.Action({itemId:ids.PRINT_WOMEN_RANKING_ACTION,text:_('Women ranking'),tooltip:_('Print women ranking.'),iconCls:'print-icon',handler:function(){var turn=me.component.store.proxy.extraParams.turn,url='/pdf/womenranking/'+tourney.idtourney;if(turn)url+='?turn='+turn;window.location.assign(url);}}));me.printUnderRankingAction=me.addAction(new Ext.Action({itemId:ids.PRINT_UNDER_RANKING_ACTION,text:_('Junior ranking'),tooltip:_('Print junior ranking.'),iconCls:'print-icon',handler:function(){var turn=me.component.store.proxy.extraParams.turn;me.component.printUnderRanking(turn);}}));me.printFinalBadgesAction=me.addAction(new Ext.Action({itemId:ids.PRINT_FINAL_BADGES_ACTION,text:_('Badges'),tooltip:_('Print final badges with ranking and matches.'),iconCls:'print-icon',hidden:!tprized,handler:function(){var url='/pdf/badges/'+tourney.idtourney;window.location.assign(url);}}));me.printFinalCardsAction=me.addAction(new Ext.Action({itemId:ids.PRINT_FINAL_CARDS_ACTION,text:_('Finals'),tooltip:_('Print 1st/2nd and 3rd/4th place finals scorecards.'),iconCls:'print-icon',hidden:!tprized&&tourney.finals===null,handler:function(){var url='/pdf/scorecards/'+tourney.idtourney;window.location.assign(url);}}));me.prizegivingAction=this.addAction(new Ext.Action({itemId:ids.PRIZE_GIVING_ACTION,text:tprized?_('Reset prizes'):_('Assign prizes'),hidden:tourney.readOnly,tooltip:tprized?_('Reset assigned final prizes.'):_('Assign final prizes.'),iconCls:'prize-giving-icon',handler:function(){Ext.Ajax.request({url:tprized?'/tourney/resetPrizes':'/tourney/assignPrizes',params:{idtourney:tourney.idtourney},success:function(r){var res=Ext.decode(r.responseText);if(!res){Ext.MessageBox.alert(_("Comunication error"),_('Cannot decode JSON object'));}else{if(res.success){tourney.currentturn=res.currentturn;tourney.rankedturn=res.rankedturn;tourney.prized=tprized=res.prized;me.component.store.reload();if(tprized){me.component.setWidth(500);me.prizegivingAction.setText(_('Reset prizes'));me.prizegivingAction.callEach('setTooltip',[_('Reset assigned final prizes.')]);}else{me.component.setWidth(me.component.initialConfig.width);me.prizegivingAction.setText(_('Assign prizes'));me.prizegivingAction.callEach('setTooltip',[_('Assign final prizes.')]);}}else{Ext.MessageBox.alert(_('Error'),res.message);}}}});}}));},attachActions:function(){var me=this;me.callParent();var tbar=me.component.child('#ttoolbar');tbar.add(0,me.printFinalCardsAction,me.printFinalBadgesAction,me.printRankingAction,{text:_('Other…'),iconCls:'print-icon',menu:{items:[me.printNationalRankingAction,me.printWomenRankingAction,me.printUnderRankingAction]}});if(!me.module.tourney.finals)
me.component.addDocked({xtype:'toolbar',dock:'bottom',items:['->',me.prizegivingAction]});}});Ext.define('SoL.view.Ranking',{extend:'MP.grid.Panel',uses:['SoL.view.Matches'],alias:'widget.ranking-grid',clicksToEdit:1,statics:{getConfig:function(callback,errorcb,config){var me=this,ordinal=SoL.view.Matches.ordinal,cfg=config.Ranking={dataURL:'/tourney/ranking',header:true,layout:'fit',noAddAndDelete:true,noBottomToolbar:true,noFilterbar:true,pageSize:999,plugins:[Ext.create('SoL.view.Ranking.Actions',{module:me})],remoteSort:false,saveChangesURL:'/bio/saveChanges',title:(config.tourney.rankedturn===0?_('Ranking'):(config.tourney.prized?_('Final ranking'):Ext.String.format(_('Ranking after {0} round'),ordinal(config.tourney.rankedturn)))),xtype:'ranking-grid'};MP.data.MetaData.fetch(cfg.dataURL,me,function(metadata){var overrides={prize:{hidden:!config.tourney.prized,editor:{hideTrigger:true}}};Ext.apply(cfg,{metadata:metadata,fields:metadata.fields(overrides),columns:metadata.columns(overrides),idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,rootProperty:metadata.root_slot});callback(cfg);});}},initEvents:function(){var me=this,module=me.module,tourney=module.tourney,ordinal=SoL.view.Matches.ordinal,normal_sorters=[{property:'prize',direction:'DESC'},{property:'points',direction:'DESC'},{property:'bucholz',direction:'DESC'},{property:'netscore',direction:'DESC'},{property:'totscore',direction:'DESC'},{property:'position',direction:'ASC'},{property:'rate',direction:'DESC'},{property:'description',direction:'ASC'}],newturn_sorters=[{property:'prize',direction:'DESC'},{property:'points',direction:'DESC'},{property:'bucholz',direction:'DESC'},{property:'position',direction:'ASC'},{property:'rate',direction:'DESC'},{property:'netscore',direction:'DESC'},{property:'totscore',direction:'DESC'},{property:'description',direction:'ASC'}];me.callParent();me.on('itemdblclick',module.togglePlayerDetail,module);me.on('beforeedit',function(){return!tourney.readOnly&&tourney.prized;});me.store.on('load',function(store){var pcol=me.getColumnByName('prize'),turn=me.store.proxy.extraParams.turn;if(tourney.prized&&!turn){pcol.show();}else{pcol.hide();}
if(turn){if(turn<=tourney.delaytoppairing){me.setTitle(Ext.String.format(_('Ranking used to compute {0} round'),ordinal(turn+1)));newturn_sorters=store.sort(newturn_sorters);}else{me.setTitle(Ext.String.format(_('Ranking after {0} round'),ordinal(turn)));normal_sorters=store.sort(normal_sorters);}}else{me.setTitle((tourney.rankedturn===0?_('Ranking'):(tourney.prized?_('Final ranking'):Ext.String.format(_('Ranking after {0} round'),ordinal(tourney.rankedturn)))));normal_sorters=store.sort(normal_sorters);}});Ext.tip.QuickTipManager.register({target:me.getView().getId(),text:_('Double click on a player to view his matches.'),width:200,dismissDelay:3000});},toggleView:function(action){var me=this,view=me.view,feature=view.getFeature('bynationgrouping');if(feature.disabled){feature.enable();action.setText(_('By nationality'));}else{feature.disable();action.setText(_('Normal'));}},printUnderRanking:function(turn){var me=this,tourney=me.module.tourney,url='/pdf/underranking/'+tourney.idtourney,win,form,winWidth=215,winHeight=110;var handler=function(){var frm=form.getForm();if(frm.isValid()){var age=frm.getFields().items[0].getValue();url+='?age='+age;if(turn)
url+='&turn='+turn;win.destroy();window.location.assign(url);}};var onKeyDown=function(field,event){if(event.keyCode===event.RETURN||event.keyCode===10){handler();}};form=new Ext.form.Panel({frame:true,bodyPadding:'10 10 0',defaults:{labelWidth:50,anchor:'100%'},items:[{xtype:'numberfield',itemId:'age',increment:3,allowBlank:false,minValue:5,maxValue:99,value:18,enableKeyEvents:true,listeners:{keydown:onKeyDown,scope:me}}],buttons:[{text:_('Cancel'),handler:function(){win.destroy();}},{text:_('Confirm'),formBind:true,handler:handler}]});win=me.module.app.getDesktop().createWindow({title:_('Maximum age'),width:winWidth,height:winHeight,layout:'fit',minimizable:false,maximizable:false,items:[form],defaultFocus:'age'});win.show();}});Ext.define('SoL.module.RatedPlayers.Actions',{extend:'MP.action.StoreAware',uses:['Ext.Action'],statics:{SHOW_CHART_ACTION:'show_chart',SHOW_RANKING_ACTION:'show_ranking'},initActions:function(){var me=this,ids=me.statics();me.callParent();me.showChart=me.addAction(new Ext.Action({itemId:ids.SHOW_CHART_ACTION,text:_('Chart'),tooltip:_('Show the rating chart of selected players.'),iconCls:'rating-chart-icon',needsSelectedRow:true,disabled:true,handler:function(){var idrating=me.module.idrating,sels=me.component.getSelectionModel().getSelection(),players=[],desktop=me.module.app.getDesktop();for(var i=0,l=sels.length;i<l;i++){var id=sels[i].get('idplayer');players.push(id);}
var url='/svg/ratingchart/'+idrating+'?'+Ext.Object.toQueryString({idplayer:players,width:Math.floor(desktop.getWidth()*0.8),height:Math.floor(desktop.getHeight()*0.8)});window.open(url,"_blank");}}));me.showRanking=me.addAction(new Ext.Action({itemId:ids.SHOW_RANKING_ACTION,text:_('Print'),tooltip:_('Print this rating ranking.'),iconCls:'print-icon',handler:function(){var idrating=me.module.idrating,url='/pdf/ratingranking/'+idrating;window.open(url,"_blank");}}));},attachActions:function(){var me=this;me.callParent();var tbar=me.component.child('#ttoolbar');tbar.add(2,' ',me.showChart,me.showRanking);}});Ext.define('SoL.module.RatedPlayers',{extend:'MP.desktop.Module',requires:['MP.grid.Panel'],uses:['SoL.module.RatedPlayers.Actions','SoL.window.Help'],id:'rated-players-win',iconCls:'rated-players-icon',launcherText:null,launcherTooltip:function(){return _('Players rates.');},config:{xtype:'basic-grid',pageSize:14,readOnly:true,dataURL:'/data/ratedPlayers',sorters:[{property:'rate',direction:'DESC'}],stripeRows:true,selType:'checkboxmodel'},getConfig:function(callback){var me=this,cfg=me.config;if(!cfg.metadata){MP.data.MetaData.fetch(cfg.dataURL,me,function(metadata){var overrides={nationality:{renderer:SoL.form.field.FlagsCombo.renderer}};Ext.apply(cfg,{metadata:metadata,fields:metadata.fields(overrides),columns:metadata.columns(overrides,false),idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,rootProperty:metadata.root_slot,plugins:[Ext.create('SoL.module.RatedPlayers.Actions',{module:me})]});callback(cfg);me.app.on('logout',function(){delete cfg.metadata;},me,{single:true});});}else{callback(cfg);}},createOrShowWindow:function(idrating,rating){var me=this,config=me.config,desktop=me.app.getDesktop(),win=desktop.getWindow(me.id);if(win){win.destroy();}
me.idrating=idrating;me.configure([me.getConfig],function(done){var size=desktop.getReasonableWindowSize(690,421,"SE");config=Ext.apply({stickyFilters:[{property:'idrating',value:idrating,operator:'='}]},config);win=desktop.createWindow({id:me.id,title:Ext.String.format(_('Players in rating “{0}”'),rating),taskbuttonTooltip:me.getLauncherTooltip(),iconCls:me.iconCls,items:[config],x:size.x,y:size.y,width:size.width,height:size.height,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640),wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/playersrates.html'),title:_('Help on rated players window')});wh.show();}}]});win.child('basic-grid').store.load({params:{start:0,limit:me.pageSize},callback:function(){win.on({show:done,single:true});win.show();}});});}});Ext.define('SoL.module.Competitors',{extend:'MP.desktop.Module',requires:['MP.grid.Panel','SoL.window.Help'],id:'competitors-win',iconCls:'edit-user-icon',launcherText:null,launcherTooltip:function(){return _("Tourney competitors management.");},config:{xtype:'editable-grid',pageSize:14,dataURL:'/tourney/competitors',saveChangesURL:'/bio/saveChanges',noAddAndDelete:true,remoteSort:false,sorters:['player1FullName'],stripeRows:true},getConfig:function(callback,errorcb,config){var me=this;var cfg=me.config;if(!cfg.metadata){MP.data.MetaData.fetch(cfg.dataURL,me,function(metadata){var overrides={retired:{hidden:true,readonly:true},player1Nationality:{renderer:SoL.form.field.FlagsCombo.renderer},player1FullName:{flex:1},player2FullName:function(){return{flex:1,hidden:config.playersperteam<2};},player3FullName:function(){return{flex:1,hidden:config.playersperteam<3};},player4FullName:function(){return{flex:1,hidden:config.playersperteam<4};},'*':{editor:function(finfo){var c={};if(finfo.name.substr(7)!=='FullName'&&finfo.name!=='position')
c.readonly=true;return c;}}};var columns=metadata.columns(overrides).filter(function(c){return c.dataIndex!='player1Country';});Ext.apply(cfg,{fields:metadata.fields(overrides),columns:columns,idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,rootProperty:metadata.root_slot});callback(cfg);me.app.on('logout',function(){delete cfg.metadata;},me,{single:true});});}else{callback(cfg);}},createOrShowWindow:function(idtourney,tourney,date,championship,playersperteam){var me=this,config=me.config,desktop=me.app.getDesktop(),win=desktop.getWindow(me.id);if(win){win.destroy();}
me.configure([me.getConfig],function(done){var size=desktop.getReasonableWindowSize(650,447,"NE");config=Ext.apply({stickyFilters:[{property:'idtourney',value:idtourney,operator:'='}]},config);win=desktop.createWindow({id:me.id,title:Ext.String.format(_('Competitors of tourney “{0}” ({1}), {2}'),tourney,championship,MP.data.MetaData.renderDate(date)),taskbuttonTooltip:me.getLauncherTooltip(),iconCls:me.iconCls,items:[config],x:size.x,y:size.y,width:size.width,height:size.height,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640);var wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/competitors.html'),title:_('Help on competitors management')});wh.show();}}]});win.child('editable-grid').store.load({params:{start:0,limit:me.pageSize},callback:function(){win.on({show:done,single:true});win.show();}});},{playersperteam:playersperteam});}});Ext.define('SoL.module.ClubUsers',{extend:'MP.desktop.Module',requires:['MP.grid.Panel'],uses:['Ext.grid.column.CheckColumn','SoL.window.Help'],id:'clubusers-win',iconCls:'users-icon',launcherText:null,launcherTooltip:function(){return _('<b>Club\'s users</b><br />Basic club-users association management.');},config:{xtype:'editable-grid',pageSize:14,noAddAndDelete:true,clicksToEdit:1,dataURL:'/data/clubUsers',sorters:[{property:'associated',direction:'DESC'},{property:'lastname',direction:'ASC'},{property:'firstname',direction:'ASC'}],stripeRows:true},getConfig:function(callback){var me=this,cfg=me.config;if(!cfg.metadata){MP.data.MetaData.fetch(cfg.dataURL,me,function(metadata){var overrides={},fields=metadata.fields(overrides);Ext.apply(cfg,{metadata:metadata,fields:fields,columns:metadata.columns(overrides,true),idProperty:metadata.primary_key,totalProperty:metadata.count_slot,successProperty:metadata.success_slot,rootProperty:metadata.root_slot});callback(cfg);me.app.on('logout',function(){delete cfg.metadata;},me,{single:true});});}else{callback(cfg);}},createOrShowWindow:function(idclub,club){var me=this,config=me.config,desktop=me.app.getDesktop(),win=desktop.getWindow(me.id);if(win){win.destroy();}
me.configure([me.getConfig],function(done){var size=desktop.getReasonableWindowSize(780,421,"C");config=Ext.apply({extraParams:{idclub:idclub},saveChangesURL:config.dataURL+'?idclub='+idclub},config);win=desktop.createWindow({id:me.id,title:Ext.String.format(_('Users associated with club {0}'),club),taskbuttonTooltip:me.getLauncherTooltip(),iconCls:me.iconCls,items:[config],x:size.x,y:size.y,width:size.width,height:size.height,tools:[{type:'help',tooltip:_('Show user manual section.'),callback:function(){var whsize=desktop.getReasonableWindowSize(800,640);var wh=Ext.create('SoL.window.Help',{width:whsize.width,height:whsize.height,help_url:_('/static/manual/en/clubusers.html'),title:_('Help on club\'s users management')});wh.show();}}]});var grid=win.child('editable-grid');grid.store.load({params:{start:0,limit:me.pageSize},callback:function(){win.on({show:done,single:true});win.show();}});});}});Ext.define('SoL.view.Tourney',{requires:['SoL.view.Boards','SoL.view.Competitors','SoL.view.Matches','SoL.view.Ranking'],statics:{configurators:function(){return[SoL.view.Boards.getConfig,SoL.view.Competitors.getConfig,SoL.view.Matches.getConfig,SoL.view.Ranking.getConfig];}}});