orator 6.0.2 → 6.0.4
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/package.json +8 -8
- package/source/Orator-ServiceServer-IPC.js +3 -3
- package/dist/indoctrinate_content_staging/Indoctrinate-Catalog-AppData.json +0 -2364
- package/dist/orator.compatible.js +0 -4889
- package/dist/orator.compatible.min.js +0 -17
- package/dist/orator.compatible.min.js.map +0 -1
- package/dist/orator.js +0 -4487
- package/dist/orator.min.js +0 -17
- package/dist/orator.min.js.map +0 -1
- /package/docs/{cover.md → _cover.md} +0 -0
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";var _excluded=["version","host"];function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=_superPropBase(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},_get.apply(this,arguments)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var i=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _objectWithoutProperties(e,t){if(null==e)return{};var r,n,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}!function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Orator=e()}}((function(){return function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[a]={exports:{}};t[a][0].call(l.exports,(function(e){return i(t[a][1][e]||e)}),l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){(function(r){(function(){var n=e("object-assign");
|
|
2
|
-
/*!
|
|
3
|
-
* The buffer module from node.js, for the browser.
|
|
4
|
-
*
|
|
5
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
6
|
-
* @license MIT
|
|
7
|
-
*/function i(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function o(e){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var a=e("util/"),s=Object.prototype.hasOwnProperty,c=Array.prototype.slice,u="foo"===function(){}.name;function l(e){return Object.prototype.toString.call(e)}function f(e){return!o(e)&&("function"==typeof r.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var h=t.exports=b,p=/\s*function\s+([^\(\s]*)\s*/;function d(e){if(a.isFunction(e)){if(u)return e.name;var t=e.toString().match(p);return t&&t[1]}}function v(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function y(e){if(u||!a.isFunction(e))return a.inspect(e);var t=d(e);return"[Function"+(t?": "+t:"")+"]"}function g(e,t,r,n,i){throw new h.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function b(e,t){e||g(e,!0,t,"==",h.ok)}function m(e,t,r,n){if(e===t)return!0;if(o(e)&&o(t))return 0===i(e,t);if(a.isDate(e)&&a.isDate(t))return e.getTime()===t.getTime();if(a.isRegExp(e)&&a.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"===_typeof(e)||null!==t&&"object"===_typeof(t)){if(f(e)&&f(t)&&l(e)===l(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===i(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(e);return-1!==s&&s===n.expected.indexOf(t)||(n.actual.push(e),n.expected.push(t),function(e,t,r,n){if(null==e||null==t)return!1;if(a.isPrimitive(e)||a.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=S(e),o=S(t);if(i&&!o||!i&&o)return!1;if(i)return m(e=c.call(e),t=c.call(t),r);var s,u,l=O(e),f=O(t);if(l.length!==f.length)return!1;for(l.sort(),f.sort(),u=l.length-1;u>=0;u--)if(l[u]!==f[u])return!1;for(u=l.length-1;u>=0;u--)if(!m(e[s=l[u]],t[s],r,n))return!1;return!0}(e,t,r,n))}return r?e===t:e==t}function S(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function P(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function C(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&g(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!e&&i&&!r;if((!e&&a.isError(i)&&o&&P(i,r)||s)&&g(i,r,"Got unwanted exception"+n),e&&i&&r&&!P(i,r)||!e&&i)throw i}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return v(y(e.actual),128)+" "+e.operator+" "+v(y(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=d(t),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},a.inherits(h.AssertionError,Error),h.fail=g,h.ok=b,h.equal=function(e,t,r){e!=t&&g(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){m(e,t,!1)||g(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){m(e,t,!0)||g(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){m(e,t,!1)&&g(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){m(t,r,!0)&&g(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){C(!0,e,t,r)},h.doesNotThrow=function(e,t,r){C(!1,e,t,r)},h.ifError=function(e){if(e)throw e},h.strict=n((function e(t,r){t||g(t,!0,r,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var O=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":23,"util/":4}],2:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],3:[function(e,t,r){t.exports=function(e){return e&&"object"===_typeof(e)&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],4:[function(e,t,r){(function(t,n){(function(){var i=/%[sdj%]/g;r.format=function(e){if(!g(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),c=n[r];r<o;c=n[++r])v(c)||!S(c)?a+=" "+c:a+=" "+s(c);return a},r.deprecate=function(e,i){if(b(n.process))return function(){return r.deprecate(e,i).apply(this,arguments)};if(!0===t.noDeprecation)return e;var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),o=!0}return e.apply(this,arguments)}};var o,a={};function s(e,t){var n={seen:[],stylize:u};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(t)?n.showHidden=t:t&&r._extend(n,t),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),l(n,e,n.depth)}function c(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function l(e,t,n){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return g(i)||(i=l(e,i,n)),i}var o=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(y(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(v(t))return e.stylize("null","null")}(e,t);if(o)return o;var a=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),C(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(t);if(0===a.length){if(O(t)){var c=t.name?": "+t.name:"";return e.stylize("[Function"+c+"]","special")}if(m(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(P(t))return e.stylize(Date.prototype.toString.call(t),"date");if(C(t))return f(t)}var u,S="",w=!1,_=["{","}"];(p(t)&&(w=!0,_=["[","]"]),O(t))&&(S=" [Function"+(t.name?": "+t.name:"")+"]");return m(t)&&(S=" "+RegExp.prototype.toString.call(t)),P(t)&&(S=" "+Date.prototype.toUTCString.call(t)),C(t)&&(S=" "+f(t)),0!==a.length||w&&0!=t.length?n<0?m(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=w?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)x(t,String(a))?o.push(h(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(h(e,t,r,n,i,!0))})),o}(e,t,n,s,a):a.map((function(r){return h(e,t,n,s,r,w)})),e.seen.pop(),function(e,t,r){var n=e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,S,_)):_[0]+S+_[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),x(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(c.value)<0?(s=v(r)?l(e,c.value,null):l(e,c.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),b(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function v(e){return null===e}function y(e){return"number"==typeof e}function g(e){return"string"==typeof e}function b(e){return void 0===e}function m(e){return S(e)&&"[object RegExp]"===w(e)}function S(e){return"object"===_typeof(e)&&null!==e}function P(e){return S(e)&&"[object Date]"===w(e)}function C(e){return S(e)&&("[object Error]"===w(e)||e instanceof Error)}function O(e){return"function"==typeof e}function w(e){return Object.prototype.toString.call(e)}function _(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(b(o)&&(o=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!a[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var n=t.pid;a[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else a[e]=function(){};return a[e]},r.inspect=s,s.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]},s.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=v,r.isNullOrUndefined=function(e){return null==e},r.isNumber=y,r.isString=g,r.isSymbol=function(e){return"symbol"===_typeof(e)},r.isUndefined=b,r.isRegExp=m,r.isObject=S,r.isDate=P,r.isError=C,r.isFunction=O,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===_typeof(e)||void 0===e},r.isBuffer=e("./support/isBuffer");var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[_(e.getHours()),_(e.getMinutes()),_(e.getSeconds())].join(":"),[e.getDate(),A[e.getMonth()],t].join(" ")),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!S(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":3,_process:24,inherits:2}],5:[function(e,t,r){var n=function(){function e(t,r){_classCallCheck(this,e),this.fable=!1,this.options="object"===_typeof(t)?t:{},this.serviceType="Unknown",this.UUID="CORESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof r?r:"".concat(this.UUID)}return _createClass(e,[{key:"connectFable",value:function(e){return this.fable=e,!0}}]),e}();_defineProperty(n,"isFableService",!0),t.exports=n},{}],6:[function(e,t,r){var n=_createClass((function e(t,r,n){_classCallCheck(this,e),this.fable=t,this.options="object"===_typeof(r)?r:"object"!==_typeof(t)||t.isFable?{}:t,this.serviceType="Unknown","function"==typeof t.getUUID?this.UUID=t.getUUID():this.UUID="NoFABLESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof n?n:"".concat(this.UUID),this.log=this.fable.log,this.servicesMap=this.fable.servicesMap,this.services=this.fable.services}));_defineProperty(n,"isFableService",!0),t.exports=n,t.exports.CoreServiceProviderBase=e("./Fable-ServiceProviderBase-Preinit.js")},{"./Fable-ServiceProviderBase-Preinit.js":5}],7:[function(e,t,r){var n=[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 i={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 o(e,t){var r=i[e];return void 0===r?255:r<<t}t.exports=function(e){var t=e.indexOf("%");if(-1===t)return e;for(var r=e.length,i="",a=0,s=0,c=t,u=12;t>-1&&t<r;){var l=o(e[t+1],4)|o(e[t+2],0),f=n[l];if(s=s<<6|l&n[364+f],12!==(u=n[256+u+f])){if(0===u)return null;if((t+=3)<r&&37===e.charCodeAt(t))continue;return null}i+=e.slice(a,c),i+=s<=65535?String.fromCharCode(s):String.fromCharCode(55232+(s>>10),56320+(1023&s)),s=0,a=t+3,t=c=e.indexOf("%",a)}return i+e.slice(a)}},{}],8:[function(e,t,r){t.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==_typeof(t)&&"object"==_typeof(r)){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r}},{}],9:[function(e,t,r){var n=e("./parse"),i=e("./stringify"),o={parse:n,stringify:i};t.exports=o,t.exports.default=o,t.exports.parse=n,t.exports.stringify=i},{"./parse":11,"./stringify":12}],10:[function(e,t,r){var n=Array.from({length:256},(function(e,t){return"%"+((t<16?"0":"")+t.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]);t.exports={encodeString:function(e){var t=e.length;if(0===t)return"";var r="",o=0,a=0;e:for(;a<t;a++){for(var s=e.charCodeAt(a);s<128;){if(1!==i[s]&&(o<a&&(r+=e.slice(o,a)),o=a+1,r+=n[s]),++a===t)break e;s=e.charCodeAt(a)}if(o<a&&(r+=e.slice(o,a)),s<2048)o=a+1,r+=n[192|s>>6]+n[128|63&s];else if(s<55296||s>=57344)o=a+1,r+=n[224|s>>12]+n[128|s>>6&63]+n[128|63&s];else{if(++a>=t)throw new Error("URI malformed");var c=1023&e.charCodeAt(a);o=a+1,r+=n[240|(s=65536+((1023&s)<<10|c))>>18]+n[128|s>>12&63]+n[128|s>>6&63]+n[128|63&s]}}return 0===o?e:o<t?r+e.slice(o):r}}},{}],11:[function(e,t,r){var n=e("fast-decode-uri-component"),i=/\+/g,o=function(){};o.prototype=Object.create(null),t.exports=function(e){var t=new o;if("string"!=typeof e)return t;for(var r=e.length,a="",s="",c=-1,u=-1,l=!1,f=!1,h=!1,p=!1,d=!1,v=0,y=0;y<r+1;y++)if(38===(v=y!==r?e.charCodeAt(y):38)){if((d=u>c)||(u=y),a=e.slice(c+1,u),d||a.length>0){h&&(a=a.replace(i," ")),l&&(a=n(a)||a),d&&(s=e.slice(u+1,y),p&&(s=s.replace(i," ")),f&&(s=n(s)||s));var g=t[a];void 0===g?t[a]=s:g.pop?g.push(s):t[a]=[g,s]}s="",c=y,u=y,l=!1,f=!1,h=!1,p=!1}else 61===v?u<=c?u=y:f=!0:43===v?u>c?p=!0:h=!0:37===v&&(u>c?f=!0:l=!0);return t}},{"fast-decode-uri-component":7}],12:[function(e,t,r){var n=e("./internals/querystring").encodeString;function i(e){var t=_typeof(e);return"string"===t?n(e):"bigint"===t?e.toString():"boolean"===t?e?"true":"false":"number"===t&&Number.isFinite(e)?e<1e21?""+e:n(""+e):""}t.exports=function(e){var t="";if(null===e||"object"!==_typeof(e))return t;for(var r=Object.keys(e),o=r.length,a=0,s=0;s<o;s++){var c=r[s],u=e[c],l=n(c)+"=";if(s&&(t+="&"),Array.isArray(u)){a=u.length;for(var f=0;f<a;f++)f&&(t+="&"),t+=l,t+=i(u[f])}else t+=l,t+=i(u)}return t}},{"./internals/querystring":10}],13:[function(e,t,r){var n=e("assert"),i=e("fast-querystring"),o=e("safe-regex2"),a=e("fast-deep-equal"),s=e("./lib/pretty-print").prettyPrintTree,c=e("./lib/node"),u=c.StaticNode,l=c.NODE_TYPES,f=e("./lib/constrainer"),h=e("./lib/http-methods"),p=e("./lib/strategies/http-method"),d=e("./lib/url-sanitizer"),v=d.safeDecodeURI,y=d.safeDecodeURIComponent,g=/^https?:\/\/.*?\//,b=/(\/:[^/()]*?)\?(\/?)/;if(!o(g))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!o(b))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function m(e){if(!(this instanceof m))return new m(e);e=e||{},this._opts=e,e.defaultRoute?(n("function"==typeof e.defaultRoute,"The default route must be a function"),this.defaultRoute=e.defaultRoute):this.defaultRoute=null,e.onBadUrl?(n("function"==typeof e.onBadUrl,"The bad url handler must be a function"),this.onBadUrl=e.onBadUrl):this.onBadUrl=null,e.buildPrettyMeta?(n("function"==typeof e.buildPrettyMeta,"buildPrettyMeta must be a function"),this.buildPrettyMeta=e.buildPrettyMeta):this.buildPrettyMeta=A,e.querystringParser?(n("function"==typeof e.querystringParser,"querystringParser must be a function"),this.querystringParser=e.querystringParser):this.querystringParser=function(e){return""===e?{}:i.parse(e)},this.caseSensitive=void 0===e.caseSensitive||e.caseSensitive,this.ignoreTrailingSlash=e.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=e.ignoreDuplicateSlashes||!1,this.maxParamLength=e.maxParamLength||100,this.allowUnsafeRegex=e.allowUnsafeRegex||!1,this.constrainer=new f(e.constraints),this.routes=[],this.trees={}}m.prototype.on=function(e,t,r,i,o){"function"==typeof r&&(void 0!==i&&(o=i),i=r,r={}),n("string"==typeof t,"Path should be a string"),n(t.length>0,"The path could not be empty"),n("/"===t[0]||"*"===t[0],"The first character of a path should be `/` or `*`"),n("function"==typeof i,"Handler should be a function");var a=t.match(b);if(a){n(t.length===a.index+a[0].length,"Optional Parameter needs to be the last parameter of the path");var s=t.replace(b,"$1$2"),c=t.replace(b,"$2");return this.on(e,s,r,i,o),void this.on(e,c,r,i,o)}var u=t;this.ignoreDuplicateSlashes&&(t=C(t)),this.ignoreTrailingSlash&&(t=O(t));var l,f=_createForOfIteratorHelper(Array.isArray(e)?e:[e]);try{for(f.s();!(l=f.n()).done;){var p=l.value;n("string"==typeof p,"Method should be a string"),n(h.includes(p),"Method '".concat(p,"' is not an http method.")),this._on(p,t,r,i,o,u)}}catch(e){f.e(e)}finally{f.f()}},m.prototype._on=function(e,t,r,i,s){var c={};void 0!==r.constraints&&(n("object"===_typeof(r.constraints)&&null!==r.constraints,"Constraints should be an object"),0!==Object.keys(r.constraints).length&&(c=r.constraints)),this.constrainer.validateConstraints(c),this.constrainer.noteUsage(c),void 0===this.trees[e]&&(this.trees[e]=new u("/"));var l=t;if("*"===l&&0!==this.trees[e].prefix.length){var f=this.trees[e];this.trees[e]=new u(""),this.trees[e].staticChildren["/"]=f}for(var h=this.trees[e],p=h.prefix.length,d=[],v=0;v<=l.length;v++)if(58!==l.charCodeAt(v)||58!==l.charCodeAt(v+1)){var y=58===l.charCodeAt(v)&&58!==l.charCodeAt(v+1),g=42===l.charCodeAt(v);if(y||g||v===l.length&&v!==p){var b=l.slice(p,v);this.caseSensitive||(b=b.toLowerCase()),b=(b=b.split("::").join(":")).split("%").join("%25"),h=h.createStaticChild(b)}if(y)for(var m=!1,S=[],P=v+1,C=P;;C++){var O=l.charCodeAt(C),A=40===O,x=45===O||46===O,k=47===O||C===l.length;if(A||x||k){var E=l.slice(P,C);if(d.push(E),m=m||A||x,A){var j=_(l,C),I=l.slice(C,j+1);this.allowUnsafeRegex||n(o(new RegExp(I)),"The regex '".concat(I,"' is not safe!")),S.push(w(I)),C=j+1}else S.push("(.*?)");for(var R=C;C<l.length;C++){var T=l.charCodeAt(C);if(47===T)break;if(58===T){if(58!==l.charCodeAt(C+1))break;C++}}var D=l.slice(R,C);if(D&&(D=(D=D.split("::").join(":")).split("%").join("%25"),S.push(D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))),P=C+1,k||47===l.charCodeAt(C)||C===l.length){var U=m?"()"+D:D,N=l.slice(v,C);l=l.slice(0,v+1)+U+l.slice(C),v+=U.length;var B=m?new RegExp("^"+S.join("")+"$"):null;h=h.createParametricChild(B,D||null,N),p=v+1;break}}}else if(g&&(d.push("*"),h=h.createWildcardChild(),p=v+1,v!==l.length-1))throw new Error("Wildcard must be the last character in the route")}else v++;this.caseSensitive||(l=l.toLowerCase()),"*"===l&&(l="/*");var H,M=_createForOfIteratorHelper(this.routes);try{for(M.s();!(H=M.n()).done;){var F=H.value,q=F.opts.constraints||{};if(F.method===e&&F.pattern===l&&a(q,c))throw new Error("Method '".concat(e,"' already declared for route '").concat(l,"' with constraints '").concat(JSON.stringify(c),"'"))}}catch(e){M.e(e)}finally{M.f()}var z={method:e,path:t,pattern:l,params:d,opts:r,handler:i,store:s};this.routes.push(z),h.addRoute(z,this.constrainer)},m.prototype.hasConstraintStrategy=function(e){return this.constrainer.hasConstraintStrategy(e)},m.prototype.addConstraintStrategy=function(e){this.constrainer.addConstraintStrategy(e),this._rebuild(this.routes)},m.prototype.reset=function(){this.trees={},this.routes=[]},m.prototype.off=function(e,t,r){n("string"==typeof t,"Path should be a string"),n(t.length>0,"The path could not be empty"),n("/"===t[0]||"*"===t[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.");var i=t.match(b);if(i){n(t.length===i.index+i[0].length,"Optional Parameter needs to be the last parameter of the path");var o=t.replace(b,"$1$2"),a=t.replace(b,"$2");return this.off(e,o,r),void this.off(e,a,r)}this.ignoreDuplicateSlashes&&(t=C(t)),this.ignoreTrailingSlash&&(t=O(t));var s,c=_createForOfIteratorHelper(Array.isArray(e)?e:[e]);try{for(c.s();!(s=c.n()).done;){var u=s.value;this._off(u,t,r)}}catch(e){c.e(e)}finally{c.f()}},m.prototype._off=function(e,t,r){function i(r){return e!==r.method||t!==r.path}n("string"==typeof e,"Method should be a string"),n(h.includes(e),"Method '".concat(e,"' is not an http method."));var o=r?function(e){return i(e)||!a(r,e.opts.constraints||{})}:i,s=this.routes.filter(o);this._rebuild(s)},m.prototype.lookup=function(e,t,r,n){var i=this;if("function"==typeof r&&(n=r,r=void 0),void 0===n){var o=this.constrainer.deriveConstraints(e,r),a=this.find(e.method,e.url,o);return this.callHandler(a,e,t,r)}this.constrainer.deriveConstraints(e,r,(function(o,a){if(null===o)try{var s=i.find(e.method,e.url,a),c=i.callHandler(s,e,t,r);n(null,c)}catch(o){n(o)}else n(o)}))},m.prototype.callHandler=function(e,t,r,n){return null===e?this._defaultRoute(t,r,n):void 0===n?e.handler(t,r,e.params,e.store,e.searchParams):e.handler.call(n,t,r,e.params,e.store,e.searchParams)},m.prototype.find=function(e,t,r){var n,i,o,a=this.trees[e];if(void 0===a)return null;47!==t.charCodeAt(0)&&(t=t.replace(g,"/")),this.ignoreDuplicateSlashes&&(t=C(t));try{t=(n=v(t)).path,i=n.querystring,o=n.shouldDecodeParam}catch(e){return this._onBadUrl(t)}this.ignoreTrailingSlash&&(t=O(t));var s=t;!1===this.caseSensitive&&(t=t.toLowerCase());for(var c=this.maxParamLength,u=a.prefix.length,f=[],h=t.length,p=[];;){if(u===h&&a.isLeafNode){var d=a.handlerStorage.getMatchingHandler(r);if(null!==d)return{handler:d.handler,store:d.store,params:d._createParamsObject(f),searchParams:this.querystringParser(i)}}var b=a.getNextNode(t,u,p,f.length);if(null===b){if(0===p.length)return null;var m=p.pop();u=m.brotherPathIndex,f.splice(m.paramsCount),b=m.brotherNode}if((a=b).kind!==l.STATIC)if(a.kind!==l.WILDCARD){if(a.kind===l.PARAMETRIC){var S=s.indexOf("/",u);-1===S&&(S=h);var P=s.slice(u,S);if(o&&(P=y(P)),a.isRegex){var w=a.regex.exec(P);if(null===w)continue;for(var _=1;_<w.length;_++){var A=w[_];if(A.length>c)return null;f.push(A)}}else{if(P.length>c)return null;f.push(P)}u=S}}else{var x=s.slice(u);o&&(x=y(x)),f.push(x),u=h}else u+=a.prefix.length}},m.prototype._rebuild=function(e){this.reset();var t,r=_createForOfIteratorHelper(e);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=n.method,o=n.path,a=n.opts,s=n.handler,c=n.store;this._on(i,o,a,s,c)}}catch(e){r.e(e)}finally{r.f()}},m.prototype._defaultRoute=function(e,t,r){if(null!==this.defaultRoute)return void 0===r?this.defaultRoute(e,t):this.defaultRoute.call(r,e,t);t.statusCode=404,t.end()},m.prototype._onBadUrl=function(e){if(null===this.onBadUrl)return null;var t=this.onBadUrl;return{handler:function(r,n,i){return t(e,r,n)},params:{},store:null}},m.prototype.prettyPrint=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.method;e.buildPrettyMeta=this.buildPrettyMeta.bind(this);var r=null;if(void 0===t){var n=this.constrainer.strategies,i=(n.version,n.host,_objectWithoutProperties(n,_excluded));i[p.name]=p;var o=new m(_objectSpread(_objectSpread({},this._opts),{},{constraints:i})),a=this.routes.map((function(e){var t=_objectSpread(_objectSpread({},e.opts.constraints),{},_defineProperty({},p.name,e.method));return _objectSpread(_objectSpread({},e),{},{method:"MERGED",opts:{constraints:t}})}));o._rebuild(a),r=o.trees.MERGED}else r=this.trees[t];return null==r?"(empty tree)":s(r,e)};var S=function(){if(!h.hasOwnProperty(P))return"continue";var e=h[P],t=e.toLowerCase();if(m.prototype[t])throw new Error("Method already exists: "+t);m.prototype[t]=function(t,r,n){return this.on(e,t,r,n)}};for(var P in h)S();function C(e){return e.replace(/\/\/+/g,"/")}function O(e){return e.length>1&&47===e.charCodeAt(e.length-1)?e.slice(0,-1):e}function w(e){return 94===e.charCodeAt(1)&&(e=e.slice(0,1)+e.slice(2)),36===e.charCodeAt(e.length-2)&&(e=e.slice(0,e.length-2)+e.slice(e.length-1)),e}function _(e,t){for(var r=1;t<e.length;)if("\\"!==e[++t]){if(")"===e[t]?r--:"("===e[t]&&r++,!r)return t}else t++;throw new TypeError('Invalid regexp expression in "'+e+'"')}function A(e){return e&&e.store?Object.assign({},e.store):{}}m.prototype.all=function(e,t,r){this.on(h,e,t,r)},t.exports=m},{"./lib/constrainer":14,"./lib/http-methods":16,"./lib/node":17,"./lib/pretty-print":18,"./lib/strategies/http-method":21,"./lib/url-sanitizer":22,assert:1,"fast-deep-equal":8,"fast-querystring":9,"safe-regex2":25}],14:[function(e,t,r){var n=e("./strategies/accept-version"),i=e("./strategies/accept-host"),o=e("assert"),a=function(){function e(t){if(_classCallCheck(this,e),this.strategies={version:n,host:i},this.strategiesInUse=new Set,this.asyncStrategiesInUse=new Set,t)for(var r=0,o=Object.values(t);r<o.length;r++){var a=o[r];this.addConstraintStrategy(a)}}return _createClass(e,[{key:"isStrategyUsed",value:function(e){return this.strategiesInUse.has(e)||this.asyncStrategiesInUse.has(e)}},{key:"hasConstraintStrategy",value:function(e){var t=this.strategies[e];return void 0!==t&&(t.isCustom||this.isStrategyUsed(e))}},{key:"addConstraintStrategy",value:function(e){if(o("string"==typeof e.name&&""!==e.name,"strategy.name is required."),o(e.storage&&"function"==typeof e.storage,"strategy.storage function is required."),o(e.deriveConstraint&&"function"==typeof e.deriveConstraint,"strategy.deriveConstraint function is required."),this.strategies[e.name]&&this.strategies[e.name].isCustom)throw new Error("There already exists a custom constraint with the name ".concat(e.name,"."));if(this.isStrategyUsed(e.name))throw new Error("There already exists a route with ".concat(e.name," constraint."));e.isCustom=!0,e.isAsync=3===e.deriveConstraint.length,this.strategies[e.name]=e,e.mustMatchWhenDerived&&this.noteUsage(_defineProperty({},e.name,e))}},{key:"deriveConstraints",value:function(e,t,r){var n=this.deriveSyncConstraints(e,t);if(void 0===r)return n;this.deriveAsyncConstraints(n,e,t,r)}},{key:"deriveSyncConstraints",value:function(e,t){}},{key:"noteUsage",value:function(e){if(e){var t=this.strategiesInUse.size;for(var r in e){this.strategies[r].isAsync?this.asyncStrategiesInUse.add(r):this.strategiesInUse.add(r)}t!==this.strategiesInUse.size&&this._buildDeriveConstraints()}}},{key:"newStoreForConstraint",value:function(e){if(!this.strategies[e])throw new Error("No strategy registered for constraint key ".concat(e));return this.strategies[e].storage()}},{key:"validateConstraints",value:function(e){for(var t in e){var r=e[t];if(void 0===r)throw new Error("Can't pass an undefined constraint value, must pass null or no key at all");var n=this.strategies[t];if(!n)throw new Error("No strategy registered for constraint key ".concat(t));n.validate&&n.validate(r)}}},{key:"deriveAsyncConstraints",value:function(e,t,r,n){var i=this,o=this.asyncStrategiesInUse.size;if(0!==o){e=e||{};var a,s=_createForOfIteratorHelper(this.asyncStrategiesInUse);try{var c=function(){var s=a.value;i.strategies[s].deriveConstraint(t,r,(function(t,r){null===t?(e[s]=r,0==--o&&n(null,e)):n(t)}))};for(s.s();!(a=s.n()).done;)c()}catch(e){s.e(e)}finally{s.f()}}else n(null,e)}},{key:"_buildDeriveConstraints",value:function(){if(0!==this.strategiesInUse.size){var e,t=["return {"],r=_createForOfIteratorHelper(this.strategiesInUse);try{for(r.s();!(e=r.n()).done;){var n=e.value,i=this.strategies[n];if(i.isCustom)t.push(" ".concat(i.name,": this.strategies.").concat(n,".deriveConstraint(req, ctx),"));else if("version"===n)t.push(" version: req.headers['accept-version'],");else{if("host"!==n)throw new Error("unknown non-custom strategy for compiling constraint derivation function");t.push(" host: req.headers.host || req.headers[':authority'],")}}}catch(e){r.e(e)}finally{r.f()}t.push("}"),this.deriveSyncConstraints=new Function("req","ctx",t.join("\n")).bind(this)}}}]),e}();t.exports=a},{"./strategies/accept-host":19,"./strategies/accept-version":20,assert:1}],15:[function(e,t,r){var n=e("./strategies/http-method"),i=function(){function e(){_classCallCheck(this,e),this.unconstrainedHandler=null,this.constraints=[],this.handlers=[],this.constrainedHandlerStores=null}return _createClass(e,[{key:"getMatchingHandler",value:function(e){return void 0===e?this.unconstrainedHandler:this._getHandlerMatchingConstraints(e)}},{key:"addHandler",value:function(e,t){var r=t.params,i=t.opts.constraints||{},o={params:r,constraints:i,handler:t.handler,store:t.store||null,_createParamsObject:this._compileCreateParamsObject(r)},a=Object.keys(i);0===a.length&&(this.unconstrainedHandler=o);for(var s=0,c=a;s<c.length;s++){var u=c[s];this.constraints.includes(u)||("version"===u?this.constraints.unshift(u):this.constraints.push(u))}var l=a.includes(n.name);if(!l&&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(o),this.handlers.sort((function(e,t){return Object.keys(e.constraints).length-Object.keys(t.constraints).length})),l||this._compileGetHandlerMatchingConstraints(e,i)}},{key:"_compileCreateParamsObject",value:function(e){for(var t=[],r=0;r<e.length;r++)t.push("'".concat(e[r],"': paramsArray[").concat(r,"]"));return new Function("paramsArray","return {".concat(t.join(","),"}"))}},{key:"_getHandlerMatchingConstraints",value:function(){return null}},{key:"_buildConstraintStore",value:function(e,t){for(var r=0;r<this.handlers.length;r++){var n=this.handlers[r].constraints[t];if(void 0!==n){var i=e.get(n)||0;i|=1<<r,e.set(n,i)}}}},{key:"_constrainedIndexBitmask",value:function(e){for(var t=0,r=0;r<this.handlers.length;r++){void 0!==this.handlers[r].constraints[e]&&(t|=1<<r)}return~t}},{key:"_compileGetHandlerMatchingConstraints",value:function(e){this.constrainedHandlerStores={};var t,r=_createForOfIteratorHelper(this.constraints);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=e.newStoreForConstraint(n);this.constrainedHandlerStores[n]=i,this._buildConstraintStore(i,n)}}catch(e){r.e(e)}finally{r.f()}var o=[];o.push("\n let candidates = ".concat((1<<this.handlers.length)-1,"\n let mask, matches\n "));var a,s=_createForOfIteratorHelper(this.constraints);try{for(s.s();!(a=s.n()).done;){var c=a.value;o.push("\n mask = ".concat(this._constrainedIndexBitmask(c),"\n value = derivedConstraints.").concat(c,"\n "));var u=e.strategies[c].mustMatchWhenDerived?"matches":"(matches | mask)";o.push("\n if (value === undefined) {\n candidates &= mask\n } else {\n matches = this.constrainedHandlerStores.".concat(c,".get(value) || 0\n candidates &= ").concat(u,"\n }\n if (candidates === 0) return null;\n "))}}catch(e){s.e(e)}finally{s.f()}for(var l in e.strategies){e.strategies[l].mustMatchWhenDerived&&!this.constraints.includes(l)&&o.push("if (derivedConstraints.".concat(l," !== undefined) return null"))}o.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",o.join("\n"))}}]),e}();t.exports=i},{"./strategies/http-method":21}],16:[function(e,t,r){t.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"]},{}],17:[function(e,t,r){var n=e("./handler-storage"),i={STATIC:0,PARAMETRIC:1,WILDCARD:2},o=function(){function e(){_classCallCheck(this,e),this.isLeafNode=!1,this.routes=null,this.handlerStorage=null}return _createClass(e,[{key:"addRoute",value:function(e,t){null===this.routes&&(this.routes=[]),null===this.handlerStorage&&(this.handlerStorage=new n),this.isLeafNode=!0,this.routes.push(e),this.handlerStorage.addHandler(t,e)}}]),e}(),a=function(e){_inherits(r,e);var t=_createSuper(r);function r(){var e;return _classCallCheck(this,r),(e=t.call(this)).staticChildren={},e}return _createClass(r,[{key:"findStaticMatchingChild",value:function(e,t){var r=this.staticChildren[e.charAt(t)];return void 0!==r&&r.matchPrefix(e,t)?r:null}},{key:"createStaticChild",value:function(e){if(0===e.length)return this;var t=this.staticChildren[e.charAt(0)];if(t){for(var r=1;r<t.prefix.length;r++)if(e.charCodeAt(r)!==t.prefix.charCodeAt(r)){t=t.split(this,r);break}return t.createStaticChild(e.slice(r))}var n=e.charAt(0);return this.staticChildren[n]=new s(e),this.staticChildren[n]}}]),r}(o),s=function(e){_inherits(r,e);var t=_createSuper(r);function r(e){var n;return _classCallCheck(this,r),(n=t.call(this)).prefix=e,n.wildcardChild=null,n.parametricChildren=[],n.kind=i.STATIC,n._compilePrefixMatch(),n}return _createClass(r,[{key:"createParametricChild",value:function(e,t,r){var n=e&&e.source,i=this.parametricChildren.find((function(e){return(e.regex&&e.regex.source)===n}));return i?(i.nodePaths.add(r),i):(i=new c(e,t,r),this.parametricChildren.push(i),this.parametricChildren.sort((function(e,t){return e.isRegex?t.isRegex?null===e.staticSuffix?1:null===t.staticSuffix?-1:t.staticSuffix.endsWith(e.staticSuffix)?1:e.staticSuffix.endsWith(t.staticSuffix)?-1:0:-1:1})),i)}},{key:"createWildcardChild",value:function(){return this.wildcardChild||(this.wildcardChild=new u),this.wildcardChild}},{key:"split",value:function(e,t){var n=this.prefix.slice(0,t),i=this.prefix.slice(t);this.prefix=i,this._compilePrefixMatch();var o=new r(n);return o.staticChildren[i.charAt(0)]=this,e.staticChildren[n.charAt(0)]=o,o}},{key:"getNextNode",value:function(e,t,r,n){var i=this.findStaticMatchingChild(e,t),o=0;if(null===i){if(0===this.parametricChildren.length)return this.wildcardChild;i=this.parametricChildren[0],o=1}null!==this.wildcardChild&&r.push({paramsCount:n,brotherPathIndex:t,brotherNode:this.wildcardChild});for(var a=this.parametricChildren.length-1;a>=o;a--)r.push({paramsCount:n,brotherPathIndex:t,brotherNode:this.parametricChildren[a]});return i}},{key:"_compilePrefixMatch",value:function(){if(1!==this.prefix.length){for(var e=[],t=1;t<this.prefix.length;t++){var r=this.prefix.charCodeAt(t);e.push("path.charCodeAt(i + ".concat(t,") === ").concat(r))}this.matchPrefix=new Function("path","i","return ".concat(e.join(" && ")))}else this.matchPrefix=function(){return!0}}}]),r}(a),c=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,o){var a;return _classCallCheck(this,r),(a=t.call(this)).isRegex=!!e,a.regex=e||null,a.staticSuffix=n||null,a.kind=i.PARAMETRIC,a.nodePaths=new Set([o]),a}return _createClass(r,[{key:"getNextNode",value:function(e,t){return this.findStaticMatchingChild(e,t)}}]),r}(a),u=function(e){_inherits(r,e);var t=_createSuper(r);function r(){var e;return _classCallCheck(this,r),(e=t.call(this)).kind=i.WILDCARD,e}return _createClass(r,[{key:"getNextNode",value:function(){return null}}]),r}(o);t.exports={StaticNode:s,ParametricNode:c,WildcardNode:u,NODE_TYPES:i}},{"./handler-storage":15}],18:[function(e,t,r){var n=e("fast-deep-equal"),i=e("./strategies/http-method"),o=Symbol("treeData");function a(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r="",n=Object.keys(e),i=0;i<n.length;i++){var s=n[i],c=e[s],u=i===n.length-1,l=u?" ":"│ ";r+=t+(u?"└── ":"├── ")+s+(c[o]||"").split("\n").join("\n"+t+l)+"\n",r+=a(c,t+l)}return r}function s(e){return Array.isArray(e)?e.map((function(e){return s(e)})):"symbol"===_typeof(e)?e.toString():"function"==typeof e?((e.name||"").replace("bound","").trim()||"anonymous")+"()":e}function c(e){var t=_objectSpread({},e.opts.constraints),r=t[i.name];return delete t[i.name],_objectSpread(_objectSpread({},e),{},{method:r,opts:{constraints:t}})}function u(e){var t=" (".concat(e.method,")"),r=e.opts.constraints||{};return 0!==Object.keys(r).length&&(t+=" "+JSON.stringify(r)),t+=function(e){for(var t="",r=0,n=Object.entries(e);r<n.length;r++){var i=_slicedToArray(n[r],2),o=i[0],a=i[1];t+="\n• (".concat(o,") ").concat(a)}return t}(e.metaData)}function l(e,t,r){var i=e.routes;return void 0===r.method&&(i=i.map(c)),i=i.map((function(e){return e.metaData=function(e,t){if(!t.includeMeta)return{};var r=t.buildPrettyMeta(e),n={},i=t.includeMeta;Array.isArray(i)||(i=Reflect.ownKeys(r));var o,a=_createForOfIteratorHelper(i);try{for(a.s();!(o=a.n()).done;){var c=o.value;if(Object.prototype.hasOwnProperty.call(r,c)){var u=c.toString(),l=r[c];if(null!=l){var f=JSON.stringify(s(l));n[u]=f}}}}catch(e){a.e(e)}finally{a.f()}return n}(e,r),e})),void 0===r.method&&(i=function(e){return e.reduce((function(e,t){var r,i=_createForOfIteratorHelper(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(n(t.opts.constraints,o.opts.constraints)&&n(t.metaData,o.metaData))return o.method+=", "+t.method,e}}catch(e){i.e(e)}finally{i.f()}return e.push(t),e}),[])}(i)),i.map(u).join("\n".concat(t))}function f(e,t,r,n){if((e.isLeafNode||!1!==n.commonPrefix)&&(t=t[r=r||"(empty root node)"]={},e.isLeafNode&&(t[o]=l(e,r,n)),r=""),e.staticChildren)for(var i=0,a=Object.values(e.staticChildren);i<a.length;i++){var s=a[i];f(s,t,r+s.prefix,n)}if(e.parametricChildren)for(var c=0,u=Object.values(e.parametricChildren);c<u.length;c++){var h=u[c];f(h,t,r+Array.from(h.nodePaths).join("|"),n)}e.wildcardChild&&f(e.wildcardChild,t,"*",n)}t.exports={prettyPrintTree:function(e,t){var r={};return f(e,r,e.prefix,t),a(r)}}},{"./strategies/http-method":21,"fast-deep-equal":8}],19:[function(e,t,r){var n=e("assert");t.exports={name:"host",mustMatchWhenDerived:!1,storage:function(){var e={},t=[];return{get:function(r){var n=e[r];if(n)return n;for(var i=0,o=t;i<o.length;i++){var a=o[i];if(a.host.test(r))return a.value}},set:function(r,n){r instanceof RegExp?t.push({host:r,value:n}):e[r]=n}}},validate:function(e){n("string"==typeof e||"[object RegExp]"===Object.prototype.toString.call(e),"Host should be a string or a RegExp")}}},{assert:1}],20:[function(e,t,r){var n=e("assert");function i(){if(!(this instanceof i))return new i;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}i.prototype.set=function(e,t){if("string"!=typeof e)throw new TypeError("Version should be a string");var r=_slicedToArray(e.split("."),3),n=r[0],i=r[1],o=r[2];return n=Number(n)||0,i=Number(i)||0,o=Number(o)||0,n>=this.maxMajor&&(this.maxMajor=n,this.store.x=t,this.store["*"]=t,this.store["x.x"]=t,this.store["x.x.x"]=t),i>=(this.maxMinors[n]||0)&&(this.maxMinors[n]=i,this.store["".concat(n,".x")]=t,this.store["".concat(n,".x.x")]=t),o>=(this.store["".concat(n,".").concat(i)]||0)&&(this.maxPatches["".concat(n,".").concat(i)]=o,this.store["".concat(n,".").concat(i,".x")]=t),this.store["".concat(n,".").concat(i,".").concat(o)]=t,this},i.prototype.get=function(e){return this.store[e]},t.exports={name:"version",mustMatchWhenDerived:!0,storage:i,validate:function(e){n("string"==typeof e,"Version should be a string")}}},{assert:1}],21:[function(e,t,r){t.exports={name:"__fmw_internal_strategy_merged_tree_http_method__",storage:function(){var e={};return{get:function(t){return e[t]||null},set:function(t,r){e[t]=r}}},deriveConstraint:function(e){return e.method},mustMatchWhenDerived:!0}},{}],22:[function(e,t,r){function n(e,t){return 50===e?53===t?"%":51===t?"#":52===t?"$":54===t?"&":66===t||98===t?"+":67===t||99===t?",":70===t||102===t?"/":null:51===e?65===t||97===t?":":66===t||98===t?";":68===t||100===t?"=":70===t||102===t?"?":null:52===e&&48===t?"@":null}t.exports={safeDecodeURI:function(e){for(var t=!1,r=!1,i="",o=1;o<e.length;o++){var a=e.charCodeAt(o);if(37===a){var s=e.charCodeAt(o+1),c=e.charCodeAt(o+2);null===n(s,c)?t=!0:(r=!0,50===s&&53===c&&(t=!0,e=e.slice(0,o+1)+"25"+e.slice(o+1),o+=2),o+=2)}else if(63===a||59===a||35===a){i=e.slice(o+1),e=e.slice(0,o);break}}return{path:t?decodeURI(e):e,querystring:i,shouldDecodeParam:r}},safeDecodeURIComponent:function(e){var t=e.indexOf("%");if(-1===t)return e;for(var r="",i=t,o=t;o<e.length;o++)if(37===e.charCodeAt(o)){var a=n(e.charCodeAt(o+1),e.charCodeAt(o+2));r+=e.slice(i,o)+a,i=o+3}return e.slice(0,t)+r+e.slice(i)}}},{}],23:[function(e,t,r){var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,a,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),c=1;c<arguments.length;c++){for(var u in r=Object(arguments[c]))i.call(r,u)&&(s[u]=r[u]);if(n){a=n(r);for(var l=0;l<a.length;l++)o.call(r,a[l])&&(s[a[l]]=r[a[l]])}}return s}},{}],24:[function(e,t,r){var n,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var u,l=[],f=!1,h=-1;function p(){f&&u&&(f=!1,u.length?l=u.concat(l):h=-1,l.length&&d())}function d(){if(!f){var e=c(p);f=!0;for(var t=l.length;t;){for(u=l,l=[];++h<t;)u&&u[h].run();h=-1,t=l.length}u=null,f=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function v(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new v(e,t)),1!==l.length||f||c(d)},v.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],25:[function(e,t,r){var n=e("ret"),i=n.types;t.exports=function(e,t){t||(t={});var r,o=void 0===t.limit?25:t.limit;r=e,"[object RegExp]"==={}.toString.call(r)?e=e.source:"string"!=typeof e&&(e=String(e));try{e=n(e)}catch(e){return!1}var a=0;return function e(t,r){var n,s;if(t.type===i.REPETITION){if(r++,a++,r>1)return!1;if(a>o)return!1}if(t.options)for(n=0,s=t.options.length;n<s;n++)if(!e({stack:t.options[n]},r))return!1;var c=t.stack||t.value&&t.value.stack;if(!c)return!0;for(n=0;n<c.length;n++)if(!e(c[n],r))return!1;return!0}(e,0)}},{ret:26}],26:[function(e,t,r){var n=e("./util"),i=e("./types"),o=e("./sets"),a=e("./positions");t.exports=function(e){var t,r,s=0,c={type:i.ROOT,stack:[]},u=c,l=c.stack,f=[],h=function(t){n.error(e,"Nothing to repeat at column ".concat(t-1))},p=n.strToChars(e);for(t=p.length;s<t;)switch(r=p[s++]){case"\\":switch(r=p[s++]){case"b":l.push(a.wordBoundary());break;case"B":l.push(a.nonWordBoundary());break;case"w":l.push(o.words());break;case"W":l.push(o.notWords());break;case"d":l.push(o.ints());break;case"D":l.push(o.notInts());break;case"s":l.push(o.whitespace());break;case"S":l.push(o.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(a.begin());break;case"$":l.push(a.end());break;case"[":var d;"^"===p[s]?(d=!0,s++):d=!1;var v=n.tokenizeClass(p.slice(s),e);s+=v[1],l.push({type:i.SET,set:v[0],not:d});break;case".":l.push(o.anyChar());break;case"(":var y={type:i.GROUP,stack:[],remember:!0};"?"===(r=p[s])&&(r=p[s+1],s+=2,"="===r?y.followedBy=!0:"!"===r?y.notFollowedBy=!0:":"!==r&&n.error(e,"Invalid group, character '".concat(r,"'")+" after '?' at column ".concat(s-1)),y.remember=!1),l.push(y),f.push(u),u=y,l=y.stack;break;case")":0===f.length&&n.error(e,"Unmatched ) at column ".concat(s-1)),l=(u=f.pop()).options?u.options[u.options.length-1]:u.stack;break;case"|":u.options||(u.options=[u.stack],delete u.stack);var g=[];u.options.push(g),l=g;break;case"{":var b,m,S=/^(\d+)(,(\d+)?)?\}/.exec(p.slice(s));null!==S?(0===l.length&&h(s),b=parseInt(S[1],10),m=S[2]?S[3]?parseInt(S[3],10):1/0:b,s+=S[0].length,l.push({type:i.REPETITION,min:b,max:m,value:l.pop()})):l.push({type:i.CHAR,value:123});break;case"?":0===l.length&&h(s),l.push({type:i.REPETITION,min:0,max:1,value:l.pop()});break;case"+":0===l.length&&h(s),l.push({type:i.REPETITION,min:1,max:1/0,value:l.pop()});break;case"*":0===l.length&&h(s),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(e,"Unterminated group"),c},t.exports.types=i},{"./positions":27,"./sets":28,"./types":29,"./util":30}],27:[function(e,t,r){var n=e("./types");r.wordBoundary=function(){return{type:n.POSITION,value:"b"}},r.nonWordBoundary=function(){return{type:n.POSITION,value:"B"}},r.begin=function(){return{type:n.POSITION,value:"^"}},r.end=function(){return{type:n.POSITION,value:"$"}}},{"./types":29}],28:[function(e,t,r){var n=e("./types"),i=function(){return[{type:n.RANGE,from:48,to:57}]},o=function(){return[{type:n.CHAR,value:95},{type:n.RANGE,from:97,to:122},{type:n.RANGE,from:65,to:90}].concat(i())},a=function(){return[{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=function(){return{type:n.SET,set:o(),not:!1}},r.notWords=function(){return{type:n.SET,set:o(),not:!0}},r.ints=function(){return{type:n.SET,set:i(),not:!1}},r.notInts=function(){return{type:n.SET,set:i(),not:!0}},r.whitespace=function(){return{type:n.SET,set:a(),not:!1}},r.notWhitespace=function(){return{type:n.SET,set:a(),not:!0}},r.anyChar=function(){return{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":29}],29:[function(e,t,r){t.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}},{}],30:[function(e,t,r){var n=e("./types"),i=e("./sets"),o={0:0,t:9,n:10,v:11,f:12,r:13};r.strToChars=function(e){return e=e.replace(/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g,(function(e,t,r,n,i,a,s,c){if(r)return e;var u=t?8:n?parseInt(n,16):i?parseInt(i,16):a?parseInt(a,8):s?"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?".indexOf(s):o[c],l=String.fromCharCode(u);return/[[\]{}^$.|?*+()]/.test(l)&&(l="\\"+l),l}))},r.tokenizeClass=function(e,t){for(var o,a,s=[],c=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g;null!=(o=c.exec(e));)if(o[1])s.push(i.words());else if(o[2])s.push(i.ints());else if(o[3])s.push(i.whitespace());else if(o[4])s.push(i.notWords());else if(o[5])s.push(i.notInts());else if(o[6])s.push(i.notWhitespace());else if(o[7])s.push({type:n.RANGE,from:(o[8]||o[9]).charCodeAt(0),to:o[10].charCodeAt(0)});else{if(!(a=o[12]))return[s,c.lastIndex];s.push({type:n.CHAR,value:a.charCodeAt(0)})}r.error(t,"Unterminated character class")},r.error=function(e,t){throw new SyntaxError("Invalid regular expression: /"+e+"/: "+t)}},{"./sets":28,"./types":29}],31:[function(e,t,r){t.exports={Product:"Unnamed_Service",ProductVersion:"0.0.1",ServicePort:8080}},{}],32:[function(e,t,r){t.exports=e("./Orator-ServiceServer-IPC.js")},{"./Orator-ServiceServer-IPC.js":35}],33:[function(e,t,r){var n=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,i){var o;return _classCallCheck(this,r),(o=t.call(this,e,n,i)).serviceType="OratorServiceServer",o.ServiceServerType="Base",o.Name=o.fable.settings.Product,o.URL="BASE_SERVICE_SERVER",o.Port=o.options.ServicePort,o.Active=!1,o}return _createClass(r,[{key:"listen",value:function(e,t){return this.Active=!0,t()}},{key:"close",value:function(e){return this.Active=!1,e()}},{key:"bodyParser",value:function(e){return function(e,t,r){r()}}},{key:"use",value:function(e){return"function"==typeof e||(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 ".concat(_typeof(e)," instead of a string.")),!1)}},{key:"doGet",value:function(e){return!0}},{key:"get",value:function(e){if("string"!=typeof e)return this.log.error("Orator GET Route mapping failed -- route parameter was ".concat(_typeof(e)," instead of a string.")),!1;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.doGet.apply(this,[e].concat(r))}},{key:"getWithBodyParser",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.get.apply(this,[e,this.bodyParser()].concat(r))}},{key:"doPut",value:function(e){return!0}},{key:"put",value:function(e){if("string"!=typeof e)return this.log.error("Orator PUT Route mapping failed -- route parameter was ".concat(_typeof(e)," instead of a string.")),!1;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.doPut.apply(this,[e].concat(r))}},{key:"putWithBodyParser",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.put.apply(this,[e,this.bodyParser()].concat(r))}},{key:"doPost",value:function(e){return!0}},{key:"post",value:function(e){if("string"!=typeof e)return this.log.error("Orator POST Route mapping failed -- route parameter was ".concat(_typeof(e)," instead of a string.")),!1;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.doPost.apply(this,[e].concat(r))}},{key:"postWithBodyParser",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.post.apply(this,[e,this.bodyParser()].concat(r))}},{key:"doDel",value:function(e){return!0}},{key:"del",value:function(e){if("string"!=typeof e)return this.log.error("Orator DEL Route mapping failed -- route parameter was ".concat(_typeof(e)," instead of a string.")),!1;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.doDel.apply(this,[e].concat(r))}},{key:"delWithBodyParser",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.del.apply(this,[e,this.bodyParser()].concat(r))}},{key:"doPatch",value:function(e){return!0}},{key:"patch",value:function(e){if("string"!=typeof e)return this.log.error("Orator PATCH Route mapping failed -- route parameter was ".concat(_typeof(e)," instead of a string.")),!1;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.doPatch.apply(this,[e].concat(r))}},{key:"patchWithBodyParser",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.patch.apply(this,[e,this.bodyParser()].concat(r))}},{key:"doOpts",value:function(e){return!0}},{key:"opts",value:function(e){if("string"!=typeof e)return this.log.error("Orator OPTS Route mapping failed -- route parameter was ".concat(_typeof(e)," instead of a string.")),!1;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.doOpts.apply(this,[e].concat(r))}},{key:"optsWithBodyParser",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.opts.apply(this,[e,this.bodyParser()].concat(r))}},{key:"doHead",value:function(e){return!0}},{key:"head",value:function(e){return"string"==typeof e||(this.log.error("Orator HEAD Route mapping failed -- route parameter was ".concat(_typeof(e)," instead of a string.")),!1)}},{key:"headWithBodyParser",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.head.apply(this,[e,this.bodyParser()].concat(r))}},{key:"invoke",value:function(e,t,r,n){return this.log.debug("Orator invoke called for route [".concat(t,"] and landed on the base class; the service provider likely does not implement programmatic invoke capabilities."),r),!1}}]),r}(e("fable-serviceproviderbase"));t.exports=n},{"fable-serviceproviderbase":6}],34:[function(e,t,r){var n=function(){function e(t,r,n){_classCallCheck(this,e),this.log=r,t.hasOwnProperty("params")?this.params=t.params:this.params={},t.hasOwnProperty("searchParams")?this.searchParams=t.searchParams:this.searchParams={},this.requestGUID=n,this.responseData=null,this.responseStatus=-1}return _createClass(e,[{key:"send",value:function(e){return"string"==typeof e?null===this.responseData?(this.responseData=e,!0):"string"==typeof this.responseData?(this.responseData=this.responseData+e,!0):(this.log("Request ".concat(this.requestGUID," has tried to send() a string value after send()ing data type ").concat(_typeof(this.responseData),"."),e),!1):"object"==_typeof(e)?null===this.responseData?(this.responseData=JSON.stringify(e),!0):"string"==typeof this.responseData?(this.responseData+=this.responseData+JSON.stringify(e),!0):(this.log("Request ".concat(this.requestGUID," has tried to send() an object value to be auto stringified after send()ing data type ").concat(_typeof(this.responseData),"."),e),!1):void 0}}]),e}();t.exports=n},{}],35:[function(e,t,r){var n=e("./Orator-ServiceServer-Base.js"),i=e("./Orator-ServiceServer-IPC-SynthesizedResponse.js"),o=e("find-my-way"),a=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,i){var a;return _classCallCheck(this,r),(a=t.call(this,e,n,i)).router=o(a.options),a.ServiceServerType="IPC",a.URL="IPC",a.Port=0,a.preBehaviorFunctions=[],a.behaviorMap={},a.postBehaviorFunctions=[],a}return _createClass(r,[{key:"use",value:function(e){return this.addPreBehaviorFunction(e)}},{key:"addPreBehaviorFunction",value:function(e){return _get(_getPrototypeOf(r.prototype),"use",this).call(this,e)?(this.preBehaviorFunctions.push(e),!0):(this.log.error("IPC provider failed to map USE handler function!"),!1)}},{key:"executePreBehaviorFunctions",value:function(e,t,r){for(var n=this,i=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate"),o=function(){var r=n.preBehaviorFunctions[a];i.anticipate((function(n){return r(e,t,n)}))},a=0;a<this.preBehaviorFunctions.length;a++)o();i.wait((function(e){return e&&n.log.error("IPC Provider preBehaviorFunction ".concat(pFunctionIndex," failed with error: ").concat(e),e),r(e)}))}},{key:"addPostBehaviorFunction",value:function(e){return _get(_getPrototypeOf(r.prototype),"use",this).call(this,e)?(this.postBehaviorFunctions.push(e),!0):(this.log.error("IPC provider failed to map USE handler function!"),!1)}},{key:"executePostBehaviorFunctions",value:function(e,t,r){for(var n=this,i=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate"),o=function(){var r=n.postBehaviorFunctions[a];i.anticipate((function(n){return r(e,t,n)}))},a=0;a<this.postBehaviorFunctions.length;a++)o();i.wait((function(e){return e&&n.log.error("IPC Provider postBehaviorFunction ".concat(pFunctionIndex," failed with error: ").concat(e),e),r(e)}))}},{key:"addRouteProcessor",value:function(e,t,r){return this.router.on(e,t,this.buildFindMyWayHandler(r)),!0}},{key:"buildFindMyWayHandler",value:function(e){var t=this,r=e;return function(e,n,i){var o=t.fable.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate");o.anticipate((function(r){return t.executePreBehaviorFunctions(e,n,r)}));for(var a=function(){var t=r[s];o.anticipate((function(r){return t(e,n,r)}))},s=0;s<r.length;s++)a();return o.anticipate((function(r){return t.executePostBehaviorFunctions(e,n,r)})),new Promise((function(e,r){o.wait((function(n){return n?(t.log.error("IPC Provider behavior function ".concat(pFunctionIndex," failed with error: ").concat(n),n),r(n)):e()}))}))}}},{key:"bodyParser",value:function(){return function(e,t,r){return r()}}},{key:"doGet",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.addRouteProcessor("GET",e,Array.from(r))}},{key:"doPut",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.addRouteProcessor("PUT",e,Array.from(r))}},{key:"doPost",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.addRouteProcessor("POST",e,Array.from(r))}},{key:"doDel",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.addRouteProcessor("DELETE",e,Array.from(r))}},{key:"doPatch",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.addRouteProcessor("PATCH",e,Array.from(r))}},{key:"doOpts",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.addRouteProcessor("OPTIONS",e,Array.from(r))}},{key:"doHead",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.addRouteProcessor("HEAD",e,Array.from(r))}},{key:"invoke",value:function(e,t,r,n){var o=this,a="function"==typeof n?n:"function"==typeof r&&r;if(!a)throw new Error("IPC Provider invoke() called without a callback function.");var s={method:e,url:t,guid:this.fable.getUUID()},c=this.router.find(s.method,s.url),u=new i(c,this.log,s.guid);s.params=u.params,s.searchParams=u.searchParams,c.handler(s,u,r).then((function(e){return a(null,u.responseData,u,e)}),(function(e){return o.log.trace("IPC Response Received",{Error:e}),e&&o.log.error("IPC Request Error Request GUID [".concat(s.guid,"] handling route [").concat(t,"]: ").concat(e),{Error:e,Route:t,Data:r}),a(e,u.responseData,u)}))}}]),r}(n);t.exports=a},{"./Orator-ServiceServer-Base.js":33,"./Orator-ServiceServer-IPC-SynthesizedResponse.js":34,"find-my-way":13}],36:[function(e,t,r){
|
|
8
|
-
/**
|
|
9
|
-
* Orator Service Abstraction
|
|
10
|
-
*
|
|
11
|
-
* @license MIT
|
|
12
|
-
*
|
|
13
|
-
* @author Steven Velozo <steven@velozo.com>
|
|
14
|
-
* @module Orator Service
|
|
15
|
-
*/
|
|
16
|
-
var n=e("fable-serviceproviderbase"),i=e("./Orator-Default-ServiceServer.js"),o=e("./Orator-Default-Configuration.js"),a=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,i){var a;return _classCallCheck(this,r),(a=t.call(this,e,n,i)).serviceType="Orator",a.serviceServer=!1,a.serviceServerProvider=!1,"undefined"!=typeof pServiceProvider&&(a.serviceServerProvider=pServiceProvider),a.options.hasOwnProperty("ServicePort")||(a.fable.settings.hasOwnProperty("APIServerPort")?a.options.ServicePort=a.fable.settings.APIServerPort:a.options.ServicePort=o.ServicePort),a.options.hasOwnProperty("Product")||(a.options.Product=o.Product),a}return _createClass(r,[{key:"onBeforeInitialize",value:function(){this.fable.settings.LogNoisiness>3&&this.log.trace("Orator [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Product," onBeforeInitialize:"))}},{key:"onBeforeInitializeAsync",value:function(e){if(this.onBeforeInitialize(),this.serviceServer)this.log.warn("Orator attempting to initialize a service server after initialization has already completed.");else{if(!this.fable.OratorServiceServer){var t=void 0===this.options.ServiceServerOptions?{}:this.options.ServiceServerOptions;this.fable.serviceManager.servicesMap.hasOwnProperty("OratorServiceServer")||this.fable.serviceManager.addServiceType("OratorServiceServer",i),this.fable.serviceManager.instantiateServiceProvider("OratorServiceServer",t,"OratorServiceServer-AutoInit")}this.serviceServer=this.fable.OratorServiceServer,this.webServer=this.serviceServer}e()}},{key:"onInitialize",value:function(){this.fable.settings.LogNoisiness>3&&this.log.trace("Orator [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Product," onInitialize:"))}},{key:"onInitializeAsync",value:function(e){return this.onInitialize(),e()}},{key:"onAfterInitialize",value:function(){this.fable.settings.LogNoisiness>3&&this.log.trace("Orator [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Product," onAfterInitialize:"))}},{key:"onAfterInitializeAsync",value:function(e){return this.onAfterInitialize(),e()}},{key:"initialize",value:function(e){var t=this,r="function"==typeof e?e:function(){};if(this.initializeTimestamp)return this.log.warn("Orator [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Product," async initialize called but initialization is already completed. Aborting.")),r();var n=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate");this.fable.LogNoisiness>3&&this.log.trace("Orator [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Product," beginning initialization steps...")),n.anticipate(this.onBeforeInitializeAsync.bind(this)),n.anticipate(this.onInitializeAsync.bind(this)),n.anticipate(this.onAfterInitializeAsync.bind(this)),n.wait((function(e){return t.initializeTimestamp=t.fable.log.getTimeStamp(),t.fable.LogNoisiness>2&&t.log.trace("Orator [".concat(t.UUID,"]::[").concat(t.Hash,"] ").concat(t.options.Product," initialization steps complete.")),r(e)}))}},{key:"onBeforeStartService",value:function(e){return e()}},{key:"onStartService",value:function(e){var t=this;return this.onAfterInitialize(),this.serviceServer.listen(this.options.ServicePort,(function(r){return t.log.info("".concat(t.serviceServer.Name," listening at ").concat(t.serviceServer.URL," port ").concat(t.serviceServer.Port)),e(r)}))}},{key:"onAfterStartService",value:function(e){return e()}},{key:"startService",value:function(e){var t=this,r="function"==typeof e?e:function(){},n=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("Anticipate");this.fable.LogNoisiness>3&&this.log.trace("Orator [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Product," beginning startService steps...")),this.serviceServer||n.anticipate(this.initialize.bind(this)),n.anticipate(this.onBeforeStartService.bind(this)),n.anticipate(this.onStartService.bind(this)),n.anticipate(this.onAfterStartService.bind(this)),n.wait((function(e){return t.startServiceTimestamp=t.fable.log.getTimeStamp(),t.fable.LogNoisiness>2&&t.log.trace("Orator [".concat(t.UUID,"]::[").concat(t.Hash,"] ").concat(t.options.Product," startService steps complete.")),r(e)}))}},{key:"stopService",value:function(e){var t="function"==typeof e?e:function(){};if(!this.serviceServer){var r="Orator attempting to stop a service server but the service server has not been intialized yet.";return this.log.warn(r),t(r)}if(!this.serviceServer.Active){var n="Orator attempting to stop a service server but the service server is not actively running.";return this.log.warn(n),t(n)}return this.serviceServer.close(t)}},{key:"invoke",value:function(e,t,r,n){return this.serviceServer.invoke(e,t,r,n)}},{key:"startWebServer",value:function(e){return this.startService(e)}},{key:"stopWebServer",value:function(e){return this.stopService(e)}},{key:"getWebServer",value:function(){return this.serviceServer||this.initializeServiceServer(),this.serviceServer}}]),r}(n);t.exports=a,t.exports.ServiceServerBase=e("./Orator-ServiceServer-Base.js"),t.exports.ServiceServerIPC=e("./Orator-ServiceServer-IPC.js")},{"./Orator-Default-Configuration.js":31,"./Orator-Default-ServiceServer.js":32,"./Orator-ServiceServer-Base.js":33,"./Orator-ServiceServer-IPC.js":35,"fable-serviceproviderbase":6}]},{},[36])(36)}));
|
|
17
|
-
//# sourceMappingURL=orator.compatible.min.js.map
|