orator 3.0.6 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/debug/Harness.js +10 -6
- package/dist/orator.js +5170 -1025
- package/dist/orator.min.js +6 -104
- package/dist/orator.min.js.map +1 -1
- package/package.json +3 -4
- package/source/Orator-ServiceServer-Base.js +160 -0
- package/source/Orator-ServiceServer-IPC.js +1 -1
- package/source/Orator.js +3 -16
- package/test/Orator_basic_tests.js +16 -14
package/dist/orator.min.js
CHANGED
|
@@ -1,121 +1,23 @@
|
|
|
1
|
-
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Orator=t()}}((function(){return function t(e,r,n){function i(o,a){if(!r[o]){if(!e[o]){var u="function"==typeof require&&require;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var
|
|
1
|
+
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Orator=t()}}((function(){return function t(e,r,n){function i(o,a){if(!r[o]){if(!e[o]){var u="function"==typeof require&&require;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[o]={exports:{}};e[o][0].call(l.exports,(function(t){return i(e[o][1][t]||t)}),l,l.exports,t,e,r,n)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){(function(r){(function(){"use strict";var n=t("object-assign");
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
5
5
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
6
6
|
* @license MIT
|
|
7
|
-
*/function i(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function s(t){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var o=t("util/"),a=Object.prototype.hasOwnProperty,u=Array.prototype.slice,l="foo"===function(){}.name;function c(t){return Object.prototype.toString.call(t)}function h(t){return!s(t)&&("function"==typeof r.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var f=e.exports=v,p=/\s*function\s+([^\(\s]*)\s*/;function d(t){if(o.isFunction(t)){if(l)return t.name;var e=t.toString().match(p);return e&&e[1]}}function g(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function y(t){if(l||!o.isFunction(t))return o.inspect(t);var e=d(t);return"[Function"+(e?": "+e:"")+"]"}function m(t,e,r,n,i){throw new f.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function v(t,e){t||m(t,!0,e,"==",f.ok)}function b(t,e,r,n){if(t===e)return!0;if(s(t)&&s(e))return 0===i(t,e);if(o.isDate(t)&&o.isDate(e))return t.getTime()===e.getTime();if(o.isRegExp(t)&&o.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(h(t)&&h(e)&&c(t)===c(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===i(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(s(t)!==s(e))return!1;var a=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==a&&a===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(o.isPrimitive(t)||o.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=S(t),s=S(e);if(i&&!s||!i&&s)return!1;if(i)return b(t=u.call(t),e=u.call(e),r);var a,l,c=P(t),h=P(e);if(c.length!==h.length)return!1;for(c.sort(),h.sort(),l=c.length-1;l>=0;l--)if(c[l]!==h[l])return!1;for(l=c.length-1;l>=0;l--)if(!b(t[a=c[l]],e[a],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function S(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function w(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function x(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&m(i,r,"Missing expected exception"+n);var s="string"==typeof n,a=!t&&i&&!r;if((!t&&o.isError(i)&&s&&w(i,r)||a)&&m(i,r,"Got unwanted exception"+n),t&&i&&r&&!w(i,r)||!t&&i)throw i}f.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return g(y(t.actual),128)+" "+t.operator+" "+g(y(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=d(e),s=n.indexOf("\n"+i);if(s>=0){var o=n.indexOf("\n",s+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(f.AssertionError,Error),f.fail=m,f.ok=v,f.equal=function(t,e,r){t!=e&&m(t,e,r,"==",f.equal)},f.notEqual=function(t,e,r){t==e&&m(t,e,r,"!=",f.notEqual)},f.deepEqual=function(t,e,r){b(t,e,!1)||m(t,e,r,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(t,e,r){b(t,e,!0)||m(t,e,r,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(t,e,r){b(t,e,!1)&&m(t,e,r,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,r,n){b(e,r,!0)&&m(e,r,n,"notDeepStrictEqual",t)},f.strictEqual=function(t,e,r){t!==e&&m(t,e,r,"===",f.strictEqual)},f.notStrictEqual=function(t,e,r){t===e&&m(t,e,r,"!==",f.notStrictEqual)},f.throws=function(t,e,r){x(!0,t,e,r)},f.doesNotThrow=function(t,e,r){x(!1,t,e,r)},f.ifError=function(t){if(t)throw t},f.strict=n((function t(e,r){e||m(e,!0,r,"==",t)}),f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var P=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":51,"util/":4}],2:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],3:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],4:[function(t,e,r){(function(e,n){(function(){var i=/%[sdj%]/g;r.format=function(t){if(!m(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(a(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,s=n.length,o=String(t).replace(i,(function(t){if("%%"===t)return"%";if(r>=s)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),u=n[r];r<s;u=n[++r])g(u)||!S(u)?o+=" "+u:o+=" "+a(u);return o},r.deprecate=function(t,i){if(v(n.process))return function(){return r.deprecate(t,i).apply(this,arguments)};if(!0===e.noDeprecation)return t;var s=!1;return function(){if(!s){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),s=!0}return t.apply(this,arguments)}};var s,o={};function a(t,e){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,t,n.depth)}function u(t,e){var r=a.styles[e];return r?"["+a.colors[r][0]+"m"+t+"["+a.colors[r][1]+"m":t}function l(t,e){return t}function c(t,e,n){if(t.customInspect&&e&&P(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return m(i)||(i=c(t,i,n)),i}var s=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(y(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,e);if(s)return s;var o=Object.keys(e),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),x(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(e);if(0===o.length){if(P(e)){var u=e.name?": "+e.name:"";return t.stylize("[Function"+u+"]","special")}if(b(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(w(e))return t.stylize(Date.prototype.toString.call(e),"date");if(x(e))return h(e)}var l,S="",O=!1,C=["{","}"];(p(e)&&(O=!0,C=["[","]"]),P(e))&&(S=" [Function"+(e.name?": "+e.name:"")+"]");return b(e)&&(S=" "+RegExp.prototype.toString.call(e)),w(e)&&(S=" "+Date.prototype.toUTCString.call(e)),x(e)&&(S=" "+h(e)),0!==o.length||O&&0!=e.length?n<0?b(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=O?function(t,e,r,n,i){for(var s=[],o=0,a=e.length;o<a;++o)E(e,String(o))?s.push(f(t,e,r,n,String(o),!0)):s.push("");return i.forEach((function(i){i.match(/^\d+$/)||s.push(f(t,e,r,n,i,!0))})),s}(t,e,n,a,o):o.map((function(r){return f(t,e,n,a,r,O)})),t.seen.pop(),function(t,e,r){var n=t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(l,S,C)):C[0]+S+C[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i,s){var o,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),E(n,i)||(o="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=g(r)?c(t,u.value,null):c(t,u.value,r-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),v(o)){if(s&&i.match(/^\d+$/))return a;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function g(t){return null===t}function y(t){return"number"==typeof t}function m(t){return"string"==typeof t}function v(t){return void 0===t}function b(t){return S(t)&&"[object RegExp]"===O(t)}function S(t){return"object"==typeof t&&null!==t}function w(t){return S(t)&&"[object Date]"===O(t)}function x(t){return S(t)&&("[object Error]"===O(t)||t instanceof Error)}function P(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function C(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(v(s)&&(s=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(s)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=d,r.isNull=g,r.isNullOrUndefined=function(t){return null==t},r.isNumber=y,r.isString=m,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=v,r.isRegExp=b,r.isObject=S,r.isDate=w,r.isError=x,r.isFunction=P,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[C(t.getHours()),C(t.getMinutes()),C(t.getSeconds())].join(":"),[t.getDate(),j[t.getMonth()],e].join(" ")),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!S(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":3,_process:56,inherits:2}],5:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){if((0,s.isAsync)(t))return function(...e){const r=e.pop();return a(t.apply(this,e),r)};return(0,n.default)((function(e,r){var n;try{n=t.apply(this,e)}catch(t){return r(t)}if(n&&"function"==typeof n.then)return a(n,r);r(null,n)}))};var n=o(t("./internal/initialParams.js")),i=o(t("./internal/setImmediate.js")),s=t("./internal/wrapAsync.js");function o(t){return t&&t.__esModule?t:{default:t}}function a(t,e){return t.then((t=>{u(e,null,t)}),(t=>{u(e,t&&t.message?t:new Error(t))}))}function u(t,e,r){try{t(e,r)}catch(t){(0,i.default)((t=>{throw t}),t)}}e.exports=r.default},{"./internal/initialParams.js":14,"./internal/setImmediate.js":19,"./internal/wrapAsync.js":21}],6:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=a(t("./internal/eachOfLimit.js")),i=a(t("./internal/withoutIndex.js")),s=a(t("./internal/wrapAsync.js")),o=a(t("./internal/awaitify.js"));function a(t){return t&&t.__esModule?t:{default:t}}r.default=(0,o.default)((function(t,e,r,o){return(0,n.default)(e)(t,(0,i.default)((0,s.default)(r)),o)}),4),e.exports=r.default},{"./internal/awaitify.js":10,"./internal/eachOfLimit.js":12,"./internal/withoutIndex.js":20,"./internal/wrapAsync.js":21}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=o(t("./internal/eachOfLimit.js")),i=o(t("./internal/wrapAsync.js")),s=o(t("./internal/awaitify.js"));function o(t){return t&&t.__esModule?t:{default:t}}r.default=(0,s.default)((function(t,e,r,s){return(0,n.default)(e)(t,(0,i.default)(r),s)}),4),e.exports=r.default},{"./internal/awaitify.js":10,"./internal/eachOfLimit.js":12,"./internal/wrapAsync.js":21}],8:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=s(t("./eachOfLimit.js")),i=s(t("./internal/awaitify.js"));function s(t){return t&&t.__esModule?t:{default:t}}r.default=(0,i.default)((function(t,e,r){return(0,n.default)(t,1,e,r)}),3),e.exports=r.default},{"./eachOfLimit.js":7,"./internal/awaitify.js":10}],9:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t,e,r,n){let i=!1,o=!1,a=!1,u=0,l=0;function c(){u>=e||a||i||(a=!0,t.next().then((({value:t,done:e})=>{if(!o&&!i){if(a=!1,e)return i=!0,void(u<=0&&n(null));u++,r(t,l,h),l++,c()}})).catch(f))}function h(t,e){if(u-=1,!o)return t?f(t):!1===t?(i=!0,void(o=!0)):e===s.default||i&&u<=0?(i=!0,n(null)):void c()}function f(t){o||(a=!1,i=!0,n(t))}c()};var n,i=t("./breakLoop.js"),s=(n=i)&&n.__esModule?n:{default:n};e.exports=r.default},{"./breakLoop.js":11}],10:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t,e=t.length){if(!e)throw new Error("arity is undefined");return function(...r){return"function"==typeof r[e-1]?t.apply(this,r):new Promise(((n,i)=>{r[e-1]=(t,...e)=>{if(t)return i(t);n(e.length>1?e:e[0])},t.apply(this,r)}))}},e.exports=r.default},{}],11:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.default={},e.exports=r.default},{}],12:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=l(t("./once.js")),i=l(t("./iterator.js")),s=l(t("./onlyOnce.js")),o=t("./wrapAsync.js"),a=l(t("./asyncEachOfLimit.js")),u=l(t("./breakLoop.js"));function l(t){return t&&t.__esModule?t:{default:t}}r.default=t=>(e,r,l)=>{if(l=(0,n.default)(l),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return l(null);if((0,o.isAsyncGenerator)(e))return(0,a.default)(e,t,r,l);if((0,o.isAsyncIterable)(e))return(0,a.default)(e[Symbol.asyncIterator](),t,r,l);var c=(0,i.default)(e),h=!1,f=!1,p=0,d=!1;function g(t,e){if(!f)if(p-=1,t)h=!0,l(t);else if(!1===t)h=!0,f=!0;else{if(e===u.default||h&&p<=0)return h=!0,l(null);d||y()}}function y(){for(d=!0;p<t&&!h;){var e=c();if(null===e)return h=!0,void(p<=0&&l(null));p+=1,r(e.value,e.key,(0,s.default)(g))}d=!1}y()},e.exports=r.default},{"./asyncEachOfLimit.js":9,"./breakLoop.js":11,"./iterator.js":16,"./once.js":17,"./onlyOnce.js":18,"./wrapAsync.js":21}],13:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()},e.exports=r.default},{}],14:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return function(...e){var r=e.pop();return t.call(this,e,r)}},e.exports=r.default},{}],15:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return t&&"number"==typeof t.length&&t.length>=0&&t.length%1==0},e.exports=r.default},{}],16:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){if((0,n.default)(t))return function(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}(t);var e=(0,i.default)(t);return e?function(t){var e=-1;return function(){var r=t.next();return r.done?null:(e++,{value:r.value,key:e})}}(e):(r=t,s=r?Object.keys(r):[],o=-1,a=s.length,function t(){var e=s[++o];return"__proto__"===e?t():o<a?{value:r[e],key:e}:null});var r,s,o,a};var n=s(t("./isArrayLike.js")),i=s(t("./getIterator.js"));function s(t){return t&&t.__esModule?t:{default:t}}e.exports=r.default},{"./getIterator.js":13,"./isArrayLike.js":15}],17:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){function e(...e){if(null!==t){var r=t;t=null,r.apply(this,e)}}return Object.assign(e,t),e},e.exports=r.default},{}],18:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return function(...e){if(null===t)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}},e.exports=r.default},{}],19:[function(t,e,r){(function(t,e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.fallback=a,r.wrap=u;var n,i=r.hasQueueMicrotask="function"==typeof queueMicrotask&&queueMicrotask,s=r.hasSetImmediate="function"==typeof e&&e,o=r.hasNextTick="object"==typeof t&&"function"==typeof t.nextTick;function a(t){setTimeout(t,0)}function u(t){return(e,...r)=>t((()=>e(...r)))}n=i?queueMicrotask:s?e:o?t.nextTick:a,r.default=u(n)}).call(this)}).call(this,t("_process"),t("timers").setImmediate)},{_process:56,timers:63}],20:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return(e,r,n)=>t(e,n)},e.exports=r.default},{}],21:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isAsyncIterable=r.isAsyncGenerator=r.isAsync=void 0;var n,i=t("../asyncify.js"),s=(n=i)&&n.__esModule?n:{default:n};function o(t){return"AsyncFunction"===t[Symbol.toStringTag]}r.default=function(t){if("function"!=typeof t)throw new Error("expected a function");return o(t)?(0,s.default)(t):t},r.isAsync=o,r.isAsyncGenerator=function(t){return"AsyncGenerator"===t[Symbol.toStringTag]},r.isAsyncIterable=function(t){return"function"==typeof t[Symbol.asyncIterator]}},{"../asyncify.js":5}],22:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=a(t("./internal/once.js")),i=a(t("./internal/onlyOnce.js")),s=a(t("./internal/wrapAsync.js")),o=a(t("./internal/awaitify.js"));function a(t){return t&&t.__esModule?t:{default:t}}r.default=(0,o.default)((function(t,e){if(e=(0,n.default)(e),!Array.isArray(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var r=0;function o(e){(0,s.default)(t[r++])(...e,(0,i.default)(a))}function a(n,...i){if(!1!==n)return n||r===t.length?e(n,...i):void o(i)}o([])})),e.exports=r.default},{"./internal/awaitify.js":10,"./internal/once.js":17,"./internal/onlyOnce.js":18,"./internal/wrapAsync.js":21}],23:[function(t,e,r){e.exports=
|
|
8
|
-
/**
|
|
9
|
-
* Base Logger Class
|
|
10
|
-
*
|
|
11
|
-
* @license MIT
|
|
12
|
-
*
|
|
13
|
-
* @author Steven Velozo <steven@velozo.com>
|
|
14
|
-
*/
|
|
15
|
-
class{constructor(t,e){this._Settings=t,this.loggerUUID=this.generateInsecureUUID(),this.levels=["trace","debug","info","warn","error","fatal"]}generateInsecureUUID(){let t=(new Date).getTime();return"LOGSTREAM-xxxxxx-yxxxxx".replace(/[xy]/g,(e=>{let r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?r:3&r|8).toString(16)}))}initialize(){}trace(t,e){this.write("trace",t,e)}debug(t,e){this.write("debug",t,e)}info(t,e){this.write("info",t,e)}warn(t,e){this.write("warn",t,e)}error(t,e){this.write("error",t,e)}fatal(t,e){this.write("fatal",t,e)}write(t,e,r){return!0}}},{}],24:[function(t,e,r){
|
|
16
|
-
/**
|
|
17
|
-
* Default Logger Provider Function
|
|
18
|
-
*
|
|
19
|
-
* @license MIT
|
|
20
|
-
*
|
|
21
|
-
* @author Steven Velozo <steven@velozo.com>
|
|
22
|
-
*/
|
|
23
|
-
getDefaultProviders=()=>{let e={};return e.console=t("./Fable-Log-Logger-Console.js"),e.default=e.console,e},e.exports=getDefaultProviders()},{"./Fable-Log-Logger-Console.js":26}],25:[function(t,e,r){e.exports=[{loggertype:"console",streamtype:"console",level:"trace"}]},{}],26:[function(t,e,r){let n=t("./Fable-Log-BaseLogger.js");e.exports=class extends n{constructor(t,e){super(t),this._ShowTimeStamps=!!t.hasOwnProperty("showtimestamps")&&1==t.showtimestamps,this._FormattedTimeStamps=!!t.hasOwnProperty("formattedtimestamps")&&1==t.formattedtimestamps,this._ContextMessage=t.hasOwnProperty("Context")?`(${t.Context})`:e._Settings.hasOwnProperty("Product")?`(${e._Settings.Product})`:"Unnamed_Log_Context",this._OutputLogLinesToConsole=!t.hasOwnProperty("outputloglinestoconsole")||t.outputloglinestoconsole,this._OutputObjectsToConsole=!t.hasOwnProperty("outputobjectstoconsole")||t.outputobjectstoconsole,this.prefixCache={};for(let t=0;t<=this.levels.length;t++)this.prefixCache[this.levels[t]]=`[${this.levels[t]}] ${this._ContextMessage}: `,this._ShowTimeStamps&&(this.prefixCache[this.levels[t]]=" "+this.prefixCache[this.levels[t]])}write(t,e,r){let n="";this._ShowTimeStamps&&this._FormattedTimeStamps?n=(new Date).toISOString():this._ShowTimeStamps&&(n=+new Date);let i=`${n}${this.prefixCache[t]}${e}`;return this._OutputLogLinesToConsole&&console.log(i),this._OutputObjectsToConsole&&void 0!==r&&console.log(JSON.stringify(r,null,2)),i}}},{"./Fable-Log-BaseLogger.js":23}],27:[function(t,e,r){
|
|
24
|
-
/**
|
|
25
|
-
* Fable Logging Add-on
|
|
26
|
-
*
|
|
27
|
-
* @license MIT
|
|
28
|
-
*
|
|
29
|
-
* @author Steven Velozo <steven@velozo.com>
|
|
30
|
-
* @module Fable Logger
|
|
31
|
-
*/
|
|
32
|
-
class n{constructor(e,r){let n="object"==typeof e?e:{};this._Settings=n,this._Providers=t("./Fable-Log-DefaultProviders-Node.js"),this._StreamDefinitions=n.hasOwnProperty("LogStreams")?n.LogStreams:t("./Fable-Log-DefaultStreams.json"),this.logStreams=[],this.logProviders={},this.activeLogStreams={},this.logStreamsTrace=[],this.logStreamsDebug=[],this.logStreamsInfo=[],this.logStreamsWarn=[],this.logStreamsError=[],this.logStreamsFatal=[],this.datumDecorator=t=>t,this.uuid="string"==typeof n.Product?n.Product:"Default"}addLogger(t,e){if(this.activeLogStreams.hasOwnProperty(t.loggerUUID))return!1;switch(this.logStreams.push(t),this.activeLogStreams[t.loggerUUID]=!0,e){case"trace":this.logStreamsTrace.push(t);case"debug":this.logStreamsDebug.push(t);case"info":this.logStreamsInfo.push(t);case"warn":this.logStreamsWarn.push(t);case"error":this.logStreamsError.push(t);case"fatal":this.logStreamsFatal.push(t)}return!0}setDatumDecorator(t){this.datumDecorator="function"==typeof t?t:t=>t}trace(t,e){const r=this.datumDecorator(e);for(let e=0;e<this.logStreamsTrace.length;e++)this.logStreamsTrace[e].trace(t,r)}debug(t,e){const r=this.datumDecorator(e);for(let e=0;e<this.logStreamsDebug.length;e++)this.logStreamsDebug[e].debug(t,r)}info(t,e){const r=this.datumDecorator(e);for(let e=0;e<this.logStreamsInfo.length;e++)this.logStreamsInfo[e].info(t,r)}warn(t,e){const r=this.datumDecorator(e);for(let e=0;e<this.logStreamsWarn.length;e++)this.logStreamsWarn[e].warn(t,r)}error(t,e){const r=this.datumDecorator(e);for(let e=0;e<this.logStreamsError.length;e++)this.logStreamsError[e].error(t,r)}fatal(t,e){const r=this.datumDecorator(e);for(let e=0;e<this.logStreamsFatal.length;e++)this.logStreamsFatal[e].fatal(t,r)}initialize(){for(let t=0;t<this._StreamDefinitions.length;t++){let e=Object.assign({loggertype:"default",streamtype:"console",level:"info"},this._StreamDefinitions[t]);this._Providers.hasOwnProperty(e.loggertype)?this.addLogger(new this._Providers[e.loggertype](e,this),e.level):console.log(`Error initializing log stream: bad loggertype in stream definition ${JSON.stringify(e)}`)}for(let t=0;t<this.logStreams.length;t++)this.logStreams[t].initialize()}logTime(t,e){let r=void 0!==t?t:"Time",n=new Date;this.info(`${r} ${n} (epoch ${+n})`,e)}getTimeStamp(){return+new Date}getTimeDelta(t){return+new Date-t}logTimeDelta(t,e,r){let n=void 0!==e?e:"Time Measurement",i=+new Date;this.info(`${n} logged at (epoch ${+i}) took (${t}ms)`,r)}logTimeDeltaHuman(t,e,r){let n=void 0!==e?e:"Time Measurement",i=+new Date,s=parseInt(t%1e3),o=parseInt(t/1e3%60),a=parseInt(t/6e4%60),u=parseInt(t/36e5);s=s<10?"00"+s:s<100?"0"+s:s,o=o<10?"0"+o:o,a=a<10?"0"+a:a,u=u<10?"0"+u:u,this.info(`${n} logged at (epoch ${+i}) took (${t}ms) or (${u}:${a}:${o}.${s})`,r)}logTimeDeltaRelative(t,e,r){this.logTimeDelta(this.getTimeDelta(t),e,r)}logTimeDeltaRelativeHuman(t,e,r){this.logTimeDeltaHuman(this.getTimeDelta(t),e,r)}}e.exports={new:function(t){return new n(t)},FableLog:n}},{"./Fable-Log-DefaultProviders-Node.js":24,"./Fable-Log-DefaultStreams.json":25}],28:[function(t,e,r){e.exports={Product:"ApplicationNameHere",ProductVersion:"0.0.0",ConfigFile:!1,LogStreams:[{level:"trace"}]}},{}],29:[function(t,e,r){(function(t){(function(){e.exports=
|
|
33
|
-
/**
|
|
34
|
-
* Fable Settings Template Processor
|
|
35
|
-
*
|
|
36
|
-
* This class allows environment variables to come in via templated expressions, and defaults to be set.
|
|
37
|
-
*
|
|
38
|
-
* @license MIT
|
|
39
|
-
*
|
|
40
|
-
* @author Steven Velozo <steven@velozo.com>
|
|
41
|
-
* @module Fable Settings
|
|
42
|
-
*/
|
|
43
|
-
class{constructor(e){this.templateProcessor=new e.precedent,this.templateProcessor.addPattern("${","}",(e=>{let r=e.trim(),n=r.indexOf("|"),i=r.substring(n+1),s=n>-1?r.substring(0,n):r;return t.env.hasOwnProperty(s)?t.env[s]:i}))}parseSetting(t){return this.templateProcessor.parseString(t)}}}).call(this)}).call(this,t("_process"))},{_process:56}],30:[function(t,e,r){
|
|
44
|
-
/**
|
|
45
|
-
* Fable Settings Add-on
|
|
46
|
-
*
|
|
47
|
-
* @license MIT
|
|
48
|
-
*
|
|
49
|
-
* @author Steven Velozo <steven@velozo.com>
|
|
50
|
-
* @module Fable Settings
|
|
51
|
-
*/
|
|
52
|
-
const n=t("precedent"),i=t("./Fable-Settings-TemplateProcessor.js");class s{constructor(e){this.dependencies={precedent:n},this.settingsTemplateProcessor=new i(this.dependencies),this._configureEnvTemplating(e),this.default=this.buildDefaultSettings();let r=this.merge(e,this.buildDefaultSettings());if(this.base=JSON.parse(JSON.stringify(r)),r.DefaultConfigFile)try{r=this.merge(t(r.DefaultConfigFile),r)}catch(t){console.log("Fable-Settings Warning: Default configuration file specified but there was a problem loading it. Falling back to base."),console.log(" Loading Exception: "+t)}if(r.ConfigFile)try{r=this.merge(t(r.ConfigFile),r)}catch(t){console.log("Fable-Settings Warning: Configuration file specified but there was a problem loading it. Falling back to base."),console.log(" Loading Exception: "+t)}this.settings=r}buildDefaultSettings(){return JSON.parse(JSON.stringify(t("./Fable-Settings-Default")))}_configureEnvTemplating(t){this._PerformEnvTemplating=!t||!0!==t.NoEnvReplacement}_resolveEnv(t){for(const e in t)"object"==typeof t[e]?this._resolveEnv(t[e]):"string"==typeof t[e]&&(t[e]=this.settingsTemplateProcessor.parseSetting(t[e]))}_isObject(t){return"object"==typeof t&&!Array.isArray(t)}_deepMergeObjects(t,e){if(e&&this._isObject(e))return Object.keys(e).forEach((r=>{const n=e[r];if(this._isObject(n)){const e=t[r];if(e&&this._isObject(e))return void this._deepMergeObjects(e,n)}t[r]=n})),t}merge(t,e){let r="object"==typeof t?t:{},n="object"==typeof e?e:this.settings,i=JSON.parse(JSON.stringify(r));return n=this._deepMergeObjects(n,i),this._PerformEnvTemplating&&this._resolveEnv(n),this._configureEnvTemplating(n),n}fill(t){let e="object"==typeof t?t:{},r=JSON.parse(JSON.stringify(e));return this.settings=this._deepMergeObjects(r,this.settings),this.settings}}e.exports={new:function(t){return new s(t)},FableSettings:s}},{"./Fable-Settings-Default":28,"./Fable-Settings-TemplateProcessor.js":29,precedent:53}],31:[function(t,e,r){e.exports=
|
|
53
|
-
/**
|
|
54
|
-
* Random Byte Generator - Browser version
|
|
55
|
-
*
|
|
56
|
-
* @license MIT
|
|
57
|
-
*
|
|
58
|
-
* @author Steven Velozo <steven@velozo.com>
|
|
59
|
-
*/
|
|
60
|
-
class{constructor(){this.getRandomValues="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)}generateWhatWGBytes(){let t=new Uint8Array(16);return this.getRandomValues(t),t}generateRandomBytes(){let t=new Uint8Array(16);for(let e,r=0;r<16;r++)0==(3&r)&&(e=4294967296*Math.random()),t[r]=e>>>((3&r)<<3)&255;return t}generate(){return this.getRandomValues?this.generateWhatWGBytes():this.generateRandomBytes()}}},{}],32:[function(t,e,r){
|
|
61
|
-
/**
|
|
62
|
-
* Fable UUID Generator
|
|
63
|
-
*
|
|
64
|
-
* @license MIT
|
|
65
|
-
*
|
|
66
|
-
* @author Steven Velozo <steven@velozo.com>
|
|
67
|
-
* @module Fable UUID
|
|
68
|
-
*/
|
|
69
|
-
var n=t("./Fable-UUID-Random.js");class i{constructor(t){this._UUIDModeRandom=!("object"!=typeof t||!t.hasOwnProperty("UUIDModeRandom"))&&1==t.UUIDModeRandom,this._UUIDLength="object"==typeof t&&t.hasOwnProperty("UUIDLength")?t.UUIDLength+0:8,this._UUIDRandomDictionary="object"==typeof t&&t.hasOwnProperty("UUIDDictionary")?t.UUIDDictionary+0:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.randomByteGenerator=new n,this._HexLookup=[];for(let t=0;t<256;++t)this._HexLookup[t]=(t+256).toString(16).substr(1)}bytesToUUID(t){let e=0;return[this._HexLookup[t[e++]],this._HexLookup[t[e++]],this._HexLookup[t[e++]],this._HexLookup[t[e++]],"-",this._HexLookup[t[e++]],this._HexLookup[t[e++]],"-",this._HexLookup[t[e++]],this._HexLookup[t[e++]],"-",this._HexLookup[t[e++]],this._HexLookup[t[e++]],"-",this._HexLookup[t[e++]],this._HexLookup[t[e++]],this._HexLookup[t[e++]],this._HexLookup[t[e++]],this._HexLookup[t[e++]],this._HexLookup[t[e++]]].join("")}generateUUIDv4(){new Array(16);var t=this.randomByteGenerator.generate();return t[6]=15&t[6]|64,t[8]=63&t[8]|128,this.bytesToUUID(t)}generateRandom(){let t="";for(let e=0;e<this._UUIDLength;e++)t+=this._UUIDRandomDictionary.charAt(Math.floor(Math.random()*(this._UUIDRandomDictionary.length-1)));return t}getUUID(){return this._UUIDModeRandom?this.generateRandom():this.generateUUIDv4()}}e.exports={new:function(t){return new i(t)},FableUUID:i}},{"./Fable-UUID-Random.js":31}],33:[function(t,e,r){e.exports=class{constructor(t,e){this.fable=t,this.Matchers={Evaluate:/<%([\s\S]+?)%>/g,Interpolate:/<%=([\s\S]+?)%>/g,Escaper:/\\|'|\r|\n|\t|\u2028|\u2029/g,Unescaper:/\\(\\|'|r|n|t|u2028|u2029)/g,GuaranteedNonMatch:/.^/},this.templateEscapes={"\\":"\\","'":"'",r:"\r","\r":"r",n:"\n","\n":"n",t:"\t","\t":"t",u2028:"\u2028","\u2028":"u2028",u2029:"\u2029","\u2029":"u2029"},this.renderFunction=()=>""}extend(t,...e){return Object.assign(t,...e)}renderTemplate(t){return this.renderFunction(t)}templateFunction(t){return this.renderTemplate.bind(this)}buildTemplateFunction(t,e){return this.TemplateSource="__p+='"+t.replace(this.Matchers.Escaper,(t=>`\\${this.templateEscapes[t]}`)).replace(this.Matchers.Interpolate||this.Matchers.GuaranteedNonMatch,((t,e)=>`'+\n(${decodeURIComponent(e)})+\n'`)).replace(this.Matchers.Evaluate||this.Matchers.GuaranteedNonMatch,((t,e)=>`';\n${decodeURIComponent(e)}\n;__p+='`))+"';\n",this.TemplateSource=`with(pTemplateDataObject||{}){\n${this.TemplateSource}}\n`,this.TemplateSource=`var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n${this.TemplateSource}return __p;\n`,this.renderFunction=new Function("pTemplateDataObject",this.TemplateSource),void 0!==e?this.renderFunction(e):(this.TemplateSourceCompiled="function(obj){\n"+this.TemplateSource+"}",this.templateFunction())}}},{}],34:[function(t,e,r){const n=t("./Fable-Utility-Template.js"),i=t("async/waterfall"),s=t("async/eachLimit");e.exports=class{constructor(t){this.fable=t,this.waterfall=i,this.eachLimit=s}extend(t,...e){return Object.assign(t,...e)}template(t,e){return new n(this.fable,t).buildTemplateFunction(t,e)}chunk(t,e,r){let n=[...t],i="number"==typeof e?e:0,s=void 0!==r?r:[];if(i<=0)return s;for(;n.length;)s.push(n.splice(0,i));return s}}},{"./Fable-Utility-Template.js":33,"async/eachLimit":6,"async/waterfall":22}],35:[function(t,e,r){
|
|
70
|
-
/**
|
|
71
|
-
* Fable Application Services Support Library
|
|
72
|
-
* @license MIT
|
|
73
|
-
* @author <steven@velozo.com>
|
|
74
|
-
*/
|
|
75
|
-
const n=t("fable-settings").FableSettings,i=t("fable-uuid").FableUUID,s=t("fable-log").FableLog,o=t("./Fable-Utility.js");e.exports=class{constructor(t){let e=new n(t);this.settingsManager=e,this.libUUID=new i(this.settingsManager.settings),this.log=new s(this.settingsManager.settings),this.log.initialize(),this.Utility=new o(this)}get settings(){return this.settingsManager.settings}get fable(){return this}getUUID(){return this.libUUID.getUUID()}}},{"./Fable-Utility.js":34,"fable-log":27,"fable-settings":30,"fable-uuid":32}],36:[function(t,e,r){"use strict";var n=12,i=0,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7];var o={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};function a(t,e){var r=o[t];return void 0===r?255:r<<e}e.exports=function(t){var e=t.indexOf("%");if(-1===e)return t;for(var r=t.length,o="",u=0,l=0,c=e,h=n;e>-1&&e<r;){var f=a(t[e+1],4)|a(t[e+2],0),p=s[f];if(h=s[256+h+p],l=l<<6|f&s[364+p],h!==n){if(h===i)return null;if((e+=3)<r&&37===t.charCodeAt(e))continue;return null}o+=t.slice(u,c),o+=l<=65535?String.fromCharCode(l):String.fromCharCode(55232+(l>>10),56320+(1023&l)),l=0,u=e+3,e=c=t.indexOf("%",u)}return o+t.slice(u)}},{}],37:[function(t,e,r){"use strict";e.exports=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if((n=e.length)!=r.length)return!1;for(i=n;0!=i--;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((n=(s=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;0!=i--;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!=e&&r!=r}},{}],38:[function(t,e,r){"use strict";const n=t("./parse"),i=t("./stringify"),s={parse:n,stringify:i};e.exports=s,e.exports.default=s,e.exports.parse=n,e.exports.stringify=i},{"./parse":40,"./stringify":41}],39:[function(t,e,r){const n=Array.from({length:256},((t,e)=>"%"+((e<16?"0":"")+e.toString(16)).toUpperCase())),i=new Int8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0]);e.exports={encodeString:function(t){const e=t.length;if(0===e)return"";let r="",s=0,o=0;t:for(;o<e;o++){let a=t.charCodeAt(o);for(;a<128;){if(1!==i[a]&&(s<o&&(r+=t.slice(s,o)),s=o+1,r+=n[a]),++o===e)break t;a=t.charCodeAt(o)}if(s<o&&(r+=t.slice(s,o)),a<2048){s=o+1,r+=n[192|a>>6]+n[128|63&a];continue}if(a<55296||a>=57344){s=o+1,r+=n[224|a>>12]+n[128|a>>6&63]+n[128|63&a];continue}if(++o,o>=e)throw new Error("URI malformed");s=o+1,a=65536+((1023&a)<<10|1023&t.charCodeAt(o)),r+=n[240|a>>18]+n[128|a>>12&63]+n[128|a>>6&63]+n[128|63&a]}return 0===s?t:s<e?r+t.slice(s):r}}},{}],40:[function(t,e,r){"use strict";const n=t("fast-decode-uri-component"),i=/\+/g,s=function(){};s.prototype=Object.create(null),e.exports=function(t){const e=new s;if("string"!=typeof t)return e;let r=t.length,o="",a="",u=-1,l=-1,c=!1,h=!1,f=!1,p=!1,d=!1,g=0;for(let s=0;s<r+1;s++)if(g=s!==r?t.charCodeAt(s):38,38===g){if(d=l>u,d||(l=s),o=t.slice(u+1,l),d||o.length>0){f&&(o=o.replace(i," ")),c&&(o=n(o)||o),d&&(a=t.slice(l+1,s),p&&(a=a.replace(i," ")),h&&(a=n(a)||a));const r=e[o];void 0===r?e[o]=a:r.pop?r.push(a):e[o]=[r,a]}a="",u=s,l=s,c=!1,h=!1,f=!1,p=!1}else 61===g?l<=u?l=s:h=!0:43===g?l>u?p=!0:f=!0:37===g&&(l>u?h=!0:c=!0);return e}},{"fast-decode-uri-component":36}],41:[function(t,e,r){"use strict";const{encodeString:n}=t("./internals/querystring");function i(t){const e=typeof t;return"string"===e?n(t):"bigint"===e?t.toString():"boolean"===e?t?"true":"false":"number"===e&&Number.isFinite(t)?t<1e21?""+t:n(""+t):""}e.exports=function(t){let e="";if(null===t||"object"!=typeof t)return e;const r=Object.keys(t),s=r.length;let o=0;for(let a=0;a<s;a++){const s=r[a],u=t[s],l=n(s)+"=";if(a&&(e+="&"),Array.isArray(u)){o=u.length;for(let t=0;t<o;t++)t&&(e+="&"),e+=l,e+=i(u[t])}else e+=l,e+=i(u)}return e}},{"./internals/querystring":39}],42:[function(t,e,r){"use strict";const n=t("./handler_storage"),i={STATIC:0,PARAMETRIC:1,WILDCARD:2};class s{constructor(){this.handlerStorage=new n}}class o extends s{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(t,e){const r=this.staticChildren[t.charAt(e)];return void 0!==r&&r.matchPrefix(t,e)?r:null}createStaticChild(t){if(0===t.length)return this;let e=this.staticChildren[t.charAt(0)];if(e){let r=1;for(;r<e.prefix.length;r++)if(t.charCodeAt(r)!==e.prefix.charCodeAt(r)){e=e.split(this,r);break}return e.createStaticChild(t.slice(r))}const r=t.charAt(0);return this.staticChildren[r]=new a(t),this.staticChildren[r]}}class a extends o{constructor(t){super(),this.prefix=t,this.wildcardChild=null,this.parametricChildren=[],this.kind=i.STATIC,this._compilePrefixMatch()}createParametricChild(t,e){const r=t&&t.source;let n=this.parametricChildren.find((t=>(t.regex&&t.regex.source)===r));return n||(n=new u(t,e),this.parametricChildren.push(n),this.parametricChildren.sort(((t,e)=>t.isRegex?e.isRegex?null===t.staticSuffix?1:null===e.staticSuffix?-1:e.staticSuffix.endsWith(t.staticSuffix)?1:t.staticSuffix.endsWith(e.staticSuffix)?-1:0:-1:1)),n)}createWildcardChild(){return this.wildcardChild||(this.wildcardChild=new l),this.wildcardChild}split(t,e){const r=this.prefix.slice(0,e),n=this.prefix.slice(e);this.prefix=n,this._compilePrefixMatch();const i=new a(r);return i.staticChildren[n.charAt(0)]=this,t.staticChildren[r.charAt(0)]=i,i}getNextNode(t,e,r,n){let i=this.findStaticMatchingChild(t,e),s=0;if(null===i){if(0===this.parametricChildren.length)return this.wildcardChild;i=this.parametricChildren[0],s=1}null!==this.wildcardChild&&r.push({paramsCount:n,brotherPathIndex:e,brotherNode:this.wildcardChild});for(let t=this.parametricChildren.length-1;t>=s;t--)r.push({paramsCount:n,brotherPathIndex:e,brotherNode:this.parametricChildren[t]});return i}_compilePrefixMatch(){if(1===this.prefix.length)return void(this.matchPrefix=()=>!0);const t=[];for(let e=1;e<this.prefix.length;e++){const r=this.prefix.charCodeAt(e);t.push(`path.charCodeAt(i + ${e}) === ${r}`)}this.matchPrefix=new Function("path","i",`return ${t.join(" && ")}`)}}class u extends o{constructor(t,e){super(),this.isRegex=!!t,this.regex=t||null,this.staticSuffix=e||null,this.kind=i.PARAMETRIC}getNextNode(t,e){return this.findStaticMatchingChild(t,e)}}class l extends s{constructor(){super(),this.kind=i.WILDCARD}getNextNode(){return null}}e.exports={StaticNode:a,ParametricNode:u,WildcardNode:l,NODE_TYPES:i}},{"./handler_storage":43}],43:[function(t,e,r){"use strict";e.exports=class{constructor(){this.unconstrainedHandler=null,this.constraints=[],this.handlers=[],this.constrainedHandlerStores=null}getMatchingHandler(t){return void 0===t?this.unconstrainedHandler:this._getHandlerMatchingConstraints(t)}addHandler(t,e,r,n,i){const s={handler:t,params:e,constraints:i,store:r||null,_createParamsObject:this._compileCreateParamsObject(e)};0===Object.keys(i).length&&(this.unconstrainedHandler=s);for(const t of Object.keys(i))this.constraints.includes(t)||("version"===t?this.constraints.unshift(t):this.constraints.push(t));if(this.handlers.length>=32)throw new Error("find-my-way supports a maximum of 32 route handlers per node when there are constraints, limit reached");this.handlers.push(s),this.handlers.sort(((t,e)=>Object.keys(t.constraints).length-Object.keys(e.constraints).length)),this._compileGetHandlerMatchingConstraints(n,i)}_compileCreateParamsObject(t){const e=[];for(let r=0;r<t.length;r++)e.push(`'${t[r]}': paramsArray[${r}]`);return new Function("paramsArray",`return {${e.join(",")}}`)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(t,e){for(let r=0;r<this.handlers.length;r++){const n=this.handlers[r].constraints[e];if(void 0!==n){let e=t.get(n)||0;e|=1<<r,t.set(n,e)}}}_constrainedIndexBitmask(t){let e=0;for(let r=0;r<this.handlers.length;r++){void 0!==this.handlers[r].constraints[t]&&(e|=1<<r)}return~e}_compileGetHandlerMatchingConstraints(t){this.constrainedHandlerStores={};for(const e of this.constraints){const r=t.newStoreForConstraint(e);this.constrainedHandlerStores[e]=r,this._buildConstraintStore(r,e)}const e=[];e.push(`\n let candidates = ${(1<<this.handlers.length)-1}\n let mask, matches\n `);for(const r of this.constraints){e.push(`\n mask = ${this._constrainedIndexBitmask(r)}\n value = derivedConstraints.${r}\n `);const n=t.strategies[r].mustMatchWhenDerived?"matches":"(matches | mask)";e.push(`\n if (value === undefined) {\n candidates &= mask\n } else {\n matches = this.constrainedHandlerStores.${r}.get(value) || 0\n candidates &= ${n}\n }\n if (candidates === 0) return null;\n `)}for(const r in t.strategies){t.strategies[r].mustMatchWhenDerived&&!this.constraints.includes(r)&&e.push(`if (derivedConstraints.${r} !== undefined) return null`)}e.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",e.join("\n"))}}},{}],44:[function(t,e,r){"use strict";const n=t("assert"),i=t("fast-querystring"),s=t("safe-regex2"),o=t("fast-deep-equal"),{flattenNode:a,compressFlattenedNode:u,prettyPrintFlattenedNode:l,prettyPrintRoutesArray:c}=t("./lib/pretty-print"),{StaticNode:h,NODE_TYPES:f}=t("./custom_node"),p=t("./lib/constrainer"),d=t("./lib/http-methods"),{safeDecodeURI:g,safeDecodeURIComponent:y}=t("./lib/url-sanitizer"),m=/^https?:\/\/.*?\//,v=/(\/:[^/()]*?)\?(\/?)/;if(!s(m))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!s(v))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function b(t){if(!(this instanceof b))return new b(t);(t=t||{}).defaultRoute?(n("function"==typeof t.defaultRoute,"The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(n("function"==typeof t.onBadUrl,"The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(n("function"==typeof t.buildPrettyMeta,"buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=C,t.querystringParser?(n("function"==typeof t.querystringParser,"querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=t=>""===t?{}:i.parse(t),this.caseSensitive=void 0===t.caseSensitive||t.caseSensitive,this.ignoreTrailingSlash=t.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=t.ignoreDuplicateSlashes||!1,this.maxParamLength=t.maxParamLength||100,this.allowUnsafeRegex=t.allowUnsafeRegex||!1,this.routes=[],this.trees={},this.constrainer=new p(t.constraints),this._routesPatterns={}}for(var S in b.prototype.on=function(t,e,r,i,s){"function"==typeof r&&(void 0!==i&&(s=i),i=r,r={}),n("string"==typeof e,"Path should be a string"),n(e.length>0,"The path could not be empty"),n("/"===e[0]||"*"===e[0],"The first character of a path should be `/` or `*`"),n("function"==typeof i,"Handler should be a function");const o=e.match(v);if(o){n(e.length===o.index+o[0].length,"Optional Parameter needs to be the last parameter of the path");const a=e.replace(v,"$1$2"),u=e.replace(v,"$2");return this.on(t,a,r,i,s),void this.on(t,u,r,i,s)}const a=e;this.ignoreDuplicateSlashes&&(e=w(e)),this.ignoreTrailingSlash&&(e=x(e));const u=Array.isArray(t)?t:[t];for(const t of u)this._on(t,e,r,i,s,a),this.routes.push({method:t,path:e,opts:r,handler:i,store:s})},b.prototype._on=function(t,e,r,i,a){n("string"==typeof t,"Method should be a string"),n(d.includes(t),`Method '${t}' is not an http method.`);let u={};if(void 0!==r.constraints&&(n("object"==typeof r.constraints&&null!==r.constraints,"Constraints should be an object"),0!==Object.keys(r.constraints).length&&(u=r.constraints)),this.constrainer.validateConstraints(u),this.constrainer.noteUsage(u),void 0===this.trees[t]&&(this.trees[t]=new h("/"),this._routesPatterns[t]=[]),"*"===e&&0!==this.trees[t].prefix.length){const e=this.trees[t];this.trees[t]=new h(""),this.trees[t].staticChildren["/"]=e}let l=this.trees[t],c=l.prefix.length;const f=[];for(let t=0;t<=e.length;t++){if(58===e.charCodeAt(t)&&58===e.charCodeAt(t+1)){t++;continue}const r=58===e.charCodeAt(t)&&58!==e.charCodeAt(t+1),i=42===e.charCodeAt(t);if(r||i||t===e.length&&t!==c){let r=e.slice(c,t);this.caseSensitive||(r=r.toLowerCase()),r=r.split("::").join(":"),r=r.split("%").join("%25"),l=l.createStaticChild(r)}if(r){let r=!1;const i=[];let o=t+1;for(let a=o;;a++){const u=e.charCodeAt(a),h=40===u,p=45===u||46===u,d=47===u||a===e.length;if(h||p||d){const u=e.slice(o,a);if(f.push(u),r=r||h||p,h){const t=O(e,a),r=e.slice(a,t+1);this.allowUnsafeRegex||n(s(new RegExp(r)),`The regex '${r}' is not safe!`),i.push(P(r)),a=t+1}else i.push("(.*?)");const g=a;for(;a<e.length;a++){const t=e.charCodeAt(a);if(47===t)break;if(58===t){if(58!==e.charCodeAt(a+1))break;a++}}let y=e.slice(g,a);if(y&&(y=y.split("::").join(":"),y=y.split("%").join("%25"),i.push(y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))),o=a+1,d||47===e.charCodeAt(a)||a===e.length){const n=r?"()"+y:y;e=e.slice(0,t+1)+n+e.slice(a),t+=n.length;const s=r?new RegExp("^"+i.join("")+"$"):null;l=l.createParametricChild(s,y||null),c=t+1;break}}}}else if(i&&(f.push("*"),l=l.createWildcardChild(),c=t+1,t!==e.length-1))throw new Error("Wildcard must be the last character in the route")}this.caseSensitive||(e=e.toLowerCase()),"*"===e&&(e="/*");for(const r of this._routesPatterns[t])if(r.path===e&&o(r.constraints,u))throw new Error(`Method '${t}' already declared for route '${e}' with constraints '${JSON.stringify(u)}'`);this._routesPatterns[t].push({path:e,params:f,constraints:u}),l.handlerStorage.addHandler(i,f,a,this.constrainer,u)},b.prototype.hasConstraintStrategy=function(t){return this.constrainer.hasConstraintStrategy(t)},b.prototype.addConstraintStrategy=function(t){this.constrainer.addConstraintStrategy(t),this._rebuild(this.routes)},b.prototype.reset=function(){this.trees={},this.routes=[],this._routesPatterns={}},b.prototype.off=function(t,e,r){n("string"==typeof e,"Path should be a string"),n(e.length>0,"The path could not be empty"),n("/"===e[0]||"*"===e[0],"The first character of a path should be `/` or `*`"),n(void 0===r||"object"==typeof r&&!Array.isArray(r)&&null!==r,"Constraints should be an object or undefined.");const i=e.match(v);if(i){n(e.length===i.index+i[0].length,"Optional Parameter needs to be the last parameter of the path");const s=e.replace(v,"$1$2"),o=e.replace(v,"$2");return this.off(t,s,r),void this.off(t,o,r)}this.ignoreDuplicateSlashes&&(e=w(e)),this.ignoreTrailingSlash&&(e=x(e));const s=Array.isArray(t)?t:[t];for(const t of s)this._off(t,e,r)},b.prototype._off=function(t,e,r){function i(r){return t!==r.method||e!==r.path}n("string"==typeof t,"Method should be a string"),n(d.includes(t),`Method '${t}' is not an http method.`);const s=r?function(t){return i(t)||!o(r,t.opts.constraints||{})}:i,a=this.routes.filter(s);this._rebuild(a)},b.prototype.lookup=function(t,e,r,n){if("function"==typeof r&&(n=r,r=void 0),void 0===n){const n=this.constrainer.deriveConstraints(t,r),i=this.find(t.method,t.url,n);return this.callHandler(i,t,e,r)}this.constrainer.deriveConstraints(t,r,((i,s)=>{if(null===i)try{const i=this.find(t.method,t.url,s),o=this.callHandler(i,t,e,r);n(null,o)}catch(i){n(i)}else n(i)}))},b.prototype.callHandler=function(t,e,r,n){return null===t?this._defaultRoute(e,r,n):void 0===n?t.handler(e,r,t.params,t.store,t.searchParams):t.handler.call(n,e,r,t.params,t.store,t.searchParams)},b.prototype.find=function(t,e,r){let n,i,s,o=this.trees[t];if(void 0===o)return null;47!==e.charCodeAt(0)&&(e=e.replace(m,"/")),this.ignoreDuplicateSlashes&&(e=w(e));try{n=g(e),e=n.path,i=n.querystring,s=n.shouldDecodeParam}catch(t){return this._onBadUrl(e)}this.ignoreTrailingSlash&&(e=x(e));const a=e;!1===this.caseSensitive&&(e=e.toLowerCase());const u=this.maxParamLength;let l=o.prefix.length;const c=[],h=e.length,p=[];for(;;){if(l===h){const t=o.handlerStorage.getMatchingHandler(r);if(null!==t)return{handler:t.handler,store:t.store,params:t._createParamsObject(c),searchParams:this.querystringParser(i)}}let t=o.getNextNode(e,l,p,c.length);if(null===t){if(0===p.length)return null;const e=p.pop();l=e.brotherPathIndex,c.splice(e.paramsCount),t=e.brotherNode}if(o=t,o.kind!==f.STATIC)if(o.kind!==f.WILDCARD){if(o.kind===f.PARAMETRIC){let t=a.indexOf("/",l);-1===t&&(t=h);let e=a.slice(l,t);if(s&&(e=y(e)),o.isRegex){const t=o.regex.exec(e);if(null===t)continue;for(let e=1;e<t.length;e++){const r=t[e];if(r.length>u)return null;c.push(r)}}else{if(e.length>u)return null;c.push(e)}l=t}}else{let t=a.slice(l);s&&(t=y(t)),c.push(t),l=h}else l+=o.prefix.length}},b.prototype._rebuild=function(t){this.reset();for(const e of t){const{method:t,path:r,opts:n,handler:i,store:s}=e;this._on(t,r,n,i,s),this.routes.push({method:t,path:r,opts:n,handler:i,store:s})}},b.prototype._defaultRoute=function(t,e,r){if(null!==this.defaultRoute)return void 0===r?this.defaultRoute(t,e):this.defaultRoute.call(r,t,e);e.statusCode=404,e.end()},b.prototype._onBadUrl=function(t){if(null===this.onBadUrl)return null;const e=this.onBadUrl;return{handler:(r,n,i)=>e(t,r,n),params:{},store:null}},b.prototype.prettyPrint=function(t={}){if(t.commonPrefix=void 0===t.commonPrefix||t.commonPrefix,!t.commonPrefix)return c.call(this,this.routes,t);const e={prefix:"/",nodes:[],children:{}};for(const t in this.trees){const r=this.trees[t];r&&a(e,r,t)}return u(e),l.call(this,e,"",!0,t)},d){if(!d.hasOwnProperty(S))continue;const t=d[S],e=t.toLowerCase();if(b.prototype[e])throw new Error("Method already exists: "+e);b.prototype[e]=function(e,r,n){return this.on(t,e,r,n)}}function w(t){return t.replace(/\/\/+/g,"/")}function x(t){return t.length>1&&47===t.charCodeAt(t.length-1)?t.slice(0,-1):t}function P(t){return 94===t.charCodeAt(1)&&(t=t.slice(0,1)+t.slice(2)),36===t.charCodeAt(t.length-2)&&(t=t.slice(0,t.length-2)+t.slice(t.length-1)),t}function O(t,e){for(var r=1;e<t.length;)if("\\"!==t[++e]){if(")"===t[e]?r--:"("===t[e]&&r++,!r)return e}else e++;throw new TypeError('Invalid regexp expression in "'+t+'"')}function C(t){return t&&t.store?Object.assign({},t.store):{}}b.prototype.all=function(t,e,r){this.on(d,t,e,r)},e.exports=b},{"./custom_node":42,"./lib/constrainer":45,"./lib/http-methods":46,"./lib/pretty-print":47,"./lib/url-sanitizer":50,assert:1,"fast-deep-equal":37,"fast-querystring":38,"safe-regex2":57}],45:[function(t,e,r){"use strict";const n=t("./strategies/accept-version"),i=t("./strategies/accept-host"),s=t("assert");e.exports=class{constructor(t){if(this.strategies={version:n,host:i},this.strategiesInUse=new Set,this.asyncStrategiesInUse=new Set,t)for(const e of Object.values(t))this.addConstraintStrategy(e)}isStrategyUsed(t){return this.strategiesInUse.has(t)||this.asyncStrategiesInUse.has(t)}hasConstraintStrategy(t){const e=this.strategies[t];return void 0!==e&&(e.isCustom||this.isStrategyUsed(t))}addConstraintStrategy(t){if(s("string"==typeof t.name&&""!==t.name,"strategy.name is required."),s(t.storage&&"function"==typeof t.storage,"strategy.storage function is required."),s(t.deriveConstraint&&"function"==typeof t.deriveConstraint,"strategy.deriveConstraint function is required."),this.strategies[t.name]&&this.strategies[t.name].isCustom)throw new Error(`There already exists a custom constraint with the name ${t.name}.`);if(this.isStrategyUsed(t.name))throw new Error(`There already exists a route with ${t.name} constraint.`);t.isCustom=!0,t.isAsync=3===t.deriveConstraint.length,this.strategies[t.name]=t,t.mustMatchWhenDerived&&this.noteUsage({[t.name]:t})}deriveConstraints(t,e,r){const n=this.deriveSyncConstraints(t,e);if(void 0===r)return n;this.deriveAsyncConstraints(n,t,e,r)}deriveSyncConstraints(t,e){}noteUsage(t){if(t){const e=this.strategiesInUse.size;for(const e in t){this.strategies[e].isAsync?this.asyncStrategiesInUse.add(e):this.strategiesInUse.add(e)}e!==this.strategiesInUse.size&&this._buildDeriveConstraints()}}newStoreForConstraint(t){if(!this.strategies[t])throw new Error(`No strategy registered for constraint key ${t}`);return this.strategies[t].storage()}validateConstraints(t){for(const e in t){const r=t[e];if(void 0===r)throw new Error("Can't pass an undefined constraint value, must pass null or no key at all");const n=this.strategies[e];if(!n)throw new Error(`No strategy registered for constraint key ${e}`);n.validate&&n.validate(r)}}deriveAsyncConstraints(t,e,r,n){let i=this.asyncStrategiesInUse.size;if(0!==i){t=t||{};for(const s of this.asyncStrategiesInUse){this.strategies[s].deriveConstraint(e,r,((e,r)=>{null===e?(t[s]=r,0==--i&&n(null,t)):n(e)}))}}else n(null,t)}_buildDeriveConstraints(){if(0===this.strategiesInUse.size)return;const t=["return {"];for(const e of this.strategiesInUse){const r=this.strategies[e];if(r.isCustom)t.push(` ${r.name}: this.strategies.${e}.deriveConstraint(req, ctx),`);else if("version"===e)t.push(" version: req.headers['accept-version'],");else{if("host"!==e)throw new Error("unknown non-custom strategy for compiling constraint derivation function");t.push(" host: req.headers.host || req.headers[':authority'],")}}t.push("}"),this.deriveSyncConstraints=new Function("req","ctx",t.join("\n")).bind(this)}}},{"./strategies/accept-host":48,"./strategies/accept-version":49,assert:1}],46:[function(t,e,r){"use strict";e.exports=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"]},{}],47:[function(t,e,r){"use strict";const n=" ",i="│ ",s="├── ",o="└── ",a="*",u="/",l=/(?=\/)/;function c(t){return Array.isArray(t)?t.map((t=>c(t))):"symbol"==typeof t?t.toString():"function"==typeof t?function(t){let e=t.name||"";return e=e.replace("bound","").trim(),e=(e||"anonymous")+"()",e}(t):t}function h(t,e){const r={},n=this.buildPrettyMeta(t);return Array.isArray(e)||(e=n?Reflect.ownKeys(n):[]),e.forEach((t=>{const e="symbol"==typeof t?t.toString():t;n&&n[t]&&(r[e]=c(n[t]))})),r}function f(t,e,r,a,u){let l="";if(a||u||(l+="\n"),a||(l+=`${e||""}${r?o:s}`),l+=`${t.path}`,t.handlers){const s=t.handlers.reduce(((t,e)=>{const r=t.findIndex((t=>JSON.stringify(t.opts)===JSON.stringify(e.opts)));return-1!==r?t[r].method=[t[r].method,e.method].join(", "):t.push(e),t}),[]);s.forEach(((o,u)=>{u>0&&(l+=`${a?"":e||""}${r?n:i}${t.path}`),l+=` (${o.method||"-"})`,o.opts&&"{}"!==JSON.stringify(o.opts)&&(l+=` ${JSON.stringify(o.opts)}`),o.meta&&Reflect.ownKeys(o.meta).forEach(((t,s)=>{l+=`\n${a?"":e||""}${r?n:i}`,l+=`• (${t}) ${JSON.stringify(o.meta[t])}`})),s.length>1&&u!==s.length-1&&(l+="\n")}))}else t.children.length>1&&(l+=" (-)");return a||(e=`${e||""}${r?n:i}`),t.children.forEach(((r,n)=>{const i=n===t.children.length-1,s=!t.handlers&&1===t.children.length;l+=f(r,e,i,s)})),l}e.exports={flattenNode:function t(e,r,n){if(0!==r.handlerStorage.handlers.length&&e.nodes.push({method:n,node:r}),r.parametricChildren&&r.parametricChildren[0]&&(e.children[":"]||(e.children[":"]={prefix:":",nodes:[],children:{}}),t(e.children[":"],r.parametricChildren[0],n)),r.wildcardChild&&(e.children["*"]||(e.children["*"]={prefix:"*",nodes:[],children:{}}),t(e.children["*"],r.wildcardChild,n)),r.staticChildren)for(const i of Object.values(r.staticChildren)){const r=i.prefix.split(l);let s,o=e;for(const t of r)s=o,o=o.children[t],o||(o={prefix:t,nodes:[],children:{}},s.children[t]=o);t(o,i,n)}},compressFlattenedNode:function t(e){const r=Object.keys(e.children);if(0===e.nodes.length&&1===r.length){const n=e.children[r[0]];if(n.nodes.length<=1)return t(n),e.nodes=n.nodes,e.prefix+=n.prefix,e.children=n.children,e}for(const r of Object.keys(e.children))t(e.children[r]);return e},prettyPrintFlattenedNode:function t(e,r,a,u){if(!this.buildPrettyMeta)throw new Error("buildPrettyMeta not defined");u.includeMeta=u.includeMeta||null;let l="";const c=[];for(const{node:t,method:r}of e.nodes)for(const e of t.handlerStorage.handlers)c.push({method:r,...e});c.length?c.forEach(((t,s)=>{let o=`(${t.method||"-"})`;Object.keys(t.constraints).length>0&&(o+=" "+JSON.stringify(t.constraints));let c="";const f=e.prefix.split("").map(((t,e)=>":"===t?e:null)).filter((t=>null!==t));if(f.length){let r=0;f.forEach(((n,i)=>{c+=e.prefix.slice(r,n+1),c+=t.params[t.params.length-f.length+i],i===f.length-1&&(c+=e.prefix.slice(n+1)),r=n+1}))}else c=e.prefix;if(l+=0===s?`${c} ${o}`:`\n${r}${a?n:i}${c} ${o}`,u.includeMeta){const e=h.call(this,t,u.includeMeta);Object.keys(e).forEach(((t,s)=>{l+=`\n${r||""}${a?n:i}`,l+=`• (${t}) ${JSON.stringify(e[t])}`}))}})):l=e.prefix;let f=`${r}${a?o:s}${l}\n`;r=`${r}${a?n:i}`;const p=Object.keys(e.children);for(let n=0;n<p.length;n++){const i=e.children[p[n]];f+=t.call(this,i,r,n===p.length-1,u)}return f},prettyPrintRoutesArray:function(t,e={}){if(!this.buildPrettyMeta)throw new Error("buildPrettyMeta not defined");e.includeMeta=e.includeMeta||null;const r=[];let n="";t.sort(((t,e)=>t.path&&e.path?t.path.localeCompare(e.path):0));for(let n=0;n<t.length;n++){const i=t[n],s=r.find((t=>i.path===t.path));if(s){s.handlers.push({method:i.method,opts:i.opts.constraints||void 0,meta:e.includeMeta?h.call(this,i,e.includeMeta):null});continue}const o={method:i.method,opts:i.opts.constraints||void 0,meta:e.includeMeta?h.call(this,i,e.includeMeta):null};r.push({path:i.path,methods:[i.method],opts:[i.opts],handlers:[o]})}if(!r.filter((t=>t.path===u)).length){const t={path:u,truncatedPath:"",methods:[],opts:[],handlers:[{}]};r.filter((t=>t.path===a)).length?r.splice(1,0,t):r.unshift(t)}const i=function(t){const e=[],r={result:e};return t.forEach(((t,e)=>{let n=t.path.split(l);n[0]!==u&&n[0]!==a&&(n=[u,n[0].slice(1),...n.slice(1)]),n.reduce(((e,r,i)=>{if(!e[r]){e[r]={result:[]};const s={path:r,children:e[r].result};i===n.length-1&&(s.handlers=t.handlers),e.result.push(s)}return e[r]}),r)})),e}(r);return i.forEach(((t,e)=>{n+=f(t,null,e===i.length-1,!1,!0),n+="\n"})),n}}},{}],48:[function(t,e,r){"use strict";const n=t("assert");e.exports={name:"host",mustMatchWhenDerived:!1,storage:function(){const t={},e=[];return{get:r=>{const n=t[r];if(n)return n;for(const t of e)if(t.host.test(r))return t.value},set:(r,n)=>{r instanceof RegExp?e.push({host:r,value:n}):t[r]=n}}},validate(t){n("string"==typeof t||"[object RegExp]"===Object.prototype.toString.call(t),"Host should be a string or a RegExp")}}},{assert:1}],49:[function(t,e,r){"use strict";const n=t("assert");function i(){if(!(this instanceof i))return new i;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}i.prototype.set=function(t,e){if("string"!=typeof t)throw new TypeError("Version should be a string");let[r,n,i]=t.split(".");return r=Number(r)||0,n=Number(n)||0,i=Number(i)||0,r>=this.maxMajor&&(this.maxMajor=r,this.store.x=e,this.store["*"]=e,this.store["x.x"]=e,this.store["x.x.x"]=e),n>=(this.maxMinors[r]||0)&&(this.maxMinors[r]=n,this.store[`${r}.x`]=e,this.store[`${r}.x.x`]=e),i>=(this.store[`${r}.${n}`]||0)&&(this.maxPatches[`${r}.${n}`]=i,this.store[`${r}.${n}.x`]=e),this.store[`${r}.${n}.${i}`]=e,this},i.prototype.get=function(t){return this.store[t]},e.exports={name:"version",mustMatchWhenDerived:!0,storage:i,validate(t){n("string"==typeof t,"Version should be a string")}}},{assert:1}],50:[function(t,e,r){"use strict";function n(t,e){return 50===t?53===e?"%":51===e?"#":52===e?"$":54===e?"&":66===e||98===e?"+":67===e||99===e?",":70===e||102===e?"/":null:51===t?65===e||97===e?":":66===e||98===e?";":68===e||100===e?"=":70===e||102===e?"?":null:52===t&&48===e?"@":null}e.exports={safeDecodeURI:function(t){let e=!1,r=!1,i="";for(let s=1;s<t.length;s++){const o=t.charCodeAt(s);if(37===o){const i=t.charCodeAt(s+1),o=t.charCodeAt(s+2);null===n(i,o)?e=!0:(r=!0,50===i&&53===o&&(e=!0,t=t.slice(0,s+1)+"25"+t.slice(s+1),s+=2),s+=2)}else if(63===o||59===o||35===o){i=t.slice(s+1),t=t.slice(0,s);break}}return{path:e?decodeURI(t):t,querystring:i,shouldDecodeParam:r}},safeDecodeURIComponent:function(t){const e=t.indexOf("%");if(-1===e)return t;let r="",i=e;for(let s=e;s<t.length;s++)if(37===t.charCodeAt(s)){const e=n(t.charCodeAt(s+1),t.charCodeAt(s+2));r+=t.slice(i,s)+e,i=s+3}return t.slice(0,e)+r+t.slice(i)}}},{}],51:[function(t,e,r){
|
|
7
|
+
*/function i(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function s(t){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var o=t("util/"),a=Object.prototype.hasOwnProperty,u=Array.prototype.slice,c="foo"===function(){}.name;function l(t){return Object.prototype.toString.call(t)}function f(t){return!s(t)&&("function"==typeof r.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var h=e.exports=m,p=/\s*function\s+([^\(\s]*)\s*/;function d(t){if(o.isFunction(t)){if(c)return t.name;var e=t.toString().match(p);return e&&e[1]}}function g(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function y(t){if(c||!o.isFunction(t))return o.inspect(t);var e=d(t);return"[Function"+(e?": "+e:"")+"]"}function v(t,e,r,n,i){throw new h.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function m(t,e){t||v(t,!0,e,"==",h.ok)}function b(t,e,r,n){if(t===e)return!0;if(s(t)&&s(e))return 0===i(t,e);if(o.isDate(t)&&o.isDate(e))return t.getTime()===e.getTime();if(o.isRegExp(t)&&o.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(f(t)&&f(e)&&l(t)===l(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===i(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(s(t)!==s(e))return!1;var a=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==a&&a===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(o.isPrimitive(t)||o.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=S(t),s=S(e);if(i&&!s||!i&&s)return!1;if(i)return b(t=u.call(t),e=u.call(e),r);var a,c,l=x(t),f=x(e);if(l.length!==f.length)return!1;for(l.sort(),f.sort(),c=l.length-1;c>=0;c--)if(l[c]!==f[c])return!1;for(c=l.length-1;c>=0;c--)if(!b(t[a=l[c]],e[a],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function S(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function w(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function C(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&v(i,r,"Missing expected exception"+n);var s="string"==typeof n,a=!t&&i&&!r;if((!t&&o.isError(i)&&s&&w(i,r)||a)&&v(i,r,"Got unwanted exception"+n),t&&i&&r&&!w(i,r)||!t&&i)throw i}h.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return g(y(t.actual),128)+" "+t.operator+" "+g(y(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=d(e),s=n.indexOf("\n"+i);if(s>=0){var o=n.indexOf("\n",s+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(h.AssertionError,Error),h.fail=v,h.ok=m,h.equal=function(t,e,r){t!=e&&v(t,e,r,"==",h.equal)},h.notEqual=function(t,e,r){t==e&&v(t,e,r,"!=",h.notEqual)},h.deepEqual=function(t,e,r){b(t,e,!1)||v(t,e,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,r){b(t,e,!0)||v(t,e,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){b(t,e,!1)&&v(t,e,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){b(e,r,!0)&&v(e,r,n,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,r){t!==e&&v(t,e,r,"===",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,"!==",h.notStrictEqual)},h.throws=function(t,e,r){C(!0,t,e,r)},h.doesNotThrow=function(t,e,r){C(!1,t,e,r)},h.ifError=function(t){if(t)throw t},h.strict=n((function t(e,r){e||v(e,!0,r,"==",t)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var x=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":36,"util/":4}],2:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],3:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],4:[function(t,e,r){(function(e,n){(function(){var i=/%[sdj%]/g;r.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(a(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,s=n.length,o=String(t).replace(i,(function(t){if("%%"===t)return"%";if(r>=s)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),u=n[r];r<s;u=n[++r])g(u)||!S(u)?o+=" "+u:o+=" "+a(u);return o},r.deprecate=function(t,i){if(m(n.process))return function(){return r.deprecate(t,i).apply(this,arguments)};if(!0===e.noDeprecation)return t;var s=!1;return function(){if(!s){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),s=!0}return t.apply(this,arguments)}};var s,o={};function a(t,e){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),l(n,t,n.depth)}function u(t,e){var r=a.styles[e];return r?"["+a.colors[r][0]+"m"+t+"["+a.colors[r][1]+"m":t}function c(t,e){return t}function l(t,e,n){if(t.customInspect&&e&&x(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return v(i)||(i=l(t,i,n)),i}var s=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(y(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,e);if(s)return s;var o=Object.keys(e),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),C(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(e);if(0===o.length){if(x(e)){var u=e.name?": "+e.name:"";return t.stylize("[Function"+u+"]","special")}if(b(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(w(e))return t.stylize(Date.prototype.toString.call(e),"date");if(C(e))return f(e)}var c,S="",O=!1,P=["{","}"];(p(e)&&(O=!0,P=["[","]"]),x(e))&&(S=" [Function"+(e.name?": "+e.name:"")+"]");return b(e)&&(S=" "+RegExp.prototype.toString.call(e)),w(e)&&(S=" "+Date.prototype.toUTCString.call(e)),C(e)&&(S=" "+f(e)),0!==o.length||O&&0!=e.length?n<0?b(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=O?function(t,e,r,n,i){for(var s=[],o=0,a=e.length;o<a;++o)j(e,String(o))?s.push(h(t,e,r,n,String(o),!0)):s.push("");return i.forEach((function(i){i.match(/^\d+$/)||s.push(h(t,e,r,n,i,!0))})),s}(t,e,n,a,o):o.map((function(r){return h(t,e,n,a,r,O)})),t.seen.pop(),function(t,e,r){var n=t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,S,P)):P[0]+S+P[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,s){var o,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),j(n,i)||(o="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=g(r)?l(t,u.value,null):l(t,u.value,r-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),m(o)){if(s&&i.match(/^\d+$/))return a;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function g(t){return null===t}function y(t){return"number"==typeof t}function v(t){return"string"==typeof t}function m(t){return void 0===t}function b(t){return S(t)&&"[object RegExp]"===O(t)}function S(t){return"object"==typeof t&&null!==t}function w(t){return S(t)&&"[object Date]"===O(t)}function C(t){return S(t)&&("[object Error]"===O(t)||t instanceof Error)}function x(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function P(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(m(s)&&(s=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(s)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=d,r.isNull=g,r.isNullOrUndefined=function(t){return null==t},r.isNumber=y,r.isString=v,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=m,r.isRegExp=b,r.isObject=S,r.isDate=w,r.isError=C,r.isFunction=x,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function j(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[P(t.getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":"),[t.getDate(),E[t.getMonth()],e].join(" ")),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!S(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":3,_process:37,inherits:2}],5:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){if((0,s.isAsync)(t))return function(...e){const r=e.pop();return a(t.apply(this,e),r)};return(0,n.default)((function(e,r){var n;try{n=t.apply(this,e)}catch(t){return r(t)}if(n&&"function"==typeof n.then)return a(n,r);r(null,n)}))};var n=o(t("./internal/initialParams.js")),i=o(t("./internal/setImmediate.js")),s=t("./internal/wrapAsync.js");function o(t){return t&&t.__esModule?t:{default:t}}function a(t,e){return t.then((t=>{u(e,null,t)}),(t=>{u(e,t&&t.message?t:new Error(t))}))}function u(t,e,r){try{t(e,r)}catch(t){(0,i.default)((t=>{throw t}),t)}}e.exports=r.default},{"./internal/initialParams.js":13,"./internal/setImmediate.js":18,"./internal/wrapAsync.js":19}],6:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=o(t("./internal/eachOfLimit.js")),i=o(t("./internal/wrapAsync.js")),s=o(t("./internal/awaitify.js"));function o(t){return t&&t.__esModule?t:{default:t}}r.default=(0,s.default)((function(t,e,r,s){return(0,n.default)(e)(t,(0,i.default)(r),s)}),4),e.exports=r.default},{"./internal/awaitify.js":9,"./internal/eachOfLimit.js":11,"./internal/wrapAsync.js":19}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=s(t("./eachOfLimit.js")),i=s(t("./internal/awaitify.js"));function s(t){return t&&t.__esModule?t:{default:t}}r.default=(0,i.default)((function(t,e,r){return(0,n.default)(t,1,e,r)}),3),e.exports=r.default},{"./eachOfLimit.js":6,"./internal/awaitify.js":9}],8:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t,e,r,n){let i=!1,o=!1,a=!1,u=0,c=0;function l(){u>=e||a||i||(a=!0,t.next().then((({value:t,done:e})=>{if(!o&&!i){if(a=!1,e)return i=!0,void(u<=0&&n(null));u++,r(t,c,f),c++,l()}})).catch(h))}function f(t,e){if(u-=1,!o)return t?h(t):!1===t?(i=!0,void(o=!0)):e===s.default||i&&u<=0?(i=!0,n(null)):void l()}function h(t){o||(a=!1,i=!0,n(t))}l()};var n,i=t("./breakLoop.js"),s=(n=i)&&n.__esModule?n:{default:n};e.exports=r.default},{"./breakLoop.js":10}],9:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t,e=t.length){if(!e)throw new Error("arity is undefined");return function(...r){return"function"==typeof r[e-1]?t.apply(this,r):new Promise(((n,i)=>{r[e-1]=(t,...e)=>{if(t)return i(t);n(e.length>1?e:e[0])},t.apply(this,r)}))}},e.exports=r.default},{}],10:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.default={},e.exports=r.default},{}],11:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=c(t("./once.js")),i=c(t("./iterator.js")),s=c(t("./onlyOnce.js")),o=t("./wrapAsync.js"),a=c(t("./asyncEachOfLimit.js")),u=c(t("./breakLoop.js"));function c(t){return t&&t.__esModule?t:{default:t}}r.default=t=>(e,r,c)=>{if(c=(0,n.default)(c),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return c(null);if((0,o.isAsyncGenerator)(e))return(0,a.default)(e,t,r,c);if((0,o.isAsyncIterable)(e))return(0,a.default)(e[Symbol.asyncIterator](),t,r,c);var l=(0,i.default)(e),f=!1,h=!1,p=0,d=!1;function g(t,e){if(!h)if(p-=1,t)f=!0,c(t);else if(!1===t)f=!0,h=!0;else{if(e===u.default||f&&p<=0)return f=!0,c(null);d||y()}}function y(){for(d=!0;p<t&&!f;){var e=l();if(null===e)return f=!0,void(p<=0&&c(null));p+=1,r(e.value,e.key,(0,s.default)(g))}d=!1}y()},e.exports=r.default},{"./asyncEachOfLimit.js":8,"./breakLoop.js":10,"./iterator.js":15,"./once.js":16,"./onlyOnce.js":17,"./wrapAsync.js":19}],12:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()},e.exports=r.default},{}],13:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return function(...e){var r=e.pop();return t.call(this,e,r)}},e.exports=r.default},{}],14:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return t&&"number"==typeof t.length&&t.length>=0&&t.length%1==0},e.exports=r.default},{}],15:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){if((0,n.default)(t))return function(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}(t);var e=(0,i.default)(t);return e?function(t){var e=-1;return function(){var r=t.next();return r.done?null:(e++,{value:r.value,key:e})}}(e):(r=t,s=r?Object.keys(r):[],o=-1,a=s.length,function t(){var e=s[++o];return"__proto__"===e?t():o<a?{value:r[e],key:e}:null});var r,s,o,a};var n=s(t("./isArrayLike.js")),i=s(t("./getIterator.js"));function s(t){return t&&t.__esModule?t:{default:t}}e.exports=r.default},{"./getIterator.js":12,"./isArrayLike.js":14}],16:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){function e(...e){if(null!==t){var r=t;t=null,r.apply(this,e)}}return Object.assign(e,t),e},e.exports=r.default},{}],17:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return function(...e){if(null===t)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}},e.exports=r.default},{}],18:[function(t,e,r){(function(t,e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.fallback=a,r.wrap=u;var n,i=r.hasQueueMicrotask="function"==typeof queueMicrotask&&queueMicrotask,s=r.hasSetImmediate="function"==typeof e&&e,o=r.hasNextTick="object"==typeof t&&"function"==typeof t.nextTick;function a(t){setTimeout(t,0)}function u(t){return(e,...r)=>t((()=>e(...r)))}n=i?queueMicrotask:s?e:o?t.nextTick:a,r.default=u(n)}).call(this)}).call(this,t("_process"),t("timers").setImmediate)},{_process:37,timers:44}],19:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isAsyncIterable=r.isAsyncGenerator=r.isAsync=void 0;var n,i=t("../asyncify.js"),s=(n=i)&&n.__esModule?n:{default:n};function o(t){return"AsyncFunction"===t[Symbol.toStringTag]}r.default=function(t){if("function"!=typeof t)throw new Error("expected a function");return o(t)?(0,s.default)(t):t},r.isAsync=o,r.isAsyncGenerator=function(t){return"AsyncGenerator"===t[Symbol.toStringTag]},r.isAsyncIterable=function(t){return"function"==typeof t[Symbol.asyncIterator]}},{"../asyncify.js":5}],20:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=a(t("./internal/once.js")),i=a(t("./internal/onlyOnce.js")),s=a(t("./internal/wrapAsync.js")),o=a(t("./internal/awaitify.js"));function a(t){return t&&t.__esModule?t:{default:t}}r.default=(0,o.default)((function(t,e){if(e=(0,n.default)(e),!Array.isArray(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var r=0;function o(e){(0,s.default)(t[r++])(...e,(0,i.default)(a))}function a(n,...i){if(!1!==n)return n||r===t.length?e(n,...i):void o(i)}o([])})),e.exports=r.default},{"./internal/awaitify.js":9,"./internal/once.js":16,"./internal/onlyOnce.js":17,"./internal/wrapAsync.js":19}],21:[function(t,e,r){"use strict";var n=12,i=0,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7];var o={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};function a(t,e){var r=o[t];return void 0===r?255:r<<e}e.exports=function(t){var e=t.indexOf("%");if(-1===e)return t;for(var r=t.length,o="",u=0,c=0,l=e,f=n;e>-1&&e<r;){var h=a(t[e+1],4)|a(t[e+2],0),p=s[h];if(f=s[256+f+p],c=c<<6|h&s[364+p],f!==n){if(f===i)return null;if((e+=3)<r&&37===t.charCodeAt(e))continue;return null}o+=t.slice(u,l),o+=c<=65535?String.fromCharCode(c):String.fromCharCode(55232+(c>>10),56320+(1023&c)),c=0,u=e+3,e=l=t.indexOf("%",u)}return o+t.slice(u)}},{}],22:[function(t,e,r){"use strict";e.exports=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if((n=e.length)!=r.length)return!1;for(i=n;0!=i--;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((n=(s=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;0!=i--;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!=e&&r!=r}},{}],23:[function(t,e,r){"use strict";const n=t("./parse"),i=t("./stringify"),s={parse:n,stringify:i};e.exports=s,e.exports.default=s,e.exports.parse=n,e.exports.stringify=i},{"./parse":25,"./stringify":26}],24:[function(t,e,r){const n=Array.from({length:256},((t,e)=>"%"+((e<16?"0":"")+e.toString(16)).toUpperCase())),i=new Int8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0]);e.exports={encodeString:function(t){const e=t.length;if(0===e)return"";let r="",s=0,o=0;t:for(;o<e;o++){let a=t.charCodeAt(o);for(;a<128;){if(1!==i[a]&&(s<o&&(r+=t.slice(s,o)),s=o+1,r+=n[a]),++o===e)break t;a=t.charCodeAt(o)}if(s<o&&(r+=t.slice(s,o)),a<2048){s=o+1,r+=n[192|a>>6]+n[128|63&a];continue}if(a<55296||a>=57344){s=o+1,r+=n[224|a>>12]+n[128|a>>6&63]+n[128|63&a];continue}if(++o,o>=e)throw new Error("URI malformed");s=o+1,a=65536+((1023&a)<<10|1023&t.charCodeAt(o)),r+=n[240|a>>18]+n[128|a>>12&63]+n[128|a>>6&63]+n[128|63&a]}return 0===s?t:s<e?r+t.slice(s):r}}},{}],25:[function(t,e,r){"use strict";const n=t("fast-decode-uri-component"),i=/\+/g,s=function(){};s.prototype=Object.create(null),e.exports=function(t){const e=new s;if("string"!=typeof t)return e;let r=t.length,o="",a="",u=-1,c=-1,l=!1,f=!1,h=!1,p=!1,d=!1,g=0;for(let s=0;s<r+1;s++)if(g=s!==r?t.charCodeAt(s):38,38===g){if(d=c>u,d||(c=s),o=t.slice(u+1,c),d||o.length>0){h&&(o=o.replace(i," ")),l&&(o=n(o)||o),d&&(a=t.slice(c+1,s),p&&(a=a.replace(i," ")),f&&(a=n(a)||a));const r=e[o];void 0===r?e[o]=a:r.pop?r.push(a):e[o]=[r,a]}a="",u=s,c=s,l=!1,f=!1,h=!1,p=!1}else 61===g?c<=u?c=s:f=!0:43===g?c>u?p=!0:h=!0:37===g&&(c>u?f=!0:l=!0);return e}},{"fast-decode-uri-component":21}],26:[function(t,e,r){"use strict";const{encodeString:n}=t("./internals/querystring");function i(t){const e=typeof t;return"string"===e?n(t):"bigint"===e?t.toString():"boolean"===e?t?"true":"false":"number"===e&&Number.isFinite(t)?t<1e21?""+t:n(""+t):""}e.exports=function(t){let e="";if(null===t||"object"!=typeof t)return e;const r=Object.keys(t),s=r.length;let o=0;for(let a=0;a<s;a++){const s=r[a],u=t[s],c=n(s)+"=";if(a&&(e+="&"),Array.isArray(u)){o=u.length;for(let t=0;t<o;t++)t&&(e+="&"),e+=c,e+=i(u[t])}else e+=c,e+=i(u)}return e}},{"./internals/querystring":24}],27:[function(t,e,r){"use strict";const n=t("./handler_storage"),i={STATIC:0,PARAMETRIC:1,WILDCARD:2};class s{constructor(){this.handlerStorage=new n}}class o extends s{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(t,e){const r=this.staticChildren[t.charAt(e)];return void 0!==r&&r.matchPrefix(t,e)?r:null}createStaticChild(t){if(0===t.length)return this;let e=this.staticChildren[t.charAt(0)];if(e){let r=1;for(;r<e.prefix.length;r++)if(t.charCodeAt(r)!==e.prefix.charCodeAt(r)){e=e.split(this,r);break}return e.createStaticChild(t.slice(r))}const r=t.charAt(0);return this.staticChildren[r]=new a(t),this.staticChildren[r]}}class a extends o{constructor(t){super(),this.prefix=t,this.wildcardChild=null,this.parametricChildren=[],this.kind=i.STATIC,this._compilePrefixMatch()}createParametricChild(t,e){const r=t&&t.source;let n=this.parametricChildren.find((t=>(t.regex&&t.regex.source)===r));return n||(n=new u(t,e),this.parametricChildren.push(n),this.parametricChildren.sort(((t,e)=>t.isRegex?e.isRegex?null===t.staticSuffix?1:null===e.staticSuffix?-1:e.staticSuffix.endsWith(t.staticSuffix)?1:t.staticSuffix.endsWith(e.staticSuffix)?-1:0:-1:1)),n)}createWildcardChild(){return this.wildcardChild||(this.wildcardChild=new c),this.wildcardChild}split(t,e){const r=this.prefix.slice(0,e),n=this.prefix.slice(e);this.prefix=n,this._compilePrefixMatch();const i=new a(r);return i.staticChildren[n.charAt(0)]=this,t.staticChildren[r.charAt(0)]=i,i}getNextNode(t,e,r,n){let i=this.findStaticMatchingChild(t,e),s=0;if(null===i){if(0===this.parametricChildren.length)return this.wildcardChild;i=this.parametricChildren[0],s=1}null!==this.wildcardChild&&r.push({paramsCount:n,brotherPathIndex:e,brotherNode:this.wildcardChild});for(let t=this.parametricChildren.length-1;t>=s;t--)r.push({paramsCount:n,brotherPathIndex:e,brotherNode:this.parametricChildren[t]});return i}_compilePrefixMatch(){if(1===this.prefix.length)return void(this.matchPrefix=()=>!0);const t=[];for(let e=1;e<this.prefix.length;e++){const r=this.prefix.charCodeAt(e);t.push(`path.charCodeAt(i + ${e}) === ${r}`)}this.matchPrefix=new Function("path","i",`return ${t.join(" && ")}`)}}class u extends o{constructor(t,e){super(),this.isRegex=!!t,this.regex=t||null,this.staticSuffix=e||null,this.kind=i.PARAMETRIC}getNextNode(t,e){return this.findStaticMatchingChild(t,e)}}class c extends s{constructor(){super(),this.kind=i.WILDCARD}getNextNode(){return null}}e.exports={StaticNode:a,ParametricNode:u,WildcardNode:c,NODE_TYPES:i}},{"./handler_storage":28}],28:[function(t,e,r){"use strict";e.exports=class{constructor(){this.unconstrainedHandler=null,this.constraints=[],this.handlers=[],this.constrainedHandlerStores=null}getMatchingHandler(t){return void 0===t?this.unconstrainedHandler:this._getHandlerMatchingConstraints(t)}addHandler(t,e,r,n,i){const s={handler:t,params:e,constraints:i,store:r||null,_createParamsObject:this._compileCreateParamsObject(e)};0===Object.keys(i).length&&(this.unconstrainedHandler=s);for(const t of Object.keys(i))this.constraints.includes(t)||("version"===t?this.constraints.unshift(t):this.constraints.push(t));if(this.handlers.length>=32)throw new Error("find-my-way supports a maximum of 32 route handlers per node when there are constraints, limit reached");this.handlers.push(s),this.handlers.sort(((t,e)=>Object.keys(t.constraints).length-Object.keys(e.constraints).length)),this._compileGetHandlerMatchingConstraints(n,i)}_compileCreateParamsObject(t){const e=[];for(let r=0;r<t.length;r++)e.push(`'${t[r]}': paramsArray[${r}]`);return new Function("paramsArray",`return {${e.join(",")}}`)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(t,e){for(let r=0;r<this.handlers.length;r++){const n=this.handlers[r].constraints[e];if(void 0!==n){let e=t.get(n)||0;e|=1<<r,t.set(n,e)}}}_constrainedIndexBitmask(t){let e=0;for(let r=0;r<this.handlers.length;r++){void 0!==this.handlers[r].constraints[t]&&(e|=1<<r)}return~e}_compileGetHandlerMatchingConstraints(t){this.constrainedHandlerStores={};for(const e of this.constraints){const r=t.newStoreForConstraint(e);this.constrainedHandlerStores[e]=r,this._buildConstraintStore(r,e)}const e=[];e.push(`\n let candidates = ${(1<<this.handlers.length)-1}\n let mask, matches\n `);for(const r of this.constraints){e.push(`\n mask = ${this._constrainedIndexBitmask(r)}\n value = derivedConstraints.${r}\n `);const n=t.strategies[r].mustMatchWhenDerived?"matches":"(matches | mask)";e.push(`\n if (value === undefined) {\n candidates &= mask\n } else {\n matches = this.constrainedHandlerStores.${r}.get(value) || 0\n candidates &= ${n}\n }\n if (candidates === 0) return null;\n `)}for(const r in t.strategies){t.strategies[r].mustMatchWhenDerived&&!this.constraints.includes(r)&&e.push(`if (derivedConstraints.${r} !== undefined) return null`)}e.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",e.join("\n"))}}},{}],29:[function(t,e,r){"use strict";const n=t("assert"),i=t("fast-querystring"),s=t("safe-regex2"),o=t("fast-deep-equal"),{flattenNode:a,compressFlattenedNode:u,prettyPrintFlattenedNode:c,prettyPrintRoutesArray:l}=t("./lib/pretty-print"),{StaticNode:f,NODE_TYPES:h}=t("./custom_node"),p=t("./lib/constrainer"),d=t("./lib/http-methods"),{safeDecodeURI:g,safeDecodeURIComponent:y}=t("./lib/url-sanitizer"),v=/^https?:\/\/.*?\//,m=/(\/:[^/()]*?)\?(\/?)/;if(!s(v))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!s(m))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function b(t){if(!(this instanceof b))return new b(t);(t=t||{}).defaultRoute?(n("function"==typeof t.defaultRoute,"The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(n("function"==typeof t.onBadUrl,"The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(n("function"==typeof t.buildPrettyMeta,"buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=P,t.querystringParser?(n("function"==typeof t.querystringParser,"querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=t=>""===t?{}:i.parse(t),this.caseSensitive=void 0===t.caseSensitive||t.caseSensitive,this.ignoreTrailingSlash=t.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=t.ignoreDuplicateSlashes||!1,this.maxParamLength=t.maxParamLength||100,this.allowUnsafeRegex=t.allowUnsafeRegex||!1,this.routes=[],this.trees={},this.constrainer=new p(t.constraints),this._routesPatterns={}}for(var S in b.prototype.on=function(t,e,r,i,s){"function"==typeof r&&(void 0!==i&&(s=i),i=r,r={}),n("string"==typeof e,"Path should be a string"),n(e.length>0,"The path could not be empty"),n("/"===e[0]||"*"===e[0],"The first character of a path should be `/` or `*`"),n("function"==typeof i,"Handler should be a function");const o=e.match(m);if(o){n(e.length===o.index+o[0].length,"Optional Parameter needs to be the last parameter of the path");const a=e.replace(m,"$1$2"),u=e.replace(m,"$2");return this.on(t,a,r,i,s),void this.on(t,u,r,i,s)}const a=e;this.ignoreDuplicateSlashes&&(e=w(e)),this.ignoreTrailingSlash&&(e=C(e));const u=Array.isArray(t)?t:[t];for(const t of u)this._on(t,e,r,i,s,a),this.routes.push({method:t,path:e,opts:r,handler:i,store:s})},b.prototype._on=function(t,e,r,i,a){n("string"==typeof t,"Method should be a string"),n(d.includes(t),`Method '${t}' is not an http method.`);let u={};if(void 0!==r.constraints&&(n("object"==typeof r.constraints&&null!==r.constraints,"Constraints should be an object"),0!==Object.keys(r.constraints).length&&(u=r.constraints)),this.constrainer.validateConstraints(u),this.constrainer.noteUsage(u),void 0===this.trees[t]&&(this.trees[t]=new f("/"),this._routesPatterns[t]=[]),"*"===e&&0!==this.trees[t].prefix.length){const e=this.trees[t];this.trees[t]=new f(""),this.trees[t].staticChildren["/"]=e}let c=this.trees[t],l=c.prefix.length;const h=[];for(let t=0;t<=e.length;t++){if(58===e.charCodeAt(t)&&58===e.charCodeAt(t+1)){t++;continue}const r=58===e.charCodeAt(t)&&58!==e.charCodeAt(t+1),i=42===e.charCodeAt(t);if(r||i||t===e.length&&t!==l){let r=e.slice(l,t);this.caseSensitive||(r=r.toLowerCase()),r=r.split("::").join(":"),r=r.split("%").join("%25"),c=c.createStaticChild(r)}if(r){let r=!1;const i=[];let o=t+1;for(let a=o;;a++){const u=e.charCodeAt(a),f=40===u,p=45===u||46===u,d=47===u||a===e.length;if(f||p||d){const u=e.slice(o,a);if(h.push(u),r=r||f||p,f){const t=O(e,a),r=e.slice(a,t+1);this.allowUnsafeRegex||n(s(new RegExp(r)),`The regex '${r}' is not safe!`),i.push(x(r)),a=t+1}else i.push("(.*?)");const g=a;for(;a<e.length;a++){const t=e.charCodeAt(a);if(47===t)break;if(58===t){if(58!==e.charCodeAt(a+1))break;a++}}let y=e.slice(g,a);if(y&&(y=y.split("::").join(":"),y=y.split("%").join("%25"),i.push(y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))),o=a+1,d||47===e.charCodeAt(a)||a===e.length){const n=r?"()"+y:y;e=e.slice(0,t+1)+n+e.slice(a),t+=n.length;const s=r?new RegExp("^"+i.join("")+"$"):null;c=c.createParametricChild(s,y||null),l=t+1;break}}}}else if(i&&(h.push("*"),c=c.createWildcardChild(),l=t+1,t!==e.length-1))throw new Error("Wildcard must be the last character in the route")}this.caseSensitive||(e=e.toLowerCase()),"*"===e&&(e="/*");for(const r of this._routesPatterns[t])if(r.path===e&&o(r.constraints,u))throw new Error(`Method '${t}' already declared for route '${e}' with constraints '${JSON.stringify(u)}'`);this._routesPatterns[t].push({path:e,params:h,constraints:u}),c.handlerStorage.addHandler(i,h,a,this.constrainer,u)},b.prototype.hasConstraintStrategy=function(t){return this.constrainer.hasConstraintStrategy(t)},b.prototype.addConstraintStrategy=function(t){this.constrainer.addConstraintStrategy(t),this._rebuild(this.routes)},b.prototype.reset=function(){this.trees={},this.routes=[],this._routesPatterns={}},b.prototype.off=function(t,e,r){n("string"==typeof e,"Path should be a string"),n(e.length>0,"The path could not be empty"),n("/"===e[0]||"*"===e[0],"The first character of a path should be `/` or `*`"),n(void 0===r||"object"==typeof r&&!Array.isArray(r)&&null!==r,"Constraints should be an object or undefined.");const i=e.match(m);if(i){n(e.length===i.index+i[0].length,"Optional Parameter needs to be the last parameter of the path");const s=e.replace(m,"$1$2"),o=e.replace(m,"$2");return this.off(t,s,r),void this.off(t,o,r)}this.ignoreDuplicateSlashes&&(e=w(e)),this.ignoreTrailingSlash&&(e=C(e));const s=Array.isArray(t)?t:[t];for(const t of s)this._off(t,e,r)},b.prototype._off=function(t,e,r){function i(r){return t!==r.method||e!==r.path}n("string"==typeof t,"Method should be a string"),n(d.includes(t),`Method '${t}' is not an http method.`);const s=r?function(t){return i(t)||!o(r,t.opts.constraints||{})}:i,a=this.routes.filter(s);this._rebuild(a)},b.prototype.lookup=function(t,e,r,n){if("function"==typeof r&&(n=r,r=void 0),void 0===n){const n=this.constrainer.deriveConstraints(t,r),i=this.find(t.method,t.url,n);return this.callHandler(i,t,e,r)}this.constrainer.deriveConstraints(t,r,((i,s)=>{if(null===i)try{const i=this.find(t.method,t.url,s),o=this.callHandler(i,t,e,r);n(null,o)}catch(i){n(i)}else n(i)}))},b.prototype.callHandler=function(t,e,r,n){return null===t?this._defaultRoute(e,r,n):void 0===n?t.handler(e,r,t.params,t.store,t.searchParams):t.handler.call(n,e,r,t.params,t.store,t.searchParams)},b.prototype.find=function(t,e,r){let n,i,s,o=this.trees[t];if(void 0===o)return null;47!==e.charCodeAt(0)&&(e=e.replace(v,"/")),this.ignoreDuplicateSlashes&&(e=w(e));try{n=g(e),e=n.path,i=n.querystring,s=n.shouldDecodeParam}catch(t){return this._onBadUrl(e)}this.ignoreTrailingSlash&&(e=C(e));const a=e;!1===this.caseSensitive&&(e=e.toLowerCase());const u=this.maxParamLength;let c=o.prefix.length;const l=[],f=e.length,p=[];for(;;){if(c===f){const t=o.handlerStorage.getMatchingHandler(r);if(null!==t)return{handler:t.handler,store:t.store,params:t._createParamsObject(l),searchParams:this.querystringParser(i)}}let t=o.getNextNode(e,c,p,l.length);if(null===t){if(0===p.length)return null;const e=p.pop();c=e.brotherPathIndex,l.splice(e.paramsCount),t=e.brotherNode}if(o=t,o.kind!==h.STATIC)if(o.kind!==h.WILDCARD){if(o.kind===h.PARAMETRIC){let t=a.indexOf("/",c);-1===t&&(t=f);let e=a.slice(c,t);if(s&&(e=y(e)),o.isRegex){const t=o.regex.exec(e);if(null===t)continue;for(let e=1;e<t.length;e++){const r=t[e];if(r.length>u)return null;l.push(r)}}else{if(e.length>u)return null;l.push(e)}c=t}}else{let t=a.slice(c);s&&(t=y(t)),l.push(t),c=f}else c+=o.prefix.length}},b.prototype._rebuild=function(t){this.reset();for(const e of t){const{method:t,path:r,opts:n,handler:i,store:s}=e;this._on(t,r,n,i,s),this.routes.push({method:t,path:r,opts:n,handler:i,store:s})}},b.prototype._defaultRoute=function(t,e,r){if(null!==this.defaultRoute)return void 0===r?this.defaultRoute(t,e):this.defaultRoute.call(r,t,e);e.statusCode=404,e.end()},b.prototype._onBadUrl=function(t){if(null===this.onBadUrl)return null;const e=this.onBadUrl;return{handler:(r,n,i)=>e(t,r,n),params:{},store:null}},b.prototype.prettyPrint=function(t={}){if(t.commonPrefix=void 0===t.commonPrefix||t.commonPrefix,!t.commonPrefix)return l.call(this,this.routes,t);const e={prefix:"/",nodes:[],children:{}};for(const t in this.trees){const r=this.trees[t];r&&a(e,r,t)}return u(e),c.call(this,e,"",!0,t)},d){if(!d.hasOwnProperty(S))continue;const t=d[S],e=t.toLowerCase();if(b.prototype[e])throw new Error("Method already exists: "+e);b.prototype[e]=function(e,r,n){return this.on(t,e,r,n)}}function w(t){return t.replace(/\/\/+/g,"/")}function C(t){return t.length>1&&47===t.charCodeAt(t.length-1)?t.slice(0,-1):t}function x(t){return 94===t.charCodeAt(1)&&(t=t.slice(0,1)+t.slice(2)),36===t.charCodeAt(t.length-2)&&(t=t.slice(0,t.length-2)+t.slice(t.length-1)),t}function O(t,e){for(var r=1;e<t.length;)if("\\"!==t[++e]){if(")"===t[e]?r--:"("===t[e]&&r++,!r)return e}else e++;throw new TypeError('Invalid regexp expression in "'+t+'"')}function P(t){return t&&t.store?Object.assign({},t.store):{}}b.prototype.all=function(t,e,r){this.on(d,t,e,r)},e.exports=b},{"./custom_node":27,"./lib/constrainer":30,"./lib/http-methods":31,"./lib/pretty-print":32,"./lib/url-sanitizer":35,assert:1,"fast-deep-equal":22,"fast-querystring":23,"safe-regex2":38}],30:[function(t,e,r){"use strict";const n=t("./strategies/accept-version"),i=t("./strategies/accept-host"),s=t("assert");e.exports=class{constructor(t){if(this.strategies={version:n,host:i},this.strategiesInUse=new Set,this.asyncStrategiesInUse=new Set,t)for(const e of Object.values(t))this.addConstraintStrategy(e)}isStrategyUsed(t){return this.strategiesInUse.has(t)||this.asyncStrategiesInUse.has(t)}hasConstraintStrategy(t){const e=this.strategies[t];return void 0!==e&&(e.isCustom||this.isStrategyUsed(t))}addConstraintStrategy(t){if(s("string"==typeof t.name&&""!==t.name,"strategy.name is required."),s(t.storage&&"function"==typeof t.storage,"strategy.storage function is required."),s(t.deriveConstraint&&"function"==typeof t.deriveConstraint,"strategy.deriveConstraint function is required."),this.strategies[t.name]&&this.strategies[t.name].isCustom)throw new Error(`There already exists a custom constraint with the name ${t.name}.`);if(this.isStrategyUsed(t.name))throw new Error(`There already exists a route with ${t.name} constraint.`);t.isCustom=!0,t.isAsync=3===t.deriveConstraint.length,this.strategies[t.name]=t,t.mustMatchWhenDerived&&this.noteUsage({[t.name]:t})}deriveConstraints(t,e,r){const n=this.deriveSyncConstraints(t,e);if(void 0===r)return n;this.deriveAsyncConstraints(n,t,e,r)}deriveSyncConstraints(t,e){}noteUsage(t){if(t){const e=this.strategiesInUse.size;for(const e in t){this.strategies[e].isAsync?this.asyncStrategiesInUse.add(e):this.strategiesInUse.add(e)}e!==this.strategiesInUse.size&&this._buildDeriveConstraints()}}newStoreForConstraint(t){if(!this.strategies[t])throw new Error(`No strategy registered for constraint key ${t}`);return this.strategies[t].storage()}validateConstraints(t){for(const e in t){const r=t[e];if(void 0===r)throw new Error("Can't pass an undefined constraint value, must pass null or no key at all");const n=this.strategies[e];if(!n)throw new Error(`No strategy registered for constraint key ${e}`);n.validate&&n.validate(r)}}deriveAsyncConstraints(t,e,r,n){let i=this.asyncStrategiesInUse.size;if(0!==i){t=t||{};for(const s of this.asyncStrategiesInUse){this.strategies[s].deriveConstraint(e,r,((e,r)=>{null===e?(t[s]=r,0==--i&&n(null,t)):n(e)}))}}else n(null,t)}_buildDeriveConstraints(){if(0===this.strategiesInUse.size)return;const t=["return {"];for(const e of this.strategiesInUse){const r=this.strategies[e];if(r.isCustom)t.push(` ${r.name}: this.strategies.${e}.deriveConstraint(req, ctx),`);else if("version"===e)t.push(" version: req.headers['accept-version'],");else{if("host"!==e)throw new Error("unknown non-custom strategy for compiling constraint derivation function");t.push(" host: req.headers.host || req.headers[':authority'],")}}t.push("}"),this.deriveSyncConstraints=new Function("req","ctx",t.join("\n")).bind(this)}}},{"./strategies/accept-host":33,"./strategies/accept-version":34,assert:1}],31:[function(t,e,r){"use strict";e.exports=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"]},{}],32:[function(t,e,r){"use strict";const n=" ",i="│ ",s="├── ",o="└── ",a="*",u="/",c=/(?=\/)/;function l(t){return Array.isArray(t)?t.map((t=>l(t))):"symbol"==typeof t?t.toString():"function"==typeof t?function(t){let e=t.name||"";return e=e.replace("bound","").trim(),e=(e||"anonymous")+"()",e}(t):t}function f(t,e){const r={},n=this.buildPrettyMeta(t);return Array.isArray(e)||(e=n?Reflect.ownKeys(n):[]),e.forEach((t=>{const e="symbol"==typeof t?t.toString():t;n&&n[t]&&(r[e]=l(n[t]))})),r}function h(t,e,r,a,u){let c="";if(a||u||(c+="\n"),a||(c+=`${e||""}${r?o:s}`),c+=`${t.path}`,t.handlers){const s=t.handlers.reduce(((t,e)=>{const r=t.findIndex((t=>JSON.stringify(t.opts)===JSON.stringify(e.opts)));return-1!==r?t[r].method=[t[r].method,e.method].join(", "):t.push(e),t}),[]);s.forEach(((o,u)=>{u>0&&(c+=`${a?"":e||""}${r?n:i}${t.path}`),c+=` (${o.method||"-"})`,o.opts&&"{}"!==JSON.stringify(o.opts)&&(c+=` ${JSON.stringify(o.opts)}`),o.meta&&Reflect.ownKeys(o.meta).forEach(((t,s)=>{c+=`\n${a?"":e||""}${r?n:i}`,c+=`• (${t}) ${JSON.stringify(o.meta[t])}`})),s.length>1&&u!==s.length-1&&(c+="\n")}))}else t.children.length>1&&(c+=" (-)");return a||(e=`${e||""}${r?n:i}`),t.children.forEach(((r,n)=>{const i=n===t.children.length-1,s=!t.handlers&&1===t.children.length;c+=h(r,e,i,s)})),c}e.exports={flattenNode:function t(e,r,n){if(0!==r.handlerStorage.handlers.length&&e.nodes.push({method:n,node:r}),r.parametricChildren&&r.parametricChildren[0]&&(e.children[":"]||(e.children[":"]={prefix:":",nodes:[],children:{}}),t(e.children[":"],r.parametricChildren[0],n)),r.wildcardChild&&(e.children["*"]||(e.children["*"]={prefix:"*",nodes:[],children:{}}),t(e.children["*"],r.wildcardChild,n)),r.staticChildren)for(const i of Object.values(r.staticChildren)){const r=i.prefix.split(c);let s,o=e;for(const t of r)s=o,o=o.children[t],o||(o={prefix:t,nodes:[],children:{}},s.children[t]=o);t(o,i,n)}},compressFlattenedNode:function t(e){const r=Object.keys(e.children);if(0===e.nodes.length&&1===r.length){const n=e.children[r[0]];if(n.nodes.length<=1)return t(n),e.nodes=n.nodes,e.prefix+=n.prefix,e.children=n.children,e}for(const r of Object.keys(e.children))t(e.children[r]);return e},prettyPrintFlattenedNode:function t(e,r,a,u){if(!this.buildPrettyMeta)throw new Error("buildPrettyMeta not defined");u.includeMeta=u.includeMeta||null;let c="";const l=[];for(const{node:t,method:r}of e.nodes)for(const e of t.handlerStorage.handlers)l.push({method:r,...e});l.length?l.forEach(((t,s)=>{let o=`(${t.method||"-"})`;Object.keys(t.constraints).length>0&&(o+=" "+JSON.stringify(t.constraints));let l="";const h=e.prefix.split("").map(((t,e)=>":"===t?e:null)).filter((t=>null!==t));if(h.length){let r=0;h.forEach(((n,i)=>{l+=e.prefix.slice(r,n+1),l+=t.params[t.params.length-h.length+i],i===h.length-1&&(l+=e.prefix.slice(n+1)),r=n+1}))}else l=e.prefix;if(c+=0===s?`${l} ${o}`:`\n${r}${a?n:i}${l} ${o}`,u.includeMeta){const e=f.call(this,t,u.includeMeta);Object.keys(e).forEach(((t,s)=>{c+=`\n${r||""}${a?n:i}`,c+=`• (${t}) ${JSON.stringify(e[t])}`}))}})):c=e.prefix;let h=`${r}${a?o:s}${c}\n`;r=`${r}${a?n:i}`;const p=Object.keys(e.children);for(let n=0;n<p.length;n++){const i=e.children[p[n]];h+=t.call(this,i,r,n===p.length-1,u)}return h},prettyPrintRoutesArray:function(t,e={}){if(!this.buildPrettyMeta)throw new Error("buildPrettyMeta not defined");e.includeMeta=e.includeMeta||null;const r=[];let n="";t.sort(((t,e)=>t.path&&e.path?t.path.localeCompare(e.path):0));for(let n=0;n<t.length;n++){const i=t[n],s=r.find((t=>i.path===t.path));if(s){s.handlers.push({method:i.method,opts:i.opts.constraints||void 0,meta:e.includeMeta?f.call(this,i,e.includeMeta):null});continue}const o={method:i.method,opts:i.opts.constraints||void 0,meta:e.includeMeta?f.call(this,i,e.includeMeta):null};r.push({path:i.path,methods:[i.method],opts:[i.opts],handlers:[o]})}if(!r.filter((t=>t.path===u)).length){const t={path:u,truncatedPath:"",methods:[],opts:[],handlers:[{}]};r.filter((t=>t.path===a)).length?r.splice(1,0,t):r.unshift(t)}const i=function(t){const e=[],r={result:e};return t.forEach(((t,e)=>{let n=t.path.split(c);n[0]!==u&&n[0]!==a&&(n=[u,n[0].slice(1),...n.slice(1)]),n.reduce(((e,r,i)=>{if(!e[r]){e[r]={result:[]};const s={path:r,children:e[r].result};i===n.length-1&&(s.handlers=t.handlers),e.result.push(s)}return e[r]}),r)})),e}(r);return i.forEach(((t,e)=>{n+=h(t,null,e===i.length-1,!1,!0),n+="\n"})),n}}},{}],33:[function(t,e,r){"use strict";const n=t("assert");e.exports={name:"host",mustMatchWhenDerived:!1,storage:function(){const t={},e=[];return{get:r=>{const n=t[r];if(n)return n;for(const t of e)if(t.host.test(r))return t.value},set:(r,n)=>{r instanceof RegExp?e.push({host:r,value:n}):t[r]=n}}},validate(t){n("string"==typeof t||"[object RegExp]"===Object.prototype.toString.call(t),"Host should be a string or a RegExp")}}},{assert:1}],34:[function(t,e,r){"use strict";const n=t("assert");function i(){if(!(this instanceof i))return new i;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}i.prototype.set=function(t,e){if("string"!=typeof t)throw new TypeError("Version should be a string");let[r,n,i]=t.split(".");return r=Number(r)||0,n=Number(n)||0,i=Number(i)||0,r>=this.maxMajor&&(this.maxMajor=r,this.store.x=e,this.store["*"]=e,this.store["x.x"]=e,this.store["x.x.x"]=e),n>=(this.maxMinors[r]||0)&&(this.maxMinors[r]=n,this.store[`${r}.x`]=e,this.store[`${r}.x.x`]=e),i>=(this.store[`${r}.${n}`]||0)&&(this.maxPatches[`${r}.${n}`]=i,this.store[`${r}.${n}.x`]=e),this.store[`${r}.${n}.${i}`]=e,this},i.prototype.get=function(t){return this.store[t]},e.exports={name:"version",mustMatchWhenDerived:!0,storage:i,validate(t){n("string"==typeof t,"Version should be a string")}}},{assert:1}],35:[function(t,e,r){"use strict";function n(t,e){return 50===t?53===e?"%":51===e?"#":52===e?"$":54===e?"&":66===e||98===e?"+":67===e||99===e?",":70===e||102===e?"/":null:51===t?65===e||97===e?":":66===e||98===e?";":68===e||100===e?"=":70===e||102===e?"?":null:52===t&&48===e?"@":null}e.exports={safeDecodeURI:function(t){let e=!1,r=!1,i="";for(let s=1;s<t.length;s++){const o=t.charCodeAt(s);if(37===o){const i=t.charCodeAt(s+1),o=t.charCodeAt(s+2);null===n(i,o)?e=!0:(r=!0,50===i&&53===o&&(e=!0,t=t.slice(0,s+1)+"25"+t.slice(s+1),s+=2),s+=2)}else if(63===o||59===o||35===o){i=t.slice(s+1),t=t.slice(0,s);break}}return{path:e?decodeURI(t):t,querystring:i,shouldDecodeParam:r}},safeDecodeURIComponent:function(t){const e=t.indexOf("%");if(-1===e)return t;let r="",i=e;for(let s=e;s<t.length;s++)if(37===t.charCodeAt(s)){const e=n(t.charCodeAt(s+1),t.charCodeAt(s+2));r+=t.slice(i,s)+e,i=s+3}return t.slice(0,e)+r+t.slice(i)}}},{}],36:[function(t,e,r){
|
|
76
8
|
/*
|
|
77
9
|
object-assign
|
|
78
10
|
(c) Sindre Sorhus
|
|
79
11
|
@license MIT
|
|
80
12
|
*/
|
|
81
|
-
"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,a=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),u=1;u<arguments.length;u++){for(var
|
|
82
|
-
/**
|
|
83
|
-
* Precedent Meta-Templating
|
|
84
|
-
*
|
|
85
|
-
* @license MIT
|
|
86
|
-
*
|
|
87
|
-
* @author Steven Velozo <steven@velozo.com>
|
|
88
|
-
*
|
|
89
|
-
* @description Process text streams, parsing out meta-template expressions.
|
|
90
|
-
*/
|
|
91
|
-
var n=t("./WordTree.js"),i=t("./StringParser.js");e.exports=class{constructor(){this.WordTree=new n,this.StringParser=new i,this.ParseTree=this.WordTree.ParseTree}addPattern(t,e,r){return this.WordTree.addPattern(t,e,r)}parseString(t){return this.StringParser.parseString(t,this.ParseTree)}}},{"./StringParser.js":54,"./WordTree.js":55}],54:[function(t,e,r){e.exports=
|
|
92
|
-
/**
|
|
93
|
-
* String Parser
|
|
94
|
-
*
|
|
95
|
-
* @license MIT
|
|
96
|
-
*
|
|
97
|
-
* @author Steven Velozo <steven@velozo.com>
|
|
98
|
-
*
|
|
99
|
-
* @description Parse a string, properly processing each matched token in the word tree.
|
|
100
|
-
*/
|
|
101
|
-
class{constructor(){}newParserState(t){return{ParseTree:t,Output:"",OutputBuffer:"",Pattern:!1,PatternMatch:!1,PatternMatchOutputBuffer:""}}assignNode(t,e){e.PatternMatch=t,e.PatternMatch.hasOwnProperty("PatternEnd")&&(e.Pattern=e.PatternMatch)}appendOutputBuffer(t,e){e.OutputBuffer+=t}flushOutputBuffer(t){t.Output+=t.OutputBuffer,t.OutputBuffer=""}checkPatternEnd(t){t.OutputBuffer.length>=t.Pattern.PatternEnd.length+t.Pattern.PatternStart.length&&t.OutputBuffer.substr(-t.Pattern.PatternEnd.length)===t.Pattern.PatternEnd&&(t.OutputBuffer=t.Pattern.Parse(t.OutputBuffer.substr(t.Pattern.PatternStart.length,t.OutputBuffer.length-(t.Pattern.PatternStart.length+t.Pattern.PatternEnd.length))),this.flushOutputBuffer(t),t.Pattern=!1,t.PatternMatch=!1)}parseCharacter(t,e){!e.PatternMatch&&e.ParseTree.hasOwnProperty(t)?(this.assignNode(e.ParseTree[t],e),this.appendOutputBuffer(t,e)):e.PatternMatch?(e.PatternMatch.hasOwnProperty(t)&&this.assignNode(e.PatternMatch[t],e),this.appendOutputBuffer(t,e),e.Pattern&&this.checkPatternEnd(e)):e.Output+=t}parseString(t,e){let r=this.newParserState(e);for(var n=0;n<t.length;n++)this.parseCharacter(t[n],r);return this.flushOutputBuffer(r),r.Output}}},{}],55:[function(t,e,r){e.exports=
|
|
102
|
-
/**
|
|
103
|
-
* Word Tree
|
|
104
|
-
*
|
|
105
|
-
* @license MIT
|
|
106
|
-
*
|
|
107
|
-
* @author Steven Velozo <steven@velozo.com>
|
|
108
|
-
*
|
|
109
|
-
* @description Create a tree (directed graph) of Javascript objects, one character per object.
|
|
110
|
-
*/
|
|
111
|
-
class{constructor(){this.ParseTree={}}addChild(t,e,r){return t.hasOwnProperty(e[r])||(t[e[r]]={}),t[e[r]]}addPattern(t,e,r){if(t.length<1)return!1;if("string"==typeof e&&e.length<1)return!1;let n=this.ParseTree;for(var i=0;i<t.length;i++)n=this.addChild(n,t,i);return n.PatternStart=t,n.PatternEnd="string"==typeof e&&e.length>0?e:t,n.Parse="function"==typeof r?r:"string"==typeof r?()=>r:t=>t,!0}}},{}],56:[function(t,e,r){var n,i,s=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var l,c=[],h=!1,f=-1;function p(){h&&l&&(h=!1,l.length?c=l.concat(c):f=-1,c.length&&d())}function d(){if(!h){var t=u(p);h=!0;for(var e=c.length;e;){for(l=c,c=[];++f<e;)l&&l[f].run();f=-1,e=c.length}l=null,h=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function y(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new g(t,e)),1!==c.length||h||u(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=y,s.addListener=y,s.once=y,s.off=y,s.removeListener=y,s.removeAllListeners=y,s.emit=y,s.prependListener=y,s.prependOnceListener=y,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],57:[function(t,e,r){"use strict";var n=t("ret"),i=n.types;e.exports=function(t,e){e||(e={});var r,s=void 0===e.limit?25:e.limit;r=t,"[object RegExp]"==={}.toString.call(r)?t=t.source:"string"!=typeof t&&(t=String(t));try{t=n(t)}catch(t){return!1}var o=0;return function t(e,r){var n,a;if(e.type===i.REPETITION){if(r++,o++,r>1)return!1;if(o>s)return!1}if(e.options)for(n=0,a=e.options.length;n<a;n++)if(!t({stack:e.options[n]},r))return!1;var u=e.stack||e.value&&e.value.stack;if(!u)return!0;for(n=0;n<u.length;n++)if(!t(u[n],r))return!1;return!0}(t,0)}},{ret:58}],58:[function(t,e,r){const n=t("./util"),i=t("./types"),s=t("./sets"),o=t("./positions");e.exports=t=>{var e,r,a=0,u={type:i.ROOT,stack:[]},l=u,c=u.stack,h=[],f=e=>{n.error(t,"Nothing to repeat at column "+(e-1))},p=n.strToChars(t);for(e=p.length;a<e;)switch(r=p[a++]){case"\\":switch(r=p[a++]){case"b":c.push(o.wordBoundary());break;case"B":c.push(o.nonWordBoundary());break;case"w":c.push(s.words());break;case"W":c.push(s.notWords());break;case"d":c.push(s.ints());break;case"D":c.push(s.notInts());break;case"s":c.push(s.whitespace());break;case"S":c.push(s.notWhitespace());break;default:/\d/.test(r)?c.push({type:i.REFERENCE,value:parseInt(r,10)}):c.push({type:i.CHAR,value:r.charCodeAt(0)})}break;case"^":c.push(o.begin());break;case"$":c.push(o.end());break;case"[":var d;"^"===p[a]?(d=!0,a++):d=!1;var g=n.tokenizeClass(p.slice(a),t);a+=g[1],c.push({type:i.SET,set:g[0],not:d});break;case".":c.push(s.anyChar());break;case"(":var y={type:i.GROUP,stack:[],remember:!0};"?"===(r=p[a])&&(r=p[a+1],a+=2,"="===r?y.followedBy=!0:"!"===r?y.notFollowedBy=!0:":"!==r&&n.error(t,`Invalid group, character '${r}' after '?' at column `+(a-1)),y.remember=!1),c.push(y),h.push(l),l=y,c=y.stack;break;case")":0===h.length&&n.error(t,"Unmatched ) at column "+(a-1)),c=(l=h.pop()).options?l.options[l.options.length-1]:l.stack;break;case"|":l.options||(l.options=[l.stack],delete l.stack);var m=[];l.options.push(m),c=m;break;case"{":var v,b,S=/^(\d+)(,(\d+)?)?\}/.exec(p.slice(a));null!==S?(0===c.length&&f(a),v=parseInt(S[1],10),b=S[2]?S[3]?parseInt(S[3],10):1/0:v,a+=S[0].length,c.push({type:i.REPETITION,min:v,max:b,value:c.pop()})):c.push({type:i.CHAR,value:123});break;case"?":0===c.length&&f(a),c.push({type:i.REPETITION,min:0,max:1,value:c.pop()});break;case"+":0===c.length&&f(a),c.push({type:i.REPETITION,min:1,max:1/0,value:c.pop()});break;case"*":0===c.length&&f(a),c.push({type:i.REPETITION,min:0,max:1/0,value:c.pop()});break;default:c.push({type:i.CHAR,value:r.charCodeAt(0)})}return 0!==h.length&&n.error(t,"Unterminated group"),u},e.exports.types=i},{"./positions":59,"./sets":60,"./types":61,"./util":62}],59:[function(t,e,r){const n=t("./types");r.wordBoundary=()=>({type:n.POSITION,value:"b"}),r.nonWordBoundary=()=>({type:n.POSITION,value:"B"}),r.begin=()=>({type:n.POSITION,value:"^"}),r.end=()=>({type:n.POSITION,value:"$"})},{"./types":61}],60:[function(t,e,r){const n=t("./types"),i=()=>[{type:n.RANGE,from:48,to:57}],s=()=>[{type:n.CHAR,value:95},{type:n.RANGE,from:97,to:122},{type:n.RANGE,from:65,to:90}].concat(i()),o=()=>[{type:n.CHAR,value:9},{type:n.CHAR,value:10},{type:n.CHAR,value:11},{type:n.CHAR,value:12},{type:n.CHAR,value:13},{type:n.CHAR,value:32},{type:n.CHAR,value:160},{type:n.CHAR,value:5760},{type:n.RANGE,from:8192,to:8202},{type:n.CHAR,value:8232},{type:n.CHAR,value:8233},{type:n.CHAR,value:8239},{type:n.CHAR,value:8287},{type:n.CHAR,value:12288},{type:n.CHAR,value:65279}];r.words=()=>({type:n.SET,set:s(),not:!1}),r.notWords=()=>({type:n.SET,set:s(),not:!0}),r.ints=()=>({type:n.SET,set:i(),not:!1}),r.notInts=()=>({type:n.SET,set:i(),not:!0}),r.whitespace=()=>({type:n.SET,set:o(),not:!1}),r.notWhitespace=()=>({type:n.SET,set:o(),not:!0}),r.anyChar=()=>({type:n.SET,set:[{type:n.CHAR,value:10},{type:n.CHAR,value:13},{type:n.CHAR,value:8232},{type:n.CHAR,value:8233}],not:!0})},{"./types":61}],61:[function(t,e,r){e.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}},{}],62:[function(t,e,r){const n=t("./types"),i=t("./sets"),s={0:0,t:9,n:10,v:11,f:12,r:13};r.strToChars=function(t){return t=t.replace(/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g,(function(t,e,r,n,i,o,a,u){if(r)return t;var l=e?8:n?parseInt(n,16):i?parseInt(i,16):o?parseInt(o,8):a?"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?".indexOf(a):s[u],c=String.fromCharCode(l);return/[[\]{}^$.|?*+()]/.test(c)&&(c="\\"+c),c}))},r.tokenizeClass=(t,e)=>{for(var s,o,a=[],u=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g;null!=(s=u.exec(t));)if(s[1])a.push(i.words());else if(s[2])a.push(i.ints());else if(s[3])a.push(i.whitespace());else if(s[4])a.push(i.notWords());else if(s[5])a.push(i.notInts());else if(s[6])a.push(i.notWhitespace());else if(s[7])a.push({type:n.RANGE,from:(s[8]||s[9]).charCodeAt(0),to:s[10].charCodeAt(0)});else{if(!(o=s[12]))return[a,u.lastIndex];a.push({type:n.CHAR,value:o.charCodeAt(0)})}r.error(e,"Unterminated character class")},r.error=(t,e)=>{throw new SyntaxError("Invalid regular expression: /"+t+"/: "+e)}},{"./sets":60,"./types":61}],63:[function(t,e,r){(function(e,n){(function(){var i=t("process/browser.js").nextTick,s=Function.prototype.apply,o=Array.prototype.slice,a={},u=0;function l(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new l(s.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new l(s.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=u++,n=!(arguments.length<2)&&o.call(arguments,1);return a[e]=!0,i((function(){a[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete a[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":56,timers:63}],64:[function(t,e,r){
|
|
13
|
+
"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,a=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),u=1;u<arguments.length;u++){for(var c in r=Object(arguments[u]))i.call(r,c)&&(a[c]=r[c]);if(n){o=n(r);for(var l=0;l<o.length;l++)s.call(r,o[l])&&(a[o[l]]=r[o[l]])}}return a}},{}],37:[function(t,e,r){var n,i,s=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var c,l=[],f=!1,h=-1;function p(){f&&c&&(f=!1,c.length?l=c.concat(l):h=-1,l.length&&d())}function d(){if(!f){var t=u(p);f=!0;for(var e=l.length;e;){for(c=l,l=[];++h<e;)c&&c[h].run();h=-1,e=l.length}c=null,f=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function y(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];l.push(new g(t,e)),1!==l.length||f||u(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=y,s.addListener=y,s.once=y,s.off=y,s.removeListener=y,s.removeAllListeners=y,s.emit=y,s.prependListener=y,s.prependOnceListener=y,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],38:[function(t,e,r){"use strict";var n=t("ret"),i=n.types;e.exports=function(t,e){e||(e={});var r,s=void 0===e.limit?25:e.limit;r=t,"[object RegExp]"==={}.toString.call(r)?t=t.source:"string"!=typeof t&&(t=String(t));try{t=n(t)}catch(t){return!1}var o=0;return function t(e,r){var n,a;if(e.type===i.REPETITION){if(r++,o++,r>1)return!1;if(o>s)return!1}if(e.options)for(n=0,a=e.options.length;n<a;n++)if(!t({stack:e.options[n]},r))return!1;var u=e.stack||e.value&&e.value.stack;if(!u)return!0;for(n=0;n<u.length;n++)if(!t(u[n],r))return!1;return!0}(t,0)}},{ret:39}],39:[function(t,e,r){const n=t("./util"),i=t("./types"),s=t("./sets"),o=t("./positions");e.exports=t=>{var e,r,a=0,u={type:i.ROOT,stack:[]},c=u,l=u.stack,f=[],h=e=>{n.error(t,"Nothing to repeat at column "+(e-1))},p=n.strToChars(t);for(e=p.length;a<e;)switch(r=p[a++]){case"\\":switch(r=p[a++]){case"b":l.push(o.wordBoundary());break;case"B":l.push(o.nonWordBoundary());break;case"w":l.push(s.words());break;case"W":l.push(s.notWords());break;case"d":l.push(s.ints());break;case"D":l.push(s.notInts());break;case"s":l.push(s.whitespace());break;case"S":l.push(s.notWhitespace());break;default:/\d/.test(r)?l.push({type:i.REFERENCE,value:parseInt(r,10)}):l.push({type:i.CHAR,value:r.charCodeAt(0)})}break;case"^":l.push(o.begin());break;case"$":l.push(o.end());break;case"[":var d;"^"===p[a]?(d=!0,a++):d=!1;var g=n.tokenizeClass(p.slice(a),t);a+=g[1],l.push({type:i.SET,set:g[0],not:d});break;case".":l.push(s.anyChar());break;case"(":var y={type:i.GROUP,stack:[],remember:!0};"?"===(r=p[a])&&(r=p[a+1],a+=2,"="===r?y.followedBy=!0:"!"===r?y.notFollowedBy=!0:":"!==r&&n.error(t,`Invalid group, character '${r}' after '?' at column `+(a-1)),y.remember=!1),l.push(y),f.push(c),c=y,l=y.stack;break;case")":0===f.length&&n.error(t,"Unmatched ) at column "+(a-1)),l=(c=f.pop()).options?c.options[c.options.length-1]:c.stack;break;case"|":c.options||(c.options=[c.stack],delete c.stack);var v=[];c.options.push(v),l=v;break;case"{":var m,b,S=/^(\d+)(,(\d+)?)?\}/.exec(p.slice(a));null!==S?(0===l.length&&h(a),m=parseInt(S[1],10),b=S[2]?S[3]?parseInt(S[3],10):1/0:m,a+=S[0].length,l.push({type:i.REPETITION,min:m,max:b,value:l.pop()})):l.push({type:i.CHAR,value:123});break;case"?":0===l.length&&h(a),l.push({type:i.REPETITION,min:0,max:1,value:l.pop()});break;case"+":0===l.length&&h(a),l.push({type:i.REPETITION,min:1,max:1/0,value:l.pop()});break;case"*":0===l.length&&h(a),l.push({type:i.REPETITION,min:0,max:1/0,value:l.pop()});break;default:l.push({type:i.CHAR,value:r.charCodeAt(0)})}return 0!==f.length&&n.error(t,"Unterminated group"),u},e.exports.types=i},{"./positions":40,"./sets":41,"./types":42,"./util":43}],40:[function(t,e,r){const n=t("./types");r.wordBoundary=()=>({type:n.POSITION,value:"b"}),r.nonWordBoundary=()=>({type:n.POSITION,value:"B"}),r.begin=()=>({type:n.POSITION,value:"^"}),r.end=()=>({type:n.POSITION,value:"$"})},{"./types":42}],41:[function(t,e,r){const n=t("./types"),i=()=>[{type:n.RANGE,from:48,to:57}],s=()=>[{type:n.CHAR,value:95},{type:n.RANGE,from:97,to:122},{type:n.RANGE,from:65,to:90}].concat(i()),o=()=>[{type:n.CHAR,value:9},{type:n.CHAR,value:10},{type:n.CHAR,value:11},{type:n.CHAR,value:12},{type:n.CHAR,value:13},{type:n.CHAR,value:32},{type:n.CHAR,value:160},{type:n.CHAR,value:5760},{type:n.RANGE,from:8192,to:8202},{type:n.CHAR,value:8232},{type:n.CHAR,value:8233},{type:n.CHAR,value:8239},{type:n.CHAR,value:8287},{type:n.CHAR,value:12288},{type:n.CHAR,value:65279}];r.words=()=>({type:n.SET,set:s(),not:!1}),r.notWords=()=>({type:n.SET,set:s(),not:!0}),r.ints=()=>({type:n.SET,set:i(),not:!1}),r.notInts=()=>({type:n.SET,set:i(),not:!0}),r.whitespace=()=>({type:n.SET,set:o(),not:!1}),r.notWhitespace=()=>({type:n.SET,set:o(),not:!0}),r.anyChar=()=>({type:n.SET,set:[{type:n.CHAR,value:10},{type:n.CHAR,value:13},{type:n.CHAR,value:8232},{type:n.CHAR,value:8233}],not:!0})},{"./types":42}],42:[function(t,e,r){e.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}},{}],43:[function(t,e,r){const n=t("./types"),i=t("./sets"),s={0:0,t:9,n:10,v:11,f:12,r:13};r.strToChars=function(t){return t=t.replace(/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g,(function(t,e,r,n,i,o,a,u){if(r)return t;var c=e?8:n?parseInt(n,16):i?parseInt(i,16):o?parseInt(o,8):a?"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?".indexOf(a):s[u],l=String.fromCharCode(c);return/[[\]{}^$.|?*+()]/.test(l)&&(l="\\"+l),l}))},r.tokenizeClass=(t,e)=>{for(var s,o,a=[],u=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g;null!=(s=u.exec(t));)if(s[1])a.push(i.words());else if(s[2])a.push(i.ints());else if(s[3])a.push(i.whitespace());else if(s[4])a.push(i.notWords());else if(s[5])a.push(i.notInts());else if(s[6])a.push(i.notWhitespace());else if(s[7])a.push({type:n.RANGE,from:(s[8]||s[9]).charCodeAt(0),to:s[10].charCodeAt(0)});else{if(!(o=s[12]))return[a,u.lastIndex];a.push({type:n.CHAR,value:o.charCodeAt(0)})}r.error(e,"Unterminated character class")},r.error=(t,e)=>{throw new SyntaxError("Invalid regular expression: /"+t+"/: "+e)}},{"./sets":41,"./types":42}],44:[function(t,e,r){(function(e,n){(function(){var i=t("process/browser.js").nextTick,s=Function.prototype.apply,o=Array.prototype.slice,a={},u=0;function c(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new c(s.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(s.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=u++,n=!(arguments.length<2)&&o.call(arguments,1);return a[e]=!0,i((function(){a[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete a[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":37,timers:44}],45:[function(t,e,r){
|
|
112
14
|
/**
|
|
113
15
|
* Simple browser shim loader - assign the npm module to a window global automatically
|
|
114
16
|
*
|
|
115
17
|
* @license MIT
|
|
116
18
|
* @author <steven@velozo.com>
|
|
117
19
|
*/
|
|
118
|
-
var n=t("./Orator.js");"object"!=typeof window||window.hasOwnProperty("Orator")||(window.Orator=n),e.exports=n},{"./Orator.js":
|
|
20
|
+
var n=t("./Orator.js");"object"!=typeof window||window.hasOwnProperty("Orator")||(window.Orator=n),e.exports=n},{"./Orator.js":52}],46:[function(t,e,r){e.exports={Product:"Unnamed_Service",ProductVersion:"0.0.1",ServicePort:8080}},{}],47:[function(t,e,r){
|
|
119
21
|
/**
|
|
120
22
|
* Default Service Server Function
|
|
121
23
|
*
|
|
@@ -123,7 +25,7 @@ var n=t("./Orator.js");"object"!=typeof window||window.hasOwnProperty("Orator")|
|
|
|
123
25
|
*
|
|
124
26
|
* @author Steven Velozo <steven@velozo.com>
|
|
125
27
|
*/
|
|
126
|
-
getDefaultServiceServers=()=>{let e={};return e.ipc=t("./Orator-ServiceServer-IPC.js"),e.default=e.ipc,e},e.exports=getDefaultServiceServers()},{"./Orator-ServiceServer-IPC.js":
|
|
28
|
+
getDefaultServiceServers=()=>{let e={};return e.ipc=t("./Orator-ServiceServer-IPC.js"),e.default=e.ipc,e},e.exports=getDefaultServiceServers()},{"./Orator-ServiceServer-IPC.js":51}],48:[function(t,e,r){e.exports=class{constructor(t){this.orator=t,this.log=t.log,this.Name=this.orator.settings.Product,this.URL="BASE_SERVICE_SERVER",this.Port=this.orator.settings.ServicePort,this.Active=!1}listen(t,e){return this.Active=!0,e()}close(t){return this.Active=!1,t()}use(t){return"function"==typeof t||(this.log.error(`Orator USE global handler mapping failed -- parameter was expected to be a function with prototype function(Request, Response, Next) but type was ${typeof t} instead of a string.`),!1)}get(t,...e){return"string"==typeof t||(this.log.error(`Orator GET Route mapping failed -- route parameter was ${typeof t} instead of a string.`),!1)}put(t,...e){return"string"==typeof t||(this.log.error(`Orator PUT Route mapping failed -- route parameter was ${typeof t} instead of a string.`),!1)}post(t,...e){return"string"==typeof t||(this.log.error(`Orator POST Route mapping failed -- route parameter was ${typeof t} instead of a string.`),!1)}del(t,...e){return"string"==typeof t||(this.log.error(`Orator DEL Route mapping failed -- route parameter was ${typeof t} instead of a string.`),!1)}patch(t,...e){return"string"==typeof t||(this.log.error(`Orator PATCH Route mapping failed -- route parameter was ${typeof t} instead of a string.`),!1)}opts(t,...e){return"string"==typeof t||(this.log.error(`Orator OPTS Route mapping failed -- route parameter was ${typeof t} instead of a string.`),!1)}head(t,...e){return"string"==typeof t||(this.log.error(`Orator HEAD Route mapping failed -- route parameter was ${typeof t} instead of a string.`),!1)}invoke(t,e,r,n){return this.log.debug(`Orator invoke called for route [${e}] and landed on the base class; the service provider likely does not implement programmatic invoke capabilities.`,r),!1}}},{}],49:[function(t,e,r){"use strict";e.exports={name:"ipc",isAsync:!0,storage:()=>{let t={};return{get:e=>t[e]||null,set:(e,r)=>{t[e]=r}}},deriveConstraint:(t,e,r)=>r(null,"IPC"),mustMatchWhenDerived:!0}},{}],50:[function(t,e,r){e.exports=class{constructor(t,e){this.log=t,this.requestGUID=e,this.responseData=null,this.responseStatus=-1}send(t){return"string"==typeof t?null===this.responseData?(this.responseData=t,!0):"string"==typeof this.responseData?(this.responseData=this.responseData+t,!0):(this.log(`Request ${this.requestGUID} has tried to send() a string value after send()ing data type ${typeof this.responseData}.`,t),!1):"object"==typeof t?null===this.responseData?(this.responseData=JSON.stringify(t),!0):"string"==typeof this.responseData?(this.responseData+=this.responseData+JSON.stringify(t),!0):(this.log(`Request ${this.requestGUID} has tried to send() an object value to be auto stringified after send()ing data type ${typeof this.responseData}.`,t),!1):void 0}}},{}],51:[function(t,e,r){const n=t("./Orator-ServiceServer-Base.js"),i=t("./Orator-ServiceServer-IPC-SynthesizedResponse.js"),s=t("./Orator-ServiceServer-IPC-RouterConstrainer.js"),o=t("find-my-way"),a=t("async/waterfall"),u=t("async/eachOfSeries");e.exports=class extends n{constructor(t){super(t),this.routerOptions=this.orator.settings.hasOwnProperty("router_options")&&"object"==typeof this.orator.settings.router_options?this.orator.settings.router_options:{},this.router=o(this.routerOptions),this.router.addConstraintStrategy(s),this.URL="IPC",this.preBehaviorFunctions=[],this.behaviorMap={},this.postBehaviorFunctions=[]}use(t){if(!super.use(t))return this.log.error("IPC provider failed to map USE handler function!"),!1;this.preBehaviorFunctions.push(t)}addPostBehaviorFunction(t){if(!super.use(t))return this.log.error("IPC provider failed to map USE handler function!"),!1;this.preBehaviorFunctions.push(t)}executePreBehaviorFunctions(t,e,r){u(this.preBehaviorFunctions,((r,n,i)=>r(t,e,i)),(t=>(t&&this.log.error(`IPC Provider preBehaviorFunction ${pFunctionIndex} failed with error: ${t}`,t),r(t))))}addPostBehaviorFunction(t){if(!super.use(t))return this.log.error("IPC provider failed to map USE handler function!"),!1;this.preBehaviorFunctions.push(t)}executePostBehaviorFunctions(t,e,r){u(this.postBehaviorFunctions,((r,n,i)=>r(t,e,i)),(t=>(t&&this.log.error(`IPC Provider postBehaviorFunction ${pFunctionIndex} failed with error: ${t}`,t),r(t))))}addRouteProcessor(t,e,r){return this.router.on(t,e,{constraints:{ipc:"IPC"}},((t,e,n)=>{a([e=>(t.params=n,e()),r=>this.executePreBehaviorFunctions(t,e,r),n=>{u(r,((r,n,i)=>r(t,e,i)),(t=>{if(t)return this.log.error(`IPC Provider behavior function ${pFunctionIndex} failed with error: ${t}`,t),fNext(pError)}))},r=>this.executePostBehaviorFunctions(t,e,r)],(t=>{t&&this.log.error(`IPC Provider behavior function ${pFunctionIndex} failed with error: ${pBehaviorFunctionError}`,pBehaviorFunctionError)}))})),!0}get(t,...e){return super.get(t,...e)?this.addRouteProcessor("GET",t,Array.from(e)):(this.log.error(`IPC provider failed to map GET route [${t}]!`),!1)}put(t,...e){return!!super.get(t,...e)||(this.log.error(`IPC provider failed to map PUT route [${t}]!`),!1)}post(t,...e){return!!super.get(t,...e)||(this.log.error(`IPC provider failed to map POST route [${t}]!`),!1)}del(t,...e){return!!super.get(t,...e)||(this.log.error(`IPC provider failed to map DEL route [${t}]!`),!1)}invoke(t,e,r,n){let s="function"==typeof n?n:"function"==typeof r?r:()=>{},o={method:t,url:e,guid:this.orator.fable.getUUID()},a=new i(this.log,o.guid);return this.router.lookup(o,a,((t,n)=>(t&&this.log.error(`IPC Request Error Request GUID [${o.guid}] handling route [${e}]: ${t}`,{Error:t,Route:e,Data:r}),s(t,a.responseData,a,n))))}}},{"./Orator-ServiceServer-Base.js":48,"./Orator-ServiceServer-IPC-RouterConstrainer.js":49,"./Orator-ServiceServer-IPC-SynthesizedResponse.js":50,"async/eachOfSeries":7,"async/waterfall":20,"find-my-way":29}],52:[function(t,e,r){
|
|
127
29
|
/**
|
|
128
30
|
* Orator Service Abstraction
|
|
129
31
|
*
|
|
@@ -132,5 +34,5 @@ getDefaultServiceServers=()=>{let e={};return e.ipc=t("./Orator-ServiceServer-IP
|
|
|
132
34
|
* @author Steven Velozo <steven@velozo.com>
|
|
133
35
|
* @module Orator Service
|
|
134
36
|
*/
|
|
135
|
-
const n=t("
|
|
37
|
+
const n=t("./Orator-Default-Configuration.js"),i=t("./Orator-Default-ServiceServers-Node.js");e.exports=class{constructor(t,e){this.fable=t,this.settings=this.fable.settings,this.log=this.fable.log,this.serviceServer=!1,this.serviceServerProvider=!1,void 0!==e&&(this.serviceServerProvider=e),this.settings.hasOwnProperty("ServicePort")||(this.settings.hasOwnProperty("APIServerPort")?this.settings.ServicePort=this.fable.settings.APIServerPort:this.settings.ServicePort=n.ServicePort),this.settings.hasOwnProperty("Product")||(this.settings.Product=n.Product)}initializeServiceServer(t){var e="function"==typeof t?t:()=>{};return this.serviceServer?this.log.warn("Orator attempting to initialize a service server after initialization has already completed."):(this.serviceServerProvider||(this.serviceServerProvider=i.default),this.serviceServer=new this.serviceServerProvider(this),this.webServer=this.serviceServer),e()}_startServiceListener(t){return this.serviceServer.listen(this.settings.ServicePort,(e=>(this.log.info(`${this.serviceServer.Name} listening at ${this.serviceServer.URL} port ${this.serviceServer.Port}`),t(e))))}startService(t){var e="function"==typeof t?t:()=>{};return this.serviceServer||this.initializeServiceServer(),this._startServiceListener(e)}stopService(t){var e="function"==typeof t?t:()=>{};if(!this.serviceServer){let t="Orator attempting to stop a service server but the service server has not been intialized yet.";return this.log.warn(t),e(t)}if(!this.serviceServer.Active){let t="Orator attempting to stop a service server but the service server is not actively running.";return this.log.warn(t),e(t)}return this.serviceServer.close(e)}invoke(t,e,r,n){return this.serviceServer.invoke(t,e,r,n)}startWebServer(t){return this.startService(t)}stopWebServer(t){return this.stopService(t)}getWebServer(){return this.serviceServer||this.initializeServiceServer(),this.serviceServer}},e.exports.ServiceServerBase=t("./Orator-ServiceServer-Base.js")},{"./Orator-Default-Configuration.js":46,"./Orator-Default-ServiceServers-Node.js":47,"./Orator-ServiceServer-Base.js":48}]},{},[45])(45)}));
|
|
136
38
|
//# sourceMappingURL=orator.min.js.map
|