@harpsealjs/framework
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -1,1 +0,1 @@ | ||
!function t(n,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports["@harpsealjs/framework"]=r():n["@harpsealjs/framework"]=r()}(window,function(){return e={},o.m=r=[function(t,n,r){var e=r(6);function o(r){return function t(n){return 0===arguments.length||e(n)?t:r.apply(this,arguments)}}t.exports=o},function(t,n,r){var o=r(0),u=r(6);function e(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return u(n)?t:o(function(t){return e(n,t)});default:return u(n)&&u(r)?t:u(n)?o(function(t){return e(t,r)}):u(r)?o(function(t){return e(n,t)}):e(n,r)}}}t.exports=e},function(t,n,r){var e=r(0),o=r(27),u=e(function t(n){return o(n,[])});t.exports=u},function(t,n,r){var e=r(8);t.exports={baseMap:function(t){return t(this.value)},getEquals:function(r){return function t(n){return n instanceof r&&e(this.value,n.value)}},extend:function(t,n){function r(){this.constructor=t}r.prototype=n.prototype,t.prototype=new r,t.super_=n.prototype},identity:function(t){return t},notImplemented:function(t){return function(){throw new Error(t+" is not implemented")}},notCallable:function(t){return function(){throw new Error(t+" cannot be called directly")}},returnThis:function(){return this},chainRecNext:function(t){return{isNext:!0,value:t}},chainRecDone:function(t){return{isNext:!1,value:t}},deriveAp:function(r){return function(t){return this.chain(function(n){return t.chain(function(t){return r.of(n(t))})})}},deriveMap:function(r){return function(n){return this.chain(function(t){return r.of(n(t))})}}}},function(t,n){function r(t,s){switch(t){case 0:return function(){return s.apply(this,arguments)};case 1:return function(t){return s.apply(this,arguments)};case 2:return function(t,n){return s.apply(this,arguments)};case 3:return function(t,n,r){return s.apply(this,arguments)};case 4:return function(t,n,r,e){return s.apply(this,arguments)};case 5:return function(t,n,r,e,o){return s.apply(this,arguments)};case 6:return function(t,n,r,e,o,u){return s.apply(this,arguments)};case 7:return function(t,n,r,e,o,u,i){return s.apply(this,arguments)};case 8:return function(t,n,r,e,o,u,i,c){return s.apply(this,arguments)};case 9:return function(t,n,r,e,o,u,i,c,a){return s.apply(this,arguments)};case 10:return function(t,n,r,e,o,u,i,c,a,f){return s.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}t.exports=r},function(t,n,r){var e=r(0),o=r(7),u=e(function t(n){return o(n.length,n)});t.exports=u},function(t,n){function r(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}t.exports=r},function(t,n,r){var e=r(4),o=r(0),u=r(1),i=r(26),c=u(function t(n,r){return 1===n?o(r):e(n,i(n,[],r))});t.exports=c},function(t,n,r){var e=r(1),o=r(30),u=e(function t(n,r){return o(n,r,[],[])});t.exports=u},function(t,n){function r(t,n){return Object.prototype.hasOwnProperty.call(n,t)}t.exports=r},function(t,n,r){var e=r(0),i=r(9),c=r(35),a=!{toString:null}.propertyIsEnumerable("toString"),f=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],s=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),p=function t(n,r){for(var e=0;e<n.length;){if(n[e]===r)return!0;e+=1}return!1},o="function"!=typeof Object.keys||s?e(function t(n){if(Object(n)!==n)return[];var r,e,o=[],u=s&&c(n);for(r in n)!i(r,n)||u&&"length"===r||(o[o.length]=r);if(a)for(e=f.length-1;0<=e;)i(r=f[e],n)&&!p(o,r)&&(o[o.length]=r),--e;return o}):e(function t(n){return Object(n)!==n?[]:Object.keys(n)});t.exports=o},function(t,n){t.exports=Array.isArray||function t(n){return null!=n&&0<=n.length&&"[object Array]"===Object.prototype.toString.call(n)}},function(t,n,r){var o=r(11);function e(r,e){return function(){var t=arguments.length;if(0===t)return e();var n=arguments[t-1];return o(n)||"function"!=typeof n[r]?e.apply(this,arguments):n[r].apply(n,Array.prototype.slice.call(arguments,0,t-1))}}t.exports=e},function(t,n,r){var e=r(47),o=r(48),u=r(49);function i(t,n,r){for(var e=0,o=r.length;e<o;){if((n=t["@@transducer/step"](n,r[e]))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e+=1}return t["@@transducer/result"](n)}function c(t,n,r){for(var e=r.next();!e.done;){if((n=t["@@transducer/step"](n,e.value))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e=r.next()}return t["@@transducer/result"](n)}function a(t,n,r,e){return t["@@transducer/result"](r[e](u(t["@@transducer/step"],t),n))}var f="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function s(t,n,r){if("function"==typeof t&&(t=o(t)),e(r))return i(t,n,r);if("function"==typeof r["fantasy-land/reduce"])return a(t,n,r,"fantasy-land/reduce");if(null!=r[f])return c(t,n,r[f]());if("function"==typeof r.next)return c(t,n,r);if("function"==typeof r.reduce)return a(t,n,r,"reduce");throw new TypeError("reduce: list must be array or iterable")}t.exports=s},function(t,n){function r(t){return"[object String]"===Object.prototype.toString.call(t)}t.exports=r},function(t,n,r){var e=r(2),o=r(3);function u(t){if(!(this instanceof u))return new u(t);this.value=t}u.prototype["@@type"]="ramda-fantasy/Identity",u.prototype.of=u.of=function(t){return new u(t)},u.prototype.map=function(t){return new u(t(this.value))},u.prototype.ap=function(t){return t.map(this.value)},u.prototype.chain=function(t){return t(this.value)},u.chainRec=u.prototype.chainRec=function(t,n){for(var r=o.chainRecNext(n);r.isNext;)r=t(o.chainRecNext,o.chainRecDone,r.value).get();return u(r.value)},u.prototype.get=function(){return this.value},u.prototype.equals=o.getEquals(u),u.prototype.toString=function(){return"Identity("+e(this.value)+")"},t.exports=u},function(t,n,r){var e=r(56),o=r(61);function u(){if(0===arguments.length)throw new Error("compose requires at least one argument");return e.apply(this,o(arguments))}t.exports=u},function(t,n,r){var i=r(0),c=r(1),a=r(6);function e(u){return function t(r,e,o){switch(arguments.length){case 0:return t;case 1:return a(r)?t:c(function(t,n){return u(r,t,n)});case 2:return a(r)&&a(e)?t:a(r)?c(function(t,n){return u(t,e,n)}):a(e)?c(function(t,n){return u(r,t,n)}):i(function(t){return u(r,e,t)});default:return a(r)&&a(e)&&a(o)?t:a(r)&&a(e)?c(function(t,n){return u(t,n,o)}):a(r)&&a(o)?c(function(t,n){return u(t,e,n)}):a(e)&&a(o)?c(function(t,n){return u(r,t,n)}):a(r)?i(function(t){return u(t,e,o)}):a(e)?i(function(t){return u(r,t,o)}):a(o)?i(function(t){return u(r,e,t)}):u(r,e,o)}}}t.exports=e},function(t,n,r){var e=r(2),o=r(8);function u(n,t){switch(arguments.length){case 0:throw new TypeError("no arguments to Tuple");case 1:return function(t){return new i(n,t)};default:return new i(n,t)}}function i(t,n){this[0]=t,this[1]=n,this.length=2}function c(t){t.forEach(function(t){if("function"!=typeof t.concat)throw new TypeError(e(t)+" must be a semigroup to perform this operation")})}u.fst=function(t){return t[0]},u.snd=function(t){return t[1]},i.prototype["@@type"]="ramda-fantasy/Tuple",i.prototype.concat=function(t){return c([this[0],this[1]]),u(this[0].concat(t[0]),this[1].concat(t[1]))},i.prototype.map=function(t){return u(this[0],t(this[1]))},i.prototype.ap=function(t){return c([this[0]]),u(this[0].concat(t[0]),this[1](t[1]))},i.prototype.equals=function(t){return t instanceof i&&o(this[0],t[0])&&o(this[1],t[1])},i.prototype.toString=function(){return"Tuple("+e(this[0])+", "+e(this[1])+")"},t.exports=u},function(u,t,f){"use strict";(function(i){var h=f(23),y=f(24),c=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,r=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,t,n=new RegExp("^"+"[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]"+"+");function d(t){return(t||"").toString().replace(n,"")}var v=[["#","hash"],["?","query"],function t(n){return n.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],a={hash:1,query:1};function g(t){var n,r=(n="undefined"!=typeof window?window:void 0!==i?i:"undefined"!=typeof self?self:{}).location||{},e={},o=typeof(t=t||r),u;if("blob:"===t.protocol)e=new b(unescape(t.pathname),{});else if("string"==o)for(u in e=new b(t,{}),a)delete e[u];else if("object"==o){for(u in t)u in a||(e[u]=t[u]);void 0===e.slashes&&(e.slashes=c.test(t.href))}return e}function m(t){t=d(t);var n=r.exec(t);return{protocol:n[1]?n[1].toLowerCase():"",slashes:!!n[2],rest:n[3]}}function x(t,n){if(""===t)return n;for(var r=(n||"/").split("/").slice(0,-1).concat(t.split("/")),e=r.length,o=r[e-1],u=!1,i=0;e--;)"."===r[e]?r.splice(e,1):".."===r[e]?(r.splice(e,1),i++):i&&(0===e&&(u=!0),r.splice(e,1),i--);return u&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}function b(t,n,r){if(t=d(t),!(this instanceof b))return new b(t,n,r);var e,o,u,i,c,a,f=v.slice(),s=typeof n,p=this,l=0;for("object"!=s&&"string"!=s&&(r=n,n=null),r&&"function"!=typeof r&&(r=y.parse),n=g(n),e=!(o=m(t||"")).protocol&&!o.slashes,p.slashes=o.slashes||e&&n.slashes,p.protocol=o.protocol||n.protocol||"",t=o.rest,o.slashes||(f[3]=[/(.*)/,"pathname"]);l<f.length;l++)"function"!=typeof(i=f[l])?(u=i[0],a=i[1],u!=u?p[a]=t:"string"==typeof u?~(c=t.indexOf(u))&&(t="number"==typeof i[2]?(p[a]=t.slice(0,c),t.slice(c+i[2])):(p[a]=t.slice(c),t.slice(0,c))):(c=u.exec(t))&&(p[a]=c[1],t=t.slice(0,c.index)),p[a]=p[a]||e&&i[3]&&n[a]||"",i[4]&&(p[a]=p[a].toLowerCase())):t=i(t);r&&(p.query=r(p.query)),e&&n.slashes&&"/"!==p.pathname.charAt(0)&&(""!==p.pathname||""!==n.pathname)&&(p.pathname=x(p.pathname,n.pathname)),h(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(i=p.auth.split(":"),p.username=i[0]||"",p.password=i[1]||""),p.origin=p.protocol&&p.host&&"file:"!==p.protocol?p.protocol+"//"+p.host:"null",p.href=p.toString()}function e(t,n,r){var e=this;switch(t){case"query":"string"==typeof n&&n.length&&(n=(r||y.parse)(n)),e[t]=n;break;case"port":e[t]=n,h(n,e.protocol)?n&&(e.host=e.hostname+":"+n):(e.host=e.hostname,e[t]="");break;case"hostname":e[t]=n,e.port&&(n+=":"+e.port),e.host=n;break;case"host":e[t]=n,/:\d+$/.test(n)?(n=n.split(":"),e.port=n.pop(),e.hostname=n.join(":")):(e.hostname=n,e.port="");break;case"protocol":e.protocol=n.toLowerCase(),e.slashes=!r;break;case"pathname":case"hash":if(n){var o="pathname"===t?"/":"#";e[t]=n.charAt(0)!==o?o+n:n}else e[t]=n;break;default:e[t]=n}for(var u=0;u<v.length;u++){var i=v[u];i[4]&&(e[i[1]]=e[i[1]].toLowerCase())}return e.origin=e.protocol&&e.host&&"file:"!==e.protocol?e.protocol+"//"+e.host:"null",e.href=e.toString(),e}function o(t){t&&"function"==typeof t||(t=y.stringify);var n,r=this,e=r.protocol;e&&":"!==e.charAt(e.length-1)&&(e+=":");var o=e+(r.slashes?"//":"");return r.username&&(o+=r.username,r.password&&(o+=":"+r.password),o+="@"),o+=r.host+r.pathname,(n="object"==typeof r.query?t(r.query):r.query)&&(o+="?"!==n.charAt(0)?"?"+n:n),r.hash&&(o+=r.hash),o}b.prototype={set:e,toString:o},b.extractProtocol=m,b.location=g,b.trimLeft=d,b.qs=y,u.exports=b}).call(this,f(22))},function(t,n,r){t.exports={Either:r(25),Future:r(52),Identity:r(15),IO:r(55),lift2:r(62),lift3:r(63),Maybe:r(64),Reader:r(65),State:r(69),Tuple:r(18)}},function(t,n,r){t.exports=r(70)},function(t,n){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,n,r){"use strict";t.exports=function t(n,r){if(r=r.split(":")[0],!(n=+n))return!1;switch(r){case"http":case"ws":return 80!==n;case"https":case"wss":return 443!==n;case"ftp":return 21!==n;case"gopher":return 70!==n;case"file":return!1}return 0!==n}},function(t,n,r){"use strict";var u=Object.prototype.hasOwnProperty,i;function c(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function e(t){try{return encodeURIComponent(t)}catch(t){return}}function o(t){for(var n=/([^=?&]+)=?([^&]*)/g,r={},e;e=n.exec(t);){var o=c(e[1]),u=c(e[2]);null===o||null===u||o in r||(r[o]=u)}return r}function a(t,n){n=n||"";var r=[],e,o;for(o in"string"!=typeof n&&(n="?"),t)if(u.call(t,o)){if((e=t[o])||null!==e&&e!==i&&!isNaN(e)||(e=""),o=encodeURIComponent(o),e=encodeURIComponent(e),null===o||null===e)continue;r.push(o+"="+e)}return r.length?n+r.join("&"):""}n.stringify=a,n.parse=o},function(t,n,r){var e=r(5),o=r(2),u=r(3);function i(n,t){switch(arguments.length){case 0:throw new TypeError("no arguments to Either");case 1:return function(t){return null==t?i.Left(n):i.Right(t)};default:return null==t?i.Left(n):i.Right(t)}}function c(t){this.value=t}function a(t){this.value=t}i.prototype["@@type"]="ramda-fantasy/Either",i.prototype.map=u.returnThis,i.of=i.prototype.of=function(t){return i.Right(t)},i.prototype.chain=u.returnThis,i.either=e(function t(n,r,e){if(e instanceof a)return n(e.value);if(e instanceof c)return r(e.value);throw new TypeError("invalid type given to Either.either")}),i.isLeft=function(t){return t.isLeft},i.isRight=function(t){return t.isRight},u.extend(c,i),c.prototype.isRight=!0,c.prototype.isLeft=!1,c.prototype.map=function(t){return new c(t(this.value))},c.prototype.ap=function(t){return t.map(this.value)},c.prototype.chain=function(t){return t(this.value)},i.chainRec=i.prototype.chainRec=function(t,n){for(var r,e=u.chainRecNext(n);e.isNext;){if(r=t(u.chainRecNext,u.chainRecDone,e.value),i.isLeft(r))return r;e=r.value}return i.Right(e.value)},c.prototype.bimap=function(t,n){return new c(n(this.value))},c.prototype.extend=function(t){return new c(t(this))},c.prototype.toString=function(){return"Either.Right("+o(this.value)+")"},c.prototype.equals=u.getEquals(c),i.Right=function(t){return new c(t)},u.extend(a,i),a.prototype.isLeft=!0,a.prototype.isRight=!1,a.prototype.ap=u.returnThis,a.prototype.bimap=function(t){return new a(t(this.value))},a.prototype.extend=u.returnThis,a.prototype.toString=function(){return"Either.Left("+o(this.value)+")"},a.prototype.equals=u.getEquals(a),i.Left=function(t){return new a(t)},i.prototype.either=function t(n,r){return(this.isLeft?n:r)(this.value)},t.exports=i},function(t,n,r){var a=r(4),f=r(6);function s(u,i,c){return function(){for(var t=[],n=0,r=u,e=0;e<i.length||n<arguments.length;){var o;e<i.length&&(!f(i[e])||arguments.length<=n)?o=i[e]:(o=arguments[n],n+=1),t[e]=o,f(o)||--r,e+=1}return r<=0?c.apply(this,t):a(r,s(u,t,c))}}t.exports=s},function(t,n,r){var u=r(28),i=r(37),c=r(38),a=r(39),f=r(10),s=r(40);function p(e,o){var r=function t(n){var r=o.concat([e]);return u(n,r)?"<Circular>":p(n,r)},t=function(n,t){return i(function(t){return c(t)+": "+r(n[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+i(r,e).join(", ")+"))";case"[object Array]":return"["+i(r,e).concat(t(e,s(function(t){return/^\d+$/.test(t)},f(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+r(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?r(NaN):c(a(e)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+r(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object String]":return"object"==typeof e?"new String("+r(e.valueOf())+")":c(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var n=e.toString();if("[object Object]"!==n)return n}return"{"+t(e,f(e)).join(", ")+"}"}}t.exports=p},function(t,n,r){var e=r(29);function o(t,n){return 0<=e(n,t,0)}t.exports=o},function(t,n,r){var u=r(8);function e(t,n,r){var e,o;if("function"==typeof t.indexOf)switch(typeof n){case"number":if(0===n){for(e=1/n;r<t.length;){if(0===(o=t[r])&&1/o==e)return r;r+=1}return-1}if(n==n)return t.indexOf(n,r);for(;r<t.length;){if("number"==typeof(o=t[r])&&o!=o)return r;r+=1}return-1;case"string":case"boolean":case"function":case"undefined":return t.indexOf(n,r);case"object":if(null===n)return t.indexOf(n,r)}for(;r<t.length;){if(u(t[r],n))return r;r+=1}return-1}t.exports=e},function(t,n,r){var c=r(31),a=r(32),s=r(33),p=r(9),l=r(34),h=r(10),y=r(36);function d(t,n,r,e){var o=c(t),u=c(n);function i(t,n){return v(t,n,r.slice(),e.slice())}return!a(function(t,n){return!a(i,n,t)},u,o)}function v(t,n,r,e){if(l(t,n))return!0;var o=y(t);if(o!==y(n))return!1;if(null==t||null==n)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===s(t.constructor))return t===n;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof n||!l(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!l(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1}for(var u=r.length-1;0<=u;){if(r[u]===t)return e[u]===n;--u}switch(o){case"Map":return t.size!==n.size?!1:d(t.entries(),n.entries(),r.concat([t]),e.concat([n]));case"Set":return t.size!==n.size?!1:d(t.values(),n.values(),r.concat([t]),e.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var i=h(t);if(i.length!==h(n).length)return!1;var c=r.concat([t]),a=e.concat([n]);for(u=i.length-1;0<=u;){var f=i[u];if(!p(f,n)||!v(n[f],t[f],c,a))return!1;--u}return!0}t.exports=v},function(t,n){function r(t){for(var n=[],r;!(r=t.next()).done;)n.push(r.value);return n}t.exports=r},function(t,n){function r(t,n,r){for(var e=0,o=r.length;e<o;){if(t(n,r[e]))return!0;e+=1}return!1}t.exports=r},function(t,n){function r(t){var n=String(t).match(/^function (\w*)/);return null==n?"":n[1]}t.exports=r},function(t,n){function r(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}t.exports="function"==typeof Object.is?Object.is:r},function(t,n,r){var e=r(9),o=Object.prototype.toString,u=function(){return"[object Arguments]"===o.call(arguments)?function t(n){return"[object Arguments]"===o.call(n)}:function t(n){return e("callee",n)}}();t.exports=u},function(t,n,r){var e,o=r(0)(function t(n){return null===n?"Null":void 0===n?"Undefined":Object.prototype.toString.call(n).slice(8,-1)});t.exports=o},function(t,n){function r(t,n){for(var r=0,e=n.length,o=Array(e);r<e;)o[r]=t(n[r]),r+=1;return o}t.exports=r},function(t,n){function r(t){var n;return'"'+t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}t.exports=r},function(t,n){var r=function t(n){return(n<10?"0":"")+n},e="function"==typeof Date.prototype.toISOString?function t(n){return n.toISOString()}:function t(n){return n.getUTCFullYear()+"-"+r(n.getUTCMonth()+1)+"-"+r(n.getUTCDate())+"T"+r(n.getUTCHours())+":"+r(n.getUTCMinutes())+":"+r(n.getUTCSeconds())+"."+(n.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};t.exports=e},function(t,n,r){var e=r(41),o=r(1),u=r(42),i=o(function t(n,r){return u(e(n),r)});t.exports=i},function(t,n){function r(t){return function(){return!t.apply(this,arguments)}}t.exports=r},function(t,n,r){var e=r(1),o=r(43),u=r(45),i=r(46),c=r(13),a=r(50),f=r(10),s=e(o(["filter"],a,function(r,e){return i(e)?c(function(t,n){return r(e[n])&&(t[n]=e[n]),t},{},f(e)):u(r,e)}));t.exports=s},function(t,n,r){var c=r(11),a=r(44);function e(o,u,i){return function(){if(0===arguments.length)return i();var t=Array.prototype.slice.call(arguments,0),n=t.pop();if(!c(n)){for(var r=0,e;r<o.length;){if("function"==typeof n[o[r]])return n[o[r]].apply(n,t);r+=1}if(a(n))return u.apply(null,t)(n)}return i.apply(this,arguments)}}t.exports=e},function(t,n){function r(t){return null!=t&&"function"==typeof t["@@transducer/step"]}t.exports=r},function(t,n){function r(t,n){for(var r=0,e=n.length,o=[];r<e;)t(n[r])&&(o[o.length]=n[r]),r+=1;return o}t.exports=r},function(t,n){function r(t){return"[object Object]"===Object.prototype.toString.call(t)}t.exports=r},function(t,n,r){var e=r(0),o=r(11),u=r(14),i=e(function t(n){return!!o(n)||!!n&&("object"==typeof n&&(!u(n)&&(1===n.nodeType?!!n.length:0===n.length||0<n.length&&(n.hasOwnProperty(0)&&n.hasOwnProperty(n.length-1)))))});t.exports=i},function(t,n){var r=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,n){return this.f(t,n)},t}();function e(t){return new r(t)}t.exports=e},function(t,n,r){var e=r(4),o,u=r(1)(function t(n,r){return e(n.length,function(){return n.apply(r,arguments)})});t.exports=u},function(t,n,r){var e=r(1),o=r(51),u=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=o.init,t.prototype["@@transducer/result"]=o.result,t.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):t},t}(),i=e(function t(n,r){return new u(n,r)});t.exports=i},function(t,n){t.exports={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}}},function(t,n,r){var a=r(53),f=r(54),e=r(2),s=r(5),p=r(3);function l(n,r){return function(t){try{return r(t)}catch(t){n(t)}}}function h(t){if(!(this instanceof h))return new h(t);this._fork=t}h.prototype["@@type"]="ramda-fantasy/Future",h.prototype.fork=function(t,n){this._fork(t,l(t,n))},h.prototype.map=function(n){return this.chain(function(t){return h.of(n(t))})},h.prototype.ap=function(i){var c=this;return new h(function(t,n){var r,e,o=a(t),u=l(o,function(){if(null!=r&&null!=e)return n(r(e))});c._fork(o,function(t){r=t,u()}),i._fork(o,function(t){e=t,u()})})},h.prototype.of=h.of=function(r){return new h(function(t,n){return n(r)})},h.prototype.chain=function(e){return new h(function(n,r){return this._fork(function(t){return n(t)},l(n,function(t){return e(t)._fork(n,r)}))}.bind(this))},h.chainRec=h.prototype.chainRec=function(c,t){return h(function(u,i){return function n(t){for(var r=null,e=p.chainRecNext(t),o=function(t){null===r?(r=!0,e=t):(t.isNext?n:i)(t.value)};e.isNext;)if(r=null,c(p.chainRecNext,p.chainRecDone,e.value).fork(u,o),!0!==r)return void(r=!1);i(e.value)}(t)})},h.prototype.chainReject=function(e){return new h(function(n,r){return this._fork(l(n,function(t){return e(t)._fork(n,r)}),function(t){return r(t)})}.bind(this))},h.prototype.bimap=function(e,o){var t=this;return new h(function(n,r){t._fork(l(n,function(t){n(e(t))}),l(n,function(t){r(o(t))}))})},h.reject=function(n){return new h(function(t){t(n)})},h.prototype.toString=function(){return"Future("+e(this._fork)+")"},h.cache=function(r){var e="IDLE",o=[],u,i=s(function(t,n,r){e=t,n(u=r),f(function(t){t[e](u)},o)});function c(t,n){o.push({REJECTED:t,RESOLVED:n})}function a(t,n){return e="PENDING",r._fork(i("REJECTED",t),i("RESOLVED",n))}return new h(function(t,n){switch(e){case"IDLE":a(t,n);break;case"PENDING":c(t,n);break;case"REJECTED":t(u);break;case"RESOLVED":n(u)}})},t.exports=h},function(t,n,r){var o=r(4),e,u=r(0)(function t(n){var r=!1,e;return o(n.length,function(){return r?e:(r=!0,e=n.apply(this,arguments))})});t.exports=u},function(t,n,r){var e=r(12),o,u=r(1)(e("forEach",function t(n,r){for(var e=r.length,o=0;o<e;)n(r[o]),o+=1;return r}));t.exports=u},function(t,n,r){var e=r(16),o=r(2),u=r(3);function i(t){if(!(this instanceof i))return new i(t);this.fn=t}(t.exports=i).prototype["@@type"]="ramda-fantasy/IO",i.prototype.chain=function(n){var r=this;return new i(function(){var t=n(r.fn.apply(r,arguments));return t.fn.apply(t,arguments)})},i.chainRec=i.prototype.chainRec=function(n,r){return new i(function(){for(var t=u.chainRecNext(r);t.isNext;)t=n(u.chainRecNext,u.chainRecDone,t.value).fn();return t.value})},i.prototype.map=function(t){var n;return new i(e(t,this.fn))},i.prototype.ap=function(n){return this.chain(function(t){return n.map(t)})},i.runIO=function(t){return t.runIO.apply(t,[].slice.call(arguments,1))},i.prototype.runIO=function(){return this.fn.apply(this,arguments)},i.of=i.prototype.of=function(t){return new i(function(){return t})},i.prototype.toString=function(){return"IO("+o(this.fn)+")"}},function(t,n,r){var e=r(4),o=r(57),u=r(58),i=r(59);function c(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return e(arguments[0].length,u(o,arguments[0],i(arguments)))}t.exports=c},function(t,n){function r(t,n){return function(){return n.call(this,t.apply(this,arguments))}}t.exports=r},function(t,n,r){var e,o,u=r(17)(r(13));t.exports=u},function(t,n,r){var e=r(12),o,u,i=r(0)(e("tail",r(60)(1,1/0)));t.exports=i},function(t,n,r){var e=r(12),o,u=r(17)(e("slice",function t(n,r,e){return Array.prototype.slice.call(e,n,r)}));t.exports=u},function(t,n,r){var e=r(0),o=r(14),u=e(function t(n){return o(n)?n.split("").reverse().join(""):Array.prototype.slice.call(n,0).reverse()});t.exports=u},function(t,n,r){var e=r(7);t.exports=e(3,function t(n,r,e){return r.map(n).ap(e)})},function(t,n,r){var e=r(7);t.exports=e(4,function t(n,r,e,o){return r.map(n).ap(e).ap(o)})},function(t,n,r){var e=r(2),o=r(5),u=r(3);function i(t){return null==t?f:i.Just(t)}function c(t){this.value=t}function a(){}i.prototype["@@type"]="ramda-fantasy/Maybe",u.extend(c,i),c.prototype.isJust=!0,c.prototype.isNothing=!1,u.extend(a,i),a.prototype.isNothing=!0,a.prototype.isJust=!1;var f=new a;i.Nothing=function(){return f},i.of=i.Just=function(t){return new c(t)},i.prototype.of=i.Just,i.isJust=function(t){return t.isJust},i.isNothing=function(t){return t.isNothing},i.maybe=o(function(t,r,n){return n.reduce(function(t,n){return r(n)},t)}),i.toMaybe=i,c.prototype.concat=function(t){return t.isNothing?this:this.of(this.value.concat(t.value))},a.prototype.concat=u.identity,c.prototype.map=function(t){return this.of(t(this.value))},a.prototype.map=u.returnThis,c.prototype.ap=function(t){return t.map(this.value)},a.prototype.ap=u.returnThis,c.prototype.chain=u.baseMap,a.prototype.chain=u.returnThis,i.chainRec=i.prototype.chainRec=function(t,n){for(var r,e=u.chainRecNext(n);e.isNext;){if(r=t(u.chainRecNext,u.chainRecDone,e.value),i.isNothing(r))return r;e=r.value}return i.Just(e.value)},c.prototype.datatype=c,a.prototype.datatype=a,c.prototype.equals=u.getEquals(c),a.prototype.equals=function(t){return t===f},i.prototype.isNothing=function(){return this===f},i.prototype.isJust=function(){return this instanceof c},c.prototype.getOrElse=function(){return this.value},a.prototype.getOrElse=function(t){return t},c.prototype.reduce=function(t,n){return t(n,this.value)},a.prototype.reduce=function(t,n){return n},c.prototype.toString=function(){return"Maybe.Just("+e(this.value)+")"},a.prototype.toString=function(){return"Maybe.Nothing()"},t.exports=i},function(t,n,r){var e=r(16),o=r(66),u=r(2),i=r(68);function c(t){if(!(this instanceof c))return new c(t);this.run=t}c.run=function(t){return t.run.apply(t,[].slice.call(arguments,1))},c.prototype["@@type"]="ramda-fantasy/Reader",c.prototype.chain=function(n){var r=this;return new c(function(t){return n(r.run(t)).run(t)})},c.prototype.ap=function(n){return this.chain(function(t){return n.map(t)})},c.prototype.map=function(n){return this.chain(function(t){return c.of(n(t))})},c.of=c.prototype.of=function(t){return new c(function(){return t})},c.ask=c(o),c.prototype.toString=function(){return"Reader("+u(this.run)+")"},c.T=function(n){var o=function t(n){if(!(this instanceof t))return new t(n);this.run=n};return o.lift=e(o,i),o.ask=o(n.of),o.prototype.of=o.of=function(t){return o(function(){return n.of(t)})},o.prototype.chain=function(r){var e=this;return o(function(n){var t;return e.run(n).chain(function(t){return r(t).run(n)})})},o.prototype.map=function(n){return this.chain(function(t){return o.of(n(t))})},o.prototype.ap=function(n){var r=this;return o(function(t){return r.run(t).ap(n.run(t))})},o.prototype.toString=function(){return"ReaderT["+n.name+"]("+u(this.run)+")"},o},t.exports=c},function(t,n,r){var e,o,u=r(0)(r(67));t.exports=u},function(t,n){function r(t){return t}t.exports=r},function(t,n,r){var e,o=r(0)(function t(n){return function(){return n}});t.exports=o},function(t,n,r){var u=r(5),e=r(15),i=r(18),c=r(3);function o(e){function o(t){if(!(this instanceof o))return new o(t);this._run=t}return o.prototype.run=function(t){return this._run(t)},o.prototype.eval=function(t){return i.fst(this.run(t))},o.prototype.exec=function(t){return i.snd(this.run(t))},o.prototype.chain=function(n){var r=this;return o(function(t){return r._run(t).chain(function(t){return n(i.fst(t))._run(i.snd(t))})})},o.of=o.prototype.of=function(n){return o(function(t){return e.of(i(n,t))})},o.prototype.ap=c.deriveAp(o),o.prototype.map=c.deriveMap(o),o.tailRec=u(function(n,r){return o(function(t){return e.tailRec(function(t){return n(i.fst(t))._run(i.snd(t)).chain(function(n){return e.of(i.fst(n).bimap(function(t){return i(t,i.snd(n))},function(t){return i(t,i.snd(n))}))})},i(r,t))})}),o.lift=function(t){return o(function(n){return t.chain(function(t){return e.of(i(t,n))})})},o.get=o(function(t){return e.of(i(t,t))}),o.gets=function(n){return o(function(t){return e.of(i(n(t),t))})},o.put=function(n){return o(function(t){return e.of(i(void 0,n))})},o.modify=function(n){return o(function(t){return e.of(i(void 0,n(t)))})},o}var a=o(e);a.T=o,a.prototype.run=function(t){return this._run(t).value},t.exports=a},function(t,n,r){"use strict";function i(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function c(r){return function t(n){return 0===arguments.length||i(n)?t:r.apply(this,arguments)}}function a(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return i(n)?t:c(function(t){return e(n,t)});default:return i(n)&&i(r)?t:i(n)?c(function(t){return e(t,r)}):i(r)?c(function(t){return e(n,t)}):e(n,r)}}}function f(t){for(var n=[],r;!(r=t.next()).done;)n.push(r.value);return n}function s(t,n,r){for(var e=0,o=r.length;e<o;){if(t(n,r[e]))return 1;e+=1}}function p(t){var n=String(t).match(/^function (\w*)/);return null==n?"":n[1]}function l(t,n){return Object.prototype.hasOwnProperty.call(n,t)}function e(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}r.r(n);var h="function"==typeof Object.is?Object.is:e,o=Object.prototype.toString,u,y=function(){return"[object Arguments]"===o.call(arguments)?function t(n){return"[object Arguments]"===o.call(n)}:function t(n){return l("callee",n)}}(),d=!{toString:null}.propertyIsEnumerable("toString"),v=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],g=function(){return arguments.propertyIsEnumerable("length")}(),m=function t(n,r){for(var e=0;e<n.length;){if(n[e]===r)return!0;e+=1}return!1},x,b="function"!=typeof Object.keys||g?c(function t(n){if(Object(n)!==n)return[];var r,e,o=[],u=g&&y(n);for(r in n)!l(r,n)||u&&"length"===r||(o[o.length]=r);if(d)for(e=v.length-1;0<=e;)l(r=v[e],n)&&!m(o,r)&&(o[o.length]=r),--e;return o}):c(function t(n){return Object(n)!==n?[]:Object.keys(n)}),w,E=c(function t(n){return null===n?"Null":void 0===n?"Undefined":Object.prototype.toString.call(n).slice(8,-1)});function A(t,n,r,e){var o=f(t),u;function i(t,n){return O(t,n,r.slice(),e.slice())}return!s(function(t,n){return!s(i,n,t)},f(n),o)}function O(t,n,r,e){if(h(t,n))return!0;var o=E(t);if(o!==E(n))return!1;if(null==t||null==n)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===p(t.constructor))return t===n;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof n||!h(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!h(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1}for(var u=r.length-1;0<=u;){if(r[u]===t)return e[u]===n;--u}switch(o){case"Map":return t.size!==n.size?!1:A(t.entries(),n.entries(),r.concat([t]),e.concat([n]));case"Set":return t.size!==n.size?!1:A(t.values(),n.values(),r.concat([t]),e.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var i=b(t);if(i.length!==b(n).length)return!1;var c=r.concat([t]),a=e.concat([n]);for(u=i.length-1;0<=u;){var f=i[u];if(!l(f,n)||!O(n[f],t[f],c,a))return!1;--u}return!0}var j,R=a(function t(n,r){return O(n,r,[],[])}),S=Array.isArray||function t(n){return null!=n&&0<=n.length&&"[object Array]"===Object.prototype.toString.call(n)};function C(t){return null!=t&&"function"==typeof t["@@transducer/step"]}function N(o,u,i){return function(){if(0===arguments.length)return i();var t=Array.prototype.slice.call(arguments,0),n=t.pop();if(!S(n)){for(var r=0,e;r<o.length;){if("function"==typeof n[o[r]])return n[o[r]].apply(n,t);r+=1}if(C(n))return u.apply(null,t)(n)}return i.apply(this,arguments)}}function T(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var k=function(){return this.xf["@@transducer/init"]()},q=function(t){return this.xf["@@transducer/result"](t)},I=function(){function t(t,n){this.xf=n,this.f=t,this.found=!1}return t.prototype["@@transducer/init"]=k,t.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,void 0)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.found=!0,t=T(this.xf["@@transducer/step"](t,n))),t},t}(),D,_,P,L=a(N(["find"],a(function t(n,r){return new I(n,r)}),function t(n,r){for(var e=0,o=r.length;e<o;){if(n(r[e]))return r[e];e+=1}})),M,U=a(function t(n,r){return null==r||r!=r?n:r}),F,J=a(function t(n,r){var e=r instanceof Array?[]:{},o,u,i;for(u in r)i=typeof(o=n[u]),e[u]="function"==i?o(r[u]):o&&"object"==i?t(o,r[u]):r[u];return e});function $(t,n){var r,e=(t=t||[]).length,o=(n=n||[]).length,u=[];for(r=0;r<e;)u[u.length]=t[r],r+=1;for(r=0;r<o;)u[u.length]=n[r],r+=1;return u}var z,B=a(function t(n,r){return $(r,[n])});function H(u){return function t(r,e,o){switch(arguments.length){case 0:return t;case 1:return i(r)?t:a(function(t,n){return u(r,t,n)});case 2:return i(r)&&i(e)?t:i(r)?a(function(t,n){return u(t,e,n)}):i(e)?a(function(t,n){return u(r,t,n)}):c(function(t){return u(r,e,t)});default:return i(r)&&i(e)&&i(o)?t:i(r)&&i(e)?a(function(t,n){return u(t,n,o)}):i(r)&&i(o)?a(function(t,n){return u(t,e,n)}):i(e)&&i(o)?a(function(t,n){return u(r,t,n)}):i(r)?c(function(t){return u(t,e,o)}):i(e)?c(function(t){return u(r,t,o)}):i(o)?c(function(t){return u(r,e,t)}):u(r,e,o)}}}var V,W=H(function t(n,r,e){var o={};for(var u in e)o[u]=e[u];return o[n]=r,o}),Z=r(19),G=r.n(Z),X=function t(n,r){var e=1<arguments.length&&void 0!==r?r:"";return n?t(--n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".charAt(Math.floor(60*Math.random()))+e):e},K="framework",Q="preload",Y="childapp",tt=["style","link","script"],nt=/\.css$/,rt=/\.js$/,et="__MICRO_ROOT_DATA__";function ot(t){return ct(t)||it(t)||ut()}function ut(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function it(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function ct(t){if(Array.isArray(t)){for(var n=0,r=new Array(t.length);n<t.length;n++)r[n]=t[n];return r}}var at=function t(n){return"".concat(K,"-").concat(n)},ft=document.head||document.getElementsByTagName("head")[0],st=function t(e){return new Promise(function(t,n){var r=document.createElement("script");r.type="text/javascript",r.setAttribute(at("script"),Y),r.src=e,r.async=!1,r.onload=function(){return t(e)},r.onerror=function(t){return n({url:e,error:t})},ft.appendChild(r)})},pt=function t(e){return new Promise(function(t,n){var r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.setAttribute(at("link"),Y),r.href=e,r.onload=function(){return t(e)},r.onerror=function(t){return n({url:e,error:t})},ft.appendChild(r)})},lt=function t(){tt.forEach(function(n){var t;ot(document.getElementsByTagName(n)).forEach(function(t){return t.setAttribute(at(n),Q)})})},ht=function t(){tt.forEach(function(n){var t;ot(document.getElementsByTagName(n)).forEach(function(t){return t.removeAttribute(at(n))})})},yt=function t(){tt.forEach(function(t){var n;ot(document.querySelectorAll("".concat(t,":not([").concat(at(t),"='").concat(Q,"'])"))).forEach(function(t){return t.parentNode&&t.parentNode.removeChild(t)})})},dt=function t(n,r,e,o){var u=[],i=[];("string"==typeof n?[n]:n).filter(function(t){return!!t}).forEach(function(t){nt.test(t)?u.push(t):rt.test(t)&&i.push(t)}),u.length&&Promise.all(u.map(pt)).then(e).catch(o),i.length&&Promise.all(i.map(st)).then(r).catch(o)};function vt(t){for(var n=[],r=0;r<t.length;){var e=t[r];if("*"!==e&&"+"!==e&&"?"!==e)if("\\"!==e)if("{"!==e)if("}"!==e)if(":"!==e)if("("!==e)n.push({type:"CHAR",index:r,value:t[r++]});else{var o=1,u="",i;if("?"===t[i=r+1])throw new TypeError('Pattern cannot start with "?" at '+i);for(;i<t.length;)if("\\"!==t[i]){if(")"===t[i]){if(0===--o){i++;break}}else if("("===t[i]&&(o++,"?"!==t[i+1]))throw new TypeError("Capturing groups are not allowed at "+i);u+=t[i++]}else u+=t[i++]+t[i++];if(o)throw new TypeError("Unbalanced pattern at "+r);if(!u)throw new TypeError("Missing pattern at "+r);n.push({type:"PATTERN",index:r,value:u}),r=i}else{for(var c="",i=r+1;i<t.length;){var a=t.charCodeAt(i);if(!(48<=a&&a<=57||65<=a&&a<=90||97<=a&&a<=122||95===a))break;c+=t[i++]}if(!c)throw new TypeError("Missing parameter name at "+r);n.push({type:"NAME",index:r,value:c}),r=i}else n.push({type:"CLOSE",index:r,value:t[r++]});else n.push({type:"OPEN",index:r,value:t[r++]});else n.push({type:"ESCAPED_CHAR",index:r++,value:t[r++]});else n.push({type:"MODIFIER",index:r,value:t[r++]})}return n.push({type:"END",index:r,value:""}),n}function gt(t,n){void 0===n&&(n={});for(var u=vt(t),r=n.prefixes,e=void 0===r?"./":r,o="[^"+Et(n.delimiter||"/#?")+"]+?",i=[],c=0,a=0,f="",s=function(t){if(a<u.length&&u[a].type===t)return u[a++].value},p=function(t){var n=s(t);if(void 0!==n)return n;var r=u[a],e=r.type,o=r.index;throw new TypeError("Unexpected "+e+" at "+o+", expected "+t)},l=function(){for(var t="",n;n=s("CHAR")||s("ESCAPED_CHAR");)t+=n;return t};a<u.length;){var h=s("CHAR"),y=s("NAME"),d=s("PATTERN");if(y||d){var v=h||"";-1===e.indexOf(v)&&(f+=v,v=""),f&&(i.push(f),f=""),i.push({name:y||c++,prefix:v,suffix:"",pattern:d||o,modifier:s("MODIFIER")||""})}else{var g=h||s("ESCAPED_CHAR"),m;if(g)f+=g;else if(f&&(i.push(f),f=""),s("OPEN")){var v=l(),x=s("NAME")||"",b=s("PATTERN")||"",w=l();p("CLOSE"),i.push({name:x||(b?c++:""),pattern:x&&!b?o:b,prefix:v,suffix:w,modifier:s("MODIFIER")||""})}else p("END")}}return i}function mt(t,n){return xt(gt(t,n),n)}function xt(s,t){void 0===t&&(t={});var n=At(t),r=t.encode,p=void 0===r?function(t){return t}:r,e=t.validate,l=void 0===e||e,h=s.map(function(t){if("object"==typeof t)return new RegExp("^(?:"+t.pattern+")$",n)});return function(t){for(var n="",r=0;r<s.length;r++){var e=s[r];if("string"!=typeof e){var o=t?t[e.name]:void 0,u="?"===e.modifier||"*"===e.modifier,i="*"===e.modifier||"+"===e.modifier;if(Array.isArray(o)){if(!i)throw new TypeError('Expected "'+e.name+'" to not repeat, but got an array');if(0===o.length){if(u)continue;throw new TypeError('Expected "'+e.name+'" to not be empty')}for(var c=0;c<o.length;c++){var a=p(o[c],e);if(l&&!h[r].test(a))throw new TypeError('Expected all "'+e.name+'" to match "'+e.pattern+'", but got "'+a+'"');n+=e.prefix+a+e.suffix}}else if("string"!=typeof o&&"number"!=typeof o){if(!u){var f=i?"an array":"a string";throw new TypeError('Expected "'+e.name+'" to be '+f)}}else{var a=p(String(o),e);if(l&&!h[r].test(a))throw new TypeError('Expected "'+e.name+'" to match "'+e.pattern+'", but got "'+a+'"');n+=e.prefix+a+e.suffix}}else n+=e}return n}}function bt(t,n){var r=[],e;return wt(Ct(t,r,n),r,n)}function wt(c,a,t){void 0===t&&(t={});var n=t.decode,f=void 0===n?function(t){return t}:n;return function(t){var r=c.exec(t);if(!r)return!1;for(var n=r[0],e=r.index,o=Object.create(null),u=function(t){if(void 0===r[t])return"continue";var n=a[t-1];"*"===n.modifier||"+"===n.modifier?o[n.name]=r[t].split(n.prefix+n.suffix).map(function(t){return f(t,n)}):o[n.name]=f(r[t],n)},i=1;i<r.length;i++)u(i);return{path:n,index:e,params:o}}}function Et(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function At(t){return t&&t.sensitive?"":"i"}function Ot(t,n){if(!n)return t;var r=t.source.match(/\((?!\?)/g);if(r)for(var e=0;e<r.length;e++)n.push({name:e,prefix:"",suffix:"",modifier:"",pattern:""});return t}function jt(t,n,r){var e=t.map(function(t){return Ct(t,n,r).source});return new RegExp("(?:"+e.join("|")+")",At(r))}function Rt(t,n,r){return St(gt(t,r),n,r)}function St(t,n,r){void 0===r&&(r={});for(var e=r.strict,o=void 0!==e&&e,u=r.start,i=void 0===u||u,c=r.end,a=void 0===c||c,f=r.encode,s=void 0===f?function(t){return t}:f,p="["+Et(r.endsWith||"")+"]|$",l="["+Et(r.delimiter||"/#?")+"]",h=i?"^":"",y=0,d=t;y<d.length;y++){var v=d[y];if("string"==typeof v)h+=Et(s(v));else{var g=Et(s(v.prefix)),m=Et(s(v.suffix));if(v.pattern)if(n&&n.push(v),g||m)if("+"===v.modifier||"*"===v.modifier){var x="*"===v.modifier?"?":"";h+="(?:"+g+"((?:"+v.pattern+")(?:"+m+g+"(?:"+v.pattern+"))*)"+m+")"+x}else h+="(?:"+g+"("+v.pattern+")"+m+")"+v.modifier;else h+="("+v.pattern+")"+v.modifier;else h+="(?:"+g+m+")"+v.modifier}}if(a)o||(h+=l+"?"),h+=r.endsWith?"(?="+p+")":"$";else{var b=t[t.length-1],w="string"==typeof b?-1<l.indexOf(b[b.length-1]):void 0===b;o||(h+="(?:"+l+"(?="+p+"))?"),w||(h+="(?="+l+"|"+p+")")}return new RegExp(h,At(r))}function Ct(t,n,r){return t instanceof RegExp?Ot(t,n):(Array.isArray(t)?jt:Rt)(t,n,r)}function Nt(t){return qt(t)||kt(t)||Tt()}function Tt(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function kt(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function qt(t){if(Array.isArray(t))return t}var It={},Dt=1e4,_t=0;function Pt(t,n){var r="".concat(n.end).concat(n.strict).concat(n.sensitive),e=It[r]||(It[r]={});if(e[t])return e[t];var o=[],u,i={regexp:Ct(t,o,n),keys:o};return _t<Dt&&(e[t]=i,_t++),i}function Lt(s){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof t&&!Array.isArray(t)||(t={path:t});var n=t,r=t.path,e=t.exact,p=void 0!==e&&e,o=t.strict,l=void 0!==o&&o,u=t.sensitive,h=void 0!==u&&u,i;return[].concat(r).reduce(function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=Pt(n,{end:p,strict:l,sensitive:h}),e=r.regexp,o=r.keys,u=e.exec(s);if(!u)return null;var i=Nt(u),c=i[0],a=i.slice(1),f=s===c;return p&&!f?null:{path:n,url:"/"===n&&""===c?"/":c,isExact:f,params:o.reduce(function(t,n,r){return t[n.name]=a[r],t},{})}},null)}var Mt=Lt,Ut=r(20),Ft=function t(n){return Object(Ut.Identity)(n)};function Jt(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}r.d(n,"FrameworkImpl",function(){return $t}),r.d(n,"create",function(){return zt}),r.d(n,"register",function(){return Kt}),r.d(n,"registerNotFound",function(){return Qt}),r.d(n,"registerError",function(){return Yt}),r.d(n,"root",function(){return tn}),r.d(n,"onChildEnter",function(){return nn}),r.d(n,"onChildLeave",function(){return rn}),r.d(n,"exit",function(){return en}),r.d(n,"start",function(){return on}),r.d(n,"redirect",function(){return un}),r.d(n,"createMonad",function(){return Ft});var $t=function t(){Jt(this,t),this.children=[],this.$root=document.body},zt=function t(){var n=new $t;return Ft(n)},Bt=function t(n){n.currentChild&&n.currentChild.assets&&dt(n.currentChild.assets,function(){n.currentChild.title&&(document.title=n.currentChild.title)},function(){n.onChildEnter&&n.onChildEnter(n.currentChild)},function(){n.childError&&Vt(n.childError,n)})},Ht=function t(n){n.onChildLeave&&n.onChildLeave(n.currentChild),"function"==typeof window[et].onChildAppLeave&&window[et].onChildAppLeave()},Vt=function t(n,r){return R(r.currentChild,n)||(console.log(r.currentChild,n),Ht(r),yt(),r.currentChild=n,Zt(r),Bt(r)),r},Wt=function t(n,r){var e,o=new G.a(n).pathname;return L(function(t){return Mt(o,t)},r.children)},Zt=function t(n){window[et]=Object.assign(Object.assign({},window[et]||{}),{$root:n.$root,base:n.currentChild&&n.currentChild.base||"/",onChildAppLeave:function t(){}})},Gt=function t(){delete window[et]},Xt=function t(n,r){var e=U(r.childNotFound,Wt(n,r));return Vt(e,r),r},Kt=function t(n){return function(t){return Ft(J({children:B(n)},t))}},Qt=function t(n){return function(t){return Ft(W("childNotFound",n,t))}},Yt=function t(n){return function(t){return Ft(W("childError",n,t))}},tn=function t(n){return function(t){return t=W("$root",n,t),Zt(t),Ft(t)}},nn=function t(n){return function(t){return Ft(W("onChildEnter",n,t))}},rn=function t(n){return function(t){return Ft(W("onChildLeave",n,t))}},en=function t(n){return n.currentChild=null,Ht(n),Gt(),yt(),ht(),Ft(n)},on=function t(n){return Zt(n),lt(),Xt("/",n),Ft(n)},un=function t(n){return function(t){return Xt(n,t),Ft(t)}}}],o.c=e,o.d=function(t,n,r){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(n,t){if(1&t&&(n=o(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var e in n)o.d(r,e,function(t){return n[t]}.bind(null,e));return r},o.n=function(n){var t=n&&n.__esModule?function t(){return n.default}:function t(){return n};return o.d(t,"a",t),t},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=21);function o(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var r,e}); | ||
!function t(n,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports["@harpsealjs/framework"]=r():n["@harpsealjs/framework"]=r()}(window,function(){return e={},o.m=r=[function(t,n,r){var e=r(6);function o(r){return function t(n){return 0===arguments.length||e(n)?t:r.apply(this,arguments)}}t.exports=o},function(t,n,r){var o=r(0),u=r(6);function e(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return u(n)?t:o(function(t){return e(n,t)});default:return u(n)&&u(r)?t:u(n)?o(function(t){return e(t,r)}):u(r)?o(function(t){return e(n,t)}):e(n,r)}}}t.exports=e},function(t,n,r){var e=r(0),o=r(27),u=e(function t(n){return o(n,[])});t.exports=u},function(t,n,r){var e=r(8);t.exports={baseMap:function(t){return t(this.value)},getEquals:function(r){return function t(n){return n instanceof r&&e(this.value,n.value)}},extend:function(t,n){function r(){this.constructor=t}r.prototype=n.prototype,t.prototype=new r,t.super_=n.prototype},identity:function(t){return t},notImplemented:function(t){return function(){throw new Error(t+" is not implemented")}},notCallable:function(t){return function(){throw new Error(t+" cannot be called directly")}},returnThis:function(){return this},chainRecNext:function(t){return{isNext:!0,value:t}},chainRecDone:function(t){return{isNext:!1,value:t}},deriveAp:function(r){return function(t){return this.chain(function(n){return t.chain(function(t){return r.of(n(t))})})}},deriveMap:function(r){return function(n){return this.chain(function(t){return r.of(n(t))})}}}},function(t,n){function r(t,s){switch(t){case 0:return function(){return s.apply(this,arguments)};case 1:return function(t){return s.apply(this,arguments)};case 2:return function(t,n){return s.apply(this,arguments)};case 3:return function(t,n,r){return s.apply(this,arguments)};case 4:return function(t,n,r,e){return s.apply(this,arguments)};case 5:return function(t,n,r,e,o){return s.apply(this,arguments)};case 6:return function(t,n,r,e,o,u){return s.apply(this,arguments)};case 7:return function(t,n,r,e,o,u,i){return s.apply(this,arguments)};case 8:return function(t,n,r,e,o,u,i,c){return s.apply(this,arguments)};case 9:return function(t,n,r,e,o,u,i,c,a){return s.apply(this,arguments)};case 10:return function(t,n,r,e,o,u,i,c,a,f){return s.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}t.exports=r},function(t,n,r){var e=r(0),o=r(7),u=e(function t(n){return o(n.length,n)});t.exports=u},function(t,n){function r(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}t.exports=r},function(t,n,r){var e=r(4),o=r(0),u=r(1),i=r(26),c=u(function t(n,r){return 1===n?o(r):e(n,i(n,[],r))});t.exports=c},function(t,n,r){var e=r(1),o=r(30),u=e(function t(n,r){return o(n,r,[],[])});t.exports=u},function(t,n){function r(t,n){return Object.prototype.hasOwnProperty.call(n,t)}t.exports=r},function(t,n,r){var e=r(0),i=r(9),c=r(35),a=!{toString:null}.propertyIsEnumerable("toString"),f=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],s=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),p=function t(n,r){for(var e=0;e<n.length;){if(n[e]===r)return!0;e+=1}return!1},o="function"!=typeof Object.keys||s?e(function t(n){if(Object(n)!==n)return[];var r,e,o=[],u=s&&c(n);for(r in n)!i(r,n)||u&&"length"===r||(o[o.length]=r);if(a)for(e=f.length-1;0<=e;)i(r=f[e],n)&&!p(o,r)&&(o[o.length]=r),--e;return o}):e(function t(n){return Object(n)!==n?[]:Object.keys(n)});t.exports=o},function(t,n){t.exports=Array.isArray||function t(n){return null!=n&&0<=n.length&&"[object Array]"===Object.prototype.toString.call(n)}},function(t,n,r){var o=r(11);function e(r,e){return function(){var t=arguments.length;if(0===t)return e();var n=arguments[t-1];return o(n)||"function"!=typeof n[r]?e.apply(this,arguments):n[r].apply(n,Array.prototype.slice.call(arguments,0,t-1))}}t.exports=e},function(t,n,r){var e=r(47),o=r(48),u=r(49);function i(t,n,r){for(var e=0,o=r.length;e<o;){if((n=t["@@transducer/step"](n,r[e]))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e+=1}return t["@@transducer/result"](n)}function c(t,n,r){for(var e=r.next();!e.done;){if((n=t["@@transducer/step"](n,e.value))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e=r.next()}return t["@@transducer/result"](n)}function a(t,n,r,e){return t["@@transducer/result"](r[e](u(t["@@transducer/step"],t),n))}var f="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function s(t,n,r){if("function"==typeof t&&(t=o(t)),e(r))return i(t,n,r);if("function"==typeof r["fantasy-land/reduce"])return a(t,n,r,"fantasy-land/reduce");if(null!=r[f])return c(t,n,r[f]());if("function"==typeof r.next)return c(t,n,r);if("function"==typeof r.reduce)return a(t,n,r,"reduce");throw new TypeError("reduce: list must be array or iterable")}t.exports=s},function(t,n){function r(t){return"[object String]"===Object.prototype.toString.call(t)}t.exports=r},function(t,n,r){var e=r(2),o=r(3);function u(t){if(!(this instanceof u))return new u(t);this.value=t}u.prototype["@@type"]="ramda-fantasy/Identity",u.prototype.of=u.of=function(t){return new u(t)},u.prototype.map=function(t){return new u(t(this.value))},u.prototype.ap=function(t){return t.map(this.value)},u.prototype.chain=function(t){return t(this.value)},u.chainRec=u.prototype.chainRec=function(t,n){for(var r=o.chainRecNext(n);r.isNext;)r=t(o.chainRecNext,o.chainRecDone,r.value).get();return u(r.value)},u.prototype.get=function(){return this.value},u.prototype.equals=o.getEquals(u),u.prototype.toString=function(){return"Identity("+e(this.value)+")"},t.exports=u},function(t,n,r){var e=r(56),o=r(61);function u(){if(0===arguments.length)throw new Error("compose requires at least one argument");return e.apply(this,o(arguments))}t.exports=u},function(t,n,r){var i=r(0),c=r(1),a=r(6);function e(u){return function t(r,e,o){switch(arguments.length){case 0:return t;case 1:return a(r)?t:c(function(t,n){return u(r,t,n)});case 2:return a(r)&&a(e)?t:a(r)?c(function(t,n){return u(t,e,n)}):a(e)?c(function(t,n){return u(r,t,n)}):i(function(t){return u(r,e,t)});default:return a(r)&&a(e)&&a(o)?t:a(r)&&a(e)?c(function(t,n){return u(t,n,o)}):a(r)&&a(o)?c(function(t,n){return u(t,e,n)}):a(e)&&a(o)?c(function(t,n){return u(r,t,n)}):a(r)?i(function(t){return u(t,e,o)}):a(e)?i(function(t){return u(r,t,o)}):a(o)?i(function(t){return u(r,e,t)}):u(r,e,o)}}}t.exports=e},function(t,n,r){var e=r(2),o=r(8);function u(n,t){switch(arguments.length){case 0:throw new TypeError("no arguments to Tuple");case 1:return function(t){return new i(n,t)};default:return new i(n,t)}}function i(t,n){this[0]=t,this[1]=n,this.length=2}function c(t){t.forEach(function(t){if("function"!=typeof t.concat)throw new TypeError(e(t)+" must be a semigroup to perform this operation")})}u.fst=function(t){return t[0]},u.snd=function(t){return t[1]},i.prototype["@@type"]="ramda-fantasy/Tuple",i.prototype.concat=function(t){return c([this[0],this[1]]),u(this[0].concat(t[0]),this[1].concat(t[1]))},i.prototype.map=function(t){return u(this[0],t(this[1]))},i.prototype.ap=function(t){return c([this[0]]),u(this[0].concat(t[0]),this[1](t[1]))},i.prototype.equals=function(t){return t instanceof i&&o(this[0],t[0])&&o(this[1],t[1])},i.prototype.toString=function(){return"Tuple("+e(this[0])+", "+e(this[1])+")"},t.exports=u},function(u,t,f){"use strict";(function(i){var h=f(23),y=f(24),c=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,r=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,t,n=new RegExp("^"+"[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]"+"+");function d(t){return(t||"").toString().replace(n,"")}var v=[["#","hash"],["?","query"],function t(n){return n.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],a={hash:1,query:1};function g(t){var n,r=(n="undefined"!=typeof window?window:void 0!==i?i:"undefined"!=typeof self?self:{}).location||{},e={},o=typeof(t=t||r),u;if("blob:"===t.protocol)e=new b(unescape(t.pathname),{});else if("string"==o)for(u in e=new b(t,{}),a)delete e[u];else if("object"==o){for(u in t)u in a||(e[u]=t[u]);void 0===e.slashes&&(e.slashes=c.test(t.href))}return e}function m(t){t=d(t);var n=r.exec(t);return{protocol:n[1]?n[1].toLowerCase():"",slashes:!!n[2],rest:n[3]}}function x(t,n){if(""===t)return n;for(var r=(n||"/").split("/").slice(0,-1).concat(t.split("/")),e=r.length,o=r[e-1],u=!1,i=0;e--;)"."===r[e]?r.splice(e,1):".."===r[e]?(r.splice(e,1),i++):i&&(0===e&&(u=!0),r.splice(e,1),i--);return u&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}function b(t,n,r){if(t=d(t),!(this instanceof b))return new b(t,n,r);var e,o,u,i,c,a,f=v.slice(),s=typeof n,p=this,l=0;for("object"!=s&&"string"!=s&&(r=n,n=null),r&&"function"!=typeof r&&(r=y.parse),n=g(n),e=!(o=m(t||"")).protocol&&!o.slashes,p.slashes=o.slashes||e&&n.slashes,p.protocol=o.protocol||n.protocol||"",t=o.rest,o.slashes||(f[3]=[/(.*)/,"pathname"]);l<f.length;l++)"function"!=typeof(i=f[l])?(u=i[0],a=i[1],u!=u?p[a]=t:"string"==typeof u?~(c=t.indexOf(u))&&(t="number"==typeof i[2]?(p[a]=t.slice(0,c),t.slice(c+i[2])):(p[a]=t.slice(c),t.slice(0,c))):(c=u.exec(t))&&(p[a]=c[1],t=t.slice(0,c.index)),p[a]=p[a]||e&&i[3]&&n[a]||"",i[4]&&(p[a]=p[a].toLowerCase())):t=i(t);r&&(p.query=r(p.query)),e&&n.slashes&&"/"!==p.pathname.charAt(0)&&(""!==p.pathname||""!==n.pathname)&&(p.pathname=x(p.pathname,n.pathname)),h(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(i=p.auth.split(":"),p.username=i[0]||"",p.password=i[1]||""),p.origin=p.protocol&&p.host&&"file:"!==p.protocol?p.protocol+"//"+p.host:"null",p.href=p.toString()}function e(t,n,r){var e=this;switch(t){case"query":"string"==typeof n&&n.length&&(n=(r||y.parse)(n)),e[t]=n;break;case"port":e[t]=n,h(n,e.protocol)?n&&(e.host=e.hostname+":"+n):(e.host=e.hostname,e[t]="");break;case"hostname":e[t]=n,e.port&&(n+=":"+e.port),e.host=n;break;case"host":e[t]=n,/:\d+$/.test(n)?(n=n.split(":"),e.port=n.pop(),e.hostname=n.join(":")):(e.hostname=n,e.port="");break;case"protocol":e.protocol=n.toLowerCase(),e.slashes=!r;break;case"pathname":case"hash":if(n){var o="pathname"===t?"/":"#";e[t]=n.charAt(0)!==o?o+n:n}else e[t]=n;break;default:e[t]=n}for(var u=0;u<v.length;u++){var i=v[u];i[4]&&(e[i[1]]=e[i[1]].toLowerCase())}return e.origin=e.protocol&&e.host&&"file:"!==e.protocol?e.protocol+"//"+e.host:"null",e.href=e.toString(),e}function o(t){t&&"function"==typeof t||(t=y.stringify);var n,r=this,e=r.protocol;e&&":"!==e.charAt(e.length-1)&&(e+=":");var o=e+(r.slashes?"//":"");return r.username&&(o+=r.username,r.password&&(o+=":"+r.password),o+="@"),o+=r.host+r.pathname,(n="object"==typeof r.query?t(r.query):r.query)&&(o+="?"!==n.charAt(0)?"?"+n:n),r.hash&&(o+=r.hash),o}b.prototype={set:e,toString:o},b.extractProtocol=m,b.location=g,b.trimLeft=d,b.qs=y,u.exports=b}).call(this,f(22))},function(t,n,r){t.exports={Either:r(25),Future:r(52),Identity:r(15),IO:r(55),lift2:r(62),lift3:r(63),Maybe:r(64),Reader:r(65),State:r(69),Tuple:r(18)}},function(t,n,r){t.exports=r(70)},function(t,n){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,n,r){"use strict";t.exports=function t(n,r){if(r=r.split(":")[0],!(n=+n))return!1;switch(r){case"http":case"ws":return 80!==n;case"https":case"wss":return 443!==n;case"ftp":return 21!==n;case"gopher":return 70!==n;case"file":return!1}return 0!==n}},function(t,n,r){"use strict";var u=Object.prototype.hasOwnProperty,i;function c(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function e(t){try{return encodeURIComponent(t)}catch(t){return}}function o(t){for(var n=/([^=?&]+)=?([^&]*)/g,r={},e;e=n.exec(t);){var o=c(e[1]),u=c(e[2]);null===o||null===u||o in r||(r[o]=u)}return r}function a(t,n){n=n||"";var r=[],e,o;for(o in"string"!=typeof n&&(n="?"),t)if(u.call(t,o)){if((e=t[o])||null!==e&&e!==i&&!isNaN(e)||(e=""),o=encodeURIComponent(o),e=encodeURIComponent(e),null===o||null===e)continue;r.push(o+"="+e)}return r.length?n+r.join("&"):""}n.stringify=a,n.parse=o},function(t,n,r){var e=r(5),o=r(2),u=r(3);function i(n,t){switch(arguments.length){case 0:throw new TypeError("no arguments to Either");case 1:return function(t){return null==t?i.Left(n):i.Right(t)};default:return null==t?i.Left(n):i.Right(t)}}function c(t){this.value=t}function a(t){this.value=t}i.prototype["@@type"]="ramda-fantasy/Either",i.prototype.map=u.returnThis,i.of=i.prototype.of=function(t){return i.Right(t)},i.prototype.chain=u.returnThis,i.either=e(function t(n,r,e){if(e instanceof a)return n(e.value);if(e instanceof c)return r(e.value);throw new TypeError("invalid type given to Either.either")}),i.isLeft=function(t){return t.isLeft},i.isRight=function(t){return t.isRight},u.extend(c,i),c.prototype.isRight=!0,c.prototype.isLeft=!1,c.prototype.map=function(t){return new c(t(this.value))},c.prototype.ap=function(t){return t.map(this.value)},c.prototype.chain=function(t){return t(this.value)},i.chainRec=i.prototype.chainRec=function(t,n){for(var r,e=u.chainRecNext(n);e.isNext;){if(r=t(u.chainRecNext,u.chainRecDone,e.value),i.isLeft(r))return r;e=r.value}return i.Right(e.value)},c.prototype.bimap=function(t,n){return new c(n(this.value))},c.prototype.extend=function(t){return new c(t(this))},c.prototype.toString=function(){return"Either.Right("+o(this.value)+")"},c.prototype.equals=u.getEquals(c),i.Right=function(t){return new c(t)},u.extend(a,i),a.prototype.isLeft=!0,a.prototype.isRight=!1,a.prototype.ap=u.returnThis,a.prototype.bimap=function(t){return new a(t(this.value))},a.prototype.extend=u.returnThis,a.prototype.toString=function(){return"Either.Left("+o(this.value)+")"},a.prototype.equals=u.getEquals(a),i.Left=function(t){return new a(t)},i.prototype.either=function t(n,r){return(this.isLeft?n:r)(this.value)},t.exports=i},function(t,n,r){var a=r(4),f=r(6);function s(u,i,c){return function(){for(var t=[],n=0,r=u,e=0;e<i.length||n<arguments.length;){var o;e<i.length&&(!f(i[e])||arguments.length<=n)?o=i[e]:(o=arguments[n],n+=1),t[e]=o,f(o)||--r,e+=1}return r<=0?c.apply(this,t):a(r,s(u,t,c))}}t.exports=s},function(t,n,r){var u=r(28),i=r(37),c=r(38),a=r(39),f=r(10),s=r(40);function p(e,o){var r=function t(n){var r=o.concat([e]);return u(n,r)?"<Circular>":p(n,r)},t=function(n,t){return i(function(t){return c(t)+": "+r(n[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+i(r,e).join(", ")+"))";case"[object Array]":return"["+i(r,e).concat(t(e,s(function(t){return/^\d+$/.test(t)},f(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+r(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?r(NaN):c(a(e)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+r(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object String]":return"object"==typeof e?"new String("+r(e.valueOf())+")":c(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var n=e.toString();if("[object Object]"!==n)return n}return"{"+t(e,f(e)).join(", ")+"}"}}t.exports=p},function(t,n,r){var e=r(29);function o(t,n){return 0<=e(n,t,0)}t.exports=o},function(t,n,r){var u=r(8);function e(t,n,r){var e,o;if("function"==typeof t.indexOf)switch(typeof n){case"number":if(0===n){for(e=1/n;r<t.length;){if(0===(o=t[r])&&1/o==e)return r;r+=1}return-1}if(n==n)return t.indexOf(n,r);for(;r<t.length;){if("number"==typeof(o=t[r])&&o!=o)return r;r+=1}return-1;case"string":case"boolean":case"function":case"undefined":return t.indexOf(n,r);case"object":if(null===n)return t.indexOf(n,r)}for(;r<t.length;){if(u(t[r],n))return r;r+=1}return-1}t.exports=e},function(t,n,r){var c=r(31),a=r(32),s=r(33),p=r(9),l=r(34),h=r(10),y=r(36);function d(t,n,r,e){var o=c(t),u=c(n);function i(t,n){return v(t,n,r.slice(),e.slice())}return!a(function(t,n){return!a(i,n,t)},u,o)}function v(t,n,r,e){if(l(t,n))return!0;var o=y(t);if(o!==y(n))return!1;if(null==t||null==n)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===s(t.constructor))return t===n;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof n||!l(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!l(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1}for(var u=r.length-1;0<=u;){if(r[u]===t)return e[u]===n;--u}switch(o){case"Map":return t.size!==n.size?!1:d(t.entries(),n.entries(),r.concat([t]),e.concat([n]));case"Set":return t.size!==n.size?!1:d(t.values(),n.values(),r.concat([t]),e.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var i=h(t);if(i.length!==h(n).length)return!1;var c=r.concat([t]),a=e.concat([n]);for(u=i.length-1;0<=u;){var f=i[u];if(!p(f,n)||!v(n[f],t[f],c,a))return!1;--u}return!0}t.exports=v},function(t,n){function r(t){for(var n=[],r;!(r=t.next()).done;)n.push(r.value);return n}t.exports=r},function(t,n){function r(t,n,r){for(var e=0,o=r.length;e<o;){if(t(n,r[e]))return!0;e+=1}return!1}t.exports=r},function(t,n){function r(t){var n=String(t).match(/^function (\w*)/);return null==n?"":n[1]}t.exports=r},function(t,n){function r(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}t.exports="function"==typeof Object.is?Object.is:r},function(t,n,r){var e=r(9),o=Object.prototype.toString,u=function(){return"[object Arguments]"===o.call(arguments)?function t(n){return"[object Arguments]"===o.call(n)}:function t(n){return e("callee",n)}}();t.exports=u},function(t,n,r){var e,o=r(0)(function t(n){return null===n?"Null":void 0===n?"Undefined":Object.prototype.toString.call(n).slice(8,-1)});t.exports=o},function(t,n){function r(t,n){for(var r=0,e=n.length,o=Array(e);r<e;)o[r]=t(n[r]),r+=1;return o}t.exports=r},function(t,n){function r(t){var n;return'"'+t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}t.exports=r},function(t,n){var r=function t(n){return(n<10?"0":"")+n},e="function"==typeof Date.prototype.toISOString?function t(n){return n.toISOString()}:function t(n){return n.getUTCFullYear()+"-"+r(n.getUTCMonth()+1)+"-"+r(n.getUTCDate())+"T"+r(n.getUTCHours())+":"+r(n.getUTCMinutes())+":"+r(n.getUTCSeconds())+"."+(n.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};t.exports=e},function(t,n,r){var e=r(41),o=r(1),u=r(42),i=o(function t(n,r){return u(e(n),r)});t.exports=i},function(t,n){function r(t){return function(){return!t.apply(this,arguments)}}t.exports=r},function(t,n,r){var e=r(1),o=r(43),u=r(45),i=r(46),c=r(13),a=r(50),f=r(10),s=e(o(["filter"],a,function(r,e){return i(e)?c(function(t,n){return r(e[n])&&(t[n]=e[n]),t},{},f(e)):u(r,e)}));t.exports=s},function(t,n,r){var c=r(11),a=r(44);function e(o,u,i){return function(){if(0===arguments.length)return i();var t=Array.prototype.slice.call(arguments,0),n=t.pop();if(!c(n)){for(var r=0,e;r<o.length;){if("function"==typeof n[o[r]])return n[o[r]].apply(n,t);r+=1}if(a(n))return u.apply(null,t)(n)}return i.apply(this,arguments)}}t.exports=e},function(t,n){function r(t){return null!=t&&"function"==typeof t["@@transducer/step"]}t.exports=r},function(t,n){function r(t,n){for(var r=0,e=n.length,o=[];r<e;)t(n[r])&&(o[o.length]=n[r]),r+=1;return o}t.exports=r},function(t,n){function r(t){return"[object Object]"===Object.prototype.toString.call(t)}t.exports=r},function(t,n,r){var e=r(0),o=r(11),u=r(14),i=e(function t(n){return!!o(n)||!!n&&("object"==typeof n&&(!u(n)&&(1===n.nodeType?!!n.length:0===n.length||0<n.length&&(n.hasOwnProperty(0)&&n.hasOwnProperty(n.length-1)))))});t.exports=i},function(t,n){var r=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,n){return this.f(t,n)},t}();function e(t){return new r(t)}t.exports=e},function(t,n,r){var e=r(4),o,u=r(1)(function t(n,r){return e(n.length,function(){return n.apply(r,arguments)})});t.exports=u},function(t,n,r){var e=r(1),o=r(51),u=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=o.init,t.prototype["@@transducer/result"]=o.result,t.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):t},t}(),i=e(function t(n,r){return new u(n,r)});t.exports=i},function(t,n){t.exports={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}}},function(t,n,r){var a=r(53),f=r(54),e=r(2),s=r(5),p=r(3);function l(n,r){return function(t){try{return r(t)}catch(t){n(t)}}}function h(t){if(!(this instanceof h))return new h(t);this._fork=t}h.prototype["@@type"]="ramda-fantasy/Future",h.prototype.fork=function(t,n){this._fork(t,l(t,n))},h.prototype.map=function(n){return this.chain(function(t){return h.of(n(t))})},h.prototype.ap=function(i){var c=this;return new h(function(t,n){var r,e,o=a(t),u=l(o,function(){if(null!=r&&null!=e)return n(r(e))});c._fork(o,function(t){r=t,u()}),i._fork(o,function(t){e=t,u()})})},h.prototype.of=h.of=function(r){return new h(function(t,n){return n(r)})},h.prototype.chain=function(e){return new h(function(n,r){return this._fork(function(t){return n(t)},l(n,function(t){return e(t)._fork(n,r)}))}.bind(this))},h.chainRec=h.prototype.chainRec=function(c,t){return h(function(u,i){return function n(t){for(var r=null,e=p.chainRecNext(t),o=function(t){null===r?(r=!0,e=t):(t.isNext?n:i)(t.value)};e.isNext;)if(r=null,c(p.chainRecNext,p.chainRecDone,e.value).fork(u,o),!0!==r)return void(r=!1);i(e.value)}(t)})},h.prototype.chainReject=function(e){return new h(function(n,r){return this._fork(l(n,function(t){return e(t)._fork(n,r)}),function(t){return r(t)})}.bind(this))},h.prototype.bimap=function(e,o){var t=this;return new h(function(n,r){t._fork(l(n,function(t){n(e(t))}),l(n,function(t){r(o(t))}))})},h.reject=function(n){return new h(function(t){t(n)})},h.prototype.toString=function(){return"Future("+e(this._fork)+")"},h.cache=function(r){var e="IDLE",o=[],u,i=s(function(t,n,r){e=t,n(u=r),f(function(t){t[e](u)},o)});function c(t,n){o.push({REJECTED:t,RESOLVED:n})}function a(t,n){return e="PENDING",r._fork(i("REJECTED",t),i("RESOLVED",n))}return new h(function(t,n){switch(e){case"IDLE":a(t,n);break;case"PENDING":c(t,n);break;case"REJECTED":t(u);break;case"RESOLVED":n(u)}})},t.exports=h},function(t,n,r){var o=r(4),e,u=r(0)(function t(n){var r=!1,e;return o(n.length,function(){return r?e:(r=!0,e=n.apply(this,arguments))})});t.exports=u},function(t,n,r){var e=r(12),o,u=r(1)(e("forEach",function t(n,r){for(var e=r.length,o=0;o<e;)n(r[o]),o+=1;return r}));t.exports=u},function(t,n,r){var e=r(16),o=r(2),u=r(3);function i(t){if(!(this instanceof i))return new i(t);this.fn=t}(t.exports=i).prototype["@@type"]="ramda-fantasy/IO",i.prototype.chain=function(n){var r=this;return new i(function(){var t=n(r.fn.apply(r,arguments));return t.fn.apply(t,arguments)})},i.chainRec=i.prototype.chainRec=function(n,r){return new i(function(){for(var t=u.chainRecNext(r);t.isNext;)t=n(u.chainRecNext,u.chainRecDone,t.value).fn();return t.value})},i.prototype.map=function(t){var n;return new i(e(t,this.fn))},i.prototype.ap=function(n){return this.chain(function(t){return n.map(t)})},i.runIO=function(t){return t.runIO.apply(t,[].slice.call(arguments,1))},i.prototype.runIO=function(){return this.fn.apply(this,arguments)},i.of=i.prototype.of=function(t){return new i(function(){return t})},i.prototype.toString=function(){return"IO("+o(this.fn)+")"}},function(t,n,r){var e=r(4),o=r(57),u=r(58),i=r(59);function c(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return e(arguments[0].length,u(o,arguments[0],i(arguments)))}t.exports=c},function(t,n){function r(t,n){return function(){return n.call(this,t.apply(this,arguments))}}t.exports=r},function(t,n,r){var e,o,u=r(17)(r(13));t.exports=u},function(t,n,r){var e=r(12),o,u,i=r(0)(e("tail",r(60)(1,1/0)));t.exports=i},function(t,n,r){var e=r(12),o,u=r(17)(e("slice",function t(n,r,e){return Array.prototype.slice.call(e,n,r)}));t.exports=u},function(t,n,r){var e=r(0),o=r(14),u=e(function t(n){return o(n)?n.split("").reverse().join(""):Array.prototype.slice.call(n,0).reverse()});t.exports=u},function(t,n,r){var e=r(7);t.exports=e(3,function t(n,r,e){return r.map(n).ap(e)})},function(t,n,r){var e=r(7);t.exports=e(4,function t(n,r,e,o){return r.map(n).ap(e).ap(o)})},function(t,n,r){var e=r(2),o=r(5),u=r(3);function i(t){return null==t?f:i.Just(t)}function c(t){this.value=t}function a(){}i.prototype["@@type"]="ramda-fantasy/Maybe",u.extend(c,i),c.prototype.isJust=!0,c.prototype.isNothing=!1,u.extend(a,i),a.prototype.isNothing=!0,a.prototype.isJust=!1;var f=new a;i.Nothing=function(){return f},i.of=i.Just=function(t){return new c(t)},i.prototype.of=i.Just,i.isJust=function(t){return t.isJust},i.isNothing=function(t){return t.isNothing},i.maybe=o(function(t,r,n){return n.reduce(function(t,n){return r(n)},t)}),i.toMaybe=i,c.prototype.concat=function(t){return t.isNothing?this:this.of(this.value.concat(t.value))},a.prototype.concat=u.identity,c.prototype.map=function(t){return this.of(t(this.value))},a.prototype.map=u.returnThis,c.prototype.ap=function(t){return t.map(this.value)},a.prototype.ap=u.returnThis,c.prototype.chain=u.baseMap,a.prototype.chain=u.returnThis,i.chainRec=i.prototype.chainRec=function(t,n){for(var r,e=u.chainRecNext(n);e.isNext;){if(r=t(u.chainRecNext,u.chainRecDone,e.value),i.isNothing(r))return r;e=r.value}return i.Just(e.value)},c.prototype.datatype=c,a.prototype.datatype=a,c.prototype.equals=u.getEquals(c),a.prototype.equals=function(t){return t===f},i.prototype.isNothing=function(){return this===f},i.prototype.isJust=function(){return this instanceof c},c.prototype.getOrElse=function(){return this.value},a.prototype.getOrElse=function(t){return t},c.prototype.reduce=function(t,n){return t(n,this.value)},a.prototype.reduce=function(t,n){return n},c.prototype.toString=function(){return"Maybe.Just("+e(this.value)+")"},a.prototype.toString=function(){return"Maybe.Nothing()"},t.exports=i},function(t,n,r){var e=r(16),o=r(66),u=r(2),i=r(68);function c(t){if(!(this instanceof c))return new c(t);this.run=t}c.run=function(t){return t.run.apply(t,[].slice.call(arguments,1))},c.prototype["@@type"]="ramda-fantasy/Reader",c.prototype.chain=function(n){var r=this;return new c(function(t){return n(r.run(t)).run(t)})},c.prototype.ap=function(n){return this.chain(function(t){return n.map(t)})},c.prototype.map=function(n){return this.chain(function(t){return c.of(n(t))})},c.of=c.prototype.of=function(t){return new c(function(){return t})},c.ask=c(o),c.prototype.toString=function(){return"Reader("+u(this.run)+")"},c.T=function(n){var o=function t(n){if(!(this instanceof t))return new t(n);this.run=n};return o.lift=e(o,i),o.ask=o(n.of),o.prototype.of=o.of=function(t){return o(function(){return n.of(t)})},o.prototype.chain=function(r){var e=this;return o(function(n){var t;return e.run(n).chain(function(t){return r(t).run(n)})})},o.prototype.map=function(n){return this.chain(function(t){return o.of(n(t))})},o.prototype.ap=function(n){var r=this;return o(function(t){return r.run(t).ap(n.run(t))})},o.prototype.toString=function(){return"ReaderT["+n.name+"]("+u(this.run)+")"},o},t.exports=c},function(t,n,r){var e,o,u=r(0)(r(67));t.exports=u},function(t,n){function r(t){return t}t.exports=r},function(t,n,r){var e,o=r(0)(function t(n){return function(){return n}});t.exports=o},function(t,n,r){var u=r(5),e=r(15),i=r(18),c=r(3);function o(e){function o(t){if(!(this instanceof o))return new o(t);this._run=t}return o.prototype.run=function(t){return this._run(t)},o.prototype.eval=function(t){return i.fst(this.run(t))},o.prototype.exec=function(t){return i.snd(this.run(t))},o.prototype.chain=function(n){var r=this;return o(function(t){return r._run(t).chain(function(t){return n(i.fst(t))._run(i.snd(t))})})},o.of=o.prototype.of=function(n){return o(function(t){return e.of(i(n,t))})},o.prototype.ap=c.deriveAp(o),o.prototype.map=c.deriveMap(o),o.tailRec=u(function(n,r){return o(function(t){return e.tailRec(function(t){return n(i.fst(t))._run(i.snd(t)).chain(function(n){return e.of(i.fst(n).bimap(function(t){return i(t,i.snd(n))},function(t){return i(t,i.snd(n))}))})},i(r,t))})}),o.lift=function(t){return o(function(n){return t.chain(function(t){return e.of(i(t,n))})})},o.get=o(function(t){return e.of(i(t,t))}),o.gets=function(n){return o(function(t){return e.of(i(n(t),t))})},o.put=function(n){return o(function(t){return e.of(i(void 0,n))})},o.modify=function(n){return o(function(t){return e.of(i(void 0,n(t)))})},o}var a=o(e);a.T=o,a.prototype.run=function(t){return this._run(t).value},t.exports=a},function(t,n,r){"use strict";function i(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function c(r){return function t(n){return 0===arguments.length||i(n)?t:r.apply(this,arguments)}}function a(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return i(n)?t:c(function(t){return e(n,t)});default:return i(n)&&i(r)?t:i(n)?c(function(t){return e(t,r)}):i(r)?c(function(t){return e(n,t)}):e(n,r)}}}function f(t){for(var n=[],r;!(r=t.next()).done;)n.push(r.value);return n}function s(t,n,r){for(var e=0,o=r.length;e<o;){if(t(n,r[e]))return 1;e+=1}}function p(t){var n=String(t).match(/^function (\w*)/);return null==n?"":n[1]}function l(t,n){return Object.prototype.hasOwnProperty.call(n,t)}function e(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}r.r(n);var h="function"==typeof Object.is?Object.is:e,o=Object.prototype.toString,u,y=function(){return"[object Arguments]"===o.call(arguments)?function t(n){return"[object Arguments]"===o.call(n)}:function t(n){return l("callee",n)}}(),d=!{toString:null}.propertyIsEnumerable("toString"),v=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],g=function(){return arguments.propertyIsEnumerable("length")}(),m=function t(n,r){for(var e=0;e<n.length;){if(n[e]===r)return!0;e+=1}return!1},x,b="function"!=typeof Object.keys||g?c(function t(n){if(Object(n)!==n)return[];var r,e,o=[],u=g&&y(n);for(r in n)!l(r,n)||u&&"length"===r||(o[o.length]=r);if(d)for(e=v.length-1;0<=e;)l(r=v[e],n)&&!m(o,r)&&(o[o.length]=r),--e;return o}):c(function t(n){return Object(n)!==n?[]:Object.keys(n)}),w,E=c(function t(n){return null===n?"Null":void 0===n?"Undefined":Object.prototype.toString.call(n).slice(8,-1)});function A(t,n,r,e){var o=f(t),u;function i(t,n){return O(t,n,r.slice(),e.slice())}return!s(function(t,n){return!s(i,n,t)},f(n),o)}function O(t,n,r,e){if(h(t,n))return!0;var o=E(t);if(o!==E(n))return!1;if(null==t||null==n)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===p(t.constructor))return t===n;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof n||!h(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!h(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1}for(var u=r.length-1;0<=u;){if(r[u]===t)return e[u]===n;--u}switch(o){case"Map":return t.size!==n.size?!1:A(t.entries(),n.entries(),r.concat([t]),e.concat([n]));case"Set":return t.size!==n.size?!1:A(t.values(),n.values(),r.concat([t]),e.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var i=b(t);if(i.length!==b(n).length)return!1;var c=r.concat([t]),a=e.concat([n]);for(u=i.length-1;0<=u;){var f=i[u];if(!l(f,n)||!O(n[f],t[f],c,a))return!1;--u}return!0}var j,R=a(function t(n,r){return O(n,r,[],[])}),S=Array.isArray||function t(n){return null!=n&&0<=n.length&&"[object Array]"===Object.prototype.toString.call(n)};function N(t){return null!=t&&"function"==typeof t["@@transducer/step"]}function C(o,u,i){return function(){if(0===arguments.length)return i();var t=Array.prototype.slice.call(arguments,0),n=t.pop();if(!S(n)){for(var r=0,e;r<o.length;){if("function"==typeof n[o[r]])return n[o[r]].apply(n,t);r+=1}if(N(n))return u.apply(null,t)(n)}return i.apply(this,arguments)}}function T(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var k=function(){return this.xf["@@transducer/init"]()},q=function(t){return this.xf["@@transducer/result"](t)},I=function(){function t(t,n){this.xf=n,this.f=t,this.found=!1}return t.prototype["@@transducer/init"]=k,t.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,void 0)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.found=!0,t=T(this.xf["@@transducer/step"](t,n))),t},t}(),D,P,_,L=a(C(["find"],a(function t(n,r){return new I(n,r)}),function t(n,r){for(var e=0,o=r.length;e<o;){if(n(r[e]))return r[e];e+=1}})),M,U=a(function t(n,r){return null==r||r!=r?n:r}),F,J=a(function t(n,r){var e=r instanceof Array?[]:{},o,u,i;for(u in r)i=typeof(o=n[u]),e[u]="function"==i?o(r[u]):o&&"object"==i?t(o,r[u]):r[u];return e});function $(t,n){var r,e=(t=t||[]).length,o=(n=n||[]).length,u=[];for(r=0;r<e;)u[u.length]=t[r],r+=1;for(r=0;r<o;)u[u.length]=n[r],r+=1;return u}var z,B=a(function t(n,r){return $(r,[n])});function H(u){return function t(r,e,o){switch(arguments.length){case 0:return t;case 1:return i(r)?t:a(function(t,n){return u(r,t,n)});case 2:return i(r)&&i(e)?t:i(r)?a(function(t,n){return u(t,e,n)}):i(e)?a(function(t,n){return u(r,t,n)}):c(function(t){return u(r,e,t)});default:return i(r)&&i(e)&&i(o)?t:i(r)&&i(e)?a(function(t,n){return u(t,n,o)}):i(r)&&i(o)?a(function(t,n){return u(t,e,n)}):i(e)&&i(o)?a(function(t,n){return u(r,t,n)}):i(r)?c(function(t){return u(t,e,o)}):i(e)?c(function(t){return u(r,t,o)}):i(o)?c(function(t){return u(r,e,t)}):u(r,e,o)}}}var G,V=H(function t(n,r,e){var o={};for(var u in e)o[u]=e[u];return o[n]=r,o}),W=r(19),Z=r.n(W),X=function t(n,r){var e=1<arguments.length&&void 0!==r?r:"";return n?t(--n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".charAt(Math.floor(60*Math.random()))+e):e},K="framework",Q="preload",Y="childapp",tt=["style","link","script"],nt=/\.css$/,rt=/\.js$/,et="__MICRO_ROOT_DATA__";function ot(t){return ct(t)||it(t)||ut()}function ut(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function it(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function ct(t){if(Array.isArray(t)){for(var n=0,r=new Array(t.length);n<t.length;n++)r[n]=t[n];return r}}var at=function t(n){return"".concat(K,"-").concat(n)},ft=document.head||document.getElementsByTagName("head")[0],st=function t(e){return new Promise(function(t,n){var r=document.createElement("script");r.type="text/javascript",r.setAttribute(at("script"),Y),r.src=e,r.async=!1,r.onload=function(){return t(e)},r.onerror=function(t){return n({url:e,error:t})},ft.appendChild(r)})},pt=(lt={},ht=eval,function t(n,r){var e;return(lt[n]?Promise.resolve(lt[n]):fetch(n).then(function(t){return t.text()})).then(function(t){lt[n]=t,window.proxy=r;try{ht(";(function(window){;\n".concat(t,"\n}).bind(window.proxy)(window.proxy);"))}catch(t){throw console.error(t),console.error("error occurs when eval ".concat(n)),t}})}),lt,ht,yt=function t(n,r){return r?pt(n,r):st(n)},dt=function t(e){return new Promise(function(t,n){var r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.setAttribute(at("link"),Y),r.href=e,r.onload=function(){return t(e)},r.onerror=function(t){return n({url:e,error:t})},ft.appendChild(r)})},vt=function t(){tt.forEach(function(n){var t;ot(document.getElementsByTagName(n)).forEach(function(t){return t.setAttribute(at(n),Q)})})},gt=function t(){tt.forEach(function(n){var t;ot(document.getElementsByTagName(n)).forEach(function(t){return t.removeAttribute(at(n))})})},mt=function t(){tt.forEach(function(t){var n;ot(document.querySelectorAll("".concat(t,":not([").concat(at(t),"='").concat(Q,"'])"))).forEach(function(t){return t.parentNode&&t.parentNode.removeChild(t)})})},xt=function t(n,r,e,o,u){var i=[],c=[];("string"==typeof n?[n]:n).filter(function(t){return!!t}).forEach(function(t){nt.test(t)?i.push(t):rt.test(t)&&c.push(t)}),i.length&&Promise.all(i.map(dt)).then(o).catch(u),c.length&&Promise.all(c.map(function(t){return yt(t,r)})).then(e).catch(u)};function bt(t){for(var n=[],r=0;r<t.length;){var e=t[r];if("*"!==e&&"+"!==e&&"?"!==e)if("\\"!==e)if("{"!==e)if("}"!==e)if(":"!==e)if("("!==e)n.push({type:"CHAR",index:r,value:t[r++]});else{var o=1,u="",i;if("?"===t[i=r+1])throw new TypeError('Pattern cannot start with "?" at '+i);for(;i<t.length;)if("\\"!==t[i]){if(")"===t[i]){if(0===--o){i++;break}}else if("("===t[i]&&(o++,"?"!==t[i+1]))throw new TypeError("Capturing groups are not allowed at "+i);u+=t[i++]}else u+=t[i++]+t[i++];if(o)throw new TypeError("Unbalanced pattern at "+r);if(!u)throw new TypeError("Missing pattern at "+r);n.push({type:"PATTERN",index:r,value:u}),r=i}else{for(var c="",i=r+1;i<t.length;){var a=t.charCodeAt(i);if(!(48<=a&&a<=57||65<=a&&a<=90||97<=a&&a<=122||95===a))break;c+=t[i++]}if(!c)throw new TypeError("Missing parameter name at "+r);n.push({type:"NAME",index:r,value:c}),r=i}else n.push({type:"CLOSE",index:r,value:t[r++]});else n.push({type:"OPEN",index:r,value:t[r++]});else n.push({type:"ESCAPED_CHAR",index:r++,value:t[r++]});else n.push({type:"MODIFIER",index:r,value:t[r++]})}return n.push({type:"END",index:r,value:""}),n}function wt(t,n){void 0===n&&(n={});for(var u=bt(t),r=n.prefixes,e=void 0===r?"./":r,o="[^"+Rt(n.delimiter||"/#?")+"]+?",i=[],c=0,a=0,f="",s=function(t){if(a<u.length&&u[a].type===t)return u[a++].value},p=function(t){var n=s(t);if(void 0!==n)return n;var r=u[a],e=r.type,o=r.index;throw new TypeError("Unexpected "+e+" at "+o+", expected "+t)},l=function(){for(var t="",n;n=s("CHAR")||s("ESCAPED_CHAR");)t+=n;return t};a<u.length;){var h=s("CHAR"),y=s("NAME"),d=s("PATTERN");if(y||d){var v=h||"";-1===e.indexOf(v)&&(f+=v,v=""),f&&(i.push(f),f=""),i.push({name:y||c++,prefix:v,suffix:"",pattern:d||o,modifier:s("MODIFIER")||""})}else{var g=h||s("ESCAPED_CHAR"),m;if(g)f+=g;else if(f&&(i.push(f),f=""),s("OPEN")){var v=l(),x=s("NAME")||"",b=s("PATTERN")||"",w=l();p("CLOSE"),i.push({name:x||(b?c++:""),pattern:x&&!b?o:b,prefix:v,suffix:w,modifier:s("MODIFIER")||""})}else p("END")}}return i}function Et(t,n){return At(wt(t,n),n)}function At(s,t){void 0===t&&(t={});var n=St(t),r=t.encode,p=void 0===r?function(t){return t}:r,e=t.validate,l=void 0===e||e,h=s.map(function(t){if("object"==typeof t)return new RegExp("^(?:"+t.pattern+")$",n)});return function(t){for(var n="",r=0;r<s.length;r++){var e=s[r];if("string"!=typeof e){var o=t?t[e.name]:void 0,u="?"===e.modifier||"*"===e.modifier,i="*"===e.modifier||"+"===e.modifier;if(Array.isArray(o)){if(!i)throw new TypeError('Expected "'+e.name+'" to not repeat, but got an array');if(0===o.length){if(u)continue;throw new TypeError('Expected "'+e.name+'" to not be empty')}for(var c=0;c<o.length;c++){var a=p(o[c],e);if(l&&!h[r].test(a))throw new TypeError('Expected all "'+e.name+'" to match "'+e.pattern+'", but got "'+a+'"');n+=e.prefix+a+e.suffix}}else if("string"!=typeof o&&"number"!=typeof o){if(!u){var f=i?"an array":"a string";throw new TypeError('Expected "'+e.name+'" to be '+f)}}else{var a=p(String(o),e);if(l&&!h[r].test(a))throw new TypeError('Expected "'+e.name+'" to match "'+e.pattern+'", but got "'+a+'"');n+=e.prefix+a+e.suffix}}else n+=e}return n}}function Ot(t,n){var r=[],e;return jt(qt(t,r,n),r,n)}function jt(c,a,t){void 0===t&&(t={});var n=t.decode,f=void 0===n?function(t){return t}:n;return function(t){var r=c.exec(t);if(!r)return!1;for(var n=r[0],e=r.index,o=Object.create(null),u=function(t){if(void 0===r[t])return"continue";var n=a[t-1];"*"===n.modifier||"+"===n.modifier?o[n.name]=r[t].split(n.prefix+n.suffix).map(function(t){return f(t,n)}):o[n.name]=f(r[t],n)},i=1;i<r.length;i++)u(i);return{path:n,index:e,params:o}}}function Rt(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function St(t){return t&&t.sensitive?"":"i"}function Nt(t,n){if(!n)return t;var r=t.source.match(/\((?!\?)/g);if(r)for(var e=0;e<r.length;e++)n.push({name:e,prefix:"",suffix:"",modifier:"",pattern:""});return t}function Ct(t,n,r){var e=t.map(function(t){return qt(t,n,r).source});return new RegExp("(?:"+e.join("|")+")",St(r))}function Tt(t,n,r){return kt(wt(t,r),n,r)}function kt(t,n,r){void 0===r&&(r={});for(var e=r.strict,o=void 0!==e&&e,u=r.start,i=void 0===u||u,c=r.end,a=void 0===c||c,f=r.encode,s=void 0===f?function(t){return t}:f,p="["+Rt(r.endsWith||"")+"]|$",l="["+Rt(r.delimiter||"/#?")+"]",h=i?"^":"",y=0,d=t;y<d.length;y++){var v=d[y];if("string"==typeof v)h+=Rt(s(v));else{var g=Rt(s(v.prefix)),m=Rt(s(v.suffix));if(v.pattern)if(n&&n.push(v),g||m)if("+"===v.modifier||"*"===v.modifier){var x="*"===v.modifier?"?":"";h+="(?:"+g+"((?:"+v.pattern+")(?:"+m+g+"(?:"+v.pattern+"))*)"+m+")"+x}else h+="(?:"+g+"("+v.pattern+")"+m+")"+v.modifier;else h+="("+v.pattern+")"+v.modifier;else h+="(?:"+g+m+")"+v.modifier}}if(a)o||(h+=l+"?"),h+=r.endsWith?"(?="+p+")":"$";else{var b=t[t.length-1],w="string"==typeof b?-1<l.indexOf(b[b.length-1]):void 0===b;o||(h+="(?:"+l+"(?="+p+"))?"),w||(h+="(?="+l+"|"+p+")")}return new RegExp(h,St(r))}function qt(t,n,r){return t instanceof RegExp?Nt(t,n):(Array.isArray(t)?Ct:Tt)(t,n,r)}function It(t){return _t(t)||Pt(t)||Dt()}function Dt(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Pt(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function _t(t){if(Array.isArray(t))return t}var Lt={},Mt=1e4,Ut=0;function Ft(t,n){var r="".concat(n.end).concat(n.strict).concat(n.sensitive),e=Lt[r]||(Lt[r]={});if(e[t])return e[t];var o=[],u,i={regexp:qt(t,o,n),keys:o};return Ut<Mt&&(e[t]=i,Ut++),i}function Jt(s){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof t&&!Array.isArray(t)||(t={path:t});var n=t,r=t.path,e=t.exact,p=void 0!==e&&e,o=t.strict,l=void 0!==o&&o,u=t.sensitive,h=void 0!==u&&u,i;return[].concat(r).reduce(function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=Ft(n,{end:p,strict:l,sensitive:h}),e=r.regexp,o=r.keys,u=e.exec(s);if(!u)return null;var i=It(u),c=i[0],a=i.slice(1),f=s===c;return p&&!f?null:{path:n,url:"/"===n&&""===c?"/":c,isExact:f,params:o.reduce(function(t,n,r){return t[n.name]=a[r],t},{})}},null)}var $t=Jt,zt=r(20),Bt=function t(n){return Object(zt.Identity)(n)};function Ht(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}r.d(n,"FrameworkImpl",function(){return Gt}),r.d(n,"create",function(){return Vt}),r.d(n,"register",function(){return nn}),r.d(n,"registerNotFound",function(){return rn}),r.d(n,"registerError",function(){return en}),r.d(n,"root",function(){return on}),r.d(n,"setGlobal",function(){return un}),r.d(n,"onChildEnter",function(){return cn}),r.d(n,"onChildLeave",function(){return an}),r.d(n,"exit",function(){return fn}),r.d(n,"start",function(){return sn}),r.d(n,"redirect",function(){return pn}),r.d(n,"createMonad",function(){return Bt});var Gt=function t(){Ht(this,t),this.children=[],this.$root=document.body},Vt=function t(){var n=new Gt;return Bt(n)},Wt=function t(n){n.currentChild&&n.currentChild.assets&&xt(n.currentChild.assets,n.global,function(){n.currentChild.title&&(document.title=n.currentChild.title)},function(){n.onChildEnter&&n.onChildEnter(n.currentChild)},function(){n.childError&&Xt(n.childError,n)})},Zt=function t(n){n.onChildLeave&&n.onChildLeave(n.currentChild),"function"==typeof window[et].onChildAppLeave&&window[et].onChildAppLeave()},Xt=function t(n,r){return R(r.currentChild,n)||(Zt(r),mt(),r.currentChild=n,Qt(r),Wt(r)),r},Kt=function t(n,r){var e,o=new Z.a(n).pathname;return L(function(t){return $t(o,t)},r.children)},Qt=function t(n){window[et]=Object.assign(Object.assign({},window[et]||{}),{$root:n.$root,base:n.currentChild&&n.currentChild.base||"/",onChildAppLeave:function t(){}})},Yt=function t(){delete window[et]},tn=function t(n,r){var e=U(r.childNotFound,Kt(n,r));return Xt(e,r),r},nn=function t(n){return function(t){return Bt(J({children:B(n)},t))}},rn=function t(n){return function(t){return Bt(V("childNotFound",n,t))}},en=function t(n){return function(t){return Bt(V("childError",n,t))}},on=function t(n){return function(t){return t.$root=n,Qt(t),Bt(t)}},un=function t(n){return function(t){return t.global=n,Bt(t)}},cn=function t(n){return function(t){return Bt(V("onChildEnter",n,t))}},an=function t(n){return function(t){return Bt(V("onChildLeave",n,t))}},fn=function t(n){return n.currentChild=null,Zt(n),Yt(),mt(),gt(),Bt(n)},sn=function t(n){return Qt(n),vt(),tn("/",n),Bt(n)},pn=function t(n){return function(t){return tn(n,t),Bt(t)}}}],o.c=e,o.d=function(t,n,r){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(n,t){if(1&t&&(n=o(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var e in n)o.d(r,e,function(t){return n[t]}.bind(null,e));return r},o.n=function(n){var t=n&&n.__esModule?function t(){return n.default}:function t(){return n};return o.d(t,"a",t),t},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=21);function o(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var r,e}); |
@@ -1,2 +0,2 @@ | ||
import { ChildAppData, FrameworkAPI, FrameworkCommonChain, FrameworkChildChain, FrameworkChildEventChain, FrameworkElementChain, FrameworkStringChain } from './types'; | ||
import { ChildAppData, FrameworkAPI, FrameworkCommonChain, FrameworkChildChain, FrameworkChildEventChain, FrameworkElementChain, FrameworkStringChain, FrameworkWindowChain } from './types'; | ||
export * from './types'; | ||
@@ -8,2 +8,3 @@ export declare class FrameworkImpl implements FrameworkAPI { | ||
currentChild: any; | ||
global: any; | ||
onChildEnter: (child: ChildAppData) => {}; | ||
@@ -18,2 +19,3 @@ onChildLeave: (child: ChildAppData) => {}; | ||
export declare const root: FrameworkElementChain; | ||
export declare const setGlobal: FrameworkWindowChain; | ||
export declare const onChildEnter: FrameworkChildEventChain; | ||
@@ -20,0 +22,0 @@ export declare const onChildLeave: FrameworkChildEventChain; |
@@ -21,3 +21,3 @@ import * as _ from 'ramda'; | ||
if (ins.currentChild && ins.currentChild.assets) { | ||
loadAssets(ins.currentChild.assets, () => { | ||
loadAssets(ins.currentChild.assets, ins.global, () => { | ||
ins.currentChild.title && (document.title = ins.currentChild.title); | ||
@@ -40,3 +40,2 @@ }, () => { | ||
return ins; | ||
console.log(ins.currentChild, child); | ||
leaveCurrentChild(ins); | ||
@@ -68,6 +67,10 @@ clearAssets(); | ||
export const root = (t) => (ins) => { | ||
ins = _.assoc('$root', t, ins); | ||
ins.$root = t; | ||
flushGlobalData(ins); | ||
return createMonad(ins); | ||
}; | ||
export const setGlobal = (t) => (ins) => { | ||
ins.global = t; | ||
return createMonad(ins); | ||
}; | ||
export const onChildEnter = (t) => (ins) => createMonad(_.assoc('onChildEnter', t, ins)); | ||
@@ -74,0 +77,0 @@ export const onChildLeave = (t) => (ins) => createMonad(_.assoc('onChildLeave', t, ins)); |
@@ -1,2 +0,2 @@ | ||
export declare const loadJs: (url: any) => Promise<unknown>; | ||
export declare const loadJs: (url: string, global?: Object | undefined) => Promise<unknown>; | ||
export declare const loadCss: (url: any) => Promise<unknown>; | ||
@@ -6,2 +6,2 @@ export declare const tagAssets: () => void; | ||
export declare const clearAssets: () => void; | ||
export declare const loadAssets: (assets: string | string[], onJs: any, onCss: any, onError: any) => void; | ||
export declare const loadAssets: (assets: string | string[], global: any, onJs: any, onCss: any, onError: any) => void; |
import { DYNAMIC_ID, ASSETS_TAG_NAME, REG_CSS, REG_JS, ASSETS_PRELOAD_LABEL, ASSETS_CHILDAPP_LABEL } from './constant'; | ||
const getAssetAttrName = (type) => `${DYNAMIC_ID}-${type}`; | ||
const $head = document.head || document.getElementsByTagName('head')[0]; | ||
export const loadJs = url => new Promise((resolve, reject) => { | ||
const $script = document.createElement('script'); | ||
$script.type = 'text/javascript'; | ||
$script.setAttribute(getAssetAttrName('script'), ASSETS_CHILDAPP_LABEL); | ||
$script.src = url; | ||
$script.async = false; | ||
$script.onload = () => resolve(url); | ||
$script.onerror = error => reject({ url, error }); | ||
$head.appendChild($script); | ||
}); | ||
const loadJsByScript = function loadJsByScript(url) { | ||
return new Promise((resolve, reject) => { | ||
const $script = document.createElement('script'); | ||
$script.type = 'text/javascript'; | ||
$script.setAttribute(getAssetAttrName('script'), ASSETS_CHILDAPP_LABEL); | ||
$script.src = url; | ||
$script.async = false; | ||
$script.onload = () => resolve(url); | ||
$script.onerror = error => reject({ url, error }); | ||
$head.appendChild($script); | ||
}); | ||
}; | ||
const loadJsByEval = (function () { | ||
const cache = {}; | ||
const rawEval = eval; | ||
return function loadJsByEval(url, global) { | ||
let chain = cache[url] ? Promise.resolve(cache[url]) : fetch(url).then(res => res.text()); | ||
return chain.then(text => { | ||
cache[url] = text; | ||
window.proxy = global; | ||
try { | ||
rawEval(`;(function(window){;\n${text}\n}).bind(window.proxy)(window.proxy);`); | ||
} | ||
catch (e) { | ||
console.error(e); | ||
console.error(`error occurs when eval ${url}`); | ||
throw e; | ||
} | ||
}); | ||
}; | ||
})(); | ||
export const loadJs = (url, global) => { | ||
if (!global) | ||
return loadJsByScript(url); | ||
return loadJsByEval(url, global); | ||
}; | ||
export const loadCss = url => new Promise((resolve, reject) => { | ||
@@ -42,3 +68,3 @@ const $link = document.createElement('link'); | ||
}; | ||
export const loadAssets = function (assets, onJs, onCss, onError) { | ||
export const loadAssets = function (assets, global, onJs, onCss, onError) { | ||
const cssList = []; | ||
@@ -55,3 +81,3 @@ const jsList = []; | ||
cssList.length && Promise.all(cssList.map(loadCss)).then(onCss).catch(onError); | ||
jsList.length && Promise.all(jsList.map(loadJs)).then(onJs).catch(onError); | ||
jsList.length && Promise.all(jsList.map(url => loadJs(url, global))).then(onJs).catch(onError); | ||
}; |
@@ -21,2 +21,3 @@ interface Monad<T> { | ||
} | ||
declare type Global = Window | null; | ||
export interface FrameworkAPI { | ||
@@ -26,2 +27,3 @@ children: ChildAppData[]; | ||
childError: ChildAppData; | ||
global: Global; | ||
$root: HTMLElement | null; | ||
@@ -38,2 +40,3 @@ onChildEnter: ChildEventCallback; | ||
export declare type FrameworkChildEventChain = TypedChainable<ChildEventCallback, FrameworkAPI>; | ||
export declare type FrameworkWindowChain = TypedChainable<Global, FrameworkAPI>; | ||
export declare type FrameworkChangeFunction = (t: FrameworkMonad) => void; | ||
@@ -40,0 +43,0 @@ export declare const createMonad: MonadFactory<FrameworkAPI>; |
{ | ||
"name": "@harpsealjs/framework", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "micro framework hijack", | ||
@@ -9,2 +9,3 @@ "license": "MIT", | ||
"scripts": { | ||
"watch": "../../node_modules/.bin/tsc --watch", | ||
"clean": "rm -rf ./lib && rm -rf ./dist", | ||
@@ -46,3 +47,3 @@ "build-lib": "../../node_modules/.bin/tsc", | ||
"author": "skyinlayer", | ||
"gitHead": "c23e8fe6d42ab5e21e275eb09a77a3e9c3e30d71" | ||
"gitHead": "1dd61dae2d036b51ae9e1d253d68a78c1d1415b2" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
62694
347
4