//>>built
define("dojox/widget/Portlet","dojo/_base/declare dojo/_base/kernel dojo/_base/lang dojo/_base/array dojo/_base/event dojo/_base/connect dojo/dom-style dojo/dom-class dojo/dom-construct dojo/fx dijit/registry dijit/TitlePane dijit/_Container ./PortletSettings ./PortletDialogSettings".split(" "),function(u,v,h,p,w,x,g,f,q,C,r,y,z,D,E){v.experimental("dojox.widget.Portlet");return u("dojox.widget.Portlet",[y,z],{resizeChildren:!0,closable:!0,_parents:null,_size:null,dragRestriction:!1,buildRendering:function(){this.inherited(arguments);
g.set(this.domNode,"visibility","hidden")},postCreate:function(){this.inherited(arguments);f.add(this.domNode,"dojoxPortlet");f.remove(this.arrowNode,"dijitArrowNode");f.add(this.arrowNode,"dojoxPortletIcon dojoxArrowDown");f.add(this.titleBarNode,"dojoxPortletTitle");f.add(this.hideNode,"dojoxPortletContentOuter");f.add(this.domNode,"dojoxPortlet-"+(this.dragRestriction?"nonmovable":"movable"));var a=this;if(this.resizeChildren){this.subscribe("/dnd/drop",function(){a._updateSize()});this.subscribe("/Portlet/sizechange",
function(e){a.onSizeChange(e)});this.connect(window,"onresize",function(){a._updateSize()});var c=h.hitch(this,function(e,k){var m=r.byId(e);if(m.selectChild){var B=this.subscribe(e+"-selectChild",function(A){for(var n=a.domNode.parentNode;n;){if(n==A.domNode){a.unsubscribe(B);a._updateSize();break}n=n.parentNode}}),t=r.byId(k);m&&t&&a._parents.push({parent:m,child:t})}});this._parents=[];for(var d=this.domNode.parentNode;null!=d;d=d.parentNode){var b=d.getAttribute?d.getAttribute("widgetId"):null;
if(b){c(b,l);var l=b}}}this.connect(this.titleBarNode,"onmousedown",function(e){return f.contains(e.target,"dojoxPortletIcon")?(w.stop(e),!1):!0});this.connect(this._wipeOut,"onEnd",function(){a._publish()});this.connect(this._wipeIn,"onEnd",function(){a._publish()});this.closable&&(this.closeIcon=this._createIcon("dojoxCloseNode","dojoxCloseNodeHover",h.hitch(this,"onClose")),g.set(this.closeIcon,"display",""))},startup:function(){if(!this._started){var a=this.getChildren();this._placeSettingsWidgets();
p.forEach(a,function(c){try{c.started||c._started||c.startup()}catch(d){}});this.inherited(arguments);g.set(this.domNode,"visibility","visible")}},_placeSettingsWidgets:function(){p.forEach(this.getChildren(),h.hitch(this,function(a){a.portletIconClass&&a.toggle&&!a.get("portlet")&&(this._createIcon(a.portletIconClass,a.portletIconHoverClass,h.hitch(a,"toggle")),q.place(a.domNode,this.containerNode,"before"),a.set("portlet",this),this._settingsWidget=a)}))},_createIcon:function(a,c,d){var b=q.create("div",
{"class":"dojoxPortletIcon "+a,waiRole:"presentation"});q.place(b,this.arrowNode,"before");this.connect(b,"onclick",d);c&&(this.connect(b,"onmouseover",function(){f.add(b,c)}),this.connect(b,"onmouseout",function(){f.remove(b,c)}));return b},onClose:function(a){g.set(this.domNode,"display","none")},onSizeChange:function(a){a!=this&&this._updateSize()},_updateSize:function(){this.open&&this._started&&this.resizeChildren&&(this._timer&&clearTimeout(this._timer),this._timer=setTimeout(h.hitch(this,function(){for(var a=
{w:g.get(this.domNode,"width"),h:g.get(this.domNode,"height")},c=0;c<this._parents.length;c++){var d=this._parents[c],b=d.parent.selectedChildWidget;if(b&&b!=d.child)return}if(!this._size||this._size.w!=a.w||this._size.h!=a.h){this._size=a;var l=["resize","layout"];this._timer=null;a=this.getChildren();p.forEach(a,function(e){for(var k=0;k<l.length;k++)if(h.isFunction(e[l[k]])){try{e[l[k]]()}catch(m){}break}});this.onUpdateSize()}}),100))},onUpdateSize:function(){},_publish:function(){x.publish("/Portlet/sizechange",
[this])},_onTitleClick:function(a){a.target==this.arrowNode&&this.inherited(arguments)},addChild:function(a){this._size=null;this.inherited(arguments);this._started&&(this._placeSettingsWidgets(),this._updateSize());!this._started||a.started||a._started||a.startup()},destroyDescendants:function(a){this.inherited(arguments);this._settingsWidget&&this._settingsWidget.destroyRecursive(a)},destroy:function(){this._timer&&clearTimeout(this._timer);this.inherited(arguments)},_setCss:function(){this.inherited(arguments);
g.set(this.arrowNode,"display",this.toggleable?"":"none")}})});