UNPKG

@danielkalen/simplybind

Version:

Magically simple, framework-less one-way/two-way data binding for frontend/backend in ~5kb.

2 lines (1 loc) 18 kB
!function(){var t,v,I,A,T,U,V,W,X,Y,Z,aa,ba,ca,da,ea,fa,m,J,ga,B,q,K,C,D,g,ha,w,E,ia,x,r,ja,L,M,ka,F,N,la,n,y,ma,O,na,G,H,P,Q,oa,R,S,pa,p,l,z,qa,u,ra;return ia=0,B="push pop shift unshift splice reverse sort".split(" "),ja={},q={},P=["{{","}}"],p=Object.create({silent:!1},{placeholder:{get:function(){return P},set:function(a){g.iA(a)&&2===a.length&&(P=a,S())}}}),x={delay:!1,throttle:!1,simpleSelector:!1,promiseTransforms:!1,dispatchEvents:!1,sendArrayCopies:!1,updateEvenIfSame:!1,updateOnBind:!0},r=Object.defineProperty,O=Object.getOwnPropertyDescriptor,C=null,D=function(){var a;return C||(a=C=document.createEvent("Event"),a.initEvent("change",!0,!1),a._sb=!0),C},oa=!("className"in Element.prototype&&O(Element.prototype,"className").get),ra="innerWidth innerHeight outerWidth outerHeight scrollX scrollY pageXOffset pageYOffset screenX screenY screenLeft screenTop".split(" "),pa=function(a,b){return this.uAS(b||this)},la=function(){return""+ ++ia},n=function(){return Object.create(null)},y=function(a,b){return function(c,d,e){return m(c,d,e,a,b)}},ma=function(a,b){return a.sU||(a.sU=new t(function(){return b?a.sV(a.fDV(),a,!0):a.uAS(a)},"Func",{}))},l=function(a,b){return a&&-1!==a.indexOf(b)},g={iD:function(a){return void 0!==a},iA:function(a){return a instanceof Array},iO:function(a){return"object"==typeof a&&a},iS:function(a){return"string"==typeof a},iN:function(a){return"number"==typeof a},iF:function(a){return"function"==typeof a},iBI:function(a){return a instanceof v},iB:function(a){return a instanceof t},isI:function(a){return g.iO(a)&&g.iN(a.length)},DM:function(a){return a.nodeName&&1===a.nodeType},dI:function(a){return a=a.nodeName,"INPUT"===a||"TEXTAREA"===a||"SELECT"===a},dR:function(a){return"radio"===a.type},dC:function(a){return"checkbox"===a.type},eC:function(a){return a instanceof NodeList||a instanceof HTMLCollection||g.iD(jQuery)&&a instanceof jQuery},eAS:function(a){var b;return b=a[0].type,[].filter.call(a,function(a){return a.type===b}).length===a.length}},N=function(a,b,c){var d;return(d=O(a,b))?(c&&(d.configurable=!0),d):(a=Object.getPrototypeOf(a))?N(a,b,!0):void 0},w=function(a,b,c){var d,e,f,h,k,m;a.OD||(a.OD=N(b,a.pr)),c?B.forEach(function(c){return r(b,c,{configurable:!0,value:function(){var d;return d=Array.prototype[c].apply(b,arguments),a.uAS(a),d}})}):"Proxy"===a.type?(e=a.oR=a.value,a.value={result:null,args:null},g.iF(e)&&(m=[].slice,d=f=function(){var c;return c=m.call(arguments),a.value.args=c=a.tfS?a.tfS(c):c,a.value.result=c=e.apply(b,c),a.uAS(a),c},r(b,a.pr,{configurable:a.isL=!0,get:function(){return d},set:function(b){g.iF(b)?b!==e&&(b!==f&&(e=a.oR=b),d!==f&&(d=f)):d=b}}))):l(a.type,"DOM")||a.object===window&&l(ra,a.pr)||(c=a.OD||ja,c.get&&(a.OG=c.get.bind(b)),c.set&&(a.OS=c.set.bind(b)),k=(k=c.configurable)&&b.constructor!==CSSStyleDeclaration,oa&&a.DM&&a.pr in b.cloneNode(!1)&&(a.OD=k=!1,a.isL=!0,a.OG=function(){return a.object[a.pr]},a.OS=function(b){return a.object[a.pr]=b}),k&&(k="Array"===a.type,h=!a.OS&&!k,r(b,a.pr,{configurable:a.isL=!0,enumerable:c.enumerable,get:a.OG||function(){return a.value},set:function(b){a.sV(b,a,h)}}),k&&w(a,b[a.pr],!0)))},E=function(a,b,c){var d,e;if(c){for(e=[],a=0,c=B.length;a<c;a++)d=B[a],e.push(delete b[d]);return e}return c=a.OD,c.set||c.get||(c.value=a.oR||a.value),r(b,a.pr,c)},ha=function(a){var b,c;b=n();for(c in a)b[c]=a[c];return b},F=function(a,b){var c,d,e,f;for(f=Object.keys(b),c=0,e=f.length;c<e;c++)d=f[c],a[d]=b[d]},K={get:function(a,b,c,d){return b?q[a._sb_ID]:d&&a[0]._sb_map&&(b=q[a[0]._sb_map[c]],b.gB)?b.gB:a._sb_map&&a._sb_map[c]?q[a._sb_map[c]]:void 0},set:function(a,b){var c,d;b?r(a.object,"_sb_ID",{configurable:!0,value:a.ID}):(d=a.se,a.object._sb_map?a.object._sb_map[d]=a.ID:(c={},c[d]=a.ID,r(a.object,"_sb_map",{configurable:!0,value:c})))}},M=/[.*+?^${}()|[\]\\]/g,G=H=null,S=function(){var a,b,c;c=p.placeholder[0].replace(M,"\\$&"),a=p.placeholder[1].replace(M,"\\$&"),b="[^"+a+"]+",G=new RegExp(c+"("+b+")"+a,"g"),H=new RegExp(""+c+b+a,"g")},S(),ga=function(a,b,c){var d,e,f,h,g;for(g="",e=f=0,h=a.length;f<h;e=++f)d=a[e],g+=d,c[e]&&(g+=b[c[e]]);return g},J=function(a,b,c){null==a[c]&&(a[c]=[]),a[c].push(b)},R=function(a,b){var c,d,e,f,h,g,l,m,n,q,p;for(c=Array.prototype.slice.call(a.childNodes),e=0,h=c.length;e<h;e++)if(n=c[e],3!==n.nodeType)R(n,b);else if(n.textContent.match(H))if(p=n.textContent.split(G),3===p.length&&""===p[0]+p[2])J(b,n,p[1]);else{for(l=document.createDocumentFragment(),d=f=0,g=p.length;f<g;d=++f)q=p[d],m=l.appendChild(document.createTextNode(q)),d%2&&J(b,m,q);n.parentNode.replaceChild(l,n)}},z=function(a){throw Error("SimplyBind: "+(L[a]||a))},u=function(a,b){var c,d;p.silent||(c=na(b),d=L[a],console.warn("SimplyBind: "+(d+("\n\n"+c))))},qa=function(a){z("Invalid argument/s ("+a+")",!0)},na=function(a){return(Error().stack||"").split("\n").slice(a+3).join("\n")},L={erIP:"SimplyBind() and .to() only accept a function, an array, a bound object, a string, or a number.",erFN:"Only functions are allowed for .transform/.condition/All()",erEV:"Invalid argument number in .ofEvent()",emptyList:"Empty collection provided",erOD:"You can only pass a single DOM element to a binding",erMX:"'checked' of Mixed list of element cannot be bound"},m=function(a,b,c,d,e){return(a||0===a)&&(g.iS(a)||g.iN(a)||g.iF(a)||a instanceof Array)||g.iBI(a)||z("erIP"),!g.iO(a)||a instanceof Array?(b=new v(b),b.so=c,b.IS=d,b.cC=e,a=g.iF(a)?b.sS(a,!0):b.sP(a)):a=e?e(a):a.sC(),a},m.version="1.14.2",m.settings=p,m.defaultOptions=x,m.unBindAll=function(a,b){var c,d,e;if(a&&(g.iO(a)||g.iF(a))&&(g.isI(a)&&!a._sb_ID&&a[0]&&g.DM(a[0])&&(a=a[0]),e=a._sb_map,a._sb_ID&&q[a._sb_ID].rAS(b),e))for(d in e)c=e[d],q[c].rAS(b)},t=function(a,b,c){return F(this,c),this.oD=this.so?this.options:x,this.type=b,this.object=a,this.ID=la(),this.subs=[],this.sM=n(),this.pM=n(),this.atEV=[],"Proxy"===this.type&&(this.sV=pa),this.mC&&(this.cH=n(),this.object.forEach(function(a){return function(b){var c;c=a.cH[b.value]=m("checked").of(b)._,c.aS(a),c.sM[a.ID].tF=function(){return c},c.gB=a}}(this))),"Event"===this.type||"Func"===this.type&&this.IS||("Pholder"===this.type?(b=this.de&&!l(this.de,"multi")?this.de+":"+this.pr:this.pr,a=this.pB=m(b).of(a)._,a.sPH(),this.value=a.pVL[this.Ph],a.txN&&(this.txN=a.txN[this.Ph])):(this.value=a=this.fDV(),"ObjectProp"!==this.type||g.iD(a)||(this.object[this.pr]=a),w(this,this.object))),this.aEV(),q[this.ID]=this},t.prototype={aS:function(a,b,c,d){var e,f,h,g;if(a.isMulti)for(h=a.bindings,a=0,f=h.length;a<f;a++)g=h[a],this.aS(g,b,c,d);else this.sM[a.ID]?e=!0:(a.pM[this.ID]=this,this.subs.unshift(a),f=this.sM[a.ID]=n(),f.uO=c,f.opts=ha(b),(d||"Event"===this.type||"Proxy"===this.type||"Array"===this.type)&&(f.opts.updateEvenIfSame=!0),f.VR="Func"===a.type?"ps":"value");return e},rS:function(a,b){var c,d,e,f;if(a.isMulti)for(e=a.bindings,c=0,d=e.length;c<d;c++)f=e[c],this.rS(f,b);else this.sM[a.ID]&&(this.subs.splice(this.subs.indexOf(a),1),delete this.sM[a.ID],delete a.pM[this.ID]),b&&(a.rS(this),delete this.pM[a.ID]);0===this.subs.length&&0===Object.keys(this.pM).length&&this.DES()},rAS:function(a){var b,c,d,e;for(d=this.subs.slice(),b=0,c=d.length;b<c;b++)e=d[b],this.rS(e,a)},DES:function(){var a,b,c,d;if(delete q[this.ID],this.rPI(),"Event"===this.type)for(d=this.atEV,b=0,c=d.length;b<c;b++)a=d[b],this.urEVE(a,this.cEM.listen);else"Func"===this.type&&delete this.object._sb_ID;this.isL&&this.OD&&E(this,this.object),"Array"===this.type&&E(this,this.value,!0),this.object._sb_map&&(delete this.object._sb_map[this.se],0===Object.keys(this.object._sb_map).length&&delete this.object._sb_map)},fDV:function(){var a,b,c,d,e;switch(e=this.type,!1){case"Func"!==e:return this.object();case"DOMAttr"!==e:return this.object.getAttribute(this.pr)||"";case!this.mC:d=[],c=this.cH;for(b in c)if(a=c[b],a.object.checked){if("DOMRadio"===e)return b;d.push(b)}return d;default:return this.object[this.pr]}},sV:function(a,b,c,d){var e,f,h,k;if(b||(b=this),this.tfS&&(a=this.tfS(a)),!c)switch(this.type){case"ObjectProp":this.isL?this.dI?d?a!==this.OG()&&(e=this.object.selectionStart,this.OS(a),e&&this.object.setSelectionRange(e,e)):(this.OS(a),p.dispatchEvents&&this.object.dispatchEvent(D())):this.OS&&this.OS(a):a!==this.value&&(this.object[this.pr]=a);break;case"Pholder":if(d=this.pB,d.pVL[this.Ph]=a,e=ga(d.pCT,d.pVL,d.pIM),this.txN&&a!==this.value)for(h=this.txN,f=0,c=h.length;f<c;f++)k=h[f],k.textContent=a;"textContent"!==this.pr&&d.sV(e,b);break;case"Array":a!==this.value&&(g.iA(a)||(a=Array.prototype.concat(a)),E(this,this.value,!0),w(this,a=a.slice(),!0));break;case"Func":e=this.ps,this.ps=a,a=this.object(a,e);break;case"Event":this.iE=!0,this.eE(a),this.iE=!1;break;case"DOMRadio":if(this.mC)if(d=g.iB(a)?a:this.cH[a])for(f in a=d.object.value,e=this.cH)c=e[f],c.sV(c.ID===d.ID,b);else a=this.value;else{if(a=!!a,a===this.value)return;this.object.checked!==a&&(this.object.checked=a),a&&p.dispatchEvents&&this.object.dispatchEvent(D())}break;case"DOMCheckbox":if(this.mC){for(f=!g.iB(a),a=[].concat(a),c=d=0,h=a.length;d<h;c=++d)k=a[c],a[c]=g.iB(k)?k:this.cH[k];h=[],k=this.cH;for(e in k)c=k[e],d=f?l(a,c):c.value,c.sV(d,b),d&&h.push(e);a=h}else{if(a=!!a,a===this.value)return;this.object.checked!==a&&(this.object.checked=a,p.dispatchEvents&&this.object.dispatchEvent(D()))}break;case"DOMAttr":this.object.setAttribute(this.pr,a)}this.value=a,this.uAS(b)},uAS:function(a){var b,c;if(c=(b=this.subs).length)for(;c--;)this.uS(b[c],a)},uS:function(a,b,c){var d,e,f;if(!(b===a||b!==this&&b.sM[a.ID])){if(d=this.sM[a.ID],d.opts.throttle){if(c=+new Date,e=c-d.lU,e<d.opts.throttle)return clearTimeout(d.uT),d.uT=setTimeout(function(c){return function(){return c.uS(a,b)}}(this),d.opts.throttle-e);d.lU=c}else if(d.opts.delay&&!c)return setTimeout(function(c){return function(){return c.uS(a,b,!0)}}(this),d.opts.delay);c="Array"===this.type&&d.opts.sendArrayCopies?this.value.slice():this.value,e=a[d.VR],c=(f=d.tF)?f(c,e,a.object):c,c===e&&!d.opts.updateEvenIfSame||d.cN&&!d.cN(c,e,a.object)||(d.opts.promiseTransforms&&c&&g.iF(c.then)?c.then(function(c){a.sV(c,b)}):a.sV(c,b),d.uO&&this.rS(a))}},aM:function(a,b,c,d){var e,f,h,k;if(g.iF(c)){for(e=0,f=b.length;e<f;e++)h=b[e],k=h._||h,k.isMulti?this.aM(a,k.bindings,c,d):(h=this.sM[k.ID],h[a]=c,d=d&&!h.uO,this.pM[k.ID]&&(k.sM[this.ID][a]=c),!d&&"Func"!==this.type||"tF"!==a||this.uS(k,this));return!0}return u("erFN",2)},ss:function(a,b){this.tfS=a,b&&this.sV(this.value)},sPH:function(){var a;this.pVL||(this.pVL=n(),this.pIM=n(),this.pCT=[],g.iS(this.value)&&(this.pCT=this.value.split(H),a=0,this.value=this.value.replace(G,function(b){return function(c,d){return b.pIM[a++]=d,b.pVL[d]=d}}(this))),this.DM&&"textContent"===this.pr&&R(this.object,this.txN=n()))},aPI:function(a){if("Event"!==this.type)return this.rPI(),this.PI=setInterval(function(a){return function(){var b;return b=a.fDV(),a.sV(b)}}(this),a)},rPI:function(){return clearInterval(this.PI),this.PI=null},aUV:function(a,b){this.object.addEventListener(a,function(a){return function(c){c._sb||(c=a.tfS&&a.dI,a.sV(a.object[b],null,!c,!0))}}(this),!1)},aEV:function(){this.evN?this.rEVE(this.evN,this.cEM.listen):this.dI?(this.aUV("input","value"),this.aUV("change","value")):this.mC||"DOMRadio"!==this.type&&"DOMCheckbox"!==this.type||this.aUV("change","checked")},rEVE:function(a,b){this.atEV.push(a),this.iEM(a,b||"addEventListener","addEventListener")},urEVE:function(a,b){this.atEV.splice(this.atEV.indexOf(a),1),this.iEM(a,b||"removeEventListener","removeEventListener")},iEM:function(a,b,c){var d;d=this.object,(this.DM&&g.iD(jQuery)&&"on"===b||"off"===b)&&(d=jQuery(this.object)),d[b]||(b=c),this.evH||(this.evH=ka.bind(this)),"function"==typeof d[b]&&d[b](a,this.evH)},eE:function(a){var b,c;return c=this.object,b=this.cEM.emit||"dispatchEvent",this.DM&&g.iD(jQuery)&&"trigger"===b&&(c=jQuery(this.object)),c[b]||(b="dispatchEvent"),"dispatchEvent"===b?(this.evO||(this.evO=document.createEvent("Event"),this.evO.initEvent(this.evN,!0,!0)),this.evO.bindingData=a,c[b](this.evO)):void c[b](this.evN,a)}},ka=function(){this.iE||this.sV(arguments[this.pr],null,!0)},v=function(a,b){var c;if(b)F(this,b),this.sG=1;else for(c in this.sG=0,this.subs=[],this.oP=a||(a={}),this.options={},x)this.options[c]=null!=a[c]?a[c]:x[c];return this},I={sC:function(){return new v(null,this)},dM:function(a){return this._=a,Object.defineProperties(this,{value:{get:function(){return a.value}},original:{get:function(){return a.objects||a.object}},subscribers:{get:function(){return a.subs.slice().map(function(a){return a.object})}}})},createBP:function(a,b,c,d){var e;return this.object=a,(e=K.get(a,d,this.se,this.mC))?this.patchCachedBP(e):(a=new t(a,b,c),K.set(a,d),a)},patchCachedBP:function(a){var b,c,d,e;if("ObjectProp"!==a.type||this.pr in this.object||w(a,this.object),this.so)for(c in d=this.oP)e=d[c],a.oD[c]=e;c=a.oD;for(b in c)e=c[b],this.options[b]=g.iD(this.oP[b])?this.oP[b]:e;return a},sP:function(a){var b;return g.iN(a)&&(a=a.toString()),this.se=this.pr=a,this.options.simpleSelector||(l(a,":")&&(b=a.split(":"),this.de=b.slice(0,-1).join(":"),this.pr=b[b.length-1]),l(a,".")&&(b=this.pr.split("."),this.pr=b[0],this.Ph=b.slice(1).join(".")),l(this.de,"event")&&(l(a,"#")?(b=this.pr.split("#"),this.evN=b[0],this.pr=b[1]):(this.evN=this.pr,this.pr=0),isNaN(parseInt(this.pr))&&u("erEV",1),this.cEM={listen:this.oP.listenMethod,emit:this.oP.emitMethod})),this},sS:function(a,b){var c,d,e,f;if(this.sG=1,f=(e=a!==window&&g.isI(a)&&!a.nodeType)?a[0]:a){if((this.DM=g.DM(f))&&("checked"===this.pr?(d=f&&g.dR(f),c=!d&&f&&g.dC(f)):"value"===this.pr&&(this.dI=g.dI(f)),e&&!l(this.de,"multi")))if(1===a.length)a=a[0];else{if((d||c)&&!g.eAS(a))return u("erMX",3);d||c?(this.mC=!0,a=[].slice.call(a)):(a=a[0],u("erOD",3))}}else e&&g.eC(a)&&z("emptyList");switch(!1){case!b:c="Func";break;case!this.Ph:c="Pholder";break;case!l(this.de,"array"):c="Array";break;case!l(this.de,"event"):c="Event";break;case!l(this.de,"func"):c="Proxy";break;case!d:c="DOMRadio";break;case!c:c="DOMCheckbox";break;case!l(this.de,"attr"):c="DOMAttr";break;default:c="ObjectProp"}return l(this.de,"multi")?(a.length||z("emptyList"),this.dM(new A(this,a,c))):this.dM(this.createBP(a,c,this,b)),l(this._.type,"Event")||l(this._.type,"Proxy")?this.options.updateOnBind=!1:l(this._.type,"Func")&&(this.options.updateOnBind=!0),this.cC?this.cC(this):this},aP:function(a){var b,c,d,e;if(a.sG=2,a.subs.push(this),b=a._.aS(this._,a.options,a.uO),a.uO)delete a.uO;else if(a.options.updateOnBind&&!b)if(this._.isMulti)for(e=this._.bindings,c=0,d=e.length;c<d;c++)b=e[c],a._.uS(b,a._);else a._.uS(this._,a._)}},v.prototype=Object.create(I,{of:{get:function(){if(!this.sG)return X}},set:{get:function(){if(this.sG)return Z}},chainTo:{get:function(){if(2===this.sG)return U}},transformSelf:{get:function(){if(1===this.sG)return ea}},transform:{get:function(){if(2===this.sG)return ca}},transformAll:{get:function(){if(2===this.sG)return da}},condition:{get:function(){if(2===this.sG)return V}},conditionAll:{get:function(){if(2===this.sG)return W}},bothWays:{get:function(){if(2===this.sG)return T}},unBind:{get:function(){if(2===this.sG)return fa}},pollEvery:{get:function(){if(this.sG)return Y}},stopPolling:{get:function(){if(this.sG)return ba}},setOption:{get:function(){if(2===this.sG)return aa}},updateOn:{get:function(){var a;if(this.sG&&(a=this))return y(!1,function(b){return b._!==a._&&(a._.pM[b._.ID]=b._,b._.aS(ma(a._,!0),b.options,!1,!0)),a})}},removeUpdater:{get:function(){var a,b;if(this.sG&&(b=this)&&(a=this._.sU))return y(!1,function(c){c._.sM[a.ID]&&(delete b._.pM[c._.ID],c._.rS(a))})}},to:{get:function(){var a;if(1===this.sG&&(a=this))return y(!0,function(b){return b._!==a._&&b.aP(a),a})}},and:{get:function(){var a,b;return b=this.sC(),2===this.sG?b:1===this.sG?(b._.isMulti||(a=b._,b._=b._=new A(b),b._.addBP(a)),y(!1,function(a){return b._.addBP(a._),b})):void 0}},once:{get:function(){var a;if(1===this.sG)return a=this.sC(),a.uO=!0,a}},update:{get:function(){return this.set}},twoWay:{get:function(){return this.bothWays}},pipe:{get:function(){return this.chainTo}}}),X=function(a){return g.iO(a)||g.iF(a)||qa(a),g.iBI(a)&&(a=a.object),this.sG=1,this.sS(a)},U=function(a,b,c){return m(this.subs[this.subs.length-1]).to(a,b,c)},Z=function(a){return this._.sV(a),this},ea=function(a){return g.iF(a)?this._.ss(a,this.options.updateOnBind):u("erFN",1),this},ca=function(a){return this._.aM("tF",this.subs.slice(-1),a,this.options.updateOnBind),this},da=function(a){return this._.aM("tF",this.subs,a,this.options.updateOnBind),this},V=function(a){return this._.aM("cN",this.subs.slice(-1),a),this},W=function(a){return this._.aM("cN",this.subs,a),this},T=function(a){var b,c,d,e,f,h;for(d=this.subs[this.subs.length-1],h=d._,c=this._.isMulti?this._.bindings:[this._],h.aS(this._,d.options),d=0,e=c.length;d<e;d++)b=c[d],f=b.sM[h.ID].tF,b=b.sM[h.ID].cN,(f||a)&&(f=g.iF(a)?a:f)&&!1!==a&&(h.sM[this._.ID].tF=f),b&&(h.sM[this._.ID].cN=b);return this},fa=function(a){var b,c,d,e;for(d=this.subs,b=0,c=d.length;b<c;b++)e=d[b],this._.rS(e._,a);return this},Y=function(a){return this._.aPI(a),this},ba=function(){return this._.rPI(),this},aa=function(a,b){return this._.sM[this.subs[this.subs.length-1]._.ID].opts[a]=b,this},A=function(a,b,c){var d,e,f;if(a.se=a.se.slice(6),F(this,this.In=a),this.isMulti=!0,this.bindings=d=[],b)for(a=0,e=b.length;a<e;a++)f=b[a],this.addBP(f,c);return Object.defineProperties(this,{type:{get:function(){return d.map(function(a){return a.type})}},value:{get:function(){return d.map(function(a){return a.value})}}})},Q=A.prototype=Object.create(I),Object.keys(t.prototype).forEach(function(a){return Q[a]=function(b,c,d,e){var f,g,k,l;for(l=this.bindings,g=0,k=l.length;g<k;g++)f=l[g],"uS"===a&&(c=f),f[a](b,c,d,e)}}),Q.addBP=function(a,b){this.bindings.push(b?this.createBP(a,b,this.In):a)},null!=("undefined"!=typeof module&&null!==module?module.exports:void 0)?module.exports=m:"function"==typeof define&&define.amd?define(["simplybind"],function(){return m}):this.SimplyBind=m}();