var __slice=Array.prototype.slice;(function(a,b){if(typeof define=="function"&&define.amd)return define("synapse/backbone-view",["synapse/core","backbone","exports"],function(c,d,e){return b(a,e,c,d)});if(typeof exports=="undefined")return a.BackboneViewHook=b(a,{},a.SynapseCore,a.Backbone)})(this,function(a,b,c){var d,e,f,g;return g=function(){return{registry:{},register:function(a){return this.registry[a.name]=a},unregister:function(a){return delete this.registry[a]},get:function(){var a,b,c,d,e,f;e=arguments[0],d=arguments[1],a=3>arguments.length?[]:__slice.call(arguments,2),f=d.split("."),d=f[0],c=f[1],c!=null&&(a=[c].concat(a));if(b=this.registry[d])return b.get.apply(e,a)},set:function(){var a,b,c,d,e,f;e=arguments[0],d=arguments[1],a=3>arguments.length?[]:__slice.call(arguments,2),f=d.split("."),d=f[0],c=f[1],c!=null&&(a=[c].concat(a));if(b=this.registry[d])return b.set.apply(e,a)}}}(),function(){var a,b,d,e,f,h;return d=function(b){return this.prop!=null?this.prop(b):a.call(this,b)},h=function(a,b){return this.prop!=null?typeof a=="object"?this.prop(a):this.prop(a,b):e.call(this,a,b)},a=function(a){return this.attr(a)},e=function(a,b){return c.isObject(a)?this.attr(a):this.attr(a,b)},b=function(a){return this.css(a)},f=function(a,b){return c.isObject(a)?this.css(a):this.css(a,b)},g.register({name:"text",get:function(){return this.text()},set:function(a){return this.text((a!=null?a:"").toString())}}),g.register({name:"html",get:function(){return this.html()},set:function(a){return this.html((a!=null?a:"").toString())}}),g.register({name:"value",get:function(){return this.val()},set:function(a){return this.val(a!=null?a:"")}}),g.register({name:"enabled",get:function(){return!d.call(this,"disabled")},set:function(a){return c.isArray(a)&&a.length===0&&(a=!1),h.call(this,"disabled",!Boolean(a))}}),g.register({name:"disabled",get:function(){return d.call(this,"disabled")},set:function(a){return c.isArray(a)&&a.length===0&&(a=!1),h.call(this,"disabled",Boolean(a))}}),g.register({name:"checked",get:function(){return d.call(this,"checked")},set:function(a){return c.isArray(a)&&a.length===0&&(a=!1),h.call(this,"checked",Boolean(a))}}),g.register({name:"visible",get:function(){return b.call(this,"display")===!1},set:function(a){return c.isArray(a)&&a.length===0&&(a=!1),Boolean(a)?this.show():this.hide()}}),g.register({name:"hidden",get:function(){return b.call(this,"display")==="none"},set:function(a){return c.isArray(a)&&a.length===0&&(a=!1),Boolean(a)?this.hide():this.show()}}),g.register({name:"prop",get:function(a){return d.call(this,a)},set:function(a,b){return h.call(this,a,b)}}),g.register({name:"attr",get:function(b){return a.call(this,b)},set:function(a,b){return e.call(this,a,b)}}),g.register({name:"css",get:function(a){return b.call(this,a)},set:function(a,b){return f.call(this,a,b)}}),g.register({name:"data",get:function(a){return this.data(a)},set:function(a,b){return this.data(a,b)}}),g.register({name:"class",get:function(a){return this.hasClass(a)},set:function(a,b){return this.toggleClass(a,Boolean(b))}})}(),d=[["a,button,[type=button],[type=reset]","click"],["select,[type=checkbox],[type=radio],textarea","change"],["[type=submit]","submit"],["input","keyup"]],f=[["[type=checkbox],[type=radio]","checked"],["input,textarea,select","value"]],e=["name","role","data-bind"],{typeName:"Backbone View",domEvents:d,elementBindAttributes:e,elementInterfaces:f,interfaces:g,checkObjectType:function(a){return a instanceof Backbone.View},getHandler:function(a,b){var d,e;return d=a.$(a.el),c.isFunction(a[b])?e=a[b]():e=g.get(d,b),e&&d.is("[type=number]")?e.indexOf(".")>-1?parseFloat(e):parseInt(e):e},setHandler:function(a,b,d){return c.isFunction(a[b])?a[b](d):g.set(a.$(a.el),b,d)},onEventHandler:function(a,b,c){return a.$(a.el).bind(b,c)},offEventHandler:function(a,b,c){return a.$(a.el).unbind(b,c)},triggerEventHandler:function(a,b){return a.$(a.el).trigger(b)},detectEvent:function(a){var b,c,e,f,g,h;b=a.$(a.el);for(g=0,h=d.length;g