diff --git a/packages/omio/examples/store-counter/b.js b/packages/omio/examples/store-counter/b.js
index b39f28a72..4e05d022f 100644
--- a/packages/omio/examples/store-counter/b.js
+++ b/packages/omio/examples/store-counter/b.js
@@ -1698,9 +1698,9 @@
extendStoreUpate(store);
var timeout = null;
var patchs = {};
- obaa(store.data, function (path, a, b) {
+ obaa(store.data, function (prop, val, old, path) {
clearTimeout(timeout);
- var key = fixPath(path);
+ var key = fixPath(path + '-' + prop);
patchs[key] = true;
timeout = setTimeout(function () {
store.update(patchs);
@@ -1781,7 +1781,7 @@
function fixPath(path) {
var mpPath = '';
- var arr = path.replace('/', '').split('/');
+ var arr = path.replace('#-', '').split('-');
arr.forEach(function (item, index) {
if (index) {
if (isNaN(Number(item))) {
diff --git a/packages/omio/examples/store-counter/b.js.map b/packages/omio/examples/store-counter/b.js.map
index ac8ad1a7b..448425a29 100644
--- a/packages/omio/examples/store-counter/b.js.map
+++ b/packages/omio/examples/store-counter/b.js.map
@@ -1 +1 @@
-{"version":3,"file":"b.js","sources":["../../src/vnode.js","../../src/options.js","../../src/h.js","../../src/util.js","../../src/clone-element.js","../../src/constants.js","../../src/render-queue.js","../../src/vdom/index.js","../../src/dom/index.js","../../src/style.js","../../src/vdom/diff.js","../../src/vdom/component-recycler.js","../../src/obaa.js","../../src/tick.js","../../src/observe.js","../../src/vdom/component.js","../../src/component.js","../../src/render.js","../../src/define.js","../../src/rpx.js","../../src/model-view.js","../../src/class.js","../../src/get-host.js","../../src/render-to-string.js","../../src/omi.js","main.js"],"sourcesContent":["/** Virtual DOM Node */\nexport function VNode() {}\n","function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n if (typeof self !== 'undefined') {\n return self\n } else if (typeof window !== 'undefined') {\n return window\n } else if (typeof global !== 'undefined') {\n return global\n }\n return (function() {\n return this\n })()\n }\n return global\n}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nexport default {\n scopedStyle: true,\n mapping: {},\n isWeb: true,\n staticStyleMapping: {},\n doc: typeof document === 'object' ? document : null,\n root: getGlobal(),\n //styleCache :[{ctor:ctor,ctorName:ctorName,style:style}]\n styleCache: []\n //componentChange(component, element) { },\n /** If `true`, `prop` changes trigger synchronous component updates.\n *\t@name syncComponentUpdates\n *\t@type Boolean\n *\t@default true\n */\n //syncComponentUpdates: true,\n\n /** Processes all created VNodes.\n *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\n */\n //vnode(vnode) { }\n\n /** Hook invoked after a component is mounted. */\n //afterMount(component) { },\n\n /** Hook invoked after the DOM is updated with a component's latest render. */\n //afterUpdate(component) { }\n\n /** Hook invoked immediately before a component is unmounted. */\n // beforeUnmount(component) { }\n}\n","import { VNode } from './vnode'\nimport options from './options'\n\nconst stack = []\n\nconst EMPTY_CHILDREN = []\n\n/**\n * JSX/hyperscript reviver.\n * @see http://jasonformat.com/wtf-is-jsx\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\n *\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\n *\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\n * the current _actual_ DOM structure, and applying only the differences.\n *\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\n * and optionally children to append to the element.\n *\n * @example The following DOM tree\n *\n * `
Hello!
`\n *\n * can be constructed using this function as:\n *\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\n *\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\n * @param {Object} attributes\tAny attributes/props to set on the created element.\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\n *\n * @public\n */\nexport function h(nodeName, attributes) {\n let children = EMPTY_CHILDREN,\n lastSimple,\n child,\n simple,\n i\n for (i = arguments.length; i-- > 2; ) {\n stack.push(arguments[i])\n }\n if (attributes && attributes.children != null) {\n if (!stack.length) stack.push(attributes.children)\n delete attributes.children\n }\n while (stack.length) {\n if ((child = stack.pop()) && child.pop !== undefined) {\n for (i = child.length; i--; ) stack.push(child[i])\n } else {\n if (typeof child === 'boolean') child = null\n\n if ((simple = typeof nodeName !== 'function')) {\n if (child == null) child = ''\n else if (typeof child === 'number') child = String(child)\n else if (typeof child !== 'string') simple = false\n }\n\n if (simple && lastSimple) {\n children[children.length - 1] += child\n } else if (children === EMPTY_CHILDREN) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n let p = new VNode()\n p.nodeName = nodeName\n p.children = children\n\tp.attributes = attributes == null ? undefined : attributes\n p.key = attributes == null ? undefined : attributes.key\n\n // if a \"vnode hook\" is defined, pass every created VNode to it\n if (options.vnode !== undefined) options.vnode(p)\n\n return p\n}\n","'use strict'\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols\nvar hasOwnProperty = Object.prototype.hasOwnProperty\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable\n\nfunction toObject(val) {\n if (val === null || val === undefined) {\n throw new TypeError('Object.assign cannot be called with null or undefined')\n }\n\n return Object(val)\n}\n\nexport function assign(target, source) {\n var from\n var to = toObject(target)\n var symbols\n\n for (var s = 1; s < arguments.length; s++) {\n from = Object(arguments[s])\n\n for (var key in from) {\n if (hasOwnProperty.call(from, key)) {\n to[key] = from[key]\n }\n }\n\n if (getOwnPropertySymbols) {\n symbols = getOwnPropertySymbols(from)\n for (var i = 0; i < symbols.length; i++) {\n if (propIsEnumerable.call(from, symbols[i])) {\n to[symbols[i]] = from[symbols[i]]\n }\n }\n }\n }\n\n return to\n}\n\nif (typeof Element !== 'undefined' && !Element.prototype.addEventListener) {\n var oListeners = {};\n function runListeners(oEvent) {\n if (!oEvent) { oEvent = window.event; }\n for (var iLstId = 0, iElId = 0, oEvtListeners = oListeners[oEvent.type]; iElId < oEvtListeners.aEls.length; iElId++) {\n if (oEvtListeners.aEls[iElId] === this) {\n for (iLstId; iLstId < oEvtListeners.aEvts[iElId].length; iLstId++) { oEvtListeners.aEvts[iElId][iLstId].call(this, oEvent); }\n break;\n }\n }\n }\n Element.prototype.addEventListener = function (sEventType, fListener /*, useCapture (will be ignored!) */) {\n if (oListeners.hasOwnProperty(sEventType)) {\n var oEvtListeners = oListeners[sEventType];\n for (var nElIdx = -1, iElId = 0; iElId < oEvtListeners.aEls.length; iElId++) {\n if (oEvtListeners.aEls[iElId] === this) { nElIdx = iElId; break; }\n }\n if (nElIdx === -1) {\n oEvtListeners.aEls.push(this);\n oEvtListeners.aEvts.push([fListener]);\n this[\"on\" + sEventType] = runListeners;\n } else {\n var aElListeners = oEvtListeners.aEvts[nElIdx];\n if (this[\"on\" + sEventType] !== runListeners) {\n aElListeners.splice(0);\n this[\"on\" + sEventType] = runListeners;\n }\n for (var iLstId = 0; iLstId < aElListeners.length; iLstId++) {\n if (aElListeners[iLstId] === fListener) { return; }\n }\n aElListeners.push(fListener);\n }\n } else {\n oListeners[sEventType] = { aEls: [this], aEvts: [[fListener]] };\n this[\"on\" + sEventType] = runListeners;\n }\n };\n Element.prototype.removeEventListener = function (sEventType, fListener /*, useCapture (will be ignored!) */) {\n if (!oListeners.hasOwnProperty(sEventType)) { return; }\n var oEvtListeners = oListeners[sEventType];\n for (var nElIdx = -1, iElId = 0; iElId < oEvtListeners.aEls.length; iElId++) {\n if (oEvtListeners.aEls[iElId] === this) { nElIdx = iElId; break; }\n }\n if (nElIdx === -1) { return; }\n for (var iLstId = 0, aElListeners = oEvtListeners.aEvts[nElIdx]; iLstId < aElListeners.length; iLstId++) {\n if (aElListeners[iLstId] === fListener) { aElListeners.splice(iLstId, 1); }\n }\n };\n}\n\n\nif (typeof Object.create !== 'function') {\n Object.create = function(proto, propertiesObject) {\n if (typeof proto !== 'object' && typeof proto !== 'function') {\n throw new TypeError('Object prototype may only be an Object: ' + proto)\n } else if (proto === null) {\n throw new Error(\n \"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\"\n )\n }\n\n // if (typeof propertiesObject != 'undefined') {\n // throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support a second argument.\");\n // }\n\n function F() {}\n F.prototype = proto\n\n return new F()\n }\n}\n\nif (!String.prototype.trim) {\n String.prototype.trim = function () {\n return this.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '')\n }\n}\n\n/**\n * Copy all properties from `props` onto `obj`.\n * @param {Object} obj\t\tObject onto which properties should be copied.\n * @param {Object} props\tObject from which to copy properties.\n * @returns obj\n * @private\n */\nexport function extend(obj, props) {\n for (let i in props) obj[i] = props[i]\n return obj\n}\n\n/** Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} [ref=null]\n * @param {any} [value]\n */\nexport function applyRef(ref, value) {\n if (ref) {\n if (typeof ref == 'function') ref(value)\n else ref.current = value\n }\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n *\n * @param {Function} callback\n */\n\nlet usePromise = typeof Promise == 'function'\n\n// for native\nif (\n typeof document !== 'object' &&\n typeof global !== 'undefined' &&\n global.__config__\n) {\n if (global.__config__.platform === 'android') {\n usePromise = true\n } else {\n let systemVersion =\n (global.__config__.systemVersion &&\n global.__config__.systemVersion.split('.')[0]) ||\n 0\n if (systemVersion > 8) {\n usePromise = true\n }\n }\n}\n\nexport const defer = usePromise\n ? Promise.resolve().then.bind(Promise.resolve())\n : setTimeout\n\nexport function isArray(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport function nProps(props) {\n if (!props || isArray(props)) return {}\n const result = {}\n Object.keys(props).forEach(key => {\n result[key] = props[key].value\n })\n return result\n}\n\nexport function getUse(data, paths) {\n const obj = {}\n paths.forEach((path, index) => {\n const isPath = typeof path === 'string'\n if (isPath) {\n obj[index] = getTargetByPath(data, path)\n } else {\n const key = Object.keys(path)[0]\n const value = path[key]\n if (typeof value === 'string') {\n obj[index] = getTargetByPath(data, value)\n } else {\n const tempPath = value[0]\n if (typeof tempPath === 'string') {\n const tempVal = getTargetByPath(data, tempPath)\n obj[index] = value[1] ? value[1](tempVal) : tempVal\n } else {\n const args = []\n tempPath.forEach(path =>{\n args.push(getTargetByPath(data, path))\n })\n obj[index] = value[1].apply(null, args)\n }\n }\n obj[key] = obj[index]\n }\n })\n return obj\n}\n\nexport function getTargetByPath(origin, path) {\n const arr = path.replace(/]/g, '').replace(/\\[/g, '.').split('.')\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n current = current[arr[i]]\n }\n return current\n}","import { extend } from './util'\nimport { h } from './h'\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\n * @param {Object} props\tAttributes/props to add when cloning\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\n */\nexport function cloneElement(vnode, props) {\n return h(\n vnode.nodeName,\n extend(extend({}, vnode.attributes), props),\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\n )\n}\n","// render modes\n\nexport const NO_RENDER = 0\nexport const SYNC_RENDER = 1\nexport const FORCE_RENDER = 2\nexport const ASYNC_RENDER = 3\n\nexport const ATTR_KEY = '__omiattr_'\n\n// DOM properties that should NOT have \"px\" added when numeric\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i\n","import options from './options'\nimport { defer } from './util'\nimport { renderComponent } from './vdom/component'\n\n/** Managed queue of dirty components to be re-rendered */\n\nlet items = []\n\nexport function enqueueRender(component) {\n if (items.push(component) == 1) {\n ;(options.debounceRendering || defer)(rerender)\n }\n}\n\n/** Rerender all enqueued dirty components */\nexport function rerender() {\n\tlet p\n\twhile ( (p = items.pop()) ) {\n renderComponent(p)\n\t}\n}","import { extend } from '../util'\nimport options from '../options'\n\nconst mapping = options.mapping\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node\t\t\tDOM Node to compare\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\n * @private\n */\nexport function isSameNodeType(node, vnode, hydrating) {\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n return node.splitText !== undefined\n }\n if (typeof vnode.nodeName === 'string') {\n var ctor = mapping[vnode.nodeName]\n if (ctor) {\n return hydrating || node._componentConstructor === ctor\n }\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n }\n return hydrating || node._componentConstructor === vnode.nodeName\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n *\n * @param {Element} node\tA DOM Element to inspect the name of.\n * @param {String} nodeName\tUnnormalized name to compare against.\n */\nexport function isNamedNode(node, nodeName) {\n return (\n node.normalizedNodeName === nodeName ||\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\n )\n}\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n *\n * @param {VNode} vnode\n * @returns {Object} props\n */\nexport function getNodeProps(vnode) {\n let props = extend({}, vnode.attributes)\n props.children = vnode.children\n\n let defaultProps = vnode.nodeName.defaultProps\n if (defaultProps !== undefined) {\n for (let i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i]\n }\n }\n }\n\n return props\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\n\n/** Create an element with the given nodeName.\n *\t@param {String} nodeName\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\n *\t@returns {Element} node\n */\nexport function createNode(nodeName, isSvg) {\n let node = isSvg\n ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : options.doc.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\nfunction parseCSSText(cssText) {\n let cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, ' ').replace(/\\s+/g, ' ')\n let style = {},\n [a, b, rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/) || [a, b, cssTxt]\n let cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase())\n let properties = rule\n .split(';')\n .map(o => o.split(':').map(x => x && x.trim()))\n for (let [property, value] of properties) style[cssToJs(property)] = value\n return style\n}\n\n/** Remove a child node from its parent if attached.\n *\t@param {Element} node\t\tThe node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\n *\tIf `value` is `null`, the attribute/handler will be removed.\n *\t@param {Element} node\tAn element to mutate\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\n *\t@param {any} old\tThe last value that was set for this name/node pair\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\n *\t@private\n */\nexport function setAccessor(node, name, old, value, isSvg) {\n if (name === 'className') name = 'class'\n\n if (name === 'key') {\n // ignore\n } else if (name === 'ref') {\n applyRef(old, null)\n applyRef(value, node)\n } else if (name === 'class' && !isSvg) {\n node.className = value || ''\n } else if (name === 'style') {\n if (options.isWeb) {\n if (!value || typeof value === 'string' || typeof old === 'string') {\n node.style.cssText = value || ''\n }\n if (value && typeof value === 'object') {\n if (typeof old !== 'string') {\n for (let i in old) if (!(i in value)) node.style[i] = ''\n }\n for (let i in value) {\n node.style[i] =\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\n ? value[i] + 'px'\n : value[i]\n }\n }\n } else {\n let oldJson = old,\n currentJson = value\n if (typeof old === 'string') {\n oldJson = parseCSSText(old)\n }\n if (typeof value == 'string') {\n currentJson = parseCSSText(value)\n }\n\n let result = {},\n changed = false\n\n if (oldJson) {\n for (let key in oldJson) {\n if (typeof currentJson == 'object' && !(key in currentJson)) {\n result[key] = ''\n changed = true\n }\n }\n\n for (let ckey in currentJson) {\n if (currentJson[ckey] !== oldJson[ckey]) {\n result[ckey] = currentJson[ckey]\n changed = true\n }\n }\n\n if (changed) {\n node.setStyles(result)\n }\n } else {\n node.setStyles(currentJson)\n }\n }\n } else if (name === 'dangerouslySetInnerHTML') {\n if (value) node.innerHTML = value.__html || ''\n } else if (name[0] == 'o' && name[1] == 'n') {\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\n name = name.toLowerCase().substring(2)\n if (value) {\n if (!old) {\n node.addEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.addEventListener('touchstart', touchStart, useCapture)\n node.addEventListener('touchend', touchEnd, useCapture)\n }\n }\n } else {\n node.removeEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.removeEventListener('touchstart', touchStart, useCapture)\n node.removeEventListener('touchend', touchEnd, useCapture)\n }\n }\n ;(node._listeners || (node._listeners = {}))[name] = value\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n setProperty(node, name, value == null ? '' : value)\n if (value == null || value === false) node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n if (value == null || value === false) {\n if (ns)\n node.removeAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase()\n )\n else node.removeAttribute(name)\n } else if (typeof value !== 'function') {\n if (ns)\n node.setAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase(),\n value\n )\n else node.setAttribute(name, value)\n }\n }\n}\n\n/** Attempt to set a DOM property to the given value.\n *\tIE & FF throw for certain property-value combinations.\n */\nfunction setProperty(node, name, value) {\n try {\n node[name] = value\n } catch (e) {}\n}\n\n/** Proxy an event to hooked event handlers\n *\t@private\n */\nfunction eventProxy(e) {\n return this._listeners[e.type]((options.event && options.event(e)) || e)\n}\n\nfunction touchStart(e) {\n this.___touchX = e.touches[0].pageX\n this.___touchY = e.touches[0].pageY\n this.___scrollTop = document.body.scrollTop\n}\n\nfunction touchEnd(e) {\n if (\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\n ) {\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\n }\n}","import options from './options'\n\nlet styleId = 0\n\nexport function getCtorName(ctor) {\n for (let i = 0, len = options.styleCache.length; i < len; i++) {\n let item = options.styleCache[i]\n\n if (item.ctor === ctor) {\n return item.attrName\n }\n }\n\n let attrName = 's' + styleId\n options.styleCache.push({ ctor, attrName })\n styleId++\n\n return attrName\n}\n\n// many thanks to https://github.com/thomaspark/scoper/\nexport function scoper(css, prefix) {\n prefix = '[' + prefix.toLowerCase() + ']'\n // https://www.w3.org/TR/css-syntax-3/#lexical\n css = css.replace(/\\/\\*[^*]*\\*+([^/][^*]*\\*+)*\\//g, '')\n // eslint-disable-next-line\n let re = new RegExp('([^\\r\\n,{}:]+)(:[^\\r\\n,{}]+)?(,(?=[^{}]*{)|\\s*{)', 'g')\n /**\n * Example:\n *\n * .classname::pesudo { color:red }\n *\n * g1 is normal selector `.classname`\n * g2 is pesudo class or pesudo element\n * g3 is the suffix\n */\n css = css.replace(re, (g0, g1, g2, g3) => {\n if (typeof g2 === 'undefined') {\n g2 = ''\n }\n\n /* eslint-ignore-next-line */\n if (\n g1.match(\n /^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/\n )\n ) {\n return g1 + g2 + g3\n }\n\n let appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2\n //let prependClass = prefix + ' ' + g1.trim() + g2;\n\n return appendClass + g3\n //return appendClass + ',' + prependClass + g3;\n })\n\n return css\n}\n\nexport function addStyle(cssText, id) {\n id = id.toLowerCase()\n let ele = document.getElementById(id)\n let head = document.getElementsByTagName('head')[0]\n if (ele && ele.parentNode === head) {\n head.removeChild(ele)\n }\n\n let someThingStyles = document.createElement('style')\n head.appendChild(someThingStyles)\n someThingStyles.setAttribute('type', 'text/css')\n someThingStyles.setAttribute('id', id)\n if (window.ActiveXObject) {\n someThingStyles.styleSheet.cssText = cssText\n } else {\n someThingStyles.textContent = cssText\n }\n}\n\nexport function addStyleWithoutId(cssText) {\n let head = document.getElementsByTagName('head')[0]\n let someThingStyles = document.createElement('style')\n head.appendChild(someThingStyles)\n someThingStyles.setAttribute('type', 'text/css')\n\n if (window.ActiveXObject) {\n someThingStyles.styleSheet.cssText = cssText\n } else {\n someThingStyles.textContent = cssText\n }\n}\n\nexport function addScopedAttrStatic(vdom, attr) {\n if (options.scopedStyle) {\n scopeVdom(attr, vdom)\n } \n}\n\nexport function addStyleToHead(style, attr) {\n if (options.scopedStyle) {\n if (!options.staticStyleMapping[attr]) {\n addStyle(scoper(style, attr), attr)\n options.staticStyleMapping[attr] = true\n }\n } else if (!options.staticStyleMapping[attr]) {\n addStyleWithoutId(style)\n options.staticStyleMapping[attr] = true\n }\n}\n\nexport function scopeVdom(attr, vdom) {\n if (typeof vdom === 'object') {\n vdom.attributes = vdom.attributes || {}\n vdom.attributes[attr] = ''\n vdom.css = vdom.css || {}\n vdom.css[attr] = ''\n vdom.children.forEach(child => scopeVdom(attr, child))\n }\n}\n\nexport function scopeHost(vdom, css) {\n if (typeof vdom === 'object' && css) {\n vdom.attributes = vdom.attributes || {}\n for (let key in css) {\n vdom.attributes[key] = ''\n }\n }\n}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { buildComponentFromVNode } from './component'\nimport { createNode, setAccessor } from '../dom/index'\nimport { unmountComponent } from './component'\nimport options from '../options'\nimport { applyRef } from '../util'\nimport { removeNode } from '../dom/index'\nimport { isArray } from '../util'\nimport { addStyleToHead, getCtorName } from '../style'\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nexport const mounts = []\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false\n\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false\n\n/** Invoke queued componentDidMount lifecycle methods */\nexport function flushMounts() {\n let c\n while ((c = mounts.pop())) {\n if (options.afterMount) options.afterMount(c)\n if (c.installed) c.installed()\n if (c.constructor.css || c.css) {\n addStyleToHead(c.constructor.css ? c.constructor.css : (typeof c.css === 'function' ? c.css() : c.css), '_s' + getCtorName(c.constructor))\n }\n }\n}\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n if (!diffLevel++) {\n // when first starting the diff, check if we're diffing an SVG or within an SVG\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\n\n // hydration is indicated by the existing element to be diffed not having a prop cache\n hydrating = dom != null && !(ATTR_KEY in dom)\n }\n let ret\n\n if (isArray(vnode)) {\n vnode = {\n nodeName: 'span',\n children: vnode\n }\n }\n\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n\n // diffLevel being reduced to 0 means we're exiting the diff\n if (!--diffLevel) {\n hydrating = false\n // invoke queued componentDidMount lifecycle methods\n if (!componentRoot) flushMounts()\n }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n let out = dom,\n prevSvgMode = isSvgMode\n\n // empty values (null, undefined, booleans) render as empty Text nodes\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n if (options.mapping[vnodeName]) {\n vnode.nodeName = options.mapping[vnodeName]\n return buildComponentFromVNode(dom, vnode, context, mountAll)\n }\n if (typeof vnodeName == 'function') {\n return buildComponentFromVNode(dom, vnode, context, mountAll)\n }\n\n // Fast case: Strings & Numbers create/update Text nodes.\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n // update if it's already a Text node:\n if (\n dom &&\n dom.splitText !== undefined &&\n dom.parentNode &&\n (!dom._component || componentRoot)\n ) {\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n if (dom.nodeValue != vnode) {\n dom.nodeValue = vnode\n }\n } else {\n // it wasn't a Text node: replace it with one and recycle the old Element\n out = document.createTextNode(vnode)\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n recollectNodeTree(dom, true)\n }\n }\n\n //ie8 error\n try {\n out[ATTR_KEY] = true\n } catch (e) {}\n\n return out\n }\n\n // Tracks entering and exiting SVG namespace when descending through the tree.\n isSvgMode =\n vnodeName === 'svg'\n ? true\n : vnodeName === 'foreignObject'\n ? false\n : isSvgMode\n\n // If there's no existing element or it's the wrong type, create a new one:\n vnodeName = String(vnodeName)\n if (!dom || !isNamedNode(dom, vnodeName)) {\n out = createNode(vnodeName, isSvgMode)\n\n if (dom) {\n // move children into the replacement node\n while (dom.firstChild) out.appendChild(dom.firstChild)\n\n // if the previous Element was mounted into the DOM, replace it inline\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n // recycle the old element (skips non-Element node types)\n recollectNodeTree(dom, true)\n }\n }\n\n let fc = out.firstChild,\n props = out[ATTR_KEY],\n vchildren = vnode.children\n\n if (props == null) {\n props = out[ATTR_KEY] = {}\n for (let a = out.attributes, i = a.length; i--; )\n props[a[i].name] = a[i].value\n }\n\n // Optimization: fast-path for elements containing a single TextNode:\n if (\n !hydrating &&\n vchildren &&\n vchildren.length === 1 &&\n typeof vchildren[0] === 'string' &&\n fc != null &&\n fc.splitText !== undefined &&\n fc.nextSibling == null\n ) {\n if (fc.nodeValue != vchildren[0]) {\n fc.nodeValue = vchildren[0]\n }\n }\n // otherwise, if there are existing or new children, diff them:\n else if ((vchildren && vchildren.length) || fc != null) {\n innerDiffNode(\n out,\n vchildren,\n context,\n mountAll,\n hydrating || props.dangerouslySetInnerHTML != null\n )\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props)\n\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\n isSvgMode = prevSvgMode\n\n return out\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n let originalChildren = dom.childNodes,\n children = [],\n keyed = {},\n keyedLen = 0,\n min = 0,\n len = originalChildren.length,\n childrenLen = 0,\n vlen = vchildren ? vchildren.length : 0,\n j,\n c,\n f,\n vchild,\n child\n\n // Build up a map of keyed children and an Array of unkeyed children:\n if (len !== 0) {\n for (let i = 0; i < len; i++) {\n let child = originalChildren[i],\n props = child[ATTR_KEY],\n key =\n vlen && props\n ? child._component\n ? child._component.__key\n : props.key\n : null\n if (key != null) {\n keyedLen++\n keyed[key] = child\n } else if (\n props ||\n (child.splitText !== undefined\n ? isHydrating\n ? child.nodeValue.trim()\n : true\n : isHydrating)\n ) {\n children[childrenLen++] = child\n }\n }\n }\n\n if (vlen !== 0) {\n for (let i = 0; i < vlen; i++) {\n vchild = vchildren[i]\n child = null\n\n // attempt to find a node based on key matching\n let key = vchild.key\n if (key != null) {\n if (keyedLen && keyed[key] !== undefined) {\n child = keyed[key]\n keyed[key] = undefined\n keyedLen--\n }\n }\n // attempt to pluck a node of the same type from the existing children\n else if (!child && min < childrenLen) {\n for (j = min; j < childrenLen; j++) {\n if (\n children[j] !== undefined &&\n isSameNodeType((c = children[j]), vchild, isHydrating)\n ) {\n child = c\n children[j] = undefined\n if (j === childrenLen - 1) childrenLen--\n if (j === min) min++\n break\n }\n }\n }\n\n // morph the matched/found/created DOM child to match vchild (deep)\n child = idiff(child, vchild, context, mountAll)\n\n f = originalChildren[i]\n if (child && child !== dom && child !== f) {\n if (f == null) {\n dom.appendChild(child)\n } else if (child === f.nextSibling) {\n removeNode(f)\n } else {\n dom.insertBefore(child, f)\n }\n }\n }\n }\n\n // remove unused keyed children:\n if (keyedLen) {\n for (let i in keyed)\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\n }\n\n // remove orphaned unkeyed children:\n while (min <= childrenLen) {\n if ((child = children[childrenLen--]) !== undefined)\n recollectNodeTree(child, false)\n }\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\n let component = node._component\n if (component) {\n // if node is owned by a Component, unmount that component (ends up recursing back here)\n unmountComponent(component)\n } else {\n // If the node's VNode had a ref function, invoke it with null here.\n // (this is part of the React spec, and smart for unsetting references)\n if (node[ATTR_KEY] != null) applyRef(node[ATTR_KEY].ref, null)\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n }\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node) {\n node = node.lastChild\n while (node) {\n let next = node.previousSibling\n recollectNodeTree(node, true)\n node = next\n }\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old) {\n let name\n\n // remove attributes no longer present on the vnode by setting them to undefined\n for (name in old) {\n if (!(attrs && attrs[name] != null) && old[name] != null) {\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (\n name !== 'children' &&\n name !== 'innerHTML' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\n }\n }\n}\n","import Component from '../component'\nimport { getUse } from '../util'\n/** Retains a pool of Components for re-use, keyed on component name.\n *\tNote: since component names are not unique or even necessarily available, these are primarily a form of sharding.\n *\t@private\n */\nconst components = {}\n\n/** Reclaim a component for later re-use by the recycler. */\nexport function collectComponent(component) {\n let name = component.constructor.name\n ;(components[name] || (components[name] = [])).push(component)\n}\n\n/** Create a component. Normalizes differences between PFC's and classful Components. */\nexport function createComponent(Ctor, props, context, vnode) {\n let list = components[Ctor.name],\n inst\n\n if (Ctor.prototype && Ctor.prototype.render) {\n inst = new Ctor(props, context)\n Component.call(inst, props, context)\n } else {\n inst = new Component(props, context)\n inst.constructor = Ctor\n inst.render = doRender\n }\n vnode && (inst.scopedCssAttr = vnode.css)\n\n if (inst.constructor.use && inst.store && inst.store.data) {\n inst.store.instances.push(inst)\n inst.use = getUse(inst.store.data, inst.constructor.use)\n }\n\n if (list) {\n for (let i = list.length; i--; ) {\n if (list[i].constructor === Ctor) {\n inst.nextBase = list[i].nextBase\n list.splice(i, 1)\n break\n }\n }\n }\n return inst\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, data, context) {\n return this.constructor(props, context)\n}\n","/* obaa 1.0.0\n * By dntzhang\n * Github: https://github.com/Tencent/omi\n * MIT Licensed.\n */\n\nvar obaa = function(target, arr, callback) {\n var _observe = function(target, arr, callback) {\n if (!target.$observer) target.$observer = this\n var $observer = target.$observer\n var eventPropArr = []\n if (obaa.isArray(target)) {\n if (target.length === 0) {\n target.$observeProps = {}\n target.$observeProps.$observerPath = '#'\n }\n $observer.mock(target)\n }\n for (var prop in target) {\n if (target.hasOwnProperty(prop)) {\n if (callback) {\n if (obaa.isArray(arr) && obaa.isInArray(arr, prop)) {\n eventPropArr.push(prop)\n $observer.watch(target, prop)\n } else if (obaa.isString(arr) && prop == arr) {\n eventPropArr.push(prop)\n $observer.watch(target, prop)\n }\n } else {\n eventPropArr.push(prop)\n $observer.watch(target, prop)\n }\n }\n }\n $observer.target = target\n if (!$observer.propertyChangedHandler) $observer.propertyChangedHandler = []\n var propChanged = callback ? callback : arr\n $observer.propertyChangedHandler.push({\n all: !callback,\n propChanged: propChanged,\n eventPropArr: eventPropArr\n })\n }\n _observe.prototype = {\n onPropertyChanged: function(prop, value, oldValue, target, path) {\n if (value !== oldValue && this.propertyChangedHandler) {\n var rootName = obaa._getRootName(prop, path)\n for (\n var i = 0, len = this.propertyChangedHandler.length;\n i < len;\n i++\n ) {\n var handler = this.propertyChangedHandler[i]\n if (\n handler.all ||\n obaa.isInArray(handler.eventPropArr, rootName) ||\n rootName.indexOf('Array-') === 0\n ) {\n handler.propChanged.call(this.target, prop, value, oldValue, path)\n }\n }\n }\n if (prop.indexOf('Array-') !== 0 && typeof value === 'object') {\n this.watch(target, prop, target.$observeProps.$observerPath)\n }\n },\n mock: function(target) {\n var self = this\n obaa.methods.forEach(function(item) {\n target[item] = function() {\n var old = Array.prototype.slice.call(this, 0)\n var result = Array.prototype[item].apply(\n this,\n Array.prototype.slice.call(arguments)\n )\n if (new RegExp('\\\\b' + item + '\\\\b').test(obaa.triggerStr)) {\n for (var cprop in this) {\n if (this.hasOwnProperty(cprop) && !obaa.isFunction(this[cprop])) {\n self.watch(this, cprop, this.$observeProps.$observerPath)\n }\n }\n //todo\n self.onPropertyChanged(\n 'Array-' + item,\n this,\n old,\n this,\n this.$observeProps.$observerPath\n )\n }\n return result\n }\n target[\n 'pure' + item.substring(0, 1).toUpperCase() + item.substring(1)\n ] = function() {\n return Array.prototype[item].apply(\n this,\n Array.prototype.slice.call(arguments)\n )\n }\n })\n },\n watch: function(target, prop, path) {\n if (prop === '$observeProps' || prop === '$observer') return\n if (obaa.isFunction(target[prop])) return\n if (!target.$observeProps) target.$observeProps = {}\n if (path !== undefined) {\n target.$observeProps.$observerPath = path\n } else {\n target.$observeProps.$observerPath = '#'\n }\n var self = this\n var currentValue = (target.$observeProps[prop] = target[prop])\n Object.defineProperty(target, prop, {\n get: function() {\n return this.$observeProps[prop]\n },\n set: function(value) {\n var old = this.$observeProps[prop]\n this.$observeProps[prop] = value\n self.onPropertyChanged(\n prop,\n value,\n old,\n this,\n target.$observeProps.$observerPath\n )\n }\n })\n if (typeof currentValue == 'object') {\n if (obaa.isArray(currentValue)) {\n this.mock(currentValue)\n if (currentValue.length === 0) {\n if (!currentValue.$observeProps) currentValue.$observeProps = {}\n if (path !== undefined) {\n currentValue.$observeProps.$observerPath = path\n } else {\n currentValue.$observeProps.$observerPath = '#'\n }\n }\n }\n for (var cprop in currentValue) {\n if (currentValue.hasOwnProperty(cprop)) {\n this.watch(\n currentValue,\n cprop,\n target.$observeProps.$observerPath + '-' + prop\n )\n }\n }\n }\n }\n }\n return new _observe(target, arr, callback)\n}\n\nobaa.methods = [\n 'concat',\n 'copyWithin',\n 'entries',\n 'every',\n 'fill',\n 'filter',\n 'find',\n 'findIndex',\n 'forEach',\n 'includes',\n 'indexOf',\n 'join',\n 'keys',\n 'lastIndexOf',\n 'map',\n 'pop',\n 'push',\n 'reduce',\n 'reduceRight',\n 'reverse',\n 'shift',\n 'slice',\n 'some',\n 'sort',\n 'splice',\n 'toLocaleString',\n 'toString',\n 'unshift',\n 'values',\n 'size'\n]\nobaa.triggerStr = [\n 'concat',\n 'copyWithin',\n 'fill',\n 'pop',\n 'push',\n 'reverse',\n 'shift',\n 'sort',\n 'splice',\n 'unshift',\n 'size'\n].join(',')\n\nobaa.isArray = function(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nobaa.isString = function(obj) {\n return typeof obj === 'string'\n}\n\nobaa.isInArray = function(arr, item) {\n for (var i = arr.length; --i > -1; ) {\n if (item === arr[i]) return true\n }\n return false\n}\n\nobaa.isFunction = function(obj) {\n return Object.prototype.toString.call(obj) == '[object Function]'\n}\n\nobaa._getRootName = function(prop, path) {\n if (path === '#') {\n return prop\n }\n return path.split('-')[1]\n}\n\nobaa.add = function(obj, prop) {\n var $observer = obj.$observer\n $observer.watch(obj, prop)\n}\n\nobaa.set = function(obj, prop, value, exec) {\n if (!exec) {\n obj[prop] = value\n }\n var $observer = obj.$observer\n $observer.watch(obj, prop)\n if (exec) {\n obj[prop] = value\n }\n}\n\nArray.prototype.size = function(length) {\n this.length = length\n}\n\nexport default obaa\n","const callbacks = []\nconst nextTickCallback = []\n\nexport function tick(fn, scope) {\n callbacks.push({ fn, scope })\n}\n\nexport function fireTick() {\n callbacks.forEach(item => {\n item.fn.call(item.scope)\n })\n\n nextTickCallback.forEach(nextItem => {\n nextItem.fn.call(nextItem.scope)\n })\n nextTickCallback.length = 0\n}\n\nexport function nextTick(fn, scope) {\n nextTickCallback.push({ fn, scope })\n}\n","import obaa from './obaa'\nimport { fireTick } from './tick'\n\nexport function proxyUpdate(ele) {\n let timeout = null\n obaa(ele.data, () => {\n if (ele._willUpdate) {\n return\n }\n if (ele.constructor.mergeUpdate) {\n clearTimeout(timeout)\n\n timeout = setTimeout(() => {\n ele.update()\n fireTick()\n }, 0)\n } else {\n ele.update()\n fireTick()\n }\n })\n}\n","import {\n SYNC_RENDER,\n NO_RENDER,\n FORCE_RENDER,\n ASYNC_RENDER,\n ATTR_KEY\n} from '../constants'\nimport options from '../options'\nimport { extend, applyRef } from '../util'\nimport { enqueueRender } from '../render-queue'\nimport { getNodeProps } from './index'\nimport {\n diff,\n mounts,\n diffLevel,\n flushMounts,\n recollectNodeTree,\n removeChildren\n} from './diff'\nimport { createComponent, collectComponent } from './component-recycler'\nimport { removeNode } from '../dom/index'\nimport {\n addScopedAttrStatic,\n getCtorName,\n scopeHost\n} from '../style'\nimport { proxyUpdate } from '../observe'\n\n/** Set a component's `props` (generally derived from JSX attributes).\n *\t@param {Object} props\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\n */\nexport function setComponentProps(component, props, opts, context, mountAll) {\n if (component._disable) return\n component._disable = true\n\n if ((component.__ref = props.ref)) delete props.ref\n if ((component.__key = props.key)) delete props.key\n\n if (!component.base || mountAll) {\n if (component.beforeInstall) component.beforeInstall()\n if (component.install) component.install()\n if (component.constructor.observe) {\n proxyUpdate(component)\n }\n } else if (component.receiveProps) {\n component.receiveProps(props, component.data, component.props)\n }\n\n if (context && context !== component.context) {\n if (!component.prevContext) component.prevContext = component.context\n component.context = context\n }\n\n if (!component.prevProps) component.prevProps = component.props\n component.props = props\n\n component._disable = false\n\n if (opts !== NO_RENDER) {\n if (\n opts === SYNC_RENDER ||\n options.syncComponentUpdates !== false ||\n !component.base\n ) {\n renderComponent(component, SYNC_RENDER, mountAll)\n } else {\n enqueueRender(component)\n }\n }\n\n applyRef(component.__ref, component)\n}\n\nfunction shallowComparison(old, attrs) {\n let name\n\n for (name in old) {\n if (attrs[name] == null && old[name] != null) {\n return true\n }\n }\n\n if (old.children.length > 0 || attrs.children.length > 0) {\n return true\n }\n\n for (name in attrs) {\n if (name != 'children') {\n let type = typeof attrs[name]\n if (type == 'function' || type == 'object') {\n return true\n } else if (attrs[name] != old[name]) {\n return true\n }\n }\n }\n}\n\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\n *\t@param {Component} component\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\n *\t@private\n */\nexport function renderComponent(component, opts, mountAll, isChild) {\n if (component._disable) return\n\n let props = component.props,\n data = component.data,\n context = component.context,\n previousProps = component.prevProps || props,\n previousState = component.prevState || data,\n previousContext = component.prevContext || context,\n isUpdate = component.base,\n nextBase = component.nextBase,\n initialBase = isUpdate || nextBase,\n initialChildComponent = component._component,\n skip = false,\n rendered,\n inst,\n cbase\n\n // if updating\n if (isUpdate) {\n component.props = previousProps\n component.data = previousState\n component.context = previousContext\n if (component.store || opts == FORCE_RENDER || shallowComparison(previousProps, props)) {\n skip = false\n if (component.beforeUpdate) {\n component.beforeUpdate(props, data, context)\n }\n } else {\n skip = true\n }\n component.props = props\n component.data = data\n component.context = context\n }\n\n component.prevProps = component.prevState = component.prevContext = component.nextBase = null\n\n if (!skip) {\n component.beforeRender && component.beforeRender()\n rendered = component.render(props, data, context)\n\n //don't rerender\n if (component.constructor.css || component.css) {\n addScopedAttrStatic(\n rendered,\n '_s' + getCtorName(component.constructor)\n )\n }\n\n scopeHost(rendered, component.scopedCssAttr)\n\n // context to pass to the child, can be updated via (grand-)parent component\n if (component.getChildContext) {\n context = extend(extend({}, context), component.getChildContext())\n }\n\n let childComponent = rendered && rendered.nodeName,\n toUnmount,\n base,\n ctor = options.mapping[childComponent]\n\n if (ctor) {\n // set up high order component link\n\n let childProps = getNodeProps(rendered)\n inst = initialChildComponent\n\n if (inst && inst.constructor === ctor && childProps.key == inst.__key) {\n setComponentProps(inst, childProps, SYNC_RENDER, context, false)\n } else {\n toUnmount = inst\n\n component._component = inst = createComponent(ctor, childProps, context)\n inst.nextBase = inst.nextBase || nextBase\n inst._parentComponent = component\n setComponentProps(inst, childProps, NO_RENDER, context, false)\n renderComponent(inst, SYNC_RENDER, mountAll, true)\n }\n\n base = inst.base\n } else {\n cbase = initialBase\n\n // destroy high order component link\n toUnmount = initialChildComponent\n if (toUnmount) {\n cbase = component._component = null\n }\n\n if (initialBase || opts === SYNC_RENDER) {\n if (cbase) cbase._component = null\n base = diff(\n cbase,\n rendered,\n context,\n mountAll || !isUpdate,\n initialBase && initialBase.parentNode,\n true\n )\n }\n }\n\n if (initialBase && base !== initialBase && inst !== initialChildComponent) {\n let baseParent = initialBase.parentNode\n if (baseParent && base !== baseParent) {\n baseParent.replaceChild(base, initialBase)\n\n if (!toUnmount) {\n initialBase._component = null\n recollectNodeTree(initialBase, false)\n }\n }\n }\n\n if (toUnmount) {\n unmountComponent(toUnmount)\n }\n\n component.base = base\n if (base && !isChild) {\n let componentRef = component,\n t = component\n while ((t = t._parentComponent)) {\n ;(componentRef = t).base = base\n }\n base._component = componentRef\n base._componentConstructor = componentRef.constructor\n }\n }\n\n if (!isUpdate || mountAll) {\n mounts.unshift(component)\n } else if (!skip) {\n // Ensure that pending componentDidMount() hooks of child components\n // are called before the componentDidUpdate() hook in the parent.\n // Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\n // flushMounts();\n\n if (component.afterUpdate) {\n //deprecated\n component.afterUpdate(previousProps, previousState, previousContext)\n }\n if (component.updated) {\n component.updated(previousProps, previousState, previousContext)\n }\n if (options.afterUpdate) options.afterUpdate(component)\n }\n\n if (component._renderCallbacks != null) {\n while (component._renderCallbacks.length)\n component._renderCallbacks.pop().call(component)\n }\n\n if (!diffLevel && !isChild) flushMounts()\n}\n\n/** Apply the Component referenced by a VNode to the DOM.\n *\t@param {Element} dom\tThe DOM node to mutate\n *\t@param {VNode} vnode\tA Component-referencing VNode\n *\t@returns {Element} dom\tThe created/mutated element\n *\t@private\n */\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\n let c = dom && dom._component,\n originalComponent = c,\n oldDom = dom,\n isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n isOwner = isDirectOwner,\n props = getNodeProps(vnode)\n while (c && !isOwner && (c = c._parentComponent)) {\n isOwner = c.constructor === vnode.nodeName\n }\n\n if (c && isOwner && (!mountAll || c._component)) {\n setComponentProps(c, props, ASYNC_RENDER, context, mountAll)\n dom = c.base\n } else {\n if (originalComponent && !isDirectOwner) {\n unmountComponent(originalComponent)\n dom = oldDom = null\n }\n\n c = createComponent(vnode.nodeName, props, context, vnode)\n if (dom && !c.nextBase) {\n c.nextBase = dom\n // passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\n oldDom = null\n }\n setComponentProps(c, props, SYNC_RENDER, context, mountAll)\n dom = c.base\n\n if (oldDom && dom !== oldDom) {\n oldDom._component = null\n recollectNodeTree(oldDom, false)\n }\n }\n\n return dom\n}\n\n/** Remove a component from the DOM and recycle it.\n *\t@param {Component} component\tThe Component instance to unmount\n *\t@private\n */\nexport function unmountComponent(component) {\n if (options.beforeUnmount) options.beforeUnmount(component)\n\n let base = component.base\n\n component._disable = true\n\n if (component.uninstall) component.uninstall()\n\n component.base = null\n\n // recursively tear down & recollect high-order component children:\n let inner = component._component\n if (inner) {\n unmountComponent(inner)\n } else if (base) {\n if (base[ATTR_KEY] != null) applyRef(base[ATTR_KEY].ref, null)\n\n component.nextBase = base\n\n removeNode(base)\n collectComponent(component)\n\n removeChildren(base)\n }\n\n applyRef(component.__ref, null)\n}\n","import { FORCE_RENDER } from './constants'\nimport { renderComponent } from './vdom/component'\nimport options from './options'\nimport { nProps, assign } from './util'\n\nlet id = 0\n\nexport default class Component {\n static is = 'WeElement'\n\n constructor(props, store) {\n this.props = assign(\n nProps(this.constructor.props),\n this.constructor.defaultProps,\n props\n )\n this.elementId = id++\n this.data = this.constructor.data || this.data || {}\n\n this._preCss = null\n\n this.store = store\n }\n\n update(callback) {\n this._willUpdate = true\n if (callback)\n (this._renderCallbacks = this._renderCallbacks || []).push(callback)\n renderComponent(this, FORCE_RENDER)\n if (options.componentChange) options.componentChange(this, this.base)\n this._willUpdate = false\n }\n\n fire(type, data) {\n Object.keys(this.props).every(key => {\n if ('on' + type.toLowerCase() === key.toLowerCase()) {\n this.props[key]({ detail: data })\n return false\n }\n return true\n })\n }\n\n render() {}\n}\n","import { diff } from './vdom/diff'\nimport obaa from './obaa'\nimport { getUse } from './util' \n\n/** Render JSX into a `parent` Element.\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\n *\t@param {Element} parent\t\tDOM element to render into\n *\t@param {object} [store]\n *\t@public\n */\nexport function render(vnode, parent, store, empty, merge) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n store.instances = []\n extendStoreUpate(store)\n let timeout = null\n let patchs = {}\n obaa(store.data, (path,a,b)=> {\n clearTimeout(timeout)\n const key = fixPath(path)\n patchs[key] = true\n timeout = setTimeout(() => {\n store.update(patchs)\n patchs = {}\n }, 0)\n })\n }\n\n if (empty) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild)\n }\n }\n\n if (merge) {\n merge =\n typeof merge === 'string'\n ? document.querySelector(merge)\n : merge\n }\n\n return diff(merge, vnode, store, false, parent, false)\n}\n\n\nfunction extendStoreUpate(store) {\n store.update = function(patch) {\n const updateAll = matchGlobalData(this.globalData, patch)\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n if (\n updateAll ||\n this.updateAll ||\n (instance.constructor.updatePath &&\n needUpdate(patch, instance.constructor.updatePath))\n ) {\n //update this.use\n instance.use = getUse(store.data, instance.constructor.use)\n instance.update()\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nexport function matchGlobalData(globalData, diffResult) {\n if (!globalData) return false\n for (let keyA in diffResult) {\n if (globalData.indexOf(keyA) > -1) {\n return true\n }\n for (let i = 0, len = globalData.length; i < len; i++) {\n if (includePath(keyA, globalData[i])) {\n return true\n }\n }\n }\n return false\n}\n\nexport function needUpdate(diffResult, updatePath) {\n for (let keyA in diffResult) {\n if (updatePath[keyA]) {\n return true\n }\n for (let keyB in updatePath) {\n if (includePath(keyA, keyB)) {\n return true\n }\n }\n }\n return false\n}\n\nfunction includePath(pathA, pathB) {\n if (pathA.indexOf(pathB) === 0) {\n const next = pathA.substr(pathB.length, 1)\n if (next === '[' || next === '.') {\n return true\n }\n }\n return false\n}\n\nexport function fixPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n arr.forEach((item, index) => {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n })\n return mpPath\n}\n\nfunction getArrayPatch(path, store) {\n const arr = path.replace('/', '').split('/')\n let current = store.data[arr[0]]\n for (let i = 1, len = arr.length; i < len - 1; i++) {\n current = current[arr[i]]\n }\n return { k: fixArrPath(path), v: current }\n}\n\nfunction fixArrPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n const len = arr.length\n arr.forEach((item, index) => {\n if (index < len - 1) {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n }\n })\n return mpPath\n}\n","import options from './options'\n\nconst OBJECTTYPE = '[object Object]'\nconst ARRAYTYPE = '[object Array]'\n\nexport function define(name, ctor) {\n options.mapping[name] = ctor\n if (ctor.use) {\n ctor.updatePath = getPath(ctor.use)\n } else if (ctor.data) { //Compatible with older versions\n ctor.updatePath = getUpdatePath(ctor.data)\n }\n}\n\nfunction getPath(obj) {\n if (Object.prototype.toString.call(obj) === '[object Array]') {\n const result = {}\n obj.forEach(item => {\n if (typeof item === 'string') {\n result[item] = true\n } else {\n const tempPath = item[Object.keys(item)[0]]\n if (typeof tempPath === 'string') {\n result[tempPath] = true\n } else {\n if(typeof tempPath[0] === 'string'){\n result[tempPath[0]] = true\n }else{\n tempPath[0].forEach(path => result[path] = true)\n }\n }\n }\n })\n return result\n } else {\n return getUpdatePath(obj)\n }\n}\n\nexport function getUpdatePath(data) {\n const result = {}\n dataToPath(data, result)\n return result\n}\n\nfunction dataToPath(data, result) {\n Object.keys(data).forEach(key => {\n result[key] = true\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], key, result)\n }\n })\n}\n\nfunction _objToPath(data, path, result) {\n Object.keys(data).forEach(key => {\n result[path + '.' + key] = true\n delete result[path]\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], path + '.' + key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], path + '.' + key, result)\n }\n })\n}\n\nfunction _arrayToPath(data, path, result) {\n data.forEach((item, index) => {\n result[path + '[' + index + ']'] = true\n delete result[path]\n const type = Object.prototype.toString.call(item)\n if (type === OBJECTTYPE) {\n _objToPath(item, path + '[' + index + ']', result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(item, path + '[' + index + ']', result)\n }\n })\n}\n","export function rpx(str) {\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\n return (window.innerWidth * Number(b)) / 750 + 'px'\n })\n}\n","import Component from './component'\n\nexport default class ModelView extends Component {\n static observe = true\n\n static mergeUpdate = true\n\n beforeInstall() {\n this.data = this.vm.data\n }\n}\n","/**\n * classNames based on https://github.com/JedWatson/classnames\n * by Jed Watson\n * Licensed under the MIT License\n * https://github.com/JedWatson/classnames/blob/master/LICENSE\n * modified by dntzhang\n */\n\nvar hasOwn = {}.hasOwnProperty\n\nexport function classNames() {\n var classes = []\n\n for (var i = 0; i < arguments.length; i++) {\n var arg = arguments[i]\n if (!arg) continue\n\n var argType = typeof arg\n\n if (argType === 'string' || argType === 'number') {\n classes.push(arg)\n } else if (Array.isArray(arg) && arg.length) {\n var inner = classNames.apply(null, arg)\n if (inner) {\n classes.push(inner)\n }\n } else if (argType === 'object') {\n for (var key in arg) {\n if (hasOwn.call(arg, key) && arg[key]) {\n classes.push(key)\n }\n }\n }\n }\n\n return classes.join(' ')\n}\n\nexport function extractClass() {\n const [props, ...args] = Array.prototype.slice.call(arguments, 0)\n if (props) {\n if (props.class) {\n args.unshift(props.class)\n delete props.class\n } else if (props.className) {\n args.unshift(props.className)\n delete props.className\n }\n }\n if (args.length > 0) {\n return { class: classNames.apply(null, args) }\n }\n}\n","export function getHost(component) {\n let base = component.base\n if (base) {\n while (base.parentNode) {\n if (base.parentNode._component) {\n return base.parentNode._component\n } else {\n base = base.parentNode\n }\n }\n }\n}","/**\n * preact-render-to-string based on preact-render-to-string\n * by Jason Miller\n * Licensed under the MIT License\n * https://github.com/developit/preact-render-to-string\n *\n * modified by dntzhang\n */\n\nimport options from './options'\n\nimport {\n addScopedAttrStatic,\n getCtorName,\n scopeHost,\n scoper\n} from './style'\n\n\nconst encodeEntities = s => String(s)\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"');\n\nconst indent = (s, char) => String(s).replace(/(\\n+)/g, '$1' + (char || '\\t'));\n\nconst mapping = options.mapping\n\nconst VOID_ELEMENTS = /^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/;\n\nconst isLargeString = (s, length, ignoreLines) => (String(s).length > (length || 40) || (!ignoreLines && String(s).indexOf('\\n') !== -1) || String(s).indexOf('<') !== -1);\n\nconst JS_TO_CSS = {};\n\n// Convert an Object style to a CSSText string\nfunction styleObjToCss(s) {\n let str = '';\n for (let prop in s) {\n let val = s[prop];\n if (val != null) {\n if (str) str += ' ';\n // str += jsToCss(prop);\n str += JS_TO_CSS[prop] || (JS_TO_CSS[prop] = prop.replace(/([A-Z])/g, '-$1').toLowerCase());\n str += ': ';\n str += val;\n if (typeof val === 'number' && IS_NON_DIMENSIONAL.test(prop) === false) {\n str += 'px';\n }\n str += ';';\n }\n }\n return str || undefined;\n}\n\n/** The default export is an alias of `render()`. */\nexport function renderToString(vnode, opts, store, isSvgMode, css) {\n if (vnode == null || typeof vnode === 'boolean') {\n return '';\n }\n\n let nodeName = vnode.nodeName,\n attributes = vnode.attributes,\n isComponent = false;\n store = store || {};\n opts = Object.assign({\n scopedCSS: true\n },opts)\n\n let pretty = true && opts.pretty,\n indentChar = pretty && typeof pretty === 'string' ? pretty : '\\t';\n\n // #text nodes\n if (typeof vnode !== 'object' && !nodeName) {\n return encodeEntities(vnode);\n }\n\n // components\n const ctor = mapping[nodeName]\n if (ctor) {\n isComponent = true;\n\n let props = getNodeProps(vnode),\n rendered;\n // class-based components\n let c = new ctor(props, store);\n // turn off stateful re-rendering:\n c._disable = c.__x = true;\n c.props = props;\n c.store = store;\n if (c.install) c.install();\n if (c.beforeRender) c.beforeRender();\n rendered = c.render(c.props, c.data, c.store);\n let tempCss \n if(opts.scopedCSS){\n\n if (c.constructor.css || c.css) {\n\n const cssStr = c.constructor.css ? c.constructor.css : (typeof c.css === 'function' ? c.css() : c.css)\n const cssAttr = '_s' + getCtorName(c.constructor)\n\n tempCss = ``\n\n addScopedAttrStatic(\n rendered,\n '_s' + getCtorName(c.constructor)\n )\n }\n \n c.scopedCSSAttr = vnode.css\n scopeHost(rendered, c.scopedCSSAttr)\n }\n\n return renderToString(rendered, opts, store, false, tempCss);\n }\n\n\n // render JSX to HTML\n let s = '', html;\n\n if (attributes) {\n let attrs = Object.keys(attributes);\n\n // allow sorting lexicographically for more determinism (useful for tests, such as via preact-jsx-chai)\n if (opts && opts.sortAttributes === true) attrs.sort();\n\n for (let i = 0; i < attrs.length; i++) {\n let name = attrs[i],\n v = attributes[name];\n if (name === 'children') continue;\n\n if (name.match(/[\\s\\n\\\\/='\"\\0<>]/)) continue;\n\n if (!(opts && opts.allAttributes) && (name === 'key' || name === 'ref')) continue;\n\n if (name === 'className') {\n if (attributes.class) continue;\n name = 'class';\n }\n else if (isSvgMode && name.match(/^xlink:?./)) {\n name = name.toLowerCase().replace(/^xlink:?/, 'xlink:');\n }\n\n if (name === 'style' && v && typeof v === 'object') {\n v = styleObjToCss(v);\n }\n\n let hooked = opts.attributeHook && opts.attributeHook(name, v, store, opts, isComponent);\n if (hooked || hooked === '') {\n s += hooked;\n continue;\n }\n\n if (name === 'dangerouslySetInnerHTML') {\n html = v && v.__html;\n }\n else if ((v || v === 0 || v === '') && typeof v !== 'function') {\n if (v === true || v === '') {\n v = name;\n // in non-xml mode, allow boolean attributes\n if (!opts || !opts.xml) {\n s += ' ' + name;\n continue;\n }\n }\n s += ` ${name}=\"${encodeEntities(v)}\"`;\n }\n }\n }\n\n // account for >1 multiline attribute\n if (pretty) {\n let sub = s.replace(/^\\n\\s*/, ' ');\n if (sub !== s && !~sub.indexOf('\\n')) s = sub;\n else if (pretty && ~s.indexOf('\\n')) s += '\\n';\n }\n\n s = `<${nodeName}${s}>`;\n if (String(nodeName).match(/[\\s\\n\\\\/='\"\\0<>]/)) throw s;\n\n let isVoid = String(nodeName).match(VOID_ELEMENTS);\n if (isVoid) s = s.replace(/>$/, ' />');\n\n let pieces = [];\n if (html) {\n // if multiline, indent.\n if (pretty && isLargeString(html)) {\n html = '\\n' + indentChar + indent(html, indentChar);\n }\n s += html;\n }\n else if (vnode.children) {\n let hasLarge = pretty && ~s.indexOf('\\n');\n for (let i = 0; i < vnode.children.length; i++) {\n let child = vnode.children[i];\n if (child != null && child !== false) {\n let childSvgMode = nodeName === 'svg' ? true : nodeName === 'foreignObject' ? false : isSvgMode,\n ret = renderToString(child, opts, store, childSvgMode);\n if (pretty && !hasLarge && isLargeString(ret)) hasLarge = true;\n if (ret) pieces.push(ret);\n }\n }\n if (pretty && hasLarge) {\n for (let i = pieces.length; i--;) {\n pieces[i] = '\\n' + indentChar + indent(pieces[i], indentChar);\n }\n }\n }\n\n if (pieces.length) {\n s += pieces.join('');\n }\n else if (opts && opts.xml) {\n return s.substring(0, s.length - 1) + ' />';\n }\n\n if (!isVoid) {\n if (pretty && ~s.indexOf('\\n')) s += '\\n';\n s += `${nodeName}>`;\n }\n\n if(css) return css + s;\n return s;\n}\n\nfunction assign(obj, props) {\n for (let i in props) obj[i] = props[i];\n return obj;\n}\n\nfunction getNodeProps(vnode) {\n let props = assign({}, vnode.attributes);\n props.children = vnode.children;\n\n let defaultProps = vnode.nodeName.defaultProps;\n if (defaultProps !== undefined) {\n for (let i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i];\n }\n }\n }\n\n return props;\n}","import { h, h as createElement } from './h'\nimport { cloneElement } from './clone-element'\nimport Component from './component'\nimport { render } from './render'\nimport { rerender } from './render-queue'\nimport options from './options'\nimport { define } from './define'\nimport { rpx } from './rpx'\nimport ModelView from './model-view'\nimport { classNames, extractClass } from './class'\nimport { getHost } from './get-host'\nimport { renderToString } from './render-to-string'\n\nconst WeElement = Component\nconst defineElement = define\nfunction createRef() {\n return {}\n}\n\noptions.root.Omi = {\n h,\n createElement,\n cloneElement,\n createRef,\n Component,\n render,\n rerender,\n options,\n WeElement,\n define,\n rpx,\n ModelView,\n defineElement,\n classNames,\n extractClass,\n getHost,\n renderToString\n}\noptions.root.omi = options.root.Omi\noptions.root.Omi.version = 'omio-1.3.8'\n\nexport default {\n h,\n createElement,\n cloneElement,\n createRef,\n Component,\n render,\n rerender,\n options,\n WeElement,\n define,\n rpx,\n ModelView,\n defineElement,\n classNames,\n extractClass,\n getHost,\n renderToString\n}\n\nexport {\n h,\n createElement,\n cloneElement,\n createRef,\n Component,\n render,\n rerender,\n options,\n WeElement,\n define,\n rpx,\n ModelView,\n defineElement,\n classNames,\n extractClass,\n getHost,\n renderToString\n}\n","import { render, WeElement, define } from '../../src/omi'\n\ndefine('my-counter', class extends WeElement {\n static use = [\n { count: 'count' }\n ]\n\n add = () => this.store.add()\n sub = () => this.store.sub()\n\n addIfOdd = () => {\n if (this.use.count % 2 !== 0) {\n this.store.add()\n }\n }\n\n addAsync = () => {\n setTimeout(() => this.store.add(), 1000)\n }\n\n render() {\n return (\n
\n )\n }\n})\n\nrender(, 'body', {\n data: {\n count: 0\n },\n sub() {\n this.data.count--\n },\n add() {\n this.data.count++\n },\n})"],"names":["VNode","getGlobal","global","Math","Array","self","window","scopedStyle","mapping","isWeb","staticStyleMapping","doc","document","root","styleCache","stack","EMPTY_CHILDREN","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","key","options","vnode","getOwnPropertySymbols","Object","hasOwnProperty","prototype","propIsEnumerable","propertyIsEnumerable","toObject","val","TypeError","assign","target","source","from","to","symbols","s","call","Element","addEventListener","runListeners","oEvent","event","iLstId","iElId","oEvtListeners","oListeners","type","aEls","aEvts","sEventType","fListener","nElIdx","aElListeners","splice","removeEventListener","create","proto","propertiesObject","Error","F","trim","replace","extend","obj","props","applyRef","ref","value","current","usePromise","Promise","__config__","platform","systemVersion","split","defer","resolve","then","bind","setTimeout","isArray","toString","nProps","result","keys","forEach","getUse","data","paths","path","index","isPath","getTargetByPath","tempPath","tempVal","args","apply","origin","arr","len","cloneElement","slice","NO_RENDER","SYNC_RENDER","FORCE_RENDER","ASYNC_RENDER","ATTR_KEY","IS_NON_DIMENSIONAL","items","enqueueRender","component","debounceRendering","rerender","renderComponent","isSameNodeType","node","hydrating","splitText","ctor","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","getNodeProps","defaultProps","createNode","isSvg","createElementNS","createElement","parseCSSText","cssText","cssTxt","match","a","b","rule","cssToJs","toUpperCase","properties","map","o","x","property","style","removeNode","parentNode","removeChild","setAccessor","name","old","className","test","oldJson","currentJson","changed","ckey","setStyles","innerHTML","__html","useCapture","substring","eventProxy","touchStart","touchEnd","_listeners","setProperty","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","e","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","styleId","getCtorName","item","attrName","scoper","css","prefix","re","RegExp","g0","g1","g2","g3","appendClass","addStyle","id","ele","getElementById","head","getElementsByTagName","someThingStyles","appendChild","ActiveXObject","styleSheet","textContent","addStyleWithoutId","addScopedAttrStatic","vdom","attr","scopeVdom","addStyleToHead","scopeHost","mounts","diffLevel","isSvgMode","flushMounts","c","afterMount","installed","constructor","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","out","prevSvgMode","vnodeName","buildComponentFromVNode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","firstChild","fc","vchildren","nextSibling","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","childrenLen","vlen","j","f","vchild","__key","insertBefore","unmountOnly","unmountComponent","removeChildren","lastChild","next","previousSibling","attrs","components","collectComponent","createComponent","Ctor","list","inst","render","Component","doRender","scopedCssAttr","use","store","instances","nextBase","obaa","callback","_observe","$observer","eventPropArr","$observeProps","$observerPath","mock","prop","isInArray","watch","isString","propertyChangedHandler","propChanged","all","onPropertyChanged","oldValue","rootName","_getRootName","handler","indexOf","methods","triggerStr","cprop","isFunction","currentValue","defineProperty","get","set","join","add","exec","size","callbacks","nextTickCallback","fireTick","fn","scope","nextItem","proxyUpdate","timeout","_willUpdate","mergeUpdate","clearTimeout","update","setComponentProps","opts","_disable","__ref","base","beforeInstall","install","observe","receiveProps","prevContext","prevProps","syncComponentUpdates","shallowComparison","isChild","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","rendered","cbase","beforeUpdate","beforeRender","getChildContext","childComponent","toUnmount","childProps","_parentComponent","baseParent","componentRef","t","unshift","afterUpdate","updated","_renderCallbacks","originalComponent","oldDom","isDirectOwner","isOwner","beforeUnmount","uninstall","inner","elementId","_preCss","componentChange","fire","every","is","empty","merge","querySelector","extendStoreUpate","patchs","fixPath","patch","updateAll","matchGlobalData","globalData","instance","updatePath","needUpdate","onChange","diffResult","keyA","includePath","keyB","pathA","pathB","substr","mpPath","isNaN","Number","OBJECTTYPE","ARRAYTYPE","define","getPath","getUpdatePath","dataToPath","_objToPath","_arrayToPath","rpx","str","innerWidth","ModelView","vm","hasOwn","classNames","classes","arg","argType","extractClass","class","getHost","encodeEntities","indent","char","VOID_ELEMENTS","isLargeString","ignoreLines","JS_TO_CSS","styleObjToCss","renderToString","isComponent","scopedCSS","pretty","indentChar","__x","tempCss","cssStr","cssAttr","scopedCSSAttr","html","sortAttributes","sort","v","allAttributes","hooked","attributeHook","xml","sub","isVoid","pieces","hasLarge","childSvgMode","WeElement","defineElement","createRef","Omi","omi","version","addIfOdd","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,SAAKnO,IAAL,CAAUwX,KAAV;EACD;EAT4B,CAA/B;;;;"}
\ No newline at end of file
+{"version":3,"file":"b.js","sources":["../../src/vnode.js","../../src/options.js","../../src/h.js","../../src/util.js","../../src/clone-element.js","../../src/constants.js","../../src/render-queue.js","../../src/vdom/index.js","../../src/dom/index.js","../../src/style.js","../../src/vdom/diff.js","../../src/vdom/component-recycler.js","../../src/obaa.js","../../src/tick.js","../../src/observe.js","../../src/vdom/component.js","../../src/component.js","../../src/render.js","../../src/define.js","../../src/rpx.js","../../src/model-view.js","../../src/class.js","../../src/get-host.js","../../src/render-to-string.js","../../src/omi.js","main.js"],"sourcesContent":["/** Virtual DOM Node */\nexport function VNode() {}\n","function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n if (typeof self !== 'undefined') {\n return self\n } else if (typeof window !== 'undefined') {\n return window\n } else if (typeof global !== 'undefined') {\n return global\n }\n return (function() {\n return this\n })()\n }\n return global\n}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nexport default {\n scopedStyle: true,\n mapping: {},\n isWeb: true,\n staticStyleMapping: {},\n doc: typeof document === 'object' ? document : null,\n root: getGlobal(),\n //styleCache :[{ctor:ctor,ctorName:ctorName,style:style}]\n styleCache: []\n //componentChange(component, element) { },\n /** If `true`, `prop` changes trigger synchronous component updates.\n *\t@name syncComponentUpdates\n *\t@type Boolean\n *\t@default true\n */\n //syncComponentUpdates: true,\n\n /** Processes all created VNodes.\n *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\n */\n //vnode(vnode) { }\n\n /** Hook invoked after a component is mounted. */\n //afterMount(component) { },\n\n /** Hook invoked after the DOM is updated with a component's latest render. */\n //afterUpdate(component) { }\n\n /** Hook invoked immediately before a component is unmounted. */\n // beforeUnmount(component) { }\n}\n","import { VNode } from './vnode'\nimport options from './options'\n\nconst stack = []\n\nconst EMPTY_CHILDREN = []\n\n/**\n * JSX/hyperscript reviver.\n * @see http://jasonformat.com/wtf-is-jsx\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\n *\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\n *\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\n * the current _actual_ DOM structure, and applying only the differences.\n *\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\n * and optionally children to append to the element.\n *\n * @example The following DOM tree\n *\n * `
Hello!
`\n *\n * can be constructed using this function as:\n *\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\n *\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\n * @param {Object} attributes\tAny attributes/props to set on the created element.\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\n *\n * @public\n */\nexport function h(nodeName, attributes) {\n let children = EMPTY_CHILDREN,\n lastSimple,\n child,\n simple,\n i\n for (i = arguments.length; i-- > 2; ) {\n stack.push(arguments[i])\n }\n if (attributes && attributes.children != null) {\n if (!stack.length) stack.push(attributes.children)\n delete attributes.children\n }\n while (stack.length) {\n if ((child = stack.pop()) && child.pop !== undefined) {\n for (i = child.length; i--; ) stack.push(child[i])\n } else {\n if (typeof child === 'boolean') child = null\n\n if ((simple = typeof nodeName !== 'function')) {\n if (child == null) child = ''\n else if (typeof child === 'number') child = String(child)\n else if (typeof child !== 'string') simple = false\n }\n\n if (simple && lastSimple) {\n children[children.length - 1] += child\n } else if (children === EMPTY_CHILDREN) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n let p = new VNode()\n p.nodeName = nodeName\n p.children = children\n\tp.attributes = attributes == null ? undefined : attributes\n p.key = attributes == null ? undefined : attributes.key\n\n // if a \"vnode hook\" is defined, pass every created VNode to it\n if (options.vnode !== undefined) options.vnode(p)\n\n return p\n}\n","'use strict'\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols\nvar hasOwnProperty = Object.prototype.hasOwnProperty\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable\n\nfunction toObject(val) {\n if (val === null || val === undefined) {\n throw new TypeError('Object.assign cannot be called with null or undefined')\n }\n\n return Object(val)\n}\n\nexport function assign(target, source) {\n var from\n var to = toObject(target)\n var symbols\n\n for (var s = 1; s < arguments.length; s++) {\n from = Object(arguments[s])\n\n for (var key in from) {\n if (hasOwnProperty.call(from, key)) {\n to[key] = from[key]\n }\n }\n\n if (getOwnPropertySymbols) {\n symbols = getOwnPropertySymbols(from)\n for (var i = 0; i < symbols.length; i++) {\n if (propIsEnumerable.call(from, symbols[i])) {\n to[symbols[i]] = from[symbols[i]]\n }\n }\n }\n }\n\n return to\n}\n\nif (typeof Element !== 'undefined' && !Element.prototype.addEventListener) {\n var oListeners = {};\n function runListeners(oEvent) {\n if (!oEvent) { oEvent = window.event; }\n for (var iLstId = 0, iElId = 0, oEvtListeners = oListeners[oEvent.type]; iElId < oEvtListeners.aEls.length; iElId++) {\n if (oEvtListeners.aEls[iElId] === this) {\n for (iLstId; iLstId < oEvtListeners.aEvts[iElId].length; iLstId++) { oEvtListeners.aEvts[iElId][iLstId].call(this, oEvent); }\n break;\n }\n }\n }\n Element.prototype.addEventListener = function (sEventType, fListener /*, useCapture (will be ignored!) */) {\n if (oListeners.hasOwnProperty(sEventType)) {\n var oEvtListeners = oListeners[sEventType];\n for (var nElIdx = -1, iElId = 0; iElId < oEvtListeners.aEls.length; iElId++) {\n if (oEvtListeners.aEls[iElId] === this) { nElIdx = iElId; break; }\n }\n if (nElIdx === -1) {\n oEvtListeners.aEls.push(this);\n oEvtListeners.aEvts.push([fListener]);\n this[\"on\" + sEventType] = runListeners;\n } else {\n var aElListeners = oEvtListeners.aEvts[nElIdx];\n if (this[\"on\" + sEventType] !== runListeners) {\n aElListeners.splice(0);\n this[\"on\" + sEventType] = runListeners;\n }\n for (var iLstId = 0; iLstId < aElListeners.length; iLstId++) {\n if (aElListeners[iLstId] === fListener) { return; }\n }\n aElListeners.push(fListener);\n }\n } else {\n oListeners[sEventType] = { aEls: [this], aEvts: [[fListener]] };\n this[\"on\" + sEventType] = runListeners;\n }\n };\n Element.prototype.removeEventListener = function (sEventType, fListener /*, useCapture (will be ignored!) */) {\n if (!oListeners.hasOwnProperty(sEventType)) { return; }\n var oEvtListeners = oListeners[sEventType];\n for (var nElIdx = -1, iElId = 0; iElId < oEvtListeners.aEls.length; iElId++) {\n if (oEvtListeners.aEls[iElId] === this) { nElIdx = iElId; break; }\n }\n if (nElIdx === -1) { return; }\n for (var iLstId = 0, aElListeners = oEvtListeners.aEvts[nElIdx]; iLstId < aElListeners.length; iLstId++) {\n if (aElListeners[iLstId] === fListener) { aElListeners.splice(iLstId, 1); }\n }\n };\n}\n\n\nif (typeof Object.create !== 'function') {\n Object.create = function(proto, propertiesObject) {\n if (typeof proto !== 'object' && typeof proto !== 'function') {\n throw new TypeError('Object prototype may only be an Object: ' + proto)\n } else if (proto === null) {\n throw new Error(\n \"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\"\n )\n }\n\n // if (typeof propertiesObject != 'undefined') {\n // throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support a second argument.\");\n // }\n\n function F() {}\n F.prototype = proto\n\n return new F()\n }\n}\n\nif (!String.prototype.trim) {\n String.prototype.trim = function () {\n return this.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '')\n }\n}\n\n/**\n * Copy all properties from `props` onto `obj`.\n * @param {Object} obj\t\tObject onto which properties should be copied.\n * @param {Object} props\tObject from which to copy properties.\n * @returns obj\n * @private\n */\nexport function extend(obj, props) {\n for (let i in props) obj[i] = props[i]\n return obj\n}\n\n/** Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} [ref=null]\n * @param {any} [value]\n */\nexport function applyRef(ref, value) {\n if (ref) {\n if (typeof ref == 'function') ref(value)\n else ref.current = value\n }\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n *\n * @param {Function} callback\n */\n\nlet usePromise = typeof Promise == 'function'\n\n// for native\nif (\n typeof document !== 'object' &&\n typeof global !== 'undefined' &&\n global.__config__\n) {\n if (global.__config__.platform === 'android') {\n usePromise = true\n } else {\n let systemVersion =\n (global.__config__.systemVersion &&\n global.__config__.systemVersion.split('.')[0]) ||\n 0\n if (systemVersion > 8) {\n usePromise = true\n }\n }\n}\n\nexport const defer = usePromise\n ? Promise.resolve().then.bind(Promise.resolve())\n : setTimeout\n\nexport function isArray(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport function nProps(props) {\n if (!props || isArray(props)) return {}\n const result = {}\n Object.keys(props).forEach(key => {\n result[key] = props[key].value\n })\n return result\n}\n\nexport function getUse(data, paths) {\n const obj = {}\n paths.forEach((path, index) => {\n const isPath = typeof path === 'string'\n if (isPath) {\n obj[index] = getTargetByPath(data, path)\n } else {\n const key = Object.keys(path)[0]\n const value = path[key]\n if (typeof value === 'string') {\n obj[index] = getTargetByPath(data, value)\n } else {\n const tempPath = value[0]\n if (typeof tempPath === 'string') {\n const tempVal = getTargetByPath(data, tempPath)\n obj[index] = value[1] ? value[1](tempVal) : tempVal\n } else {\n const args = []\n tempPath.forEach(path =>{\n args.push(getTargetByPath(data, path))\n })\n obj[index] = value[1].apply(null, args)\n }\n }\n obj[key] = obj[index]\n }\n })\n return obj\n}\n\nexport function getTargetByPath(origin, path) {\n const arr = path.replace(/]/g, '').replace(/\\[/g, '.').split('.')\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n current = current[arr[i]]\n }\n return current\n}","import { extend } from './util'\nimport { h } from './h'\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\n * @param {Object} props\tAttributes/props to add when cloning\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\n */\nexport function cloneElement(vnode, props) {\n return h(\n vnode.nodeName,\n extend(extend({}, vnode.attributes), props),\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\n )\n}\n","// render modes\n\nexport const NO_RENDER = 0\nexport const SYNC_RENDER = 1\nexport const FORCE_RENDER = 2\nexport const ASYNC_RENDER = 3\n\nexport const ATTR_KEY = '__omiattr_'\n\n// DOM properties that should NOT have \"px\" added when numeric\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i\n","import options from './options'\nimport { defer } from './util'\nimport { renderComponent } from './vdom/component'\n\n/** Managed queue of dirty components to be re-rendered */\n\nlet items = []\n\nexport function enqueueRender(component) {\n if (items.push(component) == 1) {\n ;(options.debounceRendering || defer)(rerender)\n }\n}\n\n/** Rerender all enqueued dirty components */\nexport function rerender() {\n\tlet p\n\twhile ( (p = items.pop()) ) {\n renderComponent(p)\n\t}\n}","import { extend } from '../util'\nimport options from '../options'\n\nconst mapping = options.mapping\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node\t\t\tDOM Node to compare\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\n * @private\n */\nexport function isSameNodeType(node, vnode, hydrating) {\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n return node.splitText !== undefined\n }\n if (typeof vnode.nodeName === 'string') {\n var ctor = mapping[vnode.nodeName]\n if (ctor) {\n return hydrating || node._componentConstructor === ctor\n }\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n }\n return hydrating || node._componentConstructor === vnode.nodeName\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n *\n * @param {Element} node\tA DOM Element to inspect the name of.\n * @param {String} nodeName\tUnnormalized name to compare against.\n */\nexport function isNamedNode(node, nodeName) {\n return (\n node.normalizedNodeName === nodeName ||\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\n )\n}\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n *\n * @param {VNode} vnode\n * @returns {Object} props\n */\nexport function getNodeProps(vnode) {\n let props = extend({}, vnode.attributes)\n props.children = vnode.children\n\n let defaultProps = vnode.nodeName.defaultProps\n if (defaultProps !== undefined) {\n for (let i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i]\n }\n }\n }\n\n return props\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\n\n/** Create an element with the given nodeName.\n *\t@param {String} nodeName\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\n *\t@returns {Element} node\n */\nexport function createNode(nodeName, isSvg) {\n let node = isSvg\n ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : options.doc.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\nfunction parseCSSText(cssText) {\n let cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, ' ').replace(/\\s+/g, ' ')\n let style = {},\n [a, b, rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/) || [a, b, cssTxt]\n let cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase())\n let properties = rule\n .split(';')\n .map(o => o.split(':').map(x => x && x.trim()))\n for (let [property, value] of properties) style[cssToJs(property)] = value\n return style\n}\n\n/** Remove a child node from its parent if attached.\n *\t@param {Element} node\t\tThe node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\n *\tIf `value` is `null`, the attribute/handler will be removed.\n *\t@param {Element} node\tAn element to mutate\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\n *\t@param {any} old\tThe last value that was set for this name/node pair\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\n *\t@private\n */\nexport function setAccessor(node, name, old, value, isSvg) {\n if (name === 'className') name = 'class'\n\n if (name === 'key') {\n // ignore\n } else if (name === 'ref') {\n applyRef(old, null)\n applyRef(value, node)\n } else if (name === 'class' && !isSvg) {\n node.className = value || ''\n } else if (name === 'style') {\n if (options.isWeb) {\n if (!value || typeof value === 'string' || typeof old === 'string') {\n node.style.cssText = value || ''\n }\n if (value && typeof value === 'object') {\n if (typeof old !== 'string') {\n for (let i in old) if (!(i in value)) node.style[i] = ''\n }\n for (let i in value) {\n node.style[i] =\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\n ? value[i] + 'px'\n : value[i]\n }\n }\n } else {\n let oldJson = old,\n currentJson = value\n if (typeof old === 'string') {\n oldJson = parseCSSText(old)\n }\n if (typeof value == 'string') {\n currentJson = parseCSSText(value)\n }\n\n let result = {},\n changed = false\n\n if (oldJson) {\n for (let key in oldJson) {\n if (typeof currentJson == 'object' && !(key in currentJson)) {\n result[key] = ''\n changed = true\n }\n }\n\n for (let ckey in currentJson) {\n if (currentJson[ckey] !== oldJson[ckey]) {\n result[ckey] = currentJson[ckey]\n changed = true\n }\n }\n\n if (changed) {\n node.setStyles(result)\n }\n } else {\n node.setStyles(currentJson)\n }\n }\n } else if (name === 'dangerouslySetInnerHTML') {\n if (value) node.innerHTML = value.__html || ''\n } else if (name[0] == 'o' && name[1] == 'n') {\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\n name = name.toLowerCase().substring(2)\n if (value) {\n if (!old) {\n node.addEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.addEventListener('touchstart', touchStart, useCapture)\n node.addEventListener('touchend', touchEnd, useCapture)\n }\n }\n } else {\n node.removeEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.removeEventListener('touchstart', touchStart, useCapture)\n node.removeEventListener('touchend', touchEnd, useCapture)\n }\n }\n ;(node._listeners || (node._listeners = {}))[name] = value\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n setProperty(node, name, value == null ? '' : value)\n if (value == null || value === false) node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n if (value == null || value === false) {\n if (ns)\n node.removeAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase()\n )\n else node.removeAttribute(name)\n } else if (typeof value !== 'function') {\n if (ns)\n node.setAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase(),\n value\n )\n else node.setAttribute(name, value)\n }\n }\n}\n\n/** Attempt to set a DOM property to the given value.\n *\tIE & FF throw for certain property-value combinations.\n */\nfunction setProperty(node, name, value) {\n try {\n node[name] = value\n } catch (e) {}\n}\n\n/** Proxy an event to hooked event handlers\n *\t@private\n */\nfunction eventProxy(e) {\n return this._listeners[e.type]((options.event && options.event(e)) || e)\n}\n\nfunction touchStart(e) {\n this.___touchX = e.touches[0].pageX\n this.___touchY = e.touches[0].pageY\n this.___scrollTop = document.body.scrollTop\n}\n\nfunction touchEnd(e) {\n if (\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\n ) {\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\n }\n}","import options from './options'\n\nlet styleId = 0\n\nexport function getCtorName(ctor) {\n for (let i = 0, len = options.styleCache.length; i < len; i++) {\n let item = options.styleCache[i]\n\n if (item.ctor === ctor) {\n return item.attrName\n }\n }\n\n let attrName = 's' + styleId\n options.styleCache.push({ ctor, attrName })\n styleId++\n\n return attrName\n}\n\n// many thanks to https://github.com/thomaspark/scoper/\nexport function scoper(css, prefix) {\n prefix = '[' + prefix.toLowerCase() + ']'\n // https://www.w3.org/TR/css-syntax-3/#lexical\n css = css.replace(/\\/\\*[^*]*\\*+([^/][^*]*\\*+)*\\//g, '')\n // eslint-disable-next-line\n let re = new RegExp('([^\\r\\n,{}:]+)(:[^\\r\\n,{}]+)?(,(?=[^{}]*{)|\\s*{)', 'g')\n /**\n * Example:\n *\n * .classname::pesudo { color:red }\n *\n * g1 is normal selector `.classname`\n * g2 is pesudo class or pesudo element\n * g3 is the suffix\n */\n css = css.replace(re, (g0, g1, g2, g3) => {\n if (typeof g2 === 'undefined') {\n g2 = ''\n }\n\n /* eslint-ignore-next-line */\n if (\n g1.match(\n /^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/\n )\n ) {\n return g1 + g2 + g3\n }\n\n let appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2\n //let prependClass = prefix + ' ' + g1.trim() + g2;\n\n return appendClass + g3\n //return appendClass + ',' + prependClass + g3;\n })\n\n return css\n}\n\nexport function addStyle(cssText, id) {\n id = id.toLowerCase()\n let ele = document.getElementById(id)\n let head = document.getElementsByTagName('head')[0]\n if (ele && ele.parentNode === head) {\n head.removeChild(ele)\n }\n\n let someThingStyles = document.createElement('style')\n head.appendChild(someThingStyles)\n someThingStyles.setAttribute('type', 'text/css')\n someThingStyles.setAttribute('id', id)\n if (window.ActiveXObject) {\n someThingStyles.styleSheet.cssText = cssText\n } else {\n someThingStyles.textContent = cssText\n }\n}\n\nexport function addStyleWithoutId(cssText) {\n let head = document.getElementsByTagName('head')[0]\n let someThingStyles = document.createElement('style')\n head.appendChild(someThingStyles)\n someThingStyles.setAttribute('type', 'text/css')\n\n if (window.ActiveXObject) {\n someThingStyles.styleSheet.cssText = cssText\n } else {\n someThingStyles.textContent = cssText\n }\n}\n\nexport function addScopedAttrStatic(vdom, attr) {\n if (options.scopedStyle) {\n scopeVdom(attr, vdom)\n } \n}\n\nexport function addStyleToHead(style, attr) {\n if (options.scopedStyle) {\n if (!options.staticStyleMapping[attr]) {\n addStyle(scoper(style, attr), attr)\n options.staticStyleMapping[attr] = true\n }\n } else if (!options.staticStyleMapping[attr]) {\n addStyleWithoutId(style)\n options.staticStyleMapping[attr] = true\n }\n}\n\nexport function scopeVdom(attr, vdom) {\n if (typeof vdom === 'object') {\n vdom.attributes = vdom.attributes || {}\n vdom.attributes[attr] = ''\n vdom.css = vdom.css || {}\n vdom.css[attr] = ''\n vdom.children.forEach(child => scopeVdom(attr, child))\n }\n}\n\nexport function scopeHost(vdom, css) {\n if (typeof vdom === 'object' && css) {\n vdom.attributes = vdom.attributes || {}\n for (let key in css) {\n vdom.attributes[key] = ''\n }\n }\n}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { buildComponentFromVNode } from './component'\nimport { createNode, setAccessor } from '../dom/index'\nimport { unmountComponent } from './component'\nimport options from '../options'\nimport { applyRef } from '../util'\nimport { removeNode } from '../dom/index'\nimport { isArray } from '../util'\nimport { addStyleToHead, getCtorName } from '../style'\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nexport const mounts = []\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false\n\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false\n\n/** Invoke queued componentDidMount lifecycle methods */\nexport function flushMounts() {\n let c\n while ((c = mounts.pop())) {\n if (options.afterMount) options.afterMount(c)\n if (c.installed) c.installed()\n if (c.constructor.css || c.css) {\n addStyleToHead(c.constructor.css ? c.constructor.css : (typeof c.css === 'function' ? c.css() : c.css), '_s' + getCtorName(c.constructor))\n }\n }\n}\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n if (!diffLevel++) {\n // when first starting the diff, check if we're diffing an SVG or within an SVG\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\n\n // hydration is indicated by the existing element to be diffed not having a prop cache\n hydrating = dom != null && !(ATTR_KEY in dom)\n }\n let ret\n\n if (isArray(vnode)) {\n vnode = {\n nodeName: 'span',\n children: vnode\n }\n }\n\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n\n // diffLevel being reduced to 0 means we're exiting the diff\n if (!--diffLevel) {\n hydrating = false\n // invoke queued componentDidMount lifecycle methods\n if (!componentRoot) flushMounts()\n }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n let out = dom,\n prevSvgMode = isSvgMode\n\n // empty values (null, undefined, booleans) render as empty Text nodes\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n if (options.mapping[vnodeName]) {\n vnode.nodeName = options.mapping[vnodeName]\n return buildComponentFromVNode(dom, vnode, context, mountAll)\n }\n if (typeof vnodeName == 'function') {\n return buildComponentFromVNode(dom, vnode, context, mountAll)\n }\n\n // Fast case: Strings & Numbers create/update Text nodes.\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n // update if it's already a Text node:\n if (\n dom &&\n dom.splitText !== undefined &&\n dom.parentNode &&\n (!dom._component || componentRoot)\n ) {\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n if (dom.nodeValue != vnode) {\n dom.nodeValue = vnode\n }\n } else {\n // it wasn't a Text node: replace it with one and recycle the old Element\n out = document.createTextNode(vnode)\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n recollectNodeTree(dom, true)\n }\n }\n\n //ie8 error\n try {\n out[ATTR_KEY] = true\n } catch (e) {}\n\n return out\n }\n\n // Tracks entering and exiting SVG namespace when descending through the tree.\n isSvgMode =\n vnodeName === 'svg'\n ? true\n : vnodeName === 'foreignObject'\n ? false\n : isSvgMode\n\n // If there's no existing element or it's the wrong type, create a new one:\n vnodeName = String(vnodeName)\n if (!dom || !isNamedNode(dom, vnodeName)) {\n out = createNode(vnodeName, isSvgMode)\n\n if (dom) {\n // move children into the replacement node\n while (dom.firstChild) out.appendChild(dom.firstChild)\n\n // if the previous Element was mounted into the DOM, replace it inline\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n // recycle the old element (skips non-Element node types)\n recollectNodeTree(dom, true)\n }\n }\n\n let fc = out.firstChild,\n props = out[ATTR_KEY],\n vchildren = vnode.children\n\n if (props == null) {\n props = out[ATTR_KEY] = {}\n for (let a = out.attributes, i = a.length; i--; )\n props[a[i].name] = a[i].value\n }\n\n // Optimization: fast-path for elements containing a single TextNode:\n if (\n !hydrating &&\n vchildren &&\n vchildren.length === 1 &&\n typeof vchildren[0] === 'string' &&\n fc != null &&\n fc.splitText !== undefined &&\n fc.nextSibling == null\n ) {\n if (fc.nodeValue != vchildren[0]) {\n fc.nodeValue = vchildren[0]\n }\n }\n // otherwise, if there are existing or new children, diff them:\n else if ((vchildren && vchildren.length) || fc != null) {\n innerDiffNode(\n out,\n vchildren,\n context,\n mountAll,\n hydrating || props.dangerouslySetInnerHTML != null\n )\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props)\n\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\n isSvgMode = prevSvgMode\n\n return out\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n let originalChildren = dom.childNodes,\n children = [],\n keyed = {},\n keyedLen = 0,\n min = 0,\n len = originalChildren.length,\n childrenLen = 0,\n vlen = vchildren ? vchildren.length : 0,\n j,\n c,\n f,\n vchild,\n child\n\n // Build up a map of keyed children and an Array of unkeyed children:\n if (len !== 0) {\n for (let i = 0; i < len; i++) {\n let child = originalChildren[i],\n props = child[ATTR_KEY],\n key =\n vlen && props\n ? child._component\n ? child._component.__key\n : props.key\n : null\n if (key != null) {\n keyedLen++\n keyed[key] = child\n } else if (\n props ||\n (child.splitText !== undefined\n ? isHydrating\n ? child.nodeValue.trim()\n : true\n : isHydrating)\n ) {\n children[childrenLen++] = child\n }\n }\n }\n\n if (vlen !== 0) {\n for (let i = 0; i < vlen; i++) {\n vchild = vchildren[i]\n child = null\n\n // attempt to find a node based on key matching\n let key = vchild.key\n if (key != null) {\n if (keyedLen && keyed[key] !== undefined) {\n child = keyed[key]\n keyed[key] = undefined\n keyedLen--\n }\n }\n // attempt to pluck a node of the same type from the existing children\n else if (!child && min < childrenLen) {\n for (j = min; j < childrenLen; j++) {\n if (\n children[j] !== undefined &&\n isSameNodeType((c = children[j]), vchild, isHydrating)\n ) {\n child = c\n children[j] = undefined\n if (j === childrenLen - 1) childrenLen--\n if (j === min) min++\n break\n }\n }\n }\n\n // morph the matched/found/created DOM child to match vchild (deep)\n child = idiff(child, vchild, context, mountAll)\n\n f = originalChildren[i]\n if (child && child !== dom && child !== f) {\n if (f == null) {\n dom.appendChild(child)\n } else if (child === f.nextSibling) {\n removeNode(f)\n } else {\n dom.insertBefore(child, f)\n }\n }\n }\n }\n\n // remove unused keyed children:\n if (keyedLen) {\n for (let i in keyed)\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\n }\n\n // remove orphaned unkeyed children:\n while (min <= childrenLen) {\n if ((child = children[childrenLen--]) !== undefined)\n recollectNodeTree(child, false)\n }\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\n let component = node._component\n if (component) {\n // if node is owned by a Component, unmount that component (ends up recursing back here)\n unmountComponent(component)\n } else {\n // If the node's VNode had a ref function, invoke it with null here.\n // (this is part of the React spec, and smart for unsetting references)\n if (node[ATTR_KEY] != null) applyRef(node[ATTR_KEY].ref, null)\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n }\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node) {\n node = node.lastChild\n while (node) {\n let next = node.previousSibling\n recollectNodeTree(node, true)\n node = next\n }\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old) {\n let name\n\n // remove attributes no longer present on the vnode by setting them to undefined\n for (name in old) {\n if (!(attrs && attrs[name] != null) && old[name] != null) {\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (\n name !== 'children' &&\n name !== 'innerHTML' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\n }\n }\n}\n","import Component from '../component'\nimport { getUse } from '../util'\n/** Retains a pool of Components for re-use, keyed on component name.\n *\tNote: since component names are not unique or even necessarily available, these are primarily a form of sharding.\n *\t@private\n */\nconst components = {}\n\n/** Reclaim a component for later re-use by the recycler. */\nexport function collectComponent(component) {\n let name = component.constructor.name\n ;(components[name] || (components[name] = [])).push(component)\n}\n\n/** Create a component. Normalizes differences between PFC's and classful Components. */\nexport function createComponent(Ctor, props, context, vnode) {\n let list = components[Ctor.name],\n inst\n\n if (Ctor.prototype && Ctor.prototype.render) {\n inst = new Ctor(props, context)\n Component.call(inst, props, context)\n } else {\n inst = new Component(props, context)\n inst.constructor = Ctor\n inst.render = doRender\n }\n vnode && (inst.scopedCssAttr = vnode.css)\n\n if (inst.constructor.use && inst.store && inst.store.data) {\n inst.store.instances.push(inst)\n inst.use = getUse(inst.store.data, inst.constructor.use)\n }\n\n if (list) {\n for (let i = list.length; i--; ) {\n if (list[i].constructor === Ctor) {\n inst.nextBase = list[i].nextBase\n list.splice(i, 1)\n break\n }\n }\n }\n return inst\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, data, context) {\n return this.constructor(props, context)\n}\n","/* obaa 1.0.0\n * By dntzhang\n * Github: https://github.com/Tencent/omi\n * MIT Licensed.\n */\n\nvar obaa = function(target, arr, callback) {\n var _observe = function(target, arr, callback) {\n if (!target.$observer) target.$observer = this\n var $observer = target.$observer\n var eventPropArr = []\n if (obaa.isArray(target)) {\n if (target.length === 0) {\n target.$observeProps = {}\n target.$observeProps.$observerPath = '#'\n }\n $observer.mock(target)\n }\n for (var prop in target) {\n if (target.hasOwnProperty(prop)) {\n if (callback) {\n if (obaa.isArray(arr) && obaa.isInArray(arr, prop)) {\n eventPropArr.push(prop)\n $observer.watch(target, prop)\n } else if (obaa.isString(arr) && prop == arr) {\n eventPropArr.push(prop)\n $observer.watch(target, prop)\n }\n } else {\n eventPropArr.push(prop)\n $observer.watch(target, prop)\n }\n }\n }\n $observer.target = target\n if (!$observer.propertyChangedHandler) $observer.propertyChangedHandler = []\n var propChanged = callback ? callback : arr\n $observer.propertyChangedHandler.push({\n all: !callback,\n propChanged: propChanged,\n eventPropArr: eventPropArr\n })\n }\n _observe.prototype = {\n onPropertyChanged: function(prop, value, oldValue, target, path) {\n if (value !== oldValue && this.propertyChangedHandler) {\n var rootName = obaa._getRootName(prop, path)\n for (\n var i = 0, len = this.propertyChangedHandler.length;\n i < len;\n i++\n ) {\n var handler = this.propertyChangedHandler[i]\n if (\n handler.all ||\n obaa.isInArray(handler.eventPropArr, rootName) ||\n rootName.indexOf('Array-') === 0\n ) {\n handler.propChanged.call(this.target, prop, value, oldValue, path)\n }\n }\n }\n if (prop.indexOf('Array-') !== 0 && typeof value === 'object') {\n this.watch(target, prop, target.$observeProps.$observerPath)\n }\n },\n mock: function(target) {\n var self = this\n obaa.methods.forEach(function(item) {\n target[item] = function() {\n var old = Array.prototype.slice.call(this, 0)\n var result = Array.prototype[item].apply(\n this,\n Array.prototype.slice.call(arguments)\n )\n if (new RegExp('\\\\b' + item + '\\\\b').test(obaa.triggerStr)) {\n for (var cprop in this) {\n if (this.hasOwnProperty(cprop) && !obaa.isFunction(this[cprop])) {\n self.watch(this, cprop, this.$observeProps.$observerPath)\n }\n }\n //todo\n self.onPropertyChanged(\n 'Array-' + item,\n this,\n old,\n this,\n this.$observeProps.$observerPath\n )\n }\n return result\n }\n target[\n 'pure' + item.substring(0, 1).toUpperCase() + item.substring(1)\n ] = function() {\n return Array.prototype[item].apply(\n this,\n Array.prototype.slice.call(arguments)\n )\n }\n })\n },\n watch: function(target, prop, path) {\n if (prop === '$observeProps' || prop === '$observer') return\n if (obaa.isFunction(target[prop])) return\n if (!target.$observeProps) target.$observeProps = {}\n if (path !== undefined) {\n target.$observeProps.$observerPath = path\n } else {\n target.$observeProps.$observerPath = '#'\n }\n var self = this\n var currentValue = (target.$observeProps[prop] = target[prop])\n Object.defineProperty(target, prop, {\n get: function() {\n return this.$observeProps[prop]\n },\n set: function(value) {\n var old = this.$observeProps[prop]\n this.$observeProps[prop] = value\n self.onPropertyChanged(\n prop,\n value,\n old,\n this,\n target.$observeProps.$observerPath\n )\n }\n })\n if (typeof currentValue == 'object') {\n if (obaa.isArray(currentValue)) {\n this.mock(currentValue)\n if (currentValue.length === 0) {\n if (!currentValue.$observeProps) currentValue.$observeProps = {}\n if (path !== undefined) {\n currentValue.$observeProps.$observerPath = path\n } else {\n currentValue.$observeProps.$observerPath = '#'\n }\n }\n }\n for (var cprop in currentValue) {\n if (currentValue.hasOwnProperty(cprop)) {\n this.watch(\n currentValue,\n cprop,\n target.$observeProps.$observerPath + '-' + prop\n )\n }\n }\n }\n }\n }\n return new _observe(target, arr, callback)\n}\n\nobaa.methods = [\n 'concat',\n 'copyWithin',\n 'entries',\n 'every',\n 'fill',\n 'filter',\n 'find',\n 'findIndex',\n 'forEach',\n 'includes',\n 'indexOf',\n 'join',\n 'keys',\n 'lastIndexOf',\n 'map',\n 'pop',\n 'push',\n 'reduce',\n 'reduceRight',\n 'reverse',\n 'shift',\n 'slice',\n 'some',\n 'sort',\n 'splice',\n 'toLocaleString',\n 'toString',\n 'unshift',\n 'values',\n 'size'\n]\nobaa.triggerStr = [\n 'concat',\n 'copyWithin',\n 'fill',\n 'pop',\n 'push',\n 'reverse',\n 'shift',\n 'sort',\n 'splice',\n 'unshift',\n 'size'\n].join(',')\n\nobaa.isArray = function(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nobaa.isString = function(obj) {\n return typeof obj === 'string'\n}\n\nobaa.isInArray = function(arr, item) {\n for (var i = arr.length; --i > -1; ) {\n if (item === arr[i]) return true\n }\n return false\n}\n\nobaa.isFunction = function(obj) {\n return Object.prototype.toString.call(obj) == '[object Function]'\n}\n\nobaa._getRootName = function(prop, path) {\n if (path === '#') {\n return prop\n }\n return path.split('-')[1]\n}\n\nobaa.add = function(obj, prop) {\n var $observer = obj.$observer\n $observer.watch(obj, prop)\n}\n\nobaa.set = function(obj, prop, value, exec) {\n if (!exec) {\n obj[prop] = value\n }\n var $observer = obj.$observer\n $observer.watch(obj, prop)\n if (exec) {\n obj[prop] = value\n }\n}\n\nArray.prototype.size = function(length) {\n this.length = length\n}\n\nexport default obaa\n","const callbacks = []\nconst nextTickCallback = []\n\nexport function tick(fn, scope) {\n callbacks.push({ fn, scope })\n}\n\nexport function fireTick() {\n callbacks.forEach(item => {\n item.fn.call(item.scope)\n })\n\n nextTickCallback.forEach(nextItem => {\n nextItem.fn.call(nextItem.scope)\n })\n nextTickCallback.length = 0\n}\n\nexport function nextTick(fn, scope) {\n nextTickCallback.push({ fn, scope })\n}\n","import obaa from './obaa'\nimport { fireTick } from './tick'\n\nexport function proxyUpdate(ele) {\n let timeout = null\n obaa(ele.data, () => {\n if (ele._willUpdate) {\n return\n }\n if (ele.constructor.mergeUpdate) {\n clearTimeout(timeout)\n\n timeout = setTimeout(() => {\n ele.update()\n fireTick()\n }, 0)\n } else {\n ele.update()\n fireTick()\n }\n })\n}\n","import {\n SYNC_RENDER,\n NO_RENDER,\n FORCE_RENDER,\n ASYNC_RENDER,\n ATTR_KEY\n} from '../constants'\nimport options from '../options'\nimport { extend, applyRef } from '../util'\nimport { enqueueRender } from '../render-queue'\nimport { getNodeProps } from './index'\nimport {\n diff,\n mounts,\n diffLevel,\n flushMounts,\n recollectNodeTree,\n removeChildren\n} from './diff'\nimport { createComponent, collectComponent } from './component-recycler'\nimport { removeNode } from '../dom/index'\nimport {\n addScopedAttrStatic,\n getCtorName,\n scopeHost\n} from '../style'\nimport { proxyUpdate } from '../observe'\n\n/** Set a component's `props` (generally derived from JSX attributes).\n *\t@param {Object} props\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\n */\nexport function setComponentProps(component, props, opts, context, mountAll) {\n if (component._disable) return\n component._disable = true\n\n if ((component.__ref = props.ref)) delete props.ref\n if ((component.__key = props.key)) delete props.key\n\n if (!component.base || mountAll) {\n if (component.beforeInstall) component.beforeInstall()\n if (component.install) component.install()\n if (component.constructor.observe) {\n proxyUpdate(component)\n }\n } else if (component.receiveProps) {\n component.receiveProps(props, component.data, component.props)\n }\n\n if (context && context !== component.context) {\n if (!component.prevContext) component.prevContext = component.context\n component.context = context\n }\n\n if (!component.prevProps) component.prevProps = component.props\n component.props = props\n\n component._disable = false\n\n if (opts !== NO_RENDER) {\n if (\n opts === SYNC_RENDER ||\n options.syncComponentUpdates !== false ||\n !component.base\n ) {\n renderComponent(component, SYNC_RENDER, mountAll)\n } else {\n enqueueRender(component)\n }\n }\n\n applyRef(component.__ref, component)\n}\n\nfunction shallowComparison(old, attrs) {\n let name\n\n for (name in old) {\n if (attrs[name] == null && old[name] != null) {\n return true\n }\n }\n\n if (old.children.length > 0 || attrs.children.length > 0) {\n return true\n }\n\n for (name in attrs) {\n if (name != 'children') {\n let type = typeof attrs[name]\n if (type == 'function' || type == 'object') {\n return true\n } else if (attrs[name] != old[name]) {\n return true\n }\n }\n }\n}\n\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\n *\t@param {Component} component\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\n *\t@private\n */\nexport function renderComponent(component, opts, mountAll, isChild) {\n if (component._disable) return\n\n let props = component.props,\n data = component.data,\n context = component.context,\n previousProps = component.prevProps || props,\n previousState = component.prevState || data,\n previousContext = component.prevContext || context,\n isUpdate = component.base,\n nextBase = component.nextBase,\n initialBase = isUpdate || nextBase,\n initialChildComponent = component._component,\n skip = false,\n rendered,\n inst,\n cbase\n\n // if updating\n if (isUpdate) {\n component.props = previousProps\n component.data = previousState\n component.context = previousContext\n if (component.store || opts == FORCE_RENDER || shallowComparison(previousProps, props)) {\n skip = false\n if (component.beforeUpdate) {\n component.beforeUpdate(props, data, context)\n }\n } else {\n skip = true\n }\n component.props = props\n component.data = data\n component.context = context\n }\n\n component.prevProps = component.prevState = component.prevContext = component.nextBase = null\n\n if (!skip) {\n component.beforeRender && component.beforeRender()\n rendered = component.render(props, data, context)\n\n //don't rerender\n if (component.constructor.css || component.css) {\n addScopedAttrStatic(\n rendered,\n '_s' + getCtorName(component.constructor)\n )\n }\n\n scopeHost(rendered, component.scopedCssAttr)\n\n // context to pass to the child, can be updated via (grand-)parent component\n if (component.getChildContext) {\n context = extend(extend({}, context), component.getChildContext())\n }\n\n let childComponent = rendered && rendered.nodeName,\n toUnmount,\n base,\n ctor = options.mapping[childComponent]\n\n if (ctor) {\n // set up high order component link\n\n let childProps = getNodeProps(rendered)\n inst = initialChildComponent\n\n if (inst && inst.constructor === ctor && childProps.key == inst.__key) {\n setComponentProps(inst, childProps, SYNC_RENDER, context, false)\n } else {\n toUnmount = inst\n\n component._component = inst = createComponent(ctor, childProps, context)\n inst.nextBase = inst.nextBase || nextBase\n inst._parentComponent = component\n setComponentProps(inst, childProps, NO_RENDER, context, false)\n renderComponent(inst, SYNC_RENDER, mountAll, true)\n }\n\n base = inst.base\n } else {\n cbase = initialBase\n\n // destroy high order component link\n toUnmount = initialChildComponent\n if (toUnmount) {\n cbase = component._component = null\n }\n\n if (initialBase || opts === SYNC_RENDER) {\n if (cbase) cbase._component = null\n base = diff(\n cbase,\n rendered,\n context,\n mountAll || !isUpdate,\n initialBase && initialBase.parentNode,\n true\n )\n }\n }\n\n if (initialBase && base !== initialBase && inst !== initialChildComponent) {\n let baseParent = initialBase.parentNode\n if (baseParent && base !== baseParent) {\n baseParent.replaceChild(base, initialBase)\n\n if (!toUnmount) {\n initialBase._component = null\n recollectNodeTree(initialBase, false)\n }\n }\n }\n\n if (toUnmount) {\n unmountComponent(toUnmount)\n }\n\n component.base = base\n if (base && !isChild) {\n let componentRef = component,\n t = component\n while ((t = t._parentComponent)) {\n ;(componentRef = t).base = base\n }\n base._component = componentRef\n base._componentConstructor = componentRef.constructor\n }\n }\n\n if (!isUpdate || mountAll) {\n mounts.unshift(component)\n } else if (!skip) {\n // Ensure that pending componentDidMount() hooks of child components\n // are called before the componentDidUpdate() hook in the parent.\n // Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\n // flushMounts();\n\n if (component.afterUpdate) {\n //deprecated\n component.afterUpdate(previousProps, previousState, previousContext)\n }\n if (component.updated) {\n component.updated(previousProps, previousState, previousContext)\n }\n if (options.afterUpdate) options.afterUpdate(component)\n }\n\n if (component._renderCallbacks != null) {\n while (component._renderCallbacks.length)\n component._renderCallbacks.pop().call(component)\n }\n\n if (!diffLevel && !isChild) flushMounts()\n}\n\n/** Apply the Component referenced by a VNode to the DOM.\n *\t@param {Element} dom\tThe DOM node to mutate\n *\t@param {VNode} vnode\tA Component-referencing VNode\n *\t@returns {Element} dom\tThe created/mutated element\n *\t@private\n */\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\n let c = dom && dom._component,\n originalComponent = c,\n oldDom = dom,\n isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n isOwner = isDirectOwner,\n props = getNodeProps(vnode)\n while (c && !isOwner && (c = c._parentComponent)) {\n isOwner = c.constructor === vnode.nodeName\n }\n\n if (c && isOwner && (!mountAll || c._component)) {\n setComponentProps(c, props, ASYNC_RENDER, context, mountAll)\n dom = c.base\n } else {\n if (originalComponent && !isDirectOwner) {\n unmountComponent(originalComponent)\n dom = oldDom = null\n }\n\n c = createComponent(vnode.nodeName, props, context, vnode)\n if (dom && !c.nextBase) {\n c.nextBase = dom\n // passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\n oldDom = null\n }\n setComponentProps(c, props, SYNC_RENDER, context, mountAll)\n dom = c.base\n\n if (oldDom && dom !== oldDom) {\n oldDom._component = null\n recollectNodeTree(oldDom, false)\n }\n }\n\n return dom\n}\n\n/** Remove a component from the DOM and recycle it.\n *\t@param {Component} component\tThe Component instance to unmount\n *\t@private\n */\nexport function unmountComponent(component) {\n if (options.beforeUnmount) options.beforeUnmount(component)\n\n let base = component.base\n\n component._disable = true\n\n if (component.uninstall) component.uninstall()\n\n component.base = null\n\n // recursively tear down & recollect high-order component children:\n let inner = component._component\n if (inner) {\n unmountComponent(inner)\n } else if (base) {\n if (base[ATTR_KEY] != null) applyRef(base[ATTR_KEY].ref, null)\n\n component.nextBase = base\n\n removeNode(base)\n collectComponent(component)\n\n removeChildren(base)\n }\n\n applyRef(component.__ref, null)\n}\n","import { FORCE_RENDER } from './constants'\nimport { renderComponent } from './vdom/component'\nimport options from './options'\nimport { nProps, assign } from './util'\n\nlet id = 0\n\nexport default class Component {\n static is = 'WeElement'\n\n constructor(props, store) {\n this.props = assign(\n nProps(this.constructor.props),\n this.constructor.defaultProps,\n props\n )\n this.elementId = id++\n this.data = this.constructor.data || this.data || {}\n\n this._preCss = null\n\n this.store = store\n }\n\n update(callback) {\n this._willUpdate = true\n if (callback)\n (this._renderCallbacks = this._renderCallbacks || []).push(callback)\n renderComponent(this, FORCE_RENDER)\n if (options.componentChange) options.componentChange(this, this.base)\n this._willUpdate = false\n }\n\n fire(type, data) {\n Object.keys(this.props).every(key => {\n if ('on' + type.toLowerCase() === key.toLowerCase()) {\n this.props[key]({ detail: data })\n return false\n }\n return true\n })\n }\n\n render() {}\n}\n","import { diff } from './vdom/diff'\nimport obaa from './obaa'\nimport { getUse } from './util' \n\n/** Render JSX into a `parent` Element.\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\n *\t@param {Element} parent\t\tDOM element to render into\n *\t@param {object} [store]\n *\t@public\n */\nexport function render(vnode, parent, store, empty, merge) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n store.instances = []\n extendStoreUpate(store)\n let timeout = null\n let patchs = {}\n obaa(store.data, (prop, val, old, path) => {\n clearTimeout(timeout)\n const key = fixPath(path + '-' + prop)\n patchs[key] = true\n timeout = setTimeout(() => {\n store.update(patchs)\n patchs = {}\n }, 0)\n })\n }\n\n if (empty) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild)\n }\n }\n\n if (merge) {\n merge =\n typeof merge === 'string'\n ? document.querySelector(merge)\n : merge\n }\n\n return diff(merge, vnode, store, false, parent, false)\n}\n\n\nfunction extendStoreUpate(store) {\n store.update = function(patch) {\n const updateAll = matchGlobalData(this.globalData, patch)\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n if (\n updateAll ||\n this.updateAll ||\n (instance.constructor.updatePath &&\n needUpdate(patch, instance.constructor.updatePath))\n ) {\n //update this.use\n instance.use = getUse(store.data, instance.constructor.use)\n instance.update()\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nexport function matchGlobalData(globalData, diffResult) {\n if (!globalData) return false\n for (let keyA in diffResult) {\n if (globalData.indexOf(keyA) > -1) {\n return true\n }\n for (let i = 0, len = globalData.length; i < len; i++) {\n if (includePath(keyA, globalData[i])) {\n return true\n }\n }\n }\n return false\n}\n\nexport function needUpdate(diffResult, updatePath) {\n for (let keyA in diffResult) {\n if (updatePath[keyA]) {\n return true\n }\n for (let keyB in updatePath) {\n if (includePath(keyA, keyB)) {\n return true\n }\n }\n }\n return false\n}\n\nfunction includePath(pathA, pathB) {\n if (pathA.indexOf(pathB) === 0) {\n const next = pathA.substr(pathB.length, 1)\n if (next === '[' || next === '.') {\n return true\n }\n }\n return false\n}\n\nexport function fixPath(path) {\n let mpPath = ''\n const arr = path.replace('#-', '').split('-')\n arr.forEach((item, index) => {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n })\n return mpPath\n}\n\nfunction getArrayPatch(path, store) {\n const arr = path.replace('/', '').split('/')\n let current = store.data[arr[0]]\n for (let i = 1, len = arr.length; i < len - 1; i++) {\n current = current[arr[i]]\n }\n return { k: fixArrPath(path), v: current }\n}\n\nfunction fixArrPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n const len = arr.length\n arr.forEach((item, index) => {\n if (index < len - 1) {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n }\n })\n return mpPath\n}\n","import options from './options'\n\nconst OBJECTTYPE = '[object Object]'\nconst ARRAYTYPE = '[object Array]'\n\nexport function define(name, ctor) {\n options.mapping[name] = ctor\n if (ctor.use) {\n ctor.updatePath = getPath(ctor.use)\n } else if (ctor.data) { //Compatible with older versions\n ctor.updatePath = getUpdatePath(ctor.data)\n }\n}\n\nfunction getPath(obj) {\n if (Object.prototype.toString.call(obj) === '[object Array]') {\n const result = {}\n obj.forEach(item => {\n if (typeof item === 'string') {\n result[item] = true\n } else {\n const tempPath = item[Object.keys(item)[0]]\n if (typeof tempPath === 'string') {\n result[tempPath] = true\n } else {\n if(typeof tempPath[0] === 'string'){\n result[tempPath[0]] = true\n }else{\n tempPath[0].forEach(path => result[path] = true)\n }\n }\n }\n })\n return result\n } else {\n return getUpdatePath(obj)\n }\n}\n\nexport function getUpdatePath(data) {\n const result = {}\n dataToPath(data, result)\n return result\n}\n\nfunction dataToPath(data, result) {\n Object.keys(data).forEach(key => {\n result[key] = true\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], key, result)\n }\n })\n}\n\nfunction _objToPath(data, path, result) {\n Object.keys(data).forEach(key => {\n result[path + '.' + key] = true\n delete result[path]\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], path + '.' + key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], path + '.' + key, result)\n }\n })\n}\n\nfunction _arrayToPath(data, path, result) {\n data.forEach((item, index) => {\n result[path + '[' + index + ']'] = true\n delete result[path]\n const type = Object.prototype.toString.call(item)\n if (type === OBJECTTYPE) {\n _objToPath(item, path + '[' + index + ']', result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(item, path + '[' + index + ']', result)\n }\n })\n}\n","export function rpx(str) {\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\n return (window.innerWidth * Number(b)) / 750 + 'px'\n })\n}\n","import Component from './component'\n\nexport default class ModelView extends Component {\n static observe = true\n\n static mergeUpdate = true\n\n beforeInstall() {\n this.data = this.vm.data\n }\n}\n","/**\n * classNames based on https://github.com/JedWatson/classnames\n * by Jed Watson\n * Licensed under the MIT License\n * https://github.com/JedWatson/classnames/blob/master/LICENSE\n * modified by dntzhang\n */\n\nvar hasOwn = {}.hasOwnProperty\n\nexport function classNames() {\n var classes = []\n\n for (var i = 0; i < arguments.length; i++) {\n var arg = arguments[i]\n if (!arg) continue\n\n var argType = typeof arg\n\n if (argType === 'string' || argType === 'number') {\n classes.push(arg)\n } else if (Array.isArray(arg) && arg.length) {\n var inner = classNames.apply(null, arg)\n if (inner) {\n classes.push(inner)\n }\n } else if (argType === 'object') {\n for (var key in arg) {\n if (hasOwn.call(arg, key) && arg[key]) {\n classes.push(key)\n }\n }\n }\n }\n\n return classes.join(' ')\n}\n\nexport function extractClass() {\n const [props, ...args] = Array.prototype.slice.call(arguments, 0)\n if (props) {\n if (props.class) {\n args.unshift(props.class)\n delete props.class\n } else if (props.className) {\n args.unshift(props.className)\n delete props.className\n }\n }\n if (args.length > 0) {\n return { class: classNames.apply(null, args) }\n }\n}\n","export function getHost(component) {\n let base = component.base\n if (base) {\n while (base.parentNode) {\n if (base.parentNode._component) {\n return base.parentNode._component\n } else {\n base = base.parentNode\n }\n }\n }\n}","/**\n * preact-render-to-string based on preact-render-to-string\n * by Jason Miller\n * Licensed under the MIT License\n * https://github.com/developit/preact-render-to-string\n *\n * modified by dntzhang\n */\n\nimport options from './options'\n\nimport {\n addScopedAttrStatic,\n getCtorName,\n scopeHost,\n scoper\n} from './style'\n\n\nconst encodeEntities = s => String(s)\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"');\n\nconst indent = (s, char) => String(s).replace(/(\\n+)/g, '$1' + (char || '\\t'));\n\nconst mapping = options.mapping\n\nconst VOID_ELEMENTS = /^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/;\n\nconst isLargeString = (s, length, ignoreLines) => (String(s).length > (length || 40) || (!ignoreLines && String(s).indexOf('\\n') !== -1) || String(s).indexOf('<') !== -1);\n\nconst JS_TO_CSS = {};\n\n// Convert an Object style to a CSSText string\nfunction styleObjToCss(s) {\n let str = '';\n for (let prop in s) {\n let val = s[prop];\n if (val != null) {\n if (str) str += ' ';\n // str += jsToCss(prop);\n str += JS_TO_CSS[prop] || (JS_TO_CSS[prop] = prop.replace(/([A-Z])/g, '-$1').toLowerCase());\n str += ': ';\n str += val;\n if (typeof val === 'number' && IS_NON_DIMENSIONAL.test(prop) === false) {\n str += 'px';\n }\n str += ';';\n }\n }\n return str || undefined;\n}\n\n/** The default export is an alias of `render()`. */\nexport function renderToString(vnode, opts, store, isSvgMode, css) {\n if (vnode == null || typeof vnode === 'boolean') {\n return '';\n }\n\n let nodeName = vnode.nodeName,\n attributes = vnode.attributes,\n isComponent = false;\n store = store || {};\n opts = Object.assign({\n scopedCSS: true\n },opts)\n\n let pretty = true && opts.pretty,\n indentChar = pretty && typeof pretty === 'string' ? pretty : '\\t';\n\n // #text nodes\n if (typeof vnode !== 'object' && !nodeName) {\n return encodeEntities(vnode);\n }\n\n // components\n const ctor = mapping[nodeName]\n if (ctor) {\n isComponent = true;\n\n let props = getNodeProps(vnode),\n rendered;\n // class-based components\n let c = new ctor(props, store);\n // turn off stateful re-rendering:\n c._disable = c.__x = true;\n c.props = props;\n c.store = store;\n if (c.install) c.install();\n if (c.beforeRender) c.beforeRender();\n rendered = c.render(c.props, c.data, c.store);\n let tempCss \n if(opts.scopedCSS){\n\n if (c.constructor.css || c.css) {\n\n const cssStr = c.constructor.css ? c.constructor.css : (typeof c.css === 'function' ? c.css() : c.css)\n const cssAttr = '_s' + getCtorName(c.constructor)\n\n tempCss = ``\n\n addScopedAttrStatic(\n rendered,\n '_s' + getCtorName(c.constructor)\n )\n }\n \n c.scopedCSSAttr = vnode.css\n scopeHost(rendered, c.scopedCSSAttr)\n }\n\n return renderToString(rendered, opts, store, false, tempCss);\n }\n\n\n // render JSX to HTML\n let s = '', html;\n\n if (attributes) {\n let attrs = Object.keys(attributes);\n\n // allow sorting lexicographically for more determinism (useful for tests, such as via preact-jsx-chai)\n if (opts && opts.sortAttributes === true) attrs.sort();\n\n for (let i = 0; i < attrs.length; i++) {\n let name = attrs[i],\n v = attributes[name];\n if (name === 'children') continue;\n\n if (name.match(/[\\s\\n\\\\/='\"\\0<>]/)) continue;\n\n if (!(opts && opts.allAttributes) && (name === 'key' || name === 'ref')) continue;\n\n if (name === 'className') {\n if (attributes.class) continue;\n name = 'class';\n }\n else if (isSvgMode && name.match(/^xlink:?./)) {\n name = name.toLowerCase().replace(/^xlink:?/, 'xlink:');\n }\n\n if (name === 'style' && v && typeof v === 'object') {\n v = styleObjToCss(v);\n }\n\n let hooked = opts.attributeHook && opts.attributeHook(name, v, store, opts, isComponent);\n if (hooked || hooked === '') {\n s += hooked;\n continue;\n }\n\n if (name === 'dangerouslySetInnerHTML') {\n html = v && v.__html;\n }\n else if ((v || v === 0 || v === '') && typeof v !== 'function') {\n if (v === true || v === '') {\n v = name;\n // in non-xml mode, allow boolean attributes\n if (!opts || !opts.xml) {\n s += ' ' + name;\n continue;\n }\n }\n s += ` ${name}=\"${encodeEntities(v)}\"`;\n }\n }\n }\n\n // account for >1 multiline attribute\n if (pretty) {\n let sub = s.replace(/^\\n\\s*/, ' ');\n if (sub !== s && !~sub.indexOf('\\n')) s = sub;\n else if (pretty && ~s.indexOf('\\n')) s += '\\n';\n }\n\n s = `<${nodeName}${s}>`;\n if (String(nodeName).match(/[\\s\\n\\\\/='\"\\0<>]/)) throw s;\n\n let isVoid = String(nodeName).match(VOID_ELEMENTS);\n if (isVoid) s = s.replace(/>$/, ' />');\n\n let pieces = [];\n if (html) {\n // if multiline, indent.\n if (pretty && isLargeString(html)) {\n html = '\\n' + indentChar + indent(html, indentChar);\n }\n s += html;\n }\n else if (vnode.children) {\n let hasLarge = pretty && ~s.indexOf('\\n');\n for (let i = 0; i < vnode.children.length; i++) {\n let child = vnode.children[i];\n if (child != null && child !== false) {\n let childSvgMode = nodeName === 'svg' ? true : nodeName === 'foreignObject' ? false : isSvgMode,\n ret = renderToString(child, opts, store, childSvgMode);\n if (pretty && !hasLarge && isLargeString(ret)) hasLarge = true;\n if (ret) pieces.push(ret);\n }\n }\n if (pretty && hasLarge) {\n for (let i = pieces.length; i--;) {\n pieces[i] = '\\n' + indentChar + indent(pieces[i], indentChar);\n }\n }\n }\n\n if (pieces.length) {\n s += pieces.join('');\n }\n else if (opts && opts.xml) {\n return s.substring(0, s.length - 1) + ' />';\n }\n\n if (!isVoid) {\n if (pretty && ~s.indexOf('\\n')) s += '\\n';\n s += `${nodeName}>`;\n }\n\n if(css) return css + s;\n return s;\n}\n\nfunction assign(obj, props) {\n for (let i in props) obj[i] = props[i];\n return obj;\n}\n\nfunction getNodeProps(vnode) {\n let props = assign({}, vnode.attributes);\n props.children = vnode.children;\n\n let defaultProps = vnode.nodeName.defaultProps;\n if (defaultProps !== undefined) {\n for (let i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i];\n }\n }\n }\n\n return props;\n}","import { h, h as createElement } from './h'\nimport { cloneElement } from './clone-element'\nimport Component from './component'\nimport { render } from './render'\nimport { rerender } from './render-queue'\nimport options from './options'\nimport { define } from './define'\nimport { rpx } from './rpx'\nimport ModelView from './model-view'\nimport { classNames, extractClass } from './class'\nimport { getHost } from './get-host'\nimport { renderToString } from './render-to-string'\n\nconst WeElement = Component\nconst defineElement = define\nfunction createRef() {\n return {}\n}\n\noptions.root.Omi = {\n h,\n createElement,\n cloneElement,\n createRef,\n Component,\n render,\n rerender,\n options,\n WeElement,\n define,\n rpx,\n ModelView,\n defineElement,\n classNames,\n extractClass,\n getHost,\n renderToString\n}\noptions.root.omi = options.root.Omi\noptions.root.Omi.version = 'omio-1.3.8'\n\nexport default {\n h,\n createElement,\n cloneElement,\n createRef,\n Component,\n render,\n rerender,\n options,\n WeElement,\n define,\n rpx,\n ModelView,\n defineElement,\n classNames,\n extractClass,\n getHost,\n renderToString\n}\n\nexport {\n h,\n createElement,\n cloneElement,\n createRef,\n Component,\n render,\n rerender,\n options,\n WeElement,\n define,\n rpx,\n ModelView,\n defineElement,\n classNames,\n extractClass,\n getHost,\n renderToString\n}\n","import { render, WeElement, define } from '../../src/omi'\n\ndefine('my-counter', class extends WeElement {\n static use = [\n { count: 'count' }\n ]\n\n add = () => this.store.add()\n sub = () => this.store.sub()\n\n addIfOdd = () => {\n if (this.use.count % 2 !== 0) {\n this.store.add()\n }\n }\n\n addAsync = () => {\n setTimeout(() => this.store.add(), 1000)\n }\n\n render() {\n return (\n