text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.feathers=t():e.feathers=t()}(this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){(function(r){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e}(t=e.exports=n(2)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&"%c"===e&&(i=++o)}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=o,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(o())}).call(this,n(3))},function(e,t){var n=1e3,r=6e4,o=36e5,i=24*o;function s(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}e.exports=function(e,t){t=t||{};var c,a=typeof e;if("string"===a&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*o;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===a&&!1===isNaN(e))return t.long?s(c=e,i,"day")||s(c,o,"hour")||s(c,r,"minute")||s(c,n,"second")||c+" ms":function(e){return e>=i?Math.round(e/i)+"d":e>=o?Math.round(e/o)+"h":e>=r?Math.round(e/r)+"m":e>=n?Math.round(e/n)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,n){function r(e){var n;function r(){if(r.enabled){var e=r,o=+new Date,i=o-(n||o);e.diff=i,e.prev=n,e.curr=o,n=o;for(var s=new Array(arguments.length),c=0;c<s.length;c++)s[c]=arguments[c];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var a=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;a++;var o=t.formatters[r];if("function"==typeof o){var i=s[a];n=o.call(e,i),s.splice(a,1),a--}return n}),t.formatArgs.call(e,s),(r.log||t.log||console.log.bind(console)).apply(e,s)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),r.destroy=o,"function"==typeof t.init&&t.init(r),t.instances.push(r),r}function o(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var n;t.save(e),t.names=[],t.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(n=0;n<t.instances.length;n++){var i=t.instances[n];i.enabled=t.enabled(i.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(1),t.instances=[],t.names=[],t.skips=[],t.formatters={}},function(e,t){var n,r,o=e.exports={};function i(){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===i||!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:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var a,u=[],l=!1,f=-1;function h(){l&&a&&(l=!1,a.length?u=a.concat(u):f=-1,u.length&&d())}function d(){if(!l){var e=c(h);l=!0;for(var t=u.length;t;){for(a=u,u=[];++f<t;)a&&a[f].run();f=-1,t=u.length}a=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new p(e,t)),1!==u.length||l||c(d)},p.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=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,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}},function(e,t,n){"use strict";var r="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},o=n(0)("@feathersjs/errors");function i(e,t,n,s,c){var a=void 0,u=void 0,l=void 0;(e=e||"Error")instanceof Error?(u=e.message||"Error",e.errors&&(a=e.errors)):"object"===(void 0===e?"undefined":r(e))?(u=e.message||"Error",c=e):u=e,c&&((l=JSON.parse(JSON.stringify(c))).errors?(a=l.errors,delete l.errors):c.errors&&(a=JSON.parse(JSON.stringify(c.errors)))),this.type="FeathersError",this.name=t,this.message=u,this.code=n,this.className=s,this.data=l,this.errors=a||{},o(this.name+"("+this.code+"): "+this.message),o(this.errors),Error.captureStackTrace?Error.captureStackTrace(this,i):this.stack=(new Error).stack}function s(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e}function c(e,t){i.call(this,e,"BadRequest",400,"bad-request",t)}function a(e,t){i.call(this,e,"NotAuthenticated",401,"not-authenticated",t)}function u(e,t){i.call(this,e,"PaymentError",402,"payment-error",t)}function l(e,t){i.call(this,e,"Forbidden",403,"forbidden",t)}function f(e,t){i.call(this,e,"NotFound",404,"not-found",t)}function h(e,t){i.call(this,e,"MethodNotAllowed",405,"method-not-allowed",t)}function d(e,t){i.call(this,e,"NotAcceptable",406,"not-acceptable",t)}function p(e,t){i.call(this,e,"Timeout",408,"timeout",t)}function m(e,t){i.call(this,e,"Conflict",409,"conflict",t)}function C(e,t){i.call(this,e,"LengthRequired",411,"length-required",t)}function y(e,t){i.call(this,e,"Unprocessable",422,"unprocessable",t)}function v(e,t){i.call(this,e,"TooManyRequests",429,"too-many-requests",t)}function g(e,t){i.call(this,e,"GeneralError",500,"general-error",t)}function F(e,t){i.call(this,e,"NotImplemented",501,"not-implemented",t)}function b(e,t){i.call(this,e,"BadGateway",502,"bad-gateway",t)}function w(e,t){i.call(this,e,"Unavailable",503,"unavailable",t)}s(i,Error),Object.defineProperty(i.prototype,"toJSON",{value:function(){return{name:this.name,message:this.message,code:this.code,className:this.className,data:this.data,errors:this.errors}}}),s(c,i),s(a,i),s(u,i),s(l,i),s(f,i),s(h,i),s(d,i),s(p,i),s(m,i),s(C,i),s(y,i),s(v,i),s(g,i),s(F,i),s(b,i),s(w,i);var E={FeathersError:i,BadRequest:c,NotAuthenticated:a,PaymentError:u,Forbidden:l,NotFound:f,MethodNotAllowed:h,NotAcceptable:d,Timeout:p,Conflict:m,LengthRequired:C,Unprocessable:y,TooManyRequests:v,GeneralError:g,NotImplemented:F,BadGateway:b,Unavailable:w,400:c,401:a,402:u,403:l,404:f,405:h,406:d,408:p,409:m,411:C,422:y,429:v,500:g,501:F,502:b,503:w};e.exports=Object.assign({convert:function(e){if(!e)return e;var t=E[e.name],n=t?new t(e.message,e.data):new Error(e.message||e);return"object"===(void 0===e?"undefined":r(e))&&Object.assign(n,e),n}},E)},function(e,t,n){"use strict";var r=n(4),o=r.convert,i=r.Timeout,s=n(0)("@feathersjs/transport-commons/client"),c=["addListener","emit","listenerCount","listeners","on","once","prependListener","prependOnceListener","removeAllListeners","removeListener"],a=["eventNames","getMaxListeners","setMaxListeners"],u=function(e){a.forEach(function(t){e[t]=function(){var e;if("function"!=typeof this.connection[t])throw new Error("Can not call '"+t+"' on the client service connection");return(e=this.connection)[t].apply(e,arguments)}}),c.forEach(function(t){e[t]=function(e){var n;if("function"!=typeof this.connection[t])throw new Error("Can not call '"+t+"' on the client service connection");var r=this.path+" "+e;s("Calling emitter method "+t+" with namespaced event '"+r+"'");for(var o=arguments.length,i=Array(o>1?o-1:0),c=1;c<o;c++)i[c-1]=arguments[c];var a=(n=this.connection)[t].apply(n,[r].concat(i));return a===this.connection?this:a}})};e.exports=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events=t.events,this.path=t.name,this.connection=t.connection,this.method=t.method,this.timeout=t.timeout||5e3,u(this)}return e.prototype.send=function(e){for(var t=this,n=arguments.length,r=Array(n>1?n-1:0),c=1;c<n;c++)r[c-1]=arguments[c];return new Promise(function(n,c){var a,u=setTimeout(function(){return c(new i("Timeout of "+t.timeout+"ms exceeded calling "+e+" on "+t.path,{timeout:t.timeout,method:e,path:t.path}))},t.timeout);r.unshift(e,t.path),r.push(function(e,t){return e=o(e),clearTimeout(u),e?c(e):n(t)}),s("Sending socket."+t.method,r),(a=t.connection)[t.method].apply(a,r)})},e.prototype.find=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.send("find",e.query||{})},e.prototype.get=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.send("get",e,t.query||{})},e.prototype.create=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.send("create",e,t.query||{})},e.prototype.update=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.send("update",e,t,n.query||{})},e.prototype.patch=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.send("patch",e,t,n.query||{})},e.prototype.remove=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.send("remove",e,t.query||{})},e.prototype.off=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o;return"function"==typeof this.connection.off?(o=this.connection).off.apply(o,[this.path+" "+e].concat(n)):0===n.length?this.removeAllListeners(e):this.removeListener.apply(this,[e].concat(n))},e}()},function(e,t,n){"use strict";e.exports=n(5)},function(e,t,n){"use strict";var r=n(6);function o(e,t){if(!e)throw new Error("Primus connection needs to be provided");var n=function(n){return new r(Object.assign({},t,{name:n,connection:e,method:"send"}))},o=function(){if("function"==typeof this.defaultService)throw new Error("Only one default client provider can be configured");this.primus=e,this.defaultService=n};return o.Service=r,o.service=n,o}e.exports=o,e.exports.default=o},function(e,t,n){"use strict";e.exports=n(7)}])});