UNPKG

zliq

Version:

slim and quick framework in low loc

2 lines 25.8 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.zliq=t():e.zliq=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){"use strict";(function(e){n.d(t,"c",function(){return c}),n.d(t,"b",function(){return m}),n.d(t,"a",function(){return y});var r=n(2),o=n.n(r);function i(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){return void n(e)}c.done?t(a):Promise.resolve(a).then(r,o)}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var c=function(t){var n=function e(t){return function(e,t){e.value=t,function(e,t){e.forEach(function(e){e(t)})}(e.listeners,t)}(e,t),e};return n.IS_STREAM=!0,n.value=t,n.listeners=[],n.toString=function(){return"Stream("+n.value+")"},n.map=function(e){return f(n,e)},n.is=function(e){return f(n,function(t){return t===e})},n.flatMap=function(e){return function(e,t){var n,r=function(e){i(e)};function o(e,t,n){var r=e(t);return r.listeners.push(n),r}var i=a(e,function(e){return(n=o(t,e,r)).value});return e.listeners.push(function(e){n&&g(n.listeners,r),n=o(t,e,r),i(n.value)}),i}(n,e)},n.filter=function(e){return function(e,t){var n=a(e,function(e){return t(e)?e:void 0});return e.listeners.push(function(e){t(e)&&n(e)}),n}(n,e)},n.deepSelect=function(e){return function(e,t){var n=t.split("."),r=a(e,function(e){return l(e,n)});return e.listeners.push(function(e){r(l(e,n))}),r}(n,e)},n.distinct=function(e){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return function(e,t){return!o()(e,t)}(e,t)},n=a(e,function(e){return e});return e.listeners.push(function(e){t(n.value,e)&&n(e)}),n}(n,e)},n.query=function(e){return s(n,e)},n.$=function(e){return s(n,e).distinct()},n.until=function(e){return p(n,e)},n.patch=function(t){return function(t,n){return e(function(){null===n||"object"!==u(n)||"object"!==u(t.value)?t(n):t(Object.assign({},t.value,n))}),t}(n,t)},n.reduce=function(e,t){return d(n,e,t)},n.debounce=function(e){return h(n,e)},n.schedule=function(t,r){return function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=0,u=a(t,function(e){return v(n,o++,e)});n.length===o&&r();return t.listeners.push(function(t){e(function(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var u=e.apply(t,n);function c(e){i(u,r,o,c,a,"next",e)}function a(e){i(u,r,o,c,a,"throw",e)}c(void 0)})}}(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=u,e.next=3,v(n,o++,t);case 3:e.t1=e.sent,(0,e.t0)(e.t1),o===n.length&&r();case 6:case"end":return e.stop()}},e,this)})))}),u}(n,t,r)},n.next=function(){return function(e){var t,n=new Promise(function(e){t=e});return subscribeTo(e,t),n.then(function(){return g(e.listeners,t)}),n}(n)},n.log=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Stream:";return function(e,t){return f(e,function(e){return console.log(t,e)}),e}(n,e)},n};function a(e,t){var n=void 0!==e.value?t(e.value):void 0;return c(n)}function f(e,t){var n=a(e,t);return e.listeners.push(function(e){n(t(e))}),n}function l(e,t){return null===e||void 0===e?null:0===t.length?e:l(e[t[0]],t.splice(1,t.length-1))}function s(e,t){return Array.isArray(t)?e.map(function(e){return t.map(function(t){return l(e,t.split("."))})}):e.map(function(e){return l(e,t.split("."))})}function p(e,t){var n=c(),r=function(t,n){n(e.value),t.listeners.push(n)};return void 0===t.value&&r(e,n),t.map(function(t){t?g(e.listeners,n):r(e,n)}),n}function d(e,t,n){var r=n,o=c();function i(n){r=t(r,e.value),o(r)}return void 0!==e.value&&i(e.value),e.listeners.push(i),o}function h(e,t){var n;function r(e){n&&window.clearTimeout(n),n=setTimeout(function(){o(e),n=null},t)}var o=c();return void 0!==e.value&&r(e.value),e.listeners.push(r),o}function v(e,t,n){if(e.length<t+1)throw Error("ZLIQ: schedule for iteration "+t+" not defined");var r=e[t];return"function"==typeof r?r(n):r}function m(e){var t=e.map(function(e){return e&&e.IS_STREAM?e.value:e}),n=c(-1===t.indexOf(void 0)?t:void 0);return e.forEach(function(e,r){e.IS_STREAM&&e.listeners.push(function(e){t[r]=e,n(-1===t.indexOf(void 0)?t:void 0)})}),n}function y(e){return null!=e&&!!e.IS_STREAM}function g(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}}).call(this,n(3).setImmediate)},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=Array.prototype.slice,o=n(6),i=n(7),u=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:function(e,t,n){var f,l;if(c(e)||c(t))return!1;if(e.prototype!==t.prototype)return!1;if(i(e))return!!i(t)&&(e=r.call(e),t=r.call(t),u(e,t,n));if(a(e)){if(!a(t))return!1;if(e.length!==t.length)return!1;for(f=0;f<e.length;f++)if(e[f]!==t[f])return!1;return!0}try{var s=o(e),p=o(t)}catch(e){return!1}if(s.length!=p.length)return!1;for(s.sort(),p.sort(),f=s.length-1;f>=0;f--)if(s[f]!=p[f])return!1;for(f=s.length-1;f>=0;f--)if(l=s[f],!u(e[l],t[l],n))return!1;return typeof e==typeof t}(e,t,n))};function c(e){return null===e||void 0===e}function a(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(4),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(1))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o=1,i={},u=!1,c=e.document,a=Object.getPrototypeOf&&Object.getPrototypeOf(e);a=a&&a.setTimeout?a:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){l(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&l(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),r=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){l(e.data)},r=function(t){e.port2.postMessage(t)}}():c&&"onreadystatechange"in c.createElement("script")?function(){var e=c.documentElement;r=function(t){var n=c.createElement("script");n.onreadystatechange=function(){l(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():r=function(e){setTimeout(l,0,e)},a.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var u={callback:e,args:t};return i[o]=u,r(o),o++},a.clearImmediate=f}function f(e){delete i[e]}function l(e){if(u)setTimeout(l,0,e);else{var t=i[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{f(e),u=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(1),n(5))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var a,f=[],l=!1,s=-1;function p(){l&&a&&(l=!1,a.length?f=a.concat(f):s=-1,f.length&&d())}function d(){if(!l){var e=c(p);l=!0;for(var t=f.length;t;){for(a=f,f=[];++s<t;)a&&a[s].run();s=-1,t=f.length}a=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new h(e,t)),1!==f.length||l||c(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}(e.exports="function"==typeof Object.keys?Object.keys:n).shim=n},function(e,t){var n="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function r(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}(t=e.exports=n?r:o).supported=r,t.unsupported=o},function(e,t,n){"use strict";n.r(t);var r=n(0);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return void 0!==e&&Object(r.a)(e)?e.map(function(e){return e?t:n}):Object(r.c)(e?t:n)}function u(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Object(r.b)(t).map(function(e){return e.join(" ")})}function c(e){if(null===e)return Object(r.c)({});var t=function e(t){return a(Object.keys(t).map(function(n){return null===t[n]||void 0===t[n]?[]:Object(r.a)(t[n])?[{parent:t,key:n,stream:t[n]}]:"object"===o(t[n])?e(t[n]):[]}))}(e).map(function(e){var t=e.parent,n=e.key;return e.stream.distinct().map(function(e){return t[n]=e,e})});return Object(r.b)(t).map(function(t){return e})}function a(e,t){var n,r=Object.prototype.toString,o=[],i=t&&e||e.slice();if(!e.length)return o;n=i.pop();do{"[object Array]"===r.call(n)?i.push.apply(i,n):o.push(n)}while(i.length&&void 0!==(n=i.pop()));return o.reverse(),o}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,c=e[Symbol.iterator]();!(r=(u=c.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var l=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.build=t},s=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return t=t||{},new l(function(n){var i=-1,u=p(d(o,n));if("function"==typeof e){var s=e(t,u,n);return Array.isArray(s)?d(s,n):s instanceof l||Object(r.a)(s)?h(s,n):Object(r.b)([c(t),u.map(a)]).map(function(e){var t=f(e,2),r=t[0],o=t[1];return s(r,o,n)}).map(function(e){return d(e,n)})}return Object(r.b)([c(t),u.map(a)]).map(function(t){var n=f(t,2),r=n[0],o=n[1];return{tag:e,props:r,children:o,version:++i}})})};function p(e){Array.isArray(e)||(e=[e]);var t=(e=a(e).filter(function(e){return null!==e})).map(function(e){return Object(r.a)(e)?e.flatMap(p):e});return Object(r.b)(t)}function d(e,t){return Array.isArray(e)||(e=[].concat(e)),a(e.map(function(e){return Array.isArray(e)?d(e,t):h(e,t)}))}function h(e,t){return e instanceof l?d(e.build(t),t):Object(r.a)(e)?e.map(function(e){return d(e,t)}):e}var v="#text";function m(e,t,n,r,o){null===t&&(t=w(n.tag,n.children),e&&e.appendChild(t));var i=t,u=n.props&&n.props.id;try{i=u?function(e,t,n,r){var o=t.tag,i=t.props,u=t.children,c=t.version,a=n.props,f=i.id,l=!1,s=!1;void 0===r[f]&&(r[f]={element:document.createElement(o),vdom:{tag:o,props:{},children:[]}},l=!0);var p=r[f];c!==p.version&&(y(p.element,i,a),g(p.element,u,p.vdom.children,r),p.version=c,p.vdom.props=i,p.vdom.children=u,s=!0);l?T(p.element,i,"created"):s&&T(p.element,i,"updated");e!==p.element&&(e.parentElement.replaceChild(p.element,e),T(p.element,i,"mounted"));return p.element}(t,n,r,o):function(e,t,n,r){var o=t.tag,i=t.props,u=t.children,c=t.version,a=n.props,f=n.children,l=n.version,s=-1===l||void 0===l;if(j(e)&&o===v)return function(e,t){e.nodeValue!==t&&(e.nodeValue=t)}(e,u[0]),e;if(!1===function(e,t,n){return!j(e)&&""===e.id&&!function(e,t){return e.nodeName.toLowerCase()!==t}(e,n)}(e,0,o)){var p=w(o,u);e.parentElement.replaceChild(p,e),e=p,f=[]}y(e,i,a);var d=i&&void 0!==i.isolated;o===v||d&&!s||g(e,u,f,r);s&&T(e,i,"created");c>0&&T(e,i,"updated");return e}(t,n,r,o)}catch(e){i={tag:"div",props:{style:"border: 1px solid red; color: red;"},children:["FAULTY ELEMENT"]},console.error("[ERROR]: An element failed to render.\n",e)}return i}function y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};void 0!==t&&(Object.keys(t).map(function(n){!function(e,t,n){if(t.startsWith("*"))return void e.setAttribute(t.substr(1),n);if("class"===t)e.className=n||"";else if("style"===t&&"string"!=typeof n){var r=n?Object.keys(n).map(function(e){return e+":"+n[e]+";"}).join(" "):"";e.style.cssText=r}else void 0!==e[t]&&(e[t]=null===n?void 0:n),e[t]=null===n?void 0:n}(e,n,t[n])}),Object.keys(n).map(function(n){void 0===t[n]&&e.removeAttribute(n)}))}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0;if(0!==t.length||0!==n.length){e.childNodes;var o=b(t);!function(e,t,n,r){for(var o=e.childNodes,i=0;i<o.length&&i<t.length;i++)m(e,o[i],t[i],n[i]||{},r)}(e,o,b(n),r),function(e,t,n){var r=e.childNodes.length;for(n.length!==r&&console.warn("ZLIQ: Something other then ZLIQ has manipulated the children of the element",e,". This can lead to sideffects. Consider using the 'isolated' attribute for this element to prevent updates.");r>t.length;r--){var o=e.childNodes[r-1];e.removeChild(o),n.length<r||T(o,{cycle:n[r-1].cycle},"removed")}}(e,o,n),function(e,t,n){for(var r=e.childNodes.length;r<t.length;r++){var o=t[r],i=o.tag,u=o.props,c=o.children,a=(o.version,w(i,c));e.appendChild(a),m(e,a,t[r],{},n),u&&u.cycle&&u.cycle.mounted&&!u.id&&console.error("The 'mounted' lifecycle event is only called on elements with id. As elements are updated in place, it is hard to define when a normal element is mounted.")}}(e,o,r)}}function b(e){return e.map(function(e){return Object(r.a)(e)||void 0!==e.tag?e:{tag:v,children:[e],version:0}})}function w(e,t){return e===v?document.createTextNode(t[0]):document.createElement(e)}function T(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).cycle,n=arguments.length>2?arguments[2]:void 0;t&&t[n]&&t[n](e)}function j(e){return e instanceof window.Text}function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;return function e(t,n){var o;if(Object(r.a)(t))return o=t.flatMap(function(e){var t=h(e,n);return Array.isArray(t)&&(t=t[0]),Object(r.a)(t)?t:Object(r.c)(t)}).map(function(e){return Array.isArray(e)&&(e=e[0]),e});if(t instanceof l)return o=t.build(n),o=e(o,n);"function"==typeof t&&(o=t({},[],n));Object(r.a)(o)||(o=e(o,n));return o}(e,n).debounce(o).reduce(function(e,t,n){var r=t.element,o=t.version,i=t.children,u=t.keyContainer,c=n.tag,a=n.props,f=n.children,l=n.version;try{var s=m(e,r,{tag:c,props:a,children:f,version:l},{children:i,version:o},u);return e&&0===l&&T(r,a,"mounted"),{element:s,version:l,children:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];var n=JSON.parse(JSON.stringify(t));n.forEach(function(n,r){var o=t[r];o.props&&o.props.cycle&&(n.cycle=o.props.cycle),"object"===S(t[r])&&(n.children=e(o.children))});return n}(f),keyContainer:u}}catch(e){console.error("Error in rendering step:",e)}}.bind(null,t),{element:null,version:-1,children:[],keyContainer:{}})}function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var x=0,E=1,I=2,k=3,M=4,_=5,C=6,L=7,P=8,R=9,N=10,$=11,F=12,q=13;function D(e){return e===R||e===N}var z=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","!--","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9-￿_:-]+)*$");function B(e){return z.test(e)}var Z=function(e){return"string"!=typeof e?e:e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},Q=function(e,t){t||(t={});var n=t.concat||function(e,t){return String(e)+String(t)};return!1!==t.attrToProp&&(e=function(e){var t={class:"className",for:"htmlFor","http-equiv":"httpEquiv"};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(var i in r)i in t&&(r[t[i]]=r[i],delete r[i]);return e(n,r,o)}}(e)),function(t){for(var o=arguments.length,i=new Array(o>1?o-1:0),u=1;u<o;u++)i[u-1]=arguments[u];return new l(function(o){var u=function(t,o,i){for(var u=E,c="",a=i.length,f=[],l=0;l<o.length;l++)if(l<a){var s=Z(i[l]),p=Q(o[l]),d=u;d===N&&(d=P),d===R&&(d=P),d===L&&(d=P),d===M&&(d=_),d===I?"/"===c?(p.push([I,"/",s]),c=""):p.push([I,s]):p.push([x,d,s]),f.push.apply(f,p)}else f.push.apply(f,Q(o[l]));for(var h=[null,{},[]],v=[[h,-1]],m=0;m<f.length;m++){var y=v[v.length-1][0],g=f[m],b=g[0];if(b===I&&/^\//.test(g[1])){var w=v[v.length-1][1];v.length>1&&(v.pop(),v[v.length-1][0][2][w]=e(y[0],y[1],y[2].length?y[2]:void 0))}else if(b===I){var T=[g[1],{},[]];y[2].push(T),v.push([T,y[2].length-1])}else if(b===_||b===x&&g[1]===_){for(var j="",S=void 0;m<f.length;m++)if(f[m][0]===_)j=n(j,f[m][1]);else{if(f[m][0]!==x||f[m][1]!==_)break;if("object"!==A(f[m][2])||j)j=n(j,f[m][2]);else for(S in f[m][2])f[m][2].hasOwnProperty(S)&&!y[1][S]&&(y[1][S]=f[m][2][S])}f[m][0]===$&&m++;for(var O=m;m<f.length;m++)if(f[m][0]===P||f[m][0]===_)y[1][j]?""===f[m][1]||(y[1][j]=n(y[1][j],f[m][1])):y[1][j]=r(f[m][1]);else{if(f[m][0]!==x||f[m][1]!==P&&f[m][1]!==_){!j.length||y[1][j]||m!==O||f[m][0]!==k&&f[m][0]!==F||(y[1][j]=j.toLowerCase()),f[m][0]===k&&m--;break}y[1][j]?""===f[m][2]||(y[1][j]=n(y[1][j],f[m][2])):y[1][j]=r(f[m][2])}}else if(b===_)y[1][g[1]]=!0;else if(b===x&&g[1]===_)y[1][g[2]]=!0;else if(b===k){if(B(y[0])&&v.length){var z=v[v.length-1][1];v.pop(),v[v.length-1][0][2][z]=e(y[0],y[1],y[2].length?y[2]:void 0)}}else if(b===x&&g[1]===E)void 0===g[2]||null===g[2]?g[2]="":g[2]||(g[2]=n("",g[2])),Array.isArray(g[2][0])?y[2].push.apply(y[2],g[2]):y[2].push(g[2]);else if(b===E)y[2].push(g[1]);else if(b!==$&&b!==F)throw new Error("unhandled: "+b)}return h[2].length>1&&/^\s*$/.test(h[2][0])&&h[2].shift(),h[2].length>2||2===h[2].length&&/\S/.test(h[2][1])?h[2]:(Array.isArray(h[2][0])&&"string"==typeof h[2][0][0]&&Array.isArray(h[2][0][2])&&(h[2][0]=e(h[2][0][0],h[2][0][1],h[2][0][2])),h[2][0]);function Q(e){var t=[];u===L&&(u=M);for(var n=0;n<e.length;n++){var r=e.charAt(n);u===E&&"<"===r?(c.length&&t.push([E,c]),c="",u=I):">"!==r||D(u)||u===q?u===q&&/-$/.test(c)&&"-"===r?(c="",u=E):u===I&&/^!--$/.test(c)?(c=r,u=q):u===E||u===q?c+=r:u===I&&"/"===r&&c.length||(u===I&&/\s/.test(r)?(c.length&&t.push([I,c]),c="",u=M):u===I?c+=r:u===M&&/[^\s"'=/]/.test(r)?(u=_,c=r):u===M&&/\s/.test(r)?(c.length&&t.push([_,c]),t.push([F])):u===_&&/\s/.test(r)?(t.push([_,c]),c="",u=C):u===_&&"="===r?(t.push([_,c],[$]),c="",u=L):u===_?c+=r:u!==C&&u!==M||"="!==r?u!==C&&u!==M||/\s/.test(r)?u===L&&'"'===r?u=N:u===L&&"'"===r?u=R:u===N&&'"'===r?(t.push([P,c],[F]),c="",u=M):u===R&&"'"===r?(t.push([P,c],[F]),c="",u=M):u!==L||/\s/.test(r)?u===P&&/\s/.test(r)?(t.push([P,c],[F]),c="",u=M):u!==P&&u!==R&&u!==N||(c+=r):(u=P,n--):(t.push([F]),/[\w-]/.test(r)?(c+=r,u=_):u=M):(t.push([$]),u=L)):(u===I&&c.length?t.push([I,c]):u===_?t.push([_,c]):u===P&&c.length&&t.push([P,c]),t.push([k]),c="",u=E)}return u===E&&c.length?(t.push([E,c]),c=""):u===P&&c.length?(t.push([P,c]),c=""):u===N&&c.length?(t.push([P,c]),c=""):u===R&&c.length?(t.push([P,c]),c=""):u===_&&(t.push([_,c]),c=""),t}}(0,t,i);if(Array.isArray(u))return d(u,o);for(var c=u;c instanceof l;)c=c.build(o);return c})};function r(e){return"function"==typeof e?e:"string"==typeof e?e:e&&"object"===A(e)?e:n("",e)}}(s);function G(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){return void n(e)}c.done?t(a):Promise.resolve(a).then(r,o)}function J(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{attach:!1,debounce:0,globals:{}},o=document.createElement("div");return r.attach&&document.body.appendChild(o),t=t.map(function(e){return"string"==typeof e?function(t){var n=t.element;return expect(V(n.outerHTML)).toBe(V(e))}:e}),H(O(e,o,r.globals,r.debounce),t,n)}function V(e){return e.replace(/\>(\s*)(.*)(\s*)\</g,">$2<")}function H(e,t,n){return e.schedule(t.map(function(e){return function(){var t=function(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function u(e){G(i,r,o,u,c,"next",e)}function c(e){G(i,r,o,u,c,"throw",e)}u(void 0)})}}(regeneratorRuntime.mark(function t(r){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,U(e,r).catch(n.fail);case 2:return t.abrupt("return",r);case 3:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()}),n)}function U(e,t){return new Promise(function(n,r){setTimeout(function(){try{"function"==typeof e?e(t):expect(t).toEqual(e),n()}catch(e){r(e)}})})}n.d(t,"zx",function(){return Q}),n.d(t,"stream",function(){return r.c}),n.d(t,"merge$",function(){return r.b}),n.d(t,"isStream",function(){return r.a}),n.d(t,"render",function(){return O}),n.d(t,"Component",function(){return l}),n.d(t,"h",function(){return s}),n.d(t,"resolveChildren",function(){return d}),n.d(t,"resolveChild",function(){return h}),n.d(t,"if$",function(){return i}),n.d(t,"join$",function(){return u}),n.d(t,"resolve$",function(){return c}),n.d(t,"flatten",function(){return a}),n.d(t,"testRender",function(){return J}),n.d(t,"test$",function(){return H})}])}); //# sourceMappingURL=zliq.min.js.map