2 lines
170 KiB
JavaScript
2 lines
170 KiB
JavaScript
|
!function(){"use strict";var n,e,t,o,r,i,u,a=function(n){return function(){return n}},O={noop:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e]},noarg:function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t()}},compose:function(t,o){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(o.apply(null,arguments))}},constant:a,identity:function(n){return n},tripleEquals:function(n,e){return n===e},curry:function(i){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];for(var u=new Array(arguments.length-1),t=1;t<arguments.length;t++)u[t-1]=arguments[t];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=new Array(arguments.length),o=0;o<t.length;o++)t[o]=arguments[o];var r=u.concat(t);return i.apply(null,r)}},not:function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,arguments)}},die:function(n){return function(){throw new Error(n)}},apply:function(n){return n()},call:function(n){n()},never:a(!1),always:a(!0)},c=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&Array.prototype.isPrototypeOf(n)?"array":"object"===e&&String.prototype.isPrototypeOf(n)?"string":e}(n)===e}},E={isString:c("string"),isObject:c("object"),isArray:c("array"),isNull:c("null"),isBoolean:c("boolean"),isUndefined:c("undefined"),isFunction:c("function"),isNumber:c("number")},s=function(u){return function(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];if(0===n.length)throw new Error("Can't merge zero objects");for(var t={},o=0;o<n.length;o++){var r=n[o];for(var i in r)r.hasOwnProperty(i)&&(t[i]=u(t[i],r[i]))}return t}},f=s(function(n,e){return E.isObject(n)&&E.isObject(e)?f(n,e):e}),l=s(function(n,e){return e}),D={deepMerge:f,merge:l},d=O.never,m=O.always,g=function(){return p},p=(o={fold:function(n,e){return n()},is:d,isSome:d,isNone:m,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},or:t,orThunk:e,map:g,ap:g,each:function(){},bind:g,flatten:g,exists:d,forall:m,filter:g,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:O.constant("none()")},Object.freeze&&Object.freeze(o),o),v=function(t){var n=function(){return t},e=function(){return r},o=function(n){return n(t)},r={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:m,isNone:d,getOr:n,getOrThunk:n,getOrDie:n,or:e,orThunk:e,map:function(n){return v(n(t))},ap:function(n){return n.fold(g,function(n){return v(n(t))})},each:function(n){n(t)},bind:o,flatten:n,exists:o,forall:o,filter:function(n){return n(t)?r:p},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(d,function(n){return e(t,n)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return r},y={some:v,none:g,from:function(n){return null===n||n===undefined?p:v(n)}},h=(r=Object.keys)===undefined?function(n){var e=[];for(var t in n)n.hasOwnProperty(t)&&e.push(t);return e}:r,b=function(n,e){for(var t=h(n),o=0,r=t.length;o<r;o++){var i=t[o];e(n[i],i,n)}},w=function(o,r){var i={};return b(o,function(n,e){var t=r(n,e,o);i[t.k]=t.v}),i},x=function(n,t){var o=[];return b(n,function(n,e){o.push(t(n,e))}),o},S=function(n){return x(n,function(n){return n})},M={bifilter:function(n,t){var o={},r={};return b(n,function(n,e){(t(n,e)?o:r)[e]=n}),{t:o,f:r}},each:b,map:function(n,o){return w(n,function(n,e,t){return{k:e,v:o(n,e,t)}})},mapToArray:x,tupleMap:w,find:function(n,e){for(var t=h(n),o=0,r=t.length;o<r;o++){var i=t[o],u=n[i];if(e(u,i,n))return y.some(u)}return y.none()},keys:h,values:S,size:function(n){return S(n).length}},T=(O.constant("contextmenu"),O.constant("touchstart")),k=O.constant("touchmove"),C=O.constant("touchend"),A=(O.constant("gesturestart"),O.constant("mousedown")),B=O.constant("mousemove"),R=(O.constant("mouseout"),O.constant("mouseup")),I=O.constant("mouseover"),F=(O.constant("focusin")
|