/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.wire.TreeAdapter"],["require","dojox.wire.CompositeWire"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.wire.TreeAdapter"]){_4._hasResource["dojox.wire.TreeAdapter"]=true;_4.provide("dojox.wire.TreeAdapter");_4.require("dojox.wire.CompositeWire");_4.declare("dojox.wire.TreeAdapter",_6.wire.CompositeWire,{_wireClass:"dojox.wire.TreeAdapter",constructor:function(_7){this._initializeChildren(this.nodes);},_getValue:function(_8){if(!_8||!this.nodes){return _8;}var _9=_8;if(!_4.isArray(_9)){_9=[_9];}var _a=[];for(var i in _9){for(var i2 in this.nodes){_a=_a.concat(this._getNodes(_9[i],this.nodes[i2]));}}return _a;},_setValue:function(_b,_c){throw new Error("Unsupported API: "+this._wireClass+"._setValue");},_initializeChildren:function(_d){if(!_d){return;}for(var i in _d){var _e=_d[i];if(_e.node){_e.node.parent=this;if(!_6.wire.isWire(_e.node)){_e.node=_6.wire.create(_e.node);}}if(_e.title){_e.title.parent=this;if(!_6.wire.isWire(_e.title)){_e.title=_6.wire.create(_e.title);}}if(_e.children){this._initializeChildren(_e.children);}}},_getNodes:function(_f,_10){var _11=null;if(_10.node){_11=_10.node.getValue(_f);if(!_11){return [];}if(!_4.isArray(_11)){_11=[_11];}}else{_11=[_f];}var _12=[];for(var i in _11){_f=_11[i];var _13={};if(_10.title){_13.title=_10.title.getValue(_f);}else{_13.title=_f;}if(_10.children){var _14=[];for(var i2 in _10.children){_14=_14.concat(this._getNodes(_f,_10.children[i2]));}if(_14.length>0){_13.children=_14;}}_12.push(_13);}return _12;}});}}};});