diff --git a/build/Component.js b/build/Component.js index fa58f5d..9553294 100644 --- a/build/Component.js +++ b/build/Component.js @@ -423,7 +423,7 @@ var Component = function (_Element) { self.__ob.push(v); v.__ob__.push(self); v.__cb__.push(function () { - self[name] = self[name]; + self.__data(name); }); } } diff --git a/dist/index.js b/dist/index.js index 267391b..94e2d9a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,3 +1,3 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(33)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;nr;r++)n.on(e[r],t);else if(t){n.__hash.hasOwnProperty(e)||(n.__hash[e]=[]);for(var r=0,i=n.__hash[e],a=i.length;a>r;r++)if(i[r]===t)return n;n.__hash[e].push(t)}return n}},{key:"once",value:function(e,t){var n=this;if(Array.isArray(e))for(var r=0,a=e.length;a>r;r++)n.once(e[r],t);else if(t){var i=function o(){for(var r=arguments.length,a=Array(r),i=0;r>i;i++)a[i]=arguments[i];t.apply(this,a),n.off(e,o)};n.on(e,i)}return this}},{key:"off",value:function(e,t){var n=this;if(Array.isArray(e))for(var r=0,a=e.length;a>r;r++)n.off(e[r],t);else if(n.__hash.hasOwnProperty(e))if(t){for(var r=0,i=n.__hash[e],a=i.length;a>r;r++)if(i[r]===t){i.splice(r,1);break}}else delete n.__hash[e];return this}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=Array(n>1?n-1:0),a=1;n>a;a++)r[a-1]=arguments[a];if(Array.isArray(e))for(var i=0,o=e.length;o>i;i++)t.emit(e[i],r);else if(t.__hash.hasOwnProperty(e)){var s=t.__hash[e];if(s.length){s=s.slice();for(var i=0,o=s.length;o>i;i++)s[i].apply(t,r)}}return this}}],[{key:"mix",value:function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];for(var a=n.length-1;a>=0;a--){var i=n[a],o=new e;i.__hash={};for(var s=["on","once","off","emit"],u=s.length-1;u>=0;u--){var l=s[u];i[l]=o[l]}}}}]),e}();a.DOM="DOM",a.DESTROY="DESTROY",a.DATA="DATA",t["default"]=a},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){if(e instanceof h["default"])return e;if(o(e))return e;var t=Array.isArray(e)?[]:{};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];r instanceof h["default"]?t[n]=r:p.isDate(r)?t[n]=new Date(r):t[n]=p.isObject(r)?a(r):r}return t}function i(e){return function(t){return _.call(t)=="[object "+e+"]"}}function o(e){return void 0===e||null===e||p.isBoolean(e)||p.isNumber(e)||p.isString(e)}function s(e,t){if(e instanceof h["default"]||t instanceof h["default"])return e===t;if(o(e)||o(t))return e===t;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!=t.length)return!1;for(var n=0,r=e.length;r>n;n++)if(!s(e[n],t[n]))return!1;return!0}if(p.isDate(e))return p.isDate(t)?e-t==0:!1;if(p.isObject(e)){if(!p.isObject(t))return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var n=0,r=a.length;r>n;n++)if(!t.hasOwnProperty(n)||!s(e[n],t[n]))return!1;return!0}}function u(e,t){for(var n="",r=0,a=e.length;a>r;r++){var i=e[r];n+=Array.isArray(i)?u(i):i instanceof h["default"]?t?f(i.toString(),t):i.toString():f(c(i),t)}return n}function l(e){for(var t="",n=0,r=e.length;r>n;n++){var a=e[n];t+=Array.isArray(a)?l(a):a.toString()}return t}function c(e){return null===e||void 0===e?"":e.toString()}function f(e,t){return t?e.replace(/"/g,"""):e.replace(/&/g,"&").replace(/n;n++){var a=e[n];if(Array.isArray(a))t[a[0]]=a[1];else for(var i=Object.keys(a),o=i.length-1;o>=0;o--){var s=i[o];t[s]=a[s]}}return t}function l(e){for(var t=[],n=Object.keys(e),r=0,a=n.length;a>r;r++){var i=n[r];t.push([i,e[i]])}return t}function c(e){for(var t=0,n=e.length;n>t;t++){var r=e[t];if(!Array.isArray(r)){for(var a=[],i=Object.keys(r),o=0,n=i.length;n>o;o++){var s=i[o];a.push([s,r[s]])}e.splice.apply(e,[t,1].concat(a))}}return e}Object.defineProperty(t,"__esModule",{value:!0});var f=function(){function e(e,t){for(var n=0;nr;r++)if(n[r]===this){n.splice(r,1);break}}}}},{key:"inTo",value:function(e){this.clean();var t=this.toString();s(e).innerHTML=t,this.emit(h["default"].DOM)}},{key:"appendTo",value:function(e){this.clean();var t=this.toString();e=s(e),e.insertAdjacentHTML("beforeend",t),this.emit(h["default"].DOM)}},{key:"prependTo",value:function(e){this.clean();var t=this.toString();e=s(e),e.insertAdjacentHTML("afterbegin",t),this.emit(h["default"].DOM)}},{key:"before",value:function(e){this.clean();var t=this.toString();e=s(e),e.insertAdjacentHTML("beforebegin",t),this.emit(h["default"].DOM)}},{key:"after",value:function(e){this.clean();var t=this.toString();e=s(e),e.insertAdjacentHTML("afterend",t),this.emit(h["default"].DOM)}},{key:"replace",value:function(e){this.clean();var t=this.toString();e=s(e),e.insertAdjacentHTML("afterend",t),e.parentNode.removeChild(e),this.emit(h["default"].DOM)}},{key:"top",get:function(){return!this.__top&&this.parent&&(this.parent instanceof migi.Component?this.__top=this.parent:this.__top=this.parent.top),this.__top}},{key:"parent",get:function(){return this.__parent}},{key:"children",get:function(){return this.__children}},{key:"name",get:function(){return this.__name}},{key:"dom",get:function(){return this.__dom}}]),t}(h["default"]);t["default"]=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(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 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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];a(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,null,n,r)),s=o;return s.__name=s.constructor.__migiName,s.__virtualDom=null,s.__ref={},s.__stop=null,s.__model=null,s.__allowPropagation=!0,s.__stream=null,s.__canData=!1,s.__bindHash={},s.__ob=[],s.__bindProperty={},s.__props.forEach(function(e,t){var n=e[0],r=e[1];s.__init(n,r,t)}),o}return o(t,e),s(t,[{key:"__init",value:function(e,t,n){var r=this;if(/^on[a-zA-Z]/.test(e)){var a=e.slice(2).toLowerCase();r.once(c["default"].DOM,function(){r.virtualDom.__addEvt(a,t)})}else if(/^on-[a-zA-Z\d_]/.test(e)){var a=e.slice(3);r.on(a,function(){for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];if(t instanceof b["default"]){if(v["default"].isFunction(t.cb)){var a;(a=t.cb).call.apply(a,[t.context].concat(n))}}else v["default"].isFunction(t)&&t.apply(void 0,n)})}else"model"==e?r.model=t:t instanceof m["default"]&&(r.__props[n]=t.v,r.props[e]=t.v,r.__bindProperty[t.k]=[e,t])}},{key:"render",value:function(){return new _["default"](this.__uid,"div",this.__props,this.children)}},{key:"toString",value:function(){if(this.__virtualDom=this.render(),!this.__virtualDom)throw new Error("render must return a VirtualDom: "+this.name);return this.__virtualDom.__parent=this,this.__style&&(this.__virtualDom.style=this.__style),this.__virtualDom.toString()}},{key:"preString",value:function(){this.toString()}},{key:"findChild",value:function(e){return this.findChildren(e,!0)[0]}},{key:"findChildren",value:function(e,n){for(var r=[],a=0,i=this.children.length;i>a;a++){var o=this.children[a];if(o instanceof d["default"])if(o instanceof t){if((o.name==e||v["default"].isFunction(e)&&o instanceof e)&&(r.push(o),n))break}else{if((o.name==e||v["default"].isFunction(e)&&o instanceof e)&&(r.push(o),n))break;if(r=r.concat(o.findAll(e)),n&&r.length)break}}return r}},{key:"find",value:function(e){return this.__virtualDom?this.__virtualDom.find(e):null}},{key:"findAll",value:function(e){return this.__virtualDom?this.__virtualDom.findAll(e):[]}},{key:"bridge",value:function(e,n,r,a){var i=this;if(e==this)throw new Error("can not bridge self: "+i.name);if(!(e&&(e instanceof w["default"]||e instanceof t||e instanceof E["default"])))throw new Error("can only bridge to EventBus/Component/Model: "+i.name);i.__bridgeHash=i.__bridgeHash||{},2==arguments.length?v["default"].isString(n)?i.__record(e,n,n):Object.keys(n).forEach(function(t){var r=n[t];v["default"].isString(r)?i.__record(e,t,r):v["default"].isFunction(r)?i.__record(e,t,t,r):r.name&&i.__record(e,t,r.name,r.middleware)}):3==arguments.length?v["default"].isString(r)?i.__record(e,n,r):(a=r,i.__record(e,n,n,a)):4==arguments.length&&i.__record(e,n,r,a)}},{key:"__onDom",value:function(e){function n(e){e=e||window.event,e.target!=a&&e.srcElement!=a&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__onDom",this).call(this);var r=this;r.virtualDom.emit(c["default"].DOM,e);var a=r.element;r.name&&a.setAttribute("migi-name",r.name),e||r.children==r.virtualDom.children||t.fakeDom(r.children),"true"!=r.props.allowPropagation&&("false"!=r.props.allowPropagation&&r.allowPropagation||(r.__stop=n,S.forEach(function(e){a.addEventListener(e,n)}),M["default"].attach(a)))}},{key:"__data",value:function(e){var t=this;t.dom&&(t.__canData=!0),t.__onData(e),t.emit(c["default"].DATA,e),t.__bridgeHash&&(Array.isArray(e)||(e=[e]),e.forEach(function(e){var n=t.__bridgeHash[e];if(n){var r=t.__stream||new P["default"](t.__uid),a=t[e];n.forEach(function(e){var n=e.target,i=e.name,o=e.middleware;r.has(n.__uid)||(r.add(n.__uid),n instanceof w["default"]?n.emit(c["default"].DATA,i,o?o.call(t,a):a,r):(n.__stream=r,n[i]=o?o.call(t,a):a,n.__stream=null))})}}))}},{key:"__onData",value:function(e){if(this.dom&&this.canData){this.virtualDom&&this.virtualDom.__onData(e);for(var t=0,n=this.children.length;n>t;t++){var r=this.children[t];r instanceof _["default"]&&r.__onData(e)}}}},{key:"__notifyBindProperty",value:function(e){if(this.__bindProperty.hasOwnProperty(e)){var t=this.__bindProperty[e],n=t[0],r=t[1];r.update(r.v)&&(this[n]=r.v)}}},{key:"__destroy",value:function(){var e=this;if(e.__stop){var t=e.element;S.forEach(function(n){t.removeEventListener(n,e.__stop)})}e.model&&e.model.__del(e),e.__ob.forEach(function(t){var n=t.__ob__.indexOf(e);n>-1&&(t.__ob__.splice(n,1),t.__cb__.splice(n,1))});var n=e.virtualDom.__destroy();return e.emit(c["default"].DESTROY),e.__hash={},e.__bridgeHash=null,e.__bindProperty=null,n}},{key:"__initBind",value:function(e){return!this.__bindHash.hasOwnProperty(e)}},{key:"__getBind",value:function(e){return this.__bindHash[e]}},{key:"__setBind",value:function(e,t){this.__bindHash[e]=t,this.__array(e,t)}},{key:"__array",value:function(e,t){var n=this;Array.isArray(t)&&(t.__proto__=D["default"],t.__ob__=t.__ob__||[],t.__cb__=t.__cb__||[],-1==t.__ob__.indexOf(n)&&(n.__ob.push(t),t.__ob__.push(n),t.__cb__.push(function(){n[e]=n[e]})))}},{key:"allowPropagation",get:function(){return this.__allowPropagation},set:function(e){this.__allowPropagation=e}},{key:"element",get:function(){return this.virtualDom?this.virtualDom.element:null}},{key:"style",get:function(){return this.__style},set:function(e){this.__style=e}},{key:"model",get:function(){return this.__model},set:function(e){if(!(e instanceof E["default"]))throw new Error("can not set model to a non Model: "+e);this.__model=e,e.__add(this)}},{key:"virtualDom",get:function(){return this.__virtualDom}},{key:"ref",get:function(){return this.__ref}},{key:"canData",get:function(){return this.__canData}}],[{key:"fakeDom",value:function(e){Array.isArray(e)?e.forEach(function(e){t.fakeDom(e)}):e instanceof t?e.emit(c["default"].DOM,!0):e instanceof _["default"]&&e.emit(c["default"].DOM,!0)}}]),t}(d["default"]);["__record","__unRecord","bridgeTo","unBridge","unBridgeTo"].forEach(function(e){j.prototype[e]=w["default"].prototype[e]}),t["default"]=j},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={};t["default"]={get:function(e){return n[e]},set:function(e){return n[e.__uid]=e,e}}},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function a(e,t){n(this,a),this.context=e,this.cb=t};t["default"]=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;na;a++){var o=r[a],s=o.target,u=o.name,l=o.middleware;if(!n.has(s.__uid)){n.add(s.__uid);var c=migi.CacheComponent.getSid(s);n.sid>c&&(s.__stream=n,s[u]=l?l.call(s,t):t,s.__stream=null)}}}},{key:"__record",value:function(e,t,n,r){var a=this,i=this.__bridgeHash[t]=this.__bridgeHash[t]||[];i.forEach(function(r){if(r.target==e&&r.name==n)throw new Error("duplicate bridge: "+a+"."+t+" -> "+e+"."+n)}),i.push({target:e,name:n,middleware:r})}},{key:"__unRecord",value:function(e,t,n){for(var r=this,a=r.__bridgeHash[t]||[],i=0,o=a.length;o>i;i++){var s=a[i];if(s.target==e&&s.name==n)return void a.splice(i,1)}}},{key:"bridge",value:function(e,t,n,r){var a=this;if(e==this)throw new Error("can not bridge self: "+a);if(!(e&&(e instanceof migi.Component||e instanceof migi.Model)))throw new Error("can only bridge to Component/Model: "+a);2==arguments.length?f["default"].isString(t)?a.__record(e,t,t):Object.keys(t).forEach(function(n){var r=t[n];f["default"].isString(r)?a.__record(e,n,r):r.name&&a.__record(e,n,r.name,r.middleware)}):3==arguments.length?f["default"].isString(n)?a.__record(e,t,n):(r=n,a.__record(e,t,t,r)):4==arguments.length&&a.__record(e,t,n,r)}},{key:"bridgeTo",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];e.bridge.apply(e,[this].concat(n))}},{key:"unBridge",value:function(e,t,n){var r=this;2==arguments.length?f["default"].isString(t)?r.__unRecord(e,t,t):Object.keys(t).forEach(function(n){var a=t[n];f["default"].isString(a)?r.__unRecord(e,n,a):f["default"].isFunction(a)?r.__unRecord(e,n,n):a.name&&r.__unRecord(e,n,a.name)}):r.__unRecord(e,t,n)}},{key:"unBridgeTo",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];e.unBridge.apply(e,[this].concat(n))}}]),t}(l["default"]);t["default"]=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(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 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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n-1&&this.__ref.splice(t,1)}},{key:"name",get:function(){return this.__name}}]),t}(l["default"]);["__data","__record","bridge","bridgeTo","__unRecord","unBridge","unBridgeTo","__initBind","__getBind","__setBind","__array"].forEach(function(e){h.prototype[e]=f["default"].prototype[e]}),t["default"]=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(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 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 s(e){return e instanceof A["default"]?e.name+'[migi-uid="'+e.__uid+'"]':e.replace(/(^|\s|,|])([A-Z][\w$]*)\b/,'$1[migi-name="$2"]')}function u(e,t){return l(e,t,!0)[0]||null}function l(e,t,n){return c(e,t,[],n)}function c(e,t,n,r){for(var a=0,i=t.length;i>a;a++){var o=t[a];if(o instanceof A["default"]?n=f(e,o,n,r):o instanceof S["default"]?(o=o.v,Array.isArray(o)?n=c(e,o,n,r):o instanceof A["default"]&&(n=f(e,o,n,r))):Array.isArray(o)&&(n=c(e,o,n,r)),r&&n.length)break}return n}function f(e,t,n,r){if(t instanceof T["default"])t instanceof e&&n.push(t);else{if(t instanceof e&&(n.push(t),r))return n;n=n.concat(t.findAll(e,r))}return n}function d(e){return void 0===e||null===e||!e.toString()}function h(e){if(e instanceof A["default"]||e instanceof S["default"])return e.toString();if(Array.isArray(e)){for(var t="",n=0,r=e.length;r>n;n++)t+=h(e[n]);return t}return x["default"].encodeHtml(x["default"].stringify(e))}function _(e,t){if(Array.isArray(e))for(var n=0,r=e.length;r>n;n++)_(e[n],t);else e instanceof A["default"]?e.__parent=t:e instanceof S["default"]&&_(e.v,t)}function p(e,t){if(Array.isArray(e))for(var n=0,r=e.length;r>n;n++)p(e[n],t);else e instanceof ie?e.style=t:e instanceof S["default"]&&p(e.v,t)}function v(e){var t=!0;if(Array.isArray(e))for(var n=0,r=e.length;r>n&&(t=v(e[n]),t);n++);else t=e instanceof A["default"]?!1:e instanceof S["default"]?v(e.v):d(e);return t}function y(e,t,n,r){if(Array.isArray(e))for(var a=0,i=e.length;i>a&&(y(e[a],t,n,r),!n.done);a++);else if(e instanceof A["default"]){if(t==e)return void(n.done=!0);r(e)}else e instanceof S["default"]&&y(e.v,t,n,r)}function m(e,t,n,r){if(Array.isArray(e))for(var a=0,i=e.length;i>a&&(m(e[a],t,n,r),!n.done);a++);else e instanceof A["default"]?t==e?n.start=!0:n.start&&r(e):e instanceof S["default"]&&m(e.v,t,n,r)}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(Array.isArray(e))for(var n=0,r=e.length;r>n;n++)g(e[n],t);else e instanceof A["default"]?t.push(e):e instanceof S["default"]&&g(e.v,t);return t}Object.defineProperty(t,"__esModule",{value:!0});var b=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(a(this,t),re["default"].hasOwnProperty(n)&&o.length)throw new Error("self-close tag can not has children: "+n);var s=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o)),u=s;return u.__names=null,u.__classes=null,u.__ids=null,u.__inline=null,u.__hover=!1,u.__active=!1,u.__listener=null,s}return o(t,e),b(t,[{key:"toString",value:function(){for(var e=this,t="<"+e.name,n=0,r=e.__props.length;r>n;n++){var a=e.__props[n],i=e.__renderProp(a[0],a[1]);t+=i}if(e.__style){var i=e.__match(!0);i&&(t=t.indexOf(' style="')>1?t.replace(/ style="[^"]*"/,' style="'+i+'"'):t+' style="'+i+'"')}if(t+=' migi-uid="'+e.__uid+'"',e.__checkListener(),e.__selfClose)return t+"/>";if(t+=">",e.props.dangerouslySetInnerHTML){var i=e.props.dangerouslySetInnerHTML;i=i instanceof S["default"]?i.toSourceString():Array.isArray(i)?x["default"].joinSourceArray(i):x["default"].stringify(i),t+=i}else t+=e.__renderChildren();return t+=""}},{key:"preString",value:function(){for(var e=this,t=0,n=e.__props.length;n>t;t++){var r=e.__props[t];e.__renderProp(r[0],r[1])}e.__style&&e.__match(!0),e.__checkListener(),e.__renderChildren()}},{key:"isFirst",value:function(e){if(this.parent instanceof T["default"])return!0;e=e||this.parent.children;for(var n=0,r=e.length;r>n;n++){var a=e[n];if(Array.isArray(a)&&a.length)return this.isFirst(a);if(a==this)return!0;if(a instanceof t)return!1;if(a instanceof S["default"]&&(a=a.v,Array.isArray(a)&&a.length))return this.isFirst(a)}}},{key:"isLast",value:function(e){if(this.parent instanceof T["default"])return!0;e=e||this.parent.children;for(var n=e.length-1;n>=0;n--){var r=e[n];if(Array.isArray(r)&&r.length)return this.isLast(r);if(r==this)return!0;if(r instanceof t)return!1;if(r instanceof S["default"]&&(r=r.v,Array.isArray(r)&&r.length))return this.isLast(r)}}},{key:"isEmpty",value:function(){return v(this.children)}},{key:"isEnabled",value:function(){return!this.__cache.disabled}},{key:"isDisabled",value:function(){return this.__cache.disabled}},{key:"isChecked",value:function(){return this.__cache.checked}},{key:"prev",value:function(){var e={};return y(this.parent.children,this,e,function(t){e.prev=t}),e.prev}},{key:"prevAll",value:function(e){var t={prev:[]};return y(this.parent.children,this,t,function(n){(e&&!Q["default"].nci(e,n)||!e)&&t.prev.push(n)}),t.prev}},{key:"next",value:function(){var e={};return m(this.parent.children,this,e,function(t){e.next=t,e.done=!0}),e.next}},{key:"nextAll",value:function(e){var t={next:[]};return m(this.parent.children,this,t,function(n){(e&&!Q["default"].nci(e,n)||!e)&&t.next.push(n)}),t.next}},{key:"isOnly",value:function(){return 1==this.siblings().length}},{key:"isOnlyOfType",value:function(e){for(var t=this,n=t.siblings(),r=0,a=n.length;a>r;r++){var i=n[r];if(i!=t&&!Q["default"].nci(e,i))return!1}return!0}},{key:"isFirstOfType",value:function(e){for(var t=this.prevAll(e),n=0,r=t.length;r>n;n++)if(!Q["default"].nci(e,t[n]))return!1;return!0}},{key:"isLastOfType",value:function(e){for(var t=this.nextAll(e),n=0,r=t.length;r>n;n++)if(!Q["default"].nci(e,t[n]))return!1;return!0}},{key:"siblings",value:function(){var e=this.parent,t=g(e.children);return t}},{key:"getIdx",value:function(e){var t=this.siblings(),n=t.indexOf(this);return n>-1?e?t.length-n-1:n:-1}},{key:"getIdxOfType",value:function(e,t){var n=t?this.nextAll(e):this.prevAll(e);t?n.unshift(this):n.push(this);var r=n.indexOf(this);return r>-1?t?n.length-r-1:r:-1}},{key:"closest",value:function(e){for(var t=this;t&&t!=this.top;){if(!Q["default"].nci(e,t))return t;t=t.parent}}},{key:"__renderProp",value:function(e,t){var n=this,r="";if(/^on[a-zA-Z]/.test(e))n.once(O["default"].DOM,function(r){if(!r){var a=e.slice(2).toLowerCase();n.__addEvt(a,t)}});else if(t instanceof S["default"]){if("dangerouslySetInnerHTML"==e)return"";var a=t.toString(!0);"className"==e?e="class":"htmlFor"==e&&(e="for"),n.__cache[e]=a;var i=z["default"].special(n.name,e);switch(i){case z["default"].RENDER_EXIST:t.v&&(r=" "+e+'="'+a+'"');break;case z["default"].RENDER_DOM:n.once(O["default"].DOM,function(){n.__updateAttr(e,t)});break;default:r=" "+e+'="'+a+'"'}}else{var a=Array.isArray(t)?x["default"].joinSourceArray(t):x["default"].stringify(t);if("dangerouslySetInnerHTML"==e)return"";"className"==e?e="class":"htmlFor"==e&&(e="for"),n.__cache[e]=a;var i=z["default"].special(n.name,e);switch(i){case z["default"].RENDER_EXIST:t&&(r=" "+e+'="'+x["default"].encodeHtml(a,!0)+'"');break;case z["default"].RENDER_DOM:n.once(O["default"].DOM,function(){n.__updateAttr(e,t)});break;default:r=" "+e+'="'+x["default"].encodeHtml(a,!0)+'"'}}if(n.__style)switch(e){case"class":case"id":r=" migi-"+r.slice(1)}return r}},{key:"__renderChildren",value:function(){for(var e=this,t="",n=0,r=e.children.length;r>n;n++)t+=h(e.children[n]);return t}},{key:"__checkListener",value:function(){var e=this;if("input"==e.name){if(e.props.hasOwnProperty("value")){var t=e.props.value;t instanceof S["default"]&&e.once(O["default"].DOM,function(){function n(e){q["default"](e);var n=e.target.value;t.setV(n);var r=t.k;0==r.indexOf("model.")?t.context.model[r.slice(6)]=n:t.context[r]=n}var r=e.__cache.type||"";switch(r.toLowerCase()){case"checkbox":case"radio":case"range":case"color":e.__addListener("change",n);break;default:e.__addListener(["input","paste","cut","change"],n)}})}}else if("select"==e.name){if(e.props.hasOwnProperty("value")){var t=e.props.value;t instanceof S["default"]&&e.once(O["default"].DOM,function(){function n(e){q["default"](e);var n=e.target.value;t.setV(n);var r=t.k;0==r.indexOf("model.")?t.context.model[r.slice(6)]=n:t.context[r]=n; +!function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(33)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;nr;r++)n.on(e[r],t);else if(t){n.__hash.hasOwnProperty(e)||(n.__hash[e]=[]);for(var r=0,i=n.__hash[e],a=i.length;a>r;r++)if(i[r]===t)return n;n.__hash[e].push(t)}return n}},{key:"once",value:function(e,t){var n=this;if(Array.isArray(e))for(var r=0,a=e.length;a>r;r++)n.once(e[r],t);else if(t){var i=function o(){for(var r=arguments.length,a=Array(r),i=0;r>i;i++)a[i]=arguments[i];t.apply(this,a),n.off(e,o)};n.on(e,i)}return this}},{key:"off",value:function(e,t){var n=this;if(Array.isArray(e))for(var r=0,a=e.length;a>r;r++)n.off(e[r],t);else if(n.__hash.hasOwnProperty(e))if(t){for(var r=0,i=n.__hash[e],a=i.length;a>r;r++)if(i[r]===t){i.splice(r,1);break}}else delete n.__hash[e];return this}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=Array(n>1?n-1:0),a=1;n>a;a++)r[a-1]=arguments[a];if(Array.isArray(e))for(var i=0,o=e.length;o>i;i++)t.emit(e[i],r);else if(t.__hash.hasOwnProperty(e)){var s=t.__hash[e];if(s.length){s=s.slice();for(var i=0,o=s.length;o>i;i++)s[i].apply(t,r)}}return this}}],[{key:"mix",value:function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];for(var a=n.length-1;a>=0;a--){var i=n[a],o=new e;i.__hash={};for(var s=["on","once","off","emit"],u=s.length-1;u>=0;u--){var l=s[u];i[l]=o[l]}}}}]),e}();a.DOM="DOM",a.DESTROY="DESTROY",a.DATA="DATA",t["default"]=a},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){if(e instanceof h["default"])return e;if(o(e))return e;var t=Array.isArray(e)?[]:{};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];r instanceof h["default"]?t[n]=r:p.isDate(r)?t[n]=new Date(r):t[n]=p.isObject(r)?a(r):r}return t}function i(e){return function(t){return _.call(t)=="[object "+e+"]"}}function o(e){return void 0===e||null===e||p.isBoolean(e)||p.isNumber(e)||p.isString(e)}function s(e,t){if(e instanceof h["default"]||t instanceof h["default"])return e===t;if(o(e)||o(t))return e===t;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!=t.length)return!1;for(var n=0,r=e.length;r>n;n++)if(!s(e[n],t[n]))return!1;return!0}if(p.isDate(e))return p.isDate(t)?e-t==0:!1;if(p.isObject(e)){if(!p.isObject(t))return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var n=0,r=a.length;r>n;n++)if(!t.hasOwnProperty(n)||!s(e[n],t[n]))return!1;return!0}}function u(e,t){for(var n="",r=0,a=e.length;a>r;r++){var i=e[r];n+=Array.isArray(i)?u(i):i instanceof h["default"]?t?f(i.toString(),t):i.toString():f(c(i),t)}return n}function l(e){for(var t="",n=0,r=e.length;r>n;n++){var a=e[n];t+=Array.isArray(a)?l(a):a.toString()}return t}function c(e){return null===e||void 0===e?"":e.toString()}function f(e,t){return t?e.replace(/"/g,"""):e.replace(/&/g,"&").replace(/n;n++){var a=e[n];if(Array.isArray(a))t[a[0]]=a[1];else for(var i=Object.keys(a),o=i.length-1;o>=0;o--){var s=i[o];t[s]=a[s]}}return t}function l(e){for(var t=[],n=Object.keys(e),r=0,a=n.length;a>r;r++){var i=n[r];t.push([i,e[i]])}return t}function c(e){for(var t=0,n=e.length;n>t;t++){var r=e[t];if(!Array.isArray(r)){for(var a=[],i=Object.keys(r),o=0,n=i.length;n>o;o++){var s=i[o];a.push([s,r[s]])}e.splice.apply(e,[t,1].concat(a))}}return e}Object.defineProperty(t,"__esModule",{value:!0});var f=function(){function e(e,t){for(var n=0;nr;r++)if(n[r]===this){n.splice(r,1);break}}}}},{key:"inTo",value:function(e){this.clean();var t=this.toString();s(e).innerHTML=t,this.emit(h["default"].DOM)}},{key:"appendTo",value:function(e){this.clean();var t=this.toString();e=s(e),e.insertAdjacentHTML("beforeend",t),this.emit(h["default"].DOM)}},{key:"prependTo",value:function(e){this.clean();var t=this.toString();e=s(e),e.insertAdjacentHTML("afterbegin",t),this.emit(h["default"].DOM)}},{key:"before",value:function(e){this.clean();var t=this.toString();e=s(e),e.insertAdjacentHTML("beforebegin",t),this.emit(h["default"].DOM)}},{key:"after",value:function(e){this.clean();var t=this.toString();e=s(e),e.insertAdjacentHTML("afterend",t),this.emit(h["default"].DOM)}},{key:"replace",value:function(e){this.clean();var t=this.toString();e=s(e),e.insertAdjacentHTML("afterend",t),e.parentNode.removeChild(e),this.emit(h["default"].DOM)}},{key:"top",get:function(){return!this.__top&&this.parent&&(this.parent instanceof migi.Component?this.__top=this.parent:this.__top=this.parent.top),this.__top}},{key:"parent",get:function(){return this.__parent}},{key:"children",get:function(){return this.__children}},{key:"name",get:function(){return this.__name}},{key:"dom",get:function(){return this.__dom}}]),t}(h["default"]);t["default"]=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(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 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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];a(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,null,n,r)),s=o;return s.__name=s.constructor.__migiName,s.__virtualDom=null,s.__ref={},s.__stop=null,s.__model=null,s.__allowPropagation=!0,s.__stream=null,s.__canData=!1,s.__bindHash={},s.__ob=[],s.__bindProperty={},s.__props.forEach(function(e,t){var n=e[0],r=e[1];s.__init(n,r,t)}),o}return o(t,e),s(t,[{key:"__init",value:function(e,t,n){var r=this;if(/^on[a-zA-Z]/.test(e)){var a=e.slice(2).toLowerCase();r.once(c["default"].DOM,function(){r.virtualDom.__addEvt(a,t)})}else if(/^on-[a-zA-Z\d_]/.test(e)){var a=e.slice(3);r.on(a,function(){for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];if(t instanceof b["default"]){if(v["default"].isFunction(t.cb)){var a;(a=t.cb).call.apply(a,[t.context].concat(n))}}else v["default"].isFunction(t)&&t.apply(void 0,n)})}else"model"==e?r.model=t:t instanceof m["default"]&&(r.__props[n]=t.v,r.props[e]=t.v,r.__bindProperty[t.k]=[e,t])}},{key:"render",value:function(){return new _["default"](this.__uid,"div",this.__props,this.children)}},{key:"toString",value:function(){if(this.__virtualDom=this.render(),!this.__virtualDom)throw new Error("render must return a VirtualDom: "+this.name);return this.__virtualDom.__parent=this,this.__style&&(this.__virtualDom.style=this.__style),this.__virtualDom.toString()}},{key:"preString",value:function(){this.toString()}},{key:"findChild",value:function(e){return this.findChildren(e,!0)[0]}},{key:"findChildren",value:function(e,n){for(var r=[],a=0,i=this.children.length;i>a;a++){var o=this.children[a];if(o instanceof d["default"])if(o instanceof t){if((o.name==e||v["default"].isFunction(e)&&o instanceof e)&&(r.push(o),n))break}else{if((o.name==e||v["default"].isFunction(e)&&o instanceof e)&&(r.push(o),n))break;if(r=r.concat(o.findAll(e)),n&&r.length)break}}return r}},{key:"find",value:function(e){return this.__virtualDom?this.__virtualDom.find(e):null}},{key:"findAll",value:function(e){return this.__virtualDom?this.__virtualDom.findAll(e):[]}},{key:"bridge",value:function(e,n,r,a){var i=this;if(e==this)throw new Error("can not bridge self: "+i.name);if(!(e&&(e instanceof w["default"]||e instanceof t||e instanceof E["default"])))throw new Error("can only bridge to EventBus/Component/Model: "+i.name);i.__bridgeHash=i.__bridgeHash||{},2==arguments.length?v["default"].isString(n)?i.__record(e,n,n):Object.keys(n).forEach(function(t){var r=n[t];v["default"].isString(r)?i.__record(e,t,r):v["default"].isFunction(r)?i.__record(e,t,t,r):r.name&&i.__record(e,t,r.name,r.middleware)}):3==arguments.length?v["default"].isString(r)?i.__record(e,n,r):(a=r,i.__record(e,n,n,a)):4==arguments.length&&i.__record(e,n,r,a)}},{key:"__onDom",value:function(e){function n(e){e=e||window.event,e.target!=a&&e.srcElement!=a&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__onDom",this).call(this);var r=this;r.virtualDom.emit(c["default"].DOM,e);var a=r.element;r.name&&a.setAttribute("migi-name",r.name),e||r.children==r.virtualDom.children||t.fakeDom(r.children),"true"!=r.props.allowPropagation&&("false"!=r.props.allowPropagation&&r.allowPropagation||(r.__stop=n,S.forEach(function(e){a.addEventListener(e,n)}),M["default"].attach(a)))}},{key:"__data",value:function(e){var t=this;t.dom&&(t.__canData=!0),t.__onData(e),t.emit(c["default"].DATA,e),t.__bridgeHash&&(Array.isArray(e)||(e=[e]),e.forEach(function(e){var n=t.__bridgeHash[e];if(n){var r=t.__stream||new P["default"](t.__uid),a=t[e];n.forEach(function(e){var n=e.target,i=e.name,o=e.middleware;r.has(n.__uid)||(r.add(n.__uid),n instanceof w["default"]?n.emit(c["default"].DATA,i,o?o.call(t,a):a,r):(n.__stream=r,n[i]=o?o.call(t,a):a,n.__stream=null))})}}))}},{key:"__onData",value:function(e){if(this.dom&&this.canData){this.virtualDom&&this.virtualDom.__onData(e);for(var t=0,n=this.children.length;n>t;t++){var r=this.children[t];r instanceof _["default"]&&r.__onData(e)}}}},{key:"__notifyBindProperty",value:function(e){if(this.__bindProperty.hasOwnProperty(e)){var t=this.__bindProperty[e],n=t[0],r=t[1];r.update(r.v)&&(this[n]=r.v)}}},{key:"__destroy",value:function(){var e=this;if(e.__stop){var t=e.element;S.forEach(function(n){t.removeEventListener(n,e.__stop)})}e.model&&e.model.__del(e),e.__ob.forEach(function(t){var n=t.__ob__.indexOf(e);n>-1&&(t.__ob__.splice(n,1),t.__cb__.splice(n,1))});var n=e.virtualDom.__destroy();return e.emit(c["default"].DESTROY),e.__hash={},e.__bridgeHash=null,e.__bindProperty=null,n}},{key:"__initBind",value:function(e){return!this.__bindHash.hasOwnProperty(e)}},{key:"__getBind",value:function(e){return this.__bindHash[e]}},{key:"__setBind",value:function(e,t){this.__bindHash[e]=t,this.__array(e,t)}},{key:"__array",value:function(e,t){var n=this;Array.isArray(t)&&(t.__proto__=D["default"],t.__ob__=t.__ob__||[],t.__cb__=t.__cb__||[],-1==t.__ob__.indexOf(n)&&(n.__ob.push(t),t.__ob__.push(n),t.__cb__.push(function(){n.__data(e)})))}},{key:"allowPropagation",get:function(){return this.__allowPropagation},set:function(e){this.__allowPropagation=e}},{key:"element",get:function(){return this.virtualDom?this.virtualDom.element:null}},{key:"style",get:function(){return this.__style},set:function(e){this.__style=e}},{key:"model",get:function(){return this.__model},set:function(e){if(!(e instanceof E["default"]))throw new Error("can not set model to a non Model: "+e);this.__model=e,e.__add(this)}},{key:"virtualDom",get:function(){return this.__virtualDom}},{key:"ref",get:function(){return this.__ref}},{key:"canData",get:function(){return this.__canData}}],[{key:"fakeDom",value:function(e){Array.isArray(e)?e.forEach(function(e){t.fakeDom(e)}):e instanceof t?e.emit(c["default"].DOM,!0):e instanceof _["default"]&&e.emit(c["default"].DOM,!0)}}]),t}(d["default"]);["__record","__unRecord","bridgeTo","unBridge","unBridgeTo"].forEach(function(e){j.prototype[e]=w["default"].prototype[e]}),t["default"]=j},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={};t["default"]={get:function(e){return n[e]},set:function(e){return n[e.__uid]=e,e}}},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function a(e,t){n(this,a),this.context=e,this.cb=t};t["default"]=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;na;a++){var o=r[a],s=o.target,u=o.name,l=o.middleware;if(!n.has(s.__uid)){n.add(s.__uid);var c=migi.CacheComponent.getSid(s);n.sid>c&&(s.__stream=n,s[u]=l?l.call(s,t):t,s.__stream=null)}}}},{key:"__record",value:function(e,t,n,r){var a=this,i=this.__bridgeHash[t]=this.__bridgeHash[t]||[];i.forEach(function(r){if(r.target==e&&r.name==n)throw new Error("duplicate bridge: "+a+"."+t+" -> "+e+"."+n)}),i.push({target:e,name:n,middleware:r})}},{key:"__unRecord",value:function(e,t,n){for(var r=this,a=r.__bridgeHash[t]||[],i=0,o=a.length;o>i;i++){var s=a[i];if(s.target==e&&s.name==n)return void a.splice(i,1)}}},{key:"bridge",value:function(e,t,n,r){var a=this;if(e==this)throw new Error("can not bridge self: "+a);if(!(e&&(e instanceof migi.Component||e instanceof migi.Model)))throw new Error("can only bridge to Component/Model: "+a);2==arguments.length?f["default"].isString(t)?a.__record(e,t,t):Object.keys(t).forEach(function(n){var r=t[n];f["default"].isString(r)?a.__record(e,n,r):r.name&&a.__record(e,n,r.name,r.middleware)}):3==arguments.length?f["default"].isString(n)?a.__record(e,t,n):(r=n,a.__record(e,t,t,r)):4==arguments.length&&a.__record(e,t,n,r)}},{key:"bridgeTo",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];e.bridge.apply(e,[this].concat(n))}},{key:"unBridge",value:function(e,t,n){var r=this;2==arguments.length?f["default"].isString(t)?r.__unRecord(e,t,t):Object.keys(t).forEach(function(n){var a=t[n];f["default"].isString(a)?r.__unRecord(e,n,a):f["default"].isFunction(a)?r.__unRecord(e,n,n):a.name&&r.__unRecord(e,n,a.name)}):r.__unRecord(e,t,n)}},{key:"unBridgeTo",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];e.unBridge.apply(e,[this].concat(n))}}]),t}(l["default"]);t["default"]=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(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 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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n-1&&this.__ref.splice(t,1)}},{key:"name",get:function(){return this.__name}}]),t}(l["default"]);["__data","__record","bridge","bridgeTo","__unRecord","unBridge","unBridgeTo","__initBind","__getBind","__setBind","__array"].forEach(function(e){h.prototype[e]=f["default"].prototype[e]}),t["default"]=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(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 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 s(e){return e instanceof A["default"]?e.name+'[migi-uid="'+e.__uid+'"]':e.replace(/(^|\s|,|])([A-Z][\w$]*)\b/,'$1[migi-name="$2"]')}function u(e,t){return l(e,t,!0)[0]||null}function l(e,t,n){return c(e,t,[],n)}function c(e,t,n,r){for(var a=0,i=t.length;i>a;a++){var o=t[a];if(o instanceof A["default"]?n=f(e,o,n,r):o instanceof S["default"]?(o=o.v,Array.isArray(o)?n=c(e,o,n,r):o instanceof A["default"]&&(n=f(e,o,n,r))):Array.isArray(o)&&(n=c(e,o,n,r)),r&&n.length)break}return n}function f(e,t,n,r){if(t instanceof T["default"])t instanceof e&&n.push(t);else{if(t instanceof e&&(n.push(t),r))return n;n=n.concat(t.findAll(e,r))}return n}function d(e){return void 0===e||null===e||!e.toString()}function h(e){if(e instanceof A["default"]||e instanceof S["default"])return e.toString();if(Array.isArray(e)){for(var t="",n=0,r=e.length;r>n;n++)t+=h(e[n]);return t}return x["default"].encodeHtml(x["default"].stringify(e))}function _(e,t){if(Array.isArray(e))for(var n=0,r=e.length;r>n;n++)_(e[n],t);else e instanceof A["default"]?e.__parent=t:e instanceof S["default"]&&_(e.v,t)}function p(e,t){if(Array.isArray(e))for(var n=0,r=e.length;r>n;n++)p(e[n],t);else e instanceof ie?e.style=t:e instanceof S["default"]&&p(e.v,t)}function v(e){var t=!0;if(Array.isArray(e))for(var n=0,r=e.length;r>n&&(t=v(e[n]),t);n++);else t=e instanceof A["default"]?!1:e instanceof S["default"]?v(e.v):d(e);return t}function y(e,t,n,r){if(Array.isArray(e))for(var a=0,i=e.length;i>a&&(y(e[a],t,n,r),!n.done);a++);else if(e instanceof A["default"]){if(t==e)return void(n.done=!0);r(e)}else e instanceof S["default"]&&y(e.v,t,n,r)}function m(e,t,n,r){if(Array.isArray(e))for(var a=0,i=e.length;i>a&&(m(e[a],t,n,r),!n.done);a++);else e instanceof A["default"]?t==e?n.start=!0:n.start&&r(e):e instanceof S["default"]&&m(e.v,t,n,r)}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(Array.isArray(e))for(var n=0,r=e.length;r>n;n++)g(e[n],t);else e instanceof A["default"]?t.push(e):e instanceof S["default"]&&g(e.v,t);return t}Object.defineProperty(t,"__esModule",{value:!0});var b=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(a(this,t),re["default"].hasOwnProperty(n)&&o.length)throw new Error("self-close tag can not has children: "+n);var s=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o)),u=s;return u.__names=null,u.__classes=null,u.__ids=null,u.__inline=null,u.__hover=!1,u.__active=!1,u.__listener=null,s}return o(t,e),b(t,[{key:"toString",value:function(){for(var e=this,t="<"+e.name,n=0,r=e.__props.length;r>n;n++){var a=e.__props[n],i=e.__renderProp(a[0],a[1]);t+=i}if(e.__style){var i=e.__match(!0);i&&(t=t.indexOf(' style="')>1?t.replace(/ style="[^"]*"/,' style="'+i+'"'):t+' style="'+i+'"')}if(t+=' migi-uid="'+e.__uid+'"',e.__checkListener(),e.__selfClose)return t+"/>";if(t+=">",e.props.dangerouslySetInnerHTML){var i=e.props.dangerouslySetInnerHTML;i=i instanceof S["default"]?i.toSourceString():Array.isArray(i)?x["default"].joinSourceArray(i):x["default"].stringify(i),t+=i}else t+=e.__renderChildren();return t+=""}},{key:"preString",value:function(){for(var e=this,t=0,n=e.__props.length;n>t;t++){var r=e.__props[t];e.__renderProp(r[0],r[1])}e.__style&&e.__match(!0),e.__checkListener(),e.__renderChildren()}},{key:"isFirst",value:function(e){if(this.parent instanceof T["default"])return!0;e=e||this.parent.children;for(var n=0,r=e.length;r>n;n++){var a=e[n];if(Array.isArray(a)&&a.length)return this.isFirst(a);if(a==this)return!0;if(a instanceof t)return!1;if(a instanceof S["default"]&&(a=a.v,Array.isArray(a)&&a.length))return this.isFirst(a)}}},{key:"isLast",value:function(e){if(this.parent instanceof T["default"])return!0;e=e||this.parent.children;for(var n=e.length-1;n>=0;n--){var r=e[n];if(Array.isArray(r)&&r.length)return this.isLast(r);if(r==this)return!0;if(r instanceof t)return!1;if(r instanceof S["default"]&&(r=r.v,Array.isArray(r)&&r.length))return this.isLast(r)}}},{key:"isEmpty",value:function(){return v(this.children)}},{key:"isEnabled",value:function(){return!this.__cache.disabled}},{key:"isDisabled",value:function(){return this.__cache.disabled}},{key:"isChecked",value:function(){return this.__cache.checked}},{key:"prev",value:function(){var e={};return y(this.parent.children,this,e,function(t){e.prev=t}),e.prev}},{key:"prevAll",value:function(e){var t={prev:[]};return y(this.parent.children,this,t,function(n){(e&&!Q["default"].nci(e,n)||!e)&&t.prev.push(n)}),t.prev}},{key:"next",value:function(){var e={};return m(this.parent.children,this,e,function(t){e.next=t,e.done=!0}),e.next}},{key:"nextAll",value:function(e){var t={next:[]};return m(this.parent.children,this,t,function(n){(e&&!Q["default"].nci(e,n)||!e)&&t.next.push(n)}),t.next}},{key:"isOnly",value:function(){return 1==this.siblings().length}},{key:"isOnlyOfType",value:function(e){for(var t=this,n=t.siblings(),r=0,a=n.length;a>r;r++){var i=n[r];if(i!=t&&!Q["default"].nci(e,i))return!1}return!0}},{key:"isFirstOfType",value:function(e){for(var t=this.prevAll(e),n=0,r=t.length;r>n;n++)if(!Q["default"].nci(e,t[n]))return!1;return!0}},{key:"isLastOfType",value:function(e){for(var t=this.nextAll(e),n=0,r=t.length;r>n;n++)if(!Q["default"].nci(e,t[n]))return!1;return!0}},{key:"siblings",value:function(){var e=this.parent,t=g(e.children);return t}},{key:"getIdx",value:function(e){var t=this.siblings(),n=t.indexOf(this);return n>-1?e?t.length-n-1:n:-1}},{key:"getIdxOfType",value:function(e,t){var n=t?this.nextAll(e):this.prevAll(e);t?n.unshift(this):n.push(this);var r=n.indexOf(this);return r>-1?t?n.length-r-1:r:-1}},{key:"closest",value:function(e){for(var t=this;t&&t!=this.top;){if(!Q["default"].nci(e,t))return t;t=t.parent}}},{key:"__renderProp",value:function(e,t){var n=this,r="";if(/^on[a-zA-Z]/.test(e))n.once(O["default"].DOM,function(r){if(!r){var a=e.slice(2).toLowerCase();n.__addEvt(a,t)}});else if(t instanceof S["default"]){if("dangerouslySetInnerHTML"==e)return"";var a=t.toString(!0);"className"==e?e="class":"htmlFor"==e&&(e="for"),n.__cache[e]=a;var i=z["default"].special(n.name,e);switch(i){case z["default"].RENDER_EXIST:t.v&&(r=" "+e+'="'+a+'"');break;case z["default"].RENDER_DOM:n.once(O["default"].DOM,function(){n.__updateAttr(e,t)});break;default:r=" "+e+'="'+a+'"'}}else{var a=Array.isArray(t)?x["default"].joinSourceArray(t):x["default"].stringify(t);if("dangerouslySetInnerHTML"==e)return"";"className"==e?e="class":"htmlFor"==e&&(e="for"),n.__cache[e]=a;var i=z["default"].special(n.name,e);switch(i){case z["default"].RENDER_EXIST:t&&(r=" "+e+'="'+x["default"].encodeHtml(a,!0)+'"');break;case z["default"].RENDER_DOM:n.once(O["default"].DOM,function(){n.__updateAttr(e,t)});break;default:r=" "+e+'="'+x["default"].encodeHtml(a,!0)+'"'}}if(n.__style)switch(e){case"class":case"id":r=" migi-"+r.slice(1)}return r}},{key:"__renderChildren",value:function(){for(var e=this,t="",n=0,r=e.children.length;r>n;n++)t+=h(e.children[n]);return t}},{key:"__checkListener",value:function(){var e=this;if("input"==e.name){if(e.props.hasOwnProperty("value")){var t=e.props.value;t instanceof S["default"]&&e.once(O["default"].DOM,function(){function n(e){q["default"](e);var n=e.target.value;t.setV(n);var r=t.k;0==r.indexOf("model.")?t.context.model[r.slice(6)]=n:t.context[r]=n}var r=e.__cache.type||"";switch(r.toLowerCase()){case"checkbox":case"radio":case"range":case"color":e.__addListener("change",n);break;default:e.__addListener(["input","paste","cut","change"],n)}})}}else if("select"==e.name){if(e.props.hasOwnProperty("value")){var t=e.props.value;t instanceof S["default"]&&e.once(O["default"].DOM,function(){function n(e){q["default"](e);var n=e.target.value;t.setV(n);var r=t.k;0==r.indexOf("model.")?t.context.model[r.slice(6)]=n:t.context[r]=n; }e.__addListener("change",n)})}}else if("textarea"==e.name&&1==e.children.length){var n=e.children[0];n instanceof S["default"]&&e.once(O["default"].DOM,function(){function t(e){q["default"](e);var t=e.target.value;n.setV(t);var r=n.k;n.context[r]=t}e.__addListener(["input","paste","cut","change"],t)})}}},{key:"__addEvt",value:function(e,t){var n=this;n.__addListener(e,function(e){q["default"](e);var r=e.target,a=r.getAttribute("migi-uid"),i=W["default"].get(a);if(t instanceof C["default"]&&x["default"].isFunction(t.cb))return t.cb.call(t.context,e,n,i);if(x["default"].isFunction(t))return t(e,n,i);if(Array.isArray(t)){var o;return t.forEach(function(t,r){var a=t[1],s=J["default"](e,t[0],n);s[0]&&(a instanceof C["default"]&&x["default"].isFunction(a.cb)?r?a.cb.call(a.context,e,n,s[1],i):o=a.cb.call(a.context,e,n,s[1],i):x["default"].isFunction(a)&&(r?a(e,n,s[1],i):o=a(e,n,s[1],i)))}),o}})}},{key:"__addListener",value:function(e,t){var n=this;if(Array.isArray(e))for(var r=0,a=e.length;a>r;r++)n.__addListener(e[r],t);else{n.__listener=n.__listener||[],"tap"==e&&(e="click");var i=n.element;if(ae.hasOwnProperty(e))return void Z["default"](this,e,t,n.__listener);if(n.__listener.push([e,t]),i.addEventListener(te["default"][e]||e,t),"load"==e&&i.complete){var o=document.createEvent("Event");o.initEvent("load",!0,!0),i.dispatchEvent(o)}}}},{key:"__removeListener",value:function(){var e=this;if(e.__listener)for(var t=e.element,n=e.__listener.length-1;n>=0;n--){var r=e.__listener[n];t.removeEventListener(r[0],r[1])}}},{key:"find",value:function(e){if(x["default"].isFunction(e))return u(e,this.children);if(this.element){var t=this.element.querySelector(s(e)),n=t.getAttribute("migi-uid");return W["default"].get(n)||null}return null}},{key:"findAll",value:function(e){if(x["default"].isFunction(e))return l(e,this.children);var t=[];if(this.element){var n=this.element.querySelectorAll(s(e));Array.from(n).forEach(function(e){if(e){var n=e.getAttribute("migi-uid"),r=W["default"].get(n)||null;r&&t.push(r)}})}return t}},{key:"__onDom",value:function(e){k(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__onDom",this).call(this);var n=this;if(e)return void T["default"].fakeDom(n.children);var r={start:0,first:!0};n.__checkBlank(n.children,r),(r.empty||r.first)&&n.__insertBlank(r.start)}},{key:"__checkBlank",value:function(e,t){var n=this;if(Array.isArray(e)&&e.length)for(var r=0,a=e.length;a>r;r++)n.__checkBlank(e[r],t);else if(e instanceof A["default"]&&!(e instanceof migi.NonVisualComponent))t.empty&&n.__insertBlank(t.start),t.start++,t.prev==I["default"].TEXT&&t.start++,t.prev=I["default"].DOM,t.empty=!1,t.first=!1,e.emit(O["default"].DOM);else if(e instanceof S["default"])n.__checkBlank(e.v,t);else if(d(e)){if(e instanceof migi.NonVisualComponent&&e.emit(O["default"].DOM),t.prev==I["default"].TEXT)return;t.empty=!0,t.prev=I["default"].TEXT,t.first=!1}else t.empty=!1,t.prev=I["default"].TEXT,t.first=!1}},{key:"__insertBlank",value:function(e){var t=document.createTextNode(""),n=this.element,r=n.childNodes,a=r.length;!a||e>=a?n.appendChild(t):n.insertBefore(t,r[e])}},{key:"__onData",value:function(e){var t=this;if(t.dom){for(var n=0,r=t.__props.length;r>n;n++){var a=t.__props[n],i=a[0];if(a=a[1],a instanceof S["default"]){var o=!1,s=Array.isArray(e)?1:0,u=Array.isArray(a.k)?2:0;switch(s|u){case 0:o=e==a.k;break;case 1:o=e.indexOf(a.k)>-1;break;case 2:o=a.k.indexOf(e)>-1;break;case 3:for(var l={},c=e.length-1;c>=0;c--)l[e[c]]=!0;for(var f=a.k,c=0,r=f.length;r>c;c++)if(l.hasOwnProperty(f[c])){o=!0;break}}if(o){var d=a.v;a.update(d)&&t.__updateAttr(i,a.v)}}}for(var h,_=[],p={start:0,record:[],first:!0},v=t.children,y=0,r=v.length;r>y;y++){var m=v[y];h=[y],t.__checkObj(e,m,_,p,h)}if(_.length){if("textarea"==t.name)return void t.__updateAttr("value",N["default"].value(_[0],t.children));for(var n=_.length-1;n>=0;n--)N["default"].update(_[n],t.children,t.element)}}}},{key:"__checkObj",value:function(e,n,r,a,i){var o=this;if(n instanceof S["default"]){var s=!1,u=Array.isArray(e)?1:0,l=Array.isArray(n.k)?2:0;switch(u|l){case 0:s=e==n.k;break;case 1:s=e.indexOf(n.k)>-1;break;case 2:s=n.k.indexOf(e)>-1;break;case 3:for(var c={},f=e.length-1;f>=0;f--)c[e[f]]=!0;for(var d=n.k,f=0,h=d.length;h>f;f++)if(c.hasOwnProperty(d[f])){s=!0;break}}if(s){var _=n.v;n.update(_)?B["default"].diff(this.element,_,n.v,r,a,i,this):o.__checkObj(e,n.v,r,a,i)}else o.__checkObj(e,n.v,r,a,i)}else if(n instanceof A["default"])delete a.t2d,delete a.d2t,n instanceof t?n.__onData(e):n.__notifyBindProperty(e),a.start++,a.first||a.prev!=I["default"].TEXT||a.start++,a.prev=I["default"].DOM;else if(Array.isArray(n))if(n.length){i.push(0);for(var f=0,h=n.length;h>f;f++){var p=n[f];i[i.length-1]=f,o.__checkObj(e,p,r,a,i)}i.pop()}else B["default"].check(a,this.element,n,r,i),N["default"].record(i,a),a.prev=I["default"].TEXT;else B["default"].check(a,this.element,n,r,i),N["default"].record(i,a),a.prev=I["default"].TEXT;a.first=!1}},{key:"__updateAttr",value:function(e,t){return"dangerouslySetInnerHTML"==e?((null===t||void 0===t)&&(t=""),this.element.innerHTML=x["default"].stringify(t),void this.__insertBlank(0)):(z["default"].update(this.name,this.element,e,t,this.__style),this.__cache[e]=t,void(this.__style&&this.__updateStyle()))}},{key:"__match",value:function(e){this.__inline=this.__cache.style||"",this.__initCI();var t=R["default"](this.__names,this.__classes,this.__ids,this.__style||{"default":{}},this,e);return t+this.__inline}},{key:"__initCI",value:function(){var e=this.parent;e instanceof t?(this.__classes=e.__classes.slice(),this.__ids=e.__ids.slice()):(this.__classes=[],this.__ids=[]),this.__classes.push(Q["default"].splitClass(this.__cache["class"])),this.__ids.push(Q["default"].preId(this.__cache.id))}},{key:"__updateStyle",value:function(e){var n=this.__match(e);if(this.element.getAttribute("style")!=n&&this.element.setAttribute("style",n),!e)for(var r=this.children.length-1;r>=0;r--){var a=this.children[r];a instanceof t&&a.__updateStyle()}}},{key:"__init",value:function(e,t){var n=this;n.__selfClose=re["default"].hasOwnProperty(e),_(t,n)}},{key:"__reset",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return k(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__reset",this).call(this,e,n,r,a),this.__init(n,a),this.__hasDes=!1,this}},{key:"__destroy",value:function(){return(this.__onHover||this.__outHover)&&this.element&&(this.element.removeEventListener("mouseenter",this.__onHover),this.element.removeEventListener("mouseleave",this.__outHover)),this.__hash={},this.__cache=null,this.__names=null,this.__classes=null,this.__ids=null,this.__inline=null,this.__hover=!1,this.__active=!1,this.__listener=null,this.__parent=null,this.__top=null,this.__dom=!1,this.__style=null,this.__element=null,this}},{key:"names",get:function(){return this.__names||(this.__names=[])}},{key:"element",get:function(){return this.__element||(this.__element=document.querySelector(this.name+'[migi-uid="'+this.__uid+'"]'))}},{key:"style",get:function(){return this.__style},set:function(e){var n=this;n.__style=e,n.parent instanceof t?n.__names=n.parent.names.slice():n.__names=[],n.__names.push(n.name);for(var r=0,a=n.children.length;a>r;r++)p(n.children[r],e)}}]),t}(A["default"]);t["default"]=ie},function(e,t){"use strict";function n(e){return"undefined"!=typeof window?document.createElement(e):void 0}Object.defineProperty(t,"__esModule",{value:!0});var r=n("div"),a=n("table"),i=n("tbody"),o=n("tr"),s=n("ul"),u=n("dl"),l=n("select"),c=n("menu");t["default"]={NODE:r,getParent:function(e){switch(e){case"td":return o;case"tr":return i;case"tbody":case"thead":case"col":return a;case"li":return s;case"dt":case"dd":return u;case"option":return l;case"menuitem":return c;default:return r}}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={};t["default"]={add:function(e,t){n[e]=t},del:function(e){var t=n[e];t&&(window.removeEventListener("mouseup",t,!0),window.removeEventListener("touchend",t,!0),window.removeEventListener("touchcancel",t,!0),window.removeEventListener("blur",t),window.removeEventListener("dragend",t),delete n[e])}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t-r>1){a(e,t,n,r+1);for(var i=0,o=n.length;o>i;i++)n.push(n[i]+"."+e[r])}return n.push("."+e[r]),n}function i(e,t){if("odd"==t){if(e%2==1)return!1}else if("even"==t){if(e%2==0)return!1}else if(/^\d+$/.test(t)){if(e!=t-1)return!1}else{for(var n=/(\d+)?n(?:\+(\d+))?/.exec(t),r=!1,a=0;a<=Math.ceil(e/n[1]);a++)if((n[1]||1)*a+(n[2]||0)==e+1){r=!0;break}if(!r)return!1}return!0}Object.defineProperty(t,"__esModule",{value:!0});var o=n(14),s=r(o);t["default"]={splitClass:function(e){return e=(e||"").trim(),e?(e=e.split(/\s+/),s["default"](e,function(e,t){return e>t}),e):""},preId:function(e){return(void 0===e||null===e)&&(e=""),e=e.toString().trim(),e?"#"+e:""},combo:function u(e,t,n,r){var i=0,o=0;if(e&&e.length){var s=a(e,e.length);o=1}var u=[t];n&&(i=2);var l=r.hasOwnProperty("_*."),c=r.hasOwnProperty("_*#"),f=r.hasOwnProperty("_*.#");return r.hasOwnProperty("_*")&&u.push("*"),o&&s.forEach(function(e){u.push(e),u.push(t+e),l&&u.push("*"+e),i&&(u.push(e+n),u.push(t+e+n),f&&u.push("*"+e+n))}),i&&(u.push(n),u.push(t+n),c&&u.push("*"+n)),u},pseudo:function l(e,t,n){for(var r=0,a=e.length;a>r;r++){var l=e[r];switch(l){case"hover":if(!t.__hover)return!1;break;case"active":if(!t.__active)return!1;break;case"first-child":if(!t.isFirst())return!1;break;case"last-child":if(!t.isLast())return!1;break;case"empty":if(!t.isEmpty())return!1;break;case"enabled":if(!t.isEnabled())return!1;break;case"disabled":if(!t.isDisabled())return!1;break;case"checked":if(!t.isChecked())return!1;break;case"only-child":if(!t.isOnly())return!1;break;case"only-of-type":if(!t.isOnlyOfType(n))return!1;break;case"first-of-type":if(!t.isFirstOfType(n))return!1;break;case"last-of-type":if(!t.isLastOfType(n))return!1;break;default:if(0==l.indexOf("nth-child")){var o=t.getIdx(),s=/\((.+)\)/.exec(l)[1];if(!i(o,s))return!1}else if(0==l.indexOf("nth-last-child")){var o=t.getIdx(!0),s=/\((.+)\)/.exec(l)[1];if(!i(o,s))return!1}else if(0==l.indexOf("nth-of-type")){var o=t.getIdxOfType(n),s=/\((.+)\)/.exec(l)[1];if(!i(o,s))return!1}else{if(0!=l.indexOf("nth-last-of-type"))return!1;var o=t.getIdxOfType(n,!0),s=/\((.+)\)/.exec(l)[1];if(!i(o,s))return!1}}}return!0},attr:function c(e,t){var n=!0;e:for(var r=0,a=e.length;a>r;r++){var c=e[r];if(1==c.length){if(!t.__cache.hasOwnProperty(c[0])){n=!1;break}}else{var i=t.__cache[c[0]];if(void 0===i){n=!1;break}var o=c[2];switch(c[1]){case"=":n=i==o;break;case"^=":n=0==i.indexOf(o);break;case"$=":n=i.length>=o.length&&i.indexOf(o)==i.length-o.length;break;case"~=":var s=new RegExp("\\b"+o+"\\b");n=s.test(i);break;case"*=":n=i.indexOf(o)>-1;break;case"|=":n=0==i.indexOf(o)||0==i.indexOf(o+"-");break;default:n=!1;break e}if(!n)break}}return n},nci:function(e,t){var n=/^[a-z\d]+/i.exec(e);if(n&&n[0].toUpperCase()!=t.__name.toUpperCase())return!0;var r=e.match(/\.[a-z\d_-]+/gi);if(r&&t.__cache["class"])for(var a=r.length-1;a>=0;a--)if(!new RegExp("\\b"+r[a].slice(1)+"\\b","i").test(t.__cache["class"]))return!0;var i=/#[a-z\d_-]+/i.exec(e);return i&&t.__cache.id&&i[0].toUpperCase()!=t.__cache.id.toUpperCase()?!0:void 0}}},function(e,t){"use strict";function n(e,t,a,i){if(!(t>=a)){for(var o=t,s=a,u=o,l=e[u],c=!0;s>o;)if(c){for(;s>o;s--)if(i.call(e,l,e[s])){r(e,u,s),u=s,c=!c,o++;break}}else for(;s>o;o++)if(i.call(e,e[o],l)){r(e,u,o),u=o,c=!c,s--;break}n(e,t,u-1,i),n(e,u+1,a,i)}}function r(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t){if(!Array.isArray(e))throw new Error("quick sort need an array");return e.length<2?e:(t=t||function(){},n(e,0,e.length-1,t),e)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={TEXT:1,DOM:2}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(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 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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;no;o++)r[o]=arguments[o];var s=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return s.__handler={},s.__ccb=!1,s.__handler2={},s.__timeout,s.__timecb,s}return o(t,e),s(t,[{key:"__data",value:function(e){var n=this;n.dom&&(n.__canData=!0),Array.isArray(e)||(e=[e]),e.forEach(function(e){if(n.__handler.hasOwnProperty(e)){var t=n.__handler[e];if(n.__stream)t instanceof p["default"]?t.sidt&&(n.__handler[e]=r)}}else n.__handler[e]=n.__stream||p["default"].gen()}),n.__ccb||(n.__ccb=!0,n.__timeout=setTimeout(n.__timecb=function(){n.__ccb=!1;var e=n.__handler,r=Object.keys(e);n.__handler={},r.forEach(function(t){var r=e[t];n.__handler2[t]=r.sid||r}),r.length&&(n.__onData(r),n.emit(l["default"].DATA,r.length>1?r:r[0]),r.forEach(function(r){var a=e[r];if(a instanceof p["default"]){if(n.__bridgeHash){var i=n.__bridgeHash[r];i&&i.forEach(function(e){var i=e.target,o=e.name,s=e.middleware;if(!a.has(i.__uid)){a.add(i.__uid);var u=t.getSid(i,o);a.sid>u&&(i.__stream=a,i[o]=s?s.call(n,n[r]):n[r],i.__stream=null)}})}}else if(n.__bridgeHash){var i=n.__bridgeHash[r];i&&(a=new p["default"](n.__uid,e[r]),i.forEach(function(e){var i=e.target,o=e.name,s=e.middleware;if(a.add(i.__uid),i instanceof h["default"])i.emit(l["default"].DATA,o,s?s.call(n,n[r]):n[r],a);else{var u=t.getSid(i,o);a.sid>u&&(i.__stream=a,i[o]=s?s.call(n,n[r]):n[r],i.__stream=null)}}))}}))},0))}},{key:"flush",value:function(){this.__timeout&&(clearTimeout(this.__timeout),this.__ccb=!1,this.__timecb())}}],[{key:"getSid",value:function(e,n){if(e instanceof t||e instanceof y["default"]){var r=e.__handler[n]||e.__handler2[n]||0;return r.sid||r}return 0}}]),t}(f["default"]);t["default"]=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(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 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)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(9),u=r(s),l=n(16),c=r(l),f=function(e){function t(){a(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.__handler={},e.__ccb=!1,e.__handler2={},e.__timeout,e.__timecb,e}return o(t,e),t}(u["default"]);f.prototype.__data=c["default"].prototype.__data,t["default"]=f},function(e,t){"use strict";function n(e,t){function r(e,t){return function(){return e.apply(t,arguments)}}var a;if(t=t||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=t.touchBoundary||10,this.layer=e,this.tapDelay=t.tapDelay||200,this.tapTimeout=t.tapTimeout||700,!n.notNeeded(e)){for(var o=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],s=this,u=0,l=o.length;l>u;u++)s[o[u]]=r(s[o[u]],s);i&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,r){var a=Node.prototype.removeEventListener;"click"===t?a.call(e,t,n.hijacked||n,r):a.call(e,t,n,r)},e.addEventListener=function(t,n,r){var a=Node.prototype.addEventListener;"click"===t?a.call(e,t,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),r):a.call(e,t,n,r)}),"function"==typeof e.onclick&&(a=e.onclick,e.addEventListener("click",function(e){a(e)},!1),e.onclick=null)}}Object.defineProperty(t,"__esModule",{value:!0});var r="undefined"!=typeof window?navigator.userAgent:"",a=r.indexOf("Windows Phone")>=0,i=r.indexOf("Android")>0&&!a,o=/iP(ad|hone|od)/.test(r)&&!a,s=o&&/OS 4_\d(_\d)?/.test(r),u=o&&/OS [6-7]_\d/.test(r),l=r.indexOf("BB10")>0;n.prototype.needsClick=function(e){switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(o&&"file"===e.type||e.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(e.className)||/\bneedsclick\b/.test(e.getAttribute("migi-class"))},n.prototype.needsFocus=function(e){switch(e.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!i;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return/\bneedsfocus\b/.test(e.className)}},n.prototype.sendClick=function(e,t){var n,r;i&&document.activeElement&&document.activeElement!==e&&document.activeElement.blur(),r=t.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(e),!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,e.dispatchEvent(n)},n.prototype.determineEventType=function(e){return i&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},n.prototype.focus=function(e){var t;o&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type&&"month"!==e.type&&"number"!==e.type&&"email"!==e.type&&"range"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},n.prototype.updateScrollParent=function(e){var t,n;if(t=e.fastClickScrollParent,!t||!t.contains(e)){n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.fastClickScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.fastClickLastScrollTop=t.scrollTop)},n.prototype.getTargetElementFromEventTarget=function(e){return e.nodeType===Node.TEXT_NODE?e.parentNode:e},n.prototype.onTouchStart=function(e){var t,n,r;if(e.targetTouches.length>1)return!0;if(t=this.getTargetElementFromEventTarget(e.target),n=e.targetTouches[0],o){if(r=window.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;if(!s){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return e.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(t)}}return this.trackingClick=!0,this.trackingClickStart=e.timeStamp,this.targetElement=t,this.touchStartX=n.pageX,this.touchStartY=n.pageY,e.timeStamp-this.lastClickTimen||Math.abs(t.pageY-this.touchStartY)>n?!0:!1},n.prototype.onTouchMove=function(e){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(e.target)||this.touchHasMoved(e))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},n.prototype.findControl=function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},n.prototype.onTouchEnd=function(e){var t,n,r,a,l,c=this.targetElement;if(!this.trackingClick)return!0;if(e.timeStamp-this.lastClickTimethis.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=e.timeStamp,n=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,u&&(l=e.changedTouches[0],c=document.elementFromPoint(l.pageX-window.pageXOffset,l.pageY-window.pageYOffset)||c,c.fastClickScrollParent=this.targetElement.fastClickScrollParent),r=c.tagName.toLowerCase(),"label"===r){if(t=this.findControl(c)){if(this.focus(c),i)return!1;c=t}}else if(this.needsFocus(c))return e.timeStamp-n>100||o&&window.top!==window&&"input"===r?(this.targetElement=null,!1):(this.focus(c),this.sendClick(c,e),o&&"select"===r||(this.targetElement=null,e.preventDefault()),!1);return o&&!s&&(a=c.fastClickScrollParent,a&&a.fastClickLastScrollTop!==a.scrollTop)?!0:(this.needsClick(c)||(e.preventDefault(),this.sendClick(c,e)),!1)},n.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},n.prototype.onMouse=function(e){return this.targetElement?"canvas"==this.targetElement.nodeName.toLowerCase()?!0:e.forwardedTouchEvent?!0:e.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(e.stopImmediatePropagation?e.stopImmediatePropagation():e.propagationStopped=!0,e.stopPropagation(),e.preventDefault(),!1):!0:!0},n.prototype.onClick=function(e){if(!this.targetElement&&!e.forwardedTouchEvent)return e.stopImmediatePropagation?e.stopImmediatePropagation():e.propagationStopped=!0,e.stopPropagation(),e.preventDefault(),!1;var t;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===e.target.type&&0===e.detail?!0:(t=this.onMouse(e),t||(this.targetElement=null),t)},n.prototype.destroy=function(){var e=this.layer;i&&(e.removeEventListener("mouseover",this.onMouse,!0),e.removeEventListener("mousedown",this.onMouse,!0),e.removeEventListener("mouseup",this.onMouse,!0)),e.removeEventListener("click",this.onClick,!0),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchcancel",this.onTouchCancel,!1)},n.notNeeded=function(e){var t,n,a,o;if("undefined"==typeof window.ontouchstart)return!0;if(n=+(/Chrome\/([0-9]+)/.exec(r)||[,0])[1]){if(!i)return!0;if(t=document.querySelector("meta[name=viewport]")){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(n>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(l&&(a=r.match(/Version\/([0-9]*)\.([0-9]*)/),a[1]>=10&&a[2]>=3&&(t=document.querySelector("meta[name=viewport]")))){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===e.style.msTouchAction||"manipulation"===e.style.msTouchAction?!0:(o=+(/Firefox\/([0-9]+)/.exec(r)||[,0])[1],o>=27&&(t=document.querySelector("meta[name=viewport]"),t&&(-1!==t.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===e.style.touchAction||"manipulation"===e.style.touchAction?!0:!1)},n.attach=function(e,t){return new n(e,t)},t["default"]=n},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;nl;l++){var d=u[l];if(a.hasOwnProperty(d)){var h=a[d];if(e){o(e-1,t,n,r,h,i.parent);for(var _=e-2;_>=0;_--)o(_,t,n,r,h,i.parent)}if(h.hasOwnProperty("_v"))return void(s=!0);if(h.hasOwnProperty("_:")||h.hasOwnProperty("_[")){var p,v=function(a){if(a&&a.hasOwnProperty("_[")){var u=a["_["];u.forEach(function(a){var l=f["default"].attr(a[0],i);l&&(u=a[1],e&&o(e-1,t,n,r,u,i.parent),u.hasOwnProperty("_v")&&(s=!0))})}};h.hasOwnProperty("_:")&&(p=h["_:"],p.forEach(function(a){var u=f["default"].pseudo(a[0],i,d);u&&(p=a[1],e&&o(e-1,t,n,r,p,i.parent),p.hasOwnProperty("_v")&&(s=!0))})),v(h),v(p)}if(h.hasOwnProperty("_>")){var p=h["_>"];o(e-1,t,n,r,p,i.parent)}if(h.hasOwnProperty("_+")){var p=h["_+"],y=i.prev();y&&Object.keys(p).forEach(function(a){return f["default"].nci(a,y)?void 0:p[a].hasOwnProperty("_v")?void(s=!0):void o(e-1,t,n,r,p[a],i.parent)})}if(h.hasOwnProperty("_~")){var p=h["_~"],m=i.prevAll();if(m.length)for(var g=!1,l=m.length-1;l>=0;l--){var y=m[l];if(Object.keys(p).forEach(function(a){if(!f["default"].nci(a,y)){if(p[a].hasOwnProperty("_v"))return void(s=!0);g=!0,o(e-1,t,n,r,p[a],i.parent)}}),g)break}}}}}Object.defineProperty(t,"__esModule",{value:!0});var s,u=n(5),l=r(u),c=n(13),f=r(c);t["default"]=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){3==e.target.nodeType&&(e.target=e.target.parentNode)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,n,r,a,o){var u=[];if(i(e.length-1,e,t,n,r["default"],a,u,o),r.media&&(r.media.forEach(function(r){var l=!1;r.query.forEach(function(c){if(!l)for(var f=0,d=c.length;d>f;f++){var h=c[f];if(Array.isArray(h)){var _=h[0].replace(/^-[a-z]+-/i,"").replace(/^mso-/i,"").toLowerCase(),p=h[1];if(/(px|\d)$/.test(p))switch(p=p.replace(/px$/,""),_){case"width":case"height":var v=s(_);if(v==p)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o);break;case"min-width":case"max-width":case"min-height":case"max-height":var v=s(_.slice(4));if(0==_.indexOf("min-")){if(v>=p)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o)}else if(p>=v)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o);break;case"device-width":case"device-height":var v=window.screen[_.slice(7)];v==p&&(l=!0,i(e.length-1,e,t,n,r.style,a,u,o));break;case"min-device-width":case"min-device-height":case"max-device-width":case"max-device-height":var v=window.screen[_.slice(11)];if(0==_.indexOf("min-")){if(v>=p)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o)}else if(p>=v)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o);break;case"aspect-ratio":var y=s("width"),m=s("height"),v=y/m,g=p.split("/");if(g=g[0]/g[1],v==g)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o);break;case"min-aspect-ratio":case"max-aspect-ratio":var y=s("width"),m=s("height"),v=y/m,g=p.split("/");if(g=g[0]/g[1],0==_.indexOf("min-")){if(v>=p)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o)}else if(p>=v)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o);break;case"device-aspect-ratio":var y=window.screen.width,m=window.screen.height,v=y/m,g=p.split("/");if(g=g[0]/g[1],v==g)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o);break;case"min-device-aspect-ratio":case"max-device-aspect-ratio":var y=window.screen.width,m=window.screen.height,v=y/m,g=p.split("/");if(g=g[0]/g[1],0==_.indexOf("min-")){if(v>=p)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o)}else if(p>=v)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o);break;case"device-pixel-ratio":var v=window.devicePixelRatio;if(v==p)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o);break;case"min-device-pixel-ratio":case"max-device-pixel-ratio":var v=window.devicePixelRatio;if(0==_.indexOf("min-")){if(v>=p)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o)}else if(p>=v)return l=!0,void i(e.length-1,e,t,n,r.style,a,u,o)}}}})}),o)){var l,c=function(){l&&clearTimeout(l),l=setTimeout(function(){h["default"].get(a.__uid).__updateStyle()},100)};window.addEventListener("resize",c),p["default"].add(a.__uid,c)}f["default"](u,function(e,t){var n=e[2],r=t[2];if(n==r)return e[0]>t[0];for(var a=0;3>a;a++)if(n[a]!=r[a])return n[a]>r[a];return e[0]>t[0]});var d="";return u.forEach(function(e){d+=e[1]+";"}),d}function i(e,t,n,r,a,s,u,c,f){for(var d=y["default"].combo(n[e],t[e],r[e],a),_=0,v=d.length;v>_;_++){var m=d[_];if(a.hasOwnProperty(m)){var g=a[m];if(e&&(i(e-1,t,n,r,g,s.parent,u,c),!f))for(var b=e-2;b>=0;b--)i(b,t,n,r,g,s.parent,u,c);if(g.hasOwnProperty("_v")&&o(u,g),c&&g.hasOwnProperty("_:")&&g["_:"].forEach(function(e){e[0].forEach(function(e){var t=s.__uid;switch(e){case"hover":var n=function(){h["default"].get(t).__hover=!0, h["default"].get(t).__updateStyle()},r=function(){h["default"].get(t).__hover=!1,h["default"].get(t).__updateStyle()},a=function(){s.element.addEventListener("mouseenter",n),s.element.addEventListener("mouseleave",r)};s.__dom?a():s.once(l["default"].DOM,a),s.__onHover=n,s.__outHover=r;break;case"active":var i=function(){h["default"].get(t).__active=!0,h["default"].get(t).__updateStyle()},o=function(){h["default"].get(t).__active=!1,h["default"].get(t).__updateStyle()},u=function(){s.element.addEventListener("mousedown",i),window.addEventListener("mouseup",o,!0),window.addEventListener("touchend",o,!0),window.addEventListener("touchcancel",o,!0),window.addEventListener("blur",o),window.addEventListener("dragend",o)};s.__dom?u():s.once(l["default"].DOM,u),p["default"].add(t,o)}})}),g.hasOwnProperty("_:")||g.hasOwnProperty("_[")){var k,w=function(a){if(a&&a.hasOwnProperty("_[")){var l=a["_["];l.forEach(function(a){var f=y["default"].attr(a[0],s);f&&(l=a[1],e&&i(e-1,t,n,r,l,s.parent,u,c),l.hasOwnProperty("_v")&&o(u,l))})}};g.hasOwnProperty("_:")&&(k=g["_:"],k.forEach(function(a){var l=y["default"].pseudo(a[0],s,m);l&&(k=a[1],e&&i(e-1,t,n,r,k,s.parent,u,c),k.hasOwnProperty("_v")&&o(u,k))})),w(g),w(k)}if(g.hasOwnProperty("_>")){var k=g["_>"];i(e-1,t,n,r,k,s.parent,u,!1,f)}if(g.hasOwnProperty("_+")){var k=g["_+"],O=s.prev();O&&Object.keys(k).forEach(function(a){y["default"].nci(a,O)||(k[a].hasOwnProperty("_v")&&o(u,k[a]),i(e-1,t,n,r,k[a],s.parent,u,!1,f))})}if(g.hasOwnProperty("_~")){var k=g["_~"],E=s.prevAll();if(E.length)for(var A=!1,_=E.length-1;_>=0;_--){var O=E[_];if(Object.keys(k).forEach(function(a){y["default"].nci(a,O)||(k[a].hasOwnProperty("_v")&&o(u,k[a]),A=!0,i(e-1,t,n,r,k[a],s.parent,u,!1,f))}),A)break}}}}}function o(e,t){t._v.forEach(function(n){n[2]=t._p,e.push(n)})}function s(e){var t=e.charAt(0).toUpperCase()+e.slice(1);return window["inner"+t]||document.documentElement["client"+t]||document.body["client"+t]}Object.defineProperty(t,"__esModule",{value:!0});var u=n(1),l=r(u),c=n(14),f=r(c),d=n(5),h=r(d),_=n(12),p=r(_),v=n(13),y=r(v);t["default"]=a},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,n){for(var r="",o=e.shift(),s=t.length;s>o;o++){var u=t[o];if(e.length){if(r+=u instanceof h["default"]?a(e,u.v,n):a(e,u,n),n.end)break}else if(u instanceof h["default"])if(Array.isArray(u.v)){if(r+=i(u.v,n),n.end)break}else{if(u.v instanceof c["default"]){n.end=!0;break}r+=u.toSourceString()}else{if(u instanceof c["default"]){n.end=!0;break}if(Array.isArray(u)){if(r+=i(u,n),n.end)break}else r+=p["default"].stringify(u)}}return r}function i(e,t){for(var n="",r=0,a=e.length;a>r;r++){var o=e[r];if(t.end)break;if(Array.isArray(o))n+=i(o,t);else{if(o instanceof c["default"]){t.end=!0;break}n+=p["default"].stringify(o)}}return n}function o(e,t,n){var r=a(e.index,t,{}),i=n.childNodes,o=i[e.start];if(1!=o.nodeType){var s=o.textContent;r!=s&&(o.textContent=r)}}function s(e,t){return a(e.index,t,{})}function u(e,t){(t.first||t.prev==m["default"].DOM)&&(t.record=e.slice())}Object.defineProperty(t,"__esModule",{value:!0});var l=n(3),c=r(l),f=n(10),d=(r(f),n(7)),h=r(d),_=n(2),p=r(_),v=n(11),y=(r(v),n(15)),m=r(y);t["default"]={update:o,value:s,record:u}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={img:!0,meta:!0,link:!0,br:!0,basefont:!0,base:!0,col:!0,embed:!0,frame:!0,hr:!0,input:!0,keygen:!0,area:!0,param:!0,source:!0,track:!0,wbr:!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(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 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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;no;o++)r[o]=arguments[o];return i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)))}return o(t,e),s(t,[{key:"toString",value:function(){return""}},{key:"__onDom",value:function(){this.__dom=!0,l["default"].fakeDom(this.children)}}]),t}(l["default"]);t["default"]=c},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Array.prototype,r=Object.create(n);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(e){var t=n[e];Object.defineProperty(r,e,{value:function(){for(var e=arguments.length,n=new Array(e);e--;)n[e]=arguments[e];var r=t.apply(this,n);return Array.isArray(this.__cb__)&&this.__cb__.forEach(function(e){e()}),r}})}),t["default"]=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,n,r,a){var i;if(a){var o=E["default"].stringify(r);i=document.createTextNode(o||""),n>=t.length?e.appendChild(i):e.replaceChild(i,t[n]),r instanceof migi.NonVisualComponent&&r.emit(v["default"].DOM)}else{if(i=r.toString(),n>=t.length)e.insertAdjacentHTML("beforeend",i);else if(1==t[n].nodeType)t[n].insertAdjacentHTML("afterend",i),e.removeChild(t[n]);else{var s=P["default"].getParent(r.name);s.innerHTML=i,e.replaceChild(s.firstChild,t[n])}r.emit(v["default"].DOM)}}function i(e,t,n,r,a){var i;if(a){var o=E["default"].stringify(r);i=document.createTextNode(o||""),n>=t.length?e.appendChild(i):e.insertBefore(i,t[n]),r instanceof migi.NonVisualComponent&&r.emit(v["default"].DOM)}else{if(i=r.toString(),n>=t.length)e.insertAdjacentHTML("beforeend",i);else if(1==t[n].nodeType)t[n].insertAdjacentHTML("beforebegin",i);else{var s=P["default"].getParent(r.name);s.innerHTML=i,e.insertBefore(s.firstChild,t[n])}r.emit(v["default"].DOM)}}function o(e,t,n,r,a,s,u,l){if(Array.isArray(t)){a.push(0);for(var f=0,d=Math.max(t.length,1);d>f;f++){var h=t[f];a[a.length-1]=f,o(e,h,n,r,a,s,u&&f==d-1,l)}a.pop()}else if(t instanceof m["default"]&&!(t instanceof migi.NonVisualComponent)){if(t.__parent=l,t.__top=l.top,t.style=l.style,L["default"].set(t),s.hasOwnProperty("prev")){if(r.prev==j["default"].TEXT&&r.start++,i(e,e.childNodes,r.start++,t),u)switch(s.state){case Y:case I:r.t2d=!0;break;default:delete r.d2t}}else{switch(s.state=r.state,r.state){case I:r.start++;break;case Y:c(n,r),r.start++,r.t2d=!0;break;case q:r.t2d=!0}i(e,e.childNodes,r.start++,t)}s.d=!0,s.prev=r.prev=j["default"].DOM,r.state=V}else{if(s.hasOwnProperty("prev")){if(r.prev==j["default"].DOM?(M["default"].record(a,r),i(e,e.childNodes,r.start,t,!0)):c(n,r),u&&s.d)switch(c(n,r),s.state){case V:case q:delete r.t2d;break;default:delete r.d2t}}else switch(_(r,e,t,n,a),s.state=r.state,r.state){case I:r.d2t=!0;case Y:c(n,r);break;case q:M["default"].record(a,r),i(e,e.childNodes,r.start,t,!0),c(n,r);break;case V:M["default"].record(a,r),i(e,e.childNodes,r.start,t,!0),r.d2t=!0}s.prev=r.prev=j["default"].TEXT,r.state=Y}}function s(e,t,n,r,a,i){if(Array.isArray(t))for(var o=0,l=t.length;l>o;o++)s(e,t[o],n,r,a,i&&o==l-1);else if(t instanceof m["default"]&&!(t instanceof migi.NonVisualComponent)){if(a.hasOwnProperty("prev")){if(a.prev==j["default"].TEXT?(a.d&&u(e,r.start+1),u(e,r.start+1)):r.prev==j["default"].TEXT?u(e,r.start+1):u(e,r.start),i)switch(r.state){case Y:case I:r.d2t=!0;break;default:delete r.t2d}}else switch(r.state){case I:u(e,r.start+1),r.state=Y,r.prev=j["default"].TEXT,r.d2t=!0;break;case Y:u(e,r.start+1),r.prev=j["default"].TEXT,r.d2t=!0;break;case q:u(e,r.start),r.state=V,r.prev=j["default"].DOM;break;case V:u(e,r.start),r.prev=j["default"].DOM}a.d=!0,a.prev=j["default"].DOM,D["default"].add(t.__destroy())}else{if(a.hasOwnProperty("prev")){if(a.prev==j["default"].DOM&&c(n,r),i&&a.d)switch(u(e,r.start+1),r.state){case V:case q:r.t2d=!0;break;default:delete r.d2t}}else switch(r.state){case I:u(e,r.start+1),c(n,r),r.state=Y,r.prev=j["default"].TEXT;break;case Y:c(n,r),r.prev=j["default"].TEXT;break;case V:u(e,r.start),r.state=V,r.prev=j["default"].DOM,r.t2d=!0;break;case q:r.prev=j["default"].DOM,r.t2d=!0}a.prev=j["default"].TEXT}}function u(e,t){e.childNodes[t]&&e.removeChild(e.childNodes[t])}function l(e,t){return(void 0===e||null===e)&&(e=""),(void 0===t||null===t)&&(t=""),e.toString()==t.toString()}function c(e,t){var n=e.length;(!n||e[n-1].start=0;a--){var i=r[a];t[i]=e[i]}L["default"].set(t);var o={};for(a=e.__props.length-1;a>=0;a--){var s=e.__props[a],i=s[0],u=s[1];if(0!=i.indexOf("on")||"on"==i)if(o[i]=!0,t.props.hasOwnProperty(i)){var l=t.props[i];l!==u&&t.__updateAttr(i,l),t.__cache[i]=l}else t.__updateAttr(i,null),delete t.__cache[i]}e.__removeListener();var c=t.__props.length,f=function(){s=t.__props[a],i=s[0];var e=s[1];0==i.indexOf("on")&&"on"!=i?(d=i.slice(2).toLowerCase(),t.__addListener(d,function(n){n=n||window.event,F["default"](n);var r=n.target,a=r.getAttribute("migi-uid"),i=L["default"].get(a);e instanceof w["default"]?e.cb.call(e.context,n,t,i):E["default"].isFunction(e)?e(n,t,i):Array.isArray(e)&&e.forEach(function(e){var r=e[1];X["default"](n,e[0],t)&&(r instanceof w["default"]?r.cb.call(r.context,n,t,i):E["default"].isFunction(r)&&r(n,t,i))})})):o.hasOwnProperty(i)||t.__updateAttr(i,e)};for(a=0;c>a;a++){var s,i,d;f()}t.__style&&t.__updateStyle(!0);var _=[];if(h(n,e.children,t.children,_,{start:0,record:[],first:!0},[],t),_.length){if("textarea"==t.name)return void t.__updateAttr("value",M["default"].value(_[0],t.children));for(a=_.length-1;a>=0;a--)M["default"].update(_[a],t.children,n)}D["default"].add(e.__destroy())}}function d(e,t,n,r,a,i,o){a.first||(a.prev==j["default"].TEXT?a.state=Y:a.state=V),h(e,t,n,r,a,i,o),a.t2d||a.d2t||(a.state==q?a.t2d=!0:a.state==I&&(a.d2t=!0))}function h(e,t,n,r,u,d,p){var y=Array.isArray(t),g=Array.isArray(n);if(y&&g){var k=t.length,w=n.length,O=k?1:0,E=w?2:0;switch(d.push(0),u.first&&M["default"].record(d,u),O|E){case 0:u.state==q&&i(e,e.childNodes,u.start++,n,!0),u.state=Y,u.prev=j["default"].TEXT;break;case 1:h(e,t[0],n[0],r,u,d,p);for(var A={},P=1;k>P;P++)s(e,t[P],r,u,A,P==k-1);break;case 2:h(e,t[0],n[0],r,u,d,p);for(var A={},P=1;w>P;P++)d[d.length-1]=P,o(e,n[P],r,u,d,A,P==w-1,p);break;case 3:for(var P=0,T=Math.min(k,w);T>P;P++)d[d.length-1]=P,h(e,t[P],n[P],r,u,d,p);var A={};if(k>P)for(;k>P;P++)s(e,t[P],r,u,A,P==k-1);else if(w>P)for(;w>P;P++)d[d.length-1]=P,o(e,n[P],r,u,d,A,P==w-1,p)}d.pop()}else if(y){h(e,t[0],n,r,u,d,p);for(var A={},P=1,T=t.length;T>P;P++)s(e,t[P],r,u,A,P==T-1)}else if(g){d.push(0),h(e,t,n[0],r,u,d,p);for(var A={},P=1,T=n.length;T>P;P++)d[d.length-1]=P,o(e,n[P],r,u,d,A,P==T-1,p);d.pop()}else{var x=t instanceof m["default"]&&!(t instanceof migi.NonVisualComponent)?1:0,S=n instanceof m["default"]&&!(n instanceof migi.NonVisualComponent)?2:0;switch(x|S){case 0:u.first||_(u,e,n,r,d),M["default"].record(d,u);var C=e.childNodes;if(u.first)l(t,n)||c(r,u);else if(l(t,n))switch(u.state){case I:c(r,u),e.removeChild(C[u.start+1]);break;case q:c(r,u),i(e,C,u.start,n,!0)}else switch(u.state){case I:c(r,u),e.removeChild(C[u.start+1]);break;case q:c(r,u),i(e,C,u.start,n,!0);break;case V:M["default"].record(d,u);case Y:l(t,n)||c(r,u)}u.state=Y,u.prev=j["default"].TEXT;break;case 1:t.__delRef(),M["default"].record(d,u);var C=e.childNodes;if(u.first)a(e,C,u.start,n,!0);else switch(u.state){case I:case Y:c(r,u),e.removeChild(C[u.start+1]);break;case q:case V:a(e,C,u.start,n,!0)}D["default"].add(t.__destroy()),u.state=I,u.prev=j["default"].TEXT;break;case 2:n.__parent=p,n.__top=p.top,n.style=p.style,L["default"].set(n);var C=e.childNodes;if(u.first)a(e,C,u.start++,n);else switch(u.state){case I:u.start++;case V:a(e,C,u.start++,n);break;case q:i(e,C,u.start++,n);break;case Y:c(r,u),i(e,C,++u.start,n),u.start++}u.state=q,u.prev=j["default"].DOM;break;case 3:if(!u.first){switch(u.state){case I:case Y:u.start++}delete u.t2d,delete u.d2t}var N=t instanceof b["default"]?1:0,R=n instanceof b["default"]?2:0;switch(N|R){case 0:t.__delRef(),t.name==n.name?(t.__parent=p,t.__top=p.top,f(t,n),n.__saveRef()):(n.__parent=p,n.__top=p.top,n.style=p.style,e=t.element,e.insertAdjacentHTML("afterend",n.toString()),e.parentNode.removeChild(e),n.emit(v["default"].DOM),H["default"].del(t.__uid),L["default"].set(n),D["default"].add(t.__destroy()));break;default:t.__delRef(),e=t.element,e.insertAdjacentHTML("afterend",n.toString()),e.parentNode.removeChild(e),n.__parent=p,n.__top=p.top,N?H["default"].del(t.virtualDom.__uid):H["default"].del(t.__uid),n.style=p.style,n.emit(v["default"].DOM),L["default"].set(n),D["default"].add(t.__destroy())}u.state=V,u.prev=j["default"].DOM,u.start++}n instanceof migi.NonVisualComponent&&n.emit(v["default"].DOM)}u.first=!1}function _(e,t,n,r,a){e.t2d?(delete e.t2d,M["default"].record(a,e),i(t,t.childNodes,e.start,n,!0)):e.d2t&&(delete e.d2t,c(r,e),u(t,e.start+1))}Object.defineProperty(t,"__esModule",{value:!0});var p=n(1),v=r(p),y=n(3),m=r(y),g=n(4),b=r(g),k=n(6),w=r(k),O=n(2),E=r(O),A=n(11),P=r(A),T=n(25),M=r(T),x=n(21),D=r(x),S=n(15),j=r(S),C=n(5),L=r(C),N=n(12),H=r(N),R=n(23),F=r(R),B=n(22),X=r(B),I=0,V=1,q=2,Y=3;t["default"]={diff:d,check:_}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={domactivate:"DOMActivate",domfocusin:"DOMFocusIn",msgestureend:"MSGestureEnd",mspointerdown:"MSPointerDown",mspointermove:"MSPointerMove",mspointerup:"MSPointerUp",mspointercancel:"MSPointerCancel"}},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),i=r(a),o=n(3),s=r(o),u=n(8),l=r(u),c=n(9),f=r(c),d=n(17),h=r(d),_=n(4),p=r(_),v=n(10),y=r(v),m=n(27),g=r(m),b=n(16),k=r(b),w=n(7),O=r(w),E=n(6),A=r(E),P=n(21),T=r(P),M=n(2),x=r(M),D=n(11),S=r(D),j=n(14),C=r(j),L=n(5),N=r(L),H=n(24),R=r(H),F=n(12),B=r(F),X=n(20),I=r(X),V=n(26),q=r(V),Y=n(18),z=r(Y),U={uid:0,render:function(e,t){return t&&e.appendTo(t),e},preRender:function(e){return e.toString()},preExist:function(e){return e.preString(),e.emit(i["default"].DOM)},createCp:function(e,t,n){return N["default"].set(new e(this.uid++,t,n))},createVd:function(e,t,n){if("style"==e||"script"==e)throw new Error("can not create VirtualDom of: "+e);return N["default"].set(T["default"].index?T["default"].get().__reset(this.uid++,e,t,n):new y["default"](this.uid++,e,t,n))},Event:i["default"],Model:f["default"],CacheModel:h["default"],EventBus:l["default"],eventBus:new l["default"],Element:s["default"],Component:p["default"],NonVisualComponent:g["default"],CacheComponent:k["default"],VirtualDom:y["default"],Obj:O["default"],Cb:A["default"],util:x["default"],browser:S["default"],sort:C["default"],hash:N["default"],match:R["default"],matchHash:B["default"],attr:I["default"],selfClose:q["default"],FastClick:z["default"],name:function(e,t){p["default"].prototype.isPrototypeOf(e.prototype)&&(e.__migiName=t)},resetUid:function(e){this.uid=e||0},clone:function W(){var W=Object.create(U);return W.uid=0,W}};"undefined"!=typeof window?(window.migi=U,document.body?z["default"].attach(document.body):document.addEventListener("DOMContentLoaded",function(){z["default"].attach(document.body)})):"undefined"!=typeof e&&(e.migi=U),t["default"]=U}).call(t,function(){return this}())},function(e,t){"use strict";function n(e,t,n,r){return Math.abs(e-t)>=Math.abs(n-r)?e-t>0?"left":"right":n-r>0?"up":"down"}function r(){u&&clearTimeout(u),l&&clearTimeout(l),u=l=null,p={},_=[]}function a(){document.addEventListener("touchmove",i,!0),document.addEventListener("touchend",o,!0),document.addEventListener("touchcancel",r,!0),window.addEventListener("scroll",r),window.addEventListener("blur",r)}function i(e){p.vd&&(d=e.touches[0],p.x2=d.pageX,p.y2=d.pageY,m+=Math.abs(p.x1-p.x2),g+=Math.abs(p.y1-p.y2))}function o(e){p.vd&&(p.x2&&Math.abs(p.x1-p.x2)>30||p.y2&&Math.abs(p.y1-p.y2)>30?l=setTimeout(function(){var t="swipe"+n(p.x1,p.x2,p.y1,p.y2);("swipe"==p.name||p.name==t)&&p.cb(e),_.forEach(function(n){("swipe"==n.name||n.name==t)&&n.cb(e)}),p={},_=[]},0):30>m&&30>g?u=setTimeout(function(){var t=Date.now()-y>v;t?("longtap"==p.name&&p.cb(e),_.forEach(function(t){"longtap"==t.name&&t.cb(e)})):p.isDoubleTap&&p.vd==s.vd&&("doubletap"==p.name&&p.cb(e),_.forEach(function(t){"doubletap"==t.name&&t.cb(e)})),p={},_=[]},0):(p={},_=[]),m=g=0)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t,n,r){function i(r){return p.first?void _.push({vd:e,name:t,cb:n}):(d=r.touches[0],r.touches&&1===r.touches.length&&p.x2&&(p.x2=void 0,p.y2=void 0),p={vd:e,name:t,cb:n,first:!0,x1:d.pageX,y1:d.pageY},s=p,c=Date.now(),f=c-y,y=c,void(f>0&&250>f&&(p.isDoubleTap=!0)))}h||(h=!0,a()),r.push(["touchstart",i]);var o=e.element;o.addEventListener("touchstart",i)};var s,u,l,c,f,d,h,_=[],p={},v=750,y=0,m=0,g=0},function(e,t,n){"use strict";e.exports=n(31)["default"]}]); \ No newline at end of file diff --git a/src/Component.js b/src/Component.js index 460aa56..24792e0 100644 --- a/src/Component.js +++ b/src/Component.js @@ -337,7 +337,7 @@ class Component extends Element { self.__ob.push(v); v.__ob__.push(self); v.__cb__.push(function() { - self[name] = self[name]; + self.__data(name); }); } } diff --git a/web/Component.js b/web/Component.js index 33e28e4..8ba4e75 100644 --- a/web/Component.js +++ b/web/Component.js @@ -423,7 +423,7 @@ var Component = function (_Element) { self.__ob.push(v); v.__ob__.push(self); v.__cb__.push(function () { - self[name] = self[name]; + self.__data(name); }); } }