imba-source 0.14.1 → 0.14.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,30 +0,0 @@
1
- (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.imba = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
- !function(){return"undefined"==typeof Imba?(require("./imba"),Imba.CLIENT=!0,require("./core.events"),require("./scheduler"),require("./tag"),require("./dom"),require("./dom.client"),require("./dom.html"),require("./dom.svg"),require("./dom.legacy"),require("./dom.events"),require("./dom.static"),require("./selector")):console.warn("Imba is already loaded")}();
3
- },{"./core.events":2,"./dom":6,"./dom.client":3,"./dom.events":4,"./dom.html":5,"./dom.legacy":7,"./dom.static":8,"./dom.svg":9,"./imba":10,"./scheduler":11,"./selector":12,"./tag":13}],2:[function(require,module,exports){
4
- !function(){function t(t,e,n){for(var l,i,a;(l=n)&&(n=n.next);)(i=n.listener)&&(a=n.path&&i[n.path]?e?i[n.path].apply(i,e):i[n.path]():e?i.apply(n,e):i.call(n)),n.times&&--n.times<=0&&(l.next=n.next,n.listener=null)}return Imba.listen=function(t,e,n,l){var i,a,r,s;return a=t.__listeners__||(t.__listeners__={}),r=a[i=e]||(a[i]={}),s=r.tail||(r.tail=r.next={}),s.listener=n,s.path=l,r.tail=s.next={},s},Imba.once=function(t,e,n){var l=Imba.listen(t,e,n);return l.times=1,l},Imba.unlisten=function(t,e,n,l){var i,a,r=t.__listeners__;if(r&&(i=r[e]))for(;(a=i)&&(i=i.next);)if(i==n||i.listener==n){a.next=i.next,i.listener=null;break}},Imba.emit=function(e,n,l){var i;(i=e.__listeners__)&&(i[n]&&t(n,l,i[n]),i.all&&t(n,[n,l],i.all))},Imba.observeProperty=function(t,e,n,l,i){return i&&"object"==typeof i&&Imba.unlisten(i,"all",t,n),l&&"object"==typeof l&&Imba.listen(l,"all",t,n),this}}();
5
- },{}],3:[function(require,module,exports){
6
- !function(){function t(t){return t?t.toArray?t.toArray():t:[]}var e=window.getComputedStyle(document.documentElement,"");Imba.CSSKeyMap={};for(var r,n=0,o=t(e),a=o.length;a>n;n++){r=o[n];var i=r.replace(/^-(webkit|ms|moz|o|blink)-/,""),m=i.replace(/-(\w)/g,function(t,e){return e.toUpperCase()});r!=i&&e.hasOwnProperty(i)||(Imba.CSSKeyMap[i]=Imba.CSSKeyMap[m]=r)}return tag$.extendTag("htmlelement",function(t){t.prototype.css=function(t,e){if(t instanceof Object){for(var r=0,n=Object.keys(t),o=n.length;o>r;r++)this.css(n[r],t[n[r]]);return this}if(t=Imba.CSSKeyMap[t]||t,null==e)this.dom().style.removeProperty(t);else{if(void 0==e)return this.dom().style[t];("number"==typeof e||e instanceof Number)&&t.match(/width|height|left|right|top|bottom/)&&(e+="px"),this.dom().style[t]=e}return this}})}();
7
- },{}],4:[function(require,module,exports){
8
- !function(){function t(t){return t?t.toArray?t.toArray():t:[]}var e=document,n=window,o=window&&void 0!==window.ontouchstart;Imba.Pointer=function(){return this.setButton(-1),this.setEvent({x:0,y:0,type:"uninitialized"}),this},Imba.Pointer.prototype.phase=function(t){return this._phase},Imba.Pointer.prototype.setPhase=function(t){return this._phase=t,this},Imba.Pointer.prototype.prevEvent=function(t){return this._prevEvent},Imba.Pointer.prototype.setPrevEvent=function(t){return this._prevEvent=t,this},Imba.Pointer.prototype.button=function(t){return this._button},Imba.Pointer.prototype.setButton=function(t){return this._button=t,this},Imba.Pointer.prototype.event=function(t){return this._event},Imba.Pointer.prototype.setEvent=function(t){return this._event=t,this},Imba.Pointer.prototype.dirty=function(t){return this._dirty},Imba.Pointer.prototype.setDirty=function(t){return this._dirty=t,this},Imba.Pointer.prototype.events=function(t){return this._events},Imba.Pointer.prototype.setEvents=function(t){return this._events=t,this},Imba.Pointer.prototype.touch=function(t){return this._touch},Imba.Pointer.prototype.setTouch=function(t){return this._touch=t,this},Imba.Pointer.prototype.update=function(t){return this.setEvent(t),this.setDirty(!0),this},Imba.Pointer.prototype.process=function(){var t=this.event();if(this.dirty())if(this.setPrevEvent(t),this.setDirty(!1),"mousedown"==t.type){if(this.setButton(t.button),2==this.button()||this.touch()&&0!=this.button())return;this.touch()&&this.touch().cancel(),this.setTouch(new Imba.Touch(t,this)),this.touch().mousedown(t,t)}else"mousemove"==t.type?this.touch()&&this.touch().mousemove(t,t):"mouseup"==t.type&&(this.setButton(-1),this.touch()&&this.touch().button()==t.button&&(this.touch().mouseup(t,t),this.setTouch(null)));else this.touch()&&this.touch().idle();return this},Imba.Pointer.prototype.cleanup=function(){return Imba.POINTERS},Imba.Pointer.prototype.x=function(){return this.event().x},Imba.Pointer.prototype.y=function(){return this.event().y},Imba.Pointer.update=function(){for(var e=0,o=t(Imba.POINTERS),r=o.length;r>e;e++)o[e].process();return n.requestAnimationFrame(Imba.Pointer.update),this};var r=0,i=50;Imba.Touch=function(t,e){return this.setEvent(t),this.setData({}),this.setActive(!0),this._button=t&&t.button||0,this._suppress=!1,this._captured=!1,this.setBubble(!1),e=e,this.setUpdates(0),this};var s=[],u=0,h={};return Imba.Touch.count=function(){return u},Imba.Touch.lookup=function(t){return t&&(t.__touch__||h[t.identifier])},Imba.Touch.release=function(t,e){var n,o;n=h[t.identifier],delete h[t.identifier],n,o=t.__touch__,delete t.__touch__,o},Imba.Touch.ontouchstart=function(e){for(var n,o=0,r=t(e.changedTouches),i=r.length;i>o;o++)if(n=r[o],!this.lookup(n)){var a=h[n.identifier]=new this(e);n.__touch__=a,s.push(a),u++,a.touchstart(e,n)}return this},Imba.Touch.ontouchmove=function(e){for(var n,o,r=0,i=t(e.changedTouches),s=i.length;s>r;r++)o=i[r],(n=this.lookup(o))&&n.touchmove(e,o);return this},Imba.Touch.ontouchend=function(e){for(var n,o,r=0,i=t(e.changedTouches),s=i.length;s>r;r++)o=i[r],(n=this.lookup(o))&&(n.touchend(e,o),this.release(o,n),u--);return this},Imba.Touch.ontouchcancel=function(e){for(var n,o,r=0,i=t(e.changedTouches),s=i.length;s>r;r++)o=i[r],(n=this.lookup(o))&&(n.touchcancel(e,o),this.release(o,n),u--);return this},Imba.Touch.onmousedown=function(t){return this},Imba.Touch.onmousemove=function(t){return this},Imba.Touch.onmouseup=function(t){return this},Imba.Touch.prototype.phase=function(t){return this._phase},Imba.Touch.prototype.setPhase=function(t){return this._phase=t,this},Imba.Touch.prototype.active=function(t){return this._active},Imba.Touch.prototype.setActive=function(t){return this._active=t,this},Imba.Touch.prototype.event=function(t){return this._event},Imba.Touch.prototype.setEvent=function(t){return this._event=t,this},Imba.Touch.prototype.pointer=function(t){return this._pointer},Imba.Touch.prototype.setPointer=function(t){return this._pointer=t,this},Imba.Touch.prototype.target=function(t){return this._target},Imba.Touch.prototype.setTarget=function(t){return this._target=t,this},Imba.Touch.prototype.handler=function(t){return this._handler},Imba.Touch.prototype.setHandler=function(t){return this._handler=t,this},Imba.Touch.prototype.updates=function(t){return this._updates},Imba.Touch.prototype.setUpdates=function(t){return this._updates=t,this},Imba.Touch.prototype.suppress=function(t){return this._suppress},Imba.Touch.prototype.setSuppress=function(t){return this._suppress=t,this},Imba.Touch.prototype.data=function(t){return this._data},Imba.Touch.prototype.setData=function(t){return this._data=t,this},Imba.Touch.prototype.__bubble={chainable:!0,name:"bubble"},Imba.Touch.prototype.bubble=function(t){return void 0!==t?(this.setBubble(t),this):this._bubble},Imba.Touch.prototype.setBubble=function(t){return this._bubble=t,this},Imba.Touch.prototype.gestures=function(t){return this._gestures},Imba.Touch.prototype.setGestures=function(t){return this._gestures=t,this},Imba.Touch.prototype.capture=function(){return this._captured=!0,this._event&&this._event.preventDefault(),this},Imba.Touch.prototype.isCaptured=function(){return!!this._captured},Imba.Touch.prototype.extend=function(t){return this._gestures||(this._gestures=[]),this._gestures.push(t),this},Imba.Touch.prototype.redirect=function(t){return this._redirect=t,this},Imba.Touch.prototype.suppress=function(){return this._active=!1,this},Imba.Touch.prototype.setSuppress=function(t){return console.warn("Imba.Touch#suppress= is deprecated"),this._supress=t,this},Imba.Touch.prototype.touchstart=function(t,e){return this._event=t,this._touch=e,this._button=0,this._x=e.clientX,this._y=e.clientY,this.began(),t&&this.isCaptured()&&t.preventDefault(),this},Imba.Touch.prototype.touchmove=function(t,e){return this._event=t,this._x=e.clientX,this._y=e.clientY,this.update(),t&&this.isCaptured()&&t.preventDefault(),this},Imba.Touch.prototype.touchend=function(t,e){if(this._event=t,this._x=e.clientX,this._y=e.clientY,this.ended(),r=t.timeStamp,this._maxdr<20){var n=new Imba.Event(t);n.setType("tap"),n.process(),n._responder&&t.preventDefault()}return t&&this.isCaptured()&&t.preventDefault(),this},Imba.Touch.prototype.touchcancel=function(t,e){return this.cancel()},Imba.Touch.prototype.mousedown=function(t,n){var o=this;return o._event=t,o._button=t.button,o._x=n.clientX,o._y=n.clientY,o.began(),o._mousemove=function(t){return o.mousemove(t,t)},e.addEventListener("mousemove",o._mousemove,!0),o},Imba.Touch.prototype.mousemove=function(t,e){return this._x=e.clientX,this._y=e.clientY,this._event=t,this.isCaptured()&&t.preventDefault(),this.update(),this.move(),this},Imba.Touch.prototype.mouseup=function(t,n){return this._x=n.clientX,this._y=n.clientY,this.ended(),e.removeEventListener("mousemove",this._mousemove,!0),this._mousemove=null,this},Imba.Touch.prototype.idle=function(){return this.update()},Imba.Touch.prototype.began=function(){this._maxdr=this._dr=0,this._x0=this._x,this._y0=this._y;var t=this.event().target,e=null;for(this._sourceTarget=t&&tag$wrap(t);t&&(e=tag$wrap(t),!e||!e.ontouchstart||(this._bubble=!1,this.setTarget(e),this.target().ontouchstart(this),this._bubble));)t=t.parentNode;return this._updates++,this},Imba.Touch.prototype.update=function(){var e;if(!this._active)return this;var n=Math.sqrt(this.dx()*this.dx()+this.dy()*this.dy());if(n>this._dr&&(this._maxdr=n),this._dr=n,this._redirect&&(this._target&&this._target.ontouchcancel&&this._target.ontouchcancel(this),this.setTarget(this._redirect),this._redirect=null,this.target().ontouchstart&&this.target().ontouchstart(this)),this._updates++,this._gestures)for(var o=0,r=t(this._gestures),i=r.length;i>o;o++)r[o].ontouchupdate(this);return(e=this.target())&&e.ontouchupdate&&e.ontouchupdate(this),this},Imba.Touch.prototype.move=function(){var e;if(!this._active)return this;if(this._gestures)for(var n,o=0,r=t(this._gestures),i=r.length;i>o;o++)n=r[o],n.ontouchmove&&n.ontouchmove(this,this._event);return(e=this.target())&&e.ontouchmove&&e.ontouchmove(this,this._event),this},Imba.Touch.prototype.ended=function(){var e;if(!this._active)return this;if(this._updates++,this._gestures)for(var n=0,o=t(this._gestures),r=o.length;r>n;n++)o[n].ontouchend(this);return(e=this.target())&&e.ontouchend&&e.ontouchend(this),this},Imba.Touch.prototype.cancel=function(){return this._cancelled||(this._cancelled=!0,this.cancelled(),this._mousemove&&e.removeEventListener("mousemove",this._mousemove,!0)),this},Imba.Touch.prototype.cancelled=function(){var e;if(!this._active)return this;if(this._cancelled=!0,this._updates++,this._gestures)for(var n,o=0,r=t(this._gestures),i=r.length;i>o;o++)n=r[o],n.ontouchcancel&&n.ontouchcancel(this);return(e=this.target())&&e.ontouchcancel&&e.ontouchcancel(this),this},Imba.Touch.prototype.dr=function(){return this._dr},Imba.Touch.prototype.dx=function(){return this._x-this._x0},Imba.Touch.prototype.dy=function(){return this._y-this._y0},Imba.Touch.prototype.x0=function(){return this._x0},Imba.Touch.prototype.y0=function(){return this._y0},Imba.Touch.prototype.x=function(){return this._x},Imba.Touch.prototype.y=function(){return this._y},Imba.Touch.prototype.tx=function(){return this._targetBox||(this._targetBox=this._target.dom().getBoundingClientRect()),this._x-this._targetBox.left},Imba.Touch.prototype.ty=function(){return this._targetBox||(this._targetBox=this._target.dom().getBoundingClientRect()),this._y-this._targetBox.top},Imba.Touch.prototype.button=function(){return this._button},Imba.Touch.prototype.sourceTarget=function(){return this._sourceTarget},Imba.TouchGesture=function(){},Imba.TouchGesture.prototype.__active={"default":!1,name:"active"},Imba.TouchGesture.prototype.active=function(t){return this._active},Imba.TouchGesture.prototype.setActive=function(t){return this._active=t,this},Imba.TouchGesture.prototype._active=!1,Imba.TouchGesture.prototype.ontouchstart=function(t){return this},Imba.TouchGesture.prototype.ontouchupdate=function(t){return this},Imba.TouchGesture.prototype.ontouchend=function(t){return this},Imba.POINTER=new Imba.Pointer,Imba.POINTERS=[Imba.POINTER],Imba.KEYMAP={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",19:"break",20:"caps",27:"esc",32:"space",35:"end",36:"home",37:"larr",38:"uarr",39:"rarr",40:"darr",45:"insert",46:"delete",107:"plus",106:"mult",91:"meta"},Imba.CHARMAP={"%":"modulo","*":"multiply","+":"add","-":"sub","/":"divide",".":"dot"},Imba.Event=function(t){this.setEvent(t),this.setBubble(!0)},Imba.Event.prototype.event=function(t){return this._event},Imba.Event.prototype.setEvent=function(t){return this._event=t,this},Imba.Event.prototype.prefix=function(t){return this._prefix},Imba.Event.prototype.setPrefix=function(t){return this._prefix=t,this},Imba.Event.prototype.data=function(t){return this._data},Imba.Event.prototype.setData=function(t){return this._data=t,this},Imba.Event.prototype.source=function(t){return this._source},Imba.Event.prototype.setSource=function(t){return this._source=t,this},Imba.Event.prototype.__bubble={type:Boolean,chainable:!0,name:"bubble"},Imba.Event.prototype.bubble=function(t){return void 0!==t?(this.setBubble(t),this):this._bubble},Imba.Event.prototype.setBubble=function(t){return this._bubble=t,this},Imba.Event.wrap=function(t){return new this(t)},Imba.Event.prototype.setType=function(t){return this._type=t,this},Imba.Event.prototype.type=function(){return this._type||this.event().type},Imba.Event.prototype.name=function(){return this._name||(this._name=this.type().toLowerCase().replace(/\:/g,""))},Imba.Event.prototype.bubble=function(t){return void 0!=t?(this.setBubble(t),this):this._bubble},Imba.Event.prototype.halt=function(){return this.setBubble(!1),this},Imba.Event.prototype.cancel=function(){return this.event().preventDefault&&this.event().preventDefault(),this._cancel=!0,this},Imba.Event.prototype.isPrevented=function(){return this.event()&&this.event().defaultPrevented||this._cancel},Imba.Event.prototype.target=function(){return tag$wrap(this.event()._target||this.event().target)},Imba.Event.prototype.responder=function(){return this._responder},Imba.Event.prototype.redirect=function(t){return this._redirect=t,this},Imba.Event.prototype.keychar=function(){if(this.event()instanceof TextEvent)return this.event().data;if(this.event()instanceof KeyboardEvent){var t=this.event().keyIdentifier,e=Imba.KEYMAP[this.event().keyCode];return e||"U+"!=t.substr(0,2)||(e=String.fromCharCode(parseInt(t.substr(2),16))),e}return null},Imba.Event.prototype.keycombo=function(){var t;if(t=this.keychar()){t=Imba.CHARMAP[t]||t;var e=[],n=this.event();return n.ctrlKey&&e.push("ctrl"),n.shiftKey&&e.push("shift"),n.altKey&&e.push("alt"),n.metaKey&&e.push("cmd"),e.push(t),e.join("_").toLowerCase()}},Imba.Event.prototype.process=function(){for(var t,e,n="on"+(this._prefix||"")+this.name(),o=null,r=this.event()._target||this.event().target,i=r._responder||r;i;){if(this._redirect=null,t=tag$wrap(i)){if("string"==typeof t[e=n]||t[e]instanceof String){n=t[n];continue}if(t[n]instanceof Array){o=t[n].concat(t),n=o.shift();continue}t[n]instanceof Function&&(this._responder||(this._responder=t),o?t[n].apply(t,o):t[n](this,this.data()))}if(!this.bubble()||!(i=this._redirect||(t?t.parent():i.parentNode)))break}return this.processed(),this},Imba.Event.prototype.processed=function(){return Imba.emit(Imba,"event",[this]),this},Imba.Event.prototype.x=function(){return this.event().x},Imba.Event.prototype.y=function(){return this.event().y},Imba.Event.prototype.which=function(){return this.event().which},Imba.EventManager=function(e,n){var o=this;n&&n.constructor===Object||(n={});var r=void 0!==n.events?n.events:[];o.setRoot(e),o.setCount(0),o.setListeners([]),o.setDelegators({}),o.setDelegator(function(t){return o.delegate(t),!0});for(var i=0,s=t(r),u=s.length;u>i;i++)o.register(s[i]);return o},Imba.EventManager.prototype.root=function(t){return this._root},Imba.EventManager.prototype.setRoot=function(t){return this._root=t,this},Imba.EventManager.prototype.count=function(t){return this._count},Imba.EventManager.prototype.setCount=function(t){return this._count=t,this},Imba.EventManager.prototype.__enabled={"default":!1,watch:"enabledDidSet",name:"enabled"},Imba.EventManager.prototype.enabled=function(t){return this._enabled},Imba.EventManager.prototype.setEnabled=function(t){var e=this.enabled();return t!=e&&(this._enabled=t),t!=e&&this.enabledDidSet&&this.enabledDidSet(t,e,this.__enabled),this},Imba.EventManager.prototype._enabled=!1,Imba.EventManager.prototype.listeners=function(t){return this._listeners},Imba.EventManager.prototype.setListeners=function(t){return this._listeners=t,this},Imba.EventManager.prototype.delegators=function(t){return this._delegators},Imba.EventManager.prototype.setDelegators=function(t){return this._delegators=t,this},Imba.EventManager.prototype.delegator=function(t){return this._delegator},Imba.EventManager.prototype.setDelegator=function(t){return this._delegator=t,this},Imba.EventManager.prototype.enabledDidSet=function(t){return t?this.onenable():this.ondisable(),this},Imba.EventManager.prototype.register=function(e,n){if(void 0===n&&(n=!0),e instanceof Array){for(var o=0,r=t(e),i=r.length;i>o;o++)this.register(r[o],n);return this}if(this.delegators()[e])return this;var s=this.delegators()[e]=n instanceof Function?n:this.delegator();return this.enabled()?this.root().addEventListener(e,s,!0):void 0},Imba.EventManager.prototype.listen=function(t,e,n){return void 0===n&&(n=!0),this.listeners().push([t,e,n]),this.enabled()&&this.root().addEventListener(t,e,n),this},Imba.EventManager.prototype.delegate=function(t){this.setCount(this.count()+1);var e=Imba.Event.wrap(t);return e.process(),this},Imba.EventManager.prototype.create=function(t,e,n){n&&n.constructor===Object||(n={});var o=void 0!==n.data?n.data:null,r=void 0!==n.source?n.source:null,i=Imba.Event.wrap({type:t,target:e});return o&&(i.setData(o),o),r&&(i.setSource(r),r),i},Imba.EventManager.prototype.trigger=function(){return this.create.apply(this,arguments).process()},Imba.EventManager.prototype.onenable=function(){for(var e=this.delegators(),n=0,o=Object.keys(e),r=o.length;r>n;n++)this.root().addEventListener(o[n],e[o[n]],!0);for(var i,s=0,u=t(this.listeners()),h=u.length;h>s;s++)i=u[s],this.root().addEventListener(i[0],i[1],i[2]);return this},Imba.EventManager.prototype.ondisable=function(){for(var e=this.delegators(),n=0,o=Object.keys(e),r=o.length;r>n;n++)this.root().removeEventListener(o[n],e[o[n]],!0);for(var i,s=0,u=t(this.listeners()),h=u.length;h>s;s++)i=u[s],this.root().removeEventListener(i[0],i[1],i[2]);return this},ED=Imba.Events=new Imba.EventManager(document,{events:["keydown","keyup","keypress","textInput","input","change","submit","focusin","focusout","blur","contextmenu","dblclick","mousewheel","wheel"]}),o&&(Imba.Events.listen("touchstart",function(t){var e,n;return(e=Imba.Events).setCount(n=e.count()+1),Imba.Touch.ontouchstart(t)}),Imba.Events.listen("touchmove",function(t){var e,n;return(e=Imba.Events).setCount(n=e.count()+1),Imba.Touch.ontouchmove(t)}),Imba.Events.listen("touchend",function(t){var e,n;return(e=Imba.Events).setCount(n=e.count()+1),Imba.Touch.ontouchend(t)}),Imba.Events.listen("touchcancel",function(t){var e,n;return(e=Imba.Events).setCount(n=e.count()+1),Imba.Touch.ontouchcancel(t)})),Imba.Events.register("click",function(t){if(t.timeStamp-r>i){var e=new Imba.Event(t);if(e.setType("tap"),e.process(),e._responder)return t.preventDefault()}return Imba.Events.delegate(t)}),Imba.Events.listen("mousedown",function(t){return t.timeStamp-r>i&&Imba.POINTER?Imba.POINTER.update(t).process():void 0}),Imba.Events.listen("mouseup",function(t){return t.timeStamp-r>i&&Imba.POINTER?Imba.POINTER.update(t).process():void 0}),Imba.Events.register(["mousedown","mouseup"]),Imba.Events.setEnabled(!0),!0}();
9
- },{}],5:[function(require,module,exports){
10
- !function(){return tag$.defineTag("fragment","htmlelement",function(t){t.createNode=function(){return Imba.document().createDocumentFragment()}}),tag$.defineTag("a",function(t){t.prototype.href=function(t){return this.getAttribute("href")},t.prototype.setHref=function(t){return this.setAttribute("href",t),this}}),tag$.defineTag("abbr"),tag$.defineTag("address"),tag$.defineTag("area"),tag$.defineTag("article"),tag$.defineTag("aside"),tag$.defineTag("audio"),tag$.defineTag("b"),tag$.defineTag("base"),tag$.defineTag("bdi"),tag$.defineTag("bdo"),tag$.defineTag("big"),tag$.defineTag("blockquote"),tag$.defineTag("body"),tag$.defineTag("br"),tag$.defineTag("button",function(t){t.prototype.autofocus=function(t){return this.getAttribute("autofocus")},t.prototype.setAutofocus=function(t){return this.setAttribute("autofocus",t),this},t.prototype.type=function(t){return this.getAttribute("type")},t.prototype.setType=function(t){return this.setAttribute("type",t),this},t.prototype.disabled=function(t){return this.getAttribute("disabled")},t.prototype.setDisabled=function(t){return this.setAttribute("disabled",t),this}}),tag$.defineTag("canvas",function(t){t.prototype.setWidth=function(t){return this.width()!=t&&(this.dom().width=t),this},t.prototype.setHeight=function(t){return this.height()!=t&&(this.dom().height=t),this},t.prototype.width=function(){return this.dom().width},t.prototype.height=function(){return this.dom().height},t.prototype.context=function(t){return void 0===t&&(t="2d"),this.dom().getContext(t)}}),tag$.defineTag("caption"),tag$.defineTag("cite"),tag$.defineTag("code"),tag$.defineTag("col"),tag$.defineTag("colgroup"),tag$.defineTag("data"),tag$.defineTag("datalist"),tag$.defineTag("dd"),tag$.defineTag("del"),tag$.defineTag("details"),tag$.defineTag("dfn"),tag$.defineTag("div"),tag$.defineTag("dl"),tag$.defineTag("dt"),tag$.defineTag("em"),tag$.defineTag("embed"),tag$.defineTag("fieldset"),tag$.defineTag("figcaption"),tag$.defineTag("figure"),tag$.defineTag("footer"),tag$.defineTag("form",function(t){t.prototype.method=function(t){return this.getAttribute("method")},t.prototype.setMethod=function(t){return this.setAttribute("method",t),this},t.prototype.action=function(t){return this.getAttribute("action")},t.prototype.setAction=function(t){return this.setAttribute("action",t),this}}),tag$.defineTag("h1"),tag$.defineTag("h2"),tag$.defineTag("h3"),tag$.defineTag("h4"),tag$.defineTag("h5"),tag$.defineTag("h6"),tag$.defineTag("head"),tag$.defineTag("header"),tag$.defineTag("hr"),tag$.defineTag("html"),tag$.defineTag("i"),tag$.defineTag("iframe",function(t){t.prototype.src=function(t){return this.getAttribute("src")},t.prototype.setSrc=function(t){return this.setAttribute("src",t),this}}),tag$.defineTag("img",function(t){t.prototype.src=function(t){return this.getAttribute("src")},t.prototype.setSrc=function(t){return this.setAttribute("src",t),this}}),tag$.defineTag("input",function(t){t.prototype.name=function(t){return this.getAttribute("name")},t.prototype.setName=function(t){return this.setAttribute("name",t),this},t.prototype.type=function(t){return this.getAttribute("type")},t.prototype.setType=function(t){return this.setAttribute("type",t),this},t.prototype.required=function(t){return this.getAttribute("required")},t.prototype.setRequired=function(t){return this.setAttribute("required",t),this},t.prototype.disabled=function(t){return this.getAttribute("disabled")},t.prototype.setDisabled=function(t){return this.setAttribute("disabled",t),this},t.prototype.autofocus=function(t){return this.getAttribute("autofocus")},t.prototype.setAutofocus=function(t){return this.setAttribute("autofocus",t),this},t.prototype.value=function(){return this.dom().value},t.prototype.setValue=function(t){return t!=this.dom().value&&(this.dom().value=t),this},t.prototype.setPlaceholder=function(t){return t!=this.dom().placeholder&&(this.dom().placeholder=t),this},t.prototype.placeholder=function(){return this.dom().placeholder},t.prototype.checked=function(){return this.dom().checked},t.prototype.setChecked=function(t){return t!=this.dom().checked&&(this.dom().checked=t),this}}),tag$.defineTag("ins"),tag$.defineTag("kbd"),tag$.defineTag("keygen"),tag$.defineTag("label"),tag$.defineTag("legend"),tag$.defineTag("li"),tag$.defineTag("link",function(t){t.prototype.rel=function(t){return this.getAttribute("rel")},t.prototype.setRel=function(t){return this.setAttribute("rel",t),this},t.prototype.type=function(t){return this.getAttribute("type")},t.prototype.setType=function(t){return this.setAttribute("type",t),this},t.prototype.href=function(t){return this.getAttribute("href")},t.prototype.setHref=function(t){return this.setAttribute("href",t),this},t.prototype.media=function(t){return this.getAttribute("media")},t.prototype.setMedia=function(t){return this.setAttribute("media",t),this}}),tag$.defineTag("main"),tag$.defineTag("map"),tag$.defineTag("mark"),tag$.defineTag("menu"),tag$.defineTag("menuitem"),tag$.defineTag("meta",function(t){t.prototype.name=function(t){return this.getAttribute("name")},t.prototype.setName=function(t){return this.setAttribute("name",t),this},t.prototype.content=function(t){return this.getAttribute("content")},t.prototype.setContent=function(t){return this.setAttribute("content",t),this},t.prototype.charset=function(t){return this.getAttribute("charset")},t.prototype.setCharset=function(t){return this.setAttribute("charset",t),this}}),tag$.defineTag("meter"),tag$.defineTag("nav"),tag$.defineTag("noscript"),tag$.defineTag("object"),tag$.defineTag("ol"),tag$.defineTag("optgroup"),tag$.defineTag("option",function(t){t.prototype.value=function(t){return this.getAttribute("value")},t.prototype.setValue=function(t){return this.setAttribute("value",t),this}}),tag$.defineTag("output"),tag$.defineTag("p"),tag$.defineTag("param"),tag$.defineTag("pre"),tag$.defineTag("progress"),tag$.defineTag("q"),tag$.defineTag("rp"),tag$.defineTag("rt"),tag$.defineTag("ruby"),tag$.defineTag("s"),tag$.defineTag("samp"),tag$.defineTag("script",function(t){t.prototype.src=function(t){return this.getAttribute("src")},t.prototype.setSrc=function(t){return this.setAttribute("src",t),this},t.prototype.type=function(t){return this.getAttribute("type")},t.prototype.setType=function(t){return this.setAttribute("type",t),this}}),tag$.defineTag("section"),tag$.defineTag("select",function(t){t.prototype.name=function(t){return this.getAttribute("name")},t.prototype.setName=function(t){return this.setAttribute("name",t),this},t.prototype.multiple=function(t){return this.getAttribute("multiple")},t.prototype.setMultiple=function(t){return this.setAttribute("multiple",t),this},t.prototype.required=function(t){return this.getAttribute("required")},t.prototype.setRequired=function(t){return this.setAttribute("required",t),this},t.prototype.disabled=function(t){return this.getAttribute("disabled")},t.prototype.setDisabled=function(t){return this.setAttribute("disabled",t),this},t.prototype.value=function(){return this.dom().value},t.prototype.setValue=function(t){return t!=this.dom().value&&(this.dom().value=t),this}}),tag$.defineTag("small"),tag$.defineTag("source"),tag$.defineTag("span"),tag$.defineTag("strong"),tag$.defineTag("style"),tag$.defineTag("sub"),tag$.defineTag("summary"),tag$.defineTag("sup"),tag$.defineTag("table"),tag$.defineTag("tbody"),tag$.defineTag("td"),tag$.defineTag("textarea",function(t){t.prototype.name=function(t){return this.getAttribute("name")},t.prototype.setName=function(t){return this.setAttribute("name",t),this},t.prototype.disabled=function(t){return this.getAttribute("disabled")},t.prototype.setDisabled=function(t){return this.setAttribute("disabled",t),this},t.prototype.required=function(t){return this.getAttribute("required")},t.prototype.setRequired=function(t){return this.setAttribute("required",t),this},t.prototype.rows=function(t){return this.getAttribute("rows")},t.prototype.setRows=function(t){return this.setAttribute("rows",t),this},t.prototype.cols=function(t){return this.getAttribute("cols")},t.prototype.setCols=function(t){return this.setAttribute("cols",t),this},t.prototype.autofocus=function(t){return this.getAttribute("autofocus")},t.prototype.setAutofocus=function(t){return this.setAttribute("autofocus",t),this},t.prototype.value=function(){return this.dom().value},t.prototype.setValue=function(t){return t!=this.dom().value&&(this.dom().value=t),this},t.prototype.setPlaceholder=function(t){return t!=this.dom().placeholder&&(this.dom().placeholder=t),this},t.prototype.placeholder=function(){return this.dom().placeholder}}),tag$.defineTag("tfoot"),tag$.defineTag("th"),tag$.defineTag("thead"),tag$.defineTag("time"),tag$.defineTag("title"),tag$.defineTag("tr"),tag$.defineTag("track"),tag$.defineTag("u"),tag$.defineTag("ul"),tag$.defineTag("video"),tag$.defineTag("wbr")}();
11
- },{}],6:[function(require,module,exports){
12
- !function(){function t(t){return t?t.toArray?t.toArray():t:[]}return Imba.document=function(){return window.document},Imba.root=function(){return tag$wrap(Imba.document().body)},tag$.defineTag("htmlelement","element",function(e){e.inherit=function(t){if(t.prototype._empty=!0,t._protoDom=null,!this._nodeType)return t._nodeType=t._name,t._classes=[];t._nodeType=this._nodeType;var e="_"+t._name.replace(/_/g,"-");return"#"!=t._name[0]?t._classes=this._classes.concat(e):void 0},e.buildNode=function(){var t=Imba.document().createElement(this._nodeType),e=this._classes.join(" ");return e&&(t.className=e),t},e.createNode=function(){var t=this._protoDom||(this._protoDom=this.buildNode());return t.cloneNode(!1)},e.dom=function(){return this._protoDom||(this._protoDom=this.buildNode())},e.prototype.id=function(t){return this.getAttribute("id")},e.prototype.setId=function(t){return this.setAttribute("id",t),this},e.prototype.tabindex=function(t){return this.getAttribute("tabindex")},e.prototype.setTabindex=function(t){return this.setAttribute("tabindex",t),this},e.prototype.title=function(t){return this.getAttribute("title")},e.prototype.setTitle=function(t){return this.setAttribute("title",t),this},e.prototype.role=function(t){return this.getAttribute("role")},e.prototype.setRole=function(t){return this.setAttribute("role",t),this},e.prototype.width=function(){return this._dom.offsetWidth},e.prototype.height=function(){return this._dom.offsetHeight},e.prototype.setChildren=function(t,e){return this._empty?this.append(t):this.empty().append(t),this._children=null,this},e.prototype.setHtml=function(t){return this._dom.innerHTML=t,this},e.prototype.html=function(){return this._dom.innerHTML},e.prototype.empty=function(){for(;this._dom.firstChild;)this._dom.removeChild(this._dom.firstChild);return this._children=null,this._empty=!0,this},e.prototype.remove=function(t){var e=this.dom(),r=t&&t.dom();return r&&r.parentNode==e&&e.removeChild(r),this},e.prototype.emit=function(t,e){e&&e.constructor===Object||(e={});var r=void 0!==e.data?e.data:null,n=void 0!==e.bubble?e.bubble:!0;return Imba.Events.trigger(t,this,{data:r,bubble:n}),this},e.prototype.css=function(t,e){if(t instanceof Object)for(var r=0,n=Object.keys(t),o=n.length;o>r;r++)this.css(n[r],t[n[r]]);else if(null==e)this.dom().style.removeProperty(t);else{if(void 0==e)return this.dom().style[t];("number"==typeof e||e instanceof Number)&&t.match(/width|height|left|right|top|bottom/)&&(e+="px"),this.dom().style[t]=e}return this},e.prototype.dataset=function(e,r){if(e instanceof Object){for(var n=0,o=Object.keys(e),i=o.length;i>n;n++)this.dataset(o[n],e[o[n]]);return this}if(2==arguments.length)return this.setAttribute("data-"+e,r),this;if(e)return this.getAttribute("data-"+e);var s=this.dom().dataset;if(!s){s={};for(var u,p=0,h=t(this.dom().attributes),a=h.length;a>p;p++)u=h[p],"data-"==u.name.substr(0,5)&&(s[Imba.toCamelCase(u.name.slice(5))]=u.value)}return s},e.prototype.find=function(t){return new Imba.Selector(t,this)},e.prototype.first=function(t){return t?this.find(t).first():tag$wrap(this.dom().firstElementChild)},e.prototype.last=function(t){return t?this.find(t).last():tag$wrap(this.dom().lastElementChild)},e.prototype.child=function(t){return tag$wrap(this.dom().children[t||0])},e.prototype.children=function(t){var e=new Imba.Selector(null,this,this._dom.children);return t?e.filter(t):e},e.prototype.orphanize=function(){var t;return(t=this.dom().parentNode)&&t.removeChild(this._dom),this},e.prototype.matches=function(t){var e;return t instanceof Function?t(this):(t.query&&(t=t.query()),(e=this._dom.webkitMatchesSelector||this._dom.matches)?e.call(this._dom,t):void 0)},e.prototype.closest=function(t){if(!t)return this.parent();var e=this;for(t.query&&(t=t.query());e;){if(e.matches(t))return e;e=e.parent()}return null},e.prototype.up=function(t){return t?this.parent()&&this.parent().closest(t):this.parent()},e.prototype.path=function(t){var e=this,r=[];for(t&&t.query&&(t=t.query());e;)(!t||e.matches(t))&&r.push(e),e=e.parent();return r},e.prototype.parents=function(t){var e=this.parent();return e?e.path(t):[]},e.prototype.siblings=function(t){var e,r=this;if(!(e=this.parent()))return[];var n=this.dom().parentNode.children,o=new Imba.Selector(null,this,n);return o.filter(function(e){return e!=r&&(!t||e.matches(t))})},e.prototype.next=function(t){if(t){for(var e=this;e=e.next();)if(e.matches(t))return e;return null}return tag$wrap(this.dom().nextElementSibling)},e.prototype.prev=function(t){if(t){for(var e=this;e=e.prev();)if(e.matches(t))return e;return null}return tag$wrap(this.dom().previousElementSibling)},e.prototype.contains=function(t){return this.dom().contains(t&&t._dom||t)},e.prototype.index=function(){for(var t=0,e=this.dom();e.previousSibling;)e=e.previousSibling,t++;return t},e.prototype.insert=function(t,e){e&&e.constructor===Object||(e={});var r=void 0!==e.before?e.before:null,n=void 0!==e.after?e.after:null;return n&&(r=n.next()),t instanceof Array&&(t=tag$.$fragment().setContent(t,0).end()),r?this.dom().insertBefore(t.dom(),r.dom()):this.append(t),this},e.prototype.focus=function(){return this.dom().focus(),this},e.prototype.blur=function(){return this.dom().blur(),this},e.prototype.template=function(){return null},e.prototype.prepend=function(t){var e=this._dom.childNodes[0];return e?this.insertBefore(t,e):this.appendChild(t),this},e.prototype.append=function(e){if(!e)return this;if(e instanceof Array)for(var r,n=0,o=t(e),i=o.length;i>n;n++)r=o[n],r&&this.append(r);else if("string"==typeof e||e instanceof String||"number"==typeof e||e instanceof Number){var s=Imba.document().createTextNode(e);this._dom.appendChild(s),this._empty&&(this._empty=!1)}else this._dom.appendChild(e._dom||e),this._empty&&(this._empty=!1);return this},e.prototype.insertBefore=function(t,e){return("string"==typeof t||t instanceof String)&&(t=Imba.document().createTextNode(t)),t&&e&&this.dom().insertBefore(t._dom||t,e._dom||e),this},e.prototype.appendChild=function(t){return("string"==typeof t||t instanceof String)&&(t=Imba.document().createTextNode(t)),t&&this.dom().appendChild(t._dom||t),this},e.prototype.removeChild=function(t){return t&&this.dom().removeChild(t._dom||t),this},e.prototype.toString=function(){return this._dom.toString()},e.prototype.classes=function(){return console.log("Imba.Tag#classes is deprecated"),this._dom.classList}}),tag$.defineTag("svgelement","htmlelement")}();
13
- },{}],7:[function(require,module,exports){
14
- !function(){return document.documentElement.classList?void 0:(tag$.extendTag("htmlelement",function(t){t.prototype.hasFlag=function(t){return new RegExp("(^|\\s)"+t+"(\\s|$)").test(this._dom.className)},t.prototype.addFlag=function(t){return this.hasFlag(t)?this:(this._dom.className+=(this._dom.className?" ":"")+t,this)},t.prototype.unflag=function(t){if(!this.hasFlag(t))return this;var s=new RegExp("(^|\\s)*"+t+"(\\s|$)*","g");return this._dom.className=this._dom.className.replace(s,""),this},t.prototype.toggleFlag=function(t){return this.hasFlag(t)?this.unflag(t):this.flag(t)},t.prototype.flag=function(t,s){return 2==arguments.length&&!!s==!1?this.unflag(t):this.addFlag(t)}}),!0)}();
15
- },{}],8:[function(require,module,exports){
16
- !function(){function t(t){return t?t.toArray?t.toArray():t:[]}function e(n,i,r){if(i instanceof l)n.removeChild(i);else if(i instanceof Array)for(var o=0,s=t(i),f=s.length;f>o;o++)e(n,s[o],r);else{var h=r?r.nextSibling:n._dom.firstChild;if(!(h instanceof Text&&h.textContent==i))throw"cannot remove string";n.removeChild(h)}return r}function n(e,i){if(i instanceof l)e.appendChild(i);else if(i instanceof Array)for(var r=0,o=t(i),s=o.length;s>r;r++)n(e,o[r]);else null!=i&&i!==!1&&e.appendChild(Imba.document().createTextNode(i))}function i(e,n,r){if(n instanceof l)e.insertBefore(n,r);else if(n instanceof Array)for(var o=0,s=t(n),f=s.length;f>o;o++)i(e,s[o],r);else null!=n&&n!==!1&&e.insertBefore(Imba.document().createTextNode(n),r);return r}function r(t,e,r){var o=r?r.nextSibling:t._dom.firstChild;return o?(i(t,e,o),o.previousSibling):(n(t,e),t._dom.lastChild)}function o(e,n,i,o){for(var s,f=n.length,l=n[f-1],h=[],a=[],u=[],c=0,d=0,m=0,v=t(i),p=v.length;p>m;m++){s=v[m];var g=n.indexOf(s);if(h.push(g),-1!=g){for(var y=h.length-2;y>=0;)if(-1==h[y])y--;else{if(g>h[y])break;y=a[y]}a.push(y);var C=-1==y?0:u[y]+1;C>c&&(c=C,d=m),u.push(C)}else e.removeChild(s),a.push(-1),u.push(-1)}for(var _=[],x=h.length-1;x>=0;)x==d&&-1!=h[x]&&(_[h[x]]=!0,d=a[d]),x-=1;for(var A=0,v=t(n),p=v.length;p>A;A++)if(!_[A]){var b=n[A-1];r(e,v[A],b&&b._dom||o)}return l&&l._dom||o}function s(t,e,n,i){var r=e.length,s=r,f=e[r-1];if(r==n.length&&e[0]===n[0])for(;s--&&e[s]===n[s];);return-1==s?f&&f._dom||i:o(t,e,n,i)}function f(n,i,o,h){var a=null==i||i===!1,u=null==o||o===!1;if(i===o)return a?h:i&&i._dom?i._dom:h?h.nextSibling:n._dom.firstChild;if(i instanceof Array){if(o instanceof Array){if(!i["static"]&&!o["static"])return s(n,i,o,h);if(i["static"]==o["static"]){for(var c=0,d=t(i),m=d.length;m>c;c++)h=f(n,d[c],o[c],h);return h}e(n,o,h)}else o instanceof l?n.removeChild(o):u||n.removeChild(h?h.nextSibling:n._dom.firstChild);return r(n,i,h)}if(i instanceof l)return u||e(n,o,h),r(n,i,h),i;if(a)return u||e(n,o,h),h;var v;if(o instanceof Array)e(n,o,h);else if(o instanceof l)n.removeChild(o);else if(!u&&(v=h?h.nextSibling:n._dom.firstChild,v instanceof Text&&v.textContent!=i))return v.textContent=i,v;return r(n,i,h)}var l=Imba.TAGS.element;return tag$.extendTag("htmlelement",function(e){e.prototype.setChildren=function(e,i){var r=this._children;if(e===r)return this;if(r){if(2==i)return this;if(1==i)for(var o=null,h=0,a=t(e),u=a.length;u>h;h++)o=f(this,a[h],r[h],o);else if(3==i)if(e instanceof l)this.empty(),this.appendChild(e);else{if(!(e instanceof Array))return this.setText(e),this;r instanceof Array?s(this,e,r,null):(this.empty(),n(this,e))}else e instanceof Array&&r instanceof Array?s(this,e,r,null):(this.empty(),n(this,e))}else this.empty(),n(this,e);return this._children=e,this},e.prototype.setStaticChildren=function(e){for(var n=this._children,i=null,r=0,o=t(e),s=o.length;s>r;r++)i=f(this,o[r],n[r],i);return this._children=e,this},e.prototype.content=function(){return this._content||this.children().toArray()},e.prototype.setText=function(t){return t!=this._children&&(this._children=t,this.dom().textContent=null==t||t===!1?"":t),this}})}();
17
- },{}],9:[function(require,module,exports){
18
- !function(){function t(t,a){return a&&a.indexOf?a.indexOf(t):[].indexOf.call(t,a)}return tag$.SVG.defineTag("svgelement",function(a){a.namespaceURI=function(){return"http://www.w3.org/2000/svg"};var e="circle defs ellipse g line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan".split(" ");a.buildNode=function(){var t=Imba.document().createElementNS(this.namespaceURI(),this._nodeType),a=this._classes.join(" ");return a&&(t.className.baseVal=a),t},a.inherit=function(a){if(a._protoDom=null,t(a._name,e)>=0)return a._nodeType=a._name,a._classes=[];a._nodeType=this._nodeType;var n="_"+a._name.replace(/_/g,"-");return a._classes=this._classes.concat(n)},Imba.attr(a,"x"),Imba.attr(a,"y"),Imba.attr(a,"width"),Imba.attr(a,"height"),Imba.attr(a,"stroke"),Imba.attr(a,"stroke-width")}),tag$.SVG.defineTag("svg",function(t){Imba.attr(t,"viewbox")}),tag$.SVG.defineTag("rect"),tag$.SVG.defineTag("circle",function(t){Imba.attr(t,"cx"),Imba.attr(t,"cy"),Imba.attr(t,"r")}),tag$.SVG.defineTag("ellipse",function(t){Imba.attr(t,"cx"),Imba.attr(t,"cy"),Imba.attr(t,"rx"),Imba.attr(t,"ry")}),tag$.SVG.defineTag("path",function(t){Imba.attr(t,"d"),Imba.attr(t,"pathLength")}),tag$.SVG.defineTag("line",function(t){Imba.attr(t,"x1"),Imba.attr(t,"x2"),Imba.attr(t,"y1"),Imba.attr(t,"y2")})}();
19
- },{}],10:[function(require,module,exports){
20
- !function(){"undefined"!=typeof window&&(global=window),Imba={VERSION:"0.14.1",DEBUG:!1};var t=/-./g;return Imba.isClient=function(){return Imba.CLIENT===!0},Imba.isServer=function(){return Imba.SERVER===!0},Imba.subclass=function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t.prototype=Object.create(e.prototype),t.__super__=t.prototype.__super__=e.prototype,t.prototype.initialize=t.prototype.constructor=t,t},Imba.iterable=function(t){return t?t.toArray?t.toArray():t:[]},Imba.await=function(t){return t instanceof Array?Promise.all(t):t&&t.then?t:Promise.resolve(t)},Imba.toCamelCase=function(e){return e.replace(t,function(t){return t.charAt(1).toUpperCase()})},Imba.toCamelCase=function(e){return e.replace(t,function(t){return t.charAt(1).toUpperCase()})},Imba.indexOf=function(t,e){return e&&e.indexOf?e.indexOf(t):[].indexOf.call(t,e)},Imba.prop=function(t,e,r){return t.defineProperty?t.defineProperty(e,r):void 0},Imba.attr=function(t,e,r){if(t.defineAttribute)return t.defineAttribute(e,r);var n=Imba.toCamelCase(e),o=Imba.toCamelCase("set-"+e);t.prototype[n]=function(){return this.getAttribute(e)},t.prototype[o]=function(t){return this.setAttribute(e,t),this}}}();
21
- },{}],11:[function(require,module,exports){
22
- (function (global){
23
- !function(){function t(t,e){return e&&e.indexOf?e.indexOf(t):[].indexOf.call(t,e)}var e;return e||(e=global.requestAnimationFrame),e||(e=global.webkitRequestAnimationFrame),e||(e=global.mozRequestAnimationFrame),e||(e=function(t){return setTimeout(t,1e3/60)}),Imba.tick=function(t){this._scheduled&&e(Imba.ticker()),this.emit(this,"tick",[t])},Imba.ticker=function(){var t=this;return t._ticker||(t._ticker=function(e){return t.tick(e)})},Imba.schedule=function(t,i){return void 0===i&&(i="tick"),this.listen(this,"tick",t,i),this._scheduled||(this._scheduled=!0,e(Imba.ticker())),this},Imba.unschedule=function(t,e){this.unlisten(this,"tick",t,e);var i=this.__listeners__||(this.__listeners__={});return i.tick&&i.tick.next&&i.tick.next.listener||(this._scheduled=!1),this},Imba.setTimeout=function(t,e){return setTimeout(function(){return e(),Imba.emit(Imba,"timeout",[e])},t)},Imba.setInterval=function(t,e){return setInterval(function(){return e(),Imba.emit(Imba,"interval",[e])},t)},Imba.clearInterval=function(t){return clearInterval(t)},Imba.clearTimeout=function(t){return clearTimeout(t)},Imba.Scheduler=function(t){var e=this;e._target=t,e._marked=!1,e._active=!1,e._marker=function(){return e.mark()},e._ticker=function(t){return e.tick(t)},e._events=!0,e._fps=1,e._dt=0,e._timestamp=0,e._ticks=0,e._flushes=0},Imba.Scheduler.prototype.active=function(){return this._active},Imba.Scheduler.prototype.dt=function(){return this._dt},Imba.Scheduler.prototype.configure=function(t){t&&t.constructor===Object||(t={});var e=void 0!==t.fps?t.fps:1,i=void 0!==t.events?t.events:!0;return null!=i&&(this._events=i),null!=e&&(this._fps=e),this},Imba.Scheduler.prototype.mark=function(){return this._marked=!0,this},Imba.Scheduler.prototype.flush=function(){return this._marked=!1,this._flushes++,this._target.tick(),this},Imba.Scheduler.prototype.tick=function(t){this._ticks++,this._dt=t;var e=this._fps;if(60==e)this._marked=!0;else if(30==e)this._ticks%2&&(this._marked=!0);else if(e){var i=60/e/60*1e3,r=Math.floor(Date.now()/i);this._beat!=r&&(this._beat=r,this._marked=!0)}return this._marked&&this.flush(),this},Imba.Scheduler.prototype.activate=function(){return this._active||(this._active=!0,this._commit=this._target.commit,this._target.commit=function(){return this},Imba.schedule(this),this._events&&Imba.listen(Imba,"event",this,"onevent"),this._target&&this._target.flag&&this._target.flag("scheduled_"),this.tick(0)),this},Imba.Scheduler.prototype.deactivate=function(){return this._active&&(this._active=!1,this._target.commit=this._commit,Imba.unschedule(this),Imba.unlisten(Imba,"event",this),this._target&&this._target.unflag&&this._target.unflag("scheduled_")),this},Imba.Scheduler.prototype.track=function(){return this._marker},Imba.Scheduler.prototype.onevent=function(e){var i;return this._marked?this:(this._events instanceof Function?this._events(e)&&this.mark():this._events instanceof Array?t((i=e)&&i.type&&i.type(),this._events)>=0&&this.mark():this._events&&e._responder&&this.mark(),this)},Imba.Scheduler}();
24
- }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
25
- },{}],12:[function(require,module,exports){
26
- !function(){function t(t){return t?t.toArray?t.toArray():t:[]}return Imba.Selector=function(e,r,o){if(this._query=e instanceof Imba.Selector?e.query():e,this._context=r,o){for(var n=0,u=t(o),i=u.length,c=[];i>n;n++)c.push(tag$wrap(u[n]));this._nodes=c}return this._lazy=!o,this},Imba.Selector.one=function(t,e){var r=(e||Imba.document()).querySelector(t);return r&&tag$wrap(r)||null},Imba.Selector.all=function(t,e){return new Imba.Selector(t,e)},Imba.Selector.prototype.query=function(t){return this._query},Imba.Selector.prototype.setQuery=function(t){return this._query=t,this},Imba.Selector.prototype.reload=function(){return this._nodes=null,this},Imba.Selector.prototype.scope=function(){var t;return this._scope?this._scope:(t=this._context)?this._scope=t.toScope?t.toScope():t:Imba.document()},Imba.Selector.prototype.first=function(){return this._lazy?tag$wrap(this._first||(this._first=this.scope().querySelector(this.query()))):this.nodes()[0]},Imba.Selector.prototype.last=function(){return this.nodes()[this._nodes.length-1]},Imba.Selector.prototype.nodes=function(){if(this._nodes)return this._nodes;for(var e=this.scope().querySelectorAll(this.query()),r=0,o=t(e),n=o.length,u=[];n>r;r++)u.push(tag$wrap(o[r]));return this._nodes=u,this._lazy=!1,this._nodes},Imba.Selector.prototype.count=function(){return this.nodes().length},Imba.Selector.prototype.len=function(){return this.nodes().length},Imba.Selector.prototype.some=function(){return this.count()>=1},Imba.Selector.prototype.at=function(t){return this.nodes()[t]},Imba.Selector.prototype.forEach=function(t){return this.nodes().forEach(t),this},Imba.Selector.prototype.map=function(t){return this.nodes().map(t)},Imba.Selector.prototype.toArray=function(){return this.nodes()},Imba.Selector.prototype.closest=function(t){return this._nodes=this.map(function(e){return e.closest(t)}),this},Imba.Selector.prototype.siblings=function(t){return this._nodes=this.map(function(e){return e.siblings(t)}),this},Imba.Selector.prototype.find=function(t){return this._nodes=this.__query__(t.query(),this.nodes()),this},Imba.Selector.prototype.reject=function(t){return this.filter(t,!1)},Imba.Selector.prototype.filter=function(t,e){void 0===e&&(e=!0);var r=t instanceof Function&&t||function(e){return e.matches(t)},o=this.nodes().filter(function(t){return r(t)==e});return new Imba.Selector("",this._scope,o)},Imba.Selector.prototype.__query__=function(t,e){for(var r=[],o=0,n=e.length;n>o;)r.push.apply(r,e[o++].querySelectorAll(t));return r},Imba.Selector.prototype.__matches__=function(){return!0},Imba.Selector.prototype.flag=function(t){return this.forEach(function(e){return e.flag(t)})},Imba.Selector.prototype.unflag=function(t){return this.forEach(function(e){return e.unflag(t)})},q$=function(t,e){return new Imba.Selector(t,e)},q$$=function(t,e){var r=(e||Imba.document()).querySelector(t);return r&&tag$wrap(r)||null},tag$.extendTag("element",function(t){t.prototype.querySelectorAll=function(t){return this._dom.querySelectorAll(t)},t.prototype.querySelector=function(t){return this._dom.querySelector(t)},t.prototype.find=function(t){return new Imba.Selector(t,this)}})}();
27
- },{}],13:[function(require,module,exports){
28
- !function(){function t(t,e){return e&&e.indexOf?e.indexOf(t):[].indexOf.call(t,e)}function e(t,e){for(var n=0,a=Object.keys(e),r=a.length;r>n;n++)null==t[$1=a[n]]?t[$1]=e[a[n]]:t[$1];return t.prototype=Object.create(e.prototype),t.__super__=t.prototype.__super__=e.prototype,t.prototype.initialize=t.prototype.constructor=t,e.inherit&&e.inherit(t),t}function n(){return function(t){return this.setDom(t),this}}function a(t){return function(){return t.build()}}Imba["static"]=function(t,e){return t["static"]=e,t},Imba.Tag=function(t){this.setDom(t)},Imba.Tag.createNode=function(){throw"Not implemented"},Imba.Tag.build=function(){return new this(this.createNode())},Imba.Tag.prototype.object=function(t){return this._object},Imba.Tag.prototype.setObject=function(t){return this._object=t,this},Imba.Tag.prototype.dom=function(){return this._dom},Imba.Tag.prototype.setDom=function(t){return t._tag=this,this._dom=t,this},Imba.Tag.prototype.setRef=function(t,e){return this.flag(this._ref=t),this},Imba.Tag.prototype.setHandler=function(t,e,n){var a="on"+t;if(e instanceof Function)this[a]=e;else if(e instanceof Array){var r=e.shift();this[a]=function(t){return n[r].apply(n,e.concat(t))}}else this[a]=function(t){return n[e](t)};return this},Imba.Tag.prototype.setId=function(t){return this.dom().id=t,this},Imba.Tag.prototype.id=function(){return this.dom().id},Imba.Tag.prototype.setAttribute=function(t,e){var n=this.dom().getAttribute(t);return n==e?e:null!=e&&e!==!1?this.dom().setAttribute(t,e):this.dom().removeAttribute(t)},Imba.Tag.prototype.removeAttribute=function(t){return this.dom().removeAttribute(t)},Imba.Tag.prototype.getAttribute=function(t){return this.dom().getAttribute(t)},Imba.Tag.prototype.setContent=function(t,e){return this.setChildren(t,e),this},Imba.Tag.prototype.setChildren=function(t,e){throw"Not implemented"},Imba.Tag.prototype.text=function(t){return this._dom.textContent},Imba.Tag.prototype.setText=function(t){return this._empty=!1,this._dom.textContent=null==t?t="":t,this},Imba.Tag.prototype.dataset=function(t,e){throw"Not implemented"},Imba.Tag.prototype.render=function(){return this},Imba.Tag.prototype.build=function(){return this.render(),this},Imba.Tag.prototype.commit=function(){return this.render(),this},Imba.Tag.prototype.tick=function(){return this.render(),this},Imba.Tag.prototype.end=function(){return this._built?this.commit():(this._built=!0,this.build()),this},Imba.Tag.prototype.synced=function(){return this},Imba.Tag.prototype.awaken=function(){return this},Imba.Tag.prototype.flags=function(){return this._dom.classList},Imba.Tag.prototype.flag=function(t,e){return 2!=arguments.length||e?this._dom.classList.add(t):this._dom.classList.remove(t),this},Imba.Tag.prototype.unflag=function(t){return this._dom.classList.remove(t),this},Imba.Tag.prototype.toggleFlag=function(t){return this._dom.classList.toggle(t),this},Imba.Tag.prototype.hasFlag=function(t){return this._dom.classList.contains(t)},Imba.Tag.prototype.scheduler=function(){return null==this._scheduler?this._scheduler=new Imba.Scheduler(this):this._scheduler},Imba.Tag.prototype.schedule=function(t){return void 0===t&&(t={}),this.scheduler().configure(t).activate(),this},Imba.Tag.prototype.unschedule=function(){return this._scheduler&&this.scheduler().deactivate(),this},Imba.Tag.prototype.parent=function(){return tag$wrap(this.dom().parentNode)},Imba.Tag.prototype.log=function(){for(var t=arguments,e=t.length,n=new Array(e>0?e:0);e>0;)n[e-1]=t[--e];return n.unshift(console),Function.prototype.call.apply(console.log,n),this},Imba.Tag.prototype.initialize=Imba.Tag,HTML_TAGS="a abbr address area article aside audio b base bdi bdo big blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hr html i iframe img input ins kbd keygen label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr".split(" "),HTML_TAGS_UNSAFE="article aside header section".split(" "),SVG_TAGS="circle defs ellipse g line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan".split(" "),Imba.Tags=function(){},Imba.Tags.prototype.__clone=function(t){var e=Object.create(this);return e._parent=this,e},Imba.Tags.prototype.defineNamespace=function(t){var e=Object.create(this);return e._parent=this,e._ns=t,this[t.toUpperCase()]=e,e},Imba.Tags.prototype.baseType=function(e){return t(e,HTML_TAGS)>=0?"htmlelement":"div"},Imba.Tags.prototype.defineTag=function(t,r,o){void 0==o&&"function"==typeof r&&(o=r,r=""),void 0==r&&(r=""),r||(r=this.baseType(t));var i=this[r],s=n(),u=t.replace(/\-/g,"_");return s._name=t,e(s,i),"#"==t[0]?(this[t]=s,Imba.SINGLETONS[t.slice(1)]=s):(this[t]=s,this["$"+u]=a(s)),o&&(2==o.length&&(s.hasOwnProperty("TAGS")||(s.TAGS=(i.TAGS||this).__clone())),o.call(s,s,s.TAGS||this)),s},Imba.Tags.prototype.defineSingleton=function(t,e,n){return this.defineTag(t,e,n)},Imba.Tags.prototype.extendTag=function(t,e,n){void 0==n&&"function"==typeof e&&(n=e,e=""),void 0==e&&(e="");var a="string"==typeof t||t instanceof String?this[t]:t;return n&&n&&n.call(a,a,a.prototype),a},Imba.TAGS=new Imba.Tags,Imba.TAGS.element=Imba.Tag;var r=Imba.TAGS.defineNamespace("svg");r.baseType=function(t){return"svgelement"},Imba.SINGLETONS={},Imba.defineTag=function(t,e,n){return void 0==n&&"function"==typeof e&&(n=e,e=""),void 0==e&&(e=""),Imba.TAGS.defineTag(t,e,n)},Imba.defineSingletonTag=function(t,e,n){return void 0==n&&"function"==typeof e&&(n=e,e="div"),void 0==e&&(e="div"),Imba.TAGS.defineTag(this.name(),e,n)},Imba.extendTag=function(t,e){return Imba.TAGS.extendTag(t,e)},Imba.tag=function(t){var e=Imba.TAGS[t];if(!e)throw new Error("tag "+t+" is not defined");return new e(e.createNode())},Imba.tagWithId=function(t,e){var n=Imba.TAGS[t];if(!n)throw new Error("tag "+t+" is not defined");var a=n.createNode();return a.id=e,new n(a)},Imba.getTagSingleton=function(t){var e,n,a;return(e=Imba.SINGLETONS[t])?e&&e.Instance?e.Instance:(n=Imba.document().getElementById(t))?(a=e.Instance=new e(n),a.awaken(n),a):(n=e.createNode(),n.id=t,a=e.Instance=new e(n),a.end().awaken(n),a):(n=Imba.document().getElementById(t))?Imba.getTagForDom(n):void 0};var o="undefined"!=typeof SVGElement;return Imba.getTagForDom=function(t){var e;if(!t)return null;if(t._dom)return t;if(t._tag)return t._tag;if(!t.nodeName)return null;var n=null,a=t.id,r=t.nodeName.toLowerCase(),i=Imba.TAGS,s=r,u=t.className;if(a&&Imba.SINGLETONS[a])return Imba.getTagSingleton(a);o&&t instanceof SVGElement&&(n="svg",u=t.className.baseVal,i=i.SVG);var m;return u&&((e=u.match(/\b_([a-z\-]+)\b(?!\s*_[a-z\-]+)/))&&(r=e[1]),(e=u.match(/\b([A-Z\-]+)_\b/))&&(n=e[1])),m=i[r]||i[s],m?new m(t).awaken(t):null},tag$=Imba.TAGS,t$=Imba.tag,tc$=Imba.tagWithFlags,ti$=Imba.tagWithId,tic$=Imba.tagWithIdAndFlags,id$=Imba.getTagSingleton,tag$wrap=Imba.getTagForDom}();
29
- },{}]},{},[1])(1)
30
- });