Fix #7284 - more issues with bullet point detection
[roojs1] / roojs-bootstrap.js
1 // Roo/bootstrap/namespace.js
2 Roo.bootstrap={};
3 // Roo/bootstrap/version.js
4 Roo.bootstrap.version=(function(){var A=3;Roo.each(document.styleSheets,function(s){if(s.href&&s.href.match(/css-bootstrap4/)){A=4;}});if(A>3){Roo.Element.prototype.visibilityMode=Roo.Element.DISPLAY;}return A;})();
5 // Roo/bootstrap/menu/namespace.js
6 Roo.bootstrap.menu=Roo.bootstrap.menu||{};
7 // Roo/bootstrap/nav/namespace.js
8 Roo.bootstrap.nav={};
9 // Roo/bootstrap/form/namespace.js
10 Roo.bootstrap.form={};
11 // Roo/bootstrap/panel/namespace.js
12 Roo.bootstrap.panel={};
13 // Roo/bootstrap/layout/namespace.js
14 Roo.bootstrap.layout={};
15 // Roo/Shadow.js
16 Roo.Shadow=function(A){Roo.apply(this,A);if(typeof this.mode!="string"){this.mode=this.defaultMode;}var o=this.offset,a={h:0};var B=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case "drop":a.w=0;a.l=a.t=o;a.t-=1;if(Roo.isIE){a.l-=this.offset+B;
17 a.t-=this.offset+B;a.w-=B;a.h-=B;a.t+=1;}break;case "sides":a.w=(o*2);a.l=-o;a.t=o-1;if(Roo.isIE){a.l-=(this.offset-B);a.t-=this.offset+B;a.l+=1;a.w-=(this.offset-B)*2;a.w-=B+1;a.h-=1;}break;case "frame":a.w=a.h=(o*2);a.l=a.t=-o;a.t+=1;a.h-=2;if(Roo.isIE){a.l-=(this.offset-B);
18 a.t-=(this.offset-B);a.l+=1;a.w-=(this.offset+B+1);a.h-=(this.offset+B);a.h+=1;}break;};this.adjusts=a;};Roo.Shadow.prototype={mode:false,offset:4,defaultMode:"drop",show:function(A){A=Roo.get(A);if(!this.el){this.el=Roo.Shadow.Pool.pull();if(this.el.dom.nextSibling!=A.dom){this.el.insertBefore(A);
19 }}this.el.setStyle("z-index",this.zIndex||parseInt(A.getStyle("z-index"),10)-1);if(Roo.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")";}this.realign(A.getLeft(true),A.getTop(true),A.getWidth(),A.getHeight());
20 this.el.dom.style.display="block";},isVisible:function(){return this.el?true:false;},realign:function(l,t,w,h){if(!this.el){return;}var a=this.adjusts,d=this.el.dom,s=d.style;var A=0;s.left=(l+a.l)+"px";s.top=(t+a.t)+"px";var sw=(w+a.w),sh=(h+a.h),B=sw+"px",C=sh+"px";
21 if(s.width!=B||s.height!=C){s.width=B;s.height=C;if(!Roo.isIE){var cn=d.childNodes;var D=Math.max(0,(sw-12))+"px";cn[0].childNodes[1].style.width=D;cn[1].childNodes[1].style.width=D;cn[2].childNodes[1].style.width=D;cn[1].style.height=Math.max(0,(sh-12))+"px";
22 }}},hide:function(){if(this.el){this.el.dom.style.display="none";Roo.Shadow.Pool.push(this.el);delete this.el;}},setZIndex:function(z){this.zIndex=z;if(this.el){this.el.setStyle("z-index",z);}}};Roo.Shadow.Pool=function(){var p=[];var A=Roo.isIE?'<div class="x-ie-shadow"></div>':'<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';
23 return {pull:function(){var sh=p.shift();if(!sh){sh=Roo.get(Roo.DomHelper.insertHtml("beforeBegin",document.body.firstChild,A));sh.autoBoxAdjust=false;}return sh;},push:function(sh){p.push(sh);}};}();
24 // Roo/bootstrap/Component.js
25 Roo.bootstrap=Roo.bootstrap||{};Roo.bootstrap.Component=function(A){Roo.bootstrap.Component.superclass.constructor.call(this,A);this.addEvents({"childrenrendered":true});};Roo.extend(Roo.bootstrap.Component,Roo.BoxComponent,{allowDomMove:false,cls:false,style:false,autoCreate:false,tooltip:null,initEvents:function(){}
26 ,xattr:false,parentId:false,can_build_overlaid:true,container_method:false,dataId:false,name:false,parent:function(){return Roo.ComponentMgr.get(this.parentId)},onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A);if(this.el){if(this.el.attr('xtype')){this.el.attr('xtypex',this.el.attr('xtype'));
27 this.el.dom.removeAttribute('xtype');this.initEvents();}return;}var B=Roo.apply({},this.getAutoCreate());B.id=this.id||Roo.id();if(this.xattr&&typeof(this.xattr)=='object'){for(var i in this.xattr){B[i]=this.xattr[i];}}if(this.dataId){B.dataId=this.dataId;
28 }if(this.cls){B.cls=(typeof(B.cls)=='undefined'?this.cls:B.cls)+' '+this.cls;}if(this.style){B.style=(typeof(B.style)=='undefined'?this.style:B.style)+'; '+this.style;}if(this.name){B.name=this.name;}this.el=ct.createChild(B,A);if(this.tooltip){this.tooltipEl().attr('tooltip',this.tooltip);
29 }if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);}this.initEvents();},getChildContainer:function(){return this.el;},getDocumentBody:function(){return Roo.get(document.body);},tooltipEl:function(){return this.el;},addxtype:function(A,B){var cn=this;
30 cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;B=(typeof(B)=='undefined')?'getChildContainer':B;if(typeof(cn.container_method)=='string'){B=cn.container_method;}var C=(typeof(A['flexy:foreach'])!='undefined');var D=(typeof(A['flexy:if'])!='undefined');
31 var E=Roo.XComponent.build_from_html;var F=(A.xtype=='Body');var G=(Roo.get(document.body).attr('xtype')=='Roo.bootstrap.Body');var H=Roo.get(this[B](false));if((C||D||this.can_build_overlaid==false)&&E){return false;}if(!C||!E||F||!G){if(!D||typeof(A.name)=='undefined'||!E||F||!G){return this.addxtypeChild(A,B,F);
32 }var I=H?H.child('>*[name='+A.name+']'):false;if(I){return this.addxtypeChild(Roo.apply({},A),B);}Roo.log('skipping render');return cn;}var J=false;if(!E){return false;}while(true){var I=H?H.child('>*[xtype]'):false;if(!I){break;}if(I&&I.attr('xtype').split('.').pop()!=cn.xtype){break;
33 }J=this.addxtypeChild(Roo.apply({},A),B);}return J;},addxtypeChild:function(A,B,C){Roo.debug&&Roo.log('addxtypeChild:'+B);var cn=this;B=(typeof(B)=='undefined')?'getChildContainer':B;var D=(typeof(A['flexy:if'])!='undefined')||(typeof(A['flexy:foreach'])!='undefined');
34 skip_children=false;if(!C){if(!this[B](true)){A.items=[];return A;}cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;var E=Roo.XComponent.build_from_html;if(E&&Roo.get(document.body).attr('xtype')=='Roo.bootstrap.Body'){var F=Roo.get(this[B](false));
35 var G=F?F.child('>*[xtype]'):false;if(G){}if(G&&G.attr('xtype').split('.').pop()==cn.xtype){cn.el=G;}else{Roo.debug&&Roo.log("MISSING "+cn.xtype+" on child of "+(this.el?this.el.attr('xbuilderid'):'no parent'));Roo.debug&&Roo.log(F);Roo.debug&&Roo.log(G);
36 Roo.debug&&Roo.log(cn);}}if(E&&D&&!cn.el&&cn.can_build_overlaid){Roo.debug&&Roo.log('skipping render');Roo.debug&&Roo.log(A);if(!cn.el){Roo.debug&&Roo.log('skipping all children');skip_children=true;}}else{cn.render&&cn.render(this[B](true));}}var H=[];if(!A.items||!A.items.length){cn.items=H;
37 return cn;}var I=A.items;delete A.items;if(!skip_children){for(var i=0;i<I.length;i++){H.push(cn.addxtype(Roo.apply({},I[i])));}}cn.items=H;cn.fireEvent('childrenrendered',this);return cn;},setVisibilityEl:function(el){this.visibilityEl=el;},getVisibilityEl:function(){if(typeof(this.visibilityEl)=='object'){return this.visibilityEl;
38 }if(typeof(this.visibilityEl)=='string'){return this.visibilityEl=='parent'?this.parent().getEl():this.getEl();}return this.getEl();},show:function(){if(!this.getVisibilityEl()){return;}this.getVisibilityEl().removeClass(['hidden','d-none']);this.fireEvent('show',this);
39 },hide:function(){if(!this.getVisibilityEl()){return;}this.getVisibilityEl().addClass(['hidden','d-none']);this.fireEvent('hide',this);}});
40 // Roo/bootstrap/Element.js
41 Roo.bootstrap.Element=function(A){Roo.bootstrap.Element.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.Element,Roo.bootstrap.Component,{tag:'div',cls:'',html:'',preventDefault:false,clickable:false,tapedTwice:false,role:false,getAutoCreate:function(){var A={tag:this.tag,html:this.html}
42 ;if(this.role!==false){A.role=this.role;}return A;},initEvents:function(){Roo.bootstrap.Element.superclass.initEvents.call(this);if(this.clickable){this.el.on('click',this.onClick,this);}},onClick:function(e){if(this.preventDefault){e.preventDefault();}this.fireEvent('click',this,e);
43 },getValue:function(){return this.el.dom.innerHTML;},setValue:function(A){this.el.dom.innerHTML=A;}});
44 // Roo/bootstrap/DropTarget.js
45 Roo.bootstrap.DropTarget=function(A){Roo.bootstrap.DropTarget.superclass.constructor.call(this,A);this.addEvents({"drop":true});};Roo.extend(Roo.bootstrap.DropTarget,Roo.bootstrap.Element,{getAutoCreate:function(){},initEvents:function(){Roo.bootstrap.DropTarget.superclass.initEvents.call(this);
46 this.dropZone=new Roo.dd.DropTarget(this.getEl(),{ddGroup:this.name,listeners:{drop:this.dragDrop.createDelegate(this),enter:this.dragEnter.createDelegate(this),out:this.dragOut.createDelegate(this),over:this.dragOver.createDelegate(this)}});this.dropZone.DDM.useCache=false}
47 ,dragDrop:function(A,e,B){Roo.log('drop');Roo.log(this);return false;},dragEnter:function(n,dd,e,A){Roo.log("enter");this.originalSize=this.el.getSize();this.el.setSize(n.el.getSize());this.dropZone.DDM.refreshCache(this.name);Roo.log([n,dd,e,A]);},dragOut:function(A){Roo.log("out");
48 this.el.setSize(this.originalSize);this.dropZone.resetConstraints();},dragOver:function(){}});
49 // Roo/bootstrap/Body.js
50 Roo.bootstrap.Body=function(A){A=A||{};Roo.bootstrap.Body.superclass.constructor.call(this,A);this.el=Roo.get(A.el?A.el:document.body);if(this.cls&&this.cls.length){Roo.get(document.body).addClass(this.cls);}};Roo.extend(Roo.bootstrap.Body,Roo.bootstrap.Component,{is_body:true,autoCreate:{cls:'container'}
51 ,onRender:function(ct,A){}});
52 // Roo/bootstrap/ButtonGroup.js
53 Roo.bootstrap.ButtonGroup=function(A){Roo.bootstrap.ButtonGroup.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.ButtonGroup,Roo.bootstrap.Component,{size:'',align:'',direction:'',toolbar:false,btn:true,getAutoCreate:function(){var A={cls:'btn-group',html:null}
54 ;A.html=this.html||A.html;if(this.toolbar){A={cls:'btn-toolbar',html:null};return A;}if(['vertical','justified'].indexOf(this.align)!==-1){A.cls='btn-group-'+this.align;if(this.align=='justified'){console.log(this.items);}}if(['lg','sm','xs'].indexOf(this.size)!==-1){A.cls+=' btn-group-'+this.size;
55 }if(this.direction=='up'){A.cls+=' dropup';}return A;},addItem:function(A){var cn=new Roo.bootstrap.Button(A);cn.parentId=this.id;cn.onRender(this.el,null);return cn;}});
56 // Roo/bootstrap/Button.js
57 Roo.bootstrap.Button=function(A){Roo.bootstrap.Button.superclass.constructor.call(this,A);this.addEvents({"click":true,"dblclick":true,"toggle":true});};Roo.extend(Roo.bootstrap.Button,Roo.bootstrap.Component,{html:false,active:false,weight:'',badge_weight:'',outline:false,size:'',tag:'button',href:'',disabled:false,isClose:false,glyphicon:'',fa:'',badge:'',theme:'default',inverse:false,toggle:false,ontext:'ON',offtext:'OFF',defaulton:true,preventDefault:true,removeClass:false,name:false,target:false,group:false,pressed:null,getAutoCreate:function(){var A={tag:'button',cls:'roo-button',html:''}
58 ;if(['a','button','input','submit'].indexOf(this.tag)<0){throw "Invalid value for tag: "+this.tag+". must be a, button, input or submit.";this.tag='button';}else{A.tag=this.tag;}A.html='<span class="roo-button-text">'+(this.html||A.html)+'</span>';if(this.toggle==true){A={tag:'div',cls:'slider-frame roo-button',cn:[{tag:'span','data-on-text':'ON','data-off-text':'OFF',cls:'slider-button',html:this.offtext}
59 ]};if(Roo.bootstrap.Button.weights.indexOf(this.weight)>-1){A.cls+=' '+this.weight;}return A;}if(this.isClose){A.cls+=' close';A["aria-hidden"]=true;A.html="&times;";return A;}if(this.theme==='default'){A.cls='btn roo-button';this.weight=this.weight.length?this.weight:'default';
60 if(Roo.bootstrap.Button.weights.indexOf(this.weight)>-1){var B=this.outline||this.weight=='default'?'outline-':'';var C=this.weight=='default'?'secondary':this.weight;A.cls+=' btn-'+B+C;if(this.weight=='default'){A.cls+=' btn-'+this.weight;}}}else if(this.theme==='glow'){A.tag='a';
61 A.cls='btn-glow roo-button';if(Roo.bootstrap.Button.weights.indexOf(this.weight)>-1){A.cls+=' '+this.weight;}}if(this.inverse){this.cls+=' inverse';}if(this.active||this.pressed===true){A.cls+=' active';}if(this.disabled){A.disabled='disabled';}if(this.items){Roo.log('changing to ul');
62 A.tag='ul';this.glyphicon='caret';if(Roo.bootstrap.version==4){this.fa='caret-down';}}A.cls+=this.size.length?(' btn-'+this.size):'';if(this.parentType==='Navbar'&&!this.parent().bar){Roo.log('changing to li?');A.tag='li';A.cls='';A.cn=[{tag:'a',cls:'roo-button',html:this.html,href:this.href||'#'}
63 ];if(this.menu){A.cn[0].html=this.html+' <span class="caret"></span>';A.cls+=' dropdown';}delete A.html;}A.cls+=this.parentType==='Navbar'?' navbar-btn':'';if(this.glyphicon){A.html=' '+A.html;A.cn=[{tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon}];
64 }if(this.fa){A.html=' '+A.html;A.cn=[{tag:'i',cls:'fa fas fa-'+this.fa}];}if(this.badge){A.html+=' ';A.tag='a';A.href=this.href;var D=A.html;if(this.glyphicon){D={tag:'span',cls:'glyphicon glyphicon-'+this.glyphicon,html:this.html};}if(this.fa){D={tag:'i',cls:'fa fas fa-'+this.fa,html:this.html}
65 ;}var bw=this.badge_weight.length?this.badge_weight:(this.weight.length?this.weight:'secondary');bw=bw=='default'?'secondary':bw;A.cn=[D,{tag:'span',cls:'badge badge-'+bw,html:this.badge}];A.html='';}if(this.menu){A.cls+=' dropdown';A.html=typeof(A.html)!='undefined'?A.html+' <span class="caret"></span>':'<span class="caret"></span>';
66 }if(A.tag!=='a'&&this.href!==''){throw "Tag must be a to set href.";}else if(this.href.length>0){A.href=this.href;}if(this.removeClass){A.cls='';}if(this.target){A.target=this.target;}return A;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype;
67 this.menu.triggerEl=this.el;this.addxtype(Roo.apply({},this.menu));}if(this.el.hasClass('roo-button')){this.el.on('click',this.onClick,this);this.el.on('dblclick',this.onDblClick,this);}else{this.el.select('.roo-button').on('click',this.onClick,this);this.el.select('.roo-button').on('dblclick',this.onDblClick,this);
68 }if(this.removeClass){this.el.on('click',this.onClick,this);}if(this.group===true){if(this.pressed===false||this.pressed===true){}else{this.pressed=false;this.setActive(this.pressed);}}this.el.enableDisplayMode();},onClick:function(e){if(this.disabled){return;
69 }Roo.log('button on click ');if(this.href===''||this.preventDefault){e.preventDefault();}if(this.group){if(this.pressed){return;}this.setActive(true);var pi=this.parent().items;for(var i=0;i<pi.length;i++){if(this==pi[i]){continue;}if(pi[i].el.hasClass('roo-button')){pi[i].setActive(false);
70 }}this.fireEvent('click',this,e);return;}if(this.pressed===true||this.pressed===false){this.toggleActive(e);}this.fireEvent('click',this,e);},onDblClick:function(e){if(this.disabled){return;}if(this.preventDefault){e.preventDefault();}this.fireEvent('dblclick',this,e);
71 },enable:function(){this.disabled=false;this.el.removeClass('disabled');this.el.dom.removeAttribute("disabled");},disable:function(){this.disabled=true;this.el.addClass('disabled');this.el.attr("disabled","disabled")},setActive:function(v){this.el[v?'addClass':'removeClass']('active');
72 this.pressed=v;},toggleActive:function(e){this.setActive(!this.pressed);this.fireEvent('toggle',this,e,this.pressed);},isActive:function(){return this.el.hasClass('active');},setText:function(A){this.el.select('.roo-button-text',true).first().dom.innerHTML=A;
73 },getText:function(){return this.el.select('.roo-button-text',true).first().dom.innerHTML;},setWeight:function(A){this.el.removeClass(Roo.bootstrap.Button.weights.map(function(w){return 'btn-'+w;}));this.el.removeClass(Roo.bootstrap.Button.weights.map(function(w){return 'btn-outline-'+w;
74 }));this.weight=A;var B=this.outline?'outline-':'';if(A=='default'){this.el.addClass('btn-default btn-outline-secondary');return;}this.el.addClass('btn-'+B+A);}});Roo.bootstrap.Button.weights=['default','secondary','primary','success','info','warning','danger','link','light','dark'];
75
76 // Roo/bootstrap/Column.js
77 Roo.bootstrap.Column=function(A){Roo.bootstrap.Column.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Column,Roo.bootstrap.Component,{xs:false,sm:false,md:false,lg:false,xsoff:false,smoff:false,mdoff:false,lgoff:false,html:'',offset:0,alert:false,fa:false,icon:false,hidden:false,fasize:1,getAutoCreate:function(){var A=Roo.apply({}
78 ,Roo.bootstrap.Column.superclass.getAutoCreate.call(this));A={tag:'div',cls:'column'};var B=this;var C=['xs','sm','md','lg'];C.map(function(E,ix){if(B[E+'off']!==false){A.cls+=' col-'+E+'-offset-'+B[E+'off'];}if(B[E]===false){return;}if(!B[E]){A.cls+=' hidden-'+E+' hidden-'+E+'-down';
79 for(var i=ix;i>-1;i--){A.cls+=' d-'+C[i]+'-none';}return;}A.cls+=' col-'+E+'-'+B[E]+(E=='xs'?(' col-'+B[E]):'');});if(this.hidden){A.cls+=' hidden';}if(this.alert&&["success","info","warning","danger"].indexOf(this.alert)>-1){A.cls+=' alert alert-'+this.alert;
80 }if(this.html.length){A.html=this.html;}if(this.fa){var D='';if(this.fasize>1){D=' fa-'+this.fasize+'x';}A.html='<i class="fa fa-'+this.fa+D+'"></i>'+(A.html||'');}if(this.icon){A.html='<i class="glyphicon glyphicon-'+this.icon+'"></i>'+(A.html||'');}return A;
81 }});
82 // Roo/bootstrap/Container.js
83 Roo.bootstrap.Container=function(A){Roo.bootstrap.Container.superclass.constructor.call(this,A);this.addEvents({"expand":true,"collapse":true,"click":true});};Roo.extend(Roo.bootstrap.Container,Roo.bootstrap.Component,{jumbotron:false,well:'',panel:'',header:'',footer:'',sticky:'',tag:false,alert:false,fa:false,icon:false,expandable:false,rheader:'',expanded:true,clickable:false,getChildContainer:function(){if(!this.el){return false;
84 }if(this.panel.length){return this.el.select('.panel-body',true).first();}return this.el;},getAutoCreate:function(){var A={tag:this.tag||'div',html:'',cls:''};if(this.jumbotron){A.cls='jumbotron';}if(this.sticky.length){var bd=Roo.get(document.body);if(!bd.hasClass('bootstrap-sticky')){bd.addClass('bootstrap-sticky');
85 Roo.select('html',true).setStyle('height','100%');}A.cls+='bootstrap-sticky-'+this.sticky;}if(this.well.length){switch(this.well){case 'lg':case 'sm':A.cls+=' well well-'+this.well;break;default:A.cls+=' well';break;}}if(this.hidden){A.cls+=' hidden';}if(this.alert&&["success","info","warning","danger"].indexOf(this.alert)>-1){A.cls+=' alert alert-'+this.alert;
86 }var B=A;if(this.panel.length){A.cls+=' panel panel-'+this.panel;A.cn=[];if(this.header.length){var h=[];if(this.expandable){A.cls=A.cls+' expandable';h.push({tag:'i',cls:(this.expanded?'fa fa-minus':'fa fa-plus')});}h.push({tag:'span',cls:'panel-title',html:(this.expandable?'&nbsp;':'')+this.header}
87 ,{tag:'span',cls:'panel-header-right',html:this.rheader});A.cn.push({cls:'panel-heading',style:this.expandable?'cursor: pointer':'',cn:h});}B=false;A.cn.push({cls:'panel-body'+(this.expanded?'':' hide'),html:this.html});if(this.footer.length){A.cn.push({cls:'panel-footer',html:this.footer}
88 );}}if(B){B.html=this.html||A.html;if(this.fa){B.html='<i class="fa fa-'+this.fa+'"></i>'+B.html;}if(this.icon){B.html='<i class="glyphicon glyphicon-'+this.icon+'"></i>'+B.html;}}if((!this.cls||!this.cls.length)&&(!A.cls||!A.cls.length)){A.cls='container';
89 }return A;},initEvents:function(){if(this.expandable){var A=this.headerEl();if(A){A.on('click',this.onToggleClick,this);}}if(this.clickable){this.el.on('click',this.onClick,this);}},onToggleClick:function(){var A=this.headerEl();if(!A){return;}if(this.expanded){this.collapse();
90 return;}this.expand();},expand:function(){if(this.fireEvent('expand',this)){this.expanded=true;this.el.select('.panel-body',true).first().removeClass('hide');var A=this.toggleEl();if(!A){return;}A.removeClass(['fa-minus','fa-plus']).addClass(['fa-minus']);
91 }},collapse:function(){if(this.fireEvent('collapse',this)){this.expanded=false;this.el.select('.panel-body',true).first().addClass('hide');var A=this.toggleEl();if(!A){return;}A.removeClass(['fa-minus','fa-plus']).addClass(['fa-plus']);}},toggleEl:function(){if(!this.el||!this.panel.length||!this.header.length||!this.expandable){return;
92 }return this.el.select('.panel-heading .fa',true).first();},headerEl:function(){if(!this.el||!this.panel.length||!this.header.length){return;}return this.el.select('.panel-heading',true).first()},bodyEl:function(){if(!this.el||!this.panel.length){return;}
93 return this.el.select('.panel-body',true).first()},titleEl:function(){if(!this.el||!this.panel.length||!this.header.length){return;}return this.el.select('.panel-title',true).first();},setTitle:function(v){var A=this.titleEl();if(!A){return;}A.dom.innerHTML=v;
94 },getTitle:function(){var A=this.titleEl();if(!A){return '';}return A.dom.innerHTML;},setRightTitle:function(v){var t=this.el.select('.panel-header-right',true).first();if(!t){return;}t.dom.innerHTML=v;},onClick:function(e){e.preventDefault();this.fireEvent('click',this,e);
95 }});
96 // Roo/bootstrap/Card.js
97 Roo.bootstrap.Card=function(A){Roo.bootstrap.Card.superclass.constructor.call(this,A);this.addEvents({'drop':true,'rotate':true,'cardover':true});};Roo.extend(Roo.bootstrap.Card,Roo.bootstrap.Component,{weight:'',margin:'',margin_top:'',margin_bottom:'',margin_left:'',margin_right:'',margin_x:'',margin_y:'',padding:'',padding_top:'',padding_bottom:'',padding_left:'',padding_right:'',padding_x:'',padding_y:'',display:'',display_xs:'',display_sm:'',display_lg:'',display_xl:'',header_image:'',header:'',header_size:0,title:'',subtitle:'',html:'',footer:'',collapsable:false,collapsed:false,rotateable:false,rotated:false,dragable:false,drag_group:false,dropable:false,drop_group:false,childContainer:false,dropEl:false,containerEl:false,bodyEl:false,headerContainerEl:false,headerEl:false,header_imageEl:false,layoutCls:function(){var A='';
98 var t=this;Roo.log(this.margin_bottom.length);['','top','bottom','left','right','x','y'].forEach(function(v){if((''+t['margin'+(v.length?'_':'')+v]).length){A+=' m'+(v.length?v[0]:'')+'-'+t['margin'+(v.length?'_':'')+v];}if((''+t['padding'+(v.length?'_':'')+v]).length){A+=' p'+(v.length?v[0]:'')+'-'+t['padding'+(v.length?'_':'')+v];
99 }});['','xs','sm','lg','xl'].forEach(function(v){if((''+t['display'+(v.length?'_':'')+v]).length){A+=' d'+(v.length?'-':'')+v+'-'+t['display'+(v.length?'_':'')+v]}});if(this.hidden){A+=' d-none';}return A;},getAutoCreate:function(){var A={tag:'div',cls:'card',cn:[]}
100 ;if(this.weight.length&&this.weight!='light'){A.cls+=' text-white';}else{A.cls+=' text-dark';}if(this.weight.length){A.cls+=' bg-'+this.weight;}A.cls+=' '+this.layoutCls();var B=false;var C=false;if(this.header.length){B={tag:this.header_size>0?'h'+this.header_size:'div',cls:'card-header '+(this.header_weight?'bg-'+this.header_weight:''),cn:[]}
101 ;A.cn.push(B);C=B;}else{B={tag:'div',cls:'card-header d-none '+(this.header_weight?'bg-'+this.header_weight:''),cn:[]};A.cn.push(B);C=B;}if(this.collapsable){C={tag:'a',cls:'d-block user-select-none',cn:[{tag:'i',cls:'roo-collapse-toggle fa fa-chevron-down float-right '+(this.collapsed?'collapsed':'')}
102 ]};B.cn.push(C);}C.cn.push({tag:'span',cls:'roo-card-header-ctr'+(this.header.length?'':' d-none'),html:this.header});if(this.header_image.length){A.cn.push({tag:'img',cls:'card-img-top',src:this.header_image});}else{A.cn.push({tag:'div',cls:'card-img-top d-none'}
103 );}var D={tag:'div',cls:'card-body'+(this.html===false?' d-none':''),cn:[]};var E=D;if(this.collapsable||this.rotateable){E={tag:'div',cls:'roo-collapsable collapse '+(this.collapsed||this.rotated?'':'show'),cn:[D]};}A.cn.push(E);if(this.title.length){D.cn.push({tag:'div',cls:'card-title',src:this.title}
104 );}if(this.subtitle.length){D.cn.push({tag:'div',cls:'card-title',src:this.subtitle});}D.cn.push({tag:'div',cls:'roo-card-body-ctr'});if(this.html.length){D.cn.push({tag:'div',html:this.html});}if(this.footer.length){A.cn.push({cls:'card-footer '+(this.rotated?'d-none':''),html:this.footer}
105 );}else{A.cn.push({cls:'card-footer d-none'});}return A;},getCardHeader:function(){var A=this.el.select('.card-header',true).first();if(A.hasClass('d-none')){A.removeClass('d-none');}return A;},getCardFooter:function(){var A=this.el.select('.card-footer',true).first();
106 if(A.hasClass('d-none')){A.removeClass('d-none');}return A;},getCardImageTop:function(){var A=this.header_imageEl;if(A.hasClass('d-none')){A.removeClass('d-none');}return A;},getChildContainer:function(){if(!this.el){return false;}return this.el.select('.roo-card-body-ctr',true).first();
107 },initEvents:function(){this.bodyEl=this.el.select('.card-body',true).first();this.containerEl=this.getChildContainer();if(this.dragable){this.dragZone=new Roo.dd.DragZone(this.getEl(),{containerScroll:true,ddGroup:this.drag_group||'default_card_drag_group'}
108 );this.dragZone.getDragData=this.getDragData.createDelegate(this);}if(this.dropable){this.dropZone=new Roo.dd.DropZone(this.el.select('.card-body',true).first(),{containerScroll:true,ddGroup:this.drop_group||'default_card_drag_group'});this.dropZone.getTargetFromEvent=this.getTargetFromEvent.createDelegate(this);
109 this.dropZone.onNodeEnter=this.onNodeEnter.createDelegate(this);this.dropZone.onNodeOver=this.onNodeOver.createDelegate(this);this.dropZone.onNodeOut=this.onNodeOut.createDelegate(this);this.dropZone.onNodeDrop=this.onNodeDrop.createDelegate(this);}if(this.collapsable){this.el.select('.card-header',true).on('click',this.onToggleCollapse,this);
110 }if(this.rotateable){this.el.select('.card-header',true).on('click',this.onToggleRotate,this);}this.collapsableEl=this.el.select('.roo-collapsable',true).first();this.footerEl=this.el.select('.card-footer',true).first();this.collapsableToggleEl=this.el.select('.roo-collapse-toggle',true).first();
111 this.headerContainerEl=this.el.select('.roo-card-header-ctr',true).first();this.headerEl=this.el.select('.card-header',true).first();if(this.rotated){this.el.addClass('roo-card-rotated');this.fireEvent('rotate',this,true);}this.header_imageEl=this.el.select('.card-img-top',true).first();
112 this.header_imageEl.on('load',this.onHeaderImageLoad,this);},getDragData:function(e){var A=this.getEl();if(A){var B={source:this,copy:false,nodes:this.getEl(),records:[]};B.ddel=A.dom;Roo.log(A.getWidth());B.ddel.style.width=A.getWidth()+'px';return B;}return false;
113 },getTargetFromEvent:function(e,A){var B=e.getTarget();while((B!==null)&&(B.parentNode!=this.containerEl.dom)){B=B.parentNode;}var C={position:'',cards:[],card_n:-1,items_n:-1,card:false};var D=false;var E=0;var F=0;for(var i=0;i<this.items.length;i++){if(!this.items[i].el.hasClass('card')){continue;
114 }D=this.getDropPoint(e,this.items[i].el.dom);F=C.cards.length;C.cards.push(this.items[i]);E=i;if(C.card_n<0&&D=='above'){C.position=F>0?'below':D;C.items_n=i>0?i-1:0;C.card_n=F>0?F-1:0;C.card=C.cards[C.card_n];}}if(!C.cards.length){C.card=true;C.position='below';
115 C.items_n;return C;}if(C.card_n<0){C.card_n=E;C.card=C.cards[E];C.items_n=this.items.indexOf(C.cards[E]);C.position='below';}if(this.items[C.items_n].el==A){return false;}if(C.position=='below'){var G=C.card_n+1==C.cards.length?false:C.cards[C.card_n+1];if(G&&G.el==A){return false;
116 }return C;}var H=C.card_n>0?C.cards[C.card_n-1]:false;if(H&&H.el==A){return false;}return C;},onNodeEnter:function(n,dd,e,A){return false;},onNodeOver:function(n,dd,e,A){var B=this.getTargetFromEvent(e,A.source.el);if(B===false){this.dropPlaceHolder('hide');
117 return false;}Roo.log(['getTargetFromEvent',B]);if(this.fireEvent('cardover',this,[A])===false){return false;}this.dropPlaceHolder('show',B,A);return false;},onNodeOut:function(n,dd,e,A){this.dropPlaceHolder('hide');},onNodeDrop:function(n,dd,e,A){var B=this.getTargetFromEvent(e,A.source.el);
118 if(B===false){return false;}this.dropPlaceHolder('hide');this.acceptCard(A.source,B.position,B.card,B.items_n);return true;},firstChildCard:function(){for(var i=0;i<this.items.length;i++){if(!this.items[i].el.hasClass('card')){continue;}return this.items[i];
119 }return this.items.length?this.items[this.items.length-1]:false;},acceptCard:function(A,B,C){if(this.fireEvent("drop",this,A,B,C)===false){return false;}var D=C?this.items.indexOf(C):0;A.parent().removeCard(A);var E=A.el.dom;E.style.width='';if(C!==false&&C!==true&&C.el.dom.parentNode){var F=C.el.dom;
120 if(B=='above'){F.parentNode.insertBefore(E,F);}else if(F.nextSibling){F.parentNode.insertBefore(E,F.nextSibling);}else{F.parentNode.append(E);}}else{this.containerEl.dom.append(E);}if(this.items.length){var G=[];for(var i=0;i<this.items.length;i++){if(i==D&&B=='above'){G.push(A);
121 }G.push(this.items[i]);if(i==D&&B=='below'){G.push(A);}}this.items=G;Roo.log(this.items);}else{this.items.push(A);}A.parentId=this.id;return true;},removeCard:function(c){this.items=this.items.filter(function(e){return e!=c});var A=c.el.dom;A.parentNode.removeChild(A);
122 A.style.width='';c.parentId=false;},getDropPoint:function(e,n,dd){if(dd){return false;}if(n==this.containerEl.dom){return "above";}var t=Roo.lib.Dom.getY(n),b=t+n.offsetHeight;var c=t+(b-t)/2;var y=Roo.lib.Event.getPageY(e);if(y<=c){return "above";}else{return "below";
123 }},onToggleCollapse:function(e){if(this.collapsed){this.el.select('.roo-collapse-toggle').removeClass('collapsed');this.collapsableEl.addClass('show');this.collapsed=false;return;}this.el.select('.roo-collapse-toggle').addClass('collapsed');this.collapsableEl.removeClass('show');
124 this.collapsed=true;},onToggleRotate:function(e){this.collapsableEl.removeClass('show');this.footerEl.removeClass('d-none');this.el.removeClass('roo-card-rotated');this.el.removeClass('d-none');if(this.rotated){this.collapsableEl.addClass('show');this.rotated=false;
125 this.fireEvent('rotate',this,this.rotated);return;}this.el.addClass('roo-card-rotated');this.footerEl.addClass('d-none');this.el.select('.roo-collapsable').removeClass('show');this.rotated=true;this.fireEvent('rotate',this,this.rotated);},dropPlaceHolder:function(A,B,C){if(this.dropEl===false){this.dropEl=Roo.DomHelper.append(this.containerEl,{cls:'d-none'}
126 ,true);}this.dropEl.removeClass(['d-none','d-block']);if(A=='hide'){this.dropEl.addClass('d-none');return;}this.dropEl.dom.parentNode.removeChild(this.dropEl.dom);if(B.card!==true){var D=B.card.el.dom;if(B.position=='above'){D.parentNode.insertBefore(this.dropEl.dom,D);
127 }else if(D.nextSibling){D.parentNode.insertBefore(this.dropEl.dom,D.nextSibling);}else{D.parentNode.append(this.dropEl.dom);}}else{this.containerEl.dom.append(this.dropEl.dom);}this.dropEl.addClass('d-block roo-card-dropzone');this.dropEl.setHeight(Roo.get(C.ddel).getHeight());
128 },setHeaderText:function(A){this.header=A;if(this.headerContainerEl){this.headerContainerEl.dom.innerHTML=A;}},onHeaderImageLoad:function(ev,he){if(!this.header_image_fit_square){return;}var hw=he.naturalHeight/he.naturalWidth;var ww=he.width;he.style.left=0;
129 he.style.position='relative';if(hw>1){var nw=(ww*(1/hw));Roo.get(he).setSize(ww*(1/hw),ww);he.style.left=((ww-nw)/2)+'px';he.style.position='relative';}}});
130 // Roo/bootstrap/CardHeader.js
131 Roo.bootstrap.CardHeader=function(A){Roo.bootstrap.CardHeader.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.CardHeader,Roo.bootstrap.Element,{container_method:'getCardHeader'});
132 // Roo/bootstrap/CardFooter.js
133 Roo.bootstrap.CardFooter=function(A){Roo.bootstrap.CardFooter.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.CardFooter,Roo.bootstrap.Element,{container_method:'getCardFooter'});
134 // Roo/bootstrap/CardImageTop.js
135 Roo.bootstrap.CardImageTop=function(A){Roo.bootstrap.CardImageTop.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.CardImageTop,Roo.bootstrap.Element,{container_method:'getCardImageTop'});
136 // Roo/bootstrap/ButtonUploader.js
137 Roo.bootstrap.ButtonUploader=function(A){Roo.bootstrap.ButtonUploader.superclass.constructor.call(this,A);this.addEvents({'beforeselect':true,'uploaded':true});};Roo.extend(Roo.bootstrap.ButtonUploader,Roo.bootstrap.Button,{errorTimeout:3000,images:false,fileCollection:false,allowBlank:true,multiple:true,getAutoCreate:function(){return {cls:'div',cn:[Roo.bootstrap.Button.prototype.getAutoCreate.call(this)]}
138 ;},initEvents:function(){Roo.bootstrap.Button.prototype.initEvents.call(this);this.urlAPI=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);var im={tag:'input',type:'file',cls:'d-none  roo-card-upload-selector'}
139 ;if(this.multiple){im.multiple='multiple';}this.selectorEl=Roo.get(document.body).createChild(im);this.selectorEl.on('change',this.onFileSelected,this);},onClick:function(e){e.preventDefault();if(this.fireEvent('beforeselect',this)===false){return;}this.selectorEl.dom.click();
140 },onFileSelected:function(e){e.preventDefault();if(typeof(this.selectorEl.dom.files)=='undefined'||!this.selectorEl.dom.files.length){return;}var A=Array.prototype.slice.call(this.selectorEl.dom.files);this.selectorEl.dom.value='';this.fireEvent('uploaded',this,A);
141 },reset:function(){this.selectorEl}});
142 // Roo/bootstrap/Img.js
143 Roo.bootstrap.Img=function(A){Roo.bootstrap.Img.superclass.constructor.call(this,A);this.addEvents({"click":true,"load":true});};Roo.extend(Roo.bootstrap.Img,Roo.bootstrap.Component,{imgResponsive:true,border:'',src:'about:blank',href:false,target:false,xsUrl:'',smUrl:'',mdUrl:'',lgUrl:'',backgroundContain:false,getAutoCreate:function(){if(this.src||(!this.xsUrl&&!this.smUrl&&!this.mdUrl&&!this.lgUrl)){return this.createSingleImg();
144 }var A={tag:'div',cls:'roo-image-responsive-group',cn:[]};var B=this;Roo.each(['xs','sm','md','lg'],function(C){if(!B[C+'Url']){return;}var D={tag:'img',cls:(B.imgResponsive)?'img-responsive':'',html:B.html||A.html,src:B[C+'Url']};D.cls+=' roo-image-responsive-'+C;
145 var s=['xs','sm','md','lg'];s.splice(s.indexOf(C),1);Roo.each(s,function(ss){D.cls+=' hidden-'+ss;});if(['rounded','circle','thumbnail'].indexOf(B.border)>-1){A.cls+=' img-'+B.border;}if(B.alt){A.alt=B.alt;}if(B.href){var a={tag:'a',href:B.href,cn:[D]};if(this.target){a.target=B.target;
146 }}A.cn.push((B.href)?a:D);});return A;},createSingleImg:function(){var A={tag:'img',cls:(this.imgResponsive)?'img-responsive':'',html:null,src:Roo.BLANK_IMAGE_URL};if(this.backgroundContain){A.cls+=' background-contain';}A.html=this.html||A.html;if(this.backgroundContain){A.style="background-image: url("+this.src+')';
147 }else{A.src=this.src||A.src;}if(['rounded','circle','thumbnail'].indexOf(this.border)>-1){A.cls+=' img-'+this.border;}if(this.alt){A.alt=this.alt;}if(this.href){var a={tag:'a',href:this.href,cn:[A]};if(this.target){a.target=this.target;}}return (this.href)?a:A;
148 },initEvents:function(){if(!this.href){this.el.on('click',this.onClick,this);}if(this.src||(!this.xsUrl&&!this.smUrl&&!this.mdUrl&&!this.lgUrl)){this.el.on('load',this.onImageLoad,this);}else{this.el.select('img',true).on('load',this.onImageLoad,this);}},onClick:function(e){Roo.log('img onclick');
149 this.fireEvent('click',this,e);},onImageLoad:function(e){Roo.log('img load');this.fireEvent('load',this,e);},setSrc:function(A){this.src=A;if(this.src||(!this.xsUrl&&!this.smUrl&&!this.mdUrl&&!this.lgUrl)){if(this.backgroundContain){this.el.dom.style.backgroundImage='url('+A+')';
150 }else{this.el.dom.src=A;}return;}this.el.select('img',true).first().dom.src=A;}});
151 // Roo/bootstrap/Link.js
152 Roo.bootstrap.Link=function(A){Roo.bootstrap.Link.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.Link,Roo.bootstrap.Component,{href:false,target:false,preventDefault:false,anchor:false,alt:false,fa:false,getAutoCreate:function(){var A=this.html||'';
153 if(this.fa!==false){A='<i class="fa fa-'+this.fa+'"></i>';}var B={tag:'a'};if(this.anchor===false){B.html=A;B.href=this.href||'#';}else{B.name=this.anchor;if(this.html!==false||this.fa!==false){B.html=A;}if(this.href!==false){B.href=this.href;}}if(this.alt!==false){B.alt=this.alt;
154 }if(this.target!==false){B.target=this.target;}return B;},initEvents:function(){if(!this.href||this.preventDefault){this.el.on('click',this.onClick,this);}},onClick:function(e){if(this.preventDefault){e.preventDefault();}this.fireEvent('click',this,e);}});
155
156 // Roo/bootstrap/Header.js
157 Roo.bootstrap.Header=function(A){Roo.bootstrap.Header.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Header,Roo.bootstrap.Component,{html:false,level:1,getAutoCreate:function(){var A={tag:'h'+(1*this.level),html:this.html||''};return A;}});
158
159 // Roo/bootstrap/menu/Manager.js
160 Roo.bootstrap.menu.Manager=function(){var A,B,C={},D=false,E=new Date();function init(){A={};B=new Roo.util.MixedCollection();Roo.get(document).addKeyListener(27,function(){if(B.length>0){hideAll();}});}function hideAll(){if(B&&B.length>0){var c=B.clone();
161 c.each(function(m){m.hide();});}}function onHide(m){B.remove(m);if(B.length<1){Roo.get(document).un("mouseup",onMouseDown);D=false;}}function onShow(m){var F=B.last();E=new Date();B.add(m);if(!D){Roo.get(document).on("mouseup",onMouseDown);D=true;}if(m.parentMenu){m.parentMenu.activeChild=m;
162 }else if(F&&F.isVisible()){}}function onBeforeHide(m){if(m.activeChild){m.activeChild.hide();}if(m.autoHideTimer){clearTimeout(m.autoHideTimer);delete m.autoHideTimer;}}function onBeforeShow(m){var pm=m.parentMenu;if(!pm&&!m.allowOtherMenus){hideAll();}else if(pm&&pm.activeChild&&B!=m){pm.activeChild.hide();
163 }}function onMouseDown(e){Roo.log("on Mouse Up");if(E.getElapsed()>50&&B.length>0&&!e.getTarget(".dropdown-menu")&&!e.getTarget('.user-menu')){Roo.log("MenuManager hideAll");hideAll();e.stopEvent();}}function onBeforeCheck(mi,F){if(F){var g=C[mi.group];for(var i=0,l=g.length;
164 i<l;i++){if(g[i]!=mi){g[i].setChecked(false);}}}}return {hideAll:function(){hideAll();},register:function(F){if(!A){init();}A[F.id]=F;F.on("beforehide",onBeforeHide);F.on("hide",onHide);F.on("beforeshow",onBeforeShow);F.on("show",onShow);var g=F.group;if(g&&F.events["checkchange"]){if(!C[g]){C[g]=[];
165 }C[g].push(F);F.on("checkchange",onCheck);}},get:function(F){if(typeof F=="string"){return A[F];}else if(F.events){return F;}return false;},unregister:function(F){delete A[F.id];F.un("beforehide",onBeforeHide);F.un("hide",onHide);F.un("beforeshow",onBeforeShow);
166 F.un("show",onShow);var g=F.group;if(g&&F.events["checkchange"]){C[g].remove(F);F.un("checkchange",onCheck);}},registerCheckable:function(F){var g=F.group;if(g){if(!C[g]){C[g]=[];}C[g].push(F);F.on("beforecheckchange",onBeforeCheck);}},unregisterCheckable:function(F){var g=F.group;
167 if(g){C[g].remove(F);F.un("beforecheckchange",onBeforeCheck);}}};}();
168 // Roo/bootstrap/menu/Menu.js
169 Roo.bootstrap.menu.Menu=function(A){if(A.type=='treeview'){this.container_method='getChildContainer';}Roo.bootstrap.menu.Menu.superclass.constructor.call(this,A);if(this.registerMenu&&this.type!='treeview'){Roo.bootstrap.menu.Manager.register(this);}this.addEvents({beforeshow:true,beforehide:true,show:true,hide:true,click:true,mouseover:true,mouseout:true,itemclick:true}
170 );this.menuitems=new Roo.util.MixedCollection(false,function(o){return o.el.id;});};Roo.extend(Roo.bootstrap.menu.Menu,Roo.bootstrap.Component,{triggerEl:false,type:false,registerMenu:true,menuItems:false,hidden:true,parentMenu:false,stopEvent:true,isLink:false,container_method:'getDocumentBody',hideTrigger:false,align:'tl-bl?',getChildContainer:function(){return this.el;
171 },getAutoCreate:function(){var A={tag:'ul',cls:'dropdown-menu shadow',style:'z-index:1000'};if(this.type==='submenu'){A.cls='submenu active';}if(this.type==='treeview'){A.cls='treeview-menu';}return A;},initEvents:function(){if(this.triggerEl){this.triggerEl.on('click',this.onTriggerClick,this);
172 this.triggerEl.on(Roo.isTouch?'touchstart':'mouseup',this.onTriggerPress,this);if(!this.hideTrigger){if(this.triggerEl.hasClass('nav-item')&&this.triggerEl.select('.nav-link',true).length){this.triggerEl.select('.nav-link',true).first().addClass('dropdown-toggle');
173 }else{this.triggerEl.addClass('dropdown-toggle');}}}if(Roo.isTouch){this.el.on('touchstart',this.onTouch,this);}this.el.on('click',this.onClick,this);this.el.on("mouseover",this.onMouseOver,this);this.el.on("mouseout",this.onMouseOut,this);},findTargetItem:function(e){var t=e.getTarget(".dropdown-menu-item",this.el,true);
174 if(!t){return false;}if(t&&t.id){return this.menuitems.get(t.id);}return false;},onTouch:function(e){Roo.log("menu.onTouch");this.onClick(e);},onClick:function(e){Roo.log("menu.onClick");var t=this.findTargetItem(e);if(!t||t.isContainer){return;}Roo.log(e);
175 Roo.log('pass click event');t.onClick(e);this.fireEvent("click",this,t,e);var A=this;if(!t.href.length||t.href=='#'){(function(){A.hide();}).defer(100);}},onMouseOver:function(e){var t=this.findTargetItem(e);this.fireEvent("mouseover",this,e,t);},isVisible:function(){return !this.hidden;
176 },onMouseOut:function(e){var t=this.findTargetItem(e);this.fireEvent("mouseout",this,e,t);},show:function(el,A,B){if(false===this.fireEvent("beforeshow",this)){Roo.log("show canceled");return;}this.parentMenu=B;if(!this.el){this.render();}this.el.addClass('show');
177 var xy=this.el.getAlignToXY(el,A);if(this.el.getWidth()+xy[0]>=Roo.lib.Dom.getViewWidth()){xy=this.el.getAlignToXY(el,this.align.replace('/l/g','r'))}if(xy[0]<0){xy=this.el.getAlignToXY(el,this.align.replace('/r/g','l'))}if(this.el.getHeight()+xy[1]>=Roo.lib.Dom.getViewHeight()||xy[1]<0){var a=this.align.replace('?','').split('-');
178 xy=this.el.getAlignToXY(el,a[1]+'-'+a[0]+'?')}this.showAt(xy,B,false);},showAt:function(xy,A,_e){this.parentMenu=A;if(!this.el){this.render();}if(_e!==false){this.fireEvent("beforeshow",this);}this.hideMenuItems();this.hidden=false;if(this.triggerEl){this.triggerEl.addClass('open');
179 }this.el.addClass('show');if(this.el.getStyle('top')!='auto'&&this.el.getStyle('top').slice(-1)!="%"){this.el.setXY(xy);}this.focus();this.fireEvent("show",this);},focus:function(){return;if(!this.hidden){this.doFocus.defer(50,this);}},doFocus:function(){if(!this.hidden){this.focusEl.focus();
180 }},hide:function(A){if(false===this.fireEvent("beforehide",this)){Roo.log("hide canceled");return;}this.hideMenuItems();if(this.el&&this.isVisible()){if(this.activeItem){this.activeItem.deactivate();this.activeItem=null;}if(this.triggerEl){this.triggerEl.removeClass('open');
181 }this.el.removeClass('show');this.hidden=true;this.fireEvent("hide",this);}if(A===true&&this.parentMenu){this.parentMenu.hide(true);}},onTriggerClick:function(e){Roo.log('trigger click');var A=e.getTarget();Roo.log(A.nodeName.toLowerCase());if(A.nodeName.toLowerCase()==='i'){e.preventDefault();
182 }},onTriggerPress:function(e){Roo.log('trigger press');var A=Roo.get(e.getTarget());if(A.findParent('.dropdown-menu')||A.findParent('.treeview-menu')){Roo.log('is treeview or dropdown?');return;}if(e.getTarget().nodeName.toLowerCase()!=='i'&&this.isLink){return;
183 }if(this.isVisible()){Roo.log('hide');this.hide();}else{Roo.log('show');this.show(this.triggerEl,this.align,false);}if(this.stopEvent||e.getTarget().nodeName.toLowerCase()==='i'){e.stopEvent();}},hideMenuItems:function(){Roo.log("hide Menu Items");if(!this.el){return;
184 }this.el.select('.open',true).each(function(aa){aa.removeClass('open');});},addxtypeChild:function(A,B){var C=Roo.bootstrap.menu.Menu.superclass.addxtypeChild.call(this,A,B);this.menuitems.add(C);return C;},getEl:function(){Roo.log(this.el);return this.el;
185 },clear:function(){this.getEl().dom.innerHTML='';this.menuitems.clear();}});
186 // Roo/bootstrap/menu/Item.js
187 Roo.bootstrap.menu.Item=function(A){Roo.bootstrap.menu.Item.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.menu.Item,Roo.bootstrap.Component,{href:false,html:false,preventDefault:false,isContainer:false,active:false,fa:false,getAutoCreate:function(){if(this.isContainer){return {tag:'li',cls:'dropdown-menu-item '}
188 ;}var A={tag:'span',html:'Link'};var B={tag:'a',cls:'dropdown-item',href:'#',cn:[]};if(this.fa!==false){B.cn.push({tag:'i',cls:'fa fa-'+this.fa});}B.cn.push(A);var C={tag:'li',cls:'dropdown-menu-item',cn:[B]};if(this.parent().type=='treeview'){C.cls='treeview-menu';
189 }if(this.active){C.cls+=' active';}B.href=this.href||C.cn[0].href;A.html=this.html||C.cn[0].html;return C;},initEvents:function(){if(this.parent().type=='treeview'){this.el.select('a').on('click',this.onClick,this);}if(this.menu){this.menu.parentType=this.xtype;
190 this.menu.triggerEl=this.el;this.menu=this.addxtype(Roo.apply({},this.menu));}},onClick:function(e){if(this.href===false||this.preventDefault){e.preventDefault();}this.fireEvent('click',this,e);},getEl:function(){return this.el;}});
191 // Roo/bootstrap/menu/Separator.js
192 Roo.bootstrap.menu.Separator=function(A){Roo.bootstrap.menu.Separator.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.menu.Separator,Roo.bootstrap.Component,{getAutoCreate:function(){var A={tag:'li',cls:'dropdown-divider divider'};return A;}
193 });
194 // Roo/bootstrap/Modal.js
195 Roo.bootstrap.Modal=function(A){Roo.bootstrap.Modal.superclass.constructor.call(this,A);this.addEvents({"btnclick":true,"resize":true,"titlechanged":true});this.buttons=this.buttons||[];if(this.tmpl){this.tmpl=Roo.factory(this.tmpl);}};Roo.extend(Roo.bootstrap.Modal,Roo.bootstrap.Component,{title:'test dialog',buttons:false,html:false,tmp:false,specificTitle:false,buttonPosition:'right',allow_close:true,animate:true,fitwindow:false,dialogEl:false,bodyEl:false,footerEl:false,titleEl:false,closeEl:false,size:'',max_width:0,max_height:0,fit_content:false,editableTitle:false,onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A);
196 if(!this.el){var B=Roo.apply({},this.getAutoCreate());B.id=Roo.id();if(this.cls){B.cls+=' '+this.cls;}if(this.style){B.style=this.style;}this.el=Roo.get(document.body).createChild(B,A);}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);
197 }this.dialogEl=this.el.select('.modal-dialog',true).first();this.bodyEl=this.el.select('.modal-body',true).first();this.closeEl=this.el.select('.modal-header .close',true).first();this.headerEl=this.el.select('.modal-header',true).first();this.titleEl=this.el.select('.modal-title',true).first();
198 this.footerEl=this.el.select('.modal-footer',true).first();this.maskEl=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);if(this.buttons.length){Roo.each(this.buttons,function(bb){var b=Roo.apply({},bb);b.xns=b.xns||Roo.bootstrap;b.xtype=b.xtype||'Button';
199 if(typeof(b.listeners)=='undefined'){b.listeners={click:this.onButtonClick.createDelegate(this)};}var E=Roo.factory(b);E.render(this.getButtonContainer());},this);}var C=[];if(typeof(this.items)!='undefined'){var D=this.items;delete this.items;for(var i=0;
200 i<D.length;i++){D[i].monitorWindowResize=false;C.push(this.addxtype(Roo.apply({},D[i])));}}this.items=C;this.initEvents();},getAutoCreate:function(){var A={cls:'modal-body '+(this.bodyOverflow?'overflow-auto':''),html:this.html||''};var B={tag:'h5',cls:'modal-title',html:this.title}
201 ;if(this.specificTitle){B=this.title;}var C=[];if(this.allow_close&&Roo.bootstrap.version==3){C.push({tag:'button',cls:'close',html:'&times'});}C.push(B);if(this.editableTitle){C.push({cls:'form-control roo-editable-title d-none',tag:'input',type:'text'});
202 }if(this.allow_close&&Roo.bootstrap.version==4){C.push({tag:'button',cls:'close',html:'&times'});}var D='';if(this.size.length){D='modal-'+this.size;}var E=Roo.bootstrap.version==3?{cls:'modal-footer',cn:[{tag:'div',cls:'btn-'+this.buttonPosition}]}:{cls:'modal-footer'}
203 ;var F={cls:"modal",cn:[{cls:"modal-dialog "+D,cn:[{cls:"modal-content",cn:[{cls:'modal-header',cn:C},A,E]}]}]};if(this.animate){F.cls+=' fade';}return F;},getChildContainer:function(){return this.bodyEl;},getButtonContainer:function(){return Roo.bootstrap.version==4?this.el.select('.modal-footer',true).first():this.el.select('.modal-footer div',true).first();
204 },initEvents:function(){if(this.allow_close){this.closeEl.on('click',this.hide,this);}Roo.EventManager.onWindowResize(this.resize,this,true);if(this.editableTitle){this.headerEditEl=this.headerEl.select('.form-control',true).first();this.headerEl.on('click',function(){this.toggleHeaderInput(true)}
205 ,this);this.headerEditEl.on('keyup',function(e){if([e.RETURN,e.TAB,e.ESC].indexOf(e.keyCode)>-1){this.toggleHeaderInput(false)}},this);this.headerEditEl.on('blur',function(e){this.toggleHeaderInput(false)},this);}},resize:function(){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));
206 if(this.fitwindow){this.dialogEl.setStyle({'max-width':'100%'});this.setSize(this.width||Roo.lib.Dom.getViewportWidth(true)-30,this.height||Roo.lib.Dom.getViewportHeight(true));return;}if(this.max_width!==0){var w=Math.min(this.max_width,Roo.lib.Dom.getViewportWidth(true)-30);
207 if(this.height){this.setSize(w,this.height);return;}if(this.max_height){this.setSize(w,Math.min(this.max_height,Roo.lib.Dom.getViewportHeight(true)-60));return;}if(!this.fit_content){this.setSize(w,Roo.lib.Dom.getViewportHeight(true)-60);return;}this.setSize(w,Math.min(60+this.headerEl.getHeight()+this.footerEl.getHeight()+this.getChildHeight(this.bodyEl.dom.childNodes),Roo.lib.Dom.getViewportHeight(true)-60));
208 }},setSize:function(w,h){if(!w&&!h){return;}this.resizeTo(w,h);(function(){this.items.forEach(function(e){e.layout?e.layout():false;});}).defer(100,this);},show:function(){if(!this.rendered){this.render();}this.toggleHeaderInput(false);this.el.removeClass('hideing');
209 this.el.dom.style.display='block';Roo.get(document.body).addClass('modal-open');if(this.animate){(function(){this.el.addClass('show');this.el.addClass('in');}).defer(50,this);}else{this.el.addClass('show');this.el.addClass('in');}Roo.get(document.body).addClass("x-body-masked");
210 this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.maskEl.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);this.maskEl.dom.style.display='block';this.maskEl.addClass('show');this.resize();this.fireEvent('show',this);this.el.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);
211 (function(){this.items.forEach(function(e){e.layout?e.layout():false;});}).defer(100,this);},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.maskEl.removeClass('show');this.maskEl.dom.style.display='';Roo.get(document.body).removeClass("x-body-masked");
212 this.el.removeClass('in');this.el.select('.modal-dialog',true).first().setStyle('transform','');if(this.animate){this.el.addClass('hideing');this.el.removeClass('show');(function(){if(!this.el.hasClass('hideing')){return;}this.el.dom.style.display='';Roo.get(document.body).removeClass('modal-open');
213 this.el.removeClass('hideing');}).defer(150,this);}else{this.el.removeClass('show');this.el.dom.style.display='';Roo.get(document.body).removeClass('modal-open');}this.fireEvent('hide',this);}},isVisible:function(){return this.el.hasClass('show')&&!this.el.hasClass('hideing');
214 },addButton:function(A,cb){var b=Roo.apply({},{html:A});b.xns=b.xns||Roo.bootstrap;b.xtype=b.xtype||'Button';if(typeof(b.listeners)=='undefined'){b.listeners={click:cb.createDelegate(this)};}var B=Roo.factory(b);B.render(this.getButtonContainer());return B;
215 },setDefaultButton:function(A){},resizeTo:function(w,h){this.dialogEl.setWidth(w);var A=this.headerEl.getHeight()+this.footerEl.getHeight()+60;this.bodyEl.setHeight(h-A);this.fireEvent('resize',this);},setContentSize:function(w,h){},onButtonClick:function(A,e){this.fireEvent('btnclick',A.name,e);
216 },setTitle:function(A){this.titleEl.dom.innerHTML=A;this.title=A;},setBody:function(A){this.bodyEl.dom.innerHTML=A;},applyBody:function(A){if(!this.tmpl){Roo.log("Error - using apply Body without a template");}this.tmpl.overwrite(this.bodyEl,A);},getChildHeight:function(A){if(!A||A.length==0){return 0;
217 }var B=0;for(var i=0;i<A.length;i++){B+=A[i].offsetHeight;}return B;},toggleHeaderInput:function(A){if(!this.editableTitle){return;}if(A&&this.is_header_editing){return;}if(A){this.headerEditEl.dom.value=this.title;this.headerEditEl.removeClass('d-none');
218 this.headerEditEl.dom.focus();this.titleEl.addClass('d-none');this.is_header_editing=true;return}this.title=this.headerEditEl.dom.value;this.headerEditEl.addClass('d-none');this.titleEl.removeClass('d-none');this.titleEl.dom.innerHTML=String.format('{0}',this.title);
219 this.is_header_editing=false;this.fireEvent('titlechanged',this,this.title);}});Roo.apply(Roo.bootstrap.Modal,{OK:[{name:'ok',weight:'primary',html:'OK'}],YESNO:[{name:'no',html:'No'},{name:'yes',weight:'primary',html:'Yes'}],OKCANCEL:[{name:'cancel',html:'Cancel'}
220 ,{name:'ok',weight:'primary',html:'OK'}],YESNOCANCEL:[{name:'yes',weight:'primary',html:'Yes'},{name:'no',html:'No'},{name:'cancel',html:'Cancel'}],zIndex:10001});
221 // Roo/bootstrap/MessageBox.js
222 Roo.bootstrap.MessageBox=function(){var A,B,C,D;var E,F,G,H,I,pp;var J,K,L;var M=function(Q){A.hide();Roo.callback(B.fn,B.scope||window,[Q,K.dom.value],1);};var N=function(){if(B&&B.cls){A.el.removeClass(B.cls);}};var O=function(b){var Q=0;if(!b){J["ok"].hide();
223 J["cancel"].hide();J["yes"].hide();J["no"].hide();A.footerEl.hide();return Q;}A.footerEl.show();for(var k in J){if(typeof J[k]!="function"){if(b[k]){J[k].show();J[k].setText(typeof b[k]=="string"?b[k]:Roo.bootstrap.MessageBox.buttonText[k]);Q+=J[k].el.getWidth()+15;
224 }else{J[k].hide();}}}return Q;};var P=function(d,k,e){if(B&&B.closable!==false){A.hide();}if(e){e.stopEvent();}};return {getDialog:function(){if(!A){A=new Roo.bootstrap.Modal({closeClick:function(){if(B&&B.buttons&&B.buttons.no&&!B.buttons.cancel){M("no");
225 }else{M("cancel");}}});A.render();A.on("hide",N);C=A.mask;J={};this.buttons=J;var bt=this.buttonText;J["ok"]=A.addButton(bt["ok"],M.createCallback("ok"));J["yes"]=A.addButton(bt["yes"],M.createCallback("yes"));J["no"]=A.addButton(bt["no"],M.createCallback("no"));
226 J["cancel"]=A.addButton(bt["cancel"],M.createCallback("cancel"));E=A.bodyEl.createChild({html:'<span class="roo-mb-text"></span><br /><input type="text" class="roo-mb-input" />'+'<textarea class="roo-mb-textarea"></textarea>'+'<div class="roo-mb-progress-wrap"><div class="roo-mb-progress"><div class="roo-mb-progress-bar">&#160;</div></div></div>'}
227 );F=E.dom.firstChild;G=Roo.get(E.dom.childNodes[2]);G.enableDisplayMode();G.addKeyListener([10,13],function(){if(A.isVisible()&&B&&B.buttons){if(B.buttons.ok){M("ok");}else if(B.buttons.yes){M("yes");}}});H=Roo.get(E.dom.childNodes[3]);H.enableDisplayMode();
228 I=Roo.get(E.dom.childNodes[4]);I.enableDisplayMode();var pf=I.dom.firstChild;if(pf){pp=Roo.get(pf.firstChild);pp.setHeight(pf.offsetHeight);}}return A;},updateText:function(Q){if(!A.isVisible()&&!B.width){A.dialogEl.setStyle({'max-width':this.maxWidth});}
229 F.innerHTML=Q||'&#160;';var cw=Math.max(F.offsetWidth,F.parentNode.scrollWidth);var w=Math.max(Math.min(B.width||cw,this.maxWidth),Math.max(B.minWidth||this.minWidth,L));if(B.prompt){K.setWidth(w);}if(A.isVisible()){A.fixedcenter=false;}if(E.getHeight()>(Roo.lib.Dom.getViewHeight()-100)){E.setHeight(Roo.lib.Dom.getViewHeight()-100);
230 E.dom.style.overflowY='auto'+(Roo.isIE?'':' !important');}else{E.dom.style.height='';E.dom.style.overflowY='';}if(cw>w){E.dom.style.get='auto'+(Roo.isIE?'':' !important');}else{E.dom.style.overflowX='';}A.setContentSize(w,E.getHeight());if(A.isVisible()){A.fixedcenter=true;
231 }return this;},updateProgress:function(Q,R){if(R){this.updateText(R);}if(pp){pp.setWidth(Math.floor(Q*I.dom.firstChild.offsetWidth));pp.setHeight(Math.floor(I.dom.firstChild.offsetHeight));}return this;},isVisible:function(){return A&&A.isVisible();},hide:function(){if(this.isVisible()){A.hide();
232 }},show:function(Q){if(this.isVisible()){this.hide();Roo.log("[Roo.Messagebox] Show called while message displayed:");Roo.log("Old Dialog Message:"+F.innerHTML);Roo.log("New Dialog Message:"+Q.msg)}var d=this.getDialog();B=Q;d.setTitle(B.title||"&#160;");
233 d.closeEl.setDisplayed(B.closable!==false);K=G;B.prompt=B.prompt||(B.multiline?true:false);if(B.prompt){if(B.multiline){G.hide();H.show();H.setHeight(typeof B.multiline=="number"?B.multiline:this.defaultTextHeight);K=H;}else{G.show();H.hide();}}else{G.hide();
234 H.hide();}I.setDisplayed(B.progress===true);if(B.progress){d.animate=false;}this.updateProgress(0);K.dom.value=B.value||"";if(B.prompt){A.setDefaultButton(K);}else{var bs=B.buttons;var db=null;if(bs&&bs.ok){db=J["ok"];}else if(bs&&bs.yes){db=J["yes"];}A.setDefaultButton(db);
235 }L=O(B.buttons);this.updateText(B.msg);if(B.cls){d.el.addClass(B.cls);}d.proxyDrag=B.proxyDrag===true;d.modal=B.modal!==false;d.mask=B.modal!==false?C:false;if(!d.isVisible()){document.body.appendChild(A.el.dom);d.animateTarget=null;d.show(Q.animEl);}return this;
236 },progress:function(Q,R){this.show({title:Q,msg:R,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,modal:true});return this;},alert:function(Q,R,fn,S){this.show({title:Q,msg:R,buttons:this.OK,fn:fn,closable:false,scope:S,modal:true}
237 );return this;},wait:function(Q,R){this.show({title:R,msg:Q,buttons:false,closable:false,progress:true,modal:true,width:300,wait:true});D=Roo.TaskMgr.start({run:function(i){Roo.MessageBox.updateProgress(((((i+20)%20)+1)*5)*.01);},interval:1000});return this;
238 },confirm:function(Q,R,fn,S){this.show({title:Q,msg:R,buttons:this.YESNO,fn:fn,scope:S,modal:true});return this;},prompt:function(Q,R,fn,S,T){this.show({title:Q,msg:R,buttons:this.OKCANCEL,fn:fn,minWidth:250,scope:S,prompt:true,multiline:T,modal:true});return this;
239 },OK:{ok:true},YESNO:{yes:true,no:true},OKCANCEL:{ok:true,cancel:true},YESNOCANCEL:{yes:true,no:true,cancel:true},defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}};}();Roo.MessageBox=Roo.MessageBox||Roo.bootstrap.MessageBox;
240 Roo.Msg=Roo.Msg||Roo.MessageBox;
241 // Roo/bootstrap/nav/Bar.js
242 Roo.bootstrap.nav.Bar=function(A){Roo.bootstrap.nav.Bar.superclass.constructor.call(this,A);this.addEvents({"beforetoggle":true});};Roo.extend(Roo.bootstrap.nav.Bar,Roo.bootstrap.Component,{navItems:false,loadMask:false,getAutoCreate:function(){throw {message:"nav bar is now a abstract base class - use NavSimplebar / NavHeaderbar / NavSidebar etc..."}
243 ;},initEvents:function(){this.el.select('.navbar-toggle',true).on('click',this.onToggle,this);var A={tag:"div",cls:"x-dlg-mask"};this.maskEl=Roo.DomHelper.append(this.el,A,true);var B=this.el.getSize();this.maskEl.setSize(B.width,B.height);this.maskEl.enableDisplayMode("block");
244 this.maskEl.hide();if(this.loadMask){this.maskEl.show();}},getChildContainer:function(){if(this.el&&this.el.select('.collapse').getCount()){return this.el.select('.collapse',true).first();}return this.el;},mask:function(){this.maskEl.show();},unmask:function(){this.maskEl.hide();
245 },onToggle:function(){if(this.fireEvent('beforetoggle',this)===false){return;}var ce=this.el.select('.navbar-collapse',true).first();if(!ce.hasClass('show')){this.expand();}else{this.collapse();}},expand:function(){var ce=this.el.select('.navbar-collapse',true).first();
246 if(ce.hasClass('collapsing')){return;}ce.dom.style.height='';ce.addClass('in');ce.removeClass('collapse');ce.addClass('show');var h=ce.getHeight();Roo.log(h);ce.removeClass('show');ce.addClass('collapsing');ce.setHeight(0);ce.on('transitionend',function(){ce.removeClass('collapsing');
247 ce.addClass('show');ce.removeClass('collapse');ce.dom.style.height='';},this,{single:true});ce.setHeight(h);ce.dom.scrollTop=0;},collapse:function(){var ce=this.el.select('.navbar-collapse',true).first();if(ce.hasClass('collapsing')||ce.hasClass('collapse')){return;
248 }ce.removeClass('in');ce.setHeight(ce.getHeight());ce.removeClass('show');ce.addClass('collapsing');ce.on('transitionend',function(){ce.dom.style.height='';ce.removeClass('collapsing');ce.addClass('collapse');},this,{single:true});ce.setHeight(0);}});
249 // Roo/bootstrap/nav/Simplebar.js
250 Roo.bootstrap.nav.Simplebar=function(A){Roo.bootstrap.nav.Simplebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.nav.Simplebar,Roo.bootstrap.nav.Bar,{inverse:false,type:false,arrangement:'',align:false,weight:'light',main:false,tag:false,getAutoCreate:function(){var A={tag:this.tag||'div',cls:'navbar roo-navbar-simple'}
251 ;if(['light','white'].indexOf(this.weight)>-1){A.cls+=['light','white'].indexOf(this.weight)>-1?' navbar-light':' navbar-dark';}A.cls+=' bg-'+this.weight;if(this.inverse){A.cls+=' navbar-inverse';}if(Roo.bootstrap.version==4&&this.xtype=='NavSimplebar'){return A;
252 }A.cn=[{cls:'nav nav-'+this.xtype,tag:'ul'}];this.type=this.type||'nav';if(['tabs','pills'].indexOf(this.type)!=-1){A.cn[0].cls+=' nav-'+this.type}else{if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}A.cn[0].cls+=' navbar-nav'}if(['stacked','justified'].indexOf(this.arrangement)!=-1){A.cn[0].cls+=' nav-'+this.arrangement;
253 }if(this.align==='right'){A.cn[0].cls+=' navbar-right';}return A;}});
254 // Roo/bootstrap/nav/Headerbar.js
255 Roo.bootstrap.nav.Headerbar=function(A){Roo.bootstrap.nav.Headerbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.nav.Headerbar,Roo.bootstrap.nav.Simplebar,{position:'',brand:'',brand_href:false,srButton:true,autohide:false,desktopCenter:false,getAutoCreate:function(){var A={tag:this.nav||'nav',cls:'navbar navbar-expand-md',role:'navigation',cn:[]}
256 ;var cn=A.cn;if(this.desktopCenter){cn.push({cls:'container',cn:[]});cn=cn[0].cn;}if(this.srButton){var B={tag:'button',type:'button',cls:'navbar-toggle navbar-toggler','data-toggle':'collapse',cn:[{tag:'span',cls:'sr-only',html:'Toggle navigation'},{tag:'span',cls:'icon-bar navbar-toggler-icon'}
257 ,{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'}]};cn.push(Roo.bootstrap.version==4?B:{tag:'div',cls:'navbar-header',cn:[B]});}cn.push({tag:'div',cls:Roo.bootstrap.version==4?'nav flex-row roo-navbar-collapse collapse navbar-collapse':'collapse navbar-collapse roo-navbar-collapse',cn:[]}
258 );A.cls+=this.inverse?' navbar-inverse navbar-dark bg-dark':' navbar-default';if(['light','white'].indexOf(this.weight)>-1){A.cls+=['light','white'].indexOf(this.weight)>-1?' navbar-light':' navbar-dark';}A.cls+=' bg-'+this.weight;if(['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1){A.cls+=' navbar-'+this.position+' '+this.position;
259 A.tag=this.tag||(this.position=='fixed-bottom'?'footer':'header');}if(this.brand!==''){var cp=Roo.bootstrap.version==4?cn:cn[0].cn;cp.unshift({tag:'a',href:this.brand_href?this.brand_href:'#',cls:'navbar-brand',cn:[this.brand]});}if(this.main){A.cls+=' main-nav';
260 }return A;},getHeaderChildContainer:function(){if(this.srButton&&this.el.select('.navbar-header').getCount()){return this.el.select('.navbar-header',true).first();}return this.getChildContainer();},getChildContainer:function(){return this.el.select('.roo-navbar-collapse',true).first();
261 },initEvents:function(){Roo.bootstrap.nav.Headerbar.superclass.initEvents.call(this);if(this.autohide){var A=0;var ft=this.el;Roo.get(document).on('scroll',function(e){var ns=Roo.get(document).getScroll().top;var os=A;A=ns;if(ns>os){ft.removeClass('slideDown');
262 ft.addClass('slideUp');return;}ft.removeClass('slideUp');ft.addClass('slideDown');},this);}}});
263 // Roo/bootstrap/nav/Sidebar.js
264 Roo.bootstrap.nav.Sidebar=function(A){Roo.bootstrap.nav.Sidebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.nav.Sidebar,Roo.bootstrap.nav.Bar,{sidebar:true,getAutoCreate:function(){return {tag:'div',cls:'sidebar sidebar-nav'};}});
265 // Roo/bootstrap/nav/Group.js
266 Roo.bootstrap.nav.Group=function(A){Roo.bootstrap.nav.Group.superclass.constructor.call(this,A);this.navItems=[];Roo.bootstrap.nav.Group.register(this);this.addEvents({'changed':true});};Roo.extend(Roo.bootstrap.nav.Group,Roo.bootstrap.Component,{align:'',inverse:false,form:false,type:'nav',navId:'',pilltype:true,navItems:false,getAutoCreate:function(){var A=Roo.apply({}
267 ,Roo.bootstrap.nav.Group.superclass.getAutoCreate.call(this));A={tag:'ul',cls:'nav'};if(Roo.bootstrap.version==4){if(['tabs','pills'].indexOf(this.type)!=-1){A.cls+=' nav-'+this.type;}else{if(this.parent()&&this.parent().xtype!='NavHeaderbar'){A.cls+=' navbar-nav';
268 }}}else{if(['tabs','pills'].indexOf(this.type)!=-1){A.cls+=' nav-'+this.type}else{if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}A.cls+=' navbar-nav'}}if(this.parent()&&this.parent().sidebar){A={tag:'ul',cls:'dashboard-menu sidebar-menu'}
269 ;return A;}if(this.form===true){A={tag:'form',cls:'navbar-form form-inline'};if(this.align==='right'){A.cls+=' navbar-right ml-md-auto';}else{A.cls+=' navbar-left';}}if(this.align==='right'){A.cls+=' navbar-right ml-md-auto';}else{A.cls+=' mr-auto';}if(this.inverse){A.cls+=' navbar-inverse';
270 }return A;},setActiveItem:function(A){var B=false;Roo.each(this.navItems,function(v){if(v==A){return;}if(v.isActive()){v.setActive(false,true);B=v;}});A.setActive(true,true);this.fireEvent('changed',this,A,B);},getActive:function(){var A=false;Roo.each(this.navItems,function(v){if(v.isActive()){A=v;
271 }});return A;},indexOfNav:function(){var A=false;Roo.each(this.navItems,function(v,i){if(v.isActive()){A=i;}});return A;},addItem:function(A){if(this.form&&Roo.bootstrap.version==4){A.tag='div';}var cn=new Roo.bootstrap.nav.Item(A);this.register(cn);cn.parentId=this.id;
272 cn.onRender(this.el,null);return cn;},register:function(A){this.navItems.push(A);A.navId=this.navId;},clearAll:function(){this.navItems=[];this.el.dom.innerHTML='';},getNavItem:function(A){var B=false;Roo.each(this.navItems,function(e){if(e.tabId==A){B=e;
273 return false;}return true;});return B;},setActiveNext:function(){var i=this.indexOfNav(this.getActive());if(i>this.navItems.length){return;}this.setActiveItem(this.navItems[i+1]);},setActivePrev:function(){var i=this.indexOfNav(this.getActive());if(i<1){return;
274 }this.setActiveItem(this.navItems[i-1]);},clearWasActive:function(A){Roo.each(this.navItems,function(e){if(e.tabId!=A.tabId&&e.was_active){e.was_active=false;return false;}return true;});},getWasActive:function(){var r=false;Roo.each(this.navItems,function(e){if(e.was_active){r=e;
275 return false;}return true;});return r;}});Roo.apply(Roo.bootstrap.nav.Group,{groups:{},register:function(A){this.groups[A.navId]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false;}return this.groups[A];}});
276 // Roo/bootstrap/nav/Item.js
277 Roo.bootstrap.nav.Item=function(A){Roo.bootstrap.nav.Item.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true,'scrollto':true});};Roo.extend(Roo.bootstrap.nav.Item,Roo.bootstrap.Component,{href:false,html:'',badge:'',icon:false,fa:false,glyphicon:false,active:false,preventDefault:false,tabId:false,tagtype:'a',tag:'li',disabled:false,animateRef:false,was_active:false,button_weight:'',button_outline:false,linkcls:'',navLink:false,getAutoCreate:function(){var A={tag:this.tag,cls:'nav-item'}
278 ;A.cls=typeof(A.cls)=='undefined'?'':A.cls;if(this.active){A.cls+=' active';}if(this.disabled){A.cls+=' disabled';}if(this.button_weight.length){A.tag=this.href?'a':'button';A.html=this.html||'';A.cls+=' btn btn'+(this.button_outline?'-outline':'')+'-'+this.button_weight;
279 if(this.href){A.href=this.href;}if(this.fa){A.html='<i class="fa fas fa-'+this.fa+'"></i> <span class="nav-html">'+this.html+'</span>';}else{A.cls+=" nav-html";}if(this.badge!==''){A.html+=' <span class="badge badge-secondary">'+this.badge+'</span>';}return A;
280 }if(this.href||this.html||this.glyphicon||this.icon||this.fa){A.cn=[{tag:this.tagtype,href:this.href||"#",html:this.html||'',cls:''}];if(this.tagtype=='a'){A.cn[0].cls='nav-link'+(this.active?' active':'')+' '+this.linkcls;}if(this.icon){A.cn[0].html='<i class="'+this.icon+'"></i> <span class="nav-html">'+A.cn[0].html+'</span>';
281 }else if(this.fa){A.cn[0].html='<i class="fa fas fa-'+this.fa+'"></i> <span class="nav-html">'+A.cn[0].html+'</span>';}else if(this.glyphicon){A.cn[0].html='<span class="glyphicon glyphicon-'+this.glyphicon+'"></span> '+A.cn[0].html;}else{A.cn[0].cls+=" nav-html";
282 }if(this.menu){A.cn[0].html+=" <span class='caret'></span>";}if(this.badge!==''){A.cn[0].html+=' <span class="badge badge-secondary">'+this.badge+'</span>';}}return A;},onRender:function(ct,A){if(Roo.bootstrap.version==4&&ct.dom.type!='ul'){this.tag='div';
283 }var B=Roo.bootstrap.nav.Item.superclass.onRender.call(this,ct,A);this.navLink=this.el.select('.nav-link',true).first();this.htmlEl=this.el.hasClass('nav-html')?this.el:this.el.select('.nav-html',true).first();return B;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype;
284 this.menu.triggerEl=this.el;this.menu=this.addxtype(Roo.apply({},this.menu));}this.el.on('click',this.onClick,this);this.parent().register(this);},onClick:function(e){if(e.getTarget('.dropdown-menu-item')){return;}if(this.preventDefault||this.href===false||this.href==='#'){e.preventDefault();
285 }if(this.disabled){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(tg&&tg.transition){Roo.log("waiting for the transitionend");return;}if(this.fireEvent('click',this,e)===false){return;};if(this.tagtype=='span'){return;}var A=this.el.select('a',true).first();
286 if(A&&this.animateRef&&this.href.indexOf('#')>-1){if(A.dom.href.split("#")[0]!=document.location.toString().split("#")[0]){return;}Roo.log("NavItem - prevent Default?");e.preventDefault();this.scrollToElement(e);}var p=this.parent();if(['tabs','pills'].indexOf(p.type)!==-1&&p.pilltype){if(typeof(p.setActiveItem)!=='undefined'){p.setActiveItem(this);
287 }}if(p.parentType=='NavHeaderbar'&&!this.menu){p.parent().el.select('.roo-navbar-collapse',true).removeClass('in');}},isActive:function(){return this.active},setActive:function(A,B,C){if(this.active&&!A&&this.navId){this.was_active=true;var nv=Roo.bootstrap.nav.Group.get(this.navId);
288 if(nv){nv.clearWasActive(this);}}this.active=A;if(!A){this.el.removeClass('active');this.navLink?this.navLink.removeClass('active'):false;}else if(!this.el.hasClass('active')){this.el.addClass('active');if(Roo.bootstrap.version==4&&this.navLink){this.navLink.addClass('active');
289 }}if(B){this.fireEvent('changed',this,A);}if(!this.navId||!this.tabId||!A||C){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(!tg){return;}var D=tg.getPanelByName(this.tabId);if(!D){return;}if(false==tg.showPanel(D)){var nv=Roo.bootstrap.nav.Group.get(this.navId);
290 if(nv){var E=nv.getWasActive();if(E){E.setActive(true,false,true);}}}},setDisabled:function(A){this.disabled=A;if(!A){this.el.removeClass('disabled');}else if(!this.el.hasClass('disabled')){this.el.addClass('disabled');}},tooltipEl:function(){return this.el;
291 },scrollToElement:function(e){var c=document.body;if(Roo.isFirefox||Roo.isIE||Roo.isIE11){c=document.documentElement;}var A=Roo.get(c).select('a[name='+this.href.split('#')[1]+']',true).first();if(!A){return;}var o=A.calcOffsetsTo(c);var B={target:A,value:o[1]}
292 ;this.fireEvent('scrollto',this,B,e);Roo.get(c).scrollTo('top',B.value,true);return;},setHtml:function(A){this.html=A;this.htmlEl.dom.innerHTML=A;}});
293 // Roo/bootstrap/nav/SidebarItem.js
294 Roo.bootstrap.nav.SidebarItem=function(A){Roo.bootstrap.nav.SidebarItem.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true});};Roo.extend(Roo.bootstrap.nav.SidebarItem,Roo.bootstrap.nav.Item,{badgeWeight:'default',open:false,buttonView:false,buttonWeight:'default',buttonSize:'md',showArrow:true,getAutoCreate:function(){var a={tag:'a',href:this.href||'#',cls:'',html:'',cn:[]}
295 ;if(this.buttonView){a={tag:'button',href:this.href||'#',cls:'btn btn-'+this.buttonWeight+' btn-'+this.buttonSize+'roo-button-dropdown-toggle',html:this.html,cn:[]};}var A={tag:'li',cls:'',cn:[a]};if(this.active){A.cls+=' active';}if(this.disabled){A.cls+=' disabled';
296 }if(this.open){A.cls+=' open x-open';}if(this.glyphicon||this.icon){var c=this.glyphicon?('glyphicon glyphicon-'+this.glyphicon):this.icon;a.cn.push({tag:'i',cls:c});}if(!this.buttonView){var B={tag:'span',html:this.html||''};a.cn.push(B);}if(this.badge!==''){a.cn.push({tag:'span',cls:'badge pull-right badge-'+this.badgeWeight,html:this.badge}
297 );}if(this.menu){if(this.showArrow){a.cn.push({tag:'i',cls:'glyphicon glyphicon-chevron-down pull-right'});}a.cls+=' dropdown-toggle treeview';}return A;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype;this.menu.triggerEl=this.el;
298 this.menu=this.addxtype(Roo.apply({},this.menu));}this.el.on('click',this.onClick,this);if(this.badge!==''){this.badgeEl=this.el.select('.badge',true).first().setVisibilityMode(Roo.Element.DISPLAY);}},onClick:function(e){if(this.disabled){e.preventDefault();
299 return;}if(this.preventDefault){e.preventDefault();}this.fireEvent('click',this,e);},disable:function(){this.setDisabled(true);},enable:function(){this.setDisabled(false);},setDisabled:function(A){if(this.disabled==A){return;}this.disabled=A;if(A){this.el.addClass('disabled');
300 return;}this.el.removeClass('disabled');return;},setActive:function(A){if(this.active==A){return;}this.active=A;if(A){this.el.addClass('active');return;}this.el.removeClass('active');return;},isActive:function(){return this.active;},setBadge:function(A){if(!this.badgeEl){return;
301 }this.badgeEl.dom.innerHTML=A;}});
302 // Roo/bootstrap/nav/ProgressBar.js
303 Roo.bootstrap.nav.ProgressBar=function(A){Roo.bootstrap.nav.ProgressBar.superclass.constructor.call(this,A);this.bullets=this.bullets||[];this.addEvents({'changed':true});};Roo.extend(Roo.bootstrap.nav.ProgressBar,Roo.bootstrap.Component,{bullets:[],barItems:[],getAutoCreate:function(){var A=Roo.apply({}
304 ,Roo.bootstrap.nav.ProgressBar.superclass.getAutoCreate.call(this));A={tag:'div',cls:'roo-navigation-bar-group',cn:[{tag:'div',cls:'roo-navigation-top-bar'},{tag:'div',cls:'roo-navigation-bullets-bar',cn:[{tag:'ul',cls:'roo-navigation-bar'}]},{tag:'div',cls:'roo-navigation-bottom-bar'}
305 ]};return A;},initEvents:function(){},onRender:function(ct,A){Roo.bootstrap.nav.ProgressBar.superclass.onRender.call(this,ct,A);if(this.bullets.length){Roo.each(this.bullets,function(b){this.addItem(b);},this);}this.format();},addItem:function(A){var B=new Roo.bootstrap.nav.ProgressItem(A);
306 B.parentId=this.id;B.render(this.el.select('.roo-navigation-bar',true).first(),null);if(A.html){var C=new Roo.bootstrap.Element({tag:'div',cls:'roo-navigation-bar-text'});var D=new Roo.bootstrap.Element({tag:'div',cls:'roo-navigation-bar-text'});C.onRender(this.el.select('.roo-navigation-top-bar',true).first(),null);
307 D.onRender(this.el.select('.roo-navigation-bottom-bar',true).first(),null);var E=new Roo.bootstrap.Element({tag:'span',html:(typeof(A.position)!='undefined'&&A.position=='top')?A.html:''});var F=new Roo.bootstrap.Element({tag:'span',html:(typeof(A.position)!='undefined'&&A.position=='top')?'':A.html}
308 );E.onRender(C.el,null);F.onRender(D.el,null);B.topEl=C;B.bottomEl=D;}this.barItems.push(B);return B;},getActive:function(){var A=false;Roo.each(this.barItems,function(v){if(!v.isActive()){return;}A=v;return false;});return A;},setActiveItem:function(A){var B=false;
309 Roo.each(this.barItems,function(v){if(v.rid==A.rid){return;}if(v.isActive()){v.setActive(false);B=v;}});A.setActive(true);this.fireEvent('changed',this,A,B);},getBarItem:function(A){var B=false;Roo.each(this.barItems,function(e){if(e.rid!=A){return;}B=e;return false;
310 });return B;},indexOfItem:function(A){var B=false;Roo.each(this.barItems,function(v,i){if(v.rid!=A.rid){return;}B=i;return false});return B;},setActiveNext:function(){var i=this.indexOfItem(this.getActive());if(i>this.barItems.length){return;}this.setActiveItem(this.barItems[i+1]);
311 },setActivePrev:function(){var i=this.indexOfItem(this.getActive());if(i<1){return;}this.setActiveItem(this.barItems[i-1]);},format:function(){if(!this.barItems.length){return;}var A=100/this.barItems.length;Roo.each(this.barItems,function(i){i.el.setStyle('width',A+'%');
312 i.topEl.el.setStyle('width',A+'%');i.bottomEl.el.setStyle('width',A+'%');},this);}});
313 // Roo/bootstrap/nav/ProgressBarItem.js
314 Roo.bootstrap.nav.ProgressBarItem=function(A){Roo.bootstrap.nav.ProgressBarItem.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.nav.ProgressBarItem,Roo.bootstrap.Component,{rid:'',active:false,disabled:false,html:'',position:'bottom',icon:false,getAutoCreate:function(){var A='roo-navigation-bar-item-icon';
315 A+=((this.icon)?(' '+this.icon):(' step-number'));var B={tag:'li',cls:'roo-navigation-bar-item',cn:[{tag:'i',cls:A}]};if(this.active){B.cls+=' active';}if(this.disabled){B.cls+=' disabled';}return B;},disable:function(){this.setDisabled(true);},enable:function(){this.setDisabled(false);
316 },initEvents:function(){this.iconEl=this.el.select('.roo-navigation-bar-item-icon',true).first();this.iconEl.on('click',this.onClick,this);},onClick:function(e){e.preventDefault();if(this.disabled){return;}if(this.fireEvent('click',this,e)===false){return;
317 };this.parent().setActiveItem(this);},isActive:function(){return this.active;},setActive:function(A){if(this.active==A){return;}this.active=A;if(A){this.el.addClass('active');return;}this.el.removeClass('active');return;},setDisabled:function(A){if(this.disabled==A){return;
318 }this.disabled=A;if(A){this.el.addClass('disabled');return;}this.el.removeClass('disabled');},tooltipEl:function(){return this.el.select('.roo-navigation-bar-item-icon',true).first();;}});
319 // Roo/bootstrap/breadcrumb/Nav.js
320 Roo.namespace('Roo.bootstrap.breadcrumb');Roo.bootstrap.breadcrumb.Nav=function(A){Roo.bootstrap.breadcrumb.Nav.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.breadcrumb.Nav,Roo.bootstrap.Component,{getAutoCreate:function(){var A={tag:'nav',cn:[{tag:'ol',cls:'breadcrumb'}
321 ]};return A;},initEvents:function(){this.olEl=this.el.select('ol',true).first();},getChildContainer:function(){return this.olEl;}});
322 // Roo/bootstrap/breadcrumb/Item.js
323 Roo.bootstrap.breadcrumb.Item=function(A){Roo.bootstrap.breadcrumb.Item.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.breadcrumb.Item,Roo.bootstrap.Component,{href:false,html:'',getAutoCreate:function(){var A={tag:'li',cls:'breadcrumb-item'+(this.active?' active':'')}
324 ;if(this.href!==false){A.cn=[{tag:'a',href:this.href,html:this.html}];}else{A.html=this.html;}return A;},initEvents:function(){if(this.href){this.el.select('a',true).first().on('click',this.onClick,this)}},onClick:function(e){e.preventDefault();this.fireEvent('click',this,e);
325 }});
326 // Roo/bootstrap/Row.js
327 Roo.bootstrap.Row=function(A){Roo.bootstrap.Row.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Row,Roo.bootstrap.Component,{getAutoCreate:function(){return {cls:'row clearfix'};}});
328 // Roo/bootstrap/Pagination.js
329 Roo.bootstrap.Pagination=function(A){Roo.bootstrap.Pagination.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Pagination,Roo.bootstrap.Component,{cls:false,size:false,inverse:false,getAutoCreate:function(){var A={tag:'ul',cls:'pagination'};if(this.inverse){A.cls+=' inverse';
330 }if(this.html){A.html=this.html;}if(this.cls){A.cls+=" "+this.cls;}return A;}});
331 // Roo/bootstrap/PaginationItem.js
332 Roo.bootstrap.PaginationItem=function(A){Roo.bootstrap.PaginationItem.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.PaginationItem,Roo.bootstrap.Component,{href:false,html:false,preventDefault:true,active:false,cls:false,disabled:false,getAutoCreate:function(){var A={tag:'li',cn:[{tag:'a',href:this.href?this.href:'#',html:this.html?this.html:''}
333 ]};if(this.cls){A.cls=this.cls;}if(this.disabled){A.cls=typeof(A.cls)!=='undefined'?A.cls+' disabled':'disabled';}if(this.active){A.cls=typeof(A.cls)!=='undefined'?A.cls+' active':'active';}return A;},initEvents:function(){this.el.on('click',this.onClick,this);
334 },onClick:function(e){Roo.log('PaginationItem on click ');if(this.preventDefault){e.preventDefault();}if(this.disabled){return;}this.fireEvent('click',this,e);}});
335 // Roo/bootstrap/Slider.js
336 Roo.bootstrap.Slider=function(A){Roo.bootstrap.Slider.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Slider,Roo.bootstrap.Component,{getAutoCreate:function(){var A={tag:'div',cls:'slider slider-sample1 vertical-handler ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all',cn:[{tag:'a',cls:'ui-slider-handle ui-state-default ui-corner-all'}
337 ]};return A;}});
338 // Roo/grid/SplitDragZone.js
339 Roo.grid.SplitDragZone=function(A,hd,B){this.grid=A;this.view=A.getView();this.proxy=this.view.resizeProxy;Roo.grid.SplitDragZone.superclass.constructor.call(this,hd,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Roo.id(this.proxy.dom),resizeFrame:false}
340 );this.setHandleElId(Roo.id(hd));if(B!==false){this.setOuterHandleElId(Roo.id(B));}this.scroll=false;};Roo.extend(Roo.grid.SplitDragZone,Roo.dd.DDProxy,{fly:Roo.Element.fly,b4StartDrag:function(x,y){this.view.headersDisabled=true;var h=this.view.mainWrap?this.view.mainWrap.getHeight():(this.view.headEl.getHeight()+this.view.bodyEl.getHeight());
341 this.proxy.setHeight(h);var w=this.cm.getColumnWidth(this.cellIndex);if(!this.view.mainWrap){w=this.view.getHeaderIndex(this.cellIndex).getWidth();}var A=Math.max(w-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(A,1000);this.setYConstraint(0,0);
342 this.minX=x-A;this.maxX=x+1000;this.startPos=x;if(!this.view.mainWrap){this.getDragEl().style.display='block';}Roo.dd.DDProxy.prototype.b4StartDrag.call(this,x,y);},handleMouseDown:function(e){ev=Roo.EventObject.setEvent(e);var t=this.fly(ev.getTarget());
343 if(t.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(t.dom);this.split=t.dom;this.cm=this.grid.colModel;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Roo.grid.SplitDragZone.superclass.handleMouseDown.apply(this,arguments);
344 }}},endDrag:function(e){this.view.headersDisabled=false;var A=Math.max(this.minX,Roo.lib.Event.getPageX(e));var B=A-this.startPos;var w=this.cm.getColumnWidth(this.cellIndex);if(!this.view.mainWrap){w=0;}this.view.onColumnSplitterMoved(this.cellIndex,w+B);
345 },autoOffset:function(){this.setDelta(0,0);}});
346 // Roo/grid/AbstractSelectionModel.js
347 Roo.grid.AbstractSelectionModel=function(){this.locked=false;Roo.grid.AbstractSelectionModel.superclass.constructor.call(this);};Roo.extend(Roo.grid.AbstractSelectionModel,Roo.util.Observable,{init:function(A){this.grid=A;this.initEvents();},lock:function(){this.locked=true;
348 },unlock:function(){this.locked=false;},isLocked:function(){return this.locked;}});
349 // Roo/grid/RowSelectionModel.js
350 Roo.grid.RowSelectionModel=function(A){Roo.apply(this,A);this.selections=new Roo.util.MixedCollection(false,function(o){return o.id;});this.last=false;this.lastActive=false;this.addEvents({"selectionchange":true,"afterselectionchange":true,"beforerowselect":true,"rowselect":true,"rowdeselect":true}
351 );Roo.grid.RowSelectionModel.superclass.constructor.call(this);this.locked=false;};Roo.extend(Roo.grid.RowSelectionModel,Roo.grid.AbstractSelectionModel,{singleSelect:false,initEvents:function(){if(!this.grid.enableDragDrop&&!this.grid.enableDrag){this.grid.on("mousedown",this.handleMouseDown,this);
352 }else{this.grid.on("rowclick",this.handleDragableRowClick,this);}var A=this.grid.view?this.grid.view:this.grid;this.rowNav=new Roo.KeyNav(this.grid.getGridEl(),{"up":function(e){if(!e.shiftKey){this.selectPrevious(e.shiftKey);}else if(this.last!==false&&this.lastActive!==false){var B=this.last;
353 this.selectRange(this.last,this.lastActive-1);A.focusRow(this.lastActive);if(B!==false){this.last=B;}}else{this.selectFirstRow();}this.fireEvent("afterselectionchange",this);},"down":function(e){if(!e.shiftKey){this.selectNext(e.shiftKey);}else if(this.last!==false&&this.lastActive!==false){var B=this.last;
354 this.selectRange(this.last,this.lastActive+1);A.focusRow(this.lastActive);if(B!==false){this.last=B;}}else{this.selectFirstRow();}this.fireEvent("afterselectionchange",this);},scope:this});A.on("refresh",this.onRefresh,this);A.on("rowupdated",this.onRowUpdated,this);
355 A.on("rowremoved",this.onRemove,this);},onRefresh:function(){var ds=this.grid.ds,i,v=this.grid.view;var s=this.selections;s.each(function(r){if((i=ds.indexOfId(r.id))!=-1){v.onRowSelect(i);s.add(ds.getAt(i));}else{s.remove(r);}});},onRemove:function(v,A,r){this.selections.remove(r);
356 },onRowUpdated:function(v,A,r){if(this.isSelected(r)){v.onRowSelect(A);}},selectRecords:function(A,B){if(!B){this.clearSelections();}var ds=this.grid.ds;for(var i=0,C=A.length;i<C;i++){this.selectRow(ds.indexOf(A[i]),true);}},getCount:function(){return this.selections.length;
357 },selectFirstRow:function(){this.selectRow(0);},selectLastRow:function(A){this.selectRow(this.grid.ds.getCount()-1,A);},selectNext:function(A){if(this.last!==false&&(this.last+1)<this.grid.ds.getCount()){this.selectRow(this.last+1,A);var B=this.grid.view?this.grid.view:this.grid;
358 B.focusRow(this.last);}},selectPrevious:function(A){if(this.last){this.selectRow(this.last-1,A);var B=this.grid.view?this.grid.view:this.grid;B.focusRow(this.last);}},getSelections:function(){return [].concat(this.selections.items);},getSelected:function(){return this.selections.itemAt(0);
359 },clearSelections:function(A){if(this.locked){return;}if(A!==true){var ds=this.grid.ds;var s=this.selections;s.each(function(r){this.deselectRow(ds.indexOfId(r.id));},this);s.clear();}else{this.selections.clear();}this.last=false;},selectAll:function(){if(this.locked){return;
360 }this.selections.clear();for(var i=0,A=this.grid.ds.getCount();i<A;i++){this.selectRow(i,true);}},hasSelection:function(){return this.selections.length>0;},isSelected:function(A){var r=typeof A=="number"?this.grid.ds.getAt(A):A;return (r&&this.selections.key(r.id)?true:false);
361 },isIdSelected:function(id){return (this.selections.key(id)?true:false);},handleMouseDown:function(e,t){var A=this.grid.view?this.grid.view:this.grid;var B;if(this.isLocked()||(B=A.findRowIndex(t))===false){return;};if(e.shiftKey&&this.last!==false){var C=this.last;
362 this.selectRange(C,B,e.ctrlKey);this.last=C;A.focusRow(B);}else{var D=this.isSelected(B);if(e.button!==0&&D){A.focusRow(B);}else if(e.ctrlKey&&D){this.deselectRow(B);}else if(!D){this.selectRow(B,e.button===0&&(e.ctrlKey||e.shiftKey));A.focusRow(B);}}this.fireEvent("afterselectionchange",this);
363 },handleDragableRowClick:function(A,B,e){if(e.button===0&&!e.shiftKey&&!e.ctrlKey){this.selectRow(B,false);var C=this.grid.view?this.grid.view:this.grid;C.focusRow(B);this.fireEvent("afterselectionchange",this);}},selectRows:function(A,B){if(!B){this.clearSelections();
364 }for(var i=0,C=A.length;i<C;i++){this.selectRow(A[i],true);}},selectRange:function(A,B,C){if(this.locked){return;}if(!C){this.clearSelections();}if(A<=B){for(var i=A;i<=B;i++){this.selectRow(i,true);}}else{for(var i=A;i>=B;i--){this.selectRow(i,true);}}},deselectRange:function(A,B,C){if(this.locked){return;
365 }for(var i=A;i<=B;i++){this.deselectRow(i,C);}},selectRow:function(A,B,C){if(this.locked||(A<0||A>=this.grid.ds.getCount())){return;}if(this.fireEvent("beforerowselect",this,A,B)!==false){if(!B||this.singleSelect){this.clearSelections();}var r=this.grid.ds.getAt(A);
366 this.selections.add(r);this.last=this.lastActive=A;if(!C){var D=this.grid.view?this.grid.view:this.grid;D.onRowSelect(A);}this.fireEvent("rowselect",this,A,r);this.fireEvent("selectionchange",this);}},deselectRow:function(A,B){if(this.locked){return;}if(this.last==A){this.last=false;
367 }if(this.lastActive==A){this.lastActive=false;}var r=this.grid.ds.getAt(A);this.selections.remove(r);if(!B){var C=this.grid.view?this.grid.view:this.grid;C.onRowDeselect(A);}this.fireEvent("rowdeselect",this,A);this.fireEvent("selectionchange",this);},restoreLast:function(){if(this._last){this.last=this._last;
368 }},acceptsNav:function(A,B,cm){return !cm.isHidden(B)&&cm.isCellEditable(B,A);},onEditorKey:function(A,e){var k=e.getKey(),B,g=this.grid,ed=g.activeEditor;if(k==e.TAB){e.stopEvent();ed.completeEdit();if(e.shiftKey){B=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this);
369 }else{B=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}}else if(k==e.ENTER&&!e.ctrlKey){e.stopEvent();ed.completeEdit();if(e.shiftKey){B=g.walkCells(ed.row-1,ed.col,-1,this.acceptsNav,this);}else{B=g.walkCells(ed.row+1,ed.col,1,this.acceptsNav,this);
370 }}else if(k==e.ESC){ed.cancelEdit();}if(B){g.startEditing(B[0],B[1]);}}});
371 // Roo/grid/ColumnModel.js
372 Roo.grid.ColumnModel=function(A){this.config=[];this.lookup={};for(var i=0,B=A.length;i<B;i++){this.addColumn(A[i]);}this.defaultWidth=100;this.defaultSortable=false;this.addEvents({"widthchange":true,"headerchange":true,"hiddenchange":true,"columnmoved":true,"columnlockchange":true}
373 );Roo.grid.ColumnModel.superclass.constructor.call(this);};Roo.extend(Roo.grid.ColumnModel,Roo.util.Observable,{getColumnId:function(A){return this.config[A].id;},getColumnById:function(id){return this.lookup[id];},getColumnByDataIndex:function(A){var B=this.findColumnIndex(A);
374 return B>-1?this.config[B]:false;},getIndexById:function(id){for(var i=0,A=this.config.length;i<A;i++){if(this.config[i].id==id){return i;}}return -1;},findColumnIndex:function(A){for(var i=0,B=this.config.length;i<B;i++){if(this.config[i].dataIndex==A){return i;
375 }}return -1;},moveColumn:function(A,B){var c=this.config[A];this.config.splice(A,1);this.config.splice(B,0,c);this.dataMap=null;this.fireEvent("columnmoved",this,A,B);},isLocked:function(A){return this.config[A].locked===true;},setLocked:function(A,B,C){if(this.isLocked(A)==B){return;
376 }this.config[A].locked=B;if(!C){this.fireEvent("columnlockchange",this,A,B);}},getTotalLockedWidth:function(){var A=0;for(var i=0;i<this.config.length;i++){if(this.isLocked(i)&&!this.isHidden(i)){this.totalWidth+=this.getColumnWidth(i);}}return A;},getLockedCount:function(){for(var i=0,A=this.config.length;
377 i<A;i++){if(!this.isLocked(i)){return i;}}return this.config.length;},getColumnCount:function(A){if(A===true){var c=0;for(var i=0,B=this.config.length;i<B;i++){if(!this.isHidden(i)){c++;}}return c;}return this.config.length;},getColumnsBy:function(fn,A){var r=[];
378 for(var i=0,B=this.config.length;i<B;i++){var c=this.config[i];if(fn.call(A||this,c,i)===true){r[r.length]=c;}}return r;},isSortable:function(A){if(typeof this.config[A].sortable=="undefined"){return this.defaultSortable;}return this.config[A].sortable;},getRenderer:function(A){if(!this.config[A].renderer){return Roo.grid.ColumnModel.defaultRenderer;
379 }return this.config[A].renderer;},setRenderer:function(A,fn){this.config[A].renderer=fn;},getColumnWidth:function(A,B){var C=this.config[A];if(typeof(B)=='undefined'){return C.width*1||this.defaultWidth;}if(B===false){return C.width||false;}var D=['xl','lg','md','sm','xs'];
380 for(var i=D.indexOf(B);i<D.length;i++){if(typeof(C[D[i]])=='undefined'){continue;}return C[D[i]];}return 1;},setColumnWidth:function(A,B,C){this.config[A].width=B;this.totalWidth=null;if(!C){this.fireEvent("widthchange",this,A,B);}},getTotalWidth:function(A){if(!this.totalWidth){this.totalWidth=0;
381 for(var i=0,B=this.config.length;i<B;i++){if(A||!this.isHidden(i)){this.totalWidth+=this.getColumnWidth(i);}}}return this.totalWidth;},getColumnHeader:function(A){return this.config[A].header;},setColumnHeader:function(A,B){this.config[A].header=B;this.fireEvent("headerchange",this,A,B);
382 },getColumnTooltip:function(A){return this.config[A].tooltip;},setColumnTooltip:function(A,B){this.config[A].tooltip=B;},getDataIndex:function(A){return this.config[A].dataIndex;},setDataIndex:function(A,B){this.config[A].dataIndex=B;},isCellEditable:function(A,B){return (this.config[A].editable||(typeof this.config[A].editable=="undefined"&&this.config[A].editor))?true:false;
383 },getCellEditor:function(A,B){return this.config[A].editor;},setEditable:function(A,B){this.config[A].editable=B;},isHidden:function(A){return this.config[A].hidden;},isFixed:function(A){return this.config[A].fixed;},isResizable:function(A){return A>=0&&this.config[A].resizable!==false&&this.config[A].fixed!==true;
384 },setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;},addColumn:function(c){var i=this.config.length;this.config[i]=c;if(typeof c.dataIndex=="undefined"){c.dataIndex=i;
385 }if(typeof c.renderer=="string"){c.renderer=Roo.util.Format[c.renderer];}if(typeof c.id=="undefined"){c.id=Roo.id();}if(c.editor&&c.editor.xtype){c.editor=Roo.factory(c.editor,Roo.grid);}if(c.editor&&c.editor.isFormField){c.editor=new Roo.grid.GridEditor(c.editor);
386 }this.lookup[c.id]=c;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="object"){return A;}if(typeof A=="string"&&A.length<1){return "&#160;";}return String.format("{0}",A);};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel;
387 // Roo/LoadMask.js
388 Roo.LoadMask=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(this.store){this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this);this.removeMask=false;}else{var um=this.el.getUpdateManager();
389 um.showLoadIndicator=false;um.on('beforeupdate',this.onBeforeLoad,this);um.on('update',this.onLoad,this);um.on('failure',this.onLoad,this);this.removeMask=true;}};Roo.LoadMask.prototype={removeMask:false,msg:'Loading...',msgCls:'x-mask-loading',disabled:false,disable:function(){this.disabled=true;
390 },enable:function(){this.disabled=false;},onLoadException:function(){Roo.log(arguments);if(typeof(arguments[3])!='undefined'){Roo.MessageBox.alert("Error loading",arguments[3]);}(function(){this.el.unmask(this.removeMask);}).defer(50,this);},onLoad:function(){(function(){this.el.unmask(this.removeMask);
391 }).defer(50,this);},onBeforeLoad:function(){if(!this.disabled){(function(){this.el.mask(this.msg,this.msgCls);}).defer(50,this);}},destroy:function(){if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);
392 this.store.un('loadexception',this.onLoadException,this);}else{var um=this.el.getUpdateManager();um.un('beforeupdate',this.onBeforeLoad,this);um.un('update',this.onLoad,this);um.un('failure',this.onLoad,this);}}};
393 // Roo/bootstrap/Table.js
394 Roo.bootstrap.Table=function(A){Roo.bootstrap.Table.superclass.constructor.call(this,A);this.rowSelection=(typeof(A.rowSelection)!='undefined')?A.rowSelection:this.rowSelection;this.cellSelection=(typeof(A.cellSelection)!='undefined')?A.cellSelection:this.cellSelection;
395 this.headerShow=(typeof(A.thead)!='undefined')?A.thead:this.headerShow;this.footerShow=(typeof(A.tfoot)!='undefined')?A.tfoot:this.footerShow;this.view=this;this.sm=this.sm||{xtype:'RowSelectionModel'};if(this.sm){this.sm.grid=this;this.selModel=Roo.factory(this.sm,Roo.grid);
396 this.sm=this.selModel;this.sm.xmodule=this.xmodule||false;}if(this.cm&&typeof(this.cm.config)=='undefined'){this.colModel=new Roo.grid.ColumnModel(this.cm);this.cm=this.colModel;this.cm.xmodule=this.xmodule||false;}if(this.store){this.store=Roo.factory(this.store,Roo.data);
397 this.ds=this.store;this.ds.xmodule=this.xmodule||false;}if(this.footer&&this.store){this.footer.dataSource=this.ds;this.footer=Roo.factory(this.footer);}this.addEvents({"cellclick":true,"celldblclick":true,"rowclick":true,"rowdblclick":true,"mouseover":true,"mouseout":true,'rowclass':true,'rowsrendered':true,"contextmenu":true,"rowcontextmenu":true,"cellcontextmenu":true,"headercontextmenu":true,"mousedown":true}
398 );};Roo.extend(Roo.bootstrap.Table,Roo.bootstrap.Component,{cls:false,empty_results:'',striped:false,scrollBody:false,bordered:false,hover:false,condensed:false,responsive:false,sm:false,cm:false,store:false,loadMask:false,footerShow:true,headerShow:true,enableColumnResize:true,rowSelection:false,cellSelection:false,layout:false,minColumnWidth:50,bodyEl:false,headEl:false,resizeProxy:false,container:false,lazyLoad:false,CSS:Roo.util.CSS,auto_hide_footer:false,view:false,getAutoCreate:function(){var A=Roo.apply({}
399 ,Roo.bootstrap.Table.superclass.getAutoCreate.call(this));A={tag:'table',cls:'table',cn:[]};if(this.scrollBody){A.cls+=' table-body-fixed';}if(this.striped){A.cls+=' table-striped';}if(this.hover){A.cls+=' table-hover';}if(this.bordered){A.cls+=' table-bordered';
400 }if(this.condensed){A.cls+=' table-condensed';}if(this.responsive){A.cls+=' table-responsive';}if(this.cls){A.cls+=' '+this.cls;}if(this.layout){A.style=(typeof(A.style)=='undefined')?('table-layout:'+this.layout+';'):(A.style+('table-layout:'+this.layout+';'));
401 }if(this.store||this.cm){if(this.headerShow){A.cn.push(this.renderHeader());}A.cn.push(this.renderBody());if(this.footerShow){A.cn.push(this.renderFooter());}}return {cn:[A]};},initEvents:function(){if(!this.store||!this.cm){return;}if(this.selModel){this.selModel.initEvents();
402 }this.bodyEl=this.el.select('tbody',true).first();this.headEl=this.el.select('thead',true).first();this.mainFoot=this.el.select('tfoot',true).first();Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',this.sort,this);},this);
403 if(this.footer){this.footer.parentId=this.id;this.footer.onRender(this.el.select('tfoot tr td').first(),null);if(this.lazyLoad){this.el.select('tfoot tr td').first().addClass('hide');}}if(this.loadMask){this.maskEl=new Roo.LoadMask(this.el,{store:this.ds,msgCls:'roo-el-mask-msg'}
404 );}this.store.on('load',this.onLoad,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('update',this.onUpdate,this);this.store.on('add',this.onAdd,this);this.store.on("clear",this.clear,this);this.el.on("contextmenu",this.onContextMenu,this);
405 this.cm.on("headerchange",this.onHeaderChange,this);this.cm.on("hiddenchange",this.onHiddenChange,this,arguments);this.bodyEl.on("click",this.onClick,this);this.bodyEl.on("dblclick",this.onDblClick,this);this.bodyEl.on('scroll',this.onBodyScroll,this);this.relayEvents(this.bodyEl,["mousedown","mouseup","mouseover","mouseout","keypress"]);
406 this.resizeProxy=Roo.get(document.body).createChild({cls:"x-grid-resize-proxy",html:'&#160;'});if(this.headEl&&this.enableColumnResize!==false&&Roo.grid.SplitDragZone){new Roo.grid.SplitDragZone(this,this.headEl.dom,false);}this.initCSS();},getView:function(){return this;
407 },initCSS:function(){var cm=this.cm,A=[];this.CSS.removeStyleSheet(this.id+'-cssrules');var B=this.headEl?this.headEl.dom.clientHeight:0;var sz=Roo.getGridSize();var C=0;var D=-1;var E=[];var F=0;for(var i=0,G=cm.getColumnCount();i<G;i++){var w=cm.getColumnWidth(i,false);
408 if(cm.isHidden(i)){E.push({rel:false,abs:0});continue;}if(w!==false){E.push({rel:false,abs:w});F+=w;D=i;continue;}var w=cm.getColumnWidth(i,sz);if(w>0){D=i}C+=w;E.push({rel:w,abs:false});}var H=this.bodyEl.dom.clientWidth-F;var I=Math.floor(H/C);var J=H-(I*C);
409 var K,L,M=0,N,O;for(var i=0,G=cm.getColumnCount();i<G;i++){K='display:none;';O='';L='width:0px;';N='';if(!cm.isHidden(i)){K='';var w=E[i].rel==false?E[i].abs:(E[i].rel*I);if(w===0){K='display:none;';}if(i==D){w+=J;}M+=w;O="left:"+(M-4)+"px;";L="width:"+w+"px;";
410 }if(this.responsive){L='';O='';K=cm.isHidden(i)?'display:none;':'';N='display: none;';}A.push('#',this.id,' .x-col-',i," {",cm.config[i].css,L,K,"}\n");if(this.headEl){if(i==D){N='display:none;';}A.push('#',this.id,' .x-hcol-',i," { ",L,K," }\n",'#',this.id,' .x-grid-split-',i," { ",O,N,'height:',(B-4),"px;}\n",'.popover-inner #',this.id,' .x-grid-split-',i," { ",O,N,'height:',100,"%;}\n");
411 }}this.CSS.createStyleSheet(A.join(''),this.id+'-cssrules');},onContextMenu:function(e,t){this.processEvent("contextmenu",e);},processEvent:function(A,e){if(A!='touchstart'){this.fireEvent(A,e);}var t=e.getTarget();var B=Roo.get(t);if(!B){return;}if(B.findParent('tfoot',false,true)){return;
412 }if(B.findParent('thead',false,true)){if(e.getTarget().nodeName.toLowerCase()!='th'){B=Roo.get(t).findParent('th',false,true);if(!B){Roo.log("failed to find th in thead?");Roo.log(e.getTarget());return;}}var C=B.dom.cellIndex;var D=A=='touchstart'?'click':A;
413 this.fireEvent("header"+D,this,C,e);return;}if(e.getTarget().nodeName.toLowerCase()!='td'){B=Roo.get(t).findParent('td',false,true);if(!B){Roo.log("failed to find th in tbody?");Roo.log(e.getTarget());return;}}var E=B.findParent('tr',false,true);var C=B.dom.cellIndex;
414 var F=E.dom.rowIndex-1;if(E!==false){this.fireEvent("row"+A,this,F,e);if(B!==false){this.fireEvent("cell"+A,this,F,C,e);}}},onMouseover:function(e,el){var A=Roo.get(el);if(!A){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);
415 }var B=A.findParent('tr',false,true);var C=A.dom.cellIndex;var D=B.dom.rowIndex-1;this.fireEvent('mouseover',this,A,D,C,e);},onMouseout:function(e,el){var A=Roo.get(el);if(!A){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);
416 }var B=A.findParent('tr',false,true);var C=A.dom.cellIndex;var D=B.dom.rowIndex-1;this.fireEvent('mouseout',this,A,D,C,e);},onClick:function(e,el){var A=Roo.get(el);if(!A||(!this.cellSelection&&!this.rowSelection)){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);
417 }if(!A||typeof(A)=='undefined'){return;}var B=A.findParent('tr',false,true);if(!B||typeof(B)=='undefined'){return;}var C=A.dom.cellIndex;var D=this.getRowIndex(B);this.fireEvent('cellclick',this,A,D,C,e);this.fireEvent('rowclick',this,B,D,e);},onDblClick:function(e,el){var A=Roo.get(el);
418 if(!A||(!this.cellSelection&&!this.rowSelection)){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);}if(!A||typeof(A)=='undefined'){return;}var B=A.findParent('tr',false,true);if(!B||typeof(B)=='undefined'){return;}var C=A.dom.cellIndex;
419 var D=this.getRowIndex(B);if(this.cellSelection){this.fireEvent('celldblclick',this,A,D,C,e);}if(this.rowSelection){this.fireEvent('rowdblclick',this,B,D,e);}},findRowIndex:function(el){var A=Roo.get(el);if(!A){return false;}var B=A.findParent('tr',false,true);
420 if(!B||typeof(B)=='undefined'){return false;}return this.getRowIndex(B);},sort:function(e,el){var A=Roo.get(el);if(!A.hasClass('sortable')){return;}var B=A.attr('sort');var C='ASC';if(A.select('i',true).first().hasClass('fa-arrow-up')){C='DESC';}this.store.sortInfo={field:B,direction:C}
421 ;if(this.footer){Roo.log("calling footer first");this.footer.onClick('first');}else{this.store.load({params:{start:0}});}},renderHeader:function(){var A={tag:'thead',cn:[]};var cm=this.cm;this.totalWidth=0;for(var i=0,B=cm.getColumnCount();i<B;i++){var C=cm.config[i];
422 var c={tag:'th',cls:'x-hcol-'+i,style:'',html:cm.getColumnHeader(i)};var D=cm.getColumnTooltip(i);if(D){c.tooltip=D;}var hh='';if(typeof(C.sortable)!='undefined'&&C.sortable){c.cls+=' sortable';c.html='<i class="fa"></i>'+c.html;}if(typeof(C.lgHeader)!='undefined'){hh+='<span class="hidden-xs hidden-sm hidden-md ">'+C.lgHeader+'</span>';
423 }if(typeof(C.mdHeader)!='undefined'){hh+='<span class="hidden-xs hidden-sm hidden-lg">'+C.mdHeader+'</span>';}if(typeof(C.smHeader)!='undefined'){hh+='<span class="hidden-xs hidden-md hidden-lg">'+C.smHeader+'</span>';}if(typeof(C.xsHeader)!='undefined'){hh+='<span class="hidden-sm hidden-md hidden-lg">'+C.xsHeader+'</span>';
424 }if(hh.length){c.html=hh;}if(typeof(C.tooltip)!='undefined'){c.tooltip=C.tooltip;}if(typeof(C.colspan)!='undefined'){c.colspan=C.colspan;}if(typeof(C.dataIndex)!='undefined'){c.sort=C.dataIndex;}if(typeof(C.align)!='undefined'&&C.align.length){c.style+=' text-align:'+C.align+';';
425 }if(typeof(C.cls)!='undefined'){c.cls=(typeof(c.cls)=='undefined')?C.cls:(c.cls+' '+C.cls);}if(this.responsive){['xs','sm','md','lg'].map(function(E){if(typeof(C[E])=='undefined'){return;}if(!C[E]){c.cls+=' hidden-'+E+' hidden'+E+'-down';return;}c.cls+=' col-'+E+'-'+C[E]+(E=='xs'?(' col-'+C[E]):'');
426 });}c.html+=' <span class="x-grid-split x-grid-split-'+i+'"></span>';A.cn.push(c)}return A;},renderBody:function(){var A={tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A;},renderFooter:function(){var A={tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}
427 ]}]};return A;},onLoad:function(){this.clear();var A=this;var cm=this.cm;var ds=this.store;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.select('i',true).removeClass(['fa-arrow-up','fa-arrow-down']);if(A.store.sortInfo){if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='ASC'){e.select('i',true).addClass(['fa-arrow-up']);
428 }if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='DESC'){e.select('i',true).addClass(['fa-arrow-down']);}}});var B=this.bodyEl;if(ds.getCount()>0){ds.data.each(function(d,E){var F=this.renderRow(cm,ds,E);
429 B.createChild(F);var G=this;if(F.cellObjects.length){Roo.each(F.cellObjects,function(r){G.renderCellObject(r);})}},this);}else if(this.empty_results.length){this.el.mask(this.empty_results,'no-spinner');}var C=this.el.select('tfoot',true).first();if(this.footerShow&&this.auto_hide_footer&&this.mainFoot){this.mainFoot.setVisibilityMode(Roo.Element.DISPLAY).hide();
430 var D=this.ds.getTotalCount();if(this.footer.pageSize<D){this.mainFoot.show();}}Roo.each(this.el.select('tbody td',true).elements,function(e){e.on('mouseover',A.onMouseover,A);});Roo.each(this.el.select('tbody td',true).elements,function(e){e.on('mouseout',A.onMouseout,A);
431 });this.fireEvent('rowsrendered',this);this.autoSize();this.initCSS();},onUpdate:function(ds,A){this.refreshRow(A);this.autoSize();},onRemove:function(ds,A,B,C){if(C!==true){this.fireEvent("beforerowremoved",this,B,A);}var bt=this.bodyEl.dom;var D=this.el.select('tbody > tr',true).elements;
432 if(typeof(D[B])!='undefined'){bt.removeChild(D[B].dom);}if(C!==true){this.fireEvent("rowremoved",this,B,A);}},onAdd:function(ds,A,B){var bt=this.bodyEl.dom;for(var i=0;i<A.length;i++){this.insertRow(this.store,B+i,false);return;}},refreshRow:function(A){var ds=this.store,B;
433 if(typeof A=='number'){B=A;A=ds.getAt(B);}else{B=ds.indexOf(A);if(B<0){return;}}this.insertRow(ds,B,true);this.autoSize();this.onRemove(ds,A,B+1,true);this.autoSize();this.fireEvent("rowupdated",this,B,A);},onRowSelect:function(A){var B=this.getRowDom(A);
434 B.addClass(['bg-info','info']);},onRowDeselect:function(A){if(A<0){return;}var B=this.getRowDom(A);B.removeClass(['bg-info','info']);},focusRow:function(A){var x=this.bodyEl.dom.scrollLeft;this.focusCell(A,0,false);this.bodyEl.dom.scrollLeft=x;},focusCell:function(A,B,C){var el=this.ensureVisible(A,B,C);
435 },ensureVisible:function(A,B,C){if(typeof A!="number"){A=A.rowIndex;}if(A<0&&A>=this.ds.getCount()){return null;}B=(B!==undefined?B:0);var cm=this.cm;while(cm.isHidden(B)){B++;}var el=this.getCellDom(A,B);if(!el){return null;}var c=this.bodyEl.dom;var D=parseInt(el.offsetTop,10);
436 var E=parseInt(el.offsetLeft,10);var F=D+el.offsetHeight;var G=E+el.offsetWidth;var ch=0;var H=parseInt(c.scrollTop,10);var I=parseInt(c.scrollLeft,10);var J=H+ch;var K=I+c.clientWidth;if(D<H){c.scrollTop=D;}else if(F>J){c.scrollTop=F-ch;}if(C!==false){if(E<I){c.scrollLeft=E;
437 }else if(G>K){c.scrollLeft=G-c.clientWidth;}}return el;},insertRow:function(dm,A,B){if(!B){this.fireEvent("beforerowsinserted",this,A);}var C=this.renderRow(this.cm,this.store,A);var e=this.bodyEl.createChild(C,this.getRowDom(A));var D=this;if(C.cellObjects.length){Roo.each(C.cellObjects,function(r){D.renderCellObject(r);
438 })}if(!B){this.fireEvent("rowsinserted",this,A);}},getRowDom:function(A){var B=this.el.select('tbody > tr',true).elements;return (typeof(B[A])=='undefined')?false:B[A];},getCellDom:function(A,B){var C=this.getRowDom(A);if(C===false){return false;}var D=C.select('td',true).elements;
439 return (typeof(D[B])=='undefined')?false:D[B];},renderRow:function(cm,ds,A){var d=ds.getAt(A);var B={tag:'tr',cls:'x-row-'+A,cn:[]};var C=[];for(var i=0,D=cm.getColumnCount();i<D;i++){var E=cm.config[i];var F=cm.getRenderer(i);var G='';var id=false;if(typeof(F)!=='undefined'){G=F(d.data[cm.getDataIndex(i)],false,d);
440 }if(typeof(G)==='object'){id=Roo.id();C.push({container:id,cfg:G})}var H={record:d,rowIndex:A,colIndex:i,rowClass:''};this.fireEvent('rowclass',this,H);var td={tag:'td',cls:H.rowClass+' x-col-'+i,style:'',html:(typeof(G)==='object')?'':G};if(id){td.id=id;
441 }if(typeof(E.colspan)!='undefined'){td.colspan=E.colspan;}if(typeof(E.align)!='undefined'&&E.align.length){td.style+=' text-align:'+E.align+';';}if(typeof(E.valign)!='undefined'&&E.valign.length){td.style+=' vertical-align:'+E.valign+';';}if(typeof(E.cursor)!='undefined'){td.style+=' cursor:'+E.cursor+';';
442 }if(typeof(E.cls)!='undefined'){td.cls=(typeof(td.cls)=='undefined')?E.cls:(td.cls+' '+E.cls);}if(this.responsive){['xs','sm','md','lg'].map(function(I){if(typeof(E[I])=='undefined'){return;}if(!E[I]){td.cls+=' hidden-'+I+' hidden'+I+'-down';return;}td.cls+=' col-'+I+'-'+E[I]+(I=='xs'?(' col-'+E[I]):'');
443 });}B.cn.push(td);}B.cellObjects=C;return B;},onBeforeLoad:function(){this.el.unmask();},clear:function(){this.el.select('tbody',true).first().dom.innerHTML='';},setRowVisibility:function(A,B){var bt=this.bodyEl.dom;var C=this.el.select('tbody > tr',true).elements;
444 if(typeof(C[A])=='undefined'){return;}C[A][B?'removeClass':'addClass']('d-none');},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.bootstrap.Table.RowSelectionModel({grid:this});}return this.selModel;},renderCellObject:function(r){var A=this;
445 r.cfg.parentId=(typeof(r.container)=='string')?r.container:r.container.id;var t=r.cfg.render(r.container);if(r.cfg.cn){Roo.each(r.cfg.cn,function(c){var B={container:t.getChildContainer(),cfg:c};A.renderCellObject(B);})}},getRowIndex:function(A){var B=-1;
446 Roo.each(this.el.select('tbody > tr',true).elements,function(el,C){if(el!=A){return;}B=C;});return B;},getHeaderIndex:function(A){var B=this.headEl.select('th',true).elements;return B[A];},getCellIndex:function(A){var id=String(A.className).match(Roo.bootstrap.Table.cellRE);
447 if(id){return parseInt(id[1],10);}return 0;},getGridEl:function(){return this.el;},autoSize:function(){var A=Roo.get(this.el.dom);var B=this.getGridEl().select('thead',true).first();var C=this.getGridEl().select('tbody',true).first();var D=this.getGridEl().select('tfoot',true).first();
448 var cw=A.getWidth();this.getGridEl().select('tfoot tr, tfoot  td',true).setWidth(cw);if(C){C.setWidth(A.getWidth());var E=(C.dom.offsetWidth-C.dom.clientWidth);cw-=E;}cw=Math.max(cw,this.totalWidth);this.getGridEl().select('tbody tr',true).setWidth(cw);this.initCSS();
449 return;},onBodyScroll:function(){if(this.headEl){this.headEl.setStyle({'position':'relative','left':(-1*this.bodyEl.dom.scrollLeft)+'px'});}if(this.lazyLoad){var A=this.bodyEl.dom.scrollHeight;var B=Math.ceil(this.bodyEl.getScroll().top);var C=this.bodyEl.getHeight();
450 if(A-C==B){var D=this.ds.getTotalCount();if(this.footer.cursor+this.footer.pageSize<D){this.footer.ds.load({params:{start:this.footer.cursor+this.footer.pageSize,limit:this.footer.pageSize},add:true});}}}},onColumnSplitterMoved:function(i,A){this.userResized=true;
451 var cm=this.colModel;var w=this.getHeaderIndex(i).getWidth()+A;cm.setColumnWidth(i,w,true);this.initCSS();this.fireEvent("columnresize",i,w);},onHeaderChange:function(){var A=this.renderHeader();var B=this.el.select('table',true).first();this.headEl.remove();
452 this.headEl=B.createChild(A,this.bodyEl,false);Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',this.sort,this);},this);if(this.enableColumnResize!==false&&Roo.grid.SplitDragZone){new Roo.grid.SplitDragZone(this,this.headEl.dom,false);
453 }},onHiddenChange:function(A,B,C){this.onHeaderChange();this.onLoad();},setColumnWidth:function(A,B){if(!this.colModel.config[A]){return;}var w=B.split(" ");var C=this.el.dom.getElementsByClassName("x-col-"+A);var D=this.el.dom.getElementsByClassName("x-hcol-"+A);
454 for(var j=0;j<w.length;j++){if(!w[j]){continue;}var E=w[j].split("-");if(!Number.isInteger(E[1]*1)){continue;}if(!this.colModel.config[A][E[0]]){continue;}if(!D[0].classList.contains("col-"+E[0]+"-"+this.colModel.config[A][E[0]])){continue;}D[0].classList.replace("col-"+E[0]+"-"+this.colModel.config[A][E[0]],"col-"+E[0]+"-"+E[1]);
455 for(var i=0;i<C.length;i++){var E=w[j].split("-");if(!Number.isInteger(E[1]*1)){continue;}if(!this.colModel.config[A][E[0]]){continue;}if(!C[i].classList.contains("col-"+E[0]+"-"+this.colModel.config[A][E[0]])){continue;}C[i].classList.replace("col-"+E[0]+"-"+this.colModel.config[A][E[0]],"col-"+E[0]+"-"+E[1]);
456 }this.colModel.config[A][E[0]]=E[1];}}});Roo.bootstrap.Table.cellRE=/(?:.*?)x-grid-(?:hd|cell|split)-([\d]+)(?:.*?)/;Roo.bootstrap.Table.AbstractSelectionModel=Roo.grid.AbstractSelectionModel;Roo.bootstrap.Table.RowSelectionModel=Roo.grid.RowSelectionModel;
457
458 // Roo/bootstrap/TableCell.js
459 Roo.bootstrap.TableCell=function(A){Roo.bootstrap.TableCell.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TableCell,Roo.bootstrap.Component,{html:false,cls:false,tag:false,abbr:false,align:false,axis:false,bgcolor:false,charoff:false,colspan:false,headers:false,height:false,nowrap:false,rowspan:false,scope:false,valign:false,width:false,getAutoCreate:function(){var A=Roo.apply({}
460 ,Roo.bootstrap.TableCell.superclass.getAutoCreate.call(this));A={tag:'td'};if(this.tag){A.tag=this.tag;}if(this.html){A.html=this.html}if(this.cls){A.cls=this.cls}if(this.abbr){A.abbr=this.abbr}if(this.align){A.align=this.align}if(this.axis){A.axis=this.axis}
461 if(this.bgcolor){A.bgcolor=this.bgcolor}if(this.charoff){A.charoff=this.charoff}if(this.colspan){A.colspan=this.colspan}if(this.headers){A.headers=this.headers}if(this.height){A.height=this.height}if(this.nowrap){A.nowrap=this.nowrap}if(this.rowspan){A.rowspan=this.rowspan}
462 if(this.scope){A.scope=this.scope}if(this.valign){A.valign=this.valign}if(this.width){A.width=this.width}return A;}});
463 // Roo/bootstrap/TableRow.js
464 Roo.bootstrap.TableRow=function(A){Roo.bootstrap.TableRow.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TableRow,Roo.bootstrap.Component,{cls:false,align:false,bgcolor:false,charoff:false,valign:false,getAutoCreate:function(){var A=Roo.apply({}
465 ,Roo.bootstrap.TableRow.superclass.getAutoCreate.call(this));A={tag:'tr'};if(this.cls){A.cls=this.cls;}if(this.align){A.align=this.align;}if(this.bgcolor){A.bgcolor=this.bgcolor;}if(this.charoff){A.charoff=this.charoff;}if(this.valign){A.valign=this.valign;
466 }return A;}});
467 // Roo/bootstrap/TableBody.js
468 Roo.bootstrap.TableBody=function(A){Roo.bootstrap.TableBody.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TableBody,Roo.bootstrap.Component,{cls:false,tag:false,align:false,charoff:false,valign:false,getAutoCreate:function(){var A=Roo.apply({}
469 ,Roo.bootstrap.TableBody.superclass.getAutoCreate.call(this));A={tag:'tbody'};if(this.cls){A.cls=this.cls}if(this.tag){A.tag=this.tag;}if(this.align){A.align=this.align;}if(this.charoff){A.charoff=this.charoff;}if(this.valign){A.valign=this.valign;}return A;
470 }});
471 // Roo/form/Action.js
472 Roo.namespace('Roo.form');Roo.form.Action=function(A,B){this.form=A;this.options=B||{};};Roo.form.Action.CLIENT_INVALID='client';Roo.form.Action.SERVER_INVALID='server';Roo.form.Action.CONNECT_FAILURE='connect';Roo.form.Action.LOAD_FAILURE='load';Roo.form.Action.prototype={type:'default',failureType:undefined,response:undefined,result:undefined,run:function(A){}
473 ,success:function(A){},handleResponse:function(A){},failure:function(A){this.response=A;this.failureType=Roo.form.Action.CONNECT_FAILURE;this.form.afterAction(this,false);},processResponse:function(A){this.response=A;if(!A.responseText){return true;}this.result=this.handleResponse(A);
474 return this.result;},getUrl:function(A){var B=this.options.url||this.form.url||this.form.el.dom.action;if(A){var p=this.getParams();if(p){B+=(B.indexOf('?')!=-1?'&':'?')+p;}}return B;},getMethod:function(){return (this.options.method||this.form.method||this.form.el.dom.method||'POST').toUpperCase();
475 },getParams:function(){var bp=this.form.baseParams;var p=this.options.params;if(p){if(typeof p=="object"){p=Roo.urlEncode(Roo.applyIf(p,bp));}else if(typeof p=='string'&&bp){p+='&'+Roo.urlEncode(bp);}}else if(bp){p=Roo.urlEncode(bp);}return p;},createCallback:function(){return {success:this.success,failure:this.failure,scope:this,timeout:(this.form.timeout*1000),upload:this.form.fileUpload?this.success:undefined}
476 ;}};Roo.form.Action.Submit=function(A,B){Roo.form.Action.Submit.superclass.constructor.call(this,A,B);};Roo.extend(Roo.form.Action.Submit,Roo.form.Action,{type:'submit',haveProgress:false,uploadComplete:false,uploadProgress:function(){if(!this.form.progressUrl){return;
477 }if(!this.haveProgress){Roo.MessageBox.progress("Uploading","Uploading");}if(this.uploadComplete){Roo.MessageBox.hide();return;}this.haveProgress=true;var A=this.form.findField('UPLOAD_IDENTIFIER').getValue();var c=new Roo.data.Connection();c.request({url:this.form.progressUrl,params:{id:A}
478 ,method:'GET',success:function(B){var C=false;var D;try{C=Roo.decode(B.responseText)}catch(e){Roo.log("Invalid data from server..");Roo.log(D);return;}if(!C||!C.success){Roo.log(C);Roo.MessageBox.alert(Roo.encode(C));return;}var E=C.data;if(this.uploadComplete){Roo.MessageBox.hide();
479 return;}if(E){Roo.MessageBox.updateProgress(E.bytes_uploaded/E.bytes_total,Math.floor((E.bytes_total-E.bytes_uploaded)/1000)+'k remaining');}this.uploadProgress.defer(2000,this);},failure:function(B){Roo.log('progress url failed ');Roo.log(B);},scope:this}
480 );},run:function(){this.form.getValues();var o=this.options;var A=this.getMethod();var B=A=='POST';if(o.clientValidation===false||this.form.isValid()){if(this.form.progressUrl){this.form.findField('UPLOAD_IDENTIFIER').setValue((new Date()*1)+''+Math.random());
481 }Roo.Ajax.request(Roo.apply(this.createCallback(),{form:this.form.el.dom,url:this.getUrl(!B),method:A,params:B?this.getParams():null,isUpload:this.form.fileUpload,formData:this.form.formData}));this.uploadProgress();}else if(o.clientValidation!==false){this.failureType=Roo.form.Action.CLIENT_INVALID;
482 this.form.afterAction(this,false);}},success:function(A){this.uploadComplete=true;if(this.haveProgress){Roo.MessageBox.hide();}var B=this.processResponse(A);if(B===true||B.success){this.form.afterAction(this,true);return;}if(B.errors){this.form.markInvalid(B.errors);
483 this.failureType=Roo.form.Action.SERVER_INVALID;}this.form.afterAction(this,false);},failure:function(A){this.uploadComplete=true;if(this.haveProgress){Roo.MessageBox.hide();}this.response=A;this.failureType=Roo.form.Action.CONNECT_FAILURE;this.form.afterAction(this,false);
484 },handleResponse:function(A){if(this.form.errorReader){var rs=this.form.errorReader.read(A);var B=[];if(rs.records){for(var i=0,C=rs.records.length;i<C;i++){var r=rs.records[i];B[i]=r.data;}}if(B.length<1){B=null;}return {success:rs.success,errors:B};}var D=false;
485 try{D=Roo.decode(A.responseText);}catch(e){D={success:false,errorMsg:"Failed to read server message: "+(A?A.responseText:' - no message'),errors:[]};}return D;}});Roo.form.Action.Load=function(A,B){Roo.form.Action.Load.superclass.constructor.call(this,A,B);
486 this.reader=this.form.reader;};Roo.extend(Roo.form.Action.Load,Roo.form.Action,{type:'load',run:function(){Roo.Ajax.request(Roo.apply(this.createCallback(),{method:this.getMethod(),url:this.getUrl(false),params:this.getParams()}));},success:function(A){var B=this.processResponse(A);
487 if(B===true||!B.success||!B.data){this.failureType=Roo.form.Action.LOAD_FAILURE;this.form.afterAction(this,false);return;}this.form.clearInvalid();this.form.setValues(B.data);this.form.afterAction(this,true);},handleResponse:function(A){if(this.form.reader){var rs=this.form.reader.read(A);
488 var B=rs.records&&rs.records[0]?rs.records[0].data:null;return {success:rs.success,data:B};}return Roo.decode(A.responseText);}});Roo.form.Action.ACTION_TYPES={'load':Roo.form.Action.Load,'submit':Roo.form.Action.Submit};
489 // Roo/bootstrap/form/Form.js
490 Roo.bootstrap.form.Form=function(A){Roo.bootstrap.form.Form.superclass.constructor.call(this,A);Roo.bootstrap.form.Form.popover.apply();this.addEvents({clientvalidation:true,beforeaction:true,actionfailed:true,actioncomplete:true});};Roo.extend(Roo.bootstrap.form.Form,Roo.bootstrap.Component,{method:'POST',timeout:30,align:'left',activeAction:null,waitMsgTarget:false,loadMask:true,errorMask:false,maskOffset:100,maskBody:false,getAutoCreate:function(){var A={tag:'form',method:this.method||'POST',id:this.id||Roo.id(),cls:''}
491 ;if(this.parent().xtype.match(/^Nav/)){A.cls='navbar-form form-inline navbar-'+this.align;}if(this.labelAlign=='left'){A.cls+=' form-horizontal';}return A;},initEvents:function(){this.el.on('submit',this.onSubmit,this);this.el.on('keypress',function(e){if(e.getCharCode()!=13){return true;
492 }if(e.getTarget().nodeName.toLowerCase()==='textarea'){return true;}Roo.log("keypress blocked");e.preventDefault();return false;});},onSubmit:function(e){e.stopEvent();},isValid:function(){var A=this.getItems();var B=true;var C=false;A.each(function(f){if(f.validate()){return;
493 }Roo.log('invalid field: '+f.name);B=false;if(!C&&f.el.isVisible(true)){C=f;}});if(this.errorMask&&!B){Roo.bootstrap.form.Form.popover.mask(this,C);}return B;},isDirty:function(){var A=false;var B=this.getItems();B.each(function(f){if(f.isDirty()){A=true;
494 return false;}return true;});return A;},doAction:function(A,B){if(typeof A=='string'){A=new Roo.form.Action.ACTION_TYPES[A](this,B);}if(this.fireEvent('beforeaction',this,A)!==false){this.beforeAction(A);A.run.defer(100,A);}return this;},beforeAction:function(A){var o=A.options;
495 if(this.loadMask){if(this.maskBody){Roo.get(document.body).mask(o.waitMsg||"Sending",'x-mask-loading')}else{this.el.mask(o.waitMsg||"Sending",'x-mask-loading');}}},afterAction:function(A,B){this.activeAction=null;var o=A.options;if(this.loadMask){if(this.maskBody){Roo.get(document.body).unmask();
496 }else{this.el.unmask();}}if(B){if(o.reset){this.reset();}Roo.callback(o.success,o.scope,[this,A]);this.fireEvent('actioncomplete',this,A);}else{if((typeof(A.result)!='undefined')&&(typeof(A.result.errors)!='undefined')&&(typeof(A.result.errors.needs_confirm)!='undefined')){var _t=this;
497 Roo.log("not supported yet");return;}Roo.callback(o.failure,o.scope,[this,A]);if(!this.hasListener('actionfailed')){Roo.log("need to add dialog support");}this.fireEvent('actionfailed',this,A);}},findField:function(id){var A=this.getItems();var B=A.get(id);
498 if(!B){A.each(function(f){if(f.isFormField&&(f.dataIndex==id||f.id==id||f.getName()==id)){B=f;return false;}return true;});}return B||null;},markInvalid:function(A){if(A instanceof Array){for(var i=0,B=A.length;i<B;i++){var C=A[i];var f=this.findField(C.id);
499 if(f){f.markInvalid(C.msg);}}}else{var D,id;for(id in A){if(typeof A[id]!='function'&&(D=this.findField(id))){D.markInvalid(A[id]);}}}return this;},setValues:function(A){if(A instanceof Array){for(var i=0,B=A.length;i<B;i++){var v=A[i];var f=this.findField(v.id);
500 if(f){f.setValue(v.value);if(this.trackResetOnLoad){f.originalValue=f.getValue();}}}}else{var C,id;for(id in A){if(typeof A[id]!='function'&&(C=this.findField(id))){if(C.setFromData&&C.valueField&&C.displayField&&(C.store&&!C.store.isLocal)){var sd={};sd[C.valueField]=typeof(A[C.hiddenName])=='undefined'?'':A[C.hiddenName];
501 sd[C.displayField]=typeof(A[C.name])=='undefined'?'':A[C.name];C.setFromData(sd);}else if(C.setFromData&&(C.store&&!C.store.isLocal)){C.setFromData(A);}else{C.setValue(A[id]);}if(this.trackResetOnLoad){C.originalValue=C.getValue();}}}}return this;},getValues:function(A){var fs=Roo.lib.Ajax.serializeForm(this.el.dom);
502 if(A===true){return fs;}return Roo.urlDecode(fs);},getFieldValues:function(A){var B=this.getItems();var C={};B.each(function(f){if(!f.getName()){return;}var v=f.getValue();if(f.inputType=='radio'){if(typeof(C[f.getName()])=='undefined'){C[f.getName()]='';
503 }if(!f.el.dom.checked){return;}v=f.el.dom.value;}if(f.xtype=='MoneyField'){C[f.currencyName]=f.getCurrency();}if((typeof(v)=='object')&&f.getRawValue){v=f.getRawValue();}if(f.name!==false&&f.name!=''&&f.name!=f.getName()){C[f.name]=f.getRawValue();}C[f.getName()]=v;
504 });return C;},clearInvalid:function(){var A=this.getItems();A.each(function(f){f.clearInvalid();});return this;},reset:function(){var A=this.getItems();A.each(function(f){f.reset();});Roo.each(this.childForms||[],function(f){f.reset();});return this;},getItems:function(){var r=new Roo.util.MixedCollection(false,function(o){return o.id||(o.id=Roo.id());
505 });var A=function(el){if(el.inputEl){r.add(el);}if(!el.items){return;}Roo.each(el.items,function(e){A(e);});};A(this);return r;},hideFields:function(A){Roo.each(A,function(i){var f=this.findField(i);if(!f){return;}f.hide();},this);},showFields:function(A){Roo.each(A,function(i){var f=this.findField(i);
506 if(!f){return;}f.show();},this);}});Roo.apply(Roo.bootstrap.form.Form,{popover:{padding:5,isApplied:false,isMasked:false,form:false,target:false,toolTip:false,intervalID:false,maskEl:false,apply:function(){if(this.isApplied){return;}this.maskEl={top:Roo.DomHelper.append(Roo.get(document.body),{tag:"div",cls:"x-dlg-mask roo-form-top-mask"}
507 ,true),left:Roo.DomHelper.append(Roo.get(document.body),{tag:"div",cls:"x-dlg-mask roo-form-left-mask"},true),bottom:Roo.DomHelper.append(Roo.get(document.body),{tag:"div",cls:"x-dlg-mask roo-form-bottom-mask"},true),right:Roo.DomHelper.append(Roo.get(document.body),{tag:"div",cls:"x-dlg-mask roo-form-right-mask"}
508 ,true)};this.maskEl.top.enableDisplayMode("block");this.maskEl.left.enableDisplayMode("block");this.maskEl.bottom.enableDisplayMode("block");this.maskEl.right.enableDisplayMode("block");this.toolTip=new Roo.bootstrap.Tooltip({cls:'roo-form-error-popover',alignment:{'left':['r-l',[-2,0],'right'],'right':['l-r',[2,0],'left'],'bottom':['tl-bl',[0,2],'top'],'top':['bl-tl',[0,-2],'bottom']}
509 });this.toolTip.render(Roo.get(document.body));this.toolTip.el.enableDisplayMode("block");Roo.get(document.body).on('click',function(){this.unmask();},this);Roo.get(document.body).on('touchstart',function(){this.unmask();},this);this.isApplied=true},mask:function(A,B){this.form=A;
510 this.target=B;if(!this.form.errorMask||!B.el){return;}var C=this.target.el.findScrollableParent()||this.target.el.findParent('div.modal',100,true)||Roo.get(document.body);Roo.log(C);var ot=this.target.el.calcOffsetsTo(C);var D=ot[1]-this.form.maskOffset;D=Math.min(D,C.dom.scrollHeight);
511 C.scrollTo('top',D);var E=this.target.el.getBox();Roo.log(E);var F=Roo.bootstrap.Modal.zIndex++;this.maskEl.top.setStyle('position','absolute');this.maskEl.top.setStyle('z-index',F);this.maskEl.top.setSize(Roo.lib.Dom.getDocumentWidth(),E.y-this.padding);
512 this.maskEl.top.setLeft(0);this.maskEl.top.setTop(0);this.maskEl.top.show();this.maskEl.left.setStyle('position','absolute');this.maskEl.left.setStyle('z-index',F);this.maskEl.left.setSize(E.x-this.padding,E.height+this.padding*2);this.maskEl.left.setLeft(0);
513 this.maskEl.left.setTop(E.y-this.padding);this.maskEl.left.show();this.maskEl.bottom.setStyle('position','absolute');this.maskEl.bottom.setStyle('z-index',F);this.maskEl.bottom.setSize(Roo.lib.Dom.getDocumentWidth(),Roo.lib.Dom.getDocumentHeight()-E.bottom-this.padding);
514 this.maskEl.bottom.setLeft(0);this.maskEl.bottom.setTop(E.bottom+this.padding);this.maskEl.bottom.show();this.maskEl.right.setStyle('position','absolute');this.maskEl.right.setStyle('z-index',F);this.maskEl.right.setSize(Roo.lib.Dom.getDocumentWidth()-E.right-this.padding,E.height+this.padding*2);
515 this.maskEl.right.setLeft(E.right+this.padding);this.maskEl.right.setTop(E.y-this.padding);this.maskEl.right.show();this.toolTip.bindEl=this.target.el;this.toolTip.el.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);var G=this.target.blankText;if(this.target.getValue()!==''){if(this.target.invalidText.length){G=this.target.invalidText;
516 }else if(this.target.regexText.length){G=this.target.regexText;}}this.toolTip.show(G);this.intervalID=window.setInterval(function(){Roo.bootstrap.form.Form.popover.unmask();},10000);window.onwheel=function(){return false;};(function(){this.isMasked=true;}
517 ).defer(500,this);},unmask:function(){if(!this.isApplied||!this.isMasked||!this.form||!this.target||!this.form.errorMask){return;}this.maskEl.top.setStyle('position','absolute');this.maskEl.top.setSize(0,0).setXY([0,0]);this.maskEl.top.hide();this.maskEl.left.setStyle('position','absolute');
518 this.maskEl.left.setSize(0,0).setXY([0,0]);this.maskEl.left.hide();this.maskEl.bottom.setStyle('position','absolute');this.maskEl.bottom.setSize(0,0).setXY([0,0]);this.maskEl.bottom.hide();this.maskEl.right.setStyle('position','absolute');this.maskEl.right.setSize(0,0).setXY([0,0]);
519 this.maskEl.right.hide();this.toolTip.hide();this.toolTip.el.hide();window.onwheel=function(){return true;};if(this.intervalID){window.clearInterval(this.intervalID);this.intervalID=false;}this.isMasked=false;}}});
520 // Roo/form/VTypes.js
521 Roo.form.VTypes=function(){var A=/^[a-zA-Z_]+$/;var B=/^[a-zA-Z0-9_]+$/;var C=/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/;var D=/(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return {'email':function(v){return C.test(v);
522 },'emailText':'This field should be an e-mail address in the format "user@domain.com"','emailMask':/[a-z0-9_\.\-@]/i,'url':function(v){return D.test(v);},'urlText':'This field should be a URL in the format "http:/'+'/www.domain.com"','alpha':function(v){return A.test(v);
523 },'alphaText':'This field should only contain letters and _','alphaMask':/[a-z_]/i,'alphanum':function(v){return B.test(v);},'alphanumText':'This field should only contain letters, numbers and _','alphanumMask':/[a-z0-9_]/i};}();
524 // Roo/bootstrap/form/Input.js
525 Roo.bootstrap.form.Input=function(A){Roo.bootstrap.form.Input.superclass.constructor.call(this,A);this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true,keyup:true,paste:true});};Roo.extend(Roo.bootstrap.form.Input,Roo.bootstrap.Component,{validationEvent:"keyup",validateOnBlur:true,validationDelay:250,focusClass:"x-form-focus",invalidClass:"has-warning",validClass:"has-success",hasFeedback:true,invalidFeedbackClass:"glyphicon-warning-sign",validFeedbackClass:"glyphicon-ok",selectOnFocus:false,maskRe:null,vtype:null,disableKeyFilter:false,disabled:false,allowBlank:true,blankText:"Please complete this mandatory field",minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",validator:null,regex:null,regexText:"",invalidText:"",autocomplete:false,fieldLabel:'',inputType:'text',name:false,placeholder:false,before:false,after:false,size:false,hasFocus:false,preventMark:false,isFormField:true,value:'',labelWidth:2,labelAlign:false,readOnly:false,align:false,formatedValue:false,forceFeedback:false,indicatorpos:'left',labellg:0,labelmd:0,labelsm:0,labelxs:0,capture:'',accept:'',parentLabelAlign:function(){var A=this;
526 while(A.parent()){A=A.parent();if(typeof(A.labelAlign)!='undefined'){return A.labelAlign;}}return 'left';},getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;var id=Roo.id();var B={};if(this.inputType!='hidden'){B.cls='form-group'}
527 var C={tag:'input',id:id,type:this.inputType,value:this.value,cls:'form-control',placeholder:this.placeholder||'',autocomplete:this.autocomplete||'new-password'};if(this.inputType=='file'){C.style='overflow:hidden';}if(this.capture.length){C.capture=this.capture;
528 }if(this.accept.length){C.accept=this.accept+"/*";}if(this.align){C.style=(typeof(C.style)=='undefined')?('text-align:'+this.align):(C.style+'text-align:'+this.align);}if(this.maxLength&&this.maxLength!=Number.MAX_VALUE){C.maxLength=this.maxLength;}if(this.disabled){C.disabled=true;
529 }if(this.readOnly){C.readonly=true;}if(this.name){C.name=this.name;}if(this.size){C.cls+=' input-'+this.size;}var D=this;['xs','sm','md','lg'].map(function(J){if(D[J]){B.cls+=' col-'+J+'-'+D[J];}});var E=C;var F={tag:'span',cls:'glyphicon form-control-feedback'}
530 ;if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){E={cls:'has-feedback',cn:[C,F]};}if(this.before||this.after){E={cls:'input-group',cn:[]};if(this.before&&typeof(this.before)=='string'){E.cn.push({tag:'span',cls:'roo-input-before input-group-addon input-group-prepend input-group-text',html:this.before}
531 );}if(this.before&&typeof(this.before)=='object'){this.before=Roo.factory(this.before);E.cn.push({tag:'span',cls:'roo-input-before input-group-prepend   input-group-'+(this.before.xtype=='Button'?'btn':'addon')});}E.cn.push(C);if(this.after&&typeof(this.after)=='string'){E.cn.push({tag:'span',cls:'roo-input-after input-group-append input-group-text input-group-addon',html:this.after}
532 );}if(this.after&&typeof(this.after)=='object'){this.after=Roo.factory(this.after);E.cn.push({tag:'span',cls:'roo-input-after input-group-append  input-group-'+(this.after.xtype=='Button'?'btn':'addon')});}if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){E.cls+=' has-feedback';
533 E.cn.push(F);}};var G={tag:'i',cls:'roo-required-indicator '+(this.indicatorpos=='right'?'right':'left')+'-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'};if(this.allowBlank){G.style=this.allowBlank?' display:none':'';}if(A==='left'&&this.fieldLabel.length){B.cls+=' roo-form-group-label-left'+(Roo.bootstrap.version==4?' row':'');
534 B.cn=[G,{tag:'label','for':id,cls:'control-label col-form-label',html:this.fieldLabel},{cls:"",cn:[E]}];var H=B.cn[1];var I=B.cn[2];if(this.indicatorpos=='right'){B.cn=[{tag:'label','for':id,cls:'control-label col-form-label',cn:[{tag:'span',html:this.fieldLabel}
535 ,G]},{cls:"",cn:[E]}];H=B.cn[0];I=B.cn[1];}if(this.labelWidth>12){H.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labellg=this.labellg>0?this.labellg:this.labelWidth;}if(this.labellg>0){H.cls+=' col-lg-'+this.labellg;I.cls+=' col-lg-'+(12-this.labellg);
536 }if(this.labelmd>0){H.cls+=' col-md-'+this.labelmd;I.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){H.cls+=' col-sm-'+this.labelsm;I.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){H.cls+=' col-xs-'+this.labelxs;I.cls+=' col-xs-'+(12-this.labelxs);
537 }}else if(this.fieldLabel.length){B.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required',style:this.allowBlank?' display:none':''},{tag:'label',html:this.fieldLabel},E];if(this.indicatorpos=='right'){B.cn=[{tag:'label',html:this.fieldLabel}
538 ,{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required',style:this.allowBlank?' display:none':''},E];}}else{B.cn=[E];};if(this.parentType==='Navbar'&&this.parent().bar){B.cls+=' navbar-form';}if(this.parentType==='NavGroup'&&!(Roo.bootstrap.version==4&&this.parent().form)){B.cls+=' navbar-form';
539 B.tag='li';}return B;},inputEl:function(){return this.el.select('input.form-control',true).first();},tooltipEl:function(){return this.inputEl();},indicatorEl:function(){if(Roo.bootstrap.version==4){return false;}var A=this.el.select('i.roo-required-indicator',true).first();
540 if(!A){return false;}return A;},setDisabled:function(v){var i=this.inputEl().dom;if(!v){i.removeAttribute('disabled');return;}i.setAttribute('disabled','true');},initEvents:function(){this.inputEl().on("keydown",this.fireKey,this);this.inputEl().on("focus",this.onFocus,this);
541 this.inputEl().on("blur",this.onBlur,this);this.inputEl().relayEvent('keyup',this);this.inputEl().relayEvent('paste',this);this.indicator=this.indicatorEl();if(this.indicator){this.indicator.addClass(this.indicatorpos=='right'?'hidden':'invisible');}this.originalValue=this.getValue();
542 if(this.validationEvent=='keyup'){this.validationTask=new Roo.util.DelayedTask(this.validate,this);this.inputEl().on('keyup',this.filterValidation,this);}else if(this.validationEvent!==false){this.inputEl().on(this.validationEvent,this.validate,this,{buffer:this.validationDelay}
543 );}if(this.selectOnFocus){this.on("focus",this.preFocus,this);}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Roo.form.VTypes[this.vtype+'Mask']))){this.inputEl().on("keypress",this.filterKeys,this);}else{this.inputEl().relayEvent('keypress',this);
544 }if(this.inputEl().is('input[type=password]')&&Roo.isSafari){this.inputEl().on('keydown',this.SafariOnKeyDown,this);}if(typeof(this.before)=='object'){this.before.render(this.el.select('.roo-input-before',true).first());}if(typeof(this.after)=='object'){this.after.render(this.el.select('.roo-input-after',true).first());
545 }this.inputEl().on('change',this.onChange,this);},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);}},validate:function(){if(this.disabled||this.validateValue(this.getRawValue())){this.markValid();return true;
546 }this.markInvalid();return false;},validateValue:function(A){if(this.getVisibilityEl().hasClass('hidden')){return true;}if(A.length<1){if(this.allowBlank){return true;}return false;}if(A.length<this.minLength){return false;}if(A.length>this.maxLength){return false;
547 }if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](A,this)){return false;}}if(typeof this.validator=="function"){var B=this.validator(A);if(B!==true){return false;}if(typeof(B)=='string'){this.invalidText=B;}}if(this.regex&&!this.regex.test(A)){return false;
548 }return true;},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},focus:function(A){if(this.rendered){this.inputEl().focus();if(A===true){this.inputEl().dom.select();}}return this;},onFocus:function(){if(!Roo.isOpera&&this.focusClass){}
549 if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();
550 }var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);}this.fireEvent("blur",this);},onChange:function(e){var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);
551 }},reset:function(){this.setValue(this.originalValue);this.validate();},getName:function(){return this.name;},getValue:function(){var v=this.inputEl().getValue();return v;},getRawValue:function(){var v=this.inputEl().getValue();return v;},setRawValue:function(v){return this.inputEl().dom.value=(v===null||v===undefined?'':v);
552 },selectText:function(A,B){var v=this.getRawValue();if(v.length>0){A=A===undefined?0:A;B=B===undefined?v.length:B;var d=this.inputEl().dom;if(d.setSelectionRange){d.setSelectionRange(A,B);}else if(d.createTextRange){var C=d.createTextRange();C.moveStart("character",A);
553 C.moveEnd("character",v.length-B);C.select();}}},setValue:function(v){this.value=v;if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v);this.validate();}},preFocus:function(){if(this.selectOnFocus){this.inputEl().dom.select();}},filterKeys:function(e){var k=e.getKey();
554 if(!Roo.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE&&e.button==-1))){return;}var c=e.getCharCode(),cc=String.fromCharCode(c);if(Roo.isIE&&(e.isSpecialKey()||!cc)){return;}if(!this.maskRe.test(cc)){e.stopEvent();}},clearInvalid:function(){if(!this.el||this.preventMark){return;
555 }this.el.removeClass([this.invalidClass,'is-invalid']);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass);
556 }}if(this.indicator){this.indicator.removeClass('visible');this.indicator.addClass(this.indicatorpos=='right'?'hidden':'invisible');}this.fireEvent('valid',this);},markValid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);
557 this.inputEl().removeClass(['is-valid','is-invalid']);var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.indicator){this.indicator.removeClass('visible');
558 this.indicator.addClass(this.indicatorpos=='right'?'hidden':'invisible');}if(this.disabled){return;}if(this.allowBlank&&!this.getRawValue().length){return;}if(Roo.bootstrap.version==3){this.el.addClass(this.validClass);}else{this.inputEl().addClass('is-valid');
559 }if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank&&(this.getValue().length||this.forceFeedback)){var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);
560 this.el.select('.form-control-feedback',true).first().addClass([this.validFeedbackClass]);}}this.fireEvent('valid',this);},markInvalid:function(A){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);this.inputEl().removeClass(['is-valid','is-invalid']);
561 var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled){return;}if(this.allowBlank&&!this.getRawValue().length){return;
562 }if(this.indicator){this.indicator.removeClass(this.indicatorpos=='right'?'hidden':'invisible');this.indicator.addClass('visible');}if(Roo.bootstrap.version==3){this.el.addClass(this.invalidClass);}else{this.inputEl().addClass('is-invalid');}if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var B=this.el.select('.form-control-feedback',true).first();
563 if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);if(this.getValue().length||this.forceFeedback){this.el.select('.form-control-feedback',true).first().addClass([this.invalidFeedbackClass]);
564 }}}this.fireEvent('invalid',this,A);},SafariOnKeyDown:function(A){if(this.inputEl().dom.type!='password'){return;}var B=false;if(this.inputEl().dom.selectionEnd>0){B=(this.inputEl().dom.selectionEnd-this.inputEl().dom.selectionStart-this.getValue().length==0)?true:false;
565 }if(((A.getKey()==8||A.getKey()==46)&&this.getValue().length==1)){A.preventDefault();this.setValue('');return;}if(B&&A.getCharCode()>31&&!A.ctrlKey){A.preventDefault();var cc=String.fromCharCode(A.getCharCode());this.setValue(A.shiftKey?cc:cc.toLowerCase());
566 }},adjustWidth:function(A,w){A=A.toLowerCase();if(typeof w=='number'&&Roo.isStrict&&!Roo.isSafari){if(Roo.isIE&&(A=='input'||A=='textarea')){if(A=='input'){return w+2;}if(A=='textarea'){return w-2;}}else if(Roo.isOpera){if(A=='input'){return w+2;}if(A=='textarea'){return w-2;
567 }}}return w;},setFieldLabel:function(v){if(!this.rendered){return;}if(this.indicatorEl()){var ar=this.el.select('label > span',true);if(ar.elements.length){this.el.select('label > span',true).first().dom.innerHTML=(v===null||v===undefined?'':v);this.fieldLabel=v;
568 return;}var br=this.el.select('label',true);if(br.elements.length){this.el.select('label',true).first().dom.innerHTML=(v===null||v===undefined?'':v);this.fieldLabel=v;return;}Roo.log('Cannot Found any of label > span || label in input');return;}this.el.select('label',true).first().dom.innerHTML=(v===null||v===undefined?'':v);
569 this.fieldLabel=v;}});
570 // Roo/bootstrap/form/TextArea.js
571 Roo.bootstrap.form.TextArea=function(A){Roo.bootstrap.form.TextArea.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.TextArea,Roo.bootstrap.form.Input,{cols:false,rows:5,readOnly:false,warp:'soft',resize:false,value:false,html:false,getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;
572 var id=Roo.id();var B={};if(this.inputType!='hidden'){B.cls='form-group'}var C={tag:'textarea',id:id,warp:this.warp,rows:this.rows,value:this.value||'',html:this.html||'',cls:'form-control',placeholder:this.placeholder||''};if(this.maxLength&&this.maxLength!=Number.MAX_VALUE){C.maxLength=this.maxLength;
573 }if(this.resize){C.style=(typeof(C.style)=='undefined')?'resize:'+this.resize:C.style+'resize:'+this.resize;}if(this.cols){C.cols=this.cols;}if(this.readOnly){C.readonly=true;}if(this.name){C.name=this.name;}if(this.size){C.cls=(typeof(C.cls)=='undefined')?'input-'+this.size:C.cls+' input-'+this.size;
574 }var D=this;['xs','sm','md','lg'].map(function(G){if(D[G]){B.cls+=' col-'+G+'-'+D[G];}});var E=C;if(this.hasFeedback&&!this.allowBlank){var F={tag:'span',cls:'glyphicon form-control-feedback'};E={cls:'has-feedback',cn:[C,F]};}if(this.before||this.after){E={cls:'input-group',cn:[]}
575 ;if(this.before){E.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}E.cn.push(C);if(this.hasFeedback&&!this.allowBlank){E.cls+=' has-feedback';E.cn.push(F);}if(this.after){E.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}}if(A==='left'&&this.fieldLabel.length){B.cn=[{tag:'label','for':id,cls:'control-label',html:this.fieldLabel}
576 ,{cls:"",cn:[E]}];if(this.labelWidth>12){B.cn[0].style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){B.cn[0].cls+=' col-lg-'+this.labellg;B.cn[1].cls+=' col-lg-'+(12-this.labellg);
577 }if(this.labelmd>0){B.cn[0].cls+=' col-md-'+this.labelmd;B.cn[1].cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){B.cn[0].cls+=' col-sm-'+this.labelsm;B.cn[1].cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){B.cn[0].cls+=' col-xs-'+this.labelxs;
578 B.cn[1].cls+=' col-xs-'+(12-this.labelxs);}}else if(this.fieldLabel.length){B.cn=[{tag:'label',html:this.fieldLabel},E];}else{B.cn=[E];}if(this.disabled){C.disabled=true;}return B;},inputEl:function(){return this.el.select('textarea.form-control',true).first();
579 },clearInvalid:function(){if(!this.el||this.preventMark){return;}var A=this.el.select('label',true).first();var B=this.el.select('i.fa-star',true).first();if(A&&B){B.remove();}this.el.removeClass(this.validClass);this.inputEl().removeClass('is-invalid');if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var C=this.el.select('.form-control-feedback',true).first();
580 if(C){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass);}}this.fireEvent('valid',this);},markValid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);this.inputEl().removeClass(['is-valid','is-invalid']);
581 var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled||this.allowBlank){return;}var B=this.el.select('label',true).first();
582 var C=this.el.select('i.fa-star',true).first();if(B&&C){C.remove();}if(Roo.bootstrap.version==3){this.el.addClass(this.validClass);}else{this.inputEl().addClass('is-valid');}if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank&&(this.getValue().length||this.forceFeedback)){var A=this.el.select('.form-control-feedback',true).first();
583 if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);this.el.select('.form-control-feedback',true).first().addClass([this.validFeedbackClass]);}}this.fireEvent('valid',this);},markInvalid:function(A){if(!this.el||this.preventMark){return;
584 }this.el.removeClass([this.invalidClass,this.validClass]);this.inputEl().removeClass(['is-valid','is-invalid']);var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);
585 }if(this.disabled||this.allowBlank){return;}var C=this.el.select('label',true).first();var D=this.el.select('i.fa-star',true).first();if(!this.getValue().length&&C&&!D){this.el.createChild({tag:'i',cls:'text-danger fa fa-lg fa-star',tooltip:'This field is required',style:'margin-right:5px;'}
586 ,C,true);}if(Roo.bootstrap.version==3){this.el.addClass(this.invalidClass);}else{this.inputEl().addClass('is-invalid');}if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);
587 if(this.getValue().length||this.forceFeedback){this.el.select('.form-control-feedback',true).first().addClass([this.invalidFeedbackClass]);}}}this.fireEvent('invalid',this,A);}});
588 // Roo/bootstrap/form/TriggerField.js
589 Roo.bootstrap.form.TriggerField=function(A){this.mimicing=false;Roo.bootstrap.form.TriggerField.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.TriggerField,Roo.bootstrap.form.Input,{hideTrigger:false,removable:false,autoSize:Roo.emptyFn,monitorTab:true,deferHeight:true,actionMode:'wrap',caret:false,getAutoCreate:function(){var A=this.labelAlign||this.parentLabelAlign();
590 var id=Roo.id();var B={cls:'form-group'};var C={tag:'input',id:id,type:this.inputType,cls:'form-control',autocomplete:'new-password',placeholder:this.placeholder||''};if(this.name){C.name=this.name;}if(this.size){C.cls+=' input-'+this.size;}if(this.disabled){C.disabled=true;
591 }var D=C;if(this.hasFeedback&&!this.allowBlank){var E={tag:'span',cls:'glyphicon form-control-feedback'};if(this.removable&&!this.editable){D={cls:'has-feedback',cn:[D,{tag:'button',html:'x',cls:'roo-combo-removable-btn close'},E]};}else{D={cls:'has-feedback',cn:[D,E]}
592 ;}}else{if(this.removable&&!this.editable){D={cls:'roo-removable',cn:[D,{tag:'button',html:'x',cls:'roo-combo-removable-btn close'}]};}}if(this.before||this.after){D={cls:'input-group',cn:[]};if(this.before){D.cn.push({tag:'span',cls:'input-group-addon input-group-prepend input-group-text',html:this.before}
593 );}D.cn.push(C);if(this.hasFeedback&&!this.allowBlank){D.cls+=' has-feedback';D.cn.push(E);}if(this.after){D.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text',html:this.after});}};var F=D;if(this.multiple){F={tag:'ul',cls:'roo-select2-choices',cn:[{tag:'li',cls:'roo-select2-search-field',cn:[D]}
594 ]};}var G={cls:'roo-select2-container input-group',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},F]};if(!this.multiple&&this.showToggleBtn){var H={tag:'span',cls:'caret'};if(this.caret!=false){H={tag:'i',cls:'fa fa-'+this.caret};}G.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text btn dropdown-toggle',cn:[Roo.bootstrap.version==3?H:'',{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'}
595 ]}]})}if(this.multiple){G.cls+=' roo-select2-container-multi';}var I={tag:'i',cls:'roo-required-indicator '+(this.indicatorpos=='right'?'right':'left')+'-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'};if(Roo.bootstrap.version==4){I={tag:'i',style:'display:none'}
596 ;}if(A==='left'&&this.fieldLabel.length){B.cls+=' roo-form-group-label-left'+(Roo.bootstrap.version==4?' row':'');B.cn=[I,{tag:'label','for':id,cls:'control-label',html:this.fieldLabel},{cls:"",cn:[G]}];var J=B.cn[1];var K=B.cn[2];if(this.indicatorpos=='right'){B.cn=[{tag:'label','for':id,cls:'control-label',cn:[{tag:'span',html:this.fieldLabel}
597 ,I]},{cls:"",cn:[G]}];J=B.cn[0];K=B.cn[1];}if(this.labelWidth>12){J.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){J.cls+=' col-lg-'+this.labellg;K.cls+=' col-lg-'+(12-this.labellg);
598 }if(this.labelmd>0){J.cls+=' col-md-'+this.labelmd;K.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){J.cls+=' col-sm-'+this.labelsm;K.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){J.cls+=' col-xs-'+this.labelxs;K.cls+=' col-xs-'+(12-this.labelxs);
599 }}else if(this.fieldLabel.length){B.cn=[I,{tag:'label',html:this.fieldLabel},G];if(this.indicatorpos=='right'){B.cn=[{tag:'label',cn:[{tag:'span',html:this.fieldLabel},I]},G];}}else{B=G}var L=this;['xs','sm','md','lg'].map(function(M){if(L[M]){B.cls+=' col-'+M+'-'+L[M];
600 }});return B;},onResize:function(w,h){},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.inputEl();},getPositionEl:function(){return this.inputEl();},alignErrorIcon:function(){this.errorIcon.alignTo(this.inputEl(),'tl-tr',[2,0]);
601 },initEvents:function(){this.createList();Roo.bootstrap.form.TriggerField.superclass.initEvents.call(this);if(!this.multiple&&this.showToggleBtn){this.trigger=this.el.select('span.dropdown-toggle',true).first();if(this.hideTrigger){this.trigger.setDisplayed(false);
602 }this.trigger.on("click",this.onTriggerClick,this,{preventDefault:true});}if(this.multiple){this.inputEl().on("click",this.onTriggerClick,this,{preventDefault:true});}if(this.removable&&!this.editable&&!this.tickable){var A=this.closeTriggerEl();if(A){A.setVisibilityMode(Roo.Element.DISPLAY).hide();
603 A.on('click',this.removeBtnClick,this,A);}}},closeTriggerEl:function(){var A=this.el.select('.roo-combo-removable-btn',true).first();return A?A:false;},removeBtnClick:function(e,h,el){e.preventDefault();if(this.fireEvent("remove",this)!==false){this.reset();
604 this.fireEvent("afterremove",this)}},createList:function(){this.list=Roo.get(document.body).createChild({tag:Roo.bootstrap.version==4?'div':'ul',cls:'typeahead typeahead-long dropdown-menu shadow',style:'display:none'});this.list.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
605 ;},initTrigger:function(){},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();}Roo.bootstrap.form.TriggerField.superclass.onDestroy.call(this);},onFocus:function(){Roo.bootstrap.form.TriggerField.superclass.onFocus.call(this);},checkTab:function(e){if(e.getKey()==e.TAB){this.triggerBlur();
606 }},onBlur:function(){},mimicBlur:function(e,t){},triggerBlur:function(){this.mimicing=false;Roo.get(Roo.isIE?document.body:document).un("mousedown",this.mimicBlur);if(this.monitorTab){this.el.un("keydown",this.checkTab,this);}Roo.bootstrap.form.TriggerField.superclass.onBlur.call(this);
607 },validateBlur:function(e,t){return true;},onDisable:function(){this.inputEl().dom.disabled=true;},onEnable:function(){this.inputEl().dom.disabled=false;},onShow:function(){var ae=this.getActionEl();if(ae){ae.dom.style.display='';ae.dom.style.visibility='visible';
608 }},onHide:function(){var ae=this.getActionEl();ae.dom.style.display='none';},onTriggerClick:Roo.emptyFn});
609 // Roo/bootstrap/form/CardUploader.js
610 Roo.bootstrap.form.CardUploader=function(A){Roo.bootstrap.form.CardUploader.superclass.constructor.call(this,A);this.fileCollection=new Roo.util.MixedCollection(false,function(r){return r.data.id});this.addEvents({'preview':true,'download':true});};Roo.extend(Roo.bootstrap.form.CardUploader,Roo.bootstrap.form.Input,{errorTimeout:3000,images:false,fileCollection:false,allowBlank:true,getAutoCreate:function(){var A={cls:'form-group',cn:[{tag:'label',html:this.fieldLabel}
611 ,{tag:'input',type:'hidden',name:this.name,value:this.value,cls:'d-none  form-control'},{tag:'input',multiple:'multiple',type:'file',cls:'d-none  roo-card-upload-selector'},{cls:'roo-card-uploader-button-container w-100 mb-2'},{cls:'card-columns roo-card-uploader-container'}
612 ]};return A;},getChildContainer:function(){return this.containerEl;},getButtonContainer:function(){return this.el.select(".roo-card-uploader-button-container").first();},initEvents:function(){Roo.bootstrap.form.Input.prototype.initEvents.call(this);var t=this;
613 this.addxtype({xns:Roo.bootstrap,xtype:'Button',container_method:'getButtonContainer',html:this.html,cls:'w-100 ',listeners:{'click':function(A,e){t.onClick(e);}}});this.urlAPI=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);
614 this.selectorEl=this.el.select('.roo-card-upload-selector',true).first();this.selectorEl.on('change',this.onFileSelected,this);if(this.images){var t=this;this.images.forEach(function(A){t.addCard(A)});this.images=false;}this.containerEl=this.el.select('.roo-card-uploader-container',true).first();
615 },onClick:function(e){e.preventDefault();this.selectorEl.dom.click();},onFileSelected:function(e){e.preventDefault();if(typeof(this.selectorEl.dom.files)=='undefined'||!this.selectorEl.dom.files.length){return;}Roo.each(this.selectorEl.dom.files,function(A){this.addFile(A);
616 },this);},addFile:function(A){if(typeof(A)==='string'){throw "Add file by name?";return;}if(!A||!this.urlAPI){return;}var B=this;var C=B.urlAPI.createObjectURL(A);this.addCard({id:Roo.bootstrap.form.CardUploader.ID--,is_uploaded:false,src:C,srcfile:A,title:A.name,mimetype:A.type,preview:false,is_deleted:0}
617 );},addCard:function(A){var t=this;var B=[{xns:Roo.bootstrap,xtype:'CardFooter',items:[{xns:Roo.bootstrap,xtype:'Element',cls:'d-flex',items:[{xns:Roo.bootstrap,xtype:'Button',html:String.format("<small>{0}</small>",A.title),cls:'col-10 text-left',size:'sm',weight:'link',fa:'download',listeners:{click:function(){t.fireEvent("download",t,A);
618 }}},{xns:Roo.bootstrap,xtype:'Button',style:'max-height: 28px; ',size:'sm',weight:'danger',cls:'col-2',fa:'times',listeners:{click:function(){t.removeCard(A.id)}}}]}]}];var cn=this.addxtype({xns:Roo.bootstrap,xtype:'Card',closeable:true,header:!A.mimetype.match(/image/)&&!A.preview?"Document":false,header_image:A.mimetype.match(/image/)?A.src:A.preview,header_image_fit_square:true,data:A,html:false,items:B,initEvents:function(){Roo.bootstrap.Card.prototype.initEvents.call(this);
619 var D=this;this.imgEl=this.el.select('.card-img-top').first();if(this.imgEl){this.imgEl.on('click',function(){t.fireEvent("preview",t,A);},this);this.imgEl.set({'pointer':'cursor'});}this.getCardFooter().addClass('p-1');}});this.fileCollection.add(cn);if(!A.srcfile){this.updateInput();
620 return;}var _t=this;var C=new FileReader();C.addEventListener("load",function(){A.srcdata=C.result;_t.updateInput();});C.readAsDataURL(A.srcfile);},removeCard:function(id){var A=this.fileCollection.get(id);A.data.is_deleted=1;A.data.src='';A.el.dom.parentNode.removeChild(A.el.dom);
621 this.updateInput();},reset:function(){this.fileCollection.each(function(A){if(A.el.dom&&A.el.dom.parentNode){A.el.dom.parentNode.removeChild(A.el.dom);}});this.fileCollection.clear();this.updateInput();},updateInput:function(){var A=[];this.fileCollection.each(function(e){A.push(e.data);
622 });this.inputEl().dom.value=JSON.stringify(A);}});Roo.bootstrap.form.CardUploader.ID=-1;
623 // Roo/data/SortTypes.js
624 Roo.data.SortTypes={none:function(s){return s;},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();
625 },asDate:function(s){if(!s){return 0;}if(s instanceof Date){return s.getTime();}return Date.parse(String(s));},asFloat:function(s){var A=parseFloat(String(s).replace(/,/g,""));if(isNaN(A)){A=0;}return A;},asInt:function(s){var A=parseInt(String(s).replace(/,/g,""));
626 if(isNaN(A)){A=0;}return A;}};
627 // Roo/data/Record.js
628 Roo.data.Record=function(A,id){this.id=(id||id===0)?id:++Roo.data.Record.AUTO_ID;this.data=A;};Roo.data.Record.create=function(o){var f=function(){f.superclass.constructor.apply(this,arguments);};Roo.extend(f,Roo.data.Record);var p=f.prototype;p.fields=new Roo.util.MixedCollection(false,function(B){return B.name;
629 });for(var i=0,A=o.length;i<A;i++){p.fields.add(new Roo.data.Field(o[i]));}f.getField=function(B){return p.fields.get(B);};return f;};Roo.data.Record.AUTO_ID=1000;Roo.data.Record.EDIT='edit';Roo.data.Record.REJECT='reject';Roo.data.Record.COMMIT='commit';
630 Roo.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,join:function(A){this.store=A;},set:function(A,B){if(this.data[A]==B){return;}this.dirty=true;if(!this.modified){this.modified={};}if(typeof this.modified[A]=='undefined'){this.modified[A]=this.data[A];
631 }this.data[A]=B;if(!this.editing&&this.store){this.store.afterEdit(this);}},get:function(A){return this.data[A];},beginEdit:function(){this.editing=true;this.modified={};},cancelEdit:function(){this.editing=false;delete this.modified;},endEdit:function(){this.editing=false;
632 if(this.dirty&&this.store){this.store.afterEdit(this);}},reject:function(){var m=this.modified;for(var n in m){if(typeof m[n]!="function"){this.data[n]=m[n];}}this.dirty=false;delete this.modified;this.editing=false;if(this.store){this.store.afterReject(this);
633 }},commit:function(){this.dirty=false;delete this.modified;this.editing=false;if(this.store){this.store.afterCommit(this);}},hasError:function(){return this.error!=null;},clearError:function(){this.error=null;},copy:function(A){return new this.constructor(Roo.apply({}
634 ,this.data),A||this.id);}};
635 // Roo/data/Store.js
636 Roo.data.Store=function(A){this.data=new Roo.util.MixedCollection(false);this.data.getKey=function(o){return o.id;};this.baseParams={};this.paramNames={"start":"start","limit":"limit","sort":"sort","dir":"dir","multisort":"_multisort"};if(A&&A.data){this.inlineData=A.data;
637 delete A.data;}Roo.apply(this,A);if(this.reader){this.reader=Roo.factory(this.reader,Roo.data);this.reader.xmodule=this.xmodule||false;if(!this.recordType){this.recordType=this.reader.recordType;}if(this.reader.onMetaChange){this.reader.onMetaChange=this.onMetaChange.createDelegate(this);
638 }}if(this.recordType){this.fields=this.recordType.prototype.fields;}this.modified=[];this.addEvents({datachanged:true,metachange:true,add:true,remove:true,update:true,clear:true,beforeload:true,beforeloadadd:true,load:true,loadexception:true});if(this.proxy){this.proxy=Roo.factory(this.proxy,Roo.data);
639 this.proxy.xmodule=this.xmodule||false;this.relayEvents(this.proxy,["loadexception"]);}this.sortToggle={};this.sortOrder=[];Roo.data.Store.superclass.constructor.call(this);if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData;}};Roo.extend(Roo.data.Store,Roo.util.Observable,{multiSort:false,remoteSort:false,pruneModifiedRecords:false,lastOptions:null,add:function(A){A=[].concat(A);
640 for(var i=0,B=A.length;i<B;i++){A[i].join(this);}var C=this.data.length;this.data.addAll(A);this.fireEvent("add",this,A,C);},remove:function(A){var B=this.data.indexOf(A);this.data.removeAt(B);if(this.pruneModifiedRecords){this.modified.remove(A);}this.fireEvent("remove",this,A,B);
641 },removeAll:function(){this.data.clear();if(this.pruneModifiedRecords){this.modified=[];}this.fireEvent("clear",this);},insert:function(A,B){B=[].concat(B);for(var i=0,C=B.length;i<C;i++){this.data.insert(A,B[i]);B[i].join(this);}this.fireEvent("add",this,B,A);
642 },indexOf:function(A){return this.data.indexOf(A);},indexOfId:function(id){return this.data.indexOfKey(id);},getById:function(id){return this.data.key(id);},getAt:function(A){return this.data.itemAt(A);},getRange:function(A,B){return this.data.getRange(A,B);
643 },storeOptions:function(o){o=Roo.apply({},o);delete o.callback;delete o.scope;this.lastOptions=o;},load:function(A){A=A||{};if(this.fireEvent("beforeload",this,A)!==false){this.storeOptions(A);var p=Roo.apply(A.params||{},this.baseParams);if(!this.reader.metaFromRemote){p._requestMeta=1;
644 }if(this.sortInfo&&this.remoteSort){var pn=this.paramNames;p[pn["sort"]]=this.sortInfo.field;p[pn["dir"]]=this.sortInfo.direction;}if(this.multiSort){var pn=this.paramNames;p[pn["multisort"]]=Roo.encode({sort:this.sortToggle,order:this.sortOrder});}this.proxy.load(p,this.reader,this.loadRecords,this,A);
645 }},reload:function(A){this.load(Roo.applyIf(A||{},this.lastOptions));},loadRecords:function(o,A,B){if(!o){if(B!==false){this.fireEvent("load",this,[],A,o);}if(A.callback){A.callback.call(A.scope||this,[],A,false);}return;}if(o.success===false){if(!this.hasListener('loadexception')&&typeof(o.raw.errorMsg)!='undefined'){Roo.MessageBox.alert("Error loading",o.raw.errorMsg);
646 }this.fireEvent("loadexception",this,o,A,o.raw.errorMsg);return;}var r=o.records,t=o.totalRecords||r.length;this.fireEvent("beforeloadadd",this,r,A,o);if(!A||A.add!==true){if(this.pruneModifiedRecords){this.modified=[];}for(var i=0,C=r.length;i<C;i++){r[i].join(this);
647 }if(this.snapshot){this.data=this.snapshot;delete this.snapshot;}this.data.clear();this.data.addAll(r);this.totalLength=t;this.applySort();this.fireEvent("datachanged",this);}else{this.totalLength=Math.max(t,this.data.length+r.length);this.add(r);}if(this.parent&&!Roo.isIOS&&!this.useNativeIOS&&this.parent.emptyTitle.length){var e=new Roo.data.Record({}
648 );e.set(this.parent.displayField,this.parent.emptyTitle);e.set(this.parent.valueField,'');this.insert(0,e);}this.fireEvent("load",this,r,A,o);if(A.callback){A.callback.call(A.scope||this,r,A,true);}},loadData:function(o,A){var r=this.reader.readRecords(o);
649 this.loadRecords(r,{add:A},true);},loadDataFromChildren:function(A){this.loadData(this.reader.toLoadData(A));},getCount:function(){return this.data.length||0;},getTotalCount:function(){return this.totalLength||0;},getSortState:function(){return this.sortInfo;
650 },applySort:function(){if(this.sortInfo&&!this.remoteSort){var s=this.sortInfo,f=s.field;var st=this.fields.get(f).sortType;var fn=function(r1,r2){var v1=st(r1.data[f]),v2=st(r2.data[f]);return v1>v2?1:(v1<v2?-1:0);};this.data.sort(s.direction,fn);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(s.direction,fn);
651 }}},setDefaultSort:function(A,B){this.sortInfo={field:A,direction:B?B.toUpperCase():"ASC"};},sort:function(A,B){var f=this.fields.get(A);if(!B){this.sortToggle[f.name]=this.sortToggle[f.name]||f.sortDir;if(this.multiSort||(this.sortInfo&&this.sortInfo.field==f.name)){B=(this.sortToggle[f.name]||"ASC").toggle("ASC","DESC");
652 }else{B=f.sortDir;}}this.sortToggle[f.name]=B;this.sortInfo={field:f.name,direction:B};if(!this.remoteSort){this.applySort();this.fireEvent("datachanged",this);}else{this.load(this.lastOptions);}},each:function(fn,A){this.data.each(fn,A);},getModifiedRecords:function(){return this.modified;
653 },createFilterFn:function(A,B,C){if(!B.exec){B=String(B);if(B.length==0){return false;}B=new RegExp((C===true?'':'^')+Roo.escapeRe(B),"i");}return function(r){return B.test(r.data[A]);};},sum:function(A,B,C){var rs=this.data.items,v=0;B=B||0;C=(C||C===0)?C:rs.length-1;
654 for(var i=B;i<=C;i++){v+=(rs[i].data[A]||0);}return v;},filter:function(A,B,C){var fn=this.createFilterFn(A,B,C);return fn?this.filterBy(fn):this.clearFilter();},filterBy:function(fn,A){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(fn,A||this);
655 this.fireEvent("datachanged",this);},query:function(A,B,C){var fn=this.createFilterFn(A,B,C);return fn?this.queryBy(fn):this.data.clone();},queryBy:function(fn,A){var B=this.snapshot||this.data;return B.filterBy(fn,A||this);},collect:function(A,B,C){var d=(C===true&&this.snapshot)?this.snapshot.items:this.data.items;
656 var v,sv,r=[],l={};for(var i=0,D=d.length;i<D;i++){v=d[i].data[A];sv=String(v);if((B||!Roo.isEmpty(v))&&!l[sv]){l[sv]=true;r[r.length]=v;}}return r;},clearFilter:function(A){if(this.snapshot&&this.snapshot!=this.data){this.data=this.snapshot;delete this.snapshot;
657 if(A!==true){this.fireEvent("datachanged",this);}}},afterEdit:function(A){if(this.modified.indexOf(A)==-1){this.modified.push(A);}this.fireEvent("update",this,A,Roo.data.Record.EDIT);},afterReject:function(A){this.modified.remove(A);this.fireEvent("update",this,A,Roo.data.Record.REJECT);
658 },afterCommit:function(A){this.modified.remove(A);this.fireEvent("update",this,A,Roo.data.Record.COMMIT);},commitChanges:function(){var m=this.modified.slice(0);this.modified=[];for(var i=0,A=m.length;i<A;i++){m[i].commit();}},rejectChanges:function(){var m=this.modified.slice(0);
659 this.modified=[];for(var i=0,A=m.length;i<A;i++){m[i].reject();}},onMetaChange:function(A,B,o){this.recordType=B;this.fields=B.prototype.fields;delete this.snapshot;this.sortInfo=A.sortInfo||this.sortInfo;this.modified=[];this.fireEvent('metachange',this,this.reader.meta);
660 },moveIndex:function(A,B){var C=this.indexOf(A);var D=C+B;this.remove(A);this.insert(D,A);}});
661 // Roo/data/SimpleStore.js
662 Roo.data.SimpleStore=function(A){Roo.data.SimpleStore.superclass.constructor.call(this,{isLocal:true,reader:typeof(A.reader)!='undefined'?A.reader:new Roo.data.ArrayReader({id:A.id},Roo.data.Record.create(A.fields)),proxy:new Roo.data.MemoryProxy(A.data)});
663 this.load();};Roo.extend(Roo.data.SimpleStore,Roo.data.Store);
664 // Roo/data/JsonStore.js
665 Roo.data.JsonStore=function(c){Roo.data.JsonStore.superclass.constructor.call(this,Roo.apply(c,{proxy:!c.data?new Roo.data.HttpProxy({url:c.url}):undefined,reader:new Roo.data.JsonReader(c,c.fields)}));};Roo.extend(Roo.data.JsonStore,Roo.data.Store);
666 // Roo/data/Field.js
667 Roo.data.Field=function(A){if(typeof A=="string"){A={name:A};}Roo.apply(this,A);if(!this.type){this.type="auto";}var st=Roo.data.SortTypes;if(typeof this.sortType=="string"){this.sortType=st[this.sortType];}if(!this.sortType){switch(this.type){case "string":this.sortType=st.asUCString;
668 break;case "date":this.sortType=st.asDate;break;default:this.sortType=st.none;}}var B=/[\$,%]/g;if(!this.convert){var cv,C=this.dateFormat;switch(this.type){case "":case "auto":case undefined:cv=function(v){return v;};break;case "string":cv=function(v){return (v===undefined||v===null)?'':String(v);
669 };break;case "int":cv=function(v){return v!==undefined&&v!==null&&v!==''?parseInt(String(v).replace(B,""),10):'';};break;case "float":cv=function(v){return v!==undefined&&v!==null&&v!==''?parseFloat(String(v).replace(B,""),10):'';};break;case "bool":case "boolean":cv=function(v){return v===true||v==="true"||v==1;
670 };break;case "date":cv=function(v){if(!v){return '';}if(v instanceof Date){return v;}if(C){if(C=="timestamp"){return new Date(v*1000);}return Date.parseDate(v,C);}var D=Date.parse(v);return D?new Date(D):null;};break;}this.convert=cv;}};Roo.data.Field.prototype={dateFormat:null,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC"}
671 ;
672 // Roo/data/DataReader.js
673 Roo.data.DataReader=function(A,B){this.meta=A;this.recordType=B instanceof Array?Roo.data.Record.create(B):B;};Roo.data.DataReader.prototype={readerType:'Data',newRow:function(d){var da={};this.recordType.prototype.fields.each(function(c){switch(c.type){case 'int':da[c.name]=0;
674 break;case 'date':da[c.name]=new Date();break;case 'float':da[c.name]=0.0;break;case 'boolean':da[c.name]=false;break;default:da[c.name]="";break;}});return new this.recordType(Roo.apply(da,d));}};
675 // Roo/data/DataProxy.js
676 Roo.data.DataProxy=function(){this.addEvents({beforeload:true,load:true,loadexception:true});Roo.data.DataProxy.superclass.constructor.call(this);};Roo.extend(Roo.data.DataProxy,Roo.util.Observable);
677 // Roo/data/MemoryProxy.js
678 Roo.data.MemoryProxy=function(A){var B=A;if(typeof(A)!='undefined'&&typeof(A.data)!='undefined'){B=A.data;}Roo.data.MemoryProxy.superclass.constructor.call(this);this.data=B;};Roo.extend(Roo.data.MemoryProxy,Roo.data.DataProxy,{load:function(A,B,C,D,E){A=A||{}
679 ;var F;try{F=B.readRecords(A.data?A.data:this.data);}catch(e){this.fireEvent("loadexception",this,E,null,e);C.call(D,null,E,false);return;}C.call(D,F,E,true);},update:function(A,B){}});
680 // Roo/data/HttpProxy.js
681 Roo.data.HttpProxy=function(A){Roo.data.HttpProxy.superclass.constructor.call(this);this.conn=A;this.useAjax=!A||!A.events;};Roo.extend(Roo.data.HttpProxy,Roo.data.DataProxy,{getConnection:function(){return this.useAjax?Roo.Ajax:this.conn;},load:function(A,B,C,D,E){if(this.fireEvent("beforeload",this,A)!==false){var o={params:A||{}
682 ,request:{callback:C,scope:D,arg:E},reader:B,callback:this.loadResponse,scope:this};if(this.useAjax){Roo.applyIf(o,this.conn);if(this.activeRequest){Roo.Ajax.abort(this.activeRequest);}this.activeRequest=Roo.Ajax.request(o);}else{this.conn.request(o);}}else{C.call(D||this,null,E,false);
683 }},loadResponse:function(o,A,B){delete this.activeRequest;if(!A){this.fireEvent("loadexception",this,o,B);o.request.callback.call(o.request.scope,null,o.request.arg,false);return;}var C;try{C=o.reader.read(B);}catch(e){o.success=false;o.raw={errorMsg:B.responseText}
684 ;this.fireEvent("loadexception",this,o,B,e);o.request.callback.call(o.request.scope,o,o.request.arg,false);return;}this.fireEvent("load",this,o,o.request.arg);o.request.callback.call(o.request.scope,C,o.request.arg,true);},update:function(A){},updateResponse:function(A){}
685 });
686 // Roo/data/ScriptTagProxy.js
687 Roo.data.ScriptTagProxy=function(A){Roo.data.ScriptTagProxy.superclass.constructor.call(this);Roo.apply(this,A);this.head=document.getElementsByTagName("head")[0];};Roo.data.ScriptTagProxy.TRANS_ID=1000;Roo.extend(Roo.data.ScriptTagProxy,Roo.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,load:function(A,B,C,D,E){if(this.fireEvent("beforeload",this,A)!==false){var p=Roo.urlEncode(Roo.apply(A,this.extraParams));
688 var F=this.url;F+=(F.indexOf("?")!=-1?"&":"?")+p;if(this.nocache){F+="&_dc="+(new Date().getTime());}var G=++Roo.data.ScriptTagProxy.TRANS_ID;var H={id:G,cb:"stcCallback"+G,scriptId:"stcScript"+G,params:A,arg:E,url:F,callback:C,scope:D,reader:B};var I=this;
689 window[H.cb]=function(o){I.handleResponse(o,H);};F+=String.format("&{0}={1}",this.callbackParam,H.cb);if(this.autoAbort!==false){this.abort();}H.timeoutId=this.handleFailure.defer(this.timeout,this,[H]);var J=document.createElement("script");J.setAttribute("src",F);
690 J.setAttribute("type","text/javascript");J.setAttribute("id",H.scriptId);this.head.appendChild(J);this.trans=H;}else{C.call(D||this,null,E,false);}},isLoading:function(){return this.trans?true:false;},abort:function(){if(this.isLoading()){this.destroyTrans(this.trans);
691 }},destroyTrans:function(A,B){this.head.removeChild(document.getElementById(A.scriptId));clearTimeout(A.timeoutId);if(B){window[A.cb]=undefined;try{delete window[A.cb];}catch(e){}}else{window[A.cb]=function(){window[A.cb]=undefined;try{delete window[A.cb];
692 }catch(e){}};}},handleResponse:function(o,A){this.trans=false;this.destroyTrans(A,true);var B;try{B=A.reader.readRecords(o);}catch(e){this.fireEvent("loadexception",this,o,A.arg,e);A.callback.call(A.scope||window,null,A.arg,false);return;}this.fireEvent("load",this,o,A.arg);
693 A.callback.call(A.scope||window,B,A.arg,true);},handleFailure:function(A){this.trans=false;this.destroyTrans(A,false);this.fireEvent("loadexception",this,null,A.arg);A.callback.call(A.scope||window,null,A.arg,false);}});
694 // Roo/data/JsonReader.js
695 Roo.data.JsonReader=function(A,B){A=A||{};Roo.applyIf(A,{totalProperty:'total',successProperty:'success',root:'data',id:'id'});Roo.data.JsonReader.superclass.constructor.call(this,A,B||A.fields);};Roo.extend(Roo.data.JsonReader,Roo.data.DataReader,{readerType:'Json',metaFromRemote:false,read:function(A){var B=A.responseText;
696 var o=eval("("+B+")");if(!o){throw {message:"JsonReader.read: Json object not found"};}if(o.metaData){delete this.ef;this.metaFromRemote=true;this.meta=o.metaData;this.recordType=Roo.data.Record.create(o.metaData.fields);this.onMetaChange(this.meta,this.recordType,o);
697 }return this.readRecords(o);},onMetaChange:function(A,B,o){},simpleAccess:function(A,B){return A[B];},getJsonAccessor:function(){var re=/[\[\.]/;return function(A){try{return (re.test(A))?new Function("obj","return obj."+A):function(B){return B[A];};}catch(e){}
698 return Roo.emptyFn;};}(),readRecords:function(o){this.o=o;var s=this.meta,A=this.recordType,f=A?A.prototype.fields:null,fi=f?f.items:[],fl=f?f.length:0;if(!this.ef){if(s.totalProperty){this.getTotal=this.getJsonAccessor(s.totalProperty);}if(s.successProperty){this.getSuccess=this.getJsonAccessor(s.successProperty);
699 }this.getRoot=s.root?this.getJsonAccessor(s.root):function(p){return p;};if(s.id){var g=this.getJsonAccessor(s.id);this.getId=function(I){var r=g(I);return (r===undefined||r==="")?null:r;};}else{this.getId=function(){return null;};}this.ef=[];for(var jj=0;
700 jj<fl;jj++){f=fi[jj];var B=(f.mapping!==undefined&&f.mapping!==null)?f.mapping:f.name;this.ef[jj]=this.getJsonAccessor(B);}}var C=this.getRoot(o),c=C.length,D=c,E=true;if(s.totalProperty){var vt=parseInt(this.getTotal(o),10);if(!isNaN(vt)){D=vt;}}if(s.successProperty){var vs=this.getSuccess(o);
701 if(vs===false||vs==='false'){E=false;}}var F=[];for(var i=0;i<c;i++){var n=C[i];var G={};var id=this.getId(n);for(var j=0;j<fl;j++){f=fi[j];var v=this.ef[j](n);if(!f.convert){Roo.log('missing convert for '+f.name);Roo.log(f);continue;}G[f.name]=f.convert((v!==undefined)?v:f.defaultValue);
702 }if(!A){return {raw:{errorMsg:"JSON Reader Error: fields or metadata not available to create Record"},success:false,records:[],totalRecords:0};}var H=new A(G,id);H.json=n;F[i]=H;}return {raw:o,success:E,records:F,totalRecords:D};},toLoadData:function(A){var B=typeof(A.data.cn)=='undefined'?[]:A.data.cn;
703 return {data:B,total:B.length};}});
704 // Roo/data/ArrayReader.js
705 Roo.data.ArrayReader=function(A,B){Roo.data.ArrayReader.superclass.constructor.call(this,A,B||A.fields);};Roo.extend(Roo.data.ArrayReader,Roo.data.JsonReader,{readRecords:function(o){var A=this.meta?this.meta.id:null;var B=this.recordType,C=B.prototype.fields;
706 var D=[];var E=o;for(var i=0;i<E.length;i++){var n=E[i];var F={};var id=((A||A===0)&&n[A]!==undefined&&n[A]!==""?n[A]:null);for(var j=0,G=C.length;j<G;j++){var f=C.items[j];var k=f.mapping!==undefined&&f.mapping!==null?f.mapping:j;var v=n[k]!==undefined?n[k]:f.defaultValue;
707 v=f.convert(v);F[f.name]=v;}var H=new B(F,id);H.json=n;D[D.length]=H;}return {records:D,totalRecords:D.length};},toLoadData:function(A){return typeof(A.data.cn)=='undefined'?[]:A.data.cn;}});
708 // Roo/bootstrap/form/ComboBox.js
709 Roo.bootstrap.form.ComboBox=function(A){Roo.bootstrap.form.ComboBox.superclass.constructor.call(this,A);this.addEvents({'expand':true,'collapse':true,'beforeselect':true,'select':true,'beforequery':true,'add':true,'edit':true,'remove':true,'afterremove':true,'specialfilter':true,'tick':true,'touchviewdisplay':true}
710 );this.item=[];this.tickItems=[];this.selectedIndex=-1;if(this.mode=='local'){if(A.queryDelay===undefined){this.queryDelay=10;}if(A.minChars===undefined){this.minChars=0;}}};Roo.extend(Roo.bootstrap.form.ComboBox,Roo.bootstrap.form.TriggerField,{listWidth:undefined,displayField:undefined,valueField:undefined,modalTitle:'',hiddenName:undefined,listClass:'',selectedClass:'active',shadow:'sides',listAlign:'tl-bl?',maxHeight:300,triggerAction:'query',minChars:4,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:'query',loadingText:'Loading...',resizable:false,handleHeight:8,editable:true,allQuery:'',mode:'remote',minListWidth:70,forceSelection:false,typeAheadDelay:250,valueNotFoundText:undefined,blockFocus:false,disableClear:false,alwaysQuery:false,multiple:false,invalidClass:"has-warning",validClass:"has-success",specialFilter:false,mobileTouchView:true,useNativeIOS:false,mobile_restrict_height:false,ios_options:false,addicon:false,editicon:false,page:0,hasQuery:false,append:false,loadNext:false,autoFocus:true,tickable:false,btnPosition:'right',triggerList:true,showToggleBtn:true,animate:true,emptyResultText:'Empty',triggerText:'Select',emptyTitle:'',width:false,getAutoCreate:function(){var A=false;
711 if(Roo.isIOS&&this.useNativeIOS){A=this.getAutoCreateNativeIOS();return A;}if(Roo.isTouch&&this.mobileTouchView){A=this.getAutoCreateTouchView();return A;;}if(!this.tickable){A=Roo.bootstrap.form.ComboBox.superclass.getAutoCreate.call(this);return A;}var B=this.labelAlign||this.parentLabelAlign();
712 A={cls:'form-group roo-combobox-tickable'};var C='';var D='';var E='';if(this.btn_text_show){C='Select';D='Done';E='Cancel';}var F={tag:'div',cls:'tickable-buttons',cn:[{tag:'button',type:'button',cls:'btn btn-link btn-edit pull-'+this.btnPosition,html:C}
713 ,{tag:'button',type:'button',name:'ok',cls:'btn btn-link btn-ok pull-'+this.btnPosition,html:D},{tag:'button',type:'button',name:'cancel',cls:'btn btn-link btn-cancel pull-'+this.btnPosition,html:E}]};if(this.editable){F.cn.unshift({tag:'input',cls:'roo-select2-search-field-input'}
714 );}var G=this;Roo.each(F.cn,function(c){if(G.size){c.cls+=' btn-'+G.size;}if(G.disabled){c.disabled=true;}});var H={tag:'div',style:'display: contents',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},{tag:'ul',cls:'roo-select2-choices',cn:[{tag:'li',cls:'roo-select2-search-field',cn:[F]}
715 ]}]};var I={cls:'roo-select2-container input-group roo-select2-container-multi',cn:[H]};if(this.hasFeedback&&!this.allowBlank){var J={tag:'span',cls:'glyphicon form-control-feedback'};I.cn.push(J);}var K={tag:'i',cls:'roo-required-indicator '+(this.indicatorpos=='right'?'right':'left')+'-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'}
716 ;if(Roo.bootstrap.version==4){K={tag:'i',style:'display:none'};}if(B==='left'&&this.fieldLabel.length){A.cls+=' roo-form-group-label-left'+(Roo.bootstrap.version==4?' row':'');A.cn=[K,{tag:'label','for':id,cls:'control-label col-form-label',html:this.fieldLabel}
717 ,{cls:"",cn:[I]}];var L=A.cn[1];var M=A.cn[2];if(this.indicatorpos=='right'){A.cn=[{tag:'label','for':id,cls:'control-label col-form-label',cn:[{tag:'span',html:this.fieldLabel},K]},{cls:"",cn:[I]}];L=A.cn[0];M=A.cn[1];}if(this.labelWidth>12){L.style="width: "+this.labelWidth+'px';
718 }if(this.width*1>0){M.style="width: "+this.width+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){L.cls+=' col-lg-'+this.labellg;M.cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){L.cls+=' col-md-'+this.labelmd;
719 M.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){L.cls+=' col-sm-'+this.labelsm;M.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){L.cls+=' col-xs-'+this.labelxs;M.cls+=' col-xs-'+(12-this.labelxs);}}else if(this.fieldLabel.length){A.cn=[K,{tag:'label',html:this.fieldLabel}
720 ,I];if(this.indicatorpos=='right'){A.cn=[{tag:'label',html:this.fieldLabel},K,I];}}else{A=I}var N=this;['xs','sm','md','lg'].map(function(O){if(N[O]){A.cls+=' col-'+O+'-'+N[O];}});return A;},_initEventsCalled:false,initEvents:function(){if(this._initEventsCalled){return;
721 }this._initEventsCalled=true;if(!this.store){throw "can not find store for combo";}this.indicator=this.indicatorEl();this.store=Roo.factory(this.store,Roo.data);this.store.parent=this;if(Roo.XComponent.build_from_html){var e=this.el.dom,k=0;while(e){e=e.previousSibling;
722 ++k;}this.el.remove();this.el=false;this.rendered=false;this.render(this.parent().getChildContainer(true),k);}if(Roo.isIOS&&this.useNativeIOS){this.initIOSView();return;}if(Roo.isTouch&&this.mobileTouchView){this.initTouchView();return;}if(this.tickable){this.initTickableEvents();
723 return;}Roo.bootstrap.form.ComboBox.superclass.initEvents.call(this);if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first();this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';
724 this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName);}var A='x-combo-list';var B=this;(function(){var lw=B.listWidth||Math.max(B.inputEl().getWidth(),B.minListWidth);B.list.setWidth(lw);}).defer(100);this.list.on('mouseover',this.onViewOver,this);
725 this.list.on('mousemove',this.onViewMove,this);this.list.on('scroll',this.onViewScroll,this);if(!this.tpl){this.tpl=Roo.bootstrap.version==4?'<a class="dropdown-item" href="#">{'+this.displayField+'}</a>':'<li><a class="dropdown-item" href="#">{'+this.displayField+'}</a></li>';
726 }this.view=new Roo.View(this.list,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass});this.view.on('click',this.onViewClick,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this);
727 if(!this.editable){this.editable=true;this.setEditable(false);}this.keyNav=new Roo.KeyNav(this.inputEl(),{"up":function(e){this.inKeyMode=true;this.selectPrev();},"down":function(e){if(!this.isExpanded()){this.onTriggerClick();}else{this.inKeyMode=true;this.selectNext();
728 }},"enter":function(e){this.collapse();if(this.fireEvent("specialkey",this,e)){this.onViewClick(false);}return true;},"esc":function(e){this.collapse();},"tab":function(e){this.collapse();if(this.fireEvent("specialkey",this,e)){this.onViewClick(false);}return true;
729 },scope:this,doRelay:function(C,D,E){if(E=='down'||this.scope.isExpanded()){return Roo.KeyNav.prototype.doRelay.apply(this,arguments);}return true;},forceKeyDown:true});this.queryDelay=Math.max(this.queryDelay||10,this.mode=='local'?10:250);this.dqTask=new Roo.util.DelayedTask(this.initQuery,this);
730 if(this.typeAhead){this.taTask=new Roo.util.DelayedTask(this.onTypeAhead,this);}if(this.editable!==false){this.inputEl().on("keyup",this.onKeyUp,this);}if(this.forceSelection){this.inputEl().on('blur',this.doForce,this);}if(this.multiple){this.choices=this.el.select('ul.roo-select2-choices',true).first();
731 this.searchField=this.el.select('ul li.roo-select2-search-field',true).first();}},initTickableEvents:function(){this.createList();if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first();this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';
732 this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName);}this.choices=this.el.select('ul.roo-select2-choices',true).first();this.searchField=this.el.select('ul li.roo-select2-search-field',true).first();if(this.triggerList){this.searchField.on("click",this.onSearchFieldClick,this,{preventDefault:true}
733 );}this.trigger=this.el.select('.tickable-buttons > .btn-edit',true).first();this.trigger.on("click",this.onTickableTriggerClick,this,{preventDefault:true});this.okBtn=this.el.select('.tickable-buttons > .btn-ok',true).first();this.cancelBtn=this.el.select('.tickable-buttons > .btn-cancel',true).first();
734 this.okBtn.on('click',this.onTickableFooterButtonClick,this,this.okBtn);this.cancelBtn.on('click',this.onTickableFooterButtonClick,this,this.cancelBtn);this.trigger.setVisibilityMode(Roo.Element.DISPLAY);this.okBtn.setVisibilityMode(Roo.Element.DISPLAY);this.cancelBtn.setVisibilityMode(Roo.Element.DISPLAY);
735 this.okBtn.hide();this.cancelBtn.hide();var A=this;(function(){var lw=A.listWidth||Math.max(A.inputEl().getWidth(),A.minListWidth);A.list.setWidth(lw);}).defer(100);this.list.on('mouseover',this.onViewOver,this);this.list.on('mousemove',this.onViewMove,this);
736 this.list.on('scroll',this.onViewScroll,this);if(!this.tpl){this.tpl='<li class="roo-select2-result"><div class="checkbox"><input id="{roo-id}"'+'type="checkbox" {roo-data-checked}><label for="{roo-id}"><b>{'+this.displayField+'}</b></label></div></li>';}
737 this.view=new Roo.View(this.list,this.tpl,{singleSelect:true,tickable:true,parent:this,store:this.store,selectedClass:this.selectedClass});this.view.on('click',this.onViewClick,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);
738 this.store.on('loadexception',this.onLoadException,this);if(this.editable){this.keyNav=new Roo.KeyNav(this.tickableInputEl(),{"up":function(e){this.inKeyMode=true;this.selectPrev();},"down":function(e){this.inKeyMode=true;this.selectNext();},"enter":function(e){if(this.fireEvent("specialkey",this,e)){this.onViewClick(false);
739 }return true;},"esc":function(e){this.onTickableFooterButtonClick(e,false,false);},"tab":function(e){this.fireEvent("specialkey",this,e);this.onTickableFooterButtonClick(e,false,false);return true;},scope:this,doRelay:function(e,fn,B){if(this.scope.isExpanded()){return Roo.KeyNav.prototype.doRelay.apply(this,arguments);
740 }return true;},forceKeyDown:true});}this.queryDelay=Math.max(this.queryDelay||10,this.mode=='local'?10:250);this.dqTask=new Roo.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Roo.util.DelayedTask(this.onTypeAhead,this);}if(this.editable!==false){this.tickableInputEl().on("keyup",this.onKeyUp,this);
741 }this.indicator=this.indicatorEl();if(this.indicator){this.indicator.setVisibilityMode(Roo.Element.DISPLAY);this.indicator.hide();}},onDestroy:function(){if(this.view){this.view.setStore(null);this.view.el.removeAllListeners();this.view.el.remove();this.view.purgeListeners();
742 }if(this.list){this.list.dom.innerHTML='';}if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.onLoadException,this);}Roo.bootstrap.form.ComboBox.superclass.onDestroy.call(this);
743 },fireKey:function(e){if(e.isNavKeyPress()&&!this.list.isVisible()){this.fireEvent("specialkey",this,e);}},onResize:function(w,h){},setEditable:function(A){if(A==this.editable){return;}this.editable=A;if(!A){this.inputEl().dom.setAttribute('readOnly',true);
744 this.inputEl().on('mousedown',this.onTriggerClick,this);this.inputEl().addClass('x-combo-noedit');}else{this.inputEl().dom.removeAttribute('readOnly');this.inputEl().un('mousedown',this.onTriggerClick,this);this.inputEl().removeClass('x-combo-noedit');}},onBeforeLoad:function(A,B){if(!this.hasFocus){return;
745 }if(!B.add){this.list.dom.innerHTML='<li class="loading-indicator">'+(this.loadingText||'loading')+'</li>';}this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){this.hasQuery=false;if(!this.hasFocus){return;}if(typeof(this.loading)!=='undefined'&&this.loading!==null){this.loading.hide();
746 }if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable&&!this.tickable){this.inputEl().dom.select();}if(!this.selectByValue(this.value,true)&&this.autoFocus&&(!this.store.lastOptions||typeof(this.store.lastOptions.add)=='undefined'||this.store.lastOptions.add!=true)){this.select(0,true);
747 }}else{if(this.autoFocus){this.selectNext();}if(this.typeAhead&&this.lastKey!=Roo.EventObject.BACKSPACE&&this.lastKey!=Roo.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay);}}}else{this.onEmptyResults();}},onLoadException:function(){this.hasQuery=false;
748 if(typeof(this.loading)!=='undefined'&&this.loading!==null){this.loading.hide();}if(this.tickable&&this.editable){return;}this.collapse();},onTypeAhead:function(){if(this.store.getCount()>0){var r=this.store.getAt(0);var A=r.data[this.displayField];var B=A.length;
749 var C=this.getRawValue().length;if(C!=B){this.setRawValue(A);this.selectText(C,A.length);}}},onSelect:function(A,B){if(this.fireEvent('beforeselect',this,A,B)!==false){this.setFromData(B>-1?A.data:false);this.collapse();this.fireEvent('select',this,A,B);}
750 },getValue:function(){if(Roo.isIOS&&this.useNativeIOS){return this.ios_options[this.inputEl().dom.selectedIndex].data[this.valueField];}if(this.multiple){return (this.hiddenField)?this.hiddenField.dom.value:this.value;}if(this.valueField){return typeof this.value!='undefined'?this.value:'';
751 }else{return Roo.bootstrap.form.ComboBox.superclass.getValue.call(this);}},getRawValue:function(){if(Roo.isIOS&&this.useNativeIOS){return this.ios_options[this.inputEl().dom.selectedIndex].data[this.displayField];}var v=this.inputEl().getValue();return v;
752 },clearValue:function(){if(this.hiddenField){this.hiddenField.dom.value='';}this.value='';this.setRawValue('');this.lastSelectionText='';this.lastData=false;var A=this.closeTriggerEl();if(A){A.hide();}this.validate();},setValue:function(v){if(Roo.isIOS&&this.useNativeIOS){this.setIOSValue(v);
753 return;}if(this.multiple){this.syncValue();return;}var A=v;if(this.valueField){var r=this.findRecord(this.valueField,v);if(r){A=r.data[this.displayField];}else if(this.valueNotFoundText!==undefined){A=this.valueNotFoundText;}}this.lastSelectionText=A;if(this.hiddenField){this.hiddenField.dom.value=v;
754 }Roo.bootstrap.form.ComboBox.superclass.setValue.call(this,A);this.value=v;var B=this.closeTriggerEl();if(B){(v&&(v.length||v*1>0))?B.show():B.hide();}this.validate();},lastData:false,setFromData:function(o){if(this.multiple){this.addItem(o);return;}var dv='';
755 var vv='';this.lastData=o;if(this.displayField){dv=!o||typeof(o[this.displayField])=='undefined'?'':o[this.displayField];}else{Roo.log('no  displayField value set for '+(this.name?this.name:this.id));}if(this.valueField){vv=!o||typeof(o[this.valueField])=='undefined'?dv:o[this.valueField];
756 }var A=this.closeTriggerEl();if(A){if(dv.length||vv*1>0){A.show();this.blockFocus=true;}else{A.hide();}}if(this.hiddenField){this.hiddenField.dom.value=vv;this.lastSelectionText=dv;Roo.bootstrap.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;
757 return;}this.lastSelectionText=dv;Roo.bootstrap.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;},reset:function(){if(this.multiple){this.clearItem();return;}this.setValue(this.originalValue);this.lastData=false;if(this.view){this.view.clearSelections();
758 }this.validate();},findRecord:function(A,B){var C;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[A]==B){C=r;return false;}return true;});}return C;},getName:function(){if(!this.rendered){return ''};return !this.hiddenName&&this.inputEl().dom.name?this.inputEl().dom.name:(this.hiddenName||'');
759 },onViewMove:function(e,t){this.inKeyMode=false;},onViewOver:function(e,t){if(this.inKeyMode){return;}var A=this.view.findItemFromChild(t);if(A){var B=this.view.indexOf(A);this.select(B,false);}},onViewClick:function(A,B,el,e){var C=this.view.getSelectedIndexes()[0];
760 var r=this.store.getAt(C);if(this.tickable){if(typeof(e)!='undefined'&&e.getTarget().nodeName.toLowerCase()!='input'){return;}var rm=false;var D=this;Roo.each(this.tickItems,function(v,k){if(typeof(v)!='undefined'&&v[D.valueField]==r.data[D.valueField]){Roo.log(v);
761 D.tickItems.splice(k,1);if(typeof(e)=='undefined'&&A==false){Roo.get(D.view.getNodes(C,C)[0]).select('input',true).first().dom.checked=false;}rm=true;return;}});if(rm){return;}if(this.fireEvent('tick',this,r,C,Roo.get(D.view.getNodes(C,C)[0]).select('input',true).first().dom.checked)!==false){this.tickItems.push(r.data);
762 }if(typeof(e)=='undefined'&&A==false){Roo.get(D.view.getNodes(C,C)[0]).select('input',true).first().dom.checked=true;}return;}if(r){this.onSelect(r,C);}if(B!==false&&!this.blockFocus){this.inputEl().focus();}},restrictHeight:function(){this.list.alignTo(this.inputEl(),this.listAlign);
763 this.list.alignTo(this.inputEl(),this.listAlign);},onEmptyResults:function(){if(this.tickable&&this.editable){this.hasFocus=false;this.restrictHeight();return;}this.collapse();},isExpanded:function(){return this.list.isVisible();},selectByValue:function(v,A){if(v!==undefined&&v!==null){var r=this.findRecord(this.valueField||this.displayField,v);
764 if(r){this.select(this.store.indexOf(r),A);return true;}}return false;},select:function(A,B){this.selectedIndex=A;this.view.select(A);if(B!==false){var el=this.view.getNode(A);if(el){this.list.scrollChildIntoView(el,false);}}},selectNext:function(){var ct=this.store.getCount();
765 if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex<ct-1){this.select(this.selectedIndex+1);}}},selectPrev:function(){var ct=this.store.getCount();if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex!=0){this.select(this.selectedIndex-1);
766 }}},onKeyUp:function(e){if(this.editable!==false&&!e.isSpecialKey()){this.lastKey=e.getKey();this.dqTask.delay(this.queryDelay);}},validateBlur:function(){return !this.list||!this.list.isVisible();},initQuery:function(){var v=this.getRawValue();if(this.tickable&&this.editable){v=this.tickableInputEl().getValue();
767 }this.doQuery(v);},doForce:function(){if(this.inputEl().dom.value.length>0){this.inputEl().dom.value=this.lastSelectionText===undefined?'':this.lastSelectionText;}},doQuery:function(q,A){if(q===undefined||q===null){q='';}var qe={query:q,forceAll:A,combo:this,cancel:false}
768 ;if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;}q=qe.query;A=qe.forceAll;if(A===true||(q.length>=this.minChars)){this.hasQuery=true;if(this.lastQuery!=q||this.alwaysQuery){this.lastQuery=q;if(this.mode=='local'){this.selectedIndex=-1;
769 if(A){this.store.clearFilter();}else{if(this.specialFilter){this.fireEvent('specialfilter',this);this.onLoad();return;}this.store.filter(this.displayField,q);}this.store.fireEvent("datachanged",this.store);this.onLoad();}else{this.store.baseParams[this.queryParam]=q;
770 var B={params:this.getParams(q)};if(this.loadNext){B.add=true;B.params.start=this.page*this.pageSize;}this.store.load(B);}}else{this.selectedIndex=-1;this.onLoad();}}this.loadNext=false;},getParams:function(q){var p={};if(this.pageSize){p.start=0;p.limit=this.pageSize;
771 }return p;},collapse:function(){if(!this.isExpanded()){return;}this.list.hide();this.hasFocus=false;if(this.tickable){this.okBtn.hide();this.cancelBtn.hide();this.trigger.show();if(this.editable){this.tickableInputEl().dom.value='';this.tickableInputEl().blur();
772 }}Roo.get(document).un('mousedown',this.collapseIf,this);Roo.get(document).un('mousewheel',this.collapseIf,this);if(!this.editable){Roo.get(document).un('keydown',this.listKeyPress,this);}this.fireEvent('collapse',this);this.validate();},collapseIf:function(e){var A=e.within(this.el);
773 var B=e.within(this.list);var C=(Roo.get(e.getTarget()).id==this.list.id)?true:false;if(A||B||C){return;}if(this.tickable){this.onTickableFooterButtonClick(e,false,false);}this.collapse();},expand:function(){if(this.isExpanded()||!this.hasFocus){return;}var lw=this.listWidth||Math.max(this.inputEl().getWidth(),this.minListWidth);
774 this.list.setWidth(lw);Roo.log('expand');this.list.show();this.restrictHeight();if(this.tickable){this.tickItems=Roo.apply([],this.item);this.okBtn.show();this.cancelBtn.show();this.trigger.hide();if(this.editable){this.tickableInputEl().focus();}}Roo.get(document).on('mousedown',this.collapseIf,this);
775 Roo.get(document).on('mousewheel',this.collapseIf,this);if(!this.editable){Roo.get(document).on('keydown',this.listKeyPress,this);}this.fireEvent('expand',this);},onTriggerClick:function(e){Roo.log('trigger click');if(this.disabled||!this.triggerList){return;
776 }this.page=0;this.loadNext=false;if(this.isExpanded()){this.collapse();if(!this.blockFocus){this.inputEl().focus();}}else{this.hasFocus=true;if(this.triggerAction=='all'){this.doQuery(this.allQuery,true);}else{this.doQuery(this.getRawValue());}if(!this.blockFocus){this.inputEl().focus();
777 }}},onTickableTriggerClick:function(e){if(this.disabled){return;}this.page=0;this.loadNext=false;this.hasFocus=true;if(this.triggerAction=='all'){this.doQuery(this.allQuery,true);}else{this.doQuery(this.getRawValue());}},onSearchFieldClick:function(e){if(this.hasFocus&&!this.disabled&&e.getTarget().nodeName.toLowerCase()!='button'){this.onTickableFooterButtonClick(e,false,false);
778 return;}if(this.hasFocus||this.disabled||e.getTarget().nodeName.toLowerCase()=='button'){return;}this.page=0;this.loadNext=false;this.hasFocus=true;if(this.triggerAction=='all'){this.doQuery(this.allQuery,true);}else{this.doQuery(this.getRawValue());}},listKeyPress:function(e){if(e.isSpecialKey()){return false;
779 }var k=String.fromCharCode(e.getKey()).toUpperCase();var A=false;var B=this.view.getSelectedNodes();var C=false;if(B.length){var ix=this.view.indexOf(B[0]);C=this.store.getAt(ix);if(!C.get(this.displayField)||C.get(this.displayField).substring(0,1).toUpperCase()!=k){C=false;
780 }}this.store.each(function(v){if(C){if(C.id==v.id){C=false;}return true;}if(v.get(this.displayField)&&v.get(this.displayField).substring(0,1).toUpperCase()==k){A=this.store.indexOf(v);return false;}return true;},this);if(A===false){return true;}this.view.select(A);
781 var sn=Roo.get(this.view.getSelectedNodes()[0]);sn.scrollIntoView(sn.dom.parentNode,false);},onViewScroll:function(e,t){if(this.view.el.getScroll().top==0||this.view.el.getScroll().top<this.view.el.dom.scrollHeight-this.view.el.dom.clientHeight||!this.hasFocus||!this.append||this.hasQuery){return;
782 }this.hasQuery=true;this.loading=this.list.select('.loading',true).first();if(this.loading===null){this.list.createChild({tag:'div',cls:'loading roo-select2-more-results roo-select2-active',html:'Loading more results...'});this.loading=this.list.select('.loading',true).first();
783 this.loading.setVisibilityMode(Roo.Element.DISPLAY);this.loading.hide();}this.loading.show();var A=this;this.page++;this.loadNext=true;(function(){A.doQuery(A.allQuery,true);}).defer(500);return;},addItem:function(o){var dv='';if(this.displayField){dv=!o||typeof(o[this.displayField])=='undefined'?'':o[this.displayField];
784 }else{Roo.log('no  displayField value set for '+(this.name?this.name:this.id));}if(!dv.length){return;}var A=this.choices.createChild({tag:'li',cls:'roo-select2-search-choice',cn:[{tag:'div',html:dv},{tag:'a',href:'#',cls:'roo-select2-search-choice-close fa fa-times',tabindex:'-1'}
785 ]},this.searchField);var B=A.select('a.roo-select2-search-choice-close',true).first();B.on('click',this.onRemoveItem,this,{item:A,data:o});this.item.push(o);this.lastData=o;this.syncValue();this.inputEl().dom.value='';this.validate();},onRemoveItem:function(e,A,o){e.preventDefault();
786 this.lastItem=Roo.apply([],this.item);var B=this.item.indexOf(o.data)*1;if(B<0){Roo.log('not this item?!');return;}this.item.splice(B,1);o.item.remove();this.syncValue();this.fireEvent('remove',this,e);this.validate();},syncValue:function(){if(!this.item.length){this.clearValue();
787 return;}var A=[];var B=this;Roo.each(this.item,function(i){if(B.valueField){A.push(i[B.valueField]);return;}A.push(i);});this.value=A.join(',');if(this.hiddenField){this.hiddenField.dom.value=this.value;}this.store.fireEvent("datachanged",this.store);this.validate();
788 },clearItem:function(){if(!this.multiple){return;}this.item=[];Roo.each(this.choices.select('>li.roo-select2-search-choice',true).elements,function(c){c.remove();});this.syncValue();this.validate();if(this.tickable&&!Roo.isTouch){this.view.refresh();}},inputEl:function(){if(Roo.isIOS&&this.useNativeIOS){return this.el.select('select.roo-ios-select',true).first();
789 }if(Roo.isTouch&&this.mobileTouchView){return this.el.select('input.form-control',true).first();}if(this.tickable){return this.searchField;}return this.el.select('input.form-control',true).first();},onTickableFooterButtonClick:function(e,A,el){e.preventDefault();
790 this.lastItem=Roo.apply([],this.item);if(A&&A.name=='cancel'){this.tickItems=Roo.apply([],this.item);this.collapse();return;}this.clearItem();var B=this;Roo.each(this.tickItems,function(o){B.addItem(o);});this.collapse();},validate:function(){if(this.getVisibilityEl().hasClass('hidden')){return true;
791 }var v=this.getRawValue();if(this.multiple){v=this.getValue();}if(this.disabled||this.allowBlank||v.length){this.markValid();return true;}this.markInvalid();return false;},tickableInputEl:function(){if(!this.tickable||!this.editable){return this.inputEl();
792 }return this.inputEl().select('.roo-select2-search-field-input',true).first();},getAutoCreateTouchView:function(){var id=Roo.id();var A={cls:'form-group'};var B={tag:'input',id:id,type:this.inputType,cls:'form-control x-combo-noedit',autocomplete:'new-password',placeholder:this.placeholder||'',readonly:true}
793 ;if(this.name){B.name=this.name;}if(this.size){B.cls+=' input-'+this.size;}if(this.disabled){B.disabled=true;}var C={cls:'roo-combobox-wrap',cn:[B]};if(this.before){C.cls+=' input-group';C.cn.unshift({tag:'span',cls:'input-group-addon input-group-prepend input-group-text',html:this.before}
794 );}if(this.removable&&!this.multiple){C.cls+=' roo-removable';C.cn.push({tag:'button',html:'x',cls:'roo-combo-removable-btn close'});}if(this.hasFeedback&&!this.allowBlank){C.cls+=' has-feedback';C.cn.push({tag:'span',cls:'glyphicon form-control-feedback'}
795 );}if(this.after){C.cls+=(this.before)?'':' input-group';C.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text',html:this.after});}var D=C;if(this.multiple){D={tag:'ul',cls:'roo-select2-choices',cn:[{tag:'li',cls:'roo-select2-search-field',cn:[C]}
796 ]};}var E={cls:'roo-select2-container input-group roo-touchview-combobox ',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},D]};if(!this.multiple&&this.showToggleBtn){var F={cls:'caret'};if(this.caret!=false){F={tag:'i',cls:'fa fa-'+this.caret};}E.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text btn dropdown-toggle',cn:[Roo.bootstrap.version==3?F:'',{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'}
797 ]}]})}if(this.multiple){E.cls+=' roo-select2-container-multi';}var G=this.allowBlank?{tag:'i',style:'display: none'}:{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'};var H=this.labelAlign||this.parentLabelAlign();
798 if(H==='left'&&this.fieldLabel.length){A.cn=[G,{tag:'label',cls:'control-label col-form-label',html:this.fieldLabel},{cls:'roo-combobox-wrap ',cn:[E]}];var I=A.cn[1];var J=A.cn[2];if(this.indicatorpos=='right'){A.cn=[{tag:'label','for':id,cls:'control-label col-form-label',cn:[{tag:'span',html:this.fieldLabel}
799 ,G]},{cls:"roo-combobox-wrap ",cn:[E]}];I=A.cn[0];J=A.cn[1];}if(this.labelWidth>12){I.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){I.cls+=' col-lg-'+this.labellg;J.cls+=' col-lg-'+(12-this.labellg);
800 }if(this.labelmd>0){I.cls+=' col-md-'+this.labelmd;J.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){I.cls+=' col-sm-'+this.labelsm;J.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){I.cls+=' col-xs-'+this.labelxs;J.cls+=' col-xs-'+(12-this.labelxs);
801 }}else if(this.fieldLabel.length){A.cn=[G,{tag:'label',cls:'control-label',html:this.fieldLabel},{cls:'',cn:[E]}];if(this.indicatorpos=='right'){A.cn=[{tag:'label',cls:'control-label',html:this.fieldLabel,cn:[G]},{cls:'',cn:[E]}];}}else{A.cn=E;}var K=this;
802 ['xs','sm','md','lg'].map(function(L){if(K[L]){A.cls+=' col-'+L+'-'+K[L];}});return A;},initTouchView:function(){this.renderTouchView();this.touchViewEl.on('scroll',function(){this.el.dom.scrollTop=0;},this);this.originalValue=this.getValue();this.triggerEl=this.el.select('span.dropdown-toggle',true).first();
803 this.inputEl().on("click",this.showTouchView,this);if(this.triggerEl){this.triggerEl.on("click",this.showTouchView,this);}this.touchViewFooterEl.select('.roo-touch-view-cancel',true).first().on('click',this.hideTouchView,this);this.touchViewFooterEl.select('.roo-touch-view-ok',true).first().on('click',this.setTouchViewValue,this);
804 this.maskEl=new Roo.LoadMask(this.touchViewEl,{store:this.store,msgCls:'roo-el-mask-msg'});this.store.on('beforeload',this.onTouchViewBeforeLoad,this);this.store.on('load',this.onTouchViewLoad,this);this.store.on('loadexception',this.onTouchViewLoadException,this);
805 if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first();this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName);
806 }if(this.multiple){this.choices=this.el.select('ul.roo-select2-choices',true).first();this.searchField=this.el.select('ul li.roo-select2-search-field',true).first();}if(this.removable&&!this.multiple){var A=this.closeTriggerEl();if(A){A.setVisibilityMode(Roo.Element.DISPLAY).hide();
807 A.on('click',this.removeBtnClick,this,A);}}this.inputEl().on("focus",function(e){document.activeElement.blur();},this);this._touchViewMask=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);return;},renderTouchView:function(){this.touchViewEl=Roo.get(document.body).createChild(Roo.bootstrap.form.ComboBox.touchViewTemplate);
808 this.touchViewEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewHeaderEl=this.touchViewEl.select('.modal-header',true).first();this.touchViewHeaderEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl=this.touchViewEl.select('.modal-body',true).first();
809 this.touchViewBodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl.setStyle('overflow','auto');this.touchViewListGroup=this.touchViewBodyEl.select('.list-group',true).first();this.touchViewListGroup.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
810 this.touchViewFooterEl=this.touchViewEl.select('.modal-footer',true).first();this.touchViewFooterEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';},showTouchView:function(){if(this.disabled){return;}this.touchViewHeaderEl.hide();if(this.modalTitle.length){this.touchViewHeaderEl.dom.innerHTML=this.modalTitle;
811 this.touchViewHeaderEl.show();}this.touchViewEl.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);this.touchViewEl.show();this.touchViewEl.select('.modal-dialog',true).first().setStyle({margin:'0px',width:'100%'});var A=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb');
812 if(this.modalTitle.length){A=A-this.touchViewHeaderEl.getHeight();}this.touchViewBodyEl.setHeight(A);if(this.animate){var B=this;(function(){B.touchViewEl.addClass(['in','show']);}).defer(50);}else{this.touchViewEl.addClass(['in','show']);}if(this._touchViewMask){Roo.get(document.body).addClass("x-body-masked");
813 this._touchViewMask.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this._touchViewMask.setStyle('z-index',10000);this._touchViewMask.addClass('show');}this.doTouchViewQuery();},hideTouchView:function(){this.touchViewEl.removeClass(['in','show']);
814 if(this.animate){var A=this;(function(){A.touchViewEl.setStyle('display','none');}).defer(150);}else{this.touchViewEl.setStyle('display','none');}if(this._touchViewMask){this._touchViewMask.removeClass('show');Roo.get(document.body).removeClass("x-body-masked");
815 }},setTouchViewValue:function(){if(this.multiple){this.clearItem();var A=this;Roo.each(this.tickItems,function(o){this.addItem(o);},this);}this.hideTouchView();},doTouchViewQuery:function(){var qe={query:'',forceAll:true,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;
816 }if(!this.alwaysQuery||this.mode=='local'){this.onTouchViewLoad();return;}this.store.load();},onTouchViewBeforeLoad:function(A,B){return;},onTouchViewLoad:function(){if(this.store.getCount()<1){this.onTouchViewEmptyResults();return;}this.clearTouchView();
817 var A=this.getRawValue();var B=(this.multiple)?Roo.bootstrap.form.ComboBox.listItemCheckbox:Roo.bootstrap.form.ComboBox.listItemRadio;this.tickItems=[];this.store.data.each(function(d,G){var H=this.touchViewListGroup.createChild(B);if(typeof(d.data.cls)!='undefined'&&d.data.cls.length){H.addClass(d.data.cls);
818 }if(this.displayField&&typeof(d.data[this.displayField])!='undefined'){var I={data:d.data,html:d.data[this.displayField]};if(this.fireEvent('touchviewdisplay',this,I)!==false){H.select('.roo-combobox-list-group-item-value',true).first().dom.innerHTML=I.html;
819 }}H.removeClass('selected');if(!this.multiple&&this.valueField&&typeof(d.data[this.valueField])!='undefined'&&d.data[this.valueField]==this.getValue()){H.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);H.addClass('selected');
820 }if(this.multiple&&this.valueField&&typeof(d.data[this.valueField])!='undefined'&&this.getValue().indexOf(d.data[this.valueField])!=-1){H.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.tickItems.push(d.data);}H.on('click',this.onTouchViewClick,this,{row:H,rowIndex:G}
821 );},this);var C=this.touchViewListGroup.select('.list-group-item > .roo-combobox-list-group-item-box > input:checked',true).first();var D=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb');if(this.modalTitle.length){D=D-this.touchViewHeaderEl.getHeight();
822 }var E=this.touchViewListGroup.getHeight()+this.touchViewBodyEl.getPadding('tb')*2;if(this.mobile_restrict_height&&E<D){this.touchViewBodyEl.setHeight(E);}var F=this;if(C&&E>D){(function(){C.findParent('li').scrollIntoView(F.touchViewListGroup.dom);}).defer(500);
823 }},onTouchViewLoadException:function(){this.hideTouchView();},onTouchViewEmptyResults:function(){this.clearTouchView();this.touchViewListGroup.createChild(Roo.bootstrap.form.ComboBox.emptyResult);this.touchViewListGroup.select('.roo-combobox-touch-view-empty-result',true).first().dom.innerHTML=this.emptyResultText;
824 },clearTouchView:function(){this.touchViewListGroup.dom.innerHTML='';},onTouchViewClick:function(e,el,o){e.preventDefault();var A=o.row;var B=o.rowIndex;var r=this.store.getAt(B);if(this.fireEvent('beforeselect',this,r,B)!==false){if(!this.multiple){Roo.each(this.touchViewListGroup.select('.list-group-item > .roo-combobox-list-group-item-box > input:checked',true).elements,function(c){c.dom.removeAttribute('checked');
825 },this);A.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.setFromData(r.data);var C=this.closeTriggerEl();if(C){C.show();}this.hideTouchView();this.fireEvent('select',this,r,B);return;}if(this.valueField&&typeof(r.data[this.valueField])!='undefined'&&this.getValue().indexOf(r.data[this.valueField])!=-1){A.select('.roo-combobox-list-group-item-box > input',true).first().dom.removeAttribute('checked');
826 this.tickItems.splice(this.tickItems.indexOf(r.data),1);return;}A.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.addItem(r.data);this.tickItems.push(r.data);}},getAutoCreateNativeIOS:function(){var A={cls:'form-group'}
827 ;var B={tag:'select',cls:'roo-ios-select'};if(this.name){B.name=this.name;}if(this.disabled){B.disabled=true;}var C=this;['xs','sm','md','lg'].map(function(D){if(C[D]){A.cls+=' col-'+D+'-'+C[D];}});A.cn=B;return A;},initIOSView:function(){this.store.on('load',this.onIOSViewLoad,this);
828 return;},onIOSViewLoad:function(){if(this.store.getCount()<1){return;}this.clearIOSView();if(this.allowBlank){var A='-- SELECT --';if(this.placeholder.length){A=this.placeholder;}if(this.emptyTitle.length){A+=' - '+this.emptyTitle+' -';}var B=this.inputEl().createChild({tag:'option',value:0,html:A}
829 );var o={};o[this.valueField]=0;o[this.displayField]=A;this.ios_options.push({data:o,el:B});}this.store.data.each(function(d,C){var D='';if(this.displayField&&typeof(d.data[this.displayField])!='undefined'){D=d.data[this.displayField];}var E='';if(this.valueField&&typeof(d.data[this.valueField])!='undefined'){E=d.data[this.valueField];
830 }var F={tag:'option',value:E,html:D};if(this.value==d.data[this.valueField]){F['selected']=true;}var G=this.inputEl().createChild(F);this.ios_options.push({data:d.data,el:G});},this);this.inputEl().on('change',function(){this.fireEvent('select',this);},this);
831 },clearIOSView:function(){this.inputEl().dom.innerHTML='';this.ios_options=[];},setIOSValue:function(v){this.value=v;if(!this.ios_options){return;}Roo.each(this.ios_options,function(A){A.el.dom.removeAttribute('selected');if(A.data[this.valueField]!=v){return;
832 }A.el.dom.setAttribute('selected',true);},this);}});Roo.apply(Roo.bootstrap.form.ComboBox,{header:{tag:'div',cls:'modal-header',cn:[{tag:'h4',cls:'modal-title'}]},body:{tag:'div',cls:'modal-body',cn:[{tag:'ul',cls:'list-group'}]},listItemRadio:{tag:'li',cls:'list-group-item',cn:[{tag:'span',cls:'roo-combobox-list-group-item-value'}
833 ,{tag:'div',cls:'roo-combobox-list-group-item-box pull-xs-right radio-inline radio radio-info',cn:[{tag:'input',type:'radio'},{tag:'label'}]}]},listItemCheckbox:{tag:'li',cls:'list-group-item',cn:[{tag:'span',cls:'roo-combobox-list-group-item-value'},{tag:'div',cls:'roo-combobox-list-group-item-box pull-xs-right checkbox-inline checkbox checkbox-info',cn:[{tag:'input',type:'checkbox'}
834 ,{tag:'label'}]}]},emptyResult:{tag:'div',cls:'alert alert-danger roo-combobox-touch-view-empty-result'},footer:{tag:'div',cls:'modal-footer',cn:[{tag:'div',cls:'row',cn:[{tag:'div',cls:'col-xs-6 text-left',cn:{tag:'button',cls:'btn btn-danger roo-touch-view-cancel',html:'Cancel'}
835 },{tag:'div',cls:'col-xs-6 text-right',cn:{tag:'button',cls:'btn btn-success roo-touch-view-ok',html:'OK'}}]}]}});Roo.apply(Roo.bootstrap.form.ComboBox,{touchViewTemplate:{tag:'div',cls:'modal fade roo-combobox-touch-view',cn:[{tag:'div',cls:'modal-dialog',style:'position:fixed',cn:[{tag:'div',cls:'modal-content',cn:[Roo.bootstrap.form.ComboBox.header,Roo.bootstrap.form.ComboBox.body,Roo.bootstrap.form.ComboBox.footer]}
836 ]}]}});
837 // Roo/View.js
838 Roo.View=function(A,B,C){this.parent=false;if(typeof(B)=='undefined'){Roo.apply(this,A);this.el=Roo.get(this.el);}else{this.el=Roo.get(A);this.tpl=B;Roo.apply(this,C);}this.wrapEl=this.el.wrap().wrap();if(typeof(this.tpl)=="string"){this.tpl=new Roo.Template(this.tpl);
839 }else{this.tpl=new Roo.factory(this.tpl,Roo);}this.tpl.compile();this.addEvents({"beforeclick":true,"click":true,"dblclick":true,"contextmenu":true,"selectionchange":true,"beforeselect":true,"preparedata":true});this.el.on({"click":this.onClick,"dblclick":this.onDblClick,"contextmenu":this.onContextMenu,scope:this}
840 );this.selections=[];this.nodes=[];this.cmp=new Roo.CompositeElementLite([]);if(this.store){this.store=Roo.factory(this.store,Roo.data);this.setStore(this.store,true);}if(this.footer&&this.footer.xtype){var D=this.wrapEl.appendChild(document.createElement("div"));
841 this.footer.dataSource=this.store;this.footer.container=D;this.footer=Roo.factory(this.footer,Roo);D.insertFirst(this.el);}Roo.View.superclass.constructor.call(this);};Roo.extend(Roo.View,Roo.util.Observable,{store:false,el:'',tpl:false,dataName:false,selectedClass:"x-view-selected",emptyText:"",mask:false,multiSelect:false,singleSelect:false,toggleSelect:false,tickable:false,getEl:function(){return this.wrapEl;
842 },refresh:function(){var t=this.tpl;this.clearSelections();this.el.update("");var A=[];var B=this.store.getRange();if(B.length<1){this.el.update(this.emptyText);return;}var el=this.el;if(this.dataName){this.el.update(t.apply(this.store.meta));el=this.el.child('.roo-tpl-'+this.dataName);
843 }for(var i=0,C=B.length;i<C;i++){var D=this.prepareData(B[i].data,i,B[i]);this.fireEvent("preparedata",this,D,i,B[i]);var d=Roo.apply({},D);if(this.tickable){Roo.apply(d,{'roo-id':Roo.id()});var E=this;Roo.each(this.parent.item,function(F){if(F[E.parent.valueField]!=D[E.parent.valueField]){return;
844 }Roo.apply(d,{'roo-data-checked':'checked'});});}A[A.length]=Roo.util.Format.trim(this.dataName?t.applySubtemplate(this.dataName,d,this.store.meta):t.apply(d));}el.update(A.join(""));this.nodes=el.dom.childNodes;this.updateIndexes(0);},prepareData:function(A,B,C){this.fireEvent("preparedata",this,A,B,C);
845 return A;},onUpdate:function(ds,A){this.clearSelections();var B=this.store.indexOf(A);var n=this.nodes[B];this.tpl.insertBefore(n,this.prepareData(A.data,B,A));n.parentNode.removeChild(n);this.updateIndexes(B,B);},onAdd:function(ds,A,B){this.clearSelections();
846 if(this.nodes.length==0){this.refresh();return;}var n=this.nodes[B];for(var i=0,C=A.length;i<C;i++){var d=this.prepareData(A[i].data,i,A[i]);if(n){this.tpl.insertBefore(n,d);}else{this.tpl.append(this.el,d);}}this.updateIndexes(B);},onRemove:function(ds,A,B){this.clearSelections();
847 var el=this.dataName?this.el.child('.roo-tpl-'+this.dataName):this.el;el.dom.removeChild(this.nodes[B]);this.updateIndexes(B);},refreshNode:function(A){this.onUpdate(this.store,this.store.getAt(A));},updateIndexes:function(A,B){var ns=this.nodes;A=A||0;B=B||ns.length-1;
848 for(var i=A;i<=B;i++){ns[i].nodeIndex=i;}},setStore:function(A,B){if(!B&&this.store){this.store.un("datachanged",this.refresh);this.store.un("add",this.onAdd);this.store.un("remove",this.onRemove);this.store.un("update",this.onUpdate);this.store.un("clear",this.refresh);
849 this.store.un("beforeload",this.onBeforeLoad);this.store.un("load",this.onLoad);this.store.un("loadexception",this.onLoad);}if(A){A.on("datachanged",this.refresh,this);A.on("add",this.onAdd,this);A.on("remove",this.onRemove,this);A.on("update",this.onUpdate,this);
850 A.on("clear",this.refresh,this);A.on("beforeload",this.onBeforeLoad,this);A.on("load",this.onLoad,this);A.on("loadexception",this.onLoad,this);}if(A){this.refresh();}},onBeforeLoad:function(A,B){if(!B.add){this.el.update("");}this.el.mask(this.mask?this.mask:"Loading");
851 },onLoad:function(){this.el.unmask();},findItemFromChild:function(A){var el=this.dataName?this.el.child('.roo-tpl-'+this.dataName,true):this.el.dom;if(!A||A.parentNode==el){return A;}var p=A.parentNode;while(p&&p!=el){if(p.parentNode==el){return p;}p=p.parentNode;
852 }return null;},onClick:function(e){var A=this.findItemFromChild(e.getTarget());if(A){var B=this.indexOf(A);if(this.onItemClick(A,B,e)!==false){this.fireEvent("click",this,B,A,e);}}else{this.clearSelections();}},onContextMenu:function(e){var A=this.findItemFromChild(e.getTarget());
853 if(A){this.fireEvent("contextmenu",this,this.indexOf(A),A,e);}},onDblClick:function(e){var A=this.findItemFromChild(e.getTarget());if(A){this.fireEvent("dblclick",this,this.indexOf(A),A,e);}},onItemClick:function(A,B,e){if(this.fireEvent("beforeclick",this,B,A,e)===false){return false;
854 }if(this.toggleSelect){var m=this.isSelected(A)?'unselect':'select';var _t=this;_t[m](A,true,false);return true;}if(this.multiSelect||this.singleSelect){if(this.multiSelect&&e.shiftKey&&this.lastSelection){this.select(this.getNodes(this.indexOf(this.lastSelection),B),false);
855 }else{this.select(A,this.multiSelect&&e.ctrlKey);this.lastSelection=A;}if(!this.tickable){e.preventDefault();}}return true;},getSelectionCount:function(){return this.selections.length;},getSelectedNodes:function(){return this.selections;},getSelectedIndexes:function(){var A=[],s=this.selections;
856 for(var i=0,B=s.length;i<B;i++){A.push(s[i].nodeIndex);}return A;},clearSelections:function(A){if(this.nodes&&(this.multiSelect||this.singleSelect)&&this.selections.length>0){this.cmp.elements=this.selections;this.cmp.removeClass(this.selectedClass);this.selections=[];
857 if(!A){this.fireEvent("selectionchange",this,this.selections);}}},isSelected:function(A){var s=this.selections;if(s.length<1){return false;}A=this.getNode(A);return s.indexOf(A)!==-1;},select:function(A,B,C){if(A instanceof Array){if(!B){this.clearSelections(true);
858 }for(var i=0,D=A.length;i<D;i++){this.select(A[i],true,true);}return;}var E=this.getNode(A);if(!E||this.isSelected(E)){return;}if(!B){this.clearSelections(true);}if(this.fireEvent("beforeselect",this,E,this.selections)!==false){Roo.fly(E).addClass(this.selectedClass);
859 this.selections.push(E);if(!C){this.fireEvent("selectionchange",this,this.selections);}}},unselect:function(A,B,C){if(A instanceof Array){Roo.each(this.selections,function(s){this.unselect(s,A);},this);return;}var D=this.getNode(A);if(!D||!this.isSelected(D)){return;
860 }var ns=[];Roo.each(this.selections,function(s){if(s==D){Roo.fly(D).removeClass(this.selectedClass);return;}ns.push(s);},this);this.selections=ns;this.fireEvent("selectionchange",this,this.selections);},getNode:function(A){if(typeof A=="string"){return document.getElementById(A);
861 }else if(typeof A=="number"){return this.nodes[A];}return A;},getNodes:function(A,B){var ns=this.nodes;A=A||0;B=typeof B=="undefined"?ns.length-1:B;var C=[];if(A<=B){for(var i=A;i<=B;i++){C.push(ns[i]);}}else{for(var i=A;i>=B;i--){C.push(ns[i]);}}return C;
862 },indexOf:function(A){A=this.getNode(A);if(typeof A.nodeIndex=="number"){return A.nodeIndex;}var ns=this.nodes;for(var i=0,B=ns.length;i<B;i++){if(ns[i]==A){return i;}}return -1;}});
863 // Roo/bootstrap/Calendar.js
864 Roo.bootstrap=Roo.bootstrap||{};Roo.bootstrap.Calendar=function(A){Roo.bootstrap.Calendar.superclass.constructor.call(this,A);this.addEvents({'select':true,'monthchange':true,'evententer':true,'eventleave':true,'eventclick':true});};Roo.extend(Roo.bootstrap.Calendar,Roo.bootstrap.Component,{store:false,startDay:0,loadMask:false,header:false,getAutoCreate:function(){var A=function(H,I,J,K){return Roo.apply({}
865 ,{tag:'span',cls:'fc-button fc-button-'+H+' fc-state-default '+(I.length?'fc-corner-'+I.split(' ').join(' fc-corner-'):''),html:'<SPAN class="fc-text-'+J+'">'+K+'</SPAN>',unselectable:'on'});};var B={};if(!this.header){B={tag:'table',cls:'fc-header',style:'width:100%',cn:[{tag:'tr',cn:[{tag:'td',cls:'fc-header-left',cn:[A('prev','left','arrow','&#8249;'),A('next','right','arrow','&#8250;'),{tag:'span',cls:'fc-header-space'}
866 ,A('today','left right','','today')]},{tag:'td',cls:'fc-header-center',cn:[{tag:'span',cls:'fc-header-title',cn:{tag:'H2',html:'month / year'}}]},{tag:'td',cls:'fc-header-right',cn:[]}]}]};}B=this.header;var C=function(){var H=[];for(var i=0;i<Date.dayNames.length;
867 i++){var d=Date.dayNames[i];H.push({tag:'th',cls:'fc-day-header fc-'+d.substring(0,3).toLowerCase()+' fc-widget-header',html:d.substring(0,3)});}H[0].cls+=' fc-first';H[6].cls+=' fc-last';return H;};var D=function(n){return {tag:'td',cls:'fc-day fc-'+n+' fc-widget-content',cn:[{cn:[{cls:'fc-day-number',html:'D'}
868 ,{cls:'fc-day-content',cn:[{style:'position: relative;'}]}]}]}};var E=function(){var H=[];for(var r=0;r<6;r++){var I={tag:'tr',cls:'fc-week',cn:[]};for(var i=0;i<Date.dayNames.length;i++){var d=Date.dayNames[i];I.cn.push(D(d.substring(0,3).toLowerCase()));
869 }I.cn[0].cls+=' fc-first';I.cn[0].cn[0].style='min-height:90px';I.cn[6].cls+=' fc-last';H.push(I);}H[0].cls+=' fc-first';H[4].cls+=' fc-prev-last';H[5].cls+=' fc-last';return H;};var F={tag:'table',cls:'fc-border-separate',style:'width:100%',cellspacing:0,cn:[{tag:'thead',cn:[{tag:'tr',cls:'fc-first fc-last',cn:C()}
870 ]},{tag:'tbody',cn:E()}]};var G={cls:'fc fc-ltr',cn:[B,{cls:'fc-content',style:"position: relative;",cn:[{cls:'fc-view fc-view-month fc-grid',style:'position: relative',unselectable:'on',cn:[{cls:'fc-event-container',style:'position:absolute;z-index:8;top:0;left:0;'}
871 ,F]}]}]};return G;},initEvents:function(){if(!this.store){throw "can not find store for calendar";}var A={tag:"div",cls:"x-dlg-mask",style:"text-align:center",cn:[{tag:"div",style:"background-color:white;width:50%;margin:250 auto",cn:[{tag:"img",src:Roo.rootURL+'/images/ux/lightbox/loading.gif'}
872 ,{tag:"span",html:"Loading"}]}]};this.maskEl=Roo.DomHelper.append(this.el.select('.fc-content',true).first(),A,true);var B=this.el.select('.fc-content',true).first().getSize();this.maskEl.setSize(B.width,B.height);this.maskEl.enableDisplayMode("block");if(!this.loadMask){this.maskEl.hide();
873 }this.store=Roo.factory(this.store,Roo.data);this.store.on('load',this.onLoad,this);this.store.on('beforeload',this.onBeforeLoad,this);this.resize();this.cells=this.el.select('.fc-day',true);this.textNodes=this.el.query('.fc-day-number');this.cells.addClassOnOver('fc-state-hover');
874 this.el.select('.fc-button-prev',true).on('click',this.showPrevMonth,this);this.el.select('.fc-button-next',true).on('click',this.showNextMonth,this);this.el.select('.fc-button-today',true).on('click',this.showToday,this);this.el.select('.fc-button',true).addClassOnOver('fc-state-hover');
875 this.on('monthchange',this.onMonthChange,this);this.update(new Date().clearTime());},resize:function(){var sz=this.el.getSize();this.el.select('.fc-day-header',true).setWidth(sz.width/7);this.el.select('.fc-day-content div',true).setHeight(34);},showPrevMonth:function(e){this.update(this.activeDate.add("mo",-1));
876 },showToday:function(e){this.update(new Date().clearTime());},showNextMonth:function(e){this.update(this.activeDate.add("mo",1));},showPrevYear:function(){this.update(this.activeDate.add("y",-1));},showNextYear:function(){this.update(this.activeDate.add("y",1));
877 },update:function(A){var vd=this.activeDate;this.activeDate=A;var B=A.getDaysInMonth();var C=A.getFirstDateOfMonth();var D=C.getDay()-this.startDay;if(D<this.startDay){D+=7;}var pm=A.add(Date.MONTH,-1);var E=pm.getDaysInMonth()-D;this.cells=this.el.select('.fc-day',true);
878 this.textNodes=this.el.query('.fc-day-number');this.cells.addClassOnOver('fc-state-hover');var F=this.cells.elements;var G=this.textNodes;Roo.each(F,function(V){V.removeClass(['fc-past','fc-other-month','fc-future','fc-state-highlight','fc-state-disabled']);
879 });B+=D;var H=86400000;var d=(new Date(pm.getFullYear(),pm.getMonth(),E)).clearTime();var I=new Date().clearTime().getTime();var J=A.clearTime().getTime();var K=this.minDate?this.minDate.clearTime():Number.NEGATIVE_INFINITY;var L=this.maxDate?this.maxDate.clearTime():Number.POSITIVE_INFINITY;
880 var M=this.disabledDatesRE;var N=this.disabledDatesText;var O=this.disabledDays?this.disabledDays.join(""):false;var P=this.disabledDaysText;var Q=this.format;var R=function(V,W){W.row=0;W.events=[];W.more=[];W.title="";var t=d.getTime();W.dateValue=t;if(t==I){W.className+=" fc-today";
881 W.className+=" fc-state-highlight";W.title=V.todayText;}if(t==J){}if(t<K){W.className=" fc-state-disabled";W.title=V.minText;return;}if(t>L){W.className=" fc-state-disabled";W.title=V.maxText;return;}if(O){if(O.indexOf(d.getDay())!=-1){W.title=P;W.className=" fc-state-disabled";
882 }}if(M&&Q){var X=d.dateFormat(Q);if(M.test(X)){W.title=N.replace("%0",X);W.className=" fc-state-disabled";}}if(!W.initialClassName){W.initialClassName=W.dom.className;}W.dom.className=W.initialClassName+' '+W.className;};var i=0;for(;i<D;i++){G[i].innerHTML=(++E);
883 d.setDate(d.getDate()+1);F[i].className="fc-past fc-other-month";R(this,F[i]);}var S=0;for(;i<B;i++){S=i-D+1;G[i].innerHTML=(S);d.setDate(d.getDate()+1);F[i].className='';R(this,F[i]);}var T=0;for(;i<42;i++){G[i].innerHTML=(++T);d.setDate(d.getDate()+1);F[i].className="fc-future fc-other-month";
884 R(this,F[i]);}this.el.select('.fc-header-title h2',true).update(Date.monthNames[A.getMonth()]+" "+A.getFullYear());var U=Math.ceil((A.getDaysInMonth()+A.getFirstDateOfMonth().getDay())/7);this.el.select('tr.fc-week.fc-prev-last',true).removeClass('fc-last');
885 this.el.select('tr.fc-week.fc-next-last',true).addClass('fc-last').show();if(U!=6){this.el.select('tr.fc-week.fc-last',true).removeClass('fc-last').addClass('fc-next-last').hide();this.el.select('tr.fc-week.fc-prev-last',true).addClass('fc-last');}this.fireEvent('monthchange',this,A);
886 },findCell:function(dt){dt=dt.clearTime().getTime();var A=false;this.cells.each(function(c){if(c.dateValue==dt){A=c;return false;}return true;});return A;},findCells:function(ev){var s=ev.start.clone().clearTime().getTime();var e=ev.end.clone().clearTime().getTime();
887 var A=[];this.cells.each(function(c){if(c.dateValue>e){return;}if(c.dateValue<s){return;}A.push(c);});return A;},addItem:function(ev){var A=this.findCells(ev);var B=false;var C=[];for(var i=0;i<A.length;i++){A[i].row=A[0].row;if(i==0){A[i].row=A[i].row+1;
888 }if(!B){B={start:A[i],end:A[i]};continue;}if(B.start.getY()==A[i].getY()){B.end=A[i];continue;}C.push(B);B={start:A[i],end:A[i]};}C.push(B);ev.els=[];ev.rows=C;ev.cells=A;A[0].events.push(ev);this.calevents.push(ev);},clearEvents:function(){if(!this.calevents){return;
889 }Roo.each(this.cells.elements,function(c){c.row=0;c.events=[];c.more=[];});Roo.each(this.calevents,function(e){Roo.each(e.els,function(el){el.un('mouseenter',this.onEventEnter,this);el.un('mouseleave',this.onEventLeave,this);el.remove();},this);},this);Roo.each(Roo.select('.fc-more-event',true).elements,function(e){e.remove();
890 });},renderEvents:function(){var A=this;this.cells.each(function(c){if(c.row<5){return;}var ev=c.events;var r=4;if(c.row!=c.events.length){r=4-(4-(c.row-c.events.length));}c.events=ev.slice(0,r);c.more=ev.slice(r);if(c.more.length&&c.more.length==1){c.events.push(c.more.pop());
891 }c.row=(c.row-ev.length)+c.events.length+((c.more.length)?1:0);});this.cells.each(function(c){c.select('.fc-day-content div',true).first().setHeight(Math.max(34,c.row*20));for(var e=0;e<c.events.length;e++){var ev=c.events[e];var B=ev.rows;for(var i=0;i<B.length;
892 i++){var C={cls:'roo-dynamic fc-event fc-event-hori fc-event-draggable ui-draggable',style:'position: absolute',unselectable:"on",cn:[{cls:'fc-event-inner',cn:[{tag:'span',cls:'fc-event-title',html:String.format('{0}',ev.title)}]},{cls:'ui-resizable-handle ui-resizable-e',html:'&nbsp;&nbsp;&nbsp'}
893 ]};if(i==0){C.cls+=' fc-event-start';}if((i+1)==B.length){C.cls+=' fc-event-end';}var D=A.el.select('.fc-event-container',true).first();var cg=D.createChild(C);var E=B[i].start.select('.fc-day-content',true).first().getBox();var F=B[i].end.select('.fc-day-content',true).first().getBox();
894 var r=(c.more.length)?1:0;cg.setXY([E.x+2,E.y+((c.row-c.events.length-r+e)*20)]);cg.setWidth(F.right-E.x-2);cg.on('mouseenter',A.onEventEnter,A,ev);cg.on('mouseleave',A.onEventLeave,A,ev);cg.on('click',A.onEventClick,A,ev);ev.els.push(cg);}}if(c.more.length){var C={cls:'fc-more-event roo-dynamic fc-event fc-event-hori fc-event-draggable ui-draggable fc-event-start fc-event-end',style:'position: absolute',unselectable:"on",cn:[{cls:'fc-event-inner',cn:[{tag:'span',cls:'fc-event-title',html:'More'}
895 ]},{cls:'ui-resizable-handle ui-resizable-e',html:'&nbsp;&nbsp;&nbsp'}]};var D=A.el.select('.fc-event-container',true).first();var cg=D.createChild(C);var E=c.select('.fc-day-content',true).first().getBox();var F=c.select('.fc-day-content',true).first().getBox();
896 cg.setXY([E.x+2,E.y+((c.row-1)*20)]);cg.setWidth(F.right-E.x-2);cg.on('click',A.onMoreEventClick,A,c.more);}});},onEventEnter:function(e,el,A,d){this.fireEvent('evententer',this,el,A);},onEventLeave:function(e,el,A,d){this.fireEvent('eventleave',this,el,A);
897 },onEventClick:function(e,el,A,d){this.fireEvent('eventclick',this,el,A);},onMonthChange:function(){this.store.load();},onMoreEventClick:function(e,el,A){var B=this;this.calpopover.placement='right';this.calpopover.setTitle('More');this.calpopover.setContent('');
898 var C=this.calpopover.el.select('.popover-content',true).first();Roo.each(A,function(m){var D={cls:'fc-event-hori fc-event-draggable',html:m.title};var cg=C.createChild(D);cg.on('click',B.onEventClick,B,m);});this.calpopover.show(el);},onLoad:function(){this.calevents=[];
899 var A=this;if(this.store.getCount()>0){this.store.data.each(function(d){A.addItem({id:d.data.id,start:(typeof(d.data.start_dt)==='string')?new Date.parseDate(d.data.start_dt,'Y-m-d H:i:s'):d.data.start_dt,end:(typeof(d.data.end_dt)==='string')?new Date.parseDate(d.data.end_dt,'Y-m-d H:i:s'):d.data.end_dt,time:d.data.start_time,title:d.data.title,description:d.data.description,venue:d.data.venue}
900 );});}this.renderEvents();if(this.calevents.length&&this.loadMask){this.maskEl.hide();}},onBeforeLoad:function(){this.clearEvents();if(this.loadMask){this.maskEl.show();}}});
901 // Roo/bootstrap/Popover.js
902 Roo.bootstrap.Popover=function(A){Roo.bootstrap.Popover.superclass.constructor.call(this,A);this.addEvents({"show":true,"hide":true});};Roo.extend(Roo.bootstrap.Popover,Roo.bootstrap.Component,{title:false,html:false,placement:'right',trigger:'hover',modal:false,delay:0,over:false,can_build_overlaid:false,maskEl:false,headerEl:false,contentEl:false,alignEl:false,getChildContainer:function(){return this.contentEl;
903 },getPopoverHeader:function(){this.title=true;this.headerEl.addClass('p-0');return this.headerEl},getAutoCreate:function(){var A={cls:'popover roo-dynamic shadow roo-popover'+(this.modal?'-modal':''),style:'display:block',cn:[{cls:'arrow'},{cls:'popover-inner ',cn:[{tag:'h3',cls:'popover-title popover-header',html:this.title===false?'':this.title}
904 ,{cls:'popover-content popover-body '+(this.cls||''),html:this.html||''}]}]};return A;},setTitle:function(A){this.title=A;if(this.el){this.headerEl.dom.innerHTML=A;}},setContent:function(A){this.html=A;if(this.contentEl){this.contentEl.dom.innerHTML=A;}},onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A);
905 if(!this.el){var B=Roo.apply({},this.getAutoCreate());B.id=Roo.id();if(this.cls){B.cls+=' '+this.cls;}if(this.style){B.style=this.style;}this.el=Roo.get(document.body).createChild(B,A);}this.contentEl=this.el.select('.popover-content',true).first();this.headerEl=this.el.select('.popover-title',true).first();
906 var C=[];if(typeof(this.items)!='undefined'){var D=this.items;delete this.items;for(var i=0;i<D.length;i++){C.push(this.addxtype(Roo.apply({},D[i])));}}this.items=C;this.maskEl=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);Roo.EventManager.onWindowResize(this.resizeMask,this,true);
907 this.initEvents();},resizeMask:function(){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));},initEvents:function(){if(!this.modal){Roo.bootstrap.Popover.register(this);}this.arrowEl=this.el.select('.arrow',true).first();
908 this.headerEl.setVisibilityMode(Roo.Element.DISPLAY);this.el.enableDisplayMode('block');this.el.hide();if(this.over===false&&!this.parent()){return;}if(this.triggers===false){return;}var A=(this.over=='parent'||this.over===false)?this.parent().el:Roo.get(this.over);
909 var B=this.trigger?this.trigger.split(' '):[];Roo.each(B,function(C){if(C=='click'){A.on('click',this.toggle,this);}else if(C!='manual'){var D=C=='hover'?'mouseenter':'focusin';var E=C=='hover'?'mouseleave':'focusout';A.on(D,this.enter,this);A.on(E,this.leave,this);
910 }},this);},timeout:null,hoverState:null,toggle:function(){this.hoverState=='in'?this.leave():this.enter();},enter:function(){clearTimeout(this.timeout);this.hoverState='in';if(!this.delay||!this.delay.show){this.show();return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='in'){_t.show();
911 }},this.delay.show)},leave:function(){clearTimeout(this.timeout);this.hoverState='out';if(!this.delay||!this.delay.hide){this.hide();return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='out'){_t.hide();}},this.delay.hide)},doAlign:function(){if(this.alignEl){this.updatePosition(this.placement,true);
912 }else{var es=this.el.getSize();var x=Roo.lib.Dom.getViewWidth()/2;var y=Roo.lib.Dom.getViewHeight()/2;this.el.setXY([x-(es.width/2),y-(es.height/2)]);}},show:function(A,B){this.placement=typeof(B)=='undefined'?this.placement:B;A=A||false;if(!A){if(this.parent()&&(this.over=='parent'||(this.over===false))){A=this.parent().el;
913 }else if(this.over){A=Roo.get(this.over);}}this.alignEl=Roo.get(A);if(!this.el){this.render(document.body);}if(this.title===false){this.headerEl.hide();}this.el.show();this.el.dom.style.display='block';this.doAlign();this.el.addClass('in');this.hoverState='in';
914 if(this.modal){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.maskEl.setStyle('z-index',Roo.bootstrap.Popover.zIndex++);this.maskEl.dom.style.display='block';this.maskEl.addClass('show');}this.el.setStyle('z-index',Roo.bootstrap.Popover.zIndex++);
915 this.fireEvent('show',this);},updatePosition:function(A,B){A=A?A:this.placement;B=typeof(B)=='undefined'?true:B;this.el.removeClass(['fade','top','bottom','left','right','in','bs-popover-top','bs-popover-bottom','bs-popover-left','bs-popover-right']);this.el.addClass(A+' bs-popover-'+A);
916 if(!this.alignEl){return false;}switch(A){case 'right':var C=this.el.getAlignToXY(this.alignEl,'tl-tr',[10,0]);var D=this.el.getAlignToXY(this.alignEl,'tl-tr?',[10,0]);if(!B||C.equals(D)||C[0]==D[0]){this.el.setXY(D);var xy=this.alignEl.getAnchorXY('tr',false);
917 xy[0]+=2;xy[1]+=5;this.arrowEl.setXY(xy);return true;}return this.updatePosition('left',false);case 'left':var C=this.el.getAlignToXY(this.alignEl,'tr-tl',[-10,0]);var D=this.el.getAlignToXY(this.alignEl,'tr-tl?',[-10,0]);if(!B||C.equals(D)||C[0]==D[0]){this.el.setXY(D);
918 var xy=this.alignEl.getAnchorXY('tl',false);xy[0]-=10;xy[1]+=5;this.arrowEl.setXY(xy);return true;}return this.updatePosition('right',false);case 'top':var C=this.el.getAlignToXY(this.alignEl,'b-t',[0,-10]);var D=this.el.getAlignToXY(this.alignEl,'b-t?',[0,-10]);
919 if(!B||C.equals(D)||C[1]==D[1]){this.el.setXY(D);var xy=this.alignEl.getAnchorXY('t',false);xy[1]-=10;this.arrowEl.setXY(xy);return true;}return this.updatePosition('bottom',false);case 'bottom':var C=this.el.getAlignToXY(this.alignEl,'t-b',[0,10]);var D=this.el.getAlignToXY(this.alignEl,'t-b?',[0,10]);
920 if(!B||C.equals(D)||C[1]==D[1]){this.el.setXY(D);var xy=this.alignEl.getAnchorXY('b',false);xy[1]+=2;this.arrowEl.setXY(xy);return true;}return this.updatePosition('top',false);}return false;},hide:function(){this.el.setXY([0,0]);this.el.removeClass('in');
921 this.el.hide();this.hoverState=null;this.maskEl.hide();this.fireEvent('hide',this);}});Roo.apply(Roo.bootstrap.Popover,{alignment:{'left':['r-l',[-10,0],'left bs-popover-left'],'right':['l-br',[10,0],'right bs-popover-right'],'bottom':['t-b',[0,10],'top bs-popover-top'],'top':['b-t',[0,-10],'bottom bs-popover-bottom']}
922 ,zIndex:20001,clickHander:false,onMouseDown:function(e){if(this.popups.length&&!e.getTarget(".roo-popover")){this.hideAll();}},popups:[],register:function(A){if(!Roo.bootstrap.Popover.clickHandler){Roo.bootstrap.Popover.clickHandler=Roo.get(document).on("mousedown",Roo.bootstrap.Popover.onMouseDown,Roo.bootstrap.Popover);
923 }A.on('show',Roo.bootstrap.Popover.onShow,A);A.on('hide',Roo.bootstrap.Popover.onHide,A);this.hideAll();},hideAll:function(){this.popups.forEach(function(p){p.hide();});},onShow:function(){Roo.bootstrap.Popover.popups.push(this);},onHide:function(){Roo.bootstrap.Popover.popups.remove(this);
924 }});
925 // Roo/bootstrap/PopoverNav.js
926 Roo.bootstrap.PopoverNav=function(A){Roo.bootstrap.PopoverNav.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.PopoverNav,Roo.bootstrap.nav.Simplebar,{container_method:'getPopoverHeader'});
927 // Roo/bootstrap/Progress.js
928 Roo.bootstrap.Progress=function(A){Roo.bootstrap.Progress.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Progress,Roo.bootstrap.Component,{striped:false,active:false,getAutoCreate:function(){var A={tag:'div',cls:'progress'};if(this.striped){A.cls+=' progress-striped';
929 }if(this.active){A.cls+=' active';}return A;}});
930 // Roo/bootstrap/ProgressBar.js
931 Roo.bootstrap.ProgressBar=function(A){Roo.bootstrap.ProgressBar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.ProgressBar,Roo.bootstrap.Component,{aria_valuenow:0,aria_valuemin:0,aria_valuemax:100,label:false,panel:false,role:false,sr_only:false,getAutoCreate:function(){var A={tag:'div',cls:'progress-bar',style:'width:'+Math.ceil((this.aria_valuenow/this.aria_valuemax)*100)+'%'}
932 ;if(this.sr_only){A.cn={tag:'span',cls:'sr-only',html:this.sr_only}}if(this.role){A.role=this.role;}if(this.aria_valuenow){A['aria-valuenow']=this.aria_valuenow;}if(this.aria_valuemin){A['aria-valuemin']=this.aria_valuemin;}if(this.aria_valuemax){A['aria-valuemax']=this.aria_valuemax;
933 }if(this.label&&!this.sr_only){A.html=this.label;}if(this.panel){A.cls+=' progress-bar-'+this.panel;}return A;},update:function(A){this.aria_valuenow=A;this.el.setStyle('width',Math.ceil((this.aria_valuenow/this.aria_valuemax)*100)+'%');}});
934 // Roo/bootstrap/TabGroup.js
935 Roo.bootstrap.TabGroup=function(A){Roo.bootstrap.TabGroup.superclass.constructor.call(this,A);if(!this.navId){this.navId=Roo.id();}this.tabs=[];Roo.bootstrap.TabGroup.register(this);};Roo.extend(Roo.bootstrap.TabGroup,Roo.bootstrap.Column,{carousel:false,transition:false,bullets:0,timer:0,autoslide:false,slideFn:false,slideOnTouch:false,showarrow:true,getAutoCreate:function(){var A=Roo.apply({}
936 ,Roo.bootstrap.TabGroup.superclass.getAutoCreate.call(this));A.cls+=' tab-content';if(this.carousel){A.cls+=' carousel slide';A.cn=[{cls:'carousel-inner',cn:[]}];if(this.bullets&&!Roo.isTouch){var B={cls:'carousel-bullets',cn:[]};if(this.bullets_cls){B.cls=B.cls+' '+this.bullets_cls;
937 }B.cn.push({cls:'clear'});A.cn[0].cn.push(B);}if(this.showarrow){A.cn[0].cn.push({tag:'div',class:'carousel-arrow',cn:[{tag:'div',class:'carousel-prev',cn:[{tag:'i',class:'fa fa-chevron-left'}]},{tag:'div',class:'carousel-next',cn:[{tag:'i',class:'fa fa-chevron-right'}
938 ]}]});}}return A;},initEvents:function(){if(this.autoslide){var A=this;this.slideFn=window.setInterval(function(){A.showPanelNext();},this.timer);}if(this.showarrow){this.el.select('.carousel-prev',true).first().on('click',this.showPanelPrev,this);this.el.select('.carousel-next',true).first().on('click',this.showPanelNext,this);
939 }},getChildContainer:function(){return this.carousel?this.el.select('.carousel-inner',true).first():this.el;},register:function(A){this.tabs.push(A);A.navId=this.navId;this.addBullet();},getActivePanel:function(){var r=false;Roo.each(this.tabs,function(t){if(t.active){r=t;
940 return false;}return null;});return r;},getPanelByName:function(n){var r=false;Roo.each(this.tabs,function(t){if(t.tabId==n){r=t;return false;}return null;});return r;},indexOfPanel:function(p){var r=false;Roo.each(this.tabs,function(t,i){if(t.tabId==p.tabId){r=i;
941 return false;}return null;});return r;},showPanel:function(A){if(this.transition||typeof(A)=='undefined'){Roo.log("waiting for the transitionend");return false;}if(typeof(A)=='number'){A=this.tabs[A];}if(typeof(A)=='string'){A=this.getPanelByName(A);}var B=this.getActivePanel();
942 if(!A||!B){Roo.log('pan or acitve pan is undefined');return false;}if(A.tabId==this.getActivePanel().tabId){return true;}if(false===B.fireEvent('beforedeactivate')){return false;}if(this.bullets>0&&!Roo.isTouch){this.setActiveBullet(this.indexOfPanel(A));
943 }if(this.carousel&&typeof(Roo.get(document.body).dom.style.transition)!='undefined'){this.transition=true;var C=this.indexOfPanel(A)>this.indexOfPanel(B)?'next':'prev';var lr=C=='next'?'left':'right';A.el.addClass(C);A.el.addClass('carousel-item-'+C);A.el.dom.offsetWidth;
944 B.el.addClass(lr);A.el.addClass(lr);B.el.addClass('carousel-item-'+lr);A.el.addClass('carousel-item-'+lr);var D=this;B.el.on('transitionend',function(){Roo.log("trans end?");A.el.removeClass([lr,C,'carousel-item-'+lr,'carousel-item-'+C]);A.setActive(true);
945 B.el.removeClass([lr,'carousel-item-'+lr]);B.setActive(false);D.transition=false;},this,{single:true});return true;}B.setActive(false);A.setActive(true);return true;},showPanelNext:function(){var i=this.indexOfPanel(this.getActivePanel());if(i>=this.tabs.length-1&&!this.autoslide){return;
946 }if(i>=this.tabs.length-1&&this.autoslide){i=-1;}this.showPanel(this.tabs[i+1]);},showPanelPrev:function(){var i=this.indexOfPanel(this.getActivePanel());if(i<1&&!this.autoslide){return;}if(i<1&&this.autoslide){i=this.tabs.length;}this.showPanel(this.tabs[i-1]);
947 },addBullet:function(){if(!this.bullets||Roo.isTouch){return;}var A=this.el.select('.carousel-bullets',true).first();var i=this.el.select('.carousel-bullets .bullet',true).getCount();var B=A.createChild({cls:'bullet bullet-'+i},A.dom.lastChild);var C=this;
948 B.on('click',(function(e,el,o,ii,t){e.preventDefault();this.showPanel(ii);if(this.autoslide&&this.slideFn){clearInterval(this.slideFn);this.slideFn=window.setInterval(function(){C.showPanelNext();},this.timer);}}).createDelegate(this,[i,B],true));},setActiveBullet:function(i){if(Roo.isTouch){return;
949 }Roo.each(this.el.select('.bullet',true).elements,function(el){el.removeClass('selected');});var A=this.el.select('.bullet-'+i,true).first();if(!A){return;}A.addClass('selected');}});Roo.apply(Roo.bootstrap.TabGroup,{groups:{},register:function(A){this.groups[A.navId]=A;
950 },get:function(A){if(typeof(this.groups[A])=='undefined'){this.register(new Roo.bootstrap.TabGroup({navId:A}));}return this.groups[A];}});
951 // Roo/bootstrap/TabPanel.js
952 Roo.bootstrap.TabPanel=function(A){Roo.bootstrap.TabPanel.superclass.constructor.call(this,A);this.addEvents({'changed':true,'beforedeactivate':true});this.tabId=this.tabId||Roo.id();};Roo.extend(Roo.bootstrap.TabPanel,Roo.bootstrap.Component,{active:false,html:false,tabId:false,navId:false,href:'',touchSlide:false,getAutoCreate:function(){var A={tag:'div',cls:'carousel-item tab-pane item'+((this.href.length)?' clickable ':''),html:this.html||''}
953 ;if(this.active){A.cls+=' active';}if(this.tabId){A.tabId=this.tabId;}return A;},initEvents:function(){var p=this.parent();this.navId=this.navId||p.navId;if(typeof(this.navId)!='undefined'){var tg=Roo.bootstrap.TabGroup.get(this.navId);tg.register(this);var i=tg.tabs.length-1;
954 if(this.active&&tg.bullets>0&&i<tg.bullets){tg.setActiveBullet(i);}}this.el.on('click',this.onClick,this);if(Roo.isTouch&&this.touchSlide){this.el.on("touchstart",this.onTouchStart,this);this.el.on("touchmove",this.onTouchMove,this);this.el.on("touchend",this.onTouchEnd,this);
955 }},onRender:function(ct,A){Roo.bootstrap.TabPanel.superclass.onRender.call(this,ct,A);},setActive:function(A){Roo.log("panel - set active "+this.tabId+"="+A);this.active=A;if(!A){this.el.removeClass('active');}else if(!this.el.hasClass('active')){this.el.addClass('active');
956 }this.fireEvent('changed',this,A);},onClick:function(e){e.preventDefault();if(!this.href.length){return;}window.location.href=this.href;},startX:0,startY:0,endX:0,endY:0,swiping:false,onTouchStart:function(e){this.swiping=false;this.startX=e.browserEvent.touches[0].clientX;
957 this.startY=e.browserEvent.touches[0].clientY;},onTouchMove:function(e){this.swiping=true;this.endX=e.browserEvent.touches[0].clientX;this.endY=e.browserEvent.touches[0].clientY;},onTouchEnd:function(e){if(!this.swiping){this.onClick(e);return;}var A=this.parent();
958 if(this.endX>this.startX){A.showPanelPrev();return;}if(this.startX>this.endX){A.showPanelNext();return;}}});
959 // Roo/bootstrap/form/DateField.js
960 Roo.bootstrap.form.DateField=function(A){Roo.bootstrap.form.DateField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true,beforeselect:true});};Roo.extend(Roo.bootstrap.form.DateField,Roo.bootstrap.form.Input,{format:"m/d/y",altFormats:"m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d",weekStart:0,viewMode:'',minViewMode:'',todayHighlight:false,todayBtn:false,language:'en',keyboardNavigation:true,calendarWeeks:false,startDate:-Infinity,endDate:Infinity,daysOfWeekDisabled:[],_events:[],singleMode:false,UTCDate:function(){return new Date(Date.UTC.apply(Date,arguments));
961 },UTCToday:function(){var A=new Date();return this.UTCDate(A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate());},getDate:function(){var d=this.getUTCDate();return new Date(d.getTime()+(d.getTimezoneOffset()*60000));},getUTCDate:function(){return this.date;
962 },setDate:function(d){this.setUTCDate(new Date(d.getTime()-(d.getTimezoneOffset()*60000)));},setUTCDate:function(d){this.date=d;this.setValue(this.formatDate(this.date));},onRender:function(ct,A){Roo.bootstrap.form.DateField.superclass.onRender.call(this,ct,A);
963 this.language=this.language||'en';this.language=this.language in Roo.bootstrap.form.DateField.dates?this.language:this.language.split('-')[0];this.language=this.language in Roo.bootstrap.form.DateField.dates?this.language:"en";this.isRTL=Roo.bootstrap.form.DateField.dates[this.language].rtl||false;
964 this.format=this.format||'m/d/y';this.isInline=false;this.isInput=true;this.component=this.el.select('.add-on',true).first()||false;this.component=(this.component&&this.component.length===0)?false:this.component;this.hasInput=this.component&&this.inputEl().length;
965 if(typeof(this.minViewMode==='string')){switch(this.minViewMode){case 'months':this.minViewMode=1;break;case 'years':this.minViewMode=2;break;default:this.minViewMode=0;break;}}if(typeof(this.viewMode==='string')){switch(this.viewMode){case 'months':this.viewMode=1;
966 break;case 'years':this.viewMode=2;break;default:this.viewMode=0;break;}}this.pickerEl=Roo.get(document.body).createChild(Roo.bootstrap.form.DateField.template);this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.picker().on('mousedown',this.onMousedown,this);
967 this.picker().on('click',this.onClick,this);this.picker().addClass('datepicker-dropdown');this.startViewMode=this.viewMode;if(this.singleMode){Roo.each(this.picker().select('thead > tr > th',true).elements,function(v){v.setVisibilityMode(Roo.Element.DISPLAY);
968 v.hide();});Roo.each(this.picker().select('tbody > tr > td',true).elements,function(v){v.setStyle('width','189px');});}Roo.each(this.picker().select('tfoot th.today',true).elements,function(v){if(!this.calendarWeeks){v.remove();return;}v.dom.innerHTML=Roo.bootstrap.form.DateField.dates[this.language].today;
969 v.attr('colspan',function(i,B){return parseInt(B)+1;});});this.weekEnd=this.weekStart===0?6:this.weekStart-1;this.setStartDate(this.startDate);this.setEndDate(this.endDate);this.setDaysOfWeekDisabled(this.daysOfWeekDisabled);this.fillDow();this.fillMonths();
970 this.update();this.showMode();if(this.isInline){this.showPopup();}},picker:function(){return this.pickerEl;},fillDow:function(){var A=this.weekStart;var B={tag:'tr',cn:[]};if(this.calendarWeeks){B.cn.push({tag:'th',cls:'cw',html:'&nbsp;'})}while(A<this.weekStart+7){B.cn.push({tag:'th',cls:'dow',html:Roo.bootstrap.form.DateField.dates[this.language].daysMin[(A++)%7]}
971 );}this.picker().select('>.datepicker-days thead',true).first().createChild(B);},fillMonths:function(){var i=0;var A=this.picker().select('>.datepicker-months td',true).first();A.dom.innerHTML='';while(i<12){var B={tag:'span',cls:'month',html:Roo.bootstrap.form.DateField.dates[this.language].monthsShort[i++]}
972 ;A.createChild(B);}},update:function(){this.date=(typeof(this.date)==='undefined'||((typeof(this.date)==='string')&&!this.date.length))?this.UTCToday():(typeof(this.date)==='string')?this.parseDate(this.date):this.date;if(this.date<this.startDate){this.viewDate=new Date(this.startDate);
973 }else if(this.date>this.endDate){this.viewDate=new Date(this.endDate);}else{this.viewDate=new Date(this.date);}this.fill();},fill:function(){var d=new Date(this.viewDate),A=d.getUTCFullYear(),B=d.getUTCMonth(),C=this.startDate!==-Infinity?this.startDate.getUTCFullYear():-Infinity,D=this.startDate!==-Infinity?this.startDate.getUTCMonth():-Infinity,E=this.endDate!==Infinity?this.endDate.getUTCFullYear():Infinity,F=this.endDate!==Infinity?this.endDate.getUTCMonth():Infinity,G=this.date&&this.date.valueOf(),H=this.UTCToday();
974 this.picker().select('>.datepicker-days thead th.switch',true).first().dom.innerHTML=Roo.bootstrap.form.DateField.dates[this.language].months[B]+' '+A;this.updateNavArrows();this.fillMonths();var I=this.UTCDate(A,B-1,28,0,0,0,0),J=I.getDaysInMonth(I.getUTCFullYear(),I.getUTCMonth());
975 I.setUTCDate(J);I.setUTCDate(J-(I.getUTCDay()-this.weekStart+7)%7);var K=new Date(I);K.setUTCDate(K.getUTCDate()+42);K=K.valueOf();var L=false;this.picker().select('>.datepicker-days tbody',true).first().dom.innerHTML='';while(I.valueOf()<=K){var M='';if(I.getUTCDay()===this.weekStart){if(L){this.picker().select('>.datepicker-days tbody',true).first().createChild(L);
976 }L={tag:'tr',cn:[]};if(this.calendarWeeks){var ws=new Date(+I+(this.weekStart-I.getUTCDay()-7)%7*864e5),th=new Date(+ws+(7+4-ws.getUTCDay())%7*864e5),N=new Date(+(N=this.UTCDate(th.getUTCFullYear(),0,1))+(7+4-N.getUTCDay())%7*864e5),O=(th-N)/864e5/7+1;L.cn.push({tag:'td',cls:'cw',html:O}
977 );}}if(I.getUTCFullYear()<A||(I.getUTCFullYear()==A&&I.getUTCMonth()<B)){M+=' old';}else if(I.getUTCFullYear()>A||(I.getUTCFullYear()==A&&I.getUTCMonth()>B)){M+=' new';}if(this.todayHighlight&&I.getUTCFullYear()==H.getFullYear()&&I.getUTCMonth()==H.getMonth()&&I.getUTCDate()==H.getDate()){M+=' today';
978 }if(G&&I.valueOf()===G){M+=' active';}if(I.valueOf()<this.startDate||I.valueOf()>this.endDate||this.daysOfWeekDisabled.indexOf(I.getUTCDay())!==-1){M+=' disabled';}L.cn.push({tag:'td',cls:'day '+M,html:I.getDate()});I.setDate(I.getDate()+1);}var P=this.date&&this.date.getUTCFullYear();
979 var Q=this.date&&this.date.getUTCMonth();this.picker().select('>.datepicker-months th.switch',true).first().dom.innerHTML=A;Roo.each(this.picker().select('>.datepicker-months tbody span',true).elements,function(v,k){v.removeClass('active');if(P===A&&k===Q){v.addClass('active');
980 }if(A<C||A>E||(A==C&&k<D)||(A==E&&k>F)){v.addClass('disabled');}});A=parseInt(A/10,10)*10;this.picker().select('>.datepicker-years th.switch',true).first().dom.innerHTML=A+'-'+(A+9);this.picker().select('>.datepicker-years tbody td',true).first().dom.innerHTML='';
981 A-=1;for(var i=-1;i<11;i++){this.picker().select('>.datepicker-years tbody td',true).first().createChild({tag:'span',cls:'year'+(i===-1||i===10?' old':'')+(P===A?' active':'')+(A<C||A>E?' disabled':''),html:A});A+=1;}},showMode:function(A){if(A){this.viewMode=Math.max(this.minViewMode,Math.min(2,this.viewMode+A));
982 }Roo.each(this.picker().select('>div',true).elements,function(v){v.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';v.hide();});this.picker().select('>.datepicker-'+Roo.bootstrap.form.DateField.modes[this.viewMode].clsName,true).first().show();
983 },place:function(){if(this.isInline){return;}this.picker().removeClass(['bottom','top']);if((Roo.lib.Dom.getViewHeight()+Roo.get(document.body).getScroll().top)-(this.inputEl().getBottom()+this.picker().getHeight())<0){this.picker().addClass('top');this.picker().setTop(this.inputEl().getTop()-this.picker().getHeight()).setLeft(this.inputEl().getLeft());
984 return;}this.picker().addClass('bottom');this.picker().setTop(this.inputEl().getBottom()).setLeft(this.inputEl().getLeft());},parseDate:function(A){if(!A||A instanceof Date){return A;}var v=Date.parseDate(A,this.format);if(!v&&(this.useIso||A.match(/^(\d{4})-0?(\d+)-0?(\d+)/))){v=Date.parseDate(A,'Y-m-d');
985 }if(!v&&this.altFormats){if(!this.altFormatsArray){this.altFormatsArray=this.altFormats.split("|");}for(var i=0,B=this.altFormatsArray.length;i<B&&!v;i++){v=Date.parseDate(A,this.altFormatsArray[i]);}}return v;},formatDate:function(A,B){return (!A||!(A instanceof Date))?A:A.dateFormat(B||this.format);
986 },onFocus:function(){Roo.bootstrap.form.DateField.superclass.onFocus.call(this);this.showPopup();},onBlur:function(){Roo.bootstrap.form.DateField.superclass.onBlur.call(this);var d=this.inputEl().getValue();this.setValue(d);this.hidePopup();},showPopup:function(){this.picker().show();
987 this.update();this.place();this.fireEvent('showpopup',this,this.date);},hidePopup:function(){if(this.isInline){return;}this.picker().hide();this.viewMode=this.startViewMode;this.showMode();this.fireEvent('hidepopup',this,this.date);},onMousedown:function(e){e.stopPropagation();
988 e.preventDefault();},keyup:function(e){Roo.bootstrap.form.DateField.superclass.keyup.call(this);this.update();},setValue:function(v){if(this.fireEvent('beforeselect',this,v)!==false){var d=new Date(this.parseDate(v)).clearTime();if(isNaN(d.getTime())){this.date=this.viewDate='';
989 Roo.bootstrap.form.DateField.superclass.setValue.call(this,'');return;}v=this.formatDate(d);Roo.bootstrap.form.DateField.superclass.setValue.call(this,v);this.date=new Date(d.getTime()-d.getTimezoneOffset()*60000);this.update();this.fireEvent('select',this,this.date);
990 }},getValue:function(){return this.formatDate(this.date);},fireKey:function(e){if(!this.picker().isVisible()){if(e.keyCode==27){this.showPopup();}return;}var A=false,B,C,D,E,F;switch(e.keyCode){case 27:this.hidePopup();e.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation){break;
991 }B=e.keyCode==37?-1:1;if(e.ctrlKey){E=this.moveYear(this.date,B);F=this.moveYear(this.viewDate,B);}else if(e.shiftKey){E=this.moveMonth(this.date,B);F=this.moveMonth(this.viewDate,B);}else{E=new Date(this.date);E.setUTCDate(this.date.getUTCDate()+B);F=new Date(this.viewDate);
992 F.setUTCDate(this.viewDate.getUTCDate()+B);}if(this.dateWithinRange(E)){this.date=E;this.viewDate=F;this.setValue(this.formatDate(this.date));e.preventDefault();A=true;}break;case 38:case 40:if(!this.keyboardNavigation){break;}B=e.keyCode==38?-1:1;if(e.ctrlKey){E=this.moveYear(this.date,B);
993 F=this.moveYear(this.viewDate,B);}else if(e.shiftKey){E=this.moveMonth(this.date,B);F=this.moveMonth(this.viewDate,B);}else{E=new Date(this.date);E.setUTCDate(this.date.getUTCDate()+B*7);F=new Date(this.viewDate);F.setUTCDate(this.viewDate.getUTCDate()+B*7);
994 }if(this.dateWithinRange(E)){this.date=E;this.viewDate=F;this.setValue(this.formatDate(this.date));e.preventDefault();A=true;}break;case 13:this.setValue(this.formatDate(this.date));this.hidePopup();e.preventDefault();break;case 9:this.setValue(this.formatDate(this.date));
995 this.hidePopup();break;case 16:case 17:case 18:break;default:this.hidePopup();}},onClick:function(e){e.stopPropagation();e.preventDefault();var A=e.getTarget();if(A.nodeName.toLowerCase()==='i'){A=Roo.get(A).dom.parentNode;}var B=A.nodeName;var C=A.className;
996 var D=A.innerHTML;switch(B.toLowerCase()){case 'th':switch(C){case 'switch':this.showMode(1);break;case 'prev':case 'next':var E=Roo.bootstrap.form.DateField.modes[this.viewMode].navStep*(C=='prev'?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,E);
997 break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,E);break;}this.fill();break;case 'today':var F=new Date();this.date=this.UTCDate(F.getFullYear(),F.getMonth(),F.getDate(),0,0,0);this.setValue(this.formatDate(this.date));this.hidePopup();break;
998 }break;case 'span':if(C.indexOf('disabled')<0){if(!this.viewDate){this.viewDate=new Date();}this.viewDate.setUTCDate(1);if(C.indexOf('month')>-1){this.viewDate.setUTCMonth(Roo.bootstrap.form.DateField.dates[this.language].monthsShort.indexOf(D));}else{var G=parseInt(D,10)||0;
999 this.viewDate.setUTCFullYear(G);}if(this.singleMode){this.setValue(this.formatDate(this.viewDate));this.hidePopup();return;}this.showMode(-1);this.fill();}break;case 'td':if(C.indexOf('day')>-1&&C.indexOf('disabled')<0){var H=parseInt(D,10)||1;var G=(this.viewDate||new Date()).getUTCFullYear(),I=(this.viewDate||new Date()).getUTCMonth();
1000 if(C.indexOf('old')>-1){if(I===0){I=11;G-=1;}else{I-=1;}}else if(C.indexOf('new')>-1){if(I==11){I=0;G+=1;}else{I+=1;}}this.date=this.UTCDate(G,I,H,0,0,0,0);this.viewDate=this.UTCDate(G,I,Math.min(28,H),0,0,0,0);this.setValue(this.formatDate(this.date));this.hidePopup();
1001 }break;}},setStartDate:function(A){this.startDate=A||-Infinity;if(this.startDate!==-Infinity){this.startDate=this.parseDate(this.startDate);}this.update();this.updateNavArrows();},setEndDate:function(A){this.endDate=A||Infinity;if(this.endDate!==Infinity){this.endDate=this.parseDate(this.endDate);
1002 }this.update();this.updateNavArrows();},setDaysOfWeekDisabled:function(A){this.daysOfWeekDisabled=A||[];if(typeof(this.daysOfWeekDisabled)!=='object'){this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/);}this.daysOfWeekDisabled=this.daysOfWeekDisabled.map(function(d){return parseInt(d,10);
1003 });this.update();this.updateNavArrows();},updateNavArrows:function(){if(this.singleMode){return;}var d=new Date(this.viewDate),A=d.getUTCFullYear(),B=d.getUTCMonth();Roo.each(this.picker().select('.prev',true).elements,function(v){v.show();switch(this.viewMode){case 0:if(this.startDate!==-Infinity&&A<=this.startDate.getUTCFullYear()&&B<=this.startDate.getUTCMonth()){v.hide();
1004 }break;case 1:case 2:if(this.startDate!==-Infinity&&A<=this.startDate.getUTCFullYear()){v.hide();}break;}});Roo.each(this.picker().select('.next',true).elements,function(v){v.show();switch(this.viewMode){case 0:if(this.endDate!==Infinity&&A>=this.endDate.getUTCFullYear()&&B>=this.endDate.getUTCMonth()){v.hide();
1005 }break;case 1:case 2:if(this.endDate!==Infinity&&A>=this.endDate.getUTCFullYear()){v.hide();}break;}})},moveMonth:function(A,B){if(!B){return A;}var C=new Date(A.valueOf()),D=C.getUTCDate(),E=C.getUTCMonth(),F=Math.abs(B),G,H;B=B>0?1:-1;if(F==1){H=B==-1?function(){return C.getUTCMonth()==E;
1006 }:function(){return C.getUTCMonth()!=G;};G=E+B;C.setUTCMonth(G);if(G<0||G>11){G=(G+12)%12;}}else{for(var i=0;i<F;i++){C=this.moveMonth(C,B);}G=C.getUTCMonth();C.setUTCDate(D);H=function(){return G!=C.getUTCMonth();};}while(H()){C.setUTCDate(--D);C.setUTCMonth(G);
1007 }return C;},moveYear:function(A,B){return this.moveMonth(A,B*12);},dateWithinRange:function(A){return A>=this.startDate&&A<=this.endDate;},remove:function(){this.picker().remove();},validateValue:function(A){if(this.getVisibilityEl().hasClass('hidden')){return true;
1008 }if(A.length<1){if(this.allowBlank){return true;}return false;}if(A.length<this.minLength){return false;}if(A.length>this.maxLength){return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](A,this)){return false;}}if(typeof this.validator=="function"){var B=this.validator(A);
1009 if(B!==true){return false;}}if(this.regex&&!this.regex.test(A)){return false;}if(typeof(this.parseDate(A))=='undefined'){return false;}if(this.endDate!==Infinity&&this.parseDate(A).getTime()>this.endDate.getTime()){return false;}if(this.startDate!==-Infinity&&this.parseDate(A).getTime()<this.startDate.getTime()){return false;
1010 }return true;},reset:function(){this.date=this.viewDate='';Roo.bootstrap.form.DateField.superclass.setValue.call(this,'');}});Roo.apply(Roo.bootstrap.form.DateField,{head:{tag:'thead',cn:[{tag:'tr',cn:[{tag:'th',cls:'prev',html:'<i class="fa fa-arrow-left"/>'}
1011 ,{tag:'th',cls:'switch',colspan:'5'},{tag:'th',cls:'next',html:'<i class="fa fa-arrow-right"/>'}]}]},content:{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}]}]},footer:{tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'th',colspan:'7',cls:'today'}]}]},dates:{en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today"}
1012 },modes:[{clsName:'days',navFnc:'Month',navStep:1},{clsName:'months',navFnc:'FullYear',navStep:1},{clsName:'years',navFnc:'FullYear',navStep:10}]});Roo.apply(Roo.bootstrap.form.DateField,{template:{tag:'div',cls:'datepicker dropdown-menu roo-dynamic shadow',cn:[{tag:'div',cls:'datepicker-days',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.form.DateField.head,{tag:'tbody'}
1013 ,Roo.bootstrap.form.DateField.footer]}]},{tag:'div',cls:'datepicker-months',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.form.DateField.head,Roo.bootstrap.form.DateField.content,Roo.bootstrap.form.DateField.footer]}]},{tag:'div',cls:'datepicker-years',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.form.DateField.head,Roo.bootstrap.form.DateField.content,Roo.bootstrap.form.DateField.footer]}
1014 ]}]}});
1015 // Roo/bootstrap/form/TimeField.js
1016 Roo.bootstrap.form.TimeField=function(A){Roo.bootstrap.form.TimeField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true});};Roo.extend(Roo.bootstrap.form.TimeField,Roo.bootstrap.form.Input,{format:"H:i",getAutoCreate:function(){this.after='<i class="fa far fa-clock"></i>';
1017 return Roo.bootstrap.form.TimeField.superclass.getAutoCreate.call(this);},onRender:function(ct,A){Roo.bootstrap.form.TimeField.superclass.onRender.call(this,ct,A);this.pickerEl=Roo.get(document.body).createChild(Roo.bootstrap.form.TimeField.template);this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
1018 this.pop=this.picker().select('>.datepicker-time',true).first();this.pop.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.picker().on('mousedown',this.onMousedown,this);this.picker().on('click',this.onClick,this);this.picker().addClass('datepicker-dropdown');
1019 this.fillTime();this.update();this.pop.select('.hours-up',true).first().on('click',this.onIncrementHours,this);this.pop.select('.hours-down',true).first().on('click',this.onDecrementHours,this);this.pop.select('.minutes-up',true).first().on('click',this.onIncrementMinutes,this);
1020 this.pop.select('.minutes-down',true).first().on('click',this.onDecrementMinutes,this);this.pop.select('button.period',true).first().on('click',this.onTogglePeriod,this);this.pop.select('button.ok',true).first().on('click',this.setTime,this);},fireKey:function(e){if(!this.picker().isVisible()){if(e.keyCode==27){this.show();
1021 }return;}e.preventDefault();switch(e.keyCode){case 27:this.hide();break;case 37:case 39:this.onTogglePeriod();break;case 38:this.onIncrementMinutes();break;case 40:this.onDecrementMinutes();break;case 13:case 9:this.setTime();break;}},onClick:function(e){e.stopPropagation();
1022 e.preventDefault();},picker:function(){return this.pickerEl;},fillTime:function(){var A=this.pop.select('tbody',true).first();A.dom.innerHTML='';A.createChild({tag:'tr',cn:[{tag:'td',cn:[{tag:'a',href:'#',cls:'btn',cn:[{tag:'i',cls:'hours-up fa fas fa-chevron-up'}
1023 ]}]},{tag:'td',cls:'separator'},{tag:'td',cn:[{tag:'a',href:'#',cls:'btn',cn:[{tag:'i',cls:'minutes-up fa fas fa-chevron-up'}]}]},{tag:'td',cls:'separator'}]});A.createChild({tag:'tr',cn:[{tag:'td',cn:[{tag:'span',cls:'timepicker-hour',html:'00'}]},{tag:'td',cls:'separator',html:':'}
1024 ,{tag:'td',cn:[{tag:'span',cls:'timepicker-minute',html:'00'}]},{tag:'td',cls:'separator'},{tag:'td',cn:[{tag:'button',type:'button',cls:'btn btn-primary period',html:'AM'}]}]});A.createChild({tag:'tr',cn:[{tag:'td',cn:[{tag:'a',href:'#',cls:'btn',cn:[{tag:'span',cls:'hours-down fa fas fa-chevron-down'}
1025 ]}]},{tag:'td',cls:'separator'},{tag:'td',cn:[{tag:'a',href:'#',cls:'btn',cn:[{tag:'span',cls:'minutes-down fa fas fa-chevron-down'}]}]},{tag:'td',cls:'separator'}]});},update:function(){this.time=(typeof(this.time)==='undefined')?new Date():this.time;this.fill();
1026 },fill:function(){var A=this.time.getHours();var B=this.time.getMinutes();var C='AM';if(A>11){C='PM';}if(A==0){A=12;}if(A>12){A=A-12;}if(A<10){A='0'+A;}if(B<10){B='0'+B;}this.pop.select('.timepicker-hour',true).first().dom.innerHTML=A;this.pop.select('.timepicker-minute',true).first().dom.innerHTML=B;
1027 this.pop.select('button',true).first().dom.innerHTML=C;},place:function(){this.picker().removeClass(['bottom-left','bottom-right','top-left','top-right']);var A=['bottom'];if((Roo.lib.Dom.getViewHeight()+Roo.get(document.body).getScroll().top)-(this.inputEl().getBottom()+this.picker().getHeight())<0){A.pop();
1028 A.push('top');}A.push('right');if((Roo.lib.Dom.getViewWidth()+Roo.get(document.body).getScroll().left)-(this.inputEl().getLeft()+this.picker().getWidth())<0){A.pop();A.push('left');}this.picker().addClass(A.join('-'));var B=this;Roo.each(A,function(c){if(c=='bottom'){(function(){}
1029 ).defer(200);B.picker().alignTo(B.inputEl(),"tr-br",[0,10],false);return;}if(c=='top'){B.picker().alignTo(B.inputEl(),"br-tr",[0,10],false);return;}});},onFocus:function(){Roo.bootstrap.form.TimeField.superclass.onFocus.call(this);this.show();},onBlur:function(){Roo.bootstrap.form.TimeField.superclass.onBlur.call(this);
1030 this.hide();},show:function(){this.picker().show();this.pop.show();this.update();this.place();this.fireEvent('show',this,this.date);},hide:function(){this.picker().hide();this.pop.hide();this.fireEvent('hide',this,this.date);},setTime:function(){this.hide();
1031 this.setValue(this.time.format(this.format));this.fireEvent('select',this,this.date);},onMousedown:function(e){e.stopPropagation();e.preventDefault();},onIncrementHours:function(){Roo.log('onIncrementHours');this.time=this.time.add(Date.HOUR,1);this.update();
1032 },onDecrementHours:function(){Roo.log('onDecrementHours');this.time=this.time.add(Date.HOUR,-1);this.update();},onIncrementMinutes:function(){Roo.log('onIncrementMinutes');this.time=this.time.add(Date.MINUTE,1);this.update();},onDecrementMinutes:function(){Roo.log('onDecrementMinutes');
1033 this.time=this.time.add(Date.MINUTE,-1);this.update();},onTogglePeriod:function(){Roo.log('onTogglePeriod');this.time=this.time.add(Date.HOUR,12);this.update();}});Roo.apply(Roo.bootstrap.form.TimeField,{template:{tag:'div',cls:'datepicker dropdown-menu',cn:[{tag:'div',cls:'datepicker-time',cn:[{tag:'table',cls:'table-condensed',cn:[{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}
1034 ]}]},{tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'th',colspan:'7',cls:'',cn:[{tag:'button',cls:'btn btn-info ok',html:'OK'}]}]}]}]}]}]}});
1035 // Roo/bootstrap/form/MonthField.js
1036 Roo.bootstrap.form.MonthField=function(A){Roo.bootstrap.form.MonthField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true});};Roo.extend(Roo.bootstrap.form.MonthField,Roo.bootstrap.form.Input,{onRender:function(ct,A){Roo.bootstrap.form.MonthField.superclass.onRender.call(this,ct,A);
1037 this.language=this.language||'en';this.language=this.language in Roo.bootstrap.form.MonthField.dates?this.language:this.language.split('-')[0];this.language=this.language in Roo.bootstrap.form.MonthField.dates?this.language:"en";this.isRTL=Roo.bootstrap.form.MonthField.dates[this.language].rtl||false;
1038 this.isInline=false;this.isInput=true;this.component=this.el.select('.add-on',true).first()||false;this.component=(this.component&&this.component.length===0)?false:this.component;this.hasInput=this.component&&this.inputEL().length;this.pickerEl=Roo.get(document.body).createChild(Roo.bootstrap.form.MonthField.template);
1039 this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.picker().on('mousedown',this.onMousedown,this);this.picker().on('click',this.onClick,this);this.picker().addClass('datepicker-dropdown');Roo.each(this.picker().select('tbody > tr > td',true).elements,function(v){v.setStyle('width','189px');
1040 });this.fillMonths();this.update();if(this.isInline){this.show();}},setValue:function(v,A){var o=this.getValue();Roo.bootstrap.form.MonthField.superclass.setValue.call(this,v);this.update();if(A!==true){this.fireEvent('select',this,o,v);}},getValue:function(){return this.value;
1041 },onClick:function(e){e.stopPropagation();e.preventDefault();var A=e.getTarget();if(A.nodeName.toLowerCase()==='i'){A=Roo.get(A).dom.parentNode;}var B=A.nodeName;var C=A.className;var D=A.innerHTML;if(B.toLowerCase()!='span'||C.indexOf('disabled')>-1||C.indexOf('month')==-1){return;
1042 }this.vIndex=Roo.bootstrap.form.MonthField.dates[this.language].monthsShort.indexOf(D);this.setValue(Roo.bootstrap.form.MonthField.dates[this.language].months[this.vIndex]);this.hide();},picker:function(){return this.pickerEl;},fillMonths:function(){var i=0;
1043 var A=this.picker().select('>.datepicker-months td',true).first();A.dom.innerHTML='';while(i<12){var B={tag:'span',cls:'month',html:Roo.bootstrap.form.MonthField.dates[this.language].monthsShort[i++]};A.createChild(B);}},update:function(){var A=this;if(typeof(this.vIndex)=='undefined'&&this.value.length){this.vIndex=Roo.bootstrap.form.MonthField.dates[this.language].months.indexOf(this.value);
1044 }Roo.each(this.pickerEl.select('> .datepicker-months tbody > tr > td > span',true).elements,function(e,k){e.removeClass('active');if(typeof(A.vIndex)!='undefined'&&k==A.vIndex){e.addClass('active');}})},place:function(){if(this.isInline){return;}this.picker().removeClass(['bottom','top']);
1045 if((Roo.lib.Dom.getViewHeight()+Roo.get(document.body).getScroll().top)-(this.inputEl().getBottom()+this.picker().getHeight())<0){this.picker().addClass('top');this.picker().setTop(this.inputEl().getTop()-this.picker().getHeight()).setLeft(this.inputEl().getLeft());
1046 return;}this.picker().addClass('bottom');this.picker().setTop(this.inputEl().getBottom()).setLeft(this.inputEl().getLeft());},onFocus:function(){Roo.bootstrap.form.MonthField.superclass.onFocus.call(this);this.show();},onBlur:function(){Roo.bootstrap.form.MonthField.superclass.onBlur.call(this);
1047 var d=this.inputEl().getValue();this.setValue(d);this.hide();},show:function(){this.picker().show();this.picker().select('>.datepicker-months',true).first().show();this.update();this.place();this.fireEvent('show',this,this.date);},hide:function(){if(this.isInline){return;
1048 }this.picker().hide();this.fireEvent('hide',this,this.date);},onMousedown:function(e){e.stopPropagation();e.preventDefault();},keyup:function(e){Roo.bootstrap.form.MonthField.superclass.keyup.call(this);this.update();},fireKey:function(e){if(!this.picker().isVisible()){if(e.keyCode==27){this.show();
1049 }return;}var A;switch(e.keyCode){case 27:this.hide();e.preventDefault();break;case 37:case 39:A=e.keyCode==37?-1:1;this.vIndex=this.vIndex+A;if(this.vIndex<0){this.vIndex=0;}if(this.vIndex>11){this.vIndex=11;}if(isNaN(this.vIndex)){this.vIndex=0;}this.setValue(Roo.bootstrap.form.MonthField.dates[this.language].months[this.vIndex]);
1050 break;case 38:case 40:A=e.keyCode==38?-1:1;this.vIndex=this.vIndex+A*4;if(this.vIndex<0){this.vIndex=0;}if(this.vIndex>11){this.vIndex=11;}if(isNaN(this.vIndex)){this.vIndex=0;}this.setValue(Roo.bootstrap.form.MonthField.dates[this.language].months[this.vIndex]);
1051 break;case 13:if(typeof(this.vIndex)!='undefined'&&!isNaN(this.vIndex)){this.setValue(Roo.bootstrap.form.MonthField.dates[this.language].months[this.vIndex]);}this.hide();e.preventDefault();break;case 9:if(typeof(this.vIndex)!='undefined'&&!isNaN(this.vIndex)){this.setValue(Roo.bootstrap.form.MonthField.dates[this.language].months[this.vIndex]);
1052 }this.hide();break;case 16:case 17:case 18:break;default:this.hide();}},remove:function(){this.picker().remove();}});Roo.apply(Roo.bootstrap.form.MonthField,{content:{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}]}]},dates:{en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}
1053 }});Roo.apply(Roo.bootstrap.form.MonthField,{template:{tag:'div',cls:'datepicker dropdown-menu roo-dynamic',cn:[{tag:'div',cls:'datepicker-months',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.form.DateField.content]}]}]}});
1054 // Roo/bootstrap/form/CheckBox.js
1055 Roo.bootstrap.form.CheckBox=function(A){Roo.bootstrap.form.CheckBox.superclass.constructor.call(this,A);this.addEvents({check:true,click:true});};Roo.extend(Roo.bootstrap.form.CheckBox,Roo.bootstrap.form.Input,{inputType:'checkbox',inputValue:1,valueOff:0,boxLabel:false,checked:false,weight:false,inline:false,tooltip:'',invalidClass:"",validClass:"",getAutoCreate:function(){var A=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;
1056 var id=Roo.id();var B={};B.cls='form-group form-check '+this.inputType;if(this.inline){B.cls+=' '+this.inputType+'-inline  form-check-inline';}var C={tag:'input',id:id,type:this.inputType,value:this.inputValue,cls:'roo-'+this.inputType,placeholder:this.placeholder||''}
1057 ;if(this.inputType!='radio'){var D={tag:'input',type:'hidden',cls:'roo-hidden-value',value:this.checked?this.inputValue:this.valueOff};}if(this.weight){B.cls+=" "+this.inputType+"-"+this.weight;}if(this.disabled){C.disabled=true;}if(this.checked){C.checked=this.checked;
1058 }if(this.name){C.name=this.name;if(this.inputType!='radio'){D.name=this.name;C.name='_hidden_'+this.name;}}if(this.size){C.cls+=' input-'+this.size;}var E=this;['xs','sm','md','lg'].map(function(H){if(E[H]){B.cls+=' col-'+H+'-'+E[H];}});var F=C;if(this.before||this.after){F={cls:'input-group',cn:[]}
1059 ;if(this.before){F.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}F.cn.push(C);if(this.inputType!='radio'){F.cn.push(D);}if(this.after){F.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}}var G=false;if(this.boxLabel){G={tag:'label',cls:'box-label',html:this.boxLabel}
1060 ;if(this.tooltip){G.tooltip=this.tooltip;}}if(A==='left'&&this.fieldLabel.length){B.cn=[{tag:'label','for':id,cls:'control-label',html:this.fieldLabel},{cls:"",cn:[F]}];if(G){B.cn[1].cn.push(G);}if(this.labelWidth>12){B.cn[0].style="width: "+this.labelWidth+'px';
1061 }if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){B.cn[0].cls+=' col-lg-'+this.labellg;B.cn[1].cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){B.cn[0].cls+=' col-md-'+this.labelmd;B.cn[1].cls+=' col-md-'+(12-this.labelmd);
1062 }if(this.labelsm>0){B.cn[0].cls+=' col-sm-'+this.labelsm;B.cn[1].cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){B.cn[0].cls+=' col-xs-'+this.labelxs;B.cn[1].cls+=' col-xs-'+(12-this.labelxs);}}else if(this.fieldLabel.length){B.cn=[{tag:this.boxLabel?'span':'label','for':id,cls:'control-label box-input-label',html:this.fieldLabel}
1063 ,F];if(G){B.cn.push(G);}}else{B.cn=[F];if(G){B.cn.push(G);}}if(this.inputType!='radio'){B.cn.push(D);}return B;},inputEl:function(){return this.el.select('input.roo-'+this.inputType,true).first();},hiddenEl:function(){return this.el.select('input.roo-hidden-value',true).first();
1064 },labelEl:function(){return this.el.select('label.control-label',true).first();},label:function(){return this.labelEl();},boxLabelEl:function(){return this.el.select('label.box-label',true).first();},initEvents:function(){this.inputEl().on('click',this.onClick,this);
1065 if(this.boxLabel){this.el.select('label.box-label',true).first().on('click',this.onClick,this);}this.startValue=this.getValue();if(this.groupId){Roo.bootstrap.form.CheckBox.register(this);}},onClick:function(e){if(this.fireEvent('click',this,e)!==false){this.setChecked(!this.checked);
1066 }},setChecked:function(A,B){this.startValue=this.getValue();if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false;});this.inputEl().dom.checked=true;this.inputEl().dom.value=this.inputValue;
1067 if(B!==true){this.fireEvent('check',this,true);}this.validate();return;}this.checked=A;this.inputEl().dom.checked=A;this.hiddenEl().dom.value=A?this.inputValue:this.valueOff;if(B!==true){this.fireEvent('check',this,A);}this.validate();},getValue:function(){if(this.inputType=='radio'){return this.getGroupValue();
1068 }return this.hiddenEl().dom.value;},getGroupValue:function(){if(typeof(this.el.up('form').child('input[name='+this.name+']:checked',true))=='undefined'){return '';}return this.el.up('form').child('input[name='+this.name+']:checked',true).value;},setValue:function(v,A){if(this.inputType=='radio'){this.setGroupValue(v,A);
1069 return;}this.setChecked(((typeof(v)=='undefined')?this.checked:(String(v)===String(this.inputValue))),A);this.validate();},setGroupValue:function(v,A){this.startValue=this.getValue();Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false;
1070 if(e.dom.value==v){e.dom.checked=true;}});if(A!==true){this.fireEvent('check',this,true);}this.validate();return;},validate:function(){if(this.getVisibilityEl().hasClass('hidden')){return true;}if(this.disabled||(this.inputType=='radio'&&this.validateRadio())||(this.inputType=='checkbox'&&this.validateCheckbox())){this.markValid();
1071 return true;}this.markInvalid();return false;},validateRadio:function(){if(this.getVisibilityEl().hasClass('hidden')){return true;}if(this.allowBlank){return true;}var A=false;Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){if(!e.dom.checked){return;
1072 }A=true;return false;});return A;},validateCheckbox:function(){if(!this.groupId){return (this.getValue()==this.inputValue||this.allowBlank)?true:false;}var A=Roo.bootstrap.form.CheckBox.get(this.groupId);if(!A){return false;}var r=false;for(var i in A){if(A[i].el.isVisible(true)){r=false;
1073 break;}r=true;}for(var i in A){if(r){break;}r=(A[i].getValue()==A[i].inputValue)?true:false;}return r;},markValid:function(){var A=this;this.fireEvent('valid',this);var B=Roo.bootstrap.form.FieldLabel.get(this.name+'-group');if(this.groupId){B=Roo.bootstrap.form.FieldLabel.get(this.groupId+'-group');
1074 }if(B){B.markValid();}if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){var fg=e.findParent('.form-group',false,true);if(Roo.bootstrap.version==3){fg.removeClass([A.invalidClass,A.validClass]);
1075 fg.addClass(A.validClass);}else{fg.removeClass(['is-valid','is-invalid']);fg.addClass('is-valid');}});return;}if(!this.groupId){var fg=this.el.findParent('.form-group',false,true);if(Roo.bootstrap.version==3){fg.removeClass([this.invalidClass,this.validClass]);
1076 fg.addClass(this.validClass);}else{fg.removeClass(['is-valid','is-invalid']);fg.addClass('is-valid');}return;}var C=Roo.bootstrap.form.CheckBox.get(this.groupId);if(!C){return;}for(var i in C){var fg=C[i].el.findParent('.form-group',false,true);if(Roo.bootstrap.version==3){fg.removeClass([this.invalidClass,this.validClass]);
1077 fg.addClass(this.validClass);}else{fg.removeClass(['is-valid','is-invalid']);fg.addClass('is-valid');}}},markInvalid:function(A){if(this.allowBlank){return;}var B=this;this.fireEvent('invalid',this,A);var C=Roo.bootstrap.form.FieldLabel.get(this.name+'-group');
1078 if(this.groupId){C=Roo.bootstrap.form.FieldLabel.get(this.groupId+'-group');}if(C){C.markInvalid();}if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){var fg=e.findParent('.form-group',false,true);
1079 if(Roo.bootstrap.version==3){fg.removeClass([B.invalidClass,B.validClass]);fg.addClass(B.invalidClass);}else{fg.removeClass(['is-invalid','is-valid']);fg.addClass('is-invalid');}});return;}if(!this.groupId){var fg=this.el.findParent('.form-group',false,true);
1080 if(Roo.bootstrap.version==3){fg.removeClass([B.invalidClass,B.validClass]);fg.addClass(B.invalidClass);}else{fg.removeClass(['is-invalid','is-valid']);fg.addClass('is-invalid');}return;}var D=Roo.bootstrap.form.CheckBox.get(this.groupId);if(!D){return;}for(var i in D){var fg=D[i].el.findParent('.form-group',false,true);
1081 if(Roo.bootstrap.version==3){fg.removeClass([B.invalidClass,B.validClass]);fg.addClass(B.invalidClass);}else{fg.removeClass(['is-invalid','is-valid']);fg.addClass('is-invalid');}}},clearInvalid:function(){Roo.bootstrap.form.Input.prototype.clearInvalid.call(this);
1082 var A=Roo.bootstrap.form.FieldLabel.get(this.name+'-group');if(A&&A.iconEl){A.iconEl.removeClass([A.validClass,A.invalidClass]);A.iconEl.removeClass(['is-invalid','is-valid']);}},disable:function(){if(this.inputType!='radio'){Roo.bootstrap.form.CheckBox.superclass.disable.call(this);
1083 return;}var A=this;if(this.rendered){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){A.getActionEl().addClass(this.disabledClass);e.dom.disabled=true;});}this.disabled=true;this.fireEvent("disable",this);return this;
1084 },enable:function(){if(this.inputType!='radio'){Roo.bootstrap.form.CheckBox.superclass.enable.call(this);return;}var A=this;if(this.rendered){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){A.getActionEl().removeClass(this.disabledClass);
1085 e.dom.disabled=false;});}this.disabled=false;this.fireEvent("enable",this);return this;},setBoxLabel:function(v){this.boxLabel=v;if(this.rendered){this.el.select('label.box-label',true).first().dom.innerHTML=(v===null||v===undefined?'':v);}}});Roo.apply(Roo.bootstrap.form.CheckBox,{groups:{}
1086 ,register:function(A){if(typeof(this.groups[A.groupId])=='undefined'){this.groups[A.groupId]={};}if(this.groups[A.groupId].hasOwnProperty(A.name)){return;}this.groups[A.groupId][A.name]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false;
1087 }return this.groups[A];}});
1088 // Roo/bootstrap/form/Radio.js
1089 Roo.bootstrap.form.Radio=function(A){Roo.bootstrap.form.Radio.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.Radio,Roo.bootstrap.Component,{boxLabel:'',value:'',getAutoCreate:function(){var A={tag:'div',cls:'form-group radio',cn:[{tag:'label',cls:'box-label',html:this.boxLabel}
1090 ]};return A;},initEvents:function(){this.parent().register(this);this.el.on('click',this.onClick,this);},onClick:function(e){if(this.parent().fireEvent('click',this.parent(),this,e)!==false){this.setChecked(true);}},setChecked:function(A,B){this.parent().setValue(this.value,B);
1091 },setBoxLabel:function(v){this.boxLabel=v;if(this.rendered){this.el.select('label.box-label',true).first().dom.innerHTML=(v===null||v===undefined?'':v);}}});
1092 // Roo/bootstrap/form/SecurePass.js
1093 Roo.bootstrap.form.SecurePass=function(A){this.errors={PwdEmpty:"Please type a password, and then retype it to confirm.",PwdShort:"Your password must be at least 6 characters long. Please type a different password.",PwdLong:"Your password can't contain more than 16 characters. Please type a different password.",PwdBadChar:"The password contains characters that aren't allowed. Please type a different password.",IDInPwd:"Your password can't include the part of your ID. Please type a different password.",FNInPwd:"Your password can't contain your first name. Please type a different password.",LNInPwd:"Your password can't contain your last name. Please type a different password.",TooWeak:"Your password is Too Weak."}
1094 ,this.meterLabel="Password strength:";this.pwdStrengths=["Too Weak","Weak","Medium","Strong"];this.meterClass=["roo-password-meter-tooweak","roo-password-meter-weak","roo-password-meter-medium","roo-password-meter-strong","roo-password-meter-grey"];this.errors={}
1095 ;Roo.bootstrap.form.SecurePass.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.SecurePass,Roo.bootstrap.form.Input,{meterWidth:300,errorMsg:'',errors:false,imageRoot:'/',meterLabel:'',pwdStrengths:false,strength:0,_lastPwd:null,kCapitalLetter:0,kSmallLetter:1,kDigit:2,kPunctuation:3,insecure:false,initEvents:function(){Roo.bootstrap.form.SecurePass.superclass.initEvents.call(this);
1096 if(this.el.is('input[type=password]')&&Roo.isSafari){this.el.on('keydown',this.SafariOnKeyDown,this);}this.el.on('keyup',this.checkStrength,this,{buffer:50});},onRender:function(ct,A){Roo.bootstrap.form.SecurePass.superclass.onRender.call(this,ct,A);this.wrap=this.el.wrap({cls:'x-form-field-wrap'}
1097 );this.trigger=this.wrap.createChild({tag:'div',cls:'StrengthMeter '+this.triggerClass});this.trigger.createChild({cn:[{tag:'div',cls:'roo-password-meter-grey col-xs-12',style:{}},{cls:'roo-password-meter-text'}]});if(this.hideTrigger){this.trigger.setDisplayed(false);
1098 }this.setSize(this.width||'',this.height||'');},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();this.trigger.remove();}if(this.wrap){this.wrap.remove();}Roo.bootstrap.form.TriggerField.superclass.onDestroy.call(this);},checkStrength:function(){var A=this.inputEl().getValue();
1099 if(A==this._lastPwd){return;}var B;if(this.ClientSideStrongPassword(A)){B=3;}else if(this.ClientSideMediumPassword(A)){B=2;}else if(this.ClientSideWeakPassword(A)){B=1;}else{B=0;}Roo.log('strength1: '+B);var pm=this.trigger.child('div/div');pm.removeClass(this.meterClass);
1100 pm.addClass(this.meterClass[B]);var pt=this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom;pt.innerHTML=this.meterLabel+'&nbsp;'+this.pwdStrengths[B];this._lastPwd=A;},reset:function(){Roo.bootstrap.form.SecurePass.superclass.reset.call(this);
1101 this._lastPwd='';var pm=this.trigger.child('div/div');pm.removeClass(this.meterClass);pm.addClass('roo-password-meter-grey');var pt=this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom;pt.innerHTML='';this.inputEl().dom.type='password';
1102 },validateValue:function(A){if(!Roo.bootstrap.form.SecurePass.superclass.validateValue.call(this,A)){return false;}if(A.length==0){if(this.allowBlank){this.clearInvalid();return true;}this.markInvalid(this.errors.PwdEmpty);this.errorMsg=this.errors.PwdEmpty;
1103 return false;}if(this.insecure){return true;}if(!A.match(/[\x21-\x7e]+/)){this.markInvalid(this.errors.PwdBadChar);this.errorMsg=this.errors.PwdBadChar;return false;}if(A.length<6){this.markInvalid(this.errors.PwdShort);this.errorMsg=this.errors.PwdShort;
1104 return false;}if(A.length>16){this.markInvalid(this.errors.PwdLong);this.errorMsg=this.errors.PwdLong;return false;}var B;if(this.ClientSideStrongPassword(A)){B=3;}else if(this.ClientSideMediumPassword(A)){B=2;}else if(this.ClientSideWeakPassword(A)){B=1;
1105 }else{B=0;}if(B<2){this.errorMsg=this.errors.TooWeak;}console.log('strength2: '+B);var pm=this.trigger.child('div/div');pm.removeClass(this.meterClass);pm.addClass(this.meterClass[B]);var pt=this.trigger.child('/div').child('>*[class=roo-password-meter-text]').dom;
1106 pt.innerHTML=this.meterLabel+'&nbsp;'+this.pwdStrengths[B];this.errorMsg='';return true;},CharacterSetChecks:function(A){this.type=A;this.fResult=false;},isctype:function(A,B){switch(B){case this.kCapitalLetter:if(A>='A'&&A<='Z'){return true;}break;case this.kSmallLetter:if(A>='a'&&A<='z'){return true;
1107 }break;case this.kDigit:if(A>='0'&&A<='9'){return true;}break;case this.kPunctuation:if('!@#$%^&*()_+-=\'";:[{]}|.>,</?`~'.indexOf(A)>=0){return true;}break;default:return false;}},IsLongEnough:function(A,B){return !(A==null||isNaN(B)||A.length<B);},SpansEnoughCharacterSets:function(A,nb){if(!this.IsLongEnough(A,nb)){return false;
1108 }var B=new Array(new this.CharacterSetChecks(this.kCapitalLetter),new this.CharacterSetChecks(this.kSmallLetter),new this.CharacterSetChecks(this.kDigit),new this.CharacterSetChecks(this.kPunctuation));for(var C=0;C<A.length;++C){for(var D=0;D<B.length;++D){if(!B[D].fResult&&this.isctype(A.charAt(C),B[D].type)){B[D].fResult=true;
1109 break;}}}var E=0;for(var D=0;D<B.length;++D){if(B[D].fResult){++E;}}if(E<nb){return false;}return true;},ClientSideStrongPassword:function(A){return this.IsLongEnough(A,8)&&this.SpansEnoughCharacterSets(A,3);},ClientSideMediumPassword:function(A){return this.IsLongEnough(A,7)&&this.SpansEnoughCharacterSets(A,2);
1110 },ClientSideWeakPassword:function(A){return this.IsLongEnough(A,6)||!this.IsLongEnough(A,0);}});
1111 // Roo/htmleditor/namespace.js
1112 Roo.htmleditor={};
1113 // Roo/htmleditor/Filter.js
1114 Roo.htmleditor.Filter=function(A){Roo.apply(this.cfg);};Roo.htmleditor.Filter.prototype={node:false,tag:false,replaceComment:false,replaceTag:false,walk:function(A){Roo.each(Array.from(A.childNodes),function(e){switch(true){case e.nodeType==8&&this.replaceComment!==false:this.replaceComment(e);
1115 return;case e.nodeType!=1:return;case this.tag===true:case e.tagName.indexOf(":")>-1&&typeof(this.tag)=='object'&&this.tag.indexOf(":")>-1:case e.tagName.indexOf(":")>-1&&typeof(this.tag)=='string'&&this.tag==":":case typeof(this.tag)=='object'&&this.tag.indexOf(e.tagName)>-1:case typeof(this.tag)=='string'&&this.tag==e.tagName:if(this.replaceTag&&false===this.replaceTag(e)){return;
1116 }if(e.hasChildNodes()){this.walk(e);}return;default:if(e.hasChildNodes()){this.walk(e);}}},this);}};
1117 // Roo/htmleditor/FilterAttributes.js
1118 Roo.htmleditor.FilterAttributes=function(A){Roo.apply(this,A);this.attrib_black=this.attrib_black||[];this.attrib_white=this.attrib_white||[];this.attrib_clean=this.attrib_clean||[];this.style_white=this.style_white||[];this.style_black=this.style_black||[];
1119 this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterAttributes,Roo.htmleditor.Filter,{tag:true,attrib_black:false,attrib_clean:false,attrib_white:false,style_white:false,style_black:false,replaceTag:function(A){if(!A.attributes||!A.attributes.length){return true;
1120 }for(var i=A.attributes.length-1;i>-1;i--){var a=A.attributes[i];if(this.attrib_white.length&&this.attrib_white.indexOf(a.name.toLowerCase())<0){A.removeAttribute(a.name);continue;}if(a.name.toLowerCase().substr(0,2)=='on'){A.removeAttribute(a.name);continue;
1121 }if(this.attrib_black.indexOf(a.name.toLowerCase())>-1){A.removeAttribute(a.name);continue;}if(this.attrib_clean.indexOf(a.name.toLowerCase())>-1){this.cleanAttr(A,a.name,a.value);continue;}if(a.name=='style'){this.cleanStyle(A,a.name,a.value);continue;}if(a.name=='class'){if(a.value.match(/^Mso/)){A.removeAttribute('class');
1122 }if(a.value.match(/^body$/)){A.removeAttribute('class');}continue;}}return true;},cleanAttr:function(A,n,v){if(v.match(/^\./)||v.match(/^\//)){return;}if(v.match(/^(http|https):\/\//)||v.match(/^mailto:/)||v.match(/^ftp:/)||v.match(/^data:/)){return;}if(v.match(/^#/)){return;
1123 }if(v.match(/^\{/)){return;}A.removeAttribute(n);},cleanStyle:function(A,n,v){if(v.match(/expression/)){A.removeAttribute(n);return;}var B=v.split(/;/);var C=[];Roo.each(B,function(p){p=p.replace(/^\s+/g,'').replace(/\s+$/g,'');if(!p.length){return true;}
1124 var l=p.split(':').shift().replace(/\s+/g,'');l=l.replace(/^\s+/g,'').replace(/\s+$/g,'');if(this.style_black.length&&(this.style_black.indexOf(l)>-1||this.style_black.indexOf(l.toLowerCase())>-1)){return true;}if(this.style_white.length&&style_white.indexOf(l)<0&&style_white.indexOf(l.toLowerCase())<0){return true;
1125 }C.push(p);return true;},this);if(C.length){A.setAttribute(n,C.join(';'));}else{A.removeAttribute(n);}}});
1126 // Roo/htmleditor/FilterBlack.js
1127 Roo.htmleditor.FilterBlack=function(A){Roo.apply(this,A);this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterBlack,Roo.htmleditor.Filter,{tag:true,replaceTag:function(n){n.parentNode.removeChild(n);}});
1128 // Roo/htmleditor/FilterComment.js
1129 Roo.htmleditor.FilterComment=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterComment,Roo.htmleditor.Filter,{replaceComment:function(n){n.parentNode.removeChild(n);}});
1130 // Roo/htmleditor/FilterKeepChildren.js
1131 Roo.htmleditor.FilterKeepChildren=function(A){Roo.apply(this,A);if(this.tag===false){return;}this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterKeepChildren,Roo.htmleditor.FilterBlack,{replaceTag:function(A){var ar=Array.from(A.childNodes);for(var i=0;i<ar.length;
1132 i++){if(ar[i].nodeType==1){if((typeof(this.tag)=='object'&&this.tag.indexOf(ar[i].tagName)>-1)||(typeof(this.tag)=='string'&&this.tag==ar[i].tagName)){this.replaceTag(ar[i]);continue;}}}ar=Array.from(A.childNodes);for(var i=0;i<ar.length;i++){A.removeChild(ar[i]);
1133 A.parentNode.insertBefore(ar[i],A);if(this.tag!==false){this.walk(ar[i]);}}A.parentNode.removeChild(A);return false;}});
1134 // Roo/htmleditor/FilterParagraph.js
1135 Roo.htmleditor.FilterParagraph=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterParagraph,Roo.htmleditor.Filter,{tag:'P',replaceTag:function(A){if(A.childNodes.length==1&&A.childNodes[0].nodeType==3&&A.childNodes[0].textContent.trim().length<1){A.parentNode.replaceChild(A.ownerDocument.createElement('BR'),A);
1136 return false;}var ar=Array.from(A.childNodes);for(var i=0;i<ar.length;i++){A.removeChild(ar[i]);A.parentNode.insertBefore(ar[i],A);}A.parentNode.insertBefore(A.ownerDocument.createElement('BR'),A);A.parentNode.insertBefore(A.ownerDocument.createElement('BR'),A);
1137 A.parentNode.removeChild(A);return false;}});
1138 // Roo/htmleditor/FilterSpan.js
1139 Roo.htmleditor.FilterSpan=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterSpan,Roo.htmleditor.FilterKeepChildren,{tag:'SPAN',replaceTag:function(A){if(A.attributes&&A.attributes.length>0){return true;}Roo.htmleditor.FilterKeepChildren.prototype.replaceTag.call(this,A);
1140 return false;}});
1141 // Roo/htmleditor/FilterTableWidth.js
1142 Roo.htmleditor.FilterTableWidth=function(A){this.tag=['TABLE','TD','TR','TH','THEAD','TBODY'];this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterTableWidth,Roo.htmleditor.Filter,{replaceTag:function(A){if(A.hasAttribute('width')){A.removeAttribute('width');
1143 }if(A.hasAttribute("style")){var B=A.getAttribute("style").split(";");var C=[];Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^\s*(width|min-width)\s*$/)){return;}C.push(s);});A.setAttribute("style",C.length?C.join(';'):'');
1144 if(!C.length){A.removeAttribute('style');}}return true;}});
1145 // Roo/htmleditor/FilterWord.js
1146 Roo.htmleditor.FilterWord=function(A){this.replaceDocBullets(A.node);};Roo.extend(Roo.htmleditor.FilterWord,Roo.htmleditor.Filter,{tag:true,replaceTag:function(A){if(A.nodeName=='SPAN'&&!A.hasAttributes()&&A.childNodes.length==1&&A.firstChild.nodeName=="#text"){var B=A.firstChild;
1147 A.removeChild(B);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.insertBefore(B,A);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.removeChild(A);
1148 return false;}if(A.tagName.toLowerCase().match(/^(style|script|applet|embed|noframes|noscript)$/)){A.parentNode.removeChild(A);return false;}if(A.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|v:|font)/)){while(A.childNodes.length){var cn=A.childNodes[0];
1149 A.removeChild(cn);A.parentNode.insertBefore(cn,A);if(cn.nodeType==1){this.replaceTag(cn);}}A.parentNode.removeChild(A);return false;}if(A.className.length){var cn=A.className.split(/\W+/);var C=[];Roo.each(cn,function(F){if(F.match(/Mso[a-zA-Z]+/)){return;
1150 }C.push(F);});A.className=C.length?C.join(' '):'';if(!C.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var D=A.getAttribute("style").split(";");var E=[];Roo.each(D,function(s){if(!s.match(/:/)){return;
1151 }var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return;}E.push(s);});A.setAttribute("style",E.length?E.join(';'):'');if(!E.length){A.removeAttribute('style');}}return true;},styleToObject:function(A){var B=(A.getAttribute("style")||'').split(";");
1152 var C={};Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");C[kv[0].trim()]=kv[1];});return C;},replaceDocBullets:function(A){var B=A.getElementsByClassName('MsoListParagraphCxSpFirst');for(var i=0;i<B.length;i++){B.item(i).className="MsoListParagraph";
1153 }var C=A.getElementsByTagName('h2');for(var i=0;i<C.length;i++){if(C.item(i).hasAttribute('style')&&C.item(i).getAttribute('style').match(/mso-list:/)){C.item(i).className="MsoListParagraph";}}B=A.getElementsByClassName('MsoNormal');while(B.length){if(B.item(0).hasAttribute('style')&&B.item(0).getAttribute('style').match(/mso-list:/)){B.item(0).className="MsoListParagraph";
1154 }else{B.item(0).className="MsoNormalx";}}B=A.getElementsByClassName('ql-indent-1');while(B.length){this.replaceDocBullet(B.item(0));}B=A.getElementsByClassName('MsoListParagraph');while(B.length){this.replaceDocBullet(B.item(0));}},replaceDocBullet:function(p){var ns=p,A=p.parentNode,B=A.ownerDocument,C=[];
1155 while(ns){if(ns.nodeType!=1){ns=ns.nextSibling;continue;}if(!ns.className.match(/(MsoListParagraph|ql-indent-1)/i)){break;}if(ns.getAttribute('style').match(/mso-list/)){C.push(ns);ns=ns.nextSibling;E=true;continue;}var D=ns.getElementsByTagName('span');if(!D.length){break;
1156 }var E=false;for(var i=0;i<D.length;i++){if(D[i].getAttribute('style').match(/mso-list/)){E=true;break;}}if(!E){break;}C.push(ns);ns=ns.nextSibling;}if(!C.length){ns.className="";return;}var ul=A.ownerDocument.createElement('ul');A.insertBefore(ul,p);var F=0;
1157 var G=[ul];var H=false;var I={};max_margins=-1;C.forEach(function(n,J){var K=n.getElementsByTagName('span');if(!K.length){A.removeChild(n);return;}var L={};for(var i=0;i<K.length;i++){L=this.styleToObject(K[i]);if(typeof(L['mso-list'])=='undefined'){continue;
1158 }K[i].parentNode.removeChild(K[i]);break;}L=this.styleToObject(n);if(typeof(L['mso-list'])=='undefined'){A.removeChild(n);return;}var M=L['margin-left'];if(typeof(I[M])=='undefined'){max_margins++;I[M]=max_margins;}nlvl=I[M];if(nlvl>F){var N=B.createElement('ul');
1159 if(!H){H=B.createElement('li');G[F].appendChild(H);}H.appendChild(N);G[nlvl]=N;}F=nlvl;var O=G[nlvl].appendChild(B.createElement('li'));H=O;O.innerHTML=n.innerHTML;A.removeChild(n);},this);}});
1160 // Roo/htmleditor/FilterStyleToTag.js
1161 Roo.htmleditor.FilterStyleToTag=function(A){this.tags={B:['fontWeight','bold'],I:['fontStyle','italic'],SUP:['verticalAlign','super'],SUB:['verticalAlign','sub']};Roo.apply(this,A);this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterStyleToTag,Roo.htmleditor.Filter,{tag:true,tags:false,replaceTag:function(A){if(A.getAttribute("style")===null){return true;
1162 }var B=[];for(var k in this.tags){if(A.style[this.tags[k][0]]==this.tags[k][1]){B.push(k);A.style.removeProperty(this.tags[k][0]);}}if(!B.length){return true;}var cn=Array.from(A.childNodes);var nn=A;Roo.each(B,function(t){var nc=A.ownerDocument.createElement(t);
1163 nn.appendChild(nc);nn=nc;});for(var i=0;i<cn.length;cn++){A.removeChild(cn[i]);nn.appendChild(cn[i]);}return true}})
1164 // Roo/htmleditor/FilterLongBr.js
1165 Roo.htmleditor.FilterLongBr=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterLongBr,Roo.htmleditor.Filter,{tag:'BR',replaceTag:function(A){var ps=A.nextSibling;while(ps&&ps.nodeType==3&&ps.nodeValue.trim().length<1){ps=ps.nextSibling;}if(!ps&&['TD','TH','LI','H1','H2','H3','H4','H5','H6'].indexOf(A.parentNode.tagName)>-1){A.parentNode.removeChild(A);
1166 return false;}if(!ps||ps.nodeType!=1){return false;}if(!ps||ps.tagName!='BR'){return false;}if(!A.previousSibling){return false;}var ps=A.previousSibling;while(ps&&ps.nodeType==3&&ps.nodeValue.trim().length<1){ps=ps.previousSibling;}if(!ps||ps.nodeType!=1){return false;
1167 }if(!ps||['BR','H1','H2','H3','H4','H5','H6'].indexOf(ps.tagName)<0){return false;}A.parentNode.removeChild(A);return false;}});
1168 // Roo/htmleditor/FilterBlock.js
1169 Roo.htmleditor.FilterBlock=function(A){Roo.apply(this,A);var qa=A.node.querySelectorAll;this.removeAttributes('data-block');this.removeAttributes('contenteditable');this.removeAttributes('id');};Roo.apply(Roo.htmleditor.FilterBlock.prototype,{node:true,removeAttributes:function(A){var ar=this.node.querySelectorAll('*['+A+']');
1170 for(var i=0;i<ar.length;i++){ar[i].removeAttribute(A);}}});
1171 // Roo/htmleditor/KeyEnter.js
1172 Roo.htmleditor.KeyEnter=function(A){Roo.apply(this,A);Roo.get(this.core.doc.body).on('keypress',this.keypress,this);};Roo.htmleditor.KeyEnter.prototype={core:false,keypress:function(e){if(e.charCode!=13&&e.charCode!=10){Roo.log([e.charCode,e]);return true;
1173 }e.preventDefault();var A=this.core.doc;var B=this.core.getSelection();var C=B.getRangeAt(0);var n=C.commonAncestorContainer;var pc=C.closest(['ol','ul']);var D=C.closest('li');if(!pc||e.ctrlKey){if(!e.ctrlKey){B.insertNode('br','after');}else{var br=A.createElement('br');
1174 br.className='clear';br.setAttribute('style','clear: both');B.insertNode(br,'after');}this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}if(D.innerText.trim()==''&&D.previousSibling&&D.previousSibling.nodeName=='LI'&&D.previousSibling.innerText.trim()==''){D.parentNode.removeChild(D.previousSibling);
1175 B.cursorAfter(pc);this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}var li=A.createElement('LI');li.innerHTML='&nbsp;';if(!D||!D.firstSibling){pc.appendChild(li);}else{D.parentNode.insertBefore(li,D.firstSibling);}B.cursorText(li.firstChild);
1176 this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}};
1177 // Roo/htmleditor/Block.js
1178 Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var cc=Roo.htmleditor.Block.cache;var id=Roo.get(A).id;if(typeof(cc[id])!='undefined'&&(!cc[id].node||cc[id].node.closest('body'))){Roo.htmleditor.Block.cache[id].readElement(A);return Roo.htmleditor.Block.cache[id];
1179 }var db=A.getAttribute('data-block');if(!db){db=A.nodeName.toLowerCase().toUpperCaseFirst();}var B=Roo.htmleditor['Block'+db];if(typeof(B)=='undefined'){Roo.log("OOps missing block : "+'Block'+db);return false;}Roo.htmleditor.Block.cache[id]=new B({node:A}
1180 );return Roo.htmleditor.Block.cache[id];};Roo.htmleditor.Block.initAll=function(A,B){if(typeof(B)=='undefined'){var ia=Roo.htmleditor.Block.initAll;ia(A,'table');ia(A,'td');ia(A,'figure');return;}Roo.each(Roo.get(A).query(B),function(e){Roo.htmleditor.Block.factory(e);
1181 },this);};Roo.htmleditor.Block.cache={};Roo.htmleditor.Block.prototype={node:false,friendly_name:'Based Block',deleteTitle:false,context:false,updateElement:function(A){Roo.DomHelper.update(A===undefined?this.node:A,this.toObject());},toHTML:function(){return Roo.DomHelper.markup(this.toObject());
1182 },getVal:function(A,B,C,D){var n=A;if(B!==true&&n.tagName!=B.toUpperCase()){n=A.getElementsByTagName(B).item(0);}if(!n){return '';}if(C===false){return n;}if(C=='html'){return n.innerHTML;}if(C=='style'){return n.style[D];}return n.hasAttribute(C)?n.getAttribute(C):'';
1183 },toObject:function(){return {};},readElement:function(A){}};
1184 // Roo/htmleditor/BlockFigure.js
1185 Roo.htmleditor.BlockFigure=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.extend(Roo.htmleditor.BlockFigure,Roo.htmleditor.Block,{image_src:'',align:'center',caption:'',caption_display:'block',width:'100%',cls:'',href:'',video_url:'',text_align:'left',friendly_name:'Image with caption',deleteTitle:"Delete Image and Caption",contextMenu:function(A){var B=function(){return Roo.htmleditor.Block.factory(A.tb.selectedNode);
1186 };var C=typeof(Roo.bootstrap)=='undefined'?Roo:Roo.bootstrap;var D=A.editorcore.syncValue;var E={};return [{xtype:'TextItem',text:"Source: ",xns:C.Toolbar},{xtype:'Button',text:'Change Image URL',listeners:{click:function(F,G){var b=B();Roo.MessageBox.show({title:"Image Source URL",msg:"Enter the url for the image",buttons:Roo.MessageBox.OKCANCEL,fn:function(H,I){if(H!='ok'){return;
1187 }b.image_src=I;b.updateElement();D();A.editorcore.onEditorEvent();},minWidth:250,prompt:true,modal:true,value:b.image_src});}},xns:C.Toolbar},{xtype:'Button',text:'Change Link URL',listeners:{click:function(F,G){var b=B();Roo.MessageBox.show({title:"Link URL",msg:"Enter the url for the link - leave blank to have no link",buttons:Roo.MessageBox.OKCANCEL,fn:function(H,I){if(H!='ok'){return;
1188 }b.href=I;b.updateElement();D();A.editorcore.onEditorEvent();},minWidth:250,prompt:true,modal:true,value:b.href});}},xns:C.Toolbar},{xtype:'Button',text:'Show Video URL',listeners:{click:function(F,G){Roo.MessageBox.alert("Video URL",B().video_url==''?'This image is not linked ot a video':'The image is linked to: <a target="_new" href="'+B().video_url+'">'+B().video_url+'</a>');
1189 }},xns:C.Toolbar},{xtype:'TextItem',text:"Width: ",xns:C.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:70,name:'width',listeners:{select:function(F,r,G){A.editorcore.selectNode(A.tb.selectedNode);
1190 var b=B();b.width=r.get('val');b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form,store:{xtype:'SimpleStore',data:[['100%'],['80%'],['50%'],['20%'],['10%']],fields:['val'],xns:Roo.data}},{xtype:'TextItem',text:"Align: ",xns:C.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:70,name:'align',listeners:{select:function(F,r,G){A.editorcore.selectNode(A.tb.selectedNode);
1191 var b=B();b.align=r.get('val');b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form,store:{xtype:'SimpleStore',data:[['left'],['right'],['center']],fields:['val'],xns:Roo.data}},{xtype:'Button',text:'Hide Caption',name:'caption_display',pressed:false,enableToggle:true,setValue:function(v){this.setText(v?"Hide Caption":"Show Caption");
1192 this.setPressed(v!='block');},listeners:{toggle:function(F,G){var b=B();b.caption_display=b.caption_display=='block'?'none':'block';this.setText(b.caption_display=='block'?"Hide Caption":"Show Caption");b.updateElement();D();A.editorcore.selectNode(A.tb.selectedNode);
1193 A.editorcore.onEditorEvent();}},xns:C.Toolbar}];},toObject:function(){var d=document.createElement('div');d.innerHTML=this.caption;var m=this.width!='100%'&&this.align=='center'?'0 auto':0;var iw=this.align=='center'?this.width:'100%';var A={tag:'img',contenteditable:'false',src:this.image_src,alt:d.innerText.replace(/\n/g," ").replace(/\s+/g,' ').trim(),style:{width:iw,maxWidth:iw+' !important',margin:m}
1194 };if(this.href.length>0){A={tag:'a',href:this.href,contenteditable:'true',cn:[A]};}if(this.video_url.length>0){A={tag:'div',cls:this.cls,frameborder:0,allowfullscreen:true,width:420,height:315,src:this.video_url,cn:[A]};}var B=this.caption_display=='none'?'':(this.caption.length?this.caption:"Caption");
1195 var C={tag:'figure','data-block':'Figure','data-width':this.width,contenteditable:'false',style:{display:'block',float:this.align,maxWidth:this.align=='center'?'100% !important':(this.width+' !important'),width:this.align=='center'?'100%':this.width,margin:'0px',padding:this.align=='center'?'0':'0 10px',textAlign:this.align}
1196 ,align:this.align,cn:[A,{tag:'figcaption','data-display':this.caption_display,style:{textAlign:'left',fontSize:'16px',lineHeight:'24px',display:this.caption_display,maxWidth:(this.align=='center'?this.width:'100%')+' !important',margin:m,width:this.align=='center'?this.width:'100%'}
1197 ,cls:this.cls.length>0?(this.cls+'-thumbnail'):'',cn:[{tag:'div',style:{marginTop:'16px',textAlign:'left'},align:'left',cn:[{tag:'i',contenteditable:true,html:B}]}]}]};return C;},readElement:function(A){this.video_url=this.getVal(A,'div','src');this.cls=this.getVal(A,'div','class');
1198 this.href=this.getVal(A,'a','href');this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','align');var B=this.getVal(A,'figcaption',false);if(B!==''){this.caption=this.getVal(B,'i','html');}this.caption_display=this.getVal(A,'figcaption','data-display');
1199 this.width=this.getVal(A,true,'data-width');},removeNode:function(){return this.node;}})
1200 // Roo/htmleditor/BlockTable.js
1201 Roo.htmleditor.BlockTable=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);if(!A.node){this.rows=[];for(var r=0;r<this.no_row;r++){this.rows[r]=[];for(var c=0;c<this.no_col;c++){this.rows[r][c]=this.emptyCell();
1202 }}}};Roo.extend(Roo.htmleditor.BlockTable,Roo.htmleditor.Block,{rows:false,no_col:1,no_row:1,width:'100%',friendly_name:'Table',deleteTitle:'Delete Table',contextMenu:function(A){var B=function(){return Roo.htmleditor.Block.factory(A.tb.selectedNode);};var C=typeof(Roo.bootstrap)=='undefined'?Roo:Roo.bootstrap;
1203 var D=A.editorcore.syncValue;var E={};return [{xtype:'TextItem',text:"Width: ",xns:C.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:100,name:'width',listeners:{select:function(F,r,G){A.editorcore.selectNode(A.tb.selectedNode);
1204 var b=B();b.width=r.get('val');b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form,store:{xtype:'SimpleStore',data:[['100%'],['auto']],fields:['val'],xns:Roo.data}},{xtype:'TextItem',text:"Columns: ",xns:C.Toolbar},{xtype:'Button',text:'-',listeners:{click:function(F,e){A.editorcore.selectNode(A.tb.selectedNode);
1205 B().removeColumn();D();A.editorcore.onEditorEvent();}},xns:C.Toolbar},{xtype:'Button',text:'+',listeners:{click:function(F,e){A.editorcore.selectNode(A.tb.selectedNode);B().addColumn();D();A.editorcore.onEditorEvent();}},xns:C.Toolbar},{xtype:'TextItem',text:"Rows: ",xns:C.Toolbar}
1206 ,{xtype:'Button',text:'-',listeners:{click:function(F,e){A.editorcore.selectNode(A.tb.selectedNode);B().removeRow();D();A.editorcore.onEditorEvent();}},xns:C.Toolbar},{xtype:'Button',text:'+',listeners:{click:function(F,e){B().addRow();D();A.editorcore.onEditorEvent();
1207 }},xns:C.Toolbar},{xtype:'Button',text:'Reset Column Widths',listeners:{click:function(F,e){B().resetWidths();D();A.editorcore.onEditorEvent();}},xns:C.Toolbar}];},toObject:function(){var A={tag:'table',contenteditable:'false','data-block':'Table',style:{width:this.width,border:'solid 1px #000','border-collapse':'collapse'}
1208 ,cn:[{tag:'tbody',cn:[]}]};var B=0;Roo.each(this.rows,function(C){var tr={tag:'tr',style:{margin:'6px',border:'solid 1px #000',textAlign:'left'},cn:[]};A.cn[0].cn.push(tr);var nc=0;Roo.each(C,function(D){var td={tag:'td',contenteditable:'true','data-block':'Td',html:D.html,style:D.style}
1209 ;if(D.colspan>1){td.colspan=D.colspan;nc+=D.colspan;}else{nc++;}if(D.rowspan>1){td.rowspan=D.rowspan;}tr.cn.push(td);},this);B=Math.max(nc,B);},this);B++;return A;},readElement:function(A){A=A?A:this.node;this.width=this.getVal(A,true,'style','width')||'100%';
1210 this.rows=[];this.no_row=0;var B=Array.from(A.rows);B.forEach(function(tr){var C=[];this.rows.push(C);this.no_row++;var D=0;Array.from(tr.cells).forEach(function(td){var E={colspan:td.hasAttribute('colspan')?td.getAttribute('colspan')*1:1,rowspan:td.hasAttribute('rowspan')?td.getAttribute('rowspan')*1:1,style:td.hasAttribute('style')?td.getAttribute('style'):'',html:td.innerHTML}
1211 ;D+=E.colspan;C.push(E);},this);this.no_col=Math.max(this.no_col,D);},this);},normalizeRows:function(){var A=[];var B=-1;this.rows.forEach(function(C){B++;A[B]=[];C=this.normalizeRow(C);var D=0;C.forEach(function(c){while(typeof(A[B][D])!='undefined'){D++;
1212 }if(typeof(A[B])=='undefined'){A[B]=[];}A[B][D]=c;c.row=B;c.col=D;if(c.rowspan<2){return;}for(var i=1;i<c.rowspan;i++){if(typeof(A[B+i])=='undefined'){A[B+i]=[];}A[B+i][D]=c;}});},this);return A;},normalizeRow:function(A){var B=[];A.forEach(function(c){if(c.colspan<2){B.push(c);
1213 return;}for(var i=0;i<c.colspan;i++){B.push(c);}});return B;},deleteColumn:function(A){if(!A||A.type!='col'){return;}if(this.no_col<2){return;}this.rows.forEach(function(B){var C=this.normalizeRow(B);var D=C[A.col];if(D.colspan>1){D.colspan--;}else{B.remove(D);
1214 }},this);this.no_col--;},removeColumn:function(){this.deleteColumn({type:'col',col:this.no_col-1});this.updateElement();},addColumn:function(){this.rows.forEach(function(A){A.push(this.emptyCell());},this);this.updateElement();},deleteRow:function(A){if(!A||A.type!='row'){return;
1215 }if(this.no_row<2){return;}var B=this.normalizeRows();B[A.row].forEach(function(D){if(D.rowspan>1){D.rowspan--;}else{D.remove=1;}},this);var C=[];this.rows.forEach(function(D){newrow=[];D.forEach(function(c){if(typeof(c.remove)=='undefined'){newrow.push(c);
1216 }});if(newrow.length>0){C.push(D);}});this.rows=C;this.no_row--;this.updateElement();},removeRow:function(){this.deleteRow({type:'row',row:this.no_row-1});},addRow:function(){var A=[];for(var i=0;i<this.no_col;i++){A.push(this.emptyCell());}this.rows.push(A);
1217 this.updateElement();},emptyCell:function(){return (new Roo.htmleditor.BlockTd({})).toObject();},removeNode:function(){return this.node;},resetWidths:function(){Array.from(this.node.getElementsByTagName('td')).forEach(function(n){var nn=Roo.htmleditor.Block.factory(n);
1218 nn.width='';nn.updateElement(n);});}})
1219 // Roo/htmleditor/BlockTd.js
1220 Roo.htmleditor.BlockTd=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.extend(Roo.htmleditor.BlockTd,Roo.htmleditor.Block,{node:false,width:'',textAlign:'left',valign:'top',colspan:1,rowspan:1,friendly_name:'Table Cell',deleteTitle:false,contextMenu:function(A){var B=function(){return Roo.htmleditor.Block.factory(A.tb.selectedNode);
1221 };var C=function(){return Roo.htmleditor.Block.factory(A.tb.selectedNode.closest('table'));};var lr=false;var D=function(){lr=A.editorcore.getSelection().getRangeAt(0);};var restoreSel=function(){if(lr){(function(){A.editorcore.focus();var cr=A.editorcore.getSelection();
1222 cr.removeAllRanges();cr.addRange(lr);A.editorcore.onEditorEvent();}).defer(10,this);}};var rooui=typeof(Roo.bootstrap)=='undefined'?Roo:Roo.bootstrap;var E=A.editorcore.syncValue;var F={};return [{xtype:'Button',text:'Edit Table',listeners:{click:function(){var t=A.tb.selectedNode.closest('table');
1223 A.editorcore.selectNode(t);A.editorcore.onEditorEvent();}}},{xtype:'TextItem',text:"Column Width: ",xns:rooui.Toolbar},{xtype:'Button',text:'-',listeners:{click:function(G,e){A.editorcore.selectNode(A.tb.selectedNode);B().shrinkColumn();E();A.editorcore.onEditorEvent();
1224 }},xns:rooui.Toolbar},{xtype:'Button',text:'+',listeners:{click:function(G,e){A.editorcore.selectNode(A.tb.selectedNode);B().growColumn();E();A.editorcore.onEditorEvent();}},xns:rooui.Toolbar},{xtype:'TextItem',text:"Vertical Align: ",xns:rooui.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:100,name:'valign',listeners:{select:function(G,r,H){A.editorcore.selectNode(A.tb.selectedNode);
1225 var b=B();b.valign=r.get('val');b.updateElement();E();A.editorcore.onEditorEvent();}},xns:rooui.form,store:{xtype:'SimpleStore',data:[['top'],['middle'],['bottom']],fields:['val'],xns:Roo.data}},{xtype:'TextItem',text:"Merge Cells: ",xns:rooui.Toolbar},{xtype:'Button',text:'Right',listeners:{click:function(G,e){A.editorcore.selectNode(A.tb.selectedNode);
1226 B().mergeRight();E();A.editorcore.onEditorEvent();}},xns:rooui.Toolbar},{xtype:'Button',text:'Below',listeners:{click:function(G,e){A.editorcore.selectNode(A.tb.selectedNode);B().mergeBelow();E();A.editorcore.onEditorEvent();}},xns:rooui.Toolbar},{xtype:'TextItem',text:"| ",xns:rooui.Toolbar}
1227 ,{xtype:'Button',text:'Split',listeners:{click:function(G,e){B().split();E();A.editorcore.selectNode(A.tb.selectedNode);A.editorcore.onEditorEvent();}},xns:rooui.Toolbar},{xtype:'Fill',xns:rooui.Toolbar},{xtype:'Button',text:'Delete',xns:rooui.Toolbar,menu:{xtype:'Menu',xns:rooui.menu,items:[{xtype:'Item',html:'Column',listeners:{click:function(G,e){var t=C();
1228 B().deleteColumn();E();A.editorcore.selectNode(t.node);A.editorcore.onEditorEvent();}},xns:rooui.menu},{xtype:'Item',html:'Row',listeners:{click:function(G,e){var t=C();B().deleteRow();E();A.editorcore.selectNode(t.node);A.editorcore.onEditorEvent();}},xns:rooui.menu}
1229 ,{xtype:'Separator',xns:rooui.menu},{xtype:'Item',html:'Table',listeners:{click:function(G,e){var t=C();var nn=t.node.nextSibling||t.node.previousSibling;t.node.parentNode.removeChild(t.node);if(nn){A.editorcore.selectNode(nn,true);}A.editorcore.onEditorEvent();
1230 }},xns:rooui.menu}]}}];},toObject:function(){var A={tag:'td',contenteditable:'true','data-block':'Td',valign:this.valign,style:{'text-align':this.textAlign,border:'solid 1px rgb(0, 0, 0)','border-collapse':'collapse',padding:'6px','vertical-align':this.valign}
1231 ,html:this.html};if(this.width!=''){A.width=this.width;A.style.width=this.width;}if(this.colspan>1){A.colspan=this.colspan;}if(this.rowspan>1){A.rowspan=this.rowspan;}return A;},readElement:function(A){A=A?A:this.node;this.width=A.style.width;this.colspan=Math.max(1,1*A.getAttribute('colspan'));
1232 this.rowspan=Math.max(1,1*A.getAttribute('rowspan'));this.html=A.innerHTML;},emptyCell:function(){return {colspan:1,rowspan:1,textAlign:'left',html:"&nbsp;"};},removeNode:function(){return this.node.closest('table');},cellData:false,colWidths:false,toTableArray:function(){var A=[];
1233 var B=this.node.closest('tr').closest('table');Array.from(B.rows).forEach(function(r,ri){A[ri]=[];});var rn=0;this.colWidths=[];var C=true;Array.from(B.rows).forEach(function(r,ri){var cn=0;Array.from(r.cells).forEach(function(ce,ci){var c={cell:ce,row:rn,col:cn,colspan:ce.colSpan,rowspan:ce.rowSpan}
1234 ;if(ce.isEqualNode(this.node)){this.cellData=c;}if(typeof(A[rn][cn])!='undefined'){while(typeof(A[rn][cn])!='undefined'){cn++;}c.col=cn;}if(typeof(this.colWidths[cn])=='undefined'&&c.colspan<2){this.colWidths[cn]=ce.style.width;if(this.colWidths[cn]!=''){C=false;
1235 }}if(c.colspan<2&&c.rowspan<2){A[rn][cn]=c;cn++;return;}for(var j=0;j<c.rowspan;j++){if(typeof(A[rn+j])=='undefined'){continue;}A[rn+j][cn]=c;for(var i=0;i<c.colspan;i++){A[rn+j][cn+i]=c;}}cn+=c.colspan;},this);rn++;},this);if(C){this.colWidths[0]=false;}
1236 return A;},mergeRight:function(){var tr=this.node.closest('tr');var i=Array.prototype.indexOf.call(tr.childNodes,this.node);if(i>=tr.childNodes.length-1){return;}var A=this.toTableArray();if(typeof(A[this.cellData.row][this.cellData.col+this.cellData.colspan])=='undefined'){return;
1237 }var rc=A[this.cellData.row][this.cellData.col+this.cellData.colspan];if(rc.rowspan!=this.cellData.rowspan||rc.row!=this.cellData.row){return;}this.node.innerHTML+=' '+rc.cell.innerHTML;tr.removeChild(rc.cell);this.colspan+=rc.colspan;this.node.setAttribute('colspan',this.colspan);
1238 var A=this.toTableArray();this.normalizeWidths(A);this.updateWidths(A);},mergeBelow:function(){var A=this.toTableArray();if(typeof(A[this.cellData.row+this.cellData.rowspan])=='undefined'){return;}if(typeof(A[this.cellData.row+this.cellData.rowspan][this.cellData.col])=='undefined'){return;
1239 }var rc=A[this.cellData.row+this.cellData.rowspan][this.cellData.col];if(rc.colspan!=this.cellData.colspan||rc.col!=this.cellData.col){return;}this.node.innerHTML=this.node.innerHTML+rc.cell.innerHTML;rc.cell.parentNode.removeChild(rc.cell);this.rowspan+=rc.rowspan;
1240 this.node.setAttribute('rowspan',this.rowspan);},split:function(){if(this.node.rowSpan<2&&this.node.colSpan<2){return;}var A=this.toTableArray();var cd=this.cellData;this.rowspan=1;this.colspan=1;for(var r=cd.row;r<cd.row+cd.rowspan;r++){for(var c=cd.col;
1241 c<cd.col+cd.colspan;c++){if(r==cd.row&&c==cd.col){this.node.removeAttribute('rowspan');this.node.removeAttribute('colspan');}var B=this.node.cloneNode();B.removeAttribute('id');B.style.width=this.colWidths[c];B.innerHTML='';A[r][c]={cell:B,col:c,row:r,colspan:1,rowspan:1}
1242 ;}}this.redrawAllCells(A);},redrawAllCells:function(A){var B=this.node.closest('tr').closest('table');var C=B.rows[0].parentNode;Array.from(B.rows).forEach(function(r,ri){Array.from(r.cells).forEach(function(ce,ci){ce.parentNode.removeChild(ce);});r.parentNode.removeChild(r);
1243 });for(var r=0;r<A.length;r++){var re=B.rows[r];var re=B.ownerDocument.createElement('tr');C.appendChild(re);for(var c=0;c<A[r].length;c++){if(A[r][c].cell===false){continue;}re.appendChild(A[r][c].cell);A[r][c].cell=false;}}},updateWidths:function(A){for(var r=0;
1244 r<A.length;r++){for(var c=0;c<A[r].length;c++){if(A[r][c].cell===false){continue;}if(this.colWidths[0]!=false&&A[r][c].colspan<2){var el=Roo.htmleditor.Block.factory(A[r][c].cell);el.width=Math.floor(this.colWidths[c])+'%';el.updateElement(el.node);}if(this.colWidths[0]!=false&&A[r][c].colspan>1){var el=Roo.htmleditor.Block.factory(A[r][c].cell);
1245 var B=0;for(var i=0;i<A[r][c].colspan;i++){B+=Math.floor(this.colWidths[c+i]);}el.width=B+'%';el.updateElement(el.node);}A[r][c].cell=false;}}},normalizeWidths:function(A){if(this.colWidths[0]===false){var nw=100.0/this.colWidths.length;this.colWidths.forEach(function(w,i){this.colWidths[i]=nw;
1246 },this);return;}var t=0,B=[];this.colWidths.forEach(function(w,i){this.colWidths[i]=this.colWidths[i]==''?0:(this.colWidths[i]+'').replace(/[^0-9]+/g,'')*1;var D=this.colWidths[i];if(D>0){t+=D;return;}B.push(i);},this);var nc=this.colWidths.length;if(B.length){var C=(nc-B.length)/(1.0*nc);
1247 var t=C*t;var ew=(100-t)/(1.0*B.length);this.colWidths.forEach(function(w,i){if(w>0){this.colWidths[i]=w*C;return;}this.colWidths[i]=ew;},this);}},shrinkColumn:function(){var A=this.toTableArray();this.normalizeWidths(A);var B=this.cellData.col;var nw=this.colWidths[B]*0.8;
1248 if(nw<5){return;}var C=(this.colWidths[B]*0.2)/(this.colWidths.length-1);this.colWidths.forEach(function(w,i){if(i==B){this.colWidths[i]=nw;return;}this.colWidths[i]+=C},this);this.updateWidths(A);},growColumn:function(){var A=this.toTableArray();this.normalizeWidths(A);
1249 var B=this.cellData.col;var nw=this.colWidths[B]*1.2;if(nw>90){return;}var C=(this.colWidths[B]*0.2)/(this.colWidths.length-1);this.colWidths.forEach(function(w,i){if(i==B){this.colWidths[i]=nw;return;}this.colWidths[i]-=C},this);this.updateWidths(A);},deleteRow:function(){var A=this.toTableArray();
1250 for(var i=0;i<A[this.cellData.row].length;i++){var c=A[this.cellData.row][i];if(c.row!=this.cellData.row){c.rowspan--;c.cell.setAttribute('rowspan',c.rowspan);continue;}if(c.rowspan>1){c.rowspan--;c.cell.setAttribute('rowspan',c.rowspan);}}A.splice(this.cellData.row,1);
1251 this.redrawAllCells(A);},deleteColumn:function(){var A=this.toTableArray();for(var i=0;i<A.length;i++){var c=A[i][this.cellData.col];if(c.col!=this.cellData.col){A[i][this.cellData.col].colspan--;}else if(c.colspan>1){c.colspan--;c.cell.setAttribute('colspan',c.colspan);
1252 }A[i].splice(this.cellData.col,1);}this.redrawAllCells(A);}})
1253 // Roo/HtmlEditorCore.js
1254 Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,autoClean:true,enableBlocks:true,stylesheets:false,language:'en',allowComments:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',undoManager:false,getDocMarkup:function(){var st='';
1255 if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);});Roo.get(document.head).select('link').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);
1256 });}else if(!this.stylesheets.length){st='<style type="text/css">'+'body{border:0;margin:0;padding:3px;height:98%;cursor:text;}'+'</style>';}else{for(var i in this.stylesheets){if(typeof(this.stylesheets[i])!='string'){continue;}st+='<link rel="stylesheet" href="'+this.stylesheets[i]+'" type="text/css">';
1257 }}st+='<style type="text/css">'+'IMG { cursor: pointer } '+'</style>';st+='<meta name="google" content="notranslate">';var A='notranslate roo-htmleditor-body';if(this.bodyCls.length){A+=' '+this.bodyCls;}return '<html  class="notranslate" translate="no"><head>'+st+' </head><body contenteditable="true" data-enable-grammerly="true" class="'+A+'"></body></html>';
1258 },onRender:function(ct,A){var _t=this;this.el=this.owner.inputEl?this.owner.inputEl():this.owner.el;this.el.dom.style.border='0 none';this.el.dom.setAttribute('tabIndex',-1);this.el.addClass('x-hidden hide');if(Roo.isIE){this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')}
1259 this.frameId=Roo.id();var B=this.owner.wrap.createChild({tag:'iframe',cls:'form-control',id:this.frameId,name:this.frameId,frameBorder:'no','src':Roo.SSL_SECURE_URL?Roo.SSL_SECURE_URL:"javascript:false"},this.el);this.iframe=B.dom;this.assignDocWin();this.doc.designMode='on';
1260 this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var C={run:function(){this.assignDocWin();if(this.doc.body||this.doc.readyState=='complete'){try{this.doc.designMode="on";}catch(e){return;}Roo.TaskMgr.stop(C);this.initEditor.defer(10,this);
1261 }},interval:10,duration:10000,scope:this};Roo.TaskMgr.start(C);},onResize:function(w,h){Roo.log('resize: '+w+','+h);if(!this.iframe){return;}if(typeof w=='number'){this.iframe.style.width=w+'px';}if(typeof h=='number'){this.iframe.style.height=h+'px';if(this.doc){(this.doc.body||this.doc.documentElement).style.height=(h-(this.iframePad*2))+'px';
1262 }}},toggleSourceEdit:function(A){this.sourceEditMode=A===true;if(this.sourceEditMode){Roo.get(this.iframe).addClass(['x-hidden','hide','d-none']);}else{Roo.get(this.iframe).removeClass(['x-hidden','hide','d-none']);this.deferFocus();}},cleanHtml:function(A){A=String(A);
1263 if(A.length>5){if(Roo.isSafari){A=A.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,'');}}if(A=='&nbsp;'){A='';}return A;},syncValue:function(){if(this.initialized){if(this.undoManager){this.undoManager.addEvent();}var bd=(this.doc.body||this.doc.documentElement);
1264 var A=this.win.getSelection();var B=document.createElement('div');B.innerHTML=bd.innerHTML;var C=B.getElementsByClassName('gtx-trans-icon');if(C.length>0){var rm=C.item(0).parentNode;rm.parentNode.removeChild(rm);}if(this.enableBlocks){new Roo.htmleditor.FilterBlock({node:B}
1265 );}var D=new Roo.htmleditor.TidySerializer({inner:true});var E=D.serialize(B);if(Roo.isSafari){var bs=bd.getAttribute('style');var m=bs?bs.match(/text-align:(.*?);/i):false;if(m&&m[1]){E='<div style="'+m[0]+'">'+E+'</div>';}}E=this.cleanHtml(E);E=E.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\u0080-\uFFFF]/g,function(F){var cc=F.charCodeAt();
1266 if(F.length==2){var G=F.charCodeAt(0)-0xD800;var H=F.charCodeAt(1)-0xDC00;cc=(G*0x400)+H+0x10000;}else if((cc>=0x4E00&&cc<0xA000)||(cc>=0x3400&&cc<0x4E00)||(cc>=0xf900&&cc<0xfb00)){return F;}return "&#"+cc+";";});if(this.owner.fireEvent('beforesync',this,E)!==false){this.el.dom.value=E;
1267 this.owner.fireEvent('sync',this,E);}}},pushValue:function(){if(this.initialized){var v=this.el.dom.value.trim();if(this.owner.fireEvent('beforepush',this,v)!==false){var d=(this.doc.body||this.doc.documentElement);d.innerHTML=v;this.el.dom.value=d.innerHTML;
1268 this.owner.fireEvent('push',this,v);}if(this.autoClean){new Roo.htmleditor.FilterParagraph({node:this.doc.body});new Roo.htmleditor.FilterSpan({node:this.doc.body});}if(this.enableBlocks){Roo.htmleditor.Block.initAll(this.doc.body);}this.updateLanguage();
1269 var lc=this.doc.body.lastChild;if(lc&&lc.nodeType==1&&lc.getAttribute("contenteditable")=="false"){this.doc.body.appendChild(this.doc.createElement('br'));}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();
1270 }else{this.el.focus();}},assignDocWin:function(){var A=this.iframe;if(Roo.isIE){this.doc=A.contentWindow.document;this.win=A.contentWindow;}else{if(!Roo.get(this.frameId)&&!A.contentDocument){return;}this.doc=(A.contentDocument||Roo.get(this.frameId).dom.document);
1271 this.win=(A.contentWindow||Roo.get(this.frameId).dom.contentWindow);}},initEditor:function(){this.assignDocWin();this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement);
1272 A.bgProperties='fixed';A.setAttribute("translate","no");Roo.EventManager.on(this.doc,{'mouseup':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this});Roo.EventManager.on(this.doc,{'paste':this.onPasteEvent,scope:this}
1273 );if(Roo.isGecko){Roo.EventManager.on(this.doc,'keypress',this.mozKeyPress,this);}if(Roo.isIE||Roo.isSafari||Roo.isOpera){Roo.EventManager.on(this.doc,'keydown',this.fixKeys,this);}this.initialized=true;new Roo.htmleditor.KeyEnter({core:this});this.owner.fireEvent('initialize',this);
1274 this.pushValue();},onPasteEvent:function(e,v){var cd=(e.browserEvent.clipboardData||window.clipboardData);if(cd.files&&cd.files.length>0){var A=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);var B=A.createObjectURL(cd.files[0]);
1275 this.insertAtCursor('<img src=" + url + ">');return false;}if(cd.types.indexOf('text/html')<0){return false;}var C=[];var D=cd.getData('text/html');if(cd.types.indexOf('text/rtf')>-1){var E=new Roo.rtf.Parser(cd.getData('text/rtf'));C=E.doc?E.doc.getElementsByType('pict'):[];
1276 }C=C.filter(function(g){return !g.path.match(/^rtf\/(head|pgdsctbl|listtable|footerf)/);}).map(function(g){return g.toDataURL();}).filter(function(g){return g!='about:blank';});D=this.cleanWordChars(D);var d=(new DOMParser().parseFromString(D,'text/html')).body;
1277 var sn=this.getParentElement();if(d.getElementsByTagName('table').length&&sn&&sn.closest('table')){e.preventDefault();this.insertAtCursor("You can not nest tables");return false;}if(C.length>0){Roo.each(d.getElementsByTagName('img'),function(F,i){F.setAttribute('src',C[i]);
1278 });}if(this.autoClean){new Roo.htmleditor.FilterWord({node:d});new Roo.htmleditor.FilterStyleToTag({node:d});new Roo.htmleditor.FilterAttributes({node:d,attrib_white:['href','src','name','align','colspan','rowspan','data-display','data-width'],attrib_clean:['href','src']}
1279 );new Roo.htmleditor.FilterBlack({node:d,tag:this.black});new Roo.htmleditor.FilterKeepChildren({node:d,tag:['FONT',':']});new Roo.htmleditor.FilterParagraph({node:d});new Roo.htmleditor.FilterSpan({node:d});new Roo.htmleditor.FilterLongBr({node:d});new Roo.htmleditor.FilterComment({node:d}
1280 );}if(this.enableBlocks){Array.from(d.getElementsByTagName('img')).forEach(function(F){if(F.closest('figure')){return;}var G=new Roo.htmleditor.BlockFigure({image_src:F.src});G.updateElement(F);});}this.insertAtCursor(d.innerHTML.replace(/&nbsp;/g,' '));if(this.enableBlocks){Roo.htmleditor.Block.initAll(this.doc.body);
1281 }e.preventDefault();return false;},onDestroy:function(){if(this.rendered){}},onFirstFocus:function(){this.assignDocWin();this.undoManager=new Roo.lib.UndoManager(100,(this.doc.body||this.doc.documentElement));this.activated=true;if(Roo.isGecko){this.win.focus();
1282 var s=this.win.getSelection();if(!s.focusNode||s.focusNode.nodeType!=3){var r=s.getRangeAt(0);r.selectNodeContents((this.doc.body||this.doc.documentElement));r.collapse(true);this.deferFocus();}try{this.execCmd('useCSS',true);this.execCmd('styleWithCSS',false);
1283 }catch(e){}}this.owner.fireEvent('activate',this);},adjustFont:function(A){var B=A.cmd=='increasefontsize'?1:-1;var v=parseInt(this.doc.queryCommandValue('FontSize')||3,10);if(Roo.isSafari){var sm={10:1,13:2,16:3,18:4,24:5,32:6,48:7};v=(v<10)?10:v;v=(v>48)?48:v;
1284 v=typeof(sm[v])=='undefined'?1:sm[v];}v=Math.max(1,v+B);this.execCmd('FontSize',v);},onEditorEvent:function(e){if(e&&(e.ctrlKey||e.metaKey)&&e.keyCode===90){return;}if(e&&e.target.nodeName=='BODY'&&e.type=="mouseup"&&this.doc.body.lastChild){var lc=this.doc.body.lastChild;
1285 while((lc.nodeType==3&&lc.nodeValue=='')||lc.id=='gtx-trans'){lc=lc.previousSibling;}if(lc.nodeType==1&&lc.nodeName!='BR'){var ns=this.doc.createElement('br');this.doc.body.appendChild(ns);range=this.doc.createRange();range.setStartAfter(ns);range.collapse(true);
1286 var A=this.win.getSelection();A.removeAllRanges();A.addRange(range);}}this.fireEditorEvent(e);this.syncValue();},fireEditorEvent:function(e){this.owner.fireEvent('editorevent',this,e);},insertTag:function(tg){if(tg.toLowerCase()=='span'||tg.toLowerCase()=='code'||tg.toLowerCase()=='sup'||tg.toLowerCase()=='sub'){range=this.createRange(this.getSelection());
1287 var A=this.doc.createElement(tg.toLowerCase());A.appendChild(range.extractContents());range.insertNode(A);return;}this.execCmd("formatblock",tg);this.undoManager.addEvent();},insertText:function(A){var B=this.createRange();B.deleteContents();B.insertNode(this.doc.createTextNode(A));
1288 this.undoManager.addEvent();},relayCmd:function(A,B){switch(A){case 'justifyleft':case 'justifyright':case 'justifycenter':var n=this.getParentElement();var td=n.closest('td');if(td){var bl=Roo.htmleditor.Block.factory(td);bl.textAlign=A.replace('justify','');
1289 bl.updateElement();this.owner.fireEvent('editorevent',this);return;}this.execCmd('styleWithCSS',true);break;case 'bold':case 'italic':this.execCmd('styleWithCSS',false);break;default:break;}this.win.focus();this.execCmd(A,B);this.owner.fireEvent('editorevent',this);
1290 this.owner.deferFocus();},execCmd:function(A,B){this.doc.execCommand(A,false,B===undefined?null:B);this.syncValue();},insertAtCursor:function(A){if(!this.activated){return;}if(Roo.isGecko||Roo.isOpera||Roo.isSafari){this.win.focus();var B,C;var D=this.win;
1291 if(D.getSelection&&D.getSelection().getRangeAt){this.createRange(this.getSelection()).deleteContents();B=D.getSelection().getRangeAt(0);C=typeof(A)=='string'?B.createContextualFragment(A):A;B.insertNode(C);B=B.cloneRange();B.collapse(false);D.getSelection().removeAllRanges();
1292 D.getSelection().addRange(B);}else if(D.document.selection&&D.document.selection.createRange){var E=typeof(A)=='string'?A:A.outerHTML;D.document.selection.createRange().pasteHTML(E);}else{var E=typeof(A)=='string'?A:A.outerHTML;this.execCmd('InsertHTML',E);
1293 }this.syncValue();this.deferFocus();}},mozKeyPress:function(e){if(e.ctrlKey){var c=e.getCharCode(),A;if(c>0){c=String.fromCharCode(c).toLowerCase();switch(c){case 'b':A='bold';break;case 'i':A='italic';break;case 'u':A='underline';break;}if(A){this.relayCmd(A);
1294 e.preventDefault();}}}},fixKeys:function(){if(Roo.isIE){return function(e){var k=e.getKey(),r;if(k==e.TAB){e.stopEvent();r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML('&#160;&#160;&#160;&#160;');this.deferFocus();}return;}};}else if(Roo.isOpera){return function(e){var k=e.getKey();
1295 if(k==e.TAB){e.stopEvent();this.win.focus();this.execCmd('InsertHTML','&#160;&#160;&#160;&#160;');this.deferFocus();}};}else if(Roo.isSafari){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.execCmd('InsertText','\t');this.deferFocus();
1296 return;}this.mozKeyPress(e);};}}(),getAllAncestors:function(){var p=this.getSelectedNode();var a=[];if(!p){a.push(p);p=this.getParentElement();}while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;}a.push(this.doc.body);return a;
1297 },lastSel:false,lastSelNode:false,getSelection:function(){this.assignDocWin();return Roo.lib.Selection.wrap(Roo.isIE?this.doc.selection:this.win.getSelection(),this.doc);},selectNode:function(A,B){var C=A.ownerDocument.createRange();try{C.selectNode(A);}catch(e){C.selectNodeContents(A);
1298 }if(B===true){C.collapse(true);}var s=this.win.getSelection();s.removeAllRanges();s.addRange(C);},getSelectedNode:function(){var A=this.createRange(this.getSelection()).cloneRange();if(Roo.isIE){var B=A.parentElement();while(true){var C=A.duplicate();C.moveToElementText(B);
1299 if(C.inRange(A)){break;}if((B.nodeType!=1)||(B.tagName.toLowerCase()=='body')){break;}B=B.parentElement;}return B;}var ac=A.commonAncestorContainer;if(ac.nodeType==3){ac=ac.parentNode;}var ar=ac.childNodes;var D=[];var E=[];var F=false;for(var i=0;i<ar.length;
1300 i++){if((ar[i].nodeType==3)&&(!ar[i].data.length)){continue;}if(this.rangeIntersectsNode(A,ar[i])&&this.rangeCompareNode(A,ar[i])==3){D.push(ar[i]);continue;}if((ar[i].nodeType==1)&&this.rangeIntersectsNode(A,ar[i])&&(this.rangeCompareNode(A,ar[i])>0)){E.push(ar[i]);
1301 continue;}if(!this.rangeIntersectsNode(A,ar[i])||(this.rangeCompareNode(A,ar[i])==0)){continue;}F=true;}if(!D.length&&E.length){D=E;}if(F||!D.length||(D.length>1)){return false;}return D[0];},createRange:function(A){if(typeof A!="undefined"){try{return A.getRangeAt?A.getRangeAt(0):A.createRange();
1302 }catch(e){return this.doc.createRange();}}else{return this.doc.createRange();}},getParentElement:function(){this.assignDocWin();var A=Roo.isIE?this.doc.selection:this.win.getSelection();var B=this.createRange(A);try{var p=B.commonAncestorContainer;while(p.nodeType==3){p=p.parentNode;
1303 }return p;}catch(e){return null;}},rangeIntersectsNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){C.selectNodeContents(B);}var D=A.cloneRange();D.collapse(true);var E=A.cloneRange();E.collapse(false);var F=C.cloneRange();
1304 F.collapse(true);var G=C.cloneRange();G.collapse(false);return D.compareBoundaryPoints(Range.START_TO_START,G)==-1&&E.compareBoundaryPoints(Range.START_TO_START,F)==1;},rangeCompareNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);
1305 }catch(e){C.selectNodeContents(B);}A.collapse(true);C.collapse(true);var ss=A.compareBoundaryPoints(Range.START_TO_START,C);var ee=A.compareBoundaryPoints(Range.END_TO_END,C);var D=ss==1;var E=ee==-1;if(D&&E){return 0;}if(!D&&E){return 1;}if(D&&!E){return 2;
1306 }return 3;},cleanWordChars:function(A){var B=[[8211,"&#8211;"],[8212,"&#8212;"],[8216,"'"],[8217,"'"],[8220,'"'],[8221,'"'],[8226,"*"],[8230,"..."]];var C=A;Roo.each(B,function(sw){var D=new RegExp("\\u"+sw[0].toString(16),"g");C=C.replace(D,sw[1]);});return C;
1307 },cleanUpChild:function(A){new Roo.htmleditor.FilterComment({node:A});new Roo.htmleditor.FilterAttributes({node:A,attrib_black:this.ablack,attrib_clean:this.aclean,style_white:this.cwhite,style_black:this.cblack});new Roo.htmleditor.FilterBlack({node:A,tag:this.black}
1308 );new Roo.htmleditor.FilterKeepChildren({node:A,tag:this.tag_remove});},cleanWord:function(A){new Roo.htmleditor.FilterWord({node:A?A:this.doc.body});new Roo.htmleditor.FilterKeepChildren({node:A?A:this.doc.body,tag:['FONT',':']});},cleanTableWidths:function(A){new Roo.htmleditor.FilterTableWidth({node:A?A:this.doc.body}
1309 );},applyBlacklists:function(){var w=typeof(this.owner.white)!='undefined'&&this.owner.white?this.owner.white:[];var b=typeof(this.owner.black)!='undefined'&&this.owner.black?this.owner.black:[];this.aclean=typeof(this.owner.aclean)!='undefined'&&this.owner.aclean?this.owner.aclean:Roo.HtmlEditorCore.aclean;
1310 this.ablack=typeof(this.owner.ablack)!='undefined'&&this.owner.ablack?this.owner.ablack:Roo.HtmlEditorCore.ablack;this.tag_remove=typeof(this.owner.tag_remove)!='undefined'&&this.owner.tag_remove?this.owner.tag_remove:Roo.HtmlEditorCore.tag_remove;this.white=[];
1311 this.black=[];Roo.each(Roo.HtmlEditorCore.white,function(A){if(b.indexOf(A)>-1){return;}this.white.push(A);},this);Roo.each(w,function(A){if(b.indexOf(A)>-1){return;}if(this.white.indexOf(A)>-1){return;}this.white.push(A);},this);Roo.each(Roo.HtmlEditorCore.black,function(A){if(w.indexOf(A)>-1){return;
1312 }this.black.push(A);},this);Roo.each(b,function(A){if(w.indexOf(A)>-1){return;}if(this.black.indexOf(A)>-1){return;}this.black.push(A);},this);w=typeof(this.owner.cwhite)!='undefined'&&this.owner.cwhite?this.owner.cwhite:[];b=typeof(this.owner.cblack)!='undefined'&&this.owner.cblack?this.owner.cblack:[];
1313 this.cwhite=[];this.cblack=[];Roo.each(Roo.HtmlEditorCore.cwhite,function(A){if(b.indexOf(A)>-1){return;}this.cwhite.push(A);},this);Roo.each(w,function(A){if(b.indexOf(A)>-1){return;}if(this.cwhite.indexOf(A)>-1){return;}this.cwhite.push(A);},this);Roo.each(Roo.HtmlEditorCore.cblack,function(A){if(w.indexOf(A)>-1){return;
1314 }this.cblack.push(A);},this);Roo.each(b,function(A){if(w.indexOf(A)>-1){return;}if(this.cblack.indexOf(A)>-1){return;}this.cblack.push(A);},this);},setStylesheets:function(A){if(typeof(A)=='string'){Roo.get(this.iframe.contentDocument.head).createChild({tag:'link',rel:'stylesheet',type:'text/css',href:A}
1315 );return;}var B=this;Roo.each(A,function(s){if(!s.length){return;}Roo.get(B.iframe.contentDocument.head).createChild({tag:'link',rel:'stylesheet',type:'text/css',href:s});});},updateLanguage:function(){if(!this.iframe||!this.iframe.contentDocument){return;
1316 }Roo.get(this.iframe.contentDocument.body).attr("lang",this.language);},removeStylesheets:function(){var A=this;Roo.each(Roo.get(A.iframe.contentDocument.head).select('link[rel=stylesheet]',true).elements,function(s){s.remove();});},setStyle:function(A){Roo.get(this.iframe.contentDocument.head).createChild({tag:'style',type:'text/css',html:A}
1317 );return;}});Roo.HtmlEditorCore.white=['AREA','BR','IMG','INPUT','HR','WBR','ADDRESS','BLOCKQUOTE','CENTER','DD','DIR','DIV','DL','DT','H1','H2','H3','H4','H5','H6','HR','ISINDEX','LISTING','MARQUEE','MENU','MULTICOL','OL','P','PLAINTEXT','PRE','TABLE','UL','XMP','CAPTION','COL','COLGROUP','TBODY','TD','TFOOT','TH','THEAD','TR','DIR','MENU','OL','UL','DL','EMBED','OBJECT'];
1318 Roo.HtmlEditorCore.black=['APPLET','BASE','BASEFONT','BGSOUND','BLINK','BODY','FRAME','FRAMESET','HEAD','HTML','ILAYER','IFRAME','LAYER','LINK','META','OBJECT','SCRIPT','STYLE','TITLE','XML','COLGROUP','COL'];Roo.HtmlEditorCore.clean=['SCRIPT','STYLE','TITLE','XML'];
1319 Roo.HtmlEditorCore.tag_remove=['FONT','TBODY'];Roo.HtmlEditorCore.ablack=['on'];Roo.HtmlEditorCore.aclean=['action','background','codebase','dynsrc','href','lowsrc'];Roo.HtmlEditorCore.pwhite=['http','https','mailto'];Roo.HtmlEditorCore.cwhite=[];Roo.HtmlEditorCore.cblack=[];
1320
1321 // Roo/bootstrap/form/HtmlEditor.js
1322 Roo.bootstrap.form.HtmlEditor=function(A){Roo.bootstrap.form.HtmlEditor.superclass.constructor.call(this,A);if(!this.toolbars){this.toolbars=[];}this.editorcore=new Roo.HtmlEditorCore(Roo.apply({owner:this},A));this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editmodechange:true,editorevent:true,firstfocus:true,autosave:true,savedpreview:true}
1323 );};Roo.extend(Roo.bootstrap.form.HtmlEditor,Roo.bootstrap.form.TextArea,{toolbars:false,btns:[],resizable:false,height:300,width:false,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',tbContainer:false,bodyCls:'',toolbarContainer:function(){return this.wrap.select('.x-html-editor-tb',true).first();
1324 },createToolbar:function(){Roo.log('renewing');Roo.log("create toolbars");this.toolbars=[new Roo.bootstrap.form.HtmlEditorToolbarStandard({editor:this})];this.toolbars[0].render(this.toolbarContainer());return;},onRender:function(ct,A){var _t=this;Roo.bootstrap.form.HtmlEditor.superclass.onRender.call(this,ct,A);
1325 this.wrap=this.inputEl().wrap({cls:'x-html-editor-wrap',cn:{cls:'x-html-editor-tb'}});this.editorcore.onRender(ct,A);if(this.resizable){this.resizeEl=new Roo.Resizable(this.wrap,{pinned:true,wrap:true,dynamic:true,minHeight:this.height,height:this.height,handles:this.resizable,width:this.width,listeners:{resize:function(r,w,h){_t.onResize(w,h);
1326 }}});}this.createToolbar(this);if(!this.width&&this.resizable){this.setSize(this.wrap.getSize());}if(this.resizeEl){this.resizeEl.resizeTo.defer(100,this.resizeEl,[this.width,this.height]);}},onResize:function(w,h){Roo.log('resize: '+w+','+h);Roo.bootstrap.form.HtmlEditor.superclass.onResize.apply(this,arguments);
1327 var ew=false;var eh=false;if(this.inputEl()){if(typeof w=='number'){var aw=w-this.wrap.getFrameWidth('lr');this.inputEl().setWidth(this.adjustWidth('textarea',aw));ew=aw;}if(typeof h=='number'){var A=-11;for(var i=0;i<this.toolbars.length;i++){A+=this.toolbars[i].el.getHeight();
1328 }var ah=h-this.wrap.getFrameWidth('tb')-A;ah-=5;this.inputEl().setHeight(this.adjustWidth('textarea',ah));var eh=ah;}}Roo.log('onResize:'+[w,h,ew,eh].join(','));this.editorcore.onResize(ew,eh);},toggleSourceEdit:function(A){this.editorcore.toggleSourceEdit(A);
1329 if(this.editorcore.sourceEditMode){Roo.log('editor - showing textarea');this.syncValue();this.inputEl().removeClass(['hide','x-hidden']);this.inputEl().dom.removeAttribute('tabIndex');this.inputEl().focus();}else{Roo.log('editor - hiding textarea');this.pushValue();
1330 this.inputEl().addClass(['hide','x-hidden']);this.inputEl().dom.setAttribute('tabIndex',-1);}if(this.resizable){this.setSize(this.wrap.getSize());}this.fireEvent('editmodechange',this,this.editorcore.sourceEditMode);},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap;
1331 },getPositionEl:function(){return this.wrap;},initEvents:function(){this.originalValue=this.getValue();},setValue:function(v){Roo.bootstrap.form.HtmlEditor.superclass.setValue.call(this,v);this.editorcore.pushValue();},deferFocus:function(){this.focus.defer(10,this);
1332 },focus:function(){this.editorcore.focus();},onDestroy:function(){if(this.rendered){for(var i=0;i<this.toolbars.length;i++){this.toolbars[i].onDestroy();}this.wrap.dom.innerHTML='';this.wrap.remove();}},onFirstFocus:function(){this.editorcore.onFirstFocus();
1333 for(var i=0;i<this.toolbars.length;i++){this.toolbars[i].onFirstFocus();}},syncValue:function(){this.editorcore.syncValue();},pushValue:function(){this.editorcore.pushValue();}});
1334 // Roo/bootstrap/form/HtmlEditorToolbarStandard.js
1335 Roo.namespace('Roo.bootstrap.form.HtmlEditor');Roo.bootstrap.form.HtmlEditorToolbarStandard=function(A){Roo.apply(this,A);this.disable=this.disable||{};Roo.applyIf(this.disable,{fontSize:true,colors:true,specialElements:true});Roo.bootstrap.form.HtmlEditorToolbarStandard.superclass.constructor.call(this,A);
1336 this.editor=A.editor;this.editorcore=A.editor.editorcore;this.buttons=new Roo.util.MixedCollection(false,function(o){return o.cmd;});};Roo.extend(Roo.bootstrap.form.HtmlEditorToolbarStandard,Roo.bootstrap.nav.Simplebar,{bar:true,editor:false,editorcore:false,formats:["p","h1","h2","h3","h4","h5","h6","pre","code","abbr","acronym","address","cite","samp","var",'div','span'],onRender:function(ct,A){Roo.bootstrap.form.HtmlEditorToolbarStandard.superclass.onRender.call(this,ct,A);
1337 Roo.log(this.el);this.el.dom.style.marginBottom='0';var B=this;var C=this.editorcore;var D=this.editor;var E=[];var F=function(id,G,H,I,J){var K=H?'toggle':'click';var a={size:'sm',xtype:'Button',xns:Roo.bootstrap,fa:id,cmd:id||G,enableToggle:H!==false,html:J||'',pressed:H?false:null,listeners:{}
1338 };a.listeners[H?'toggle':'click']=function(){I?I.call(B,this):B.onBtnClick.call(B,G||id);};E.push(a);return a;};var style={xtype:'Button',size:'sm',xns:Roo.bootstrap,fa:'font',menu:{xtype:'Menu',xns:Roo.bootstrap,items:[]}};Roo.each(this.formats,function(f){style.menu.items.push({xtype:'MenuItem',xns:Roo.bootstrap,html:'<'+f+' style="margin:2px">'+f+'</'+f+'>',tagname:f,listeners:{click:function(){C.insertTag(this.tagname);
1339 D.focus();}}});});E.push(style);F('bold',false,true);F('italic',false,true);F('align-left','justifyleft',true);F('align-center','justifycenter',true);F('align-right','justifyright',true);F('link',false,false,function(G){var H=prompt(this.createLinkText,this.defaultLinkValue);
1340 if(H&&H!='http:/'+'/'){this.editorcore.relayCmd('createlink',H);}}),F('list','insertunorderedlist',true);F('pencil',false,true,function(G){Roo.log(this);this.toggleSourceEdit(G.pressed);});if(this.editor.btns.length>0){for(var i=0;i<this.editor.btns.length;
1341 i++){E.push(this.editor.btns[i]);}}this.xtype='NavSimplebar';for(var i=0;i<E.length;i++){this.buttons.add(this.addxtypeChild(E[i]));}D.on('editorevent',this.updateToolbar,this);},onBtnClick:function(id){this.editorcore.relayCmd(id);this.editorcore.focus();
1342 },updateToolbar:function(){if(!this.editorcore.activated){this.editor.onFirstFocus();return;}var A=this.buttons;var B=this.editorcore.doc;A.get('bold').setActive(B.queryCommandState('bold'));A.get('italic').setActive(B.queryCommandState('italic'));A.get('align-left').setActive(B.queryCommandState('justifyleft'));
1343 A.get('align-center').setActive(B.queryCommandState('justifycenter'));A.get('align-right').setActive(B.queryCommandState('justifyright'));A.get('list').setActive(B.queryCommandState('insertunorderedlist'));Roo.bootstrap.menu.Manager.hideAll();},onFirstFocus:function(){this.buttons.each(function(A){A.enable();
1344 });},toggleSourceEdit:function(A){if(A){Roo.log("disabling buttons");this.buttons.each(function(B){if(B.cmd!='pencil'){B.disable();}});}else{Roo.log("enabling buttons");if(this.editorcore.initialized){this.buttons.each(function(B){B.enable();});}}Roo.log("calling toggole on editor");
1345 this.editor.toggleSourceEdit(A);}});
1346 // Roo/bootstrap/form/Markdown.js
1347 Roo.bootstrap.form.Markdown=function(A){Roo.bootstrap.form.Markdown.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.Markdown,Roo.bootstrap.form.TextArea,{editing:false,initEvents:function(){Roo.bootstrap.form.TextArea.prototype.initEvents.call(this);
1348 this.markdownEl=this.el.createChild({cls:'roo-markdown-area'});this.inputEl().addClass('d-none');if(this.getValue()==''){this.markdownEl.dom.innerHTML=String.format('<span class="roo-placeholder">{0}</span>',this.placeholder||'');}else{this.markdownEl.dom.innerHTML=Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(this.getValue()));
1349 }this.markdownEl.on('click',this.toggleTextEdit,this);this.on('blur',this.toggleTextEdit,this);this.on('specialkey',this.resizeTextArea,this);},toggleTextEdit:function(){var sh=this.markdownEl.getHeight();this.inputEl().addClass('d-none');this.markdownEl.addClass('d-none');
1350 if(!this.editing){this.inputEl().setHeight(Math.min(500,Math.max(sh,(this.getValue().split("\n").length+1)*30)));this.inputEl().removeClass('d-none');this.inputEl().focus();this.editing=true;return;}this.updateMarkdown();this.markdownEl.removeClass('d-none');
1351 this.editing=false;return;},updateMarkdown:function(){if(this.getValue()==''){this.markdownEl.dom.innerHTML=String.format('<span class="roo-placeholder">{0}</span>',this.placeholder||'');return;}this.markdownEl.dom.innerHTML=Roo.Markdown.toHtml(Roo.util.Format.htmlEncode(this.getValue()));
1352 },resizeTextArea:function(){var sh=100;Roo.log([sh,this.getValue().split("\n").length*30]);this.inputEl().setHeight(Math.min(500,Math.max(sh,(this.getValue().split("\n").length+1)*30)));},setValue:function(A){Roo.bootstrap.form.TextArea.prototype.setValue.call(this,A);
1353 if(!this.editing){this.updateMarkdown();}},focus:function(){if(!this.editing){this.toggleTextEdit();}}});
1354 // Roo/bootstrap/PagingToolbar.js
1355 Roo.bootstrap.PagingToolbar=function(A){this.ds=A.dataSource;if(A.store&&!this.ds){this.store=Roo.factory(A.store,Roo.data);this.ds=this.store;this.ds.xmodule=this.xmodule||false;}this.toolbarItems=[];if(A.items){this.toolbarItems=A.items;}Roo.bootstrap.PagingToolbar.superclass.constructor.call(this,A);
1356 this.cursor=0;if(this.ds){this.bind(this.ds);}if(Roo.bootstrap.version==4){this.navgroup=new Roo.bootstrap.ButtonGroup({cls:'pagination'});}else{this.navgroup=new Roo.bootstrap.nav.Group({cls:'pagination'});}};Roo.extend(Roo.bootstrap.PagingToolbar,Roo.bootstrap.nav.Simplebar,{pageSize:20,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",buttons:false,onRender:function(ct,A){Roo.bootstrap.PagingToolbar.superclass.onRender.call(this,ct,A);
1357 this.navgroup.parentId=this.id;this.navgroup.onRender(this.el,null);if(this.displayInfo){this.el.select('ul.navbar-nav',true).first().createChild({cls:'x-paging-info'});this.displayEl=this.el.select('.x-paging-info',true).first();}var B=this;if(this.buttons){Roo.each(B.buttons,function(e){Roo.factory(e).render(B.el);
1358 });}Roo.each(B.toolbarItems,function(e){B.navgroup.addItem(e);});this.first=this.navgroup.addItem({tooltip:this.firstText,cls:"prev btn-outline-secondary",html:' <i class="fa fa-step-backward"></i>',disabled:true,preventDefault:true,listeners:{click:this.onClick.createDelegate(this,["first"])}
1359 });this.prev=this.navgroup.addItem({tooltip:this.prevText,cls:"prev btn-outline-secondary",html:' <i class="fa fa-backward"></i>',disabled:true,preventDefault:true,listeners:{click:this.onClick.createDelegate(this,["prev"])}});var C=this.navgroup.addItem({tagtype:'span',cls:'x-paging-position  btn-outline-secondary',disabled:true,html:this.beforePageText+'<input type="text" size="3" value="1" class="x-grid-page-number">'+'<span class="x-paging-after">'+String.format(this.afterPageText,1)+'</span>'}
1360 );this.field=C.el.select('input',true).first();this.field.on("keydown",this.onPagingKeydown,this);this.field.on("focus",function(){this.dom.select();});this.afterTextEl=C.el.select('.x-paging-after',true).first();this.next=this.navgroup.addItem({tooltip:this.nextText,cls:"next btn-outline-secondary",html:' <i class="fa fa-forward"></i>',disabled:true,preventDefault:true,listeners:{click:this.onClick.createDelegate(this,["next"])}
1361 });this.last=this.navgroup.addItem({tooltip:this.lastText,html:' <i class="fa fa-step-forward"></i>',cls:"next btn-outline-secondary",disabled:true,preventDefault:true,listeners:{click:this.onClick.createDelegate(this,["last"])}});this.loading=this.navgroup.addItem({tooltip:this.refreshText,cls:"btn-outline-secondary",html:' <i class="fa fa-refresh"></i>',preventDefault:true,listeners:{click:this.onClick.createDelegate(this,["refresh"])}
1362 });},updateInfo:function(){if(this.displayEl){var A=(typeof(this.getCount)=='undefined')?this.ds.getCount():this.getCount();var B=A==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+A,this.ds.getTotalCount());this.displayEl.update(B);
1363 }},onLoad:function(ds,r,o){this.cursor=o.params&&o.params.start?o.params.start:0;var d=this.getPageData(),ap=d.activePage,ps=d.pages;this.afterTextEl.dom.innerHTML=String.format(this.afterPageText,d.pages);this.field.dom.value=ap;this.first.setDisabled(ap==1);
1364 this.prev.setDisabled(ap==1);this.next.setDisabled(ap==ps);this.last.setDisabled(ap==ps);this.loading.enable();this.updateInfo();},getPageData:function(){var A=this.ds.getTotalCount();return {total:A,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:A<this.pageSize?1:Math.ceil(A/this.pageSize)}
1365 ;},onLoadError:function(A,o){this.loading.enable();if(this.ds.events.loadexception.listeners.length<2){Roo.MessageBox.alert("Error loading",o.raw.errorMsg);}},onPagingKeydown:function(e){var k=e.getKey();var d=this.getPageData();if(k==e.RETURN){var v=this.field.dom.value,A;
1366 if(!v||isNaN(A=parseInt(v,10))){this.field.dom.value=d.activePage;return;}A=Math.min(Math.max(1,A),d.pages)-1;this.ds.load({params:{start:A*this.pageSize,limit:this.pageSize}});e.stopEvent();}else if(k==e.HOME||(k==e.UP&&e.ctrlKey)||(k==e.PAGEUP&&e.ctrlKey)||(k==e.RIGHT&&e.ctrlKey)||k==e.END||(k==e.DOWN&&e.ctrlKey)||(k==e.LEFT&&e.ctrlKey)||(k==e.PAGEDOWN&&e.ctrlKey)){var A=(k==e.HOME||(k==e.DOWN&&e.ctrlKey)||(k==e.LEFT&&e.ctrlKey)||(k==e.PAGEDOWN&&e.ctrlKey))?1:d.pages;
1367 this.field.dom.value=A;this.ds.load({params:{start:(A-1)*this.pageSize,limit:this.pageSize}});e.stopEvent();}else if(k==e.UP||k==e.RIGHT||k==e.PAGEUP||k==e.DOWN||k==e.LEFT||k==e.PAGEDOWN){var v=this.field.dom.value,A;var B=(e.shiftKey)?10:1;if(k==e.DOWN||k==e.LEFT||k==e.PAGEDOWN){B*=-1;
1368 }if(!v||isNaN(A=parseInt(v,10))){this.field.dom.value=d.activePage;return;}else if(parseInt(v,10)+B>=1&parseInt(v,10)+B<=d.pages){this.field.dom.value=parseInt(v,10)+B;A=Math.min(Math.max(1,A+B),d.pages)-1;this.ds.load({params:{start:A*this.pageSize,limit:this.pageSize}
1369 });}e.stopEvent();}},beforeLoad:function(){if(this.loading){this.loading.disable();}},onClick:function(A){var ds=this.ds;if(!ds){return;}switch(A){case "first":ds.load({params:{start:0,limit:this.pageSize}});break;case "prev":ds.load({params:{start:Math.max(0,this.cursor-this.pageSize),limit:this.pageSize}
1370 });break;case "next":ds.load({params:{start:this.cursor+this.pageSize,limit:this.pageSize}});break;case "last":var B=ds.getTotalCount();var C=B%this.pageSize;var D=C?(B-C):B-this.pageSize;ds.load({params:{start:D,limit:this.pageSize}});break;case "refresh":ds.load({params:{start:this.cursor,limit:this.pageSize}
1371 });break;}},unbind:function(ds){ds.un("beforeload",this.beforeLoad,this);ds.un("load",this.onLoad,this);ds.un("loadexception",this.onLoadError,this);ds.un("remove",this.updateInfo,this);ds.un("add",this.updateInfo,this);this.ds=undefined;},bind:function(ds){ds.on("beforeload",this.beforeLoad,this);
1372 ds.on("load",this.onLoad,this);ds.on("loadexception",this.onLoadError,this);ds.on("remove",this.updateInfo,this);ds.on("add",this.updateInfo,this);this.ds=ds;}});
1373 // Roo/bootstrap/MessageBar.js
1374 Roo.bootstrap.MessageBar=function(A){Roo.bootstrap.MessageBar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.MessageBar,Roo.bootstrap.Component,{html:'',weight:'info',closable:false,fixed:false,beforeClass:'bootstrap-sticky-wrap',getAutoCreate:function(){var A={tag:'div',cls:'alert alert-dismissable alert-'+this.weight,cn:[{tag:'span',cls:'message',html:this.html||''}
1375 ]};if(this.fixed){A.cls+=' alert-messages-fixed';}if(this.closable){A.cn.push({tag:'button',cls:'close',html:'x'});}return A;},onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A);if(!this.el){var B=Roo.apply({},this.getAutoCreate());
1376 B.id=Roo.id();if(this.cls){B.cls+=' '+this.cls;}if(this.style){B.style=this.style;}this.el=Roo.get(document.body).createChild(B,Roo.select('.'+this.beforeClass,true).first());this.el.setVisibilityMode(Roo.Element.DISPLAY);}this.el.select('>button.close').on('click',this.hide,this);
1377 },show:function(){if(!this.rendered){this.render();}this.el.show();this.fireEvent('show',this);},hide:function(){if(!this.rendered){this.render();}this.el.hide();this.fireEvent('hide',this);},update:function(){this.el.select('>.message',true).first().dom.innerHTML=this.html||'';
1378 }});
1379 // Roo/bootstrap/Graph.js
1380 Roo.bootstrap.Graph=function(A){Roo.bootstrap.Graph.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.Graph,Roo.bootstrap.Component,{sm:4,md:5,graphtype:'bar',g_height:250,g_width:400,g_x:50,g_y:50,g_r:30,opts:{g_type:'soft',g_gutter:'20%'}
1381 ,title:false,getAutoCreate:function(){var A={tag:'div',html:null};return A;},onRender:function(ct,A){Roo.bootstrap.Graph.superclass.onRender.call(this,ct,A);if(typeof(Raphael)=='undefined'){Roo.bootstrap.MessageBox.alert("Error","Raphael is not availabe");
1382 return;}this.raphael=Raphael(this.el.dom);},load:function(A,B,C){this.raphael.clear();if(!A){A=this.graphtype;}if(!C){C=this.opts;}var r=this.raphael,D=function(){this.flag=r.popup(this.bar.x,this.bar.y,this.bar.value||"0").insertBefore(this);},E=function(){this.flag.animate({opacity:0}
1383 ,300,function(){this.remove();});},F=function(){this.sector.stop();this.sector.scale(1.1,1.1,this.cx,this.cy);if(this.label){this.label[0].stop();this.label[0].attr({r:7.5});this.label[1].attr({"font-weight":800});}},G=function(){this.sector.animate({transform:'s1 1 '+this.cx+' '+this.cy}
1384 ,500,"bounce");if(this.label){this.label[0].animate({r:5},500,"bounce");this.label[1].attr({"font-weight":400});}};switch(A){case 'bar':this.raphael.barchart(this.g_x,this.g_y,this.g_width,this.g_height,B,C).hover(D,E);break;case 'hbar':this.raphael.hbarchart(this.g_x,this.g_y,this.g_width,this.g_height,B,C).hover(D,E);
1385 break;case 'pie':this.raphael.piechart(this.g_x,this.g_y,this.g_r,B,C).hover(F,G);break;}if(this.title){this.raphael.text(this.title.x,this.title.y,this.title.text).attr(this.title.attr);}},setTitle:function(o){this.title=o;},initEvents:function(){if(!this.href){this.el.on('click',this.onClick,this);
1386 }},onClick:function(e){Roo.log('img onclick');this.fireEvent('click',this,e);}});
1387 // Roo/bootstrap/dash/namespace.js
1388 Roo.bootstrap.dash={};
1389 // Roo/bootstrap/dash/NumberBox.js
1390 Roo.bootstrap.dash=Roo.bootstrap.dash||{};Roo.bootstrap.dash.NumberBox=function(A){Roo.bootstrap.dash.NumberBox.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.dash.NumberBox,Roo.bootstrap.Component,{headline:'',content:'',icon:'',footer:'',fhref:'',ficon:'',getAutoCreate:function(){var A={tag:'div',cls:'small-box ',cn:[{tag:'div',cls:'inner',cn:[{tag:'h3',cls:'roo-headline',html:this.headline}
1391 ,{tag:'p',cls:'roo-content',html:this.content}]}]};if(this.icon){A.cn.push({tag:'div',cls:'icon',cn:[{tag:'i',cls:'ion '+this.icon}]});}if(this.footer){var B={tag:'a',cls:'small-box-footer',href:this.fhref||'#',html:this.footer};A.cn.push(B);}return A;},onRender:function(ct,A){Roo.bootstrap.dash.NumberBox.superclass.onRender.call(this,ct,A);
1392 },setHeadline:function(A){this.el.select('.roo-headline',true).first().dom.innerHTML=A;},setFooter:function(A,B){this.el.select('a.small-box-footer',true).first().dom.innerHTML=A;if(B){this.el.select('a.small-box-footer',true).first().attr('href',B);}},setContent:function(A){this.el.select('.roo-content',true).first().dom.innerHTML=A;
1393 },initEvents:function(){}});
1394 // Roo/bootstrap/dash/TabBox.js
1395 Roo.bootstrap.dash=Roo.bootstrap.dash||{};Roo.bootstrap.dash.TabBox=function(A){Roo.bootstrap.dash.TabBox.superclass.constructor.call(this,A);this.addEvents({"addpane":true,"activatepane":true});this.panes=[];};Roo.extend(Roo.bootstrap.dash.TabBox,Roo.bootstrap.Component,{title:'',icon:false,showtabs:true,tabScrollable:false,getChildContainer:function(){return this.el.select('.tab-content',true).first();
1396 },getAutoCreate:function(){var A={tag:'li',cls:'pull-left header',html:this.title,cn:[]};if(this.icon){A.cn.push({tag:'i',cls:'fa '+this.icon});}var h={tag:'ul',cls:'nav nav-tabs pull-right',cn:[A]};if(this.tabScrollable){h={tag:'div',cls:'tab-header',cn:[{tag:'ul',cls:'nav nav-tabs pull-right',cn:[A]}
1397 ]};}var B={tag:'div',cls:'nav-tabs-custom',cn:[h,{tag:'div',cls:'tab-content no-padding',cn:[]}]};return B;},initEvents:function(){this.on('addpane',this.onAddPane,this);},setTitle:function(A){this.el.select('.nav-tabs .header',true).first().dom.innerHTML=A;
1398 },onAddPane:function(A){this.panes.push(A);if(!this.showtabs){return;}var B=this.el.select('.nav-tabs',true).first();var C=B.select('.nav-tab',true);var D=C.getCount();;var E=B.createChild({tag:'li',cls:'nav-tab'+(D?'':' active'),cn:[{tag:'a',href:'#',html:A.title}
1399 ]},D?C.first().dom:B.select('.header',true).first().dom);A.tab=E;E.on('click',this.onTabClick.createDelegate(this,[A],true));if(!D){A.el.addClass('active');}},onTabClick:function(ev,un,ob,A){ev.preventDefault();this.el.select('.nav-tabs li.nav-tab',true).removeClass('active');
1400 A.tab.addClass('active');this.getChildContainer().select('.tab-pane',true).removeClass('active');this.fireEvent('activatepane',A);A.el.addClass('active');A.fireEvent('activate');},getActivePane:function(){var r=false;Roo.each(this.panes,function(p){if(p.el.hasClass('active')){r=p;
1401 return false;}return;});return r;}});
1402 // Roo/bootstrap/dash/TabPane.js
1403 Roo.bootstrap.dash=Roo.bootstrap.dash||{};Roo.bootstrap.dash.TabPane=function(A){Roo.bootstrap.dash.TabPane.superclass.constructor.call(this,A);this.addEvents({"activate":true});};Roo.extend(Roo.bootstrap.dash.TabPane,Roo.bootstrap.Component,{active:false,title:'',tab:false,getAutoCreate:function(){var A={tag:'div',cls:'tab-pane'}
1404 ;if(this.active){A.cls+=' active';}return A;},initEvents:function(){this.parent().fireEvent('addpane',this)},setTitle:function(A){if(!this.tab){return;}this.title=A;this.tab.select('a',true).first().dom.innerHTML=A;}});
1405 // Roo/bootstrap/Tooltip.js
1406 Roo.bootstrap.Tooltip=function(A){Roo.bootstrap.Tooltip.superclass.constructor.call(this,A);this.alignment=Roo.bootstrap.Tooltip.alignment;if(typeof(A)!='undefined'&&typeof(A.alignment)!='undefined'){this.alignment=A.alignment;}};Roo.apply(Roo.bootstrap.Tooltip,{currentEl:false,currentTip:false,currentRegion:false,init:function(){Roo.get(document).on('mouseover',this.enter,this);
1407 Roo.get(document).on('mouseout',this.leave,this);this.currentTip=new Roo.bootstrap.Tooltip();},enter:function(ev){var A=ev.getTarget();var el=Roo.fly(A);if(this.currentEl){if(this.currentEl==el){return;}if(A!=this.currentEl.dom&&this.currentEl.contains(A)){return;
1408 }}if(this.currentTip.el){this.currentTip.el.setVisibilityMode(Roo.Element.DISPLAY).hide();}if(!el||el.dom==document){return;}var B=el;var C=false;if(!el.attr('tooltip')){C=el.findParent("[tooltip]");if(C){B=Roo.get(C);}}if(!C&&!el.attr('tooltip')){if(!el.select("[tooltip]").elements.length){return;
1409 }B=el.select("[tooltip]").first();var xy=ev.getXY();if(!B.getRegion().contains({top:xy[1],right:xy[0],bottom:xy[1],left:xy[0]})){return;}}this.currentEl=el;this.currentTip.bind(B);this.currentRegion=Roo.lib.Region.getRegion(A);this.currentTip.enter();},leave:function(ev){var A=ev.getTarget();
1410 if(!this.currentEl){return;}if(A!=this.currentEl.dom){return;}var xy=ev.getXY();if(this.currentRegion.contains(new Roo.lib.Region(xy[1],xy[0],xy[1],xy[0]))){return;}if(this.currentTip){this.currentTip.leave();}this.currentEl=false;},alignment:{'left':['r-l',[-2,0],'right'],'right':['l-r',[2,0],'left'],'bottom':['t-b',[0,2],'top'],'top':['b-t',[0,-2],'bottom']}
1411 });Roo.extend(Roo.bootstrap.Tooltip,Roo.bootstrap.Component,{bindEl:false,delay:null,timeout:null,hoverState:null,placement:'bottom',alignment:false,getAutoCreate:function(){var A={cls:'tooltip',role:'tooltip',cn:[{cls:'tooltip-arrow arrow'},{cls:'tooltip-inner'}
1412 ]};return A;},bind:function(el){this.bindEl=el;},initEvents:function(){this.arrowEl=this.el.select('.arrow',true).first();this.innerEl=this.el.select('.tooltip-inner',true).first();},enter:function(){if(this.timeout!=null){clearTimeout(this.timeout);}this.hoverState='in';
1413 if(!this.delay||!this.delay.show){this.show();return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='in'){_t.show();}},this.delay.show);},leave:function(){clearTimeout(this.timeout);this.hoverState='out';if(!this.delay||!this.delay.hide){this.hide();
1414 return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='out'){_t.hide();Roo.bootstrap.Tooltip.currentEl=false;}},delay);},show:function(A){if(!this.el){this.render(document.body);}var B=A||this.bindEl.attr('tooltip')||this.bindEl.select("[tooltip]").first().attr('tooltip');
1415 this.el.select('.tooltip-inner',true).first().dom.innerHTML=B;this.el.removeClass(['fade','top','bottom','left','right','in','bs-tooltip-top','bs-tooltip-bottom','bs-tooltip-left','bs-tooltip-right']);var C=typeof this.placement=='function'?this.placement.call(this,this.el,on_el):this.placement;
1416 var D=/\s?auto?\s?/i;var E=D.test(C);if(E){C=C.replace(D,'')||'top';}this.el.show();var p=this.getPosition();var F=this.el.getBox();if(E){}var G=this.alignment[C];var xy=this.el.getAlignToXY(this.bindEl,G[0],G[1]);if(C=='top'||C=='bottom'){if(xy[0]<0){C='right';
1417 }if(xy[0]+this.el.getWidth()>Roo.lib.Dom.getViewWidth()){C='left';}var H=Roo.select('body',true).first().getScroll();if(xy[1]>Roo.lib.Dom.getViewHeight()+H.top-this.el.getHeight()){C='top';}G=this.alignment[C];this.arrowEl.setLeft((this.innerEl.getWidth()/2)-5);
1418 }var I=document.getElementsByTagName('div');var J=Number.MIN_SAFE_INTEGER||-(Math.pow(2,53)-1);for(var i=0;i<I.length;i++){var K=Number.parseInt(document.defaultView.getComputedStyle(I[i],null).getPropertyValue("z-index"),10);if(K>J){J=K;}}this.el.dom.style.zIndex=J;
1419 this.el.alignTo(this.bindEl,G[0],G[1]);this.el.addClass(C);this.el.addClass("bs-tooltip-"+C);this.el.addClass('in fade show');this.hoverState=null;if(this.el.hasClass('fade')){}},hide:function(){if(!this.el){return;}this.el.removeClass(['show','in']);}});
1420
1421 // Roo/bootstrap/LocationPicker.js
1422 Roo.bootstrap.LocationPicker=function(A){Roo.bootstrap.LocationPicker.superclass.constructor.call(this,A);this.addEvents({initial:true,positionchanged:true,resize:true,show:true,hide:true,mapClick:true,mapRightClick:true,markerClick:true,markerRightClick:true,OverlayViewDraw:true,OverlayViewOnAdd:true,OverlayViewOnRemove:true,OverlayViewShow:true,OverlayViewHide:true,loadexception:true}
1423 );};Roo.extend(Roo.bootstrap.LocationPicker,Roo.bootstrap.Component,{gMapContext:false,latitude:0,longitude:0,zoom:15,mapTypeId:false,mapTypeControl:false,disableDoubleClickZoom:false,scrollwheel:true,streetViewControl:false,radius:0,locationName:'',draggable:true,enableAutocomplete:false,enableReverseGeocode:true,markerTitle:'',getAutoCreate:function(){var A={tag:'div',cls:'roo-location-picker'}
1424 ;return A},initEvents:function(ct,A){if(!this.el.getWidth()||this.isApplied()){return;}this.el.setVisibilityMode(Roo.Element.DISPLAY);this.initial();},initial:function(){if(typeof(google)=='undefined'||typeof(google.maps)=='undefined'){this.fireEvent('loadexception',this);
1425 return;}if(!this.mapTypeId){this.mapTypeId=google.maps.MapTypeId.ROADMAP;}this.gMapContext=this.GMapContext();this.initOverlayView();this.OverlayView=new Roo.bootstrap.LocationPicker.OverlayView(this.gMapContext.map);var A=this;google.maps.event.addListener(this.gMapContext.marker,"dragend",function(B){A.setPosition(A.gMapContext.marker.position);
1426 });google.maps.event.addListener(this.gMapContext.map,'click',function(B){A.fireEvent('mapClick',this,B);});google.maps.event.addListener(this.gMapContext.map,'rightclick',function(B){A.fireEvent('mapRightClick',this,B);});google.maps.event.addListener(this.gMapContext.marker,'click',function(B){A.fireEvent('markerClick',this,B);
1427 });google.maps.event.addListener(this.gMapContext.marker,'rightclick',function(B){A.fireEvent('markerRightClick',this,B);});this.setPosition(this.gMapContext.location);this.fireEvent('initial',this,this.gMapContext.location);},initOverlayView:function(){var A=this;
1428 Roo.bootstrap.LocationPicker.OverlayView.prototype=Roo.apply(new google.maps.OverlayView(),{draw:function(){A.fireEvent('OverlayViewDraw',A);},onAdd:function(){A.fireEvent('OverlayViewOnAdd',A);},onRemove:function(){A.fireEvent('OverlayViewOnRemove',A);},show:function(B){A.fireEvent('OverlayViewShow',A,B);
1429 },hide:function(){A.fireEvent('OverlayViewHide',A);}});},fromLatLngToContainerPixel:function(A){return this.OverlayView.getProjection().fromLatLngToContainerPixel(A.latLng);},isApplied:function(){return this.getGmapContext()==false?false:true;},getGmapContext:function(){return (typeof(this.gMapContext)=='undefined')?false:this.gMapContext;
1430 },GMapContext:function(){var A=new google.maps.LatLng(this.latitude,this.longitude);var B=new google.maps.Map(this.el.dom,{center:A,zoom:this.zoom,mapTypeId:this.mapTypeId,mapTypeControl:this.mapTypeControl,disableDoubleClickZoom:this.disableDoubleClickZoom,scrollwheel:this.scrollwheel,streetViewControl:this.streetViewControl,locationName:this.locationName,draggable:this.draggable,enableAutocomplete:this.enableAutocomplete,enableReverseGeocode:this.enableReverseGeocode}
1431 );var C=new google.maps.Marker({position:A,map:B,title:this.markerTitle,draggable:this.draggable});return {map:B,marker:C,circle:null,location:A,radius:this.radius,locationName:this.locationName,addressComponents:{formatted_address:null,addressLine1:null,addressLine2:null,streetName:null,streetNumber:null,city:null,district:null,state:null,stateOrProvince:null}
1432 ,settings:this,domContainer:this.el.dom,geodecoder:new google.maps.Geocoder()};},drawCircle:function(A,B,C){if(this.gMapContext.circle!=null){this.gMapContext.circle.setMap(null);}if(B>0){B*=1;C=Roo.apply({},C,{strokeColor:"#0000FF",strokeOpacity:.35,strokeWeight:2,fillColor:"#0000FF",fillOpacity:.2}
1433 );C.map=this.gMapContext.map;C.radius=B;C.center=A;this.gMapContext.circle=new google.maps.Circle(C);return this.gMapContext.circle;}return null;},setPosition:function(A){this.gMapContext.location=A;this.gMapContext.marker.setPosition(A);this.gMapContext.map.panTo(A);
1434 this.drawCircle(A,this.gMapContext.radius,{});var B=this;if(this.gMapContext.settings.enableReverseGeocode){this.gMapContext.geodecoder.geocode({latLng:this.gMapContext.location},function(C,D){if(D==google.maps.GeocoderStatus.OK&&C.length>0){B.gMapContext.locationName=C[0].formatted_address;
1435 B.gMapContext.addressComponents=B.address_component_from_google_geocode(C[0].address_components);B.fireEvent('positionchanged',this,A);}});return;}this.fireEvent('positionchanged',this,A);},resize:function(){google.maps.event.trigger(this.gMapContext.map,"resize");
1436 this.gMapContext.map.setCenter(this.gMapContext.marker.position);this.fireEvent('resize',this);},setPositionByLatLng:function(A,B){this.setPosition(new google.maps.LatLng(A,B));},getCurrentPosition:function(){return {latitude:this.gMapContext.location.lat(),longitude:this.gMapContext.location.lng()}
1437 ;},getAddressName:function(){return this.gMapContext.locationName;},getAddressComponents:function(){return this.gMapContext.addressComponents;},address_component_from_google_geocode:function(A){var B={};for(var i=0;i<A.length;i++){var C=A[i];if(C.types.indexOf("postal_code")>=0){B.postalCode=C.short_name;
1438 }else if(C.types.indexOf("street_number")>=0){B.streetNumber=C.short_name;}else if(C.types.indexOf("route")>=0){B.streetName=C.short_name;}else if(C.types.indexOf("neighborhood")>=0){B.city=C.short_name;}else if(C.types.indexOf("locality")>=0){B.city=C.short_name;
1439 }else if(C.types.indexOf("sublocality")>=0){B.district=C.short_name;}else if(C.types.indexOf("administrative_area_level_1")>=0){B.stateOrProvince=C.short_name;}else if(C.types.indexOf("country")>=0){B.country=C.short_name;}}B.addressLine1=[B.streetNumber,B.streetName].join(" ").trim();
1440 B.addressLine2="";return B;},setZoomLevel:function(A){this.gMapContext.map.setZoom(A);},show:function(){if(!this.el){return;}this.el.show();this.resize();this.fireEvent('show',this);},hide:function(){if(!this.el){return;}this.el.hide();this.fireEvent('hide',this);
1441 }});Roo.apply(Roo.bootstrap.LocationPicker,{OverlayView:function(A,B){B=B||{};this.setMap(A);}});
1442 // Roo/bootstrap/Alert.js
1443 Roo.bootstrap.Alert=function(A){Roo.bootstrap.Alert.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Alert,Roo.bootstrap.Component,{title:'',html:'',weight:false,fa:false,faicon:false,close:false,getAutoCreate:function(){var A={tag:'div',cls:'alert',cn:[{tag:'button',type:"button",cls:"close",html:'×',style:this.close?'':'display:none'}
1444 ,{tag:'i',cls:'roo-alert-icon'},{tag:'b',cls:'roo-alert-title',html:this.title},{tag:'span',cls:'roo-alert-text',html:this.html}]};if(this.faicon){A.cn[0].cls+=' fa '+this.faicon;}if(this.fa){A.cn[0].cls+=' fa '+this.fa;}if(this.weight){A.cls+=' alert-'+this.weight;
1445 }return A;},initEvents:function(){this.el.setVisibilityMode(Roo.Element.DISPLAY);this.titleEl=this.el.select('.roo-alert-title',true).first();this.iconEl=this.el.select('.roo-alert-icon',true).first();this.htmlEl=this.el.select('.roo-alert-text',true).first();
1446 if(this.seconds>0){this.hide.defer(this.seconds,this);}},setTitle:function(A){this.titleEl.dom.innerHTML=A;},setHtml:function(A){this.htmlEl.dom.innerHTML=A;},setWeight:function(A){if(this.weight){this.el.removeClass('alert-'+this.weight);}this.weight=A;this.el.addClass('alert-'+this.weight);
1447 },setIcon:function(A){if(this.faicon){this.alertEl.removeClass(['fa','fa-'+this.faicon]);}this.faicon=A;this.alertEl.addClass(['fa','fa-'+this.faicon]);},hide:function(){this.el.hide();},show:function(){this.el.show();}});
1448 // Roo/bootstrap/UploadCropbox.js
1449 Roo.bootstrap.UploadCropbox=function(A){Roo.bootstrap.UploadCropbox.superclass.constructor.call(this,A);this.addEvents({"beforeselectfile":true,"initial":true,"crop":true,"prepare":true,"exception":true,"beforeloadcanvas":true,"trash":true,"download":true,"footerbuttonclick":true,"resize":true,"rotate":true,"inspect":true,"upload":true,"arrange":true}
1450 );this.buttons=this.buttons||Roo.bootstrap.UploadCropbox.footer.STANDARD;};Roo.extend(Roo.bootstrap.UploadCropbox,Roo.bootstrap.Component,{emptyText:'Click to upload image',rotateNotify:'Image is too small to rotate',errorTimeout:3000,scale:0,baseScale:1,rotate:0,dragable:false,pinching:false,mouseX:0,mouseY:0,cropData:false,minWidth:300,minHeight:300,file:false,exif:{}
1451 ,baseRotate:1,cropType:'image/jpeg',buttons:false,canvasLoaded:false,isDocument:false,method:'POST',paramName:'imageUpload',loadMask:true,loadingText:'Loading...',maskEl:false,getAutoCreate:function(){var A={tag:'div',cls:'roo-upload-cropbox',cn:[{tag:'input',cls:'roo-upload-cropbox-selector',type:'file'}
1452 ,{tag:'div',cls:'roo-upload-cropbox-body',style:'cursor:pointer',cn:[{tag:'div',cls:'roo-upload-cropbox-preview'},{tag:'div',cls:'roo-upload-cropbox-thumb'},{tag:'div',cls:'roo-upload-cropbox-empty-notify',html:this.emptyText},{tag:'div',cls:'roo-upload-cropbox-error-notify alert alert-danger',html:this.rotateNotify}
1453 ]},{tag:'div',cls:'roo-upload-cropbox-footer',cn:{tag:'div',cls:'btn-group btn-group-justified roo-upload-cropbox-btn-group',cn:[]}}]};return A;},onRender:function(ct,A){Roo.bootstrap.UploadCropbox.superclass.onRender.call(this,ct,A);if(this.buttons.length){Roo.each(this.buttons,function(bb){var B=this.el.select('.roo-upload-cropbox-footer div.roo-upload-cropbox-btn-group').first().createChild(bb);
1454 B.on('click',this.onFooterButtonClick.createDelegate(this,[bb.action],true));},this);}if(this.loadMask){this.maskEl=this.el;}},initEvents:function(){this.urlAPI=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);
1455 this.bodyEl=this.el.select('.roo-upload-cropbox-body',true).first();this.bodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.selectorEl=this.el.select('.roo-upload-cropbox-selector',true).first();this.selectorEl.hide();this.previewEl=this.el.select('.roo-upload-cropbox-preview',true).first();
1456 this.previewEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.thumbEl=this.el.select('.roo-upload-cropbox-thumb',true).first();this.thumbEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.thumbEl.hide();this.notifyEl=this.el.select('.roo-upload-cropbox-empty-notify',true).first();
1457 this.notifyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.errorEl=this.el.select('.roo-upload-cropbox-error-notify',true).first();this.errorEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.errorEl.hide();this.footerEl=this.el.select('.roo-upload-cropbox-footer',true).first();
1458 this.footerEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.footerEl.hide();this.setThumbBoxSize();this.bind();this.resize();this.fireEvent('initial',this);},bind:function(){var A=this;window.addEventListener("resize",function(){A.resize();
1459 });this.bodyEl.on('click',this.beforeSelectFile,this);if(Roo.isTouch){this.bodyEl.on('touchstart',this.onTouchStart,this);this.bodyEl.on('touchmove',this.onTouchMove,this);this.bodyEl.on('touchend',this.onTouchEnd,this);}if(!Roo.isTouch){this.bodyEl.on('mousedown',this.onMouseDown,this);
1460 this.bodyEl.on('mousemove',this.onMouseMove,this);var B=(/Firefox/i.test(navigator.userAgent))?'DOMMouseScroll':'mousewheel';this.bodyEl.on(B,this.onMouseWheel,this);Roo.get(document).on('mouseup',this.onMouseUp,this);}this.selectorEl.on('change',this.onFileSelected,this);
1461 },reset:function(){this.scale=0;this.baseScale=1;this.rotate=0;this.baseRotate=1;this.dragable=false;this.pinching=false;this.mouseX=0;this.mouseY=0;this.cropData=false;this.notifyEl.dom.innerHTML=this.emptyText;this.selectorEl.dom.value='';},resize:function(){if(this.fireEvent('resize',this)!=false){this.setThumbBoxPosition();
1462 this.setCanvasPosition();}},onFooterButtonClick:function(e,el,o,A){switch(A){case 'rotate-left':this.onRotateLeft(e);break;case 'rotate-right':this.onRotateRight(e);break;case 'picture':this.beforeSelectFile(e);break;case 'trash':this.trash(e);break;case 'crop':this.crop(e);
1463 break;case 'download':this.download(e);break;default:break;}this.fireEvent('footerbuttonclick',this,A);},beforeSelectFile:function(e){e.preventDefault();if(this.fireEvent('beforeselectfile',this)!=false){this.selectorEl.dom.click();}},onFileSelected:function(e){e.preventDefault();
1464 if(typeof(this.selectorEl.dom.files)=='undefined'||!this.selectorEl.dom.files.length){return;}var A=this.selectorEl.dom.files[0];if(this.fireEvent('inspect',this,A)!=false){this.prepare(A);}},trash:function(e){this.fireEvent('trash',this);},download:function(e){this.fireEvent('download',this);
1465 },loadCanvas:function(A){if(this.fireEvent('beforeloadcanvas',this,A)!=false){this.reset();this.imageEl=document.createElement('img');var B=this;this.imageEl.addEventListener("load",function(){B.onLoadCanvas();});this.imageEl.src=A;}},onLoadCanvas:function(){this.imageEl.OriginWidth=this.imageEl.naturalWidth||this.imageEl.width;
1466 this.imageEl.OriginHeight=this.imageEl.naturalHeight||this.imageEl.height;this.bodyEl.un('click',this.beforeSelectFile,this);this.notifyEl.hide();this.thumbEl.show();this.footerEl.show();this.baseRotateLevel();if(this.isDocument){this.setThumbBoxSize();}this.setThumbBoxPosition();
1467 this.baseScaleLevel();this.draw();this.resize();this.canvasLoaded=true;if(this.loadMask){this.maskEl.unmask();}},setCanvasPosition:function(){if(!this.canvasEl){return;}var pw=Math.ceil((this.bodyEl.getWidth()-this.canvasEl.width)/2);var ph=Math.ceil((this.bodyEl.getHeight()-this.canvasEl.height)/2);
1468 this.previewEl.setLeft(pw);this.previewEl.setTop(ph);},onMouseDown:function(e){e.stopEvent();this.dragable=true;this.pinching=false;if(this.isDocument&&(this.canvasEl.width<this.thumbEl.getWidth()||this.canvasEl.height<this.thumbEl.getHeight())){this.dragable=false;
1469 return;}this.mouseX=Roo.isTouch?e.browserEvent.touches[0].pageX:e.getPageX();this.mouseY=Roo.isTouch?e.browserEvent.touches[0].pageY:e.getPageY();},onMouseMove:function(e){e.stopEvent();if(!this.canvasLoaded){return;}if(!this.dragable){return;}var A=Math.ceil(this.thumbEl.getLeft(true));
1470 var B=Math.ceil(this.thumbEl.getTop(true));var C=Math.ceil(A+this.thumbEl.getWidth()-this.canvasEl.width);var D=Math.ceil(B+this.thumbEl.getHeight()-this.canvasEl.height);var x=Roo.isTouch?e.browserEvent.touches[0].pageX:e.getPageX();var y=Roo.isTouch?e.browserEvent.touches[0].pageY:e.getPageY();
1471 x=x-this.mouseX;y=y-this.mouseY;var E=Math.ceil(x+this.previewEl.getLeft(true));var F=Math.ceil(y+this.previewEl.getTop(true));E=(A<E)?A:((C>E)?C:E);F=(B<F)?B:((D>F)?D:F);this.previewEl.setLeft(E);this.previewEl.setTop(F);this.mouseX=Roo.isTouch?e.browserEvent.touches[0].pageX:e.getPageX();
1472 this.mouseY=Roo.isTouch?e.browserEvent.touches[0].pageY:e.getPageY();},onMouseUp:function(e){e.stopEvent();this.dragable=false;},onMouseWheel:function(e){e.stopEvent();this.startScale=this.scale;this.scale=(e.getWheelDelta()==1)?(this.scale+1):(this.scale-1);
1473 if(!this.zoomable()){this.scale=this.startScale;return;}this.draw();return;},zoomable:function(){var A=this.thumbEl.getWidth()/this.minWidth;if(this.minWidth<this.minHeight){A=this.thumbEl.getHeight()/this.minHeight;}var B=Math.ceil(this.imageEl.OriginWidth*this.getScaleLevel()/A);
1474 var C=Math.ceil(this.imageEl.OriginHeight*this.getScaleLevel()/A);if(this.isDocument&&(this.rotate==0||this.rotate==180)&&(B>this.imageEl.OriginWidth||C>this.imageEl.OriginHeight||(B<this.minWidth&&C<this.minHeight))){return false;}if(this.isDocument&&(this.rotate==90||this.rotate==270)&&(B>this.imageEl.OriginWidth||C>this.imageEl.OriginHeight||(B<this.minHeight&&C<this.minWidth))){return false;
1475 }if(!this.isDocument&&(this.rotate==0||this.rotate==180)&&(B<this.minWidth||B>this.imageEl.OriginWidth||C<this.minHeight||C>this.imageEl.OriginHeight)){return false;}if(!this.isDocument&&(this.rotate==90||this.rotate==270)&&(B<this.minHeight||B>this.imageEl.OriginWidth||C<this.minWidth||C>this.imageEl.OriginHeight)){return false;
1476 }return true;},onRotateLeft:function(e){if(!this.isDocument&&(this.canvasEl.height<this.thumbEl.getWidth()||this.canvasEl.width<this.thumbEl.getHeight())){var A=this.thumbEl.getWidth()/this.minWidth;var bw=Math.ceil(this.canvasEl.width/this.getScaleLevel());
1477 var bh=Math.ceil(this.canvasEl.height/this.getScaleLevel());this.startScale=this.scale;while(this.getScaleLevel()<A){this.scale=this.scale+1;if(!this.zoomable()){break;}if(Math.ceil(bw*this.getScaleLevel())<this.thumbEl.getHeight()||Math.ceil(bh*this.getScaleLevel())<this.thumbEl.getWidth()){continue;
1478 }this.rotate=(this.rotate<90)?270:this.rotate-90;this.draw();return;}this.scale=this.startScale;this.onRotateFail();return false;}this.rotate=(this.rotate<90)?270:this.rotate-90;if(this.isDocument){this.setThumbBoxSize();this.setThumbBoxPosition();this.setCanvasPosition();
1479 }this.draw();this.fireEvent('rotate',this,'left');},onRotateRight:function(e){if(!this.isDocument&&(this.canvasEl.height<this.thumbEl.getWidth()||this.canvasEl.width<this.thumbEl.getHeight())){var A=this.thumbEl.getWidth()/this.minWidth;var bw=Math.ceil(this.canvasEl.width/this.getScaleLevel());
1480 var bh=Math.ceil(this.canvasEl.height/this.getScaleLevel());this.startScale=this.scale;while(this.getScaleLevel()<A){this.scale=this.scale+1;if(!this.zoomable()){break;}if(Math.ceil(bw*this.getScaleLevel())<this.thumbEl.getHeight()||Math.ceil(bh*this.getScaleLevel())<this.thumbEl.getWidth()){continue;
1481 }this.rotate=(this.rotate>180)?0:this.rotate+90;this.draw();return;}this.scale=this.startScale;this.onRotateFail();return false;}this.rotate=(this.rotate>180)?0:this.rotate+90;if(this.isDocument){this.setThumbBoxSize();this.setThumbBoxPosition();this.setCanvasPosition();
1482 }this.draw();this.fireEvent('rotate',this,'right');},onRotateFail:function(){this.errorEl.show(true);var A=this;(function(){A.errorEl.hide(true);}).defer(this.errorTimeout);},draw:function(){this.previewEl.dom.innerHTML='';var A=document.createElement("canvas");
1483 var B=A.getContext("2d");A.width=this.imageEl.OriginWidth*this.getScaleLevel();A.height=this.imageEl.OriginWidth*this.getScaleLevel();var C=this.imageEl.OriginWidth/2;if(this.imageEl.OriginWidth<this.imageEl.OriginHeight){A.width=this.imageEl.OriginHeight*this.getScaleLevel();
1484 A.height=this.imageEl.OriginHeight*this.getScaleLevel();C=this.imageEl.OriginHeight/2;}B.scale(this.getScaleLevel(),this.getScaleLevel());B.translate(C,C);B.rotate(this.rotate*Math.PI/180);B.drawImage(this.imageEl,0,0,this.imageEl.OriginWidth,this.imageEl.OriginHeight,C*-1,C*-1,this.imageEl.OriginWidth,this.imageEl.OriginHeight);
1485 this.canvasEl=document.createElement("canvas");this.contextEl=this.canvasEl.getContext("2d");switch(this.rotate){case 0:this.canvasEl.width=this.imageEl.OriginWidth*this.getScaleLevel();this.canvasEl.height=this.imageEl.OriginHeight*this.getScaleLevel();this.contextEl.drawImage(A,0,0,this.canvasEl.width,this.canvasEl.height,0,0,this.canvasEl.width,this.canvasEl.height);
1486 break;case 90:this.canvasEl.width=this.imageEl.OriginHeight*this.getScaleLevel();this.canvasEl.height=this.imageEl.OriginWidth*this.getScaleLevel();if(this.imageEl.OriginWidth>this.imageEl.OriginHeight){this.contextEl.drawImage(A,Math.abs(this.canvasEl.width-this.canvasEl.height),0,this.canvasEl.width,this.canvasEl.height,0,0,this.canvasEl.width,this.canvasEl.height);
1487 break;}this.contextEl.drawImage(A,0,0,this.canvasEl.width,this.canvasEl.height,0,0,this.canvasEl.width,this.canvasEl.height);break;case 180:this.canvasEl.width=this.imageEl.OriginWidth*this.getScaleLevel();this.canvasEl.height=this.imageEl.OriginHeight*this.getScaleLevel();
1488 if(this.imageEl.OriginWidth>this.imageEl.OriginHeight){this.contextEl.drawImage(A,0,Math.abs(this.canvasEl.width-this.canvasEl.height),this.canvasEl.width,this.canvasEl.height,0,0,this.canvasEl.width,this.canvasEl.height);break;}this.contextEl.drawImage(A,Math.abs(this.canvasEl.width-this.canvasEl.height),0,this.canvasEl.width,this.canvasEl.height,0,0,this.canvasEl.width,this.canvasEl.height);
1489 break;case 270:this.canvasEl.width=this.imageEl.OriginHeight*this.getScaleLevel();this.canvasEl.height=this.imageEl.OriginWidth*this.getScaleLevel();if(this.imageEl.OriginWidth>this.imageEl.OriginHeight){this.contextEl.drawImage(A,0,0,this.canvasEl.width,this.canvasEl.height,0,0,this.canvasEl.width,this.canvasEl.height);
1490 break;}this.contextEl.drawImage(A,0,Math.abs(this.canvasEl.width-this.canvasEl.height),this.canvasEl.width,this.canvasEl.height,0,0,this.canvasEl.width,this.canvasEl.height);break;default:break;}this.previewEl.appendChild(this.canvasEl);this.setCanvasPosition();
1491 },crop:function(){if(!this.canvasLoaded){return;}var A=document.createElement("canvas");var B=A.getContext("2d");A.width=(this.imageEl.OriginWidth>this.imageEl.OriginHeight)?this.imageEl.OriginWidth:this.imageEl.OriginHeight;A.height=(this.imageEl.OriginWidth>this.imageEl.OriginHeight)?this.imageEl.OriginWidth:this.imageEl.OriginHeight;
1492 var C=A.width/2;B.translate(C,C);B.rotate(this.rotate*Math.PI/180);B.drawImage(this.imageEl,0,0,this.imageEl.OriginWidth,this.imageEl.OriginHeight,C*-1,C*-1,this.imageEl.OriginWidth,this.imageEl.OriginHeight);var D=document.createElement("canvas");var E=D.getContext("2d");
1493 D.width=this.minWidth;D.height=this.minHeight;switch(this.rotate){case 0:var F=(this.thumbEl.getWidth()/this.getScaleLevel()>this.imageEl.OriginWidth)?this.imageEl.OriginWidth:(this.thumbEl.getWidth()/this.getScaleLevel());var G=(this.thumbEl.getHeight()/this.getScaleLevel()>this.imageEl.OriginHeight)?this.imageEl.OriginHeight:(this.thumbEl.getHeight()/this.getScaleLevel());
1494 var x=(this.thumbEl.getLeft(true)>this.previewEl.getLeft(true))?0:((this.previewEl.getLeft(true)-this.thumbEl.getLeft(true))/this.getScaleLevel());var y=(this.thumbEl.getTop(true)>this.previewEl.getTop(true))?0:((this.previewEl.getTop(true)-this.thumbEl.getTop(true))/this.getScaleLevel());
1495 var H=this.minWidth-2*x;var I=this.minHeight-2*y;var J=1;if((x==0&&y==0)||(x==0&&y>0)){J=H/F;}if(x>0&&y==0){J=I/G;}if(x>0&&y>0){J=H/F;if(F<G){J=I/G;}}E.scale(J,J);var sx=Math.min(this.canvasEl.width-this.thumbEl.getWidth(),this.thumbEl.getLeft(true)-this.previewEl.getLeft(true));
1496 var sy=Math.min(this.canvasEl.height-this.thumbEl.getHeight(),this.thumbEl.getTop(true)-this.previewEl.getTop(true));sx=sx<0?0:(sx/this.getScaleLevel());sy=sy<0?0:(sy/this.getScaleLevel());E.drawImage(A,sx,sy,F,G,x,y,F,G);break;case 90:var F=(this.thumbEl.getWidth()/this.getScaleLevel()>this.imageEl.OriginHeight)?this.imageEl.OriginHeight:(this.thumbEl.getWidth()/this.getScaleLevel());
1497 var G=(this.thumbEl.getHeight()/this.getScaleLevel()>this.imageEl.OriginWidth)?this.imageEl.OriginWidth:(this.thumbEl.getHeight()/this.getScaleLevel());var x=(this.thumbEl.getLeft(true)>this.previewEl.getLeft(true))?0:((this.previewEl.getLeft(true)-this.thumbEl.getLeft(true))/this.getScaleLevel());
1498 var y=(this.thumbEl.getTop(true)>this.previewEl.getTop(true))?0:((this.previewEl.getTop(true)-this.thumbEl.getTop(true))/this.getScaleLevel());var H=this.minWidth-2*x;var I=this.minHeight-2*y;var J=1;if((x==0&&y==0)||(x==0&&y>0)){J=H/F;}if(x>0&&y==0){J=I/G;
1499 }if(x>0&&y>0){J=H/F;if(F<G){J=I/G;}}E.scale(J,J);var sx=Math.min(this.canvasEl.width-this.thumbEl.getWidth(),this.thumbEl.getLeft(true)-this.previewEl.getLeft(true));var sy=Math.min(this.canvasEl.height-this.thumbEl.getHeight(),this.thumbEl.getTop(true)-this.previewEl.getTop(true));
1500 sx=sx<0?0:(sx/this.getScaleLevel());sy=sy<0?0:(sy/this.getScaleLevel());sx+=(this.imageEl.OriginWidth>this.imageEl.OriginHeight)?Math.abs(this.imageEl.OriginWidth-this.imageEl.OriginHeight):0;E.drawImage(A,sx,sy,F,G,x,y,F,G);break;case 180:var F=(this.thumbEl.getWidth()/this.getScaleLevel()>this.imageEl.OriginWidth)?this.imageEl.OriginWidth:(this.thumbEl.getWidth()/this.getScaleLevel());
1501 var G=(this.thumbEl.getHeight()/this.getScaleLevel()>this.imageEl.OriginHeight)?this.imageEl.OriginHeight:(this.thumbEl.getHeight()/this.getScaleLevel());var x=(this.thumbEl.getLeft(true)>this.previewEl.getLeft(true))?0:((this.previewEl.getLeft(true)-this.thumbEl.getLeft(true))/this.getScaleLevel());
1502 var y=(this.thumbEl.getTop(true)>this.previewEl.getTop(true))?0:((this.previewEl.getTop(true)-this.thumbEl.getTop(true))/this.getScaleLevel());var H=this.minWidth-2*x;var I=this.minHeight-2*y;var J=1;if((x==0&&y==0)||(x==0&&y>0)){J=H/F;}if(x>0&&y==0){J=I/G;
1503 }if(x>0&&y>0){J=H/F;if(F<G){J=I/G;}}E.scale(J,J);var sx=Math.min(this.canvasEl.width-this.thumbEl.getWidth(),this.thumbEl.getLeft(true)-this.previewEl.getLeft(true));var sy=Math.min(this.canvasEl.height-this.thumbEl.getHeight(),this.thumbEl.getTop(true)-this.previewEl.getTop(true));
1504 sx=sx<0?0:(sx/this.getScaleLevel());sy=sy<0?0:(sy/this.getScaleLevel());sx+=(this.imageEl.OriginWidth>this.imageEl.OriginHeight)?0:Math.abs(this.imageEl.OriginWidth-this.imageEl.OriginHeight);sy+=(this.imageEl.OriginWidth>this.imageEl.OriginHeight)?Math.abs(this.imageEl.OriginWidth-this.imageEl.OriginHeight):0;
1505 E.drawImage(A,sx,sy,F,G,x,y,F,G);break;case 270:var F=(this.thumbEl.getWidth()/this.getScaleLevel()>this.imageEl.OriginHeight)?this.imageEl.OriginHeight:(this.thumbEl.getWidth()/this.getScaleLevel());var G=(this.thumbEl.getHeight()/this.getScaleLevel()>this.imageEl.OriginWidth)?this.imageEl.OriginWidth:(this.thumbEl.getHeight()/this.getScaleLevel());
1506 var x=(this.thumbEl.getLeft(true)>this.previewEl.getLeft(true))?0:((this.previewEl.getLeft(true)-this.thumbEl.getLeft(true))/this.getScaleLevel());var y=(this.thumbEl.getTop(true)>this.previewEl.getTop(true))?0:((this.previewEl.getTop(true)-this.thumbEl.getTop(true))/this.getScaleLevel());
1507 var H=this.minWidth-2*x;var I=this.minHeight-2*y;var J=1;if((x==0&&y==0)||(x==0&&y>0)){J=H/F;}if(x>0&&y==0){J=I/G;}if(x>0&&y>0){J=H/F;if(F<G){J=I/G;}}E.scale(J,J);var sx=Math.min(this.canvasEl.width-this.thumbEl.getWidth(),this.thumbEl.getLeft(true)-this.previewEl.getLeft(true));
1508 var sy=Math.min(this.canvasEl.height-this.thumbEl.getHeight(),this.thumbEl.getTop(true)-this.previewEl.getTop(true));sx=sx<0?0:(sx/this.getScaleLevel());sy=sy<0?0:(sy/this.getScaleLevel());sy+=(this.imageEl.OriginWidth>this.imageEl.OriginHeight)?0:Math.abs(this.imageEl.OriginWidth-this.imageEl.OriginHeight);
1509 E.drawImage(A,sx,sy,F,G,x,y,F,G);break;default:break;}this.cropData=D.toDataURL(this.cropType);if(this.fireEvent('crop',this,this.cropData)!==false){this.process(this.file,this.cropData);}return;},setThumbBoxSize:function(){var A,B;if(this.isDocument&&typeof(this.imageEl)!='undefined'){A=(this.imageEl.OriginWidth>this.imageEl.OriginHeight)?Math.max(this.minWidth,this.minHeight):Math.min(this.minWidth,this.minHeight);
1510 B=(this.imageEl.OriginWidth>this.imageEl.OriginHeight)?Math.min(this.minWidth,this.minHeight):Math.max(this.minWidth,this.minHeight);this.minWidth=A;this.minHeight=B;if(this.rotate==90||this.rotate==270){this.minWidth=B;this.minHeight=A;}}B=300;A=Math.ceil(this.minWidth*B/this.minHeight);
1511 if(this.minWidth>this.minHeight){A=300;B=Math.ceil(this.minHeight*A/this.minWidth);}this.thumbEl.setStyle({width:A+'px',height:B+'px'});return;},setThumbBoxPosition:function(){var x=Math.ceil((this.bodyEl.getWidth()-this.thumbEl.getWidth())/2);var y=Math.ceil((this.bodyEl.getHeight()-this.thumbEl.getHeight())/2);
1512 this.thumbEl.setLeft(x);this.thumbEl.setTop(y);},baseRotateLevel:function(){this.baseRotate=1;if(typeof(this.exif)!='undefined'&&typeof(this.exif[Roo.bootstrap.UploadCropbox['tags']['Orientation']])!='undefined'&&[1,3,6,8].indexOf(this.exif[Roo.bootstrap.UploadCropbox['tags']['Orientation']])!=-1){this.baseRotate=this.exif[Roo.bootstrap.UploadCropbox['tags']['Orientation']];
1513 }this.rotate=Roo.bootstrap.UploadCropbox['Orientation'][this.baseRotate];},baseScaleLevel:function(){var A,B;if(this.isDocument){if(this.baseRotate==6||this.baseRotate==8){B=this.thumbEl.getHeight();this.baseScale=B/this.imageEl.OriginWidth;if(this.imageEl.OriginHeight*this.baseScale>this.thumbEl.getWidth()){A=this.thumbEl.getWidth();
1514 this.baseScale=A/this.imageEl.OriginHeight;}return;}B=this.thumbEl.getHeight();this.baseScale=B/this.imageEl.OriginHeight;if(this.imageEl.OriginWidth*this.baseScale>this.thumbEl.getWidth()){A=this.thumbEl.getWidth();this.baseScale=A/this.imageEl.OriginWidth;
1515 }return;}if(this.baseRotate==6||this.baseRotate==8){A=this.thumbEl.getHeight();this.baseScale=A/this.imageEl.OriginHeight;if(this.imageEl.OriginHeight*this.baseScale<this.thumbEl.getWidth()){B=this.thumbEl.getWidth();this.baseScale=B/this.imageEl.OriginHeight;
1516 }if(this.imageEl.OriginWidth>this.imageEl.OriginHeight){B=this.thumbEl.getWidth();this.baseScale=B/this.imageEl.OriginHeight;if(this.imageEl.OriginWidth*this.baseScale<this.thumbEl.getHeight()){A=this.thumbEl.getHeight();this.baseScale=A/this.imageEl.OriginWidth;
1517 }}return;}A=this.thumbEl.getWidth();this.baseScale=A/this.imageEl.OriginWidth;if(this.imageEl.OriginHeight*this.baseScale<this.thumbEl.getHeight()){B=this.thumbEl.getHeight();this.baseScale=B/this.imageEl.OriginHeight;}if(this.imageEl.OriginWidth>this.imageEl.OriginHeight){B=this.thumbEl.getHeight();
1518 this.baseScale=B/this.imageEl.OriginHeight;if(this.imageEl.OriginWidth*this.baseScale<this.thumbEl.getWidth()){A=this.thumbEl.getWidth();this.baseScale=A/this.imageEl.OriginWidth;}}return;},getScaleLevel:function(){return this.baseScale*Math.pow(1.1,this.scale);
1519 },onTouchStart:function(e){if(!this.canvasLoaded){this.beforeSelectFile(e);return;}var A=e.browserEvent.touches;if(!A){return;}if(A.length==1){this.onMouseDown(e);return;}if(A.length!=2){return;}var B=[];for(var i=0,C;C=A[i];i++){B.push(C.pageX,C.pageY);}
1520 var x=Math.pow(B[0]-B[2],2);var y=Math.pow(B[1]-B[3],2);this.startDistance=Math.sqrt(x+y);this.startScale=this.scale;this.pinching=true;this.dragable=false;},onTouchMove:function(e){if(!this.pinching&&!this.dragable){return;}var A=e.browserEvent.touches;if(!A){return;
1521 }if(this.dragable){this.onMouseMove(e);return;}var B=[];for(var i=0,C;C=A[i];i++){B.push(C.pageX,C.pageY);}var x=Math.pow(B[0]-B[2],2);var y=Math.pow(B[1]-B[3],2);this.endDistance=Math.sqrt(x+y);this.scale=this.startScale+Math.floor(Math.log(this.endDistance/this.startDistance)/Math.log(1.1));
1522 if(!this.zoomable()){this.scale=this.startScale;return;}this.draw();},onTouchEnd:function(e){this.pinching=false;this.dragable=false;},process:function(A,B){if(this.loadMask){this.maskEl.mask(this.loadingText);}this.xhr=new XMLHttpRequest();A.xhr=this.xhr;
1523 this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr);
1524 };this.xhr.onerror=function(){F.xhrOnError(F.xhr);};var G=new FormData();G.append('returnHTML','NO');if(B){G.append('crop',B);}if(typeof(A)!='undefined'&&(typeof(A.id)=='undefined'||A.id*1<1)){G.append(this.paramName,A,A.name);}if(typeof(A.filename)!='undefined'){G.append('filename',A.filename);
1525 }if(typeof(A.mimetype)!='undefined'){G.append('mimetype',A.mimetype);}if(this.fireEvent('arrange',this,G)!=false){this.xhr.send(G);};},xhrOnLoad:function(A){if(this.loadMask){this.maskEl.unmask();}if(A.readyState!==4){this.fireEvent('exception',this,A);return;
1526 }var B=Roo.decode(A.responseText);if(!B.success){this.fireEvent('exception',this,A);return;}var B=Roo.decode(A.responseText);this.fireEvent('upload',this,B);},xhrOnError:function(){if(this.loadMask){this.maskEl.unmask();}Roo.log('xhr on error');var A=Roo.decode(xhr.responseText);
1527 Roo.log(A);},prepare:function(A){if(this.loadMask){this.maskEl.mask(this.loadingText);}this.file=false;this.exif={};if(typeof(A)==='string'){this.loadCanvas(A);return;}if(!A||!this.urlAPI){return;}this.file=A;this.cropType=A.type;var B=this;if(this.fireEvent('prepare',this,this.file)!=false){var C=new FileReader();
1528 C.onload=function(e){if(e.target.error){Roo.log(e.target.error);return;}var D=e.target.result,E=new DataView(D),F=2,G=E.byteLength-4,H,I;if(E.getUint16(0)===0xffd8){while(F<G){H=E.getUint16(F);if((H>=0xffe0&&H<=0xffef)||H===0xfffe){I=E.getUint16(F+2)+2;if(F+I>E.byteLength){Roo.log('Invalid meta data: Invalid segment size.');
1529 break;}if(H==0xffe1){B.parseExifData(E,F,I);}F+=I;continue;}break;}}var J=B.urlAPI.createObjectURL(B.file);B.loadCanvas(J);return;};C.readAsArrayBuffer(this.file);}},parseExifData:function(A,B,C){var D=B+10,E,F;if(A.getUint32(B+4)!==0x45786966){return;}if(A.getUint32(B+4)!==0x45786966){return;
1530 }if(D+8>A.byteLength){Roo.log('Invalid Exif data: Invalid segment size.');return;}if(A.getUint16(B+8)!==0x0000){Roo.log('Invalid Exif data: Missing byte alignment offset.');return;}switch(A.getUint16(D)){case 0x4949:E=true;break;case 0x4D4D:E=false;break;
1531 default:Roo.log('Invalid Exif data: Invalid byte alignment marker.');return;}if(A.getUint16(D+2,E)!==0x002A){Roo.log('Invalid Exif data: Missing TIFF marker.');return;}F=A.getUint32(D+4,E);this.parseExifTags(A,D,D+F,E);},parseExifTags:function(A,B,C,D){var E,F,i;
1532 if(C+6>A.byteLength){Roo.log('Invalid Exif data: Invalid directory offset.');return;}E=A.getUint16(C,D);F=C+2+12*E;if(F+4>A.byteLength){Roo.log('Invalid Exif data: Invalid directory size.');return;}for(i=0;i<E;i+=1){this.parseExifTag(A,B,C+2+12*i,D);}return A.getUint32(F,D);
1533 },parseExifTag:function(A,B,C,D){var E=A.getUint16(C,D);this.exif[E]=this.getExifValue(A,B,C,A.getUint16(C+2,D),A.getUint32(C+4,D),D);},getExifValue:function(A,B,C,D,E,F){var G=Roo.bootstrap.UploadCropbox.exifTagTypes[D],H,I,J,i,K,c;if(!G){Roo.log('Invalid Exif data: Invalid tag type.');
1534 return;}H=G.size*E;I=H>4?B+A.getUint32(C+8,F):(C+8);if(I+H>A.byteLength){Roo.log('Invalid Exif data: Invalid data offset.');return;}if(E===1){return G.getValue(A,I,F);}J=[];for(i=0;i<E;i+=1){J[i]=G.getValue(A,I+i*G.size,F);}if(G.ascii){K='';for(i=0;i<J.length;
1535 i+=1){c=J[i];if(c==='\u0000'){break;}K+=c;}return K;}return J;}});Roo.apply(Roo.bootstrap.UploadCropbox,{tags:{'Orientation':0x0112
1536 },Orientation:{1:0,3:180,6:90,8:270},exifTagTypes:{1:{getValue:function(A,B){return A.getUint8(B);},size:1},2:{getValue:function(A,B){return String.fromCharCode(A.getUint8(B));
1537 },size:1,ascii:true},3:{getValue:function(A,B,C){return A.getUint16(B,C);},size:2},4:{getValue:function(A,B,C){return A.getUint32(B,C);},size:4},5:{getValue:function(A,B,C){return A.getUint32(B,C)/A.getUint32(B+4,C);},size:8},9:{getValue:function(A,B,C){return A.getInt32(B,C);
1538 },size:4},10:{getValue:function(A,B,C){return A.getInt32(B,C)/A.getInt32(B+4,C);},size:8}},footer:{STANDARD:[{tag:'div',cls:'btn-group roo-upload-cropbox-rotate-left',action:'rotate-left',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-undo"></i>'}
1539 ]},{tag:'div',cls:'btn-group roo-upload-cropbox-picture',action:'picture',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-picture-o"></i>'}]},{tag:'div',cls:'btn-group roo-upload-cropbox-rotate-right',action:'rotate-right',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-repeat"></i>'}
1540 ]}],DOCUMENT:[{tag:'div',cls:'btn-group roo-upload-cropbox-rotate-left',action:'rotate-left',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-undo"></i>'}]},{tag:'div',cls:'btn-group roo-upload-cropbox-download',action:'download',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-download"></i>'}
1541 ]},{tag:'div',cls:'btn-group roo-upload-cropbox-crop',action:'crop',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-crop"></i>'}]},{tag:'div',cls:'btn-group roo-upload-cropbox-trash',action:'trash',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-trash"></i>'}
1542 ]},{tag:'div',cls:'btn-group roo-upload-cropbox-rotate-right',action:'rotate-right',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-repeat"></i>'}]}],ROTATOR:[{tag:'div',cls:'btn-group roo-upload-cropbox-rotate-left',action:'rotate-left',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-undo"></i>'}
1543 ]},{tag:'div',cls:'btn-group roo-upload-cropbox-rotate-right',action:'rotate-right',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-repeat"></i>'}]}]}});
1544 // Roo/bootstrap/DocumentManager.js
1545 Roo.bootstrap.DocumentManager=function(A){Roo.bootstrap.DocumentManager.superclass.constructor.call(this,A);this.files=[];this.delegates=[];this.addEvents({"initial":true,"inspect":true,"exception":true,"afterupload":true,"prepare":true,"remove":true,"refresh":true,"click":true,"edit":true,"beforeselectfile":true,"process":true,"previewrendered":true,"previewResize":true}
1546 );};Roo.extend(Roo.bootstrap.DocumentManager,Roo.bootstrap.Component,{boxes:0,inputName:'',thumbSize:300,multiple:true,files:false,method:'POST',url:'',paramName:'imageUpload',toolTipName:'filename',fieldLabel:'',labelWidth:4,labelAlign:'left',editable:true,delegates:false,xhr:false,labellg:0,labelmd:0,labelsm:0,labelxs:0,getAutoCreate:function(){var A={tag:'div',cls:'roo-document-manager',cn:[{tag:'input',cls:'roo-document-manager-selector',type:'file'}
1547 ,{tag:'div',cls:'roo-document-manager-uploader',cn:[{tag:'div',cls:'roo-document-manager-upload-btn',html:'<i class="fa fa-plus"></i>'}]}]};var B=[{tag:'div',cls:'column col-md-12',cn:A}];if(this.fieldLabel.length){B=[{tag:'div',cls:'column col-md-12',html:this.fieldLabel}
1548 ,{tag:'div',cls:'column col-md-12',cn:A}];if(this.labelAlign=='left'){B=[{tag:'div',cls:'column',html:this.fieldLabel},{tag:'div',cls:'column',cn:A}];if(this.labelWidth>12){B[0].style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;
1549 }if(this.labellg>0){B[0].cls+=' col-lg-'+this.labellg;B[1].cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){B[0].cls+=' col-md-'+this.labelmd;B[1].cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){B[0].cls+=' col-sm-'+this.labelsm;B[1].cls+=' col-sm-'+(12-this.labelsm);
1550 }if(this.labelxs>0){B[0].cls+=' col-xs-'+this.labelxs;B[1].cls+=' col-xs-'+(12-this.labelxs);}}}var C={tag:'div',cls:'row clearfix',cn:B};return C;},initEvents:function(){this.managerEl=this.el.select('.roo-document-manager',true).first();this.managerEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
1551 this.selectorEl=this.el.select('.roo-document-manager-selector',true).first();this.selectorEl.hide();if(this.multiple){this.selectorEl.attr('multiple','multiple');}this.selectorEl.on('change',this.onFileSelected,this);this.uploader=this.el.select('.roo-document-manager-uploader',true).first();
1552 this.uploader.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.uploader.on('click',this.onUploaderClick,this);this.renderProgressDialog();var A=this;window.addEventListener("resize",function(){A.refresh();});this.fireEvent('initial',this);
1553 },renderProgressDialog:function(){var A=this;this.progressDialog=new Roo.bootstrap.Modal({cls:'roo-document-manager-progress-dialog',allow_close:false,animate:false,title:'',buttons:[{name:'cancel',weight:'danger',html:'Cancel'}],listeners:{btnclick:function(){A.uploadCancel();
1554 this.hide();}}});this.progressDialog.render(Roo.get(document.body));this.progress=new Roo.bootstrap.Progress({cls:'roo-document-manager-progress',active:true,striped:true});this.progress.render(this.progressDialog.getChildContainer());this.progressBar=new Roo.bootstrap.ProgressBar({cls:'roo-document-manager-progress-bar',aria_valuenow:0,aria_valuemin:0,aria_valuemax:12,panel:'success'}
1555 );this.progressBar.render(this.progress.getChildContainer());},onUploaderClick:function(e){e.preventDefault();if(this.fireEvent('beforeselectfile',this)!=false){this.selectorEl.dom.click();}},onFileSelected:function(e){e.preventDefault();if(typeof(this.selectorEl.dom.files)=='undefined'||!this.selectorEl.dom.files.length){return;
1556 }Roo.each(this.selectorEl.dom.files,function(A){if(this.fireEvent('inspect',this,A)!=false){this.files.push(A);}},this);this.queue();},queue:function(){this.selectorEl.dom.value='';if(!this.files||!this.files.length){return;}if(this.boxes>0&&this.files.length>this.boxes){this.files=this.files.slice(0,this.boxes);
1557 }this.uploader.show();if(this.boxes>0&&this.files.length>this.boxes-1){this.uploader.hide();}var A=this;var B=[];var C=[];Roo.each(this.files,function(D){if(typeof(D.id)!='undefined'&&D.id*1>0){var f=this.renderPreview(D);B.push(f);return;}if(D.type.indexOf('image')!=-1){this.delegates.push((function(){A.process(D);
1558 }).createDelegate(this));return;}C.push((function(){A.process(D);}).createDelegate(this));},this);this.files=B;this.delegates=this.delegates.concat(C);if(!this.delegates.length){this.refresh();return;}this.progressBar.aria_valuemax=this.delegates.length;this.arrange();
1559 return;},arrange:function(){if(!this.delegates.length){this.progressDialog.hide();this.refresh();return;}var A=this.delegates.shift();this.progressDialog.show();this.progressDialog.setTitle((this.progressBar.aria_valuemax-this.delegates.length)+' / '+this.progressBar.aria_valuemax);
1560 this.progressBar.update(this.progressBar.aria_valuemax-this.delegates.length);A();},refresh:function(){this.uploader.show();if(this.boxes>0&&this.files.length>this.boxes-1){this.uploader.hide();}Roo.isTouch?this.closable(false):this.closable(true);this.fireEvent('refresh',this);
1561 },onRemove:function(e,el,o){e.preventDefault();this.fireEvent('remove',this,o);},remove:function(o){var A=[];Roo.each(this.files,function(B){if(typeof(B.id)=='undefined'||B.id*1<1||B.id!=o.id){A.push(B);return;}o.target.remove();},this);this.files=A;this.refresh();
1562 },clear:function(){Roo.each(this.files,function(A){if(!A.target){return;}A.target.remove();},this);this.files=[];this.refresh();},onClick:function(e,el,o){e.preventDefault();this.fireEvent('click',this,o);},closable:function(A){Roo.each(this.managerEl.select('.roo-document-manager-preview > button.close',true).elements,function(el){el.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
1563 if(A){el.show();return;}el.hide();},this);},xhrOnLoad:function(A){Roo.each(this.managerEl.select('.roo-document-manager-loading',true).elements,function(el){el.remove();},this);if(A.readyState!==4){this.arrange();this.fireEvent('exception',this,A);return;
1564 }var B=Roo.decode(A.responseText);if(!B.success){this.arrange();this.fireEvent('exception',this,A);return;}var C=this.renderPreview(B.data);this.files.push(C);this.arrange();this.fireEvent('afterupload',this,A);},xhrOnError:function(A){Roo.log('xhr on error');
1565 var B=Roo.decode(A.responseText);Roo.log(B);this.arrange();},process:function(A){if(this.fireEvent('process',this,A)!==false){if(this.editable&&A.type.indexOf('image')!=-1){this.fireEvent('edit',this,A);return;}this.uploadStart(A,false);return;}},uploadStart:function(A,B){this.xhr=new XMLHttpRequest();
1566 if(typeof(A.id)!='undefined'&&A.id*1>0){this.arrange();return;}A.xhr=this.xhr;this.managerEl.createChild({tag:'div',cls:'roo-document-manager-loading',cn:[{tag:'div',tooltip:A.name,cls:'roo-document-manager-thumb',html:'<i class="fa fa-circle-o-notch fa-spin"></i>'}
1567 ]});this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr);
1568 };this.xhr.onerror=function(){F.xhrOnError(F.xhr);};var G=new FormData();G.append('returnHTML','NO');if(B){G.append('crop',B);}G.append(this.paramName,A,A.name);var H={file:A,manually:false};if(this.fireEvent('prepare',this,G,H)!=false){if(H.manually){return;
1569 }this.xhr.send(G);return;};this.uploadCancel();},uploadCancel:function(){if(this.xhr){this.xhr.abort();}this.delegates=[];Roo.each(this.managerEl.select('.roo-document-manager-loading',true).elements,function(el){el.remove();},this);this.arrange();},renderPreview:function(A){if(typeof(A.target)!='undefined'&&A.target){return A;
1570 }var B=encodeURI(baseURL+'/Images/Thumb/'+this.thumbSize+'/'+A.id+'/'+A.filename);var C=this.managerEl.createChild({tag:'div',cls:'roo-document-manager-preview',cn:[{tag:'div',tooltip:A[this.toolTipName],cls:'roo-document-manager-thumb',html:'<img tooltip="'+A[this.toolTipName]+'" src="'+B+'">'}
1571 ,{tag:'button',cls:'close',html:'<i class="fa fa-times-circle"></i>'}]});var D=C.select('button.close',true).first();D.on('click',this.onRemove,this,A);A.target=C;var E=C.select('img',true).first();var F=this;E.dom.addEventListener("load",function(){F.onPreviewLoad(A,E);
1572 });E.on('click',this.onClick,this,A);this.fireEvent('previewrendered',this,A);return A;},onPreviewLoad:function(A,B){if(typeof(A.target)=='undefined'||!A.target){return;}var C=B.dom.naturalWidth||B.dom.width;var D=B.dom.naturalHeight||B.dom.height;if(!this.previewResize){return;
1573 }if(C>D){A.target.addClass('wide');return;}A.target.addClass('tall');return;},uploadFromSource:function(A,B){this.xhr=new XMLHttpRequest();this.managerEl.createChild({tag:'div',cls:'roo-document-manager-loading',cn:[{tag:'div',tooltip:A.name,cls:'roo-document-manager-thumb',html:'<i class="fa fa-circle-o-notch fa-spin"></i>'}
1574 ]});this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr);
1575 };this.xhr.onerror=function(){F.xhrOnError(F.xhr);};var G=new FormData();G.append('returnHTML','NO');G.append('crop',B);if(typeof(A.filename)!='undefined'){G.append('filename',A.filename);}if(typeof(A.mimetype)!='undefined'){G.append('mimetype',A.mimetype);
1576 }Roo.log(G);if(this.fireEvent('prepare',this,G)!=false){this.xhr.send(G);};}});
1577 // Roo/bootstrap/DocumentViewer.js
1578 Roo.bootstrap.DocumentViewer=function(A){Roo.bootstrap.DocumentViewer.superclass.constructor.call(this,A);this.addEvents({"initial":true,"click":true,"download":true,"trash":true});};Roo.extend(Roo.bootstrap.DocumentViewer,Roo.bootstrap.Component,{showDownload:true,showTrash:true,getAutoCreate:function(){var A={tag:'div',cls:'roo-document-viewer',cn:[{tag:'div',cls:'roo-document-viewer-body',cn:[{tag:'div',cls:'roo-document-viewer-thumb',cn:[{tag:'img',cls:'roo-document-viewer-image'}
1579 ]}]},{tag:'div',cls:'roo-document-viewer-footer',cn:{tag:'div',cls:'btn-group btn-group-justified roo-document-viewer-btn-group',cn:[{tag:'div',cls:'btn-group roo-document-viewer-download',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-download"></i>'}
1580 ]},{tag:'div',cls:'btn-group roo-document-viewer-trash',cn:[{tag:'button',cls:'btn btn-default',html:'<i class="fa fa-trash"></i>'}]}]}}]};return A;},initEvents:function(){this.bodyEl=this.el.select('.roo-document-viewer-body',true).first();this.bodyEl.setVisibilityMode(Roo.Element.DISPLAY);
1581 this.thumbEl=this.el.select('.roo-document-viewer-thumb',true).first();this.thumbEl.setVisibilityMode(Roo.Element.DISPLAY);this.imageEl=this.el.select('.roo-document-viewer-image',true).first();this.imageEl.setVisibilityMode(Roo.Element.DISPLAY);this.footerEl=this.el.select('.roo-document-viewer-footer',true).first();
1582 this.footerEl.setVisibilityMode(Roo.Element.DISPLAY);this.downloadBtn=this.el.select('.roo-document-viewer-download',true).first();this.downloadBtn.setVisibilityMode(Roo.Element.DISPLAY);this.trashBtn=this.el.select('.roo-document-viewer-trash',true).first();
1583 this.trashBtn.setVisibilityMode(Roo.Element.DISPLAY);this.bodyEl.on('click',this.onClick,this);this.downloadBtn.on('click',this.onDownload,this);this.trashBtn.on('click',this.onTrash,this);this.downloadBtn.hide();this.trashBtn.hide();if(this.showDownload){this.downloadBtn.show();
1584 }if(this.showTrash){this.trashBtn.show();}if(!this.showDownload&&!this.showTrash){this.footerEl.hide();}},initial:function(){this.fireEvent('initial',this);},onClick:function(e){e.preventDefault();this.fireEvent('click',this);},onDownload:function(e){e.preventDefault();
1585 this.fireEvent('download',this);},onTrash:function(e){e.preventDefault();this.fireEvent('trash',this);}});
1586 // Roo/bootstrap/form/FieldLabel.js
1587 Roo.bootstrap.form.FieldLabel=function(A){Roo.bootstrap.Element.superclass.constructor.call(this,A);this.addEvents({invalid:true,valid:true});};Roo.extend(Roo.bootstrap.form.FieldLabel,Roo.bootstrap.Component,{tag:'label',cls:'',html:'',target:'',allowBlank:true,invalidClass:'has-warning',validClass:'has-success',iconTooltip:'This field is required',indicatorpos:'left',getAutoCreate:function(){var A="";
1588 if(!this.allowBlank){A="visible";}var B={tag:this.tag,cls:'roo-bootstrap-field-label '+this.cls,for:this.target,cn:[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star '+A,tooltip:this.iconTooltip},{tag:'span',html:this.html}]}
1589 ;if(this.indicatorpos=='right'){var B={tag:this.tag,cls:'roo-bootstrap-field-label '+this.cls,for:this.target,cn:[{tag:'span',html:this.html},{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star '+A,tooltip:this.iconTooltip}]}
1590 ;}return B;},initEvents:function(){Roo.bootstrap.Element.superclass.initEvents.call(this);this.indicator=this.indicatorEl();if(this.indicator){this.indicator.removeClass('visible');this.indicator.addClass('invisible');}Roo.bootstrap.form.FieldLabel.register(this);
1591 },indicatorEl:function(){var A=this.el.select('i.roo-required-indicator',true).first();if(!A){return false;}return A;},markValid:function(){if(this.indicator){this.indicator.removeClass('visible');this.indicator.addClass('invisible');}if(Roo.bootstrap.version==3){this.el.removeClass(this.invalidClass);
1592 this.el.addClass(this.validClass);}else{this.el.removeClass('is-invalid');this.el.addClass('is-valid');}this.fireEvent('valid',this);},markInvalid:function(A){if(this.indicator){this.indicator.removeClass('invisible');this.indicator.addClass('visible');}if(Roo.bootstrap.version==3){this.el.removeClass(this.validClass);
1593 this.el.addClass(this.invalidClass);}else{this.el.removeClass('is-valid');this.el.addClass('is-invalid');}this.fireEvent('invalid',this,A);}});Roo.apply(Roo.bootstrap.form.FieldLabel,{groups:{},register:function(A){if(this.groups.hasOwnProperty(A.target)){return;
1594 }this.groups[A.target]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false;}return this.groups[A];}});
1595 // Roo/bootstrap/form/DateSplitField.js
1596 Roo.bootstrap.form.DateSplitField=function(A){Roo.bootstrap.form.DateSplitField.superclass.constructor.call(this,A);this.addEvents({"years":true,"days":true,invalid:true,valid:true});};Roo.extend(Roo.bootstrap.form.DateSplitField,Roo.bootstrap.Component,{fieldLabel:'',labelAlign:'top',labelWidth:3,dayAllowBlank:false,monthAllowBlank:false,yearAllowBlank:false,dayPlaceholder:'',monthPlaceholder:'',yearPlaceholder:'',dayFormat:'d',monthFormat:'m',yearFormat:'Y',isFormField:true,labellg:0,labelmd:0,labelsm:0,labelxs:0,getAutoCreate:function(){var A={tag:'div',cls:'row roo-date-split-field-group',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field roo-date-split-field-group-value',name:this.name}
1597 ]};var B='col-md-12';var C='col-md-4';if(this.fieldLabel){var D={tag:'div',cls:'column roo-date-split-field-label col-md-'+((this.labelAlign=='top')?'12':this.labelWidth),cn:[{tag:'label',html:this.fieldLabel}]};if(this.labelAlign=='left'){if(this.labelWidth>12){D.style="width: "+this.labelWidth+'px';
1598 }if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){B=' col-lg-'+this.labellg;C=' col-lg-'+((12-this.labellg)/3);}if(this.labelmd>0){B=' col-md-'+this.labelmd;C=' col-md-'+((12-this.labelmd)/3);}if(this.labelsm>0){B=' col-sm-'+this.labelsm;
1599 C=' col-sm-'+((12-this.labelsm)/3);}if(this.labelxs>0){B=' col-xs-'+this.labelxs;C=' col-xs-'+((12-this.labelxs)/3);}}D.cls+=' '+B;A.cn.push(D);}Roo.each(['day','month','year'],function(t){A.cn.push({tag:'div',cls:'column roo-date-split-field-'+t+' '+C});
1600 },this);return A;},inputEl:function(){return this.el.select('.roo-date-split-field-group-value',true).first();},onRender:function(ct,A){var B=this;Roo.bootstrap.DateSplitFiel.superclass.onRender.call(this,ct,A);this.inputEl=this.el.select('.roo-date-split-field-group-value',true).first();
1601 this.dayField=new Roo.bootstrap.form.ComboBox({allowBlank:this.dayAllowBlank,alwaysQuery:true,displayField:'value',editable:false,fieldLabel:'',forceSelection:true,mode:'local',placeholder:this.dayPlaceholder,selectOnFocus:true,tpl:'<div class="roo-select2-result"><b>{value}</b></div>',triggerAction:'all',typeAhead:true,valueField:'value',store:new Roo.data.SimpleStore({data:(function(){var C=[];
1602 B.fireEvent('days',B,C);return C;})(),fields:['value']}),listeners:{select:function(C,D,E){B.setValue(B.getValue());}}});this.dayField.render(this.el.select('.roo-date-split-field-day',true).first(),null);this.monthField=new Roo.bootstrap.form.MonthField({after:'<i class=\"fa fa-calendar\"></i>',allowBlank:this.monthAllowBlank,placeholder:this.monthPlaceholder,readOnly:true,listeners:{render:function(C){this.el.select('span.input-group-addon',true).first().on('click',function(e){e.preventDefault();
1603 C.focus();});},select:function(C,D,E){B.setValue(B.getValue());}}});this.monthField.render(this.el.select('.roo-date-split-field-month',true).first(),null);this.yearField=new Roo.bootstrap.form.ComboBox({allowBlank:this.yearAllowBlank,alwaysQuery:true,displayField:'value',editable:false,fieldLabel:'',forceSelection:true,mode:'local',placeholder:this.yearPlaceholder,selectOnFocus:true,tpl:'<div class="roo-select2-result"><b>{value}</b></div>',triggerAction:'all',typeAhead:true,valueField:'value',store:new Roo.data.SimpleStore({data:(function(){var C=[];
1604 B.fireEvent('years',B,C);return C;})(),fields:['value']}),listeners:{select:function(C,D,E){B.setValue(B.getValue());}}});this.yearField.render(this.el.select('.roo-date-split-field-year',true).first(),null);},setValue:function(v,A){this.inputEl.dom.value=v;
1605 var f=A||(this.yearFormat+'-'+this.monthFormat+'-'+this.dayFormat);var d=Date.parseDate(v,f);if(!d){this.validate();return;}this.setDay(d.format(this.dayFormat));this.setMonth(d.format(this.monthFormat));this.setYear(d.format(this.yearFormat));this.validate();
1606 return;},setDay:function(v){this.dayField.setValue(v);this.inputEl.dom.value=this.getValue();this.validate();return;},setMonth:function(v){this.monthField.setValue(v,true);this.inputEl.dom.value=this.getValue();this.validate();return;},setYear:function(v){this.yearField.setValue(v);
1607 this.inputEl.dom.value=this.getValue();this.validate();return;},getDay:function(){return this.dayField.getValue();},getMonth:function(){return this.monthField.getValue();},getYear:function(){return this.yearField.getValue();},getValue:function(){var f=this.yearFormat+'-'+this.monthFormat+'-'+this.dayFormat;
1608 var A=this.yearField.getValue()+'-'+this.monthField.getValue()+'-'+this.dayField.getValue();return A;},reset:function(){this.setDay('');this.setMonth('');this.setYear('');this.inputEl.dom.value='';this.validate();return;},validate:function(){var d=this.dayField.validate();
1609 var m=this.monthField.validate();var y=this.yearField.validate();var A=true;if((!this.dayAllowBlank&&!d)||(!this.monthAllowBlank&&!m)||(!this.yearAllowBlank&&!y)){A=false;}if(this.dayAllowBlank&&this.monthAllowBlank&&this.yearAllowBlank){return A;}if(A){this.markValid();
1610 return A;}this.markInvalid();return A;},markValid:function(){var A=this.el.select('label',true).first();var B=this.el.select('i.fa-star',true).first();if(A&&B){B.remove();}this.fireEvent('valid',this);},markInvalid:function(A){var B=this.el.select('label',true).first();
1611 var C=this.el.select('i.fa-star',true).first();if(B&&!C){this.el.select('.roo-date-split-field-label',true).createChild({tag:'i',cls:'text-danger fa fa-lg fa-star',tooltip:'This field is required',style:'margin-right:5px;'},B,true);}this.fireEvent('invalid',this,A);
1612 },clearInvalid:function(){var A=this.el.select('label',true).first();var B=this.el.select('i.fa-star',true).first();if(A&&B){B.remove();}this.fireEvent('valid',this);},getName:function(){return this.name;}});
1613 // Roo/bootstrap/LayoutMasonry.js
1614 Roo.bootstrap.LayoutMasonry=function(A){Roo.bootstrap.LayoutMasonry.superclass.constructor.call(this,A);this.bricks=[];Roo.bootstrap.LayoutMasonry.register(this);this.addEvents({"layout":true});};Roo.extend(Roo.bootstrap.LayoutMasonry,Roo.bootstrap.Component,{isLayoutInstant:false,boxWidth:450,boxHeight:0,padWidth:10,gutter:10,maxCols:0,isAutoInitial:true,containerWidth:0,isHorizontal:false,currentSize:null,tag:'div',cls:'',bricks:null,cols:1,_isLayoutInited:false,alternativePadWidth:50,selectedBrick:[],getAutoCreate:function(){var A=Roo.apply({}
1615 ,Roo.bootstrap.LayoutMasonry.superclass.getAutoCreate.call(this));var A={tag:this.tag,cls:'blog-masonary-wrapper '+this.cls,cn:{cls:'mas-boxes masonary'}};return A;},getChildContainer:function(){if(this.boxesEl){return this.boxesEl;}this.boxesEl=this.el.select('.mas-boxes').first();
1616 return this.boxesEl;},initEvents:function(){var A=this;if(this.isAutoInitial){Roo.log('hook children rendered');this.on('childrenrendered',function(){Roo.log('children rendered');A.initial();},this);}},initial:function(){this.selectedBrick=[];this.currentSize=this.el.getBox(true);
1617 Roo.EventManager.onWindowResize(this.resize,this);if(!this.isAutoInitial){this.layout();return;}this.layout();return;},resize:function(){var cs=this.el.getBox(true);if(this.currentSize.width==cs.width&&this.currentSize.x==cs.x&&this.currentSize.height==cs.height&&this.currentSize.y==cs.y){Roo.log("no change in with or X or Y");
1618 return;}this.currentSize=cs;this.layout();},layout:function(){this._resetLayout();var A=this.isLayoutInstant!==undefined?this.isLayoutInstant:!this._isLayoutInited;this.layoutItems(A);this._isLayoutInited=true;this.fireEvent('layout',this);},_resetLayout:function(){if(this.isHorizontal){this.horizontalMeasureColumns();
1619 return;}this.verticalMeasureColumns();},verticalMeasureColumns:function(){this.getContainerWidth();var A=this.boxWidth+this.padWidth;if(this.containerWidth<this.boxWidth){A=this.containerWidth}var B=this.containerWidth;var C=Math.floor(B/A);this.cols=Math.max(C,1);
1620 this.cols=this.maxCols>0?Math.min(this.cols,this.maxCols):this.cols;var D=this.cols*A-this.padWidth;var E=Math.floor((B-D)/this.cols);this.colWidth=A+E-this.padWidth;this.unitWidth=Math.round((this.colWidth-(this.gutter*2))/3);this.unitHeight=this.boxHeight>0?this.boxHeight:this.unitWidth;
1621 },horizontalMeasureColumns:function(){this.getContainerWidth();var A=this.boxWidth;if(this.containerWidth<A){A=this.containerWidth;}this.unitWidth=Math.floor((A-(this.gutter*2))/3);this.el.setHeight(A);},getContainerWidth:function(){this.containerWidth=this.el.getBox(true).width;
1622 },layoutItems:function(A){Roo.log(this.bricks);var B=Roo.apply([],this.bricks);if(this.isHorizontal){this._horizontalLayoutItems(B,A);return;}this._verticalLayoutItems(B,A);},_verticalLayoutItems:function(A,B){if(!A||!A.length){return;}var C=[['xs','xs','xs','tall'],['xs','xs','tall'],['xs','xs','sm'],['xs','xs','xs'],['xs','tall'],['xs','sm'],['xs','xs'],['xs'],['sm','xs','xs'],['sm','xs'],['sm'],['tall','xs','xs','xs'],['tall','xs','xs'],['tall','xs'],['tall']];
1623 var D=[];var E=[];var F=[];Roo.each(A,function(H,k){switch(H.size){case 'md':case 'md-left':case 'md-right':case 'wide':if(F.length){E.push(F);F=[];}E.push([H]);break;case 'xs':case 'sm':case 'tall':F.push(H);break;default:break;}},this);if(F.length){E.push(F);
1624 F=[];}var G=function(H,I){if(!H.length){return;}var J=false;var K=H.slice(0,I);var L=[];Roo.each(K,function(i){L.push(i.size);},this);Roo.each(C,function(s){if(String(s)!=String(L)){return;}J=true;return false;},this);if(!J&&I==1){return;}if(!J){G(H,I-1);
1625 return;}D.push(K);H=H.slice(I,H.length);G(H,4);return;};Roo.each(E,function(H,k){if(!H.length){return;}if(H.length==1){D.push(H);return;}G(H,4);},this);this._processVerticalLayoutQueue(D,B);},_horizontalLayoutItems:function(A,B){if(!A||!A.length||A.length<3){return;
1626 }A.reverse();var C=A.slice(0,3);A=A.slice(3,A.length);var D=[['xs','xs','xs','wide'],['xs','xs','wide'],['xs','xs','sm'],['xs','xs','xs'],['xs','wide'],['xs','sm'],['xs','xs'],['xs'],['sm','xs','xs'],['sm','xs'],['sm'],['wide','xs','xs','xs'],['wide','xs','xs'],['wide','xs'],['wide'],['wide-thin']];
1627 var E=[];var F=[];var G=[];Roo.each(A,function(N,k){switch(N.size){case 'md':case 'md-left':case 'md-right':case 'tall':if(G.length){F.push(G);G=[];}F.push([N]);break;case 'xs':case 'sm':case 'wide':case 'wide-thin':G.push(N);break;default:break;}},this);
1628 if(G.length){F.push(G);G=[];}var H=function(N,O){if(!N.length){return;}var P=false;var Q=N.slice(0,O);var R=[];Roo.each(Q,function(i){R.push(i.size);},this);Roo.each(D,function(s){if(String(s)!=String(R)){return;}P=true;return false;},this);if(!P&&O==1){return;
1629 }if(!P){H(N,O-1);return;}E.push(Q);N=N.slice(O,N.length);H(N,4);return;};Roo.each(F,function(N,k){if(!N.length){return;}if(N.length==1){E.push(N);return;}H(N,4);},this);var I=[];var J=this.el.getBox(true);var K=J.x;var L=J.right-this.unitWidth*3-this.gutter*2-this.padWidth;
1630 var M=false;Roo.each(E,function(N){if(M){Roo.each(N,function(b){b.el.setVisibilityMode(Roo.Element.DISPLAY);b.el.hide();},this);return;}var mx=0;Roo.each(N,function(b){b.el.setVisibilityMode(Roo.Element.DISPLAY);b.el.show();mx=Math.max(mx,b.x);},this);L=L-this.unitWidth*mx-this.gutter*(mx-1)-this.padWidth;
1631 if(L<K){Roo.each(N,function(b){b.el.setVisibilityMode(Roo.Element.DISPLAY);b.el.hide();},this);M=true;return;}I.push(N);},this);this._processHorizontalLayoutQueue(I,C,B);},_processVerticalLayoutQueue:function(A,B){var C=this.el.getBox(true);var x=C.x;var y=C.y;
1632 var D=[];for(var i=0;i<this.cols;i++){D[i]=C.y;}Roo.each(A,function(E,k){var F=k%this.cols;Roo.each(E,function(b,kk){b.el.position('absolute');var H=Math.floor(this.unitWidth*b.x+(this.gutter*(b.x-1))+b.el.getPadding('lr'));var I=Math.floor(this.unitHeight*b.y+(this.gutter*(b.y-1))+b.el.getPadding('tb'));
1633 if(b.size=='md-left'||b.size=='md-right'){H=Math.floor(this.unitWidth*(b.x-1)+(this.gutter*(b.x-2))+b.el.getPadding('lr'));I=Math.floor(this.unitHeight*(b.y-1)+(this.gutter*(b.y-2))+b.el.getPadding('tb'));}b.el.setWidth(H);b.el.setHeight(I);b.el.select('iframe',true).setSize(H,I);
1634 },this);for(var i=0;i<this.cols;i++){if(D[i]<D[F]){F=i;continue;}F=Math.min(F,i);}x=C.x+F*(this.colWidth+this.padWidth);y=D[F];var G=[];switch(E.length){case 1:G=this.getVerticalOneBoxColPositions(x,y,E);break;case 2:G=this.getVerticalTwoBoxColPositions(x,y,E);
1635 break;case 3:G=this.getVerticalThreeBoxColPositions(x,y,E);break;case 4:G=this.getVerticalFourBoxColPositions(x,y,E);break;default:break;}Roo.each(E,function(b,kk){b.el.setXY([G[kk].x,G[kk].y],B?false:true);var sz=b.el.getSize();D[F]=Math.max(D[F],G[kk].y+sz.height+this.padWidth);
1636 },this);},this);var mY=0;for(var i=0;i<this.cols;i++){mY=Math.max(mY,D[i]);}this.el.setHeight(mY-C.y);},_processHorizontalLayoutQueue:function(A,B,C){var D=this.el.getBox(true);var E=D.x;var F=D.y;var G=D.right;this._processHorizontalEndItem(B,G,E,F,C);var G=G-this.unitWidth*3-this.gutter*2-this.padWidth;
1637 Roo.each(A,function(H,k){Roo.each(H,function(b,kk){b.el.position('absolute');var J=Math.floor(this.unitWidth*b.x+(this.gutter*(b.x-1))+b.el.getPadding('lr'));var K=Math.floor(this.unitWidth*b.y+(this.gutter*(b.y-1))+b.el.getPadding('tb'));if(b.size=='md-left'||b.size=='md-right'){J=Math.floor(this.unitWidth*(b.x-1)+(this.gutter*(b.x-2))+b.el.getPadding('lr'));
1638 K=Math.floor(this.unitWidth*(b.y-1)+(this.gutter*(b.y-2))+b.el.getPadding('tb'));}b.el.setWidth(J);b.el.setHeight(K);},this);if(!H.length){return;}var I=[];switch(H.length){case 1:I=this.getHorizontalOneBoxColPositions(G,F,H);break;case 2:I=this.getHorizontalTwoBoxColPositions(G,F,H);
1639 break;case 3:I=this.getHorizontalThreeBoxColPositions(G,F,H);break;case 4:I=this.getHorizontalFourBoxColPositions(G,F,H);break;default:break;}Roo.each(H,function(b,kk){b.el.setXY([I[kk].x,I[kk].y],C?false:true);G=Math.min(G,I[kk].x-this.padWidth);},this);
1640 },this);},_processHorizontalEndItem:function(A,B,C,D,E){Roo.each(A,function(b,k){b.size=(k==0)?'sm':'xs';b.x=(k==0)?2:1;b.y=(k==0)?2:1;b.el.position('absolute');var G=Math.floor(this.unitWidth*b.x+(this.gutter*(b.x-1))+b.el.getPadding('lr'));b.el.setWidth(G);
1641 var H=Math.floor(this.unitWidth*b.y+(this.gutter*(b.y-1))+b.el.getPadding('tb'));b.el.setHeight(H);},this);var F=[];F.push({x:B-this.unitWidth*2-this.gutter,y:D});F.push({x:B-this.unitWidth,y:D+(this.unitWidth+this.gutter)*2});F.push({x:B-this.unitWidth*3-this.gutter*2,y:D}
1642 );Roo.each(A,function(b,k){b.el.setXY([F[k].x,F[k].y],E?false:true);},this);},getVerticalOneBoxColPositions:function(x,y,A){var B=[];var C=Math.floor(Math.random()*((4-A[0].x)));if(A[0].size=='md-left'){C=0;}if(A[0].size=='md-right'){C=1;}B.push({x:x+(this.unitWidth+this.gutter)*C,y:y}
1643 );return B;},getVerticalTwoBoxColPositions:function(x,y,A){var B=[];if(A[0].size=='xs'){B.push({x:x,y:y+((this.unitHeight+this.gutter)*Math.floor(Math.random()*A[1].y))});B.push({x:x+(this.unitWidth+this.gutter)*(3-A[1].x),y:y});return B;}B.push({x:x,y:y}
1644 );B.push({x:x+(this.unitWidth+this.gutter)*2,y:y+((this.unitHeight+this.gutter)*Math.floor(Math.random()*A[0].y))});return B;},getVerticalThreeBoxColPositions:function(x,y,A){var B=[];if(A[0].size=='xs'&&A[1].size=='xs'&&A[2].size=='xs'){B.push({x:x,y:y});
1645 B.push({x:x+(this.unitWidth+this.gutter)*1,y:y});B.push({x:x+(this.unitWidth+this.gutter)*2,y:y});return B;}if(A[0].size=='xs'&&A[1].size=='xs'){B.push({x:x,y:y});B.push({x:x,y:y+((this.unitHeight+this.gutter)*(A[2].y-1))});B.push({x:x+(this.unitWidth+this.gutter)*1,y:y}
1646 );return B;}B.push({x:x,y:y});B.push({x:x+(this.unitWidth+this.gutter)*2,y:y});B.push({x:x+(this.unitWidth+this.gutter)*2,y:y+(this.unitHeight+this.gutter)*(A[0].y-1)});return B;},getVerticalFourBoxColPositions:function(x,y,A){var B=[];if(A[0].size=='xs'){B.push({x:x,y:y}
1647 );B.push({x:x,y:y+(this.unitHeight+this.gutter)*1});B.push({x:x,y:y+(this.unitHeight+this.gutter)*2});B.push({x:x+(this.unitWidth+this.gutter)*1,y:y});return B;}B.push({x:x,y:y});B.push({x:x+(this.unitWidth+this.gutter)*2,y:y});B.push({x:x+(this.unitHeightunitWidth+this.gutter)*2,y:y+(this.unitHeight+this.gutter)*1}
1648 );B.push({x:x+(this.unitWidth+this.gutter)*2,y:y+(this.unitWidth+this.gutter)*2});return B;},getHorizontalOneBoxColPositions:function(A,B,C){var D=[];if(C[0].size=='md-left'){D.push({x:A-this.unitWidth*(C[0].x-1)-this.gutter*(C[0].x-2),y:B});return D;}if(C[0].size=='md-right'){D.push({x:A-this.unitWidth*(C[0].x-1)-this.gutter*(C[0].x-2),y:B+(this.unitWidth+this.gutter)*1}
1649 );return D;}var E=Math.floor(Math.random()*(4-C[0].y));D.push({x:A-this.unitWidth*C[0].x-this.gutter*(C[0].x-1),y:B+(this.unitWidth+this.gutter)*E});return D;},getHorizontalTwoBoxColPositions:function(A,B,C){var D=[];if(C[0].size=='xs'){D.push({x:A-this.unitWidth*C[0].x-this.gutter*(C[0].x-1),y:B}
1650 );D.push({x:A-this.unitWidth*C[1].x-this.gutter*(C[1].x-1),y:B+(this.unitWidth+this.gutter)*(3-C[1].y)});return D;}D.push({x:A-this.unitWidth*C[0].x-this.gutter*(C[0].x-1),y:B});D.push({x:A-this.unitWidth*C[1].x-this.gutter*(C[1].x-1),y:B+(this.unitWidth+this.gutter)*2}
1651 );return D;},getHorizontalThreeBoxColPositions:function(A,B,C){var D=[];if(C[0].size=='xs'&&C[1].size=='xs'&&C[2].size=='xs'){D.push({x:A-this.unitWidth*C[0].x-this.gutter*(C[0].x-1),y:B});D.push({x:A-this.unitWidth*C[1].x-this.gutter*(C[1].x-1),y:B+(this.unitWidth+this.gutter)*1}
1652 );D.push({x:A-this.unitWidth*C[2].x-this.gutter*(C[2].x-1),y:B+(this.unitWidth+this.gutter)*2});return D;}if(C[0].size=='xs'&&C[1].size=='xs'){D.push({x:A-this.unitWidth*C[0].x-this.gutter*(C[0].x-1),y:B});D.push({x:A-this.unitWidth*C[0].x-this.gutter*(C[0].x-1)-this.unitWidth*C[1].x-this.gutter*(C[1].x-1),y:B}
1653 );D.push({x:A-this.unitWidth*C[2].x-this.gutter*(C[2].x-1),y:B+(this.unitWidth+this.gutter)*1});return D;}D.push({x:A-this.unitWidth*C[0].x-this.gutter*(C[0].x-1),y:B});D.push({x:A-this.unitWidth*C[1].x-this.gutter*(C[1].x-1),y:B+(this.unitWidth+this.gutter)*2}
1654 );D.push({x:A-this.unitWidth*C[1].x-this.gutter*(C[1].x-1)-this.unitWidth*C[2].x-this.gutter*(C[2].x-1),y:B+(this.unitWidth+this.gutter)*2});return D;},getHorizontalFourBoxColPositions:function(A,B,C){var D=[];if(C[0].size=='xs'){D.push({x:A-this.unitWidth*C[0].x-this.gutter*(C[0].x-1),y:B}
1655 );D.push({x:A-this.unitWidth*C[0].x-this.gutter*(C[0].x-1)-this.unitWidth*C[1].x-this.gutter*(C[1].x-1),y:B});D.push({x:A-this.unitWidth*C[0].x-this.gutter*(C[0].x-1)-this.unitWidth*C[1].x-this.gutter*(C[1].x-1)-this.unitWidth*C[2].x-this.gutter*(C[2].x-1),y:B}
1656 );D.push({x:A-this.unitWidth*C[3].x-this.gutter*(C[3].x-1),y:B+(this.unitWidth+this.gutter)*1});return D;}D.push({x:A-this.unitWidth*C[0].x-this.gutter*(C[0].x-1),y:B});D.push({x:A-this.unitWidth*C[1].x-this.gutter*(C[1].x-1),y:B+(this.unitWidth+this.gutter)*2}
1657 );D.push({x:A-this.unitWidth*C[1].x-this.gutter*(C[1].x-1)-this.unitWidth*C[2].x-this.gutter*(C[2].x-1),y:B+(this.unitWidth+this.gutter)*2});D.push({x:A-this.unitWidth*C[1].x-this.gutter*(C[1].x-1)-this.unitWidth*C[2].x-this.gutter*(C[2].x-1)-this.unitWidth*C[3].x-this.gutter*(C[3].x-1),y:B+(this.unitWidth+this.gutter)*2}
1658 );return D;},removeBrick:function(A){if(!A){return;}for(var i=0;i<this.bricks.length;i++){if(this.bricks[i].id==A){this.bricks.splice(i,1);this.el.dom.removeChild(Roo.get(A).dom);this.initial();}}},addBrick:function(A){var cn=new Roo.bootstrap.MasonryBrick(A);
1659 cn.parentId=this.id;cn.render(this.el);return cn;},register:function(A){this.bricks.push(A);A.masonryId=this.id;},clearAll:function(){this.bricks=[];this.el.dom.innerHTML='';},getSelected:function(){if(!this.selectedBrick){return false;}return this.selectedBrick;
1660 }});Roo.apply(Roo.bootstrap.LayoutMasonry,{groups:{},register:function(A){this.groups[A.id]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false;}return this.groups[A];}});
1661 // Roo/bootstrap/LayoutMasonryAuto.js
1662 Roo.bootstrap.LayoutMasonryAuto=function(A){Roo.bootstrap.LayoutMasonryAuto.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.LayoutMasonryAuto,Roo.bootstrap.Component,{isFitWidth:false,isOriginLeft:true,isOriginTop:false,isLayoutInstant:false,isResizingContainer:true,columnWidth:0,maxCols:0,padHeight:10,isAutoInitial:true,gutter:0,containerWidth:0,initialColumnWidth:0,currentSize:null,colYs:null,maxY:0,padWidth:10,tag:'div',cls:'',bricks:null,cols:0,_isLayoutInited:null,getAutoCreate:function(){var A={tag:this.tag,cls:'blog-masonary-wrapper '+this.cls,cn:{cls:'mas-boxes masonary'}
1663 };return A;},getChildContainer:function(){if(this.boxesEl){return this.boxesEl;}this.boxesEl=this.el.select('.mas-boxes').first();return this.boxesEl;},initEvents:function(){var A=this;if(this.isAutoInitial){Roo.log('hook children rendered');this.on('childrenrendered',function(){Roo.log('children rendered');
1664 A.initial();},this);}},initial:function(){this.reloadItems();this.currentSize=this.el.getBox(true);Roo.EventManager.onWindowResize(this.resize,this);if(!this.isAutoInitial){this.layout();return;}this.layout.defer(500,this);},reloadItems:function(){this.bricks=this.el.select('.masonry-brick',true);
1665 this.bricks.each(function(b){if(!b.attr('originalwidth')){b.attr('originalwidth',b.getSize().width);}});Roo.log(this.bricks.elements.length);},resize:function(){Roo.log('resize');var cs=this.el.getBox(true);if(this.currentSize.width==cs.width&&this.currentSize.x==cs.x){Roo.log("no change in with or X");
1666 return;}this.currentSize=cs;this.layout();},layout:function(){Roo.log('layout');this._resetLayout();var A=this.isLayoutInstant!==undefined?this.isLayoutInstant:!this._isLayoutInited;this.layoutItems(A);this._isLayoutInited=true;},layoutItems:function(A){this._layoutItems(this.bricks,A);
1667 this._postLayout();},_layoutItems:function(A,B){if(!A||!A.elements.length){return;}var C=[];A.each(function(D){Roo.log("layout item");Roo.log(D);var E=this._getItemLayoutPosition(D);E.item=D;E.isInstant=B;C.push(E);},this);this._processLayoutQueue(C);},_processLayoutQueue:function(A){for(var i=0,B=A.length;
1668 i<B;i++){var C=A[i];C.item.position('absolute');C.item.setXY([C.x,C.y],C.isInstant?false:true);}},_postLayout:function(){this.resizeContainer();},resizeContainer:function(){if(!this.isResizingContainer){return;}var A=this._getContainerSize();if(A){this.el.setSize(A.width,A.height);
1669 this.boxesEl.setSize(A.width,A.height);}},_resetLayout:function(){this.colWidth=this.el.getWidth();this.measureColumns();var i=this.cols;this.colYs=[];while(i--){this.colYs.push(0);}this.maxY=0;},measureColumns:function(){this.getContainerWidth();if(!this.columnWidth){var A=this.bricks.first();
1670 Roo.log(A);this.columnWidth=this.containerWidth;if(A&&A.attr('originalwidth')){this.columnWidth=1*(A.attr('originalwidth')||A.getWidth());}Roo.log("set column width?");this.initialColumnWidth=this.columnWidth;}if(this.initialColumnWidth){this.columnWidth=this.initialColumnWidth;
1671 }var B=this.columnWidth+=this.gutter;var C=this.containerWidth+this.gutter;var D=(C-this.padWidth)/(B-this.padWidth);var E=B-C%B;var F=E&&E<1?'round':'floor';D=Math[F](D);this.cols=Math.max(D,1);this.cols=this.maxCols>0?Math.min(this.cols,this.maxCols):this.cols;
1672 var G=this.cols*this.columnWidth;var H=this.containerWidth-G;var I=(1+this.cols)*this.padWidth;var J=Math.floor((H-I)/this.cols);this.columnWidth+=J},getContainerWidth:function(){this.containerWidth=this.el.getBox(true).width;},_getItemLayoutPosition:function(A){A.setWidth(this.columnWidth);
1673 A.autoBoxAdjust=false;var sz=A.getSize();var B=this.containerWidth%this.columnWidth;var C=B&&B<1?'round':'ceil';var D=Math[C](sz.width/this.columnWidth);D=Math.min(D,this.cols);var E=this._getColGroup(D);var F=Math.min.apply(Math,E);Roo.log(['setHeight',F,sz.height,I]);
1674 var G=E.indexOf(F);var H={x:this.currentSize.x+(this.padWidth/2)+((this.columnWidth+this.padWidth)*G),y:this.currentSize.y+F+this.padHeight};Roo.log(H);var I=F+sz.height+this.padHeight;var J=this.cols+1-E.length;for(var i=0;i<J;i++){this.colYs[G+i]=I;}return H;
1675 },_getColGroup:function(A){if(A<2){return this.colYs;}var B=[];var C=this.cols+1-A;for(var i=0;i<C;i++){var D=this.colYs.slice(i,i+A);B[i]=Math.max.apply(Math,D);}return B;},_getContainerSize:function(){this.maxY=Math.max.apply(Math,this.colYs);var A={height:this.maxY}
1676 ;if(this.isFitWidth){A.width=this._getContainerFitWidth();}return A;},_getContainerFitWidth:function(){var A=0;var i=this.cols;while(--i){if(this.colYs[i]!==0){break;}A++;}return (this.cols-A)*this.columnWidth-this.gutter;},needsResizeLayout:function(){var A=this.containerWidth;
1677 this.getContainerWidth();return A!==this.containerWidth;}});
1678 // Roo/bootstrap/MasonryBrick.js
1679 Roo.bootstrap.MasonryBrick=function(A){Roo.bootstrap.MasonryBrick.superclass.constructor.call(this,A);Roo.bootstrap.MasonryBrick.register(this);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.MasonryBrick,Roo.bootstrap.Component,{title:'',html:'',bgimage:'',videourl:'',cls:'',href:'',size:'xs',placetitle:'',isFitContainer:true,preventDefault:false,maskInverse:false,getAutoCreate:function(){if(!this.isFitContainer){return this.getSplitAutoCreate();
1680 }var A='masonry-brick masonry-brick-full';if(this.href.length){A+=' masonry-brick-link';}if(this.bgimage.length){A+=' masonry-brick-image';}if(this.maskInverse){A+=' mask-inverse';}if(!this.html.length&&!this.maskInverse&&!this.videourl.length){A+=' enable-mask';
1681 }if(this.size){A+=' masonry-'+this.size+'-brick';}if(this.placetitle.length){switch(this.placetitle){case 'center':A+=' masonry-center-title';break;case 'bottom':A+=' masonry-bottom-title';break;default:break;}}else{if(!this.html.length&&!this.bgimage.length){A+=' masonry-center-title';
1682 }if(!this.html.length&&this.bgimage.length){A+=' masonry-bottom-title';}}if(this.cls){A+=' '+this.cls;}var B={tag:(this.href.length)?'a':'div',cls:A,cn:[{tag:'div',cls:'masonry-brick-mask'},{tag:'div',cls:'masonry-brick-paragraph',cn:[]}]};if(this.href.length){B.href=this.href;
1683 }var cn=B.cn[1].cn;if(this.title.length){cn.push({tag:'h4',cls:'masonry-brick-title',html:this.title});}if(this.html.length){cn.push({tag:'p',cls:'masonry-brick-text',html:this.html});}if(!this.title.length&&!this.html.length){B.cn[1].cls+=' hide';}if(this.bgimage.length){B.cn.push({tag:'img',cls:'masonry-brick-image-view',src:this.bgimage}
1684 );}if(this.videourl.length){var C=this.videourl.replace(/https:\/\/youtu\.be/,'https://www.youtube.com/embed/');B.cn.push({tag:'iframe',cls:'masonry-brick-image-view',src:C,frameborder:0,allowfullscreen:true});}return B;},getSplitAutoCreate:function(){var A='masonry-brick masonry-brick-split';
1685 if(this.href.length){A+=' masonry-brick-link';}if(this.bgimage.length){A+=' masonry-brick-image';}if(this.size){A+=' masonry-'+this.size+'-brick';}switch(this.placetitle){case 'center':A+=' masonry-center-title';break;case 'bottom':A+=' masonry-bottom-title';
1686 break;default:if(!this.bgimage.length){A+=' masonry-center-title';}if(this.bgimage.length){A+=' masonry-bottom-title';}break;}if(this.cls){A+=' '+this.cls;}var B={tag:(this.href.length)?'a':'div',cls:A,cn:[{tag:'div',cls:'masonry-brick-split-head',cn:[{tag:'div',cls:'masonry-brick-paragraph',cn:[]}
1687 ]},{tag:'div',cls:'masonry-brick-split-body',cn:[]}]};if(this.href.length){B.href=this.href;}if(this.title.length){B.cn[0].cn[0].cn.push({tag:'h4',cls:'masonry-brick-title',html:this.title});}if(this.html.length){B.cn[1].cn.push({tag:'p',cls:'masonry-brick-text',html:this.html}
1688 );}if(this.bgimage.length){B.cn[0].cn.push({tag:'img',cls:'masonry-brick-image-view',src:this.bgimage});}if(this.videourl.length){var C=this.videourl.replace(/https:\/\/youtu\.be/,'https://www.youtube.com/embed/');B.cn[0].cn.cn.push({tag:'iframe',cls:'masonry-brick-image-view',src:C,frameborder:0,allowfullscreen:true}
1689 );}return B;},initEvents:function(){switch(this.size){case 'xs':this.x=1;this.y=1;break;case 'sm':this.x=2;this.y=2;break;case 'md':case 'md-left':case 'md-right':this.x=3;this.y=3;break;case 'tall':this.x=2;this.y=3;break;case 'wide':this.x=3;this.y=2;break;
1690 case 'wide-thin':this.x=3;this.y=1;break;default:break;}if(Roo.isTouch){this.el.on('touchstart',this.onTouchStart,this);this.el.on('touchmove',this.onTouchMove,this);this.el.on('touchend',this.onTouchEnd,this);this.el.on('contextmenu',this.onContextMenu,this);
1691 }else{this.el.on('mouseenter',this.enter,this);this.el.on('mouseleave',this.leave,this);this.el.on('click',this.onClick,this);}if(typeof(this.parent().bricks)=='object'&&this.parent().bricks!=null){this.parent().bricks.push(this);}},onClick:function(e,el){var A=this.endTimer-this.startTimer;
1692 if(Roo.isTouch){if(A>1000){e.preventDefault();return;}}if(!this.preventDefault){return;}e.preventDefault();if(this.activeClass!=''){this.selectBrick();}this.fireEvent('click',this,e);},enter:function(e,el){e.preventDefault();if(!this.isFitContainer||this.maskInverse||this.videourl.length){return;
1693 }if(this.bgimage.length&&this.html.length){this.el.select('.masonry-brick-paragraph',true).first().setOpacity(0.9,true);}},leave:function(e,el){e.preventDefault();if(!this.isFitContainer||this.maskInverse||this.videourl.length){return;}if(this.bgimage.length&&this.html.length){this.el.select('.masonry-brick-paragraph',true).first().setOpacity(0,true);
1694 }},onTouchStart:function(e,el){this.touchmoved=false;if(!this.isFitContainer){return;}if(!this.bgimage.length||!this.html.length){return;}this.el.select('.masonry-brick-paragraph',true).first().setOpacity(0.9,true);this.timer=new Date().getTime();},onTouchMove:function(e,el){this.touchmoved=true;
1695 },onContextMenu:function(e,el){e.preventDefault();e.stopPropagation();return false;},onTouchEnd:function(e,el){if((new Date().getTime()-this.timer>1000)||!this.href.length||this.touchmoved){this.leave(e,el);return;}if(!this.bgimage.length||!this.html.length){if(this.href.length){window.location.href=this.href;
1696 }return;}if(!this.isFitContainer){return;}this.el.select('.masonry-brick-paragraph',true).first().setOpacity(0,true);window.location.href=this.href;},selectBrick:function(){if(!this.parentId){return;}var m=Roo.bootstrap.LayoutMasonry.get(this.parentId);var A=m.selectedBrick.indexOf(this.id);
1697 if(A>-1){m.selectedBrick.splice(A,1);this.el.removeClass(this.activeClass);return;}for(var i=0;i<m.selectedBrick.length;i++){var b=Roo.bootstrap.MasonryBrick.get(m.selectedBrick[i]);b.el.removeClass(b.activeClass);}m.selectedBrick=[];m.selectedBrick.push(this.id);
1698 this.el.addClass(this.activeClass);return;},isSelected:function(){return this.el.hasClass(this.activeClass);}});Roo.apply(Roo.bootstrap.MasonryBrick,{groups:new Roo.util.MixedCollection(false,function(o){return o.el.id;}),register:function(A){this.groups.add(A.id,A);
1699 },get:function(A){if(this.groups.key(A)){return this.groups.key(A);}return false;}});
1700 // Roo/bootstrap/Brick.js
1701 Roo.bootstrap.Brick=function(A){Roo.bootstrap.Brick.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.Brick,Roo.bootstrap.Component,{title:'',html:'',bgimage:'',cls:'',href:'',video:'',square:true,getAutoCreate:function(){var A='roo-brick';
1702 if(this.href.length){A+=' roo-brick-link';}if(this.bgimage.length){A+=' roo-brick-image';}if(!this.html.length&&!this.bgimage.length){A+=' roo-brick-center-title';}if(!this.html.length&&this.bgimage.length){A+=' roo-brick-bottom-title';}if(this.cls){A+=' '+this.cls;
1703 }var B={tag:(this.href.length)?'a':'div',cls:A,cn:[{tag:'div',cls:'roo-brick-paragraph',cn:[]}]};if(this.href.length){B.href=this.href;}var cn=B.cn[0].cn;if(this.title.length){cn.push({tag:'h4',cls:'roo-brick-title',html:this.title});}if(this.html.length){cn.push({tag:'p',cls:'roo-brick-text',html:this.html}
1704 );}else{cn.cls+=' hide';}if(this.bgimage.length){B.cn.push({tag:'img',cls:'roo-brick-image-view',src:this.bgimage});}return B;},initEvents:function(){if(this.title.length||this.html.length){this.el.on('mouseenter',this.enter,this);this.el.on('mouseleave',this.leave,this);
1705 }Roo.EventManager.onWindowResize(this.resize,this);if(this.bgimage.length){this.imageEl=this.el.select('.roo-brick-image-view',true).first();this.imageEl.on('load',this.onImageLoad,this);return;}this.resize();},onImageLoad:function(){this.resize();},resize:function(){var A=this.el.select('.roo-brick-paragraph',true).first();
1706 A.setHeight(A.getWidth()+A.getPadding('tb'));if(this.bgimage.length){var B=this.el.select('.roo-brick-image-view',true).first();B.setWidth(A.getWidth());if(this.square){B.setHeight(A.getWidth());}this.el.setHeight(B.getHeight());A.setHeight(B.getHeight());
1707 }},enter:function(e,el){e.preventDefault();if(this.bgimage.length){this.el.select('.roo-brick-paragraph',true).first().setOpacity(0.9,true);this.el.select('.roo-brick-image-view',true).first().setOpacity(0.1,true);}},leave:function(e,el){e.preventDefault();
1708 if(this.bgimage.length){this.el.select('.roo-brick-paragraph',true).first().setOpacity(0,true);this.el.select('.roo-brick-image-view',true).first().setOpacity(1,true);}}});
1709 // Roo/bootstrap/form/NumberField.js
1710 Roo.bootstrap.form.NumberField=function(A){Roo.bootstrap.form.NumberField.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.NumberField,Roo.bootstrap.form.Input,{allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,allowZero:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,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",thousandsDelimiter:false,valueAlign:"left",getAutoCreate:function(){var A={tag:'input',type:'hidden',id:Roo.id(),cls:'hidden-number-input'}
1711 ;if(this.name){A.name=this.name;}this.name='';var B=Roo.bootstrap.form.NumberField.superclass.getAutoCreate.call(this);this.name=A.name;if(B.cn.length>0){B.cn.push(A);}return B;},initEvents:function(){Roo.bootstrap.form.NumberField.superclass.initEvents.call(this);
1712 var A="0123456789";if(this.allowDecimals){A+=this.decimalSeparator;}if(this.allowNegative){A+="-";}if(this.thousandsDelimiter){A+=",";}this.stripCharsRe=new RegExp('[^'+A+']','gi');var B=function(e){var k=e.getKey();var c=e.getCharCode();if((String.fromCharCode(c)=='.'||String.fromCharCode(c)=='-')&&A.indexOf(String.fromCharCode(c))===-1){e.stopEvent();
1713 return;}if(!Roo.isIE&&(e.isSpecialKey()||k==e.BACKSPACE||k==e.DELETE)){return;}if(A.indexOf(String.fromCharCode(c))===-1){e.stopEvent();}};this.el.on("keypress",B,this);},validateValue:function(A){if(!Roo.bootstrap.form.NumberField.superclass.validateValue.call(this,A)){return false;
1714 }var B=this.parseValue(A);if(isNaN(B)){this.markInvalid(String.format(this.nanText,A));return false;}if(B<this.minValue){this.markInvalid(String.format(this.minText,this.minValue));return false;}if(B>this.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue));
1715 return false;}return true;},getValue:function(){var v=this.hiddenEl().getValue();return this.fixPrecision(this.parseValue(v));},parseValue:function(A){if(this.thousandsDelimiter){A+="";r=new RegExp(",","g");A=A.replace(r,"");}A=parseFloat(String(A).replace(this.decimalSeparator,"."));
1716 return isNaN(A)?'':A;},fixPrecision:function(A){if(this.thousandsDelimiter){A+="";r=new RegExp(",","g");A=A.replace(r,"");}var B=isNaN(A);if(!this.allowDecimals||this.decimalPrecision==-1||B||!A){return B?'':A;}return parseFloat(A).toFixed(this.decimalPrecision);
1717 },setValue:function(v){v=String(this.fixPrecision(v)).replace(".",this.decimalSeparator);this.value=v;if(this.rendered){this.hiddenEl().dom.value=(v===null||v===undefined?'':v);this.inputEl().dom.value=(v=='')?'':Roo.util.Format.number(v,this.decimalPrecision,this.thousandsDelimiter||'');
1718 if(!this.allowZero&&v==='0'){this.hiddenEl().dom.value='';this.inputEl().dom.value='';}this.validate();}},decimalPrecisionFcn:function(v){return Math.floor(v);},beforeBlur:function(){var v=this.parseValue(this.getRawValue());if(v||v===0||v===''){this.setValue(v);
1719 }},hiddenEl:function(){return this.el.select('input.hidden-number-input',true).first();}});
1720 // Roo/bootstrap/DocumentSlider.js
1721 Roo.bootstrap.DocumentSlider=function(A){Roo.bootstrap.DocumentSlider.superclass.constructor.call(this,A);this.files=[];this.addEvents({"initial":true,"update":true,"click":true});};Roo.extend(Roo.bootstrap.DocumentSlider,Roo.bootstrap.Component,{files:false,indicator:0,getAutoCreate:function(){var A={tag:'div',cls:'roo-document-slider',cn:[{tag:'div',cls:'roo-document-slider-header',cn:[{tag:'div',cls:'roo-document-slider-header-title'}
1722 ]},{tag:'div',cls:'roo-document-slider-body',cn:[{tag:'div',cls:'roo-document-slider-prev',cn:[{tag:'i',cls:'fa fa-chevron-left'}]},{tag:'div',cls:'roo-document-slider-thumb',cn:[{tag:'img',cls:'roo-document-slider-image'}]},{tag:'div',cls:'roo-document-slider-next',cn:[{tag:'i',cls:'fa fa-chevron-right'}
1723 ]}]}]};return A;},initEvents:function(){this.headerEl=this.el.select('.roo-document-slider-header',true).first();this.headerEl.setVisibilityMode(Roo.Element.DISPLAY);this.titleEl=this.el.select('.roo-document-slider-header .roo-document-slider-header-title',true).first();
1724 this.titleEl.setVisibilityMode(Roo.Element.DISPLAY);this.bodyEl=this.el.select('.roo-document-slider-body',true).first();this.bodyEl.setVisibilityMode(Roo.Element.DISPLAY);this.thumbEl=this.el.select('.roo-document-slider-thumb',true).first();this.thumbEl.setVisibilityMode(Roo.Element.DISPLAY);
1725 this.imageEl=this.el.select('.roo-document-slider-image',true).first();this.imageEl.setVisibilityMode(Roo.Element.DISPLAY);this.prevIndicator=this.el.select('.roo-document-slider-prev i',true).first();this.prevIndicator.setVisibilityMode(Roo.Element.DISPLAY);
1726 this.nextIndicator=this.el.select('.roo-document-slider-next i',true).first();this.nextIndicator.setVisibilityMode(Roo.Element.DISPLAY);this.thumbEl.on('click',this.onClick,this);this.prevIndicator.on('click',this.prev,this);this.nextIndicator.on('click',this.next,this);
1727 },initial:function(){if(this.files.length){this.indicator=1;this.update()}this.fireEvent('initial',this);},update:function(){this.imageEl.attr('src',this.files[this.indicator-1]);this.titleEl.dom.innerHTML=String.format('{0} / {1}',this.indicator,this.files.length);
1728 this.prevIndicator.show();if(this.indicator==1){this.prevIndicator.hide();}this.nextIndicator.show();if(this.indicator==this.files.length){this.nextIndicator.hide();}this.thumbEl.scrollTo('top');this.fireEvent('update',this);},onClick:function(e){e.preventDefault();
1729 this.fireEvent('click',this);},prev:function(e){e.preventDefault();this.indicator=Math.max(1,this.indicator-1);this.update();},next:function(e){e.preventDefault();this.indicator=Math.min(this.files.length,this.indicator+1);this.update();}});
1730 // Roo/bootstrap/form/RadioSet.js
1731 Roo.bootstrap.form.RadioSet=function(A){Roo.bootstrap.form.RadioSet.superclass.constructor.call(this,A);this.radioes=[];Roo.bootstrap.form.RadioSet.register(this);this.addEvents({check:true,click:true});};Roo.extend(Roo.bootstrap.form.RadioSet,Roo.bootstrap.form.Input,{radioes:false,inline:true,weight:'',indicatorpos:'left',getAutoCreate:function(){var A={tag:'label',cls:'roo-radio-set-label',cn:[{tag:'span',html:this.fieldLabel}
1732 ]};if(Roo.bootstrap.version==3){if(this.indicatorpos=='left'){A.cn.unshift({tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'});}else{A.cn.push({tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'}
1733 );}}var B={tag:'div',cls:'roo-radio-set-items'};var C=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;if(C==='left'&&this.fieldLabel.length){B={cls:"roo-radio-set-right",cn:[B]};if(this.labelWidth>12){A.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;
1734 }if(this.labellg>0){A.cls+=' col-lg-'+this.labellg;B.cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){A.cls+=' col-md-'+this.labelmd;B.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){A.cls+=' col-sm-'+this.labelsm;B.cls+=' col-sm-'+(12-this.labelsm);
1735 }if(this.labelxs>0){A.cls+=' col-xs-'+this.labelxs;B.cls+=' col-xs-'+(12-this.labelxs);}}var D={tag:'div',cls:'roo-radio-set',cn:[{tag:'input',cls:'roo-radio-set-input',type:'hidden',name:this.name,value:this.value?this.value:''},A,B]};if(this.weight.length){D.cls+=' roo-radio-'+this.weight;
1736 }if(this.inline){D.cls+=' roo-radio-set-inline';}var E=this;['xs','sm','md','lg'].map(function(F){if(E[F]){D.cls+=' col-'+F+'-'+E[F];}});return D;},initEvents:function(){this.labelEl=this.el.select('.roo-radio-set-label',true).first();this.labelEl.setVisibilityMode(Roo.Element.DISPLAY);
1737 if(!this.fieldLabel.length){this.labelEl.hide();}this.itemsEl=this.el.select('.roo-radio-set-items',true).first();this.itemsEl.setVisibilityMode(Roo.Element.DISPLAY);this.indicator=this.indicatorEl();if(this.indicator){this.indicator.addClass('invisible');
1738 }this.originalValue=this.getValue();},inputEl:function(){return this.el.select('.roo-radio-set-input',true).first();},getChildContainer:function(){return this.itemsEl;},register:function(A){this.radioes.push(A);},validate:function(){if(this.getVisibilityEl().hasClass('hidden')){return true;
1739 }var A=false;Roo.each(this.radioes,function(i){if(!i.checked){return;}A=true;return false;});if(this.allowBlank){return true;}if(this.disabled||A){this.markValid();return true;}this.markInvalid();return false;},markValid:function(){if(this.labelEl.isVisible(true)&&this.indicatorEl()){this.indicatorEl().removeClass('visible');
1740 this.indicatorEl().addClass('invisible');}if(Roo.bootstrap.version==3){this.el.removeClass([this.invalidClass,this.validClass]);this.el.addClass(this.validClass);}else{this.el.removeClass(['is-invalid','is-valid']);this.el.addClass(['is-valid']);}this.fireEvent('valid',this);
1741 },markInvalid:function(A){if(this.allowBlank||this.disabled){return;}if(this.labelEl.isVisible(true)&&this.indicatorEl()){this.indicatorEl().removeClass('invisible');this.indicatorEl().addClass('visible');}if(Roo.bootstrap.version==3){this.el.removeClass([this.invalidClass,this.validClass]);
1742 this.el.addClass(this.invalidClass);}else{this.el.removeClass(['is-invalid','is-valid']);this.el.addClass(['is-invalid']);}this.fireEvent('invalid',this,A);},setValue:function(v,A){if(this.value===v){return;}this.value=v;if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v);
1743 }Roo.each(this.radioes,function(i){i.checked=false;i.el.removeClass('checked');});Roo.each(this.radioes,function(i){if(i.value===v||i.value.toString()===v.toString()){i.checked=true;i.el.addClass('checked');if(A!==true){this.fireEvent('check',this,i);}return false;
1744 }},this);this.validate();},clearInvalid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass]);this.fireEvent('valid',this);}});Roo.apply(Roo.bootstrap.form.RadioSet,{groups:{},register:function(A){this.groups[A.name]=A;
1745 },get:function(A){if(typeof(this.groups[A])=='undefined'){return false;}return this.groups[A];}});
1746 // Roo/bootstrap/SplitBar.js
1747 Roo.bootstrap.SplitBar=function(A){this.el=Roo.get(A.dragElement,true);this.el.dom.unselectable="on";this.resizingEl=Roo.get(A.resizingElement,true);this.orientation=A.orientation||Roo.bootstrap.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;
1748 this.useShim=false;this.shim=null;if(!A.existingProxy){this.proxy=Roo.bootstrap.SplitBar.createProxy(this.orientation);}else{this.proxy=Roo.get(A.existingProxy).dom;}this.dd=new Roo.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);
1749 this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Roo.bootstrap.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Roo.bootstrap.SplitBar.HORIZONTAL){this.placement=A.placement||(this.el.getX()>this.resizingEl.getX()?Roo.bootstrap.SplitBar.LEFT:Roo.bootstrap.SplitBar.RIGHT);
1750 this.el.addClass("roo-splitbar-h");}else{this.placement=A.placement||(this.el.getY()>this.resizingEl.getY()?Roo.bootstrap.SplitBar.TOP:Roo.bootstrap.SplitBar.BOTTOM);this.el.addClass("roo-splitbar-v");}this.addEvents({"resize":true,"moved":true,"beforeresize":true,"beforeapply":true}
1751 );Roo.util.Observable.call(this);};Roo.extend(Roo.bootstrap.SplitBar,Roo.util.Observable,{onStartProxyDrag:function(x,y){this.fireEvent("beforeresize",this);if(!this.overlay){var o=Roo.DomHelper.insertFirst(document.body,{cls:"roo-drag-overlay",html:"&#160;"}
1752 ,true);o.unselectable();o.enableDisplayMode("block");Roo.bootstrap.SplitBar.prototype.overlay=o;}this.overlay.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.overlay.show();Roo.get(this.proxy).setDisplayed("block");var A=this.adapter.getElementSize(this);
1753 this.activeMinSize=this.getMinimumSize();;this.activeMaxSize=this.getMaximumSize();;var c1=A-this.activeMinSize;var c2=Math.max(this.activeMaxSize-A,0);if(this.orientation==Roo.bootstrap.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Roo.bootstrap.SplitBar.LEFT?c1:c2,this.placement==Roo.bootstrap.SplitBar.LEFT?c2:c1);
1754 this.dd.setYConstraint(0,0);}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Roo.bootstrap.SplitBar.TOP?c1:c2,this.placement==Roo.bootstrap.SplitBar.TOP?c2:c1);}this.dragSpecs.startSize=A;this.dragSpecs.startPoint=[x,y];
1755 Roo.dd.DDProxy.prototype.b4StartDrag.call(this.dd,x,y);},onEndProxyDrag:function(e){Roo.get(this.proxy).setDisplayed(false);var A=Roo.lib.Event.getXY(e);if(this.overlay){this.overlay.hide();}var B;if(this.orientation==Roo.bootstrap.SplitBar.HORIZONTAL){B=this.dragSpecs.startSize+(this.placement==Roo.bootstrap.SplitBar.LEFT?A[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-A[0]);
1756 }else{B=this.dragSpecs.startSize+(this.placement==Roo.bootstrap.SplitBar.TOP?A[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-A[1]);}B=Math.min(Math.max(B,this.activeMinSize),this.activeMaxSize);if(B!=this.dragSpecs.startSize){if(this.fireEvent('beforeapply',this,B)!==false){this.adapter.setElementSize(this,B);
1757 this.fireEvent("moved",this,B);this.fireEvent("resize",this,B);}}},getAdapter:function(){return this.adapter;},setAdapter:function(A){this.adapter=A;this.adapter.init(this);},getMinimumSize:function(){return this.minSize;},setMinimumSize:function(A){this.minSize=A;
1758 },getMaximumSize:function(){return this.maxSize;},setMaximumSize:function(A){this.maxSize=A;},setCurrentSize:function(A){var B=this.animate;this.animate=false;this.adapter.setElementSize(this,A);this.animate=B;},destroy:function(A){if(this.shim){this.shim.remove();
1759 }this.dd.unreg();this.proxy.parentNode.removeChild(this.proxy);if(A){this.el.remove();}}});Roo.bootstrap.SplitBar.createProxy=function(A){var B=new Roo.Element(document.createElement("div"));B.unselectable();var C='roo-splitbar-proxy';B.addClass(C+' '+(A==Roo.bootstrap.SplitBar.HORIZONTAL?C+'-h':C+'-v'));
1760 document.body.appendChild(B.dom);return B.dom;};Roo.bootstrap.SplitBar.BasicLayoutAdapter=function(){};Roo.bootstrap.SplitBar.BasicLayoutAdapter.prototype={init:function(s){},getElementSize:function(s){if(s.orientation==Roo.bootstrap.SplitBar.HORIZONTAL){return s.resizingEl.getWidth();
1761 }else{return s.resizingEl.getHeight();}},setElementSize:function(s,A,B){if(s.orientation==Roo.bootstrap.SplitBar.HORIZONTAL){if(!s.animate){s.resizingEl.setWidth(A);if(B){B(s,A);}}else{s.resizingEl.setWidth(A,true,.1,B,'easeOut');}}else{if(!s.animate){s.resizingEl.setHeight(A);
1762 if(B){B(s,A);}}else{s.resizingEl.setHeight(A,true,.1,B,'easeOut');}}}};Roo.bootstrap.SplitBar.AbsoluteLayoutAdapter=function(A){this.basic=new Roo.bootstrap.SplitBar.BasicLayoutAdapter();this.container=Roo.get(A);};Roo.bootstrap.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(s){this.basic.init(s);
1763 },getElementSize:function(s){return this.basic.getElementSize(s);},setElementSize:function(s,A,B){this.basic.setElementSize(s,A,this.moveSplitter.createDelegate(this,[s]));},moveSplitter:function(s){var A=Roo.bootstrap.SplitBar;switch(s.placement){case A.LEFT:s.el.setX(s.resizingEl.getRight());
1764 break;case A.RIGHT:s.el.setStyle("right",(this.container.getWidth()-s.resizingEl.getLeft())+"px");break;case A.TOP:s.el.setY(s.resizingEl.getBottom());break;case A.BOTTOM:s.el.setY(s.resizingEl.getTop()-s.el.getHeight());break;}}};Roo.bootstrap.SplitBar.VERTICAL=1;
1765 Roo.bootstrap.SplitBar.HORIZONTAL=2;Roo.bootstrap.SplitBar.LEFT=1;Roo.bootstrap.SplitBar.RIGHT=2;Roo.bootstrap.SplitBar.TOP=3;Roo.bootstrap.SplitBar.BOTTOM=4;
1766 // Roo/bootstrap/layout/Manager.js
1767 Roo.bootstrap.layout.Manager=function(A){this.monitorWindowResize=true;Roo.bootstrap.layout.Manager.superclass.constructor.call(this,A);this.regions={};this.addEvents({"layout":true,"regionresized":true,"regioncollapsed":true,"regionexpanded":true});this.updating=false;
1768 if(A.el){this.el=Roo.get(A.el);this.initEvents();}};Roo.extend(Roo.bootstrap.layout.Manager,Roo.bootstrap.Component,{regions:null,monitorWindowResize:true,updating:false,onRender:function(ct,A){if(!this.el){this.el=Roo.get(ct);this.initEvents();}},initEvents:function(){if(this.el.dom==document.body&&Roo.isIE&&!config.allowScroll){document.body.scroll="no";
1769 }else if(this.el.dom!=document.body&&this.el.getStyle('position')=='static'){this.el.position('relative');}this.id=this.el.id;this.el.addClass("roo-layout-container");Roo.EventManager.onWindowResize(this.onWindowResize,this,true);if(this.el.dom!=document.body){this.el.on('resize',this.layout,this);
1770 this.el.on('show',this.layout,this);}},isUpdating:function(){return this.updating;},beginUpdate:function(){this.updating=true;},endUpdate:function(A){this.updating=false;if(!A){this.layout();}},layout:function(){},onRegionResized:function(A,B){this.fireEvent("regionresized",A,B);
1771 this.layout();},onRegionCollapsed:function(A){this.fireEvent("regioncollapsed",A);},onRegionExpanded:function(A){this.fireEvent("regionexpanded",A);},getViewSize:function(){var A;if(this.el.dom!=document.body){A=this.el.getSize();}else{A={width:Roo.lib.Dom.getViewWidth(),height:Roo.lib.Dom.getViewHeight()}
1772 ;}A.width-=this.el.getBorderWidth("lr")-this.el.getPadding("lr");A.height-=this.el.getBorderWidth("tb")-this.el.getPadding("tb");return A;},getEl:function(){return this.el;},getRegion:function(A){return this.regions[A.toLowerCase()];},onWindowResize:function(){if(this.monitorWindowResize){this.layout();
1773 }}});
1774 // Roo/bootstrap/layout/Border.js
1775 Roo.bootstrap.layout.Border=function(A){A=A||{};Roo.bootstrap.layout.Border.superclass.constructor.call(this,A);Roo.each(Roo.bootstrap.layout.Border.regions,function(B){if(A[B]){A[B].region=B;this.addRegion(A[B]);}},this);};Roo.bootstrap.layout.Border.regions=["center","north","south","east","west"];
1776 Roo.extend(Roo.bootstrap.layout.Border,Roo.bootstrap.layout.Manager,{parent:false,addRegion:function(A){if(!this.regions[A.region]){var r=this.factory(A);this.bindRegion(r);}return this.regions[A.region];},bindRegion:function(r){this.regions[r.config.region]=r;
1777 r.on("visibilitychange",this.layout,this);r.on("paneladded",this.layout,this);r.on("panelremoved",this.layout,this);r.on("invalidated",this.layout,this);r.on("resized",this.onRegionResized,this);r.on("collapsed",this.onRegionCollapsed,this);r.on("expanded",this.onRegionExpanded,this);
1778 },layout:function(){if(this.updating){return;}Roo.each(Roo.bootstrap.layout.Border.regions,function(N){if(this.regions[N]&&!this.regions[N].bodyEl){this.regions[N].onRender(this.el)}},this);var A=this.getViewSize();var w=A.width;var h=A.height;var B=w;var C=h;
1779 var D=0;var E=0;var rs=this.regions;var F=rs["north"];var G=rs["south"];var H=rs["west"];var I=rs["east"];var J=rs["center"];if(F&&F.isVisible()){var b=F.getBox();var m=F.getMargins();b.width=w-(m.left+m.right);b.x=m.left;b.y=m.top;D=b.height+b.y+m.bottom;
1780 C-=D;F.updateBox(this.safeBox(b));}if(G&&G.isVisible()){var b=G.getBox();var m=G.getMargins();b.width=w-(m.left+m.right);b.x=m.left;var K=(b.height+m.top+m.bottom);b.y=h-K+m.top;C-=K;G.updateBox(this.safeBox(b));}if(H&&H.isVisible()){var b=H.getBox();var m=H.getMargins();
1781 b.height=C-(m.top+m.bottom);b.x=m.left;b.y=D+m.top;var L=(b.width+m.left+m.right);E+=L;B-=L;H.updateBox(this.safeBox(b));}if(I&&I.isVisible()){var b=I.getBox();var m=I.getMargins();b.height=C-(m.top+m.bottom);var L=(b.width+m.left+m.right);b.x=w-L+m.left;
1782 b.y=D+m.top;B-=L;I.updateBox(this.safeBox(b));}if(J){var m=J.getMargins();var M={x:E+m.left,y:D+m.top,width:B-(m.left+m.right),height:C-(m.top+m.bottom)};J.updateBox(this.safeBox(M));}this.el.repaint();this.fireEvent("layout",this);},safeBox:function(A){A.width=Math.max(0,A.width);
1783 A.height=Math.max(0,A.height);return A;},add:function(A,B){A=A.toLowerCase();return this.regions[A].add(B);},remove:function(A,B){A=A.toLowerCase();return this.regions[A].remove(B);},findPanel:function(A){var rs=this.regions;for(var B in rs){if(typeof rs[B]!="function"){var p=rs[B].getPanel(A);
1784 if(p){return p;}}}return null;},showPanel:function(A){var rs=this.regions;for(var B in rs){var r=rs[B];if(typeof r!="function"){if(r.hasPanel(A)){return r.showPanel(A);}}}return null;},addxtype:function(A){var B=false;if(typeof(A.region)=='undefined'){Roo.log("Failed to add Panel, region was not set");
1785 Roo.log(A);return false;}var C=A.region;delete A.region;var D=[];if(A.items){D=A.items;delete A.items;}var nb=false;if(C=='center'){Roo.log("Center: "+A.title);}switch(A.xtype){case 'Content':case 'Scroll':case 'View':A.autoCreate=A.autoCreate||true;B=new A.xns[A.xtype](A);
1786 this.add(C,B);break;case 'Nest':var E=A.layout;E.el=this.el.createChild();E.items=E.items||[];delete A.layout;D=E.items;if(C=='center'&&this.active&&this.getRegion('center').panels.length<1){A.background=false;}A.layout=new Roo.bootstrap.layout.Border(E);
1787 B=new A.xns[A.xtype](A);this.add(C,B);nb={};break;case 'Grid':if(C=='center'&&this.active){A.background=false;}B=new A.xns[A.xtype](A);this.add(C,B);break;case 'Border':B=this;break;default:Roo.log(A);throw "Can not add '"+A.xtype+"' to Border";return null;
1788 }this.beginUpdate();var C='';var F={};Roo.each(D,function(i){C=nb&&i.region?i.region:false;var G=B.addxtype(i);if(C){nb[C]=nb[C]==undefined?0:nb[C]+1;if(!i.background){F[C]=nb[C];}}});this.endUpdate();if(nb){for(var r in F){C=this.getRegion(r);if(C){C.showPanel(F[r]);
1789 }}}return B;},factory:function(A){var B=Roo.bootstrap.layout.Border.regions;var C=A.region;A.mgr=this;var r=Roo.bootstrap.layout;Roo.log(C);switch(C){case "north":return new r.North(A);case "south":return new r.South(A);case "east":return new r.East(A);case "west":return new r.West(A);
1790 case "center":return new r.Center(A);}throw 'Layout region "'+C+'" not supported.';}});
1791 // Roo/bootstrap/layout/Basic.js
1792 Roo.bootstrap.layout.Basic=function(A){this.mgr=A.mgr;this.position=A.region;var B=A.skipConfig;this.events={"beforeremove":true,"invalidated":true,"visibilitychange":true,"paneladded":true,"panelremoved":true,"beforecollapse":true,"collapsed":true,"expanded":true,"slideshow":true,"slidehide":true,"panelactivated":true,"resized":true}
1793 ;this.panels=new Roo.util.MixedCollection();this.panels.getKey=this.getPanelId.createDelegate(this);this.box=null;this.activePanel=null;if(A.listeners||A.events){Roo.bootstrap.layout.Basic.superclass.constructor.call(this,{listeners:A.listeners||{},events:A.events||{}
1794 });}if(B!==true){this.applyConfig(A);}};Roo.extend(Roo.bootstrap.layout.Basic,Roo.util.Observable,{getPanelId:function(p){return p.getId();},applyConfig:function(A){this.margins=A.margins||this.margins||{top:0,left:0,right:0,bottom:0};this.config=A;},resizeTo:function(A){var el=this.el?this.el:(this.activePanel?this.activePanel.getEl():null);
1795 if(el){switch(this.position){case "east":case "west":el.setWidth(A);this.fireEvent("resized",this,A);break;case "north":case "south":el.setHeight(A);this.fireEvent("resized",this,A);break;}}},getBox:function(){return this.activePanel?this.activePanel.getEl().getBox(false,true):null;
1796 },getMargins:function(){return this.margins;},updateBox:function(A){this.box=A;var el=this.activePanel.getEl();el.dom.style.left=A.x+"px";el.dom.style.top=A.y+"px";this.activePanel.setSize(A.width,A.height);},getEl:function(){return this.activePanel;},isVisible:function(){return this.activePanel?true:false;
1797 },setActivePanel:function(A){A=this.getPanel(A);if(this.activePanel&&this.activePanel!=A){this.activePanel.setActiveState(false);this.activePanel.getEl().setLeftTop(-10000,-10000);}this.activePanel=A;A.setActiveState(true);if(this.box){A.setSize(this.box.width,this.box.height);
1798 }this.fireEvent("panelactivated",this,A);this.fireEvent("invalidated");},showPanel:function(A){A=this.getPanel(A);if(A){this.setActivePanel(A);}return A;},getActivePanel:function(){return this.activePanel;},add:function(A){if(arguments.length>1){for(var i=0,B=arguments.length;
1799 i<B;i++){this.add(arguments[i]);}return null;}if(this.hasPanel(A)){this.showPanel(A);return A;}var el=A.getEl();if(el.dom.parentNode!=this.mgr.el.dom){this.mgr.el.dom.appendChild(el.dom);}if(A.setRegion){A.setRegion(this);}this.panels.add(A);el.setStyle("position","absolute");
1800 if(!A.background){this.setActivePanel(A);if(this.config.initialSize&&this.panels.getCount()==1){this.resizeTo(this.config.initialSize);}}this.fireEvent("paneladded",this,A);return A;},hasPanel:function(A){if(typeof A=="object"){A=A.getId();}return this.getPanel(A)?true:false;
1801 },remove:function(A,B){A=this.getPanel(A);if(!A){return null;}var e={};this.fireEvent("beforeremove",this,A,e);if(e.cancel===true){return null;}var C=A.getId();this.panels.removeKey(C);return A;},getPanel:function(id){if(typeof id=="object"){return id;}return this.panels.get(id);
1802 },getPosition:function(){return this.position;}});
1803 // Roo/bootstrap/layout/Region.js
1804 Roo.bootstrap.layout.Region=function(A){this.applyConfig(A);var B=A.mgr;var C=A.region;A.skipConfig=true;Roo.bootstrap.layout.Region.superclass.constructor.call(this,A);if(B.el){this.onRender(B.el);}this.visible=true;this.collapsed=false;this.unrendered_panels=[];
1805 };Roo.extend(Roo.bootstrap.layout.Region,Roo.bootstrap.layout.Basic,{position:'',unrendered_panels:null,tabPosition:false,mgr:false,createBody:function(){this.bodyEl=this.el.createChild({tag:"div",cls:"roo-layout-panel-body tab-content"});},onRender:function(A,B){var dh=Roo.DomHelper;
1806 this.el=dh.append(A.dom,{tag:"div",cls:(this.config.cls||'')+" roo-layout-region roo-layout-panel roo-layout-panel-"+this.position},true);this.titleEl=dh.append(this.el.dom,{tag:"div",unselectable:"on",cls:"roo-unselectable roo-layout-panel-hd breadcrumb roo-layout-title-"+this.position,children:[{tag:"span",cls:"roo-unselectable roo-layout-panel-hd-text",unselectable:"on",html:"&#160;"}
1807 ,{tag:"div",cls:"roo-unselectable roo-layout-panel-hd-tools",unselectable:"on"}]},true);this.titleEl.enableDisplayMode();this.titleTextEl=this.titleEl.dom.firstChild;this.tools=Roo.get(this.titleEl.dom.childNodes[1],true);this.createBody(this.config);if(this.config.hideWhenEmpty){this.hide();
1808 this.on("paneladded",this.validateVisibility,this);this.on("panelremoved",this.validateVisibility,this);}if(this.autoScroll){this.bodyEl.setStyle("overflow","auto");}else{this.bodyEl.setStyle("overflow",this.config.overflow||'hidden');}if((!this.config.titlebar&&!this.config.title)||this.config.titlebar===false){this.titleEl.hide();
1809 }else{this.titleEl.show();if(this.config.title){this.titleTextEl.innerHTML=this.config.title;}}if(this.config.collapsed){this.collapse(true);}if(this.config.hidden){this.hide();}if(this.unrendered_panels&&this.unrendered_panels.length){for(var i=0;i<this.unrendered_panels.length;
1810 i++){this.add(this.unrendered_panels[i]);}this.unrendered_panels=null;}},applyConfig:function(c){this.margins=c.margins||this.margins||{top:0,left:0,right:0,bottom:0};this.tabPosition=['top','bottom','west'].indexOf(c.tabPosition)>-1?c.tabPosition:"top";this.autoScroll=c.autoScroll||false;
1811 this.duration=c.duration||.30;this.slideDuration=c.slideDuration||.45;this.config=c;},isVisible:function(){return this.visible;},getBox:function(){var b;b=this.el.getBox(false,true);return b;},getMargins:function(){return this.margins;},updateBox:function(A){if(!this.bodyEl){return;
1812 }this.box=A;if(!this.collapsed){this.el.dom.style.left=A.x+"px";this.el.dom.style.top=A.y+"px";this.updateBody(A.width,A.height);}else{this.collapsedEl.dom.style.left=A.x+"px";this.collapsedEl.dom.style.top=A.y+"px";this.collapsedEl.setSize(A.width,A.height);
1813 }if(this.tabs){this.tabs.autoSizeTabs();}},updateBody:function(w,h){if(w!==null){this.el.setWidth(w);w-=this.el.getBorderWidth("rl");if(this.config.adjustments){w+=this.config.adjustments[0];}}if(h!==null&&h>0){this.el.setHeight(h);h=this.titleEl&&this.titleEl.isDisplayed()?h-(this.titleEl.getHeight()||0):h;
1814 h-=this.el.getBorderWidth("tb");if(this.config.adjustments){h+=this.config.adjustments[1];}this.bodyEl.setHeight(h);if(this.tabs){h=this.tabs.syncHeight(h);}}if(this.panelSize){w=w!==null?w:this.panelSize.width;h=h!==null?h:this.panelSize.height;}if(this.activePanel){var el=this.activePanel.getEl();
1815 w=w!==null?w:el.getWidth();h=h!==null?h:el.getHeight();this.panelSize={width:w,height:h};this.activePanel.setSize(w,h);}if(Roo.isIE&&this.tabs){this.tabs.el.repaint();}},getEl:function(){return this.el;},hide:function(){this.el.dom.style.left="-2000px";this.el.hide();
1816 this.visible=false;this.fireEvent("visibilitychange",this,false);},show:function(){this.el.show();this.visible=true;this.fireEvent("visibilitychange",this,true);},animateCollapse:function(){},animateExpand:function(){},initTabs:function(){var ts=new Roo.bootstrap.panel.Tabs({el:this.bodyEl.dom,region:this,tabPosition:this.tabPosition?this.tabPosition:'top',disableTooltips:this.config.disableTabTips,toolbar:this.config.toolbar}
1817 );if(this.config.hideTabs){ts.stripWrap.setDisplayed(false);}this.tabs=ts;ts.resizeTabs=this.config.resizeTabs===true;ts.minTabWidth=this.config.minTabWidth||40;ts.maxTabWidth=this.config.maxTabWidth||250;ts.preferredTabWidth=this.config.preferredTabWidth||150;
1818 ts.monitorResize=false;ts.bodyEl.addClass('roo-layout-tabs-body');this.panels.each(this.initPanelAsTab,this);},initPanelAsTab:function(A){var ti=this.tabs.addTab(A.getEl().id,A.getTitle(),null,this.config.closeOnTab&&A.isClosable(),A.tpl);if(A.tabTip!==undefined){ti.setTooltip(A.tabTip);
1819 }ti.on("activate",function(){this.setActivePanel(A);},this);if(this.config.closeOnTab){ti.on("beforeclose",function(t,e){e.cancel=true;this.remove(A);},this);}A.tabItem=ti;return ti;},updatePanelTitle:function(A,B){if(this.activePanel==A){this.updateTitle(B);
1820 }if(this.tabs){var ti=this.tabs.getTab(A.getEl().id);ti.setText(B);if(A.tabTip!==undefined){ti.setTooltip(A.tabTip);}}},updateTitle:function(A){if(this.titleTextEl&&!this.config.title){this.titleTextEl.innerHTML=(typeof A!="undefined"&&A.length>0?A:"&#160;");
1821 }},setActivePanel:function(A){A=this.getPanel(A);if(this.activePanel&&this.activePanel!=A){if(this.activePanel.setActiveState(false)===false){return;}}this.activePanel=A;A.setActiveState(true);if(this.panelSize){A.setSize(this.panelSize.width,this.panelSize.height);
1822 }if(this.closeBtn){this.closeBtn.setVisible(!this.config.closeOnTab&&!this.isSlid&&A.isClosable());}this.updateTitle(A.getTitle());if(this.tabs){this.fireEvent("invalidated",this);}this.fireEvent("panelactivated",this,A);},showPanel:function(A){A=this.getPanel(A);
1823 if(A){if(this.tabs){var B=this.tabs.getTab(A.getEl().id);if(B.isHidden()){this.tabs.unhideTab(B.id);}B.activate();}else{this.setActivePanel(A);}}return A;},getActivePanel:function(){return this.activePanel;},validateVisibility:function(){if(this.panels.getCount()<1){this.updateTitle("&#160;");
1824 this.closeBtn.hide();this.hide();}else{if(!this.isVisible()){this.show();}}},add:function(A){if(arguments.length>1){for(var i=0,B=arguments.length;i<B;i++){this.add(arguments[i]);}return null;}if(!this.bodyEl){this.unrendered_panels.push(A);return A;}if(this.hasPanel(A)){this.showPanel(A);
1825 return A;}A.setRegion(this);this.panels.add(A);if(!this.tabs){this.initTabs();}else{this.initPanelAsTab(A);}if(A.background!==true){this.tabs.activate(A.getEl().id);}this.fireEvent("paneladded",this,A);return A;},hidePanel:function(A){if(this.tabs&&(A=this.getPanel(A))){this.tabs.hideTab(A.getEl().id);
1826 }},unhidePanel:function(A){if(this.tabs&&(A=this.getPanel(A))){this.tabs.unhideTab(A.getEl().id);}},clearPanels:function(){while(this.panels.getCount()>0){this.remove(this.panels.first());}},remove:function(A,B){A=this.getPanel(A);if(!A){return null;}var e={}
1827 ;this.fireEvent("beforeremove",this,A,e);if(e.cancel===true){return null;}B=(typeof B!="undefined"?B:(this.config.preservePanels===true||A.preserve===true));var C=A.getId();this.panels.removeKey(C);if(B){document.body.appendChild(A.getEl().dom);}if(this.tabs){this.tabs.removeTab(A.getEl().id);
1828 }else if(!B){this.bodyEl.dom.removeChild(A.getEl().dom);}if(this.panels.getCount()==1&&this.tabs&&!this.config.alwaysShowTabs){var p=this.panels.first();var D=document.createElement("div");D.appendChild(p.getEl().dom);this.bodyEl.update("");this.bodyEl.dom.appendChild(p.getEl().dom);
1829 D=null;this.updateTitle(p.getTitle());this.tabs=null;this.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");this.setActivePanel(p);}A.setRegion(null);if(this.activePanel==A){this.activePanel=null;}if(this.config.autoDestroy!==false&&B!==true){try{A.destroy();
1830 }catch(e){}}this.fireEvent("panelremoved",this,A);return A;},getTabs:function(){return this.tabs;},createTool:function(A,B){var C=Roo.DomHelper.append(A,{tag:"div",cls:"x-layout-tools-button",children:[{tag:"div",cls:"roo-layout-tools-button-inner "+B,html:"&#160;"}
1831 ]},true);C.addClassOnOver("roo-layout-tools-button-over");return C;}});
1832 // Roo/bootstrap/layout/Split.js
1833 Roo.bootstrap.layout.Split=function(A){this.cursor=A.cursor;Roo.bootstrap.layout.Split.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.layout.Split,Roo.bootstrap.layout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,applyConfig:function(A){Roo.bootstrap.layout.Split.superclass.applyConfig.call(this,A);
1834 },onRender:function(A,B){Roo.bootstrap.layout.Split.superclass.onRender.call(this,A,B);if(!this.config.split){return;}if(!this.split){var C=Roo.DomHelper.append(A.dom,{tag:"div",id:this.el.id+"-split",cls:"roo-layout-split roo-layout-split-"+this.position,html:"&#160;"}
1835 );Roo.log([this.position,this.orientation]);this.split=new Roo.bootstrap.SplitBar({dragElement:C,resizingElement:this.el,orientation:this.orientation});this.split.on("moved",this.onSplitMove,this);this.split.useShim=this.config.useShim===true;this.split.getMaximumSize=this[this.position=='north'||this.position=='south'?'getVMaxSize':'getHMaxSize'].createDelegate(this);
1836 if(this.useSplitTips){this.split.el.dom.title=this.config.collapsible?this.collapsibleSplitTip:this.splitTip;}}if(typeof this.config.minSize!="undefined"){this.split.minSize=this.config.minSize;}if(typeof this.config.maxSize!="undefined"){this.split.maxSize=this.config.maxSize;
1837 }if(this.config.hideWhenEmpty||this.config.hidden||this.config.collapsed){this.hideSplitter();}},getHMaxSize:function(){var A=this.config.maxSize||10000;var B=this.mgr.getRegion("center");return Math.min(A,(this.el.getWidth()+B.getEl().getWidth())-B.getMinWidth());
1838 },getVMaxSize:function(){var A=this.config.maxSize||10000;var B=this.mgr.getRegion("center");return Math.min(A,(this.el.getHeight()+B.getEl().getHeight())-B.getMinHeight());},onSplitMove:function(A,B){this.fireEvent("resized",this,B);},getSplitBar:function(){return this.split;
1839 },hide:function(){this.hideSplitter();Roo.bootstrap.layout.Split.superclass.hide.call(this);},hideSplitter:function(){if(this.split){this.split.el.setLocation(-2000,-2000);this.split.el.hide();}},show:function(){if(this.split){this.split.el.show();}Roo.bootstrap.layout.Split.superclass.show.call(this);
1840 },beforeSlide:function(){if(Roo.isGecko){this.bodyEl.clip();if(this.tabs){this.tabs.bodyEl.clip();}if(this.activePanel){this.activePanel.getEl().clip();if(this.activePanel.beforeSlide){this.activePanel.beforeSlide();}}}},afterSlide:function(){if(Roo.isGecko){this.bodyEl.unclip();
1841 if(this.tabs){this.tabs.bodyEl.unclip();}if(this.activePanel){this.activePanel.getEl().unclip();if(this.activePanel.afterSlide){this.activePanel.afterSlide();}}}},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){var st=new Roo.util.DelayedTask(this.slideIn,this);
1842 this.autoHideHd={"mouseout":function(e){if(!e.within(this.el,true)){st.delay(500);}},"mouseover":function(e){st.cancel();},scope:this};}this.el.on(this.autoHideHd);}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);
1843 this.el.un("mouseover",this.autoHideHd.mouseover);}},clearMonitor:function(){Roo.get(document).un("click",this.slideInIf,this);},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return;}this.isSlid=true;if(this.collapseBtn){this.collapseBtn.hide();
1844 }this.closeBtnState=this.closeBtn.getStyle('display');this.closeBtn.hide();if(this.stickBtn){this.stickBtn.show();}this.el.show();this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.beforeSlide();this.el.setStyle("z-index",10001);this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();
1845 this.initAutoHide();Roo.get(document).on("click",this.slideInIf,this);this.fireEvent("slideshow",this);},scope:this,block:true});},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");if(this.collapseBtn){this.collapseBtn.show();
1846 }this.closeBtn.setStyle('display',this.closeBtnState);if(this.stickBtn){this.stickBtn.hide();}this.fireEvent("slidehide",this);},slideIn:function(cb){if(!this.isSlid||this.el.hasActiveFx()){Roo.callback(cb);return;}this.isSlid=false;this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.setLeftTop(-10000,-10000);
1847 this.afterSlide();this.afterSlideIn();Roo.callback(cb);},scope:this,block:true});},slideInIf:function(e){if(!e.within(this.el)){this.slideIn();}},animateCollapse:function(){this.beforeSlide();this.el.setStyle("z-index",20000);var A=this.getSlideAnchor();this.el.slideOut(A,{callback:function(){this.el.setStyle("z-index","");
1848 this.collapsedEl.slideIn(A,{duration:.3});this.afterSlide();this.el.setLocation(-10000,-10000);this.el.hide();this.fireEvent("collapsed",this);},scope:this,block:true});},animateExpand:function(){this.beforeSlide();this.el.alignTo(this.collapsedEl,this.getCollapseAnchor(),this.getExpandAdj());
1849 this.el.setStyle("z-index",20000);this.collapsedEl.hide({duration:.1});this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.el.setStyle("z-index","");this.afterSlide();if(this.split){this.split.el.show();}this.fireEvent("invalidated",this);this.fireEvent("expanded",this);
1850 },scope:this,block:true});},anchors:{"west":"left","east":"right","north":"top","south":"bottom"},sanchors:{"west":"l","east":"r","north":"t","south":"b"},canchors:{"west":"tl-tr","east":"tr-tl","north":"tl-bl","south":"bl-tl"},getAnchor:function(){return this.anchors[this.position];
1851 },getCollapseAnchor:function(){return this.canchors[this.position];},getSlideAnchor:function(){return this.sanchors[this.position];},getAlignAdj:function(){var cm=this.cmargins;switch(this.position){case "west":return [0,0];break;case "east":return [0,0];
1852 break;case "north":return [0,0];break;case "south":return [0,0];break;}},getExpandAdj:function(){var c=this.collapsedEl,cm=this.cmargins;switch(this.position){case "west":return [-(cm.right+c.getWidth()+cm.left),0];break;case "east":return [cm.right+c.getWidth()+cm.left,0];
1853 break;case "north":return [0,-(cm.top+cm.bottom+c.getHeight())];break;case "south":return [0,cm.top+cm.bottom+c.getHeight()];break;}}});
1854 // Roo/bootstrap/layout/Center.js
1855 Roo.bootstrap.layout.Center=function(A){A.region="center";Roo.bootstrap.layout.Region.call(this,A);this.visible=true;this.minWidth=A.minWidth||20;this.minHeight=A.minHeight||20;};Roo.extend(Roo.bootstrap.layout.Center,Roo.bootstrap.layout.Region,{hide:function(){}
1856 ,show:function(){},getMinWidth:function(){return this.minWidth;},getMinHeight:function(){return this.minHeight;}});
1857 // Roo/bootstrap/layout/North.js
1858 Roo.bootstrap.layout.North=function(A){A.region='north';A.cursor='n-resize';Roo.bootstrap.layout.Split.call(this,A);if(this.split){this.split.placement=Roo.bootstrap.SplitBar.TOP;this.split.orientation=Roo.bootstrap.SplitBar.VERTICAL;this.split.el.addClass("roo-layout-split-v");
1859 }};Roo.extend(Roo.bootstrap.layout.North,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.VERTICAL,onRender:function(A,B){Roo.bootstrap.layout.Split.prototype.onRender.call(this,A,B);var C=this.config.initialSize||this.config.height;if(this.el&&typeof C!="undefined"){this.el.setHeight(C);
1860 }},getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){A.height+=this.split.el.getHeight();}return A;},updateBox:function(A){if(this.split&&!this.collapsed){A.height-=this.split.el.getHeight();this.split.el.setLeft(A.x);
1861 this.split.el.setTop(A.y+A.height);this.split.el.setWidth(A.width);}if(this.collapsed){this.updateBody(A.width,null);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}});
1862 // Roo/bootstrap/layout/South.js
1863 Roo.bootstrap.layout.South=function(A){A.region='south';A.cursor='s-resize';Roo.bootstrap.layout.Split.call(this,A);if(this.split){this.split.placement=Roo.bootstrap.SplitBar.BOTTOM;this.split.orientation=Roo.bootstrap.SplitBar.VERTICAL;this.split.el.addClass("roo-layout-split-v");
1864 }};Roo.extend(Roo.bootstrap.layout.South,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.VERTICAL,onRender:function(A,B){Roo.bootstrap.layout.Split.prototype.onRender.call(this,A,B);var C=this.config.initialSize||this.config.height;if(this.el&&typeof C!="undefined"){this.el.setHeight(C);
1865 }},getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){var sh=this.split.el.getHeight();A.height+=sh;A.y-=sh;}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sh=this.split.el.getHeight();
1866 A.height-=sh;A.y+=sh;this.split.el.setLeft(A.x);this.split.el.setTop(A.y-sh);this.split.el.setWidth(A.width);}if(this.collapsed){this.updateBody(A.width,null);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}});
1867 // Roo/bootstrap/layout/East.js
1868 Roo.bootstrap.layout.East=function(A){A.region="east";A.cursor="e-resize";Roo.bootstrap.layout.Split.call(this,A);if(this.split){this.split.placement=Roo.bootstrap.SplitBar.RIGHT;this.split.orientation=Roo.bootstrap.SplitBar.HORIZONTAL;this.split.el.addClass("roo-layout-split-h");
1869 }};Roo.extend(Roo.bootstrap.layout.East,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.HORIZONTAL,onRender:function(A,B){Roo.bootstrap.layout.Split.prototype.onRender.call(this,A,B);var C=this.config.initialSize||this.config.width;if(this.el&&typeof C!="undefined"){this.el.setWidth(C);
1870 }},getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){var sw=this.split.el.getWidth();A.width+=sw;A.x-=sw;}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();
1871 A.width-=sw;this.split.el.setLeft(A.x);this.split.el.setTop(A.y);this.split.el.setHeight(A.height);A.x+=sw;}if(this.collapsed){this.updateBody(null,A.height);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}});
1872 // Roo/bootstrap/layout/West.js
1873 Roo.bootstrap.layout.West=function(A){A.region="west";A.cursor="w-resize";Roo.bootstrap.layout.Split.call(this,A);if(this.split){this.split.placement=Roo.bootstrap.SplitBar.LEFT;this.split.orientation=Roo.bootstrap.SplitBar.HORIZONTAL;this.split.el.addClass("roo-layout-split-h");
1874 }};Roo.extend(Roo.bootstrap.layout.West,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.HORIZONTAL,onRender:function(A,B){Roo.bootstrap.layout.West.superclass.onRender.call(this,A,B);var C=this.config.initialSize||this.config.width;if(typeof C!="undefined"){this.el.setWidth(C);
1875 }},getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(A.width==0){A.width=this.config.width;}if(this.split){A.width+=this.split.el.getWidth();}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();
1876 A.width-=sw;this.split.el.setLeft(A.x+A.width);this.split.el.setTop(A.y);this.split.el.setHeight(A.height);}if(this.collapsed){this.updateBody(null,A.height);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}});
1877 // Roo/bootstrap/panel/Content.js
1878 Roo.bootstrap.panel.Content=function(A){this.tpl=A.tpl||false;var el=A.el;var B=A.content;if(A.autoCreate){el=Roo.id();}this.el=Roo.get(el);if(!this.el&&A&&A.autoCreate){if(typeof A.autoCreate=="object"){if(!A.autoCreate.id){A.autoCreate.id=A.id||el;}this.el=Roo.DomHelper.append(document.body,A.autoCreate,true);
1879 }else{var C={tag:"div",cls:(A.cls||'')+(A.background?' bg-'+A.background:'')+" roo-layout-inactive-content",id:A.id||el};if(A.iframe){C.cn=[{tag:'iframe',style:'border: 0px',src:'about:blank'}];}if(A.html){C.html=A.html;}this.el=Roo.DomHelper.append(document.body,C,true);
1880 if(A.iframe){this.iframeEl=this.el.select('iframe',true).first();}}}this.closable=false;this.loaded=false;this.active=false;if(A.toolbar&&!A.toolbar.el&&A.toolbar.xtype){this.toolbar=new A.toolbar.xns[A.toolbar.xtype](A.toolbar);this.wrapEl=this.el;var ti=[];
1881 if(A.toolbar.items){ti=A.toolbar.items;delete A.toolbar.items;}var D=[];this.toolbar.render(this.wrapEl,'before');for(var i=0;i<ti.length;i++){D.push(this.toolbar.addxtype(Roo.apply({},ti[i])));}this.toolbar.items=D;this.toolbar.el.insertBefore(this.wrapEl.dom.firstChild);
1882 delete A.toolbar;}if(typeof A=="string"){this.title=A;}else{Roo.apply(this,A);}if(this.resizeEl){this.resizeEl=Roo.get(this.resizeEl,true);}else{this.resizeEl=this.el;}this.addEvents({"activate":true,"deactivate":true,"resize":true,"render":true,"scroll":true}
1883 );if(this.autoScroll&&!this.iframe){this.resizeEl.setStyle("overflow","auto");this.resizeEl.on('scroll',this.onScroll,this);}else{}B=B||this.content;if(B){this.setContent(B);}if(A&&A.url){this.setUrl(this.url,this.params,this.loadOnce);}Roo.bootstrap.panel.Content.superclass.constructor.call(this);
1884 if(this.view&&typeof(this.view.xtype)!='undefined'){this.view.el=this.el.appendChild(document.createElement("div"));this.view=Roo.factory(this.view);this.view.render&&this.view.render(false,'');}this.fireEvent('render',this);};Roo.extend(Roo.bootstrap.panel.Content,Roo.bootstrap.Component,{cls:'',background:'',tabTip:'',iframe:false,iframeEl:false,resizeEl:false,setRegion:function(A){this.region=A;
1885 this.setActiveClass(A&&!this.background);},setActiveClass:function(A){if(A){this.el.replaceClass("roo-layout-inactive-content","roo-layout-active-content");this.el.setStyle('position','relative');}else{this.el.replaceClass("roo-layout-active-content","roo-layout-inactive-content");
1886 this.el.setStyle('position','absolute');}},getToolbar:function(){return this.toolbar;},setActiveState:function(A){this.active=A;this.setActiveClass(A);if(!A){if(this.fireEvent("deactivate",this)===false){return false;}return true;}this.fireEvent("activate",this);
1887 return true;},setContent:function(A,B){if(this.iframe){return;}this.el.update(A,B);},ignoreResize:function(w,h){if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return true;}else{this.lastSize={width:w,height:h};return false;}},getUpdateManager:function(){if(this.iframe){return false;
1888 }return this.el.getUpdateManager();},load:function(){if(this.iframe){return this;}var um=this.el.getUpdateManager();um.update.apply(um,arguments);return this;},setUrl:function(A,B,C){if(this.iframe){this.iframeEl.dom.src=A;return false;}if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate);
1889 }this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.el.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.el.getUpdateManager();D.update(A,B,this._setLoaded.createDelegate(this));
1890 }},_setLoaded:function(){this.loaded=true;},getId:function(){return this.el.id;},getEl:function(){return this.wrapEl||this.el;},adjustForComponents:function(A,B){if(this.resizeEl!=this.el){A-=this.el.getFrameWidth('lr');B-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl();
1891 te.setWidth(A);B-=te.getHeight();}if(this.footer){var te=this.footer.getEl();te.setWidth(A);B-=te.getHeight();}if(this.adjustments){A+=this.adjustments[0];B+=this.adjustments[1];}return {"width":A,"height":B};},setSize:function(A,B){if(this.fitToFrame&&!this.ignoreResize(A,B)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(A,B);
1892 }var C=this.adjustForComponents(A,B);if(this.iframe){this.iframeEl.setSize(A,B);}this.resizeEl.setSize(this.autoWidth?"auto":C.width,this.autoHeight?"auto":C.height);this.fireEvent('resize',this,C.width,C.height);}},getTitle:function(){if(typeof(this.title)!='object'){return this.title;
1893 }var t='';for(var k in this.title){if(!this.title.hasOwnProperty(k)){continue;}if(k.indexOf('-')>=0){var s=k.split('-');for(var i=0;i<s.length;i++){t+="<span class='visible-"+s[i]+"'>"+this.title[k]+"</span>";}}else{t+="<span class='visible-"+k+"'>"+this.title[k]+"</span>";
1894 }}return t;},setTitle:function(A){this.title=A;if(this.region){this.region.updatePanelTitle(this,A);}},isClosable:function(){return this.closable;},beforeSlide:function(){this.el.clip();this.resizeEl.clip();},afterSlide:function(){this.el.unclip();this.resizeEl.unclip();
1895 },refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},destroy:function(){this.el.removeAllListeners();var A=document.createElement("span");A.appendChild(this.el.dom);A.innerHTML="";this.el.remove();this.el=null;},form:false,view:false,getChildContainer:function(){return this.getEl();
1896 },onScroll:function(e){this.fireEvent('scroll',this,e);}});
1897 // Roo/bootstrap/panel/Grid.js
1898 Roo.bootstrap.panel.Grid=function(A){this.wrapper=Roo.DomHelper.append(document.body,{tag:"div",cls:"roo-layout-grid-wrapper roo-layout-inactive-content"},true);A.el=this.wrapper;if(A.container){this.wrapper.setStyle("overflow","hidden");this.wrapper.addClass('roo-grid-container');
1899 }if(A.toolbar){var B=this.wrapper.createChild();this.toolbar=Roo.factory(A.toolbar);var ti=[];if(A.toolbar.items){ti=A.toolbar.items;delete A.toolbar.items;}var C=[];this.toolbar.render(B);for(var i=0;i<ti.length;i++){C.push(this.toolbar.addxtype(Roo.apply({}
1900 ,ti[i])));}this.toolbar.items=C;delete A.toolbar;}Roo.bootstrap.panel.Grid.superclass.constructor.call(this,A);A.grid.scrollBody=true;;A.grid.monitorWindowResize=false;A.grid.autoHeight=false;A.grid.autoWidth=false;this.grid=new A.grid.xns[A.grid.xtype](A.grid);
1901 if(A.background){this.on('activate',function(gp){if(!gp.grid.rendered){gp.grid.render(this.wrapper);gp.grid.getGridEl().replaceClass("roo-layout-inactive-content","roo-layout-component-panel");}});}else{this.grid.render(this.wrapper);this.grid.getGridEl().replaceClass("roo-layout-inactive-content","roo-layout-component-panel");
1902 }if(this.footer&&!this.footer.el&&this.footer.xtype){var D=this.grid.getView().getFooterPanel(true);this.footer.dataSource=this.grid.dataSource;this.footer=Roo.factory(this.footer,Roo);this.footer.render(D);}};Roo.extend(Roo.bootstrap.panel.Grid,Roo.bootstrap.panel.Content,{getId:function(){return this.grid.id;
1903 },getGrid:function(){return this.grid;},setSize:function(A,B){var C=this.grid;var D=this.adjustForComponents(A,B);var E=C.getGridEl();E.setSize(D.width,D.height);var F=C.getGridEl().select('tbody',true).first();var G=C.getGridEl().select('thead',true).first();
1904 var H=C.getGridEl().select('tfoot',true).first();if(H){D.height-=H.getHeight();}if(G){D.height-=G.getHeight();}F.setSize(D.width,D.height);var G=C.getGridEl().select('thead',true).first();C.autoSize();},beforeSlide:function(){this.grid.getView().scroller.clip();
1905 },afterSlide:function(){this.grid.getView().scroller.unclip();},destroy:function(){this.grid.destroy();delete this.grid;Roo.bootstrap.panel.Grid.superclass.destroy.call(this);}});
1906 // Roo/bootstrap/panel/Nest.js
1907 Roo.bootstrap.panel.Nest=function(A){A.el=A.layout.getEl();Roo.bootstrap.panel.Nest.superclass.constructor.call(this,A);A.layout.monitorWindowResize=false;this.layout=A.layout;this.layout.getEl().addClass("roo-layout-nested-layout");this.layout.parent=this;
1908 };Roo.extend(Roo.bootstrap.panel.Nest,Roo.bootstrap.panel.Content,{layout:false,setSize:function(A,B){if(!this.ignoreResize(A,B)){var C=this.adjustForComponents(A,B);var el=this.layout.getEl();if(C.height<1){el.setWidth(C.width);}else{el.setSize(C.width,C.height);
1909 }var D=el.dom.offsetWidth;this.layout.layout();if(Roo.isIE&&!this.initialized){this.initialized=true;this.layout.layout();}}},setActiveState:function(A){this.active=A;this.setActiveClass(A);if(!A){this.fireEvent("deactivate",this);return;}this.fireEvent("activate",this);
1910 if(!this.layout){return;}var B=false;for(var r in this.layout.regions){B=this.layout.getRegion(r);if(B.getActivePanel()){B.setActivePanel(B.getActivePanel());continue;}if(!B.panels.length){continue;}B.showPanel(B.getPanel(0));}},getLayout:function(){return this.layout;
1911 },addxtype:function(A){return this.layout.addxtype(A);}});
1912 // Roo/bootstrap/panel/Tabs.js
1913 Roo.bootstrap.panel.Tabs=function(A){this.el=Roo.get(A.el);delete A.el;if(A){if(typeof A=="boolean"){this.tabPosition=A?"bottom":"top";}else{Roo.apply(this,A);}}if(this.tabPosition=="bottom"){this.bodyEl=Roo.get(this.createBody(this.el.dom));this.el.addClass("roo-tabs-bottom");
1914 }if(this.tabPosition=="west"){var B=this.region;while(B){if(!B.mgr.parent){break;}B=B.mgr.parent.region;}Roo.log("got nest?");Roo.log(B);if(B.mgr.getRegion('west')){var C=B.mgr.getRegion('west').bodyEl.dom;this.stripWrap=Roo.get(this.createStrip(C),true);
1915 this.stripEl=Roo.get(this.createStripList(this.stripWrap.dom),true);this.stripEl.setVisibilityMode(Roo.Element.DISPLAY);this.stripBody=Roo.get(this.stripWrap.dom.firstChild.firstChild,true);}}else{this.stripWrap=Roo.get(this.createStrip(this.el.dom),true);
1916 this.stripEl=Roo.get(this.createStripList(this.stripWrap.dom),true);this.stripEl.setVisibilityMode(Roo.Element.DISPLAY);this.stripBody=Roo.get(this.stripWrap.dom.firstChild.firstChild,true);}if(Roo.isIE){Roo.fly(this.stripWrap.dom.firstChild).setStyle("overflow-x","hidden");
1917 }if(this.tabPosition!="bottom"){this.bodyEl=Roo.get(this.createBody(this.el.dom));this.el.addClass("roo-tabs-top");}this.items=[];this.bodyEl.setStyle("position","relative");this.active=null;this.activateDelegate=this.activate.createDelegate(this);this.addEvents({"tabchange":true,"beforetabchange":true}
1918 );Roo.EventManager.onWindowResize(this.onResize,this);this.cpad=this.el.getPadding("lr");this.hiddenCount=0;if(this.toolbar){alert("no toolbar support yet");this.toolbar=false;}Roo.bootstrap.panel.Tabs.superclass.constructor.call(this);};Roo.extend(Roo.bootstrap.panel.Tabs,Roo.util.Observable,{tabPosition:"top",currentTabWidth:0,minTabWidth:40,maxTabWidth:250,preferredTabWidth:175,resizeTabs:false,monitorResize:true,toolbar:false,region:false,disableTooltips:true,addTab:function(id,A,B,C,D){var E=new Roo.bootstrap.panel.TabItem({panel:this,id:id,text:A,closable:C,tpl:D}
1919 );this.addTabItem(E);if(B){E.setContent(B);}return E;},getTab:function(id){return this.items[id];},hideTab:function(id){var t=this.items[id];if(!t.isHidden()){t.setHidden(true);this.hiddenCount++;this.autoSizeTabs();}},unhideTab:function(id){var t=this.items[id];
1920 if(t.isHidden()){t.setHidden(false);this.hiddenCount--;this.autoSizeTabs();}},addTabItem:function(A){this.items[A.id]=A;this.items.push(A);this.autoSizeTabs();},removeTab:function(id){var A=this.items;var B=A[id];if(!B){return;}var C=A.indexOf(B);if(this.active==B&&A.length>1){var D=this.getNextAvailable(C);
1921 if(D){D.activate();}}this.stripEl.dom.removeChild(B.pnode.dom);if(B.bodyEl.dom.parentNode==this.bodyEl.dom){this.bodyEl.dom.removeChild(B.bodyEl.dom);}A.splice(C,1);delete this.items[B.id];B.fireEvent("close",B);B.purgeListeners();this.autoSizeTabs();},getNextAvailable:function(A){var B=this.items;
1922 var C=A;while(C<B.length){var D=B[++C];if(D&&!D.isHidden()){return D;}}C=A;while(C>=0){var D=B[--C];if(D&&!D.isHidden()){return D;}}return null;},disableTab:function(id){var A=this.items[id];if(A&&this.active!=A){A.disable();}},enableTab:function(id){var A=this.items[id];
1923 A.enable();},activate:function(id){var A=this.items[id];if(!A){return null;}if(A==this.active||A.disabled){return A;}var e={};this.fireEvent("beforetabchange",this,e,A);if(e.cancel!==true&&!A.disabled){if(this.active){this.active.hide();}this.active=this.items[id];
1924 this.active.show();this.fireEvent("tabchange",this,this.active);}return A;},getActiveTab:function(){return this.active;},syncHeight:function(A){var B=(A||this.el.getHeight())-this.el.getBorderWidth("tb")-this.el.getPadding("tb");var bm=this.bodyEl.getMargins();
1925 var C=B-(this.stripWrap.getHeight()||0)-(bm.top+bm.bottom);this.bodyEl.setHeight(C);return C;},onResize:function(){if(this.monitorResize){this.autoSizeTabs();}},beginUpdate:function(){this.updating=true;},endUpdate:function(){this.updating=false;this.autoSizeTabs();
1926 },autoSizeTabs:function(){var A=this.items.length;var B=A-this.hiddenCount;if(B<2){this.stripEl.hide();}else{this.stripEl.show();}if(!this.resizeTabs||A<1||B<1||this.updating){return;}var w=Math.max(this.el.getWidth()-this.cpad,10);var C=Math.floor(w/B);var b=this.stripBody;
1927 if(b.getWidth()>w){var D=this.items;this.setTabWidth(Math.max(C,this.minTabWidth)-2);if(C<this.minTabWidth){}}else{if(this.currentTabWidth<this.preferredTabWidth){this.setTabWidth(Math.min(C,this.preferredTabWidth)-2);}}},getCount:function(){return this.items.length;
1928 },setTabWidth:function(A){this.currentTabWidth=A;for(var i=0,B=this.items.length;i<B;i++){if(!this.items[i].isHidden()){this.items[i].setWidth(A);}}},destroy:function(A){Roo.EventManager.removeResizeListener(this.onResize,this);for(var i=0,B=this.items.length;
1929 i<B;i++){this.items[i].purgeListeners();}if(A===true){this.el.update("");this.el.remove();}},createStrip:function(A){var B=document.createElement("nav");B.className=Roo.bootstrap.version==4?"navbar-light bg-light":"navbar navbar-default";A.appendChild(B);
1930 return B;},createStripList:function(A){A.innerHTML='<ul class="nav nav-tabs" role="tablist"></ul>';return A.firstChild;},createBody:function(A){var B=document.createElement("div");Roo.id(B,"tab-body");Roo.fly(B).addClass("tab-content");A.appendChild(B);return B;
1931 },createItemBody:function(A,id){var B=Roo.getDom(id);if(!B){B=document.createElement("div");B.id=id;}Roo.fly(B).addClass("tab-pane");A.insertBefore(B,A.firstChild);return B;},createStripElements:function(A,B,C,D){var td=document.createElement("li");td.className='nav-item';
1932 A.appendChild(td);var E=D||this.tabTpl||false;if(!E){E=new Roo.Template(Roo.bootstrap.version==4?('<a class="nav-link" href="#" unselectable="on"'+(this.disableTooltips?'':' title="{text}"')+' >{text}</a>'):('<a class="nav-link" href="#">'+'<span unselectable="on"'+(this.disableTooltips?'':' title="{text}"')+' >{text}</span></a>'));
1933 }switch(typeof(E)){case 'object':break;case 'string':E=new Roo.Template(E);break;default:break;}var el=E.overwrite(td,{"text":B});var F=el.getElementsByTagName("span")[0];return {"el":el,"inner":F};}});
1934 // Roo/bootstrap/panel/TabItem.js
1935 Roo.bootstrap.panel.TabItem=function(A){this.tabPanel=A.panel;this.id=A.id;this.disabled=false;this.text=A.text;this.loaded=false;this.closable=A.closable;this.bodyEl=Roo.get(this.tabPanel.createItemBody(this.tabPanel.bodyEl.dom,A.id));this.bodyEl.setVisibilityMode(Roo.Element.VISIBILITY);
1936 this.bodyEl.setStyle("display","block");this.bodyEl.setStyle("zoom","1");var B=this.tabPanel.createStripElements(this.tabPanel.stripEl.dom,A.text,A.closable,A.tpl);this.el=Roo.get(B.el);this.inner=Roo.get(B.inner,true);this.textEl=Roo.bootstrap.version==4?this.el:Roo.get(this.el.dom.firstChild,true);
1937 this.pnode=this.linode=Roo.get(B.el.parentNode,true);this.status_node=Roo.bootstrap.version==4?this.el:this.linode;this.el.on("click",this.onTabClick,this);if(A.closable){var c=Roo.get(B.close,true);c.dom.title=this.closeText;c.addClassOnOver("close-over");
1938 c.on("click",this.closeClick,this);}this.addEvents({"activate":true,"beforeclose":true,"close":true,"deactivate":true});this.hidden=false;Roo.bootstrap.panel.TabItem.superclass.constructor.call(this);};Roo.extend(Roo.bootstrap.panel.TabItem,Roo.util.Observable,{purgeListeners:function(){Roo.util.Observable.prototype.purgeListeners.call(this);
1939 this.el.removeAllListeners();},show:function(){this.status_node.addClass("active");this.showAction();if(Roo.isOpera){this.tabPanel.stripWrap.repaint();}this.fireEvent("activate",this.tabPanel,this);},isActive:function(){return this.tabPanel.getActiveTab()==this;
1940 },hide:function(){this.status_node.removeClass("active");this.hideAction();this.fireEvent("deactivate",this.tabPanel,this);},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px");
1941 },showAction:function(){this.bodyEl.setStyle("position","relative");this.bodyEl.setTop("");this.bodyEl.setLeft("");this.bodyEl.show();},setTooltip:function(A){if(Roo.QuickTips&&Roo.QuickTips.isEnabled()){this.textEl.dom.qtip=A;this.textEl.dom.removeAttribute('title');
1942 }else{this.textEl.dom.title=A;}},onTabClick:function(e){e.preventDefault();this.tabPanel.activate(this.id);},onTabMouseDown:function(e){e.preventDefault();this.tabPanel.activate(this.id);},setHidden:function(A){this.hidden=A;this.linode.setStyle("display",A?"none":"");
1943 },isHidden:function(){return this.hidden;},getText:function(){return this.text;},setText:function(A){this.text=A;this.textEl.update(A);this.setTooltip(A);},activate:function(){this.tabPanel.activate(this.id);},disable:function(){if(this.tabPanel.active!=this){this.disabled=true;
1944 this.status_node.addClass("disabled");}},enable:function(){this.disabled=false;this.status_node.removeClass("disabled");},setContent:function(A,B){this.bodyEl.update(A,B);},getUpdateManager:function(){return this.bodyEl.getUpdateManager();},setUrl:function(A,B,C){if(this.refreshDelegate){this.un('activate',this.refreshDelegate);
1945 }this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.bodyEl.getUpdateManager();D.update(A,B,this._setLoaded.createDelegate(this));
1946 }},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},_setLoaded:function(){this.loaded=true;},closeClick:function(e){var o={};e.stopEvent();this.fireEvent("beforeclose",this,o);if(o.cancel!==true){this.tabPanel.removeTab(this.id);
1947 }},closeText:"Close this tab"});
1948 // Roo/bootstrap/form/PhoneInputData.js
1949 Roo.bootstrap.form.PhoneInputData=function(){var d=[["Afghanistan (‫افغانستان‬‎)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (‫الجزائر‬‎)","dz","213"],["American Samoa","as","1684"],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1264"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1242"],["Bahrain (‫البحرين‬‎)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1246"],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1441"],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1284"],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1],["Cayman Islands","ky","1345"],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2],["Cocos (Keeling) Islands","cc","61",1],["Colombia","co","57"],["Comoros (‫جزر القمر‬‎)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1767"],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (‫مصر‬‎)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1473"],["Guadeloupe","gp","590",0],["Guam","gu","1671"],["Guatemala","gt","502"],["Guernsey","gg","44",1],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (‫ایران‬‎)","ir","98"],["Iraq (‫العراق‬‎)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2],["Israel (‫ישראל‬‎)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1876"],["Japan (日本)","jp","81"],["Jersey","je","44",3],["Jordan (‫الأردن‬‎)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (‫الكويت‬‎)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (‫لبنان‬‎)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (‫ليبيا‬‎)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["Macedonia (FYROM) (Македонија)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (‫موريتانيا‬‎)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1664"],["Morocco (‫المغرب‬‎)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["Northern Mariana Islands","mp","1670"],["Norway (Norge)","no","47",0],["Oman (‫عُمان‬‎)","om","968"],["Pakistan (‫پاکستان‬‎)","pk","92"],["Palau","pw","680"],["Palestine (‫فلسطين‬‎)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (‫قطر‬‎)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (‫المملكة العربية السعودية‬‎)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1721"],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (‫جنوب السودان‬‎)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්‍රී ලංකාව)","lk","94"],["Sudan (‫السودان‬‎)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1],["Swaziland","sz","268"],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (‫سوريا‬‎)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia (‫تونس‬‎)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1649"],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1340"],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (‫الصحراء الغربية‬‎)","eh","212",1],["Yemen (‫اليمن‬‎)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1]];
1950 return d;}
1951 // Roo/bootstrap/form/PhoneInput.js
1952 Roo.bootstrap.form.PhoneInput=function(A){Roo.bootstrap.form.PhoneInput.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.PhoneInput,Roo.bootstrap.form.TriggerField,{listWidth:undefined,selectedClass:'active',invalidClass:"has-warning",validClass:'has-success',allowed:'0123456789',max_length:15,defaultDialCode:'+852',preferedCountries:false,getAutoCreate:function(){var A=Roo.bootstrap.form.PhoneInputData();
1953 var B=this.labelAlign||this.parentLabelAlign();var id=Roo.id();this.allCountries=[];this.dialCodeMapping=[];for(var i=0;i<A.length;i++){var c=A[i];this.allCountries[i]={name:c[0],iso2:c[1],dialCode:c[2],priority:c[3]||0,areaCodes:c[4]||null};this.dialCodeMapping[c[2]]={name:c[0],iso2:c[1],priority:c[3]||0,areaCodes:c[4]||null}
1954 ;}var C={cls:'form-group',cn:[]};var D={tag:'input',id:id,maxlength:this.max_length,cls:'form-control tel-input',autocomplete:'new-password'};var E={tag:'input',type:'hidden',cls:'hidden-tel-input'};if(this.name){E.name=this.name;}if(this.disabled){D.disabled=true;
1955 }var F={tag:'div',cls:'flag-box',cn:[{tag:'div',cls:'flag'},{tag:'div',cls:'caret'}]};var G={tag:'div',cls:this.hasFeedback?'has-feedback':'',cn:[E,D,{tag:'input',cls:'dial-code-holder',disabled:true}]};var H={cls:'roo-select2-container input-group',cn:[F,G]}
1956 ;if(this.fieldLabel.length){var I={tag:'i',tooltip:'This field is required'};var J={tag:'label','for':id,cls:'control-label',cn:[]};var K={tag:'span',html:this.fieldLabel};I.cls='roo-required-indicator text-danger fa fa-lg fa-star left-indicator';J.cn=[I,K];
1957 if(this.indicatorpos=='right'){I.cls='roo-required-indicator text-danger fa fa-lg fa-star right-indicator';J.cn=[K,I];}if(B=='left'){H={tag:'div',cn:[H]};if(this.labelWidth>12){J.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;
1958 }if(this.labellg>0){J.cls+=' col-lg-'+this.labellg;D.cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){J.cls+=' col-md-'+this.labelmd;H.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){J.cls+=' col-sm-'+this.labelsm;H.cls+=' col-sm-'+(12-this.labelsm);
1959 }if(this.labelxs>0){J.cls+=' col-xs-'+this.labelxs;H.cls+=' col-xs-'+(12-this.labelxs);}}}C.cn=[J,H];var L=this;['xs','sm','md','lg'].map(function(M){if(L[M]){C.cls+=' col-'+M+'-'+L[M];}});this.store=new Roo.data.Store({proxy:new Roo.data.MemoryProxy({}),reader:new Roo.data.JsonReader({fields:[{'name':'name','type':'string'}
1960 ,{'name':'iso2','type':'string'},{'name':'dialCode','type':'string'},{'name':'priority','type':'string'},{'name':'areaCodes','type':'string'}]})});if(!this.preferedCountries){this.preferedCountries=['hk','gb','us'];}var p=this.preferedCountries.reverse();
1961 if(p){for(var i=0;i<p.length;i++){for(var j=0;j<this.allCountries.length;j++){if(this.allCountries[j].iso2==p[i]){var t=this.allCountries[j];this.allCountries.splice(j,1);this.allCountries.unshift(t);}}}}this.store.proxy.data={success:true,data:this.allCountries}
1962 ;return C;},initEvents:function(){this.createList();Roo.bootstrap.form.PhoneInput.superclass.initEvents.call(this);this.indicator=this.indicatorEl();this.flag=this.flagEl();this.dialCodeHolder=this.dialCodeHolderEl();this.trigger=this.el.select('div.flag-box',true).first();
1963 this.trigger.on("click",this.onTriggerClick,this,{preventDefault:true});var A=this;(function(){var lw=A.listWidth||Math.max(A.inputEl().getWidth(),A.minListWidth);A.list.setWidth(lw);}).defer(100);this.list.on('mouseover',this.onViewOver,this);this.list.on('mousemove',this.onViewMove,this);
1964 this.inputEl().on("keyup",this.onKeyUp,this);this.inputEl().on("keypress",this.onKeyPress,this);this.tpl='<li><a href="#"><div class="flag {iso2}"></div>{name} <span class="dial-code">+{dialCode}</span></a></li>';this.view=new Roo.View(this.list,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass}
1965 );this.view.on('click',this.onViewClick,this);this.setValue(this.defaultDialCode);},onTriggerClick:function(e){Roo.log('trigger click');if(this.disabled){return;}if(this.isExpanded()){this.collapse();this.hasFocus=false;}else{this.store.load({});this.hasFocus=true;
1966 this.expand();}},isExpanded:function(){return this.list.isVisible();},collapse:function(){if(!this.isExpanded()){return;}this.list.hide();Roo.get(document).un('mousedown',this.collapseIf,this);Roo.get(document).un('mousewheel',this.collapseIf,this);this.fireEvent('collapse',this);
1967 this.validate();},expand:function(){Roo.log('expand');if(this.isExpanded()||!this.hasFocus){return;}var lw=this.listWidth||Math.max(this.inputEl().getWidth(),this.minListWidth);this.list.setWidth(lw);this.list.show();this.restrictHeight();Roo.get(document).on('mousedown',this.collapseIf,this);
1968 Roo.get(document).on('mousewheel',this.collapseIf,this);this.fireEvent('expand',this);},restrictHeight:function(){this.list.alignTo(this.inputEl(),this.listAlign);this.list.alignTo(this.inputEl(),this.listAlign);},onViewOver:function(e,t){if(this.inKeyMode){return;
1969 }var A=this.view.findItemFromChild(t);if(A){var B=this.view.indexOf(A);this.select(B,false);}},onViewClick:function(A,B,el,e){var C=this.view.getSelectedIndexes()[0];var r=this.store.getAt(C);if(r){this.onSelect(r,C);}if(B!==false&&!this.blockFocus){this.inputEl().focus();
1970 }},onViewMove:function(e,t){this.inKeyMode=false;},select:function(A,B){this.selectedIndex=A;this.view.select(A);if(B!==false){var el=this.view.getNode(A);if(el){this.list.scrollChildIntoView(el,false);}}},createList:function(){this.list=Roo.get(document.body).createChild({tag:'ul',cls:'typeahead typeahead-long dropdown-menu tel-list',style:'display:none'}
1971 );this.list.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';},collapseIf:function(e){var A=e.within(this.el);var B=e.within(this.list);var C=(Roo.get(e.getTarget()).id==this.list.id)?true:false;if(A||B||C){return;}this.collapse();},onSelect:function(A,B){if(this.fireEvent('beforeselect',this,A,B)!==false){this.setFlagClass(A.data.iso2);
1972 this.setDialCode(A.data.dialCode);this.hasFocus=false;this.collapse();this.fireEvent('select',this,A,B);}},flagEl:function(){var A=this.el.select('div.flag',true).first();if(!A){return false;}return A;},dialCodeHolderEl:function(){var d=this.el.select('input.dial-code-holder',true).first();
1973 if(!d){return false;}return d;},setDialCode:function(v){this.dialCodeHolder.dom.value='+'+v;},setFlagClass:function(n){this.flag.dom.className='flag '+n;},getValue:function(){var v=this.inputEl().getValue();if(this.dialCodeHolder){v=this.dialCodeHolder.dom.value+this.inputEl().getValue();
1974 }return v;},setValue:function(v){var d=this.getDialCode(v);if(v.length==0||!d||d.length==0){if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v);this.hiddenEl().dom.value=(v===null||v===undefined?'':v);}return;}this.setFlagClass(this.dialCodeMapping[d].iso2);
1975 this.setDialCode(d);this.inputEl().dom.value=v.replace('+'+d,'');this.hiddenEl().dom.value=this.getValue();this.validate();},getDialCode:function(v){v=v||'';if(v.length==0){return this.dialCodeHolder.dom.value;}var A="";if(v.charAt(0)!="+"){return false;}
1976 var B="";for(var i=1;i<v.length;i++){var c=v.charAt(i);if(!isNaN(c)){B+=c;if(this.dialCodeMapping[B]){A=v.substr(1,i);}if(B.length==4){break;}}}return A;},reset:function(){this.setValue(this.defaultDialCode);this.validate();},hiddenEl:function(){return this.el.select('input.hidden-tel-input',true).first();
1977 },onKeyUp:function(e){this.setValue(this.getValue());},onKeyPress:function(e){if(this.allowed.indexOf(String.fromCharCode(e.getCharCode()))===-1){e.stopEvent();}}});
1978 // Roo/bootstrap/form/MoneyField.js
1979 Roo.bootstrap.form.MoneyField=function(A){Roo.bootstrap.form.MoneyField.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.form.MoneyField,Roo.bootstrap.form.ComboBox,{allowDecimals:true,decimalSeparator:".",decimalPrecision:0,allowNegative:true,allowZero:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,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",castInt:true,defaultCurrency:false,thousandsDelimiter:false,max_length:false,inputlg:9,inputmd:9,inputsm:9,inputxs:6,store:false,getAutoCreate:function(){var A=this.labelAlign||this.parentLabelAlign();
1980 var id=Roo.id();var B={cls:'form-group',cn:[]};var C={tag:'input',id:id,cls:'form-control roo-money-amount-input',autocomplete:'new-password'};var D={tag:'input',type:'hidden',id:Roo.id(),cls:'hidden-number-input'};if(this.max_length){C.maxlength=this.max_length;
1981 }if(this.name){D.name=this.name;}if(this.disabled){C.disabled=true;}var E=12-this.inputlg;var F=12-this.inputmd;var G=12-this.inputsm;var H=12-this.inputxs;var I={tag:'div',cls:'row roo-money-field',cn:[{tag:'div',cls:'roo-money-currency column col-lg-'+E+' col-md-'+F+' col-sm-'+G+' col-xs-'+H,cn:[{tag:'div',cls:'roo-select2-container input-group',cn:[{tag:'input',cls:'form-control roo-money-currency-input',autocomplete:'new-password',readOnly:1,name:this.currencyName}
1982 ,{tag:'span',cls:'input-group-addon',cn:[{tag:'span',cls:'caret'}]}]}]},{tag:'div',cls:'roo-money-amount column col-lg-'+this.inputlg+' col-md-'+this.inputmd+' col-sm-'+this.inputsm+' col-xs-'+this.inputxs,cn:[{tag:'div',cls:this.hasFeedback?'has-feedback':'',cn:[C]}
1983 ]}]};if(this.fieldLabel.length){var J={tag:'i',tooltip:'This field is required'};var K={tag:'label','for':id,cls:'control-label',cn:[]};var L={tag:'span',html:this.fieldLabel};J.cls='roo-required-indicator text-danger fa fa-lg fa-star left-indicator';K.cn=[J,L];
1984 if(this.indicatorpos=='right'){J.cls='roo-required-indicator text-danger fa fa-lg fa-star right-indicator';K.cn=[L,J];}if(A=='left'){I={tag:'div',cn:[I]};if(this.labelWidth>12){K.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;
1985 }if(this.labellg>0){K.cls+=' col-lg-'+this.labellg;C.cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){K.cls+=' col-md-'+this.labelmd;I.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){K.cls+=' col-sm-'+this.labelsm;I.cls+=' col-sm-'+(12-this.labelsm);
1986 }if(this.labelxs>0){K.cls+=' col-xs-'+this.labelxs;I.cls+=' col-xs-'+(12-this.labelxs);}}}B.cn=[K,I,D];var M=this;['xs','sm','md','lg'].map(function(N){if(M[N]){B.cls+=' col-'+N+'-'+M[N];}});return B;},initEvents:function(){this.indicator=this.indicatorEl();
1987 this.initCurrencyEvent();this.initNumberEvent();},initCurrencyEvent:function(){if(!this.store){throw "can not find store for combo";}this.store=Roo.factory(this.store,Roo.data);this.store.parent=this;this.createList();this.triggerEl=this.el.select('.input-group-addon',true).first();
1988 this.triggerEl.on("click",this.onTriggerClick,this,{preventDefault:true});var A=this;(function(){var lw=A.listWidth||Math.max(A.inputEl().getWidth(),A.minListWidth);A.list.setWidth(lw);}).defer(100);this.list.on('mouseover',this.onViewOver,this);this.list.on('mousemove',this.onViewMove,this);
1989 this.list.on('scroll',this.onViewScroll,this);if(!this.tpl){this.tpl='<li><a href="#">{'+this.currencyField+'}</a></li>';}this.view=new Roo.View(this.list,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass});this.view.on('click',this.onViewClick,this);
1990 this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this);this.keyNav=new Roo.KeyNav(this.currencyEl(),{"up":function(e){this.inKeyMode=true;this.selectPrev();},"down":function(e){if(!this.isExpanded()){this.onTriggerClick();
1991 }else{this.inKeyMode=true;this.selectNext();}},"enter":function(e){this.collapse();if(this.fireEvent("specialkey",this,e)){this.onViewClick(false);}return true;},"esc":function(e){this.collapse();},"tab":function(e){this.collapse();if(this.fireEvent("specialkey",this,e)){this.onViewClick(false);
1992 }return true;},scope:this,doRelay:function(B,C,D){if(D=='down'||this.scope.isExpanded()){return Roo.KeyNav.prototype.doRelay.apply(this,arguments);}return true;},forceKeyDown:true});this.currencyEl().on("click",this.onTriggerClick,this,{preventDefault:true}
1993 );},initNumberEvent:function(e){this.inputEl().on("keydown",this.fireKey,this);this.inputEl().on("focus",this.onFocus,this);this.inputEl().on("blur",this.onBlur,this);this.inputEl().relayEvent('keyup',this);if(this.indicator){this.indicator.addClass('invisible');
1994 }this.originalValue=this.getValue();if(this.validationEvent=='keyup'){this.validationTask=new Roo.util.DelayedTask(this.validate,this);this.inputEl().on('keyup',this.filterValidation,this);}else if(this.validationEvent!==false){this.inputEl().on(this.validationEvent,this.validate,this,{buffer:this.validationDelay}
1995 );}if(this.selectOnFocus){this.on("focus",this.preFocus,this);}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Roo.form.VTypes[this.vtype+'Mask']))){this.inputEl().on("keypress",this.filterKeys,this);}else{this.inputEl().relayEvent('keypress',this);
1996 }var A="0123456789";if(this.allowDecimals){A+=this.decimalSeparator;}if(this.allowNegative){A+="-";}if(this.thousandsDelimiter){A+=",";}this.stripCharsRe=new RegExp('[^'+A+']','gi');var B=function(e){var k=e.getKey();var c=e.getCharCode();if((String.fromCharCode(c)=='.'||String.fromCharCode(c)=='-')&&A.indexOf(String.fromCharCode(c))===-1){e.stopEvent();
1997 return;}if(!Roo.isIE&&(e.isSpecialKey()||k==e.BACKSPACE||k==e.DELETE)){return;}if(A.indexOf(String.fromCharCode(c))===-1){e.stopEvent();}};this.inputEl().on("keypress",B,this);},onTriggerClick:function(e){if(this.disabled){return;}this.page=0;this.loadNext=false;
1998 if(this.isExpanded()){this.collapse();return;}this.hasFocus=true;if(this.triggerAction=='all'){this.doQuery(this.allQuery,true);return;}this.doQuery(this.getRawValue());},getCurrency:function(){var v=this.currencyEl().getValue();return v;},restrictHeight:function(){this.list.alignTo(this.currencyEl(),this.listAlign);
1999 this.list.alignTo(this.currencyEl(),this.listAlign);},onViewClick:function(A,B,el,e){var C=this.view.getSelectedIndexes()[0];var r=this.store.getAt(C);if(r){this.onSelect(r,C);}},onSelect:function(A,B){if(this.fireEvent('beforeselect',this,A,B)!==false){this.setFromCurrencyData(B>-1?A.data:false);
2000 this.collapse();this.fireEvent('select',this,A,B);}},setFromCurrencyData:function(o){var A='';this.lastCurrency=o;if(this.currencyField){A=!o||typeof(o[this.currencyField])=='undefined'?'':o[this.currencyField];}else{Roo.log('no  currencyField value set for '+(this.name?this.name:this.id));
2001 }this.lastSelectionText=A;if(o[this.currencyField]*1==0&&this.defaultCurrency){this.setCurrency(this.defaultCurrency);return;}this.setCurrency(A);},setFromData:function(o){var c={};c[this.currencyField]=!o||typeof(o[this.currencyName])=='undefined'?'':o[this.currencyName];
2002 this.setFromCurrencyData(c);var A='';if(this.name){A=!o||typeof(o[this.name])=='undefined'?'':o[this.name];}else{Roo.log('no value set for '+(this.name?this.name:this.id));}this.setValue(A);},setCurrency:function(v){this.currencyValue=v;if(this.rendered){this.currencyEl().dom.value=(v===null||v===undefined?'':v);
2003 this.validate();}},setValue:function(v){v=String(this.fixPrecision(v)).replace(".",this.decimalSeparator);this.value=v;if(this.rendered){this.hiddenEl().dom.value=(v===null||v===undefined?'':v);this.inputEl().dom.value=(v=='')?'':Roo.util.Format.number(v,this.decimalPrecision,this.thousandsDelimiter||'');
2004 if(!this.allowZero&&v==='0'){this.hiddenEl().dom.value='';this.inputEl().dom.value='';}this.validate();}},getRawValue:function(){var v=this.inputEl().getValue();return v;},getValue:function(){return this.fixPrecision(this.parseValue(this.getRawValue()));}
2005 ,parseValue:function(A){if(this.thousandsDelimiter){A+="";r=new RegExp(",","g");A=A.replace(r,"");}A=parseFloat(String(A).replace(this.decimalSeparator,"."));return isNaN(A)?'':A;},fixPrecision:function(A){if(this.thousandsDelimiter){A+="";r=new RegExp(",","g");
2006 A=A.replace(r,"");}var B=isNaN(A);if(!this.allowDecimals||this.decimalPrecision==-1||B||!A){return B?'':A;}return parseFloat(A).toFixed(this.decimalPrecision);},decimalPrecisionFcn:function(v){return Math.floor(v);},validateValue:function(A){if(!Roo.bootstrap.form.MoneyField.superclass.validateValue.call(this,A)){return false;
2007 }var B=this.parseValue(A);if(isNaN(B)){this.markInvalid(String.format(this.nanText,A));return false;}if(B<this.minValue){this.markInvalid(String.format(this.minText,this.minValue));return false;}if(B>this.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue));
2008 return false;}return true;},validate:function(){if(this.disabled||this.allowBlank){this.markValid();return true;}var A=this.getCurrency();if(this.validateValue(this.getRawValue())&&A.length){this.markValid();return true;}this.markInvalid();return false;},getName:function(){return this.name;
2009 },beforeBlur:function(){if(!this.castInt){return;}var v=this.parseValue(this.getRawValue());if(v||v==0){this.setValue(v);}},onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();
2010 }var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);}this.fireEvent("blur",this);},inputEl:function(){return this.el.select('.roo-money-amount-input',true).first();},currencyEl:function(){return this.el.select('.roo-money-currency-input',true).first();
2011 },hiddenEl:function(){return this.el.select('input.hidden-number-input',true).first();}});
2012 // Roo/bootstrap/BezierSignature.js
2013 Roo.bootstrap.BezierSignature=function(A){Roo.bootstrap.BezierSignature.superclass.constructor.call(this,A);this.addEvents({"resize":true});};Roo.extend(Roo.bootstrap.BezierSignature,Roo.bootstrap.Component,{curve_data:[],is_empty:true,mouse_btn_down:true,canvas_height:'200px',dot_size:false,min_width:0.5,max_width:2.5,throttle:16,min_distance:5,bg_color:'rgba(0, 0, 0, 0)',dot_color:'black',velocity_filter_weight:0.7,onBegin:false,onEnd:false,getAutoCreate:function(){var A='roo-signature column';
2014 if(this.cls){A+=' '+this.cls;}var B=['lg','md','sm','xs'];for(var i=0;i<B.length;i++){if(this[B[i]]){A+=" col-"+B[i]+"-"+this[B[i]];}}var C={tag:'div',cls:A,cn:[{tag:'div',cls:'roo-signature-body',cn:[{tag:'canvas',cls:'roo-signature-body-canvas',height:this.canvas_height,width:this.canvas_width}
2015 ]},{tag:'input',type:'file',style:'display: none'}]};return C;},initEvents:function(){Roo.bootstrap.BezierSignature.superclass.initEvents.call(this);var A=this.canvasEl();A.dom.style.touchAction='none';A.dom.style.msTouchAction='none';this.mouse_btn_down=false;
2016 A.on('mousedown',this._handleMouseDown,this);A.on('mousemove',this._handleMouseMove,this);Roo.select('html').first().on('mouseup',this._handleMouseUp,this);if(window.PointerEvent){A.on('pointerdown',this._handleMouseDown,this);A.on('pointermove',this._handleMouseMove,this);
2017 Roo.select('html').first().on('pointerup',this._handleMouseUp,this);}if('ontouchstart' in window){A.on('touchstart',this._handleTouchStart,this);A.on('touchmove',this._handleTouchMove,this);A.on('touchend',this._handleTouchEnd,this);}Roo.EventManager.onWindowResize(this.resize,this,true);
2018 this.fileEl().on('change',this.uploadImage,this);this.clear();this.resize();},resize:function(){var A=this.canvasEl().dom;var B=this.canvasElCtx();var C=false;if(A.width>0){var C=B.getImageData(0,0,A.width,A.height);}A.width=0;var D=window.getComputedStyle?getComputedStyle(this.el.dom,null):this.el.dom.currentStyle;
2019 var E=parseInt(D.paddingLeft)||0;var F=parseInt(D.paddingRight)||0;A.width=this.el.dom.clientWidth-E-F;if(C){B.putImageData(C,0,0);}},_handleMouseDown:function(e){if(e.browserEvent.which===1){this.mouse_btn_down=true;this.strokeBegin(e);}},_handleMouseMove:function(e){if(this.mouse_btn_down){this.strokeMoveUpdate(e);
2020 }},_handleMouseUp:function(e){if(e.browserEvent.which===1&&this.mouse_btn_down){this.mouse_btn_down=false;this.strokeEnd(e);}},_handleTouchStart:function(e){e.preventDefault();if(e.browserEvent.targetTouches.length===1){this.strokeBegin(e);}},_handleTouchMove:function(e){e.preventDefault();
2021 this.strokeMoveUpdate(e);},_handleTouchEnd:function(e){var A=e.target===this.canvasEl().dom;if(A){e.preventDefault();this.strokeEnd(e);}},reset:function(){this._lastPoints=[];this._lastVelocity=0;this._lastWidth=(this.min_width+this.max_width)/2;this.canvasElCtx().fillStyle=this.dot_color;
2022 },strokeMoveUpdate:function(e){this.strokeUpdate(e);if(this.throttle){this.throttleStroke(this.strokeUpdate,this.throttle);}else{this.strokeUpdate(e);}},strokeBegin:function(e){var A={color:this.dot_color,points:[]};if(typeof this.onBegin==='function'){this.onBegin(e);
2023 }this.curve_data.push(A);this.reset();this.strokeUpdate(e);},strokeUpdate:function(e){var A=this.canvasEl().dom.getBoundingClientRect();var B=new this.Point(e.xy[0]-A.left,e.xy[1]-A.top,new Date().getTime());var C=this.curve_data[this.curve_data.length-1];
2024 var D=C.points;var E=D.length>0&&D[D.length-1];var F=E?B.distanceTo(E)<=this.min_distance:false;var G=C.color;if(!E||!(E&&F)){var H=this.addPoint(B);if(!E){this.drawDot({color:G,point:B});}else if(H){this.drawCurve({color:G,curve:H});}D.push({time:B.time,x:B.x,y:B.y}
2025 );}},strokeEnd:function(e){this.strokeUpdate(e);if(typeof this.onEnd==='function'){this.onEnd(e);}},addPoint:function(A){var B=this._lastPoints;B.push(A);if(B.length>2){if(B.length===3){B.unshift(B[0]);}var C=this.calculateCurveWidths(B[1],B[2]);var D=this.Bezier.fromPoints(B,C,this);
2026 B.shift();return D;}return null;},calculateCurveWidths:function(A,B){var C=this.velocity_filter_weight*B.velocityFrom(A)+(1-this.velocity_filter_weight)*this._lastVelocity;var D=Math.max(this.max_width/(C+1),this.min_width);var E={end:D,start:this._lastWidth}
2027 ;this._lastVelocity=C;this._lastWidth=D;return E;},drawDot:function(_a){var A=_a.color,B=_a.point;var C=this.canvasElCtx();var D=typeof this.dot_size==='function'?this.dot_size():this.dot_size;C.beginPath();this.drawCurveSegment(B.x,B.y,D);C.closePath();C.fillStyle=A;
2028 C.fill();},drawCurve:function(_a){var A=_a.color,B=_a.curve;var C=this.canvasElCtx();var D=B.endWidth-B.startWidth;var E=Math.floor(B.length())*2;C.beginPath();C.fillStyle=A;for(var i=0;i<E;i+=1){var t=i/E;var tt=t*t;var F=tt*t;var u=1-t;var uu=u*u;var G=uu*u;
2029 var x=G*B.startPoint.x;x+=3*uu*t*B.control1.x;x+=3*u*tt*B.control2.x;x+=F*B.endPoint.x;var y=G*B.startPoint.y;y+=3*uu*t*B.control1.y;y+=3*u*tt*B.control2.y;y+=F*B.endPoint.y;var H=B.startWidth+F*D;this.drawCurveSegment(x,y,H);}C.closePath();C.fill();},drawCurveSegment:function(x,y,A){var B=this.canvasElCtx();
2030 B.moveTo(x,y);B.arc(x,y,A,0,2*Math.PI,false);this.is_empty=false;},clear:function(){var A=this.canvasElCtx();var B=this.canvasEl().dom;A.fillStyle=this.bg_color;A.clearRect(0,0,B.width,B.height);A.fillRect(0,0,B.width,B.height);this.curve_data=[];this.reset();
2031 this.is_empty=true;},fileEl:function(){return this.el.select('input',true).first();},canvasEl:function(){return this.el.select('canvas',true).first();},canvasElCtx:function(){return this.el.select('canvas',true).first().dom.getContext('2d');},getImage:function(A){if(this.is_empty){return false;
2032 }return this.canvasEl().dom.toDataURL('image/'+A,1);},drawFromImage:function(A){var B=new Image();B.onload=function(){this.canvasElCtx().drawImage(B,0,0);}.bind(this);B.src=A;this.is_empty=false;},selectImage:function(){this.fileEl().dom.click();},uploadImage:function(e){var A=new FileReader();
2033 A.onload=function(e){var B=new Image();B.onload=function(){this.reset();this.canvasElCtx().drawImage(B,0,0);}.bind(this);B.src=e.target.result;}.bind(this);A.readAsDataURL(e.target.files[0]);},Point:(function(){function Point(x,y,A){this.x=x;this.y=y;this.time=A||Date.now();
2034 }Point.prototype.distanceTo=function(A){return Math.sqrt(Math.pow(this.x-A.x,2)+Math.pow(this.y-A.y,2));};Point.prototype.equals=function(A){return this.x===A.x&&this.y===A.y&&this.time===A.time;};Point.prototype.velocityFrom=function(A){return this.time!==A.time?this.distanceTo(A)/(this.time-A.time):0;
2035 };return Point;}()),Bezier:(function(){function Bezier(A,B,C,D,E,F){this.startPoint=A;this.control2=B;this.control1=C;this.endPoint=D;this.startWidth=E;this.endWidth=F;}Bezier.fromPoints=function(A,B,C){var c2=this.calculateControlPoints(A[0],A[1],A[2],C).c2;
2036 var c3=this.calculateControlPoints(A[1],A[2],A[3],C).c1;return new Bezier(A[1],c2,c3,A[2],B.start,B.end);};Bezier.calculateControlPoints=function(s1,s2,s3,A){var B=s1.x-s2.x;var C=s1.y-s2.y;var D=s2.x-s3.x;var E=s2.y-s3.y;var m1={x:(s1.x+s2.x)/2.0,y:(s1.y+s2.y)/2.0}
2037 ;var m2={x:(s2.x+s3.x)/2.0,y:(s2.y+s3.y)/2.0};var l1=Math.sqrt(B*B+C*C);var l2=Math.sqrt(D*D+E*E);var F=m1.x-m2.x;var G=m1.y-m2.y;var k=l2/(l1+l2);var cm={x:m2.x+F*k,y:m2.y+G*k};var tx=s2.x-cm.x;var ty=s2.y-cm.y;return {c1:new A.Point(m1.x+tx,m1.y+ty),c2:new A.Point(m2.x+tx,m2.y+ty)}
2038 ;};Bezier.prototype.length=function(){var A=10;var B=0;var px;var py;for(var i=0;i<=A;i+=1){var t=i/A;var cx=this.point(t,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x);var cy=this.point(t,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);
2039 if(i>0){var C=cx-px;var D=cy-py;B+=Math.sqrt(C*C+D*D);}px=cx;py=cy;}return B;};Bezier.prototype.point=function(t,A,c1,c2,B){return (A*(1.0-t)*(1.0-t)*(1.0-t))+(3.0*c1*(1.0-t)*(1.0-t)*t)+(3.0*c2*(1.0-t)*t*t)+(B*t*t*t);};return Bezier;}()),throttleStroke:function(fn,A){if(A===void 0){A=250;
2040 }var B=0;var C=null;var D;var E;var F;var G=function(){B=Date.now();C=null;D=fn.apply(E,F);if(!C){E=null;F=[];}};return function H(){var I=[];for(var _i=0;_i<arguments.length;_i++){I[_i]=arguments[_i];}var J=Date.now();var K=A-(J-B);E=this;F=I;if(K<=0||K>A){if(C){clearTimeout(C);
2041 C=null;}B=J;D=fn.apply(E,F);if(!C){E=null;F=[];}}else if(!C){C=window.setTimeout(G,K);}return D;};}});
2042 // Roo/bootstrap/form/deprecated.js
2043 Roo.bootstrap.Form=Roo.bootstrap.form.Form;Roo.bootstrap.Input=Roo.bootstrap.form.Input;Roo.bootstrap.TextArea=Roo.bootstrap.form.TextArea;Roo.bootstrap.TriggerField=Roo.bootstrap.form.TriggerField;Roo.bootstrap.ComboBox=Roo.bootstrap.form.ComboBox;Roo.bootstrap.DateField=Roo.bootstrap.form.DateField;
2044 Roo.bootstrap.TimeField=Roo.bootstrap.form.TimeField;Roo.bootstrap.MonthField=Roo.bootstrap.form.MonthField;Roo.bootstrap.CheckBox=Roo.bootstrap.form.CheckBox;Roo.bootstrap.Radio=Roo.bootstrap.form.Radio;Roo.bootstrap.RadioSet=Roo.bootstrap.form.RadioSet;
2045 Roo.bootstrap.SecurePass=Roo.bootstrap.form.SecurePass;Roo.bootstrap.FieldLabel=Roo.bootstrap.form.FieldLabel;Roo.bootstrap.DateSplitField=Roo.bootstrap.form.DateSplitField;Roo.bootstrap.NumberField=Roo.bootstrap.form.NumberField;Roo.bootstrap.PhoneInput=Roo.bootstrap.form.PhoneInput;
2046 Roo.bootstrap.PhoneInputData=Roo.bootstrap.form.PhoneInputData;Roo.bootstrap.MoneyField=Roo.bootstrap.form.MoneyField;Roo.bootstrap.HtmlEditor=Roo.bootstrap.form.HtmlEditor;Roo.bootstrap.HtmlEditor.ToolbarStandard=Roo.bootstrap.form.HtmlEditorToolbarStandard;
2047 Roo.bootstrap.Markdown=Roo.bootstrap.form.Markdown;Roo.bootstrap.CardUploader=Roo.bootstrap.form.CardUploader;
2048 // Roo/bootstrap/nav/deprecated.js
2049 Roo.bootstrap.Navbar=Roo.bootstrap.nav.Bar;Roo.bootstrap.NavGroup=Roo.bootstrap.nav.Group;Roo.bootstrap.NavHeaderbar=Roo.bootstrap.nav.Headerbar;Roo.bootstrap.NavItem=Roo.bootstrap.nav.Item;Roo.bootstrap.NavProgressBar=Roo.bootstrap.nav.ProgressBar;Roo.bootstrap.NavProgressBarItem=Roo.bootstrap.nav.ProgressBarItem;
2050 Roo.bootstrap.NavSidebar=Roo.bootstrap.nav.Sidebar;Roo.bootstrap.NavSidebarItem=Roo.bootstrap.nav.SidebarItem;Roo.bootstrap.NavSimplebar=Roo.bootstrap.nav.Simplebar;
2051 // Roo/bootstrap/menu/deprecated.js
2052 Roo.bootstrap.Menu=Roo.bootstrap.menu.Menu;Roo.bootstrap.MenuItem=Roo.bootstrap.menu.Item;Roo.bootstrap.MenuSeparator=Roo.bootstrap.menu.Separator