//>>built
define("dojo/_base/declare",["./kernel","../has","./lang"],function(t,B,w){function p(e,d){throw Error("declare"+(d?" "+d:"")+": "+e);}function C(e,d,a){var b,c,f,h,i,g,j,m=this._inherited=this._inherited||{};"string"==typeof e&&(b=e,e=d,d=a);a=0;h=e.callee;(b=b||h.nom)||p("can't deduce a name to call inherited()",this.declaredClass);i=this.constructor._meta;f=i.bases;j=m.p;if(b!=q){if(m.c!==h&&(j=0,g=f[0],i=g._meta,i.hidden[b]!==h)){(c=i.chains)&&"string"==typeof c[b]&&p("calling chained method with inherited: "+
b,this.declaredClass);do if(i=g._meta,c=g.prototype,i&&(c[b]===h&&c.hasOwnProperty(b)||i.hidden[b]===h))break;while(g=f[++j]);j=g?j:-1}if(g=f[++j])if(c=g.prototype,g._meta&&c.hasOwnProperty(b))a=c[b];else{h=r[b];do if(c=g.prototype,(a=c[b])&&(g._meta?c.hasOwnProperty(b):a!==h))break;while(g=f[++j])}a=g&&a||r[b]}else{if(m.c!==h&&(j=0,(i=f[0]._meta)&&i.ctor!==h)){c=i.chains;for((!c||"manual"!==c.constructor)&&p("calling chained constructor with inherited",this.declaredClass);(g=f[++j])&&!((i=g._meta)&&
i.ctor===h););j=g?j:-1}for(;(g=f[++j])&&!(a=(i=g._meta)?i.ctor:g););a=g&&a}m.c=a;m.p=j;if(a)return!0===d?a:a.apply(this,d||e)}function E(e,d){return"string"==typeof e?this.__inherited(e,d,!0):this.__inherited(e,!0)}function F(e,d,a){var b=this.getInherited(e,d);if(b)return b.apply(this,a||d||e)}function G(e){for(var d=this.constructor._meta.bases,a=0,b=d.length;a<b;++a)if(d[a]===e)return!0;return this instanceof e}function H(e,d){for(var a in d)a!=q&&d.hasOwnProperty(a)&&(e[a]=d[a]);if(B("bug-for-in-skips-shadowed"))for(var b=
w._extraNames,c=b.length;c;)a=b[--c],a!=q&&d.hasOwnProperty(a)&&(e[a]=d[a])}function I(e){u.safeMixin(this.prototype,e);return this}function J(e){return u([this].concat(e))}function K(e,d){return function(){var g;var a=arguments,b=a,c=a[0],f,h;h=e.length;var i;if(!(this instanceof a.callee))return s(a);if(d&&(c&&c.preamble||this.preamble)){i=Array(e.length);i[0]=a;for(f=0;;){if(c=a[0])(c=c.preamble)&&(a=c.apply(this,a)||a);c=e[f].prototype;(c=c.hasOwnProperty("preamble")&&c.preamble)&&(a=c.apply(this,
a)||a);if(++f==h)break;i[f]=a}}for(f=h-1;0<=f;--f)c=e[f],(g=(h=c._meta)?h.ctor:c,c=g)&&c.apply(this,i?i[f]:a);(c=this.postscript)&&c.apply(this,b)}}function L(e,d){return function(){var a=arguments,b=a,c=a[0];if(!(this instanceof a.callee))return s(a);if(d){if(c)(c=c.preamble)&&(b=c.apply(this,b)||b);(c=this.preamble)&&c.apply(this,b)}e&&e.apply(this,a);(c=this.postscript)&&c.apply(this,a)}}function M(e){return function(){var f;var d=arguments,a=0,b,c;if(!(this instanceof d.callee))return s(d);for(;b=
e[a];++a)if(f=(c=b._meta)?c.ctor:b,b=f){b.apply(this,d);break}(b=this.postscript)&&b.apply(this,d)}}function N(e,d,a){return function(){var b,c,f=0,h=1;a&&(f=d.length-1,h=-1);for(;b=d[f];f+=h)c=b._meta,(b=(c?c.hidden:b.prototype)[e])&&b.apply(this,arguments)}}function D(e){z.prototype=e.prototype;e=new z;z.prototype=null;return e}function s(e){var d=e.callee,a=D(d);d.apply(a,e);return a}function u(e,d,a){"string"!=typeof e&&(a=d,d=e,e="");var a=a||{},b,c,f,h,i,g,j,m=1,t=d;if("[object Array]"==v.call(d)){m=
e;f=[];h=[{cls:0,refs:[]}];g={};for(var x=1,s=d.length,o=0,l,y,k,n;o<s;++o){(l=d[o])?"[object Function]"!=v.call(l)&&p("mixin #"+o+" is not a callable constructor.",m):p("mixin #"+o+" is unknown. Did you use dojo.require to pull it in?",m);y=l._meta?l._meta.bases:[l];k=0;for(l=y.length-1;0<=l;--l){n=y[l].prototype;if(!n.hasOwnProperty("declaredClass"))n.declaredClass="uniqName_"+O++;n=n.declaredClass;g.hasOwnProperty(n)||(g[n]={count:0,refs:[],cls:y[l]},++x);n=g[n];k&&k!==n&&(n.refs.push(k),++k.count);
k=n}++k.count;h[0].refs.push(k)}for(;h.length;){k=h.pop();f.push(k.cls);for(--x;c=k.refs,1==c.length;){k=c[0];if(!k||--k.count){k=0;break}f.push(k.cls);--x}if(k)for(o=0,s=c.length;o<s;++o)k=c[o],--k.count||h.push(k)}x&&p("can't build consistent linearization",m);l=d[0];f[0]=l?l._meta&&l===f[f.length-l._meta.bases.length]?l._meta.bases.length:1:0;g=f;f=g[0];m=g.length-f;d=g[m]}else g=[0],d?"[object Function]"==v.call(d)?(f=d._meta,g=g.concat(f?f.bases:d)):p("base class is not a callable constructor.",
e):null!==d&&p("unknown base class. Did you use dojo.require to pull it in?",e);if(d)for(c=m-1;;--c){b=D(d);if(!c)break;f=g[c];(f._meta?H:A)(b,f.prototype);h=new Function;h.superclass=d;h.prototype=b;d=b.constructor=h}else b={};u.safeMixin(b,a);f=a.constructor;if(f!==r.constructor)f.nom=q,b.constructor=f;for(c=m-1;c;--c)(f=g[c]._meta)&&f.chains&&(j=A(j||{},f.chains));b["-chains-"]&&(j=A(j||{},b["-chains-"]));f=!j||!j.hasOwnProperty(q);g[0]=h=j&&"manual"===j.constructor?M(g):1==g.length?L(a.constructor,
f):K(g,f);h._meta={bases:g,hidden:a,chains:j,parents:t,ctor:a.constructor};h.superclass=d&&d.prototype;h.extend=I;h.createSubclass=J;h.prototype=b;b.constructor=h;b.getInherited=E;b.isInstanceOf=G;b.inherited=P;b.__inherited=C;if(e)b.declaredClass=e,w.setObject(e,h);if(j)for(i in j)if(b[i]&&"string"==typeof j[i]&&i!=q)f=b[i]=N(i,g,"after"===j[i]),f.nom=i;return h}var A=w.mixin,r=Object.prototype,v=r.toString,z=new Function,O=0,q="constructor",P=t.config.isDebug?F:C;t.safeMixin=u.safeMixin=function(e,
d){var a,b;for(a in d)if(b=d[a],(b!==r[a]||!(a in r))&&a!=q){if("[object Function]"==v.call(b))b.nom=a;e[a]=b}if(B("bug-for-in-skips-shadowed"))for(var c=w._extraNames,f=c.length;f;)if(a=c[--f],b=d[a],(b!==r[a]||!(a in r))&&a!=q){if("[object Function]"==v.call(b))b.nom=a;e[a]=b}return e};return t.declare=u});