/*
	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.jsonPath.query"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.jsonPath.query"]){_4._hasResource["dojox.jsonPath.query"]=true;_4.provide("dojox.jsonPath.query");_6.jsonPath.query=function(_7,_8,_9){var re=_6.jsonPath._regularExpressions;if(!_9){_9={};}var _a=[];function _b(i){return _a[i];};var _c;if(_9.resultType=="PATH"&&_9.evalType=="RESULT"){throw Error("RESULT based evaluation not supported with PATH based results");}var P={resultType:_9.resultType||"VALUE",normalize:function(_d){var _e=[];_d=_d.replace(/'([^']|'')*'/g,function(t){return "_str("+(_a.push(eval(t))-1)+")";});var ll=-1;while(ll!=_e.length){ll=_e.length;_d=_d.replace(/(\??\([^\(\)]*\))/g,function($0){return "#"+(_e.push($0)-1);});}_d=_d.replace(/[\['](#[0-9]+)[\]']/g,"[$1]").replace(/'?\.'?|\['?/g,";").replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,"");ll=-1;while(ll!=_d){ll=_d;_d=_d.replace(/#([0-9]+)/g,function($0,$1){return _e[$1];});}return _d.split(";");},asPaths:function(_f){for(var j=0;j<_f.length;j++){var p="$";var x=_f[j];for(var i=1,n=x.length;i<n;i++){p+=/^[0-9*]+$/.test(x[i])?("["+x[i]+"]"):("['"+x[i]+"']");}_f[j]=p;}return _f;},exec:function(_10,val,rb){var _11=["$"];var _12=rb?val:[val];var _13=[_11];function add(v,p,def){if(v&&v.hasOwnProperty(p)&&P.resultType!="VALUE"){_13.push(_11.concat([p]));}if(def){_12=v[p];}else{if(v&&v.hasOwnProperty(p)){_12.push(v[p]);}}};function _14(v){_12.push(v);_13.push(_11);P.walk(v,function(i){if(typeof v[i]==="object"){var _15=_11;_11=_11.concat(i);_14(v[i]);_11=_15;}});};function _16(loc,val){if(val instanceof Array){var len=val.length,_17=0,end=len,_18=1;loc.replace(/^(-?[0-9]*):(-?[0-9]*):?(-?[0-9]*)$/g,function($0,$1,$2,$3){_17=parseInt($1||_17);end=parseInt($2||end);_18=parseInt($3||_18);});_17=(_17<0)?Math.max(0,_17+len):Math.min(len,_17);end=(end<0)?Math.max(0,end+len):Math.min(len,end);for(var i=_17;i<end;i+=_18){add(val,i);}}};function _19(str){var i=loc.match(/^_str\(([0-9]+)\)$/);return i?_a[i[1]]:str;};function _1a(val){if(/^\(.*?\)$/.test(loc)){add(val,P.eval(loc,val),rb);}else{if(loc==="*"){P.walk(val,rb&&val instanceof Array?function(i){P.walk(val[i],function(j){add(val[i],j);});}:function(i){add(val,i);});}else{if(loc===".."){_14(val);}else{if(/,/.test(loc)){for(var s=loc.split(/'?,'?/),i=0,n=s.length;i<n;i++){add(val,_19(s[i]));}}else{if(/^\?\(.*?\)$/.test(loc)){P.walk(val,function(i){if(P.eval(loc.replace(/^\?\((.*?)\)$/,"$1"),val[i])){add(val,i);}});}else{if(/^(-?[0-9]*):(-?[0-9]*):?([0-9]*)$/.test(loc)){_16(loc,val);}else{loc=_19(loc);if(rb&&val instanceof Array&&!/^[0-9*]+$/.test(loc)){P.walk(val,function(i){add(val[i],loc);});}else{add(val,loc,rb);}}}}}}}};while(_10.length){var loc=_10.shift();if((val=_12)===null||val===undefined){return val;}_12=[];var _1b=_13;_13=[];if(rb){_1a(val);}else{P.walk(val,function(i){_11=_1b[i]||_11;_1a(val[i]);});}}if(P.resultType=="BOTH"){_13=P.asPaths(_13);var _1c=[];for(var i=0;i<_13.length;i++){_1c.push({path:_13[i],value:_12[i]});}return _1c;}return P.resultType=="PATH"?P.asPaths(_13):_12;},walk:function(val,f){if(val instanceof Array){for(var i=0,n=val.length;i<n;i++){if(i in val){f(i);}}}else{if(typeof val==="object"){for(var m in val){if(val.hasOwnProperty(m)){f(m);}}}}},eval:function(x,_1d){try{return $&&_1d&&eval(x.replace(/@/g,"_v"));}catch(e){throw new SyntaxError("jsonPath: "+e.message+": "+x.replace(/@/g,"_v").replace(/\^/g,"_a"));}}};var $=_7;if(_8&&_7){return P.exec(P.normalize(_8).slice(1),_7,_9.evalType=="RESULT");}return false;};}}};});