diff --git a/README.CN.md b/README.CN.md index 729e29513..b2a4d21e4 100644 --- a/README.CN.md +++ b/README.CN.md @@ -379,6 +379,7 @@ define('my-component', _ => ( defaultProps: { }, + isLightDom: true, //default is false //生命周期 install() { }, diff --git a/README.md b/README.md index e826f8b0b..01ff1ac3b 100644 --- a/README.md +++ b/README.md @@ -384,6 +384,7 @@ define('my-component', _ => ( defaultProps: { }, + isLightDom: true, //default is false //life cycle install() { }, diff --git a/packages/omi/README.md b/packages/omi/README.md index be06e3714..7b37c0f68 100644 --- a/packages/omi/README.md +++ b/packages/omi/README.md @@ -1,9 +1,9 @@ English | [简体中文](https://github.com/Tencent/omi/blob/master/README.CN.md) -

omi

+

omi

omi

Omi - Front End Cross-Frameworks Framework

-

Merge Web Components, JSX, HTM, Virtual DOM, Functional style and Proxy into one framework with tiny size and high performance. Write components once, using in everywhere, such as Omi, React, Preact, Vue or Angular.

+

Merge Web Components, JSX, Virtual DOM, Functional style, observe or Proxy into one framework with tiny size and high performance. Write components once, using in everywhere, such as Omi, React, Preact, Vue or Angular.

## Quick Preview @@ -45,7 +45,7 @@ render(, 'body', new Store) * `` can be used in any framework or no framework, such as `document.createElement('my-counter')` -You can also use `useSelf`, `useSelf` only updates itself. When using `useSelf`, the corresponding attributes are accessed through. `usingSelf` in JSX. +You can also use `useSelf`, `useSelf` only updates itself. When using `useSelf`, the corresponding attributes are accessed through `usingSelf` in JSX. You can also implement `computed` props through `compute`, such as: @@ -96,7 +96,7 @@ define('my-counter', _ => ( }) ``` -![](https://github.com/Tencent/omi/raw/master/assets/store.jpg) +![](https://tencent.github.io/omi/assets/store.jpg) ### Multi-store injection @@ -159,39 +159,39 @@ How to Multi-store injection with `compute` and `computed`? Very simple: ```jsx define('my-app', _ => { - const store = _.store.storeA - const { data, add, sub } = store - return ( -

- Clicked: {data.count} times + const store = _.store.storeA + const { data, add, sub } = store + return ( +

+ Clicked: {data.count} times - + -

- {_.store.storeB.data.msg} - -
+ -
{_.computed.dobuleCount}
-
{_.computed.reverseMsg}
-

- ) +
{_.computed.dobuleCount}
+
{_.computed.reverseMsg}
+

+ ) }, { - useSelf: { - storeA: ['count', 'adding'], - storeB: ['msg'] - }, - compute: { - dobuleCount() { - return this.storeA.data.count * 2 - }, - reverseMsg() { - return this.storeB.data.msg.split('').reverse().join('') - } - } - }) + useSelf: { + storeA: ['count', 'adding'], + storeB: ['msg'] + }, + compute: { + dobuleCount() { + return this.storeA.data.count * 2 + }, + reverseMsg() { + return this.storeB.data.msg.split('').reverse().join('') + } + } + }) ``` ### API and Hooks @@ -214,7 +214,8 @@ define('my-component', _ => ( }, defaultProps: { - }, + }, + sLightDom: true, //default is false //life cycle install() { }, @@ -233,18 +234,25 @@ define('my-component', _ => ( }) ``` +### Inject use or useSelf through prop + +```jsx + +``` + ## Ecosystem of Omi -#### Base +#### :100:Base | **Project** | **Description** | | ------------------------------- | ----------------------------------- | | [omi-docs](https://tencent.github.io/omi/site/docs/index.html) and [codepen](https://codepen.io/collection/DrMYgV/) and [webcomponents.dev](https://webcomponents.dev/)| Omi official documents | +| [omix![](https://dntzhang.github.io/cax/asset/hot.png)](https://github.com/Tencent/omi/tree/master/packages/omix)| 小程序全局状态管理框架,数据触手可及,状态无处遁形 | | [omim![](https://dntzhang.github.io/cax/asset/hot.png)](https://github.com/Tencent/omi/tree/master/packages/omim)| Cross **frameworks** and **themes** components.([DOCS & REPL](https://tencent.github.io/omi/packages/omim/docs/build/index.html) && [JOIN US!](https://github.com/Tencent/omi/tree/master/packages/omim#contribution))| | [omi-kbone![](https://dntzhang.github.io/cax/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omi-kbone)| 使用 omi + [kbone](https://github.com/wechat-miniprogram/kbone) 多端开发(小程序和Web)的贪吃蛇游戏。 | | [omio](https://github.com/Tencent/omi/tree/master/packages/omio)| Omi for old browsers with same api(IE8+)| +| [omiv![](https://dntzhang.github.io/cax/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omiv)| 1kb store system for Vue apps. [SSR Now](https://github.com/Tencent/omi/tree/master/packages/vue-omiv-ssr-starter) | | [omis![](https://dntzhang.github.io/cax/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omis)| Omis + React| -| [omiv![](https://dntzhang.github.io/cax/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omiv)| Omiv + Vue| | [omi-ssr](https://github.com/Tencent/omi/tree/master/packages/omi-ssr)| Server-side rendering(support omio only)| | [omi-router](https://github.com/Tencent/omi/tree/master/packages/omi-router) |Omi official router in 1KB js| | [omi-cli](https://github.com/Tencent/omi/tree/master/packages/omi-cli)| Project scaffolding. [→ Base Templates](https://github.com/Tencent/omi/tree/master/packages/omi-cli/template) and [→ Other Templates](https://github.com/omijs) | @@ -254,22 +262,24 @@ define('my-component', _ => ( | [omi-snippets](https://github.com/Wscats/omi-snippets) |A beautify VSCode extension for .omi or .eno file, [Install now!](https://marketplace.visualstudio.com/items?itemName=Wscats.omi-snippets)| | [obaa](https://github.com/Tencent/omi/tree/master/packages/obaa) or [JSONPatcherProxy](https://github.com/Palindrom/JSONPatcherProxy) | Observe or Proxy any object's any change | -#### Snake MVP +#### :snake:Snake MVP | **Project** | **Description** | | ------------------------------- | ----------------------------------- | | [omi-snake![](https://dntzhang.github.io/cax/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omi-snake) & [→ Touch the demo](https://tencent.github.io/omi/packages/omi-snake/build/index.html)| The Snake-Eating Game Based on MVP Architecture Written by Omi | -| [omi-kbone-snake![](https://dntzhang.github.io/cax/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omi-kbone)| omi-kbone 写的 MVP 架构的贪吃蛇小程序 | -| [Preact-snake![](https://dntzhang.github.io/cax/asset/hot.png)](https://github.com/Tencent/omi/tree/master/packages/preact-css/examples/snake) & [→ Touch the demo](https://tencent.github.io/omi/packages/preact-css/examples/snake/build/)| The Snake-Eating Game Based on MVP Architecture Written by Preact + [Preact-CSS](https://github.com/Tencent/omi/tree/master/packages/preact-css) + Omis | -| [[P]react-snake![](https://dntzhang.github.io/cax/asset/hot.png)](https://github.com/Tencent/omi/tree/master/packages/react-snake) & [→ Touch the demo](https://tencent.github.io/omi/packages/react-snake/build/index.html)| The Snake-Eating Game Based on MVP Architecture Written by React/Preact | +| [omi-kbone-snake![](https://dntzhang.github.io/cax/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/omi-kbone)| omi-kbone 写的 MVP 架构的跨端贪吃蛇游戏,支持小程序和 H5 | +| [Preact-snake](https://github.com/Tencent/omi/tree/master/packages/preact-css/examples/snake) & [→ Touch the demo](https://tencent.github.io/omi/packages/preact-css/examples/snake/build/)| The Snake-Eating Game Based on MVP Architecture Written by Preact + [Preact-CSS](https://github.com/Tencent/omi/tree/master/packages/preact-css) + Omis | +| [[P]react-snake](https://github.com/Tencent/omi/tree/master/packages/react-snake) & [→ Touch the demo](https://tencent.github.io/omi/packages/react-snake/build/index.html)| The Snake-Eating Game Based on MVP Architecture Written by React/Preact | +| [vue-snake](https://github.com/Tencent/omi/tree/master/packages/vue-snake) | The Snake-Eating Game Based on MVP Architecture Written by Vue + Omiv | +| [omix-snake![](https://dntzhang.github.io/cax/asset/hot.png)](https://github.com/Tencent/omi/tree/master/packages/omix-snake) | The Snake-Eating Game Based on MVP Architecture Written by Omix | -#### Mini Program(小程序) +#### :+1:Mini Program(小程序) | **Project** | **Description** | | ------------------------------- | ----------------------------------- | +| [omix![](https://dntzhang.github.io/cax/asset/hot.png)](https://github.com/Tencent/omi/tree/master/packages/omix)| 小程序全局状态管理框架,数据触手可及,状态无处遁形 | | [react-kbone![](https://dntzhang.github.io/cax/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/react-kbone)| 直接使用 React 开发小程序或 Web,基于 [kbone](https://github.com/wechat-miniprogram/kbone) | | [preact-kbone![](https://dntzhang.github.io/cax/asset/hot.png) ](https://github.com/Tencent/omi/tree/master/packages/preact-kbone)| 直接使用 Preact 开发小程序或 Web,基于 [kbone](https://github.com/wechat-miniprogram/kbone) | -| [omix![](https://dntzhang.github.io/cax/asset/hot.png)](https://github.com/Tencent/omi/tree/master/packages/omix)| 极小却精巧的小程序框架| | [omi-cloud](https://github.com/Tencent/omi/tree/master/packages/omi-cloud)| 小程序•云开发| | [omip](https://github.com/Tencent/omi/tree/master/packages/omip)| 直接使用 Omi 开发小程序或 H5 SPA| | [mps](https://github.com/Tencent/omi/tree/master/packages/mps)| 原生小程序增强框架(JSX + Less 输出 WXML + WXSS),也支持 QQ 轻应用 | @@ -279,7 +289,7 @@ define('my-component', _ => ( | [comi](https://github.com/Tencent/omi/tree/master/packages/comi)| 小程序代码高亮和 markdown 渲染组件 | | [wx-touch-event](https://github.com/qbright/wx-touch-event)| 基于 [AlloyFinger](https://github.com/AlloyTeam/AlloyFinger) 改造的小程序手势解决方案 | -#### Other +#### :books:Other | **Project** | **Description** | | ------------------------------- | ----------------------------------- | @@ -299,6 +309,8 @@ define('my-component', _ => ( | [omi-page](https://github.com/Tencent/omi/tree/master/packages/omi-page) |Tiny client-side router by [page](https://github.com/visionmedia/page.js)| | [omie](https://github.com/Wscats/omi-electron) |Build cross platform desktop apps with Omi.js and Electron.js| | [omi-cv](https://github.com/Wscats/CV) |Create a front-end engineer curriculum vitae, [Get Started!](http://wscats.github.io/CV/omi/build/index.html)| +| [Soo](https://github.com/tonis2/Soo)| Has same API as omi but is great alternative if you want to create custom elements without JSX, virtual DOM and store | +|[CEE](https://omijs.github.io/cee/out/)| Fork from custom-elements-everywhere | ## Why Omi? @@ -315,7 +327,7 @@ define('my-component', _ => ( - Excellent compatibility(IE8+) with [omio](https://github.com/Tencent/omi/tree/master/packages/omio) - Enhanced CSS, [rpx unit support](https://github.com/Tencent/omi/releases/tag/v4.0.26) base on **750** screen width - Compliance with browser trend and API design -- Merge [**Web Components**](https://developers.google.com/web/fundamentals/web-components/), [**JSX**](https://reactjs.org/docs/introducing-jsx.html) and [**HTM**](https://github.com/developit/htm) into one framework +- Merge [**Web Components**](https://developers.google.com/web/fundamentals/web-components/), [**JSX**](https://reactjs.org/docs/introducing-jsx.html) into one framework - Web Components can also be a data-driven view, **`UI = fn(data)`**. - JSX is the best development experience (code intelligent completion and tip) UI Expression with least [grammatical noise](https://github.com/facebook/jsx#why-not-template-literals) and it's turing complete(template engine is not, es template string is but grammatical noise is too loud) - Look at [Facebook React vs Web Components](https://softwareengineering.stackexchange.com/questions/225400/pros-and-cons-of-facebooks-react-vs-web-components-polymer),Omi **combines their advantages** and gives developers the **freedom to choose the way they like** @@ -335,6 +347,7 @@ Omi uses Shadow DOM based style isolation and semantic structure. | **Title Name** | **Other language** | **Related**| | ----------------------------------------- | ------------------ |-----------------| +|[Web Components bookmarks](https://www.notion.so/Web-Components-bookmarks-64066078f891433dbc74997dc4d64302)||| |[Snake-Eating Game Making with Web Components of Omi and MVP Architecture](https://github.com/Tencent/omi/blob/master/tutorial/omi-web-components-snake-game-mvp.md)||| |[Constructable Stylesheets: seamless reusable styles](https://developers.google.com/web/updates/2019/02/constructable-stylesheets)||| |[Web Components specifications](https://github.com/w3c/webcomponents)||| @@ -381,21 +394,24 @@ npm run test ``` -## Maintainers +## Core Maintainers +- [AlloyTeam](http://alloyteam.com/) +- [@Wscats](https://github.com/Wscats) - [@f](https://github.com/f) - [@LeeHyungGeun](https://github.com/LeeHyungGeun) - [@dntzhang](https://github.com/dntzhang) - [@xcatliu](https://github.com/xcatliu) -Please contact us for any questions. Also, Add [Omi QQ Group](https://github.com/Tencent/omi/issues/169). +Please contact us for any questions. ## Thanks * [preact](https://github.com/developit/preact) -* [JSONPatcherProxy](https://github.com/Palindrom/JSONPatcherProxy) +* [obaa](https://github.com/Tencent/omi/tree/master/packages/obaa) * [create-react-app](https://github.com/facebook/create-react-app) * [JSX](https://github.com/facebook/jsx) +* [JSONPatcherProxy](https://github.com/Palindrom/JSONPatcherProxy) ## License diff --git a/packages/omi/dist/omi.dev.js b/packages/omi/dist/omi.dev.js index aa8f0f88a..3ef96b629 100644 --- a/packages/omi/dist/omi.dev.js +++ b/packages/omi/dist/omi.dev.js @@ -1,5 +1,5 @@ /** - * Omi v6.18.0 http://omijs.org + * Omi v6.18.1 http://omijs.org * Front End Cross-Frameworks Framework. * By dntzhang https://github.com/dntzhang * Github: https://github.com/Tencent/omi @@ -1682,6 +1682,7 @@ Ele.css = config.css; Ele.propTypes = config.propTypes; Ele.defaultProps = config.defaultProps; + Ele.isLightDom = config.isLightDom; var _loop = function _loop(key) { if (typeof config[key] === 'function') { @@ -1803,7 +1804,7 @@ return JSON.stringify(obj); } - var n=function(t,r,u,e){for(var p=1;p=5&&((e||!n&&5===u)&&(s.push(e,u,r), u=6), n&&(s.push(n,u,r), u=6)), e="";},a=0;a"===t?(u=1, e=""):e=t+e[0]:p?t===p?p="":e+=t:'"'===t||"'"===t?p=t:">"===t?(h(), u=1):u&&("="===t?(u=5, r=e, e=""):"/"===t&&(u<5||">"===n[a][f+1])?(h(), 3===u&&(s=s[0]), u=s, (s=s[0]).push(u,2), u=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(h(), u=2):e+=t), 3===u&&"!--"===e&&(u=4, s=s[0]);}return h(), s},r="function"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)), r}:function(n){for(var r="",e=0;e1?r:r[0]} + var n=function(t,r,u,e){for(var p=1;p"===t?(a(), u=1):u&&("="===t?(u=4, r=e, e=""):"/"===t?(a(), 3===u&&(s=s[0]), u=s, (s=s[0]).push(u,4), u=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(), u=2):e+=t);}return a(), s},r="function"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)), r}:function(n){for(var r="",e=0;e1?r:r[0]} h.f = Fragment; @@ -1849,7 +1850,7 @@ options.root.Omi = omi; options.root.omi = omi; - options.root.Omi.version = '6.18.0'; + options.root.Omi.version = '6.18.1'; if (typeof module != 'undefined') module.exports = omi;else self.Omi = omi; }()); diff --git a/packages/omi/dist/omi.dev.js.3027334956 b/packages/omi/dist/omi.dev.js.3027334956 new file mode 100644 index 000000000..8c287b78a --- /dev/null +++ b/packages/omi/dist/omi.dev.js.3027334956 @@ -0,0 +1,1857 @@ +/** + * Omi v6.18.0 http://omijs.org + * Front End Cross-Frameworks Framework. + * By dntzhang https://github.com/dntzhang + * Github: https://github.com/Tencent/omi + * MIT Licensed. + */ + +(function () { + 'use strict'; + + function getGlobal() { + if (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) { + return self || window || global || function () { + return this; + }(); + } + return global; + } + + /** Global options + * @public + * @namespace options {Object} + */ + var options = { + store: null, + root: getGlobal(), + mapping: {}, + isMultiStore: false, + //when set true, using props of hypescript, don't use getAttribute + //if you render all the node tree by omi self, set it + ignoreAttrs: false + }; + + /** + * @license + * Copyright (c) 2016 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt + */ + (function () { + if ( + // No Reflect, no classes, no need for shim because native custom elements + // require ES2015 classes or Reflect. + window.Reflect === undefined || window.customElements === undefined || + // The webcomponentsjs custom elements polyfill doesn't require + // ES2015-compatible construction (`super()` or `Reflect.construct`). + window.customElements.hasOwnProperty('polyfillWrapFlushCallback')) { + return; + } + var BuiltInHTMLElement = HTMLElement; + window.HTMLElement = function HTMLElement() { + return Reflect.construct(BuiltInHTMLElement, [], this.constructor); + }; + HTMLElement.prototype = BuiltInHTMLElement.prototype; + HTMLElement.prototype.constructor = HTMLElement; + Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement); + })(); + + function cssToDom(css) { + var node = document.createElement('style'); + node.textContent = css; + return node; + } + + function camelCase(str) { + return str.replace(/-(\w)/g, function ($, $1) { + return $1.toUpperCase(); + }); + } + + function Fragment(props) { + return props.children; + } + + function extend(obj, props) { + for (var i in props) { + obj[i] = props[i]; + }return obj; + } + + /** Invoke or update a ref, depending on whether it is a function or object ref. + * @param {object|function} [ref=null] + * @param {any} [value] + */ + function applyRef(ref, value) { + if (ref != null) { + if (typeof ref == 'function') ref(value);else ref.current = value; + } + } + + /** + * Call a function asynchronously, as soon as possible. Makes + * use of HTML Promise to schedule the callback if available, + * otherwise falling back to `setTimeout` (mainly for IE<11). + * @type {(callback: function) => void} + */ + var defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout; + + function isArray(obj) { + return Object.prototype.toString.call(obj) === '[object Array]'; + } + + function getUse(data, paths, out, name) { + var obj = []; + paths.forEach(function (path, index) { + var isPath = typeof path === 'string'; + if (isPath) { + obj[index] = getTargetByPath(data, path); + } else { + var key = Object.keys(path)[0]; + var value = path[key]; + if (typeof value === 'string') { + obj[index] = getTargetByPath(data, value); + } else { + var tempPath = value[0]; + if (typeof tempPath === 'string') { + var tempVal = getTargetByPath(data, tempPath); + obj[index] = value[1] ? value[1](tempVal) : tempVal; + } else { + var args = []; + tempPath.forEach(function (path) { + args.push(getTargetByPath(data, path)); + }); + obj[index] = value[1].apply(null, args); + } + } + obj[key] = obj[index]; + } + }); + if (out) out[name] = obj; + return obj; + } + + function pathToArr(path) { + if (typeof path !== 'string' || !path) return []; + // return path.split(/\.|\[|\]/).filter(name => !!name) + return path.replace(/]/g, '').replace(/\[/g, '.').split('.'); + } + + function getTargetByPath(origin, path) { + var arr = pathToArr(path); + var current = origin; + for (var i = 0, len = arr.length; i < len; i++) { + current = current[arr[i]]; + } + return current; + } + + var hyphenateRE = /\B([A-Z])/g; + function hyphenate(str) { + return str.replace(hyphenateRE, '-$1').toLowerCase(); + } + + function getValByPath(path, current) { + var arr = pathToArr(path); + arr.forEach(function (prop) { + current = current[prop]; + }); + return current; + } + + function getPath(obj, out, name) { + var result = {}; + obj.forEach(function (item) { + if (typeof item === 'string') { + result[item] = true; + } else { + var tempPath = item[Object.keys(item)[0]]; + if (typeof tempPath === 'string') { + result[tempPath] = true; + } else { + if (typeof tempPath[0] === 'string') { + result[tempPath[0]] = true; + } else { + tempPath[0].forEach(function (path) { + return result[path] = true; + }); + } + } + } + }); + if (out) out[name] = result; + return result; + } + + function removeItem(item, arr) { + if (!arr) return; + for (var i = 0, len = arr.length; i < len; i++) { + if (arr[i] === item) { + arr.splice(i, 1); + break; + } + } + } + + var stack = []; + + function h(nodeName, attributes) { + var children = [], + lastSimple, + child, + simple, + i; + for (i = arguments.length; i-- > 2;) { + stack.push(arguments[i]); + } + if (attributes && attributes.children != null) { + if (!stack.length) stack.push(attributes.children); + delete attributes.children; + } + while (stack.length) { + if ((child = stack.pop()) && child.pop !== undefined) { + for (i = child.length; i--;) { + stack.push(child[i]); + } + } else { + if (typeof child === 'boolean') child = null; + + if (simple = typeof nodeName !== 'function') { + if (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false; + } + + if (simple && lastSimple) { + children[children.length - 1] += child; + } else if (children.length === 0) { + children = [child]; + } else { + children.push(child); + } + + lastSimple = simple; + } + } + + if (nodeName === Fragment) { + return children; + } + + var p = { + nodeName: nodeName, + children: children, + attributes: attributes == null ? undefined : attributes, + key: attributes == null ? undefined : attributes.key + + // if a "vnode hook" is defined, pass every created VNode to it + };if (options.vnode !== undefined) options.vnode(p); + + return p; + } + + // DOM properties that should NOT have "px" added when numeric + var IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i; + + /** + * Check if two nodes are equivalent. + * + * @param {Node} node DOM Node to compare + * @param {VNode} vnode Virtual DOM node to compare + * @param {boolean} [hydrating=false] If true, ignores component constructors when comparing. + * @private + */ + function isSameNodeType(node, vnode, hydrating) { + if (typeof vnode === 'string' || typeof vnode === 'number') { + return node.splitText !== undefined; + } + if (typeof vnode.nodeName === 'string') { + return !node._componentConstructor && isNamedNode(node, vnode.nodeName); + } else if (typeof vnode.nodeName === 'function') { + return options.mapping[node.nodeName.toLowerCase()] === vnode.nodeName; + } + return hydrating || node._componentConstructor === vnode.nodeName; + } + + /** + * Check if an Element has a given nodeName, case-insensitively. + * + * @param {Element} node A DOM Element to inspect the name of. + * @param {String} nodeName Unnormalized name to compare against. + */ + function isNamedNode(node, nodeName) { + return node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase(); + } + + var extension = {}; + + function extend$1(name, handler) { + extension['o-' + name] = handler; + } + + function set(origin, path, value) { + var arr = pathToArr(path); + var current = origin; + for (var i = 0, len = arr.length; i < len; i++) { + if (i === len - 1) { + current[arr[i]] = value; + } else { + current = current[arr[i]]; + } + } + } + + function get(origin, path) { + var arr = pathToArr(path); + var current = origin; + for (var i = 0, len = arr.length; i < len; i++) { + current = current[arr[i]]; + } + + return current; + } + + function eventProxy(e) { + return this._listeners[e.type](e); + } + + function bind(el, type, handler) { + el._listeners = el._listeners || {}; + el._listeners[type] = handler; + el.addEventListener(type, eventProxy); + } + + function unbind(el, type) { + el.removeEventListener(type, eventProxy); + } + + /** + * Create an element with the given nodeName. + * @param {string} nodeName The DOM node to create + * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG + * namespace. + * @returns {Element} The created DOM node + */ + function createNode(nodeName, isSvg) { + /** @type {Element} */ + var node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName); + node.normalizedNodeName = nodeName; + return node; + } + + /** + * Remove a child node from its parent if attached. + * @param {Node} node The node to remove + */ + function removeNode(node) { + var parentNode = node.parentNode; + if (parentNode) parentNode.removeChild(node); + } + + /** + * Set a named attribute on the given Node, with special behavior for some names + * and event handlers. If `value` is `null`, the attribute/handler will be + * removed. + * @param {Element} node An element to mutate + * @param {string} name The name/key to set, such as an event or attribute name + * @param {*} old The last value that was set for this name/node pair + * @param {*} value An attribute value, such as a function to be used as an + * event handler + * @param {boolean} isSvg Are we currently diffing inside an svg? + * @private + */ + function setAccessor(node, name, old, value, isSvg, component) { + if (name === 'className') name = 'class'; + + if (name[0] == 'o' && name[1] == '-') { + if (extension[name]) { + extension[name](node, value, component); + } + } else if (name === 'key') { + // ignore + } else if (name === 'ref') { + applyRef(old, null); + applyRef(value, node); + } else if (name === 'class' && !isSvg) { + node.className = value || ''; + } else if (name === 'style') { + if (!value || typeof value === 'string' || typeof old === 'string') { + node.style.cssText = value || ''; + } + if (value && typeof value === 'object') { + if (typeof old !== 'string') { + for (var i in old) { + if (!(i in value)) node.style[i] = ''; + } + } + for (var i in value) { + node.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i]; + } + } + } else if (name === 'dangerouslySetInnerHTML') { + if (value) node.innerHTML = value.__html || ''; + } else if (name[0] == 'o' && name[1] == 'n') { + var useCapture = name !== (name = name.replace(/Capture$/, '')); + var nameLower = name.toLowerCase(); + name = (nameLower in node ? nameLower : name).slice(2); + if (value) { + if (!old) { + node.addEventListener(name, eventProxy$1, useCapture); + if (name == 'tap') { + node.addEventListener('touchstart', touchStart, useCapture); + node.addEventListener('touchend', touchEnd, useCapture); + } + } + } else { + node.removeEventListener(name, eventProxy$1, useCapture); + if (name == 'tap') { + node.removeEventListener('touchstart', touchStart, useCapture); + node.removeEventListener('touchend', touchEnd, useCapture); + } + } + (node._listeners || (node._listeners = {}))[name] = value; + } else if (node.nodeName === 'INPUT' && name === 'value') { + node[name] = value == null ? '' : value; + } else if (name !== 'list' && name !== 'type' && name !== 'css' && !isSvg && name in node && value !== '') { + //value !== '' fix for selected, disabled, checked with pure element + // Attempt to set a DOM property to the given value. + // IE & FF throw for certain property-value combinations. + try { + node[name] = value == null ? '' : value; + } catch (e) {} + if ((value == null || value === false) && name != 'spellcheck') node.pureRemoveAttribute ? node.pureRemoveAttribute(name) : node.removeAttribute(name); + } else { + var ns = isSvg && name !== (name = name.replace(/^xlink:?/, '')); + // spellcheck is treated differently than all other boolean values and + // should not be removed when the value is `false`. See: + // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck + if (value == null || value === false) { + if (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.pureRemoveAttribute ? node.pureRemoveAttribute(name) : node.removeAttribute(name); + } else if (typeof value !== 'function') { + if (ns) { + node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value); + } else { + node.pureSetAttribute ? node.pureSetAttribute(name, value) : node.setAttribute(name, value); + } + } + } + } + + /** + * Proxy an event to hooked event handlers + * @param {Event} e The event object from the browser + * @private + */ + function eventProxy$1(e) { + return this._listeners[e.type](options.event && options.event(e) || e); + } + + function touchStart(e) { + this.___touchX = e.touches[0].pageX; + this.___touchY = e.touches[0].pageY; + this.___scrollTop = document.body.scrollTop; + } + + function touchEnd(e) { + if (Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 && Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 && Math.abs(document.body.scrollTop - this.___scrollTop) < 30) { + this.dispatchEvent(new CustomEvent('tap', { detail: e })); + } + } + + /** Diff recursion count, used to track the end of the diff cycle. */ + var diffLevel = 0; + + /** Global flag indicating if the diff is currently within an SVG */ + var isSvgMode = false; + + /** Global flag indicating if the diff is performing hydration */ + var hydrating = false; + + /** Apply differences in a given vnode (and it's deep children) to a real DOM Node. + * @param {Element} [dom=null] A DOM node to mutate into the shape of the `vnode` + * @param {VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure + * @returns {Element} dom The created/mutated element + * @private + */ + function diff(dom, vnode, parent, component, updateSelf) { + //first render return undefined + if (!dom && !vnode) return; + // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff) + var ret; + if (!diffLevel++) { + // when first starting the diff, check if we're diffing an SVG or within an SVG + isSvgMode = parent != null && parent.ownerSVGElement !== undefined; + + // hydration is indicated by the existing element to be diffed not having a prop cache + hydrating = dom != null && !('prevProps' in dom); + } + if (vnode && vnode.nodeName === Fragment) { + vnode = vnode.children; + } + if (isArray(vnode)) { + if (parent) { + var styles = parent.querySelectorAll('style'); + styles.forEach(function (s) { + parent.removeChild(s); + }); + innerDiffNode(parent, vnode, hydrating, component, updateSelf); + + for (var i = styles.length - 1; i >= 0; i--) { + parent.firstChild ? parent.insertBefore(styles[i], parent.firstChild) : parent.appendChild(style[i]); + } + } else { + ret = []; + vnode.forEach(function (item, index) { + var ele = idiff(index === 0 ? dom : null, item, component, updateSelf); + ret.push(ele); + }); + } + } else { + if (isArray(dom)) { + dom.forEach(function (one, index) { + if (index === 0) { + ret = idiff(one, vnode, component, updateSelf); + } else { + recollectNodeTree(one, false); + } + }); + } else { + ret = idiff(dom, vnode, component, updateSelf); + } + // append the element if its a new parent + if (parent && ret.parentNode !== parent) parent.appendChild(ret); + } + + // diffLevel being reduced to 0 means we're exiting the diff + if (! --diffLevel) { + hydrating = false; + // invoke queued componentDidMount lifecycle methods + } + + return ret; + } + + /** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */ + function idiff(dom, vnode, component, updateSelf) { + if (dom && vnode && dom.props) { + dom.props.children = vnode.children; + } + var out = dom, + prevSvgMode = isSvgMode; + + // empty values (null, undefined, booleans) render as empty Text nodes + if (vnode == null || typeof vnode === 'boolean') vnode = ''; + + // Fast case: Strings & Numbers create/update Text nodes. + if (typeof vnode === 'string' || typeof vnode === 'number') { + // update if it's already a Text node: + if (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || component)) { + /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */ + if (dom.nodeValue != vnode) { + dom.nodeValue = vnode; + } + } else { + // it wasn't a Text node: replace it with one and recycle the old Element + out = document.createTextNode(vnode); + if (dom) { + if (dom.parentNode) dom.parentNode.replaceChild(out, dom); + recollectNodeTree(dom, true); + } + } + + out['prevProps'] = true; + + return out; + } + + // If the VNode represents a Component, perform a component diff: + var vnodeName = vnode.nodeName; + if (typeof vnodeName === 'function') { + for (var key in options.mapping) { + if (options.mapping[key] === vnodeName) { + vnodeName = key; + vnode.nodeName = key; + break; + } + } + } + // Tracks entering and exiting SVG namespace when descending through the tree. + isSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode; + + // If there's no existing element or it's the wrong type, create a new one: + vnodeName = String(vnodeName); + if (!dom || !isNamedNode(dom, vnodeName)) { + out = createNode(vnodeName, isSvgMode); + + if (dom) { + // move children into the replacement node + while (dom.firstChild) { + out.appendChild(dom.firstChild); + } // if the previous Element was mounted into the DOM, replace it inline + if (dom.parentNode) dom.parentNode.replaceChild(out, dom); + + // recycle the old element (skips non-Element node types) + recollectNodeTree(dom, true); + } + } + + var fc = out.firstChild, + props = out['prevProps'], + vchildren = vnode.children; + + if (props == null) { + props = out['prevProps'] = {}; + for (var a = out.attributes, i = a.length; i--;) { + props[a[i].name] = a[i].value; + } + } + + // Optimization: fast-path for elements containing a single TextNode: + if (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) { + if (fc.nodeValue != vchildren[0]) { + fc.nodeValue = vchildren[0]; + } + } + // otherwise, if there are existing or new children, diff them: + else if (vchildren && vchildren.length || fc != null) { + if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) { + innerDiffNode(out, vchildren, hydrating || props.dangerouslySetInnerHTML != null, component, updateSelf); + } + } + + // Apply attributes/props from VNode to the DOM Element: + diffAttributes(out, vnode.attributes, props, component, updateSelf); + if (out.props) { + out.props.children = vnode.children; + } + // restore previous SVG mode: (in case we're exiting an SVG namespace) + isSvgMode = prevSvgMode; + + return out; + } + + /** Apply child and attribute changes between a VNode and a DOM Node to the DOM. + * @param {Element} dom Element whose children should be compared & mutated + * @param {Array} vchildren Array of VNodes to compare to `dom.childNodes` + * @param {Boolean} isHydrating If `true`, consumes externally created elements similar to hydration + */ + function innerDiffNode(dom, vchildren, isHydrating, component, updateSelf) { + var originalChildren = dom.childNodes, + children = [], + keyed = {}, + keyedLen = 0, + min = 0, + len = originalChildren.length, + childrenLen = 0, + vlen = vchildren ? vchildren.length : 0, + j, + c, + f, + vchild, + child; + + // Build up a map of keyed children and an Array of unkeyed children: + if (len !== 0) { + for (var i = 0; i < len; i++) { + var _child = originalChildren[i], + props = _child['prevProps'], + key = vlen && props ? _child._component ? _child._component.__key : props.key : null; + if (key != null) { + keyedLen++; + keyed[key] = _child; + } else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) { + children[childrenLen++] = _child; + } + } + } + + if (vlen !== 0) { + for (var i = 0; i < vlen; i++) { + vchild = vchildren[i]; + child = null; + + // attempt to find a node based on key matching + var key = vchild.key; + if (key != null) { + if (keyedLen && keyed[key] !== undefined) { + child = keyed[key]; + keyed[key] = undefined; + keyedLen--; + } + } + // attempt to pluck a node of the same type from the existing children + else if (!child && min < childrenLen) { + for (j = min; j < childrenLen; j++) { + if (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) { + child = c; + children[j] = undefined; + if (j === childrenLen - 1) childrenLen--; + if (j === min) min++; + break; + } + } + } + + // morph the matched/found/created DOM child to match vchild (deep) + child = idiff(child, vchild, component, updateSelf); + + f = originalChildren[i]; + if (child && child !== dom && child !== f) { + if (f == null) { + dom.appendChild(child); + } else if (child === f.nextSibling) { + removeNode(f); + } else { + dom.insertBefore(child, f); + } + } + } + } + + // remove unused keyed children: + if (keyedLen) { + for (var i in keyed) { + if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false); + } + } + + // remove orphaned unkeyed children: + while (min <= childrenLen) { + if ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false); + } + } + + /** Recursively recycle (or just unmount) a node and its descendants. + * @param {Node} node DOM node to start unmount/removal from + * @param {Boolean} [unmountOnly=false] If `true`, only triggers unmount lifecycle, skips removal + */ + function recollectNodeTree(node, unmountOnly) { + // If the node's VNode had a ref function, invoke it with null here. + // (this is part of the React spec, and smart for unsetting references) + if (node['prevProps'] != null && node['prevProps'].ref) { + if (typeof node['prevProps'].ref === 'function') { + node['prevProps'].ref(null); + } else if (node['prevProps'].ref.current) { + node['prevProps'].ref.current = null; + } + } + + if (unmountOnly === false || node['prevProps'] == null) { + removeNode(node); + } + + removeChildren(node); + } + + /** Recollect/unmount all children. + * - we use .lastChild here because it causes less reflow than .firstChild + * - it's also cheaper than accessing the .childNodes Live NodeList + */ + function removeChildren(node) { + node = node.lastChild; + while (node) { + var next = node.previousSibling; + recollectNodeTree(node, true); + node = next; + } + } + + /** Apply differences in attributes from a VNode to the given DOM Element. + * @param {Element} dom Element with attributes to diff `attrs` against + * @param {Object} attrs The desired end-state key-value attribute pairs + * @param {Object} old Current/previous attributes (from previous VNode or element's prop cache) + */ + function diffAttributes(dom, attrs, old, component, updateSelf) { + var name; + //let update = false + var isWeElement = dom.update; + var oldClone; + if (dom.receiveProps) { + oldClone = Object.assign({}, old); + } + // remove attributes no longer present on the vnode by setting them to undefined + for (name in old) { + if (!(attrs && attrs[name] != null) && old[name] != null) { + setAccessor(dom, name, old[name], old[name] = undefined, isSvgMode, component); + if (isWeElement) { + delete dom.props[name]; + //update = true + } + } + } + + // add new & update changed attributes + for (name in attrs) { + if (isWeElement && typeof attrs[name] === 'object' && name !== 'ref') { + if (name === 'style') { + setAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode, component); + } + var ccName = camelCase(name); + dom.props[ccName] = old[ccName] = attrs[name]; + //update = true + } else if (name !== 'children' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) { + setAccessor(dom, name, old[name], attrs[name], isSvgMode, component); + if (isWeElement) { + var _ccName = camelCase(name); + dom.props[_ccName] = old[_ccName] = attrs[name]; + //update = true + } else { + old[name] = attrs[name]; + } + } + } + + if (isWeElement && !updateSelf && dom.parentNode) { + //__hasChildren is not accuracy when it was empty at first, so add dom.children.length > 0 condition + //if (update || dom.__hasChildren || dom.children.length > 0 || (dom.store && !dom.store.data)) { + if (dom.receiveProps(dom.props, oldClone) !== false) { + dom.update(); + } + //} + } + } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var id = 0; + + var WeElement = function (_HTMLElement) { + _inherits(WeElement, _HTMLElement); + + function WeElement() { + _classCallCheck(this, WeElement); + + var _this = _possibleConstructorReturn(this, _HTMLElement.call(this)); + + _this.props = Object.assign({}, _this.constructor.defaultProps); + _this.elementId = id++; + _this.computed = {}; + return _this; + } + + WeElement.prototype.connectedCallback = function connectedCallback() { + var p = this.parentNode; + while (p && !this.store) { + this.store = p.store; + p = p.parentNode || p.host; + } + + this.attrsToProps(); + + if (this.props.use) { + this.use = this.props.use; + } + + if (this.props.useSelf) { + this.use = this.props.useSelf; + } + + if (this.use) { + var use = typeof this.use === 'function' ? this.use() : this.use; + + if (options.isMultiStore) { + var _updatePath = {}; + var using = {}; + for (var storeName in use) { + _updatePath[storeName] = {}; + using[storeName] = {}; + getPath(use[storeName], _updatePath, storeName); + getUse(this.store[storeName].data, use[storeName], using, storeName); + this.store[storeName].instances.push(this); + } + this.using = using; + this._updatePath = _updatePath; + } else { + this._updatePath = getPath(use); + this.using = getUse(this.store.data, use); + this.store.instances.push(this); + } + } + if (this.useSelf) { + var _use = typeof this.useSelf === 'function' ? this.useSelf() : this.useSelf; + if (options.isMultiStore) { + var _updatePath2 = {}; + var _using = {}; + for (var _storeName in _use) { + getPath(_use[_storeName], _updatePath2, _storeName); + getUse(this.store[_storeName].data, _use[_storeName], _using, _storeName); + this.store[_storeName].updateSelfInstances.push(this); + } + this.usingSelf = _using; + this._updateSelfPath = _updatePath2; + } else { + this._updateSelfPath = getPath(_use); + this.usingSelf = getUse(this.store.data, _use); + this.store.updateSelfInstances.push(this); + } + } + + if (this.compute) { + for (var key in this.compute) { + this.computed[key] = this.compute[key].call(options.isMultiStore ? this.store : this.store.data); + } + } + + this.beforeInstall(); + this.install(); + this.afterInstall(); + + var shadowRoot; + if (this.constructor.isLightDom) { + shadowRoot = this; + } else { + + if (!this.shadowRoot) { + shadowRoot = this.attachShadow({ + mode: 'open' + }); + } else { + shadowRoot = this.shadowRoot; + var fc; + while (fc = shadowRoot.firstChild) { + shadowRoot.removeChild(fc); + } + } + + if (this.constructor.css) { + shadowRoot.appendChild(cssToDom(this.constructor.css)); + } else if (this.css) { + shadowRoot.appendChild(cssToDom(typeof this.css === 'function' ? this.css() : this.css)); + } + } + + this.beforeRender(); + options.afterInstall && options.afterInstall(this); + + var rendered = this.render(this.props, this.store); + this.__hasChildren = Object.prototype.toString.call(rendered) === '[object Array]' && rendered.length > 0; + + this.rootNode = diff(null, rendered, null, this); + this.rendered(); + + if (this.props.css) { + this._customStyleElement = cssToDom(this.props.css); + this._customStyleContent = this.props.css; + shadowRoot.appendChild(this._customStyleElement); + } + + if (isArray(this.rootNode)) { + this.rootNode.forEach(function (item) { + shadowRoot.appendChild(item); + }); + } else { + this.rootNode && shadowRoot.appendChild(this.rootNode); + } + this.installed(); + this._isInstalled = true; + }; + + WeElement.prototype.disconnectedCallback = function disconnectedCallback() { + this.uninstall(); + this._isInstalled = false; + if (this.store) { + if (options.isMultiStore) { + for (var key in this.store) { + var current = this.store[key]; + removeItem(this, current.instances); + removeItem(this, current.updateSelfInstances); + } + } else { + removeItem(this, this.store.instances); + removeItem(this, this.store.updateSelfInstances); + } + } + }; + + WeElement.prototype.update = function update(ignoreAttrs, updateSelf) { + this._willUpdate = true; + this.beforeUpdate(); + this.beforeRender(); + //fix null !== undefined + if (this._customStyleContent != this.props.css) { + this._customStyleContent = this.props.css; + this._customStyleElement.textContent = this._customStyleContent; + } + this.attrsToProps(ignoreAttrs); + + var rendered = this.render(this.props, this.store); + this.rendered(); + this.__hasChildren = this.__hasChildren || Object.prototype.toString.call(rendered) === '[object Array]' && rendered.length > 0; + + this.rootNode = diff(this.rootNode, rendered, this.shadowRoot, this, updateSelf); + this._willUpdate = false; + this.updated(); + }; + + WeElement.prototype.forceUpdate = function forceUpdate() { + this.update(true); + }; + + WeElement.prototype.updateProps = function updateProps(obj) { + var _this2 = this; + + Object.keys(obj).forEach(function (key) { + _this2.props[key] = obj[key]; + if (_this2.prevProps) { + _this2.prevProps[key] = obj[key]; + } + }); + this.forceUpdate(); + }; + + WeElement.prototype.updateSelf = function updateSelf(ignoreAttrs) { + this.update(ignoreAttrs, true); + }; + + WeElement.prototype.removeAttribute = function removeAttribute(key) { + _HTMLElement.prototype.removeAttribute.call(this, key); + //Avoid executing removeAttribute methods before connectedCallback + this._isInstalled && this.update(); + }; + + WeElement.prototype.setAttribute = function setAttribute(key, val) { + if (val && typeof val === 'object') { + _HTMLElement.prototype.setAttribute.call(this, key, JSON.stringify(val)); + } else { + _HTMLElement.prototype.setAttribute.call(this, key, val); + } + //Avoid executing setAttribute methods before connectedCallback + this._isInstalled && this.update(); + }; + + WeElement.prototype.pureRemoveAttribute = function pureRemoveAttribute(key) { + _HTMLElement.prototype.removeAttribute.call(this, key); + }; + + WeElement.prototype.pureSetAttribute = function pureSetAttribute(key, val) { + _HTMLElement.prototype.setAttribute.call(this, key, val); + }; + + WeElement.prototype.attrsToProps = function attrsToProps(ignoreAttrs) { + if (options.ignoreAttrs || ignoreAttrs) return; + var ele = this; + ele.props['css'] = ele.getAttribute('css'); + var attrs = this.constructor.propTypes; + if (!attrs) return; + Object.keys(attrs).forEach(function (key) { + var type = attrs[key]; + var val = ele.getAttribute(hyphenate(key)); + if (val !== null) { + switch (type) { + case String: + ele.props[key] = val; + break; + case Number: + ele.props[key] = Number(val); + break; + case Boolean: + if (val === 'false' || val === '0') { + ele.props[key] = false; + } else { + ele.props[key] = true; + } + break; + case Array: + case Object: + if (val[0] === ':') { + ele.props[key] = getValByPath(val.substr(1), Omi.$); + } else { + ele.props[key] = JSON.parse(val.replace(/(['"])?([a-zA-Z0-9_-]+)(['"])?:([^\/])/g, '"$2":$4').replace(/'([\s\S]*?)'/g, '"$1"').replace(/,(\s*})/g, '$1')); + } + break; + } + } else { + if (ele.constructor.defaultProps && ele.constructor.defaultProps.hasOwnProperty(key)) { + ele.props[key] = ele.constructor.defaultProps[key]; + } else { + ele.props[key] = null; + } + } + }); + }; + + WeElement.prototype.fire = function fire(name, data) { + this.dispatchEvent(new CustomEvent(name, { + detail: data + })); + }; + + WeElement.prototype.beforeInstall = function beforeInstall() {}; + + WeElement.prototype.install = function install() {}; + + WeElement.prototype.afterInstall = function afterInstall() {}; + + WeElement.prototype.installed = function installed() {}; + + WeElement.prototype.uninstall = function uninstall() {}; + + WeElement.prototype.beforeUpdate = function beforeUpdate() {}; + + WeElement.prototype.updated = function updated() {}; + + WeElement.prototype.beforeRender = function beforeRender() {}; + + WeElement.prototype.rendered = function rendered() {}; + + WeElement.prototype.receiveProps = function receiveProps() {}; + + return WeElement; + }(HTMLElement); + + WeElement.is = 'WeElement'; + + /*! + * https://github.com/Palindrom/JSONPatcherProxy + * (c) 2017 Starcounter + * MIT license + */ + + /** Class representing a JS Object observer */ + var JSONPatcherProxy = function () { + /** + * Deep clones your object and returns a new object. + */ + function deepClone(obj) { + switch (typeof obj) { + case 'object': + return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5 + case 'undefined': + return null; //this is how JSON.stringify behaves for array items + default: + return obj; //no need to clone primitives + } + } + JSONPatcherProxy.deepClone = deepClone; + + function escapePathComponent(str) { + if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str; + return str.replace(/~/g, '~0').replace(/\//g, '~1'); + } + JSONPatcherProxy.escapePathComponent = escapePathComponent; + + /** + * Walk up the parenthood tree to get the path + * @param {JSONPatcherProxy} instance + * @param {Object} obj the object you need to find its path + */ + function findObjectPath(instance, obj) { + var pathComponents = []; + var parentAndPath = instance.parenthoodMap.get(obj); + while (parentAndPath && parentAndPath.path) { + // because we're walking up-tree, we need to use the array as a stack + pathComponents.unshift(parentAndPath.path); + parentAndPath = instance.parenthoodMap.get(parentAndPath.parent); + } + if (pathComponents.length) { + var path = pathComponents.join('/'); + return '/' + path; + } + return ''; + } + /** + * A callback to be used as th proxy set trap callback. + * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred. + * @param {JSONPatcherProxy} instance JSONPatcherProxy instance + * @param {Object} target the affected object + * @param {String} key the effect property's name + * @param {Any} newValue the value being set + */ + function setTrap(instance, target, key, newValue) { + var parentPath = findObjectPath(instance, target); + + var destinationPropKey = parentPath + '/' + escapePathComponent(key); + + if (instance.proxifiedObjectsMap.has(newValue)) { + var newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue); + + instance.parenthoodMap.set(newValueOriginalObject.originalObject, { + parent: target, + path: key + }); + } + /* + mark already proxified values as inherited. + rationale: proxy.arr.shift() + will emit + {op: replace, path: '/arr/1', value: arr_2} + {op: remove, path: '/arr/2'} + by default, the second operation would revoke the proxy, and this renders arr revoked. + That's why we need to remember the proxies that are inherited. + */ + var revokableInstance = instance.proxifiedObjectsMap.get(newValue); + /* + Why do we need to check instance.isProxifyingTreeNow? + We need to make sure we mark revokables as inherited ONLY when we're observing, + because throughout the first proxification, a sub-object is proxified and then assigned to + its parent object. This assignment of a pre-proxified object can fool us into thinking + that it's a proxified object moved around, while in fact it's the first assignment ever. + Checking isProxifyingTreeNow ensures this is not happening in the first proxification, + but in fact is is a proxified object moved around the tree + */ + if (revokableInstance && !instance.isProxifyingTreeNow) { + revokableInstance.inherited = true; + } + + // if the new value is an object, make sure to watch it + if (newValue && typeof newValue == 'object' && !instance.proxifiedObjectsMap.has(newValue)) { + instance.parenthoodMap.set(newValue, { + parent: target, + path: key + }); + newValue = instance._proxifyObjectTreeRecursively(target, newValue, key); + } + // let's start with this operation, and may or may not update it later + var operation = { + op: 'remove', + path: destinationPropKey + }; + if (typeof newValue == 'undefined') { + // applying De Morgan's laws would be a tad faster, but less readable + if (!Array.isArray(target) && !target.hasOwnProperty(key)) { + // `undefined` is being set to an already undefined value, keep silent + return Reflect.set(target, key, newValue); + } + // when array element is set to `undefined`, should generate replace to `null` + if (Array.isArray(target)) { + operation.op = 'replace', operation.value = null; + } + var oldValue = instance.proxifiedObjectsMap.get(target[key]); + // was the deleted a proxified object? + if (oldValue) { + instance.parenthoodMap.delete(target[key]); + instance.disableTrapsForProxy(oldValue); + instance.proxifiedObjectsMap.delete(oldValue); + } + } else { + if (Array.isArray(target) && !Number.isInteger(+key.toString())) { + /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */ + if (key != 'length') { + console.warn('JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'); + } + return Reflect.set(target, key, newValue); + } + operation.op = 'add'; + if (target.hasOwnProperty(key)) { + if (typeof target[key] !== 'undefined' || Array.isArray(target)) { + operation.op = 'replace'; // setting `undefined` array elements is a `replace` op + } + } + operation.value = newValue; + } + operation.oldValue = target[key]; + var reflectionResult = Reflect.set(target, key, newValue); + instance.defaultCallback(operation); + return reflectionResult; + } + /** + * A callback to be used as th proxy delete trap callback. + * It updates parenthood map if needed, calls default callbacks with the changes occurred. + * @param {JSONPatcherProxy} instance JSONPatcherProxy instance + * @param {Object} target the effected object + * @param {String} key the effected property's name + */ + function deleteTrap(instance, target, key) { + if (typeof target[key] !== 'undefined') { + var parentPath = findObjectPath(instance, target); + var destinationPropKey = parentPath + '/' + escapePathComponent(key); + + var revokableProxyInstance = instance.proxifiedObjectsMap.get(target[key]); + + if (revokableProxyInstance) { + if (revokableProxyInstance.inherited) { + /* + this is an inherited proxy (an already proxified object that was moved around), + we shouldn't revoke it, because even though it was removed from path1, it is still used in path2. + And we know that because we mark moved proxies with `inherited` flag when we move them + it is a good idea to remove this flag if we come across it here, in deleteProperty trap. + We DO want to revoke the proxy if it was removed again. + */ + revokableProxyInstance.inherited = false; + } else { + instance.parenthoodMap.delete(revokableProxyInstance.originalObject); + instance.disableTrapsForProxy(revokableProxyInstance); + instance.proxifiedObjectsMap.delete(target[key]); + } + } + var reflectionResult = Reflect.deleteProperty(target, key); + + instance.defaultCallback({ + op: 'remove', + path: destinationPropKey + }); + + return reflectionResult; + } + } + /* pre-define resume and pause functions to enhance constructors performance */ + function resume() { + var _this = this; + + this.defaultCallback = function (operation) { + _this.isRecording && _this.patches.push(operation); + _this.userCallback && _this.userCallback(operation); + }; + this.isObserving = true; + } + function pause() { + this.defaultCallback = function () {}; + this.isObserving = false; + } + /** + * Creates an instance of JSONPatcherProxy around your object of interest `root`. + * @param {Object|Array} root - the object you want to wrap + * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects} + * @returns {JSONPatcherProxy} + * @constructor + */ + function JSONPatcherProxy(root, showDetachedWarning) { + this.isProxifyingTreeNow = false; + this.isObserving = false; + this.proxifiedObjectsMap = new Map(); + this.parenthoodMap = new Map(); + // default to true + if (typeof showDetachedWarning !== 'boolean') { + showDetachedWarning = true; + } + + this.showDetachedWarning = showDetachedWarning; + this.originalObject = root; + this.cachedProxy = null; + this.isRecording = false; + this.userCallback; + /** + * @memberof JSONPatcherProxy + * Restores callback back to the original one provided to `observe`. + */ + this.resume = resume.bind(this); + /** + * @memberof JSONPatcherProxy + * Replaces your callback with a noop function. + */ + this.pause = pause.bind(this); + } + + JSONPatcherProxy.prototype.generateProxyAtPath = function (parent, obj, path) { + var _this2 = this; + + if (!obj) { + return obj; + } + var traps = { + set: function set(target, key, value, receiver) { + return setTrap(_this2, target, key, value, receiver); + }, + deleteProperty: function deleteProperty(target, key) { + return deleteTrap(_this2, target, key); + } + }; + var revocableInstance = Proxy.revocable(obj, traps); + // cache traps object to disable them later. + revocableInstance.trapsInstance = traps; + revocableInstance.originalObject = obj; + + /* keeping track of object's parent and path */ + + this.parenthoodMap.set(obj, { parent: parent, path: path }); + + /* keeping track of all the proxies to be able to revoke them later */ + this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance); + return revocableInstance.proxy; + }; + // grab tree's leaves one by one, encapsulate them into a proxy and return + JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function (parent, root, path) { + for (var key in root) { + if (root.hasOwnProperty(key)) { + if (root[key] instanceof Object) { + root[key] = this._proxifyObjectTreeRecursively(root, root[key], escapePathComponent(key)); + } + } + } + return this.generateProxyAtPath(parent, root, path); + }; + // this function is for aesthetic purposes + JSONPatcherProxy.prototype.proxifyObjectTree = function (root) { + /* + while proxyifying object tree, + the proxyifying operation itself is being + recorded, which in an unwanted behavior, + that's why we disable recording through this + initial process; + */ + this.pause(); + this.isProxifyingTreeNow = true; + var proxifiedObject = this._proxifyObjectTreeRecursively(undefined, root, ''); + /* OK you can record now */ + this.isProxifyingTreeNow = false; + this.resume(); + return proxifiedObject; + }; + /** + * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object + * @param {Proxy} proxy - The target proxy object + */ + JSONPatcherProxy.prototype.disableTrapsForProxy = function (revokableProxyInstance) { + if (this.showDetachedWarning) { + var message = "You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects"; + + revokableProxyInstance.trapsInstance.set = function (targetObject, propKey, newValue) { + console.warn(message); + return Reflect.set(targetObject, propKey, newValue); + }; + revokableProxyInstance.trapsInstance.set = function (targetObject, propKey, newValue) { + console.warn(message); + return Reflect.set(targetObject, propKey, newValue); + }; + revokableProxyInstance.trapsInstance.deleteProperty = function (targetObject, propKey) { + return Reflect.deleteProperty(targetObject, propKey); + }; + } else { + delete revokableProxyInstance.trapsInstance.set; + delete revokableProxyInstance.trapsInstance.get; + delete revokableProxyInstance.trapsInstance.deleteProperty; + } + }; + /** + * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them. + * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array. + * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter. + */ + JSONPatcherProxy.prototype.observe = function (record, callback) { + if (!record && !callback) { + throw new Error('You need to either record changes or pass a callback'); + } + this.isRecording = record; + this.userCallback = callback; + /* + I moved it here to remove it from `unobserve`, + this will also make the constructor faster, why initiate + the array before they decide to actually observe with recording? + They might need to use only a callback. + */ + if (record) this.patches = []; + this.cachedProxy = this.proxifyObjectTree(this.originalObject); + return this.cachedProxy; + }; + /** + * If the observed is set to record, it will synchronously return all the patches and empties patches array. + */ + JSONPatcherProxy.prototype.generate = function () { + if (!this.isRecording) { + throw new Error('You should set record to true to get patches later'); + } + return this.patches.splice(0, this.patches.length); + }; + /** + * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable} + */ + JSONPatcherProxy.prototype.revoke = function () { + this.proxifiedObjectsMap.forEach(function (el) { + el.revoke(); + }); + }; + /** + * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently. + */ + JSONPatcherProxy.prototype.disableTraps = function () { + this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this); + }; + return JSONPatcherProxy; + }(); + + function render(vnode, parent, store) { + parent = typeof parent === 'string' ? document.querySelector(parent) : parent; + if (store) { + if (store.data) { + observeStore(store); + } else { + options.isMultiStore = true; + //Multi-store injection + for (var key in store) { + observeStore(store[key], key); + } + } + parent.store = store; + } + return diff(null, vnode, parent, false); + } + + function observeStore(store, key) { + store.instances = []; + store.updateSelfInstances = []; + extendStoreUpdate(store, key); + + store.data = new JSONPatcherProxy(store.data).observe(false, function (patch) { + var patchs = {}; + if (patch.op === 'remove') { + // fix arr splice + var kv = getArrayPatch(patch.path, store); + patchs[kv.k] = kv.v; + + update(patchs, store); + } else { + var key = fixPath(patch.path); + patchs[key] = patch.value; + + update(patchs, store); + } + }); + } + + function update(patch, store) { + store.update(patch); + } + + function extendStoreUpdate(store, key) { + store.update = function (patch) { + if (Object.keys(patch).length > 0) { + this.instances.forEach(function (instance) { + compute(instance, key); + if (key) { + if (instance._updatePath && instance._updatePath[key] && needUpdate(patch, instance._updatePath[key])) { + if (instance.use) { + getUse(store.data, (typeof instance.use === 'function' ? instance.use() : instance.use)[key], instance.using, key); + } + + instance.update(); + } + } else { + if (instance._updatePath && needUpdate(patch, instance._updatePath)) { + if (instance.use) { + instance.using = getUse(store.data, typeof instance.use === 'function' ? instance.use() : instance.use); + } + + instance.update(); + } + } + }); + + this.updateSelfInstances.forEach(function (instance) { + compute(instance, key); + if (key) { + if (instance._updateSelfPath && instance._updateSelfPath[key] && needUpdate(patch, instance._updateSelfPath[key])) { + if (instance.useSelf) { + getUse(store.data, (typeof instance.useSelf === 'function' ? instance.useSelf() : instance.useSelf)[key], instance.usingSelf, key); + } + + instance.updateSelf(); + } + } else { + if (instance._updateSelfPath && needUpdate(patch, instance._updateSelfPath)) { + instance.usingSelf = getUse(store.data, typeof instance.useSelf === 'function' ? instance.useSelf() : instance.useSelf); + instance.updateSelf(); + } + } + }); + this.onChange && this.onChange(patch); + } + }; + } + + function compute(instance, isMultiStore) { + if (instance.compute) { + for (var ck in instance.compute) { + instance.computed[ck] = instance.compute[ck].call(isMultiStore ? instance.store : instance.store.data); + } + } + } + + function needUpdate(diffResult, updatePath) { + for (var keyA in diffResult) { + if (updatePath[keyA]) { + return true; + } + for (var keyB in updatePath) { + if (includePath(keyA, keyB)) { + return true; + } + } + } + return false; + } + + function includePath(pathA, pathB) { + if (pathA.indexOf(pathB) === 0) { + var next = pathA.substr(pathB.length, 1); + if (next === '[' || next === '.') { + return true; + } + } + return false; + } + + function fixPath(path) { + var mpPath = ''; + var arr = path.replace('/', '').split('/'); + arr.forEach(function (item, index) { + if (index) { + if (isNaN(Number(item))) { + mpPath += '.' + item; + } else { + mpPath += '[' + item + ']'; + } + } else { + mpPath += item; + } + }); + return mpPath; + } + + function getArrayPatch(path, store) { + var arr = path.replace('/', '').split('/'); + var current = store.data[arr[0]]; + for (var i = 1, len = arr.length; i < len - 1; i++) { + current = current[arr[i]]; + } + return { + k: fixArrPath(path), + v: current + }; + } + + function fixArrPath(path) { + var mpPath = ''; + var arr = path.replace('/', '').split('/'); + var len = arr.length; + arr.forEach(function (item, index) { + if (index < len - 1) { + if (index) { + if (isNaN(Number(item))) { + mpPath += '.' + item; + } else { + mpPath += '[' + item + ']'; + } + } else { + mpPath += item; + } + } + }); + return mpPath; + } + + function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn$1(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits$1(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var storeHelpers = ['use', 'useSelf']; + + function define(name, ctor, config) { + if (options.mapping[name]) { + return; + } + if (ctor.is === 'WeElement') { + customElements.define(name, ctor); + options.mapping[name] = ctor; + } else { + if (typeof config === 'string') { + config = { css: config }; + } else { + config = config || {}; + } + + var Ele = function (_WeElement) { + _inherits$1(Ele, _WeElement); + + function Ele() { + var _temp, _this, _ret; + + _classCallCheck$1(this, Ele); + + for (var _len = arguments.length, args = Array(_len), key = 0; key < _len; key++) { + args[key] = arguments[key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn$1(this, _WeElement.call.apply(_WeElement, [this].concat(args))), _this), _this.compute = config.compute, _temp), _possibleConstructorReturn$1(_this, _ret); + } + + Ele.prototype.render = function render() { + return ctor.call(this, this); + }; + + return Ele; + }(WeElement); + + Ele.css = config.css; + Ele.propTypes = config.propTypes; + Ele.defaultProps = config.defaultProps; + Ele.isLightDom = config.isLightDom; + + var _loop = function _loop(key) { + if (typeof config[key] === 'function') { + Ele.prototype[key] = function () { + return config[key].apply(this, arguments); + }; + } + }; + + for (var key in config) { + _loop(key); + } + + storeHelpers.forEach(function (func) { + if (config[func] && config[func] !== 'function') { + Ele.prototype[func] = function () { + return config[func]; + }; + } + }); + + customElements.define(name, Ele); + options.mapping[name] = Ele; + } + } + + function tag(name, pure) { + return function (target) { + target.pure = pure; + define(name, target); + }; + } + + /** + * Clones the given VNode, optionally adding attributes/props and replacing its children. + * @param {VNode} vnode The virtual DOM element to clone + * @param {Object} props Attributes/props to add when cloning + * @param {VNode} rest Any additional arguments will be used as replacement children. + */ + function cloneElement(vnode, props) { + return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children); + } + + function getHost(ele) { + var p = ele.parentNode; + while (p) { + if (p.host) { + return p.host; + } else if (p.shadowRoot && p.shadowRoot.host) { + return p.shadowRoot.host; + } else { + p = p.parentNode; + } + } + } + + function rpx(str) { + return str.replace(/([1-9]\d*|0)(\.\d*)*rpx/g, function (a, b) { + return window.innerWidth * Number(b) / 750 + 'px'; + }); + } + + /** + * classNames based on https://github.com/JedWatson/classnames + * by Jed Watson + * Licensed under the MIT License + * https://github.com/JedWatson/classnames/blob/master/LICENSE + * modified by dntzhang + */ + + var hasOwn = {}.hasOwnProperty; + + function classNames() { + var classes = []; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } else if (Array.isArray(arg) && arg.length) { + var inner = classNames.apply(null, arg); + if (inner) { + classes.push(inner); + } + } else if (argType === 'object') { + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } + } + + return classes.join(' '); + } + + function extractClass() { + var _Array$prototype$slic = Array.prototype.slice.call(arguments, 0), + props = _Array$prototype$slic[0], + args = _Array$prototype$slic.slice(1); + + if (props.class) { + args.unshift(props.class); + delete props.class; + } else if (props.className) { + args.unshift(props.className); + delete props.className; + } + if (args.length > 0) { + return { class: classNames.apply(null, args) }; + } + } + + function o(obj) { + return JSON.stringify(obj); + } + + var n=function(t,r,u,e){for(var p=1;p"===t?(a(), u=1):u&&("="===t?(u=4, r=e, e=""):"/"===t?(a(), 3===u&&(s=s[0]), u=s, (s=s[0]).push(u,4), u=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(), u=2):e+=t);}return a(), s},r="function"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)), r}:function(n){for(var r="",e=0;e1?r:r[0]} + + h.f = Fragment; + + var html = htm.bind(h); + + function createRef() { + return {}; + } + + var $ = {}; + var Component = WeElement; + var defineElement = define; + var elements = options.mapping; + + var omi = { + tag: tag, + WeElement: WeElement, + Component: Component, + render: render, + h: h, + createElement: h, + options: options, + define: define, + cloneElement: cloneElement, + getHost: getHost, + rpx: rpx, + defineElement: defineElement, + classNames: classNames, + extractClass: extractClass, + createRef: createRef, + html: html, + htm: htm, + o: o, + elements: elements, + $: $, + extend: extend$1, + get: get, + set: set, + bind: bind, + unbind: unbind, + JSONProxy: JSONPatcherProxy + }; + + options.root.Omi = omi; + options.root.omi = omi; + options.root.Omi.version = '6.18.1'; + + if (typeof module != 'undefined') module.exports = omi;else self.Omi = omi; +}()); +//# sourceMappingURL=omi.dev.js.map diff --git a/packages/omi/dist/omi.dev.js.map b/packages/omi/dist/omi.dev.js.map index c19d00213..1d825b317 100644 --- a/packages/omi/dist/omi.dev.js.map +++ b/packages/omi/dist/omi.dev.js.map @@ -1 +1 @@ -{"version":3,"file":"omi.dev.js","sources":["../src/options.js","../src/util.js","../src/h.js","../src/constants.js","../src/vdom/index.js","../src/extend.js","../src/dom/index.js","../src/vdom/diff.js","../src/we-element.js","../src/proxy.js","../src/render.js","../src/define.js","../src/tag.js","../src/clone-element.js","../src/get-host.js","../src/rpx.js","../src/class.js","../src/o.js","../node_modules/htm/dist/htm.module.js","../src/omi.js","../src/omi.js"],"sourcesContent":["function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function () {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n * @public\n * @namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal(),\n mapping: {},\n isMultiStore: false,\n //when set true, using props of hypescript, don't use getAttribute\n //if you render all the node tree by omi self, set it\n ignoreAttrs: false\n}\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This shim allows elements written in, or compiled to, ES5 to work on native\n * implementations of Custom Elements v1. It sets new.target to the value of\n * this.constructor so that the native HTMLElement constructor can access the\n * current under-construction element's definition.\n */\n;(function() {\n if (\n // No Reflect, no classes, no need for shim because native custom elements\n // require ES2015 classes or Reflect.\n window.Reflect === undefined ||\n window.customElements === undefined ||\n // The webcomponentsjs custom elements polyfill doesn't require\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = HTMLElement\n window.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\nexport function cssToDom(css) {\n const node = document.createElement('style')\n node.textContent = css\n return node\n}\n\nexport function camelCase(str) {\n return str.replace(/-(\\w)/g, ($, $1) => {\n return $1.toUpperCase()\n })\n}\n\nexport function Fragment(props) {\n return props.children\n}\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 != null) {\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 * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\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 getUse(data, paths, out, name) {\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 if (out) out[name] = obj\n return obj\n}\n\nexport function pathToArr(path) {\n if (typeof path !== 'string' || !path) return []\n // return path.split(/\\.|\\[|\\]/).filter(name => !!name)\n return path\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n}\n\nexport function getTargetByPath(origin, path) {\n const arr = pathToArr(path)\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}\n\nconst hyphenateRE = /\\B([A-Z])/g\nexport function hyphenate(str) {\n return str.replace(hyphenateRE, '-$1').toLowerCase()\n}\n\nexport function getValByPath(path, current) {\n const arr = pathToArr(path)\n arr.forEach(prop => {\n current = current[prop]\n })\n return current\n}\n\nexport function getPath(obj, out, name) {\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 if (out) out[name] = result\n return result\n}\n\nexport function removeItem(item, arr) {\n if (!arr) return\n for (let i = 0, len = arr.length; i < len; i++) {\n if (arr[i] === item) {\n arr.splice(i, 1)\n break\n }\n }\n}\n","import options from './options'\nimport { Fragment } from './util'\n\nconst stack = []\n\nexport function h(nodeName, attributes) {\n let 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.length === 0) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n if (nodeName === Fragment) {\n return children\n }\n\n const p = {\n nodeName,\n children,\n attributes: attributes == null ? undefined : attributes,\n key: attributes == null ? undefined : attributes.key\n }\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","// 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 = 'prevProps'\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 { extend } from '../util'\nimport options from '../options'\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node DOM Node to compare\n * @param {VNode} vnode Virtual DOM node to compare\n * @param {boolean} [hydrating=false] If 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 return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n } else if (typeof vnode.nodeName === 'function') {\n return options.mapping[node.nodeName.toLowerCase()] === 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 A DOM Element to inspect the name of.\n * @param {String} nodeName Unnormalized 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 { pathToArr } from './util'\n\nexport const extension = {}\n\nexport function extend(name, handler) {\n extension['o-' + name] = handler\n}\n\nexport function set(origin, path, value) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n if (i === len - 1) {\n current[arr[i]] = value\n } else {\n current = current[arr[i]]\n }\n }\n}\n\nexport function get(origin, path) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n current = current[arr[i]]\n }\n\n return current\n}\n\nfunction eventProxy(e) {\n return this._listeners[e.type](e)\n}\n\nexport function bind(el, type, handler) {\n el._listeners = el._listeners || {}\n el._listeners[type] = handler\n el.addEventListener(type, eventProxy)\n}\n\nexport function unbind(el, type) {\n el.removeEventListener(type, eventProxy)\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\nimport { extension } from '../extend'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg, component) {\n if (name === 'className') name = 'class'\n\n if (name[0] == 'o' && name[1] == '-') {\n if (extension[name]) {\n extension[name](node, value, component)\n }\n } else 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 (!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 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 let nameLower = name.toLowerCase()\n name = (nameLower in node ? nameLower : name).slice(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 (node.nodeName === 'INPUT' && name === 'value') {\n node[name] = value == null ? '' : value\n } else if (\n name !== 'list' &&\n name !== 'type' &&\n name !== 'css' &&\n !isSvg &&\n name in node &&\n value !== ''\n ) {\n //value !== '' fix for selected, disabled, checked with pure element\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\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\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : 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 {\n node.pureSetAttribute\n ? node.pureSetAttribute(name, value)\n : node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @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}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { camelCase, isArray, Fragment } from '../util'\nimport { removeNode } from '../dom/index'\nimport options from '../options'\n\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/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n * @param {Element} [dom=null] A DOM node to mutate into the shape of the `vnode`\n * @param {VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure\n * @returns {Element} dom The created/mutated element\n * @private\n */\nexport function diff(dom, vnode, parent, component, updateSelf) {\n //first render return undefined\n if (!dom && !vnode) return\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\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 if (vnode && vnode.nodeName === Fragment) {\n vnode = vnode.children\n }\n if (isArray(vnode)) {\n if (parent) {\n const styles = parent.querySelectorAll('style')\n styles.forEach(s => {\n parent.removeChild(s)\n })\n innerDiffNode(parent, vnode, hydrating, component, updateSelf)\n\n for (let i = styles.length - 1; i >= 0; i--) {\n parent.firstChild\n ? parent.insertBefore(styles[i], parent.firstChild)\n : parent.appendChild(style[i])\n }\n } else {\n ret = []\n vnode.forEach((item, index) => {\n let ele = idiff(index === 0 ? dom : null, item, component, updateSelf)\n ret.push(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n dom.forEach((one, index) => {\n if (index === 0) {\n ret = idiff(one, vnode, component, updateSelf)\n } else {\n recollectNodeTree(one, false)\n }\n })\n } else {\n ret = idiff(dom, vnode, component, updateSelf)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\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 }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, component, updateSelf) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\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 // 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 || component)\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 out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n if (typeof vnodeName === 'function') {\n for (let key in options.mapping) {\n if (options.mapping[key] === vnodeName) {\n vnodeName = key\n vnode.nodeName = key\n break\n }\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 if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n hydrating || props.dangerouslySetInnerHTML != null,\n component,\n updateSelf\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, component, updateSelf)\n if (out.props) {\n out.props.children = vnode.children\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 * @param {Element} dom Element whose children should be compared & mutated\n * @param {Array} vchildren Array of VNodes to compare to `dom.childNodes`\n * @param {Boolean} isHydrating If `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, isHydrating, component, updateSelf) {\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, component, updateSelf)\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 * @param {Node} node DOM node to start unmount/removal from\n * @param {Boolean} [unmountOnly=false] If `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\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 && node[ATTR_KEY].ref) {\n if (typeof node[ATTR_KEY].ref === 'function') {\n node[ATTR_KEY].ref(null)\n } else if (node[ATTR_KEY].ref.current) {\n node[ATTR_KEY].ref.current = null\n }\n }\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n * - we use .lastChild here because it causes less reflow than .firstChild\n * - 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 * @param {Element} dom Element with attributes to diff `attrs` against\n * @param {Object} attrs The desired end-state key-value attribute pairs\n * @param {Object} old Current/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, component, updateSelf) {\n let name\n //let update = false\n let isWeElement = dom.update\n let oldClone\n if (dom.receiveProps) {\n oldClone = Object.assign({}, old)\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(\n dom,\n name,\n old[name],\n (old[name] = undefined),\n isSvgMode,\n component\n )\n if (isWeElement) {\n delete dom.props[name]\n //update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (isWeElement && typeof attrs[name] === 'object' && name !== 'ref') {\n if (name === 'style') {\n setAccessor(\n dom,\n name,\n old[name],\n (old[name] = attrs[name]),\n isSvgMode,\n component\n )\n }\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else if (\n name !== 'children' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], attrs[name], isSvgMode, component)\n if (isWeElement) {\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else {\n old[name] = attrs[name]\n }\n }\n }\n\n if (isWeElement && !updateSelf && dom.parentNode) {\n //__hasChildren is not accuracy when it was empty at first, so add dom.children.length > 0 condition\n //if (update || dom.__hasChildren || dom.children.length > 0 || (dom.store && !dom.store.data)) {\n if (dom.receiveProps(dom.props, oldClone) !== false) {\n dom.update()\n }\n //}\n }\n}\n","import {\n\tcssToDom,\n\tisArray,\n\tgetUse,\n\thyphenate,\n\tgetValByPath,\n\tremoveItem\n} from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { getPath } from './util'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n\tstatic is = 'WeElement'\n\n\tconstructor() {\n\t\tsuper()\n\t\tthis.props = Object.assign({}, this.constructor.defaultProps)\n\t\tthis.elementId = id++\n\t\tthis.computed = {}\n\t}\n\n\tconnectedCallback() {\n\t\tlet p = this.parentNode\n\t\twhile (p && !this.store) {\n\t\t\tthis.store = p.store\n\t\t\tp = p.parentNode || p.host\n\t\t}\n\n\t\tthis.attrsToProps()\n\n\t\tif (this.props.use) {\n\t\t\tthis.use = this.props.use\n\t\t}\n\n\t\tif (this.props.useSelf) {\n\t\t\tthis.use = this.props.useSelf\n\t\t}\n\n\t\tif (this.use) {\n\t\t\tconst use = typeof this.use === 'function' ? this.use() : this.use\n\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\t_updatePath[storeName] = {}\n\t\t\t\t\tusing[storeName] = {}\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].instances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.using = using\n\t\t\t\tthis._updatePath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updatePath = getPath(use)\n\t\t\t\tthis.using = getUse(this.store.data, use)\n\t\t\t\tthis.store.instances.push(this)\n\t\t\t}\n\t\t}\n\t\tif (this.useSelf) {\n\t\t\tconst use =\n\t\t\t\ttypeof this.useSelf === 'function' ? this.useSelf() : this.useSelf\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].updateSelfInstances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.usingSelf = using\n\t\t\t\tthis._updateSelfPath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updateSelfPath = getPath(use)\n\t\t\t\tthis.usingSelf = getUse(this.store.data, use)\n\t\t\t\tthis.store.updateSelfInstances.push(this)\n\t\t\t}\n\t\t}\n\n\t\tif (this.compute) {\n\t\t\tfor (let key in this.compute) {\n\t\t\t\tthis.computed[key] = this.compute[key].call(\n\t\t\t\t\toptions.isMultiStore ? this.store : this.store.data\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeInstall()\n\t\tthis.install()\n\t\tthis.afterInstall()\n\n\t\tlet shadowRoot\n\t\tif (this.constructor.isLightDom) {\n\t\t\tshadowRoot = this\n\t\t} else {\n\n\t\t\tif (!this.shadowRoot) {\n\t\t\t\tshadowRoot = this.attachShadow({\n\t\t\t\t\tmode: 'open'\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tshadowRoot = this.shadowRoot\n\t\t\t\tlet fc\n\t\t\t\twhile ((fc = shadowRoot.firstChild)) {\n\t\t\t\t\tshadowRoot.removeChild(fc)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.constructor.css) {\n\t\t\t\tshadowRoot.appendChild(cssToDom(this.constructor.css))\n\t\t\t} else if (this.css) {\n\t\t\t\tshadowRoot.appendChild(\n\t\t\t\t\tcssToDom(typeof this.css === 'function' ? this.css() : this.css)\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeRender()\n\t\toptions.afterInstall && options.afterInstall(this)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.__hasChildren =\n\t\t\tObject.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\trendered.length > 0\n\n\t\tthis.rootNode = diff(null, rendered, null, this)\n\t\tthis.rendered()\n\n\t\tif (this.props.css) {\n\t\t\tthis._customStyleElement = cssToDom(this.props.css)\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tshadowRoot.appendChild(this._customStyleElement)\n\t\t}\n\n\t\tif (isArray(this.rootNode)) {\n\t\t\tthis.rootNode.forEach(function (item) {\n\t\t\t\tshadowRoot.appendChild(item)\n\t\t\t})\n\t\t} else {\n\t\t\tthis.rootNode && shadowRoot.appendChild(this.rootNode)\n\t\t}\n\t\tthis.installed()\n\t\tthis._isInstalled = true\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.uninstall()\n\t\tthis._isInstalled = false\n\t\tif (this.store) {\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tfor (let key in this.store) {\n\t\t\t\t\tconst current = this.store[key]\n\t\t\t\t\tremoveItem(this, current.instances)\n\t\t\t\t\tremoveItem(this, current.updateSelfInstances)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tremoveItem(this, this.store.instances)\n\t\t\t\tremoveItem(this, this.store.updateSelfInstances)\n\t\t\t}\n\t\t}\n\t}\n\n\tupdate(ignoreAttrs, updateSelf) {\n\t\tthis._willUpdate = true\n\t\tthis.beforeUpdate()\n\t\tthis.beforeRender()\n\t\t//fix null !== undefined\n\t\tif (this._customStyleContent != this.props.css) {\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tthis._customStyleElement.textContent = this._customStyleContent\n\t\t}\n\t\tthis.attrsToProps(ignoreAttrs)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.rendered()\n\t\tthis.__hasChildren =\n\t\t\tthis.__hasChildren ||\n\t\t\t(Object.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\t\trendered.length > 0)\n\n\t\tthis.rootNode = diff(\n\t\t\tthis.rootNode,\n\t\t\trendered,\n\t\t\tthis.shadowRoot,\n\t\t\tthis,\n\t\t\tupdateSelf\n\t\t)\n\t\tthis._willUpdate = false\n\t\tthis.updated()\n\t}\n\n\tforceUpdate() {\n\t\tthis.update(true)\n\t}\n\n\tupdateProps(obj) {\n\t\tObject.keys(obj).forEach(key => {\n\t\t\tthis.props[key] = obj[key]\n\t\t\tif (this.prevProps) {\n\t\t\t\tthis.prevProps[key] = obj[key]\n\t\t\t}\n\t\t})\n\t\tthis.forceUpdate()\n\t}\n\n\tupdateSelf(ignoreAttrs) {\n\t\tthis.update(ignoreAttrs, true)\n\t}\n\n\tremoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t\t//Avoid executing removeAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tsetAttribute(key, val) {\n\t\tif (val && typeof val === 'object') {\n\t\t\tsuper.setAttribute(key, JSON.stringify(val))\n\t\t} else {\n\t\t\tsuper.setAttribute(key, val)\n\t\t}\n\t\t//Avoid executing setAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tpureRemoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t}\n\n\tpureSetAttribute(key, val) {\n\t\tsuper.setAttribute(key, val)\n\t}\n\n\tattrsToProps(ignoreAttrs) {\n\t\tif (options.ignoreAttrs || ignoreAttrs) return\n\t\tconst ele = this\n\t\tele.props['css'] = ele.getAttribute('css')\n\t\tconst attrs = this.constructor.propTypes\n\t\tif (!attrs) return\n\t\tObject.keys(attrs).forEach(key => {\n\t\t\tconst type = attrs[key]\n\t\t\tconst val = ele.getAttribute(hyphenate(key))\n\t\t\tif (val !== null) {\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase String:\n\t\t\t\t\t\tele.props[key] = val\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Number:\n\t\t\t\t\t\tele.props[key] = Number(val)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Boolean:\n\t\t\t\t\t\tif (val === 'false' || val === '0') {\n\t\t\t\t\t\t\tele.props[key] = false\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Array:\n\t\t\t\t\tcase Object:\n\t\t\t\t\t\tif (val[0] === ':') {\n\t\t\t\t\t\t\tele.props[key] = getValByPath(val.substr(1), Omi.$)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = JSON.parse(\n\t\t\t\t\t\t\t\tval\n\t\t\t\t\t\t\t\t\t.replace(/(['\"])?([a-zA-Z0-9_-]+)(['\"])?:([^\\/])/g, '\"$2\":$4')\n\t\t\t\t\t\t\t\t\t.replace(/'([\\s\\S]*?)'/g, '\"$1\"')\n\t\t\t\t\t\t\t\t\t.replace(/,(\\s*})/g, '$1')\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tele.constructor.defaultProps &&\n\t\t\t\t\tele.constructor.defaultProps.hasOwnProperty(key)\n\t\t\t\t) {\n\t\t\t\t\tele.props[key] = ele.constructor.defaultProps[key]\n\t\t\t\t} else {\n\t\t\t\t\tele.props[key] = null\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tfire(name, data) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(name, {\n\t\t\t\tdetail: data\n\t\t\t})\n\t\t)\n\t}\n\n\tbeforeInstall() { }\n\n\tinstall() { }\n\n\tafterInstall() { }\n\n\tinstalled() { }\n\n\tuninstall() { }\n\n\tbeforeUpdate() { }\n\n\tupdated() { }\n\n\tbeforeRender() { }\n\n\trendered() { }\n\n\treceiveProps() { }\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\nimport { getUse } from './util'\nimport options from './options'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n if (store.data) {\n observeStore(store)\n } else {\n options.isMultiStore = true\n //Multi-store injection\n for (let key in store) {\n observeStore(store[key], key)\n }\n }\n parent.store = store\n }\n return diff(null, vnode, parent, false)\n}\n\nfunction observeStore(store, key) {\n store.instances = []\n store.updateSelfInstances = []\n extendStoreUpdate(store, key)\n\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n const patchs = {}\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n\n update(patchs, store)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n\n update(patchs, store)\n }\n })\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpdate(store, key) {\n store.update = function(patch) {\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updatePath &&\n instance._updatePath[key] &&\n needUpdate(patch, instance._updatePath[key])\n ) {\n if (instance.use) {\n getUse(\n store.data,\n (typeof instance.use === 'function'\n ? instance.use()\n : instance.use)[key],\n instance.using,\n key\n )\n }\n\n instance.update()\n }\n } else {\n if (instance._updatePath && needUpdate(patch, instance._updatePath)) {\n if (instance.use) {\n instance.using = getUse(\n store.data,\n typeof instance.use === 'function'\n ? instance.use()\n : instance.use\n )\n }\n\n instance.update()\n }\n }\n })\n\n this.updateSelfInstances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updateSelfPath &&\n instance._updateSelfPath[key] &&\n needUpdate(patch, instance._updateSelfPath[key])\n ) {\n if (instance.useSelf) {\n getUse(\n store.data,\n (typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf)[key],\n instance.usingSelf,\n key\n )\n }\n\n instance.updateSelf()\n }\n } else {\n if (\n instance._updateSelfPath &&\n needUpdate(patch, instance._updateSelfPath)\n ) {\n instance.usingSelf = getUse(\n store.data,\n typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf\n )\n instance.updateSelf()\n }\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nfunction compute(instance, isMultiStore) {\n if (instance.compute) {\n for (let ck in instance.compute) {\n instance.computed[ck] = instance.compute[ck].call(\n isMultiStore ? instance.store : instance.store.data\n )\n }\n }\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 {\n k: fixArrPath(path),\n v: current\n }\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 WeElement from './we-element'\nimport options from './options'\n\nconst storeHelpers = ['use', 'useSelf']\n\nexport function define(name, ctor, config) {\n if (options.mapping[name]) {\n return\n }\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n options.mapping[name] = ctor\n } else {\n if (typeof config === 'string') {\n config = { css: config }\n } else {\n config = config || {}\n }\n\n class Ele extends WeElement {\n static css = config.css\n\n static propTypes = config.propTypes\n\n static defaultProps = config.defaultProps\n\n compute = config.compute\n\n render() {\n return ctor.call(this, this)\n }\n }\n\n for (let key in config) {\n if (typeof config[key] === 'function') {\n Ele.prototype[key] = function() {\n return config[key].apply(this, arguments)\n }\n }\n }\n\n storeHelpers.forEach(func => {\n if (config[func] && config[func] !== 'function') {\n Ele.prototype[func] = function() {\n return config[func]\n }\n }\n })\n\n customElements.define(name, Ele)\n options.mapping[name] = Ele\n }\n}\n","import { define } from './define'\n\nexport function tag(name, pure) {\n return function(target) {\n target.pure = pure\n define(name, target)\n }\n}\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 The virtual DOM element to clone\n * @param {Object} props Attributes/props to add when cloning\n * @param {VNode} rest Any 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","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else if (p.shadowRoot && p.shadowRoot.host) {\n return p.shadowRoot.host\n } else {\n p = p.parentNode\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","/**\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.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 if (args.length > 0) {\n return { class: classNames.apply(null, args) }\n }\n}\n","export function o(obj) {\n return JSON.stringify(obj)\n}\n","var n=function(t,r,u,e){for(var p=1;p=5&&((e||!n&&5===u)&&(s.push(e,u,r),u=6),n&&(s.push(n,u,r),u=6)),e=\"\"},a=0;a\"===t?(u=1,e=\"\"):e=t+e[0]:p?t===p?p=\"\":e+=t:'\"'===t||\"'\"===t?p=t:\">\"===t?(h(),u=1):u&&(\"=\"===t?(u=5,r=e,e=\"\"):\"/\"===t&&(u<5||\">\"===n[a][f+1])?(h(),3===u&&(s=s[0]),u=s,(s=s[0]).push(u,2),u=0):\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t?(h(),u=2):e+=t),3===u&&\"!--\"===e&&(u=4,s=s[0])}return h(),s},r=\"function\"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)),r}:function(n){for(var r=\"\",e=0;e1?r:r[0]}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { classNames, extractClass } from './class'\nimport { o } from './o'\nimport htm from 'htm'\nimport { extend, get, set, bind, unbind } from './extend'\nimport JSONProxy from './proxy'\nimport { Fragment } from './util'\n\nh.f = Fragment\n\nconst html = htm.bind(h)\n\nfunction createRef() {\n\treturn {}\n}\n\nconst $ = {}\nconst Component = WeElement\nconst defineElement = define\nconst elements = options.mapping\n\nconst omi = {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n\noptions.root.Omi = omi\noptions.root.omi = omi\noptions.root.Omi.version = '6.18.0'\n\nexport default omi\n\nexport {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n","\n\t\t\t\timport Omi from './omi';\n\t\t\t\tif (typeof module!='undefined') module.exports = Omi;\n\t\t\t\telse self.Omi = Omi;\n\t\t\t"],"names":["getGlobal","global","Math","Array","self","window","store","root","mapping","isMultiStore","ignoreAttrs","Reflect","undefined","customElements","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","constructor","prototype","Object","setPrototypeOf","cssToDom","css","node","document","createElement","textContent","camelCase","str","replace","$","$1","toUpperCase","Fragment","props","children","extend","obj","i","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","isArray","toString","call","getUse","data","paths","out","name","forEach","path","index","isPath","getTargetByPath","key","keys","tempPath","tempVal","args","push","apply","pathToArr","split","origin","arr","len","length","hyphenateRE","hyphenate","toLowerCase","getValByPath","prop","getPath","result","item","removeItem","splice","stack","h","nodeName","attributes","lastSimple","child","simple","arguments","pop","String","p","options","vnode","ATTR_KEY","IS_NON_DIMENSIONAL","isSameNodeType","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","extension","handler","set","get","eventProxy","e","_listeners","type","el","addEventListener","unbind","removeEventListener","createNode","isSvg","createElementNS","removeNode","parentNode","removeChild","setAccessor","old","component","className","style","cssText","test","innerHTML","__html","useCapture","nameLower","slice","touchStart","touchEnd","pureRemoveAttribute","removeAttribute","ns","removeAttributeNS","setAttributeNS","pureSetAttribute","setAttribute","event","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","diffLevel","isSvgMode","diff","dom","parent","updateSelf","ret","ownerSVGElement","styles","querySelectorAll","s","innerDiffNode","firstChild","insertBefore","appendChild","ele","idiff","one","recollectNodeTree","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","vnodeName","fc","vchildren","a","nextSibling","is","noSlot","dangerouslySetInnerHTML","diffAttributes","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","childrenLen","vlen","j","c","f","vchild","__key","trim","unmountOnly","removeChildren","lastChild","next","previousSibling","attrs","isWeElement","update","oldClone","receiveProps","assign","ccName","id","WeElement","defaultProps","elementId","computed","connectedCallback","host","attrsToProps","use","useSelf","_updatePath","using","storeName","instances","updateSelfInstances","usingSelf","_updateSelfPath","compute","beforeInstall","install","afterInstall","shadowRoot","isLightDom","attachShadow","mode","beforeRender","rendered","render","__hasChildren","rootNode","_customStyleElement","_customStyleContent","installed","_isInstalled","disconnectedCallback","uninstall","_willUpdate","beforeUpdate","updated","forceUpdate","updateProps","prevProps","val","JSON","stringify","getAttribute","propTypes","Number","Boolean","substr","Omi","parse","fire","JSONPatcherProxy","deepClone","escapePathComponent","indexOf","findObjectPath","instance","pathComponents","parentAndPath","parenthoodMap","unshift","join","setTrap","target","newValue","parentPath","destinationPropKey","proxifiedObjectsMap","has","newValueOriginalObject","originalObject","revokableInstance","isProxifyingTreeNow","inherited","_proxifyObjectTreeRecursively","operation","op","oldValue","delete","disableTrapsForProxy","isInteger","console","warn","reflectionResult","defaultCallback","deleteTrap","revokableProxyInstance","deleteProperty","resume","isRecording","patches","userCallback","isObserving","pause","showDetachedWarning","Map","cachedProxy","generateProxyAtPath","traps","receiver","revocableInstance","Proxy","revocable","trapsInstance","proxy","proxifyObjectTree","proxifiedObject","message","targetObject","propKey","observe","record","callback","Error","generate","revoke","disableTraps","querySelector","observeStore","extendStoreUpdate","JSONProxy","patch","patchs","kv","getArrayPatch","k","v","fixPath","needUpdate","onChange","ck","diffResult","updatePath","keyA","keyB","includePath","pathA","pathB","mpPath","isNaN","fixArrPath","storeHelpers","define","ctor","config","Ele","func","tag","pure","cloneElement","getHost","rpx","b","innerWidth","hasOwn","classNames","classes","arg","argType","inner","extractClass","class","o","html","htm","createRef","Component","defineElement","elements","omi","version","module","exports"],"mappings":";;;;;;;;;;;EAAA,SAASA,SAAT,GAAqB;EACnB,MACE,OAAOC,MAAP,KAAkB,QAAlB,IACA,CAACA,MADD,IAEAA,OAAOC,IAAP,KAAgBA,IAFhB,IAGAD,OAAOE,KAAP,KAAiBA,KAJnB,EAKE;EACA,WACEC,QACAC,MADA,IAEAJ,MAFA,IAGC,YAAY;EACX,aAAO,IAAP;EACD,KAFD,EAJF;EAQD;EACD,SAAOA,MAAP;EACD;;EAED;;;;AAIA,gBAAe;EACbK,SAAO,IADM;EAEbC,QAAMP,WAFO;EAGbQ,WAAS,EAHI;EAIbC,gBAAc,KAJD;EAKb;EACA;EACAC,eAAa;EAPA,CAAf;;ECvBA;;;;;;;;;EAgBC,CAAC,YAAW;EACX;EACE;EACA;EACAL,SAAOM,OAAP,KAAmBC,SAAnB,IACAP,OAAOQ,cAAP,KAA0BD,SAD1B;EAEA;EACA;EACAP,SAAOQ,cAAP,CAAsBC,cAAtB,CAAqC,2BAArC,CAPF,EAQE;EACA;EACD;EACD,MAAMC,qBAAqBC,WAA3B;EACAX,SAAOW,WAAP,GAAqB,SAASA,WAAT,GAAuB;EAC1C,WAAOL,QAAQM,SAAR,CAAkBF,kBAAlB,EAAsC,EAAtC,EAA0C,KAAKG,WAA/C,CAAP;EACD,GAFD;EAGAF,cAAYG,SAAZ,GAAwBJ,mBAAmBI,SAA3C;EACAH,cAAYG,SAAZ,CAAsBD,WAAtB,GAAoCF,WAApC;EACAI,SAAOC,cAAP,CAAsBL,WAAtB,EAAmCD,kBA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AwBX7D,WAxBW;EAyBXqE,eAzBW;EA0BXgO;EA1BW,CAAZ;;EA6BApP,QAAQ1F,IAAR,CAAasQ,GAAb,GAAmByH,GAAnB;EACArS,QAAQ1F,IAAR,CAAa+X,GAAb,GAAmBA,GAAnB;EACArS,QAAQ1F,IAAR,CAAasQ,GAAb,CAAiB0H,OAAjB,GAA2B,QAA3B;;EC1DI,IAAI,OAAOC,MAAP,IAAe,WAAnB,EAAgCA,OAAOC,OAAP,GAAiB5H,GAAjB,CAAhC,KACKzQ,KAAKyQ,GAAL,GAAWA,GAAX;;"} \ No newline at end of file +{"version":3,"file":"omi.dev.js","sources":["../src/options.js","../src/util.js","../src/h.js","../src/constants.js","../src/vdom/index.js","../src/extend.js","../src/dom/index.js","../src/vdom/diff.js","../src/we-element.js","../src/proxy.js","../src/render.js","../src/define.js","../src/tag.js","../src/clone-element.js","../src/get-host.js","../src/rpx.js","../src/class.js","../src/o.js","../node_modules/htm/dist/htm.mjs","../src/omi.js","../src/omi.js"],"sourcesContent":["function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function () {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n * @public\n * @namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal(),\n mapping: {},\n isMultiStore: false,\n //when set true, using props of hypescript, don't use getAttribute\n //if you render all the node tree by omi self, set it\n ignoreAttrs: false\n}\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This shim allows elements written in, or compiled to, ES5 to work on native\n * implementations of Custom Elements v1. It sets new.target to the value of\n * this.constructor so that the native HTMLElement constructor can access the\n * current under-construction element's definition.\n */\n;(function() {\n if (\n // No Reflect, no classes, no need for shim because native custom elements\n // require ES2015 classes or Reflect.\n window.Reflect === undefined ||\n window.customElements === undefined ||\n // The webcomponentsjs custom elements polyfill doesn't require\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = HTMLElement\n window.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\nexport function cssToDom(css) {\n const node = document.createElement('style')\n node.textContent = css\n return node\n}\n\nexport function camelCase(str) {\n return str.replace(/-(\\w)/g, ($, $1) => {\n return $1.toUpperCase()\n })\n}\n\nexport function Fragment(props) {\n return props.children\n}\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 != null) {\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 * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\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 getUse(data, paths, out, name) {\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 if (out) out[name] = obj\n return obj\n}\n\nexport function pathToArr(path) {\n if (typeof path !== 'string' || !path) return []\n // return path.split(/\\.|\\[|\\]/).filter(name => !!name)\n return path\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n}\n\nexport function getTargetByPath(origin, path) {\n const arr = pathToArr(path)\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}\n\nconst hyphenateRE = /\\B([A-Z])/g\nexport function hyphenate(str) {\n return str.replace(hyphenateRE, '-$1').toLowerCase()\n}\n\nexport function getValByPath(path, current) {\n const arr = pathToArr(path)\n arr.forEach(prop => {\n current = current[prop]\n })\n return current\n}\n\nexport function getPath(obj, out, name) {\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 if (out) out[name] = result\n return result\n}\n\nexport function removeItem(item, arr) {\n if (!arr) return\n for (let i = 0, len = arr.length; i < len; i++) {\n if (arr[i] === item) {\n arr.splice(i, 1)\n break\n }\n }\n}\n","import options from './options'\nimport { Fragment } from './util'\n\nconst stack = []\n\nexport function h(nodeName, attributes) {\n let 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.length === 0) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n if (nodeName === Fragment) {\n return children\n }\n\n const p = {\n nodeName,\n children,\n attributes: attributes == null ? undefined : attributes,\n key: attributes == null ? undefined : attributes.key\n }\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","// 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 = 'prevProps'\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 { extend } from '../util'\nimport options from '../options'\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node DOM Node to compare\n * @param {VNode} vnode Virtual DOM node to compare\n * @param {boolean} [hydrating=false] If 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 return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n } else if (typeof vnode.nodeName === 'function') {\n return options.mapping[node.nodeName.toLowerCase()] === 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 A DOM Element to inspect the name of.\n * @param {String} nodeName Unnormalized 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 { pathToArr } from './util'\n\nexport const extension = {}\n\nexport function extend(name, handler) {\n extension['o-' + name] = handler\n}\n\nexport function set(origin, path, value) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n if (i === len - 1) {\n current[arr[i]] = value\n } else {\n current = current[arr[i]]\n }\n }\n}\n\nexport function get(origin, path) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n current = current[arr[i]]\n }\n\n return current\n}\n\nfunction eventProxy(e) {\n return this._listeners[e.type](e)\n}\n\nexport function bind(el, type, handler) {\n el._listeners = el._listeners || {}\n el._listeners[type] = handler\n el.addEventListener(type, eventProxy)\n}\n\nexport function unbind(el, type) {\n el.removeEventListener(type, eventProxy)\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\nimport { extension } from '../extend'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg, component) {\n if (name === 'className') name = 'class'\n\n if (name[0] == 'o' && name[1] == '-') {\n if (extension[name]) {\n extension[name](node, value, component)\n }\n } else 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 (!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 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 let nameLower = name.toLowerCase()\n name = (nameLower in node ? nameLower : name).slice(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 (node.nodeName === 'INPUT' && name === 'value') {\n node[name] = value == null ? '' : value\n } else if (\n name !== 'list' &&\n name !== 'type' &&\n name !== 'css' &&\n !isSvg &&\n name in node &&\n value !== ''\n ) {\n //value !== '' fix for selected, disabled, checked with pure element\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\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\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : 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 {\n node.pureSetAttribute\n ? node.pureSetAttribute(name, value)\n : node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @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}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { camelCase, isArray, Fragment } from '../util'\nimport { removeNode } from '../dom/index'\nimport options from '../options'\n\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/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n * @param {Element} [dom=null] A DOM node to mutate into the shape of the `vnode`\n * @param {VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure\n * @returns {Element} dom The created/mutated element\n * @private\n */\nexport function diff(dom, vnode, parent, component, updateSelf) {\n //first render return undefined\n if (!dom && !vnode) return\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\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 if (vnode && vnode.nodeName === Fragment) {\n vnode = vnode.children\n }\n if (isArray(vnode)) {\n if (parent) {\n const styles = parent.querySelectorAll('style')\n styles.forEach(s => {\n parent.removeChild(s)\n })\n innerDiffNode(parent, vnode, hydrating, component, updateSelf)\n\n for (let i = styles.length - 1; i >= 0; i--) {\n parent.firstChild\n ? parent.insertBefore(styles[i], parent.firstChild)\n : parent.appendChild(style[i])\n }\n } else {\n ret = []\n vnode.forEach((item, index) => {\n let ele = idiff(index === 0 ? dom : null, item, component, updateSelf)\n ret.push(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n dom.forEach((one, index) => {\n if (index === 0) {\n ret = idiff(one, vnode, component, updateSelf)\n } else {\n recollectNodeTree(one, false)\n }\n })\n } else {\n ret = idiff(dom, vnode, component, updateSelf)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\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 }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, component, updateSelf) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\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 // 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 || component)\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 out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n if (typeof vnodeName === 'function') {\n for (let key in options.mapping) {\n if (options.mapping[key] === vnodeName) {\n vnodeName = key\n vnode.nodeName = key\n break\n }\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 if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n hydrating || props.dangerouslySetInnerHTML != null,\n component,\n updateSelf\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, component, updateSelf)\n if (out.props) {\n out.props.children = vnode.children\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 * @param {Element} dom Element whose children should be compared & mutated\n * @param {Array} vchildren Array of VNodes to compare to `dom.childNodes`\n * @param {Boolean} isHydrating If `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, isHydrating, component, updateSelf) {\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, component, updateSelf)\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 * @param {Node} node DOM node to start unmount/removal from\n * @param {Boolean} [unmountOnly=false] If `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\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 && node[ATTR_KEY].ref) {\n if (typeof node[ATTR_KEY].ref === 'function') {\n node[ATTR_KEY].ref(null)\n } else if (node[ATTR_KEY].ref.current) {\n node[ATTR_KEY].ref.current = null\n }\n }\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n * - we use .lastChild here because it causes less reflow than .firstChild\n * - 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 * @param {Element} dom Element with attributes to diff `attrs` against\n * @param {Object} attrs The desired end-state key-value attribute pairs\n * @param {Object} old Current/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, component, updateSelf) {\n let name\n //let update = false\n let isWeElement = dom.update\n let oldClone\n if (dom.receiveProps) {\n oldClone = Object.assign({}, old)\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(\n dom,\n name,\n old[name],\n (old[name] = undefined),\n isSvgMode,\n component\n )\n if (isWeElement) {\n delete dom.props[name]\n //update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (isWeElement && typeof attrs[name] === 'object' && name !== 'ref') {\n if (name === 'style') {\n setAccessor(\n dom,\n name,\n old[name],\n (old[name] = attrs[name]),\n isSvgMode,\n component\n )\n }\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else if (\n name !== 'children' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], attrs[name], isSvgMode, component)\n if (isWeElement) {\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else {\n old[name] = attrs[name]\n }\n }\n }\n\n if (isWeElement && !updateSelf && dom.parentNode) {\n //__hasChildren is not accuracy when it was empty at first, so add dom.children.length > 0 condition\n //if (update || dom.__hasChildren || dom.children.length > 0 || (dom.store && !dom.store.data)) {\n if (dom.receiveProps(dom.props, oldClone) !== false) {\n dom.update()\n }\n //}\n }\n}\n","import {\n\tcssToDom,\n\tisArray,\n\tgetUse,\n\thyphenate,\n\tgetValByPath,\n\tremoveItem\n} from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { getPath } from './util'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n\tstatic is = 'WeElement'\n\n\tconstructor() {\n\t\tsuper()\n\t\tthis.props = Object.assign({}, this.constructor.defaultProps)\n\t\tthis.elementId = id++\n\t\tthis.computed = {}\n\t}\n\n\tconnectedCallback() {\n\t\tlet p = this.parentNode\n\t\twhile (p && !this.store) {\n\t\t\tthis.store = p.store\n\t\t\tp = p.parentNode || p.host\n\t\t}\n\n\t\tthis.attrsToProps()\n\n\t\tif (this.props.use) {\n\t\t\tthis.use = this.props.use\n\t\t}\n\n\t\tif (this.props.useSelf) {\n\t\t\tthis.use = this.props.useSelf\n\t\t}\n\n\t\tif (this.use) {\n\t\t\tconst use = typeof this.use === 'function' ? this.use() : this.use\n\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\t_updatePath[storeName] = {}\n\t\t\t\t\tusing[storeName] = {}\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].instances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.using = using\n\t\t\t\tthis._updatePath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updatePath = getPath(use)\n\t\t\t\tthis.using = getUse(this.store.data, use)\n\t\t\t\tthis.store.instances.push(this)\n\t\t\t}\n\t\t}\n\t\tif (this.useSelf) {\n\t\t\tconst use =\n\t\t\t\ttypeof this.useSelf === 'function' ? this.useSelf() : this.useSelf\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].updateSelfInstances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.usingSelf = using\n\t\t\t\tthis._updateSelfPath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updateSelfPath = getPath(use)\n\t\t\t\tthis.usingSelf = getUse(this.store.data, use)\n\t\t\t\tthis.store.updateSelfInstances.push(this)\n\t\t\t}\n\t\t}\n\n\t\tif (this.compute) {\n\t\t\tfor (let key in this.compute) {\n\t\t\t\tthis.computed[key] = this.compute[key].call(\n\t\t\t\t\toptions.isMultiStore ? this.store : this.store.data\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeInstall()\n\t\tthis.install()\n\t\tthis.afterInstall()\n\n\t\tlet shadowRoot\n\t\tif (this.constructor.isLightDom) {\n\t\t\tshadowRoot = this\n\t\t} else {\n\n\t\t\tif (!this.shadowRoot) {\n\t\t\t\tshadowRoot = this.attachShadow({\n\t\t\t\t\tmode: 'open'\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tshadowRoot = this.shadowRoot\n\t\t\t\tlet fc\n\t\t\t\twhile ((fc = shadowRoot.firstChild)) {\n\t\t\t\t\tshadowRoot.removeChild(fc)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.constructor.css) {\n\t\t\t\tshadowRoot.appendChild(cssToDom(this.constructor.css))\n\t\t\t} else if (this.css) {\n\t\t\t\tshadowRoot.appendChild(\n\t\t\t\t\tcssToDom(typeof this.css === 'function' ? this.css() : this.css)\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeRender()\n\t\toptions.afterInstall && options.afterInstall(this)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.__hasChildren =\n\t\t\tObject.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\trendered.length > 0\n\n\t\tthis.rootNode = diff(null, rendered, null, this)\n\t\tthis.rendered()\n\n\t\tif (this.props.css) {\n\t\t\tthis._customStyleElement = cssToDom(this.props.css)\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tshadowRoot.appendChild(this._customStyleElement)\n\t\t}\n\n\t\tif (isArray(this.rootNode)) {\n\t\t\tthis.rootNode.forEach(function (item) {\n\t\t\t\tshadowRoot.appendChild(item)\n\t\t\t})\n\t\t} else {\n\t\t\tthis.rootNode && shadowRoot.appendChild(this.rootNode)\n\t\t}\n\t\tthis.installed()\n\t\tthis._isInstalled = true\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.uninstall()\n\t\tthis._isInstalled = false\n\t\tif (this.store) {\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tfor (let key in this.store) {\n\t\t\t\t\tconst current = this.store[key]\n\t\t\t\t\tremoveItem(this, current.instances)\n\t\t\t\t\tremoveItem(this, current.updateSelfInstances)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tremoveItem(this, this.store.instances)\n\t\t\t\tremoveItem(this, this.store.updateSelfInstances)\n\t\t\t}\n\t\t}\n\t}\n\n\tupdate(ignoreAttrs, updateSelf) {\n\t\tthis._willUpdate = true\n\t\tthis.beforeUpdate()\n\t\tthis.beforeRender()\n\t\t//fix null !== undefined\n\t\tif (this._customStyleContent != this.props.css) {\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tthis._customStyleElement.textContent = this._customStyleContent\n\t\t}\n\t\tthis.attrsToProps(ignoreAttrs)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.rendered()\n\t\tthis.__hasChildren =\n\t\t\tthis.__hasChildren ||\n\t\t\t(Object.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\t\trendered.length > 0)\n\n\t\tthis.rootNode = diff(\n\t\t\tthis.rootNode,\n\t\t\trendered,\n\t\t\tthis.shadowRoot,\n\t\t\tthis,\n\t\t\tupdateSelf\n\t\t)\n\t\tthis._willUpdate = false\n\t\tthis.updated()\n\t}\n\n\tforceUpdate() {\n\t\tthis.update(true)\n\t}\n\n\tupdateProps(obj) {\n\t\tObject.keys(obj).forEach(key => {\n\t\t\tthis.props[key] = obj[key]\n\t\t\tif (this.prevProps) {\n\t\t\t\tthis.prevProps[key] = obj[key]\n\t\t\t}\n\t\t})\n\t\tthis.forceUpdate()\n\t}\n\n\tupdateSelf(ignoreAttrs) {\n\t\tthis.update(ignoreAttrs, true)\n\t}\n\n\tremoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t\t//Avoid executing removeAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tsetAttribute(key, val) {\n\t\tif (val && typeof val === 'object') {\n\t\t\tsuper.setAttribute(key, JSON.stringify(val))\n\t\t} else {\n\t\t\tsuper.setAttribute(key, val)\n\t\t}\n\t\t//Avoid executing setAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tpureRemoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t}\n\n\tpureSetAttribute(key, val) {\n\t\tsuper.setAttribute(key, val)\n\t}\n\n\tattrsToProps(ignoreAttrs) {\n\t\tif (options.ignoreAttrs || ignoreAttrs) return\n\t\tconst ele = this\n\t\tele.props['css'] = ele.getAttribute('css')\n\t\tconst attrs = this.constructor.propTypes\n\t\tif (!attrs) return\n\t\tObject.keys(attrs).forEach(key => {\n\t\t\tconst type = attrs[key]\n\t\t\tconst val = ele.getAttribute(hyphenate(key))\n\t\t\tif (val !== null) {\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase String:\n\t\t\t\t\t\tele.props[key] = val\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Number:\n\t\t\t\t\t\tele.props[key] = Number(val)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Boolean:\n\t\t\t\t\t\tif (val === 'false' || val === '0') {\n\t\t\t\t\t\t\tele.props[key] = false\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Array:\n\t\t\t\t\tcase Object:\n\t\t\t\t\t\tif (val[0] === ':') {\n\t\t\t\t\t\t\tele.props[key] = getValByPath(val.substr(1), Omi.$)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = JSON.parse(\n\t\t\t\t\t\t\t\tval\n\t\t\t\t\t\t\t\t\t.replace(/(['\"])?([a-zA-Z0-9_-]+)(['\"])?:([^\\/])/g, '\"$2\":$4')\n\t\t\t\t\t\t\t\t\t.replace(/'([\\s\\S]*?)'/g, '\"$1\"')\n\t\t\t\t\t\t\t\t\t.replace(/,(\\s*})/g, '$1')\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tele.constructor.defaultProps &&\n\t\t\t\t\tele.constructor.defaultProps.hasOwnProperty(key)\n\t\t\t\t) {\n\t\t\t\t\tele.props[key] = ele.constructor.defaultProps[key]\n\t\t\t\t} else {\n\t\t\t\t\tele.props[key] = null\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tfire(name, data) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(name, {\n\t\t\t\tdetail: data\n\t\t\t})\n\t\t)\n\t}\n\n\tbeforeInstall() { }\n\n\tinstall() { }\n\n\tafterInstall() { }\n\n\tinstalled() { }\n\n\tuninstall() { }\n\n\tbeforeUpdate() { }\n\n\tupdated() { }\n\n\tbeforeRender() { }\n\n\trendered() { }\n\n\treceiveProps() { }\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\nimport { getUse } from './util'\nimport options from './options'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n if (store.data) {\n observeStore(store)\n } else {\n options.isMultiStore = true\n //Multi-store injection\n for (let key in store) {\n observeStore(store[key], key)\n }\n }\n parent.store = store\n }\n return diff(null, vnode, parent, false)\n}\n\nfunction observeStore(store, key) {\n store.instances = []\n store.updateSelfInstances = []\n extendStoreUpdate(store, key)\n\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n const patchs = {}\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n\n update(patchs, store)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n\n update(patchs, store)\n }\n })\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpdate(store, key) {\n store.update = function(patch) {\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updatePath &&\n instance._updatePath[key] &&\n needUpdate(patch, instance._updatePath[key])\n ) {\n if (instance.use) {\n getUse(\n store.data,\n (typeof instance.use === 'function'\n ? instance.use()\n : instance.use)[key],\n instance.using,\n key\n )\n }\n\n instance.update()\n }\n } else {\n if (instance._updatePath && needUpdate(patch, instance._updatePath)) {\n if (instance.use) {\n instance.using = getUse(\n store.data,\n typeof instance.use === 'function'\n ? instance.use()\n : instance.use\n )\n }\n\n instance.update()\n }\n }\n })\n\n this.updateSelfInstances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updateSelfPath &&\n instance._updateSelfPath[key] &&\n needUpdate(patch, instance._updateSelfPath[key])\n ) {\n if (instance.useSelf) {\n getUse(\n store.data,\n (typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf)[key],\n instance.usingSelf,\n key\n )\n }\n\n instance.updateSelf()\n }\n } else {\n if (\n instance._updateSelfPath &&\n needUpdate(patch, instance._updateSelfPath)\n ) {\n instance.usingSelf = getUse(\n store.data,\n typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf\n )\n instance.updateSelf()\n }\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nfunction compute(instance, isMultiStore) {\n if (instance.compute) {\n for (let ck in instance.compute) {\n instance.computed[ck] = instance.compute[ck].call(\n isMultiStore ? instance.store : instance.store.data\n )\n }\n }\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 {\n k: fixArrPath(path),\n v: current\n }\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 WeElement from './we-element'\nimport options from './options'\n\nconst storeHelpers = ['use', 'useSelf']\n\nexport function define(name, ctor, config) {\n if (options.mapping[name]) {\n return\n }\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n options.mapping[name] = ctor\n } else {\n if (typeof config === 'string') {\n config = { css: config }\n } else {\n config = config || {}\n }\n\n class Ele extends WeElement {\n static css = config.css\n\n static propTypes = config.propTypes\n\n static defaultProps = config.defaultProps\n\n static isLightDom = config.isLightDom\n\n compute = config.compute\n\n render() {\n return ctor.call(this, this)\n }\n }\n\n for (let key in config) {\n if (typeof config[key] === 'function') {\n Ele.prototype[key] = function () {\n return config[key].apply(this, arguments)\n }\n }\n }\n\n storeHelpers.forEach(func => {\n if (config[func] && config[func] !== 'function') {\n Ele.prototype[func] = function () {\n return config[func]\n }\n }\n })\n\n customElements.define(name, Ele)\n options.mapping[name] = Ele\n }\n}\n","import { define } from './define'\n\nexport function tag(name, pure) {\n return function(target) {\n target.pure = pure\n define(name, target)\n }\n}\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 The virtual DOM element to clone\n * @param {Object} props Attributes/props to add when cloning\n * @param {VNode} rest Any 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","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else if (p.shadowRoot && p.shadowRoot.host) {\n return p.shadowRoot.host\n } else {\n p = p.parentNode\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","/**\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.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 if (args.length > 0) {\n return { class: classNames.apply(null, args) }\n }\n}\n","export function o(obj) {\n return JSON.stringify(obj)\n}\n","var n=function(t,r,u,e){for(var p=1;p\"===t?(a(),u=1):u&&(\"=\"===t?(u=4,r=e,e=\"\"):\"/\"===t?(a(),3===u&&(s=s[0]),u=s,(s=s[0]).push(u,4),u=0):\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t?(a(),u=2):e+=t)}return a(),s},r=\"function\"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)),r}:function(n){for(var r=\"\",e=0;e1?r:r[0]}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { classNames, extractClass } from './class'\nimport { o } from './o'\nimport htm from 'htm'\nimport { extend, get, set, bind, unbind } from './extend'\nimport JSONProxy from './proxy'\nimport { Fragment } from './util'\n\nh.f = Fragment\n\nconst html = htm.bind(h)\n\nfunction createRef() {\n\treturn {}\n}\n\nconst $ = {}\nconst Component = WeElement\nconst defineElement = define\nconst elements = options.mapping\n\nconst omi = {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n\noptions.root.Omi = omi\noptions.root.omi = omi\noptions.root.Omi.version = '6.18.1'\n\nexport default omi\n\nexport {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n","\n\t\t\t\timport Omi from './omi';\n\t\t\t\tif (typeof module!='undefined') module.exports = Omi;\n\t\t\t\telse self.Omi = Omi;\n\t\t\t"],"names":["getGlobal","global","Math","Array","self","window","store","root","mapping","isMultiStore","ignoreAttrs","Reflect","undefined","customElements","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","constructor","prototype","Object","setPrototypeOf","cssToDom","css","node","document","createElement","textContent","camelCase","str","replace","$","$1","toUpperCase","Fragment","props","children","extend","obj","i","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","isArray","toString","call","getUse","data","paths","out","name","forEach","path","index","isPath","getTargetByPath","key","keys","tempPath","tempVal","args","push","apply","pathToArr","split","origin","arr","len","length","hyphenateRE","hyphenate","toLowerCase","getValByPath","prop","getPath","result","item","removeItem","splice","stack","h","nodeName","attributes","lastSimple","child","simple","arguments","pop","String","p","options","vnode","ATTR_KEY","IS_NON_DIMENSIONAL","isSameNodeType","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","extension","handler","set","get","eventProxy","e","_listeners","type","el","addEventListener","unbind","removeEventListener","createNode","isSvg","createElementNS","removeNode","parentNode","removeChild","setAccessor","old","component","className","style","cssText","test","innerHTML","__html","useCapture","nameLower","slice","touchStart","touchEnd","pureRemoveAttribute","removeAttribute","ns","removeAttributeNS","setAttributeNS","pureSetAttribute","setAttribute","event","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","diffLevel","isSvgMode","diff","dom","parent","updateSelf","ret","ownerSVGElement","styles","querySelectorAll","s","innerDiffNode","firstChild","insertBefore","appendChild","ele","idiff","one","recollectNodeTree","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","vnodeName","fc","vchildren","a","nextSibling","is","noSlot","dangerouslySetInnerHTML","diffAttributes","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","childrenLen","vlen","j","c","f","vchild","__key","trim","unmountOnly","removeChildren","lastChild","next","previousSibling","attrs","isWeElement","update","oldClone","receiveProps","assign","ccName","id","WeElement","defaultProps","elementId","computed","connectedCallback","host","attrsToProps","use","useSelf","_updatePath","using","storeName","instances","updateSelfInstances","usingSelf","_updateSelfPath","compute","beforeInstall","install","afterInstall","shadowRoot","isLightDom","attachShadow","mode","beforeRender","rendered","render","__hasChildren","rootNode","_customStyleElement","_customStyleContent","installed","_isInstalled","disconnectedCallback","uninstall","_willUpdate","beforeUpdate","updated","forceUpdate","updateProps","prevProps","val","JSON","stringify","getAttribute","propTypes","Number","Boolean","substr","Omi","parse","fire","JSONPatcherProxy","deepClone","escapePathComponent","indexOf","findObjectPath","instance","pathComponents","parentAndPath","parenthoodMap","unshift","join","setTrap","target","newValue","parentPath","destinationPropKey","proxifiedObjectsMap","has","newValueOriginalObject","originalObject","revokableInstance","isProxifyingTreeNow","inherited","_proxifyObjectTreeRecursively","operation","op","oldValue","delete","disableTrapsForProxy","isInteger","console","warn","reflectionResult","defaultCallback","deleteTrap","revokableProxyInstance","deleteProperty","resume","isRecording","patches","userCallback","isObserving","pause","showDetachedWarning","Map","cachedProxy","generateProxyAtPath","traps","receiver","revocableInstance","Proxy","revocable","trapsInstance","proxy","proxifyObjectTree","proxifiedObject","message","targetObject","propKey","observe","record","callback","Error","generate","revoke","disableTraps","querySelector","observeStore","extendStoreUpdate","JSONProxy","patch","patchs","kv","getArrayPatch","k","v","fixPath","needUpdate","onChange","ck","diffResult","updatePath","keyA","keyB","includePath","pathA","pathB","mpPath","isNaN","fixArrPath","storeHelpers","define","ctor","config","Ele","func","tag","pure","cloneElement","getHost","rpx","b","innerWidth","hasOwn","classNames","classes","arg","argType","inner","extractClass","class","o","html","htm","createRef","Component","defineElement","elements","omi","version","module","exports"],"mappings":";;;;;;;;;;;EAAA,SAASA,SAAT,GAAqB;EACnB,MACE,OAAOC,MAAP,KAAkB,QAAlB,IACA,CAACA,MADD,IAEAA,OAAOC,IAAP,KAAgBA,IAFhB,IAGAD,OAAOE,KAAP,KAAiBA,KAJnB,EAKE;EACA,WACEC,QACAC,MADA,IAEAJ,MAFA,IAGC,YAAY;EACX,aAAO,IAAP;EACD,KAFD,EAJF;EAQD;EACD,SAAOA,MAAP;EACD;;EAED;;;;AAIA,gBAAe;EACbK,SAAO,IADM;EAEbC,QAAMP,WAFO;EAGbQ,WAAS,EAHI;EAIbC,gBAAc,KAJD;EAKb;EACA;EACAC,eAAa;EAPA,CAAf;;ECvBA;;;;;;;;;EAgBC,CAAC,YAAW;EACX;EACE;EACA;EACAL,SAAOM,OAAP,KAAmBC,SAAnB,IACAP,OAAOQ,cAAP,KAA0BD,SAD1B;EAEA;EACA;EACAP,SAAOQ,cAAP,CAAsBC,cAAtB,CAAqC,2BAArC,CAPF,EAQE;EACA;EACD;EACD,MAAMC,qBAAqBC,WAA3B;EACAX,SAAOW,WAAP,GAAqB,SAASA,WAAT,GAAuB;EAC1C,WA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WA,GAAX;;"} \ No newline at end of file diff --git a/packages/omi/dist/omi.esm.js b/packages/omi/dist/omi.esm.js index d9f9ca805..1f194c9ca 100644 --- a/packages/omi/dist/omi.esm.js +++ b/packages/omi/dist/omi.esm.js @@ -1,5 +1,5 @@ /** - * Omi v6.18.0 http://omijs.org + * Omi v6.18.1 http://omijs.org * Front End Cross-Frameworks Framework. * By dntzhang https://github.com/dntzhang * Github: https://github.com/Tencent/omi @@ -1679,6 +1679,7 @@ function define(name, ctor, config) { Ele.css = config.css; Ele.propTypes = config.propTypes; Ele.defaultProps = config.defaultProps; + Ele.isLightDom = config.isLightDom; var _loop = function _loop(key) { if (typeof config[key] === 'function') { @@ -1800,7 +1801,7 @@ function o(obj) { return JSON.stringify(obj); } -var n=function(t,r,u,e){for(var p=1;p=5&&((e||!n&&5===u)&&(s.push(e,u,r), u=6), n&&(s.push(n,u,r), u=6)), e="";},a=0;a"===t?(u=1, e=""):e=t+e[0]:p?t===p?p="":e+=t:'"'===t||"'"===t?p=t:">"===t?(h(), u=1):u&&("="===t?(u=5, r=e, e=""):"/"===t&&(u<5||">"===n[a][f+1])?(h(), 3===u&&(s=s[0]), u=s, (s=s[0]).push(u,2), u=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(h(), u=2):e+=t), 3===u&&"!--"===e&&(u=4, s=s[0]);}return h(), s},r="function"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)), r}:function(n){for(var r="",e=0;e1?r:r[0]} +var n=function(t,r,u,e){for(var p=1;p"===t?(a(), u=1):u&&("="===t?(u=4, r=e, e=""):"/"===t?(a(), 3===u&&(s=s[0]), u=s, (s=s[0]).push(u,4), u=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(), u=2):e+=t);}return a(), s},r="function"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)), r}:function(n){for(var r="",e=0;e1?r:r[0]} h.f = Fragment; @@ -1846,7 +1847,7 @@ var omi = { options.root.Omi = omi; options.root.omi = omi; -options.root.Omi.version = '6.18.0'; +options.root.Omi.version = '6.18.1'; export default omi; export { tag, WeElement, Component, render, h, h as createElement, options, define, cloneElement, getHost, rpx, defineElement, classNames, extractClass, createRef, html, htm, o, elements, $, extend$1 as extend, get, set, bind, unbind, JSONPatcherProxy as JSONProxy }; diff --git a/packages/omi/dist/omi.esm.js.map b/packages/omi/dist/omi.esm.js.map index f71db90cb..a0a1742f4 100644 --- a/packages/omi/dist/omi.esm.js.map +++ b/packages/omi/dist/omi.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"omi.esm.js","sources":["../src/options.js","../src/util.js","../src/h.js","../src/constants.js","../src/vdom/index.js","../src/extend.js","../src/dom/index.js","../src/vdom/diff.js","../src/we-element.js","../src/proxy.js","../src/render.js","../src/define.js","../src/tag.js","../src/clone-element.js","../src/get-host.js","../src/rpx.js","../src/class.js","../src/o.js","../node_modules/htm/dist/htm.module.js","../src/omi.js"],"sourcesContent":["function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function () {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n * @public\n * @namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal(),\n mapping: {},\n isMultiStore: false,\n //when set true, using props of hypescript, don't use getAttribute\n //if you render all the node tree by omi self, set it\n ignoreAttrs: false\n}\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This shim allows elements written in, or compiled to, ES5 to work on native\n * implementations of Custom Elements v1. It sets new.target to the value of\n * this.constructor so that the native HTMLElement constructor can access the\n * current under-construction element's definition.\n */\n;(function() {\n if (\n // No Reflect, no classes, no need for shim because native custom elements\n // require ES2015 classes or Reflect.\n window.Reflect === undefined ||\n window.customElements === undefined ||\n // The webcomponentsjs custom elements polyfill doesn't require\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = HTMLElement\n window.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\nexport function cssToDom(css) {\n const node = document.createElement('style')\n node.textContent = css\n return node\n}\n\nexport function camelCase(str) {\n return str.replace(/-(\\w)/g, ($, $1) => {\n return $1.toUpperCase()\n })\n}\n\nexport function Fragment(props) {\n return props.children\n}\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 != null) {\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 * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\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 getUse(data, paths, out, name) {\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 if (out) out[name] = obj\n return obj\n}\n\nexport function pathToArr(path) {\n if (typeof path !== 'string' || !path) return []\n // return path.split(/\\.|\\[|\\]/).filter(name => !!name)\n return path\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n}\n\nexport function getTargetByPath(origin, path) {\n const arr = pathToArr(path)\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}\n\nconst hyphenateRE = /\\B([A-Z])/g\nexport function hyphenate(str) {\n return str.replace(hyphenateRE, '-$1').toLowerCase()\n}\n\nexport function getValByPath(path, current) {\n const arr = pathToArr(path)\n arr.forEach(prop => {\n current = current[prop]\n })\n return current\n}\n\nexport function getPath(obj, out, name) {\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 if (out) out[name] = result\n return result\n}\n\nexport function removeItem(item, arr) {\n if (!arr) return\n for (let i = 0, len = arr.length; i < len; i++) {\n if (arr[i] === item) {\n arr.splice(i, 1)\n break\n }\n }\n}\n","import options from './options'\nimport { Fragment } from './util'\n\nconst stack = []\n\nexport function h(nodeName, attributes) {\n let 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.length === 0) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n if (nodeName === Fragment) {\n return children\n }\n\n const p = {\n nodeName,\n children,\n attributes: attributes == null ? undefined : attributes,\n key: attributes == null ? undefined : attributes.key\n }\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","// 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 = 'prevProps'\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 { extend } from '../util'\nimport options from '../options'\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node DOM Node to compare\n * @param {VNode} vnode Virtual DOM node to compare\n * @param {boolean} [hydrating=false] If 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 return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n } else if (typeof vnode.nodeName === 'function') {\n return options.mapping[node.nodeName.toLowerCase()] === 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 A DOM Element to inspect the name of.\n * @param {String} nodeName Unnormalized 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 { pathToArr } from './util'\n\nexport const extension = {}\n\nexport function extend(name, handler) {\n extension['o-' + name] = handler\n}\n\nexport function set(origin, path, value) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n if (i === len - 1) {\n current[arr[i]] = value\n } else {\n current = current[arr[i]]\n }\n }\n}\n\nexport function get(origin, path) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n current = current[arr[i]]\n }\n\n return current\n}\n\nfunction eventProxy(e) {\n return this._listeners[e.type](e)\n}\n\nexport function bind(el, type, handler) {\n el._listeners = el._listeners || {}\n el._listeners[type] = handler\n el.addEventListener(type, eventProxy)\n}\n\nexport function unbind(el, type) {\n el.removeEventListener(type, eventProxy)\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\nimport { extension } from '../extend'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg, component) {\n if (name === 'className') name = 'class'\n\n if (name[0] == 'o' && name[1] == '-') {\n if (extension[name]) {\n extension[name](node, value, component)\n }\n } else 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 (!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 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 let nameLower = name.toLowerCase()\n name = (nameLower in node ? nameLower : name).slice(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 (node.nodeName === 'INPUT' && name === 'value') {\n node[name] = value == null ? '' : value\n } else if (\n name !== 'list' &&\n name !== 'type' &&\n name !== 'css' &&\n !isSvg &&\n name in node &&\n value !== ''\n ) {\n //value !== '' fix for selected, disabled, checked with pure element\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\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\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : 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 {\n node.pureSetAttribute\n ? node.pureSetAttribute(name, value)\n : node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @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}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { camelCase, isArray, Fragment } from '../util'\nimport { removeNode } from '../dom/index'\nimport options from '../options'\n\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/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n * @param {Element} [dom=null] A DOM node to mutate into the shape of the `vnode`\n * @param {VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure\n * @returns {Element} dom The created/mutated element\n * @private\n */\nexport function diff(dom, vnode, parent, component, updateSelf) {\n //first render return undefined\n if (!dom && !vnode) return\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\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 if (vnode && vnode.nodeName === Fragment) {\n vnode = vnode.children\n }\n if (isArray(vnode)) {\n if (parent) {\n const styles = parent.querySelectorAll('style')\n styles.forEach(s => {\n parent.removeChild(s)\n })\n innerDiffNode(parent, vnode, hydrating, component, updateSelf)\n\n for (let i = styles.length - 1; i >= 0; i--) {\n parent.firstChild\n ? parent.insertBefore(styles[i], parent.firstChild)\n : parent.appendChild(style[i])\n }\n } else {\n ret = []\n vnode.forEach((item, index) => {\n let ele = idiff(index === 0 ? dom : null, item, component, updateSelf)\n ret.push(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n dom.forEach((one, index) => {\n if (index === 0) {\n ret = idiff(one, vnode, component, updateSelf)\n } else {\n recollectNodeTree(one, false)\n }\n })\n } else {\n ret = idiff(dom, vnode, component, updateSelf)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\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 }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, component, updateSelf) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\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 // 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 || component)\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 out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n if (typeof vnodeName === 'function') {\n for (let key in options.mapping) {\n if (options.mapping[key] === vnodeName) {\n vnodeName = key\n vnode.nodeName = key\n break\n }\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 if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n hydrating || props.dangerouslySetInnerHTML != null,\n component,\n updateSelf\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, component, updateSelf)\n if (out.props) {\n out.props.children = vnode.children\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 * @param {Element} dom Element whose children should be compared & mutated\n * @param {Array} vchildren Array of VNodes to compare to `dom.childNodes`\n * @param {Boolean} isHydrating If `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, isHydrating, component, updateSelf) {\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, component, updateSelf)\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 * @param {Node} node DOM node to start unmount/removal from\n * @param {Boolean} [unmountOnly=false] If `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\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 && node[ATTR_KEY].ref) {\n if (typeof node[ATTR_KEY].ref === 'function') {\n node[ATTR_KEY].ref(null)\n } else if (node[ATTR_KEY].ref.current) {\n node[ATTR_KEY].ref.current = null\n }\n }\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n * - we use .lastChild here because it causes less reflow than .firstChild\n * - 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 * @param {Element} dom Element with attributes to diff `attrs` against\n * @param {Object} attrs The desired end-state key-value attribute pairs\n * @param {Object} old Current/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, component, updateSelf) {\n let name\n //let update = false\n let isWeElement = dom.update\n let oldClone\n if (dom.receiveProps) {\n oldClone = Object.assign({}, old)\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(\n dom,\n name,\n old[name],\n (old[name] = undefined),\n isSvgMode,\n component\n )\n if (isWeElement) {\n delete dom.props[name]\n //update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (isWeElement && typeof attrs[name] === 'object' && name !== 'ref') {\n if (name === 'style') {\n setAccessor(\n dom,\n name,\n old[name],\n (old[name] = attrs[name]),\n isSvgMode,\n component\n )\n }\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else if (\n name !== 'children' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], attrs[name], isSvgMode, component)\n if (isWeElement) {\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else {\n old[name] = attrs[name]\n }\n }\n }\n\n if (isWeElement && !updateSelf && dom.parentNode) {\n //__hasChildren is not accuracy when it was empty at first, so add dom.children.length > 0 condition\n //if (update || dom.__hasChildren || dom.children.length > 0 || (dom.store && !dom.store.data)) {\n if (dom.receiveProps(dom.props, oldClone) !== false) {\n dom.update()\n }\n //}\n }\n}\n","import {\n\tcssToDom,\n\tisArray,\n\tgetUse,\n\thyphenate,\n\tgetValByPath,\n\tremoveItem\n} from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { getPath } from './util'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n\tstatic is = 'WeElement'\n\n\tconstructor() {\n\t\tsuper()\n\t\tthis.props = Object.assign({}, this.constructor.defaultProps)\n\t\tthis.elementId = id++\n\t\tthis.computed = {}\n\t}\n\n\tconnectedCallback() {\n\t\tlet p = this.parentNode\n\t\twhile (p && !this.store) {\n\t\t\tthis.store = p.store\n\t\t\tp = p.parentNode || p.host\n\t\t}\n\n\t\tthis.attrsToProps()\n\n\t\tif (this.props.use) {\n\t\t\tthis.use = this.props.use\n\t\t}\n\n\t\tif (this.props.useSelf) {\n\t\t\tthis.use = this.props.useSelf\n\t\t}\n\n\t\tif (this.use) {\n\t\t\tconst use = typeof this.use === 'function' ? this.use() : this.use\n\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\t_updatePath[storeName] = {}\n\t\t\t\t\tusing[storeName] = {}\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].instances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.using = using\n\t\t\t\tthis._updatePath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updatePath = getPath(use)\n\t\t\t\tthis.using = getUse(this.store.data, use)\n\t\t\t\tthis.store.instances.push(this)\n\t\t\t}\n\t\t}\n\t\tif (this.useSelf) {\n\t\t\tconst use =\n\t\t\t\ttypeof this.useSelf === 'function' ? this.useSelf() : this.useSelf\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].updateSelfInstances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.usingSelf = using\n\t\t\t\tthis._updateSelfPath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updateSelfPath = getPath(use)\n\t\t\t\tthis.usingSelf = getUse(this.store.data, use)\n\t\t\t\tthis.store.updateSelfInstances.push(this)\n\t\t\t}\n\t\t}\n\n\t\tif (this.compute) {\n\t\t\tfor (let key in this.compute) {\n\t\t\t\tthis.computed[key] = this.compute[key].call(\n\t\t\t\t\toptions.isMultiStore ? this.store : this.store.data\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeInstall()\n\t\tthis.install()\n\t\tthis.afterInstall()\n\n\t\tlet shadowRoot\n\t\tif (this.constructor.isLightDom) {\n\t\t\tshadowRoot = this\n\t\t} else {\n\n\t\t\tif (!this.shadowRoot) {\n\t\t\t\tshadowRoot = this.attachShadow({\n\t\t\t\t\tmode: 'open'\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tshadowRoot = this.shadowRoot\n\t\t\t\tlet fc\n\t\t\t\twhile ((fc = shadowRoot.firstChild)) {\n\t\t\t\t\tshadowRoot.removeChild(fc)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.constructor.css) {\n\t\t\t\tshadowRoot.appendChild(cssToDom(this.constructor.css))\n\t\t\t} else if (this.css) {\n\t\t\t\tshadowRoot.appendChild(\n\t\t\t\t\tcssToDom(typeof this.css === 'function' ? this.css() : this.css)\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeRender()\n\t\toptions.afterInstall && options.afterInstall(this)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.__hasChildren =\n\t\t\tObject.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\trendered.length > 0\n\n\t\tthis.rootNode = diff(null, rendered, null, this)\n\t\tthis.rendered()\n\n\t\tif (this.props.css) {\n\t\t\tthis._customStyleElement = cssToDom(this.props.css)\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tshadowRoot.appendChild(this._customStyleElement)\n\t\t}\n\n\t\tif (isArray(this.rootNode)) {\n\t\t\tthis.rootNode.forEach(function (item) {\n\t\t\t\tshadowRoot.appendChild(item)\n\t\t\t})\n\t\t} else {\n\t\t\tthis.rootNode && shadowRoot.appendChild(this.rootNode)\n\t\t}\n\t\tthis.installed()\n\t\tthis._isInstalled = true\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.uninstall()\n\t\tthis._isInstalled = false\n\t\tif (this.store) {\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tfor (let key in this.store) {\n\t\t\t\t\tconst current = this.store[key]\n\t\t\t\t\tremoveItem(this, current.instances)\n\t\t\t\t\tremoveItem(this, current.updateSelfInstances)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tremoveItem(this, this.store.instances)\n\t\t\t\tremoveItem(this, this.store.updateSelfInstances)\n\t\t\t}\n\t\t}\n\t}\n\n\tupdate(ignoreAttrs, updateSelf) {\n\t\tthis._willUpdate = true\n\t\tthis.beforeUpdate()\n\t\tthis.beforeRender()\n\t\t//fix null !== undefined\n\t\tif (this._customStyleContent != this.props.css) {\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tthis._customStyleElement.textContent = this._customStyleContent\n\t\t}\n\t\tthis.attrsToProps(ignoreAttrs)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.rendered()\n\t\tthis.__hasChildren =\n\t\t\tthis.__hasChildren ||\n\t\t\t(Object.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\t\trendered.length > 0)\n\n\t\tthis.rootNode = diff(\n\t\t\tthis.rootNode,\n\t\t\trendered,\n\t\t\tthis.shadowRoot,\n\t\t\tthis,\n\t\t\tupdateSelf\n\t\t)\n\t\tthis._willUpdate = false\n\t\tthis.updated()\n\t}\n\n\tforceUpdate() {\n\t\tthis.update(true)\n\t}\n\n\tupdateProps(obj) {\n\t\tObject.keys(obj).forEach(key => {\n\t\t\tthis.props[key] = obj[key]\n\t\t\tif (this.prevProps) {\n\t\t\t\tthis.prevProps[key] = obj[key]\n\t\t\t}\n\t\t})\n\t\tthis.forceUpdate()\n\t}\n\n\tupdateSelf(ignoreAttrs) {\n\t\tthis.update(ignoreAttrs, true)\n\t}\n\n\tremoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t\t//Avoid executing removeAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tsetAttribute(key, val) {\n\t\tif (val && typeof val === 'object') {\n\t\t\tsuper.setAttribute(key, JSON.stringify(val))\n\t\t} else {\n\t\t\tsuper.setAttribute(key, val)\n\t\t}\n\t\t//Avoid executing setAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tpureRemoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t}\n\n\tpureSetAttribute(key, val) {\n\t\tsuper.setAttribute(key, val)\n\t}\n\n\tattrsToProps(ignoreAttrs) {\n\t\tif (options.ignoreAttrs || ignoreAttrs) return\n\t\tconst ele = this\n\t\tele.props['css'] = ele.getAttribute('css')\n\t\tconst attrs = this.constructor.propTypes\n\t\tif (!attrs) return\n\t\tObject.keys(attrs).forEach(key => {\n\t\t\tconst type = attrs[key]\n\t\t\tconst val = ele.getAttribute(hyphenate(key))\n\t\t\tif (val !== null) {\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase String:\n\t\t\t\t\t\tele.props[key] = val\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Number:\n\t\t\t\t\t\tele.props[key] = Number(val)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Boolean:\n\t\t\t\t\t\tif (val === 'false' || val === '0') {\n\t\t\t\t\t\t\tele.props[key] = false\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Array:\n\t\t\t\t\tcase Object:\n\t\t\t\t\t\tif (val[0] === ':') {\n\t\t\t\t\t\t\tele.props[key] = getValByPath(val.substr(1), Omi.$)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = JSON.parse(\n\t\t\t\t\t\t\t\tval\n\t\t\t\t\t\t\t\t\t.replace(/(['\"])?([a-zA-Z0-9_-]+)(['\"])?:([^\\/])/g, '\"$2\":$4')\n\t\t\t\t\t\t\t\t\t.replace(/'([\\s\\S]*?)'/g, '\"$1\"')\n\t\t\t\t\t\t\t\t\t.replace(/,(\\s*})/g, '$1')\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tele.constructor.defaultProps &&\n\t\t\t\t\tele.constructor.defaultProps.hasOwnProperty(key)\n\t\t\t\t) {\n\t\t\t\t\tele.props[key] = ele.constructor.defaultProps[key]\n\t\t\t\t} else {\n\t\t\t\t\tele.props[key] = null\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tfire(name, data) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(name, {\n\t\t\t\tdetail: data\n\t\t\t})\n\t\t)\n\t}\n\n\tbeforeInstall() { }\n\n\tinstall() { }\n\n\tafterInstall() { }\n\n\tinstalled() { }\n\n\tuninstall() { }\n\n\tbeforeUpdate() { }\n\n\tupdated() { }\n\n\tbeforeRender() { }\n\n\trendered() { }\n\n\treceiveProps() { }\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\nimport { getUse } from './util'\nimport options from './options'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n if (store.data) {\n observeStore(store)\n } else {\n options.isMultiStore = true\n //Multi-store injection\n for (let key in store) {\n observeStore(store[key], key)\n }\n }\n parent.store = store\n }\n return diff(null, vnode, parent, false)\n}\n\nfunction observeStore(store, key) {\n store.instances = []\n store.updateSelfInstances = []\n extendStoreUpdate(store, key)\n\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n const patchs = {}\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n\n update(patchs, store)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n\n update(patchs, store)\n }\n })\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpdate(store, key) {\n store.update = function(patch) {\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updatePath &&\n instance._updatePath[key] &&\n needUpdate(patch, instance._updatePath[key])\n ) {\n if (instance.use) {\n getUse(\n store.data,\n (typeof instance.use === 'function'\n ? instance.use()\n : instance.use)[key],\n instance.using,\n key\n )\n }\n\n instance.update()\n }\n } else {\n if (instance._updatePath && needUpdate(patch, instance._updatePath)) {\n if (instance.use) {\n instance.using = getUse(\n store.data,\n typeof instance.use === 'function'\n ? instance.use()\n : instance.use\n )\n }\n\n instance.update()\n }\n }\n })\n\n this.updateSelfInstances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updateSelfPath &&\n instance._updateSelfPath[key] &&\n needUpdate(patch, instance._updateSelfPath[key])\n ) {\n if (instance.useSelf) {\n getUse(\n store.data,\n (typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf)[key],\n instance.usingSelf,\n key\n )\n }\n\n instance.updateSelf()\n }\n } else {\n if (\n instance._updateSelfPath &&\n needUpdate(patch, instance._updateSelfPath)\n ) {\n instance.usingSelf = getUse(\n store.data,\n typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf\n )\n instance.updateSelf()\n }\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nfunction compute(instance, isMultiStore) {\n if (instance.compute) {\n for (let ck in instance.compute) {\n instance.computed[ck] = instance.compute[ck].call(\n isMultiStore ? instance.store : instance.store.data\n )\n }\n }\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 {\n k: fixArrPath(path),\n v: current\n }\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 WeElement from './we-element'\nimport options from './options'\n\nconst storeHelpers = ['use', 'useSelf']\n\nexport function define(name, ctor, config) {\n if (options.mapping[name]) {\n return\n }\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n options.mapping[name] = ctor\n } else {\n if (typeof config === 'string') {\n config = { css: config }\n } else {\n config = config || {}\n }\n\n class Ele extends WeElement {\n static css = config.css\n\n static propTypes = config.propTypes\n\n static defaultProps = config.defaultProps\n\n compute = config.compute\n\n render() {\n return ctor.call(this, this)\n }\n }\n\n for (let key in config) {\n if (typeof config[key] === 'function') {\n Ele.prototype[key] = function() {\n return config[key].apply(this, arguments)\n }\n }\n }\n\n storeHelpers.forEach(func => {\n if (config[func] && config[func] !== 'function') {\n Ele.prototype[func] = function() {\n return config[func]\n }\n }\n })\n\n customElements.define(name, Ele)\n options.mapping[name] = Ele\n }\n}\n","import { define } from './define'\n\nexport function tag(name, pure) {\n return function(target) {\n target.pure = pure\n define(name, target)\n }\n}\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 The virtual DOM element to clone\n * @param {Object} props Attributes/props to add when cloning\n * @param {VNode} rest Any 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","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else if (p.shadowRoot && p.shadowRoot.host) {\n return p.shadowRoot.host\n } else {\n p = p.parentNode\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","/**\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.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 if (args.length > 0) {\n return { class: classNames.apply(null, args) }\n }\n}\n","export function o(obj) {\n return JSON.stringify(obj)\n}\n","var n=function(t,r,u,e){for(var p=1;p=5&&((e||!n&&5===u)&&(s.push(e,u,r),u=6),n&&(s.push(n,u,r),u=6)),e=\"\"},a=0;a\"===t?(u=1,e=\"\"):e=t+e[0]:p?t===p?p=\"\":e+=t:'\"'===t||\"'\"===t?p=t:\">\"===t?(h(),u=1):u&&(\"=\"===t?(u=5,r=e,e=\"\"):\"/\"===t&&(u<5||\">\"===n[a][f+1])?(h(),3===u&&(s=s[0]),u=s,(s=s[0]).push(u,2),u=0):\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t?(h(),u=2):e+=t),3===u&&\"!--\"===e&&(u=4,s=s[0])}return h(),s},r=\"function\"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)),r}:function(n){for(var r=\"\",e=0;e1?r:r[0]}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { classNames, extractClass } from './class'\nimport { o } from './o'\nimport htm from 'htm'\nimport { extend, get, set, bind, unbind } from './extend'\nimport JSONProxy from './proxy'\nimport { Fragment } from './util'\n\nh.f = Fragment\n\nconst html = htm.bind(h)\n\nfunction createRef() {\n\treturn {}\n}\n\nconst $ = {}\nconst Component = WeElement\nconst defineElement = define\nconst elements = options.mapping\n\nconst omi = {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n\noptions.root.Omi = omi\noptions.root.omi = omi\noptions.root.Omi.version = '6.18.0'\n\nexport default omi\n\nexport {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n"],"names":["getGlobal","global","Math","Array","self","window","Reflect","undefined","customElements","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","constructor","prototype","setPrototypeOf","cssToDom","css","node","document","createElement","textContent","camelCase","str","replace","$","$1","toUpperCase","Fragment","props","children","extend","obj","i","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","isArray","Object","toString","call","getUse","data","paths","out","name","forEach","path","index","isPath","getTargetByPath","key","keys","tempPath","tempVal","args","push","apply","pathToArr","split","origin","arr","len","length","hyphenateRE","hyphenate","toLowerCase","getValByPath","prop","getPath","result","item","removeItem","splice","stack","h","nodeName","attributes","lastSimple","child","simple","arguments","pop","String","p","options","vnode","ATTR_KEY","IS_NON_DIMENSIONAL","isSameNodeType","hydrating","splitText","_componentConstructor","isNamedNode","mapping","normalizedNodeName","extension","handler","set","get","eventProxy","e","_listeners","type","el","addEventListener","unbind","removeEventListener","createNode","isSvg","createElementNS","removeNode","parentNode","removeChild","setAccessor","old","component","className","style","cssText","test","innerHTML","__html","useCapture","nameLower","slice","touchStart","touchEnd","pureRemoveAttribute","removeAttribute","ns","removeAttributeNS","setAttributeNS","pureSetAttribute","setAttribute","event","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","diffLevel","isSvgMode","diff","dom","parent","updateSelf","ret","ownerSVGElement","styles","querySelectorAll","s","firstChild","insertBefore","appendChild","ele","idiff","one","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","vnodeName","fc","vchildren","a","nextSibling","is","noSlot","dangerouslySetInnerHTML","innerDiffNode","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","childrenLen","vlen","j","c","f","vchild","__key","trim","recollectNodeTree","unmountOnly","removeChildren","lastChild","next","previousSibling","diffAttributes","attrs","isWeElement","update","oldClone","receiveProps","assign","ccName","id","WeElement","defaultProps","elementId","computed","connectedCallback","store","host","attrsToProps","use","useSelf","isMultiStore","_updatePath","using","storeName","instances","updateSelfInstances","usingSelf","_updateSelfPath","compute","beforeInstall","install","afterInstall","shadowRoot","isLightDom","attachShadow","beforeRender","rendered","render","__hasChildren","rootNode","_customStyleElement","_customStyleContent","installed","_isInstalled","disconnectedCallback","uninstall","ignoreAttrs","_willUpdate","beforeUpdate","updated","forceUpdate","updateProps","prevProps","val","JSON","stringify","getAttribute","propTypes","Number","Boolean","substr","Omi","parse","fire","JSONPatcherProxy","deepClone","escapePathComponent","indexOf","findObjectPath","instance","pathComponents","parentAndPath","parenthoodMap","unshift","join","setTrap","target","newValue","parentPath","destinationPropKey","proxifiedObjectsMap","has","newValueOriginalObject","originalObject","revokableInstance","isProxifyingTreeNow","inherited","_proxifyObjectTreeRecursively","operation","op","oldValue","delete","disableTrapsForProxy","isInteger","warn","reflectionResult","defaultCallback","deleteTrap","revokableProxyInstance","deleteProperty","resume","isRecording","patches","userCallback","isObserving","pause","root","showDetachedWarning","Map","cachedProxy","generateProxyAtPath","traps","receiver","revocableInstance","Proxy","revocable","trapsInstance","proxy","proxifyObjectTree","proxifiedObject","message","targetObject","propKey","observe","record","callback","Error","generate","revoke","disableTraps","querySelector","observeStore","JSONProxy","patch","patchs","kv","getArrayPatch","k","v","fixPath","extendStoreUpdate","needUpdate","onChange","ck","diffResult","updatePath","keyA","keyB","includePath","pathA","pathB","mpPath","isNaN","fixArrPath","storeHelpers","define","ctor","config","Ele","func","tag","pure","cloneElement","getHost","rpx","b","innerWidth","hasOwn","classNames","classes","arg","argType","inner","extractClass","class","o","html","htm","createRef","Component","defineElement","elements","omi","version"],"mappings":";;;;;;;;AAAA,SAASA,SAAT,GAAqB;MAEjB,OAAOC,MAAP,KAAkB,QAAlB,IACA,CAACA,MADD,IAEAA,OAAOC,IAAP,KAAgBA,IAFhB,IAGAD,OAAOE,KAAP,KAAiBA,KAJnB,EAKE;WAEEC,QACAC,MADA,IAEAJ,MAFA,IAGC,YAAY;aACJ,IAAP;KADF,EAJF;;SASKA,MAAP;;;;;;;AAOF,cAAe;SACN,IADM;QAEPD,WAFO;WAGJ,EAHI;gBAIC,KAJD;;;eAOA;CAPf;;ACvBA;;;;;;;;;CAgBE,YAAW;;;;SAIFM,OAAP,KAAmBC,SAAnB,IACAF,OAAOG,cAAP,KAA0BD,SAD1B;;;SAIOC,cAAP,CAAsBC,cAAtB,CAAqC,2BAArC,CAPF,EAQE;;;MAGIC,qBAAqBC,WAA3B;SACOA,WAAP,GAAqB,SAASA,WAAT,GAAuB;WACnCL,QAAQM,SAAR,CAAkBF,kBAAlB,EAAsC,EAAtC,EAA0C,KAAKG,WAA/C,CAAP;GADF;cAGYC,SAA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;"} \ No newline at end of file +{"version":3,"file":"omi.esm.js","sources":["../src/options.js","../src/util.js","../src/h.js","../src/constants.js","../src/vdom/index.js","../src/extend.js","../src/dom/index.js","../src/vdom/diff.js","../src/we-element.js","../src/proxy.js","../src/render.js","../src/define.js","../src/tag.js","../src/clone-element.js","../src/get-host.js","../src/rpx.js","../src/class.js","../src/o.js","../node_modules/htm/dist/htm.mjs","../src/omi.js"],"sourcesContent":["function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function () {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n * @public\n * @namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal(),\n mapping: {},\n isMultiStore: false,\n //when set true, using props of hypescript, don't use getAttribute\n //if you render all the node tree by omi self, set it\n ignoreAttrs: false\n}\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This shim allows elements written in, or compiled to, ES5 to work on native\n * implementations of Custom Elements v1. It sets new.target to the value of\n * this.constructor so that the native HTMLElement constructor can access the\n * current under-construction element's definition.\n */\n;(function() {\n if (\n // No Reflect, no classes, no need for shim because native custom elements\n // require ES2015 classes or Reflect.\n window.Reflect === undefined ||\n window.customElements === undefined ||\n // The webcomponentsjs custom elements polyfill doesn't require\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = HTMLElement\n window.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\nexport function cssToDom(css) {\n const node = document.createElement('style')\n node.textContent = css\n return node\n}\n\nexport function camelCase(str) {\n return str.replace(/-(\\w)/g, ($, $1) => {\n return $1.toUpperCase()\n })\n}\n\nexport function Fragment(props) {\n return props.children\n}\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 != null) {\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 * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\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 getUse(data, paths, out, name) {\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 if (out) out[name] = obj\n return obj\n}\n\nexport function pathToArr(path) {\n if (typeof path !== 'string' || !path) return []\n // return path.split(/\\.|\\[|\\]/).filter(name => !!name)\n return path\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n}\n\nexport function getTargetByPath(origin, path) {\n const arr = pathToArr(path)\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}\n\nconst hyphenateRE = /\\B([A-Z])/g\nexport function hyphenate(str) {\n return str.replace(hyphenateRE, '-$1').toLowerCase()\n}\n\nexport function getValByPath(path, current) {\n const arr = pathToArr(path)\n arr.forEach(prop => {\n current = current[prop]\n })\n return current\n}\n\nexport function getPath(obj, out, name) {\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 if (out) out[name] = result\n return result\n}\n\nexport function removeItem(item, arr) {\n if (!arr) return\n for (let i = 0, len = arr.length; i < len; i++) {\n if (arr[i] === item) {\n arr.splice(i, 1)\n break\n }\n }\n}\n","import options from './options'\nimport { Fragment } from './util'\n\nconst stack = []\n\nexport function h(nodeName, attributes) {\n let 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.length === 0) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n if (nodeName === Fragment) {\n return children\n }\n\n const p = {\n nodeName,\n children,\n attributes: attributes == null ? undefined : attributes,\n key: attributes == null ? undefined : attributes.key\n }\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","// 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 = 'prevProps'\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 { extend } from '../util'\nimport options from '../options'\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node DOM Node to compare\n * @param {VNode} vnode Virtual DOM node to compare\n * @param {boolean} [hydrating=false] If 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 return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n } else if (typeof vnode.nodeName === 'function') {\n return options.mapping[node.nodeName.toLowerCase()] === 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 A DOM Element to inspect the name of.\n * @param {String} nodeName Unnormalized 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 { pathToArr } from './util'\n\nexport const extension = {}\n\nexport function extend(name, handler) {\n extension['o-' + name] = handler\n}\n\nexport function set(origin, path, value) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n if (i === len - 1) {\n current[arr[i]] = value\n } else {\n current = current[arr[i]]\n }\n }\n}\n\nexport function get(origin, path) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n current = current[arr[i]]\n }\n\n return current\n}\n\nfunction eventProxy(e) {\n return this._listeners[e.type](e)\n}\n\nexport function bind(el, type, handler) {\n el._listeners = el._listeners || {}\n el._listeners[type] = handler\n el.addEventListener(type, eventProxy)\n}\n\nexport function unbind(el, type) {\n el.removeEventListener(type, eventProxy)\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\nimport { extension } from '../extend'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg, component) {\n if (name === 'className') name = 'class'\n\n if (name[0] == 'o' && name[1] == '-') {\n if (extension[name]) {\n extension[name](node, value, component)\n }\n } else 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 (!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 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 let nameLower = name.toLowerCase()\n name = (nameLower in node ? nameLower : name).slice(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 (node.nodeName === 'INPUT' && name === 'value') {\n node[name] = value == null ? '' : value\n } else if (\n name !== 'list' &&\n name !== 'type' &&\n name !== 'css' &&\n !isSvg &&\n name in node &&\n value !== ''\n ) {\n //value !== '' fix for selected, disabled, checked with pure element\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\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\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : 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 {\n node.pureSetAttribute\n ? node.pureSetAttribute(name, value)\n : node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @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}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { camelCase, isArray, Fragment } from '../util'\nimport { removeNode } from '../dom/index'\nimport options from '../options'\n\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/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n * @param {Element} [dom=null] A DOM node to mutate into the shape of the `vnode`\n * @param {VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure\n * @returns {Element} dom The created/mutated element\n * @private\n */\nexport function diff(dom, vnode, parent, component, updateSelf) {\n //first render return undefined\n if (!dom && !vnode) return\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\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 if (vnode && vnode.nodeName === Fragment) {\n vnode = vnode.children\n }\n if (isArray(vnode)) {\n if (parent) {\n const styles = parent.querySelectorAll('style')\n styles.forEach(s => {\n parent.removeChild(s)\n })\n innerDiffNode(parent, vnode, hydrating, component, updateSelf)\n\n for (let i = styles.length - 1; i >= 0; i--) {\n parent.firstChild\n ? parent.insertBefore(styles[i], parent.firstChild)\n : parent.appendChild(style[i])\n }\n } else {\n ret = []\n vnode.forEach((item, index) => {\n let ele = idiff(index === 0 ? dom : null, item, component, updateSelf)\n ret.push(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n dom.forEach((one, index) => {\n if (index === 0) {\n ret = idiff(one, vnode, component, updateSelf)\n } else {\n recollectNodeTree(one, false)\n }\n })\n } else {\n ret = idiff(dom, vnode, component, updateSelf)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\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 }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, component, updateSelf) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\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 // 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 || component)\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 out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n if (typeof vnodeName === 'function') {\n for (let key in options.mapping) {\n if (options.mapping[key] === vnodeName) {\n vnodeName = key\n vnode.nodeName = key\n break\n }\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 if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n hydrating || props.dangerouslySetInnerHTML != null,\n component,\n updateSelf\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, component, updateSelf)\n if (out.props) {\n out.props.children = vnode.children\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 * @param {Element} dom Element whose children should be compared & mutated\n * @param {Array} vchildren Array of VNodes to compare to `dom.childNodes`\n * @param {Boolean} isHydrating If `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, isHydrating, component, updateSelf) {\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, component, updateSelf)\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 * @param {Node} node DOM node to start unmount/removal from\n * @param {Boolean} [unmountOnly=false] If `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\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 && node[ATTR_KEY].ref) {\n if (typeof node[ATTR_KEY].ref === 'function') {\n node[ATTR_KEY].ref(null)\n } else if (node[ATTR_KEY].ref.current) {\n node[ATTR_KEY].ref.current = null\n }\n }\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n * - we use .lastChild here because it causes less reflow than .firstChild\n * - 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 * @param {Element} dom Element with attributes to diff `attrs` against\n * @param {Object} attrs The desired end-state key-value attribute pairs\n * @param {Object} old Current/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, component, updateSelf) {\n let name\n //let update = false\n let isWeElement = dom.update\n let oldClone\n if (dom.receiveProps) {\n oldClone = Object.assign({}, old)\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(\n dom,\n name,\n old[name],\n (old[name] = undefined),\n isSvgMode,\n component\n )\n if (isWeElement) {\n delete dom.props[name]\n //update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (isWeElement && typeof attrs[name] === 'object' && name !== 'ref') {\n if (name === 'style') {\n setAccessor(\n dom,\n name,\n old[name],\n (old[name] = attrs[name]),\n isSvgMode,\n component\n )\n }\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else if (\n name !== 'children' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], attrs[name], isSvgMode, component)\n if (isWeElement) {\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else {\n old[name] = attrs[name]\n }\n }\n }\n\n if (isWeElement && !updateSelf && dom.parentNode) {\n //__hasChildren is not accuracy when it was empty at first, so add dom.children.length > 0 condition\n //if (update || dom.__hasChildren || dom.children.length > 0 || (dom.store && !dom.store.data)) {\n if (dom.receiveProps(dom.props, oldClone) !== false) {\n dom.update()\n }\n //}\n }\n}\n","import {\n\tcssToDom,\n\tisArray,\n\tgetUse,\n\thyphenate,\n\tgetValByPath,\n\tremoveItem\n} from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { getPath } from './util'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n\tstatic is = 'WeElement'\n\n\tconstructor() {\n\t\tsuper()\n\t\tthis.props = Object.assign({}, this.constructor.defaultProps)\n\t\tthis.elementId = id++\n\t\tthis.computed = {}\n\t}\n\n\tconnectedCallback() {\n\t\tlet p = this.parentNode\n\t\twhile (p && !this.store) {\n\t\t\tthis.store = p.store\n\t\t\tp = p.parentNode || p.host\n\t\t}\n\n\t\tthis.attrsToProps()\n\n\t\tif (this.props.use) {\n\t\t\tthis.use = this.props.use\n\t\t}\n\n\t\tif (this.props.useSelf) {\n\t\t\tthis.use = this.props.useSelf\n\t\t}\n\n\t\tif (this.use) {\n\t\t\tconst use = typeof this.use === 'function' ? this.use() : this.use\n\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\t_updatePath[storeName] = {}\n\t\t\t\t\tusing[storeName] = {}\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].instances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.using = using\n\t\t\t\tthis._updatePath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updatePath = getPath(use)\n\t\t\t\tthis.using = getUse(this.store.data, use)\n\t\t\t\tthis.store.instances.push(this)\n\t\t\t}\n\t\t}\n\t\tif (this.useSelf) {\n\t\t\tconst use =\n\t\t\t\ttypeof this.useSelf === 'function' ? this.useSelf() : this.useSelf\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].updateSelfInstances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.usingSelf = using\n\t\t\t\tthis._updateSelfPath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updateSelfPath = getPath(use)\n\t\t\t\tthis.usingSelf = getUse(this.store.data, use)\n\t\t\t\tthis.store.updateSelfInstances.push(this)\n\t\t\t}\n\t\t}\n\n\t\tif (this.compute) {\n\t\t\tfor (let key in this.compute) {\n\t\t\t\tthis.computed[key] = this.compute[key].call(\n\t\t\t\t\toptions.isMultiStore ? this.store : this.store.data\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeInstall()\n\t\tthis.install()\n\t\tthis.afterInstall()\n\n\t\tlet shadowRoot\n\t\tif (this.constructor.isLightDom) {\n\t\t\tshadowRoot = this\n\t\t} else {\n\n\t\t\tif (!this.shadowRoot) {\n\t\t\t\tshadowRoot = this.attachShadow({\n\t\t\t\t\tmode: 'open'\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tshadowRoot = this.shadowRoot\n\t\t\t\tlet fc\n\t\t\t\twhile ((fc = shadowRoot.firstChild)) {\n\t\t\t\t\tshadowRoot.removeChild(fc)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.constructor.css) {\n\t\t\t\tshadowRoot.appendChild(cssToDom(this.constructor.css))\n\t\t\t} else if (this.css) {\n\t\t\t\tshadowRoot.appendChild(\n\t\t\t\t\tcssToDom(typeof this.css === 'function' ? this.css() : this.css)\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeRender()\n\t\toptions.afterInstall && options.afterInstall(this)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.__hasChildren =\n\t\t\tObject.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\trendered.length > 0\n\n\t\tthis.rootNode = diff(null, rendered, null, this)\n\t\tthis.rendered()\n\n\t\tif (this.props.css) {\n\t\t\tthis._customStyleElement = cssToDom(this.props.css)\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tshadowRoot.appendChild(this._customStyleElement)\n\t\t}\n\n\t\tif (isArray(this.rootNode)) {\n\t\t\tthis.rootNode.forEach(function (item) {\n\t\t\t\tshadowRoot.appendChild(item)\n\t\t\t})\n\t\t} else {\n\t\t\tthis.rootNode && shadowRoot.appendChild(this.rootNode)\n\t\t}\n\t\tthis.installed()\n\t\tthis._isInstalled = true\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.uninstall()\n\t\tthis._isInstalled = false\n\t\tif (this.store) {\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tfor (let key in this.store) {\n\t\t\t\t\tconst current = this.store[key]\n\t\t\t\t\tremoveItem(this, current.instances)\n\t\t\t\t\tremoveItem(this, current.updateSelfInstances)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tremoveItem(this, this.store.instances)\n\t\t\t\tremoveItem(this, this.store.updateSelfInstances)\n\t\t\t}\n\t\t}\n\t}\n\n\tupdate(ignoreAttrs, updateSelf) {\n\t\tthis._willUpdate = true\n\t\tthis.beforeUpdate()\n\t\tthis.beforeRender()\n\t\t//fix null !== undefined\n\t\tif (this._customStyleContent != this.props.css) {\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tthis._customStyleElement.textContent = this._customStyleContent\n\t\t}\n\t\tthis.attrsToProps(ignoreAttrs)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.rendered()\n\t\tthis.__hasChildren =\n\t\t\tthis.__hasChildren ||\n\t\t\t(Object.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\t\trendered.length > 0)\n\n\t\tthis.rootNode = diff(\n\t\t\tthis.rootNode,\n\t\t\trendered,\n\t\t\tthis.shadowRoot,\n\t\t\tthis,\n\t\t\tupdateSelf\n\t\t)\n\t\tthis._willUpdate = false\n\t\tthis.updated()\n\t}\n\n\tforceUpdate() {\n\t\tthis.update(true)\n\t}\n\n\tupdateProps(obj) {\n\t\tObject.keys(obj).forEach(key => {\n\t\t\tthis.props[key] = obj[key]\n\t\t\tif (this.prevProps) {\n\t\t\t\tthis.prevProps[key] = obj[key]\n\t\t\t}\n\t\t})\n\t\tthis.forceUpdate()\n\t}\n\n\tupdateSelf(ignoreAttrs) {\n\t\tthis.update(ignoreAttrs, true)\n\t}\n\n\tremoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t\t//Avoid executing removeAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tsetAttribute(key, val) {\n\t\tif (val && typeof val === 'object') {\n\t\t\tsuper.setAttribute(key, JSON.stringify(val))\n\t\t} else {\n\t\t\tsuper.setAttribute(key, val)\n\t\t}\n\t\t//Avoid executing setAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tpureRemoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t}\n\n\tpureSetAttribute(key, val) {\n\t\tsuper.setAttribute(key, val)\n\t}\n\n\tattrsToProps(ignoreAttrs) {\n\t\tif (options.ignoreAttrs || ignoreAttrs) return\n\t\tconst ele = this\n\t\tele.props['css'] = ele.getAttribute('css')\n\t\tconst attrs = this.constructor.propTypes\n\t\tif (!attrs) return\n\t\tObject.keys(attrs).forEach(key => {\n\t\t\tconst type = attrs[key]\n\t\t\tconst val = ele.getAttribute(hyphenate(key))\n\t\t\tif (val !== null) {\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase String:\n\t\t\t\t\t\tele.props[key] = val\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Number:\n\t\t\t\t\t\tele.props[key] = Number(val)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Boolean:\n\t\t\t\t\t\tif (val === 'false' || val === '0') {\n\t\t\t\t\t\t\tele.props[key] = false\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Array:\n\t\t\t\t\tcase Object:\n\t\t\t\t\t\tif (val[0] === ':') {\n\t\t\t\t\t\t\tele.props[key] = getValByPath(val.substr(1), Omi.$)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = JSON.parse(\n\t\t\t\t\t\t\t\tval\n\t\t\t\t\t\t\t\t\t.replace(/(['\"])?([a-zA-Z0-9_-]+)(['\"])?:([^\\/])/g, '\"$2\":$4')\n\t\t\t\t\t\t\t\t\t.replace(/'([\\s\\S]*?)'/g, '\"$1\"')\n\t\t\t\t\t\t\t\t\t.replace(/,(\\s*})/g, '$1')\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tele.constructor.defaultProps &&\n\t\t\t\t\tele.constructor.defaultProps.hasOwnProperty(key)\n\t\t\t\t) {\n\t\t\t\t\tele.props[key] = ele.constructor.defaultProps[key]\n\t\t\t\t} else {\n\t\t\t\t\tele.props[key] = null\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tfire(name, data) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(name, {\n\t\t\t\tdetail: data\n\t\t\t})\n\t\t)\n\t}\n\n\tbeforeInstall() { }\n\n\tinstall() { }\n\n\tafterInstall() { }\n\n\tinstalled() { }\n\n\tuninstall() { }\n\n\tbeforeUpdate() { }\n\n\tupdated() { }\n\n\tbeforeRender() { }\n\n\trendered() { }\n\n\treceiveProps() { }\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\nimport { getUse } from './util'\nimport options from './options'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n if (store.data) {\n observeStore(store)\n } else {\n options.isMultiStore = true\n //Multi-store injection\n for (let key in store) {\n observeStore(store[key], key)\n }\n }\n parent.store = store\n }\n return diff(null, vnode, parent, false)\n}\n\nfunction observeStore(store, key) {\n store.instances = []\n store.updateSelfInstances = []\n extendStoreUpdate(store, key)\n\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n const patchs = {}\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n\n update(patchs, store)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n\n update(patchs, store)\n }\n })\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpdate(store, key) {\n store.update = function(patch) {\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updatePath &&\n instance._updatePath[key] &&\n needUpdate(patch, instance._updatePath[key])\n ) {\n if (instance.use) {\n getUse(\n store.data,\n (typeof instance.use === 'function'\n ? instance.use()\n : instance.use)[key],\n instance.using,\n key\n )\n }\n\n instance.update()\n }\n } else {\n if (instance._updatePath && needUpdate(patch, instance._updatePath)) {\n if (instance.use) {\n instance.using = getUse(\n store.data,\n typeof instance.use === 'function'\n ? instance.use()\n : instance.use\n )\n }\n\n instance.update()\n }\n }\n })\n\n this.updateSelfInstances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updateSelfPath &&\n instance._updateSelfPath[key] &&\n needUpdate(patch, instance._updateSelfPath[key])\n ) {\n if (instance.useSelf) {\n getUse(\n store.data,\n (typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf)[key],\n instance.usingSelf,\n key\n )\n }\n\n instance.updateSelf()\n }\n } else {\n if (\n instance._updateSelfPath &&\n needUpdate(patch, instance._updateSelfPath)\n ) {\n instance.usingSelf = getUse(\n store.data,\n typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf\n )\n instance.updateSelf()\n }\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nfunction compute(instance, isMultiStore) {\n if (instance.compute) {\n for (let ck in instance.compute) {\n instance.computed[ck] = instance.compute[ck].call(\n isMultiStore ? instance.store : instance.store.data\n )\n }\n }\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 {\n k: fixArrPath(path),\n v: current\n }\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 WeElement from './we-element'\nimport options from './options'\n\nconst storeHelpers = ['use', 'useSelf']\n\nexport function define(name, ctor, config) {\n if (options.mapping[name]) {\n return\n }\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n options.mapping[name] = ctor\n } else {\n if (typeof config === 'string') {\n config = { css: config }\n } else {\n config = config || {}\n }\n\n class Ele extends WeElement {\n static css = config.css\n\n static propTypes = config.propTypes\n\n static defaultProps = config.defaultProps\n\n static isLightDom = config.isLightDom\n\n compute = config.compute\n\n render() {\n return ctor.call(this, this)\n }\n }\n\n for (let key in config) {\n if (typeof config[key] === 'function') {\n Ele.prototype[key] = function () {\n return config[key].apply(this, arguments)\n }\n }\n }\n\n storeHelpers.forEach(func => {\n if (config[func] && config[func] !== 'function') {\n Ele.prototype[func] = function () {\n return config[func]\n }\n }\n })\n\n customElements.define(name, Ele)\n options.mapping[name] = Ele\n }\n}\n","import { define } from './define'\n\nexport function tag(name, pure) {\n return function(target) {\n target.pure = pure\n define(name, target)\n }\n}\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 The virtual DOM element to clone\n * @param {Object} props Attributes/props to add when cloning\n * @param {VNode} rest Any 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","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else if (p.shadowRoot && p.shadowRoot.host) {\n return p.shadowRoot.host\n } else {\n p = p.parentNode\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","/**\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.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 if (args.length > 0) {\n return { class: classNames.apply(null, args) }\n }\n}\n","export function o(obj) {\n return JSON.stringify(obj)\n}\n","var n=function(t,r,u,e){for(var p=1;p\"===t?(a(),u=1):u&&(\"=\"===t?(u=4,r=e,e=\"\"):\"/\"===t?(a(),3===u&&(s=s[0]),u=s,(s=s[0]).push(u,4),u=0):\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t?(a(),u=2):e+=t)}return a(),s},r=\"function\"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)),r}:function(n){for(var r=\"\",e=0;e1?r:r[0]}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { classNames, extractClass } from './class'\nimport { o } from './o'\nimport htm from 'htm'\nimport { extend, get, set, bind, unbind } from './extend'\nimport JSONProxy from './proxy'\nimport { Fragment } from './util'\n\nh.f = Fragment\n\nconst html = htm.bind(h)\n\nfunction createRef() {\n\treturn {}\n}\n\nconst $ = {}\nconst Component = WeElement\nconst defineElement = define\nconst elements = options.mapping\n\nconst omi = {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n\noptions.root.Omi = omi\noptions.root.omi = omi\noptions.root.Omi.version = '6.18.1'\n\nexport default omi\n\nexport {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n"],"names":["getGlobal","global","Math","Array","self","window","Reflect","undefined","customElements","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","constructor","prototype","setPrototypeOf","cssToDom","css","node","document","createElement","textContent","camelCase","str","replace","$","$1","toUpperCase","Fragment","props","children","extend","obj","i","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","isArray","Object","toString","call","getUse","data","paths","out","name","forEach","path","index","isPath","getTargetByPath","key","keys","tempPath","tempVal","args","push","apply","pathToArr","split","origin","arr","len","length","hyphenateRE","hyphenate","toLowerCase","getValByPath","prop","getPath","result","item","removeItem","splice","stack","h","nodeName","attributes","lastSimple","child","simple","arguments","pop","String","p","options","vnode","ATTR_KEY","IS_NON_DIMENSIONAL","isSameNodeType","hydrating","splitText","_componentConstructor","isNamedNode","mapping","normalizedNodeName","extension","handler","set","get","eventProxy","e","_listeners","type","el","addEventListener","unbind","removeEventListener","createNode","isSvg","createElementNS","removeNode","parentNode","removeChild","setAccessor","old","component","className","style","cssText","test","innerHTML","__html","useCapture","nameLower","slice","touchStart","touchEnd","pureRemoveAttribute","removeAttribute","ns","removeAttributeNS","setAttributeNS","pureSetAttribute","setAttribute","event","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","diffLevel","isSvgMode","diff","dom","parent","updateSelf","ret","ownerSVGElement","styles","querySelectorAll","s","firstChild","insertBefore","appendChild","ele","idiff","one","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","vnodeName","fc","vchildren","a","nextSibling","is","noSlot","dangerouslySetInnerHTML","innerDiffNode","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","childrenLen","vlen","j","c","f","vchild","__key","trim","recollectNodeTree","unmountOnly","removeChildren","lastChild","next","previousSibling","diffAttributes","attrs","isWeElement","update","oldClone","receiveProps","assign","ccName","id","WeElement","defaultProps","elementId","computed","connectedCallback","store","host","attrsToProps","use","useSelf","isMultiStore","_updatePath","using","storeName","instances","updateSelfInstances","usingSelf","_updateSelfPath","compute","beforeInstall","install","afterInstall","shadowRoot","isLightDom","attachShadow","beforeRender","rendered","render","__hasChildren","rootNode","_customStyleElement","_customStyleContent","installed","_isInstalled","disconnectedCallback","uninstall","ignoreAttrs","_willUpdate","beforeUpdate","updated","forceUpdate","updateProps","prevProps","val","JSON","stringify","getAttribute","propTypes","Number","Boolean","substr","Omi","parse","fire","JSONPatcherProxy","deepClone","escapePathComponent","indexOf","findObjectPath","instance","pathComponents","parentAndPath","parenthoodMap","unshift","join","setTrap","target","newValue","parentPath","destinationPropKey","proxifiedObjectsMap","has","newValueOriginalObject","originalObject","revokableInstance","isProxifyingTreeNow","inherited","_proxifyObjectTreeRecursively","operation","op","oldValue","delete","disableTrapsForProxy","isInteger","warn","reflectionResult","defaultCallback","deleteTrap","revokableProxyInstance","deleteProperty","resume","isRecording","patches","userCallback","isObserving","pause","root","showDetachedWarning","Map","cachedProxy","generateProxyAtPath","traps","receiver","revocableInstance","Proxy","revocable","trapsInstance","proxy","proxifyObjectTree","proxifiedObject","message","targetObject","propKey","observe","record","callback","Error","generate","revoke","disableTraps","querySelector","observeStore","JSONProxy","patch","patchs","kv","getArrayPatch","k","v","fixPath","extendStoreUpdate","needUpdate","onChange","ck","diffResult","updatePath","keyA","keyB","includePath","pathA","pathB","mpPath","isNaN","fixArrPath","storeHelpers","define","ctor","config","Ele","func","tag","pure","cloneElement","getHost","rpx","b","innerWidth","hasOwn","classNames","classes","arg","argType","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N,IAAR,CAAa4E,GAAb,GAAmBA,GAAnB;AACAxS,QAAQ4N,IAAR,CAAa7C,GAAb,CAAiB0H,OAAjB,GAA2B,QAA3B;;;"} \ No newline at end of file diff --git a/packages/omi/dist/omi.js b/packages/omi/dist/omi.js index db3b3346a..3ee99bd03 100644 --- a/packages/omi/dist/omi.js +++ b/packages/omi/dist/omi.js @@ -523,6 +523,7 @@ Ele.css = config.css; Ele.propTypes = config.propTypes; Ele.defaultProps = config.defaultProps; + Ele.isLightDom = config.isLightDom; for (var key in config) !function(key) { if ('function' == typeof config[key]) Ele.prototype[key] = function() { return config[key].apply(this, arguments); @@ -1014,24 +1015,22 @@ var hasOwn = {}.hasOwnProperty; var n = function(t, r, u, e) { for (var p = 1; p < r.length; p++) { - var s = r[p], h = "number" == typeof s ? u[s] : s, a = r[++p]; - 1 === a ? e[0] = h : 3 === a ? e[1] = Object.assign(e[1] || {}, h) : 5 === a ? (e[1] = e[1] || {})[r[++p]] = h : 6 === a ? e[1][r[++p]] += h + "" : e.push(a ? t.apply(null, n(t, h, u, [ "", null ])) : h); + var s = r[p++], a = "number" == typeof s ? u[s] : s; + 1 === r[p] ? e[0] = a : 2 === r[p] ? (e[1] = e[1] || {})[r[++p]] = a : 3 === r[p] ? e[1] = Object.assign(e[1] || {}, a) : e.push(r[p] ? t.apply(null, n(t, a, u, [ "", null ])) : a); } return e; }, t = function(n) { - for (var t, r, u = 1, e = "", p = "", s = [ 0 ], h = function(n) { + for (var t, r, u = 1, e = "", p = "", s = [ 0 ], a = function(n) { 1 === u && (n || (e = e.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? s.push(n || e, 0) : 3 === u && (n || e) ? (s.push(n || e, 1), - u = 2) : 2 === u && "..." === e && n ? s.push(n, 3) : 2 === u && e && !n ? s.push(!0, 5, e) : u >= 5 && ((e || !n && 5 === u) && (s.push(e, u, r), - u = 6), n && (s.push(n, u, r), u = 6)), e = ""; - }, a = 0; a < n.length; a++) { - a && (1 === u && h(), h(a)); - for (var f = 0; f < n[a].length; f++) t = n[a][f], 1 === u ? "<" === t ? (h(), s = [ s ], u = 3) : e += t : 4 === u ? "--" === e && ">" === t ? (u = 1, - e = "") : e = t + e[0] : p ? t === p ? p = "" : e += t : '"' === t || "'" === t ? p = t : ">" === t ? (h(), u = 1) : u && ("=" === t ? (u = 5, - r = e, e = "") : "/" === t && (u < 5 || ">" === n[a][f + 1]) ? (h(), 3 === u && (s = s[0]), u = s, (s = s[0]).push(u, 2), - u = 0) : " " === t || "\t" === t || "\n" === t || "\r" === t ? (h(), u = 2) : e += t), 3 === u && "!--" === e && (u = 4, - s = s[0]); + u = 2) : 2 === u && "..." === e && n ? s.push(n, 3) : 2 === u && e && !n ? s.push(!0, 2, e) : 4 === u && r && (s.push(n || e, 2, r), + r = ""), e = ""; + }, f = 0; f < n.length; f++) { + f && (1 === u && a(), a(f)); + for (var h = 0; h < n[f].length; h++) t = n[f][h], 1 === u ? "<" === t ? (a(), s = [ s ], u = 3) : e += t : p ? t === p ? p = "" : e += t : '"' === t || "'" === t ? p = t : ">" === t ? (a(), + u = 1) : u && ("=" === t ? (u = 4, r = e, e = "") : "/" === t ? (a(), 3 === u && (s = s[0]), u = s, (s = s[0]).push(u, 4), + u = 0) : " " === t || "\t" === t || "\n" === t || "\r" === t ? (a(), u = 2) : e += t); } - return h(), s; + return a(), s; }, r = "function" == typeof Map, u = r ? new Map() : {}, e = r ? function(n) { var r = u.get(n); return r || u.set(n, r = t(n)), r; @@ -1075,7 +1074,7 @@ }; options.root.Omi = omi; options.root.omi = omi; - options.root.Omi.version = '6.18.0'; + options.root.Omi.version = '6.18.1'; if ('undefined' != typeof module) module.exports = omi; else self.Omi = omi; }(); //# sourceMappingURL=omi.js.map \ No newline at end of file diff --git a/packages/omi/dist/omi.js.map b/packages/omi/dist/omi.js.map index d9f9de4bd..4d1a02ccc 100644 --- a/packages/omi/dist/omi.js.map +++ b/packages/omi/dist/omi.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/util.js","../src/h.js","../src/vdom/index.js","../src/extend.js","../src/dom/index.js","../src/vdom/diff.js","../src/proxy.js","../src/render.js","../src/define.js","../src/clone-element.js","../src/get-host.js","../src/class.js","../src/o.js","../src/omi.js","../src/options.js","../src/we-element.js","../node_modules/htm/dist/htm.module.js"],"names":["cssToDom","css","node","document","createElement","textContent","camelCase","str","replace","$","$1","toUpperCase","Fragment","props","children","extend","obj","i","applyRef","ref","value","current","isArray","Object","prototype","toString","call","getUse","data","paths","out","name","forEach","path","index","isPath","getTargetByPath","key","keys","tempPath","tempVal","args","push","apply","pathToArr","split","origin","arr","len","length","hyphenate","hyphenateRE","toLowerCase","getValByPath","prop","getPath","result","item","removeItem","splice","h","nodeName","attributes","lastSimple","child","simple","arguments","stack","pop","undefined","String","p","options","vnode","isSameNodeType","splitText","mapping","hydrating","_componentConstructor","isNamedNode","extend$1","handler","extension","get","e","type","eventProxy","el","_listeners","addEventListener","createNode","removeNode","setAccessor","component","old","isSvg","className","style","cssText","IS_NON_DIMENSIONAL","test","useCapture","nameLower","innerHTML","slice","eventProxy$1","touchStart","touchEnd","removeEventListener","pureRemoveAttribute","removeAttribute","ns","removeAttributeNS","pureSetAttribute","setAttribute","this","___touchX","pageX","___touchY","touches","pageY","Math","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","ret","diffLevel","isSvgMode","parent","ownerSVGElement","dom","querySelectorAll","styles","s","innerDiffNode","updateSelf","removeChild","firstChild","insertBefore","appendChild","ele","idiff","one","recollectNodeTree","parentNode","nodeValue","createTextNode","replaceChild","vnodeName","vchildren","fc","a","nextSibling","constructor","is","noSlot","dangerouslySetInnerHTML","diffAttributes","min","childrenLen","vlen","j","keyedLen","originalChildren","keyed","vchild","_child","_component","__key","trim","isHydrating","c","f","unmountOnly","ATTR_KEY","removeChildren","oldClone","assign","receiveProps","isWeElement","attrs","ccName","_ccName","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","render","store","JSONPatcherProxy","querySelector","observeStore","isMultiStore","diff","instances","updateSelfInstances","observe","patch","extendStoreUpdate","getArrayPatch","JSONProxy","patchs","kv","v","update","k","compute","_updatePath","needUpdate","use","using","useSelf","usingSelf","ck","diffResult","updatePath","keyA","keyB","includePath","pathA","pathB","indexOf","next","substr","fixPath","mpPath","Number","fixArrPath","_classCallCheck$1","_possibleConstructorReturn$1","ctor","define","config","customElements","Ele","_WeElement","_temp","_this","_ret","_len","Array","concat","WeElement","propTypes","defaultProps","storeHelpers","func","pure","target","cloneElement","getHost","shadowRoot","host","rpx","b","window","innerWidth","arg","classNames","classes","argType","inner","join","_Array$prototype$slic","class","unshift","o","JSON","stringify","htm","t","r","n","root","global","ignoreAttrs","Reflect","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","setPrototypeOf","Promise","resolve","then","bind","setTimeout","computed","connectedCallback","attrsToProps","storeName","_use","_updatePath2","_using","_storeName","_updateSelfPath","beforeInstall","install","afterInstall","isLightDom","attachShadow","mode","beforeRender","rendered","rootNode","_customStyleContent","_customStyleElement","installed","_isInstalled","disconnectedCallback","uninstall","_willUpdate","beforeUpdate","__hasChildren","forceUpdate","updated","_this2","updateProps","prevProps","_HTMLElement","val","getAttribute","Boolean","Omi","parse","fire","deepClone","escapePathComponent","pathComponents","parentAndPath","parenthoodMap","parentPath","newValueOriginalObject","revokableInstance","inherited","proxifiedObjectsMap","has","newValue","set","operation","destinationPropKey","op","oldValue","delete","disableTrapsForProxy","console","warn","reflectionResult","revokableProxyInstance","defaultCallback","resume","patches","userCallback","pause","isObserving","showDetachedWarning","cachedProxy","receiver","deleteProperty","deleteTrap","Proxy","revocable","revocableInstance","trapsInstance","traps","originalObject","_proxifyObjectTreeRecursively","proxifyObjectTree","isProxifyingTreeNow","proxifiedObject","targetObject","message","propKey","record","callback","generate","isRecording","revoke","disableTraps","u","Map","html","Component","defineElement","tag","elements","omi","createRef","extractClass","unbind","version","module","exports"],"mappings":";;IAqCO,SAASA,SAASC;QAC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AAA5I;IACA,IAAA6I,gBAAAxJ;;IAGD,IAAMuJ;QACNE,KAAMD;QACN7I,WAAM+I;;QAENtM,QAAMuM;QACLF,GAAAA;QACA9I,eAAAA;QACA4I,SAAAA;QACAnM,QAAAA;QACAvI,cALWqM;QAMX7P,SAAAA;QACAoE,KAAAA;QACAuK,eARWwJ;QASXtI,YAAAA;QACAC,cAAAA;QACAG,WAXWsI;QAYXJ,MAAAA;QACA7H,KAAAA;QACAkI,GAAAA;QACAD,UAAAA;QACAN,GAAAA;QACAhH,QAjBWrM;QAkBXkM,KAlBW/L;QAmBXsT,KAAAA;QACAhY,MApBW4R;QAqBXtR,QAAAA;QACAoE,WAtBWkH;;IAyBXwM,QAAAA,KAAAA,MAzBWH;IA0BX1L,QAAAA,KAAAA,MAAAA;IA1BWxI,QAAZiN,KAAAkD,IAAAmE,UAAA;IA6BAtU,IAAmBkU,sBAAXjH,QAARsH,OAAAC,UAAAN,UAAAzM,KAAA0I,MAAA+D","file":"omi.js","sourcesContent":["/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This shim allows elements written in, or compiled to, ES5 to work on native\n * implementations of Custom Elements v1. It sets new.target to the value of\n * this.constructor so that the native HTMLElement constructor can access the\n * current under-construction element's definition.\n */\n;(function() {\n if (\n // No Reflect, no classes, no need for shim because native custom elements\n // require ES2015 classes or Reflect.\n window.Reflect === undefined ||\n window.customElements === undefined ||\n // The webcomponentsjs custom elements polyfill doesn't require\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = HTMLElement\n window.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\nexport function cssToDom(css) {\n const node = document.createElement('style')\n node.textContent = css\n return node\n}\n\nexport function camelCase(str) {\n return str.replace(/-(\\w)/g, ($, $1) => {\n return $1.toUpperCase()\n })\n}\n\nexport function Fragment(props) {\n return props.children\n}\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 != null) {\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 * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\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 getUse(data, paths, out, name) {\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 if (out) out[name] = obj\n return obj\n}\n\nexport function pathToArr(path) {\n if (typeof path !== 'string' || !path) return []\n // return path.split(/\\.|\\[|\\]/).filter(name => !!name)\n return path\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n}\n\nexport function getTargetByPath(origin, path) {\n const arr = pathToArr(path)\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}\n\nconst hyphenateRE = /\\B([A-Z])/g\nexport function hyphenate(str) {\n return str.replace(hyphenateRE, '-$1').toLowerCase()\n}\n\nexport function getValByPath(path, current) {\n const arr = pathToArr(path)\n arr.forEach(prop => {\n current = current[prop]\n })\n return current\n}\n\nexport function getPath(obj, out, name) {\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 if (out) out[name] = result\n return result\n}\n\nexport function removeItem(item, arr) {\n if (!arr) return\n for (let i = 0, len = arr.length; i < len; i++) {\n if (arr[i] === item) {\n arr.splice(i, 1)\n break\n }\n }\n}\n","import options from './options'\nimport { Fragment } from './util'\n\nconst stack = []\n\nexport function h(nodeName, attributes) {\n let 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.length === 0) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n if (nodeName === Fragment) {\n return children\n }\n\n const p = {\n nodeName,\n children,\n attributes: attributes == null ? undefined : attributes,\n key: attributes == null ? undefined : attributes.key\n }\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","import { extend } from '../util'\nimport options from '../options'\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node DOM Node to compare\n * @param {VNode} vnode Virtual DOM node to compare\n * @param {boolean} [hydrating=false] If 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 return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n } else if (typeof vnode.nodeName === 'function') {\n return options.mapping[node.nodeName.toLowerCase()] === 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 A DOM Element to inspect the name of.\n * @param {String} nodeName Unnormalized 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 { pathToArr } from './util'\n\nexport const extension = {}\n\nexport function extend(name, handler) {\n extension['o-' + name] = handler\n}\n\nexport function set(origin, path, value) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n if (i === len - 1) {\n current[arr[i]] = value\n } else {\n current = current[arr[i]]\n }\n }\n}\n\nexport function get(origin, path) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n current = current[arr[i]]\n }\n\n return current\n}\n\nfunction eventProxy(e) {\n return this._listeners[e.type](e)\n}\n\nexport function bind(el, type, handler) {\n el._listeners = el._listeners || {}\n el._listeners[type] = handler\n el.addEventListener(type, eventProxy)\n}\n\nexport function unbind(el, type) {\n el.removeEventListener(type, eventProxy)\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\nimport { extension } from '../extend'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg, component) {\n if (name === 'className') name = 'class'\n\n if (name[0] == 'o' && name[1] == '-') {\n if (extension[name]) {\n extension[name](node, value, component)\n }\n } else 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 (!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 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 let nameLower = name.toLowerCase()\n name = (nameLower in node ? nameLower : name).slice(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 (node.nodeName === 'INPUT' && name === 'value') {\n node[name] = value == null ? '' : value\n } else if (\n name !== 'list' &&\n name !== 'type' &&\n name !== 'css' &&\n !isSvg &&\n name in node &&\n value !== ''\n ) {\n //value !== '' fix for selected, disabled, checked with pure element\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\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\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : 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 {\n node.pureSetAttribute\n ? node.pureSetAttribute(name, value)\n : node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @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}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { camelCase, isArray, Fragment } from '../util'\nimport { removeNode } from '../dom/index'\nimport options from '../options'\n\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/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n * @param {Element} [dom=null] A DOM node to mutate into the shape of the `vnode`\n * @param {VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure\n * @returns {Element} dom The created/mutated element\n * @private\n */\nexport function diff(dom, vnode, parent, component, updateSelf) {\n //first render return undefined\n if (!dom && !vnode) return\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\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 if (vnode && vnode.nodeName === Fragment) {\n vnode = vnode.children\n }\n if (isArray(vnode)) {\n if (parent) {\n const styles = parent.querySelectorAll('style')\n styles.forEach(s => {\n parent.removeChild(s)\n })\n innerDiffNode(parent, vnode, hydrating, component, updateSelf)\n\n for (let i = styles.length - 1; i >= 0; i--) {\n parent.firstChild\n ? parent.insertBefore(styles[i], parent.firstChild)\n : parent.appendChild(style[i])\n }\n } else {\n ret = []\n vnode.forEach((item, index) => {\n let ele = idiff(index === 0 ? dom : null, item, component, updateSelf)\n ret.push(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n dom.forEach((one, index) => {\n if (index === 0) {\n ret = idiff(one, vnode, component, updateSelf)\n } else {\n recollectNodeTree(one, false)\n }\n })\n } else {\n ret = idiff(dom, vnode, component, updateSelf)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\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 }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, component, updateSelf) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\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 // 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 || component)\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 out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n if (typeof vnodeName === 'function') {\n for (let key in options.mapping) {\n if (options.mapping[key] === vnodeName) {\n vnodeName = key\n vnode.nodeName = key\n break\n }\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 if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n hydrating || props.dangerouslySetInnerHTML != null,\n component,\n updateSelf\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, component, updateSelf)\n if (out.props) {\n out.props.children = vnode.children\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 * @param {Element} dom Element whose children should be compared & mutated\n * @param {Array} vchildren Array of VNodes to compare to `dom.childNodes`\n * @param {Boolean} isHydrating If `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, isHydrating, component, updateSelf) {\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, component, updateSelf)\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 * @param {Node} node DOM node to start unmount/removal from\n * @param {Boolean} [unmountOnly=false] If `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\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 && node[ATTR_KEY].ref) {\n if (typeof node[ATTR_KEY].ref === 'function') {\n node[ATTR_KEY].ref(null)\n } else if (node[ATTR_KEY].ref.current) {\n node[ATTR_KEY].ref.current = null\n }\n }\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n * - we use .lastChild here because it causes less reflow than .firstChild\n * - 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 * @param {Element} dom Element with attributes to diff `attrs` against\n * @param {Object} attrs The desired end-state key-value attribute pairs\n * @param {Object} old Current/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, component, updateSelf) {\n let name\n //let update = false\n let isWeElement = dom.update\n let oldClone\n if (dom.receiveProps) {\n oldClone = Object.assign({}, old)\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(\n dom,\n name,\n old[name],\n (old[name] = undefined),\n isSvgMode,\n component\n )\n if (isWeElement) {\n delete dom.props[name]\n //update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (isWeElement && typeof attrs[name] === 'object' && name !== 'ref') {\n if (name === 'style') {\n setAccessor(\n dom,\n name,\n old[name],\n (old[name] = attrs[name]),\n isSvgMode,\n component\n )\n }\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else if (\n name !== 'children' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], attrs[name], isSvgMode, component)\n if (isWeElement) {\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else {\n old[name] = attrs[name]\n }\n }\n }\n\n if (isWeElement && !updateSelf && dom.parentNode) {\n //__hasChildren is not accuracy when it was empty at first, so add dom.children.length > 0 condition\n //if (update || dom.__hasChildren || dom.children.length > 0 || (dom.store && !dom.store.data)) {\n if (dom.receiveProps(dom.props, oldClone) !== false) {\n dom.update()\n }\n //}\n }\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\nimport { getUse } from './util'\nimport options from './options'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n if (store.data) {\n observeStore(store)\n } else {\n options.isMultiStore = true\n //Multi-store injection\n for (let key in store) {\n observeStore(store[key], key)\n }\n }\n parent.store = store\n }\n return diff(null, vnode, parent, false)\n}\n\nfunction observeStore(store, key) {\n store.instances = []\n store.updateSelfInstances = []\n extendStoreUpdate(store, key)\n\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n const patchs = {}\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n\n update(patchs, store)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n\n update(patchs, store)\n }\n })\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpdate(store, key) {\n store.update = function(patch) {\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updatePath &&\n instance._updatePath[key] &&\n needUpdate(patch, instance._updatePath[key])\n ) {\n if (instance.use) {\n getUse(\n store.data,\n (typeof instance.use === 'function'\n ? instance.use()\n : instance.use)[key],\n instance.using,\n key\n )\n }\n\n instance.update()\n }\n } else {\n if (instance._updatePath && needUpdate(patch, instance._updatePath)) {\n if (instance.use) {\n instance.using = getUse(\n store.data,\n typeof instance.use === 'function'\n ? instance.use()\n : instance.use\n )\n }\n\n instance.update()\n }\n }\n })\n\n this.updateSelfInstances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updateSelfPath &&\n instance._updateSelfPath[key] &&\n needUpdate(patch, instance._updateSelfPath[key])\n ) {\n if (instance.useSelf) {\n getUse(\n store.data,\n (typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf)[key],\n instance.usingSelf,\n key\n )\n }\n\n instance.updateSelf()\n }\n } else {\n if (\n instance._updateSelfPath &&\n needUpdate(patch, instance._updateSelfPath)\n ) {\n instance.usingSelf = getUse(\n store.data,\n typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf\n )\n instance.updateSelf()\n }\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nfunction compute(instance, isMultiStore) {\n if (instance.compute) {\n for (let ck in instance.compute) {\n instance.computed[ck] = instance.compute[ck].call(\n isMultiStore ? instance.store : instance.store.data\n )\n }\n }\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 {\n k: fixArrPath(path),\n v: current\n }\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 WeElement from './we-element'\nimport options from './options'\n\nconst storeHelpers = ['use', 'useSelf']\n\nexport function define(name, ctor, config) {\n if (options.mapping[name]) {\n return\n }\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n options.mapping[name] = ctor\n } else {\n if (typeof config === 'string') {\n config = { css: config }\n } else {\n config = config || {}\n }\n\n class Ele extends WeElement {\n static css = config.css\n\n static propTypes = config.propTypes\n\n static defaultProps = config.defaultProps\n\n compute = config.compute\n\n render() {\n return ctor.call(this, this)\n }\n }\n\n for (let key in config) {\n if (typeof config[key] === 'function') {\n Ele.prototype[key] = function() {\n return config[key].apply(this, arguments)\n }\n }\n }\n\n storeHelpers.forEach(func => {\n if (config[func] && config[func] !== 'function') {\n Ele.prototype[func] = function() {\n return config[func]\n }\n }\n })\n\n customElements.define(name, Ele)\n options.mapping[name] = Ele\n }\n}\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 The virtual DOM element to clone\n * @param {Object} props Attributes/props to add when cloning\n * @param {VNode} rest Any 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","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else if (p.shadowRoot && p.shadowRoot.host) {\n return p.shadowRoot.host\n } else {\n p = p.parentNode\n }\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.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 if (args.length > 0) {\n return { class: classNames.apply(null, args) }\n }\n}\n","export function o(obj) {\n return JSON.stringify(obj)\n}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { classNames, extractClass } from './class'\nimport { o } from './o'\nimport htm from 'htm'\nimport { extend, get, set, bind, unbind } from './extend'\nimport JSONProxy from './proxy'\nimport { Fragment } from './util'\n\nh.f = Fragment\n\nconst html = htm.bind(h)\n\nfunction createRef() {\n\treturn {}\n}\n\nconst $ = {}\nconst Component = WeElement\nconst defineElement = define\nconst elements = options.mapping\n\nconst omi = {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n\noptions.root.Omi = omi\noptions.root.omi = omi\noptions.root.Omi.version = '6.18.0'\n\nexport default omi\n\nexport {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n","function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function () {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n * @public\n * @namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal(),\n mapping: {},\n isMultiStore: false,\n //when set true, using props of hypescript, don't use getAttribute\n //if you render all the node tree by omi self, set it\n ignoreAttrs: false\n}\n","import {\n\tcssToDom,\n\tisArray,\n\tgetUse,\n\thyphenate,\n\tgetValByPath,\n\tremoveItem\n} from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { getPath } from './util'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n\tstatic is = 'WeElement'\n\n\tconstructor() {\n\t\tsuper()\n\t\tthis.props = Object.assign({}, this.constructor.defaultProps)\n\t\tthis.elementId = id++\n\t\tthis.computed = {}\n\t}\n\n\tconnectedCallback() {\n\t\tlet p = this.parentNode\n\t\twhile (p && !this.store) {\n\t\t\tthis.store = p.store\n\t\t\tp = p.parentNode || p.host\n\t\t}\n\n\t\tthis.attrsToProps()\n\n\t\tif (this.props.use) {\n\t\t\tthis.use = this.props.use\n\t\t}\n\n\t\tif (this.props.useSelf) {\n\t\t\tthis.use = this.props.useSelf\n\t\t}\n\n\t\tif (this.use) {\n\t\t\tconst use = typeof this.use === 'function' ? this.use() : this.use\n\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\t_updatePath[storeName] = {}\n\t\t\t\t\tusing[storeName] = {}\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].instances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.using = using\n\t\t\t\tthis._updatePath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updatePath = getPath(use)\n\t\t\t\tthis.using = getUse(this.store.data, use)\n\t\t\t\tthis.store.instances.push(this)\n\t\t\t}\n\t\t}\n\t\tif (this.useSelf) {\n\t\t\tconst use =\n\t\t\t\ttypeof this.useSelf === 'function' ? this.useSelf() : this.useSelf\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].updateSelfInstances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.usingSelf = using\n\t\t\t\tthis._updateSelfPath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updateSelfPath = getPath(use)\n\t\t\t\tthis.usingSelf = getUse(this.store.data, use)\n\t\t\t\tthis.store.updateSelfInstances.push(this)\n\t\t\t}\n\t\t}\n\n\t\tif (this.compute) {\n\t\t\tfor (let key in this.compute) {\n\t\t\t\tthis.computed[key] = this.compute[key].call(\n\t\t\t\t\toptions.isMultiStore ? this.store : this.store.data\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeInstall()\n\t\tthis.install()\n\t\tthis.afterInstall()\n\n\t\tlet shadowRoot\n\t\tif (this.constructor.isLightDom) {\n\t\t\tshadowRoot = this\n\t\t} else {\n\n\t\t\tif (!this.shadowRoot) {\n\t\t\t\tshadowRoot = this.attachShadow({\n\t\t\t\t\tmode: 'open'\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tshadowRoot = this.shadowRoot\n\t\t\t\tlet fc\n\t\t\t\twhile ((fc = shadowRoot.firstChild)) {\n\t\t\t\t\tshadowRoot.removeChild(fc)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.constructor.css) {\n\t\t\t\tshadowRoot.appendChild(cssToDom(this.constructor.css))\n\t\t\t} else if (this.css) {\n\t\t\t\tshadowRoot.appendChild(\n\t\t\t\t\tcssToDom(typeof this.css === 'function' ? this.css() : this.css)\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeRender()\n\t\toptions.afterInstall && options.afterInstall(this)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.__hasChildren =\n\t\t\tObject.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\trendered.length > 0\n\n\t\tthis.rootNode = diff(null, rendered, null, this)\n\t\tthis.rendered()\n\n\t\tif (this.props.css) {\n\t\t\tthis._customStyleElement = cssToDom(this.props.css)\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tshadowRoot.appendChild(this._customStyleElement)\n\t\t}\n\n\t\tif (isArray(this.rootNode)) {\n\t\t\tthis.rootNode.forEach(function (item) {\n\t\t\t\tshadowRoot.appendChild(item)\n\t\t\t})\n\t\t} else {\n\t\t\tthis.rootNode && shadowRoot.appendChild(this.rootNode)\n\t\t}\n\t\tthis.installed()\n\t\tthis._isInstalled = true\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.uninstall()\n\t\tthis._isInstalled = false\n\t\tif (this.store) {\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tfor (let key in this.store) {\n\t\t\t\t\tconst current = this.store[key]\n\t\t\t\t\tremoveItem(this, current.instances)\n\t\t\t\t\tremoveItem(this, current.updateSelfInstances)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tremoveItem(this, this.store.instances)\n\t\t\t\tremoveItem(this, this.store.updateSelfInstances)\n\t\t\t}\n\t\t}\n\t}\n\n\tupdate(ignoreAttrs, updateSelf) {\n\t\tthis._willUpdate = true\n\t\tthis.beforeUpdate()\n\t\tthis.beforeRender()\n\t\t//fix null !== undefined\n\t\tif (this._customStyleContent != this.props.css) {\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tthis._customStyleElement.textContent = this._customStyleContent\n\t\t}\n\t\tthis.attrsToProps(ignoreAttrs)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.rendered()\n\t\tthis.__hasChildren =\n\t\t\tthis.__hasChildren ||\n\t\t\t(Object.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\t\trendered.length > 0)\n\n\t\tthis.rootNode = diff(\n\t\t\tthis.rootNode,\n\t\t\trendered,\n\t\t\tthis.shadowRoot,\n\t\t\tthis,\n\t\t\tupdateSelf\n\t\t)\n\t\tthis._willUpdate = false\n\t\tthis.updated()\n\t}\n\n\tforceUpdate() {\n\t\tthis.update(true)\n\t}\n\n\tupdateProps(obj) {\n\t\tObject.keys(obj).forEach(key => {\n\t\t\tthis.props[key] = obj[key]\n\t\t\tif (this.prevProps) {\n\t\t\t\tthis.prevProps[key] = obj[key]\n\t\t\t}\n\t\t})\n\t\tthis.forceUpdate()\n\t}\n\n\tupdateSelf(ignoreAttrs) {\n\t\tthis.update(ignoreAttrs, true)\n\t}\n\n\tremoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t\t//Avoid executing removeAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tsetAttribute(key, val) {\n\t\tif (val && typeof val === 'object') {\n\t\t\tsuper.setAttribute(key, JSON.stringify(val))\n\t\t} else {\n\t\t\tsuper.setAttribute(key, val)\n\t\t}\n\t\t//Avoid executing setAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tpureRemoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t}\n\n\tpureSetAttribute(key, val) {\n\t\tsuper.setAttribute(key, val)\n\t}\n\n\tattrsToProps(ignoreAttrs) {\n\t\tif (options.ignoreAttrs || ignoreAttrs) return\n\t\tconst ele = this\n\t\tele.props['css'] = ele.getAttribute('css')\n\t\tconst attrs = this.constructor.propTypes\n\t\tif (!attrs) return\n\t\tObject.keys(attrs).forEach(key => {\n\t\t\tconst type = attrs[key]\n\t\t\tconst val = ele.getAttribute(hyphenate(key))\n\t\t\tif (val !== null) {\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase String:\n\t\t\t\t\t\tele.props[key] = val\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Number:\n\t\t\t\t\t\tele.props[key] = Number(val)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Boolean:\n\t\t\t\t\t\tif (val === 'false' || val === '0') {\n\t\t\t\t\t\t\tele.props[key] = false\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Array:\n\t\t\t\t\tcase Object:\n\t\t\t\t\t\tif (val[0] === ':') {\n\t\t\t\t\t\t\tele.props[key] = getValByPath(val.substr(1), Omi.$)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = JSON.parse(\n\t\t\t\t\t\t\t\tval\n\t\t\t\t\t\t\t\t\t.replace(/(['\"])?([a-zA-Z0-9_-]+)(['\"])?:([^\\/])/g, '\"$2\":$4')\n\t\t\t\t\t\t\t\t\t.replace(/'([\\s\\S]*?)'/g, '\"$1\"')\n\t\t\t\t\t\t\t\t\t.replace(/,(\\s*})/g, '$1')\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tele.constructor.defaultProps &&\n\t\t\t\t\tele.constructor.defaultProps.hasOwnProperty(key)\n\t\t\t\t) {\n\t\t\t\t\tele.props[key] = ele.constructor.defaultProps[key]\n\t\t\t\t} else {\n\t\t\t\t\tele.props[key] = null\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tfire(name, data) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(name, {\n\t\t\t\tdetail: data\n\t\t\t})\n\t\t)\n\t}\n\n\tbeforeInstall() { }\n\n\tinstall() { }\n\n\tafterInstall() { }\n\n\tinstalled() { }\n\n\tuninstall() { }\n\n\tbeforeUpdate() { }\n\n\tupdated() { }\n\n\tbeforeRender() { }\n\n\trendered() { }\n\n\treceiveProps() { }\n}\n","var n=function(t,r,u,e){for(var p=1;p=5&&((e||!n&&5===u)&&(s.push(e,u,r),u=6),n&&(s.push(n,u,r),u=6)),e=\"\"},a=0;a\"===t?(u=1,e=\"\"):e=t+e[0]:p?t===p?p=\"\":e+=t:'\"'===t||\"'\"===t?p=t:\">\"===t?(h(),u=1):u&&(\"=\"===t?(u=5,r=e,e=\"\"):\"/\"===t&&(u<5||\">\"===n[a][f+1])?(h(),3===u&&(s=s[0]),u=s,(s=s[0]).push(u,2),u=0):\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t?(h(),u=2):e+=t),3===u&&\"!--\"===e&&(u=4,s=s[0])}return h(),s},r=\"function\"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)),r}:function(n){for(var r=\"\",e=0;e1?r:r[0]}\n"]} \ No newline at end of file +{"version":3,"sources":["../src/util.js","../src/h.js","../src/vdom/index.js","../src/extend.js","../src/dom/index.js","../src/vdom/diff.js","../src/proxy.js","../src/render.js","../src/define.js","../src/clone-element.js","../src/get-host.js","../src/class.js","../src/o.js","../src/omi.js","../src/options.js","../src/we-element.js","../node_modules/htm/dist/htm.mjs"],"names":["cssToDom","css","node","document","createElement","textContent","camelCase","str","replace","$","$1","toUpperCase","Fragment","props","children","extend","obj","i","applyRef","ref","value","current","isArray","Object","prototype","toString","call","getUse","data","paths","out","name","forEach","path","index","isPath","getTargetByPath","key","keys","tempPath","tempVal","args","push","apply","pathToArr","split","origin","arr","len","length","hyphenate","hyphenateRE","toLowerCase","getValByPath","prop","getPath","result","item","removeItem","splice","h","nodeName","attributes","lastSimple","child","simple","arguments","stack","pop","undefined","String","p","options","vnode","isSameNodeType","splitText","mapping","hydrating","_componentConstructor","isNamedNode","extend$1","handler","extension","get","e","type","eventProxy","el","_listeners","addEventListener","createNode","removeNode","setAccessor","component","old","isSvg","className","style","cssText","IS_NON_DIMENSIONAL","test","useCapture","nameLower","innerHTML","slice","eventProxy$1","touchStart","touchEnd","removeEventListener","pureRemoveAttribute","removeAttribute","ns","removeAttributeNS","pureSetAttribute","setAttribute","this","___touchX","pageX","___touchY","touches","pageY","Math","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","ret","diffLevel","isSvgMode","parent","ownerSVGElement","dom","querySelectorAll","styles","s","innerDiffNode","updateSelf","removeChild","firstChild","insertBefore","appendChild","ele","idiff","one","recollectNodeTree","parentNode","nodeValue","createTextNode","replaceChild","vnodeName","vchildren","fc","a","nextSibling","constructor","is","noSlot","dangerouslySetInnerHTML","diffAttributes","min","childrenLen","vlen","j","keyedLen","originalChildren","keyed","vchild","_child","_component","__key","trim","isHydrating","c","f","unmountOnly","ATTR_KEY","removeChildren","oldClone","assign","receiveProps","isWeElement","attrs","ccName","_ccName","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","render","store","JSONPatcherProxy","querySelector","observeStore","isMultiStore","diff","instances","updateSelfInstances","observe","patch","extendStoreUpdate","getArrayPatch","JSONProxy","patchs","kv","v","update","k","compute","_updatePath","needUpdate","use","using","useSelf","usingSelf","ck","diffResult","updatePath","keyA","keyB","includePath","pathA","pathB","indexOf","next","substr","fixPath","mpPath","Number","fixArrPath","_classCallCheck$1","_possibleConstructorReturn$1","ctor","define","config","customElements","Ele","_WeElement","_temp","_this","_ret","_len","Array","concat","WeElement","propTypes","defaultProps","isLightDom","storeHelpers","func","pure","target","cloneElement","getHost","shadowRoot","host","rpx","b","window","innerWidth","arg","classNames","classes","argType","inner","join","_Array$prototype$slic","class","unshift","o","JSON","stringify","htm","t","r","n","root","global","ignoreAttrs","Reflect","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","setPrototypeOf","Promise","resolve","then","bind","setTimeout","computed","connectedCallback","attrsToProps","storeName","_use","_updatePath2","_using","_storeName","_updateSelfPath","beforeInstall","install","afterInstall","attachShadow","mode","beforeRender","rendered","rootNode","_customStyleContent","_customStyleElement","installed","_isInstalled","disconnectedCallback","uninstall","_willUpdate","beforeUpdate","__hasChildren","forceUpdate","updated","_this2","updateProps","prevProps","_HTMLElement","val","getAttribute","Boolean","Omi","parse","fire","deepClone","escapePathComponent","pathComponents","parentAndPath","parenthoodMap","parentPath","newValueOriginalObject","revokableInstance","inherited","proxifiedObjectsMap","has","newValue","set","operation","destinationPropKey","op","oldValue","delete","disableTrapsForProxy","console","warn","reflectionResult","revokableProxyInstance","defaultCallback","resume","patches","userCallback","pause","isObserving","showDetachedWarning","cachedProxy","receiver","deleteProperty","deleteTrap","Proxy","revocable","revocableInstance","trapsInstance","traps","originalObject","_proxifyObjectTreeRecursively","proxifyObjectTree","isProxifyingTreeNow","proxifiedObject","targetObject","message","propKey","record","callback","generate","isRecording","revoke","disableTraps","u","Map","html","Component","defineElement","tag","elements","omi","createRef","extractClass","unbind","version","module","exports"],"mappings":";;IAqCO,SAASA,SAASC;QACvB,IAAMC,OAAOC,SAASC,cAAc;QACpCF,KAAKG,cAAcJ;QACnB,OAAOC;;IAGF,SAASI,UAAUC;QACxB,OAAOA,IAAIC,QAAQ,UAAU,SAACC,GAAGC;YAC/B,OAAOA,GAAGC;;;IAIP,SAASC,SAASC;QACvB,OAAOA,MAAMC;;IAGR,SAASC,OAAOC,KAAKH;QAC1B,KAAK,IAAII,KAAKJ,OAAOG,IAAIC,KAAKJ,MAAMI;QACpC,OAAOD;;IAOF,SAASE,SAASC,KAAKC;QAC5B,IAAW,QAAPD,KACF,IAAkB,qBAAPA,KAAmBA,IAAIC,aAC7BD,IAAIE,UAAUD;;IAehB,SAASE,QAAQN;QACtB,OAA+C,qBAAxCO,OAAOC,UAAUC,SAASC,KAAKV;;IAGjC,SAASW,OAAOC,MAAMC,OAAOC,KAAKC;QACvC,IAAMf;QACNa,MAAMG,QAAQ,SAACC,MAAMC;YACnB,IAAMC,SAAyB,mBAATF;YACtB,IAAIE,QACFnB,IAAIkB,SAASE,gBAAgBR,MAAMK,YAC9B;gBACL,IAAMI,MAAMd,OAAOe,KAAKL,MAAM;gBAC9B,IAAMb,QAAQa,KAAKI;gBACnB,IAAqB,mBAAVjB,OACTJ,I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,KAAAD,EAAAE;;IAEtB7N,EAAAqH,IAAArK;IIFD,IAAIyX,OAAE/G,IAASgB,KAAK1O;IHoBpB,IAAAnD;IACC,IAAA6X,YAAA5I;IACA,IAAA6I,gBAAAxJ;;IAGD,IAAMuJ;QACNE,KAAMD;QACN7I,WAAM+I;;QAENtM,QAAMuM;QACLF,GAAAA;QACA9I,eAAAA;QACA4I,SAAAA;QACAnM,QAAAA;QACAvI,cALWsM;QAMX9P,SAAAA;QACAoE,KAAAA;QACAuK,eARWwJ;QASXrI,YAAAA;QACAC,cAAAA;QACAG,WAXWqI;QAYXJ,MAAAA;QACA5H,KAAAA;QACAiI,GAAAA;QACAD,UAAAA;QACAN,GAAAA;QACA/G,QAjBWtM;QAkBXmM,KAlBWhM;QAmBXsT,KAAAA;QACAhY,MApBW6R;QAqBXvR,QAAAA;QACAoE,WAtBWkH;;IAyBXwM,QAAAA,KAAAA,MAzBWH;IA0BX1L,QAAAA,KAAAA,MAAAA;IA1BWxI,QAAZkN,KAAAiD,IAAAmE,UAAA;IA6BAtU,IAAmBkU,sBAAXhH,QAARqH,OAAAC,UAAAN,UAAAzM,KAAA0I,MAAA+D","file":"omi.js","sourcesContent":["/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This shim allows elements written in, or compiled to, ES5 to work on native\n * implementations of Custom Elements v1. It sets new.target to the value of\n * this.constructor so that the native HTMLElement constructor can access the\n * current under-construction element's definition.\n */\n;(function() {\n if (\n // No Reflect, no classes, no need for shim because native custom elements\n // require ES2015 classes or Reflect.\n window.Reflect === undefined ||\n window.customElements === undefined ||\n // The webcomponentsjs custom elements polyfill doesn't require\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = HTMLElement\n window.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\nexport function cssToDom(css) {\n const node = document.createElement('style')\n node.textContent = css\n return node\n}\n\nexport function camelCase(str) {\n return str.replace(/-(\\w)/g, ($, $1) => {\n return $1.toUpperCase()\n })\n}\n\nexport function Fragment(props) {\n return props.children\n}\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 != null) {\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 * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\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 getUse(data, paths, out, name) {\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 if (out) out[name] = obj\n return obj\n}\n\nexport function pathToArr(path) {\n if (typeof path !== 'string' || !path) return []\n // return path.split(/\\.|\\[|\\]/).filter(name => !!name)\n return path\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n}\n\nexport function getTargetByPath(origin, path) {\n const arr = pathToArr(path)\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}\n\nconst hyphenateRE = /\\B([A-Z])/g\nexport function hyphenate(str) {\n return str.replace(hyphenateRE, '-$1').toLowerCase()\n}\n\nexport function getValByPath(path, current) {\n const arr = pathToArr(path)\n arr.forEach(prop => {\n current = current[prop]\n })\n return current\n}\n\nexport function getPath(obj, out, name) {\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 if (out) out[name] = result\n return result\n}\n\nexport function removeItem(item, arr) {\n if (!arr) return\n for (let i = 0, len = arr.length; i < len; i++) {\n if (arr[i] === item) {\n arr.splice(i, 1)\n break\n }\n }\n}\n","import options from './options'\nimport { Fragment } from './util'\n\nconst stack = []\n\nexport function h(nodeName, attributes) {\n let 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.length === 0) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n if (nodeName === Fragment) {\n return children\n }\n\n const p = {\n nodeName,\n children,\n attributes: attributes == null ? undefined : attributes,\n key: attributes == null ? undefined : attributes.key\n }\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","import { extend } from '../util'\nimport options from '../options'\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node DOM Node to compare\n * @param {VNode} vnode Virtual DOM node to compare\n * @param {boolean} [hydrating=false] If 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 return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n } else if (typeof vnode.nodeName === 'function') {\n return options.mapping[node.nodeName.toLowerCase()] === 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 A DOM Element to inspect the name of.\n * @param {String} nodeName Unnormalized 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 { pathToArr } from './util'\n\nexport const extension = {}\n\nexport function extend(name, handler) {\n extension['o-' + name] = handler\n}\n\nexport function set(origin, path, value) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n if (i === len - 1) {\n current[arr[i]] = value\n } else {\n current = current[arr[i]]\n }\n }\n}\n\nexport function get(origin, path) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n current = current[arr[i]]\n }\n\n return current\n}\n\nfunction eventProxy(e) {\n return this._listeners[e.type](e)\n}\n\nexport function bind(el, type, handler) {\n el._listeners = el._listeners || {}\n el._listeners[type] = handler\n el.addEventListener(type, eventProxy)\n}\n\nexport function unbind(el, type) {\n el.removeEventListener(type, eventProxy)\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\nimport { extension } from '../extend'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg, component) {\n if (name === 'className') name = 'class'\n\n if (name[0] == 'o' && name[1] == '-') {\n if (extension[name]) {\n extension[name](node, value, component)\n }\n } else 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 (!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 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 let nameLower = name.toLowerCase()\n name = (nameLower in node ? nameLower : name).slice(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 (node.nodeName === 'INPUT' && name === 'value') {\n node[name] = value == null ? '' : value\n } else if (\n name !== 'list' &&\n name !== 'type' &&\n name !== 'css' &&\n !isSvg &&\n name in node &&\n value !== ''\n ) {\n //value !== '' fix for selected, disabled, checked with pure element\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\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\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : 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 {\n node.pureSetAttribute\n ? node.pureSetAttribute(name, value)\n : node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @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}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { camelCase, isArray, Fragment } from '../util'\nimport { removeNode } from '../dom/index'\nimport options from '../options'\n\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/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n * @param {Element} [dom=null] A DOM node to mutate into the shape of the `vnode`\n * @param {VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure\n * @returns {Element} dom The created/mutated element\n * @private\n */\nexport function diff(dom, vnode, parent, component, updateSelf) {\n //first render return undefined\n if (!dom && !vnode) return\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\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 if (vnode && vnode.nodeName === Fragment) {\n vnode = vnode.children\n }\n if (isArray(vnode)) {\n if (parent) {\n const styles = parent.querySelectorAll('style')\n styles.forEach(s => {\n parent.removeChild(s)\n })\n innerDiffNode(parent, vnode, hydrating, component, updateSelf)\n\n for (let i = styles.length - 1; i >= 0; i--) {\n parent.firstChild\n ? parent.insertBefore(styles[i], parent.firstChild)\n : parent.appendChild(style[i])\n }\n } else {\n ret = []\n vnode.forEach((item, index) => {\n let ele = idiff(index === 0 ? dom : null, item, component, updateSelf)\n ret.push(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n dom.forEach((one, index) => {\n if (index === 0) {\n ret = idiff(one, vnode, component, updateSelf)\n } else {\n recollectNodeTree(one, false)\n }\n })\n } else {\n ret = idiff(dom, vnode, component, updateSelf)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\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 }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, component, updateSelf) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\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 // 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 || component)\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 out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n if (typeof vnodeName === 'function') {\n for (let key in options.mapping) {\n if (options.mapping[key] === vnodeName) {\n vnodeName = key\n vnode.nodeName = key\n break\n }\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 if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n hydrating || props.dangerouslySetInnerHTML != null,\n component,\n updateSelf\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, component, updateSelf)\n if (out.props) {\n out.props.children = vnode.children\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 * @param {Element} dom Element whose children should be compared & mutated\n * @param {Array} vchildren Array of VNodes to compare to `dom.childNodes`\n * @param {Boolean} isHydrating If `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, isHydrating, component, updateSelf) {\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, component, updateSelf)\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 * @param {Node} node DOM node to start unmount/removal from\n * @param {Boolean} [unmountOnly=false] If `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\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 && node[ATTR_KEY].ref) {\n if (typeof node[ATTR_KEY].ref === 'function') {\n node[ATTR_KEY].ref(null)\n } else if (node[ATTR_KEY].ref.current) {\n node[ATTR_KEY].ref.current = null\n }\n }\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n * - we use .lastChild here because it causes less reflow than .firstChild\n * - 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 * @param {Element} dom Element with attributes to diff `attrs` against\n * @param {Object} attrs The desired end-state key-value attribute pairs\n * @param {Object} old Current/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, component, updateSelf) {\n let name\n //let update = false\n let isWeElement = dom.update\n let oldClone\n if (dom.receiveProps) {\n oldClone = Object.assign({}, old)\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(\n dom,\n name,\n old[name],\n (old[name] = undefined),\n isSvgMode,\n component\n )\n if (isWeElement) {\n delete dom.props[name]\n //update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (isWeElement && typeof attrs[name] === 'object' && name !== 'ref') {\n if (name === 'style') {\n setAccessor(\n dom,\n name,\n old[name],\n (old[name] = attrs[name]),\n isSvgMode,\n component\n )\n }\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else if (\n name !== 'children' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], attrs[name], isSvgMode, component)\n if (isWeElement) {\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else {\n old[name] = attrs[name]\n }\n }\n }\n\n if (isWeElement && !updateSelf && dom.parentNode) {\n //__hasChildren is not accuracy when it was empty at first, so add dom.children.length > 0 condition\n //if (update || dom.__hasChildren || dom.children.length > 0 || (dom.store && !dom.store.data)) {\n if (dom.receiveProps(dom.props, oldClone) !== false) {\n dom.update()\n }\n //}\n }\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\nimport { getUse } from './util'\nimport options from './options'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n if (store.data) {\n observeStore(store)\n } else {\n options.isMultiStore = true\n //Multi-store injection\n for (let key in store) {\n observeStore(store[key], key)\n }\n }\n parent.store = store\n }\n return diff(null, vnode, parent, false)\n}\n\nfunction observeStore(store, key) {\n store.instances = []\n store.updateSelfInstances = []\n extendStoreUpdate(store, key)\n\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n const patchs = {}\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n\n update(patchs, store)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n\n update(patchs, store)\n }\n })\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpdate(store, key) {\n store.update = function(patch) {\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updatePath &&\n instance._updatePath[key] &&\n needUpdate(patch, instance._updatePath[key])\n ) {\n if (instance.use) {\n getUse(\n store.data,\n (typeof instance.use === 'function'\n ? instance.use()\n : instance.use)[key],\n instance.using,\n key\n )\n }\n\n instance.update()\n }\n } else {\n if (instance._updatePath && needUpdate(patch, instance._updatePath)) {\n if (instance.use) {\n instance.using = getUse(\n store.data,\n typeof instance.use === 'function'\n ? instance.use()\n : instance.use\n )\n }\n\n instance.update()\n }\n }\n })\n\n this.updateSelfInstances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updateSelfPath &&\n instance._updateSelfPath[key] &&\n needUpdate(patch, instance._updateSelfPath[key])\n ) {\n if (instance.useSelf) {\n getUse(\n store.data,\n (typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf)[key],\n instance.usingSelf,\n key\n )\n }\n\n instance.updateSelf()\n }\n } else {\n if (\n instance._updateSelfPath &&\n needUpdate(patch, instance._updateSelfPath)\n ) {\n instance.usingSelf = getUse(\n store.data,\n typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf\n )\n instance.updateSelf()\n }\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nfunction compute(instance, isMultiStore) {\n if (instance.compute) {\n for (let ck in instance.compute) {\n instance.computed[ck] = instance.compute[ck].call(\n isMultiStore ? instance.store : instance.store.data\n )\n }\n }\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 {\n k: fixArrPath(path),\n v: current\n }\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 WeElement from './we-element'\nimport options from './options'\n\nconst storeHelpers = ['use', 'useSelf']\n\nexport function define(name, ctor, config) {\n if (options.mapping[name]) {\n return\n }\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n options.mapping[name] = ctor\n } else {\n if (typeof config === 'string') {\n config = { css: config }\n } else {\n config = config || {}\n }\n\n class Ele extends WeElement {\n static css = config.css\n\n static propTypes = config.propTypes\n\n static defaultProps = config.defaultProps\n\n static isLightDom = config.isLightDom\n\n compute = config.compute\n\n render() {\n return ctor.call(this, this)\n }\n }\n\n for (let key in config) {\n if (typeof config[key] === 'function') {\n Ele.prototype[key] = function () {\n return config[key].apply(this, arguments)\n }\n }\n }\n\n storeHelpers.forEach(func => {\n if (config[func] && config[func] !== 'function') {\n Ele.prototype[func] = function () {\n return config[func]\n }\n }\n })\n\n customElements.define(name, Ele)\n options.mapping[name] = Ele\n }\n}\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 The virtual DOM element to clone\n * @param {Object} props Attributes/props to add when cloning\n * @param {VNode} rest Any 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","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else if (p.shadowRoot && p.shadowRoot.host) {\n return p.shadowRoot.host\n } else {\n p = p.parentNode\n }\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.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 if (args.length > 0) {\n return { class: classNames.apply(null, args) }\n }\n}\n","export function o(obj) {\n return JSON.stringify(obj)\n}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { classNames, extractClass } from './class'\nimport { o } from './o'\nimport htm from 'htm'\nimport { extend, get, set, bind, unbind } from './extend'\nimport JSONProxy from './proxy'\nimport { Fragment } from './util'\n\nh.f = Fragment\n\nconst html = htm.bind(h)\n\nfunction createRef() {\n\treturn {}\n}\n\nconst $ = {}\nconst Component = WeElement\nconst defineElement = define\nconst elements = options.mapping\n\nconst omi = {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n\noptions.root.Omi = omi\noptions.root.omi = omi\noptions.root.Omi.version = '6.18.1'\n\nexport default omi\n\nexport {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n","function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function () {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n * @public\n * @namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal(),\n mapping: {},\n isMultiStore: false,\n //when set true, using props of hypescript, don't use getAttribute\n //if you render all the node tree by omi self, set it\n ignoreAttrs: false\n}\n","import {\n\tcssToDom,\n\tisArray,\n\tgetUse,\n\thyphenate,\n\tgetValByPath,\n\tremoveItem\n} from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { getPath } from './util'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n\tstatic is = 'WeElement'\n\n\tconstructor() {\n\t\tsuper()\n\t\tthis.props = Object.assign({}, this.constructor.defaultProps)\n\t\tthis.elementId = id++\n\t\tthis.computed = {}\n\t}\n\n\tconnectedCallback() {\n\t\tlet p = this.parentNode\n\t\twhile (p && !this.store) {\n\t\t\tthis.store = p.store\n\t\t\tp = p.parentNode || p.host\n\t\t}\n\n\t\tthis.attrsToProps()\n\n\t\tif (this.props.use) {\n\t\t\tthis.use = this.props.use\n\t\t}\n\n\t\tif (this.props.useSelf) {\n\t\t\tthis.use = this.props.useSelf\n\t\t}\n\n\t\tif (this.use) {\n\t\t\tconst use = typeof this.use === 'function' ? this.use() : this.use\n\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\t_updatePath[storeName] = {}\n\t\t\t\t\tusing[storeName] = {}\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].instances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.using = using\n\t\t\t\tthis._updatePath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updatePath = getPath(use)\n\t\t\t\tthis.using = getUse(this.store.data, use)\n\t\t\t\tthis.store.instances.push(this)\n\t\t\t}\n\t\t}\n\t\tif (this.useSelf) {\n\t\t\tconst use =\n\t\t\t\ttypeof this.useSelf === 'function' ? this.useSelf() : this.useSelf\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].updateSelfInstances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.usingSelf = using\n\t\t\t\tthis._updateSelfPath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updateSelfPath = getPath(use)\n\t\t\t\tthis.usingSelf = getUse(this.store.data, use)\n\t\t\t\tthis.store.updateSelfInstances.push(this)\n\t\t\t}\n\t\t}\n\n\t\tif (this.compute) {\n\t\t\tfor (let key in this.compute) {\n\t\t\t\tthis.computed[key] = this.compute[key].call(\n\t\t\t\t\toptions.isMultiStore ? this.store : this.store.data\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeInstall()\n\t\tthis.install()\n\t\tthis.afterInstall()\n\n\t\tlet shadowRoot\n\t\tif (this.constructor.isLightDom) {\n\t\t\tshadowRoot = this\n\t\t} else {\n\n\t\t\tif (!this.shadowRoot) {\n\t\t\t\tshadowRoot = this.attachShadow({\n\t\t\t\t\tmode: 'open'\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tshadowRoot = this.shadowRoot\n\t\t\t\tlet fc\n\t\t\t\twhile ((fc = shadowRoot.firstChild)) {\n\t\t\t\t\tshadowRoot.removeChild(fc)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.constructor.css) {\n\t\t\t\tshadowRoot.appendChild(cssToDom(this.constructor.css))\n\t\t\t} else if (this.css) {\n\t\t\t\tshadowRoot.appendChild(\n\t\t\t\t\tcssToDom(typeof this.css === 'function' ? this.css() : this.css)\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeRender()\n\t\toptions.afterInstall && options.afterInstall(this)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.__hasChildren =\n\t\t\tObject.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\trendered.length > 0\n\n\t\tthis.rootNode = diff(null, rendered, null, this)\n\t\tthis.rendered()\n\n\t\tif (this.props.css) {\n\t\t\tthis._customStyleElement = cssToDom(this.props.css)\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tshadowRoot.appendChild(this._customStyleElement)\n\t\t}\n\n\t\tif (isArray(this.rootNode)) {\n\t\t\tthis.rootNode.forEach(function (item) {\n\t\t\t\tshadowRoot.appendChild(item)\n\t\t\t})\n\t\t} else {\n\t\t\tthis.rootNode && shadowRoot.appendChild(this.rootNode)\n\t\t}\n\t\tthis.installed()\n\t\tthis._isInstalled = true\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.uninstall()\n\t\tthis._isInstalled = false\n\t\tif (this.store) {\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tfor (let key in this.store) {\n\t\t\t\t\tconst current = this.store[key]\n\t\t\t\t\tremoveItem(this, current.instances)\n\t\t\t\t\tremoveItem(this, current.updateSelfInstances)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tremoveItem(this, this.store.instances)\n\t\t\t\tremoveItem(this, this.store.updateSelfInstances)\n\t\t\t}\n\t\t}\n\t}\n\n\tupdate(ignoreAttrs, updateSelf) {\n\t\tthis._willUpdate = true\n\t\tthis.beforeUpdate()\n\t\tthis.beforeRender()\n\t\t//fix null !== undefined\n\t\tif (this._customStyleContent != this.props.css) {\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tthis._customStyleElement.textContent = this._customStyleContent\n\t\t}\n\t\tthis.attrsToProps(ignoreAttrs)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.rendered()\n\t\tthis.__hasChildren =\n\t\t\tthis.__hasChildren ||\n\t\t\t(Object.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\t\trendered.length > 0)\n\n\t\tthis.rootNode = diff(\n\t\t\tthis.rootNode,\n\t\t\trendered,\n\t\t\tthis.shadowRoot,\n\t\t\tthis,\n\t\t\tupdateSelf\n\t\t)\n\t\tthis._willUpdate = false\n\t\tthis.updated()\n\t}\n\n\tforceUpdate() {\n\t\tthis.update(true)\n\t}\n\n\tupdateProps(obj) {\n\t\tObject.keys(obj).forEach(key => {\n\t\t\tthis.props[key] = obj[key]\n\t\t\tif (this.prevProps) {\n\t\t\t\tthis.prevProps[key] = obj[key]\n\t\t\t}\n\t\t})\n\t\tthis.forceUpdate()\n\t}\n\n\tupdateSelf(ignoreAttrs) {\n\t\tthis.update(ignoreAttrs, true)\n\t}\n\n\tremoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t\t//Avoid executing removeAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tsetAttribute(key, val) {\n\t\tif (val && typeof val === 'object') {\n\t\t\tsuper.setAttribute(key, JSON.stringify(val))\n\t\t} else {\n\t\t\tsuper.setAttribute(key, val)\n\t\t}\n\t\t//Avoid executing setAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tpureRemoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t}\n\n\tpureSetAttribute(key, val) {\n\t\tsuper.setAttribute(key, val)\n\t}\n\n\tattrsToProps(ignoreAttrs) {\n\t\tif (options.ignoreAttrs || ignoreAttrs) return\n\t\tconst ele = this\n\t\tele.props['css'] = ele.getAttribute('css')\n\t\tconst attrs = this.constructor.propTypes\n\t\tif (!attrs) return\n\t\tObject.keys(attrs).forEach(key => {\n\t\t\tconst type = attrs[key]\n\t\t\tconst val = ele.getAttribute(hyphenate(key))\n\t\t\tif (val !== null) {\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase String:\n\t\t\t\t\t\tele.props[key] = val\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Number:\n\t\t\t\t\t\tele.props[key] = Number(val)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Boolean:\n\t\t\t\t\t\tif (val === 'false' || val === '0') {\n\t\t\t\t\t\t\tele.props[key] = false\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Array:\n\t\t\t\t\tcase Object:\n\t\t\t\t\t\tif (val[0] === ':') {\n\t\t\t\t\t\t\tele.props[key] = getValByPath(val.substr(1), Omi.$)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = JSON.parse(\n\t\t\t\t\t\t\t\tval\n\t\t\t\t\t\t\t\t\t.replace(/(['\"])?([a-zA-Z0-9_-]+)(['\"])?:([^\\/])/g, '\"$2\":$4')\n\t\t\t\t\t\t\t\t\t.replace(/'([\\s\\S]*?)'/g, '\"$1\"')\n\t\t\t\t\t\t\t\t\t.replace(/,(\\s*})/g, '$1')\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tele.constructor.defaultProps &&\n\t\t\t\t\tele.constructor.defaultProps.hasOwnProperty(key)\n\t\t\t\t) {\n\t\t\t\t\tele.props[key] = ele.constructor.defaultProps[key]\n\t\t\t\t} else {\n\t\t\t\t\tele.props[key] = null\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tfire(name, data) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(name, {\n\t\t\t\tdetail: data\n\t\t\t})\n\t\t)\n\t}\n\n\tbeforeInstall() { }\n\n\tinstall() { }\n\n\tafterInstall() { }\n\n\tinstalled() { }\n\n\tuninstall() { }\n\n\tbeforeUpdate() { }\n\n\tupdated() { }\n\n\tbeforeRender() { }\n\n\trendered() { }\n\n\treceiveProps() { }\n}\n","var n=function(t,r,u,e){for(var p=1;p\"===t?(a(),u=1):u&&(\"=\"===t?(u=4,r=e,e=\"\"):\"/\"===t?(a(),3===u&&(s=s[0]),u=s,(s=s[0]).push(u,4),u=0):\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t?(a(),u=2):e+=t)}return a(),s},r=\"function\"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)),r}:function(n){for(var r=\"\",e=0;e1?r:r[0]}\n"]} \ No newline at end of file diff --git a/packages/omi/dist/omi.min.js b/packages/omi/dist/omi.min.js index 88ca8bb6f..edb14bdc9 100644 --- a/packages/omi/dist/omi.min.js +++ b/packages/omi/dist/omi.min.js @@ -1,2 +1,2 @@ -!function(){"use strict";function e(e){var t=document.createElement("style");return t.textContent=e,t}function t(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})}function r(e){return e.children}function n(e,t){for(var r in t)e[r]=t[r];return e}function o(e,t){null!=e&&("function"==typeof e?e(t):e.current=t)}function i(e){return"[object Array]"===Object.prototype.toString.call(e)}function s(e,t,r,n){var o=[];return t.forEach(function(t,r){if("string"==typeof t)o[r]=p(e,t);else{var n=Object.keys(t)[0],i=t[n];if("string"==typeof i)o[r]=p(e,i);else{var s=i[0];if("string"==typeof s){var a=p(e,s);o[r]=i[1]?i[1](a):a}else{var l=[];s.forEach(function(t){l.push(p(e,t))}),o[r]=i[1].apply(null,l)}}o[n]=o[r]}}),r&&(r[n]=o),o}function a(e){return"string"==typeof e&&e?e.replace(/]/g,"").replace(/\[/g,".").split("."):[]}function p(e,t){for(var r=a(t),n=e,o=0,i=r.length;o2;)pe.push(arguments[s]);t&&null!=t.children&&(pe.length||pe.push(t.children),delete t.children);while(pe.length)if((o=pe.pop())&&void 0!==o.pop)for(s=o.length;s--;)pe.push(o[s]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof e)&&(null==o?o="":"number"==typeof o?o+="":"string"!=typeof o&&(i=!1)),i&&n?a[a.length-1]+=o:0===a.length?a=[o]:a.push(o),n=i;if(e===r)return a;var p={nodeName:e,children:a,attributes:null==t?void 0:t,key:null==t?void 0:t.key};return void 0!==se.vnode&&se.vnode(p),p}function d(e,t,r){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&y(e,t.nodeName):"function"==typeof t.nodeName?se.mapping[e.nodeName.toLowerCase()]===t.nodeName:r||e._componentConstructor===t.nodeName}function y(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function v(e,t){ue["o-"+e]=t}function b(e,t,r){for(var n=a(t),o=e,i=0,s=n.length;i=0;l--)n.firstChild?n.insertBefore(p[l],n.firstChild):n.appendChild(style[l])}else a=[],t.forEach(function(t,r){var n=C(0===r?e:null,t,o,s);a.push(n)});else i(e)?e.forEach(function(e,r){0===r?a=C(e,t,o,s):A(e,!1)}):a=C(e,t,o,s),n&&a.parentNode!==n&&n.appendChild(a);return--ce||(he=!1),a}}function C(e,t,r,n){e&&t&&e.props&&(e.props.children=t.children);var o=e,i=fe;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(o=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(o,e),A(e,!0))),o.__p=!0,o;var s=t.nodeName;if("function"==typeof s)for(var a in se.mapping)if(se.mapping[a]===s){s=a,t.nodeName=a;break}if(fe="svg"===s||"foreignObject"!==s&&fe,s+="",(!e||!y(e,s))&&(o=N(s,fe),e)){while(e.firstChild)o.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(o,e),A(e,!0)}var p=o.firstChild,l=o.__p,u=t.children;if(null==l){l=o.__p={};for(var c=o.attributes,f=c.length;f--;)l[c[f].name]=c[f].value}return!he&&u&&1===u.length&&"string"==typeof u[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=u[0]&&(p.nodeValue=u[0]):(u&&u.length||null!=p)&&("WeElement"==o.constructor.is&&o.constructor.noSlot||M(o,u,he||null!=l.dangerouslySetInnerHTML,r,n)),k(o,t.attributes,l,r,n),o.props&&(o.props.children=t.children),fe=i,o}function M(e,t,r,n,o){var i,s,a,p,l,u=e.childNodes,c=[],f={},h=0,y=0,v=u.length,b=0,g=t?t.length:0;if(0!==v)for(var m=0;m0&&(this.instances.forEach(function(n){W(n,t),t?n.M&&n.M[t]&&F(r,n.M[t])&&(n.use&&s(e.data,("function"==typeof n.use?n.use():n.use)[t],n.using,t),n.update()):n.M&&F(r,n.M)&&(n.use&&(n.using=s(e.data,"function"==typeof n.use?n.use():n.use)),n.update())}),this.updateSelfInstances.forEach(function(n){W(n,t),t?n.R&&n.R[t]&&F(r,n.R[t])&&(n.useSelf&&s(e.data,("function"==typeof n.useSelf?n.useSelf():n.useSelf)[t],n.usingSelf,t),n.updateSelf()):n.R&&F(r,n.R)&&(n.usingSelf=s(e.data,"function"==typeof n.useSelf?n.useSelf():n.useSelf),n.updateSelf())}),this.onChange&&this.onChange(r))}}function W(e,t){if(e.compute)for(var r in e.compute)e.computed[r]=e.compute[r].call(t?e.store:e.store.data)}function F(e,t){for(var r in e){if(t[r])return!0;for(var n in t)if(V(r,n))return!0}return!1}function V(e,t){if(0===e.indexOf(t)){var r=e.substr(t.length,1);if("["===r||"."===r)return!0}return!1}function U(e){var t="";return e.replace("/","").split("/").forEach(function(e,r){r?isNaN(+e)?t+="."+e:t+="["+e+"]":t+=e}),t}function Y(e,t){for(var r=e.replace("/","").split("/"),n=t.data[r[0]],o=1,i=r.length;o2?[].slice.call(arguments,2):e.children)}function Q(e){var t=e.parentNode;while(t){if(t.host)return t.host;if(t.shadowRoot&&t.shadowRoot.host)return t.shadowRoot.host;t=t.parentNode}}function ee(e){return e.replace(/([1-9]\d*|0)(\.\d*)*rpx/g,function(e,t){return window.innerWidth*+t/750+"px"})}function te(){for(var e=[],t=0;t0)return{class:te.apply(null,r)}}function ne(e){return JSON.stringify(e)}function oe(e){var t=me(this,Se(e),arguments,[]);return t.length>1?t:t[0]}function ie(){return{}}var se={store:null,root:function(){return"object"==typeof global&&global&&global.Math===Math&&global.Array===Array?global:self||window||global||function(){return this}()}(),mapping:{},isMultiStore:!1,ignoreAttrs:!1};!function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.hasOwnProperty("polyfillWrapFlushCallback")){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}(),"function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;var ae=/\B([A-Z])/g,pe=[],le=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ue={},ce=0,fe=!1,he=!1,de=0,ye=function(t){function r(){R(this,r);var e=L(this,t.call(this));return e.props=Object.assign({},e.constructor.defaultProps),e.elementId=de++,e.computed={},e}return I(r,t),r.prototype.connectedCallback=function(){var t=this.parentNode;while(t&&!this.store)this.store=t.store,t=t.parentNode||t.host;if(this.attrsToProps(),this.props.use&&(this.use=this.props.use),this.props.useSelf&&(this.use=this.props.useSelf),this.use){var r="function"==typeof this.use?this.use():this.use;if(se.isMultiStore){var n={},o={};for(var a in r)n[a]={},o[a]={},c(r[a],n,a),s(this.store[a].data,r[a],o,a),this.store[a].instances.push(this);this.using=o,this.M=n}else this.M=c(r),this.using=s(this.store.data,r),this.store.instances.push(this)}if(this.useSelf){var p="function"==typeof this.useSelf?this.useSelf():this.useSelf;if(se.isMultiStore){var l={},u={};for(var f in p)c(p[f],l,f),s(this.store[f].data,p[f],u,f),this.store[f].updateSelfInstances.push(this);this.usingSelf=u,this.R=l}else this.R=c(p),this.usingSelf=s(this.store.data,p),this.store.updateSelfInstances.push(this)}if(this.compute)for(var h in this.compute)this.computed[h]=this.compute[h].call(se.isMultiStore?this.store:this.store.data);this.beforeInstall(),this.install(),this.afterInstall();var d;if(this.constructor.isLightDom)d=this;else{if(this.shadowRoot){d=this.shadowRoot;var y;while(y=d.firstChild)d.removeChild(y)}else d=this.attachShadow({mode:"open"});this.constructor.css?d.appendChild(e(this.constructor.css)):this.css&&d.appendChild(e("function"==typeof this.css?this.css():this.css))}this.beforeRender(),se.afterInstall&&se.afterInstall(this);var v=this.render(this.props,this.store);this.P="[object Array]"===Object.prototype.toString.call(v)&&v.length>0,this.rootNode=j(null,v,null,this),this.rendered(),this.props.css&&(this.N=e(this.props.css),this.O=this.props.css,d.appendChild(this.N)),i(this.rootNode)?this.rootNode.forEach(function(e){d.appendChild(e)}):this.rootNode&&d.appendChild(this.rootNode),this.installed(),this.B=!0},r.prototype.disconnectedCallback=function(){if(this.uninstall(),this.B=!1,this.store)if(se.isMultiStore)for(var e in this.store){var t=this.store[e];f(this,t.instances),f(this,t.updateSelfInstances)}else f(this,this.store.instances),f(this,this.store.updateSelfInstances)},r.prototype.update=function(e,t){this.J=!0,this.beforeUpdate(),this.beforeRender(),this.O!=this.props.css&&(this.O=this.props.css,this.N.textContent=this.O),this.attrsToProps(e);var r=this.render(this.props,this.store);this.rendered(),this.P=this.P||"[object Array]"===Object.prototype.toString.call(r)&&r.length>0,this.rootNode=j(this.rootNode,r,this.shadowRoot,this,t),this.J=!1,this.updated()},r.prototype.forceUpdate=function(){this.update(!0)},r.prototype.updateProps=function(e){var t=this;Object.keys(e).forEach(function(r){t.props[r]=e[r],t.__p&&(t.__p[r]=e[r])}),this.forceUpdate()},r.prototype.updateSelf=function(e){this.update(e,!0)},r.prototype.removeAttribute=function(e){t.prototype.removeAttribute.call(this,e),this.B&&this.update()},r.prototype.setAttribute=function(e,r){r&&"object"==typeof r?t.prototype.setAttribute.call(this,e,JSON.stringify(r)):t.prototype.setAttribute.call(this,e,r),this.B&&this.update()},r.prototype.pureRemoveAttribute=function(e){t.prototype.removeAttribute.call(this,e)},r.prototype.pureSetAttribute=function(e,r){t.prototype.setAttribute.call(this,e,r)},r.prototype.attrsToProps=function(e){if(!se.ignoreAttrs&&!e){var t=this;t.props.css=t.getAttribute("css");var r=this.constructor.propTypes;r&&Object.keys(r).forEach(function(e){var n=r[e],o=t.getAttribute(l(e));if(null!==o)switch(n){case String:t.props[e]=o;break;case Number:t.props[e]=+o;break;case Boolean:t.props[e]="false"!==o&&"0"!==o;break;case Array:case Object:t.props[e]=":"===o[0]?u(o.substr(1),Omi.$):JSON.parse(o.replace(/(['"])?([a-zA-Z0-9_-]+)(['"])?:([^\/])/g,'"$2":$4').replace(/'([\s\S]*?)'/g,'"$1"').replace(/,(\s*})/g,"$1"))}else t.props[e]=t.constructor.defaultProps&&t.constructor.defaultProps.hasOwnProperty(e)?t.constructor.defaultProps[e]:null})}},r.prototype.fire=function(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t}))},r.prototype.beforeInstall=function(){},r.prototype.install=function(){},r.prototype.afterInstall=function(){},r.prototype.installed=function(){},r.prototype.uninstall=function(){},r.prototype.beforeUpdate=function(){},r.prototype.updated=function(){},r.prototype.beforeRender=function(){},r.prototype.rendered=function(){},r.prototype.receiveProps=function(){},r}(HTMLElement);ye.is="WeElement";var ve=function(){function e(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function t(e){return-1==e.indexOf("/")&&-1==e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function r(e,t){var r=[],n=e.parenthoodMap.get(t);while(n&&n.path)r.unshift(n.path),n=e.parenthoodMap.get(n.parent);if(r.length){return"/"+r.join("/")}return""}function n(e,n,o,i){var s=r(e,n),a=s+"/"+t(o);if(e.proxifiedObjectsMap.has(i)){e.parenthoodMap.set(e.proxifiedObjectsMap.get(i).originalObject,{parent:n,path:o})}var p=e.proxifiedObjectsMap.get(i);p&&!e.isProxifyingTreeNow&&(p.inherited=!0),i&&"object"==typeof i&&!e.proxifiedObjectsMap.has(i)&&(e.parenthoodMap.set(i,{parent:n,path:o}),i=e.A(n,i,o));var l={op:"remove",path:a};if(void 0===i){if(!Array.isArray(n)&&!n.hasOwnProperty(o))return Reflect.set(n,o,i);Array.isArray(n)&&(l.op="replace",l.value=null);var u=e.proxifiedObjectsMap.get(n[o]);u&&(e.parenthoodMap.delete(n[o]),e.disableTrapsForProxy(u),e.proxifiedObjectsMap.delete(u))}else{if(Array.isArray(n)&&!Number.isInteger(+(""+o)))return"length"!=o&&console.warn("JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch"),Reflect.set(n,o,i);l.op="add",n.hasOwnProperty(o)&&(void 0!==n[o]||Array.isArray(n))&&(l.op="replace"),l.value=i}l.oldValue=n[o];var c=Reflect.set(n,o,i);return e.defaultCallback(l),c}function o(e,n,o){if(void 0!==n[o]){var i=r(e,n),s=i+"/"+t(o),a=e.proxifiedObjectsMap.get(n[o]);a&&(a.inherited?a.inherited=!1:(e.parenthoodMap.delete(a.originalObject),e.disableTrapsForProxy(a),e.proxifiedObjectsMap.delete(n[o])));var p=Reflect.deleteProperty(n,o);return e.defaultCallback({op:"remove",path:s}),p}}function i(){var e=this;this.defaultCallback=function(t){e.isRecording&&e.patches.push(t),e.userCallback&&e.userCallback(t)},this.isObserving=!0}function s(){this.defaultCallback=function(){},this.isObserving=!1}function a(e,t){this.isProxifyingTreeNow=!1,this.isObserving=!1,this.proxifiedObjectsMap=new Map,this.parenthoodMap=new Map,"boolean"!=typeof t&&(t=!0),this.showDetachedWarning=t,this.originalObject=e,this.cachedProxy=null,this.isRecording=!1,this.resume=i.bind(this),this.pause=s.bind(this)}return a.deepClone=e,a.escapePathComponent=t,a.prototype.generateProxyAtPath=function(e,t,r){var i=this;if(!t)return t;var s={set:function(e,t,r){return n(i,e,t,r)},deleteProperty:function(e,t){return o(i,e,t)}},a=Proxy.revocable(t,s);return a.trapsInstance=s,a.originalObject=t,this.parenthoodMap.set(t,{parent:e,path:r}),this.proxifiedObjectsMap.set(a.proxy,a),a.proxy},a.prototype.A=function(e,r,n){for(var o in r)r.hasOwnProperty(o)&&r[o]instanceof Object&&(r[o]=this.A(r,r[o],t(o)));return this.generateProxyAtPath(e,r,n)},a.prototype.proxifyObjectTree=function(e){this.pause(),this.isProxifyingTreeNow=!0;var t=this.A(void 0,e,"");return this.isProxifyingTreeNow=!1,this.resume(),t},a.prototype.disableTrapsForProxy=function(e){if(this.showDetachedWarning){var t="You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects";e.trapsInstance.set=function(e,r,n){return console.warn(t),Reflect.set(e,r,n)},e.trapsInstance.set=function(e,r,n){return console.warn(t),Reflect.set(e,r,n)},e.trapsInstance.deleteProperty=function(e,t){return Reflect.deleteProperty(e,t)}}else delete e.trapsInstance.set,delete e.trapsInstance.get,delete e.trapsInstance.deleteProperty},a.prototype.observe=function(e,t){if(!e&&!t)throw Error("You need to either record changes or pass a callback");return this.isRecording=e,this.userCallback=t,e&&(this.patches=[]),this.cachedProxy=this.proxifyObjectTree(this.originalObject)},a.prototype.generate=function(){if(!this.isRecording)throw Error("You should set record to true to get patches later");return this.patches.splice(0,this.patches.length)},a.prototype.revoke=function(){this.proxifiedObjectsMap.forEach(function(e){e.revoke()})},a.prototype.disableTraps=function(){this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy,this)},a}(),be=["use","useSelf"],ge={}.hasOwnProperty,me=function(e,t,r,n){for(var o=1;o=5&&((o||!e&&5===n)&&(s.push(o,n,r),n=6),e&&(s.push(e,n,r),n=6)),o=""},p=0;p"===t?(n=1,o=""):o=t+o[0]:i?t===i?i="":o+=t:'"'===t||"'"===t?i=t:">"===t?(a(),n=1):n&&("="===t?(n=5,r=o,o=""):"/"===t&&(n<5||">"===e[p][l+1])?(a(),3===n&&(s=s[0]),n=s,(s=s[0]).push(n,2),n=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),n=2):o+=t),3===n&&"!--"===o&&(n=4,s=s[0])}return a(),s},Oe="function"==typeof Map,Ne=Oe?new Map:{},Se=Oe?function(e){var t=Ne.get(e);return t||Ne.set(e,t=we(e)),t}:function(e){for(var t="",r=0;r2;)pe.push(arguments[s]);t&&null!=t.children&&(pe.length||pe.push(t.children),delete t.children);while(pe.length)if((o=pe.pop())&&void 0!==o.pop)for(s=o.length;s--;)pe.push(o[s]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof e)&&(null==o?o="":"number"==typeof o?o+="":"string"!=typeof o&&(i=!1)),i&&n?a[a.length-1]+=o:0===a.length?a=[o]:a.push(o),n=i;if(e===r)return a;var p={nodeName:e,children:a,attributes:null==t?void 0:t,key:null==t?void 0:t.key};return void 0!==se.vnode&&se.vnode(p),p}function d(e,t,r){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&y(e,t.nodeName):"function"==typeof t.nodeName?se.mapping[e.nodeName.toLowerCase()]===t.nodeName:r||e._componentConstructor===t.nodeName}function y(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function v(e,t){ue["o-"+e]=t}function g(e,t,r){for(var n=a(t),o=e,i=0,s=n.length;i=0;l--)n.firstChild?n.insertBefore(p[l],n.firstChild):n.appendChild(style[l])}else a=[],t.forEach(function(t,r){var n=C(0===r?e:null,t,o,s);a.push(n)});else i(e)?e.forEach(function(e,r){0===r?a=C(e,t,o,s):A(e,!1)}):a=C(e,t,o,s),n&&a.parentNode!==n&&n.appendChild(a);return--ce||(he=!1),a}}function C(e,t,r,n){e&&t&&e.props&&(e.props.children=t.children);var o=e,i=fe;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(o=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(o,e),A(e,!0))),o.__p=!0,o;var s=t.nodeName;if("function"==typeof s)for(var a in se.mapping)if(se.mapping[a]===s){s=a,t.nodeName=a;break}if(fe="svg"===s||"foreignObject"!==s&&fe,s+="",(!e||!y(e,s))&&(o=N(s,fe),e)){while(e.firstChild)o.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(o,e),A(e,!0)}var p=o.firstChild,l=o.__p,u=t.children;if(null==l){l=o.__p={};for(var c=o.attributes,f=c.length;f--;)l[c[f].name]=c[f].value}return!he&&u&&1===u.length&&"string"==typeof u[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=u[0]&&(p.nodeValue=u[0]):(u&&u.length||null!=p)&&("WeElement"==o.constructor.is&&o.constructor.noSlot||M(o,u,he||null!=l.dangerouslySetInnerHTML,r,n)),k(o,t.attributes,l,r,n),o.props&&(o.props.children=t.children),fe=i,o}function M(e,t,r,n,o){var i,s,a,p,l,u=e.childNodes,c=[],f={},h=0,y=0,v=u.length,g=0,b=t?t.length:0;if(0!==v)for(var m=0;m0&&(this.instances.forEach(function(n){W(n,t),t?n.M&&n.M[t]&&F(r,n.M[t])&&(n.use&&s(e.data,("function"==typeof n.use?n.use():n.use)[t],n.using,t),n.update()):n.M&&F(r,n.M)&&(n.use&&(n.using=s(e.data,"function"==typeof n.use?n.use():n.use)),n.update())}),this.updateSelfInstances.forEach(function(n){W(n,t),t?n.R&&n.R[t]&&F(r,n.R[t])&&(n.useSelf&&s(e.data,("function"==typeof n.useSelf?n.useSelf():n.useSelf)[t],n.usingSelf,t),n.updateSelf()):n.R&&F(r,n.R)&&(n.usingSelf=s(e.data,"function"==typeof n.useSelf?n.useSelf():n.useSelf),n.updateSelf())}),this.onChange&&this.onChange(r))}}function W(e,t){if(e.compute)for(var r in e.compute)e.computed[r]=e.compute[r].call(t?e.store:e.store.data)}function F(e,t){for(var r in e){if(t[r])return!0;for(var n in t)if(V(r,n))return!0}return!1}function V(e,t){if(0===e.indexOf(t)){var r=e.substr(t.length,1);if("["===r||"."===r)return!0}return!1}function U(e){var t="";return e.replace("/","").split("/").forEach(function(e,r){r?isNaN(+e)?t+="."+e:t+="["+e+"]":t+=e}),t}function D(e,t){for(var r=e.replace("/","").split("/"),n=t.data[r[0]],o=1,i=r.length;o2?[].slice.call(arguments,2):e.children)}function Q(e){var t=e.parentNode;while(t){if(t.host)return t.host;if(t.shadowRoot&&t.shadowRoot.host)return t.shadowRoot.host;t=t.parentNode}}function ee(e){return e.replace(/([1-9]\d*|0)(\.\d*)*rpx/g,function(e,t){return window.innerWidth*+t/750+"px"})}function te(){for(var e=[],t=0;t0)return{class:te.apply(null,r)}}function ne(e){return JSON.stringify(e)}function oe(e){var t=me(this,Se(e),arguments,[]);return t.length>1?t:t[0]}function ie(){return{}}var se={store:null,root:function(){return"object"==typeof global&&global&&global.Math===Math&&global.Array===Array?global:self||window||global||function(){return this}()}(),mapping:{},isMultiStore:!1,ignoreAttrs:!1};!function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.hasOwnProperty("polyfillWrapFlushCallback")){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}(),"function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;var ae=/\B([A-Z])/g,pe=[],le=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ue={},ce=0,fe=!1,he=!1,de=0,ye=function(t){function r(){R(this,r);var e=L(this,t.call(this));return e.props=Object.assign({},e.constructor.defaultProps),e.elementId=de++,e.computed={},e}return I(r,t),r.prototype.connectedCallback=function(){var t=this.parentNode;while(t&&!this.store)this.store=t.store,t=t.parentNode||t.host;if(this.attrsToProps(),this.props.use&&(this.use=this.props.use),this.props.useSelf&&(this.use=this.props.useSelf),this.use){var r="function"==typeof this.use?this.use():this.use;if(se.isMultiStore){var n={},o={};for(var a in r)n[a]={},o[a]={},c(r[a],n,a),s(this.store[a].data,r[a],o,a),this.store[a].instances.push(this);this.using=o,this.M=n}else this.M=c(r),this.using=s(this.store.data,r),this.store.instances.push(this)}if(this.useSelf){var p="function"==typeof this.useSelf?this.useSelf():this.useSelf;if(se.isMultiStore){var l={},u={};for(var f in p)c(p[f],l,f),s(this.store[f].data,p[f],u,f),this.store[f].updateSelfInstances.push(this);this.usingSelf=u,this.R=l}else this.R=c(p),this.usingSelf=s(this.store.data,p),this.store.updateSelfInstances.push(this)}if(this.compute)for(var h in this.compute)this.computed[h]=this.compute[h].call(se.isMultiStore?this.store:this.store.data);this.beforeInstall(),this.install(),this.afterInstall();var d;if(this.constructor.isLightDom)d=this;else{if(this.shadowRoot){d=this.shadowRoot;var y;while(y=d.firstChild)d.removeChild(y)}else d=this.attachShadow({mode:"open"});this.constructor.css?d.appendChild(e(this.constructor.css)):this.css&&d.appendChild(e("function"==typeof this.css?this.css():this.css))}this.beforeRender(),se.afterInstall&&se.afterInstall(this);var v=this.render(this.props,this.store);this.P="[object Array]"===Object.prototype.toString.call(v)&&v.length>0,this.rootNode=j(null,v,null,this),this.rendered(),this.props.css&&(this.N=e(this.props.css),this.O=this.props.css,d.appendChild(this.N)),i(this.rootNode)?this.rootNode.forEach(function(e){d.appendChild(e)}):this.rootNode&&d.appendChild(this.rootNode),this.installed(),this.B=!0},r.prototype.disconnectedCallback=function(){if(this.uninstall(),this.B=!1,this.store)if(se.isMultiStore)for(var e in this.store){var t=this.store[e];f(this,t.instances),f(this,t.updateSelfInstances)}else f(this,this.store.instances),f(this,this.store.updateSelfInstances)},r.prototype.update=function(e,t){this.J=!0,this.beforeUpdate(),this.beforeRender(),this.O!=this.props.css&&(this.O=this.props.css,this.N.textContent=this.O),this.attrsToProps(e);var r=this.render(this.props,this.store);this.rendered(),this.P=this.P||"[object Array]"===Object.prototype.toString.call(r)&&r.length>0,this.rootNode=j(this.rootNode,r,this.shadowRoot,this,t),this.J=!1,this.updated()},r.prototype.forceUpdate=function(){this.update(!0)},r.prototype.updateProps=function(e){var t=this;Object.keys(e).forEach(function(r){t.props[r]=e[r],t.__p&&(t.__p[r]=e[r])}),this.forceUpdate()},r.prototype.updateSelf=function(e){this.update(e,!0)},r.prototype.removeAttribute=function(e){t.prototype.removeAttribute.call(this,e),this.B&&this.update()},r.prototype.setAttribute=function(e,r){r&&"object"==typeof r?t.prototype.setAttribute.call(this,e,JSON.stringify(r)):t.prototype.setAttribute.call(this,e,r),this.B&&this.update()},r.prototype.pureRemoveAttribute=function(e){t.prototype.removeAttribute.call(this,e)},r.prototype.pureSetAttribute=function(e,r){t.prototype.setAttribute.call(this,e,r)},r.prototype.attrsToProps=function(e){if(!se.ignoreAttrs&&!e){var t=this;t.props.css=t.getAttribute("css");var r=this.constructor.propTypes;r&&Object.keys(r).forEach(function(e){var n=r[e],o=t.getAttribute(l(e));if(null!==o)switch(n){case String:t.props[e]=o;break;case Number:t.props[e]=+o;break;case Boolean:t.props[e]="false"!==o&&"0"!==o;break;case Array:case Object:t.props[e]=":"===o[0]?u(o.substr(1),Omi.$):JSON.parse(o.replace(/(['"])?([a-zA-Z0-9_-]+)(['"])?:([^\/])/g,'"$2":$4').replace(/'([\s\S]*?)'/g,'"$1"').replace(/,(\s*})/g,"$1"))}else t.props[e]=t.constructor.defaultProps&&t.constructor.defaultProps.hasOwnProperty(e)?t.constructor.defaultProps[e]:null})}},r.prototype.fire=function(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t}))},r.prototype.beforeInstall=function(){},r.prototype.install=function(){},r.prototype.afterInstall=function(){},r.prototype.installed=function(){},r.prototype.uninstall=function(){},r.prototype.beforeUpdate=function(){},r.prototype.updated=function(){},r.prototype.beforeRender=function(){},r.prototype.rendered=function(){},r.prototype.receiveProps=function(){},r}(HTMLElement);ye.is="WeElement";var ve=function(){function e(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function t(e){return-1==e.indexOf("/")&&-1==e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function r(e,t){var r=[],n=e.parenthoodMap.get(t);while(n&&n.path)r.unshift(n.path),n=e.parenthoodMap.get(n.parent);if(r.length){return"/"+r.join("/")}return""}function n(e,n,o,i){var s=r(e,n),a=s+"/"+t(o);if(e.proxifiedObjectsMap.has(i)){e.parenthoodMap.set(e.proxifiedObjectsMap.get(i).originalObject,{parent:n,path:o})}var p=e.proxifiedObjectsMap.get(i);p&&!e.isProxifyingTreeNow&&(p.inherited=!0),i&&"object"==typeof i&&!e.proxifiedObjectsMap.has(i)&&(e.parenthoodMap.set(i,{parent:n,path:o}),i=e.A(n,i,o));var l={op:"remove",path:a};if(void 0===i){if(!Array.isArray(n)&&!n.hasOwnProperty(o))return Reflect.set(n,o,i);Array.isArray(n)&&(l.op="replace",l.value=null);var u=e.proxifiedObjectsMap.get(n[o]);u&&(e.parenthoodMap.delete(n[o]),e.disableTrapsForProxy(u),e.proxifiedObjectsMap.delete(u))}else{if(Array.isArray(n)&&!Number.isInteger(+(""+o)))return"length"!=o&&console.warn("JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch"),Reflect.set(n,o,i);l.op="add",n.hasOwnProperty(o)&&(void 0!==n[o]||Array.isArray(n))&&(l.op="replace"),l.value=i}l.oldValue=n[o];var c=Reflect.set(n,o,i);return e.defaultCallback(l),c}function o(e,n,o){if(void 0!==n[o]){var i=r(e,n),s=i+"/"+t(o),a=e.proxifiedObjectsMap.get(n[o]);a&&(a.inherited?a.inherited=!1:(e.parenthoodMap.delete(a.originalObject),e.disableTrapsForProxy(a),e.proxifiedObjectsMap.delete(n[o])));var p=Reflect.deleteProperty(n,o);return e.defaultCallback({op:"remove",path:s}),p}}function i(){var e=this;this.defaultCallback=function(t){e.isRecording&&e.patches.push(t),e.userCallback&&e.userCallback(t)},this.isObserving=!0}function s(){this.defaultCallback=function(){},this.isObserving=!1}function a(e,t){this.isProxifyingTreeNow=!1,this.isObserving=!1,this.proxifiedObjectsMap=new Map,this.parenthoodMap=new Map,"boolean"!=typeof t&&(t=!0),this.showDetachedWarning=t,this.originalObject=e,this.cachedProxy=null,this.isRecording=!1,this.resume=i.bind(this),this.pause=s.bind(this)}return a.deepClone=e,a.escapePathComponent=t,a.prototype.generateProxyAtPath=function(e,t,r){var i=this;if(!t)return t;var s={set:function(e,t,r){return n(i,e,t,r)},deleteProperty:function(e,t){return o(i,e,t)}},a=Proxy.revocable(t,s);return a.trapsInstance=s,a.originalObject=t,this.parenthoodMap.set(t,{parent:e,path:r}),this.proxifiedObjectsMap.set(a.proxy,a),a.proxy},a.prototype.A=function(e,r,n){for(var o in r)r.hasOwnProperty(o)&&r[o]instanceof Object&&(r[o]=this.A(r,r[o],t(o)));return this.generateProxyAtPath(e,r,n)},a.prototype.proxifyObjectTree=function(e){this.pause(),this.isProxifyingTreeNow=!0;var t=this.A(void 0,e,"");return this.isProxifyingTreeNow=!1,this.resume(),t},a.prototype.disableTrapsForProxy=function(e){if(this.showDetachedWarning){var t="You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects";e.trapsInstance.set=function(e,r,n){return console.warn(t),Reflect.set(e,r,n)},e.trapsInstance.set=function(e,r,n){return console.warn(t),Reflect.set(e,r,n)},e.trapsInstance.deleteProperty=function(e,t){return Reflect.deleteProperty(e,t)}}else delete e.trapsInstance.set,delete e.trapsInstance.get,delete e.trapsInstance.deleteProperty},a.prototype.observe=function(e,t){if(!e&&!t)throw Error("You need to either record changes or pass a callback");return this.isRecording=e,this.userCallback=t,e&&(this.patches=[]),this.cachedProxy=this.proxifyObjectTree(this.originalObject)},a.prototype.generate=function(){if(!this.isRecording)throw Error("You should set record to true to get patches later");return this.patches.splice(0,this.patches.length)},a.prototype.revoke=function(){this.proxifiedObjectsMap.forEach(function(e){e.revoke()})},a.prototype.disableTraps=function(){this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy,this)},a}(),ge=["use","useSelf"],be={}.hasOwnProperty,me=function(e,t,r,n){for(var o=1;o"===t?(a(),n=1):n&&("="===t?(n=4,r=o,o=""):"/"===t?(a(),3===n&&(s=s[0]),n=s,(s=s[0]).push(n,4),n=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),n=2):o+=t)}return a(),s},Oe="function"==typeof Map,Ne=Oe?new Map:{},Se=Oe?function(e){var t=Ne.get(e);return t||Ne.set(e,t=we(e)),t}:function(e){for(var t="",r=0;r {\n return $1.toUpperCase()\n })\n}\n\nexport function Fragment(props) {\n return props.children\n}\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 != null) {\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 * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\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 getUse(data, paths, out, name) {\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 if (out) out[name] = obj\n return obj\n}\n\nexport function pathToArr(path) {\n if (typeof path !== 'string' || !path) return []\n // return path.split(/\\.|\\[|\\]/).filter(name => !!name)\n return path\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n}\n\nexport function getTargetByPath(origin, path) {\n const arr = pathToArr(path)\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}\n\nconst hyphenateRE = /\\B([A-Z])/g\nexport function hyphenate(str) {\n return str.replace(hyphenateRE, '-$1').toLowerCase()\n}\n\nexport function getValByPath(path, current) {\n const arr = pathToArr(path)\n arr.forEach(prop => {\n current = current[prop]\n })\n return current\n}\n\nexport function getPath(obj, out, name) {\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 if (out) out[name] = result\n return result\n}\n\nexport function removeItem(item, arr) {\n if (!arr) return\n for (let i = 0, len = arr.length; i < len; i++) {\n if (arr[i] === item) {\n arr.splice(i, 1)\n break\n }\n }\n}\n","import options from './options'\nimport { Fragment } from './util'\n\nconst stack = []\n\nexport function h(nodeName, attributes) {\n let 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.length === 0) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n if (nodeName === Fragment) {\n return children\n }\n\n const p = {\n nodeName,\n children,\n attributes: attributes == null ? undefined : attributes,\n key: attributes == null ? undefined : attributes.key\n }\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","import { extend } from '../util'\nimport options from '../options'\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node DOM Node to compare\n * @param {VNode} vnode Virtual DOM node to compare\n * @param {boolean} [hydrating=false] If 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 return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n } else if (typeof vnode.nodeName === 'function') {\n return options.mapping[node.nodeName.toLowerCase()] === 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 A DOM Element to inspect the name of.\n * @param {String} nodeName Unnormalized 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 { pathToArr } from './util'\n\nexport const extension = {}\n\nexport function extend(name, handler) {\n extension['o-' + name] = handler\n}\n\nexport function set(origin, path, value) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n if (i === len - 1) {\n current[arr[i]] = value\n } else {\n current = current[arr[i]]\n }\n }\n}\n\nexport function get(origin, path) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n current = current[arr[i]]\n }\n\n return current\n}\n\nfunction eventProxy(e) {\n return this._listeners[e.type](e)\n}\n\nexport function bind(el, type, handler) {\n el._listeners = el._listeners || {}\n el._listeners[type] = handler\n el.addEventListener(type, eventProxy)\n}\n\nexport function unbind(el, type) {\n el.removeEventListener(type, eventProxy)\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\nimport { extension } from '../extend'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg, component) {\n if (name === 'className') name = 'class'\n\n if (name[0] == 'o' && name[1] == '-') {\n if (extension[name]) {\n extension[name](node, value, component)\n }\n } else 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 (!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 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 let nameLower = name.toLowerCase()\n name = (nameLower in node ? nameLower : name).slice(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 (node.nodeName === 'INPUT' && name === 'value') {\n node[name] = value == null ? '' : value\n } else if (\n name !== 'list' &&\n name !== 'type' &&\n name !== 'css' &&\n !isSvg &&\n name in node &&\n value !== ''\n ) {\n //value !== '' fix for selected, disabled, checked with pure element\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\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\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : 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 {\n node.pureSetAttribute\n ? node.pureSetAttribute(name, value)\n : node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @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}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { camelCase, isArray, Fragment } from '../util'\nimport { removeNode } from '../dom/index'\nimport options from '../options'\n\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/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n * @param {Element} [dom=null] A DOM node to mutate into the shape of the `vnode`\n * @param {VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure\n * @returns {Element} dom The created/mutated element\n * @private\n */\nexport function diff(dom, vnode, parent, component, updateSelf) {\n //first render return undefined\n if (!dom && !vnode) return\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\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 if (vnode && vnode.nodeName === Fragment) {\n vnode = vnode.children\n }\n if (isArray(vnode)) {\n if (parent) {\n const styles = parent.querySelectorAll('style')\n styles.forEach(s => {\n parent.removeChild(s)\n })\n innerDiffNode(parent, vnode, hydrating, component, updateSelf)\n\n for (let i = styles.length - 1; i >= 0; i--) {\n parent.firstChild\n ? parent.insertBefore(styles[i], parent.firstChild)\n : parent.appendChild(style[i])\n }\n } else {\n ret = []\n vnode.forEach((item, index) => {\n let ele = idiff(index === 0 ? dom : null, item, component, updateSelf)\n ret.push(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n dom.forEach((one, index) => {\n if (index === 0) {\n ret = idiff(one, vnode, component, updateSelf)\n } else {\n recollectNodeTree(one, false)\n }\n })\n } else {\n ret = idiff(dom, vnode, component, updateSelf)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\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 }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, component, updateSelf) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\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 // 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 || component)\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 out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n if (typeof vnodeName === 'function') {\n for (let key in options.mapping) {\n if (options.mapping[key] === vnodeName) {\n vnodeName = key\n vnode.nodeName = key\n break\n }\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 if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n hydrating || props.dangerouslySetInnerHTML != null,\n component,\n updateSelf\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, component, updateSelf)\n if (out.props) {\n out.props.children = vnode.children\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 * @param {Element} dom Element whose children should be compared & mutated\n * @param {Array} vchildren Array of VNodes to compare to `dom.childNodes`\n * @param {Boolean} isHydrating If `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, isHydrating, component, updateSelf) {\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, component, updateSelf)\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 * @param {Node} node DOM node to start unmount/removal from\n * @param {Boolean} [unmountOnly=false] If `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\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 && node[ATTR_KEY].ref) {\n if (typeof node[ATTR_KEY].ref === 'function') {\n node[ATTR_KEY].ref(null)\n } else if (node[ATTR_KEY].ref.current) {\n node[ATTR_KEY].ref.current = null\n }\n }\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n * - we use .lastChild here because it causes less reflow than .firstChild\n * - 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 * @param {Element} dom Element with attributes to diff `attrs` against\n * @param {Object} attrs The desired end-state key-value attribute pairs\n * @param {Object} old Current/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, component, updateSelf) {\n let name\n //let update = false\n let isWeElement = dom.update\n let oldClone\n if (dom.receiveProps) {\n oldClone = Object.assign({}, old)\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(\n dom,\n name,\n old[name],\n (old[name] = undefined),\n isSvgMode,\n component\n )\n if (isWeElement) {\n delete dom.props[name]\n //update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (isWeElement && typeof attrs[name] === 'object' && name !== 'ref') {\n if (name === 'style') {\n setAccessor(\n dom,\n name,\n old[name],\n (old[name] = attrs[name]),\n isSvgMode,\n component\n )\n }\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else if (\n name !== 'children' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], attrs[name], isSvgMode, component)\n if (isWeElement) {\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else {\n old[name] = attrs[name]\n }\n }\n }\n\n if (isWeElement && !updateSelf && dom.parentNode) {\n //__hasChildren is not accuracy when it was empty at first, so add dom.children.length > 0 condition\n //if (update || dom.__hasChildren || dom.children.length > 0 || (dom.store && !dom.store.data)) {\n if (dom.receiveProps(dom.props, oldClone) !== false) {\n dom.update()\n }\n //}\n }\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\nimport { getUse } from './util'\nimport options from './options'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n if (store.data) {\n observeStore(store)\n } else {\n options.isMultiStore = true\n //Multi-store injection\n for (let key in store) {\n observeStore(store[key], key)\n }\n }\n parent.store = store\n }\n return diff(null, vnode, parent, false)\n}\n\nfunction observeStore(store, key) {\n store.instances = []\n store.updateSelfInstances = []\n extendStoreUpdate(store, key)\n\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n const patchs = {}\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n\n update(patchs, store)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n\n update(patchs, store)\n }\n })\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpdate(store, key) {\n store.update = function(patch) {\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updatePath &&\n instance._updatePath[key] &&\n needUpdate(patch, instance._updatePath[key])\n ) {\n if (instance.use) {\n getUse(\n store.data,\n (typeof instance.use === 'function'\n ? instance.use()\n : instance.use)[key],\n instance.using,\n key\n )\n }\n\n instance.update()\n }\n } else {\n if (instance._updatePath && needUpdate(patch, instance._updatePath)) {\n if (instance.use) {\n instance.using = getUse(\n store.data,\n typeof instance.use === 'function'\n ? instance.use()\n : instance.use\n )\n }\n\n instance.update()\n }\n }\n })\n\n this.updateSelfInstances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updateSelfPath &&\n instance._updateSelfPath[key] &&\n needUpdate(patch, instance._updateSelfPath[key])\n ) {\n if (instance.useSelf) {\n getUse(\n store.data,\n (typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf)[key],\n instance.usingSelf,\n key\n )\n }\n\n instance.updateSelf()\n }\n } else {\n if (\n instance._updateSelfPath &&\n needUpdate(patch, instance._updateSelfPath)\n ) {\n instance.usingSelf = getUse(\n store.data,\n typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf\n )\n instance.updateSelf()\n }\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nfunction compute(instance, isMultiStore) {\n if (instance.compute) {\n for (let ck in instance.compute) {\n instance.computed[ck] = instance.compute[ck].call(\n isMultiStore ? instance.store : instance.store.data\n )\n }\n }\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 {\n k: fixArrPath(path),\n v: current\n }\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 WeElement from './we-element'\nimport options from './options'\n\nconst storeHelpers = ['use', 'useSelf']\n\nexport function define(name, ctor, config) {\n if (options.mapping[name]) {\n return\n }\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n options.mapping[name] = ctor\n } else {\n if (typeof config === 'string') {\n config = { css: config }\n } else {\n config = config || {}\n }\n\n class Ele extends WeElement {\n static css = config.css\n\n static propTypes = config.propTypes\n\n static defaultProps = config.defaultProps\n\n compute = config.compute\n\n render() {\n return ctor.call(this, this)\n }\n }\n\n for (let key in config) {\n if (typeof config[key] === 'function') {\n Ele.prototype[key] = function() {\n return config[key].apply(this, arguments)\n }\n }\n }\n\n storeHelpers.forEach(func => {\n if (config[func] && config[func] !== 'function') {\n Ele.prototype[func] = function() {\n return config[func]\n }\n }\n })\n\n customElements.define(name, Ele)\n options.mapping[name] = Ele\n }\n}\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 The virtual DOM element to clone\n * @param {Object} props Attributes/props to add when cloning\n * @param {VNode} rest Any 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","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else if (p.shadowRoot && p.shadowRoot.host) {\n return p.shadowRoot.host\n } else {\n p = p.parentNode\n }\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.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 if (args.length > 0) {\n return { class: classNames.apply(null, args) }\n }\n}\n","export function o(obj) {\n return JSON.stringify(obj)\n}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { classNames, extractClass } from './class'\nimport { o } from './o'\nimport htm from 'htm'\nimport { extend, get, set, bind, unbind } from './extend'\nimport JSONProxy from './proxy'\nimport { Fragment } from './util'\n\nh.f = Fragment\n\nconst html = htm.bind(h)\n\nfunction createRef() {\n\treturn {}\n}\n\nconst $ = {}\nconst Component = WeElement\nconst defineElement = define\nconst elements = options.mapping\n\nconst omi = {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n\noptions.root.Omi = omi\noptions.root.omi = omi\noptions.root.Omi.version = '6.18.0'\n\nexport default omi\n\nexport {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n","function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function () {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n * @public\n * @namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal(),\n mapping: {},\n isMultiStore: false,\n //when set true, using props of hypescript, don't use getAttribute\n //if you render all the node tree by omi self, set it\n ignoreAttrs: false\n}\n","import {\n\tcssToDom,\n\tisArray,\n\tgetUse,\n\thyphenate,\n\tgetValByPath,\n\tremoveItem\n} from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { getPath } from './util'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n\tstatic is = 'WeElement'\n\n\tconstructor() {\n\t\tsuper()\n\t\tthis.props = Object.assign({}, this.constructor.defaultProps)\n\t\tthis.elementId = id++\n\t\tthis.computed = {}\n\t}\n\n\tconnectedCallback() {\n\t\tlet p = this.parentNode\n\t\twhile (p && !this.store) {\n\t\t\tthis.store = p.store\n\t\t\tp = p.parentNode || p.host\n\t\t}\n\n\t\tthis.attrsToProps()\n\n\t\tif (this.props.use) {\n\t\t\tthis.use = this.props.use\n\t\t}\n\n\t\tif (this.props.useSelf) {\n\t\t\tthis.use = this.props.useSelf\n\t\t}\n\n\t\tif (this.use) {\n\t\t\tconst use = typeof this.use === 'function' ? this.use() : this.use\n\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\t_updatePath[storeName] = {}\n\t\t\t\t\tusing[storeName] = {}\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].instances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.using = using\n\t\t\t\tthis._updatePath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updatePath = getPath(use)\n\t\t\t\tthis.using = getUse(this.store.data, use)\n\t\t\t\tthis.store.instances.push(this)\n\t\t\t}\n\t\t}\n\t\tif (this.useSelf) {\n\t\t\tconst use =\n\t\t\t\ttypeof this.useSelf === 'function' ? this.useSelf() : this.useSelf\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].updateSelfInstances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.usingSelf = using\n\t\t\t\tthis._updateSelfPath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updateSelfPath = getPath(use)\n\t\t\t\tthis.usingSelf = getUse(this.store.data, use)\n\t\t\t\tthis.store.updateSelfInstances.push(this)\n\t\t\t}\n\t\t}\n\n\t\tif (this.compute) {\n\t\t\tfor (let key in this.compute) {\n\t\t\t\tthis.computed[key] = this.compute[key].call(\n\t\t\t\t\toptions.isMultiStore ? this.store : this.store.data\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeInstall()\n\t\tthis.install()\n\t\tthis.afterInstall()\n\n\t\tlet shadowRoot\n\t\tif (this.constructor.isLightDom) {\n\t\t\tshadowRoot = this\n\t\t} else {\n\n\t\t\tif (!this.shadowRoot) {\n\t\t\t\tshadowRoot = this.attachShadow({\n\t\t\t\t\tmode: 'open'\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tshadowRoot = this.shadowRoot\n\t\t\t\tlet fc\n\t\t\t\twhile ((fc = shadowRoot.firstChild)) {\n\t\t\t\t\tshadowRoot.removeChild(fc)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.constructor.css) {\n\t\t\t\tshadowRoot.appendChild(cssToDom(this.constructor.css))\n\t\t\t} else if (this.css) {\n\t\t\t\tshadowRoot.appendChild(\n\t\t\t\t\tcssToDom(typeof this.css === 'function' ? this.css() : this.css)\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeRender()\n\t\toptions.afterInstall && options.afterInstall(this)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.__hasChildren =\n\t\t\tObject.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\trendered.length > 0\n\n\t\tthis.rootNode = diff(null, rendered, null, this)\n\t\tthis.rendered()\n\n\t\tif (this.props.css) {\n\t\t\tthis._customStyleElement = cssToDom(this.props.css)\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tshadowRoot.appendChild(this._customStyleElement)\n\t\t}\n\n\t\tif (isArray(this.rootNode)) {\n\t\t\tthis.rootNode.forEach(function (item) {\n\t\t\t\tshadowRoot.appendChild(item)\n\t\t\t})\n\t\t} else {\n\t\t\tthis.rootNode && shadowRoot.appendChild(this.rootNode)\n\t\t}\n\t\tthis.installed()\n\t\tthis._isInstalled = true\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.uninstall()\n\t\tthis._isInstalled = false\n\t\tif (this.store) {\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tfor (let key in this.store) {\n\t\t\t\t\tconst current = this.store[key]\n\t\t\t\t\tremoveItem(this, current.instances)\n\t\t\t\t\tremoveItem(this, current.updateSelfInstances)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tremoveItem(this, this.store.instances)\n\t\t\t\tremoveItem(this, this.store.updateSelfInstances)\n\t\t\t}\n\t\t}\n\t}\n\n\tupdate(ignoreAttrs, updateSelf) {\n\t\tthis._willUpdate = true\n\t\tthis.beforeUpdate()\n\t\tthis.beforeRender()\n\t\t//fix null !== undefined\n\t\tif (this._customStyleContent != this.props.css) {\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tthis._customStyleElement.textContent = this._customStyleContent\n\t\t}\n\t\tthis.attrsToProps(ignoreAttrs)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.rendered()\n\t\tthis.__hasChildren =\n\t\t\tthis.__hasChildren ||\n\t\t\t(Object.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\t\trendered.length > 0)\n\n\t\tthis.rootNode = diff(\n\t\t\tthis.rootNode,\n\t\t\trendered,\n\t\t\tthis.shadowRoot,\n\t\t\tthis,\n\t\t\tupdateSelf\n\t\t)\n\t\tthis._willUpdate = false\n\t\tthis.updated()\n\t}\n\n\tforceUpdate() {\n\t\tthis.update(true)\n\t}\n\n\tupdateProps(obj) {\n\t\tObject.keys(obj).forEach(key => {\n\t\t\tthis.props[key] = obj[key]\n\t\t\tif (this.prevProps) {\n\t\t\t\tthis.prevProps[key] = obj[key]\n\t\t\t}\n\t\t})\n\t\tthis.forceUpdate()\n\t}\n\n\tupdateSelf(ignoreAttrs) {\n\t\tthis.update(ignoreAttrs, true)\n\t}\n\n\tremoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t\t//Avoid executing removeAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tsetAttribute(key, val) {\n\t\tif (val && typeof val === 'object') {\n\t\t\tsuper.setAttribute(key, JSON.stringify(val))\n\t\t} else {\n\t\t\tsuper.setAttribute(key, val)\n\t\t}\n\t\t//Avoid executing setAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tpureRemoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t}\n\n\tpureSetAttribute(key, val) {\n\t\tsuper.setAttribute(key, val)\n\t}\n\n\tattrsToProps(ignoreAttrs) {\n\t\tif (options.ignoreAttrs || ignoreAttrs) return\n\t\tconst ele = this\n\t\tele.props['css'] = ele.getAttribute('css')\n\t\tconst attrs = this.constructor.propTypes\n\t\tif (!attrs) return\n\t\tObject.keys(attrs).forEach(key => {\n\t\t\tconst type = attrs[key]\n\t\t\tconst val = ele.getAttribute(hyphenate(key))\n\t\t\tif (val !== null) {\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase String:\n\t\t\t\t\t\tele.props[key] = val\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Number:\n\t\t\t\t\t\tele.props[key] = Number(val)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Boolean:\n\t\t\t\t\t\tif (val === 'false' || val === '0') {\n\t\t\t\t\t\t\tele.props[key] = false\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Array:\n\t\t\t\t\tcase Object:\n\t\t\t\t\t\tif (val[0] === ':') {\n\t\t\t\t\t\t\tele.props[key] = getValByPath(val.substr(1), Omi.$)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = JSON.parse(\n\t\t\t\t\t\t\t\tval\n\t\t\t\t\t\t\t\t\t.replace(/(['\"])?([a-zA-Z0-9_-]+)(['\"])?:([^\\/])/g, '\"$2\":$4')\n\t\t\t\t\t\t\t\t\t.replace(/'([\\s\\S]*?)'/g, '\"$1\"')\n\t\t\t\t\t\t\t\t\t.replace(/,(\\s*})/g, '$1')\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tele.constructor.defaultProps &&\n\t\t\t\t\tele.constructor.defaultProps.hasOwnProperty(key)\n\t\t\t\t) {\n\t\t\t\t\tele.props[key] = ele.constructor.defaultProps[key]\n\t\t\t\t} else {\n\t\t\t\t\tele.props[key] = null\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tfire(name, data) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(name, {\n\t\t\t\tdetail: data\n\t\t\t})\n\t\t)\n\t}\n\n\tbeforeInstall() { }\n\n\tinstall() { }\n\n\tafterInstall() { }\n\n\tinstalled() { }\n\n\tuninstall() { }\n\n\tbeforeUpdate() { }\n\n\tupdated() { }\n\n\tbeforeRender() { }\n\n\trendered() { }\n\n\treceiveProps() { }\n}\n","var n=function(t,r,u,e){for(var p=1;p=5&&((e||!n&&5===u)&&(s.push(e,u,r),u=6),n&&(s.push(n,u,r),u=6)),e=\"\"},a=0;a\"===t?(u=1,e=\"\"):e=t+e[0]:p?t===p?p=\"\":e+=t:'\"'===t||\"'\"===t?p=t:\">\"===t?(h(),u=1):u&&(\"=\"===t?(u=5,r=e,e=\"\"):\"/\"===t&&(u<5||\">\"===n[a][f+1])?(h(),3===u&&(s=s[0]),u=s,(s=s[0]).push(u,2),u=0):\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t?(h(),u=2):e+=t),3===u&&\"!--\"===e&&(u=4,s=s[0])}return h(),s},r=\"function\"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)),r}:function(n){for(var r=\"\",e=0;e1?r:r[0]}\n"]} \ No newline at end of file +{"version":3,"sources":["../src/util.js","../src/h.js","../src/vdom/index.js","../src/extend.js","../src/dom/index.js","../src/vdom/diff.js","../src/proxy.js","../src/render.js","../src/define.js","../src/clone-element.js","../src/get-host.js","../src/class.js","../src/o.js","../src/omi.js","../src/options.js","../src/we-element.js","../node_modules/htm/dist/htm.mjs"],"names":["cssToDom","css","node","document","createElement","textContent","camelCase","str","replace","$","$1","toUpperCase","Fragment","props","children","extend","obj","i","applyRef","ref","value","current","isArray","Object","prototype","toString","call","getUse","data","paths","out","name","forEach","path","index","getTargetByPath","key","keys","tempPath","tempVal","args","push","apply","pathToArr","split","origin","arr","len","length","hyphenate","hyphenateRE","toLowerCase","getValByPath","prop","getPath","result","item","removeItem","splice","h","nodeName","attributes","lastSimple","child","simple","arguments","stack","pop","String","p","options","vnode","isSameNodeType","splitText","mapping","hydrating","_componentConstructor","isNamedNode","extend$1","handler","extension","get","e","type","eventProxy","el","_listeners","addEventListener","createNode","removeNode","setAccessor","component","old","isSvg","style","cssText","IS_NON_DIMENSIONAL","test","useCapture","nameLower","innerHTML","slice","eventProxy$1","touchStart","touchEnd","removeEventListener","pureRemoveAttribute","removeAttribute","ns","removeAttributeNS","pureSetAttribute","setAttribute","className","this","___touchX","pageX","___touchY","touches","pageY","Math","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","ret","diffLevel","isSvgMode","parent","ownerSVGElement","dom","querySelectorAll","styles","s","innerDiffNode","updateSelf","removeChild","firstChild","insertBefore","appendChild","ele","idiff","one","recollectNodeTree","parentNode","nodeValue","createTextNode","replaceChild","vnodeName","__p","vchildren","fc","a","nextSibling","constructor","is","noSlot","dangerouslySetInnerHTML","diffAttributes","min","childrenLen","vlen","j","keyedLen","originalChildren","keyed","vchild","_child","_component","__key","trim","isHydrating","c","f","unmountOnly","ATTR_KEY","removeChildren","oldClone","assign","receiveProps","isWeElement","attrs","ccName","_ccName","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","render","store","JSONPatcherProxy","querySelector","observeStore","isMultiStore","diff","instances","updateSelfInstances","observe","patch","extendStoreUpdate","getArrayPatch","JSONProxy","patchs","kv","v","update","k","compute","_updatePath","needUpdate","use","using","useSelf","usingSelf","ck","diffResult","updatePath","keyA","keyB","includePath","pathA","pathB","indexOf","next","substr","fixPath","mpPath","fixArrPath","_classCallCheck$1","_possibleConstructorReturn$1","ctor","define","customElements","config","Ele","_WeElement","_temp","_this","_ret","_len","Array","concat","WeElement","propTypes","defaultProps","isLightDom","storeHelpers","func","pure","target","cloneElement","getHost","shadowRoot","host","rpx","b","window","innerWidth","arg","classNames","classes","argType","inner","join","_Array$prototype$slic","class","unshift","o","JSON","stringify","htm","t","r","n","root","global","ignoreAttrs","Reflect","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","setPrototypeOf","Promise","resolve","then","bind","setTimeout","computed","connectedCallback","attrsToProps","storeName","_use","_updatePath2","_using","_storeName","_updateSelfPath","beforeInstall","install","afterInstall","attachShadow","mode","beforeRender","rendered","rootNode","_customStyleContent","_customStyleElement","installed","_isInstalled","disconnectedCallback","uninstall","_willUpdate","beforeUpdate","__hasChildren","forceUpdate","updated","_this2","updateProps","prevProps","_HTMLElement","val","getAttribute","Number","Boolean","Omi","parse","fire","deepClone","escapePathComponent","pathComponents","parentAndPath","parenthoodMap","parentPath","newValueOriginalObject","revokableInstance","inherited","proxifiedObjectsMap","has","newValue","set","operation","destinationPropKey","op","oldValue","delete","disableTrapsForProxy","console","warn","reflectionResult","revokableProxyInstance","defaultCallback","resume","patches","userCallback","pause","isObserving","showDetachedWarning","cachedProxy","deleteProperty","deleteTrap","Proxy","revocable","revocableInstance","trapsInstance","traps","originalObject","_proxifyObjectTreeRecursively","proxifyObjectTree","isProxifyingTreeNow","proxifiedObject","targetObject","message","propKey","record","callback","generate","isRecording","revoke","disableTraps","u","Map","html","Component","defineElement","tag","elements","omi","createRef","extractClass","unbind","version","module","exports"],"mappings":"wBAqCO,SAASA,GAASC,GACvB,GAAMC,GAAOC,SAASC,cAAc,QAEpC,OADAF,GAAKG,YAAcJ,EACZC,EAGF,QAASI,GAAUC,GACxB,MAAOA,GAAIC,QAAQ,SAAU,SAACC,EAAGC,GAC/B,MAAOA,GAAGC,gBAIP,QAASC,GAASC,GACvB,MAAOA,GAAMC,SAGR,QAASC,GAAOC,EAAKH,GAC1B,IAAK,GAAII,KAAKJ,GAAOG,EAAIC,GAAKJ,EAAMI,EACpC,OAAOD,GAOF,QAASE,GAASC,EAAKC,GACjB,MAAPD,IACgB,kBAAPA,GAAmBA,EAAIC,GAC7BD,EAAIE,QAAUD,GAehB,QAASE,GAAQN,GACtB,MAA+C,mBAAxCO,OAAOC,UAAUC,SAASC,KAAKV,GAGjC,QAASW,GAAOC,EAAMC,EAAOC,EAAKC,GACvC,GAAMf,KA2BN,OA1BAa,GAAMG,QAAQ,SAACC,EAAMC,GAEnB,GAD+B,gBAATD,GAEpBjB,EAAIkB,GAASC,EAAgBP,EAAMK,OAC9B,CACL,GAAMG,GAAMb,OAAOc,KAAKJ,GAAM,GACxBb,EAAQa,EAAKG,EACnB,IAAqB,gBAAVhB,GACTJ,EAAIkB,GAASC,EAAgBP,EAAMR,OAC9B,CACL,GAAMkB,GAA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O,EAAArM,EAAA,OAAA+S,IAAA3G,KAAA2G,GAAA3G,GAAAD,GAAAE,IAEtB5N,GAAAqH,EAAApK,CIFD,IAAIuX,IAAE/G,GAASgB,KAAKzO,GHoBpBlD,MACC2X,GAAA5I,GACA6I,GAAAxJ,gBAGKuJ,IACNE,IAAMD,EACN7I,UAAM+I,gBAENrM,OAAMsM,EACLF,EAAAA,EACA9I,cAAAA,EACA4I,QAAAA,GACAlM,OAAAA,EACAvI,aALWqM,EAMX5P,QAAAA,EACAkE,IAAAA,GACAuK,cARWwJ,GASXrI,WAAAA,GACAC,aAAAA,GACAG,UAXWqI,GAYXJ,KAAAA,GACA5H,IAAAA,GACAiI,EAAAA,GACAD,SAAAA,GACAN,EAAAA,GACA/G,OAjBWtM,EAkBXmM,IAlBWhM,EAmBXsT,IAAAA,EACA9X,KApBW2R,EAqBXrR,OAAAA,EACAkE,UAtBWmH,GAyBXuM,IAAAA,KAAAA,IAzBWH,GA0BXzL,GAAAA,KAAAA,IAAAA,GA1BWzI,GAAZkN,KAAAkD,IAAAkE,QAAA,SA6BmBJ,mBAAXhH,QAARqH,OAAAC,QAAAN,GAAAxM,KAAA0I,IAAA8D","file":"omi.min.js","sourcesContent":["/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This shim allows elements written in, or compiled to, ES5 to work on native\n * implementations of Custom Elements v1. It sets new.target to the value of\n * this.constructor so that the native HTMLElement constructor can access the\n * current under-construction element's definition.\n */\n;(function() {\n if (\n // No Reflect, no classes, no need for shim because native custom elements\n // require ES2015 classes or Reflect.\n window.Reflect === undefined ||\n window.customElements === undefined ||\n // The webcomponentsjs custom elements polyfill doesn't require\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = HTMLElement\n window.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\nexport function cssToDom(css) {\n const node = document.createElement('style')\n node.textContent = css\n return node\n}\n\nexport function camelCase(str) {\n return str.replace(/-(\\w)/g, ($, $1) => {\n return $1.toUpperCase()\n })\n}\n\nexport function Fragment(props) {\n return props.children\n}\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 != null) {\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 * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\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 getUse(data, paths, out, name) {\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 if (out) out[name] = obj\n return obj\n}\n\nexport function pathToArr(path) {\n if (typeof path !== 'string' || !path) return []\n // return path.split(/\\.|\\[|\\]/).filter(name => !!name)\n return path\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n}\n\nexport function getTargetByPath(origin, path) {\n const arr = pathToArr(path)\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}\n\nconst hyphenateRE = /\\B([A-Z])/g\nexport function hyphenate(str) {\n return str.replace(hyphenateRE, '-$1').toLowerCase()\n}\n\nexport function getValByPath(path, current) {\n const arr = pathToArr(path)\n arr.forEach(prop => {\n current = current[prop]\n })\n return current\n}\n\nexport function getPath(obj, out, name) {\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 if (out) out[name] = result\n return result\n}\n\nexport function removeItem(item, arr) {\n if (!arr) return\n for (let i = 0, len = arr.length; i < len; i++) {\n if (arr[i] === item) {\n arr.splice(i, 1)\n break\n }\n }\n}\n","import options from './options'\nimport { Fragment } from './util'\n\nconst stack = []\n\nexport function h(nodeName, attributes) {\n let 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.length === 0) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n if (nodeName === Fragment) {\n return children\n }\n\n const p = {\n nodeName,\n children,\n attributes: attributes == null ? undefined : attributes,\n key: attributes == null ? undefined : attributes.key\n }\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","import { extend } from '../util'\nimport options from '../options'\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node DOM Node to compare\n * @param {VNode} vnode Virtual DOM node to compare\n * @param {boolean} [hydrating=false] If 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 return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n } else if (typeof vnode.nodeName === 'function') {\n return options.mapping[node.nodeName.toLowerCase()] === 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 A DOM Element to inspect the name of.\n * @param {String} nodeName Unnormalized 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 { pathToArr } from './util'\n\nexport const extension = {}\n\nexport function extend(name, handler) {\n extension['o-' + name] = handler\n}\n\nexport function set(origin, path, value) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n if (i === len - 1) {\n current[arr[i]] = value\n } else {\n current = current[arr[i]]\n }\n }\n}\n\nexport function get(origin, path) {\n const arr = pathToArr(path)\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n current = current[arr[i]]\n }\n\n return current\n}\n\nfunction eventProxy(e) {\n return this._listeners[e.type](e)\n}\n\nexport function bind(el, type, handler) {\n el._listeners = el._listeners || {}\n el._listeners[type] = handler\n el.addEventListener(type, eventProxy)\n}\n\nexport function unbind(el, type) {\n el.removeEventListener(type, eventProxy)\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\nimport { extension } from '../extend'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg, component) {\n if (name === 'className') name = 'class'\n\n if (name[0] == 'o' && name[1] == '-') {\n if (extension[name]) {\n extension[name](node, value, component)\n }\n } else 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 (!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 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 let nameLower = name.toLowerCase()\n name = (nameLower in node ? nameLower : name).slice(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 (node.nodeName === 'INPUT' && name === 'value') {\n node[name] = value == null ? '' : value\n } else if (\n name !== 'list' &&\n name !== 'type' &&\n name !== 'css' &&\n !isSvg &&\n name in node &&\n value !== ''\n ) {\n //value !== '' fix for selected, disabled, checked with pure element\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\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\n node.pureRemoveAttribute\n ? node.pureRemoveAttribute(name)\n : 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 {\n node.pureSetAttribute\n ? node.pureSetAttribute(name, value)\n : node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @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}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { camelCase, isArray, Fragment } from '../util'\nimport { removeNode } from '../dom/index'\nimport options from '../options'\n\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/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n * @param {Element} [dom=null] A DOM node to mutate into the shape of the `vnode`\n * @param {VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure\n * @returns {Element} dom The created/mutated element\n * @private\n */\nexport function diff(dom, vnode, parent, component, updateSelf) {\n //first render return undefined\n if (!dom && !vnode) return\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\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 if (vnode && vnode.nodeName === Fragment) {\n vnode = vnode.children\n }\n if (isArray(vnode)) {\n if (parent) {\n const styles = parent.querySelectorAll('style')\n styles.forEach(s => {\n parent.removeChild(s)\n })\n innerDiffNode(parent, vnode, hydrating, component, updateSelf)\n\n for (let i = styles.length - 1; i >= 0; i--) {\n parent.firstChild\n ? parent.insertBefore(styles[i], parent.firstChild)\n : parent.appendChild(style[i])\n }\n } else {\n ret = []\n vnode.forEach((item, index) => {\n let ele = idiff(index === 0 ? dom : null, item, component, updateSelf)\n ret.push(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n dom.forEach((one, index) => {\n if (index === 0) {\n ret = idiff(one, vnode, component, updateSelf)\n } else {\n recollectNodeTree(one, false)\n }\n })\n } else {\n ret = idiff(dom, vnode, component, updateSelf)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\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 }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, component, updateSelf) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\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 // 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 || component)\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 out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n if (typeof vnodeName === 'function') {\n for (let key in options.mapping) {\n if (options.mapping[key] === vnodeName) {\n vnodeName = key\n vnode.nodeName = key\n break\n }\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 if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n hydrating || props.dangerouslySetInnerHTML != null,\n component,\n updateSelf\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, component, updateSelf)\n if (out.props) {\n out.props.children = vnode.children\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 * @param {Element} dom Element whose children should be compared & mutated\n * @param {Array} vchildren Array of VNodes to compare to `dom.childNodes`\n * @param {Boolean} isHydrating If `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, isHydrating, component, updateSelf) {\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, component, updateSelf)\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 * @param {Node} node DOM node to start unmount/removal from\n * @param {Boolean} [unmountOnly=false] If `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\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 && node[ATTR_KEY].ref) {\n if (typeof node[ATTR_KEY].ref === 'function') {\n node[ATTR_KEY].ref(null)\n } else if (node[ATTR_KEY].ref.current) {\n node[ATTR_KEY].ref.current = null\n }\n }\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n * - we use .lastChild here because it causes less reflow than .firstChild\n * - 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 * @param {Element} dom Element with attributes to diff `attrs` against\n * @param {Object} attrs The desired end-state key-value attribute pairs\n * @param {Object} old Current/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, component, updateSelf) {\n let name\n //let update = false\n let isWeElement = dom.update\n let oldClone\n if (dom.receiveProps) {\n oldClone = Object.assign({}, old)\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(\n dom,\n name,\n old[name],\n (old[name] = undefined),\n isSvgMode,\n component\n )\n if (isWeElement) {\n delete dom.props[name]\n //update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (isWeElement && typeof attrs[name] === 'object' && name !== 'ref') {\n if (name === 'style') {\n setAccessor(\n dom,\n name,\n old[name],\n (old[name] = attrs[name]),\n isSvgMode,\n component\n )\n }\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else if (\n name !== 'children' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], attrs[name], isSvgMode, component)\n if (isWeElement) {\n let ccName = camelCase(name)\n dom.props[ccName] = old[ccName] = attrs[name]\n //update = true\n } else {\n old[name] = attrs[name]\n }\n }\n }\n\n if (isWeElement && !updateSelf && dom.parentNode) {\n //__hasChildren is not accuracy when it was empty at first, so add dom.children.length > 0 condition\n //if (update || dom.__hasChildren || dom.children.length > 0 || (dom.store && !dom.store.data)) {\n if (dom.receiveProps(dom.props, oldClone) !== false) {\n dom.update()\n }\n //}\n }\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\nimport { getUse } from './util'\nimport options from './options'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n if (store.data) {\n observeStore(store)\n } else {\n options.isMultiStore = true\n //Multi-store injection\n for (let key in store) {\n observeStore(store[key], key)\n }\n }\n parent.store = store\n }\n return diff(null, vnode, parent, false)\n}\n\nfunction observeStore(store, key) {\n store.instances = []\n store.updateSelfInstances = []\n extendStoreUpdate(store, key)\n\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n const patchs = {}\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n\n update(patchs, store)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n\n update(patchs, store)\n }\n })\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpdate(store, key) {\n store.update = function(patch) {\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updatePath &&\n instance._updatePath[key] &&\n needUpdate(patch, instance._updatePath[key])\n ) {\n if (instance.use) {\n getUse(\n store.data,\n (typeof instance.use === 'function'\n ? instance.use()\n : instance.use)[key],\n instance.using,\n key\n )\n }\n\n instance.update()\n }\n } else {\n if (instance._updatePath && needUpdate(patch, instance._updatePath)) {\n if (instance.use) {\n instance.using = getUse(\n store.data,\n typeof instance.use === 'function'\n ? instance.use()\n : instance.use\n )\n }\n\n instance.update()\n }\n }\n })\n\n this.updateSelfInstances.forEach(instance => {\n compute(instance, key)\n if (key) {\n if (\n instance._updateSelfPath &&\n instance._updateSelfPath[key] &&\n needUpdate(patch, instance._updateSelfPath[key])\n ) {\n if (instance.useSelf) {\n getUse(\n store.data,\n (typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf)[key],\n instance.usingSelf,\n key\n )\n }\n\n instance.updateSelf()\n }\n } else {\n if (\n instance._updateSelfPath &&\n needUpdate(patch, instance._updateSelfPath)\n ) {\n instance.usingSelf = getUse(\n store.data,\n typeof instance.useSelf === 'function'\n ? instance.useSelf()\n : instance.useSelf\n )\n instance.updateSelf()\n }\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nfunction compute(instance, isMultiStore) {\n if (instance.compute) {\n for (let ck in instance.compute) {\n instance.computed[ck] = instance.compute[ck].call(\n isMultiStore ? instance.store : instance.store.data\n )\n }\n }\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 {\n k: fixArrPath(path),\n v: current\n }\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 WeElement from './we-element'\nimport options from './options'\n\nconst storeHelpers = ['use', 'useSelf']\n\nexport function define(name, ctor, config) {\n if (options.mapping[name]) {\n return\n }\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n options.mapping[name] = ctor\n } else {\n if (typeof config === 'string') {\n config = { css: config }\n } else {\n config = config || {}\n }\n\n class Ele extends WeElement {\n static css = config.css\n\n static propTypes = config.propTypes\n\n static defaultProps = config.defaultProps\n\n static isLightDom = config.isLightDom\n\n compute = config.compute\n\n render() {\n return ctor.call(this, this)\n }\n }\n\n for (let key in config) {\n if (typeof config[key] === 'function') {\n Ele.prototype[key] = function () {\n return config[key].apply(this, arguments)\n }\n }\n }\n\n storeHelpers.forEach(func => {\n if (config[func] && config[func] !== 'function') {\n Ele.prototype[func] = function () {\n return config[func]\n }\n }\n })\n\n customElements.define(name, Ele)\n options.mapping[name] = Ele\n }\n}\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 The virtual DOM element to clone\n * @param {Object} props Attributes/props to add when cloning\n * @param {VNode} rest Any 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","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else if (p.shadowRoot && p.shadowRoot.host) {\n return p.shadowRoot.host\n } else {\n p = p.parentNode\n }\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.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 if (args.length > 0) {\n return { class: classNames.apply(null, args) }\n }\n}\n","export function o(obj) {\n return JSON.stringify(obj)\n}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { classNames, extractClass } from './class'\nimport { o } from './o'\nimport htm from 'htm'\nimport { extend, get, set, bind, unbind } from './extend'\nimport JSONProxy from './proxy'\nimport { Fragment } from './util'\n\nh.f = Fragment\n\nconst html = htm.bind(h)\n\nfunction createRef() {\n\treturn {}\n}\n\nconst $ = {}\nconst Component = WeElement\nconst defineElement = define\nconst elements = options.mapping\n\nconst omi = {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n\noptions.root.Omi = omi\noptions.root.omi = omi\noptions.root.Omi.version = '6.18.1'\n\nexport default omi\n\nexport {\n\ttag,\n\tWeElement,\n\tComponent,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine,\n\tcloneElement,\n\tgetHost,\n\trpx,\n\tdefineElement,\n\tclassNames,\n\textractClass,\n\tcreateRef,\n\thtml,\n\thtm,\n\to,\n\telements,\n\t$,\n\textend,\n\tget,\n\tset,\n\tbind,\n\tunbind,\n\tJSONProxy\n}\n","function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function () {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n * @public\n * @namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal(),\n mapping: {},\n isMultiStore: false,\n //when set true, using props of hypescript, don't use getAttribute\n //if you render all the node tree by omi self, set it\n ignoreAttrs: false\n}\n","import {\n\tcssToDom,\n\tisArray,\n\tgetUse,\n\thyphenate,\n\tgetValByPath,\n\tremoveItem\n} from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { getPath } from './util'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n\tstatic is = 'WeElement'\n\n\tconstructor() {\n\t\tsuper()\n\t\tthis.props = Object.assign({}, this.constructor.defaultProps)\n\t\tthis.elementId = id++\n\t\tthis.computed = {}\n\t}\n\n\tconnectedCallback() {\n\t\tlet p = this.parentNode\n\t\twhile (p && !this.store) {\n\t\t\tthis.store = p.store\n\t\t\tp = p.parentNode || p.host\n\t\t}\n\n\t\tthis.attrsToProps()\n\n\t\tif (this.props.use) {\n\t\t\tthis.use = this.props.use\n\t\t}\n\n\t\tif (this.props.useSelf) {\n\t\t\tthis.use = this.props.useSelf\n\t\t}\n\n\t\tif (this.use) {\n\t\t\tconst use = typeof this.use === 'function' ? this.use() : this.use\n\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\t_updatePath[storeName] = {}\n\t\t\t\t\tusing[storeName] = {}\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].instances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.using = using\n\t\t\t\tthis._updatePath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updatePath = getPath(use)\n\t\t\t\tthis.using = getUse(this.store.data, use)\n\t\t\t\tthis.store.instances.push(this)\n\t\t\t}\n\t\t}\n\t\tif (this.useSelf) {\n\t\t\tconst use =\n\t\t\t\ttypeof this.useSelf === 'function' ? this.useSelf() : this.useSelf\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tlet _updatePath = {}\n\t\t\t\tlet using = {}\n\t\t\t\tfor (let storeName in use) {\n\t\t\t\t\tgetPath(use[storeName], _updatePath, storeName)\n\t\t\t\t\tgetUse(this.store[storeName].data, use[storeName], using, storeName)\n\t\t\t\t\tthis.store[storeName].updateSelfInstances.push(this)\n\t\t\t\t}\n\t\t\t\tthis.usingSelf = using\n\t\t\t\tthis._updateSelfPath = _updatePath\n\t\t\t} else {\n\t\t\t\tthis._updateSelfPath = getPath(use)\n\t\t\t\tthis.usingSelf = getUse(this.store.data, use)\n\t\t\t\tthis.store.updateSelfInstances.push(this)\n\t\t\t}\n\t\t}\n\n\t\tif (this.compute) {\n\t\t\tfor (let key in this.compute) {\n\t\t\t\tthis.computed[key] = this.compute[key].call(\n\t\t\t\t\toptions.isMultiStore ? this.store : this.store.data\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeInstall()\n\t\tthis.install()\n\t\tthis.afterInstall()\n\n\t\tlet shadowRoot\n\t\tif (this.constructor.isLightDom) {\n\t\t\tshadowRoot = this\n\t\t} else {\n\n\t\t\tif (!this.shadowRoot) {\n\t\t\t\tshadowRoot = this.attachShadow({\n\t\t\t\t\tmode: 'open'\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tshadowRoot = this.shadowRoot\n\t\t\t\tlet fc\n\t\t\t\twhile ((fc = shadowRoot.firstChild)) {\n\t\t\t\t\tshadowRoot.removeChild(fc)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.constructor.css) {\n\t\t\t\tshadowRoot.appendChild(cssToDom(this.constructor.css))\n\t\t\t} else if (this.css) {\n\t\t\t\tshadowRoot.appendChild(\n\t\t\t\t\tcssToDom(typeof this.css === 'function' ? this.css() : this.css)\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\tthis.beforeRender()\n\t\toptions.afterInstall && options.afterInstall(this)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.__hasChildren =\n\t\t\tObject.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\trendered.length > 0\n\n\t\tthis.rootNode = diff(null, rendered, null, this)\n\t\tthis.rendered()\n\n\t\tif (this.props.css) {\n\t\t\tthis._customStyleElement = cssToDom(this.props.css)\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tshadowRoot.appendChild(this._customStyleElement)\n\t\t}\n\n\t\tif (isArray(this.rootNode)) {\n\t\t\tthis.rootNode.forEach(function (item) {\n\t\t\t\tshadowRoot.appendChild(item)\n\t\t\t})\n\t\t} else {\n\t\t\tthis.rootNode && shadowRoot.appendChild(this.rootNode)\n\t\t}\n\t\tthis.installed()\n\t\tthis._isInstalled = true\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.uninstall()\n\t\tthis._isInstalled = false\n\t\tif (this.store) {\n\t\t\tif (options.isMultiStore) {\n\t\t\t\tfor (let key in this.store) {\n\t\t\t\t\tconst current = this.store[key]\n\t\t\t\t\tremoveItem(this, current.instances)\n\t\t\t\t\tremoveItem(this, current.updateSelfInstances)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tremoveItem(this, this.store.instances)\n\t\t\t\tremoveItem(this, this.store.updateSelfInstances)\n\t\t\t}\n\t\t}\n\t}\n\n\tupdate(ignoreAttrs, updateSelf) {\n\t\tthis._willUpdate = true\n\t\tthis.beforeUpdate()\n\t\tthis.beforeRender()\n\t\t//fix null !== undefined\n\t\tif (this._customStyleContent != this.props.css) {\n\t\t\tthis._customStyleContent = this.props.css\n\t\t\tthis._customStyleElement.textContent = this._customStyleContent\n\t\t}\n\t\tthis.attrsToProps(ignoreAttrs)\n\n\t\tconst rendered = this.render(this.props, this.store)\n\t\tthis.rendered()\n\t\tthis.__hasChildren =\n\t\t\tthis.__hasChildren ||\n\t\t\t(Object.prototype.toString.call(rendered) === '[object Array]' &&\n\t\t\t\trendered.length > 0)\n\n\t\tthis.rootNode = diff(\n\t\t\tthis.rootNode,\n\t\t\trendered,\n\t\t\tthis.shadowRoot,\n\t\t\tthis,\n\t\t\tupdateSelf\n\t\t)\n\t\tthis._willUpdate = false\n\t\tthis.updated()\n\t}\n\n\tforceUpdate() {\n\t\tthis.update(true)\n\t}\n\n\tupdateProps(obj) {\n\t\tObject.keys(obj).forEach(key => {\n\t\t\tthis.props[key] = obj[key]\n\t\t\tif (this.prevProps) {\n\t\t\t\tthis.prevProps[key] = obj[key]\n\t\t\t}\n\t\t})\n\t\tthis.forceUpdate()\n\t}\n\n\tupdateSelf(ignoreAttrs) {\n\t\tthis.update(ignoreAttrs, true)\n\t}\n\n\tremoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t\t//Avoid executing removeAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tsetAttribute(key, val) {\n\t\tif (val && typeof val === 'object') {\n\t\t\tsuper.setAttribute(key, JSON.stringify(val))\n\t\t} else {\n\t\t\tsuper.setAttribute(key, val)\n\t\t}\n\t\t//Avoid executing setAttribute methods before connectedCallback\n\t\tthis._isInstalled && this.update()\n\t}\n\n\tpureRemoveAttribute(key) {\n\t\tsuper.removeAttribute(key)\n\t}\n\n\tpureSetAttribute(key, val) {\n\t\tsuper.setAttribute(key, val)\n\t}\n\n\tattrsToProps(ignoreAttrs) {\n\t\tif (options.ignoreAttrs || ignoreAttrs) return\n\t\tconst ele = this\n\t\tele.props['css'] = ele.getAttribute('css')\n\t\tconst attrs = this.constructor.propTypes\n\t\tif (!attrs) return\n\t\tObject.keys(attrs).forEach(key => {\n\t\t\tconst type = attrs[key]\n\t\t\tconst val = ele.getAttribute(hyphenate(key))\n\t\t\tif (val !== null) {\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase String:\n\t\t\t\t\t\tele.props[key] = val\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Number:\n\t\t\t\t\t\tele.props[key] = Number(val)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Boolean:\n\t\t\t\t\t\tif (val === 'false' || val === '0') {\n\t\t\t\t\t\t\tele.props[key] = false\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase Array:\n\t\t\t\t\tcase Object:\n\t\t\t\t\t\tif (val[0] === ':') {\n\t\t\t\t\t\t\tele.props[key] = getValByPath(val.substr(1), Omi.$)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tele.props[key] = JSON.parse(\n\t\t\t\t\t\t\t\tval\n\t\t\t\t\t\t\t\t\t.replace(/(['\"])?([a-zA-Z0-9_-]+)(['\"])?:([^\\/])/g, '\"$2\":$4')\n\t\t\t\t\t\t\t\t\t.replace(/'([\\s\\S]*?)'/g, '\"$1\"')\n\t\t\t\t\t\t\t\t\t.replace(/,(\\s*})/g, '$1')\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tele.constructor.defaultProps &&\n\t\t\t\t\tele.constructor.defaultProps.hasOwnProperty(key)\n\t\t\t\t) {\n\t\t\t\t\tele.props[key] = ele.constructor.defaultProps[key]\n\t\t\t\t} else {\n\t\t\t\t\tele.props[key] = null\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tfire(name, data) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(name, {\n\t\t\t\tdetail: data\n\t\t\t})\n\t\t)\n\t}\n\n\tbeforeInstall() { }\n\n\tinstall() { }\n\n\tafterInstall() { }\n\n\tinstalled() { }\n\n\tuninstall() { }\n\n\tbeforeUpdate() { }\n\n\tupdated() { }\n\n\tbeforeRender() { }\n\n\trendered() { }\n\n\treceiveProps() { }\n}\n","var n=function(t,r,u,e){for(var p=1;p\"===t?(a(),u=1):u&&(\"=\"===t?(u=4,r=e,e=\"\"):\"/\"===t?(a(),3===u&&(s=s[0]),u=s,(s=s[0]).push(u,4),u=0):\" \"===t||\"\\t\"===t||\"\\n\"===t||\"\\r\"===t?(a(),u=2):e+=t)}return a(),s},r=\"function\"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)),r}:function(n){for(var r=\"\",e=0;e1?r:r[0]}\n"]} \ No newline at end of file diff --git a/packages/omi/package.json b/packages/omi/package.json index ca0f30631..23826ee1c 100644 --- a/packages/omi/package.json +++ b/packages/omi/package.json @@ -1,6 +1,6 @@ { "name": "omi", - "version": "6.18.0", + "version": "6.18.1", "description": "Front End Cross-Frameworks Framework.", "main": "dist/omi.js", "jsnext:main": "dist/omi.esm.js", @@ -88,6 +88,7 @@ "flow-bin": "^0.67.1", "gzip-size-cli": "^2.0.0", "htm": "^2.1.1", + "husky": "^3.0.9", "istanbul-instrumenter-loader": "^3.0.0", "jest": "^23.6.0", "jscodeshift": "^0.5.0", @@ -136,19 +137,15 @@ "rollup-plugin-babel" ] }, - "bundlesize": [ - { - "path": "./dist/omi.min.js", - "threshold": "4Kb" - } - ], + "bundlesize": [{ + "path": "./dist/omi.min.js", + "threshold": "4Kb" + }], "prettier": { "singleQuote": true, "semi": false, "tabWidth": 2, "useTabs": false }, - "dependencies": { - "husky": "^3.0.9" - } + "dependencies": {} } diff --git a/packages/omi/src/define.js b/packages/omi/src/define.js index 3899665f2..61dbd38ad 100644 --- a/packages/omi/src/define.js +++ b/packages/omi/src/define.js @@ -24,6 +24,8 @@ export function define(name, ctor, config) { static defaultProps = config.defaultProps + static isLightDom = config.isLightDom + compute = config.compute render() { @@ -33,7 +35,7 @@ export function define(name, ctor, config) { for (let key in config) { if (typeof config[key] === 'function') { - Ele.prototype[key] = function() { + Ele.prototype[key] = function () { return config[key].apply(this, arguments) } } @@ -41,7 +43,7 @@ export function define(name, ctor, config) { storeHelpers.forEach(func => { if (config[func] && config[func] !== 'function') { - Ele.prototype[func] = function() { + Ele.prototype[func] = function () { return config[func] } } diff --git a/packages/omi/src/omi.js b/packages/omi/src/omi.js index 325e4a339..a4ead59eb 100644 --- a/packages/omi/src/omi.js +++ b/packages/omi/src/omi.js @@ -58,7 +58,7 @@ const omi = { options.root.Omi = omi options.root.omi = omi -options.root.Omi.version = '6.18.0' +options.root.Omi.version = '6.18.1' export default omi