//>>built
define("dijit/layout/BorderContainer","dojo/_base/array dojo/cookie dojo/_base/declare dojo/dom-class dojo/dom-construct dojo/dom-geometry dojo/dom-style dojo/keys dojo/_base/lang dojo/on dojo/touch ../_WidgetBase ../_Widget ../_TemplatedMixin ./LayoutContainer ./utils".split(" "),function(l,r,d,e,m,h,n,p,k,q,t,F,u,v,w,G){var D=d("dijit.layout._Splitter",[u,v],{live:!0,templateString:'\x3cdiv class\x3d"dijitSplitter" data-dojo-attach-event\x3d"onkeydown:_onKeyDown,press:_startDrag,onmouseenter:_onMouse,onmouseleave:_onMouse" tabIndex\x3d"0" role\x3d"separator"\x3e\x3cdiv class\x3d"dijitSplitterThumb"\x3e\x3c/div\x3e\x3c/div\x3e',
constructor:function(){this._handlers=[]},postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region);this._factor=/top|left/.test(this.region)?1:-1;this._cookieName=this.container.id+"_"+this.region},buildRendering:function(){this.inherited(arguments);e.add(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V"));if(this.container.persist){var a=this._getPersistentSplit();a&&(this.child.domNode.style[this.horizontal?"height":"width"]=a)}},_computeMaxSize:function(){var a=
this.horizontal?"h":"w",c=h.getMarginBox(this.child.domNode)[a],b=l.filter(this.container.getChildren(),function(f){return"center"==f.region})[0];a=h.getContentBox(b.domNode)[a]-10;return Math.min(this.child.maxSize,c+a)},_startDrag:function(a){this.cover||(this.cover=m.place("\x3cdiv class\x3ddijitSplitterCover\x3e\x3c/div\x3e",this.child.domNode,"after"));e.add(this.cover,"dijitSplitterCoverActive");this.fake&&m.destroy(this.fake);(this._resize=this.live)||((this.fake=this.domNode.cloneNode(!0)).removeAttribute("id"),
e.add(this.domNode,"dijitSplitterShadow"),m.place(this.fake,this.domNode,"after"));e.add(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active");this.fake&&e.remove(this.fake,"dijitSplitterHover dijitSplitter"+(this.horizontal?"H":"V")+"Hover");var c=this._factor,b=this.horizontal,f=b?"pageY":"pageX",H=a[f],x=this.domNode.style;b=b?"h":"w";var y=n.getComputedStyle(this.child.domNode),I=h.getMarginBox(this.child.domNode,y)[b],J=this._computeMaxSize(),K=Math.max(this.child.minSize,
h.getPadBorderExtents(this.child.domNode,y)[b]+10);b=this.region;var z="top"==b||"bottom"==b?"top":"left",L=parseInt(x[z],10),M=this._resize,N=k.hitch(this.container,"_layoutChildren",this.child.id);b=this.ownerDocument;this._handlers=this._handlers.concat([q(b,t.move,this._drag=function(g,O){var A=g[f]-H,B=c*A+I,C=Math.max(Math.min(B,J),K);(M||O)&&N(C);x[z]=A+L+c*(C-B)+"px"}),q(b,"dragstart",function(g){g.stopPropagation();g.preventDefault()}),q(this.ownerDocumentBody,"selectstart",function(g){g.stopPropagation();
g.preventDefault()}),q(b,t.release,k.hitch(this,"_stopDrag"))]);a.stopPropagation();a.preventDefault()},_onMouse:function(a){a="mouseover"==a.type||"mouseenter"==a.type;e.toggle(this.domNode,"dijitSplitterHover",a);e.toggle(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V")+"Hover",a)},_getPersistentSplit:function(){return r(this._cookieName)},_setPersistentSplit:function(a){r(this._cookieName,a,{expires:365})},_stopDrag:function(a){try{this.cover&&e.remove(this.cover,"dijitSplitterCoverActive"),
this.fake&&m.destroy(this.fake),e.remove(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active dijitSplitterShadow"),this._drag(a),this._drag(a,!0)}finally{this._cleanupHandlers(),delete this._drag}this.container.persist&&this._setPersistentSplit(this.child.domNode.style[this.horizontal?"height":"width"])},_cleanupHandlers:function(){for(var a;a=this._handlers.pop();)a.remove()},_onKeyDown:function(a){this._resize=!0;var c=this.horizontal,b=1;switch(a.keyCode){case c?
p.UP_ARROW:p.LEFT_ARROW:b*=-1;case c?p.DOWN_ARROW:p.RIGHT_ARROW:break;default:return}c=h.getMarginSize(this.child.domNode)[c?"h":"w"]+this._factor*b;this.container._layoutChildren(this.child.id,Math.max(Math.min(c,this._computeMaxSize()),this.child.minSize));a.stopPropagation();a.preventDefault()},destroy:function(){this._cleanupHandlers();delete this.child;delete this.container;delete this.cover;delete this.fake;this.inherited(arguments)}}),E=d("dijit.layout._Gutter",[u,v],{templateString:'\x3cdiv class\x3d"dijitGutter" role\x3d"presentation"\x3e\x3c/div\x3e',
postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region)},buildRendering:function(){this.inherited(arguments);e.add(this.domNode,"dijitGutter"+(this.horizontal?"H":"V"))}});d=d("dijit.layout.BorderContainer",w,{gutters:!0,liveSplitters:!0,persist:!1,baseClass:"dijitBorderContainer",_splitterClass:D,postMixInProperties:function(){this.gutters||(this.baseClass+="NoGutter");this.inherited(arguments)},_setupChild:function(a){this.inherited(arguments);var c=
a.region,b=a.isLeftToRight();"leading"==c&&(c=b?"left":"right");"trailing"==c&&(c=b?"right":"left");c&&"center"!=c&&(a.splitter||this.gutters)&&!a._splitterWidget&&(b=a.splitter?this._splitterClass:E,k.isString(b)&&(b=k.getObject(b)),b=new b({id:a.id+"_splitter",container:this,child:a,region:c,live:this.liveSplitters}),b.isSplitter=!0,a._splitterWidget=b,c="bottom"==c||c==(this.isLeftToRight()?"right":"left"),m.place(b.domNode,a.domNode,c?"before":"after"),b.startup())},layout:function(){this._layoutChildren()},
removeChild:function(a){var c=a._splitterWidget;c&&(c.destroy(),delete a._splitterWidget);this.inherited(arguments)},getChildren:function(){return l.filter(this.inherited(arguments),function(a){return!a.isSplitter})},getSplitter:function(a){return l.filter(this.getChildren(),function(c){return c.region==a})[0]._splitterWidget},resize:function(a,c){if(!this.cs||!this.pe){var b=this.domNode;this.cs=n.getComputedStyle(b);this.pe=h.getPadExtents(b,this.cs);this.pe.r=n.toPixelValue(b,this.cs.paddingRight);
this.pe.b=n.toPixelValue(b,this.cs.paddingBottom);n.set(b,"padding","0px")}this.inherited(arguments)},_layoutChildren:function(a,c){if(this._borderBox&&this._borderBox.h){var b=[];l.forEach(this._getOrderedChildren(),function(f){b.push(f);f._splitterWidget&&b.push(f._splitterWidget)});G.layoutChildren(this.domNode,{l:this.pe.l,t:this.pe.t,w:this._borderBox.w-this.pe.w,h:this._borderBox.h-this.pe.h},b,a,c)}},destroyRecursive:function(){l.forEach(this.getChildren(),function(a){var c=a._splitterWidget;
c&&c.destroy();delete a._splitterWidget});this.inherited(arguments)}});d.ChildWidgetProperties={splitter:!1,minSize:0,maxSize:Infinity};k.mixin(d.ChildWidgetProperties,w.ChildWidgetProperties);k.extend(F,d.ChildWidgetProperties);d._Splitter=D;d._Gutter=E;return d});