//>>built
define("dojox/mobile/TreeView","dojo/_base/kernel dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/_base/window dojo/dom-construct dijit/registry ./Heading ./ListItem ./ProgressIndicator ./RoundRectList ./ScrollableView ./viewRegistry dojo/has dojo/has!dojo-bidi?dojox/mobile/bidi/TreeView".split(" "),function(b,r,e,k,l,t,h,u,m,v,n,p,w,q,x){b.experimental("dojox.mobile.TreeView");b=e(q("dojo-bidi")?"dojox.mobile.NonBidiTreeView":"dojox.mobile.TreeView",p,{postCreate:function(){this._load();
this.inherited(arguments)},_customizeListItem:function(a){},_load:function(){this.model.getRoot(k.hitch(this,function(a){var c=this,d=new n;a={label:c.model.rootLabel,moveTo:"#",onClick:function(){c.handleClick(this)},item:a};this._customizeListItem(a);a=new m(a);d.addChild(a);this.addChild(d)}))},handleClick:function(a){var c="view_",c=a.item[this.model.newItemIdAttr]?c+a.item[this.model.newItemIdAttr]:c+"rootView",c=c.replace("/","_");if(h.byId(c))h.byNode(a.domNode).transitionTo(c);else{var d=
v.getInstance();l.body().appendChild(d.domNode);d.start();this.model.getChildren(a.item,k.hitch(this,function(b){var f=this,e=new n;r.forEach(b,function(a,c){var b={item:a,label:a[f.model.store.label],transition:"slide"};f._customizeListItem(b);f.model.mayHaveChildren(a)&&(b.moveTo="#",b.onClick=function(){f.handleClick(this)});b=new m(b);e.addChild(b)});b=new u({label:"Dynamic View",back:"Back",moveTo:w.getEnclosingView(a.domNode).id,dir:this.isLeftToRight()?"ltr":"rtl"});var g=p({id:c,dir:this.isLeftToRight()?
"ltr":"rtl"},t.create("div",null,l.body()));g.addChild(b);g.addChild(e);g.startup();d.stop();h.byNode(a.domNode).transitionTo(g.id)}))}}});return q("dojo-bidi")?e("dojox.mobile.TreeView",[b,x]):b});