/* 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 */ //>>built define("dojo/_base/declare",["./kernel","../has","./lang"],function(_1,_2,_3){ var _4=_3.mixin,op=Object.prototype,_5=op.toString,_6=new Function,_7=0,_8="constructor"; function _9(_a,_b){ throw new Error("declare"+(_b?" "+_b:"")+": "+_a); }; function _c(_d,_e){ var _f=[],_10=[{cls:0,refs:[]}],_11={},_12=1,l=_d.length,i=0,j,lin,_13,top,_14,rec,_15,_16; for(;i=0;--j){ _14=lin[j].prototype; if(!_14.hasOwnProperty("declaredClass")){ _14.declaredClass="uniqName_"+(_7++); } _15=_14.declaredClass; if(!_11.hasOwnProperty(_15)){ _11[_15]={count:0,refs:[],cls:lin[j]}; ++_12; } rec=_11[_15]; if(top&&top!==rec){ rec.refs.push(top); ++top.count; } top=rec; } ++top.count; _10[0].refs.push(top); } while(_10.length){ top=_10.pop(); _f.push(top.cls); --_12; while(_16=top.refs,_16.length==1){ top=_16[0]; if(!top||--top.count){ top=0; break; } _f.push(top.cls); --_12; } if(top){ for(i=0,l=_16.length;i=0;--i){ f=_3a[i]; m=f._meta; f=m?m.ctor:f; if(f){ f.apply(this,_3d?_3d[i]:a); } } f=this.postscript; if(f){ f.apply(this,_3c); } }; }; function _3f(_40,_41){ return function(){ var a=arguments,t=a,a0=a[0],f; if(!(this instanceof a.callee)){ return _3e(a); } if(_41){ if(a0){ f=a0.preamble; if(f){ t=f.apply(this,t)||t; } } f=this.preamble; if(f){ f.apply(this,t); } } if(_40){ _40.apply(this,a); } f=this.postscript; if(f){ f.apply(this,a); } }; }; function _42(_43){ return function(){ var a=arguments,i=0,f,m; if(!(this instanceof a.callee)){ return _3e(a); } for(;f=_43[i];++i){ m=f._meta; f=m?m.ctor:f; if(f){ f.apply(this,a); break; } } f=this.postscript; if(f){ f.apply(this,a); } }; }; function _44(_45,_46,_47){ return function(){ var b,m,f,i=0,_48=1; if(_47){ i=_46.length-1; _48=-1; } for(;b=_46[i];i+=_48){ m=b._meta; f=(m?m.hidden:b.prototype)[_45]; if(f){ f.apply(this,arguments); } } }; }; function _49(_4a){ _6.prototype=_4a.prototype; var t=new _6; _6.prototype=null; return t; }; function _3e(_4b){ var _4c=_4b.callee,t=_49(_4c); _4c.apply(t,_4b); return t; }; function _35(_4d,_4e,_4f){ if(typeof _4d!="string"){ _4f=_4e; _4e=_4d; _4d=""; } _4f=_4f||{}; var _50,i,t,_51,_52,_53,_54,_55=1,_56=_4e; if(_5.call(_4e)=="[object Array]"){ _53=_c(_4e,_4d); t=_53[0]; _55=_53.length-t; _4e=_53[_55]; }else{ _53=[0]; if(_4e){ if(_5.call(_4e)=="[object Function]"){ t=_4e._meta; _53=_53.concat(t?t.bases:_4e); }else{ _9("base class is not a callable constructor.",_4d); } }else{ if(_4e!==null){ _9("unknown base class. Did you use dojo.require to pull it in?",_4d); } } } if(_4e){ for(i=_55-1;;--i){ _50=_49(_4e); if(!i){ break; } t=_53[i]; (t._meta?_29:_4)(_50,t.prototype); _51=new Function; _51.superclass=_4e; _51.prototype=_50; _4e=_50.constructor=_51; } }else{ _50={}; } _35.safeMixin(_50,_4f); t=_4f.constructor; if(t!==op.constructor){ t.nom=_8; _50.constructor=t; } for(i=_55-1;i;--i){ t=_53[i]._meta; if(t&&t.chains){ _54=_4(_54||{},t.chains); } } if(_50["-chains-"]){ _54=_4(_54||{},_50["-chains-"]); } t=!_54||!_54.hasOwnProperty(_8); _53[0]=_51=(_54&&_54.constructor==="manual")?_42(_53):(_53.length==1?_3f(_4f.constructor,t):_39(_53,t)); _51._meta={bases:_53,hidden:_4f,chains:_54,parents:_56,ctor:_4f.constructor}; _51.superclass=_4e&&_4e.prototype; _51.extend=_33; _51.createSubclass=_36; _51.prototype=_50; _50.constructor=_51; _50.getInherited=_21; _50.isInstanceOf=_27; _50.inherited=_26; _50.__inherited=_17; if(_4d){ _50.declaredClass=_4d; _3.setObject(_4d,_51); } if(_54){ for(_52 in _54){ if(_50[_52]&&typeof _54[_52]=="string"&&_52!=_8){ t=_50[_52]=_44(_52,_53,_54[_52]==="after"); t.nom=_52; } } } return _51; }; _1.safeMixin=_35.safeMixin=_2e; _1.declare=_35; return _35; });