-
Notifications
You must be signed in to change notification settings - Fork 0
/
standard.min.js
1 lines (1 loc) · 21.3 KB
/
standard.min.js
1
(function(){var n={enumerable:!1,configurable:!0,writable:!0},t=this.Object.defineProperty,e=function(n){"use strict";var t=JSON.stringify(n,function(n,t){return"function"==typeof t?t.toString():t},2);return"\n>>> "+String(t).replace(/\n/g,"\n ")},r=function(n){"use strict";return void 0!==n},i=function(n){"use strict";return Array.isArray(n)},o=function(n){"use strict";return"function"==typeof n},a=function(n){"use strict";return"string"==typeof n},u=function(n){"use strict";return!!n&&n.constructor===Object},c=function(n){"use strict";if(void 0!==n)return JSON.parse(JSON.stringify(n))},s=function(n,t){"use strict";for(var r=arguments.length,i=Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];if(!n)throw new Error("@okwolo."+t+i.map(e).join(""))},d=function(){"use strict";var n=[],t=function(){var t=n[0];t&&t()};return{add:function(e){n.push(e),1===n.length&&t()},done:function(){n.shift(),t()}}},f=function(){"use strict";for(var n=arguments.length,t=Array(n),e=0;e<n;e++)t[e]=arguments[e];return t.map(function(n){return a(n)?n:i(n)?f.apply(void 0,function(n){if(Array.isArray(n)){for(var t=0,e=Array(n.length);t<n.length;t++)e[t]=n[t];return e}return Array.from(n)}(n)):u(n)?f(Object.keys(n).map(function(t){return n[t]&&t})):void 0}).filter(Boolean).join(" ")},l=function(){"use strict";var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),this.list=n;for(var t="#",e=0;e<this.list.length;++e){t+="→ ";var r=this.list[e].tag;t+=r.substr(0,16),r.length>16&&(t+="...")}this.formatted=t},h=l.prototype,p=function(n,t){"use strict";if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return function(n,t){var e=[],r=!0,i=!1,o=void 0;try{for(var a,u=n[Symbol.iterator]();!(r=(a=u.next()).done)&&(e.push(a.value),!t||e.length!==t);r=!0);}catch(n){i=!0,o=n}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return e}(n,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},b=function(n,t){for(var e,r=[],i=0,o=0,a="",u=t&&t.delimiter||"/",c=t&&t.delimiters||"./",s=!1;null!==(e=A.exec(n));){var d=e[0],f=e[1],l=e.index;if(a+=n.slice(o,l),o=l+d.length,f)a+=f[1],s=!0;else{var h="",p=n[o],b=e[2],v=e[3],m=e[4],w=e[5];if(!s&&a.length){var O=a.length-1;c.indexOf(a[O])>-1&&(h=a[O],a=a.slice(0,O))}a&&(r.push(a),a="",s=!1);var x=""!==h&&void 0!==p&&p!==h,E="+"===w||"*"===w,j="?"===w||"*"===w,k=h||u,D=v||m;r.push({name:b||i++,prefix:h,delimiter:k,optional:j,repeat:E,partial:x,pattern:D?y(D):"[^"+g(k)+"]+?"})}}return(a||o<n.length)&&r.push(a+n.substr(o)),r},v=function(n){for(var t=new Array(n.length),e=0;e<n.length;e++)"object"==typeof n[e]&&(t[e]=new RegExp("^(?:"+n[e].pattern+")$"));return function(e,r){for(var i="",o=r&&r.encode||encodeURIComponent,a=0;a<n.length;a++){var u=n[a];if("string"!=typeof u){var c,s=e?e[u.name]:void 0;if(Array.isArray(s)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but got array');if(0===s.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var d=0;d<s.length;d++){if(c=o(s[d],u),!t[a].test(c))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'"');i+=(0===d?u.prefix:u.delimiter)+c}}else if("string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s){if(!u.optional)throw new TypeError('Expected "'+u.name+'" to be '+(u.repeat?"an array":"a string"));u.partial&&(i+=u.prefix)}else{if(c=o(String(s),u),!t[a].test(c))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but got "'+c+'"');i+=u.prefix+c}}else i+=u}return i}},g=function(n){return n.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")},y=function(n){return n.replace(/([=!:$/()])/g,"\\$1")},m=function(n){return n&&n.sensitive?"":"i"},w=function(n,t,e){for(var r=(e=e||{}).strict,i=!1!==e.start,o=!1!==e.end,a=g(e.delimiter||"/"),u=e.delimiters||"./",c=[].concat(e.endsWith||[]).map(g).concat("$").join("|"),s=i?"^":"",d=0===n.length,f=0;f<n.length;f++){var l=n[f];if("string"==typeof l)s+=g(l),d=f===n.length-1&&u.indexOf(l[l.length-1])>-1;else{var h=l.repeat?"(?:"+l.pattern+")(?:"+g(l.delimiter)+"(?:"+l.pattern+"))*":l.pattern;t&&t.push(l),l.optional?l.partial?s+=g(l.prefix)+"("+h+")?":s+="(?:"+g(l.prefix)+"("+h+"))?":s+=g(l.prefix)+"("+h+")"}}return o?(r||(s+="(?:"+a+")?"),s+="$"===c?"$":"(?="+c+")"):(r||(s+="(?:"+a+"(?="+c+"))?"),d||(s+="(?="+a+"|"+c+")")),new RegExp(s,m(e))},O=function(n,t,e){return n instanceof RegExp?function(n,t){if(!t)return n;var e=n.source.match(/\((?!\?)/g);if(e)for(var r=0;r<e.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,pattern:null});return n}(n,t):Array.isArray(n)?function(n,t,e){for(var r=[],i=0;i<n.length;i++)r.push(O(n[i],t,e).source);return new RegExp("(?:"+r.join("|")+")",m(e))}(n,t,e):function(n,t,e){return w(b(n,e),t,e)}(n,t,e)},x=function(n,t){"use strict";E.browser&&(j.defined(t)||(s(function(){return"undefined"!=typeof window}(),"app : must be run in a browser environment"),t=window));var e=function(){},i=function(){return e.apply(void 0,arguments)},c=function(){var n={};return{on:function(t,e){s(a(t),"on : handler type is not a string",t),s(o(e),"on : handler is not a function",e),r(n[t])||(n[t]=[]),n[t].push(e)},send:function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];s(a(t),"send : event type is not a string",t);var u=n[t];if(r(u))for(var c=0;c<u.length;++c)u[c].apply(u,i)}}}(),d=c.on,f=c.send,l=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e){for(var i=arguments.length,o=Array(i>1?i-1:0),c=1;c<i;c++)o[c-1]=arguments[c];if(a(e))n.apply(void 0,["blob."+e].concat(o));else{s(u(e),"use : blob is not an object",e);var d=e.name;if(r(d)){if(s(a(d),"utils.bus : blob name is not a string",d),r(t[d]))return;t[d]=!0}Object.keys(e).forEach(function(t){n("blob."+t,e[t])})}}}(f,{});return Object.assign(i,{on:d,send:f,use:l}),i.on("blob.api",function(n,t){s(j.object(n),"on.blob.api : additional api is not an object",n),Object.keys(n).forEach(function(e){t||s(!i[e],'on.blob.api : cannot add key "'+e+'" because it is already defined'),i[e]=n[e]})}),i.on("blob.primary",function(n){s(j.function(n),"on.blob.primary : primary is not a function",n),e=n}),D.forEach(function(n){n({on:i.on,send:i.send},t)}),j.defined(n)&&i.send("blob.target",n),i},E={kit:"standard",browser:!0},j={array:i,boolean:function(n){"use strict";return"boolean"==typeof n},defined:r,function:o,node:function(n){"use strict";return!!(n&&n.tagName&&n.nodeName&&n.ownerDocument&&n.removeAttribute)},null:function(n){"use strict";return null===n},number:function(n){"use strict";return"number"==typeof n},object:u,regExp:function(n){"use strict";return n instanceof RegExp},string:a},k=this;n.value=function(n){"use strict";return void 0===n?this.formatted:this.formatted+"→ {{"+n+"}}"},t(h,"f",n),n.value=function(n,t){"use strict";return new l(this.list.concat([{tag:n,key:t}]))},t(h,"add",n),n.value=function(n,t){"use strict";return this.list.push({tag:n,key:t}),this},t(h,"addUnsafe",n),n.value=function(){"use strict";return new l(this.list.slice())},t(h,"copy",n),n.value=function(){"use strict";if(this.list.length<2)return[];for(var n=Array(this.list.length-1),t=0;t<n.length;++t)n[t]=this.list[t+1].key;return n},t(h,"keys",n);var A=/(\\.)|(?:\:(\w+)(?:\(((?:\\.|[^\\()])+)\))?|\(((?:\\.|[^\\()])+)\))([+*?])?/g;O.parse=b,O.compile=function(n,t){return v(b(n,t))},O.tokensToFunction=v,O.tokensToRegExp=w;var D=[function(n){"use strict";var t=n.on,e=n.send,r={},i=r,o=void 0;t("state",function(n){i=n}),t("blob.handler",function(n){s(j.function(n),"on.blob.handler : handler generator is not a function",n);var t=n(function(){return i});s(j.function(t),"on.blob.handler : handler from generator is not a function",t),o=t}),e("blob.handler",function(){return function(n){e("state",n)}});e("blob.api",{setState:function(n){var t=j.function(n)?n(c(i)):n;o(t)},getState:function(){return s(i!==r,"state.getState : cannot get state before it has been set"),c(i)}})},function(n){"use strict";var t=n.on,e=n.send,r=!1,i={},o=[],a=[],u=d(),f=function(){},l=function(n,t,r){var d=[function(){!function(n,t,r){var o=c(n);s(j.defined(i[t]),"state.handler : action type '"+t+"' was not found"),i[t].forEach(function(e){var i=e.target;j.function(i)&&(i=i(c(n),r),s(j.array(i),"state.handler : dynamic target of action "+t+" is not an array",i),i.forEach(function(n){s(j.string(n),"state.handler : dynamic target of action "+t+" is not an array of strings",i)}));var a=c(o);0===i.length&&(o=e.handler(a,r),s(j.defined(o),"state.handler : result of action "+t+" on target @state is undefined"));var u=o;i.forEach(function(n,o){if(s(j.defined(a[n]),"state.handler : target of action "+t+" does not exist: @state."+i.slice(0,o+1).join(".")),o<i.length-1)return a=a[n],void(u=u[n]);var c=e.handler(a[n],r);s(j.defined(c),"state.handler : result of action "+t+" on target @state."+i.join(".")+" is undefined"),u[n]=c})}),e("state",c(o)),a.forEach(function(n){n(c(o),t,r)}),u.done()}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:r)}];o.reverse().forEach(function(e,i){d[i+1]=function(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r;n=o,t=a,r=u,e(d[i],c(o),a,u)}}),d[o.length](n,t,r)};t("blob.action",function(){for(var n=arguments.length,t=Array(n),e=0;e<n;e++)t[e]=arguments[e];t.reduce(function(n,t){return n.concat(t)},[]).forEach(function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.type,e=n.handler,r=n.target;s(j.string(t),"on.blob.action : action's type is not a string",n,t),s(j.function(e),"on.blob.action : handler for action "+t+" is not a function",n,e),j.array(r)?r.forEach(function(e){s(j.string(e),"on.blob.action : target of action "+t+" is not an array of strings",n,r)}):s(j.function(r),"on.blob.action : target of action "+t+" is not valid",r),void 0!==i[t]?i[t].push(n):i[t]=[n]})}),t("blob.middleware",function(){for(var n=arguments.length,t=Array(n),e=0;e<n;e++)t[e]=arguments[e];t.reduce(function(n,t){return n.concat(t)},[]).forEach(function(n){s(j.function(n),"on.blob.middleware : middleware is not a function",n),o.push(n)})}),t("blob.watcher",function(){for(var n=arguments.length,t=Array(n),e=0;e<n;e++)t[e]=arguments[e];t.reduce(function(n,t){return n.concat(t)},[]).forEach(function(n){s(j.function(n),"on.blob.watcher : watcher is not a function",n),a.push(n)})}),t("action",function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.type,e=n.params,i=void 0===e?{}:e;s(r||"SET_STATE"===t,"state.act : cannot act on state before it has been overwritten"),r=!0,s(j.string(t),"state.act : action type is not a string",t),u.add(function(){l(f(),t,i)})}),e("blob.api",{act:function(n,t){return e("action",{type:n,params:t})}}),e("blob.action",{type:"SET_STATE",target:[],handler:function(n,t){return t}}),e("blob.handler",function(n){return f=n,function(n){e("action",{type:"SET_STATE",params:n})}})},function(n){"use strict";n.on;var t=n.send,e={},r=[],i=e,o=[];t("blob.action",{type:"UNDO",target:[],handler:function(){return r.length>0&&r[r.length-1]!==e?(o.push(i),r.pop()):i}}),t("blob.action",{type:"REDO",target:[],handler:function(){return o.length>0?(r.push(i),o.pop()):i}}),t("blob.api",{resetHistory:function(){r=[],o=[]}}),t("blob.watcher",function(n,t){"UNDO"!==t&&"REDO"!==t&&(o=[],r.push(i),r.length>21&&r.shift()),i=n}),t("blob.api",{undo:function(){return t("action",{type:"UNDO"})},redo:function(){return t("action",{type:"REDO"})}})},function(n){"use strict";var t=n.on,e=n.send,r=void 0,i=void 0,o=void 0,a=void 0,u=void 0,c=void 0,f=void 0;t("blob.target",function(n){r=n,e("update",!0)}),t("blob.builder",function(n){s(j.function(n),"on.blob.builder : builder is not a function",n),i=n,e("update",!1)}),t("blob.draw",function(n){s(j.function(n),"on.blob.draw : new draw is not a function",n),a=n,e("update",!0)}),t("blob.update",function(n){s(j.function(n),"on.blob.update : new target updater is not a function",n),u=n,e("update",!1)}),t("blob.build",function(n){s(j.function(n),"on.blob.build : new build is not a function",n),o=n,e("update",!1)}),t("state",function(n){s(j.defined(n),"on.state : new state is not defined",n),f=n,e("update",!1)});var l=!1,h=!1,p=null;t("update",function(n){if(!h){if(!(j.defined(r)&&j.defined(i)&&j.defined(f)))return void(p||(p=setTimeout(function(){var n={builder:i,state:f,target:r};Object.keys(n).forEach(function(t){n[t]=n[t]?"ok":"waiting"}),s(h,"view : still waiting to draw after "+Math.round(3)+"s",n)},3e3)));h=!0}var t=d();if(n||!l)return c=a(r,o(i(f),t)),l=!0,void t.done();c=u(r,o(i(f),t),[],c),t.done()}),t("sync",function(n,t,e){s(l,"view.sync : cannot sync component before app has drawn"),c=u(r,t,n,c,e)}),e("blob.api",{update:function(){k.console.warn("@okwolo.update : function will be deprecated in next major version (4.x)"),e("update",!1)}}),e("blob.primary",function(n){e("blob.builder",n())})},function(n,t){"use strict";var e=n.send,r=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500,t={},e=[];return{set:function(r,i){t[r]=i,e.push(r),e.length>n&&(t[e.shift()]=void 0)},get:function(n){return t[n]}}}(1e3);e("blob.build",function(n,t){return t.add(function(){}),function n(t,i,o,a,u,c){if(j.boolean(t)&&(t=""),j.null(t)&&(t=""),j.number(t)&&(t+=""),j.string(t))return u&&o.addUnsafe("textNode",a),{text:t,componentIdentity:c};var d=o.f(a);if(s(j.array(t),"view.build : vdom object is not a recognized type",d,t),j.function(t[0])){var l=p(t,3),h=l[0],b=l[1],v=void 0===b?{}:b,g=l[2],y=void 0===g?[]:g;s(j.object(v),"view.build : component's props is not an object",d,t,v),s(j.array(y),"view.build : component's children is not an array",d,t,y);var m=void 0,w=o;return u||(w=o.copy(),c={}),m=h(Object.assign({},v,{children:y}),function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];i.add(function(){e("sync",w.keys(),n(m.apply(void 0,r),i,w,a,!1,c),c),i.done()})}),s(j.function(m),"view.build : component should return a function",d,m),n(m(),i,w,a,!0,c)}var O=p(t,3),x=O[0],E=O[1],k=void 0===E?{}:E,A=O[2],D=void 0===A?[]:A;s(j.string(x),"view.build : tag property is not a string",d,t,x),s(j.object(k),"view.build : attributes is not an object",d,t,k),s(j.array(D),"view.build : children of vdom object is not an array",d,t,D);var M=r.get(x);j.defined(M)||(M=/^ *?(\w+?) *?(?:#([-\w\d]+?))? *?((?:\.[-\w\d]+?)*?)? *?(?:\|\s*?([^\s][^]*?))? *?$/.exec(x),s(j.array(M),"view.build : tag property cannot be parsed",d,x),r.set(x,M));var T=p(M,5),S=T[1],N=T[2],R=T[3],$=T[4];j.defined(N)&&!j.defined(k.id)&&(k.id=N.trim()),(j.defined(k.className)||j.defined(R))&&(k.className=f(k.className,R).replace(/\./g," ").replace(/ +/g," ").trim()),j.defined($)&&(j.defined(k.style)?k.style=($+";").replace(/;;$/g,";")+k.style:k.style=$);var C=a;"key"in k&&(C=k.key,s(j.number(C)||j.string(C),"view.build : invalid element key type",d,C),s((C=""+C).match(/^[\w\d-_]+$/g),"view.build : invalid character in element key",d,C),k.key=C),c?u&&o.addUnsafe(x,C):o=o.add(x,C);for(var I={},U=[],_=0;_<D.length;++_){var F=D[_],J=""+_,q=n(F,i,o,J);q.attributes&&"key"in q.attributes&&(J=q.attributes.key),s(!I[J],"view.build : duplicate child key (note that text elements and elements with no key attribute are given their array index as key)",o.f(),J),U.push(J),I[J]=q}return{tagName:S,attributes:k,children:I,childOrder:U,componentIdentity:c}}(n,t,new l)})},function(n,t){"use strict";var e=n.send,r=function n(e){if(j.defined(e.text))return e.DOM=t.document.createTextNode(e.text),e;var r=t.document.createElement(e.tagName);Object.assign(r,e.attributes);for(var i=0;i<e.childOrder.length;++i){var o=e.childOrder[i],a=n(e.children[o]).DOM;r.appendChild(a)}return e.DOM=r,e},i=function n(t,e,i,a,u){if(j.defined(e)){if(!j.defined(i)){var c=a.DOM,s=e.DOM;return t.push(function(){c.removeChild(s)}),void delete a.children[u]}if(e.componentIdentity=i.componentIdentity,e.tagName!==i.tagName){var d=e.DOM,f=r(i),l=a.DOM,h=f.DOM;return t.push(function(){l.replaceChild(h,d)}),void Object.assign(e,{DOM:void 0,text:void 0,tagName:void 0,attributes:void 0,children:void 0,childOrder:void 0},f)}if(void 0===e.text){for(var p=function(n,t){for(var e=Object.keys(Object.assign({},n,t)),r=[],i=0;i<e.length;++i){var a=e[i],u=n[a],c=t[a];o(u)||o(c)?r.push(a):u!==c&&r.push(a)}return r}(e.attributes,i.attributes),b=function(n){var r=p[n],o=i.attributes[r];e.attributes[r]=o;var a=e.DOM;t.push(function(){a[r]=o})},v=0;v<p.length;++v)b(v);var g=e.childOrder.slice();e.childOrder=i.childOrder;var y=Object.keys(Object.assign({},e.children,i.children));for(v=0;v<y.length;++v){var m=y[v];e.children[m]?i.children[m]||g.splice(g.indexOf(m),1):g.push(m),n(t,e.children[m],i.children[m],e,m)}if(g.length){for(var w=function(n,t){for(var e=t.length,r=e/2,i=0,o=0,a=0;a<e;++a){for(var u=n.indexOf(t[a]),c=Math.min(e-u,e-a),s=1,d=1;d<c&&t[a+d]===n[u+d];++d)s+=1;if(s>i&&(i=s,o=a),i>=r)break}return{start:o,end:o+i-1}}(g,i.childOrder),O=w.start,x=w.end,E=i.childOrder.slice(0,O),k=function(n){var r=E[n],i=e.DOM,o=e.children[r].DOM;t.push(function(){i.insertBefore(o,i.firstChild)})},A=E.length-1;A>=0;--A)k(A);for(var D=i.childOrder.slice(x+1,1/0),M=function(n){var r=D[n],i=e.DOM,o=e.children[r].DOM;t.push(function(){i.appendChild(o)})},T=0;T<D.length;++T)M(T)}}else{var S=i.text;if(e.text!==S){var N=e.DOM;t.push(function(){N.nodeValue=S}),e.text=S}}}else{a.children[u]=r(i);var R=a.DOM,$=a.children[u].DOM;t.push(function(){R.appendChild($)})}};e("blob.draw",function(n,e){return s(j.node(n),"view.dom.draw : target is not a DOM node",n),r(e),t.requestAnimationFrame(function(){n.innerHTML="",n.appendChild(e.DOM)}),e}),e("blob.update",function n(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments[3],u=arguments[4];s(j.node(e),"view.dom.update : target is not a DOM node",e);for(var c={DOM:e,children:{root:a},childOrder:["root"]},d="root",f=a,l=0;l<o.length;++l)if(d=o[l],c=f,f=f.children[d],!j.defined(f))return o.length>1?n(e,r,o.slice(1),a,u):(t.console.warn("view.dom.update : target of update does not exist (this could be caused by a component update function being called on a component that no longer exists)"),a);if(u&&f.componentIdentity!==u)return o.length>1?n(e,r,o.slice(1),a,u):(t.console.warn("view.dom.update : target of update has incorrect identity (this is generally caused by a component update function being called on a component that no longer exists)"),a);var h=[];return i(h,f,r,c,d),t.requestAnimationFrame(function(){try{for(var n=0;n<h.length;++n)h[n]()}catch(n){t.console.error("view.dom.update : error when applying computed changes"+n)}}),a})},function(n,t){"use strict";var e=n.on,r=n.send,i=void 0,o="",a=void 0,u=void 0,c=!1,f=t.location.pathname,l=null!==t.window.origin&&"null"!==t.window.origin;l||(f="");var h=d(),p=function(n){var t=o.replace(/([^\w])/g,"\\$1");return n.replace(new RegExp("^"+t),"")||""};t.onpopstate=function(){h.add(function(){f=p(t.location.pathname),u(i,f),h.done()})},e("blob.route",function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.path,e=n.handler;s(j.string(t)||j.regExp(t),"on.blob.route : path is not a string or a regular expression",t),s(j.function(e),"on.blob.route : handler is not a function",t,e),s(j.function(a),"on.blob.route : register is not a function",a),h.add(function(){i=a(i,t,e),c||(c=!!u(i,f)),h.done()})}),e("blob.base",function(n){s(j.string(n),"on.blob.base : base url is not a string",n),h.add(function(){o=n,f=p(f),u(i,f),h.done()})}),e("blob.register",function(n){s(j.function(n),"on.blob.register : register is not a function",a),h.add(function(){a=n,h.done()})}),e("blob.fetch",function(n){s(j.function(n),"on.blob.fetch : fetch is not a function",u),h.add(function(){u=n,h.done()})}),e("redirect",function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(j.string(n),"on.redirect : path is not a string",n),s(j.object(e),"on.redirect : params is not an object",e),h.add(function(){f=n,l?t.history.pushState({},"",(o+f).replace(/^\/C\:/,"")):console.log("@okwolo : path changed to\n>>> "+f),u(i,f,e),h.done()})}),e("show",function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(j.string(n),"on.show : path is not a string",n),s(j.object(t),"on.show : params is not an object",t),h.add(function(){u(i,n,t),h.done()})}),r("blob.api",{redirect:function(n,t){return r("redirect",n,t)},show:function(n,t){return r("show",n,t)}})},function(n){"use strict";(0,n.send)("blob.register",function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],e=arguments[2];if("**"===t)return n.push({keys:[],pattern:/.*/g,handler:e}),n;if(j.regExp(t)){var r=new RegExp(t.toString()+"|").exec("").length-1;return n.push({keys:Array(r).fill(0).map(function(n,t){return{name:t}}),pattern:t,handler:e}),n}var i=[];return n.push({keys:i,pattern:O(t,i,{strict:!0}),handler:e}),n})},function(n){"use strict";(0,n.send)("blob.fetch",function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!1;return n.find(function(n){var i=n.pattern.exec(t);if(null!==i)return r=!0,i.shift(),n.keys.forEach(function(n,t){e[n.name]=i[t]}),n.handler(e),r}),r})},function(n){"use strict";n.on;var t=n.send;t("blob.primary",function(n,e){j.function(n)?t("blob.builder",n()):t("blob.route",{path:n,handler:function(n){t("blob.builder",e(n))}})})}];x.kit="standard",x.version="3.4.5",x.standard=x,this.okwolo=x}).call(this);