blob: c53c7cf0868c0dd065b186dd56a4699f7998b076 [file] [log] [blame]
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.WeexLegacyFramework=e.WeexLegacyFramework||{})}(this,function(e){"use strict";function t(e){for(var r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];if("function"==typeof Object.assign)Object.assign.apply(Object,[e].concat(r));else{var o=r.shift();for(var i in o)e[i]=o[i];r.length&&t.apply(void 0,[e].concat(r))}return e}function r(e,t,r,n){Object.defineProperty(e,t,{value:r,enumerable:!!n,writable:!0,configurable:!0})}function n(e,t){if(e.length){var r=e.indexOf(t);if(r>-1)return e.splice(r,1)}}function o(e,t){return ut.call(e,t)}function i(e,t){return function(r){var n=arguments.length;return n?n>1?e.apply(t,arguments):e.call(t,r):e.call(t)}}function a(e){return null!==e&&"object"==typeof e}function s(e){return lt.call(e)===pt}function c(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function u(){return"object"==typeof nativeSet?nativeSet.create():new st}function l(e){var t=Object.prototype.toString.call(e);return t.substring(8,t.length-1).toLowerCase()}function p(e){return e.replace(ht,"").replace(dt,"")}function f(e){return e.replace(mt,"")}function h(){this.id=bt++,this.subs=[]}function d(e){h.target&&kt.push(h.target),h.target=e}function v(){h.target=kt.pop()}function m(){h.target=null,kt=[]}function y(e,r,n,o){o&&t(this,o);var i="function"==typeof r;this.vm=e,e._watchers.push(this),this.expression=r,this.cb=n,this.id=++Et,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=u(),this.newDepIds=u(),i&&(this.getter=r),this.value=this.lazy?void 0:this.get(),this.queued=this.shallow=!1}function g(e,t){var r,n,o,i;if(t||(t=St).clear(),o=Array.isArray(e),i=a(e),o||i){if(e.__ob__){var s=e.__ob__.dep.id;if(t.has(s))return;t.add(s)}if(o)for(r=e.length;r--;)g(e[r],t);else if(i)for(r=(n=Object.keys(e)).length;r--;)g(e[n[r]],t)}}function w(e){this.value=e,this.dep=new h,r(e,"__ob__",this),Array.isArray(e)?((ft?_:b)(e,$t,xt),this.observeArray(e)):this.walk(e)}function _(e,t){e.__proto__=t}function b(e,t,n){for(var o=0,i=n.length;o<i;o++){var a=n[o];r(e,a,t[a])}}function k(e,t){if(a(e)){var r;return o(e,"__ob__")&&e.__ob__ instanceof w?r=e.__ob__:(Array.isArray(e)||s(e))&&Object.isExtensible(e)&&!e._isVue&&(r=new w(e)),r&&t&&r.addVm(t),r}}function E(e,t,r){var n=new h,o=Object.getOwnPropertyDescriptor(e,t);if(!o||!1!==o.configurable){var i=o&&o.get,a=o&&o.set,s=k(r);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=i?i.call(e):r;if(h.target&&(n.depend(),s&&s.dep.depend(),Array.isArray(t)))for(var o=void 0,a=0,c=t.length;a<c;a++)(o=t[a])&&o.__ob__&&o.__ob__.dep.depend();return t},set:function(t){t!==(i?i.call(e):r)&&(a?a.call(e,t):r=t,s=k(t),n.notify())}})}}function S(e,t,r){if(Array.isArray(e))return e.splice(t,1,r);if(o(e,t))e[t]=r;else if(e._isVue)S(e._data,t,r);else{var n=e.__ob__;if(n){if(n.convert(t,r),n.dep.notify(),n.vms)for(var i=n.vms.length;i--;)j(n.vms[i],t);return r}e[t]=r}}function j(e,t){(Ot.indexOf(t)>-1||!c(t))&&Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return e._data[t]},set:function(r){e._data[t]=r}})}function $(e,t){c(t)||delete e[t]}function x(e){e._watchers=[],O(e),A(e),F(e)}function O(e){var t=e._data;s(t)||(t={});for(var r=Object.keys(t),n=r.length;n--;)j(e,r[n]);k(t,e)}function M(){}function A(e){var t=e._computed;if(t)for(var r in t){var n=t[r],o={enumerable:!0,configurable:!0};"function"==typeof n?(o.get=C(n,e),o.set=M):(o.get=n.get?!1!==n.cache?C(n.get,e):i(n.get,e):M,o.set=n.set?i(n.set,e):M),Object.defineProperty(e,r,o)}}function C(e,t){var r=new y(t,e,null,{lazy:!0});return function(){return r.dirty&&r.evaluate(),h.target&&r.depend(),r.value}}function F(e){var t=e._methods;if(t)for(var r in t)e[r]=t[r]}function T(e){var t=e.type,r=At[t];if("object"==typeof r)for(var n in r)if(null==e[n])e[n]=r[n];else if("object"===l(e[n])&&"object"===l(r[n]))for(var o in r[n])null==e[n][o]&&(e[n][o]=r[n][o])}function V(e,t,r){q(e,t,r.id,e),B(e,t,r.attr),N(e,t,r.classList),z(e,t,r.style),U(e,t,r.events)}function I(e,t,r,n){t=t||{},r=r||{};var o=(t._options||{}).props;Array.isArray(o)&&(o=o.reduce(function(e,t){return e[t]=!0,e},{})),D(n,o,e,t),D(r.attr,o,e,t)}function J(e,t,r,n){void 0===n&&(n={}),P(r.classList,e,t),R(r.style,e,t),n.children?n.children[n.children.length-1]._vm=t:n._vm=t}function D(e,t,r,n){if(e){for(var o in e)!function(o){if(!t||t[o]){var i=e[o];if("function"==typeof i){var a=Z(r,i,function(e){n[o]=e});n[o]=a}else n[o]=i}}(o)}}function R(e,t,r){for(var n in e)!function(n){var o=e[n];if("function"==typeof o){var i=Z(t,o,function(e){r._rootEl&&r._rootEl.setStyle(n,e)});r._rootEl.setStyle(n,i)}else r._rootEl&&r._rootEl.setStyle(n,o)}(n)}function P(e,t,r){function n(e,t){"array"===l(e)&&e.unshift(t)}var o=t._options&&t._options.style||{};if(r._rootEl){var i="@originalRootEl";if(o[i]=r._rootEl.classStyle,"function"==typeof e){var a=Z(t,e,function(e){n(e,i),L(r._rootEl,o,e)});n(a,i),L(r._rootEl,o,a)}else null!=e&&(n(e,i),L(r._rootEl,o,e))}}function q(e,t,r,n){var o=Object.create(null);if(Object.defineProperties(o,{vm:{value:n,writable:!1,configurable:!1},el:{get:function(){return t||n._rootEl},configurable:!1}}),"function"==typeof r){var i=r;((r=i.call(e))||0===r)&&(e._ids[r]=o),Z(e,i,function(t){t&&(e._ids[t]=o)})}else r&&"string"==typeof r&&(e._ids[r]=o)}function B(e,t,r){W(e,t,"attr",r)}function L(e,t,r){"string"==typeof r&&(r=r.split(/\s+/)),r.forEach(function(e,t){r.splice.apply(r,[t,1].concat(e.split(/\s+/)))});for(var n={},o=r.length,i=0;i<o;i++)!function(e){var o=t[r[e]];o&&Object.keys(o).forEach(function(e){n[e]=o[e]})}(i);e.setClassStyle(n)}function N(e,t,r){if("function"==typeof r||Array.isArray(r))if(!Array.isArray(r)||r.length){var n=e._options&&e._options.style||{};if("function"==typeof r){var o=Z(e,r,function(e){L(t,n,e)});L(t,n,o)}else L(t,n,r)}else t.setClassStyle({})}function z(e,t,r){W(e,t,"style",r)}function X(e,t,r,n){t.addEvent(r,i(n,e))}function U(e,t,r){if(r)for(var n=Object.keys(r),o=n.length;o--;){var i=n[o],a=r[i];"string"==typeof a&&((a=e[a])||console.warn('[JS Framework] The event handler "'+a+'" is not defined.')),X(e,t,i,a)}}function W(e,t,r,n){if(n)for(var o=Object.keys(n),i=o.length;i--;){var a=o[i],s=n[a];"function"==typeof s?H(e,t,r,a,s):t[Ct[r]](a,s)}}function H(e,t,r,n,o){var i=Ct[r],a=Z(e,o,function(r){function o(){t[i](n,r)}var a=e&&e._app&&e._app.differ;a?a.append("element",t.depth,t.ref,o):o()});t[i](n,a)}function Z(e,t,r){return e._static?t.call(e,e):new y(e,t,function(e,t){"object"!=typeof e&&e===t||r(e)}).value}function G(e,t){return e._app.doc.createBody(t)}function K(e,t){return e._app.doc.createElement(t)}function Q(e,t){var r=Y(e),n=ee(e),o=Ft++;if(t.element){var i=t.updateMark;i?(i.element&&(i=i.end),t.element.insertAfter(n,i),t.element.insertAfter(r,i),t.updateMark=n):(t.element.insertBefore(r,t.end),t.element.insertBefore(n,t.end)),t=t.element}else t.appendChild(r),t.appendChild(n);return{start:r,end:n,element:t,blockId:o}}function Y(e){return e._app.doc.createComment("start")}function ee(e){return e._app.doc.createComment("end")}function te(e,t,r){if(r.element){var n=r.end,o=r.updateMark;if(r.children&&r.children.push(t),o){var i=re(e,t,o);return r.updateMark=t.element?t.end:t,i}if(!t.element)return r.element.insertBefore(t,n);r.element.insertBefore(t.start,n),r.element.insertBefore(t.end,n)}else{if(!t.element)return r.appendChild(t);r.appendChild(t.start),r.appendChild(t.end)}}function re(e,t,r){return t.element?oe(t,r):ne(t,r)}function ne(e,t){var r=t.parentNode;if(r)return r.insertAfter(e,t)}function oe(e,t){var r=t.parentNode;if(r){for(var n,o=e.start,i=[o];o&&o!==e.end;)o=o.nextSibling,i.push(o);var a=t;return i.every(function(e){return n=r.insertAfter(e,a),a=e,-1!==n}),n}}function ie(e,t,r){void 0===r&&(r=!1),t.element?se(t,r):ae(t),t._vm&&t._vm.$emit("hook:destroyed")}function ae(e){var t=e.parentNode;t&&t.removeChild(e)}function se(e,t){void 0===t&&(t=!1);for(var r=[],n=e.start.nextSibling;n&&n!==e.end;)r.push(n),n=n.nextSibling;t||ae(e.start),r.forEach(function(e){ae(e)}),t||ae(e.end)}function ce(e){var t=e._options||{},r=t.template||{};t.replace?r.children&&1===r.children.length?ue(e,r.children[0],e._parentEl):ue(e,r.children,e._parentEl):ue(e,r,e._parentEl),console.debug('[JS Framework] "ready" lifecycle in Vm('+e._type+")"),e.$emit("hook:ready"),e._ready=!0}function ue(e,t,r,n){if(-1!==(e._app||{}).lastSignal)if(t.attr&&t.attr.hasOwnProperty("static")&&(e._static=!0),le(t))me(e,t,r,n);else{if(n=n||{},pe(t))return console.debug('[JS Framework] compile "content" block by',t),void(e._content=Q(e,r));if(fe(t,n))return console.debug('[JS Framework] compile "repeat" logic by',t),void("document"===r.type?console.warn("[JS Framework] The root element does't support `repeat` directive!"):ye(e,t,r));if(he(t,n))return console.debug('[JS Framework] compile "if" logic by',t),void("document"===r.type?console.warn("[JS Framework] The root element does't support `if` directive!"):ge(e,t,r,n));var o=n.type||t.type;if(de(o,n))we(e,t,r,o,n);else{var i=o,a=ve(e,t,i);if(a)return console.debug("[JS Framework] compile composed component by",t),void _e(e,a,t,r,i,n);console.debug("[JS Framework] compile native component by",t),be(e,t,r,i)}}}function le(e){return Array.isArray(e)}function pe(e){return"content"===e.type||"slot"===e.type}function fe(e,t){return!t.hasOwnProperty("repeat")&&e.repeat}function he(e,t){return!t.hasOwnProperty("shown")&&e.shown}function de(e,t){return"function"==typeof e&&!t.hasOwnProperty("type")}function ve(e,t,r){var n;return e._app&&e._app.customComponentMap&&(n=e._app.customComponentMap[r]),e._options&&e._options.components&&(n=e._options.components[r]),t.component&&(n=n||{}),n}function me(e,t,r,n){var o=Q(e,r);t.forEach(function(t){ue(e,t,o,n)})}function ye(e,t,r){var n=t.repeat,o="function"==typeof n,i=n.getter||n.expression||n;"function"!=typeof i&&(i=function(){return[]});var a=n.key||"$index",s=n.value||"$value",c=n.trackBy||t.trackBy||t.attr&&t.attr.trackBy,u=Q(e,r);u.children=[],u.data=[],u.vms=[],Ee(e,t,u,{getter:i,key:a,value:s,trackBy:c,oldStyle:o})}function ge(e,t,r,n){var o={shown:!0},i=Q(e,r);r.element&&r.children&&r.children.push(i),n.repeat&&(o.repeat=n.repeat),Se(e,t,i,o)}function we(e,r,n,o,i){var a=t({type:o.call(e)},i),s=Q(e,n);n.element&&n.children&&n.children.push(s),Z(e,o,function(n){var o=t({type:n},i);ie(e,s,!0),ue(e,r,s,o)}),ue(e,r,s,a)}function _e(e,t,r,n,o,i){var a=new(0,e.constructor)(o,t,e,n,void 0,{"hook:init":function(){e._static&&(this._static=e._static),q(e,null,r.id,this),this._externalBinding={parent:e,template:r}},"hook:created":function(){I(e,this,r,i.repeat)},"hook:ready":function(){this._content&&ke(e,r,this._content)}});J(e,a,r,n)}function be(e,t,r,n){T(t);var o;if("_documentElement"===r.ref?(console.debug("[JS Framework] compile to create body for "+n),o=G(e,n)):(console.debug("[JS Framework] compile to create element for "+n),o=K(e,n)),!e._rootEl){e._rootEl=o;var a=e._externalBinding||{},s=a.template,c=a.parent;if(s&&s.events&&c&&o)for(var u in s.events){var l=c[s.events[u]];l&&o.addEvent(u,i(l,c))}}V(e,o,t),t.attr&&t.attr.append&&(t.append=t.attr.append),t.append&&(o.attr=o.attr||{},o.attr.append=t.append);var p="tree"===t.append,f=e._app||{};-1===f.lastSignal||p||(console.debug("[JS Framework] compile to append single node for",o),f.lastSignal=te(e,o,r)),-1!==f.lastSignal&&ke(e,t,o),-1!==f.lastSignal&&p&&(console.debug("[JS Framework] compile to append whole tree for",o),f.lastSignal=te(e,o,r))}function ke(e,t,r){var n=e._app||{},o=t.children;o&&o.length&&o.every(function(t){return ue(e,t,r),-1!==n.lastSignal})}function Ee(e,t,r,n){function o(e,n,o){var s;l?(s=e,a(e)?(s[p]=n,s.hasOwnProperty("INDEX")||Object.defineProperty(s,"INDEX",{value:function(){console.warn('[JS Framework] "INDEX" in repeat is deprecated, please use "$index" instead')}})):(console.warn("[JS Framework] Each list item must be an object in old-style repeat, please use `repeat={{v in list}}` instead."),(s={})[p]=n,s[f]=e)):((s={})[p]=n,s[f]=e);var c=$e(o,s);i.push(c),ue(c,t,r,{repeat:e})}var i=r.vms,s=r.children,c=n.getter,u=n.trackBy,l=n.oldStyle,p=n.key,f=n.value,h=je(e,r,c,"repeat",function(t){if(console.debug('[JS Framework] the "repeat" item has changed',t),r&&t){var n=s.slice(),a=i.slice(),c=r.data.slice(),h={},d={};t.forEach(function(e,t){var r=u?e[u]:l?e[p]:t;null!=r&&""!==r&&(h[r]=e)});var v=[];c.forEach(function(t,r){var o=u?t[u]:l?t[p]:r;h.hasOwnProperty(o)?(d[o]={item:t,index:r,key:o,target:n[r],vm:a[r]},v.push(t)):ie(e,n[r])}),s.length=0,i.length=0,r.data=t.slice(),r.updateMark=r.start,t.forEach(function(t,n){var a=u?t[u]:l?t[p]:n,c=d[a];c?(c.item===v[0]?v.shift():(v.$remove(c.item),re(e,c.target,r.updateMark,!0)),s.push(c.target),i.push(c.vm),l?c.vm=t:c.vm[f]=t,c.vm[p]=n,r.updateMark=c.target):o(t,n,e)}),delete r.updateMark}});r.data=h.slice(0),h.forEach(function(t,r){o(t,r,e)})}function Se(e,t,r,n){var o=je(e,r,t.shown,"shown",function(o){console.debug('[JS Framework] the "if" item was changed',o),r&&!!r.display!=!!o&&(r.display=!!o,o?ue(e,t,r,n):ie(e,r,!0))});r.display=!!o,o&&ue(e,t,r,n)}function je(e,t,r,n,o){var i=e&&e._app&&e._app.differ,a={},s=(t.element.depth||0)+1;return Z(e,r,function(e){a.latestValue=e,i&&!a.recorded&&i.append(n,s,t.blockId,function(){var e=a.latestValue;o(e),a.recorded=!1,a.latestValue=void 0}),a.recorded=!0})}function $e(e,t){var r=Object.create(e);return r._data=t,O(r),A(r),r._realParent=e,e._static&&(r._static=e._static),r}function xe(e,t){if(t instanceof xe)return t;this.timestamp=Date.now(),this.detail=t,this.type=e;var r=!1;this.stop=function(){r=!0},this.hasStopped=function(){return r}}function Oe(e,t){var r=this,n=this._vmEvents[e];if(n){var o=new xe(e,t);n.forEach(function(e){e.call(r,o)})}}function Me(e,t){var r=new xe(e,t);this.$emit(e,r),!r.hasStopped()&&this._parent&&this._parent.$dispatch&&this._parent.$dispatch(e,r)}function Ae(e,t){var r=new xe(e,t);this.$emit(e,r),!r.hasStopped()&&this._childrenVms&&this._childrenVms.forEach(function(t){t.$broadcast(e,r)})}function Ce(e,t){if(e&&"function"==typeof t){var r=this._vmEvents,n=r[e]||[];n.push(t),r[e]=n,"hook:ready"===e&&this._ready&&this.$emit("hook:ready")}}function Fe(e,t){if(e){var r=this._vmEvents;if(t){var n=r[e];n&&n.$remove(t)}else delete r[e]}}function Te(e,t){var r=e._options||{},n=r.events||{};for(var o in n)e.$on(o,n[o]);for(var i in t)e.$on(i,t[i]);Tt.forEach(function(t){e.$on("hook:"+t,r[t])})}function Ve(e,r,n,o,i,a){n=n||{},this._parent=n._realParent?n._realParent:n,this._app=n._app||{},n._childrenVms&&n._childrenVms.push(this),!r&&this._app.customComponentMap&&(r=this._app.customComponentMap[e]);var s=(r=r||{}).data||{};this._options=r,this._methods=r.methods||{},this._computed=r.computed||{},this._css=r.style||{},this._ids={},this._vmEvents={},this._childrenVms=[],this._type=e,Te(this,a),console.debug('[JS Framework] "init" lifecycle in Vm('+this._type+")"),this.$emit("hook:init"),this._inited=!0,this._data="function"==typeof s?s():s,i&&t(this._data,i),x(this),console.debug('[JS Framework] "created" lifecycle in Vm('+this._type+")"),this.$emit("hook:created"),this._created=!0,r.methods&&r.methods.ready&&(console.warn('"exports.methods.ready" is deprecated, please use "exports.created" instead'),r.methods.ready.call(this)),this._app.doc&&(this._parentEl=o||this._app.doc.documentElement,ce(this))}function Ie(e,t){for(var r in e)!function(r){var n=Vt[r];n||(n={},Vt[r]=n),e[r].forEach(function(e){"string"==typeof e&&(e={name:e}),n[e.name]&&!t||(n[e.name]=e)})}(r)}function Je(e,t){var r=e.prototype;for(var n in t)r.hasOwnProperty(n)||(r[n]=t[n])}function De(e,t){var r=Vt[t],n={};for(var o in r)!function(r){Object.defineProperty(n,r,{configurable:!0,enumerable:!0,get:function(){return function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return e.callTasks({module:t,method:r,args:n})}},set:function(n){if("function"==typeof n)return e.callTasks({module:t,method:r,args:[n]})}})}(o);return n}function Re(e,t){return e.customComponentMap[t]}function Pe(e,t,r){var n=e.customComponentMap;n[t]?console.error("[JS Framework] define a component("+t+") that already exists"):n[t]=r}function qe(e){if(It.valid(e))return e;for(var t=(e="string"==typeof e?e:"").split("."),r=0,n=[];r<3;){var o="string"==typeof t[r]&&t[r]?t[r]:"0";n.push(o),r++}return n.join(".")}function Be(e,t,r){var n={isDowngrade:!0,errorType:1,code:1e3},o=e.toLowerCase();return n.errorMessage=function(e,t,r){return"Downgrade["+e+"] :: deviceInfo "+t+" matched criteria "+r}(e,t,r),o.indexOf("osversion")>=0?n.code=1001:o.indexOf("appversion")>=0?n.code=1002:o.indexOf("weexversion")>=0?n.code=1003:o.indexOf("devicemodel")>=0&&(n.code=1004),n}function Le(e,t){t=s(t=t||global.WXEnvironment)?t:{};var r={isDowngrade:!1};if("function"===l(e)){var n=e.call(this,t,{semver:It,normalizeVersion:qe});r=(n=!!n)?Be("custom","","custom params"):r}else{var o=(e=s(e)?e:{})[(t.platform||"unknow").toLowerCase()]||{};for(var i in t){var a=i,c=a.toLowerCase(),u=t[i],p=c.indexOf("version")>=0,f=c.indexOf("devicemodel")>=0,h=o[i];if(h&&p){var d=qe(h),v=qe(t[i]);if(It.satisfies(v,d)){r=Be(a,u,h);break}}else if(f&&("array"===l(h)?h:[h]).indexOf(u)>=0){r=Be(a,u,h);break}}}return r}function Ne(e,t){if(void 0===t&&(t={}),e&&e.callTasks)return e.callTasks([{module:"meta",method:"setViewport",args:[t]}])}function ze(e,t,r,n){console.debug("[JS Framework] bootstrap for "+t);var o;if(yt(t))o=p(t);else{if(!_t(t))return new Error("Wrong component name: "+t);if(o=f(t),!Re(e,o))return new Error("It's not a component: "+t)}if("string"==typeof(r=s(r)?r:{}).transformerVersion&&"string"==typeof global.transformerVersion&&!It.satisfies(r.transformerVersion,global.transformerVersion))return new Error("JS Bundle version: "+r.transformerVersion+" not compatible with "+global.transformerVersion);var i=Le(r.downgrade);if(i.isDowngrade)return e.callTasks([{module:"instanceWrap",method:"error",args:[i.errorType,i.code,i.errorMessage]}]),new Error("Downgrade["+i.code+"]: "+i.errorMessage);r.viewport&&Ne(e,r.viewport),e.vm=new Ve(o,null,{_app:e},null,n)}function Xe(e,t,r){console.warn("[JS Framework] Register is deprecated, please install lastest transformer."),Pe(e,t,r)}function Ue(e,r){console.debug("[JS Framework] Refresh with",r,"in instance["+e.id+"]");var n=e.vm;return n&&r?("function"==typeof n.refreshData?n.refreshData(r):t(n,r),e.differ.flush(),void e.doc.taskCenter.send("dom",{action:"refreshFinish"},[])):new Error('invalid data "'+r+'"')}function We(e){console.debug("[JS Framework] Destory an instance("+e.id+")"),e.vm&&He(e.vm),e.id="",e.options=null,e.blocks=null,e.vm=null,e.doc.taskCenter.destroyCallback(),e.doc.destroy(),e.doc=null,e.customComponentMap=null,e.commonModules=null}function He(e){if(delete e._app,delete e._computed,delete e._css,delete e._data,delete e._ids,delete e._methods,delete e._options,delete e._parent,delete e._parentEl,delete e._rootEl,e._watchers){for(var t=e._watchers.length;t--;)e._watchers[t].teardown();delete e._watchers}if(e._childrenVms){for(var r=e._childrenVms.length;r--;)He(e._childrenVms[r]);delete e._childrenVms}console.debug('[JS Framework] "destroyed" lifecycle in Vm('+e._type+")"),e.$emit("hook:destroyed"),delete e._type,delete e._vmEvents}function Ze(e){var t=(e.doc||{}).body||{};return t.toJSON?t.toJSON():{}}function Ge(e,t,r,n,o){console.debug('[JS Framework] Fire a "'+r+'" event on an element('+t+") in instance("+e.id+")");{if(!Array.isArray(t)){var i=e.doc.getRef(t);if(i){var a=e.doc.fireEvent(i,r,n,o);return e.differ.flush(),e.doc.taskCenter.send("dom",{action:"updateFinish"},[]),a}return new Error('invalid element reference "'+t+'"')}t.some(function(t){return!1!==Ge(e,t,r,n)})}}function Ke(e,t,r,n){console.debug("[JS Framework] Invoke a callback("+t+") with",r,"in instance("+e.id+")");var o=e.doc.taskCenter.callback(t,r,n);return Qe(e),e.doc.taskCenter.send("dom",{action:"updateFinish"},[]),o}function Qe(e){e.differ.flush()}function Ye(e,t){var r;return"array"!==l(t)&&(t=[t]),t.forEach(function(t){r=e.doc.taskCenter.send("module",{module:t.module,method:t.method},t.args)}),r}function et(e,t,r,n){console.debug("[JS Framework] Intialize an instance with:\n",r);var o,i=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Jt.apply(void 0,[e].concat(t))},a=function(t,n,i){o=ze(e,t,n,i||r),Qe(e),e.doc.listener.createFinish(),console.debug("[JS Framework] After intialized an instance("+e.id+")")},s=Ve,c=e.doc,u=function(t){return e.requireModule(p(t))},l={config:e.options,define:i,bootstrap:a,requireModule:u,document:c,Vm:s};Object.freeze(l);var f;"function"==typeof t?f=t.toString().substr(12):t&&(f=t.toString()),f='(function(global){\n\n"use strict";\n\n '+f+" \n\n})(Object.create(this))";var h=global.WXEnvironment,d={};if(h&&"Web"!==h.platform){var v=e.requireModule("timer");Object.assign(d,{setTimeout:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return v.setTimeout(function(){t[0].apply(t,t.slice(2))},t[1]),e.doc.taskCenter.callbackManager.lastCallbackId.toString()},setInterval:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return v.setInterval(function(){t[0].apply(t,t.slice(2))},t[1]),e.doc.taskCenter.callbackManager.lastCallbackId.toString()},clearTimeout:function(e){v.clearTimeout(e)},clearInterval:function(e){v.clearInterval(e)}})}var m=Object.assign({define:i,require:function(t){return function(r){o=ze(e,t,{},r)}},bootstrap:a,register:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Xe.apply(void 0,[e].concat(t))},render:function(t,r){o=ze(e,t,{},r)},__weex_define__:i,__weex_bootstrap__:a,__weex_document__:c,__weex_require__:u,__weex_viewmodel__:s,weex:l},d,n);return rt(m,f)||tt(m,f),o}function tt(e,t){var r=[],n=[];for(var o in e)r.push(o),n.push(e[o]);return r.push(t),(new(Function.prototype.bind.apply(Function,[null].concat(r)))).apply(void 0,n)}function rt(e,t){if("function"!=typeof compileAndRunBundle)return!1;var r=void 0,n=!1,o="(function (",i=[],a=[];for(var s in e)i.push(s),a.push(e[s]);for(var c=0;c<i.length-1;++c)o+=i[c],o+=",";o+=i[i.length-1],o+=") {",o+=t,o+="} )";try{var u=(e.weex||{}).config||{};(r=compileAndRunBundle(o,u.bundleUrl,u.bundleDigest,u.codeCachePath))&&"function"==typeof r&&(r.apply(void 0,a),n=!0)}catch(e){console.error(e)}return n}function nt(e,t){var r=e[t];for(var n in r)r[n]()}function ot(e,t){var r=e[t];for(var n in r)r[n].forEach(function(e){e()})}function it(e,t){this.id=e,this.options=t||{},this.vm=null,this.customComponentMap={},this.commonModules={},this.doc=new Mt.Document(e,this.options.bundleUrl,null,Mt.Listener),this.differ=new Dt(e)}function at(e){"object"==typeof e&&Je(Ve,e)}var st,ct=Object.freeze({$:function(e){console.warn("[JS Framework] Vm#$ is deprecated, please use Vm#$vm instead");var t=this._ids[e];if(t)return t.vm},$el:function(e){var t=this._ids[e];if(t)return t.el},$vm:function(e){var t=this._ids[e];if(t)return t.vm},$renderThen:function(e){return this._app.differ.then(function(){e()})},$scrollTo:function(e,t){console.warn("[JS Framework] Vm#$scrollTo is deprecated, please use \"require('@weex-module/dom').scrollTo(el, options)\" instead");var r=this.$el(e);r&&this._app.requireModule("dom").scrollToElement(r.ref,{offset:t})},$transition:function(e,t,r){var n=this,o=this.$el(e);o&&t&&t.styles&&this._app.requireModule("animation").transition(o.ref,t,function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];n._setStyle(o,t.styles),r&&r.apply(void 0,e)})},$getConfig:function(e){var t=this._app.options;return"function"==typeof e&&(console.warn("[JS Framework] the callback of Vm#$getConfig(callback) is deprecated, this api now can directly RETURN config info."),e(t)),t},$sendHttp:function(e,t){console.warn("[JS Framework] Vm#$sendHttp is deprecated, please use \"require('@weex-module/stream').sendHttp(params, callback)\" instead"),this._app.requireModule("stream").sendHttp(e,t)},$openURL:function(e){console.warn("[JS Framework] Vm#$openURL is deprecated, please use \"require('@weex-module/event').openURL(url)\" instead"),this._app.requireModule("event").openURL(e)},$setTitle:function(e){console.warn("[JS Framework] Vm#$setTitle is deprecated, please use \"require('@weex-module/pageInfo').setTitle(title)\" instead"),this._app.requireModule("pageInfo").setTitle(e)},$call:function(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];console.warn("[JS Framework] Vm#$call is deprecated, please use \"require('@weex-module/moduleName')\" instead");var o=this._app.requireModule(e);o&&o[t]&&o[t].apply(o,r)}}),ut=Object.prototype.hasOwnProperty,lt=Object.prototype.toString,pt="[object Object]",ft="__proto__"in{};"undefined"!=typeof Set&&Set.toString().match(/native code/)?st=Set:((st=function(){this.set=Object.create(null)}).prototype.has=function(e){return void 0!==this.set[e]},st.prototype.add=function(e){null==e||this.set[e]||(this.set[e]=1)},st.prototype.clear=function(){this.set=Object.create(null)});var ht=/^@weex-component\//,dt=/^@weex-module\//,vt=/^\.{1,2}\//,mt=/\.js$/,yt=function(e){return!!e.match(ht)},gt=function(e){return!!e.match(dt)},wt=function(e){return!!e.match(vt)},_t=function(e){return!yt(e)&&!gt(e)&&!wt(e)},bt=0;h.target=null;var kt=[];h.prototype.addSub=function(e){this.subs.push(e)},h.prototype.removeSub=function(e){n(this.subs,e)},h.prototype.depend=function(){h.target&&h.target.addDep(this)},h.prototype.notify=function(){for(var e=this.subs.slice(),t=0,r=e.length;t<r;t++)e[t].update()};var Et=0;y.prototype.get=function(){d(this);var e=this.getter.call(this.vm,this.vm);return this.deep&&g(e),v(),this.cleanupDeps(),e},y.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},y.prototype.cleanupDeps=function(){for(var e=this,t=this.deps.length;t--;){var r=e.deps[t];e.newDepIds.has(r.id)||r.removeSub(e)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},y.prototype.update=function(e){this.lazy?this.dirty=!0:this.run()},y.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||(a(e)||this.deep)&&!this.shallow){var t=this.value;this.value=e,this.cb.call(this.vm,e,t)}this.queued=this.shallow=!1}},y.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},y.prototype.depend=function(){for(var e=this,t=this.deps.length;t--;)e.deps[t].depend()},y.prototype.teardown=function(){var e=this;if(this.active){this.vm._isBeingDestroyed||this.vm._vForRemoving||n(this.vm._watchers,this);for(var t=this.deps.length;t--;)e.deps[t].removeSub(e);this.active=!1,this.vm=this.cb=this.value=null}};var St=u(),jt=Array.prototype,$t=Object.create(jt);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(e){var t=jt[e];r($t,e,function(){for(var r=arguments,n=arguments.length,o=new Array(n);n--;)o[n]=r[n];var i,a=t.apply(this,o),s=this.__ob__;switch(e){case"push":case"unshift":i=o;break;case"splice":i=o.slice(2)}return i&&s.observeArray(i),s.dep.notify(),a})}),r(jt,"$set",function(e,t){return console.warn('[JS Framework] "Array.prototype.$set" is not a standard API, it will be removed in the next version.'),e>=this.length&&(this.length=e+1),this.splice(e,1,t)[0]}),r(jt,"$remove",function(e){console.warn('[JS Framework] "Array.prototype.$remove" is not a standard API, it will be removed in the next version.'),this.length&&("number"!=typeof e&&(e=this.indexOf(e)),e>-1&&this.splice(e,1))});var xt=Object.getOwnPropertyNames($t);w.prototype.walk=function(e){var t=this;for(var r in e)t.convert(r,e[r])},w.prototype.observeArray=function(e){for(var t=0,r=e.length;t<r;t++)k(e[t])},w.prototype.convert=function(e,t){E(this.value,e,t)},w.prototype.addVm=function(e){(this.vms||(this.vms=[])).push(e)},w.prototype.removeVm=function(e){n(this.vms,e)};var Ot=["$index","$value","$event"],Mt={nativeComponentMap:{text:!0,image:!0,container:!0,slider:{type:"slider",append:"tree"},cell:{type:"cell",append:"tree"}}},At=Mt.nativeComponentMap,Ct={attr:"setAttr",style:"setStyle",event:"addEvent"},Ft=1,Tt=["init","created","ready","destroyed"];!function(e){e.$emit=Oe,e.$dispatch=Me,e.$broadcast=Ae,e.$on=Ce,e.$off=Fe}(Ve.prototype),Ve.prototype.$watch=function(e,t){Z(this,e,t)},Ve.set=S,Ve.delete=function(e,t){if(o(e,t)){delete e[t];var r=e.__ob__;if(r){if(r.dep.notify(),r.vms)for(var n=r.vms.length;n--;)$(r.vms[n],t)}else e._isVue&&delete e._data[t]}};var Vt={},It=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e,t){function r(e,t){if(e instanceof n)return e;if("string"!=typeof e)return null;if(e.length>M)return null;if(!(t?C[H]:C[X]).test(e))return null;try{return new n(e,t)}catch(e){return null}}function n(e,t){if(e instanceof n){if(e.loose===t)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>M)throw new TypeError("version is longer than "+M+" characters");if(!(this instanceof n))return new n(e,t);O("SemVer",e,t),this.loose=t;var r=e.trim().match(t?C[H]:C[X]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>A||this.major<0)throw new TypeError("Invalid major version");if(this.minor>A||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>A||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<A)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}function o(e,t){var r=ye.test(e),n=ye.test(t);return r&&n&&(e=+e,t=+t),r&&!n?-1:n&&!r?1:e<t?-1:e>t?1:0}function i(e,t,r){return new n(e,r).compare(new n(t,r))}function a(e,t,r){return i(e,t,r)>0}function s(e,t,r){return i(e,t,r)<0}function c(e,t,r){return 0===i(e,t,r)}function u(e,t,r){return 0!==i(e,t,r)}function l(e,t,r){return i(e,t,r)>=0}function p(e,t,r){return i(e,t,r)<=0}function f(e,t,r,n){var o;switch(t){case"===":"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),o=e===r;break;case"!==":"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),o=e!==r;break;case"":case"=":case"==":o=c(e,r,n);break;case"!=":o=u(e,r,n);break;case">":o=a(e,r,n);break;case">=":o=l(e,r,n);break;case"<":o=s(e,r,n);break;case"<=":o=p(e,r,n);break;default:throw new TypeError("Invalid operator: "+t)}return o}function h(e,t){if(e instanceof h){if(e.loose===t)return e;e=e.value}if(!(this instanceof h))return new h(e,t);O("comparator",e,t),this.loose=t,this.parse(e),this.semver===ge?this.value="":this.value=this.operator+this.semver.version,O("comp",this)}function d(e,t){if(e instanceof d)return e.loose===t?e:new d(e.raw,t);if(e instanceof h)return new d(e.value,t);if(!(this instanceof d))return new d(e,t);if(this.loose=t,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function v(e,t){return O("comp",e),e=w(e,t),O("caret",e),e=y(e,t),O("tildes",e),e=b(e,t),O("xrange",e),e=E(e,t),O("stars",e),e}function m(e){return!e||"x"===e.toLowerCase()||"*"===e}function y(e,t){return e.trim().split(/\s+/).map(function(e){return g(e,t)}).join(" ")}function g(e,t){var r=t?C[ie]:C[oe];return e.replace(r,function(t,r,n,o,i){O("tilde",e,t,r,n,o,i);var a;return m(r)?a="":m(n)?a=">="+r+".0.0 <"+(+r+1)+".0.0":m(o)?a=">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":i?(O("replaceTilde pr",i),"-"!==i.charAt(0)&&(i="-"+i),a=">="+r+"."+n+"."+o+i+" <"+r+"."+(+n+1)+".0"):a=">="+r+"."+n+"."+o+" <"+r+"."+(+n+1)+".0",O("tilde return",a),a})}function w(e,t){return e.trim().split(/\s+/).map(function(e){return _(e,t)}).join(" ")}function _(e,t){O("caret",e,t);var r=t?C[ue]:C[ce];return e.replace(r,function(t,r,n,o,i){O("caret",e,t,r,n,o,i);var a;return m(r)?a="":m(n)?a=">="+r+".0.0 <"+(+r+1)+".0.0":m(o)?a="0"===r?">="+r+"."+n+".0 <"+r+"."+(+n+1)+".0":">="+r+"."+n+".0 <"+(+r+1)+".0.0":i?(O("replaceCaret pr",i),"-"!==i.charAt(0)&&(i="-"+i),a="0"===r?"0"===n?">="+r+"."+n+"."+o+i+" <"+r+"."+n+"."+(+o+1):">="+r+"."+n+"."+o+i+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+o+i+" <"+(+r+1)+".0.0"):(O("no pr"),a="0"===r?"0"===n?">="+r+"."+n+"."+o+" <"+r+"."+n+"."+(+o+1):">="+r+"."+n+"."+o+" <"+r+"."+(+n+1)+".0":">="+r+"."+n+"."+o+" <"+(+r+1)+".0.0"),O("caret return",a),a})}function b(e,t){return O("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return k(e,t)}).join(" ")}function k(e,t){e=e.trim();var r=t?C[te]:C[ee];return e.replace(r,function(t,r,n,o,i,a){O("xRange",e,t,r,n,o,i,a);var s=m(n),c=s||m(o),u=c||m(i),l=u;return"="===r&&l&&(r=""),s?t=">"===r||"<"===r?"<0.0.0":"*":r&&l?(c&&(o=0),u&&(i=0),">"===r?(r=">=",c?(n=+n+1,o=0,i=0):u&&(o=+o+1,i=0)):"<="===r&&(r="<",c?n=+n+1:o=+o+1),t=r+n+"."+o+"."+i):c?t=">="+n+".0.0 <"+(+n+1)+".0.0":u&&(t=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0"),O("xRange return",t),t})}function E(e,t){return O("replaceStars",e,t),e.trim().replace(C[ve],"")}function S(e,t,r,n,o,i,a,s,c,u,l,p,f){return t=m(r)?"":m(n)?">="+r+".0.0":m(o)?">="+r+"."+n+".0":">="+t,s=m(c)?"":m(u)?"<"+(+c+1)+".0.0":m(l)?"<"+c+"."+(+u+1)+".0":p?"<="+c+"."+u+"."+l+"-"+p:"<="+s,(t+" "+s).trim()}function j(e,t){for(r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length){for(var r=0;r<e.length;r++)if(O(e[r].semver),e[r].semver!==ge&&e[r].semver.prerelease.length>0){var n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}function $(e,t,r){try{t=new d(t,r)}catch(e){return!1}return t.test(e)}function x(e,t,r,o){e=new n(e,o),t=new d(t,o);var i,c,u,f,v;switch(r){case">":i=a,c=p,u=s,f=">",v=">=";break;case"<":i=s,c=l,u=a,f="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if($(e,t,o))return!1;for(var m=0;m<t.set.length;++m){var y=null,g=null;if(t.set[m].forEach(function(e){e.semver===ge&&(e=new h(">=0.0.0")),y=y||e,g=g||e,i(e.semver,y.semver,o)?y=e:u(e.semver,g.semver,o)&&(g=e)}),y.operator===f||y.operator===v)return!1;if((!g.operator||g.operator===f)&&c(e,g.semver))return!1;if(g.operator===v&&u(e,g.semver))return!1}return!0}t=e.exports=n;var O;"object"==typeof process&&process.env,O=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var M=256,A=Number.MAX_SAFE_INTEGER||9007199254740991,C=t.re=[],F=t.src=[],T=0,V=T++;F[V]="0|[1-9]\\d*";var I=T++;F[I]="[0-9]+";var J=T++;F[J]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var D=T++;F[D]="("+F[V]+")\\.("+F[V]+")\\.("+F[V]+")";var R=T++;F[R]="("+F[I]+")\\.("+F[I]+")\\.("+F[I]+")";var P=T++;F[P]="(?:"+F[V]+"|"+F[J]+")";var q=T++;F[q]="(?:"+F[I]+"|"+F[J]+")";var B=T++;F[B]="(?:-("+F[P]+"(?:\\."+F[P]+")*))";var L=T++;F[L]="(?:-?("+F[q]+"(?:\\."+F[q]+")*))";var N=T++;F[N]="[0-9A-Za-z-]+";var z=T++;F[z]="(?:\\+("+F[N]+"(?:\\."+F[N]+")*))";var X=T++,U="v?"+F[D]+F[B]+"?"+F[z]+"?";F[X]="^"+U+"$";var W="[v=\\s]*"+F[R]+F[L]+"?"+F[z]+"?",H=T++;F[H]="^"+W+"$";var Z=T++;F[Z]="((?:<|>)?=?)";var G=T++;F[G]=F[I]+"|x|X|\\*";var K=T++;F[K]=F[V]+"|x|X|\\*";var Q=T++;F[Q]="[v=\\s]*("+F[K]+")(?:\\.("+F[K]+")(?:\\.("+F[K]+")(?:"+F[B]+")?"+F[z]+"?)?)?";var Y=T++;F[Y]="[v=\\s]*("+F[G]+")(?:\\.("+F[G]+")(?:\\.("+F[G]+")(?:"+F[L]+")?"+F[z]+"?)?)?";var ee=T++;F[ee]="^"+F[Z]+"\\s*"+F[Q]+"$";var te=T++;F[te]="^"+F[Z]+"\\s*"+F[Y]+"$";var re=T++;F[re]="(?:~>?)";var ne=T++;F[ne]="(\\s*)"+F[re]+"\\s+",C[ne]=new RegExp(F[ne],"g");var oe=T++;F[oe]="^"+F[re]+F[Q]+"$";var ie=T++;F[ie]="^"+F[re]+F[Y]+"$";var ae=T++;F[ae]="(?:\\^)";var se=T++;F[se]="(\\s*)"+F[ae]+"\\s+",C[se]=new RegExp(F[se],"g");var ce=T++;F[ce]="^"+F[ae]+F[Q]+"$";var ue=T++;F[ue]="^"+F[ae]+F[Y]+"$";var le=T++;F[le]="^"+F[Z]+"\\s*("+W+")$|^$";var pe=T++;F[pe]="^"+F[Z]+"\\s*("+U+")$|^$";var fe=T++;F[fe]="(\\s*)"+F[Z]+"\\s*("+W+"|"+F[Q]+")",C[fe]=new RegExp(F[fe],"g");var he=T++;F[he]="^\\s*("+F[Q]+")\\s+-\\s+("+F[Q]+")\\s*$";var de=T++;F[de]="^\\s*("+F[Y]+")\\s+-\\s+("+F[Y]+")\\s*$";var ve=T++;F[ve]="(<|>)?=?\\s*\\*";for(var me=0;me<T;me++)O(me,F[me]),C[me]||(C[me]=new RegExp(F[me]));t.parse=r,t.valid=function(e,t){var n=r(e,t);return n?n.version:null},t.clean=function(e,t){var n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null},t.SemVer=n,n.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},n.prototype.toString=function(){return this.version},n.prototype.compare=function(e){return O("SemVer.compare",this.version,this.loose,e),e instanceof n||(e=new n(e,this.loose)),this.compareMain(e)||this.comparePre(e)},n.prototype.compareMain=function(e){return e instanceof n||(e=new n(e,this.loose)),o(this.major,e.major)||o(this.minor,e.minor)||o(this.patch,e.patch)},n.prototype.comparePre=function(e){var t=this;if(e instanceof n||(e=new n(e,this.loose)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var i=t.prerelease[r],a=e.prerelease[r];if(O("prerelease compare",r,i,a),void 0===i&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===i)return-1;if(i!==a)return o(i,a)}while(++r)},n.prototype.inc=function(e,t){var r=this;switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof r.prerelease[n]&&(r.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,o){"string"==typeof r&&(o=r,r=void 0);try{return new n(e,r).inc(t,o).version}catch(e){return null}},t.diff=function(e,t){if(c(e,t))return null;var n=r(e),o=r(t);if(n.prerelease.length||o.prerelease.length){for(var i in n)if(("major"===i||"minor"===i||"patch"===i)&&n[i]!==o[i])return"pre"+i;return"prerelease"}for(var i in n)if(("major"===i||"minor"===i||"patch"===i)&&n[i]!==o[i])return i},t.compareIdentifiers=o;var ye=/^[0-9]+$/;t.rcompareIdentifiers=function(e,t){return o(t,e)},t.major=function(e,t){return new n(e,t).major},t.minor=function(e,t){return new n(e,t).minor},t.patch=function(e,t){return new n(e,t).patch},t.compare=i,t.compareLoose=function(e,t){return i(e,t,!0)},t.rcompare=function(e,t,r){return i(t,e,r)},t.sort=function(e,r){return e.sort(function(e,n){return t.compare(e,n,r)})},t.rsort=function(e,r){return e.sort(function(e,n){return t.rcompare(e,n,r)})},t.gt=a,t.lt=s,t.eq=c,t.neq=u,t.gte=l,t.lte=p,t.cmp=f,t.Comparator=h;var ge={};h.prototype.parse=function(e){var t=this.loose?C[le]:C[pe],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new n(r[2],this.loose):this.semver=ge},h.prototype.toString=function(){return this.value},h.prototype.test=function(e){return O("Comparator.test",e,this.loose),this.semver===ge||("string"==typeof e&&(e=new n(e,this.loose)),f(e,this.operator,this.semver,this.loose))},h.prototype.intersects=function(e,t){if(!(e instanceof h))throw new TypeError("a Comparator is required");var r;if(""===this.operator)return r=new d(e.value,t),$(this.value,r,t);if(""===e.operator)return r=new d(this.value,t),$(e.semver,r,t);var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=f(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=f(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||o||i&&a||s||c},t.Range=d,d.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},d.prototype.toString=function(){return this.range},d.prototype.parseRange=function(e){var t=this.loose;e=e.trim(),O("range",e,t);var r=t?C[de]:C[he];e=e.replace(r,S),O("hyphen replace",e),e=e.replace(C[fe],"$1$2$3"),O("comparator trim",e,C[fe]),e=(e=(e=e.replace(C[ne],"$1~")).replace(C[se],"$1^")).split(/\s+/).join(" ");var n=t?C[le]:C[pe],o=e.split(" ").map(function(e){return v(e,t)}).join(" ").split(/\s+/);return this.loose&&(o=o.filter(function(e){return!!e.match(n)})),o=o.map(function(e){return new h(e,t)})},d.prototype.intersects=function(e,t){if(!(e instanceof d))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(r){return e.set.some(function(e){return e.every(function(e){return r.intersects(e,t)})})})})},t.toComparators=function(e,t){return new d(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})},d.prototype.test=function(e){var t=this;if(!e)return!1;"string"==typeof e&&(e=new n(e,this.loose));for(var r=0;r<this.set.length;r++)if(j(t.set[r],e))return!0;return!1},t.satisfies=$,t.maxSatisfying=function(e,t,r){var o=null,i=null;try{var a=new d(t,r)}catch(e){return null}return e.forEach(function(e){a.test(e)&&(o&&-1!==i.compare(e)||(i=new n(o=e,r)))}),o},t.minSatisfying=function(e,t,r){var o=null,i=null;try{var a=new d(t,r)}catch(e){return null}return e.forEach(function(e){a.test(e)&&(o&&1!==i.compare(e)||(i=new n(o=e,r)))}),o},t.validRange=function(e,t){try{return new d(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,r){return x(e,t,"<",r)},t.gtr=function(e,t,r){return x(e,t,">",r)},t.outside=x,t.prerelease=function(e,t){var n=r(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,r){return e=new d(e,r),t=new d(t,r),e.intersects(t)}}),Jt=function(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];console.debug("[JS Framework] define a component "+t);var o,i;if("function"==typeof(i=r.length>1?r[1]:r[0])&&(o=i,i=null),o){var a={exports:{}};o(function(t){if(yt(t)){var r=p(t);return Re(e,r)}if(gt(t)){var n=p(t);return e.requireModule(n)}if(wt(t)||_t(t)){var o=f(t);return e.commonModules[o]}},a.exports,a),i=a.exports}if(yt(t)){var s=p(t);Pe(e,s,i)}else if(gt(t)){var c;Ie((c={},c[p(t)]=i,c))}else if(wt(t)){var u=f(t);e.commonModules[u]=i}else if(_t(t)){var l=f(t);i.template||i.style||i.methods?Pe(e,l,i):e.commonModules[l]=i}},Dt=function(e){this.id=e,this.map=[],this.hooks=[]};Dt.prototype.isEmpty=function(){return 0===this.map.length},Dt.prototype.append=function(e,t,r,n){var o=this;this.hasTimer||(this.hasTimer=!0,setTimeout(function(){o.hasTimer=!1,o.flush(!0)},0));var i=this.map;i[t]||(i[t]={});var a=i[t];a[e]||(a[e]={}),"element"===e?(a[e][r]||(a[e][r]=[]),a[e][r].push(n)):a[e][r]=n},Dt.prototype.flush=function(e){var t=this.map.slice();this.map.length=0,t.forEach(function(e){nt(e,"repeat"),nt(e,"shown"),ot(e,"element")});var r=this.hooks.slice();this.hooks.length=0,r.forEach(function(e){e()}),this.isEmpty()||this.flush()},Dt.prototype.then=function(e){this.hooks.push(e)},it.prototype.requireModule=function(e){return De(this,e)},it.prototype.updateActions=function(){return Qe(this)},it.prototype.callTasks=function(e){return Ye(this,e)},Object.freeze(it),Object.freeze(it.prototype);var Rt={},Pt=Mt.nativeComponentMap;global.registerMethods=at;var qt={fireEvent:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Ge.apply(void 0,[Rt[e]].concat(t))},callback:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Ke.apply(void 0,[Rt[e]].concat(t))}};at(ct),Object.freeze(Ve),e.registerComponents=function(e){Array.isArray(e)&&e.forEach(function(e){e&&("string"==typeof e?Pt[e]=!0:"object"==typeof e&&"string"==typeof e.type&&(Pt[e.type]=e))})},e.registerModules=function(e){"object"==typeof e&&Ie(e)},e.registerMethods=at,e.createInstance=function(e,t,r,n,o){var i=(o||{}).services;m();var a=Rt[e];r=r||{};var s;return a?s=new Error('invalid instance id "'+e+'"'):(a=new it(e,r),Rt[e]=a,s=et(a,t,n,i)),s instanceof Error?s:a},e.init=function(e){Mt.Document=e.Document,Mt.Element=e.Element,Mt.Comment=e.Comment,Mt.sendTasks=e.sendTasks,Mt.Listener=e.Listener},e.refreshInstance=function(e,t){var r=Rt[e];return r?Ue(r,t):new Error('invalid instance id "'+e+'"')},e.destroyInstance=function(e){"function"==typeof markupState&&markupState(),m();var t=Rt[e];if(!t)return new Error('invalid instance id "'+e+'"');We(t),delete Rt[e];var r=Math.round(e);return r>0&&(r%18||"function"!=typeof notifyTrimMemory||notifyTrimMemory()),Rt},e.receiveTasks=function(e,t){if(Rt[e]&&Array.isArray(t)){var r=[];return t.forEach(function(t){var n=qt[t.method],o=[].concat(t.args);"function"==typeof n&&(o.unshift(e),r.push(n.apply(void 0,o)))}),r}return new Error('invalid instance id "'+e+'" or tasks')},e.getRoot=function(e){var t=Rt[e];return t?Ze(t):new Error('invalid instance id "'+e+'"')},Object.defineProperty(e,"__esModule",{value:!0})});