Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created April 3, 2014 06:46
Show Gist options
  • Save Raynos/9949414 to your computer and use it in GitHub Desktop.
Save Raynos/9949414 to your computer and use it in GitHub Desktop.
requirebin sketch
var mercury = require("mercury")
var h = mercury.h
var delegator = mercury.Delegator()
var inputs = mercury.EventSinks(delegator.id, ["clicks"])
var clickCount = mercury.value(0)
inputs.events.clicks(function () {
clickCount.set(clickCount() + 1)
})
function render(clickCount) {
return h("div", [
"The state ", h("code", "clickCount"), " has value: ",
clickCount + ".",
h("input", { type: "button", value: "Click me!",
"data-click": mercury.event(inputs.sinks.clicks) })
])
}
var loop = mercury.main(clickCount(), render)
clickCount(loop.update)
document.body.appendChild(loop.target)
function render(t){return h("div",["The state ",h("code","clickCount")," has value: ",t+".",h("input",{type:"button",value:"Click me!","data-click":mercury.event(inputs.sinks.clicks)})])}require=function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);throw Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;r.length>s;s++)i(r[s]);return i}({1:[function(){},{}],2:[function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,a,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length))throw e=arguments[1],e instanceof Error?e:TypeError('Uncaught, unspecified "error" event.');if(n=this._events[t],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,a=Array(i-1),u=1;i>u;u++)a[u-1]=arguments[u];n.apply(this,a)}else if(o(n)){for(i=arguments.length,a=Array(i-1),u=1;i>u;u++)a[u-1]=arguments[u];for(c=n.slice(),i=c.length,u=0;i>u;u++)c[u].apply(this,a)}return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned){var i;i=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),console.trace())}return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,s,a;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(a=s;a-->0;)if(n[a]===e||n[a].listener&&n[a].listener===e){i=a;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.listenerCount=function(t,e){var n;return n=t._events&&t._events[e]?r(t._events[e])?1:t._events[e].length:0}},{}],mercury:[function(t,e){e.exports=t("LsVy72")},{}],LsVy72:[function(t,e){e.exports={main:t("main-loop"),Delegator:t("dom-delegator"),EventSinks:t("event-sinks/geval"),event:t("value-event/event"),valueEvent:t("value-event/value"),submitEvent:t("value-event/submit"),changeEvent:t("value-event/change"),array:t("observ-array"),hash:t("observ-hash"),value:t("observ"),diff:t("virtual-dom/diff"),patch:t("virtual-dom/patch"),partial:t("vdom-thunk"),create:t("virtual-dom/create-element"),h:t("virtual-dom/h")}},{"dom-delegator":9,"event-sinks/geval":21,"main-loop":24,observ:56,"observ-array":47,"observ-hash":49,"value-event/change":57,"value-event/event":58,"value-event/submit":64,"value-event/value":65,"vdom-thunk":66,"virtual-dom/create-element":86,"virtual-dom/diff":87,"virtual-dom/h":88,"virtual-dom/patch":107}],5:[function(t,e){function n(t,e,n,i){var o=r(e),s=o[n]||{};s[t]=s[t]||[],-1===s[t].indexOf(i)&&s[t].push(i),o[n]=s}var r=t("data-set");e.exports=n},{"data-set":13}],6:[function(t,e){function n(t){function e(e,n){function s(t,e,n){i(u.id,t,e,n)}function a(e){o(u,t,e)}t.is(e)||(n=e,e=null),e=e||t.defaultTarget,n=n||{};var u={id:n.id||r(),target:e,listenTo:a,addEventListener:s};return n.defaultEvents!==!1&&t.allEvents.forEach(function(e){o(u,t,e)}),u}return e}var r=t("cuid"),i=t("./add-event.js"),o=t("./listen.js");e.exports=n},{"./add-event.js":5,"./listen.js":10,cuid:11}],7:[function(t,e){function n(t,e,n){t.addEventListener(e,n,!0)}function r(t){return t&&"string"==typeof t.tagName}function i(t){return t.parentNode}var o=t("global/document"),s=["blur","focus","focusin","focusout","load","resize","scroll","unload","click","dblclick","mousedown","mouseup","change","select","submit","keydown","keypress","keyup","error","contextmenu"];e.exports={is:r,defaultTarget:o.documentElement,allEvents:s,addListener:n,getParent:i}},{"global/document":18}],8:[function(t,e){function n(t,e,i,a){if(null===i)return null;var u=s(i),c=r(u[a],u.event,e);return c?new o(i,c):n(t,e,t.getParent(i),a)}function r(t,e,n){var r=i(t||{},n),o=i(e||{},n);return r||o?[].concat(r||[],o||[]):null}function i(t,e){return t.id===e?t:Array.isArray(t)?t.filter(function(t){return t.id===e}):t[e]}function o(t,e){this.currentTarget=t,this.handlers=e}var s=t("data-set");e.exports=n},{"data-set":13}],9:[function(t,e){var n=t("./dom-surface.js"),r=t("./create-delegator.js");e.exports=r(n)},{"./create-delegator.js":6,"./dom-surface.js":7}],10:[function(t,e){function n(t,e,n){e.addListener(t.target,n,function(o){var s=i(e,t.id,o.target,n);if(s){var a=r(o,{currentTarget:s.currentTarget});s.handlers.forEach(function(t){"function"==typeof t?t(a):t.handleEvent(a)})}})}var r=t("xtend"),i=t("./get-listener.js");e.exports=n},{"./get-listener.js":8,xtend:20}],11:[function(t,e){(function(t){"use strict";var n="cuid",r=0,i=4,o=36,s=Math.pow(o,i),a=function a(t,e){var n="000000000"+t;return n.substr(n.length-e)},u=function u(){return a((Math.random()*s<<0).toString(o),i)},c=function(){var t,e="c",n=(new Date).getTime().toString(o),l=c.fingerprint(),f=u()+u();return r=s>r?r:0,t=a(r.toString(o),i),r++,e+n+t+l+f};c.slug=function(){var t=(new Date).getTime().toString(36),e=r.toString(36).slice(-1),n=c.fingerprint().slice(0,1)+c.fingerprint().slice(-1),i=u().slice(-1);return r++,t.slice(2,4)+t.slice(-2)+e+n+i},c.globalCount=function(){var t=function(){var t,e=0;for(t in window)e++;return e}();return c.globalCount=function(){return t},t},c.fingerprint=function(){return a((navigator.mimeTypes.length+navigator.userAgent.length).toString(36)+c.globalCount().toString(36),4)},t.register?t.register(n,c):e!==void 0?e.exports=c:t[n]=c})(this.applitude||this)},{}],12:[function(t,e){function n(t){var e=t.attributes,n={};if(null===e||void 0===e)return n;for(var r=0;e.length>r;r++){var i=e[r];"data-"===i.name.substr(0,5)&&(n[i.name.substr(5)]=i.value)}return n}e.exports=n},{}],13:[function(t,e){function n(t){var e=s(t);return e.hash||(e.hash=o(t)),e.hash}var r=t("weakmap-shim/create-store"),i=t("individual"),o=t("./create-hash.js"),s=i("__DATA_SET_WEAKMAP@3",r());e.exports=n},{"./create-hash.js":12,individual:14,"weakmap-shim/create-store":16}],14:[function(t,e){function n(t,e){return r[t]?r[t]:(Object.defineProperty(r,t,{value:e,configurable:!0}),e)}var r=t("global");e.exports=n},{global:15}],15:[function(t,e){(function(t){t!==void 0?e.exports=t:"undefined"!=typeof window&&(e.exports=window)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],16:[function(t,e){function n(){var t={};return function(e){if("object"!=typeof e||null===e)throw Error("Weakmap-shim: Key must be object");var n=e.valueOf(t);return n&&n.identity===t?n:r(e,t)}}var r=t("./hidden-store.js");e.exports=n},{"./hidden-store.js":17}],17:[function(t,e){function n(t,e){var n={identity:e},r=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?r.apply(this,arguments):n},writable:!0}),n}e.exports=n},{}],18:[function(t,e){e.exports="undefined"!=typeof document?document:t("min-document")},{"min-document":1}],19:[function(t,e){function n(t){return null!==t&&("object"==typeof t||"function"==typeof t)}e.exports=n},{}],20:[function(t,e){function n(){for(var t={},e=0;arguments.length>e;e++){var n=arguments[e];if(r(n))for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])}return t}var r=t("./has-keys");e.exports=n},{"./has-keys":19}],21:[function(t,e){function n(t,e){var n=e.reduce(function(t,e){return t[e]=r(),t},{}),o=e.reduce(function(t,e){return t[e]=n[e].listen,t},{}),s=e.reduce(function(e,r){return e[r]=new i(n[r].broadcast,t,r),e},{});return{events:o,sinks:s}}var r=t("geval/event"),i=t("./sink.js");e.exports=n},{"./sink.js":23,"geval/event":22}],22:[function(t,e){function n(){function t(t){for(var e=0;n.length>e;e++)n[e](t)}function e(t){function e(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}return n.push(t),e}var n=[];return{broadcast:t,listen:e}}e.exports=n},{}],23:[function(t,e){function n(t,e,r){return this instanceof n?(this.id=e||"",this.key=r||"",this.write=t,void 0):new n(e,r,t)}e.exports=n},{}],24:[function(t,e){function n(t,e,n){function a(t){null!==c||v||(v=!0,r(u)),c=t}function u(){if(null===c)return v=!1,void 0;var t=e(c);if(n.createOnly)l(t,n);else{var i=f(h,t,n);p(d,i,n)}h=t,c=null,r(u)}n=n||{};var c=t,l=n.create||i,f=n.diff||o,p=n.patch||s,v=!0,h=e(c),d=l(h,n);return c=null,r(u),{target:d,update:a}}var r=t("raf").polyfill,i=t("virtual-dom/create-element"),o=t("virtual-dom/diff"),s=t("virtual-dom/patch");e.exports=n},{raf:25,"virtual-dom/create-element":26,"virtual-dom/diff":27,"virtual-dom/patch":43}],25:[function(t,e){function n(t,e){function i(){var e=n.now(),r=e-o;o=e,a.paused||a.emit("data",r),s(i,t)}var o=n.now(),a=new r;return"function"==typeof t&&(e=t,t=void 0),a.pause=function(){a.paused=!0},a.resume=function(){a.paused=!1},s(i,t),e&&a.on("data",function(t){e(t)}),a}e.exports=n;var r=t("events").EventEmitter,i="undefined"==typeof window?this:window,o=i.performance&&i.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date},s=i.requestAnimationFrame||i.webkitRequestAnimationFrame||i.mozRequestAnimationFrame||i.msRequestAnimationFrame||i.oRequestAnimationFrame||(i.setImmediate?function(t){setImmediate(t)}:function(t){setTimeout(t,0)});n.polyfill=s,n.now=o},{events:2}],26:[function(t,e){function n(t,e){var i=e?e.document||document:document,u=e?e.warn:null;if(t&&"function"==typeof t.init)return t.init();if(s(t))return i.createTextNode(t.text);if(a(t))return i.createTextNode(t);if(!o(t))return u&&u("Item is not a valid virtual dom node",t),null;var c=i.createElement(t.tagName);r(c,t.properties);for(var l=t.children,f=0;l.length>f;f++){var p=n(l[f],e);p&&c.appendChild(p)}return c}function r(t,e){for(var n in e){var r=e[n];if("function"==typeof r)r(t,n);else if("style"===n)if("string"==typeof r)t.style.cssText=r;else for(var o in r)t.style[o]=r[o];else"data-"===n.substr(0,5)?i(t)[n.substr(5)]=r:t[n]=r}}var i=t("data-set"),o=t("./lib/is-virtual-dom"),s=t("./lib/is-virtual-text"),a=t("./lib/is-string");e.exports=n},{"./lib/is-string":30,"./lib/is-virtual-dom":31,"./lib/is-virtual-text":32,"data-set":37}],27:[function(t,e){function n(t,e){var n={a:t};return r(t,e,n,0),n}function r(t,e,n,r){if(t===e)return e;var c=n[r];if(p(t))c=a(c,u(t,e));else if(p(e))c=a(c,u(t,e));else if(f(t)&&f(e))t.text!==e.text&&(c=a(c,u(t.text,e.text)));else if(l(t)&&l(e)&&t.tagName===e.tagName){var v=i(t.properties,e.properties);v&&(c=a(c,u(t.properties,v))),c=o(t,e,n,c,r)}else t!==e&&(c=a(c,u(t,e)),!l(t)||!t.hasWidgets||l(e)&&t.tagName===e.tagName||s(t,n,r));c&&(n[r]=c)}function i(t,e){var n;for(var r in t)if("style"===r){var o=i(t.style,e.style||v);o&&(n=n||{},n.style=o)}else{var s=t[r],a=e[r];("function"==typeof s||s!==a)&&(n=n||{},n[r]=a)}for(var u in e)u in t||(n=n||{},n[u]=e[u]);return n}function o(t,e,n,i,o){for(var c=t.children,f=e.children,p=c.length,v=f.length,h=v>p?p:v,d=0;h>d;d++){var m=c[d],g=f[d];o+=1,r(m,g,n,o),l(m)&&m.count&&(o+=m.count)}for(;p>d;d++){var y=c[d];o+=1,n[o]=u(y,null),s(y,n,o),l(y)&&y.count&&(o+=y.count)}for(;v>d;d++){var x=f[d];i=a(i,u(null,x))}return i}function s(t,e,n){if(p(t))"function"==typeof t.destroy&&(e[n]=u(t,null));else if(l(t)&&t.hasWidgets)for(var r=t.children,i=r.length,o=0;i>o;o++){var a=r[o];n+=1,s(a,e,n),l(a)&&a.count&&(n+=a.count)}}function a(t,e){return t?(c(t)?t.push(e):t=[t,e],t):e}var u=t("./lib/patch-op"),c=t("./lib/is-array"),l=t("./lib/is-virtual-dom"),f=t("./lib/is-virtual-text"),p=t("./lib/is-widget");e.exports=n;var v={}},{"./lib/is-array":29,"./lib/is-virtual-dom":31,"./lib/is-virtual-text":32,"./lib/is-widget":33,"./lib/patch-op":34}],28:[function(t,e){function n(t,e,n,i){return n&&0!==n.length?(n.sort(o),r(t,e,n,i,0)):{}}function r(t,e,n,o,a){if(o=o||{},t){i(n,a,a)&&(o[a]=t);var u=e.children;if(u)for(var c=t.childNodes,l=0;e.children.length>l;l++){a+=1;var f=u[l]||s,p=a+(f.count||0);i(n,a,p)&&r(c[l],f,n,o,a),a=p}}return o}function i(t,e,n){if(0===t.length)return!1;for(var r,i,o=0,s=t.length-1;s>=o;){if(r=(s+o)/2>>0,i=t[r],o===s)return i>=e&&n>=i;if(e>i)o=r+1;else{if(!(i>n))return!0;s=r-1}}return!1}function o(t,e){return t>e}var s={};e.exports=n},{}],29:[function(t,e){function n(t){return"[object Array]"===i.call(t)}var r=Array.isArray,i=Object.prototype.toString;e.exports=r||n},{}],30:[function(t,e){function n(t){return"[object String]"===r.call(t)}var r=Object.prototype.toString;e.exports=n},{}],31:[function(t,e){function n(t){return t?"VirtualDOMNode"===t.type&&t.version[0]===i:!1}var r=t("../version"),i=r[0];e.exports=n},{"../version":44}],32:[function(t,e){function n(t){return t?"VirtualTextNode"===t.type&&t.version[0]===i:!1}var r=t("../version"),i=r[0];e.exports=n},{"../version":44}],33:[function(t,e){function n(t){return t&&"function"==typeof t.init&&"function"==typeof t.update}e.exports=n},{}],34:[function(t,e){function n(t,e){return new r(t,e)}function r(t,e){this.vNode=t,this.patch=e}function i(t,e){var n=this.vNode,r=this.patch;return null==r?o(t,n):null==n?s(t,r,e):d(r)?a(t,n,r,e):h(r)?u(t,n,r,e):m(r)?c(t,n,r,e):l(t,r)}function o(t,e){var n=t.parentNode;return n&&n.removeChild(t),f(t,e),null}function s(t,e,n){var r=v(e,n);return t&&t.appendChild(r),t}function a(t,e,n,r){if(3===t.nodeType)return t.replaceData(0,t.length,n),t;var i=t.parentNode,o=v(n,r);return i&&i.replaceChild(o,t),f(t,e),o}function u(t,e,n,r){if(h(e)&&g(e,n)){var i=n.update(e,t);return i||t}var o=t.parentNode,s=v(n,r);return o&&o.replaceChild(s,t),f(t,e),s}function c(t,e,n,r){var i=t.parentNode,o=v(n,r);return i&&i.replaceChild(o,t),f(t,e),o}function l(t,e){for(var n in e)if("style"===n){var r=e.style,i=t.style;for(var o in r)i[o]=r[o]}else{var s=e[n];"function"==typeof s?s(t,n):"data-"===n.substr(0,5)?p(t)[n.substr(5)]=s:t[n]=s}return t}function f(t,e){"function"==typeof e.destroy&&h(e)&&e.destroy(t)}var p=t("data-set"),v=t("../create-element"),h=t("./is-widget"),d=t("./is-string"),m=t("./is-virtual-dom"),g=t("./update-widget");e.exports=n,r.prototype.apply=i},{"../create-element":26,"./is-string":30,"./is-virtual-dom":31,"./is-widget":33,"./update-widget":35,"data-set":37}],35:[function(t,e){function n(t,e){return r(t)&&r(e)?"type"in t&&"type"in e?t.type===e.type:t.init===e.init:!1}var r=t("./is-widget");e.exports=n},{"./is-widget":33}],36:[function(t,e){e.exports=t(12)},{}],37:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{"./create-hash.js":36,individual:38,"weakmap-shim/create-store":40}],38:[function(t,e){e.exports=t(14)},{global:39}],39:[function(t,e){e.exports=t(15)},{}],40:[function(t,e){e.exports=t(16)},{"./hidden-store.js":41}],41:[function(t,e){e.exports=t(17)},{}],42:[function(t,e,n){(function(t){function n(t,e){var n=e?F[ie]:F[ee];return n.test(t)?new o(t,e):null}function r(t,e){var r=n(t,e);return r?r.version:null}function i(t,e){var r=n(t,e);return r?r.version:null}function o(t,e){if(t instanceof o){if(t.loose===e)return t;t=t.version}if(!(this instanceof o))return new o(t,e);this.loose=e;var n=t.trim().match(e?F[ie]:F[ee]);if(!n)throw new TypeError("Invalid Version: "+t);this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.prerelease=n[4]?n[4].split(".").map(function(t){return/^[0-9]+$/.test(t)?+t:t}):[],this.build=n[5]?n[5].split("."):[],this.format()}function s(t,e,n){try{return new o(t,n).inc(e).version}catch(r){return null}}function a(t,e){var n=Oe.test(t),r=Oe.test(e);return n&&r&&(t=+t,e=+e),n&&!r?-1:r&&!n?1:e>t?-1:t>e?1:0}function u(t,e){return a(e,t)}function c(t,e,n){return new o(t,n).compare(e)}function l(t,e){return c(t,e,!0)}function f(t,e,n){return c(e,t,n)}function p(e,n){return e.sort(function(e,r){return t.compare(e,r,n)})}function v(e,n){return e.sort(function(e,r){return t.rcompare(e,r,n)})}function h(t,e,n){return c(t,e,n)>0}function d(t,e,n){return 0>c(t,e,n)}function m(t,e,n){return 0===c(t,e,n)}function g(t,e,n){return 0!==c(t,e,n)}function y(t,e,n){return c(t,e,n)>=0}function x(t,e,n){return 0>=c(t,e,n)}function b(t,e,n,r){var i;switch(e){case"===":i=t===n;break;case"!==":i=t!==n;break;case"":case"=":case"==":i=m(t,n,r);break;case"!=":i=g(t,n,r);break;case">":i=h(t,n,r);break;case">=":i=y(t,n,r);break;case"<":i=d(t,n,r);break;case"<=":i=x(t,n,r);break;default:throw new TypeError("Invalid operator: "+e)}return i}function w(t,e){if(t instanceof w){if(t.loose===e)return t;t=t.value}return this instanceof w?(this.loose=e,this.parse(t),this.value=this.semver===Se?"":this.operator+this.semver.version,void 0):new w(t,e)}function j(t,e){if(t instanceof j&&t.loose===e)return t;if(!(this instanceof j))return new j(t,e);if(this.loose=e,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(function(t){return this.parseRange(t.trim())},this).filter(function(t){return t.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}function k(t,e){return new j(t,e).set.map(function(t){return t.map(function(t){return t.value}).join(" ").trim().split(" ")})}function _(t,e){return t=T(t,e),t=A(t,e),t=O(t,e),t=C(t,e)}function E(t){return!t||"x"===t.toLowerCase()||"*"===t}function A(t,e){return t.trim().split(/\s+/).map(function(t){return N(t,e)}).join(" ")}function N(t,e){var n=e?F[me]:F[de];return t.replace(n,function(t,e,n,r,i){var o;return E(e)?o="":E(n)?o=">="+e+".0.0-0 <"+(+e+1)+".0.0-0":E(r)?o=">="+e+"."+n+".0-0 <"+e+"."+(+n+1)+".0-0":i?("-"!==i.charAt(0)&&(i="-"+i),o=">="+e+"."+n+"."+r+i+" <"+e+"."+(+n+1)+".0-0"):o=">="+e+"."+n+"."+r+"-0"+" <"+e+"."+(+n+1)+".0-0",o})}function T(t,e){return t.trim().split(/\s+/).map(function(t){return L(t,e)}).join(" ")}function L(t,e){var n=e?F[we]:F[be];return t.replace(n,function(t,e,n,r,i){var o;return E(e)?o="":E(n)?o=">="+e+".0.0-0 <"+(+e+1)+".0.0-0":E(r)?o="0"===e?">="+e+"."+n+".0-0 <"+e+"."+(+n+1)+".0-0":">="+e+"."+n+".0-0 <"+(+e+1)+".0.0-0":i?("-"!==i.charAt(0)&&(i="-"+i),o="0"===e?"0"===n?"="+e+"."+n+"."+r+i:">="+e+"."+n+"."+r+i+" <"+e+"."+(+n+1)+".0-0":">="+e+"."+n+"."+r+i+" <"+(+e+1)+".0.0-0"):o="0"===e?"0"===n?"="+e+"."+n+"."+r:">="+e+"."+n+"."+r+"-0"+" <"+e+"."+(+n+1)+".0-0":">="+e+"."+n+"."+r+"-0"+" <"+(+e+1)+".0.0-0",o})}function O(t,e){return t.split(/\s+/).map(function(t){return S(t,e)}).join(" ")}function S(t,e){t=t.trim();var n=e?F[fe]:F[le];return t.replace(n,function(t,e,n,r,i){var o=E(n),s=o||E(r),a=s||E(i),u=a;return"="===e&&u&&(e=""),e&&u?(o&&(n=0),s&&(r=0),a&&(i=0),">"===e&&(e=">=",o||(s?(n=+n+1,r=0,i=0):a&&(r=+r+1,i=0))),t=e+n+"."+r+"."+i+"-0"):o?t="*":s?t=">="+n+".0.0-0 <"+(+n+1)+".0.0-0":a&&(t=">="+n+"."+r+".0-0 <"+n+"."+(+r+1)+".0-0"),t})}function C(t){return t.trim().replace(F[Te],"")}function R(t,e,n,r,i,o,s,a,u,c,l,f){return e=E(n)?"":E(r)?">="+n+".0.0-0":E(i)?">="+n+"."+r+".0-0":">="+e,a=E(u)?"":E(c)?"<"+(+u+1)+".0.0-0":E(l)?"<"+u+"."+(+c+1)+".0-0":f?"<="+u+"."+c+"."+l+"-"+f:"<="+a,(e+" "+a).trim()}function $(t,e){for(var n=0;t.length>n;n++)if(!t[n].test(e))return!1;return!0}function I(t,e,n){try{e=new j(e,n)}catch(r){return!1}return e.test(t)}function P(t,e,n){return t.filter(function(t){return I(t,e,n)}).sort(function(t,e){return f(t,e,n)})[0]||null}function V(t,e){try{return new j(t,e).range||"*"}catch(n){return null}}function q(t,e,n){return M(t,e,"<",n)}function D(t,e,n){return M(t,e,">",n)}function M(t,e,n,r){t=new o(t,r),e=new j(e,r);var i,s,a,u,c;switch(n){case">":i=h,s=x,a=d,u=">",c=">=";break;case"<":i=d,s=y,a=h,u="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(I(t,e,r))return!1;for(var l=0;e.set.length>l;++l){var f=e.set[l],p=null,v=null;if(f.forEach(function(t){p=p||t,v=v||t,i(t.semver,p.semver,r)?p=t:a(t.semver,v.semver,r)&&(v=t)}),p.operator===u||p.operator===c)return!1;if((!v.operator||v.operator===u)&&s(t,v.semver))return!1;if(v.operator===c&&a(t,v.semver))return!1}return!0}"object"==typeof e&&e.exports===t&&(t=e.exports=o),t.SEMVER_SPEC_VERSION="2.0.0";var F=t.re=[],U=t.src=[],z=0,W=z++;U[W]="0|[1-9]\\d*";var X=z++;U[X]="[0-9]+";var Z=z++;U[Z]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var K=z++;U[K]="("+U[W]+")\\."+"("+U[W]+")\\."+"("+U[W]+")";var B=z++;U[B]="("+U[X]+")\\."+"("+U[X]+")\\."+"("+U[X]+")";var G=z++;U[G]="(?:"+U[W]+"|"+U[Z]+")";var H=z++;U[H]="(?:"+U[X]+"|"+U[Z]+")";var J=z++;U[J]="(?:-("+U[G]+"(?:\\."+U[G]+")*))";var Q=z++;U[Q]="(?:-?("+U[H]+"(?:\\."+U[H]+")*))";var Y=z++;U[Y]="[0-9A-Za-z-]+";var te=z++;U[te]="(?:\\+("+U[Y]+"(?:\\."+U[Y]+")*))";var ee=z++,ne="v?"+U[K]+U[J]+"?"+U[te]+"?";U[ee]="^"+ne+"$";var re="[v=\\s]*"+U[B]+U[Q]+"?"+U[te]+"?",ie=z++;U[ie]="^"+re+"$";var oe=z++;U[oe]="((?:<|>)?=?)";var se=z++;U[se]=U[X]+"|x|X|\\*";var ae=z++;U[ae]=U[W]+"|x|X|\\*";var ue=z++;U[ue]="[v=\\s]*("+U[ae]+")"+"(?:\\.("+U[ae]+")"+"(?:\\.("+U[ae]+")"+"(?:("+U[J]+")"+")?)?)?";var ce=z++;U[ce]="[v=\\s]*("+U[se]+")"+"(?:\\.("+U[se]+")"+"(?:\\.("+U[se]+")"+"(?:("+U[Q]+")"+")?)?)?";var le=z++;U[le]="^"+U[oe]+"\\s*"+U[ue]+"$";var fe=z++;U[fe]="^"+U[oe]+"\\s*"+U[ce]+"$";var pe=z++;U[pe]="(?:~>?)";var ve=z++;U[ve]="(\\s*)"+U[pe]+"\\s+",F[ve]=RegExp(U[ve],"g");var he="$1~",de=z++;U[de]="^"+U[pe]+U[ue]+"$";var me=z++;U[me]="^"+U[pe]+U[ce]+"$";var ge=z++;U[ge]="(?:\\^)";var ye=z++;U[ye]="(\\s*)"+U[ge]+"\\s+",F[ye]=RegExp(U[ye],"g");var xe="$1^",be=z++;U[be]="^"+U[ge]+U[ue]+"$";var we=z++;U[we]="^"+U[ge]+U[ce]+"$";var je=z++;U[je]="^"+U[oe]+"\\s*("+re+")$|^$";var ke=z++;U[ke]="^"+U[oe]+"\\s*("+ne+")$|^$";var _e=z++;U[_e]="(\\s*)"+U[oe]+"\\s*("+re+"|"+U[ue]+")",F[_e]=RegExp(U[_e],"g");var Ee="$1$2$3",Ae=z++;U[Ae]="^\\s*("+U[ue]+")"+"\\s+-\\s+"+"("+U[ue]+")"+"\\s*$";var Ne=z++;U[Ne]="^\\s*("+U[ce]+")"+"\\s+-\\s+"+"("+U[ce]+")"+"\\s*$";var Te=z++;U[Te]="(<|>)?=?\\s*\\*";for(var Le=0;z>Le;Le++)F[Le]||(F[Le]=RegExp(U[Le]));t.parse=n,t.valid=r,t.clean=i,t.SemVer=o,o.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},o.prototype.inspect=function(){return'<SemVer "'+this+'">'},o.prototype.toString=function(){return this.version},o.prototype.compare=function(t){return t instanceof o||(t=new o(t,this.loose)),this.compareMain(t)||this.comparePre(t)},o.prototype.compareMain=function(t){return t instanceof o||(t=new o(t,this.loose)),a(this.major,t.major)||a(this.minor,t.minor)||a(this.patch,t.patch)},o.prototype.comparePre=function(t){if(t instanceof o||(t=new o(t,this.loose)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.lenth&&!t.prerelease.length)return 0;var e=0;do{var n=this.prerelease[e],r=t.prerelease[e];if(void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return a(n,r)}while(++e)},o.prototype.inc=function(t){switch(t){case"major":this.major++,this.minor=-1;case"minor":this.minor++,this.patch=-1;case"patch":this.patch++,this.prerelease=[];break;case"prerelease":if(0===this.prerelease.length)this.prerelease=[0];else{for(var e=this.prerelease.length;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}break;default:throw Error("invalid increment argument: "+t)}return this.format(),this},t.inc=s,t.compareIdentifiers=a;var Oe=/^[0-9]+$/;t.rcompareIdentifiers=u,t.compare=c,t.compareLoose=l,t.rcompare=f,t.sort=p,t.rsort=v,t.gt=h,t.lt=d,t.eq=m,t.neq=g,t.gte=y,t.lte=x,t.cmp=b,t.Comparator=w;var Se={};w.prototype.parse=function(t){var e=this.loose?F[je]:F[ke],n=t.match(e);if(!n)throw new TypeError("Invalid comparator: "+t);this.operator=n[1],n[2]?(this.semver=new o(n[2],this.loose),"<"!==this.operator||this.semver.prerelease.length||(this.semver.prerelease=["0"],this.semver.format())):this.semver=Se},w.prototype.inspect=function(){return'<SemVer Comparator "'+this+'">'},w.prototype.toString=function(){return this.value},w.prototype.test=function(t){return this.semver===Se?!0:b(t,this.operator,this.semver,this.loose)},t.Range=j,j.prototype.inspect=function(){return'<SemVer Range "'+this.range+'">'},j.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range},j.prototype.toString=function(){return this.range},j.prototype.parseRange=function(t){var e=this.loose;t=t.trim();var n=e?F[Ne]:F[Ae];t=t.replace(n,R),t=t.replace(F[_e],Ee),t=t.replace(F[ve],he),t=t.replace(F[ye],xe),t=t.split(/\s+/).join(" ");var r=e?F[je]:F[ke],i=t.split(" ").map(function(t){return _(t,e)}).join(" ").split(/\s+/);return this.loose&&(i=i.filter(function(t){return!!t.match(r)})),i=i.map(function(t){return new w(t,e)})},t.toComparators=k,j.prototype.test=function(t){if(!t)return!1;for(var e=0;this.set.length>e;e++)if($(this.set[e],t))return!0;return!1},t.satisfies=I,t.maxSatisfying=P,t.validRange=V,t.ltr=q,t.gtr=D,t.outside=M,"function"==typeof define&&define.amd&&define(t)})("object"==typeof n?n:"function"==typeof define&&define.amd?{}:semver={})},{}],43:[function(t,e){function n(t,e){var n=i(e);if(0===n.length)return t;var s,a,u=o(t,e.a,n);("undefined"==typeof document||(s=t.ownerDocument)!==document)&&(a={document:s||t.ownerDocument});for(var c=0;n.length>c;c++){var l=n[c];t=r(t,u[l],e[l],a)}return t}function r(t,e,n,r){if(!e)return t;var i;if(s(n))for(var o=0;n.length>o;o++)i=n[o].apply(e,r),e===t&&(t=i);else i=n.apply(e,r),e===t&&(t=i);return t}function i(t){var e=[];for(var n in t)"a"!==n&&e.push(Number(n));return e}var o=t("./lib/dom-index"),s=t("./lib/is-array");e.exports=n},{"./lib/dom-index":28,"./lib/is-array":29}],44:[function(t,e){var n=t("semver");e.exports=n.clean("0.1.0")},{semver:42}],45:[function(t,e){function n(t,e){var n=t._list;return e(function(r){var i=t().slice(),o=n.indexOf(e);if(-1===o){var s="observ-array: Unremoved observ listener",a=Error(s);throw a.list=n,a.index=o,a.observ=e,a}i.splice(o,1,r),i._diff=[o,1,r],t.set(i)})}e.exports=n},{}],46:[function(t,e){function n(t){return t.push=r,t.pop=i,t.shift=o,t.unshift=s,t.reverse=a,t.sort=a,f.forEach(function(e){t[e[0]]=e[1]}),t}function r(){var t=c.call(arguments);return t.unshift(this._list.length,0),this.splice.apply(this,t),this._list.length}function i(){return this.splice(this._list.length-1,1)[0]}function o(){return this.splice(0,1)[0]}function s(){var t=c.call(arguments);return t.unshift(0,0),this.splice.apply(this,t),this._list.length}function a(){throw Error("Pull request welcome")}var u=t("./index.js"),c=Array.prototype.slice,l=["concat","slice","every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","some","toString","toLocaleString"],f=l.map(function(t){return[t,function(){var e=this._list[t].apply(this._list,arguments);return e&&Array.isArray(e)&&(e=u(e)),e}]});e.exports=n},{"./index.js":47}],47:[function(t,e){function n(t){var e=t,n=[];e.forEach(function(t,e){n[e]="function"==typeof t?t():t});var c=o(n);c.splice=s,c.get=r,c.getLength=i,c._list=e;var l=e.map(function(t){return"function"==typeof t?u(c,t):null});return c._removeListeners=l,a(c,e)}function r(t){return this._list[t]}function i(){return this._list.length}var o=t("observ");e.exports=n;var s=t("./splice.js"),a=t("./array-methods.js"),u=t("./add-listener.js")},{"./add-listener.js":45,"./array-methods.js":46,"./splice.js":48,observ:56}],48:[function(t,e){function n(){var t=this,e=r.call(arguments,0),n=t().slice(),o=e.map(function(t,e){return 0===e||1===e?t:"function"==typeof t?t():t});n.splice.apply(n,o);var s=t._list.splice.apply(t._list,e),a=e.slice(2).map(function(e){return"function"==typeof e?i(t,e):null});a.unshift(e[0],e[1]);var u=t._removeListeners.splice.apply(t._removeListeners,a);return u.forEach(function(t){t&&t()}),n._diff=o,t.set(n),s}var r=Array.prototype.slice,i=t("./add-listener.js");e.exports=n},{"./add-listener.js":45}],49:[function(t,e){function n(t){var e=Object.keys(t),n={};e.forEach(function(e){var r=t[e];n[e]="function"==typeof r?r():r});var o=r(n);return e.forEach(function(e){var n=t[e];o[e]=n,"function"==typeof n&&n(function(t){var n=i(o());n[e]=t,o.set(n)})}),o}var r=t("observ"),i=t("xtend");e.exports=n},{observ:56,xtend:51}],50:[function(t,e){e.exports=t(19)},{}],51:[function(t,e){function n(){for(var t={},e=0;arguments.length>e;e++){var n=arguments[e];if(i(n))for(var o=r(n),s=0;o.length>s;s++){var a=o[s];t[a]=n[a]}}return t}var r=t("object-keys"),i=t("./has-keys");e.exports=n},{"./has-keys":50,"object-keys":53}],52:[function(t,e){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=function(t){var e="function"==typeof t&&!(t instanceof RegExp)||"[object Function]"===r.call(t);return e||"undefined"==typeof window||(e=t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt),e};e.exports=function(t,e){if(!i(e))throw new TypeError("iterator must be a function");var r,o,s="string"==typeof t,a=t.length,u=arguments.length>2?arguments[2]:null;if(a===+a)for(r=0;a>r;r++)null===u?e(s?t.charAt(r):t[r],r,t):e.call(u,s?t.charAt(r):t[r],r,t);else for(o in t)n.call(t,o)&&(null===u?e(t[o],o,t):e.call(u,t[o],o,t))}},{}],53:[function(t,e){e.exports=Object.keys||t("./shim")},{"./shim":55}],54:[function(t,e){var n=Object.prototype.toString;e.exports=function(t){var e=n.call(t),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===n.call(t.callee)),r}},{}],55:[function(t,e){(function(){"use strict";var n,r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=t("./foreach"),s=t("./isArguments"),a=!{toString:null}.propertyIsEnumerable("toString"),u=function(){}.propertyIsEnumerable("prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];n=function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===i.call(t),l=s(t),f=[];if(!e&&!n&&!l)throw new TypeError("Object.keys called on a non-object");if(l)o(t,function(t){f.push(t)});else{var p,v=u&&n;for(p in t)v&&"prototype"===p||!r.call(t,p)||f.push(p)}if(a){var h=t.constructor,d=h&&h.prototype===t;o(c,function(e){d&&"constructor"===e||!r.call(t,e)||f.push(e)
})}return f},e.exports=n})()},{"./foreach":52,"./isArguments":54}],56:[function(t,e){function n(t){function e(e){return e?(n.push(e),function(){n.splice(n.indexOf(e),1)}):t}var n=[];return t=void 0===t?null:t,e.set=function(e){t=e,n.forEach(function(t){t(e)})},e}e.exports=n},{}],57:[function(t,e){function n(t,e){return this instanceof n?(this.sink=t,this.data=e,this.type="change",this.id=t.id,void 0):new n(t,e)}function r(t){var e=t.target,n="change"===t.type&&"checkbox"===e.type||"keyup"===t.type&&"text"===e.type;if(n){var r=o(t.currentTarget),s=i(this.data,{currentValue:r});"function"==typeof this.sink?this.sink(s):this.sink.write(s)}}var i=t("xtend"),o=t("./lib/get-form-data.js");e.exports=n,n.prototype.handleEvent=r},{"./lib/get-form-data.js":59,xtend:63}],58:[function(t,e){function n(t,e){return this instanceof n?(this.sink=t,this.id=t.id,this.data=e,void 0):new n(t,e)}function r(){"function"==typeof this.sink?this.sink(this.data):this.sink.write(this.data)}e.exports=n,n.prototype.handleEvent=r},{}],59:[function(t,e){function n(t){var e={};return o(t,function(t){t.name&&(e[t.name]=t)}),e}function r(t){var e=n(t);return i(e)}var i=t("form-data-set"),o=t("dom-walk");e.exports=r},{"dom-walk":60,"form-data-set":61}],60:[function(t,e){function n(t,e){"length"in t||(t=[t]),t=r.call(t);for(;t.length;){var n=t.shift(),i=e(n);if(i)return i;n.childNodes.length&&(t=r.call(n.childNodes).concat(t))}}var r=Array.prototype.slice;e.exports=n},{}],61:[function(t,e){function n(t){return Object.keys(t).reduce(function(e,n){var i=t[n];return e[n]=r(i),e},{})}function r(t){if("function"==typeof t)return t();if(o(t)){var e=s(t),a=e.filter(function(t){return t.checked})[0]||null;return a?a.value:null}return Array.isArray(t)?t.map(r).filter(u):void 0===t.tagName&&void 0===t.nodeType?n(t):"INPUT"===t.tagName&&i(t)?t.hasAttribute("value")?t.checked?t.value:null:t.checked:"INPUT"===t.tagName?t.value:"TEXTAREA"===t.tagName?t.value:"SELECT"===t.tagName?t.value:void 0}function i(t){return"checkbox"===t.type||"radio"===t.type}function o(t){if(t.tagName||t.nodeType)return!1;var e=s(t);return e.some(function(t){return"INPUT"===t.tagName&&"radio"===t.type})}function s(t){return Array.isArray(t)?t:Object.keys(t).map(a,t)}function a(t){return this[t]}function u(t){return null!==t}e.exports=n},{}],62:[function(t,e){e.exports=t(19)},{}],63:[function(t,e){e.exports=t(20)},{"./has-keys":62}],64:[function(t,e){function n(t,e){return this instanceof n?(this.sink=t,this.data=e,this.id=t.id,this.type="submit",void 0):new n(t,e)}function r(t){var e=t.target,n="click"===t.type&&"BUTTON"===e.tagName||("text"===e.type||"TEXTAREA"===e.tagName)&&t.keyCode===s&&!t.shiftKey&&"keyup"===t.type&&""!==e.value.trim();if(n){var r=o(t.currentTarget),a=i(this.data,{currentValue:r});"function"==typeof this.sink?this.sink(a):this.sink.write(a)}}var i=t("xtend"),o=t("./lib/get-form-data.js"),s=13;e.exports=n,n.prototype.handleEvent=r},{"./lib/get-form-data.js":59,xtend:63}],65:[function(t,e){function n(t,e){return this instanceof n?(this.sink=t,this.data=e,this.id=t.id,void 0):new n(t,e)}function r(t){var e=o(t.currentTarget),n=i(this.data,{currentValue:e});"function"==typeof this.sink?this.sink(n):this.sink.write(n)}var i=t("xtend"),o=t("./lib/get-form-data.js");e.exports=n,n.prototype.handleEvent=r},{"./lib/get-form-data.js":59,xtend:63}],66:[function(t,e){function n(t){var e=[].slice.call(arguments,1);return new r(t,e)}function r(t,e){this.fn=t,this.args=e,this.vnode=null}function i(t,e){return t.fn!==e.fn||t.args.some(function(t,n){return t!==e.args[n]})}function o(t,e){return i(this,t)?(this.vnode=this.vnode||this.fn.apply(null,this.args),c(e,u(t.vnode,this.vnode)),void 0):(this.vnode=t.vnode,void 0)}function s(){return this.vnode=this.fn.apply(null,this.args),a(this.vnode)}var a=t("virtual-dom/render"),u=t("virtual-dom/diff"),c=t("virtual-dom/patch");e.exports=n,r.prototype.type="immutable-thunk",r.prototype.update=o,r.prototype.init=s},{"virtual-dom/diff":67,"virtual-dom/patch":83,"virtual-dom/render":84}],67:[function(t,e,n){arguments[4][27][0].apply(n,arguments)},{"./lib/is-array":69,"./lib/is-virtual-dom":71,"./lib/is-virtual-text":72,"./lib/is-widget":73,"./lib/patch-op":74}],68:[function(t,e){e.exports=t(28)},{}],69:[function(t,e){e.exports=t(29)},{}],70:[function(t,e){e.exports=t(30)},{}],71:[function(t,e,n){arguments[4][31][0].apply(n,arguments)},{"../version":85}],72:[function(t,e,n){arguments[4][32][0].apply(n,arguments)},{"../version":85}],73:[function(t,e){e.exports=t(33)},{}],74:[function(t,e){function n(t,e){return new r(t,e)}function r(t,e){this.vNode=t,this.patch=e}function i(t,e){var n=this.vNode,r=this.patch;return null==r?o(t,n):null==n?s(t,r,e):d(r)?a(t,n,r,e):h(r)?u(t,n,r,e):m(r)?c(t,n,r,e):l(t,r)}function o(t,e){var n=t.parentNode;return n&&n.removeChild(t),f(t,e),null}function s(t,e,n){var r=v(e,n);return t&&t.appendChild(r),t}function a(t,e,n,r){if(3===t.nodeType)return t.replaceData(0,t.length,n),t;var i=t.parentNode,o=v(n,r);return i&&i.replaceChild(o,t),f(t,e),o}function u(t,e,n,r){if(h(e)&&g(e,n)){var i=n.update(e,t);return i||t}var o=t.parentNode,s=v(n,r);return o&&o.replaceChild(s,t),f(t,e),s}function c(t,e,n,r){var i=t.parentNode,o=v(n,r);return i&&i.replaceChild(o,t),f(t,e),o}function l(t,e){for(var n in e)if("style"===n){var r=e.style,i=t.style;for(var o in r)i[o]=r[o]}else{var s=e[n];"function"==typeof s?s(t,n):"data-"===n.substr(0,5)?p(t)[n.substr(5)]=s:t[n]=s}return t}function f(t,e){"function"==typeof e.destroy&&h(e)&&e.destroy(t)}var p=t("data-set"),v=t("../render"),h=t("./is-widget"),d=t("./is-string"),m=t("./is-virtual-dom"),g=t("./update-widget");e.exports=n,r.prototype.apply=i},{"../render":84,"./is-string":70,"./is-virtual-dom":71,"./is-widget":73,"./update-widget":75,"data-set":77}],75:[function(t,e){e.exports=t(35)},{"./is-widget":73}],76:[function(t,e){e.exports=t(12)},{}],77:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{"./create-hash.js":76,individual:78,"weakmap-shim/create-store":80}],78:[function(t,e){e.exports=t(14)},{global:79}],79:[function(t,e){e.exports=t(15)},{}],80:[function(t,e){e.exports=t(16)},{"./hidden-store.js":81}],81:[function(t,e){e.exports=t(17)},{}],82:[function(t,e){e.exports=t(42)},{}],83:[function(t,e){e.exports=t(43)},{"./lib/dom-index":68,"./lib/is-array":69}],84:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{"./lib/is-string":70,"./lib/is-virtual-dom":71,"./lib/is-virtual-text":72,"data-set":77}],85:[function(t,e){e.exports=t(44)},{semver:82}],86:[function(t,e,n){arguments[4][26][0].apply(n,arguments)},{"./lib/is-string":91,"./lib/is-virtual-dom":92,"./lib/is-virtual-text":93,"data-set":100}],87:[function(t,e,n){arguments[4][27][0].apply(n,arguments)},{"./lib/is-array":90,"./lib/is-virtual-dom":92,"./lib/is-virtual-text":93,"./lib/is-widget":94,"./lib/patch-op":96}],88:[function(t,e){function n(t,e,n){var i,u,l=[];if(n||o(e)&&(n=e,u={}),u=u||s({},e),i=c(t,u),null!=n)if(a(n))for(var f=0;n.length>f;f++)r(n[f],l);else r(n,l);return new p(i,u,l)}function r(t,e){u(t)?e.push(new v(t)):e.push(t)}function i(t){return l(t)||f(t)}function o(t){return i(t)||a(t)||u(t)}var s=t("extend"),a=t("./lib/is-array"),u=t("./lib/is-string"),c=t("./lib/parse-tag"),l=t("./lib/is-virtual-dom"),f=t("./lib/is-virtual-text"),p=t("./virtual-dom-node.js"),v=t("./virtual-text-node.js");e.exports=n},{"./lib/is-array":90,"./lib/is-string":91,"./lib/is-virtual-dom":92,"./lib/is-virtual-text":93,"./lib/parse-tag":95,"./virtual-dom-node.js":109,"./virtual-text-node.js":110,extend:105}],89:[function(t,e){e.exports=t(28)},{}],90:[function(t,e){e.exports=t(29)},{}],91:[function(t,e){e.exports=t(30)},{}],92:[function(t,e,n){arguments[4][31][0].apply(n,arguments)},{"../version":108}],93:[function(t,e,n){arguments[4][32][0].apply(n,arguments)},{"../version":108}],94:[function(t,e){e.exports=t(33)},{}],95:[function(t,e){function n(t,e){if(!t)return"div";var n=!("id"in e),s=r(t,i),a=null;o.test(s[1])&&(a="div");var u,c,l,f;for(f=0;s.length>f;f++)c=s[f],c&&(l=c.charAt(0),a?"."===l?(u=u||[],u.push(c.substring(1,c.length))):"#"===l&&n&&(e.id=c.substring(1,c.length)):a=c);return u&&(e.className&&u.push(e.className),e.className=u.join(" ")),a?a.toLowerCase():"div"}var r=t("browser-split"),i=/([\.#]?[a-zA-Z0-9_:-]+)/,o=/^\.|#/;e.exports=n},{"browser-split":98}],96:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"../create-element":86,"./is-string":91,"./is-virtual-dom":92,"./is-widget":94,"./update-widget":97,"data-set":100}],97:[function(t,e){e.exports=t(35)},{"./is-widget":94}],98:[function(t,e){e.exports=function(t){var e,n=String.prototype.split,r=/()??/.exec("")[1]===t;return e=function(e,i,o){if("[object RegExp]"!==Object.prototype.toString.call(i))return n.call(e,i,o);var s,a,u,c,l=[],f=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.extended?"x":"")+(i.sticky?"y":""),p=0,i=RegExp(i.source,f+"g");for(e+="",r||(s=RegExp("^"+i.source+"$(?!\\s)",f)),o=o===t?-1>>>0:o>>>0;(a=i.exec(e))&&(u=a.index+a[0].length,!(u>p&&(l.push(e.slice(p,a.index)),!r&&a.length>1&&a[0].replace(s,function(){for(var e=1;arguments.length-2>e;e++)arguments[e]===t&&(a[e]=t)}),a.length>1&&a.index<e.length&&Array.prototype.push.apply(l,a.slice(1)),c=a[0].length,p=u,l.length>=o)));)i.lastIndex===a.index&&i.lastIndex++;return p===e.length?(c||!i.test(""))&&l.push(""):l.push(e.slice(p)),l.length>o?l.slice(0,o):l}}()},{}],99:[function(t,e){e.exports=t(12)},{}],100:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{"./create-hash.js":99,individual:101,"weakmap-shim/create-store":103}],101:[function(t,e){e.exports=t(14)},{global:102}],102:[function(t,e){e.exports=t(15)},{}],103:[function(t,e){e.exports=t(16)},{"./hidden-store.js":104}],104:[function(t,e){e.exports=t(17)},{}],105:[function(t,e){function n(t){if(!t||"[object Object]"!==i.call(t)||t.nodeType||t.setInterval)return!1;var e=r.call(t,"constructor"),n=r.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!e&&!n)return!1;var o;for(o in t);return void 0===o||r.call(t,o)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString;e.exports=function o(){var t,e,r,i,s,a,u=arguments[0]||{},c=1,l=arguments.length,f=!1;for("boolean"==typeof u&&(f=u,u=arguments[1]||{},c=2),"object"!=typeof u&&"function"!=typeof u&&(u={});l>c;c++)if(null!=(t=arguments[c]))for(e in t)r=u[e],i=t[e],u!==i&&(f&&i&&(n(i)||(s=Array.isArray(i)))?(s?(s=!1,a=r&&Array.isArray(r)?r:[]):a=r&&n(r)?r:{},u[e]=o(f,a,i)):void 0!==i&&(u[e]=i));return u}},{}],106:[function(t,e){e.exports=t(42)},{}],107:[function(t,e){e.exports=t(43)},{"./lib/dom-index":89,"./lib/is-array":90}],108:[function(t,e){e.exports=t(44)},{semver:106}],109:[function(t,e){function n(t,e,n){this.tagName=t,this.properties=e,this.children=n,this.count=r(n),this.hasWidgets=i(n)}function r(t){if(!t)return 0;for(var e=t.length||0,n=0,r=0;e>r;r++){var i=t[r];s(i)&&(n+=i.count||0)}return e+n}function i(t){if(!t)return!1;for(var e=t.length,n=0;e>n;n++){var r=t[n];if(a(r)){if("function"==typeof r.destroy)return!0}else if(s(r)&&r.hasWidgets)return!0}return!1}var o=t("./version"),s=t("./lib/is-virtual-dom"),a=t("./lib/is-widget");e.exports=n,n.prototype.version=o.split("."),n.prototype.type="VirtualDOMNode"},{"./lib/is-virtual-dom":92,"./lib/is-widget":94,"./version":108}],110:[function(t,e){function n(t){this.text=t+""}var r=t("./version");e.exports=n,n.prototype.version=r.split("."),n.prototype.type="VirtualTextNode"},{"./version":108}]},{},[]);var mercury=require("mercury"),h=mercury.h,delegator=mercury.Delegator(),inputs=mercury.EventSinks(delegator.id,["clicks"]),clickCount=mercury.value(0);inputs.events.clicks(function(){clickCount.set(clickCount()+1)});var loop=mercury.main(clickCount(),render);clickCount(loop.update),document.body.appendChild(loop.target);
{
"name": "requirebin-sketch",
"version": "1.0.0",
"dependencies": {
"mercury": "2.0.0"
}
}
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; }
body, html { height: 100%; width: 100%; }</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment