//>>built
define("dojox/mvc/_atBindingMixin","dojo/_base/array dojo/_base/lang dojo/_base/declare dojo/has dojo/Stateful ./resolve ./sync".split(" "),function(w,m,p,l,y,x,z){function A(a){try{var b=require("dijit/registry")}catch(c){return}for(a=a.domNode&&a.domNode.parentNode;a;){if(a=b.getEnclosingWidget(a)){var d=a._relTargetProp||"target";if((m.isFunction(a.get)?a.get(d):a[d])||d in a.constructor.prototype)return a}a=a&&a.domNode.parentNode}}function r(a,b,d,c,g){function n(){h.Two&&h.Two.unwatch();delete h.Two;
var e=f&&(m.isFunction(f.get)?f.get(t):f[t]),k=x(a,e);e=x(d,e);l("mvc-bindings-log-api")&&(!k||/^rel:/.test(a)&&!f)&&u(a,b);l("mvc-bindings-log-api")&&(!e||/^rel:/.test(d)&&!f)&&u(d,c);k&&e&&(!/^rel:/.test(a)&&!/^rel:/.test(d)||f)&&(k.set&&k.watch||"*"!=b?null==b?(m.isFunction(e.set)?e.set(c,k):e[c]=k,l("mvc-bindings-log-api")):h.Two=z(k,b,e,c,g):l("mvc-bindings-log-api")&&u(a,b))}var h={},f=A(d),t=f&&f._relTargetProp||"target";n();if(f&&/^rel:/.test(a)||/^rel:/.test(d)&&m.isFunction(f.set)&&m.isFunction(f.watch))h.rel=
f.watch(t,function(e,k,B){k!==B&&(l("mvc-bindings-log-api"),n())});var v={};v.unwatch=v.remove=function(){for(var e in h)h[e]&&h[e].unwatch(),delete h[e]};return v}l("mvc-bindings-log-api");var u=l("mvc-bindings-log-api")?function(a,b){}:"",q={dataBindAttr:"data-mvc-bindings",_dbpostscript:function(a,b){var d=this._refs=(a||{}).refs||{},c;for(c in a)if("dojox.mvc.at"==(a[c]||{}).atsignature){var g=a[c];delete a[c];d[c]=g}g=new y;var n=this;g.toString=function(){return"[Mixin value of widget "+n.declaredClass+
", "+(n.id||"NO ID")+"]"};g.canConvertToLoggable=!0;this._startAtWatchHandles(g);for(c in d)void 0!==g[c]&&((a=a||{})[c]=g[c]);this._stopAtWatchHandles()},_startAtWatchHandles:function(a){this.canConvertToLoggable=!0;var b=this._refs;if(b){var d=this._atWatchHandles=this._atWatchHandles||{};this._excludes=null;for(var c in b)b[c]&&"*"!=c&&(d[c]=r(b[c].target,b[c].targetProp,a||this,c,{bindDirection:b[c].bindDirection,converter:b[c].converter,equals:b[c].equalsCallback}));"dojox.mvc.at"==(b["*"]||
{}).atsignature&&(d["*"]=r(b["*"].target,b["*"].targetProp,a||this,"*",{bindDirection:b["*"].bindDirection,converter:b["*"].converter,equals:b["*"].equalsCallback}))}},_stopAtWatchHandles:function(){for(var a in this._atWatchHandles)this._atWatchHandles[a].unwatch(),delete this._atWatchHandles[a]},_setAtWatchHandle:function(a,b){if("ref"==a)throw Error(this+": 1.7 ref syntax used in conjunction with 1.8 dojox/mvc/at syntax, which is not supported.");var d=this._atWatchHandles=this._atWatchHandles||
{};d[a]&&(d[a].unwatch(),delete d[a]);this._excludes=this[a]=null;this._started?d[a]=r(b.target,b.targetProp,this,a,{bindDirection:b.bindDirection,converter:b.converter,equals:b.equalsCallback}):this._refs[a]=b},_setBind:function(a){a=eval("({"+a+"})");for(var b in a){var d=a[b];"dojox.mvc.at"==(d||{}).atsignature&&this._setAtWatchHandle(b,d)}},_getExcludesAttr:function(){if(this._excludes)return this._excludes;var a=[],b;for(b in this._atWatchHandles)"*"!=b&&a.push(b);return a},_getPropertiesAttr:function(){if(this.constructor._attribs)return this.constructor._attribs;
var a=["onClick"].concat(this.constructor._setterAttrs);w.forEach(["id","excludes","properties","ref","binding"],function(b){b=w.indexOf(a,b);0<=b&&a.splice(b,1)});return this.constructor._attribs=a}};q[q.dataBindAttr]="";p=p("dojox/mvc/_atBindingMixin",null,q);p.mixin=q;return p});