traverson
Version:
Hypermedia API/HATEOAS client for Node.js and the browser
1 lines • 104 kB
JavaScript
!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).traverson=t()}(function(){var define,module,exports;return function n(o,i,s){function a(e,t){if(!i[e]){if(!o[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(u)return u(e,!0);throw(t=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",t}r=i[e]={exports:{}},o[e][0].call(r.exports,function(t){return a(o[e][1][t]||t)},r,r.exports,n,o,i,s)}return i[e].exports}for(var u="function"==typeof require&&require,t=0;t<s.length;t++)a(s[t]);return a}({1:[function(t,e,r){"use strict";var n=!1;function o(t){this.id=t=null==t?"":t}function i(t){return new o(t)}o.prototype.enable=function(){this.enabled=!0},o.prototype.debug=function(t){n&&console.log(this.id+"/debug: "+t)},o.prototype.info=function(t){n&&console.log(this.id+"/info: "+t)},o.prototype.warn=function(t){n&&console.log(this.id+"/warn: "+t)},o.prototype.error=function(t){n&&console.log(this.id+"/error: "+t)},i.enable=function(){n=!0},e.exports=i},{}],2:[function(t,e,r){"use strict";e.exports={isArray:function(t){return null!=t&&"[object Array]"===Object.prototype.toString.call(t)}}},{}],3:[function(t,e,r){"use strict";var n=t("superagent");function o(){}function i(t,e){var r=t,n=e=e||{},n=(null!=(n=n.qs)&&(r=r.query(n)),t),r=e,r=(null!=(r=r.headers)&&(n=n.set(r)),t),n=e;return null!=(n=n.auth)&&(r=r.auth(n.user||n.username,n.pass||n.password)),n=t,null!=(r=e)&&null!=(r=r.body)&&(n=n.send(r)),r=t,null!=(n=e)&&null!=(n=n.form)&&(r=(r=r.set("content-type","application/x-www-form-urlencoded")).send(n)),n=t,null!=(r=e)&&!0===r.withCredentials&&n.withCredentials(),t}function s(t){return t.body=t.text,t.statusCode=t.status,t}function a(r){return function(t,e){if(t){if(!e)return r(t);r(null,s(e))}else r(null,s(e))}}o.prototype.get=function(t,e,r){return i(n.get(t),e).end(a(r))},o.prototype.post=function(t,e,r){return i(n.post(t),e).end(a(r))},o.prototype.put=function(t,e,r){return i(n.put(t),e).end(a(r))},o.prototype.patch=function(t,e,r){return i(n.patch(t),e).end(a(r))},o.prototype.del=function(t,e,r){return i(n.del(t),e).end(a(r))},e.exports=new o},{superagent:57}],4:[function(t,e,r){"use strict";var o={startsWith:function(t,e){return""===e||null!=t&&null!=e&&(t=String(t),e=String(e),t.length>=e.length&&t.slice(0,e.length)===e)},endsWith:function(t,e){return""===e||null!=t&&null!=e&&(t=String(t),e=String(e),t.length>=e.length&&t.slice(t.length-e.length)===e)},splice:function(t,e,r,n){t=o.chars(t);return t.splice(~~e,~~r,n),t.join("")},contains:function(t,e){return""===e||null!=t&&-1!==String(t).indexOf(e)},chars:function(t){return null==t?[]:String(t).split("")}};e.exports=o},{}],5:[function(t,e,r){"use strict";var n=t("resolve-url");r.resolve=function(t,e){return n(t,e)}},{"resolve-url":54}],6:[function(t,e,r){"use strict";var n=t("minilog"),t=t("./errors"),o=t.errors,i=t.createError,s=n("traverson");r.abortTraversal=function(){s.debug("aborting link traversal"),this.aborted=!0,this.currentRequest&&(s.debug("request in progress. trying to abort it, too."),this.currentRequest.abort())},r.registerAbortListener=function(t,e){t.currentRequest&&t.currentRequest.on("abort",function(){r.callCallbackOnAbort(t)})},r.callCallbackOnAbort=function(t){s.debug("link traversal aborted"),t.callbackHasBeenCalledAfterAbort||(t.callbackHasBeenCalledAfterAbort=!0,t.callback(r.abortError(),t))},r.abortError=function(){var t=i("Link traversal process has been aborted.",o.TraversalAbortedError);return t.aborted=!0,t}},{"./errors":9,minilog:1}],7:[function(t,e,r){"use strict";t("minilog")("traverson"),t("./abort_traversal"),t("./transforms/apply_transforms"),t("./http_requests"),t("./is_continuation");var i=t("./walker"),s=t("./transforms/check_http_status"),n=t("./transforms/continuation_to_doc"),o=t("./transforms/continuation_to_response"),a=t("./transforms/convert_embedded_doc_to_response"),u=t("./transforms/extract_doc"),c=t("./transforms/extract_response"),l=t("./transforms/extract_url"),p=t("./transforms/fetch_last_resource"),f=t("./transforms/execute_last_http_request"),h=t("./transforms/execute_last_http_request_for_convert_response"),d=t("./transforms/parse"),y=t("./transforms/parse_link_header");function g(t,e,r,n){var o=t.convertResponseToObject?[h,s,d,y,u]:[f];t.lastMethod=r,i.walk(t,o,n)}function m(t){return{abort:t.abortTraversal}}r.get=function(t,e){var r;return t.lastMethodName="GET",r=t.convertResponseToObject?[n,p,s,d,y,u]:[o,p,a,c],i.walk(t,r,e),m(t)},r.getUrl=function(t,e){return i.walk(t,[l],e),m(t)},r.post=function(t,e){return t.lastMethodName="POST",g(t,t.requestModuleInstance,t.requestModuleInstance.post,e),m(t)},r.put=function(t,e){return t.lastMethodName="PUT",g(t,t.requestModuleInstance,t.requestModuleInstance.put,e),m(t)},r.patch=function(t,e){return t.lastMethodName="PATCH",g(t,t.requestModuleInstance,t.requestModuleInstance.patch,e),m(t)},r.delete=function(t,e){return t.lastMethodName="DELETE",g(t,t.requestModuleInstance,t.requestModuleInstance.del,e),m(t)}},{"./abort_traversal":6,"./http_requests":10,"./is_continuation":11,"./transforms/apply_transforms":18,"./transforms/check_http_status":19,"./transforms/continuation_to_doc":20,"./transforms/continuation_to_response":21,"./transforms/convert_embedded_doc_to_response":22,"./transforms/execute_last_http_request":24,"./transforms/execute_last_http_request_for_convert_response":25,"./transforms/extract_doc":26,"./transforms/extract_response":27,"./transforms/extract_url":28,"./transforms/fetch_last_resource":29,"./transforms/parse":32,"./transforms/parse_link_header":33,"./walker":39,minilog:1}],8:[function(t,e,r){"use strict";var n=t("minilog"),o=t("request"),a=t("util"),i=t("./actions"),s=t("./abort_traversal").abortTraversal,u=t("./errors"),c=u.errors,l=u.createError,p=t("./media_type_registry"),f=t("./media_types"),h=t("./merge_recursive"),d=n("traverson");function y(t,e){this.mediaType=t||f.CONTENT_NEGOTIATION,this.linkType=e||"link-rel",this.adapter=this._createAdapter(this.mediaType),this.autoHeaders=!0,this.contentNegotiation=!0,this.rawPayloadFlag=!1,this.convertResponseToObjectFlag=!1,this.links=[],this.jsonParser=JSON.parse,this.requestModuleInstance=o,this.requestOptions={},this.resolveRelativeFlag=!1,this.preferEmbedded=!1,this.lastTraversalState=null,this.continuation=null}function g(t,e){e={aborted:!1,adapter:t.adapter||null,body:null!==e?e:null,callbackHasBeenCalledAfterAbort:!1,autoHeaders:t.setsAutoHeaders(),contentNegotiation:t.doesContentNegotiation(),continuation:null,rawPayload:t.sendsRawPayload(),convertResponseToObject:t.convertsResponseToObject(),links:t.links,jsonParser:t.getJsonParser(),requestModuleInstance:t.getRequestLibrary(),requestOptions:t.getRequestOptions(),resolveRelative:t.doesResolveRelative(),preferEmbedded:t.doesPreferEmbeddedResources(),startUrl:t.startUrl,step:{url:t.startUrl,index:0},templateParameters:t.getTemplateParameters()};return e.abortTraversal=s.bind(e),t.continuation&&(e.continuation=t.continuation,e.step=t.continuation.step,t.continuation=null),e}function m(r,n,o,i){return function(t,e){return t?o(t):o(null,e,{continue:function(){if(n)return d.debug("> continuing finished traversal process"),r.continuation={step:n.step,action:i},r.continuation.step.index=0,e=n,(t=r).aborted=!1,t.adapter=e.adapter,t.body=e.body,t.callbackHasBeenCalledAfterAbort=!1,t.autoHeaders=e.autoHeaders,t.contentNegotiation=e.contentNegotiation,t.rawPayload=e.rawPayload,t.convertResponseToObjectFlag=e.convertResponseToObject,t.links=[],t.jsonParser=e.jsonParser,t.requestModuleInstance=e.requestModuleInstance,t.requestOptions=e.requestOptions,t.resolveRelativeFlag=e.resolveRelative,t.preferEmbedded=e.preferEmbedded,t.startUrl=e.startUrl,t.templateParameters=e.templateParameters,r;var t,e;throw l("No traversal state to continue from.",c.InvalidStateError)}})}}function b(t){return a.isArray(t)?v(t):"object"==typeof t?h(null,t):t}function v(t){return t&&t.slice(0)}y.prototype._createAdapter=function(t){var e=p.get(t);if(e)return d.debug("creating new "+e.name),new e(d);throw l("Unknown or unsupported media type: "+t,c.UnsupportedMediaType)},y.prototype.newRequest=function(){var t=new y(this.getMediaType(),this.getLinkType());return t.useAutoHeaders(this.setsAutoHeaders()),t.contentNegotiation=this.doesContentNegotiation(),t.convertResponseToObject(this.convertsResponseToObject()),t.from(v(this.getFrom())),t.withTemplateParameters(b(this.getTemplateParameters())),t.withRequestOptions(b(this.getRequestOptions())),t.withRequestLibrary(this.getRequestLibrary()),t.parseResponseBodiesWith(this.getJsonParser()),t.resolveRelative(this.doesResolveRelative()),t.preferEmbeddedResources(this.doesPreferEmbeddedResources()),t.continuation=this.continuation,t},y.prototype.setMediaType=function(t){return this.mediaType=t||f.CONTENT_NEGOTIATION,this.adapter=this._createAdapter(t),this.contentNegotiation=t===f.CONTENT_NEGOTIATION,this},y.prototype.getLinkType=function(){return this.linkType},y.prototype.json=function(){return this.setMediaType(f.JSON),this},y.prototype.jsonHal=function(){return this.setMediaType(f.JSON_HAL),this},y.prototype.useContentNegotiation=function(){return this.setMediaType(f.CONTENT_NEGOTIATION),this.contentNegotiation=!0,this},y.prototype.from=function(t){return this.startUrl=t,this},y.prototype.follow=function(){for(var t=Array.prototype.slice.apply(1===arguments.length&&a.isArray(arguments[0])?arguments[0]:arguments),e=0;e<t.length;e++)"string"==typeof t[e]&&(t[e]={type:this.linkType,value:t[e]});return this.links=this.links.concat(t),this},y.prototype.followLocationHeader=function(){return this.links.push({type:"header",value:"location"}),this},y.prototype.walk=y.prototype.follow,y.prototype.withTemplateParameters=function(t){return this.templateParameters=t,this},y.prototype.withRequestOptions=function(t){return this.requestOptions=t,this},y.prototype.addRequestOptions=function(t){if(a.isArray(this.requestOptions)&&a.isArray(t))for(var e=this.requestOptions,r=t,n=0;n<Math.max(e.length,r.length);n++)e[n]=h(e[n],r[n]);else if("object"==typeof this.requestOptions&&a.isArray(t))this.requestOptions=function(t,e){for(var r=[],n=0;n<e.length;n++)r[n]=h(e[n],t);return r}(this.requestOptions,t);else if(a.isArray(this.requestOptions)&&"object"==typeof t)for(var o=this.requestOptions,i=t,s=0;s<o.length;s++)h(o[s],i);else h(this.requestOptions,t);return this},y.prototype.withRequestLibrary=function(t){return this.requestModuleInstance=t,this},y.prototype.parseResponseBodiesWith=function(t){return this.jsonParser=t,this},y.prototype.disableAutoHeaders=function(){return this.useAutoHeaders(!1)},y.prototype.enableAutoHeaders=function(){return this.useAutoHeaders(!0)},y.prototype.useAutoHeaders=function(t){return this.autoHeaders=!!(t=null==t?!0:t),this},y.prototype.sendRawPayload=function(t){return this.rawPayloadFlag=!!(t=null==t?!0:t),this},y.prototype.convertResponseToObject=function(t){return this.convertResponseToObjectFlag=!!(t=null==t?!0:t),this},y.prototype.resolveRelative=function(t){return this.resolveRelativeFlag=!!(t=null==t?!0:t),this},y.prototype.preferEmbeddedResources=function(t){return this.preferEmbedded=!!(t=null==t?!0:t),this},y.prototype.getMediaType=function(){return this.mediaType},y.prototype.getFrom=function(){return this.startUrl},y.prototype.getTemplateParameters=function(){return this.templateParameters},y.prototype.getRequestOptions=function(){return this.requestOptions},y.prototype.getRequestLibrary=function(){return this.requestModuleInstance},y.prototype.getJsonParser=function(){return this.jsonParser},y.prototype.setsAutoHeaders=function(){return this.autoHeaders},y.prototype.sendsRawPayload=function(){return this.rawPayloadFlag},y.prototype.convertsResponseToObject=function(){return this.convertResponseToObjectFlag},y.prototype.doesResolveRelative=function(){return this.resolveRelativeFlag},y.prototype.doesPreferEmbeddedResources=function(){return this.preferEmbedded},y.prototype.doesContentNegotiation=function(){return this.contentNegotiation},y.prototype.get=function(t){d.debug("initiating traversal (get)");var e=g(this);return i.get(e,m(this,e,t,"get"))},y.prototype.getResource=function(t){d.debug("initiating traversal (getResource)"),this.convertResponseToObjectFlag=!0;var e=g(this);return i.get(e,m(this,e,t,"getResource"))},y.prototype.getUri=y.prototype.getUrl=function(t){d.debug("initiating traversal (getUrl)");var e=g(this);return i.getUrl(e,m(this,e,t,"getUrl"))},y.prototype.post=function(t,e){d.debug("initiating traversal (post)");t=g(this,t);return i.post(t,m(this,t,e,"post"))},y.prototype.put=function(t,e){d.debug("initiating traversal (put)");t=g(this,t);return i.put(t,m(this,t,e,"put"))},y.prototype.patch=function(t,e){d.debug("initiating traversal (patch)");t=g(this,t);return i.patch(t,m(this,t,e,"patch"))},y.prototype.del=y.prototype.delete=function(t){d.debug("initiating traversal (delete)");var e=g(this);return i.delete(e,m(this,e,t,"delete"))},y.prototype.linkHeader=function(){return this.linkType="link-header",this},e.exports=y},{"./abort_traversal":6,"./actions":7,"./errors":9,"./media_type_registry":13,"./media_types":14,"./merge_recursive":15,minilog:1,request:3,util:2}],9:[function(t,e,r){"use strict";e.exports={errors:{HTTPError:"HTTPError",InvalidArgumentError:"InvalidArgumentError",InvalidStateError:"InvalidStateError",JSONError:"JSONError",JSONPathError:"JSONPathError",LinkError:"LinkError",TraversalAbortedError:"TraversalAbortedError",UnsupportedMediaType:"UnsupportedMediaTypeError"},createError:function(t,e,r){t=new Error(t);return t.name=e,r&&(t.data=r),t}}},{}],10:[function(e,t,r){!function(h){!function(){"use strict";var s=e("minilog")("traverson"),a=e("./abort_traversal"),u=e("./transforms/detect_content_type"),t=e("./errors"),c=t.errors,l=t.createError,p=e("./transforms/get_options_for_step"),f=h&&Object.hasOwnProperty.call(h,"nextTick");r.fetchResource=function(t,e){var r,n,o,i;if(s.debug("fetching resource for next step"),!t.step.url)return t.step.doc?(s.debug("resource for next step has already been fetched, using embedded"),f?h.nextTick(function(){e(null,t)}):e(null,t)):((r=l("Can not process step.",c.InvalidStateError)).step=t.step,f?h.nextTick(function(){e(r,t)}):e(r,t));s.debug("fetching resource from",t.step.url),o=e,i=p(n=t),s.debug("HTTP GET request to",n.step.url),s.debug("options",i),n.mostRecentHttpMethodName="GET",n.currentRequest=n.requestModuleInstance.get(n.step.url,i,function(t,e,r){return s.debug("HTTP GET request to",n.step.url,"returned"),n.currentRequest=null,r&&!e.body&&(e.body=r),n.step.response=e,t?o(t,n):(s.debug("request to",n.step.url,"finished without error (",e.statusCode,")"),u(n,o)?o(null,n):void 0)}),a.registerAbortListener(n,o)},r.executeHttpRequest=function(n,t,e,o,i){var r=p(n);null!==n.body&&void 0!==n.body&&(r.body=n.rawPayload||r.jsonReplacer?n.body:JSON.stringify(n.body)),s.debug("HTTP",o,"request to",n.step.url),s.debug("options",r),n.mostRecentHttpMethodName=o,n.currentRequest=e.call(t,n.step.url,r,function(t,e,r){return s.debug("HTTP",o,"request to",n.step.url,"returned"),n.currentRequest=null,r&&!e.body&&(e.body=r),n.step.response=e,t?i(t):i(null,e)}),a.registerAbortListener(n,i)}}.call(this)}.call(this,e("_process"))},{"./abort_traversal":6,"./errors":9,"./transforms/detect_content_type":23,"./transforms/get_options_for_step":31,_process:53,minilog:1}],11:[function(t,e,r){"use strict";e.exports=function(t){return t.continuation&&t.step&&t.step.response}},{}],12:[function(t,e,r){"use strict";t("minilog");var n,o=t("underscore.string");try{n=t("jsonpath-plus")}catch(t){n=!1,console.warn("Could not require jsonpath-plus, JSONPath support is not available.")}var i=t("./errors"),s=i.errors,a=i.createError,u=t("./parse_link_header_value");function c(t){this.log=t}c.mediaType="application/json",c.prototype.findNextStep=function(t,e){var r=e;if(null==r)throw a("Link object is null or undefined.",s.InvalidArgumentError);if("object"!=typeof r)throw a("Links must be objects, not "+typeof r+".",s.InvalidArgumentError,r);if(!r.type)throw a("Link objects has no type attribute.",s.InvalidArgumentError,r);var n=t.lastStep.doc;switch(this.log.debug("resolving link",e),e.type){case"link-rel":return this._handleLinkRel(n,e);case"header":return this._handleHeader(t.lastStep.response,e);case"link-header":return this._handleLinkHeader(t.lastStep.response,e);default:throw a("Link objects with type "+e.type+" are not supported by this adapter.",s.InvalidArgumentError,e)}},c.prototype._handleLinkRel=function(t,e){e=e.value;if(this.log.debug("looking for link-rel",e,"in doc",t),this._testJSONPath(e))return{url:this._resolveJSONPath(t,e)};if(t[e])return{url:t[e]};throw a("Could not find property "+e+" in document.",s.LinkError,t)},c.prototype._testJSONPath=function(t){return o.startsWith(t,"$.")||o.startsWith(t,"$[")},c.prototype._resolveJSONPath=function(t,e){if(!n)throw a("JSONPath support is not available.");var r=n({json:t,path:e});if(1!==r.length)throw 1<r.length?a("JSONPath expression "+e+" returned more than one match in document:\n"+JSON.stringify(t),s.JSONPathError,t):a("JSONPath expression "+e+" returned no match in document:\n"+JSON.stringify(t),s.JSONPathError,t);r=r[0];if(!r)throw a("JSONPath expression "+e+" was resolved but the result was null, undefined or an empty string in document:\n"+JSON.stringify(t),s.JSONPathError,t);if("string"!=typeof r)throw a("JSONPath expression "+e+' was resolved but the result is not a property of type string. Instead it has type "'+typeof r+'" in document:\n'+JSON.stringify(t),s.JSONPathError,t);return r},c.prototype._handleHeader=function(t,e){if("location"!==e.value)throw a("Link objects with type header and value "+e.value+" are not supported by this adapter.",s.InvalidArgumentError,e);e=t.headers.location;if(e)return{url:e};throw a("Following the location header but there was no location header in the last response.",s.LinkError,t.headers)},c.prototype._handleLinkHeader=function(t,e){if(!t.headers.link)throw a("There was no link header in the last response.",s.InvalidArgumentError,e);t=u(t.headers.link);if(t[e.value])return{url:t[e.value].url};throw a("Link with relation "+e.value+" not found in link header.",s.InvalidArgumentError,e)},e.exports=c},{"./errors":9,"./parse_link_header_value":17,"jsonpath-plus":51,minilog:1,"underscore.string":4}],13:[function(t,e,r){"use strict";var n=t("./media_types"),o={};r.register=function(t,e){o[t]=e},r.get=function(t){return o[t]},r.register(n.CONTENT_NEGOTIATION,t("./negotiation_adapter")),r.register(n.JSON,t("./json_adapter"))},{"./json_adapter":12,"./media_types":14,"./negotiation_adapter":16}],14:[function(t,e,r){"use strict";t=t("./json_adapter");e.exports={CONTENT_NEGOTIATION:"content-negotiation",JSON:t.mediaType,JSON_HAL:"application/hal+json"}},{"./json_adapter":12}],15:[function(t,e,r){"use strict";function i(t,e){for(var r in!t&&e&&(t={}),e)e.hasOwnProperty(r)&&(n=t,"object"==typeof(o=e)[r=r]?(n[r]&&"object"==typeof n[r]||(n[r]={}),i(n[r],o[r])):n[r]=o[r]);var n,o;return t}e.exports=i},{}],16:[function(t,e,r){"use strict";var t=t("./errors"),n=t.errors,o=t.createError;function i(t){}i.prototype.findNextStep=function(t,e){throw o("Content negotiation did not happen",n.InvalidStateError)},e.exports=i},{"./errors":9}],17:[function(t,e,r){var n=t("./merge_recursive");function o(t){try{var e=t.split(";"),r=e.shift().replace(/[<>]/g,""),n=e.reduce(i,{});return n.url=r,n}catch(t){return null}}function i(t,e){e=e.match(/\s*(.+)\s*=\s*"?([^"]+)"?/);return e&&(t[e[1]]=e[2]),t}function s(t){return t&&t.rel}function a(e,r){return r.rel.split(/\s+/).forEach(function(t){e[t]=n({rel:t},r)}),e}e.exports=function(t){return t?t.split(/,\s*</).map(o).filter(s).reduce(a,{}):null}},{"./merge_recursive":15}],18:[function(t,e,r){!function(u){!function(){"use strict";var s=t("minilog")("traverson"),a=u&&Object.hasOwnProperty.call(u,"nextTick");e.exports=function e(r,t,n){s.debug("applying",r.length,"transforms");for(var o=0;o<r.length;o++){var i=r[o];if(s.debug("next transform",i),i.isAsync)return i(t,function(t){e(r.slice(o+1),t,n)});if(!i(t))return void s.debug("transform has failed or was a final transform")}return s.debug("all transformations done, starting next step"),a?u.nextTick(function(){n(t)}):n(t)}}.call(this)}.call(this,t("_process"))},{_process:53,minilog:1}],19:[function(t,e,r){"use strict";var n=t("minilog")("traverson"),o=t("../errors"),i=o.errors,s=o.createError,a=t("../is_continuation");e.exports=function(t){if(a(t))return!0;if(n.debug("checking http status"),!t.step.response&&t.step.doc)return n.debug("found embedded document, assuming no HTTP request has been made"),!0;var e,r=t.step.response.statusCode;return r&&(r<200||300<=r)?(e=function(t,e){var r=s("HTTP "+t.mostRecentHttpMethodName+" request to "+t.step.url+" resulted in HTTP status code "+e+".",i.HTTPError),e=(r.url=t.step.url,r.httpStatus=e,t.step.response.body);r.body=e;try{r.doc=JSON.parse(e)}catch(t){}return r}(t,r),n.error("unexpected http status code"),n.error(e),t.callback(e),!1):(n.debug("http status code ok ("+r+")"),!0)}},{"../errors":9,"../is_continuation":11,minilog:1}],20:[function(t,e,r){"use strict";var n=t("minilog")("traverson"),o=t("../is_continuation");e.exports=function(t){return!o(t)||(n.debug("continuing from last traversal process (actions)"),t.continuation=null,t.callback(null,t.step.doc),!1)}},{"../is_continuation":11,minilog:1}],21:[function(t,e,r){"use strict";var n=t("minilog")("traverson"),o=t("./convert_embedded_doc_to_response"),i=t("../is_continuation");e.exports=function(t){return!i(t)||(n.debug("continuing from last traversal process (actions)"),t.continuation=null,o(t),t.callback(null,t.step.response),!1)}},{"../is_continuation":11,"./convert_embedded_doc_to_response":22,minilog:1}],22:[function(t,e,r){"use strict";var n=t("minilog")("traverson");e.exports=function(t){return!t.step.response&&t.step.doc&&(n.debug("faking HTTP response for embedded resource"),t.step.response={statusCode:200,body:JSON.stringify(t.step.doc),remark:"This is not an actual HTTP response. The resource you requested was an embedded resource, so no HTTP request was made to acquire it."}),!0}},{minilog:1}],23:[function(t,e,r){"use strict";var o=t("minilog")("traverson"),i=t("../media_type_registry"),t=t("../errors"),s=t.errors,a=t.createError;e.exports=function(t,e){if(t.contentNegotiation&&t.step.response&&t.step.response.headers&&t.step.response.headers["content-type"]){var r=t.step.response.headers["content-type"].split(/[; ]/)[0],n=(o.debug("found content type string",r),i.get(r));if(!n)return o.error("no adapter for content type",r),e(a("Unknown content type for content type detection: "+r,s.UnsupportedMediaType),t),!1;t.adapter=new n(o),o.debug("switched to media type adapter",t.adapter.name||t.adapter.constructor.name)}return!0}},{"../errors":9,"../media_type_registry":13,minilog:1}],24:[function(t,e,r){"use strict";t("minilog")("traverson");var n=t("../abort_traversal"),o=t("../http_requests");function i(t,e){if(t.aborted)return n.callCallbackOnAbort(t);o.executeHttpRequest(t,t.requestModuleInstance,t.lastMethod,t.lastMethodName,t.callback)}i.isAsync=!0,e.exports=i},{"../abort_traversal":6,"../http_requests":10,minilog:1}],25:[function(t,e,r){"use strict";var o=t("minilog")("traverson"),i=t("../abort_traversal"),s=t("../http_requests");function n(r,n){if(r.aborted)return i.callCallbackOnAbort(r);s.executeHttpRequest(r,r.requestModuleInstance,r.lastMethod,r.lastMethodName,function(t,e){if(t)return t.aborted||(o.debug("error while executing http request, processing step",r.step),o.error(t)),r.callback(t);n(r)})}n.isAsync=!0,e.exports=n},{"../abort_traversal":6,"../http_requests":10,minilog:1}],26:[function(t,e,r){"use strict";var n=t("minilog")("traverson");e.exports=function(t){return n.debug("walker.walk has finished"),t.callback(null,t.step.doc),!1}},{minilog:1}],27:[function(t,e,r){"use strict";var n=t("minilog")("traverson");e.exports=function(t){return n.debug("walker.walk has finished"),t.callback(null,t.step.response),!1}},{minilog:1}],28:[function(t,e,r){"use strict";var n=t("minilog")("traverson"),o=t("url"),t=t("../errors"),i=t.errors,s=t.createError;e.exports=function(t){return n.debug("walker.walk has finished"),t.step.url?t.callback(null,t.step.url):t.step.doc&&t.step.doc._links&&t.step.doc._links.self&&t.step.doc._links.self.href?t.callback(null,o.resolve(t.startUrl,t.step.doc._links.self.href)):t.callback(s('You requested an URL but the last resource is an embedded resource and has no URL of its own (that is, it has no link with rel="self"',i.LinkError))}},{"../errors":9,minilog:1,url:5}],29:[function(t,e,r){"use strict";var n=t("minilog")("traverson"),o=t("../abort_traversal"),i=t("../http_requests");function s(t,r){if(t.aborted)return o.callCallbackOnAbort(t);i.fetchResource(t,function(t,e){if(n.debug("fetchResource returned (fetchLastResource)."),t)return t.aborted||(n.debug("error while executing http request"),n.error(t)),e.callback(t);r(e)})}s.isAsync=!0,e.exports=s},{"../abort_traversal":6,"../http_requests":10,minilog:1}],30:[function(e,r,t){!function(l){!function(){"use strict";var i=e("minilog")("traverson"),s=e("../abort_traversal"),a=e("../is_continuation"),u=e("../http_requests"),c=l&&Object.hasOwnProperty.call(l,"nextTick");function t(t,e){var r,n,o;a(t)?(r=t,n=e,i.debug("continuing from last traversal process (walker)"),c?l.nextTick(function(){n(r)}):n(r)):(o=e,(e=t).aborted?s.callCallbackOnAbort(e):u.fetchResource(e,function(t,e){if(i.debug("fetchResource returned"),t)return t.aborted||(i.debug("error while executing http request"),i.error(t)),e.callback(t);o(e)}))}t.isAsync=!0,r.exports=t}.call(this)}.call(this,e("_process"))},{"../abort_traversal":6,"../http_requests":10,"../is_continuation":11,_process:53,minilog:1}],31:[function(t,e,r){"use strict";var n=t("minilog")("traverson"),o=t("util"),i=t("../merge_recursive");function s(t,e){return t.form?{Accept:e}:{Accept:e,"Content-Type":e}}e.exports=function(t){var e,r=t.requestOptions;return o.isArray(t.requestOptions)&&(r=t.requestOptions[t.step.index]||{}),t.autoHeaders&&(e=r,(t=(t=t).adapter.constructor.mediaType||t.adapter.mediaType)&&(e.headers?e.headers=i(s(e,t),e.headers):e.headers=s(e,t))),n.debug("options",r),r}},{"../merge_recursive":15,minilog:1,util:2}],32:[function(t,e,r){"use strict";var n=t("minilog")("traverson"),o=t("../errors"),i=o.errors,s=o.createError,a=t("../is_continuation");e.exports=function(e){if(a(e)&&(n.debug("continuing from last traversal process (transforms/parse)"),"getResource"===e.continuation.action))return!0;if(e.step.doc)return n.debug("no parsing necessary, probably an embedded document"),!0;try{return r=e,n.debug("parsing response body"),r.requestOptions&&r.requestOptions.jsonReviver?r.step.doc=r.step.response.body:r.step.doc=r.jsonParser(r.step.response.body),!0}catch(t){r=e,e=t;return"SyntaxError"===t.name&&(e=function(t,e){var r=s("The document at "+t+" could not be parsed as JSON: "+e,i.JSONError,e);return r.url=t,r.body=e,r}(r.step.url,r.step.response.body)),n.error("parsing failed"),n.error(e),r.callback(e),!1}var r}},{"../errors":9,"../is_continuation":11,minilog:1}],33:[function(t,e,r){"use strict";var n=t("minilog")("traverson"),o=t("../parse_link_header_value");e.exports=function(e){if(!(e.step.doc&&e.step.response&&e.step.response.headers&&e.step.response.headers.link))return!0;try{var r=o(e.step.response.headers.link);return e.step.doc._linkHeaders=r,!0}catch(t){return r=e,e=t,n.error("failed to parse link header"),n.error(e),r.callback(e),!1}}},{"../parse_link_header_value":17,minilog:1}],34:[function(t,e,r){"use strict";var n=t("../is_continuation");e.exports=function(t){return!!n(t)||!(t.continuation=null)}},{"../is_continuation":11}],35:[function(t,e,r){"use strict";var n=t("../is_continuation");e.exports=function(t){return!!n(t)||!(t.lastStep=null)}},{"../is_continuation":11}],36:[function(t,e,r){"use strict";var n=t("minilog")("traverson"),o=t("underscore.string"),i=t("url"),s=/https?:\/\//i;e.exports=function(t){return t.step.url&&0!==t.step.url.search(s)&&(n.debug("found non full qualified URL"),t.resolveRelative&&t.lastStep&&t.lastStep.url?(n.debug("resolving URL relative"),o.startsWith(t.step.url,"/")&&o.endsWith(t.lastStep.url,"/")&&(t.step.url=o.splice(t.step.url,0,1)),t.step.url=t.lastStep.url+t.step.url):t.step.url=i.resolve(t.startUrl,t.step.url)),!0}},{minilog:1,"underscore.string":4,url:5}],37:[function(t,e,r){"use strict";var n=t("minilog")("traverson"),o=t("underscore.string"),i=t("url-template"),s=t("util");e.exports=function(t){var e;return t.step.url&&(e=t.templateParameters,e=(e=s.isArray(e)?e[t.step.index]:e)||{},o.contains(t.step.url,"{")&&(n.debug("resolving URI template"),e=i.parse(t.step.url).expand(e),n.debug("resolved to",e),t.step.url=e)),!0}},{minilog:1,"underscore.string":4,"url-template":66,util:2}],38:[function(t,e,r){"use strict";var n=t("minilog")("traverson");e.exports=function(t){var e=t.links[t.step.index];return n.debug("next link:",e),t.lastStep=t.step,t.step=function(e,t){try{return e.adapter.findNextStep(e,t)}catch(t){return n.error("could not find next step"),n.error(t),e.callback(t),null}}(t,e),!!t.step&&(n.debug("found next step",t.step),t.step.index=t.lastStep.index+1,!0)}},{minilog:1}],39:[function(t,e,r){"use strict";var n=t("minilog")("traverson"),o=t("./abort_traversal"),i=t("./transforms/apply_transforms"),s=(t("./is_continuation"),t("./transforms/resolve_uri_template")),a=[t("./transforms/fetch_resource"),t("./transforms/reset_last_step"),t("./transforms/check_http_status"),t("./transforms/parse"),t("./transforms/switch_to_next_step"),s,t("./transforms/resolve_next_url"),t("./transforms/reset_continuation")];function u(t){return t.step.index<t.links.length}function c(t){return t.aborted}r.walk=function(t,e,r){s(t)&&(n.debug("starting to follow links"),e=e||[],t.callback=r,function e(t,r){n.debug("processing next step");if(u(t)&&!c(t))i(a,t,function(t){n.debug("successfully processed step"),e(t,r)});else{if(c(t))return o.callCallbackOnAbort(t);n.debug("link array exhausted"),i(r,t,function(t){return t.callback()})}}(t,e))}},{"./abort_traversal":6,"./is_continuation":11,"./transforms/apply_transforms":18,"./transforms/check_http_status":19,"./transforms/fetch_resource":30,"./transforms/parse":32,"./transforms/reset_continuation":34,"./transforms/reset_last_step":35,"./transforms/resolve_next_url":36,"./transforms/resolve_uri_template":37,"./transforms/switch_to_next_step":38,minilog:1}],40:[function(t,e,r){},{}],41:[function(t,e,r){"use strict";var n=t("get-intrinsic"),o=t("./"),i=o(n("String.prototype.indexOf"));e.exports=function(t,e){e=n(t,!!e);return"function"==typeof e&&-1<i(t,".prototype.")?o(e):e}},{"./":42,"get-intrinsic":47}],42:[function(t,e,r){"use strict";var n=t("function-bind"),t=t("get-intrinsic"),o=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||n.call(i,o),a=t("%Object.getOwnPropertyDescriptor%",!0),u=t("%Object.defineProperty%",!0),c=t("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}e.exports=function(t){var e=s(n,i,arguments);return a&&u&&a(e,"length").configurable&&u(e,"length",{value:1+c(0,t.length-(arguments.length-1))}),e};function l(){return s(n,o,arguments)}u?u(e.exports,"apply",{value:l}):e.exports.apply=l},{"function-bind":46,"get-intrinsic":47}],43:[function(t,e,r){function n(t){if(t){var e,r=t;for(e in n.prototype)r[e]=n.prototype[e];return r}}void 0!==e&&(e.exports=n),n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r)for(var n=0,o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e);return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},{}],44:[function(t,e,r){((e.exports=n).default=n).stable=o,n.stableStringify=o;var f="[...]",h="[Circular]",d=[],s=[];function a(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function n(t,e,r,n){var o;!function t(e,r,n,o,i,s,a){s+=1;var u;if("object"==typeof e&&null!==e){for(u=0;u<o.length;u++)if(o[u]===e)return void y(h,e,r,i);if(void 0!==a.depthLimit&&s>a.depthLimit)y(f,e,r,i);else if(void 0!==a.edgesLimit&&n+1>a.edgesLimit)y(f,e,r,i);else{if(o.push(e),Array.isArray(e))for(u=0;u<e.length;u++)t(e[u],u,u,o,e,s,a);else{var c=Object.keys(e);for(u=0;u<c.length;u++){var l=c[u];t(e[l],l,u,o,e,s,a)}}o.pop()}}}(t,"",0,[],void 0,0,n=void 0===n?a():n);try{o=0===s.length?JSON.stringify(t,e,r):JSON.stringify(t,u(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==d.length;){var i=d.pop();4===i.length?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return o}function y(t,e,r,n){var o=Object.getOwnPropertyDescriptor(n,r);void 0!==o.get?o.configurable?(Object.defineProperty(n,r,{value:t}),d.push([n,r,e,o])):s.push([e,r,t]):(n[r]=t,d.push([n,r,e]))}function g(t,e){return t<e?-1:e<t?1:0}function o(t,e,r,n){var o,n=function t(e,r,n,o,i,s,a){s+=1;var u;if("object"==typeof e&&null!==e){for(u=0;u<o.length;u++)if(o[u]===e)return void y(h,e,r,i);try{if("function"==typeof e.toJSON)return}catch(t){return}if(void 0!==a.depthLimit&&s>a.depthLimit)y(f,e,r,i);else if(void 0!==a.edgesLimit&&n+1>a.edgesLimit)y(f,e,r,i);else{if(o.push(e),Array.isArray(e))for(u=0;u<e.length;u++)t(e[u],u,u,o,e,s,a);else{var c={},l=Object.keys(e).sort(g);for(u=0;u<l.length;u++){var p=l[u];t(e[p],p,u,o,e,s,a),c[p]=e[p]}if(void 0===i)return c;d.push([i,r,e]),i[r]=c}o.pop()}}}(t,"",0,[],void 0,0,n=void 0===n?a():n)||t;try{o=0===s.length?JSON.stringify(n,e,r):JSON.stringify(n,u(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==d.length;){var i=d.pop();4===i.length?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return o}function u(o){return o=void 0!==o?o:function(t,e){return e},function(t,e){if(0<s.length)for(var r=0;r<s.length;r++){var n=s[r];if(n[1]===t&&n[0]===e){e=n[2],s.splice(r,1);break}}return o.call(this,t,e)}}},{}],45:[function(t,e,r){"use strict";var u=Array.prototype.slice,c=Object.prototype.toString;e.exports=function(e){var r=this;if("function"!=typeof r||"[object Function]"!==c.call(r))throw new TypeError("Function.prototype.bind called on incompatible "+r);for(var n,t,o=u.call(arguments,1),i=Math.max(0,r.length-o.length),s=[],a=0;a<i;a++)s.push("$"+a);return n=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(function(){var t;return this instanceof n?(t=r.apply(this,o.concat(u.call(arguments))),Object(t)===t?t:this):r.apply(e,o.concat(u.call(arguments)))}),r.prototype&&((t=function(){}).prototype=r.prototype,n.prototype=new t,t.prototype=null),n}},{}],46:[function(t,e,r){"use strict";t=t("./implementation");e.exports=Function.prototype.bind||t},{"./implementation":45}],47:[function(t,e,r){"use strict";var n,f=SyntaxError,o=Function,h=TypeError,i=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(t){d=null}function s(){throw new h}function y(t){var e,r;return"%AsyncFunction%"===t?e=i("async function () {}"):"%GeneratorFunction%"===t?e=i("function* () {}"):"%AsyncGeneratorFunction%"===t?e=i("async function* () {}"):"%AsyncGenerator%"===t?(r=y("%AsyncGeneratorFunction%"))&&(e=r.prototype):"%AsyncIteratorPrototype%"===t&&(r=y("%AsyncGenerator%"))&&(e=c(r.prototype)),m[t]=e}var a=d?function(){try{return s}catch(t){try{return d(arguments,"callee").get}catch(t){return s}}}():s,u=t("has-symbols")(),c=Object.getPrototypeOf||function(t){return t.__proto__},g={},l="undefined"==typeof Uint8Array?n:c(Uint8Array),m={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":u?c([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":g,"%AsyncGenerator%":g,"%AsyncGeneratorFunction%":g,"%AsyncIteratorPrototype%":g,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":g,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u?c(c([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&u?c((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&u?c((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u?c(""[Symbol.iterator]()):n,"%Symbol%":u?Symbol:n,"%SyntaxError%":f,"%ThrowTypeError%":a,"%TypedArray%":l,"%TypeError%":h,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},u=t("function-bind"),v=t("has"),_=u.call(Function.call,Array.prototype.concat),w=u.call(Function.apply,Array.prototype.splice),O=u.call(Function.call,String.prototype.replace),S=u.call(Function.call,String.prototype.slice),x=u.call(Function.call,RegExp.prototype.exec),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g;e.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new h("intrinsic name must be a non-empty string");if(1<arguments.length&&"boolean"!=typeof e)throw new h('"allowMissing" argument must be a boolean');if(null===x(/^%?[^%]*%?$/g,t))throw new f("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new f("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new f("invalid intrinsic syntax, expected opening `%`");var o=[];return O(t,E,function(t,e,r,n){o[o.length]=r?O(n,T,"$1"):e||t}),o}(t),n=0<r.length?r[0]:"",o=function(t,e){var r,n=t;if(v(b,n)&&(n="%"+(r=b[n])[0]+"%"),v(m,n)){var o=m[n];if(void 0!==(o=o===g?y(n):o)||e)return{alias:r,name:n,value:o};throw new h("intrinsic "+t+" exists, but is not available. Please file an issue!")}throw new f("intrinsic "+t+" does not exist!")}("%"+n+"%",e),i=(o.name,o.value),s=!1,o=o.alias;o&&(n=o[0],w(r,_([0,1],o)));for(var a=1,u=!0;a<r.length;a+=1){var c=r[a],l=S(c,0,1),p=S(c,-1);if(('"'===l||"'"===l||"`"===l||'"'===p||"'"===p||"`"===p)&&l!==p)throw new f("property names with quotes must have matching quotes");if("constructor"!==c&&u||(s=!0),v(m,l="%"+(n+="."+c)+"%"))i=m[l];else if(null!=i){if(!(c in i)){if(e)return;throw new h("base intrinsic for "+t+" exists, but the property is not available.")}i=d&&a+1>=r.length?(u=!!(p=d(i,c)))&&"get"in p&&!("originalValue"in p.get)?p.get:i[c]:(u=v(i,c),i[c]),u&&!s&&(m[l]=i)}}return i}},{"function-bind":46,has:50,"has-symbols":48}],48:[function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=t("./shams");e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},{"./shams":49}],49:[function(t,e,r){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){r=Object.getOwnPropertyDescriptor(t,e);if(42!==r.value||!0!==r.enumerable)return!1}return!0}},{}],50:[function(t,e,r){"use strict";t=t("function-bind");e.exports=t.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":46}],51:[function(require,module,exports){var module;!function(glbl,require){"use strict";var isNode=module&&!!module.exports,allowedResultTypes=["value","path","pointer","parent","parentProperty","all"],moveToAnotherArray=(Array.prototype.includes||(Array.prototype.includes=function(t){return-1<this.indexOf(t)}),String.prototype.includes||(String.prototype.includes=function(t){return-1<this.indexOf(t)}),function(t,e,r){for(var n=0,o=t.length;n<o;n++)r(t[n])&&e.push(t.splice(n--,1)[0])}),vm=isNode?require("vm"):{runInNewContext:function(expr,context){var keys=Object.keys(context),funcs=[],code=(moveToAnotherArray(keys,funcs,function(t){return"function"==typeof context[t]}),funcs.reduce(function(t,e){return"var "+e+"="+context[e].toString()+";"+t},""));return code+=keys.reduce(function(t,e){return"var "+e+"="+JSON.stringify(context[e]).replace(/\u2028|\u2029/g,function(t){return"\\u202"+("\u2028"===t?"8":"9")})+";"+t},expr),eval(code)}};function push(t,e){return(t=t.slice()).push(e),t}function unshift(t,e){return(e=e.slice()).unshift(t),e}function NewError(t){this.avoidNew=!0,this.value=t,this.message='JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'}function JSONPath(t,e,r,n,o){if(!(this instanceof JSONPath))try{return new JSONPath(t,e,r,n,o)}catch(t){if(t.avoidNew)return t.value;throw t}"string"==typeof t&&(o=n,n=r,r=e,e=t,t={});var i=(t=t||{}).hasOwnProperty("json")&&t.hasOwnProperty("path");if(this.json=t.json||r,this.path=t.path||e,this.resultType=t.resultType&&t.resultType.toLowerCase()||"value",this.flatten=t.flatten||!1,this.wrap=!t.hasOwnProperty("wrap")||t.wrap,this.sandbox=t.sandbox||{},this.preventEval=t.preventEval||!1,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||n||null,this.otherTypeCallback=t.otherTypeCallback||o||function(){throw new Error("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==t.autostart){n=this.evaluate({path:i?t.path:e,json:i?t.json:r});if(n&&"object"==typeof n)return n;throw new NewError(n)}}JSONPath.prototype.evaluate=function(t,e,r,n){var o=this,i=this.flatten,s=this.wrap,a=this.parent,u=this.parentProperty;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,e=e||this.json,(t=t||this.path)&&"object"==typeof t){if(!t.path)throw new Error('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');e=t.hasOwnProperty("json")?t.json:e,i=t.hasOwnProperty("flatten")?t.flatten:i,this.currResultType=t.hasOwnProperty("resultType")?t.resultType:this.currResultType,this.currSandbox=t.hasOwnProperty("sandbox")?t.sandbox:this.currSandbox,s=t.hasOwnProperty("wrap")?t.wrap:s,this.currPreventEval=t.hasOwnProperty("preventEval")?t.preventEval:this.currPreventEval,r=t.hasOwnProperty("callback")?t.callback:r,this.currOtherTypeCallback=t.hasOwnProperty("otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,a=t.hasOwnProperty("parent")?t.parent:a,u=t.hasOwnProperty("parentProperty")?t.parentProperty:u,t=t.path}if(a=a||null,u=u||null,(t=Array.isArray(t)?JSONPath.toPathString(t):t)&&e&&allowedResultTypes.includes(this.currResultType))return this._obj=e,n=JSONPath.toPathArray(t),"$"===n[0]&&1<n.length&&n.shift(),this._hasParentSelector=null,t=this._trace(n,e,["$"],a,u,r),(t=t.filter(function(t){return t&&!t.isParentSelector})).length?1!==t.length||s||Array.isArray(t[0].value)?t.reduce(function(t,e){e=o._getPreferredOutput(e);return i&&Array.isArray(e)?t=t.concat(e):t.push(e),t},[]):this._getPreferredOutput(t[0]):s?[]:void 0},JSONPath.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":return t.path="string"==typeof t.path?t.path:JSONPath.toPathString(t.path),t;case"value":case"parent":case"parentProperty":return t[e];case"path":return JSONPath.toPathString(t[e]);case"pointer":return JSONPath.toPointer(t.path)}},JSONPath.prototype._handleCallback=function(t,e,r){var n;e&&(n=this._getPreferredOutput(t),t.path="string"==typeof t.path?t.path:JSONPath.toPathString(t.path),e(n,r,t))},JSONPath.prototype._trace=function(t,e,r,n,o,i,s){var a,u=this;if(!t.length)return this._handleCallback(a={path:r,value:e,parent:n,parentProperty:o},i,"value"),a;var c=t[0],l=t.slice(1),p=[];function f(t){p.push(t)}function h(t){Array.isArray(t)?t.forEach(f):p.push(t)}if(("string"!=typeof c||s)&&e&&Object.prototype.hasOwnProperty.call(e,c))h(this._trace(l,e[c],push(r,c),e,c,i));else if("*"===c)this._walk(c,l,e,r,n,o,i,function(t,e,r,n,o,i,s,a){h(u._trace(unshift(t,r),n,o,i,s,a,!0))});else if(".."===c)h(this._trace(l,e,r,n,o,i)),this._walk(c,l,e,r,n,o,i,function(t,e,r,n,o,i,s,a){"object"==typeof n[t]&&h(u._trace(unshift(e,r),n[t],push(o,t),n,t,a))});else{if("^"===c)return this._hasParentSelector=!0,r.length?{pat