-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
1 lines (1 loc) · 24.1 KB
/
index.js
File metadata and controls
1 lines (1 loc) · 24.1 KB
1
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("fiber",[],t):"object"==typeof exports?exports.fiber=t():e.fiber=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=10)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.EventGateway=function(){function e(){r(this,e)}return o(e,[{key:"trigger",value:function(e){var t=this;return new Promise(function(n){return n(t.triggerSync(e))})}},{key:"triggerSync",value:function(e){return this.element.dispatchEvent(e.event())}},{key:"listen",value:function(){for(var e=0;e<arguments.length;e+=2)this.addEventListener(arguments.length<=e?void 0:arguments[e],arguments.length<=e+1?void 0:arguments[e+1])}},{key:"addEventListener",value:function(t,n){var r=this,o=void 0,i=[];if("string"==typeof t)o=n,t.trim().split(/\s+/).forEach(function(e){i.push(e),r.element.addEventListener(e,o)});else{if(!(t instanceof Event)&&t.namespace instanceof e)return t.namespace.addEventListener(t.event,n);o=function(e){return n(e.detail)},this.element.addEventListener(t.EventName,o),i.push(t.EventName)}return{callback:o,events:i,element:this.element}}}],[{key:"forElement",value:function(e,t){var n=new this;return n.name=t&&t.constructor.name,n.element=e,n}},{key:"forComponent",value:function(e){var t=new this;return t.name=e.constructor.name,t.element=e.view,t}}]),e}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.NameSpace=t.DefinedEvent=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(4),c=n(0),s=n(13),l=n(5),f=function(e){return e&&e.__esModule?e:{default:e}}(l),v=t.DefinedEvent=(0,u.basicEvent)("Fiber:NameSpace:Defined");t.NameSpace=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.name=e,n.eventPool=new s.EventPool,n}return i(t,e),a(t,[{key:"defineState",value:function(e){var t=this;this.__state||(this.__state=new f.default),this.state=this.__state.reader,Object.getOwnPropertyNames(e).forEach(function(n){t.__state.addProperty(n);for(var r=e[n](t.__state.modifier),o=0;o<r.length;o+=2)t.addEventListener(r[o],r[o+1])}),this.trigger(new v)}},{key:"addEventListener",value:function(e,t){var n=[];return!(e instanceof u.Event)&&e.namespace instanceof c.EventGateway?e.namespace.addEventListener(e.event,t):(this.eventPool.addEventListener(e.EventName,t),n.push(e.EventName),{callback:t,events:n,element:this.eventPool})}},{key:"triggerSync",value:function(e){return this.eventPool.dispatchEvent(e)}}],[{key:"get",value:function(e){this.namespaces||(this.namespaces=new Map);var n=this.namespaces.get(e);return n||(n=new t(e),this.namespaces.set(e,n)),n}}]),t}(c.EventGateway)},function(e,t,n){"use strict";function r(e){return"string"==typeof e?e:e.EventName}function o(){return(++a).toString()}Object.defineProperty(t,"__esModule",{value:!0});var i={components:new Map,listeners:new Map,observers:new Map,elementAttribute:"fiber-component-id"};i.init=function(){this.observe(document.body),this.init=!1},i.observe=function(e){var t=this,n=(this.observers.size+1).toString();if(!e._GC_observerId){e._GC_observerId=n;var r=new MutationObserver(function(e){e.forEach(function(e){e.removedNodes&&e.removedNodes.forEach(function(e){t.removeNode(e)})})});r.observe(e,{childList:!0,subtree:!0}),this.observers.set(n,{element:e,observer:r})}},i.removeNode=function(e){var t=this;if(e.querySelectorAll&&!e._GC_observerId){var n=function(e){var n=e.attributes[t.elementAttribute].value,r=t.components.get(n);r&&t.destroy(r)};e.querySelectorAll("["+this.elementAttribute+"]").forEach(n),e.attributes[this.elementAttribute]&&n(e)}},i.registerComponent=function(e){e.componentId=o(),this.components.set(e.componentId,e),this.listeners.set(e.componentId,[]),e.view.setAttribute(this.elementAttribute,e.componentId),i.init&&i.init()},i.registerListener=function(e,t,n,o){this.listeners.has(e.componentId)&&this.listeners.get(e.componentId).push({element:t,eventName:r(n),callback:o})},i.destroy=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.listeners.get(e.componentId)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;a.element.removeEventListener(a.eventName,a.callback)}}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}e.view=null,this.components.delete(e.componentId),this.listeners.delete(e.componentId)},t.default=i;var a=0},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=n(1),u=n(7),c=function(){function e(){r(this,e);for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];this.init.apply(this,n)}return o(e,[{key:"init",value:function(){}},{key:"listen",value:function(){}},{key:"on",value:function(e){return e instanceof u.EventFlowType?this.flow(e):e instanceof i.EventGateway||e instanceof u.EventFlow?e:(0,a.getNameSpaceByPath)(e)}},{key:"flow",value:function(e){return new u.EventFlow(e)}}]),e}();t.default=c},function(e,t,n){"use strict";function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=Object.getOwnPropertyNames(e);return function(n){function a(){i(this,a);for(var n=r(this,(a.__proto__||Object.getPrototypeOf(a)).call(this)),o=new p.default(n),u=arguments.length,c=Array(u),s=0;s<u;s++)c[s]=arguments[s];for(var f=0;f<c.length;f++){var v=t[f];if(void 0===v||void 0===e[v])throw new m(n,v,c[f]);var h=y.Optional.from(e[v]),d=l(h,2),b=d[0],w=d[1];if(!b||void 0!==c[f]&&null!==c[f])if("Mixed"===w.name)o.addProperty(v,c[f]);else if(w==Number||w==String||w==Boolean)o.addProperty(v,new w(c[f]).valueOf());else{if(w instanceof Object&&!(c[f]instanceof w))throw new m(n,v,c[f],w);o.addProperty(v,c[f])}else o.addProperty(v,c[f])}return n}return o(a,n),a}(d)}function u(e){return function(e){function t(){return i(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),t}(e).alias("Event"+ ++h)}function c(e){return function(e){function t(){return i(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),t}(d).alias(e||"Event"+ ++h)}function s(e,t){return u(e).alias(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0;var l=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),f=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.defineEventType=a,t.eventOfType=u,t.basicEvent=c,t.defineEvent=s;var v=n(5),p=function(e){return e&&e.__esModule?e:{default:e}}(v),y=n(12),h=0,d=function(){function e(){i(this,e),this.name=this.constructor.EventName}return f(e,[{key:"event",value:function(){return this.originalEvent||(this.originalEvent=new CustomEvent(this.name,{detail:this,bubbles:!this.constructor._cancelBubble,cancelable:!0})),this.originalEvent}},{key:"stopPropagation",value:function(){this.originalEvent&&this.originalEvent.stopPropagation()}},{key:"preventDefault",value:function(){this.originalEvent&&this.originalEvent.preventDefault()}}],[{key:"bubbles",value:function(e){return this._cancelBubble=!e,this}},{key:"alias",value:function(e){return this.EventName=e,this}},{key:"on",value:function(e){return{namespace:e,event:this}}}]),e}();t.Event=d;var m=function(e){function t(e,n,o,a){if(i(this,t),a)var u=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Type mismatch for Event '"+e.name+"' for attribute '"+n+"'"));else var u=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Unexpected parameter for Event '"+e.name+"'"));return u.event=e,u.name=n,u.value=o,u.type=a,r(u)}return o(t,e),t}(Error)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return e instanceof Object?new Proxy(e,{get:function(e,t){return o(e[t])},set:function(){return!0}}):e}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.readOnly=o;var a=n(6),u=function(){function e(t){r(this,e),this.reader=t||{},this.modifier={}}return i(e,[{key:"addProperty",value:function(e,t){var n=this;this.modifier[e]=(0,a.coldClone)(t),Object.defineProperty(this.reader,e,{get:function(){return n.modifier[e]},enumerable:!0})}}]),e}();t.default=u},function(e,t,n){"use strict";function r(e){if(!(e instanceof Object)||e instanceof Function)return e;if(e instanceof Array)return e.map(function(e){return r(e)});if(e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Boolean)return new e.constructor(e);if(e.clone instanceof Function)return e.clone();var t={},n=!0,o=!1,i=void 0;try{for(var a,u=Object.getOwnPropertyNames(e)[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var c=a.value;t[c]=r(e[c])}}catch(e){o=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return t}function o(e){return e===r(e)?e:Object.freeze(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,t.coldClone=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.EventFlow=t.EventFlowType=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=(n(4),n(0));t.EventFlowType=function e(){r(this,e);for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];this.steps=n,n.forEach(function(e){if(!(e.namespace instanceof i.EventGateway&&e.event.EventName))throw new Error("wrong argument for Flow step!")})},t.EventFlow=function(){function e(t){var n=this;r(this,e),this.steps=t.steps.slice(),this.currentEvent=null,this.currentNameSpace=null,this.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),this.history=[]}return o(e,[{key:"trigger",value:function(e){var t=this.steps.shift();return t||this.reject(e),!e instanceof t.event&&this.reject(e),this.history.push(e),this.currentEvent=e,this.currentNameSpace=t.namespace,e.flow=this,this.currentNameSpace.trigger(e),this.steps.length||this.resolve(this),this.promise}},{key:"listen",value:function(){throw new Error("You can't set listeners on an EventFlow! (yet?)")}}]),e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},s=n(3),l=r(s),f=n(0),v=(n(1),n(9)),p=r(v),y=n(2),h=r(y),d=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),u(t,[{key:"render",value:function(){return this.constructor.template&&(this.view=p.default.render(this.constructor.template)),this.listen(),this.view}},{key:"getNameSpaceByPath",value:function(){return this.EventGateway||(this.EventGateway=f.EventGateway.forComponent(this))}},{key:"on",value:function(e){return e=c(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"on",this).call(this,e),e instanceof f.EventGateway?new m(this,e):e}},{key:"ui",value:function(e){var t=p.default.getElement(e||this.view,this.view);return t?new m(this,f.EventGateway.forElement(t,this)):null}},{key:"view",get:function(){return this._view},set:function(e){this._view=e,this.getNameSpaceByPath().element=e,e&&h.default.registerComponent(this)}},{key:"namespace",get:function(){return this.getNameSpaceByPath()}}],[{key:"elementName",value:function(){return this.name.replace("Component","").replace(/[A-Z]/g,"-$&").toLowerCase().substr(1)}},{key:"withTemplate",value:function(e){return function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),u(t,null,[{key:"__setTemplate",value:function(e){return this.template=e,this}}]),t}(this).__setTemplate(e)}},{key:"attachTo",value:function(e){e=p.default.getElement(e);for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=new(Function.prototype.bind.apply(this,[null].concat(n)));o._attached=!0;var i=this.template?p.default.render(this.template):null;return i?i.tagName==e.tagName?(e.replaceWith(i),o.view=i):(o.view=e,o.view.append(i)):o.view=e,o.listen(),o}},{key:"populate",value:function(e){var t=this;if(!e instanceof Element)return!1;var n=e.querySelectorAll(this.elementName());return e.tagName.toLowerCase()==this.elementName()&&(n=[e]),n.forEach(function(e){t.attachTo(e)}),n}}]),t}(l.default),m=function(){function e(t,n){o(this,e),this.component=t,this.EventGateway=n}return u(e,[{key:"listen",value:function(){var e,t=this,n=arguments;(e=console).log.apply(e,arguments);for(var r=0;r<arguments.length;r+=2)!function(e){var r=t.EventGateway.addEventListener(n.length<=e?void 0:n[e],n.length<=e+1?void 0:n[e+1]);r.events.forEach(function(e){return h.default.registerListener(t.component,r.element,e,r.callback)})}(r)}},{key:"trigger",value:function(e){return this.EventGateway.trigger(e)}},{key:"triggerSync",value:function(e){return this.EventGateway.triggerSync(e)}}]),e}();t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(r),i={};i.getElement=function(e,t){return"string"==typeof e?(t||document).querySelector(e):e},i.render=function(e,t){if(e instanceof Element)return e;var n=document.createElement(t||"div");return n.innerHTML=e,t||1!=n.childElementCount?n:n.firstElementChild},i.renderWithComponents=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e=i.render(e);var o=!0,a=!1,u=void 0;try{for(var c,s=n[Symbol.iterator]();!(o=(c=s.next()).done);o=!0){c.value.populate(e)}}catch(e){a=!0,u=e}finally{try{!o&&s.return&&s.return()}finally{if(a)throw u}}return e},i.detach=function(e){o.default.observe(e),e.remove()},t.default=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=r(o),a=n(11),u=r(a),c=n(8),s=r(c),l=n(1),f=n(4),v=n(7),p=n(6),y=r(p),h=n(9),d=r(h),m=n(14),b=r(m),w=n(0),g=n(15),E={};E.GC=i.default,E.DataComponent=u.default,E.UIComponent=s.default,E.namespace=function(e){return l.NameSpace.get(e)},E.NameSpace={create:function(e){return l.NameSpace.get(e)},Defined:l.DefinedEvent},E.Event=f.Event,E.defineEvent=f.defineEvent,E.defineEventType=f.defineEventType,E.basicEvent=f.basicEvent,E.EventFlow={define:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return new(Function.prototype.bind.apply(v.EventFlowType,[null].concat(t)))}},E.clone=y.default,E.DOM=d.default,E.Debugger=b.default,E.System=l.NameSpace.get("data/system"),E.System.Ready=(0,f.basicEvent)("System:Ready");var _=E.DataComponent.attachTo(E.System);E.app=function(e){e(),_.on(E.System).trigger(new E.System.Ready)},(0,g.registerSystemLoaded)({Fiber:E,NameSpace:l.NameSpace,EventGateway:w.EventGateway}),t.default=E},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(3),c=function(e){return e&&e.__esModule?e:{default:e}}(u),s=n(0),l=n(1),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),a(t,[{key:"namespace",get:function(){return this.EventGateway}}],[{key:"attachTo",value:function(e){var t=new this;return t.EventGateway=e instanceof s.EventGateway?e:(0,l.getNameSpaceByPath)(e),t.listen(),t}}]),t}(c.default);t.default=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),(t.Optional=function(e){return{$isOptional:!0,value:e}}).from=function(e){return e.$isOptional?[!0,e.value]:[!1,e]};t.Mixed=function e(){r(this,e)}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;r(this,e),this.listener=t,this.next=n}return o(e,[{key:"execute",value:function(e){this.listener(e),this.next&&this.next.execute(e)}},{key:"add",value:function(t){for(var n=this;n.next;)n=n.next;n.next=new e(t)}},{key:"without",value:function(e){for(var t=this,n=t,r=null;n;){if(n.listener==e)return null==r?t=n.next:r.next=n.next,t;r=n,n=n.next}return t}}],[{key:"with",value:function(t){return new e(t)}}]),e}();t.EventPool=function(){function e(){r(this,e),this.eventPool=new Map}return o(e,[{key:"addEventListener",value:function(e,t){this.eventPool.has(e)?this.eventPool.get(e).add(t):this.eventPool.set(e,i.with(t))}},{key:"removeEventListener",value:function(e,t){var n=this.eventPool.get(e);if(n){var r=n.without(t);r?this.eventPool.set(e,r):this.eventPool.delete(e)}}},{key:"dispatchEvent",value:function(e){var t=this.eventPool.get(e.name);t&&t.execute(e)}}]),e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e.name)return e.name;try{return e.toString().match(/_this[0-9][.]([^(]*)[(]/).pop()}catch(e){return"[inline method]"}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),a=r(i),u=n(8),c=r(u),s=n(0),l=n(1),f={},v=null,p="font-weight: bold; color: black;",y="font-weight: normal; color: red;",h="font-weight: normal;";f.init=function(){a.default.prototype.$$on=a.default.prototype.on,a.default.prototype.on=function(e){return v=this,this.$$on(e)},c.default.prototype.$$ui=c.default.prototype.ui,c.default.prototype.ui=function(e){return v=this,this.$$ui(e)},a.default.prototype.$$flow=a.default.prototype.flow,a.default.prototype.flow=function(e){return v=this,this.$$flow(e)};var e=function(e){var t=this.name||"DOM",n=v.displayName||v.constructor.name;return 1==n.length&&(n="FiberJS"),console.log(" %c"+e.name+" %ctriggered on %c"+t+"%c by %c"+n,"font-weight: bold; color: navy;",h,p,h,p),f.showEvents&&console.log(e),this.$$triggerSync(e)};s.EventGateway.prototype.$$triggerSync=s.EventGateway.prototype.triggerSync,s.EventGateway.prototype.triggerSync=e,l.NameSpace.prototype.$$triggerSync=l.NameSpace.prototype.triggerSync,l.NameSpace.prototype.triggerSync=e,s.EventGateway.prototype.$$addEventListener=s.EventGateway.prototype.addEventListener,s.EventGateway.prototype.addEventListener=function(e,t){var n="string"==typeof e,r=n?e:e.EventName,i=v.constructor.name,a=v.view,u=function(e){return n?console.log(" %c"+r.replace(" ","/")+"%c was triggered on "+i,"font-weight: bold; color: navy;",h):a&&f.showView?console.log(" "+i+" listening for %c"+r,a,y):console.log(" %c"+i+"%c listening for %c"+r,"font-weight: bold; color: #2D602D;",h,y),console.log(" %c"+o(t)+"%c is called by "+i,"font-weight: bold; color: #d9534f;",h),t(e)};return this.$$addEventListener(e,u)}},t.default=f},function(e,t,n){"use strict";(function(e){function n(){return e.__Fiber||(e.__Fiber={})}function r(e){n().system?e(n().system):(n().afterSystemLoaded||(n().afterSystemLoaded=[]),n().afterSystemLoaded.push(e))}function o(e){n().system=e,n().afterSystemLoaded&&n().afterSystemLoaded.forEach(function(t){t(e)}),n().afterSystemLoaded=[]}Object.defineProperty(t,"__esModule",{value:!0}),t.afterSystemLoaded=r,t.registerSystemLoaded=o}).call(t,n(16))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n}])});