From 3270242fc5144e4866208939b9fa7620466c7cbc Mon Sep 17 00:00:00 2001 From: bherr2 Date: Mon, 22 Feb 2021 17:12:37 +0000 Subject: [PATCH] Production deploy -- fa06411a42c5594ff8d32542641777f91d50373b --- 0-es2015.worker.js | 2 +- 0-es5.worker.js | 2 +- assets/icons/icons-organs_colon.svg | 2 +- docs/classes/HuBMAPEntity.html | 4 +- docs/components/BlockSizeInputComponent.html | 10 +-- docs/components/ContentComponent-2.html | 3 +- docs/components/InfoDialogComponent-1.html | 4 +- docs/components/LeftSidebarComponent.html | 12 ++-- docs/components/NameInputComponent.html | 6 +- docs/components/OrganSelectorComponent.html | 2 +- docs/components/ReviewButtonComponent.html | 4 +- docs/components/RotationSliderComponent.html | 4 +- docs/components/StageNavComponent.html | 3 +- docs/components/VideoModalComponent.html | 46 ++++++++----- .../VideoModalLauncherComponent.html | 13 ++-- docs/index.html | 21 ++++-- docs/injectables/ModelState.html | 67 +++++++++---------- docs/injectables/ReferenceDataState.html | 3 + docs/injectables/RegistrationState.html | 20 +++--- docs/interfaces/DefaultIconDefinition-1.html | 2 +- docs/interfaces/DefaultIconDefinition.html | 2 +- docs/interfaces/GlobalConfig.html | 2 +- docs/interfaces/ModelStateModel.html | 5 +- docs/interfaces/OrganInfo.html | 2 +- docs/interfaces/ReferenceDataStateModel.html | 3 + docs/interfaces/RegistrationStateModel.html | 20 +++--- docs/interfaces/SlicesConfig.html | 5 +- docs/interfaces/XYZTriplet.html | 5 +- docs/js/menu-wc.js | 30 ++++----- docs/js/search/search_index.js | 4 +- docs/miscellaneous/variables.html | 14 ++-- docs/modules/BlockSizeInputModule.html | 14 +++- docs/modules/NameInputModule.html | 4 +- docs/modules/ReviewButtonModule.html | 12 +++- docs/modules/RotationSliderModule.html | 4 +- docs/modules/StageNavModule.html | 15 ++++- main-es2015.js | 2 +- main-es5.js | 2 +- rui/assets/icons/icons-organs_colon.svg | 1 - .../icons/icons-organs_large intestine.svg | 1 + rui/main.js | 2 +- rui/styles.css | 2 +- 42 files changed, 217 insertions(+), 164 deletions(-) delete mode 100644 rui/assets/icons/icons-organs_colon.svg create mode 100644 rui/assets/icons/icons-organs_large intestine.svg diff --git a/0-es2015.worker.js b/0-es2015.worker.js index c2d5546a6..8ed2e7766 100644 --- a/0-es2015.worker.js +++ b/0-es2015.worker.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,(function(t){return e[t]}).bind(null,i));return r},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="Hj1c")}({"+2nh":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n("FZPO");class i{fromRdf(e,t){switch(t&&!e.value.match(i.VALIDATORS[e.datatype.value.substr(33,e.datatype.value.length)])&&r.Translator.incorrectRdfDataType(e),e.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(e.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const t=e.value.split("-");return new Date(0,parseInt(t[0],10)-1,parseInt(t[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(e.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(e.value+"-01");default:return new Date(e.value)}}toRdf(e,{datatype:t,dataFactory:n}){if(t=t||n.namedNode(i.TYPES[0]),!(e instanceof Date))return null;const r=e;let o;switch(t.value){case"http://www.w3.org/2001/XMLSchema#gDay":o=String(r.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":o=r.getUTCMonth()+1+"-"+r.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":o=String(r.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":o=r.getUTCFullYear()+"-"+(r.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":o=r.toISOString().replace(/T.*$/,"");break;default:o=r.toISOString()}return n.literal(o,t)}}t.TypeHandlerDate=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],i.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/}},"04/w":function(e,t){function n(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}n.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n(function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}})},n.empty=function(){var e=new n(null);return e.done=!0,e},n.is=function(e){return e instanceof n||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=n},"12xR":function(e,t){function n(){this.value=""}n.prototype.equals=function(e){return!!e&&e.termType===this.termType},n.prototype.termType="DefaultGraph",e.exports=n},"4cw7":function(e,t,n){var r=n("12xR");function i(e,t,n,i){this.subject=e,this.predicate=t,this.object=n,this.graph=i||new r}i.prototype.equals=function(e){return!!e&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)},e.exports=i},"6smP":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{fromRdf(e){return e.value}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e,t)}}t.TypeHandlerString=r,r.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},"8Xj3":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n("FZPO");class i{fromRdf(e,t){switch(e.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return t&&r.Translator.incorrectRdfDataType(e),!1}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e?"true":"false",t||n.namedNode(i.TYPE))}}t.TypeHandlerBoolean=i,i.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},Eagr:function(e,t){function n(e){this.value=e}n.prototype.equals=function(e){return!!e&&e.termType===this.termType&&e.value===this.value},n.prototype.termType="NamedNode",e.exports=n},FZPO:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(e){throw new Error(`Invalid RDF ${e.datatype.value} value: '${e.value}'`)}registerHandler(e,t,n){for(const r of t)this.supportedRdfDatatypes.push(r),this.fromRdfHandlers[r.value]=e;for(const r of n){let t=this.toRdfHandlers[r];t||(this.toRdfHandlers[r]=t=[]),t.push(e)}}fromRdf(e,t){const n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}toRdf(e,t){const n=this.toRdfHandlers[typeof e];if(n)for(const r of n){const n=r.toRdf(e,t);if(n)return n}throw new Error(`Invalid JavaScript value: '${e}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},HXBs:function(e,t,n){e.exports=function(){"use strict";function e(t){return(e="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})(t)}function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function o(e,t,n){return(o=i()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o}).apply(null,arguments)}function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return o(e,arguments,n(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(){for(var e=arguments[0]||{},t=1,n=arguments.length;t0&&a.length>i){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=n,++e._eventsCount;return e}function E(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function j(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function N(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}function I(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}g.prototype=Object.create(null),y.EventEmitter=y,y.usingDomains=!1,y.prototype.domain=void 0,y.prototype._events=void 0,y.prototype._maxListeners=void 0,y.defaultMaxListeners=10,y.init=function(){this.domain=null,y.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new g,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},y.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},y.prototype.getMaxListeners=function(){return v(this)},y.prototype.emit=function(e){var t,n,r,i,o,a,s,u="error"===e;if(a=this._events)u=u&&null==a.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(n=a[e]))return!1;var l="function"==typeof n;switch(r=arguments.length){case 1:m(n,l,this);break;case 2:b(n,l,this,arguments[1]);break;case 3:_(n,l,this,arguments[1],arguments[2]);break;case 4:w(n,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o0;)if(n[o]===t||n[o].listener&&n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new g,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r0?Reflect.ownKeys(this._events):[]},I.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(I.prototype[Symbol.iterator]=function(){return this}),I.of=function(){var e=arguments,t=e.length,n=0;return new I(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},I.empty=function(){var e=new I(null);return e.done=!0,e},I.is=function(e){return e instanceof I||"object"==typeof e&&null!==e&&"function"==typeof e.next};var T=I,A=function(e,t){for(var n,r=arguments.length>1?t:1/0,i=r!==1/0?new Array(r):[],o=0;;){if(o===r)return i;if((n=e.next()).done)return o!==t?i.slice(0,o):i;i[o++]=n.value}},k=function(e){function n(t,n){var r;return(r=e.call(this)||this).name="GraphError",r.message=t||"",r.data=n||{},r}return t(n,e),n}(a(Error)),O=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(k),R=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(k),L=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(k);function M(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function D(e,t){this.key=e,this.attributes=t||{},this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function C(e,t){this.key=e,this.attributes=t||{},this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function P(e,t,n,r,i){this.key=e,this.attributes=i,this.source=n,this.target=r,this.generatedKey=t}function F(e,t,n,r,i){this.key=e,this.attributes=i,this.source=n,this.target=r,this.generatedKey=t}function B(e,t,n,r,i,o,a){var s=e.multi,u=t?"undirected":"out",c=t?"undirected":"in",l=o[u][i];void 0===l&&(l=s?new Set:n,o[u][i]=l),s&&l.add(n),r!==i&&void 0===a[c][r]&&(a[c][r]=l)}function U(e,t,n){var r=e.multi,i=n.source,o=n.target,a=i.key,s=o.key,u=i[t?"undirected":"out"],c=t?"undirected":"in";if(s in u)if(r){var l=u[s];1===l.size?(delete u[s],delete o[c][a]):l.delete(n)}else delete u[s];r||delete o[c][a]}D.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},C.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var G=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],!(o=c(this,a,s,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[i]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+arguments[1];if(!(i=c(this,o,a,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(i instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],!(o=c(this,a,s,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes.hasOwnProperty(i)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i,o){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+e,u=""+i;if(i=arguments[2],o=arguments[3],!(a=c(this,s,u,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').concat(u,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(a instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",meta:{name:i,value:o}}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i,o){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+e,u=""+i;if(i=arguments[2],o=arguments[3],!(a=c(this,s,u,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').concat(u,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof o)throw new O("Graph.".concat(t,": updater should be a function."));if("mixed"!==n&&!(a instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[i]=o(a.attributes[i]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",meta:{name:i,value:a.attributes[i]}}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],!(o=c(this,a,s,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",meta:{name:i}}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],!(o=c(this,a,s,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!h(i))throw new O("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&!(o instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));var u=o.attributes;return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",meta:{before:u,after:i}}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],!(o=c(this,a,s,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!h(i))throw new O("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&!(o instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return u(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",meta:{data:i}}),this}}}],z=function(){var e,t=arguments,n=-1;return new T(function r(){if(!e){if(++n>=t.length)return{done:!0};e=t[n]}var i=e.next();return i.done?(e=null,r()):i})},V=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function q(e,t){for(var n in t)t[n]instanceof Set?t[n].forEach(function(t){return e.push(t.key)}):e.push(t[n].key)}function K(e,t){for(var n in e){var r=e[n];t(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes)}}function W(e,t){for(var n in e)e[n].forEach(function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)})}function H(e){var t=Object.keys(e),n=t.length,r=null,i=0;return new T(function o(){var a;if(r){var s=r.next();if(s.done)return r=null,i++,o();a=s.value}else{if(i>=n)return{done:!0};if((a=e[t[i]])instanceof Set)return r=a.values(),o();i++}return{done:!1,value:[a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes]}})}function J(e,t,n){n in t&&(t[n]instanceof Set?t[n].forEach(function(t){return e.push(t.key)}):e.push(t[n].key))}function $(e,t,n){if(t in e)if(e[t]instanceof Set)e[t].forEach(function(e){return n(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)});else{var r=e[t];n(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes)}}function X(e,t){var n=e[t];if(n instanceof Set){var r=n.values();return new T(function(){var e=r.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}})}return T.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function Q(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return A(e._edges.keys(),e._edges.size);var n=new Array("undirected"===t?e.undirectedSize:e.directedSize),r="undirected"===t,i=0;return e._edges.forEach(function(e,t){e instanceof F===r&&(n[i++]=t)}),n}function Y(e,t,n){if(0!==e.size)if("mixed"===t||t===e.type)e._edges.forEach(function(e,t){var r=e.source,i=e.target;n(t,e.attributes,r.key,i.key,r.attributes,i.attributes)});else{var r="undirected"===t;e._edges.forEach(function(e,t){if(e instanceof F===r){var i=e.source,o=e.target;n(t,e.attributes,i.key,o.key,i.attributes,o.attributes)}})}}function Z(e,t){return 0===e.size?T.empty():"mixed"===t?(n=e._edges.values(),new T(function(){var e=n.next();if(e.done)return e;var t=e.value;return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}})):(n=e._edges.values(),new T(function e(){var r=n.next();if(r.done)return r;var i=r.value;return i instanceof F==("undirected"===t)?{value:[i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes],done:!1}:e()}));var n}function ee(e,t,n){var r=[];return"undirected"!==e&&("out"!==t&&q(r,n.in),"in"!==t&&q(r,n.out)),"directed"!==e&&q(r,n.undirected),r}function te(e,t,n,r,i){var o=e?W:K;"undirected"!==t&&("out"!==n&&o(r.in,i),"in"!==n&&o(r.out,i)),"directed"!==t&&o(r.undirected,i)}function ne(e,t,n){var r=T.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(r=z(r,H(n.in))),"in"!==t&&void 0!==n.out&&(r=z(r,H(n.out)))),"directed"!==e&&void 0!==n.undirected&&(r=z(r,H(n.undirected))),r}function re(e,t,n,r){var i=[];return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&J(i,n.in,r),void 0!==n.out&&"in"!==t&&J(i,n.out,r)),"directed"!==e&&void 0!==n.undirected&&J(i,n.undirected,r),i}function ie(e,t,n,r,i){"undirected"!==e&&(void 0!==n.in&&"out"!==t&&$(n.in,r,i),void 0!==n.out&&"in"!==t&&$(n.out,r,i)),"directed"!==e&&void 0!==n.undirected&&$(n.undirected,r,i)}function oe(e,t,n,r){var i=T.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(i=z(i,X(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(i=z(i,X(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(i=z(i,X(n.undirected,r))),i}var ae=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function se(e,t){if(void 0!==t)for(var n in t)e.add(n)}function ue(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var r=new Set;return"undirected"!==e&&("out"!==t&&se(r,n.in),"in"!==t&&se(r,n.out)),"directed"!==e&&se(r,n.undirected),A(r.values(),r.size)}function ce(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var o=i.source,a=o===e?i.target:o;n(a.key,a.attributes)}}function le(e,t,n,r){for(var i in n){var o=n[i];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===t?o.target:a;e.has(s.key)||(e.add(s.key),r(s.key,s.attributes))}}function he(e,t){var n=Object.keys(t),r=n.length,i=0;return new T(function(){if(i>=r)return{done:!0};var o=t[n[i++]];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===e?o.target:a;return{done:!1,value:[s.key,s.attributes]}})}function de(e,t,n){var r=Object.keys(n),i=r.length,o=0;return new T(function a(){if(o>=i)return{done:!0};var s=n[r[o++]];s instanceof Set&&(s=s.values().next().value);var u=s.source,c=u===t?s.target:u;return e.has(c.key)?a():(e.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function fe(e,t,n,r,i){var o=e._nodes.get(r);if("undirected"!==t){if("out"!==n&&void 0!==o.in)for(var a in o.in)if(a===i)return!0;if("in"!==n&&void 0!==o.out)for(var s in o.out)if(s===i)return!0}if("directed"!==t&&void 0!==o.undirected)for(var u in o.undirected)if(u===i)return!0;return!1}function pe(e,t){var n={key:e};return Object.keys(t.attributes).length&&(n.attributes=u({},t.attributes)),n}function ge(e,t){var n={source:t.source.key,target:t.target.key};return t.generatedKey||(n.key=e),Object.keys(t.attributes).length&&(n.attributes=u({},t.attributes)),t instanceof F&&(n.undirected=!0),n}function ye(e){return h(e)?"key"in e?!("attributes"in e)||h(e.attributes)&&null!==e.attributes?null:"invalid-attributes":"no-key":"not-object"}function ve(e){return h(e)?"source"in e?"target"in e?!("attributes"in e)||h(e.attributes)&&null!==e.attributes?"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var me=new Set(["directed","undirected","mixed"]),be=new Set(["domain","_events","_eventsCount","_maxListeners"]),_e={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function we(e,t,n,r,i,o,a,s){if(!r&&"undirected"===e.type)throw new L("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new L("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!h(s))throw new O("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(o=""+o,a=""+a,s=s||{},!e.allowSelfLoops&&o===a)throw new L("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var u=e._nodes.get(o),c=e._nodes.get(a);if(!u)throw new R("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!c)throw new R("Graph.".concat(t,': target node "').concat(a,'" not found.'));var l={key:null,undirected:r,source:o,target:a,attributes:s};if(n&&(i=e._edgeKeyGenerator(l)),e._edges.has(i=""+i))throw new L("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));if(!e.multi&&(r?void 0!==u.undirected[a]:void 0!==u.out[a]))throw new L("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var d=new(r?F:P)(i,n,u,c,s);return e._edges.set(i,d),o===a?r?u.undirectedSelfLoops++:u.directedSelfLoops++:r?(u.undirectedDegree++,c.undirectedDegree++):(u.outDegree++,c.inDegree++),B(e,r,d,o,a,u,c),r?e._undirectedSize++:e._directedSize++,l.key=i,e.emit("edgeAdded",l),i}function xe(e,t,n,r,i,o,a,s){if(!r&&"undirected"===e.type)throw new L("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new L("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!h(s))throw new O("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(o=""+o,a=""+a,s=s||{},!e.allowSelfLoops&&o===a)throw new L("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var l,d,f=e._nodes.get(o),p=e._nodes.get(a),g=null;if(!n&&(l=e._edges.get(i))){if(l.source!==o||l.target!==a||r&&(l.source!==a||l.target!==o))throw new L("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. (').concat(l.source,", ").concat(l.target,")."));g=i}if(g||e.multi||!f||(r?void 0===f.undirected[a]:void 0===f.out[a])||(d=c(e,o,a,r?"undirected":"directed")),d)return s?(u(d.attributes,s),g):g;var y={key:null,undirected:r,source:o,target:a,attributes:s};if(n&&(i=e._edgeKeyGenerator(y)),e._edges.has(i=""+i))throw new L("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));return f||(e.addNode(o),f=e._nodes.get(o),o===a&&(p=f)),p||(e.addNode(a),p=e._nodes.get(a)),l=new(r?F:P)(i,n,f,p,s),e._edges.set(i,l),o===a?r?f.undirectedSelfLoops++:f.directedSelfLoops++:r?(f.undirectedDegree++,p.undirectedDegree++):(f.outDegree++,p.inDegree++),B(e,r,l,o,a,f,p),r?e._undirectedSize++:e._directedSize++,y.key=i,e.emit("edgeAdded",y),i}var Se=function(e){function n(t){var n;if(n=e.call(this)||this,(t=u({},_e,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new O("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new O("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!me.has(t.type))throw new O('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new O("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r,i="mixed"===t.type?M:"directed"===t.type?D:C;return f(s(n),"NodeDataClass",i),f(s(n),"_attributes",{}),f(s(n),"_nodes",new Map),f(s(n),"_edges",new Map),f(s(n),"_directedSize",0),f(s(n),"_undirectedSize",0),f(s(n),"_edgeKeyGenerator",t.edgeKeyGenerator||(r=0,function(){return"_geid".concat(r++,"_")})),f(s(n),"_options",t),be.forEach(function(e){return f(s(n),e,n[e])}),p(s(n),"order",function(){return n._nodes.size}),p(s(n),"size",function(){return n._edges.size}),p(s(n),"directedSize",function(){return n._directedSize}),p(s(n),"undirectedSize",function(){return n._undirectedSize}),p(s(n),"multi",n._options.multi),p(s(n),"type",n._options.type),p(s(n),"allowSelfLoops",n._options.allowSelfLoops),n}t(n,e);var r=n.prototype;return r.hasNode=function(e){return this._nodes.has(""+e)},r.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&n instanceof P}if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var i=r.out[t];return!(!i||this.multi&&!i.size)}throw new O("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&n instanceof F}if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var i=r.undirected[t];return!(!i||this.multi&&!i.size)}throw new O("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasEdge=function(e,t){if(1===arguments.length)return this._edges.has(""+e);if(2===arguments.length){t=""+t;var n=this._nodes.get(e=""+e);if(!n)return!1;var r=void 0!==n.out&&n.out[t];return r||(r=void 0!==n.undirected&&n.undirected[t]),!(!r||this.multi&&!r.size)}throw new O("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new L("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new R('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new R('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||void 0;return r?r.key:void 0}},r.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new L("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new R('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new R('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.undirected&&n.undirected[t]||void 0;return r?r.key:void 0}},r.edge=function(e,t){if(this.multi)throw new L("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t;var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new R('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key},r.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new O('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.inDegree+(t?n.directedSelfLoops:0)},r.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new O('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.outDegree+(t?n.directedSelfLoops:0)},r.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new O('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(!this.hasNode(e=""+e))throw new R('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:this.inDegree(e,t)+this.outDegree(e,t)},r.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new O('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(!this.hasNode(e=""+e))throw new R('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));if("directed"===this.type)return 0;var n=this._nodes.get(e);return n.undirectedDegree+(t?2*n.undirectedSelfLoops:0)},r.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new O('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(!this.hasNode(e=""+e))throw new R('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"undirected"!==this.type&&(n+=this.directedDegree(e,t)),"directed"!==this.type&&(n+=this.undirectedDegree(e,t)),n},r.source=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},r.target=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},r.extremities=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},r.opposite=function(e,t){if(t=""+t,!this._nodes.has(e=""+e))throw new R('Graph.opposite: could not find the "'.concat(e,'" node in the graph.'));var n=this._edges.get(t);if(!n)throw new R('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var r=n.source.key,i=n.target.key;if(e!==r&&e!==i)throw new R('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(r,", ").concat(i,")."));return e===r?i:r},r.undirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.undirected: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof F},r.directed=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.directed: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof P},r.selfLoop=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.selfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},r.addNode=function(e,t){if(t&&!h(t))throw new O('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));if(t=t||{},this._nodes.has(e=""+e))throw new L('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var n=new this.NodeDataClass(e,t);return this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e},r.mergeNode=function(e,t){if(t&&!h(t))throw new O('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));t=t||{};var n=this._nodes.get(e=""+e);return n?(t&&u(n.attributes,t),e):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e)},r.dropNode=function(e){if(!this.hasNode(e=""+e))throw new R('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));for(var t=this.edges(e),n=0,r=t.length;n1){var n=""+arguments[0],r=""+arguments[1];if(!(t=c(this,n,r,this.type)))throw new R('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(!(t=this._edges.get(e=""+e)))throw new R('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var i=t.source,o=t.target,a=t.attributes,s=t instanceof F;return i===o?i.selfLoops--:s?(i.undirectedDegree--,o.undirectedDegree--):(i.outDegree--,o.inDegree--),U(this,s,t),s?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:a,source:i.key,target:o.key,undirected:s}),this},r.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},r.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},r.getAttribute=function(e){return this._attributes[e]},r.getAttributes=function(){return this._attributes},r.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},r.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",meta:{name:e,value:t}}),this},r.updateAttribute=function(e,t){if("function"!=typeof t)throw new O("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",meta:{name:e,value:this._attributes[e]}}),this},r.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",meta:{name:e}}),this},r.replaceAttributes=function(e){if(!h(e))throw new O("Graph.replaceAttributes: provided attributes are not a plain object.");var t=this._attributes;return this._attributes=e,this.emit("attributesUpdated",{type:"replace",meta:{before:t,after:e}}),this},r.mergeAttributes=function(e){if(!h(e))throw new O("Graph.mergeAttributes: provided attributes are not a plain object.");return this._attributes=u(this._attributes,e),this.emit("attributesUpdated",{type:"merge",meta:{data:this._attributes}}),this},r.getNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes[t]},r.getNodeAttributes=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new R('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},r.hasNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes.hasOwnProperty(t)},r.setNodeAttribute=function(e,t,n){var r=this._nodes.get(e=""+e);if(!r)throw new R('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new O("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return r.attributes[t]=n,this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:n}}),this},r.updateNodeAttribute=function(e,t,n){var r=this._nodes.get(e=""+e);if(!r)throw new R('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new O("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new O("Graph.updateAttribute: updater should be a function.");var i=r.attributes;return i[t]=n(i[t]),this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:i[t]}}),this},r.removeNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete n.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",meta:{name:t}}),this},r.replaceNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!h(t))throw new O("Graph.replaceNodeAttributes: provided attributes are not a plain object.");var r=n.attributes;return n.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",meta:{before:r,after:t}}),this},r.mergeNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!h(t))throw new O("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return u(n.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",meta:{data:t}}),this},r.forEach=function(e){if("function"!=typeof e)throw new O("Graph.forEach: expecting a callback.");this._edges.forEach(function(t,n){var r=t.source,i=t.target;e(r.key,i.key,r.attributes,i.attributes,n,t.attributes)})},r.adjacency=function(){var e=this._edges.values();return new T(function(){var t=e.next();if(t.done)return t;var n=t.value,r=n.source,i=n.target;return{done:!1,value:[r.key,i.key,r.attributes,i.attributes,n.key,n.attributes]}})},r.nodes=function(){return A(this._nodes.keys(),this._nodes.size)},r.forEachNode=function(e){if("function"!=typeof e)throw new O("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(t,n){e(n,t.attributes)})},r.nodeEntries=function(){var e=this._nodes.values();return new T(function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:[n.key,n.attributes],done:!1}})},r.exportNode=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new R('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return pe(e,t)},r.exportEdge=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return ge(e,t)},r.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach(function(n,r){e[t++]=pe(r,n)});var n=new Array(this._edges.size);return t=0,this._edges.forEach(function(e,r){n[t++]=ge(r,e)}),{attributes:this.getAttributes(),nodes:e,edges:n}},r.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ye(e);if(n){if("not-object"===n)throw new O('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new O("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new O("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var r=e.key,i=e.attributes,o=void 0===i?{}:i;return t?this.mergeNode(r,o):this.addNode(r,o),this},r.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ve(e);if(n){if("not-object"===n)throw new O('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new O("Graph.importEdge: missing souce.");if("no-target"===n)throw new O("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new O("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new O("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var r=e.source,i=e.target,o=e.attributes,a=void 0===o?{}:o,s=e.undirected,u=void 0!==s&&s;return"key"in e?(t?u?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:u?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,r,i,a):(t?u?this.mergeUndirectedEdge:this.mergeDirectedEdge:u?this.addUndirectedEdge:this.addDirectedEdge).call(this,r,i,a),this},r.import=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l(e))return this.import(e.export(),n),this;if(!h(e))throw new O("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!h(e.attributes))throw new O("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}return e.nodes&&e.nodes.forEach(function(e){return t.importNode(e,n)}),e.edges&&e.edges.forEach(function(e){return t.importEdge(e,n)}),this},r.nullCopy=function(e){return new n(u({},this._options,e))},r.emptyCopy=function(e){var t=new n(u({},this._options,e));return this._nodes.forEach(function(e,n){e=new t.NodeDataClass(n,u({},e.attributes)),t._nodes.set(n,e)}),t},r.copy=function(){var e=new n(this._options);return e.import(this),e},r.upgradeToMixed=function(){return"mixed"===this.type||(this._nodes.forEach(function(e){return e.upgradeToMixed()}),this._options.type="mixed",p(this,"type",this._options.type),f(this,"NodeDataClass",M)),this},r.upgradeToMulti=function(){return this.multi||(this._options.multi=!0,p(this,"multi",!0),(e=this)._nodes.forEach(function(t,n){if(t.out)for(var r in t.out){var i=new Set;i.add(t.out[r]),t.out[r]=i,e._nodes.get(r).in[n]=i}if(t.undirected)for(var o in t.undirected)if(!(o>n)){var a=new Set;a.add(t.undirected[o]),t.undirected[o]=a,e._nodes.get(o).undirected[n]=a}})),this;var e},r.clearIndex=function(){return this._nodes.forEach(function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})}),this},r.toJSON=function(){return this.export()},r.toString=function(){var e=this.order>1||0===this.order,t=this.size>1||0===this.size;return"Graph<".concat(d(this.order)," node").concat(e?"s":"",", ").concat(d(this.size)," edge").concat(t?"s":"",">")},r.inspect=function(){var e=this,t={};this._nodes.forEach(function(e,n){t[n]=e.attributes});var n={},r={};this._edges.forEach(function(t,i){var o=t instanceof F?"--":"->",a="",s="(".concat(t.source.key,")").concat(o,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===r[s]?r[s]=0:r[s]++,a+="".concat(r[s],". ")):a+="[".concat(i,"]: "),n[a+=s]=t.attributes});var i={};for(var o in this)this.hasOwnProperty(o)&&!be.has(o)&&"function"!=typeof this[o]&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,f(i,"constructor",this.constructor),i},n}(y);"undefined"!=typeof Symbol&&(Se.prototype[Symbol.for("nodejs.util.inspect.custom")]=Se.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(e){["add","merge"].forEach(function(t){var n=e.name(t),r="add"===t?we:xe;Se.prototype[n]=e.generateKey?function(t,i,o){return r(this,n,!0,"undirected"===(e.type||this.type),null,t,i,o)}:function(t,i,o,a){return r(this,n,!1,"undirected"===(e.type||this.type),t,i,o,a)}})}),"undefined"!=typeof Symbol&&(Se.prototype[Symbol.iterator]=Se.prototype.adjacency),function(e){G.forEach(function(t){var n=t.name,r=t.attacher;r(e,n("Edge"),"mixed",P),r(e,n("DirectedEdge"),"directed",P),r(e,n("UndirectedEdge"),"undirected",F)})}(Se),function(e){V.forEach(function(t){!function(e,t){var n=t.name,r=t.type,i=t.direction;e.prototype[n]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return Q(this,r);if(1===arguments.length){var o=this._nodes.get(e=""+e);if(void 0===o)throw new R("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return ee("mixed"===r?this.type:r,i,o)}if(2===arguments.length){t=""+t;var a=this._nodes.get(e=""+e);if(!a)throw new R("Graph.".concat(n,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new R("Graph.".concat(n,': could not find the "').concat(t,'" target node in the graph.'));return re(r,i,a,t)}throw new O("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return Y(this,r,n=e);if(2===arguments.length){n=t;var a=this._nodes.get(e=""+e);if(void 0===a)throw new R("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return te(this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t;var s=this._nodes.get(e=""+e);if(!s)throw new R("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new R("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return ie(r,i,s,t,n)}throw new O("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.type,r=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e,t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return T.empty();if(!arguments.length)return Z(this,n);if(1===arguments.length){var o=this._nodes.get(e=""+e);if(!o)throw new R("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return ne(n,r,o)}if(2===arguments.length){t=""+t;var a=this._nodes.get(e=""+e);if(!a)throw new R("Graph.".concat(i,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new R("Graph.".concat(i,': could not find the "').concat(t,'" target node in the graph.'));return oe(n,r,a,t)}throw new O("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)})}(Se),function(e){ae.forEach(function(t){!function(e,t){var n=t.name,r=t.type,i=t.direction;e.prototype[n]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],o=""+arguments[1];if(!this._nodes.has(t))throw new R("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(o))throw new R("Graph.".concat(n,': could not find the "').concat(o,'" node in the graph.'));return fe(this,r,i,t,o)}if(1===arguments.length){var a=this._nodes.get(e=""+e);if(void 0===a)throw new R("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return ue("mixed"===r?this.type:r,i,a)}throw new O("Graph.".concat(n,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new R("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return ce(n,n.undirected,r);if("string"==typeof t)return ce(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&le(i,n,n.in,r),"in"!==t&&le(i,n,n.out,r)),"directed"!==e&&le(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}(e,t),function(e,t){var n=t.type,r=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return T.empty();var t=this._nodes.get(e=""+e);if(void 0===t)throw new R("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return he(n,n.undirected);if("string"==typeof t)return he(n,n[t])}var r=T.empty(),i=new Set;return"undirected"!==e&&("out"!==t&&(r=z(r,de(i,n,n.in))),"in"!==t&&(r=z(r,de(i,n,n.out)))),"directed"!==e&&(r=z(r,de(i,n,n.undirected))),r}("mixed"===n?this.type:n,r,t)}}(e,t)})}(Se);var Ee=function(e){function n(t){return e.call(this,u({type:"directed"},t))||this}return t(n,e),n}(Se),je=function(e){function n(t){return e.call(this,u({type:"undirected"},t))||this}return t(n,e),n}(Se),Ne=function(e){function n(t){return e.call(this,u({multi:!0},t))||this}return t(n,e),n}(Se),Ie=function(e){function n(t){return e.call(this,u({multi:!0,type:"directed"},t))||this}return t(n,e),n}(Se),Te=function(e){function n(t){return e.call(this,u({multi:!0,type:"undirected"},t))||this}return t(n,e),n}(Se);function Ae(e){e.from=function(t,n){var r=new e(n);return r.import(t),r}}return Ae(Se),Ae(Ee),Ae(je),Ae(Ne),Ae(Ie),Ae(Te),Se.Graph=Se,Se.DirectedGraph=Ee,Se.UndirectedGraph=je,Se.MultiGraph=Ne,Se.MultiDirectedGraph=Ie,Se.MultiUndirectedGraph=Te,Se.InvalidArgumentsGraphError=O,Se.NotFoundGraphError=R,Se.UsageGraphError=L,Se}()},Hj1c:function(e,t,n){"use strict";function r(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})}n.r(t);var i=n("JFj6");function o(e){return(o="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})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function u(e,t,n){return(u=s()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&a(i,n.prototype),i}).apply(null,arguments)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.precision,r=void 0===n?d.precision||4:n;return e=f(e),"".concat(parseFloat(e.toPrecision(r)))}function g(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function y(e){return function(e,t){return function(e,t,n){if(g(e)){n=n||((i=e).clone?i.clone():new Array(i.length));for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"";if(d.debug&&!E(e,t))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return e}d.EPSILON=1e-12,d.debug=!1,d.precision=4,d.printTypes=!1,d.printDegrees=!1,d.printRowMajor=!0;var N={};function I(e,t){N[e]||(N[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}function T(e){var t="function"==typeof Map?new Map:void 0;return(T=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return u(e,arguments,_(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),a(n,e)})(e)}var A,k=function(e){function t(){return m(this,t),b(this,_(t).apply(this,arguments))}return S(t,e),x(t,[{key:"toString",value:function(){var e="[";if(d.printRowMajor){e+="row-major:";for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=e*this.RANK,r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+p(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t2*Math.PI)throw Error("radians");var d=s*Math.tan(r/2),f=d*o;return(new t).ortho({left:-f,right:f,bottom:-d,top:d,near:c,far:h})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=void 0===t?void 0:t,r=e.fov,i=void 0===r?45*Math.PI/180:r,o=e.aspect,a=void 0===o?1:o,s=e.near,u=void 0===s?.1:s,c=e.far,l=void 0===c?500:c;if((n=n||i)>2*Math.PI)throw Error("radians");return M(this,n,a,u,l),this.check()}},{key:"determinant",value:function(){return((t=(e=this)[0])*(a=e[5])-(n=e[1])*(o=e[4]))*((h=e[10])*(y=e[15])-(d=e[11])*(g=e[14]))-(t*(s=e[6])-(r=e[2])*o)*((l=e[9])*y-d*(p=e[13]))+(t*(u=e[7])-(i=e[3])*o)*(l*g-h*p)+(n*s-r*a)*((c=e[8])*y-d*(f=e[12]))-(n*u-i*a)*(c*g-h*f)+(r*u-i*s)*(c*p-l*f);var e,t,n,r,i,o,a,s,u,c,l,h,d,f,p,g,y}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(t||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*i,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*i,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(t||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*i,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*i,e[8]=this[10]*o,e}},{key:"transpose",value:function(){return function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],d=t[10],f=t[11],p=t[12],g=t[13],y=t[14],v=t[15],m=n*s-r*a,b=n*u-i*a,_=n*c-o*a,w=r*u-i*s,x=r*c-o*s,S=i*c-o*u,E=l*g-h*p,j=l*y-d*p,N=l*v-f*p,I=h*y-d*g,T=h*v-f*g,A=d*v-f*y,k=m*A-b*T+_*I+w*N-x*j+S*E;k&&(e[0]=(s*A-u*T+c*I)*(k=1/k),e[1]=(i*T-r*A-o*I)*k,e[2]=(g*S-y*x+v*w)*k,e[3]=(d*x-h*S-f*w)*k,e[4]=(u*N-a*A-c*j)*k,e[5]=(n*A-i*N+o*j)*k,e[6]=(y*_-p*S-v*b)*k,e[7]=(l*S-d*_+f*b)*k,e[8]=(a*T-s*N+c*E)*k,e[9]=(r*N-n*T-o*E)*k,e[10]=(p*x-g*_+v*m)*k,e[11]=(h*_-l*x-f*m)*k,e[12]=(s*j-a*I-u*E)*k,e[13]=(n*I-r*j+i*E)*k,e[14]=(g*b-p*w-y*m)*k,e[15]=(l*w-h*b+d*m)*k)}(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return R(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return R(this,this,e),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],d=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*r,e[5]=a*i+l*r,e[6]=s*i+h*r,e[7]=u*i+d*r,e[8]=c*i-o*r,e[9]=l*i-a*r,e[10]=h*i-s*r,e[11]=d*i-u*r}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[8],l=t[9],h=t[10],d=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*r,e[1]=a*i-l*r,e[2]=s*i-h*r,e[3]=u*i-d*r,e[8]=o*r+c*i,e[9]=a*r+l*i,e[10]=s*r+h*i,e[11]=u*r+d*i}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[4],l=t[5],h=t[6],d=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*r,e[1]=a*i+l*r,e[2]=s*i+h*r,e[3]=u*i+d*r,e[4]=c*i-o*r,e[5]=l*i-a*r,e[6]=h*i-s*r,e[7]=d*i-u*r}(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t,n,r=(n=3,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(t,n)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=r[1],o=r[2];return this.rotateX(r[0]).rotateY(i).rotateZ(o)}},{key:"rotateAxis",value:function(e,t){return function(e,t,n,r){var i,o,a,s,u,c,l,h,d,f,p,g,y,v,m,b,_,w,x,S,E,j,N,I,T=r[0],A=r[1],k=r[2],O=Math.hypot(T,A,k);O<1e-6||(T*=O=1/O,A*=O,k*=O,i=Math.sin(n),o=Math.cos(n),u=t[1],c=t[2],l=t[3],d=t[5],f=t[6],p=t[7],y=t[9],v=t[10],m=t[11],x=T*A*(a=1-o)-k*i,S=A*A*a+o,E=k*A*a+T*i,j=T*k*a+A*i,N=A*k*a-T*i,I=k*k*a+o,e[0]=(s=t[0])*(b=T*T*a+o)+(h=t[4])*(_=A*T*a+k*i)+(g=t[8])*(w=k*T*a-A*i),e[1]=u*b+d*_+y*w,e[2]=c*b+f*_+v*w,e[3]=l*b+p*_+m*w,e[4]=s*x+h*S+g*E,e[5]=u*x+d*S+y*E,e[6]=c*x+f*S+v*E,e[7]=l*x+p*S+m*E,e[8]=s*j+h*N+g*I,e[9]=u*j+d*N+y*I,e[10]=c*j+f*N+v*I,e[11]=l*j+p*N+m*I,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?L(this,this,e):L(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return function(e,t,n){var r,i,o,a,s,u,c,l,h,d,f,p,g=n[0],y=n[1],v=n[2];t===e?(e[12]=t[0]*g+t[4]*y+t[8]*v+t[12],e[13]=t[1]*g+t[5]*y+t[9]*v+t[13],e[14]=t[2]*g+t[6]*y+t[10]*v+t[14],e[15]=t[3]*g+t[7]*y+t[11]*v+t[15]):(i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=r=t[0],e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=r*g+s*y+h*v+t[12],e[13]=i*g+u*y+d*v+t[13],e[14]=o*g+c*y+f*v+t[14],e[15]=a*g+l*y+p*v+t[15])}(this,this,e),this.check()}},{key:"transform",value:function(e,t){return 4===e.length?(j(t=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e}(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}},{key:"transformAsPoint",value:function(e,t){switch(e.length){case 2:t=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e}(t||[-0,-0],e,this);break;case 3:t=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e}(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return j(t,e.length),t}},{key:"transformAsVector",value:function(e,t){switch(e.length){case 2:t=function(e,t,n){var r=t[0],i=t[1],o=n[3]*r+n[7]*i||1;return e[0]=(n[0]*r+n[4]*i)/o,e[1]=(n[1]*r+n[5]*i)/o,e}(t||[-0,-0],e,this);break;case 3:t=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o||1;return e[0]=(n[0]*r+n[4]*i+n[8]*o)/a,e[1]=(n[1]*r+n[5]*i+n[9]*o)/a,e[2]=(n[2]*r+n[6]*i+n[10]*o)/a,e}(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return j(t,e.length),t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"transformPoint",value:function(e,t){return I("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}},{key:"transformVector",value:function(e,t){return I("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}},{key:"transformDirection",value:function(e,t){return I("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(e,t,n,r,i,o){var a=2*o/(i-r),s=(n+t)/(n-t),u=(i+r)/(i-r),c=-2*o;return e[0]=2*o/(n-t),e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=s,e[9]=u,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=c,e[15]=0,e}}]),t}(k),G=n("HXBs"),z=n("mtbl"),V=n.n(z),q=n("YXac"),K=n("l/hW"),W=n.n(K),H=n("LvDl"),J=n("L1/z");const $=i.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},i.DataFactory),X={x:$("rdf"),type:i.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")},Q=$("entity")("id"),Y={x:$("entity"),id:Q,sex:$("entity")("sex"),age:$("entity")("age"),bmi:$("entity")("bmi"),Male:i.DataFactory.literal("Male"),Female:i.DataFactory.literal("Female"),donor:$("entity")("donor"),entityType:$("entity")("entityType"),groupName:$("entity")("groupName"),groupUUID:$("entity")("groupUUID"),ontologyTerms:$("entity")("ontologyTerms"),spatialEntity:$("entity")("spatialEntity"),images:$("entity")("hasImage"),imageProviders:$("entity")("hasImageProvider")},Z=$("ccf"),ee={x:Z,spatial:{Body:Z("VHBody"),Female:Z("VHFemale"),Male:Z("VHMale"),BothSexes:Z("VHBothSexes"),FemaleOrgans:Z("VHFemaleOrgans"),MaleOrgans:Z("VHMaleOrgans")},SpatialObjectReference:Z("SpatialObjectReference"),SpatialEntity:Z("SpatialEntity"),SpatialPlacement:Z("SpatialPlacement"),spatialObjectReference:{file:Z("has_object_file"),file_format:Z("has_object_file_format"),file_subpath:Z("has_object_file_subpath")},extractionSet:{label:$("rdf")("label"),rui_rank:Z("ccf_rui_rank")},spatialEntity:{label:$("rdf")("label"),comment:$("rdf")("comment"),creator:$("dc")("creator"),creator_first_name:Z("creator_first_name"),creator_last_name:Z("creator_last_name"),creator_orcid:Z("creator_orcid"),creation_date:Z("creation_date"),updated_date:Z("updated_date"),ccf_annotations:Z("ccf_annotation"),representation_of:Z("ccf_representation_of"),reference_organ:Z("anatomical_structure_of"),extraction_set_for:Z("extraction_set_for"),extraction_set:Z("extraction_site_for"),sex:Z("has_sex"),side:Z("has_side"),rui_rank:Z("ccf_rui_rank"),slice_thickness:Z("ccf_slice_thickness"),slice_count:Z("ccf_slice_count"),x_dimension:Z("has_x_dimension"),y_dimension:Z("has_y_dimension"),z_dimension:Z("has_z_dimension"),dimension_units:Z("has_dimension_units"),object:Z("has_object_reference")},spatialPlacement:{source:Z("has_placement_source"),target:Z("has_placement_target"),placement_date:Z("has_placement_date"),x_scaling:Z("has_x_scaling"),y_scaling:Z("has_y_scaling"),z_scaling:Z("has_z_scaling"),scaling_units:Z("has_scaling_units"),x_rotation:Z("has_x_rotation"),y_rotation:Z("has_y_rotation"),z_rotation:Z("has_z_rotation"),w_rotation:Z("has_theta_rotation"),rotation_order:Z("has_rotation_order"),rotation_units:Z("has_rotation_units"),x_translation:Z("has_x_translation"),y_translation:Z("has_y_translation"),z_translation:Z("has_z_translation"),translation_units:Z("has_translation_units")}},te={x:$("uberon")},ne={x:$("lmha")},re={body:te.x("0013702"),heart:te.x("0000948"),lung:ne.x("00211"),left_lung:te.x("0002168"),right_lung:te.x("0002167"),kidney:te.x("0002113"),left_kidney:te.x("0004538"),right_kidney:te.x("0004539"),spleen:te.x("0002106"),colon:te.x("0001155"),small_intestine:te.x("0002108"),rectum:te.x("0001052"),liver:te.x("0002107"),bladder:te.x("0001255"),ureter:te.x("0000056"),left_ureter:te.x("0001223"),right_ureter:te.x("0001222"),thymus:te.x("0002370"),lymph_node:te.x("0000029")};function ie(e){const t={};return Object.entries(e).forEach(([e,n])=>{t[n.id]=e}),t}const oe={spatialObjectReference:ie(ee.spatialObjectReference),spatialEntity:ie(ee.spatialEntity),spatialPlacement:ie(ee.spatialPlacement)};function ae(e,t,n,r){const o={"@id":t,"@type":n};return e.some(e=>{const t=r[e.predicate.id];if(t){const n="Literal"===e.object.termType?Object(J.fromRdf)(e.object):e.object.id;Object(H.set)(o,t,n)}return!1},i.DataFactory.namedNode(t),null,null,null),o}function se(e,t){return ae(e,t,"SpatialObjectReference",oe.spatialObjectReference)}function ue(e,t){const n=ae(e,t,"ExtractionSet",oe.spatialEntity);return n.extractionSites=Object(H.sortBy)(e.getSubjects(ee.spatialEntity.extraction_set,t,null).map(t=>ce(e,t.id)),["rui_rank"]),n}function ce(e,t){const n=ae(e,t,"SpatialEntity",oe.spatialEntity);return n.object&&(n.object=se(e,n.object)),e.forSubjects(e=>n.entityId=e.id,Y.spatialEntity,t,null),n}function le(e,t){const n=t;let r;switch(n.translation_units){case"centimeter":r=.01;break;case"millimeter":r=.001;break;case"meter":default:r=1}const i=[n.x_translation,n.y_translation,n.z_translation].map(e=>e*r),o=[n.x_rotation,n.y_rotation,n.z_rotation].map(y),a=W()(Object(q.fromEuler)(o[1],o[0],o[2],"XYZ").toVector()),s=[n.x_scaling,n.y_scaling,n.z_scaling];return e.translate(i).rotateXYZ(a).scale(s)}class he{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new G.DirectedGraph;const e=this.db.store;e.forSubjects(t=>{this.addSpatialObjectReference(se(e,t.id))},X.type,ee.SpatialObjectReference,null),e.forSubjects(t=>{this.addSpatialEntity(ce(e,t.id))},X.type,ee.SpatialEntity,null),e.forSubjects(t=>{this.addSpatialPlacement(function(e,t){const n=ae(e,t,"SpatialPlacement",oe.spatialPlacement);return n.source&&(n.source=ce(e,n.source)),n.target&&(n.target=ce(e,n.target)),n}(e,t.id))},X.type,ee.SpatialPlacement,null)}addSpatialEntity(e){this.graph.mergeNode(e["@id"],{type:"SpatialEntity",object:e})}addSpatialObjectReference(e){this.graph.mergeNode(e["@id"],{type:"SpatialObjectReference",object:e})}addSpatialPlacement(e){this.graph.mergeDirectedEdge(e.source["@id"],e.target["@id"],{type:"SpatialPlacement",placement:e})}getTransformationMatrix(e,t){if(e===t)return new U;if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const n=new U,r=V()(this.graph,e,t);if(r&&r.length>0){r.reverse();let e="";for(const t of r)e&&le(n,this.graph.getEdgeAttribute(t,e,"placement")),e=t;return n}}}class de{constructor(e){this.db=e}getSpatialEntity(e){return ce(this.db.store,e)}getExtractionSets(e){return function(e,t){return Object(H.sortBy)(e.getSubjects(ee.spatialEntity.extraction_set_for,t,null).map(t=>ue(e,t.id)),["rui_rank"])}(this.db.store,e)}getExtractionSet(e){return ue(this.db.store,e)}getAnatomicalStructures(e){return function(e,t){return Object(H.sortBy)(e.getSubjects(ee.spatialEntity.reference_organ,t,null).map(t=>ce(e,t.id)).filter(e=>e["@id"]!==t),["rui_rank"])}(this.db.store,e)}getReferenceOrgans(){return function(e){const t=[];return e.forEach(n=>{n.subject.id===n.object.id&&t.push(ce(e,n.subject.id))},null,ee.spatialEntity.reference_organ,null,null),Object(H.sortBy)(t,["rui_rank"])}(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=ee.spatial.Male.id;break;case"Female":t=ee.spatial.Female.id;break;case"Both":default:t=ee.spatial.BothSexes.id}return this.getSpatialEntity(t)}getReferenceOrganSets(e){let t;switch(null==e?void 0:e.sex){case"Male":t=ee.spatial.MaleOrgans.id;break;case"Female":t=ee.spatial.FemaleOrgans.id;break;case"Both":default:t=ee.spatial.FemaleOrgans.id}return[this.getSpatialEntity(t)]}getReferenceSceneNodes(e){const t=this.getSpatialEntity(ee.spatial.Body.id),n=this.getReferenceBody(e),r=(null==e?void 0:e.ontologyTerms)||[],i={body:0===r.indexOf(re.body.id),kidney:0===r.indexOf(re.kidney.id),right_kidney:0===r.indexOf(re.right_kidney.id),left_kidney:0===r.indexOf(re.left_kidney.id),spleen:0===r.indexOf(re.spleen.id)};let o=[this.getSceneNode(n,t,{unpickable:!0,color:[255,255,255,255]}),...this.getReferenceOrganSets(e).map(e=>this.getSceneNode(e,n,{unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!0,color:[255,255,255,255]})),this.getSceneNode(this.getSpatialEntity(ee.x("VHRightKidney").id),n,{color:[255,255,255,1],unpickable:i.kidney||i.right_kidney,zoomToOnLoad:i.right_kidney}),this.getSceneNode(this.getSpatialEntity(ee.x("VHLeftKidney").id),n,{color:[255,255,255,1],unpickable:i.kidney||i.left_kidney,zoomToOnLoad:i.left_kidney}),this.getSceneNode(this.getSpatialEntity(ee.x("VHSpleen").id),n,{color:[255,255,255,1],unpickable:i.spleen,zoomToOnLoad:i.spleen})];return(null==e?void 0:e.debug)&&(o=o.concat([this.getSceneNode(this.getSpatialEntity(ee.x("VHRightKidney").id),t,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(ee.x("VHLeftKidney").id),t,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(ee.x("VHSpleenCC1").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(ee.x("VHSpleenCC2").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(ee.x("VHSpleenCC3").id),t,{color:[0,255,0,127.5],wireframe:!0})])),o.filter(e=>void 0!==e)}getEntitySceneNodes(e){const t=this.getReferenceBody(e),n=new Set(null==e?void 0:e.highlightedEntities);return this.db.getSpatialEntities(e).map(e=>this.getSceneNode(e,t,{color:n.has(e.entityId)?[10,10,229,229.5]:[255,255,255,229.5]})).filter(e=>void 0!==e)}getSceneNode(e,t,n={}){var r,i,o;const a=e.object&&(null===(r=e.object.file_format)||void 0===r?void 0:r.startsWith("model/gltf"));let s=this.db.graph.getTransformationMatrix(a&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(s){if(a)s=(new U).rotateX(y(90)).multiplyLeft(s);else{let t;switch(e.dimension_units){case"centimeter":t=.01;break;case"millimeter":t=.001;break;case"meter":default:t=1}const n=[e.x_dimension,e.y_dimension,e.z_dimension].map(e=>e*t/2);s.scale(n)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId||void 0,representation_of:e.representation_of||void 0,scenegraph:a?null===(i=e.object)||void 0===i?void 0:i.file:void 0,scenegraphNode:a?null===(o=e.object)||void 0===o?void 0:o.file_subpath:void 0,transformMatrix:s,tooltip:e.label},n)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}function fe(e){return"string"==typeof e?parseFloat(e.replace(/[^\d\-\.]/g,"")):e}function pe(e){const{x:t,y:n,z:r}=e;return{x:fe(t),y:fe(n),z:fe(r)}}const ge="https://entity-api.hubmapconsortium.org/entities/",ye=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","","DR1-VU:","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),ve={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},me=function(){const e={};return Object.entries(re).forEach(([t,n])=>e[t]=n.id),e}(),be={BL:[me.body,me.bladder],RK:[me.body,me.kidney,me.right_kidney],LK:[me.body,me.kidney,me.left_kidney],HT:[me.body,me.heart],LI:[me.body,me.colon],SI:[me.body,me.small_instestine],LL:[me.body,me.lung,me.left_lung],RL:[me.body,me.lung,me.right_lung],LY:[me.body,me.lymph_node],SP:[me.body,me.spleen],TH:[me.body,me.thymus],UR:[me.body,me.ureter],LV:[me.body,me.liver],OT:[me.body]},_e={BL:"Bladder",RK:"Right Kidney",LK:"Left Kidney",HT:"Heart",LI:"Large Intestine",SI:"Small Intestine",LL:"Left Lung",RL:"Right Lung",LY:"Lymph Node",SP:"Spleen",TH:"Thymus",UR:"Ureter",LV:"Liver",OT:"Other Organ"};class we{constructor(e,t="",n="",r){var i,o,a,s,u;this.data=e,this.assetsApi=t,this.id=this.data.uuid,this.entityType=this.data.entity_type,this.ancestors=this.data.ancestors||[],this.descendants=this.data.descendants||[],this.donor="Donor"===this.entityType?e:this.ancestors.find(e=>"Donor"===e.entity_type),this.organSample="Sample"===this.entityType&&"organ"===e.specimen_type?e:this.ancestors.find(e=>"Sample"===e.entity_type&&"organ"===e.specimen_type);const c=(this.donor.description||"").toLowerCase();let l;c.includes("female")?l="Female":c.includes("male")&&(l="Male");const h=c.match(/age\ ([0-9]+)/);let d,f,p;h&&(d=Object(H.toNumber)(h[1]));for(const E of Object(H.get)(this.donor,"metadata.organ_donor_data",[]))"Feminine gender"===E.preferred_term||"Female"===E.preferred_term?l="Female":"Masculine gender"===E.preferred_term||"Male"===E.preferred_term?l="Male":"Current chronological age"===E.preferred_term||"Age"===E.preferred_term?d=Object(H.toNumber)(E.data_value):"Body mass index"===E.preferred_term?f=Object(H.toNumber)(E.data_value):"Racial group"!==E.grouping_concept_preferred_term&&"Race"!==E.grouping_concept_preferred_term||(p=E.preferred_term);let g="";l&&d&&(g+=`${l}, Age ${d}`,f&&(g+=`, BMI ${f.toFixed(1)}`)),this.age=d,this.sex=l,this.bmi=f,this.ethnicity=p,this.label=g,this.doi=e.display_doi,this.description=e.description;const y=this.groupUUID=e.group_uuid||this.donor.group_uuid;this.groupName=ve[y]||e.group_name||this.donor.group_name,this.organName=[e,...this.ancestors,...this.descendants].map(e=>e.organ).find(e=>!!e),this.ontologyTerms=be[this.organName]||[me.body],this.organ=this.ontologyTerms[this.ontologyTerms.length-1],this.protocolUrl=this.donor.protocol_url;let v=e.rui_location||this.ancestors[0].rui_location;if(v)if("string"==typeof v&&(v=JSON.parse(v)),v.alignment_id){let t;"07a29e4c-ed43-11e8-b56a-0e8017bdda58"===y&&(v=function(e,t){e=function(e){return e=Object.assign(Object.assign({},e),{tissue_object_size:pe(e.tissue_object_size),tissue_object_rotation:pe(e.tissue_object_rotation),tissue_position_mass_point:pe(e.tissue_position_mass_point)}),Object.entries(e).forEach(([t,n])=>{"string"==typeof n&&Object(H.set)(e,t,n.replace(/^_|mm_$|_$/g,""))}),e}(e);const n=t.lab_tissue_sample_id||"";return n.match(/CC1|CC\-1/)?(e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleenCC1",e.tissue_position_mass_point={x:29.95+e.tissue_position_mass_point.x,y:40.7-60,z:0},e.tissue_object_size.x=10):n.match(/CC2|CC\-2/)?(e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleenCC2",e.tissue_position_mass_point={x:31.5+e.tissue_position_mass_point.x,y:-19.9,z:0},e.tissue_object_size.x=10):n.match(/CC3|CC\-3/)?(e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleenCC3",e.tissue_position_mass_point={x:29.35+e.tissue_position_mass_point.x,y:-16.6,z:0},e.tissue_object_size.x=10):e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleen",e}(v,e)),this.organ===me.left_kidney?t=ee.x("VHLeftKidney").id:this.organ===me.right_kidney&&(t=ee.x("VHRightKidney").id),this.spatialEntity=function(e,t,n){let r;n?r=n:"uuid-1234-5678"===e.reference_organ_id?r=ee.x("VHKidney").id:e.reference_organ_id&&(r=e.reference_organ_id),(null==r?void 0:r.endsWith("Kidney"))&&(e=function(e){return Object.assign(Object.assign({},e),{tissue_position_mass_point:{x:e.tissue_position_mass_point.x-30,y:e.tissue_position_mass_point.y-50,z:e.tissue_position_mass_point.z-30}})}(e));const i=e.tissue_object_size,o=e.tissue_object_rotation,a=e.tissue_position_mass_point;return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":"http://purl.org/ccf/0.5/"+e.alignment_id,"@type":"SpatialEntity",label:t||void 0,creator:`${e.alignment_operator_first_name} ${e.alignment_operator_last_name}`,creator_first_name:e.alignment_operator_first_name,creator_last_name:e.alignment_operator_last_name,creation_date:e.alignment_datetime,ccf_annotations:[],x_dimension:i.x,y_dimension:i.y,z_dimension:i.z,dimension_units:"millimeter",placement:{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":"http://purl.org/ccf/0.5/"+e.alignment_id+"_placement","@type":"SpatialPlacement",target:r,placement_date:e.alignment_datetime,x_scaling:1,y_scaling:1,z_scaling:1,scaling_units:"ratio",x_rotation:o.x,y_rotation:o.y,z_rotation:o.z,rotation_order:"XYZ",rotation_units:"degree",x_translation:a.x,y_translation:a.y,z_translation:a.z,translation_units:"millimeter"}}}(v,"SpatialEntity for "+this.label,t)}else v["@id"]&&(this.spatialEntity=v);let m=[];const b=[];for(const E of[e,...this.ancestors,...this.descendants]){const e=Object(H.get)(E,"metadata.files",[]).filter(e=>/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)).filter(e=>!/(multilayer\.ome\.tif|\_ac\.ome\.tif)/.test(e.rel_path)).filter(e=>"73bb26e4-ed43-11e8-8f19-0a7c1eab007a"!==y||ye.has(e.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(e=>`${this.assetsApi}/${E.uuid}/${e.rel_path}`+(r?`?token=${r}`:""));e.length>0&&(m=m.concat(e),b.push(ge+E.uuid))}m.length>0&&(this.images=m,this.imageProviders=b);const _=new Map,w=new Map;let x=!1;for(const E of[...this.ancestors,e,...this.descendants]){(E.data_types||[]).forEach(e=>_.set(e,E));const e=null===(o=null===(i=E.metadata)||void 0===i?void 0:i.metadata)||void 0===o?void 0:o.assay_type;e&&w.set(e,E),"yes"===E.contains_human_genetic_sequences&&(x=!0)}this.containsHumanGeneticSequences=x,this.dataTypes=[..._.keys()].sort(),this.assayTypes=[...w.keys()].sort();const S=[...this.dataTypes,...this.assayTypes].map(e=>e.toLowerCase()).join("|");if(-1!==S.indexOf("10x")?(this.thumbnailUrl="assets/icons/ico-bulk-10x.svg",this.spatialOrBulk="Bulk"):-1!==S.indexOf("af")?(this.thumbnailUrl="assets/icons/ico-spatial-af.svg",this.spatialOrBulk="Spatial"):-1!==S.indexOf("codex")?(this.thumbnailUrl="assets/icons/ico-spatial-codex.svg",this.spatialOrBulk="Spatial"):-1!==S.indexOf("imc")?(this.thumbnailUrl="assets/icons/ico-spatial-imc.svg",this.spatialOrBulk="Spatial"):-1!==S.indexOf("lc")&&-1===S.indexOf("af")?(this.thumbnailUrl="assets/icons/ico-bulk-lc.svg",this.spatialOrBulk="Bulk"):(this.thumbnailUrl="assets/icons/ico-unknown.svg",this.spatialOrBulk="Bulk"),this.portalUrl=`${n}browse/sample/${this.id}`,m.length>0&&-1===S.indexOf("codex")){if(this.resultUrl=m[0],this.resultType="image_viewer",this.thumbnailUrl="assets/histology3.jpg","73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===y){const e=this.resultUrl.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");ye.has(e)&&(this.thumbnailUrl=`assets/thumbnails/DR1-VU/${e}`)}}else{if(_.has("codex_cytokit")){const e=null===(a=_.get("codex_cytokit"))||void 0===a?void 0:a.uuid;this.resultUrl=`${n}browse/dataset/${e}#visualization`}else if(_.has("salmon_rnaseq_10x")){const e=null===(s=_.get("salmon_rnaseq_10x"))||void 0===s?void 0:s.uuid;this.resultUrl=`${n}browse/dataset/${e}#visualization`}else if(_.has("image_pyramid")){const e=null===(u=_.get("image_pyramid"))||void 0===u?void 0:u.uuid;this.resultUrl=`${n}browse/dataset/${e}#visualization`}else this.resultUrl=this.portalUrl;this.resultType="external_link"}}toJsonLd(){var e;const t=this.data;return Object.assign(Object.assign({"@id":ge+this.id,"@type":"Entity"},Object(H.omit)(this,["data","donor","organ_sample","organSample","ancestors","descendants","assetsApi"])),{donor:ge+this.donor.uuid,shortInfo0:this.doi,shortInfo1:this.groupName,shortInfo2:t.description||this.donor.description,downloadUrl:this.portalUrl,downloadTooltip:"View in the HuBMAP Data Portal",organName:_e[this.organName]||this.organName,sex:this.sex,age:this.age,bmi:null===(e=this.bmi)||void 0===e?void 0:e.toFixed(1),ethnicity:this.ethnicity,authorGroup:this.groupName,creator:t.created_by_user_displayname,creation_date:new Date(t.create_timestamp||0).toLocaleDateString(),modified_date:new Date(t.last_modified_timestamp||0).toLocaleDateString(),donor_id:this.donor.display_doi,organ_id:this.organSample.display_doi,tissue_id:this.doi,specimen_type:this.data.specimen_type,data_types:this.dataTypes.join(", "),assay_types:this.assayTypes.join(", "),spatial_bulk:this.spatialOrBulk,contains_sequence:this.containsHumanGeneticSequences?"Yes":"No",description:t.description||this.donor.description})}}function xe(e,t){return n=>e.has(n.id)?t.add(n.id):void 0}const Se={[Y.id.id]:"id",[Y.x("label").id]:"label",[Y.x("organName").id]:"organName"},Ee={[Y.sex.id]:"Sex",[Y.age.id]:"Age",[Y.x("bmi").id]:"BMI",[Y.x("ethnicity").id]:"Ethnicity",[Y.groupName.id]:"Author Group",[Y.x("creator").id]:"Creator",[Y.x("creation_date").id]:"Date Created",[Y.x("modified_date").id]:"Date Modified",[Y.x("donor_id").id]:"HuBMAP Donor ID",[Y.x("organ_id").id]:"HuBMAP Organ ID",[Y.x("tissue_id").id]:"HUBMAP Tissue ID",[Y.x("specimen_type").id]:"Specimen Type",[Y.x("data_types").id]:"Data Type(s)",[Y.x("assay_types").id]:"Assay(s)",[Y.x("spatial_bulk").id]:"Spatial/Bulk",[Y.x("contains_sequence").id]:"Contains Sequence",[Y.x("description").id]:"Description"},je={[Y.id.id]:"id",[Y.x("label").id]:"label",[Y.x("shortInfo0").id]:["shortInfo","0"],[Y.x("shortInfo1").id]:["shortInfo","1"],[Y.x("shortInfo2").id]:["shortInfo","2"],[Y.x("thumbnailUrl").id]:"thumbnailUrl",[Y.x("downloadUrl").id]:"downloadUrl",[Y.x("downloadTooltip").id]:"downloadTooltip",[Y.x("resultUrl").id]:"resultUrl",[Y.x("resultType").id]:"resultType"},Ne={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"},Ie=Symbol("Comlink.proxy"),Te=Symbol("Comlink.endpoint"),Ae=Symbol("Comlink.releaseProxy"),ke=Symbol("Comlink.thrown"),Oe=e=>"object"==typeof e&&null!==e||"function"==typeof e,Re=new Map([["proxy",{canHandle:e=>Oe(e)&&e[Ie],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Le(e,t),[n,[n]]},deserialize:e=>(e.start(),Ce(e,[],void 0))}],["throw",{canHandle:e=>Oe(e)&&ke in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function Le(e,t=self){t.addEventListener("message",function n(r){if(!r||!r.data)return;const{id:i,type:o,path:a}=Object.assign({path:[]},r.data),s=(r.data.argumentList||[]).map(Ue);let u;try{const t=a.slice(0,-1).reduce((e,t)=>e[t],e),n=a.reduce((e,t)=>e[t],e);switch(o){case 0:u=n;break;case 1:t[a.slice(-1)[0]]=Ue(r.data.value),u=!0;break;case 2:u=n.apply(t,s);break;case 3:u=function(e){return Object.assign(e,{[Ie]:!0})}(new n(...s));break;case 4:{const{port1:t,port2:n}=new MessageChannel;Le(e,n),u=function(e,t){return Fe.set(e,t),e}(t,[t])}break;case 5:u=void 0}}catch(c){u={value:c,[ke]:0}}Promise.resolve(u).catch(e=>({value:e,[ke]:0})).then(e=>{const[r,a]=Be(e);t.postMessage(Object.assign(Object.assign({},r),{id:i}),a),5===o&&(t.removeEventListener("message",n),Me(t))})}),t.start&&t.start()}function Me(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function De(e){if(e)throw new Error("Proxy has been released and is not useable")}function Ce(e,t=[],n=function(){}){let r=!1;const i=new Proxy(n,{get(n,o){if(De(r),o===Ae)return()=>Ge(e,{type:5,path:t.map(e=>e.toString())}).then(()=>{Me(e),r=!0});if("then"===o){if(0===t.length)return{then:()=>i};const n=Ge(e,{type:0,path:t.map(e=>e.toString())}).then(Ue);return n.then.bind(n)}return Ce(e,[...t,o])},set(n,i,o){De(r);const[a,s]=Be(o);return Ge(e,{type:1,path:[...t,i].map(e=>e.toString()),value:a},s).then(Ue)},apply(n,i,o){De(r);const a=t[t.length-1];if(a===Te)return Ge(e,{type:4}).then(Ue);if("bind"===a)return Ce(e,t.slice(0,-1));const[s,u]=Pe(o);return Ge(e,{type:2,path:t.map(e=>e.toString()),argumentList:s},u).then(Ue)},construct(n,i){De(r);const[o,a]=Pe(i);return Ge(e,{type:3,path:t.map(e=>e.toString()),argumentList:o},a).then(Ue)}});return i}function Pe(e){const t=e.map(Be);return[t.map(e=>e[0]),(n=t.map(e=>e[1]),Array.prototype.concat.apply([],n))];var n}const Fe=new WeakMap;function Be(e){for(const[t,n]of Re)if(n.canHandle(e)){const[r,i]=n.serialize(e);return[{type:3,name:t,value:r},i]}return[{type:0,value:e},Fe.get(e)||[]]}function Ue(e){switch(e.type){case 3:return Re.get(e.name).deserialize(e.value);case 0:return e.value}}function Ge(e,t,n){return new Promise(r=>{const i=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.addEventListener("message",function t(n){n.data&&n.data.id&&n.data.id===i&&(e.removeEventListener("message",t),r(n.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)})}Le(new class{constructor(e=Ne){this.options=e,this.store=new i.Store,this.graph=new he(this),this.scene=new de(this)}connect(e){return r(this,void 0,void 0,function*(){return e&&(this.options=e),this.initializing||(this.initializing=this.doConnect()),yield this.initializing,this.store.size>0})}doConnect(){return r(this,void 0,void 0,function*(){const e=[];this.options.ccfOwlUrl.endsWith(".n3")?e.push(Object(i.addN3ToStore)(this.options.ccfOwlUrl,this.store)):e.push(Object(i.addRdfXmlToStore)(this.options.ccfOwlUrl,this.store)),this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith(".jsonld")?e.push(Object(i.addJsonLdToStore)(this.options.hubmapDataUrl,this.store)):e.push(function(e,t,n,o,a="",s=""){return r(this,void 0,void 0,function*(){let r;if("static"===n)r=yield fetch(t).then(e=>e.ok?e.json():void 0).catch(()=>{});else if("search-api"===n){const e={"Content-type":"application/json"};o&&o.length>0&&(e.Authorization=`Bearer ${o}`),r=yield fetch(t,{method:"POST",headers:e,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:{exists:{field:"rui_location"}}})}).then(e=>e.ok?e.json():void 0).catch(()=>{})}r?yield Object(i.addJsonLdToStore)(function(e,t="",n="",r,i=!1){const o=Object(H.get)(e,"hits.hits",[]).map(e=>Object(H.get)(e,"_source",{}));return i&&function(e){const t=[];for(const n of Object(H.sortBy)(e.concat(),["groupName","data.hubmap_display_id"])){const e={UUID:n.id,"Group Name":n.groupName,"Entity Type":n.entityType,"Sample ID":n.data.hubmap_display_id,"Donor ID":n.donor.display_doi,"Organ Sample ID":n.organSample.display_doi,"Has Datasets":"No","Has TIFFs":"","Has Thumbnails":"","Dataset ID":"","Data Type(s)":n.dataTypes.join("|"),"Assay Type(s)":n.assayTypes.join("|"),TIFFs:"",Thumbnails:""};t.push(e);for(const r of n.descendants.filter(e=>"Dataset"===e.entity_type)){e["Has Datasets"]="Yes";const i=Object(H.get)(r,"metadata.files",[]).filter(e=>/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)).map(e=>e.rel_path).map(e=>e.split("/").slice(-1)[0].split("?")[0]),o=[];if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===n.groupUUID)for(const t of i){const n=t.replace(".ome.tif","_thumbnail.png");ye.has(n)&&(o.push(n),e["Has Thumbnails"]="Yes")}i.length>0&&(e["Has TIFFs"]="Yes");const a=Object.assign({},e,{UUID:"","Entity Type":r.entity_type,"Dataset ID":r.display_doi,"Data Type(s)":(r.data_types||[]).join("|"),"Assay Type(s)":Object(H.get)(r,"metaata.metadata.assay_type",""),TIFFs:i.join("|"),Thumbnails:o.join("|")});t.push(a)}}console.log(t)}(o.map(e=>new we(e,t,n,r))),{"@context":{"@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ontologyTerms:{"@type":"@id"},ancestors:{"@type":"@id"},descendants:{"@type":"@id"},organ:{"@type":"@id"},images:{"@id":"hasImage","@type":"@id"},imageProviders:{"@id":"hasImageProvider","@type":"@id"}},"@graph":o.map(e=>new we(e,t,n,r).toJsonLd())}}(r,a,s,o),e):console.warn(`Unable to load ${t} as HuBMAP Data`)})}(this.store,this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl))),e.push(Object(i.addJsonLdToStore)("assets/kpmp/data/rui_locations.jsonld",this.store).catch(e=>console.log("Couldn't locate KPMP data."))),yield Promise.all(e),yield new Promise(e=>setTimeout(e,500)),this.graph.createGraph()})}getIds(e={}){return function(e,t){var n,r,o,a;let s=function(e){const t=new Set;return e.forSubjects(e=>t.add(e.id),Y.id,null,null),t}(e);if(s.size>0&&(!0===t.hasSpatialEntity||!1===t.hasSpatialEntity)&&(s=function(e,t,n){const r=new Set;if(e.forSubjects(xe(t,r),Y.spatialEntity,null,null),!n){const e=new Set;return t.forEach(t=>r.has(t)?void 0:e.add(t)),e}return r}(e,s,t.hasSpatialEntity)),s.size>0&&("Male"===t.sex||"Female"===t.sex)&&(s=function(e,t,n){const r=new Set;return e.forSubjects(xe(t,r),Y.sex,Y[n],null),r}(e,s,t.sex)),s.size>0&&(null===(n=t.tmc)||void 0===n?void 0:n.length)>0&&(s=function(e,t,n){const r=new Set;for(const o of n){const n=i.DataFactory.literal(o);e.forSubjects(xe(t,r),Y.groupName,n,null)}return r}(e,s,t.tmc)),s.size>0&&(null===(r=t.ontologyTerms)||void 0===r?void 0:r.length)>0&&(s=function(e,t,n){const r=new Set;for(const o of n){const n=i.DataFactory.namedNode(o);e.forSubjects(xe(t,r),Y.ontologyTerms,n,null)}return r}(e,s,t.ontologyTerms)),s.size>0&&2===(null===(o=t.ageRange)||void 0===o?void 0:o.length)&&Object(H.isFinite)(t.ageRange[0])&&Object(H.isFinite)(t.ageRange[1])){const n=Math.max(...t.ageRange),r=Math.min(...t.ageRange);1===r&&110===n||(s=function(e,t,n,r){const i=new Set;return e.some(e=>{if(t.has(e.subject.id)){const t=Object(J.fromRdf)(e.object);t>=n&&t<=r&&i.add(e.subject.id)}return!1},null,Y.age,null,null),i}(e,s,r,n))}if(s.size>0&&2===(null===(a=t.bmiRange)||void 0===a?void 0:a.length)&&Object(H.isFinite)(t.bmiRange[0])&&Object(H.isFinite)(t.bmiRange[1])){const n=Math.max(...t.bmiRange),r=Math.min(...t.bmiRange);13===r&&83===n||(s=function(e,t,n,r){const i=new Set;return e.some(e=>{if(t.has(e.subject.id)){const t=Object(J.fromRdf)(e.object);t>=n&&t<=r&&i.add(e.subject.id)}return!1},null,Y.bmi,null,null),i}(e,s,r,n))}return s}(this.store,e)}get(e){return this.store.getQuads(i.DataFactory.namedNode(e),null,null,null)}search(e={}){return[...this.getIds(e)].map(e=>this.get(e))}getSpatialEntities(e){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(e=>function(e,t){const n=e.getObjects(i.DataFactory.namedNode(t),Y.spatialEntity,null);return n.length>0?ce(e,n[0].id):void 0}(this.store,e))}getListResults(e){return r(this,void 0,void 0,function*(){e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0});const t=new Set(e.highlightedEntities);return[...this.getIds(e)].map(e=>function(e,t){const n={"@id":t,"@type":"ListResult"};return e.some(e=>{const t=je[e.predicate.id];if(t){const r="Literal"===e.object.termType?Object(J.fromRdf)(e.object):e.object.id;Object(H.set)(n,t,r)}return!1},i.DataFactory.namedNode(t),null,null,null),n}(this.store,e)).map(e=>Object.assign(e,{highlighted:t.has(e["@id"])})).sort((e,t)=>(e.highlighted?0:1)-(t.highlighted?0:1))})}getAggregateResults(e){return r(this,void 0,void 0,function*(){return function(e,t){const n=new Set;t.some(t=>(e.has(t.subject.id)&&n.add(t.object.id),!1),null,Y.groupUUID,null,null);const r=new Set;t.some(t=>(e.has(t.subject.id)&&r.add(t.object.id),!1),null,Y.donor,null,null);const i=new Set;return t.forSubjects(t=>{e.has(t.id)&&i.add(t.id)},Y.spatialEntity,null,null),Object.entries({Centers:n.size,Donors:r.size,Samples:i.size}).map(([e,t])=>({label:e,count:t}))}(this.getIds(e),this.store)})}getOntologyTermOccurences(e){return r(this,void 0,void 0,function*(){return function(e,t){const n={};return t.some(t=>(e.has(t.subject.id)&&(n[t.object.id]=1+(n[t.object.id]||0)),!1),null,Y.ontologyTerms,null,null),n}(this.getIds(e),this.store)})}getImageViewerData(e){return r(this,void 0,void 0,function*(){return function(e,t){const n={"@id":e,"@type":"ImageViewerData"},r={};return t.some(e=>{const t=Se[e.predicate.id];if(Ee[e.predicate.id]){const t="Literal"===e.object.termType?Object(J.fromRdf)(e.object):e.object.id;r[e.predicate.id]=""+t}if(t){const r="Literal"===e.object.termType?Object(J.fromRdf)(e.object):e.object.id;Object(H.set)(n,t,r)}return!1},i.DataFactory.namedNode(e),null,null,null),n.metadata=Object.entries(Ee).map(([e,t])=>({label:t,value:r[e]})).filter(e=>e.value),n}(e,this.store)})}getScene(e){return r(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}})},JFj6:function(e,t,n){e.exports=function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){return i(t[a][1][e]||e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o=!1,a=0;a0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var i=[],o=t;o>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);var a;return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],11:[function(e,t,n){},{}],12:[function(e,t,n){(function(t){"use strict";var r=e("base64-js"),i=e("ieee754");function o(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=new Uint8Array(e);return n.__proto__=t.prototype,n}function t(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,n)}function a(e,n,r){if("string"==typeof e)return function(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!t.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var r=0|h(e,n),i=o(r),a=i.write(e,n);return a!==r&&(i=i.slice(0,a)),i}(e,n);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer))return function(e,n,r){if(n<0||e.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function h(e,n){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var o=!1;;)switch(n){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(e).length;default:if(o)return i?-1:M(e).length;n=(""+n).toLowerCase(),o=!0}}function d(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return E(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return x(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function p(e,n,r,i,o){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof n&&(n=t.from(n,i)),t.isBuffer(n))return 0===n.length?-1:g(e,n,r,i,o);if("number"==typeof n)return n&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,n,r):Uint8Array.prototype.lastIndexOf.call(e,n,r):g(e,[n],r,i,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var h=!0,d=0;di&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a>8,i.push(n%256),i.push(r);return i}(t,e.length-n),e,n,r)}function x(e,t,n){return r.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function S(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(r.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;ri)&&(n=i);for(var o="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function A(e,n,r,i,o,a){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>o||ne.length)throw new RangeError("Index out of range")}function k(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(e,t,n,r,o){return t=+t,n>>>=0,o||k(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function R(e,t,n,r,o){return t=+t,n>>>=0,o||k(e,0,n,8),i.write(e,t,n,r,52,8),n+8}n.Buffer=t,n.SlowBuffer=function(e){return+e!=e&&(e=0),t.alloc(+e)},n.INSPECT_MAX_BYTES=50,n.kMaxLength=2147483647,(t.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(e,t,n){return a(e,t,n)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(e,t,n){return function(e,t,n){return s(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},t.allocUnsafe=function(e){return u(e)},t.allocUnsafeSlow=function(e){return u(e)},t.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==t.prototype},t.compare=function(e,n){if(P(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),P(n,Uint8Array)&&(n=t.from(n,n.offset,n.byteLength)),!t.isBuffer(e)||!t.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===n)return 0;for(var r=e.length,i=n.length,o=0,a=Math.min(r,i);ot&&(e+=" ... "),""},t.prototype.compare=function(e,n,r,i,o){if(P(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===n&&(n=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),n<0||r>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&n>=r)return 0;if(i>=o)return-1;if(n>=r)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(i>>>=0),s=(r>>>=0)-(n>>>=0),u=Math.min(a,s),c=this.slice(i,o),l=e.slice(n,r),h=0;h>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":return m(this,e,t,n);case"latin1":case"binary":return b(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},t.prototype.slice=function(e,n){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(n=void 0===n?r:~~n)<0?(n+=r)<0&&(n=0):n>r&&(n=r),n>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},t.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},t.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},t.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},t.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);A(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},t.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);A(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},t.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},t.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,n){return O(this,e,t,!0,n)},t.prototype.writeFloatBE=function(e,t,n){return O(this,e,t,!1,n)},t.prototype.writeDoubleLE=function(e,t,n){return R(this,e,t,!0,n)},t.prototype.writeDoubleBE=function(e,t,n){return R(this,e,t,!1,n)},t.prototype.copy=function(e,n,r,i){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),n>=e.length&&(n=e.length),n||(n=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-n=0;--a)e[a+n]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),n);return o},t.prototype.fill=function(e,n,r,i){if("string"==typeof e){if("string"==typeof n?(i=n,n=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var o=e.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(e=o)}}else"number"==typeof e&&(e&=255);if(n<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=n;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function D(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function C(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function F(e){return e!=e}}).call(this,e("buffer").Buffer)},{"base64-js":10,buffer:12,ieee754:17}],13:[function(e,t,n){var r=Object.create||function(e){var t=function(){};return t.prototype=e,new t},i=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return n},o=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function a(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=r(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._maxListeners=void 0;var s,u=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),s=0===c.x}catch(x){s=!1}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function h(e,t,n){if(t)e.call(n);else for(var r=e.length,i=w(e,r),o=0;o0&&s.length>o){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else s=a[t]=n,++e._eventsCount;return e}function v(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t1&&(t=arguments[1]),t instanceof Error)throw t;var u=new Error('Unhandled "error" event. ('+t+")");throw u.context=t,u}if(!(n=a[e]))return!1;var c="function"==typeof n;switch(r=arguments.length){case 1:h(n,c,this);break;case 2:d(n,c,this,arguments[1]);break;case 3:f(n,c,this,arguments[1],arguments[2]);break;case 4:p(n,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,o=a;break}if(o<0)return this;0===o?n.shift():function(e,t){for(var n=t,r=n+1,i=e.length;r=0;o--)this.removeListener(e,t[o]);return this},a.prototype.listeners=function(e){return b(this,e,!0)},a.prototype.rawListeners=function(e){return b(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):_.call(e,t)},a.prototype.listenerCount=_,a.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],14:[function(e,t,n){(function(t,r){var i=e("process/browser.js").nextTick,o=Function.prototype.apply,a=Array.prototype.slice,s={},u=0;function c(e,t){this._id=e,this._clearFn=t}n.setTimeout=function(){return new c(o.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new c(o.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof t?t:function(e){var t=u++,r=!(arguments.length<2)&&a.call(arguments,1);return s[t]=!0,i(function(){s[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof r?r:function(e){delete s[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":62,timers:14}],15:[function(e,t,n){"use strict";t.exports=function(e){return function e(t){if(null===t||"object"!=typeof t||null!=t.toJSON)return JSON.stringify(t);if(Array.isArray(t)&&0===t.length)return"[]";if(Array.isArray(t)&&1===t.length)return"["+e(t[0])+"]";if(Array.isArray(t))return"["+t.reduce((t,n,r)=>(t=1===r?e(t):t)+","+e(n))+"]";const n=Object.keys(t);return 0===n.length?"{}":1===n.length?"{"+e(n[0])+":"+e(t[n[0]])+"}":"{"+n.sort().reduce((n,r,i)=>(n=1===i?e(n)+":"+e(t[n]):n)+","+e(r)+":"+e(t[r]))+"}"}(e)}},{}],16:[function(e,t,n){(function(e){function t(e){return Object.prototype.toString.call(e)}n.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},n.isBoolean=function(e){return"boolean"==typeof e},n.isNull=function(e){return null===e},n.isNullOrUndefined=function(e){return null==e},n.isNumber=function(e){return"number"==typeof e},n.isString=function(e){return"string"==typeof e},n.isSymbol=function(e){return"symbol"==typeof e},n.isUndefined=function(e){return void 0===e},n.isRegExp=function(e){return"[object RegExp]"===t(e)},n.isObject=function(e){return"object"==typeof e&&null!==e},n.isDate=function(e){return"[object Date]"===t(e)},n.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},n.isFunction=function(e){return"function"==typeof e},n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},n.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":19}],17:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,h=n?i-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+h],h+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*u-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-p]|=128*g}},{}],18:[function(e,t,n){t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],19:[function(e,t,n){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],20:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],21:[function(e,t,n){"use strict";const{isArray:r,isObject:i,isString:o}=e("./types"),{asArray:a}=e("./util"),{prependBase:s}=e("./url"),u=e("./JsonLdError"),c=e("./ResolvedContext");function l(e){throw new u("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function h({context:e,base:t}){if(!e)return;const n=e["@context"];if(o(n))e["@context"]=s(t,n);else if(r(n))for(let r=0;r10)throw new u("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(a.has(t))throw new u("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let s,c;a.add(t);try{c=await n(t),s=c.document||null,o(s)&&(s=JSON.parse(s))}catch(l){throw new u("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:l})}if(!i(s))throw new u("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return s="@context"in s?{"@context":s["@context"]}:{"@context":{}},c.contextUrl&&(r(s["@context"])||(s["@context"]=[s["@context"]]),s["@context"].push(c.contextUrl)),{context:s,remoteDoc:c}}}},{"./JsonLdError":22,"./ResolvedContext":27,"./types":41,"./url":42,"./util":43}],22:[function(e,t,n){"use strict";t.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",n={}){super(e),this.name=t,this.message=e,this.details=n}}},{}],23:[function(e,t,n){"use strict";t.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},{}],24:[function(e,t,n){"use strict";t.exports=e("rdf-canonize").NQuads},{"rdf-canonize":73}],25:[function(e,t,n){"use strict";const{RDF_LANGSTRING:r,RDF_PLAIN_LITERAL:i,RDF_OBJECT:o,RDF_XML_LITERAL:a,XSD_STRING:s}=e("./constants");let u;u="undefined"!=typeof Node?Node:{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},t.exports=class{parse(t){const n={"@default":[]},c=t.getSubjects();for(let l=0;l{})})=>{if(i(n)){let r=[];for(let i=0;i1&&(I=Array.from(I).sort());const T=e;for(const t of I){const n=S.compactIri({activeCtx:T,iri:t,relativeTo:{vocab:!0}}),r=p(j,n,"@context");s(r)||(e=await y({activeCtx:e,localCtx:r,options:f,propagate:!1}))}const A=Object.keys(n).sort();for(const s of A){const d=n[s];if("@id"!==s)if("@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&"@included"!==s&&g(s)){const t=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});_(x,t,d)}else{if(!i(d))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===d.length){const t=S.compactIri({activeCtx:e,iri:s,value:d,relativeTo:{vocab:!0},reverse:b}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let r=x;n&&(E(e,n,f),o(x[n])||(x[n]={}),r=x[n]),_(r,t,d,{propertyIsArray:!0})}for(const t of d){const n=S.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:b}),r=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let d=x;r&&(E(e,r,f),o(x[r])||(x[r]={}),d=x[r]);const g=p(e,n,"@container")||[],y=l(t),v=u(t);let j;v?j=t["@list"]:y&&(j=t["@graph"]);let N=await S.compact({activeCtx:e,activeProperty:n,element:v||y?j:t,options:f,compactionMap:m});if(v){if(i(N)||(N=[N]),g.includes("@list")){_(d,n,N,{valueIsArray:!0,allowDuplicate:!0});continue}N={[S.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:N},"@index"in t&&(N[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(y)if(g.includes("@graph")&&(g.includes("@id")||g.includes("@index")&&h(t))){let r;d.hasOwnProperty(n)?r=d[n]:d[n]=r={};const i=(g.includes("@id")?t["@id"]:t["@index"])||S.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});_(r,i,N,{propertyIsArray:!f.compactArrays||g.includes("@set")})}else g.includes("@graph")&&h(t)?(i(N)&&N.length>1&&(N={"@included":N}),_(d,n,N,{propertyIsArray:!f.compactArrays||g.includes("@set")})):(i(N)&&1===N.length&&f.compactArrays&&(N=N[0]),N={[S.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:N},"@id"in t&&(N[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(N[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),_(d,n,N,{propertyIsArray:!f.compactArrays||g.includes("@set")}));else if(g.includes("@language")||g.includes("@index")||g.includes("@id")||g.includes("@type")){let r,i;if(d.hasOwnProperty(n)?r=d[n]:d[n]=r={},g.includes("@language"))c(N)&&(N=N["@value"]),i=t["@language"];else if(g.includes("@index")){const r=p(e,n,"@index")||"@index",o=S.compactIri({activeCtx:e,iri:r,relativeTo:{vocab:!0}});if("@index"===r)i=t["@index"],delete N[o];else{let e;if([i,...e]=w(N[r]||[]),a(i))switch(e.length){case 0:delete N[r];break;case 1:N[r]=e[0];break;default:N[r]=e}else i=null}}else if(g.includes("@id")){const t=S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=N[t],delete N[t]}else if(g.includes("@type")){const r=S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let o;switch([i,...o]=w(N[r]||[]),o.length){case 0:delete N[r];break;case 1:N[r]=o[0];break;default:N[r]=o}1===Object.keys(N).length&&"@id"in t&&(N=await S.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:f,compactionMap:m}))}i||(i=S.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),_(r,i,N,{propertyIsArray:g.includes("@set")})}else{const e=!f.compactArrays||g.includes("@set")||g.includes("@list")||i(N)&&0===N.length||"@list"===s||"@graph"===s;_(d,n,N,{propertyIsArray:e})}}}else{if((p(e,t,"@container")||[]).includes("@index"))continue;const n=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});_(x,n,d)}else{const n=await S.compact({activeCtx:e,activeProperty:t,element:d,options:f,compactionMap:m});i(n)&&0===n.length||_(x,s,n)}else{const t=await S.compact({activeCtx:e,activeProperty:"@reverse",element:d,options:f,compactionMap:m});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const r=t[n],i=(p(e,n,"@container")||[]).includes("@set")||!f.compactArrays;_(x,n,r,{propertyIsArray:i}),delete t[n]}if(Object.keys(t).length>0){const n=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});_(x,n,t)}}else{let t=w(d).map(e=>S.compactIri({activeCtx:j,iri:e,relativeTo:{vocab:!0}}));1===t.length&&(t=t[0]);const n=S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),r=(p(e,n,"@container")||[]).includes("@set")&&v(e,1.1)||i(t)&&0===d.length;_(x,n,t,{propertyIsArray:r})}else{let t=w(d).map(t=>S.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:f.base}));1===t.length&&(t=t[0]),x[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return x}return n},S.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:i={vocab:!1},reverse:a=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const h=e.getInverse();if(g(t)&&t in h&&"@none"in h[t]&&"@type"in h[t]["@none"]&&"@none"in h[t]["@none"]["@type"])return h[t]["@none"]["@type"]["@none"];if(i.vocab&&t in h){const r=e["@language"]||"@none",i=[];o(n)&&"@index"in n&&!("@graph"in n)&&i.push("@index","@index@set"),o(n)&&"@preserve"in n&&(n=n["@preserve"][0]),l(n)?("@index"in n&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in n||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||i.push("@graph@id","@graph@id@set")):o(n)&&!c(n)&&i.push("@id","@id@set","@type","@set@type");let s="@language",h="@null";if(a)s="@type",h="@reverse",i.push("@set");else if(u(n)){"@index"in n||i.push("@list");const e=n["@list"];if(0===e.length)s="@any",h="@none";else{let t=0===e.length?r:null,n=null;for(let r=0;re.includes("_"));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const u=e.inverse[t];for(const o of r){if(!(o in u))continue;const e=u[o][i];for(const t of s)if(t in e)return e[t]}return null}(e,t,n,i,s,h);if(null!==d)return d}if(i.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const r=t.substr(n.length);if(!e.mappings.has(r))return r}}let d=null;const f=[];let p=e.fastCurieMap;const y=t.length-1;for(let r=0;r=0;--r){const i=f[r],o=i.terms;for(const r of o){const o=r+":"+t.substr(i.iri.length);e.mappings.get(r)._prefix&&(!e.mappings.has(o)||null===n&&e.mappings.get(o)["@id"]===t)&&(null===d||x(o,d)<0)&&(d=o)}}if(null!==d)return d;for(const[o,u]of e.mappings)if(u&&u._prefix&&t.startsWith(o+":"))throw new r(`Absolute IRI "${t}" confused with prefix "${o}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});return i.vocab?t:"@base"in e?e["@base"]?m(b(s,e["@base"]),t):t:m(s,t)},S.compactValue=({activeCtx:e,activeProperty:t,value:n,options:r})=>{if(c(n)){const r=p(e,t,"@type"),i=p(e,t,"@language"),o=p(e,t,"@direction"),s=p(e,t,"@container")||[],u="@index"in n&&!s.includes("@index");if(!u&&"@none"!==r){if(n["@type"]===r)return n["@value"];if("@language"in n&&n["@language"]===i&&"@direction"in n&&n["@direction"]===o)return n["@value"];if("@language"in n&&n["@language"]===i)return n["@value"];if("@direction"in n&&n["@direction"]===o)return n["@value"]}const c=Object.keys(n).length,l=1===c||2===c&&"@index"in n&&!u,h="@language"in e,d=a(n["@value"]),f=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(l&&"@none"!==r&&(!h||!d||f))return n["@value"];const g={};return u&&(g[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?g[S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=S.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(g[S.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(g[S.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),g[S.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],g}const i=f(e,t,{vocab:!0},r),o=p(e,t,"@type"),s=S.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===o},base:r.base});return"@id"===o||"@vocab"===o||"@graph"===i?s:{[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:s}}},{"./JsonLdError":22,"./context":30,"./graphTypes":37,"./types":41,"./url":42,"./util":43}],29:[function(e,t,n){"use strict";const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#";t.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:r,RDF_LIST:r+"List",RDF_FIRST:r+"first",RDF_REST:r+"rest",RDF_NIL:r+"nil",RDF_TYPE:r+"type",RDF_PLAIN_LITERAL:r+"PlainLiteral",RDF_XML_LITERAL:r+"XMLLiteral",RDF_JSON_LITERAL:r+"JSON",RDF_OBJECT:r+"object",RDF_LANGSTRING:r+"langString",XSD:i,XSD_BOOLEAN:i+"boolean",XSD_DOUBLE:i+"double",XSD_INTEGER:i+"integer",XSD_STRING:i+"string"}},{}],30:[function(e,t,n){"use strict";const r=e("./util"),i=e("./JsonLdError"),{isArray:o,isObject:a,isString:s,isUndefined:u}=e("./types"),{isAbsolute:c,isRelative:l,prependBase:h}=e("./url"),{asArray:d,compareShortestLeast:f}=e("./util"),p=new Map,g=/^@[a-zA-Z]+$/,y={};function v(e,t,n,r,i,o){if(null===t||!s(t)||y.isKeyword(t))return t;if(t.match(g))return null;if(r&&r.hasOwnProperty(t)&&!0!==i.get(t)&&y.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:o}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(a(n)&&"@id"in n)return n["@id"]}const u=t.indexOf(":");if(u>0){const n=t.substr(0,u),a=t.substr(u+1);if("_"===n||0===a.indexOf("//"))return t;r&&r.hasOwnProperty(n)&&y.createTermDefinition({activeCtx:e,localCtx:r,term:n,defined:i,options:o});const s=e.mappings.get(n);if(s&&s._prefix)return s["@id"]+a;if(c(t))return t}if(n.vocab&&"@vocab"in e)return e["@vocab"]+t;if(n.base&&"@base"in e){if(e["@base"])return h(h(o.base,e["@base"]),t)}else if(n.base)return h(o.base,t);return t}function m(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let n=0;n{if(a(t)&&"@context"in t&&o(t["@context"])&&(t=t["@context"]),0===d(t).length)return e;const g=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});a(g[0].document)&&"boolean"==typeof g[0].document["@propagate"]&&(u=g[0].document["@propagate"]);let m=e;u||m.previousContext||(m=m.clone(),m.previousContext=e);for(const o of g){let{document:u}=o;if(e=m,null===u){if(!f&&0!==Object.keys(e.protected).length){const a=n&&n.protectedMode||"error";if("error"===a)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});if("warn"===a){console.warn("WARNING: invalid context nullification");const t=o.getProcessed(e);if(t){m=e=t;continue}const i=e;m=e=y.getInitialContext(n).clone();for(const[n,o]of Object.entries(i.protected))o&&(e.mappings[n]=r.clone(i.mappings[n]));e.protected=r.clone(i.protected),o.setProcessed(i,m);continue}throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,protectedMode:a})}m=e=y.getInitialContext(n).clone();continue}const d=o.getProcessed(e);if(d){m=e=d;continue}if(a(u)&&"@context"in u&&(u=u["@context"]),!a(u))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:u});m=m.clone();const g=new Map;if("@version"in u){if(1.1!==u["@version"])throw new i("Unsupported JSON-LD version: "+u["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:u});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+u["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:u});m.processingMode="json-ld-1.1",m["@version"]=u["@version"],g.set("@version",!0)}if(m.processingMode=m.processingMode||e.processingMode,"@base"in u){let e=u["@base"];if(null===e||c(e));else{if(!l(e))throw new i('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:u});e=h(m["@base"],e)}m["@base"]=e,g.set("@base",!0)}if("@vocab"in u){const e=u["@vocab"];if(null===e)delete m["@vocab"];else{if(!s(e))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});if(!c(e)&&y.processingMode(m,1))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});m["@vocab"]=v(m,e,{vocab:!0,base:!0},void 0,void 0,n)}g.set("@vocab",!0)}if("@language"in u){const e=u["@language"];if(null===e)delete m["@language"];else{if(!s(e))throw new i('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:u});m["@language"]=e.toLowerCase()}g.set("@language",!0)}if("@direction"in u){const t=u["@direction"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:u});if(null===t)delete m["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new i('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:u});m["@direction"]=t}g.set("@direction",!0)}if("@propagate"in u){const n=u["@propagate"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:u});if("boolean"!=typeof n)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});g.set("@propagate",!0)}if("@import"in u){const r=u["@import"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:u});if(!s(r))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const o=await n.contextResolver.resolve({activeCtx:e,context:r,documentLoader:n.documentLoader,base:n.base});if(1!==o.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const a=o[0].getProcessed(e);if(a)u=a;else{const n=o[0].document;if("@import"in n)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in n)u.hasOwnProperty(e)||(u[e]=n[e]);o[0].setProcessed(e,u)}g.set("@import",!0)}g.set("@protected",u["@protected"]||!1);for(const e in u)if(y.createTermDefinition({activeCtx:m,localCtx:u,term:e,defined:g,options:n,overrideProtected:f}),a(u[e])&&"@context"in u[e]){const t=u[e]["@context"];let r=!0;if(s(t)){const e=h(n.base,t);p.has(e)?r=!1:p.add(e)}if(r)try{await y.process({activeCtx:m,localCtx:u[e]["@context"],overrideProtected:!0,options:n,cycles:p})}catch(b){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:u[e]["@context"],term:e})}}o.setProcessed(e,m)}return m},y.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:r,options:u,overrideProtected:l=!1})=>{if(r.has(n)){if(r.get(n))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let h;if(r.set(n,!1),t.hasOwnProperty(n)&&(h=t[n]),"@type"===n&&a(h)&&"@set"===(h["@container"]||"@set")&&y.processingMode(e,1.1)){const e=["@container","@id","@protected"],r=Object.keys(h);if(0===r.length||r.some(t=>!e.includes(t)))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(y.isKeyword(n))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(g))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:n});if(""===n)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const d=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let f=!1;if((s(h)||null===h)&&(f=!0,h={"@id":h}),!a(h))throw new i("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const p={};e.mappings.set(n,p),p.reverse=!1;const b=["@container","@id","@language","@reverse","@type"];y.processingMode(e,1.1)&&b.push("@context","@direction","@index","@nest","@prefix","@protected");for(const o in h)if(!b.includes(o))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+o,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const _=n.indexOf(":");if(p._termHasColon=_>0,"@reverse"in h){if("@id"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const o=h["@reverse"];if(!s(o))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(!y.isKeyword(o)&&o.match(g))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:o}),void(d?e.mappings.set(n,d):e.mappings.delete(n));const a=v(e,o,{vocab:!0,base:!1},t,r,u);if(!c(a))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});p["@id"]=a,p.reverse=!0}else if("@id"in h){let o=h["@id"];if(o&&!s(o))throw new i("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===o)p["@id"]=null;else{if(!y.isKeyword(o)&&o.match(g))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:o}),void(d?e.mappings.set(n,d):e.mappings.delete(n));if(o!==n){if(o=v(e,o,{vocab:!0,base:!1},t,r,u),!c(o)&&!y.isKeyword(o))throw new i("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)&&v(e,n,{vocab:!0,base:!1},t,new Map(r).set(n,!0),u)!==o)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});p["@id"]=o,p._prefix=f&&!p._termHasColon&&o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in p))if(p._termHasColon){const i=n.substr(0,_);if(t.hasOwnProperty(i)&&y.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:r,options:u}),e.mappings.has(i)){const t=n.substr(_+1);p["@id"]=e.mappings.get(i)["@id"]+t}else p["@id"]=n}else if("@type"===n)p["@id"]=n;else{if(!("@vocab"in e))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});p["@id"]=e["@vocab"]+n}if((!0===h["@protected"]||!0===r.get("@protected")&&!1!==h["@protected"])&&(e.protected[n]=!0,p.protected=!0),r.set(n,!0),"@type"in h){let n=h["@type"];if(!s(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(y.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=v(e,n,{vocab:!0,base:!1},t,r,u),!c(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new i("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}p["@type"]=n}if("@container"in h){const n=s(h["@container"])?[h["@container"]]:h["@container"]||[],r=["@list","@set","@index","@language"];let a=!0;const u=n.includes("@set");if(y.processingMode(e,1.1)){if(r.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(n.includes("@graph")){if(n.some(e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e))throw new i("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else a&=n.length<=(u?2:1);if(n.includes("@type")&&(p["@type"]=p["@type"]||"@id",!["@id","@vocab"].includes(p["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else a&=!o(h["@container"]),a&=n.length<=1;if(a&=n.every(e=>r.includes(e)),a&=!(u&&n.includes("@list")),!a)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+r.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(p.reverse&&!n.every(e=>["@index","@set"].includes(e)))throw new i("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});p["@container"]=n}if("@index"in h){if(!("@container"in h)||!p["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!s(h["@index"])||0===h["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});p["@index"]=h["@index"]}if("@context"in h&&(p["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let e=h["@language"];if(null!==e&&!s(e))throw new i("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),p["@language"]=e}if("@prefix"in h){if(n.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(y.isKeyword(p["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof h["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});p._prefix=!0===h["@prefix"]}if("@direction"in h){const e=h["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});p["@direction"]=e}if("@nest"in h){const e=h["@nest"];if(!s(e)||"@nest"!==e&&0===e.indexOf("@"))throw new i("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});p["@nest"]=e}const w=p["@id"];if("@context"===w||"@preserve"===w)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(d&&d.protected&&!l&&(e.protected[n]=!0,p.protected=!0,!m(d,p))){const e=u&&u.protectedMode||"error";if("error"===e)throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n});if("warn"===e)return void console.warn("WARNING: protected term redefinition",{term:n});throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,term:n,protectedMode:e})}},y.expandIri=(e,t,n,r)=>v(e,t,n,void 0,void 0,r),y.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=p.get(t);if(n)return n;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){if(this.inverse)return this.inverse;const e=this.inverse={},t=this.fastCurieMap={},n={},r=(this["@language"]||"@none").toLowerCase(),i=this["@direction"],s=this.mappings,u=[...s.keys()].sort(f);for(const o of u){const u=s.get(o);if(null===u)continue;let c=u["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===u["@id"])continue;const l=d(u["@id"]);for(const s of l){let l=e[s];const h=y.isKeyword(s);if(l)h||u._termHasColon||n[s].push(o);else if(e[s]=l={},!h&&!u._termHasColon){n[s]=[o];const e={iri:s,terms:n[s]};s[0]in t?t[s[0]].push(e):t[s[0]]=[e]}if(l[c]||(l[c]={"@language":{},"@type":{},"@any":{}}),l=l[c],a(o,l["@any"],"@none"),u.reverse)a(o,l["@type"],"@reverse");else if("@none"===u["@type"])a(o,l["@any"],"@none"),a(o,l["@language"],"@none"),a(o,l["@type"],"@none");else if("@type"in u)a(o,l["@type"],u["@type"]);else if("@language"in u&&"@direction"in u){const e=u["@language"],t=u["@direction"];a(o,l["@language"],e&&t?`${e}_${t}`.toLowerCase():e?e.toLowerCase():t?`_${t}`:"@null")}else"@language"in u?a(o,l["@language"],(u["@language"]||"@null").toLowerCase()):"@direction"in u?a(o,l["@language"],u["@direction"]?`_${u["@direction"]}`:"@none"):i?(a(o,l["@language"],`_${i}`),a(o,l["@language"],"@none"),a(o,l["@type"],"@none")):(a(o,l["@language"],r),a(o,l["@language"],"@none"),a(o,l["@type"],"@none"))}}for(const a in t)o(t,a,1);return e},clone:function(){const e={};return e.mappings=r.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=r.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===p.size&&p.clear(),p.set(t,i),i;function o(e,t,n){const r=e[t],i=e[t]={};let a,s;for(const o of r)a=o.iri,s=n>=a.length?"":a[n],s in i?i[s].push(o):i[s]=[o];for(const u in i)""!==u&&o(i,u,n+1)}function a(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},y.getContextValue=(e,t,n)=>{if(null===t){if("@context"===n)return;return null}if(e.mappings.has(t)){const r=e.mappings.get(t);if(u(n))return r;if(r.hasOwnProperty(n))return r[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},y.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,y.isKeyword=e=>{if(!s(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},{"./JsonLdError":22,"./types":41,"./url":42,"./util":43}],31:[function(e,t,n){"use strict";const{parseLinkHeader:r,buildHeaders:i}=e("../util"),{LINK_HEADER_CONTEXT:o}=e("../constants"),a=e("../JsonLdError"),s=e("../RequestQueue"),{prependBase:u}=e("../url");t.exports=({secure:t,strictSSL:n=!0,maxRedirects:c=-1,request:l,headers:h={}}={strictSSL:!0,maxRedirects:-1,headers:{}})=>{h=i(h),l=l||e("request");const d=e("http");return(new s).wrapLoader(function(e){return f(e,[])});async function f(e,i){if(0!==e.indexOf("http:")&&0!==e.indexOf("https:"))throw new a('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:e});if(t&&0!==e.indexOf("https"))throw new a('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:e});let s,p=null;if(null!==p)return p;let g=null;try{s=await function(e,t){return new Promise((n,r)=>{e(t,(e,t,i)=>{e?r(e):n({res:t,body:i})})})}(l,{url:e,headers:h,strictSSL:n,followRedirect:!1})}catch(m){throw new a("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:e,cause:m})}const{res:y,body:v}=s;if(p={contextUrl:null,documentUrl:e,document:v||null},y.statusCode>=400)throw new a(`URL "${e}" could not be dereferenced: ${d.STATUS_CODES[y.statusCode]}`,"jsonld.InvalidUrl",{code:"loading document failed",url:e,httpStatusCode:y.statusCode});if(y.headers.link&&"application/ld+json"!==y.headers["content-type"]){const t=r(y.headers.link),n=t[o];if(Array.isArray(n))throw new a("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:e});n&&(p.contextUrl=n.target),g=t.alternate,g&&"application/ld+json"==g.type&&!(y.headers["content-type"]||"").match(/^application\/(\w*\+)?json$/)&&(y.headers.location=u(e,g.target))}if((g||y.statusCode>=300&&y.statusCode<400)&&y.headers.location){if(i.length===c)throw new a("URL could not be dereferenced; there were too many redirects.","jsonld.TooManyRedirects",{code:"loading document failed",url:e,httpStatusCode:y.statusCode,redirects:i});if(-1!==i.indexOf(e))throw new a("URL could not be dereferenced; infinite redirection was detected.","jsonld.InfiniteRedirectDetected",{code:"recursive context inclusion",url:e,httpStatusCode:y.statusCode,redirects:i});return i.push(e),f(y.headers.location,i)}return i.push(e),p}}},{"../JsonLdError":22,"../RequestQueue":26,"../constants":29,"../url":42,"../util":43,http:11,request:11}],32:[function(e,t,n){"use strict";const{parseLinkHeader:r,buildHeaders:i}=e("../util"),{LINK_HEADER_CONTEXT:o}=e("../constants"),a=e("../JsonLdError"),s=e("../RequestQueue"),{prependBase:u}=e("../url"),c=/(^|(\r\n))link:/i;t.exports=({secure:e,headers:t={},xhr:n}={headers:{}})=>(t=i(t),(new s).wrapLoader(async function i(s){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new a('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(e&&0!==s.indexOf("https"))throw new a('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s});let l;try{l=await function(e,t,n){const r=new(e=e||XMLHttpRequest);return new Promise((e,i)=>{r.onload=()=>e(r),r.onerror=e=>i(e),r.open("GET",t,!0);for(const t in n)r.setRequestHeader(t,n[t]);r.send()})}(n,s,t)}catch(g){throw new a("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:g})}if(l.status>=400)throw new a("URL could not be dereferenced: "+l.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:s,httpStatusCode:l.status});let h={contextUrl:null,documentUrl:s,document:l.response},d=null;const f=l.getResponseHeader("Content-Type");let p;if(c.test(l.getAllResponseHeaders())&&(p=l.getResponseHeader("Link")),p&&"application/ld+json"!==f){const e=r(p),t=e[o];if(Array.isArray(t))throw new a("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});t&&(h.contextUrl=t.target),d=e.alternate,d&&"application/ld+json"==d.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(h=await i(u(s,d.target)))}return h}))},{"../JsonLdError":22,"../RequestQueue":26,"../constants":29,"../url":42,"../util":43}],33:[function(e,t,n){"use strict";const r=e("./JsonLdError"),{isArray:i,isObject:o,isEmptyObject:a,isString:s,isUndefined:u}=e("./types"),{isList:c,isValue:l,isGraph:h,isSubject:d}=e("./graphTypes"),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:v}=e("./context"),{isAbsolute:m}=e("./url"),{addValue:b,asArray:_,getValues:w,validateTypeValue:x}=e("./util"),S={};t.exports=S;const E=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;async function j({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:h,expandedParent:w,options:N={},insideList:A,typeKey:k,typeScopedContext:O,expansionMap:R}){const L=Object.keys(h).sort(),M=[];let D;const C=h[k]&&"@json"===f(e,i(h[k])?h[k][0]:h[k],{vocab:!0},N);for(const j of L){let k,L=h[j];if("@context"===j)continue;let P=f(e,j,{vocab:!0},N);if((null===P||!m(P)&&!g(P))&&(P=R({unmappedProperty:j,activeCtx:e,activeProperty:t,parent:h,options:N,insideList:A,value:L,expandedParent:w}),void 0===P))continue;if(g(P)){if("@reverse"===n)throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:L});if(P in w&&"@included"!==P&&"@type"!==P)throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:P})}if("@id"===P){if(!s(L)){if(!N.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(o(L)){if(!a(L))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L})}else{if(!i(L))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(!L.every(e=>s(e)))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L})}}b(w,"@id",_(L).map(t=>s(t)?f(e,t,{base:!0},N):t),{propertyIsArray:N.isFrame});continue}if("@type"===P){o(L)&&(L=Object.fromEntries(Object.entries(L).map(([e,t])=>[f(O,e,{vocab:!0}),_(t).map(e=>f(O,e,{base:!0,vocab:!0}))]))),x(L,N.isFrame),b(w,"@type",_(L).map(e=>s(e)?f(O,e,{base:!0,vocab:!0},N):e),{propertyIsArray:N.isFrame});continue}if("@included"===P&&v(e,1.1)){const n=_(await S.expand({activeCtx:e,activeProperty:t,element:L,options:N,expansionMap:R}));if(!n.every(e=>d(e)))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:L});b(w,"@included",n,{propertyIsArray:!0});continue}if("@graph"===P&&!o(L)&&!i(L))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:L});if("@value"===P){D=L,C&&v(e,1.1)?w["@value"]=L:b(w,"@value",L,{propertyIsArray:N.isFrame});continue}if("@language"===P){if(null===L)continue;if(!s(L)&&!N.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:L});L=_(L).map(e=>s(e)?e.toLowerCase():e);for(const e of L)s(e)&&!e.match(E)&&console.warn(`@language must be valid BCP47: ${e}`);b(w,"@language",L,{propertyIsArray:N.isFrame});continue}if("@direction"===P){if(!s(L)&&!N.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:L});L=_(L);for(const e of L)if(s(e)&&"ltr"!==e&&"rtl"!==e)throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:L});b(w,"@direction",L,{propertyIsArray:N.isFrame});continue}if("@index"===P){if(!s(L))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:L});b(w,"@index",L);continue}if("@reverse"===P){if(!o(L))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:L});if(k=await S.expand({activeCtx:e,activeProperty:"@reverse",element:L,options:N,expansionMap:R}),"@reverse"in k)for(const e in k["@reverse"])b(w,e,k["@reverse"][e],{propertyIsArray:!0});let t=w["@reverse"]||null;for(const e in k){if("@reverse"===e)continue;null===t&&(t=w["@reverse"]={}),b(t,e,[],{propertyIsArray:!0});const n=k[e];for(let i=0;i"@id"===e||"@index"===e)&&(k=_(k).map(e=>({"@graph":_(e)}))),F.mappings.has(j)&&F.mappings.get(j).reverse){const e=w["@reverse"]=w["@reverse"]||{};k=_(k);for(let t=0;t"@value"===f(e,t,{vocab:!0},N)))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await j({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:i,expandedParent:w,options:N,insideList:A,typeScopedContext:O,typeKey:k,expansionMap:R})}}}function N({activeCtx:e,activeProperty:t,value:n,options:r}){if(null==n)return null;const i=f(e,t,{vocab:!0},r);if("@id"===i)return f(e,n,{base:!0},r);if("@type"===i)return f(e,n,{vocab:!0,base:!0},r);const o=p(e,t,"@type");if(("@id"===o||"@graph"===i)&&s(n))return{"@id":f(e,n,{base:!0},r)};if("@vocab"===o&&s(n))return{"@id":f(e,n,{vocab:!0,base:!0},r)};if(g(i))return n;const a={};if(o&&!["@id","@vocab","@none"].includes(o))a["@type"]=o;else if(s(n)){const n=p(e,t,"@language");null!==n&&(a["@language"]=n);const r=p(e,t,"@direction");null!==r&&(a["@direction"]=r)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),a["@value"]=n,a}function I(e,t,n,o){const a=[],u=Object.keys(t).sort();for(const c of u){const u=f(e,c,{vocab:!0},o);let l=t[c];i(l)||(l=[l]);for(const e of l){if(null===e)continue;if(!s(e))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const i={"@value":e};"@none"!==u&&(i["@language"]=c.toLowerCase()),n&&(i["@direction"]=n),a.push(i)}}return a}async function T({activeCtx:e,options:t,activeProperty:n,value:o,expansionMap:a,asGraph:s,indexKey:c,propertyIndex:d}){const g=[],v=Object.keys(o).sort(),m="@type"===c;for(let _ of v){if(m){const n=p(e,_,"@context");u(n)||(e=await y({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let v,w=o[_];i(w)||(w=[w]),w=await S.expand({activeCtx:e,activeProperty:n,element:w,options:t,insideList:!1,insideIndex:!0,expansionMap:a}),v=d?"@none"===_?"@none":N({activeCtx:e,activeProperty:c,value:_,options:t}):f(e,_,{vocab:!0},t),"@id"===c?_=f(e,_,{base:!0},t):m&&(_=v);for(let e of w){if(s&&!h(e)&&(e={"@graph":[e]}),"@type"===c)"@none"===v||(e["@type"]=e["@type"]?[_].concat(e["@type"]):[_]);else{if(l(e)&&!["@language","@type","@index"].includes(c))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${c}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});d?"@none"!==v&&b(e,d,v,{propertyIsArray:!0,prependValue:!0}):"@none"===v||c in e||(e[c]=_)}g.push(e)}}return g}S.expand=async({activeCtx:e,activeProperty:t=null,element:n,options:c={},insideList:l=!1,insideIndex:h=!1,typeScopedContext:d=null,expansionMap:g=(()=>{})})=>{if(null==n)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!i(n)&&!o(n)){if(!l&&(null===t||"@graph"===f(e,t,{vocab:!0},c))){const r=await g({unmappedValue:n,activeCtx:e,activeProperty:t,options:c,insideList:l});return void 0===r?null:r}return N({activeCtx:e,activeProperty:t,value:n,options:c})}if(i(n)){let r=[];const o=p(e,t,"@container")||[];l=l||o.includes("@list");for(let a=0;a1?t.slice().sort():t:[t];for(const n of i){const t=p(d,n,"@context");u(t)||(e=await y({activeCtx:e,localCtx:t,options:c,propagate:!1}))}}let A={};await j({activeCtx:e,activeProperty:t,expandedActiveProperty:b,element:n,expandedParent:A,options:c,insideList:l,typeKey:T,typeScopedContext:d,expansionMap:g}),E=Object.keys(A);let k=E.length;if("@value"in A){if("@type"in A&&("@language"in A||"@direction"in A))throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:A});let i=k-1;if("@type"in A&&(i-=1),"@index"in A&&(i-=1),"@language"in A&&(i-=1),"@direction"in A&&(i-=1),0!==i)throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:A});const o=null===A["@value"]?[]:_(A["@value"]),u=w(A,"@type");if(v(e,1.1)&&u.includes("@json")&&1===u.length);else if(0===o.length){const r=await g({unmappedValue:A,activeCtx:e,activeProperty:t,element:n,options:c,insideList:l});A=void 0!==r?r:null}else{if(!o.every(e=>s(e)||a(e))&&"@language"in A)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:A});if(!u.every(e=>m(e)&&!(s(e)&&0===e.indexOf("_:"))||a(e)))throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:A})}}else if("@type"in A&&!i(A["@type"]))A["@type"]=[A["@type"]];else if("@set"in A||"@list"in A){if(k>1&&(2!==k||!("@index"in A)))throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:A});"@set"in A&&(A=A["@set"],E=Object.keys(A),k=E.length)}else if(1===k&&"@language"in A){const r=await g(A,{unmappedValue:A,activeCtx:e,activeProperty:t,element:n,options:c,insideList:l});A=void 0!==r?r:null}if(o(A)&&!c.keepFreeFloatingNodes&&!l&&(null===t||"@graph"===b)&&(0===k||"@value"in A||"@list"in A||1===k&&"@id"in A)){const r=await g({unmappedValue:A,activeCtx:e,activeProperty:t,element:n,options:c,insideList:l});A=void 0!==r?r:null}return A}},{"./JsonLdError":22,"./context":30,"./graphTypes":37,"./types":41,"./url":42,"./util":43}],34:[function(e,t,n){"use strict";const{isSubjectReference:r}=e("./graphTypes"),{createMergedNodeMap:i}=e("./nodeMap"),o={};t.exports=o,o.flatten=e=>{const t=i(e),n=[],o=Object.keys(t).sort();for(let i=0;i=0;--r){const i=n[r];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function p(e,t,n){const r="@"+n;let i=r in e?e[r][0]:t[n];if("embed"===n)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new u("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function g(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new u("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of a.asArray(e[0]["@id"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new u("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of a.asArray(e[0]["@type"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new u("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function y(e,t,n,s){let u=!0,c=!1;for(const l in n){let h=!1;const d=a.getValues(t,l),f=0===a.getValues(n,l).length;if("@id"===l){if(o.isEmptyObject(n["@id"][0]||{})?h=!0:n["@id"].length>=0&&(h=n["@id"].includes(d[0])),!s.requireAll)return h}else if("@type"===l){if(u=!1,f){if(d.length>0)return!1;h=!0}else if(1===n["@type"].length&&o.isEmptyObject(n["@type"][0]))h=d.length>0;else for(const e of n["@type"])h=!(!o.isObject(e)||!("@default"in e))||h||d.some(t=>t===e);if(!s.requireAll)return h}else{if(r(l))continue;{const t=a.getValues(n,l)[0];let r=!1;if(t&&(g([t]),r="@default"in t),u=!1,0===d.length&&r)continue;if(d.length>0&&f)return!1;if(void 0===t){if(d.length>0)return!1;h=!0}else if(i.isList(t)){const n=t["@list"][0];if(i.isList(d[0])){const t=d[0]["@list"];i.isValue(n)?h=t.some(e=>w(n,e)):(i.isSubject(n)||i.isSubjectReference(n))&&(h=t.some(t=>_(e,n,t,s)))}}else h=i.isValue(t)?d.some(e=>w(t,e)):i.isSubjectReference(t)?d.some(n=>_(e,t,n,s)):!!o.isObject(t)&&d.length>0}}if(!h&&s.requireAll)return!1;c=c||h}return u||c}function v(e,t){const n=e.uniqueEmbeds[e.graph],r=n[t],i=r.parent,s=r.property,u={"@id":t};if(o.isArray(i)){for(let e=0;e{const t=Object.keys(n);for(const r of t)r in n&&o.isObject(n[r].parent)&&n[r].parent["@id"]===e&&(delete n[r],c(r))};c(t)}function m(e,t){if(o.isArray(e))return e.map(e=>m(e,t));if(o.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=m(e["@list"],t),e;if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)"@id"===n&&t.bnodesToClear.includes(e[n])?delete e["@id"]:e[n]=m(e[n],t)}return e}function b(e,t,n){o.isObject(e)?a.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function _(e,t,n,r){if(!("@id"in n))return!1;const i=e.subjects[n["@id"]];return i&&y(e,i,t,r)}function w(e,t){const n=t["@value"],r=t["@type"],i=t["@language"],a=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],u=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===a.length&&0===s.length&&0===u.length||!(!a.includes(n)&&!o.isEmptyObject(a[0]))&&!!(!r&&0===s.length||s.includes(r)||r&&o.isEmptyObject(s[0]))&&!!(!i&&0===u.length||u.includes(i)||i&&o.isEmptyObject(u[0]))}t.exports=h,h.frameMergedOrDefault=(e,t,n)=>{const r={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new a.IdentifierIssuer("_:b");c(e,r.graphMap,"@default",i),n.merged&&(r.graphMap["@merged"]=l(r.graphMap),r.graph="@merged"),r.subjects=r.graphMap[r.graph];const o=[];return h.frame(r,Object.keys(r.subjects).sort(),t,o),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(r.bnodeMap).filter(e=>1===r.bnodeMap[e].length)),n.link={},m(o,n)},h.frame=(e,t,n,s,c=null)=>{g(n);const l=e.options,m={embed:p(n=n[0],l,"embed"),explicit:p(n,l,"explicit"),requireAll:p(n,l,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const _=e.link[e.graph],x=function(e,t,n,r){const i={};for(const o of t){const t=e.graphMap[e.graph][o];y(e,t,n,r)&&(i[o]=t)}return i}(e,t,n,m),S=Object.keys(x).sort();for(const g of S){const y=x[g];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===m.embed&&g in _){b(s,c,_[g]);continue}const S={"@id":g};if(0===g.indexOf("_:")&&a.addValue(e.bnodeMap,g,S,{propertyIsArray:!0}),_[g]=S,("@first"===m.embed||"@last"===m.embed)&&e.is11)throw new u("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(g))if(!e.embedded||"@never"!==m.embed&&!f(y,e.graph,e.subjectStack))if(!e.embedded||"@first"!=m.embed&&"@once"!=m.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(g)){if("@last"===m.embed&&g in e.uniqueEmbeds[e.graph]&&v(e,g),e.uniqueEmbeds[e.graph][g]={parent:s,property:c},e.subjectStack.push({subject:y,graph:e.graph}),g in e.graphMap){let t=!1,r=null;"@graph"in n?(r=n["@graph"][0],t=!("@merged"===g||"@default"===g),o.isObject(r)||(r={})):(t="@merged"!==e.graph,r={}),t&&h.frame({...e,graph:g,embedded:!1},Object.keys(e.graphMap[g]).sort(),[r],S,"@graph")}"@included"in n&&h.frame({...e,embedded:!1},t,n["@included"],S,"@included");for(const t of Object.keys(y).sort())if(r(t)){if(S[t]=a.clone(y[t]),"@type"===t)for(const t of y["@type"])0===t.indexOf("_:")&&a.addValue(e.bnodeMap,t,S,{propertyIsArray:!0})}else if(!m.explicit||t in n)for(const r of y[t]){const o=t in n?n[t]:d(m);if(i.isList(r)){const o=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:d(m),s={"@list":[]};b(S,t,s);const u=r["@list"];for(const t of u)i.isSubjectReference(t)?h.frame({...e,embedded:!0},[t["@id"]],o,s,"@list"):b(s,"@list",a.clone(t))}else i.isSubjectReference(r)?h.frame({...e,embedded:!0},[r["@id"]],o,S,t):w(o[0],r)&&b(S,t,a.clone(r))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!o.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(r(e))continue;const t=n[e][0]||{};if(!p(t,l,"omitDefault")&&!(e in S)){let n="@null";"@default"in t&&(n=a.clone(t["@default"])),o.isArray(n)||(n=[n]),S[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const r=n["@reverse"][t];for(const n of Object.keys(e.subjects))a.getValues(e.subjects[n],t).some(e=>e["@id"]===g)&&(S["@reverse"]=S["@reverse"]||{},a.addValue(S["@reverse"],t,[],{propertyIsArray:!0}),h.frame({...e,embedded:!0},[n],r,S["@reverse"][t],c))}b(s,c,S),e.subjectStack.pop()}else b(s,c,S);else b(s,c,S)}},h.cleanupNull=(e,t)=>{if(o.isArray(e))return e.map(e=>h.cleanupNull(e,t)).filter(e=>e);if("@null"===e)return null;if(o.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=h.cleanupNull(e[n],t)}return e}},{"./JsonLdError":22,"./context":30,"./graphTypes":37,"./nodeMap":39,"./types":41,"./url":42,"./util":43}],36:[function(e,t,n){"use strict";const r=e("./JsonLdError"),i=e("./graphTypes"),o=e("./types"),a=e("./util"),{RDF_LIST:s,RDF_FIRST:u,RDF_REST:c,RDF_NIL:l,RDF_TYPE:h,RDF_JSON_LITERAL:d,XSD_BOOLEAN:f,XSD_DOUBLE:p,XSD_INTEGER:g,XSD_STRING:y}=e("./constants"),v=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,m={};function b(e,t,n){if(e.termType.endsWith("Node"))return{"@id":e.value};const i={"@value":e.value};if(e.language)i["@language"]=e.language;else{let s=e.datatype.value;if(s||(s=y),s===d){s="@json";try{i["@value"]=JSON.parse(i["@value"])}catch(a){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:i["@value"],cause:a})}}if(t){if(s===f)"true"===i["@value"]?i["@value"]=!0:"false"===i["@value"]&&(i["@value"]=!1);else if(o.isNumeric(i["@value"]))if(s===g){const e=parseInt(i["@value"],10);e.toFixed(0)===i["@value"]&&(i["@value"]=e)}else s===p&&(i["@value"]=parseFloat(i["@value"]));[f,g,p,y].includes(s)||(i["@type"]=s)}else if("i18n-datatype"===n&&s.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=s.split(/[#_]/);e.length>0&&(i["@language"]=e,e.match(v)||console.warn(`@language must be valid BCP47: ${e}`)),i["@direction"]=t}else s!==y&&(i["@type"]=s)}return i}t.exports=m,m.fromRDF=async(e,{useRdfType:t=!1,useNativeTypes:n=!1,rdfDirection:r=null})=>{const d={},f={"@default":d},p={};for(const i of e){const e="DefaultGraph"===i.graph.termType?"@default":i.graph.value;e in f||(f[e]={}),"@default"===e||e in d||(d[e]={"@id":e});const o=f[e],s=i.subject.value,u=i.predicate.value,c=i.object;s in o||(o[s]={"@id":s});const g=o[s],y=c.termType.endsWith("Node");if(y&&!(c.value in o)&&(o[c.value]={"@id":c.value}),u===h&&!t&&y){a.addValue(g,"@type",c.value,{propertyIsArray:!0});continue}const v=b(c,n,r);if(a.addValue(g,u,v,{propertyIsArray:!0}),y)if(c.value===l){const e=o[c.value];"usages"in e||(e.usages=[]),e.usages.push({node:g,property:u,value:v})}else p[c.value]=!(c.value in p)&&{node:g,property:u,value:v}}for(const a in f){const e=f[a];if(!(l in e))continue;const t=e[l];if(t.usages){for(let n of t.usages){let t=n.node,r=n.property,a=n.value;const l=[],h=[];let d=Object.keys(t).length;for(;r===c&&o.isObject(p[t["@id"]])&&o.isArray(t[u])&&1===t[u].length&&o.isArray(t[c])&&1===t[c].length&&(3===d||4===d&&o.isArray(t["@type"])&&1===t["@type"].length&&t["@type"][0]===s)&&(l.push(t[u][0]),h.push(t["@id"]),n=p[t["@id"]],t=n.node,r=n.property,a=n.value,d=Object.keys(t).length,i.isBlankNode(t)););delete a["@id"],a["@list"]=l.reverse();for(const n of h)delete e[n]}delete t.usages}}const g=[],y=Object.keys(d).sort();for(const o of y){const e=d[o];if(o in f){const t=e["@graph"]=[],n=f[o],r=Object.keys(n).sort();for(const e of r){const r=n[e];i.isSubjectReference(r)||t.push(r)}}i.isSubjectReference(e)||g.push(e)}return g}},{"./JsonLdError":22,"./constants":29,"./graphTypes":37,"./types":41,"./util":43}],37:[function(e,t,n){"use strict";const r=e("./types"),i={};t.exports=i,i.isSubject=e=>!(!r.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>r.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>r.isObject(e)&&"@value"in e,i.isList=e=>r.isObject(e)&&"@list"in e,i.isGraph=e=>r.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(e=>"@id"!==e&&"@index"!==e).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>!!r.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))},{"./types":41}],38:[function(e,t,n){(function(n,r){const i=e("rdf-canonize"),o=e("./util"),a=e("./ContextResolver"),s=o.IdentifierIssuer,u=e("./JsonLdError"),c=e("lru-cache"),l=e("./NQuads"),h=e("./Rdfa"),{expand:d}=e("./expand"),{flatten:f}=e("./flatten"),{fromRDF:p}=e("./fromRdf"),{toRDF:g}=e("./toRdf"),{frameMergedOrDefault:y,cleanupNull:v}=e("./frame"),{isArray:m,isObject:b,isString:_}=e("./types"),{isSubjectReference:w}=e("./graphTypes"),{expandIri:x,getInitialContext:S,process:E,processingMode:j}=e("./context"),{compact:N,compactIri:I}=e("./compact"),{createNodeMap:T,createMergedNodeMap:A,mergeNodeMaps:k}=e("./nodeMap"),O=void 0!==n&&n.versions&&n.versions.node,R=!O&&("undefined"!=typeof window||"undefined"!=typeof self),L=function(t){const n={},L=new c({max:100});function M(e,{documentLoader:n=t.documentLoader,...r}){return Object.assign({},{documentLoader:n},r,e)}return t.compact=async function(e,n,r){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new u("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===e)return null;let i;(r=M(r,{base:_(e)?e:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new a({sharedCache:L})})).link&&(r.skipExpansion=!0),r.compactToRelative||delete r.base,i=r.skipExpansion?e:await t.expand(e,r);const c=await t.processContext(S(r),n,r);let l=await N({activeCtx:c,element:i,options:r,compactionMap:r.compactionMap});r.compactArrays&&!r.graph&&m(l)?1===l.length?l=l[0]:0===l.length&&(l={}):r.graph&&b(l)&&(l=[l]),b(n)&&"@context"in n&&(n=n["@context"]),n=o.clone(n),m(n)||(n=[n]);const h=n;n=[];for(let t=0;t0)&&n.push(h[t]);const d=n.length>0;if(1===n.length&&(n=n[0]),m(l)){const e=I({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=l;l={},d&&(l["@context"]=n),l[e]=t}else if(b(l)&&d){const e=l;l={"@context":n};for(const t in e)l[t]=e[t]}return l},t.expand=async function(e,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=M(n,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:L})})).expansionMap&&(n.expansionMap=void 0);const r={},i=[];if("expandContext"in n){const e=o.clone(n.expandContext);r.expandContext=b(e)&&"@context"in e?e:{"@context":e},i.push(r.expandContext)}let s;if(_(e)){const o=await t.get(e,n);s=o.documentUrl,r.input=o.document,o.contextUrl&&(r.remoteContext={"@context":o.contextUrl},i.push(r.remoteContext))}else r.input=o.clone(e);"base"in n||(n.base=s||"");let u=S(n);for(const t of i)u=await E({activeCtx:u,localCtx:t,options:n});let c=await d({activeCtx:u,element:r.input,options:n,expansionMap:n.expansionMap});return b(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),m(c)||(c=[c]),c},t.flatten=async function(e,n,r){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,r=M(r,{base:_(e)?e:"",contextResolver:new a({sharedCache:L})});const i=await t.expand(e,r),o=f(i);return null===n?o:(r.graph=!0,r.skipExpansion=!0,await t.compact(o,n,r))},t.frame=async function(e,n,r){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(r=M(r,{base:_(e)?e:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:L})}),_(n)){const e=await t.get(n,r);if(n=e.document,e.contextUrl){let t=n["@context"];t?m(t)?t.push(e.contextUrl):t=[t,e.contextUrl]:t=e.contextUrl,n["@context"]=t}}const i=n&&n["@context"]||{},o=await t.processContext(S(r),i,r);r.hasOwnProperty("omitGraph")||(r.omitGraph=j(o,1.1)),r.hasOwnProperty("pruneBlankNodeIdentifiers")||(r.pruneBlankNodeIdentifiers=j(o,1.1));const s=await t.expand(e,r),u={...r};u.isFrame=!0,u.keepFreeFloatingNodes=!0;const c=await t.expand(n,u),l=Object.keys(n).map(e=>x(o,e,{vocab:!0}));u.merged=!l.includes("@graph"),u.is11=j(o,1.1);const h=y(s,c,u);u.graph=!r.omitGraph,u.skipExpansion=!0,u.link={},u.framing=!0;let d=await t.compact(h,i,u);return u.link={},d=v(d,u),d},t.link=async function(e,n,r){const i={};return n&&(i["@context"]=n),i["@embed"]="@link",t.frame(e,i,r)},t.normalize=t.canonize=async function(e,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=M(n,{base:_(e)?e:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new a({sharedCache:L})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new u("Unknown canonicalization input format.","jsonld.CanonizeError");const t=l.parse(e);return i.canonize(t,n)}const r={...n};delete r.format,r.produceGeneralizedRdf=!1;const o=await t.toRDF(e,r);return i.canonize(o,n)},t.fromRDF=async function(e,t){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");t=M(t,{format:_(e)?"application/n-quads":void 0});const{format:r}=t;let{rdfParser:i}=t;if(r){if(i=i||n[r],!i)throw new u("Unknown input format.","jsonld.UnknownFormat",{format:r})}else i=()=>e;const o=await i(e);return p(o,t)},t.toRDF=async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let r;r=(n=M(n,{base:_(e)?e:"",skipExpansion:!1,contextResolver:new a({sharedCache:L})})).skipExpansion?e:await t.expand(e,n);const i=g(r,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return await l.serialize(i);throw new u("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return i},t.createNodeMap=async function(e,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=M(n,{base:_(e)?e:"",contextResolver:new a({sharedCache:L})});const r=await t.expand(e,n);return A(r,n)},t.merge=async function(e,n,r){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!m(e))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,r=M(r,{contextResolver:new a({sharedCache:L})});const i=await Promise.all(e.map(e=>{const n={...r};return t.expand(e,n)}));let u=!0;"mergeNodes"in r&&(u=r.mergeNodes);const c=r.issuer||new s("_:b"),l={"@default":{}};for(let t=0;tt._documentLoader,set:e=>t._documentLoader=e}),t.documentLoader=async e=>{throw new u("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},t.get=async function(e,n){let r;r="function"==typeof n.documentLoader?n.documentLoader:t.documentLoader;const i=await r(e);try{if(!i.document)throw new u("No remote document found at the given URL.","jsonld.NullRemoteDocument");_(i.document)&&(i.document=JSON.parse(i.document))}catch(o){throw new u("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:o,remoteDoc:i})}return i},t.processContext=async function(e,t,n){return n=M(n,{base:"",contextResolver:new a({sharedCache:L})}),null===t?S(n):(t=o.clone(t),b(t)&&"@context"in t||(t={"@context":t}),E({activeCtx:e,localCtx:t,options:n}))},t.getContextValue=e("./context").getContextValue,t.documentLoaders={},t.documentLoaders.node=e("./documentLoaders/node"),t.documentLoaders.xhr=e("./documentLoaders/xhr"),t.useDocumentLoader=function(e){if(!(e in t.documentLoaders))throw new u('Unknown document loader type: "'+e+'"',"jsonld.UnknownDocumentLoader",{type:e});t.documentLoader=t.documentLoaders[e].apply(t,Array.prototype.slice.call(arguments,1))},t.registerRDFParser=function(e,t){n[e]=t},t.unregisterRDFParser=function(e){delete n[e]},t.registerRDFParser("application/n-quads",l.parse),t.registerRDFParser("application/nquads",l.parse),t.registerRDFParser("rdfa-api",h.parse),t.url=e("./url"),t.util=o,Object.assign(t,o),t.promises=t,t.RequestQueue=e("./RequestQueue"),t.JsonLdProcessor=e("./JsonLdProcessor")(t),R&&void 0===r.JsonLdProcessor&&Object.defineProperty(r,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t.JsonLdProcessor}),O?t.useDocumentLoader("node"):"undefined"!=typeof XMLHttpRequest&&t.useDocumentLoader("xhr"),t},M=function(){return L(function(){return M()})};L(M),t.exports=M}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./ContextResolver":21,"./JsonLdError":22,"./JsonLdProcessor":23,"./NQuads":24,"./Rdfa":25,"./RequestQueue":26,"./compact":28,"./context":30,"./documentLoaders/node":31,"./documentLoaders/xhr":32,"./expand":33,"./flatten":34,"./frame":35,"./fromRdf":36,"./graphTypes":37,"./nodeMap":39,"./toRdf":40,"./types":41,"./url":42,"./util":43,_process:62,"lru-cache":44,"rdf-canonize":73}],39:[function(e,t,n){"use strict";const{isKeyword:r}=e("./context"),i=e("./graphTypes"),o=e("./types"),a=e("./util"),s=e("./JsonLdError"),u={};t.exports=u,u.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new a.IdentifierIssuer("_:b"),r={"@default":{}};return u.createNodeMap(e,r,"@default",n),u.mergeNodeMaps(r)},u.createNodeMap=(e,t,n,c,l,h)=>{if(o.isArray(e)){for(const r of e)u.createNodeMap(r,t,n,c,void 0,h);return}if(!o.isObject(e))return void(h&&h.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(h&&h.push(e))}if(h&&i.isList(e)){const r=[];return u.createNodeMap(e["@list"],t,n,c,l,r),void h.push({"@list":r})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}o.isUndefined(l)&&(l=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),h&&h.push({"@id":l});const d=t[n],f=d[l]=d[l]||{};f["@id"]=l;const p=Object.keys(e).sort();for(let o of p){if("@id"===o)continue;if("@reverse"===o){const r={"@id":l},o=e["@reverse"];for(const e in o){const s=o[e];for(const o of s){let s=o["@id"];i.isBlankNode(o)&&(s=c.getId(s)),u.createNodeMap(o,t,n,c,s),a.addValue(d[s],e,r,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){l in t||(t[l]={}),u.createNodeMap(e[o],t,l,c);continue}if("@included"===o){u.createNodeMap(e[o],t,n,c);continue}if("@type"!==o&&r(o)){if("@index"===o&&o in f&&(e[o]!==f[o]||e[o]["@id"]!==f[o]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:f});f[o]=e[o];continue}const h=e[o];if(0===o.indexOf("_:")&&(o=c.getId(o)),0!==h.length)for(let e of h)if("@type"===o&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const r=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];a.addValue(f,o,{"@id":r},{propertyIsArray:!0,allowDuplicate:!1}),u.createNodeMap(e,t,n,c,r)}else if(i.isValue(e))a.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const r=[];u.createNodeMap(e["@list"],t,n,c,l,r),e={"@list":r},a.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else u.createNodeMap(e,t,n,c,l),a.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else a.addValue(f,o,[],{propertyIsArray:!0})}},u.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const i of Object.keys(e[n]).sort()){const o=e[n][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(o).sort())if(r(e)&&"@type"!==e)s[e]=a.clone(o[e]);else for(const t of o[e])a.addValue(s,e,a.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},u.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const r of n){if("@default"===r)continue;const n=e[r];let o=t[r];o?"@graph"in o||(o["@graph"]=[]):t[r]=o={"@id":r,"@graph":[]};const a=o["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];i.isSubjectReference(t)||a.push(t)}}return t}},{"./JsonLdError":22,"./context":30,"./graphTypes":37,"./types":41,"./util":43}],40:[function(e,t,n){"use strict";const{createNodeMap:r}=e("./nodeMap"),{isKeyword:i}=e("./context"),o=e("./graphTypes"),a=e("canonicalize"),s=e("./types"),u=e("./util"),{RDF_FIRST:c,RDF_REST:l,RDF_NIL:h,RDF_TYPE:d,RDF_JSON_LITERAL:f,RDF_LANGSTRING:p,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:v,XSD_STRING:m}=e("./constants"),{isAbsolute:b}=e("./url"),_={};function w(e,t,n,r,o){const a=Object.keys(t).sort();for(const s of a){const a=t[s],u=Object.keys(a).sort();for(let t of u){const u=a[t];if("@type"===t)t=d;else if(i(t))continue;for(const i of u){const a={termType:s.startsWith("_:")?"BlankNode":"NamedNode",value:s};if(!b(s))continue;const u={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!b(t))continue;if("BlankNode"===u.termType&&!o.produceGeneralizedRdf)continue;const c=x(i,r,e,n,o.rdfDirection);c&&e.push({subject:a,predicate:u,object:c,graph:n})}}}}function x(e,t,n,r,i){const u={};if(o.isValue(e)){u.termType="Literal",u.value=void 0,u.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;"@json"===n?(u.value=a(t),u.datatype.value=f):s.isBoolean(t)?(u.value=t.toString(),u.datatype.value=n||g):s.isDouble(t)||n===y?(s.isDouble(t)||(t=parseFloat(t)),u.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),u.datatype.value=n||y):s.isNumber(t)?(u.value=t.toFixed(0),u.datatype.value=n||v):"i18n-datatype"===i&&"@direction"in e?(u.datatype.value="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`,u.value=t):"@language"in e?(u.value=t,u.datatype.value=n||p,u.language=e["@language"]):(u.value=t,u.datatype.value=n||m)}else if(o.isList(e)){const o=function(e,t,n,r,i){const o={termType:"NamedNode",value:c},a={termType:"NamedNode",value:l},s={termType:"NamedNode",value:h},u=e.pop(),d=u?{termType:"BlankNode",value:t.getId()}:s;let f=d;for(const c of e){const e=x(c,t,n,r,i),s={termType:"BlankNode",value:t.getId()};n.push({subject:f,predicate:o,object:e,graph:r}),n.push({subject:f,predicate:a,object:s,graph:r}),f=s}if(u){const e=x(u,t,n,r,i);n.push({subject:f,predicate:o,object:e,graph:r}),n.push({subject:f,predicate:a,object:s,graph:r})}return d}(e["@list"],t,n,r,i);u.termType=o.termType,u.value=o.value}else{const t=s.isObject(e)?e["@id"]:e;u.termType=t.startsWith("_:")?"BlankNode":"NamedNode",u.value=t}return"NamedNode"!==u.termType||b(u.value)?u:null}t.exports=_,_.toRDF=(e,t)=>{const n=new u.IdentifierIssuer("_:b"),i={"@default":{}};r(e,i,"@default",n);const o=[],a=Object.keys(i).sort();for(const r of a){let e;if("@default"===r)e={termType:"DefaultGraph",value:""};else{if(!b(r))continue;e=r.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},e.value=r}w(o,i[r],e,n,t)}return o}},{"./constants":29,"./context":30,"./graphTypes":37,"./nodeMap":39,"./types":41,"./url":42,"./util":43,canonicalize:15}],41:[function(e,t,n){"use strict";const r={};t.exports=r,r.isArray=Array.isArray,r.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),r.isDouble=e=>r.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),r.isEmptyObject=e=>r.isObject(e)&&0===Object.keys(e).length,r.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),r.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),r.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),r.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),r.isUndefined=e=>void 0===e},{}],42:[function(e,t,n){"use strict";const r=e("./types"),i={};t.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const n={},r=i.parsers[t||"full"],o=r.regex.exec(e);let a=r.keys.length;for(;a--;)n[r.keys[a]]=void 0===o[a]?null:o[a];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!r.isString(e)||(e=i.parse(e||""));const n=i.parse(t),o={protocol:e.protocol||""};if(null!==n.authority)o.authority=n.authority,o.path=n.path,o.query=n.query;else if(o.authority=e.authority,""===n.path)o.path=e.path,o.query=null!==n.query?n.query:e.query;else{if(0===n.path.indexOf("/"))o.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,o.path=t}o.query=n.query}""!==n.path&&(o.path=i.removeDotSegments(o.path));let a=o.protocol;return null!==o.authority&&(a+="//"+o.authority),a+=o.path,null!==o.query&&(a+="?"+o.query),null!==n.fragment&&(a+="#"+n.fragment),""===a&&(a="./"),a},i.removeBase=(e,t)=>{if(null===e)return t;e&&!r.isString(e)||(e=i.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const o=i.parse(t.substr(n.length)),a=e.normalizedPath.split("/"),s=o.normalizedPath.split("/"),u=o.fragment||o.query?0:1;for(;a.length>0&&s.length>u&&a[0]===s[0];)a.shift(),s.shift();let c="";if(a.length>0){a.pop();for(let e=0;e{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),r=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),r&&n.push("")):r&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>r.isString(e)&&o.test(e),i.isRelative=e=>r.isString(e)},{"./types":41}],43:[function(e,t,n){"use strict";const r=e("./graphTypes"),i=e("./types"),o=e("rdf-canonize").IdentifierIssuer,a=e("./JsonLdError"),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,u=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l="application/ld+json, application/json",h={};function d(e,t){if(i.isArray(t))for(let n=0;n{if(Object.keys(e).some(e=>"accept"===e.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+l+'" is supported.');return Object.assign({Accept:l},e)},h.parseLinkHeader=e=>{const t={},n=e.match(s);for(let r=0;r{if(!(i.isString(e)||i.isArray(e)&&e.every(e=>i.isString(e)))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&h.asArray(e["@default"]).every(e=>i.isString(e)))return}throw new a('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},h.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!i.isArray(n)||n.length>0}return!1},h.hasValue=(e,t,n)=>{if(h.hasProperty(e,t)){let o=e[t];const a=r.isList(o);if(i.isArray(o)||a){a&&(o=o["@list"]);for(let e=0;e{if("propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1),"valueIsArray"in r||(r.valueIsArray=!1),"allowDuplicate"in r||(r.allowDuplicate=!0),"prependValue"in r||(r.prependValue=!1),r.valueIsArray)e[t]=n;else if(i.isArray(n)){0===n.length&&r.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),r.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let i=0;i[].concat(e[t]||[]),h.removeProperty=(e,t)=>{delete e[t]},h.removeValue=(e,t,n,r)=>{"propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1);const i=h.getValues(e,t).filter(e=>!h.compareValues(e,n));0===i.length?h.removeProperty(e,t):e[t]=1!==i.length||r.propertyIsArray?i:i[0]},h.relabelBlankNodes=(e,t)=>d((t=t||{}).issuer||new o("_:b"),e),h.compareValues=(e,t)=>e===t||!(!r.isValue(e)||!r.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],h.compareShortestLeast=(e,t)=>e.length1,g=(e,t,n)=>{const r=e[d].get(t);if(r){const t=r.value;if(y(e,t)){if(m(e,r),!e[s])return}else n&&(e[f]&&(r.value.now=Date.now()),e[h].unshiftNode(r));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[u])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[u]&&n>e[u]},v=e=>{if(e[o]>e[i])for(let t=e[h].tail;e[o]>e[i]&&null!==t;){const n=t.prev;m(e,t),t=n}},m=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[o]-=n.length,e[d].delete(n.key),e[h].removeNode(t)}};class b{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const _=(e,t,n,r)=>{let i=n.value;y(e,i)&&(m(e,n),e[s]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};t.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||p;if(this[a]="function"!=typeof t?p:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[u]=e.maxAge||0,this[c]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,v(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,v(this)}get maxAge(){return this[u]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[a]&&(this[a]=e,this[o]=0,this[h].forEach(e=>{e.length=this[a](e.value,e.key),this[o]+=e.length})),v(this)}get lengthCalculator(){return this[a]}get length(){return this[o]}get itemCount(){return this[h].length}rforEach(e,t){t=t||this;for(let n=this[h].tail;null!==n;){const r=n.prev;_(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[h].head;null!==n;){const r=n.next;_(this,e,n,t),n=r}}keys(){return this[h].toArray().map(e=>e.key)}values(){return this[h].toArray().map(e=>e.value)}reset(){this[c]&&this[h]&&this[h].length&&this[h].forEach(e=>this[c](e.key,e.value)),this[d]=new Map,this[h]=new r,this[o]=0}dump(){return this[h].map(e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[h]}set(e,t,n){if((n=n||this[u])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,s=this[a](t,e);if(this[d].has(e)){if(s>this[i])return m(this,this[d].get(e)),!1;const a=this[d].get(e).value;return this[c]&&(this[l]||this[c](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[o]+=s-a.length,a.length=s,this.get(e),v(this),!0}const f=new b(e,t,s,r,n);return f.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=f.length,this[h].unshift(f),this[d].set(e,this[h].head),v(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[h].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[d].forEach((e,t)=>g(this,t,!1))}}},{yallist:116}],45:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",o="http://www.w3.org/2000/10/swap/";n.default={xsd:{decimal:i+"decimal",boolean:i+"boolean",double:i+"double",integer:i+"integer",string:i+"string"},rdf:{type:r+"type",nil:r+"nil",first:r+"first",rest:r+"rest",langString:r+"langString"},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:o+"reify#forSome",forAll:o+"reify#forAll"},log:{implies:o+"log#implies"}}},{}],46:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.termFromId=function e(t,n){if(n=n||d,!t)return n.defaultGraph();switch(t[0]){case"?":return n.variable(t.substr(1));case"_":return n.blankNode(t.substr(2));case'"':if(n===d)return new g(t);if('"'===t[t.length-1])return n.literal(t.substr(1,t.length-2));var r=t.lastIndexOf('"',t.length-1);return n.literal(t.substr(1,r-1),"@"===t[r+1]?t.substr(r+2):n.namedNode(t.substr(r+3)));case"<":const i=h.exec(t);return n.quad(e(w(i[1]),n),e(w(i[2]),n),e(w(i[3]),n),i[4]&&e(w(i[4]),n));default:return n.namedNode(t)}},n.termToId=function e(t){if("string"==typeof t)return t;if(t instanceof f&&"Quad"!==t.termType)return t.id;if(!t)return u.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return"_:"+t.value;case"Variable":return"?"+t.value;case"DefaultGraph":return"";case"Literal":return'"'+t.value+'"'+(t.language?"@"+t.language:t.datatype&&t.datatype.value!==s.string?"^^"+t.datatype.value:"");case"Quad":return`<<${_(e(t.subject))} ${_(e(t.predicate))} ${_(e(t.object))}${(0,o.isDefaultGraph)(t.graph)?"":` ${e(t.graph)}`}>>`;default:throw new Error("Unexpected termType: "+t.termType)}},n.escapeQuotes=_,n.unescapeQuotes=w,n.Triple=n.Quad=n.DefaultGraph=n.Variable=n.BlankNode=n.Literal=n.NamedNode=n.Term=n.default=void 0;var r,i=(r=e("./IRIs"))&&r.__esModule?r:{default:r},o=e("./N3Util");const{rdf:a,xsd:s}=i.default;let u,c=0;const l=/^"(.*".*)(?="[^"]*$)/,h=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,d={namedNode:function(e){return new p(e)},blankNode:function(e){return new y(e||"n3-"+c++)},variable:function(e){return new v(e)},literal:function(e,t){if("string"==typeof t)return new g('"'+e+'"@'+t.toLowerCase());let n=t?t.value:"";return""===n&&("boolean"==typeof e?n=s.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?s.integer:s.double:(n=s.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new g(""===n||n===s.string?'"'+e+'"':'"'+e+'"^^'+n)},defaultGraph:function(){return u},quad:x,triple:x};n.default=d;class f{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof f?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}toJSON(){return{termType:this.termType,value:this.value}}}n.Term=f;class p extends f{get termType(){return"NamedNode"}}n.NamedNode=p;class g extends f{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){var e=this.id,t=e.lastIndexOf('"')+1;return t`"${t.replace(/"/g,'""')}`)}function w(e){return e.replace(l,(e,t)=>`"${t.replace(/""/g,'"')}`)}function x(e,t,n,r){return new b(e,t,n,r)}n.Triple=n.Quad=b},{"./IRIs":45,"./N3Util":52}],47:[function(e,t,n){(function(t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./IRIs")),i=o(e("queue-microtask"));function o(e){return e&&e.__esModule?e:{default:e}}const{xsd:a}=r.default;var s=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,u={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},c=/[\x00-\x20<>\\"\{\}\|\^\`]/,l={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},h=/$0^/;n.default=class{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s()\[\]\{\}"'<])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,this._lineMode=!!(e=e||{}).lineMode)for(var t in this._n3Mode=!1,this)!(t in l)&&this[t]instanceof RegExp&&(this[t]=h);else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){for(var n=this._input,r=this._comments;;){for(var i,o;i=this._newline.exec(n);)r&&(o=this._comment.exec(i[0]))&&e(null,{line:this._line,type:"comment",value:o[1],prefix:""}),n=n.substr(i[0].length,n.length),this._line++;if(!i&&(i=this._whitespace.exec(n))&&(n=n.substr(i[0].length,n.length)),this._endOfFile.test(n))return t&&(r&&(o=this._comment.exec(n))&&e(null,{line:this._line,type:"comment",value:o[1],prefix:""}),e(n=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=n;var s=this._line,u="",l="",h="",d=n[0],f=null,p=0,g=!1;switch(d){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(p=1,u="^");break}if(this._previousMarker="^^","<"!==(n=n.substr(2))[0]){g=!0;break}case"<":if(f=this._unescapedIri.exec(n))u="IRI",l=f[1];else if(f=this._iri.exec(n)){if(null===(l=this._unescape(f[1]))||c.test(l))return v(this);u="IRI"}else n.length>1&&"<"===n[1]?(u="<<",p=2):this._n3Mode&&n.length>1&&"="===n[1]&&(u="inverse",p=2,l=">");break;case">":n.length>1&&">"===n[1]&&(u=">>",p=2);break;case"_":((f=this._blank.exec(n))||t&&(f=this._blank.exec(n+" ")))&&(u="blank",h="_",l=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(n))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(n)),null===l)return v(this);null===f&&0===p||(u="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(n))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(n)),null===l)return v(this);null===f&&0===p||(u="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(n))&&(u="var",l=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(n))?(u="langcode",l=f[1]):(f=this._keyword.exec(n))&&(u=f[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){u=".",p=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(n)||t&&(f=this._number.exec(n+" ")))&&(u="literal",l=f[0],h="string"==typeof f[1]?a.double:"string"==typeof f[2]?a.decimal:a.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(n))?u=f[0].toUpperCase():g=!0;break;case"f":case"t":(f=this._boolean.exec(n))?(u="literal",l=f[0],h=a.boolean):g=!0;break;case"a":(f=this._shortPredicates.exec(n))?(u="abbreviation",l="a"):g=!0;break;case"=":this._n3Mode&&n.length>1&&(u="abbreviation",">"!==n[1]?(p=1,l="="):(p=2,l=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(p=1,u=d);break;default:g=!0}if(g&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(n))?((f=this._prefixed.exec(n))||t&&(f=this._prefixed.exec(n+" ")))&&(u="prefixed",h=f[1]||"",l=this._unescape(f[2])):(u="prefix",l=f[1]||"")),"^^"===this._previousMarker)switch(u){case"prefixed":u="type";break;case"IRI":u="typeIRI";break;default:u=""}if(!u)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?v(this):this._input=n;var y={line:s,type:u,value:l,prefix:h};e(null,y),this.previousToken=y,this._previousMarker=u,n=n.substr(p||f[0].length,n.length)}function v(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1;const n=e.replace(s,(e,n,r,i)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof r){let e=Number.parseInt(r,16);return e<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in u?u[i]:(t=!0,"")});return t?null:n}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length;let r=Math.max(this._literalClosingPos,n);for(;(r=e.indexOf(t,r))>0;){let t=0;for(;"\\"===e[r-t-1];)t++;if(t%2==0){const t=e.substring(n,r),i=t.split(/\r\n|\r|\n/).length-1,o=r+n;if(1===n&&0!==i||3===n&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}r++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;var t=new Error('Unexpected "'+e+'" on line '+this._line+".");return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}tokenize(e,n){var r=this;if(this._line=1,"string"==typeof e){if(this._input=e,"function"!=typeof n){var o,a=[];if(this._tokenizeToEnd(function(e,t){e?o=e:a.push(t)},!0),o)throw o;return a}(0,i.default)(()=>r._tokenizeToEnd(n,!0))}else this._input="",this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",function(e){null!==r._input&&0!==e.length&&(r._pendingBuffer&&(e=t.concat([r._pendingBuffer,e]),r._pendingBuffer=null),128&e[e.length-1]?r._pendingBuffer=e:(r._input+=e,r._tokenizeToEnd(n,!1)))}),e.on("end",function(){null!==r._input&&r._tokenizeToEnd(n,!0)}),e.on("error",n)}}}).call(this,e("buffer").Buffer)},{"./IRIs":45,buffer:12,"queue-microtask":63}],48:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(e("./N3Lexer")),i=a(e("./N3DataFactory")),o=a(e("./IRIs"));function a(e){return e&&e.__esModule?e:{default:e}}let s=0;class u{constructor(e){this._contextStack=[],this._graph=null,this._setBase((e=e||{}).baseIRI),e.factory&&l(this,e.factory);var t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(t),i=/trig/.test(t),o=/triple/.test(t),a=/quad/.test(t),s=this._n3Mode=/n3/.test(t),u=o||a;(this._supportsNamedGraphs=!(n||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||o||s),this._supportsRDFStar=""===t||/star|\*$/.test(t),u&&(this._resolveRelativeIRI=function(e){return null}),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new r.default({lineMode:u,n3:s}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){s=0}_setBase(e){if(e){var t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,n,r,i){var o=this._n3Mode;this._contextStack.push({subject:n,predicate:r,object:i,graph:t,type:e,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?this._graph.id.substr(2)+".":".",this._quantified=Object.create(this._quantified))}_restoreContext(){var e=this._contextStack.pop(),t=this._n3Mode;this._subject=e.subject,this._predicate=e.predicate,this._object=e.object,this._graph=e.graph,t&&(this._inversePredicate=e.inverse,this._prefixes._=e.blankPrefix,this._quantified=e.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){var n;switch(e.type){case"IRI":case"typeIRI":var r=this._resolveIRI(e.value);if(null===r)return this._error("Invalid IRI",e);n=this._namedNode(r);break;case"type":case"prefixed":var i=this._prefixes[e.prefix];if(void 0===i)return this._error('Undefined prefix "'+e.prefix+':"',e);n=this._namedNode(i+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error("Expected entity but got "+e.type,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){var t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error("Unexpected "+t,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error("Expected graph but got "+e.type,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);var t=null===this._predicate;return this._restoreContext(),null===this._object?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){var t=null,n=null,r=this._subject,i=this._contextStack,o=i[i.length-1],a=this._readListItem;switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),a=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==i.length&&"list"===i[i.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(a=this._readPredicate,this._subject===this.RDF_NIL)return a}else if(a=this._getContextEndReader(),this._object===this.RDF_NIL)return a;n=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,a=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),a=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._blankNode()),null===r?null===o.predicate?o.subject=n:o.object=n:this._emit(r,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return a}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":var n=this._readEntity(e);if(void 0===n)return;t=this._literal(this._literalValue,n),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){var t,n=this._subject,r=this._graph,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error('Expected punctuation to follow "'+this._object.id+'"',e)}if(null!==n){var o=this._predicate,a=this._object;i?this._emit(a,o,n,r):this._emit(n,o,a,r)}return t}_readBlankNodePunctuation(e){var t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error('Expected punctuation to follow "'+this._object.id+'"',e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error('Expected IRI to follow prefix "'+this._prefix+':"',e);var t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){var t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){var t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error("Unexpected "+e.type,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:var t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){var r=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,r,this._graph)}return this._afterPath(e)}}_readForwardPath(e){var t,n,r=this._blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}_readBackwardPath(e){var t,n,r=this._blankNode();if(void 0!==(t=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=r):(n=this._object,this._object=r),this._emit(r,t,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error('Expected >> to follow "'+this._object.id+'"',e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){var e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,n,r){this._callback(null,this._quad(e,t,n,r||this.DEFAULTGRAPH))}_error(e,t){var n=new Error(e+" on line "+t.line+".");n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=c}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;for(var t="",n=e.length,r=-1,i=-1,o=0,a="/";r=i&&(t=t.substr(0,o)),"/"!==a)return t+"/"+e.substr(r+1);o=r+1}}}a=e[++r]}return t+e.substring(o)}parse(e,t,n){var r=this;if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):"b"+s+++"_",this._prefixCallback=n||c,this._inversePredicate=!1,this._quantified=Object.create(null),!t){var i,o=[];if(this._callback=function(e,t){e?i=e:t&&o.push(t)},this._lexer.tokenize(e).every(function(e){return r._readCallback=r._readCallback(e)}),i)throw i;return o}this._callback=t,this._lexer.tokenize(e,function(e,t){null!==e?(r._callback(e),r._callback=c):r._readCallback&&(r._readCallback=r._readCallback(t))})}}function c(){}function l(e,t){var n=t.namedNode;e._namedNode=n,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=n(o.default.rdf.first),e.RDF_REST=n(o.default.rdf.rest),e.RDF_NIL=n(o.default.rdf.nil),e.N3_FORALL=n(o.default.r.forAll),e.N3_FORSOME=n(o.default.r.forSome),e.ABBREVIATIONS={a:n(o.default.rdf.type),"=":n(o.default.owl.sameAs),">":n(o.default.log.implies)},e.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}n.default=u,l(u.prototype,i.default)},{"./IRIs":45,"./N3DataFactory":46,"./N3Lexer":47}],49:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}(e("./N3DataFactory")),o=e("stream"),a=(r=e("./IRIs"))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){return"string"==typeof e||e instanceof String}n.default=class{constructor(e,t){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,t||!e||e[0]||(t=e,e=null),this._factory=(t=t||{}).factory||i.default,e&&this.addQuads(e)}get size(){var e=this._size;if(null!==e)return e;e=0;var t,n,r=this._graphs;for(var i in r)for(var o in t=r[i].subjects)for(var a in n=t[o])e+=Object.keys(n[a]).length;return this._size=e}_addToIndex(e,t,n,r){var i=e[t]||(e[t]={}),o=i[n]||(i[n]={}),a=r in o;return a||(o[r]=null),!a}_removeFromIndex(e,t,n,r){var i,o=e[t],a=o[n];for(i in delete a[r],a)return;for(i in delete o[n],o)return;delete e[t]}_findInIndex(e,t,n,r,o,a,s,u,c,l){var h,d,f,p=!t+!n+!r>1?Object.keys(this._ids):this._entities;for(var g in t&&((h=e,e={})[t]=h[t]),e){var y=p[g];if(d=e[g])for(var v in n&&((h=d,d={})[n]=h[n]),d){var m=p[v];if(f=d[v])for(var b=(r?r in f?[r]:[]:Object.keys(f)),_=0;_{for(var o of this.getQuads(e,t,n,r))i.push(o);i.push(null)},i}countQuads(e,t,n,r){e=e&&(0,i.termToId)(e),t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);var o,a,s,c,l=0,h=this._getGraphs(r),d=this._ids;if(u(e)&&!(a=d[e])||u(t)&&!(s=d[t])||u(n)&&!(c=d[n]))return 0;for(var f in h)(o=h[f])&&(l+=e?n?this._countInIndex(o.objects,c,a,s):this._countInIndex(o.subjects,a,s,c):t?this._countInIndex(o.predicates,s,c,a):this._countInIndex(o.objects,c,a,s));return l}forEach(e,t,n,r,i){this.some(function(t){return e(t),!1},t,n,r,i)}every(e,t,n,r,i){var o=!1,a=!this.some(function(t){return o=!0,!e(t)},t,n,r,i);return o&&a}some(e,t,n,r,o){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r),o=o&&(0,i.termToId)(o);var a,s,c,l,h=this._getGraphs(o),d=this._ids;if(u(t)&&!(s=d[t])||u(n)&&!(c=d[n])||u(r)&&!(l=d[r]))return!1;for(var f in h)if(a=h[f])if(s){if(l){if(this._findInIndex(a.objects,l,s,c,"object","subject","predicate",f,e,null))return!0}else if(this._findInIndex(a.subjects,s,c,null,"subject","predicate","object",f,e,null))return!0}else if(c){if(this._findInIndex(a.predicates,c,l,null,"predicate","object","subject",f,e,null))return!0}else if(l){if(this._findInIndex(a.objects,l,null,null,"object","subject","predicate",f,e,null))return!0}else if(this._findInIndex(a.subjects,null,null,null,"subject","predicate","object",f,e,null))return!0;return!1}getSubjects(e,t,n){var r=[];return this.forSubjects(function(e){r.push(e)},e,t,n),r}forSubjects(e,t,n,r){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);var o,a,s,c=this._ids,l=this._getGraphs(r);if(e=this._uniqueEntities(e),!(u(t)&&!(a=c[t])||u(n)&&!(s=c[n])))for(r in l)(o=l[r])&&(a?s?this._loopBy2Keys(o.predicates,a,s,e):this._loopByKey1(o.subjects,a,e):s?this._loopByKey0(o.objects,s,e):this._loop(o.subjects,e))}getPredicates(e,t,n){var r=[];return this.forPredicates(function(e){r.push(e)},e,t,n),r}forPredicates(e,t,n,r){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);var o,a,s,c=this._ids,l=this._getGraphs(r);if(e=this._uniqueEntities(e),!(u(t)&&!(a=c[t])||u(n)&&!(s=c[n])))for(r in l)(o=l[r])&&(a?s?this._loopBy2Keys(o.objects,s,a,e):this._loopByKey0(o.subjects,a,e):s?this._loopByKey1(o.predicates,s,e):this._loop(o.predicates,e))}getObjects(e,t,n){var r=[];return this.forObjects(function(e){r.push(e)},e,t,n),r}forObjects(e,t,n,r){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);var o,a,s,c=this._ids,l=this._getGraphs(r);if(e=this._uniqueEntities(e),!(u(t)&&!(a=c[t])||u(n)&&!(s=c[n])))for(r in l)(o=l[r])&&(a?s?this._loopBy2Keys(o.subjects,a,s,e):this._loopByKey1(o.objects,a,e):s?this._loopByKey0(o.predicates,s,e):this._loop(o.objects,e))}getGraphs(e,t,n){var r=[];return this.forGraphs(function(e){r.push(e)},e,t,n),r}forGraphs(e,t,n,r){for(var i in this._graphs)this.some(function(t){return e(t.graph),!0},t,n,r,i)}createBlankNode(e){var t,n;if(e)for(t=e="_:"+e,n=1;this._ids[t];)t=e+n++;else do{t="_:b"+this._blankNodeIndex++}while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){var n={},r=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},i=this.getQuads(null,a.default.rdf.rest,a.default.rdf.nil,null),o=e?[...i]:[];return i.forEach(t=>{for(var i,s,u=[],c=!1,l=t.graph,h=t.subject;h&&!c;){var d,f,p=this.getQuads(null,null,h,null),g=this.getQuads(h,null,null,null),y=null,v=null,m=null;for(d=0;d"}_encodeLiteral(e){var t=e.value;return h.test(t)&&(t=t.replace(d,g)),e.language?'"'+t+'"@'+e.language:e.datatype.value!==l.string?'"'+t+'"^^'+this._encodeIriOrBlank(e.datatype):'"'+t+'"'}_encodePredicate(e){return e.value===c.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:n,graph:r}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(n)}${(0,a.isDefaultGraph)(r)?"":` ${this._encodeIriOrBlank(r)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,n,r,i){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof r?this._writeQuad(e,t,n,u,r):this._writeQuad(e,t,n,r||u,i)}addQuads(e){for(var t=0;t.\n")}if(r){var a="",s="";for(var u in n)a+=a?"|"+u:u,s+=(s?"|":"")+n[u];a=a.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:"+s+")[^/]*$|^("+a+")([a-zA-Z][\\-_a-zA-Z0-9]*)$")}this._write(r?"\n":"",t)}blank(e,t){var n,r,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return new p("[]");case 1:if(!((n=i[0]).object instanceof p))return new p("[ "+this._encodePredicate(n.predicate)+" "+this._encodeObject(n.object)+" ]");default:for(var o="[",a=0;a0;)s.push(c%o),c=c/o|0}for(i=0;0===e[i]&&i=0;--i)r+=t[s[i]]}else r=function(e,t){var n=0,r=t.length,i=t.charAt(0),o=[0];for(n=0;n0;)o.push(s%r),s=s/r|0}var u="";for(n=0;0===e.at(n)&&n=0;--n)u+=t[o[n]];return u}(e,t);if(n){var l=new RegExp(".{1,"+n+"}","g");r=r.match(l).join("\r\n")}return r},n.decode=function(t,n){if("string"!=typeof t)throw new TypeError('"input" must be a string.');if("string"!=typeof n)throw new TypeError('"alphabet" must be a string.');var i=r[n];if(!i){i=r[n]=[];for(var o=0;o>=8;for(;h>0;)u.push(255&h),h>>=8}for(var d=0;t[d]===s&&d>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(o),s(e,n,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a,u=r.util.createBuffer();u.putBytes(t.bytes()),u.putBytes(o.substr(0,i.blockLength-(i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1)));for(var c=8*i.fullMessageLength[0],l=0;l>>0)>>>0),c=a>>>0;u.putInt32(c);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(h,n,u);var d=r.util.createBuffer();return d.putInt32(h.h0),d.putInt32(h.h1),d.putInt32(h.h2),d.putInt32(h.h3),d.putInt32(h.h4),d},i};var o=null,a=!1;function s(e,t,n){for(var r,i,o,a,s,u,c,l=n.length();l>=64;){for(i=e.h0,o=e.h1,a=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)r=n.getInt32(),t[c]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;c<20;++c)t[c]=r=(r=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|r>>>31,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;c<32;++c)t[c]=r=(r=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|r>>>31,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;c<40;++c)t[c]=r=(r=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|r>>>30,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;c<60;++c)t[c]=r=(r=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|r>>>30,r=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;c<80;++c)t[c]=r=(r=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|r>>>30,r=(i<<5|i>>>27)+(o^a^s)+u+3395469782+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;e.h0=e.h0+i|0,e.h1=e.h1+o|0,e.h2=e.h2+a|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},{"./forge":56,"./md":57,"./util":60}],59:[function(e,t,n){var r=e("./forge");e("./md"),e("./util");var i=t.exports=r.sha256=r.sha256||{};r.md.sha256=r.md.algorithms.sha256=i,i.create=function(){a||(o=String.fromCharCode(128),o+=r.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=!0);var e=null,t=r.util.createBuffer(),n=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var n=i.messageLengthSize/4,o=0;o>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(o),u(e,n,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a,s=r.util.createBuffer();s.putBytes(t.bytes()),s.putBytes(o.substr(0,i.blockLength-(i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1)));for(var c=8*i.fullMessageLength[0],l=0;l>>0)>>>0),c=a>>>0;s.putInt32(c);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(h,n,s);var d=r.util.createBuffer();return d.putInt32(h.h0),d.putInt32(h.h1),d.putInt32(h.h2),d.putInt32(h.h3),d.putInt32(h.h4),d.putInt32(h.h5),d.putInt32(h.h6),d.putInt32(h.h7),d},i};var o=null,a=!1,s=null;function u(e,t,n){for(var r,i,o,a,u,c,l,h,d,f,p,g,y=n.length();y>=64;){for(a=0;a<16;++a)t[a]=n.getInt32();for(;a<64;++a)t[a]=(r=((r=t[a-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+t[a-7]+(i=((i=t[a-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)+t[a-16]|0;for(u=e.h0,c=e.h1,l=e.h2,h=e.h3,d=e.h4,f=e.h5,p=e.h6,g=e.h7,a=0;a<64;++a)o=u&c|l&(u^c),r=g+((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(p^d&(f^p))+s[a]+t[a],g=p,p=f,f=d,d=h+r>>>0,h=l,l=c,c=u,u=r+(i=((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+o)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+c|0,e.h2=e.h2+l|0,e.h3=e.h3+h|0,e.h4=e.h4+d|0,e.h5=e.h5+f|0,e.h6=e.h6+p|0,e.h7=e.h7+g|0,y-=64}}},{"./forge":56,"./md":57,"./util":60}],60:[function(e,t,n){(function(n,r,i,o,a,s,u,c){var l=e("./forge"),h=e("./baseN"),d=t.exports=l.util=l.util||{};function f(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function p(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(d.isArrayBuffer(e)||d.isArrayBufferView(e))if(void 0!==i&&e instanceof i)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(r){for(var n=0;n15?(r=Date.now(),a(e)):(t.push(e),1===t.length&&o.setAttribute("a",i=!i))}}d.nextTick=d.setImmediate}(),d.isNodejs=void 0!==n&&n.versions&&n.versions.node,d.globalScope=d.isNodejs?r:"undefined"==typeof self?window:self,d.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},d.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},d.isArrayBufferView=function(e){return e&&d.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},d.ByteBuffer=p,d.ByteStringBuffer=p,d.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},d.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},d.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},d.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},d.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var n=this.data;t>0;)1&t&&(n+=e),(t>>>=1)>0&&(e+=e);return this.data=n,this._optimizeConstructedString(t),this},d.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},d.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(d.encodeUtf8(e))},d.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},d.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},d.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},d.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},d.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},d.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},d.ByteStringBuffer.prototype.putInt=function(e,t){f(t);var n="";do{t-=8,n+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(n)},d.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},d.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),n=2<=n&&(t-=n<<1),t},d.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},d.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},d.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},d.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},d.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},d.ByteStringBuffer.prototype.copy=function(){var e=d.createBuffer(this.data);return e.read=this.read,e},d.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},d.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},d.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},d.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var n=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+t);return r.set(n),this.data=new DataView(r.buffer),this},d.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},d.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var n=0;n>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},d.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},d.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},d.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},d.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},d.DataBuffer.prototype.putInt=function(e,t){f(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},d.DataBuffer.prototype.putSignedInt=function(e,t){return f(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},d.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),n=2<=n&&(t-=n<<1),t},d.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},d.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},d.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},d.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},d.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},d.DataBuffer.prototype.copy=function(){return new d.DataBuffer(this)},d.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},d.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},d.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},d.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(n+=e),(t>>>=1)>0&&(e+=e);return n},d.xorBytes=function(e,t,n){for(var r="",i="",o="",a=0,s=0;n>0;--n,++a)i=e.charCodeAt(a)^t.charCodeAt(a),s>=10&&(r+=o,o="",s=0),o+=String.fromCharCode(i),++s;return r+o},d.hexToBytes=function(e){var t="",n=0;for(!0&e.length&&(n=1,t+=String.fromCharCode(parseInt(e[0],16)));n>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",y=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],v="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";d.encode64=function(e,t){for(var n,r,i,o="",a="",s=0;s>2),o+=g.charAt((3&n)<<4|r>>4),isNaN(r)?o+="==":(o+=g.charAt((15&r)<<2|i>>6),o+=isNaN(i)?"=":g.charAt(63&i)),t&&o.length>t&&(a+=o.substr(0,t)+"\r\n",o=o.substr(t));return a+o},d.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,n,r,i,o="",a=0;a>4),64!==r&&(o+=String.fromCharCode((15&n)<<4|r>>2),64!==i&&(o+=String.fromCharCode((3&r)<<6|i)));return o},d.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},d.decodeUtf8=function(e){return decodeURIComponent(escape(e))},d.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:h.encode,decode:h.decode}},d.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},d.binary.raw.decode=function(e,t,n){var r=t;r||(r=new Uint8Array(e.length));for(var i=n=n||0,o=0;o>2),o+=g.charAt((3&n)<<4|r>>4),isNaN(r)?o+="==":(o+=g.charAt((15&r)<<2|i>>6),o+=isNaN(i)?"=":g.charAt(63&i)),t&&o.length>t&&(a+=o.substr(0,t)+"\r\n",o=o.substr(t));return a+o},d.binary.base64.decode=function(e,t,n){var r,i,o,a,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=n=n||0;u>4,64!==o&&(s[c++]=(15&i)<<4|o>>2,64!==a&&(s[c++]=(3&o)<<6|a));return t?c-n:s.subarray(0,c)},d.binary.base58.encode=function(e,t){return d.binary.baseN.encode(e,v,t)},d.binary.base58.decode=function(e,t){return d.binary.baseN.decode(e,v,t)},d.text={utf8:{},utf16:{}},d.text.utf8.encode=function(e,t,n){e=d.encodeUtf8(e);var r=t;r||(r=new Uint8Array(e.length));for(var i=n=n||0,o=0;o0?(i=n[r].substring(0,a),o=n[r].substring(a+1)):(i=n[r],o=null),i in t||(t[i]=[]),i in Object.prototype||null===o||t[i].push(unescape(o))}return t};return void 0===e?(null===j&&(j="undefined"!=typeof window&&window.location&&window.location.search?n(window.location.search.substring(1)):{}),t=j):t=n(e),t},d.parseFragment=function(e){var t=e,n="",r=e.indexOf("?");r>0&&(t=e.substring(0,r),n=e.substring(r+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:n,path:i,query:""===n?{}:d.getQueryVariables(n)}},d.makeRequest=function(e){var t=d.parseFragment(e),n={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,n){var r;return void 0===e?r=t.query:(r=t.query[e])&&void 0!==n&&(r=r[n]),r},getQueryLast:function(e,t){var r=n.getQuery(e);return r?r[r.length-1]:t}};return n},d.makeLink=function(e,t,n){e=jQuery.isArray(e)?e.join("/"):e;var r=jQuery.param(t||{});return e+(r.length>0?"?"+r:"")+((n=n||"").length>0?"#"+n:"")},d.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},d.format=function(e){for(var t,n,r=/%./g,i=0,o=[],a=0;t=r.exec(e);){(n=e.substring(a,r.lastIndex-2)).length>0&&o.push(n),a=r.lastIndex;var s=t[0][1];switch(s){case"s":case"o":o.push(i");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(e.substring(a)),o.join("")},d.formatNumber=function(e,t,n,r){var i=e,o=isNaN(t=Math.abs(t))?2:t,a=void 0===n?",":n,s=void 0===r?".":r,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-c).toFixed(o).slice(2):"")},d.formatSize=function(e){return e>=1073741824?d.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?d.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?d.formatNumber(e/1024,0)+" KiB":d.formatNumber(e,0)+" bytes"},d.bytesFromIP=function(e){return-1!==e.indexOf(".")?d.bytesFromIPv4(e):-1!==e.indexOf(":")?d.bytesFromIPv6(e):null},d.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=d.createBuffer(),n=0;nn[r].end-n[r].start&&(r=n.length-1)):n.push({start:s,end:s})}t.push(o)}if(n.length>0){var u=n[r];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},d.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in d&&!e.update)return t(null,d.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return d.cores=navigator.hardwareConcurrency,t(null,d.cores);if("undefined"==typeof Worker)return d.cores=1,t(null,d.cores);if("undefined"==typeof Blob)return d.cores=2,t(null,d.cores);var n=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(e){for(var t=Date.now(),n=t+4;Date.now()s.st&&i.sti.st&&s.st1)for(var n=1;n(r||(r=Promise.resolve())).then(e).catch(e=>setTimeout(()=>{throw e},0))},{}],64:[function(e,t,n){"use strict";const r=e("./util");t.exports=class{constructor({maxCallStackDepth:e=500,maxTotalCallStackDepth:t=4294967295,timeSlice:n=10}={}){this.schedule={},this.schedule.MAX_DEPTH=e,this.schedule.MAX_TOTAL_DEPTH=t,this.schedule.depth=0,this.schedule.totalDepth=0,this.schedule.timeSlice=n}doWork(e,t){const n=this.schedule;if(n.totalDepth>=n.MAX_TOTAL_DEPTH)return t(new Error("Maximum total call stack depth exceeded; canonicalization aborting."));!function i(){if(n.depth===n.MAX_DEPTH)return n.depth=0,n.running=!1,r.nextTick(i);const o=Date.now();if(n.running||(n.start=Date.now(),n.deadline=n.start+n.timeSlice),o{n.depth--,n.totalDepth--,t(e,r)});n.depth=0,n.running=!1,r.setImmediate(i)}()}forEach(e,t,n){const r=this;let i,o,a=0;if(Array.isArray(e))o=e.length,i=()=>a!==o&&(i.value=e[a++],i.key=a,!0);else{const t=Object.keys(e);o=t.length,i=()=>a!==o&&(i.key=t[a++],i.value=e[i.key],!0)}!function e(o){return o?n(o):i()?r.doWork(()=>t(i.value,i.key,e)):void n()}()}waterfall(e,t){const n=this;n.forEach(e,(e,t,r)=>n.doWork(e,r),t)}whilst(e,t,n){const r=this;!function i(o){return o?n(o):e()?void r.doWork(t,i):n()}()}}},{"./util":74}],65:[function(e,t,n){"use strict";const r=e("./util");t.exports=class e{constructor(e){this.prefix=e,this.counter=0,this.existing={}}clone(){const t=new e(this.prefix);return t.counter=this.counter,t.existing=r.clone(this.existing),t}getId(e){if(e&&e in this.existing)return this.existing[e];const t=this.prefix+this.counter;return this.counter+=1,e&&(this.existing[e]=t),t}hasId(e){return e in this.existing}}},{"./util":74}],66:[function(e,t,n){"use strict";const r=e("node-forge/lib/forge");e("node-forge/lib/md"),e("node-forge/lib/sha1"),e("node-forge/lib/sha256"),t.exports=class{constructor(e){this.md=r.md[e].create()}update(e){this.md.update(e,"utf8")}digest(){return this.md.digest().toHex()}}},{"node-forge/lib/forge":56,"node-forge/lib/md":57,"node-forge/lib/sha1":58,"node-forge/lib/sha256":59}],67:[function(e,t,n){"use strict";const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",i="http://www.w3.org/2001/XMLSchema#string",o={};function a(e,t){for(const n in e)if(e[n].termType!==t[n].termType||e[n].value!==t[n].value)return!1;return"Literal"!==e.object.termType||e.object.datatype.termType===t.object.datatype.termType&&e.object.datatype.value===t.object.datatype.value&&e.object.language===t.object.language}o.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,o.empty=new RegExp("^[ \\t]*$"),o.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),t.exports=class e{static parse(e){const t=[],n={},s=e.split(o.eoln);let c=0;for(const l of s){if(c++,o.empty.test(l))continue;const e=l.match(o.quad);if(null===e)throw new Error("N-Quads parse error on line "+c+".");const s={};if(s.subject=void 0!==e[1]?{termType:"NamedNode",value:e[1]}:{termType:"BlankNode",value:e[2]},s.predicate={termType:"NamedNode",value:e[3]},void 0!==e[4]?s.object={termType:"NamedNode",value:e[4]}:void 0!==e[5]?s.object={termType:"BlankNode",value:e[5]}:(s.object={termType:"Literal",value:void 0,datatype:{termType:"NamedNode"}},void 0!==e[7]?s.object.datatype.value=e[7]:void 0!==e[8]?(s.object.datatype.value=r,s.object.language=e[8]):s.object.datatype.value=i,s.object.value=e[6].replace(u,function(e,t,n,r){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(r)throw new Error("Unsupported U escape")})),s.graph=void 0!==e[9]?{termType:"NamedNode",value:e[9]}:void 0!==e[10]?{termType:"BlankNode",value:e[10]}:{termType:"DefaultGraph",value:""},s.graph.value in n){let e=!0;const r=n[s.graph.value];for(const t of r)if(a(t,s)){e=!1;break}e&&(r.push(s),t.push(s))}else n[s.graph.value]=[s],t.push(s)}return t}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const n=[];for(const r of t)n.push(e.serializeQuad(r));return n.sort().join("")}static serializeQuad(e){const t=e.object,n=e.graph;let o="";return[e.subject,e.predicate].forEach(e=>{o+="NamedNode"===e.termType?"<"+e.value+">":e.value,o+=" "}),"NamedNode"===t.termType?o+="<"+t.value+">":"BlankNode"===t.termType?o+=t.value:(o+='"'+t.value.replace(s,function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})+'"',t.datatype.value===r?t.language&&(o+="@"+t.language):t.datatype.value!==i&&(o+="^^<"+t.datatype.value+">")),"NamedNode"===n.termType?o+=" <"+n.value+">":"BlankNode"===n.termType&&(o+=" "+n.value),o+=" .\n",o}static legacyDatasetToQuads(e){const t=[],n={"blank node":"BlankNode",IRI:"NamedNode",literal:"Literal"};for(const o in e)e[o].forEach(e=>{const a={};for(const t in e){const o=e[t],s={termType:n[o.type],value:o.value};"Literal"===s.termType&&(s.datatype={termType:"NamedNode"},"datatype"in o&&(s.datatype.value=o.datatype),"language"in o?("datatype"in o||(s.datatype.value=r),s.language=o.language):"datatype"in o||(s.datatype.value=i)),a[t]=s}a.graph="@default"===o?{termType:"DefaultGraph",value:""}:{termType:o.startsWith("_:")?"BlankNode":"NamedNode",value:o},t.push(a)});return t}};const s=/["\\\n\r]/g,u=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],68:[function(e,t,n){"use strict";t.exports=class{constructor(e){this.list=e.sort(),this.done=!1,this.left={};for(let t=0;tt)&&(o&&i>0&&e>this.list[i-1]||!o&&ithis.list[i+1])&&(t=e,n=i)}if(null===t)this.done=!0;else{const e=this.left[t]?n-1:n+1;this.list[n]=this.list[e],this.list[e]=t;for(let n=0;nt&&(this.left[this.list[n]]=!this.left[this.list[n]])}return e}}},{}],69:[function(e,t,n){"use strict";const r=e("./AsyncAlgorithm"),i=e("./IdentifierIssuer"),o=e("./MessageDigest"),a=e("./Permutator"),s=e("./NQuads"),u=e("./util"),c={subject:"s",object:"o",graph:"g"};t.exports=class extends r{constructor(e){super(e=e||{}),this.name="URDNA2015",this.options=Object.assign({},e),this.blankNodeInfo={},this.hashToBlankNodes={},this.canonicalIssuer=new i("_:c14n"),this.hashAlgorithm="sha256"}main(e,t){const n=this;let r;n.schedule.start=Date.now(),n.quads=e;const o={};n.waterfall([t=>{n.forEach(e,(e,t,r)=>{n.forEachComponent(e,t=>{if("BlankNode"!==t.termType)return;const r=t.value;r in n.blankNodeInfo?n.blankNodeInfo[r].quads.push(e):(o[r]=!0,n.blankNodeInfo[r]={quads:[e]})}),r()},t)},e=>{let t=!0;n.whilst(()=>t,e=>{t=!1,n.hashToBlankNodes={},n.waterfall([e=>{n.forEach(o,(e,t,r)=>{n.hashFirstDegreeQuads(t,(e,i)=>{if(e)return r(e);i in n.hashToBlankNodes?n.hashToBlankNodes[i].push(t):n.hashToBlankNodes[i]=[t],r()})},e)},e=>{const r=Object.keys(n.hashToBlankNodes).sort();n.forEach(r,(e,r,i)=>{const a=n.hashToBlankNodes[e];if(a.length>1)return i();const s=a[0];n.canonicalIssuer.getId(s),delete o[s],delete n.hashToBlankNodes[e],t=!0,i()},e)}],e)},e)},e=>{const t=Object.keys(n.hashToBlankNodes).sort();n.forEach(t,(e,t,r)=>{const o=[],a=n.hashToBlankNodes[e];n.waterfall([e=>{n.forEach(a,(e,t,r)=>{if(n.canonicalIssuer.hasId(e))return r();const a=new i("_:b");a.getId(e),n.hashNDegreeQuads(e,a,(e,t)=>{if(e)return r(e);o.push(t),r()})},e)},e=>{o.sort((e,t)=>e.hasht.hash?1:0),n.forEach(o,(e,t,r)=>{for(const i in e.issuer.existing)n.canonicalIssuer.getId(i);r()},e)}],r)},e)},e=>{const t=[];n.waterfall([e=>{n.forEach(n.quads,(e,r,i)=>{n.forEachComponent(e,e=>{"BlankNode"!==e.termType||e.value.startsWith(n.canonicalIssuer.prefix)||(e.value=n.canonicalIssuer.getId(e.value))}),t.push(s.serializeQuad(e)),i()},e)},e=>(t.sort(),r=t.join(""),e())],e)}],e=>t(e,r))}hashFirstDegreeQuads(e,t){const n=this,r=n.blankNodeInfo[e];if("hash"in r)return t(null,r.hash);const i=[];n.forEach(r.quads,(t,r,o)=>{const a={predicate:t.predicate};n.forEachComponent(t,(t,r)=>{a[r]=n.modifyFirstDegreeComponent(e,t,r)}),i.push(s.serializeQuad(a)),o()},e=>{if(e)return t(e);i.sort();const a=new o(n.hashAlgorithm);for(let t=0;ta.canonicalIssuer.hasId(e)?(s=a.canonicalIssuer.getId(e),t()):n.hasId(e)?(s=n.getId(e),t()):void a.hashFirstDegreeQuads(e,(e,n)=>{if(e)return t(e);s=n,t()})],e=>{if(e)return i(e);const n=new o(a.hashAlgorithm);return n.update(r),"g"!==r&&n.update(a.getRelatedPredicate(t)),n.update(s),i(null,n.digest())})}hashNDegreeQuads(e,t,n){const r=this;let i;const s=new o(r.hashAlgorithm);r.waterfall([n=>r.createHashToRelated(e,t,(e,t)=>{if(e)return n(e);i=t,n()}),e=>{const n=Object.keys(i).sort();r.forEach(n,(e,n,o)=>{s.update(e);let u,c="";const l=new a(i[e]);r.whilst(()=>l.hasNext(),e=>{const n=l.next();let i=t.clone(),o="";const a=[];r.waterfall([t=>{r.forEach(n,(t,n,s)=>{if(r.canonicalIssuer.hasId(t)?o+=r.canonicalIssuer.getId(t):(i.hasId(t)||a.push(t),o+=i.getId(t)),0!==c.length&&o>c)return e();s()},t)},t=>{r.forEach(a,(t,n,a)=>{r.hashNDegreeQuads(t,i,(n,r)=>n?a(n):(o+=i.getId(t),o+="<"+r.hash+">",i=r.issuer,0!==c.length&&o>c?e():void a()))},t)},e=>{(0===c.length||o{if(e)return o(e);s.update(c),t=u,o()})},e)}],e=>{n(e,{hash:s.digest(),issuer:t})})}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType||((t=u.clone(t)).value=t.value===e?"_:a":"_:z"),t}getRelatedPredicate(e){return"<"+e.predicate.value+">"}createHashToRelated(e,t,n){const r=this,i={};r.forEach(r.blankNodeInfo[e].quads,(n,o,a)=>{r.forEach(n,(o,a,s)=>{if("predicate"===a||"BlankNode"!==o.termType||o.value===e)return s();const u=o.value;r.hashRelatedBlankNode(u,n,t,c[a],(e,t)=>{if(e)return s(e);t in i?i[t].push(u):i[t]=[u],s()})},a)},e=>n(e,i))}forEachComponent(e,t){for(const n in e)"predicate"!==n&&t(e[n],n,e)}}},{"./AsyncAlgorithm":64,"./IdentifierIssuer":65,"./MessageDigest":66,"./NQuads":67,"./Permutator":68,"./util":74}],70:[function(e,t,n){"use strict";const r=e("./IdentifierIssuer"),i=e("./MessageDigest"),o=e("./Permutator"),a=e("./NQuads"),s=e("./util"),u={subject:"s",object:"o",graph:"g"};t.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo={},this.hashToBlankNodes={},this.canonicalIssuer=new r("_:c14n"),this.hashAlgorithm="sha256"}main(e){const t=this;t.quads=e;const n={};for(const r of e)t.forEachComponent(r,e=>{if("BlankNode"!==e.termType)return;const i=e.value;i in t.blankNodeInfo?t.blankNodeInfo[i].quads.push(r):(n[i]=!0,t.blankNodeInfo[i]={quads:[r]})});let i=!0;for(;i;){i=!1,t.hashToBlankNodes={};for(const r in n){const e=t.hashFirstDegreeQuads(r);e in t.hashToBlankNodes?t.hashToBlankNodes[e].push(r):t.hashToBlankNodes[e]=[r]}const e=Object.keys(t.hashToBlankNodes).sort();for(let r=0;r1)continue;const s=a[0];t.canonicalIssuer.getId(s),delete n[s],delete t.hashToBlankNodes[o],i=!0}}const o=Object.keys(t.hashToBlankNodes).sort();for(let a=0;ae.hasht.hash?1:0);for(let r=0;r{"BlankNode"!==e.termType||e.value.startsWith(t.canonicalIssuer.prefix)||(e.value=t.canonicalIssuer.getId(e.value))}),s.push(a.serializeQuad(e))}return s.sort(),s.join("")}hashFirstDegreeQuads(e){const t=this,n=t.blankNodeInfo[e];if("hash"in n)return n.hash;const r=[],o=n.quads;for(let i=0;i{s[r]=t.modifyFirstDegreeComponent(e,n,r)}),r.push(a.serializeQuad(s))}r.sort();const s=new i(t.hashAlgorithm);for(let i=0;ic){a=!0;break}}if(!a){for(let e=0;e",r=s.issuer,0!==c.length&&i>c){a=!0;break}}a||(0===c.length||i"}createHashToRelated(e,t){const n=this,r={},i=n.blankNodeInfo[e].quads;for(let o=0;o{let s,u;if("BlankNode"===n.subject.termType&&n.subject.value!==e)u=n.subject.value,s="p";else{if("BlankNode"!==n.object.termType||n.object.value===e)return a();u=n.object.value,s="r"}r.hashRelatedBlankNode(u,n,t,s,(e,t)=>{if(e)return a(e);t in i?i[t].push(u):i[t]=[u],a()})},e=>n(e,i))}}},{"./URDNA2015":69,"./util":74}],72:[function(e,t,n){"use strict";const r=e("./URDNA2015Sync"),i=e("./util");t.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType||((t=i.clone(t)).value="name"===n?"_:g":t.value===e?"_:a":"_:z"),t}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=this,r={},i=n.blankNodeInfo[e].quads;for(let o=0;o{n=(n,r)=>{if(n)return t(n);e(r)}});if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(!u)throw new Error("rdf-canonize-native not available");u.canonize(e,t,n)}else if("URDNA2015"===t.algorithm)new i(t).main(e,n);else{if("URGNA2012"!==t.algorithm)throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.");new o(t).main(e,n)}return r}),c.canonizeSync=function(e,t){if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(u)return u.canonizeSync(e,t);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===t.algorithm)return new a(t).main(e);if("URGNA2012"===t.algorithm)return new s(t).main(e);if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}},{"./IdentifierIssuer":65,"./NQuads":67,"./URDNA2015":69,"./URDNA2015Sync":70,"./URGNA2012":71,"./URGNA2012Sync":72,"./util":74,"rdf-canonize-native":11}],74:[function(e,t,n){(function(e,n){"use strict";const r={};t.exports=r;const i="function"==typeof n&&n,o=i?e=>i(e):e=>setTimeout(e,0);function a(t,n,r){try{return t(n,r)}catch(i){e.nextTick(()=>{throw i})}}r.nextTick="object"==typeof e&&"function"==typeof e.nextTick?e.nextTick:o,r.setImmediate=i?o:r.nextTick,r.clone=function(e){if(e&&"object"==typeof e){let t;if(Array.isArray(e)){t=[];for(let n=0;n"[object Object]"===Object.prototype.toString.call(e),r.isUndefined=e=>void 0===e,r.callbackify=e=>async function(...t){const n=t[t.length-1];let r;"function"==typeof n&&t.pop();try{r=await e.apply(null,t)}catch(i){if("function"==typeof n)return a(n,i);throw i}return"function"==typeof n?a(n,null,r):r}}).call(this,e("_process"),e("timers").setImmediate)},{_process:62,timers:14}],75:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}(e("./lib/RdfXmlParser"))},{"./lib/RdfXmlParser":77}],76:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});class r extends Error{constructor(e,t){const n=e.saxStream._parser;super(e.trackPosition?`Line ${n.line+1} column ${n.column+1}: ${t}`:t)}}n.ParseError=r},{}],77:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const r=e("relative-to-absolute-iri"),i=e("sax"),o=e("stream"),a=e("./ParseError");class s extends o.Transform{constructor(t){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},t&&(Object.assign(this,t),this.options=t),this.dataFactory||(this.dataFactory=e("@rdfjs/data-model")),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=i.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(e,t){const n={};let r=!1;for(const o in e.attributes)o.startsWith("xmlns")&&(5===o.length?(r=!0,n[""]=e.attributes[o]):":"===o.charAt(5)&&(r=!0,n[o.substr(6)]=e.attributes[o]));const i=t&&t.ns?t.ns:[s.DEFAULT_NS];return r?i.concat([n]):i}static expandPrefixedTerm(e,t,n){const r=e.indexOf(":");let i,o;r>=0?(i=e.substr(0,r),o=e.substr(r+1)):(i="",o=e);let s=null,u=null;for(let a=t.length-1;a>=0;a--){const e=t[a][i];if(e){s=e;break}u||(u=t[a][""])}if(!s){if(i&&"xmlns"!==i)throw new a.ParseError(n,`The prefix '${i}' in term '${e}' was not bound.`);s=u||""}return{prefix:i,local:o,uri:s}}static isValidIri(e){return s.IRI_REGEX.test(e)}import(e){const t=new o.PassThrough({readableObjectMode:!0});e.on("error",e=>n.emit("error",e)),e.on("data",e=>t.write(e)),e.on("end",()=>t.emit("end"));const n=t.pipe(new s(this.options));return n}_transform(e,t,n){try{this.saxStream.write(e,t)}catch(r){return n(r)}n()}newParseError(e){return new a.ParseError(this,e)}valueToUri(e,t){return this.uriToNamedNode(r.resolve(e,t.baseIRI))}uriToNamedNode(e){if(!s.isValidIri(e))throw this.newParseError(`Invalid URI: ${e}`);return this.dataFactory.namedNode(e)}validateNcname(e){if(!s.NCNAME_MATCHER.test(e))throw this.newParseError(`Not a valid NCName: ${e}`)}attachSaxListeners(){this.saxStream.on("error",e=>this.emit("error",e)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(e){const t=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let n=u.RESOURCE;if(t&&(t.hadChildren=!0,n=t.childrenParseType),t&&t.childrenStringTags){const n=e.name;let r="";for(const t in e.attributes)r+=` ${t}="${e.attributes[t]}"`;t.childrenStringTags.push(`<${n}${r}>`);const i={childrenStringTags:t.childrenStringTags};return i.childrenStringEmitClosingTag=``,void this.activeTagStack.push(i)}const r={};t?(r.language=t.language,r.baseIRI=t.baseIRI):r.baseIRI=this.baseIRI,this.activeTagStack.push(r),r.ns=s.parseNamespace(e,t),n===u.RESOURCE?this.onTagResource(e,r,t,!t):this.onTagProperty(e,r,t)}onTagResource(e,t,n,i){const o=s.expandPrefixedTerm(e.name,t.ns,this);t.childrenParseType=u.PROPERTY;let a=!0;if(o.uri===s.RDF){if(!i&&s.FORBIDDEN_NODE_ELEMENTS.indexOf(o.local)>=0)throw this.newParseError(`Illegal node element name: ${o.local}`);switch(o.local){case"RDF":t.childrenParseType=u.RESOURCE;case"Description":a=!1}}const c=[],l=[];let h=null,d=!1,f=!1,p=null;for(const u in e.attributes){const i=e.attributes[u],o=s.expandPrefixedTerm(u,t.ns,this);if(n&&o.uri===s.RDF)switch(o.local){case"about":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${i} and ${h} where found.`);h=i;continue;case"ID":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${i} and ${h} where found.`);this.validateNcname(i),h="#"+i,d=!0;continue;case"nodeID":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${i} and ${h} where found.`);this.validateNcname(i),h=i,f=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":p=i;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(o.uri===s.XML){if("lang"===o.local){t.language=""===i?null:i.toLowerCase();continue}if("base"===o.local){t.baseIRI=r.resolve(i,t.baseIRI);continue}}"xml"!==o.prefix&&o.uri&&(c.push(this.uriToNamedNode(o.uri+o.local)),l.push(i))}if(null!==h&&(t.subject=f?this.dataFactory.blankNode(h):this.valueToUri(h,t),d&&this.claimNodeId(t.subject)),t.subject||(t.subject=this.dataFactory.blankNode()),a){const e=this.uriToNamedNode(o.uri+o.local);this.emitTriple(t.subject,this.dataFactory.namedNode(s.RDF+"type"),e,n?n.reifiedStatementId:null)}if(n){if(n.predicate)if(n.childrenCollectionSubject){const e=this.dataFactory.blankNode();this.emitTriple(n.childrenCollectionSubject,n.childrenCollectionPredicate,e,n.reifiedStatementId),this.emitTriple(e,this.dataFactory.namedNode(s.RDF+"first"),t.subject,t.reifiedStatementId),n.childrenCollectionSubject=e,n.childrenCollectionPredicate=this.dataFactory.namedNode(s.RDF+"rest")}else{this.emitTriple(n.subject,n.predicate,t.subject,n.reifiedStatementId);for(let e=0;e=0)throw this.newParseError(`Illegal property element name: ${r.local}`);t.predicateSubPredicates=[],t.predicateSubObjects=[];let i=!1,o=!1,a=null,c=!0;const l=[],h=[];for(const d in e.attributes){const n=e.attributes[d],r=s.expandPrefixedTerm(d,t.ns,this);if(r.uri===s.RDF)switch(r.local){case"resource":if(a)throw this.newParseError(`Found both rdf:resource (${n}) and rdf:nodeID (${a}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${n})`);t.hadChildren=!0,a=n,c=!1;continue;case"datatype":if(o)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${n}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${n})`);t.datatype=this.valueToUri(n,t);continue;case"nodeID":if(o)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${n}).`);if(t.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${n}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${n})`);this.validateNcname(n),t.hadChildren=!0,a=n,c=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(o)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(t.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${t.datatype.value})`);if(a)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${a})`);if("Resource"===n){i=!0,t.childrenParseType=u.PROPERTY;const e=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,e,t.reifiedStatementId),t.subject=e,t.predicate=null}else"Collection"===n?(i=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,c=!1):"Literal"===n&&(i=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(n),t.reifiedStatementId=this.valueToUri("#"+n,t),this.claimNodeId(t.reifiedStatementId);continue}else if(r.uri===s.XML&&"lang"===r.local){t.language=""===n?null:n.toLowerCase();continue}if("xml"!==r.prefix&&"xmlns"!==r.prefix&&r.uri){if(i||t.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${n}`);t.hadChildren=!0,o=!0,l.push(this.uriToNamedNode(r.uri+r.local)),h.push(this.dataFactory.literal(n,t.datatype||t.language))}}if(null!==a){const e=t.subject;t.subject=c?this.dataFactory.blankNode(a):this.valueToUri(a,t),this.emitTriple(e,t.predicate,t.subject,t.reifiedStatementId);for(let n=0;n/g,(e,t,n)=>(this.saxStream._parser.ENTITIES[t]=n,""))}}var u;n.RdfXmlParser=s,s.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,s.MIME_TYPE="application/rdf+xml",s.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",s.XML="http://www.w3.org/XML/1998/namespace",s.XMLNS="http://www.w3.org/2000/xmlns/",s.DEFAULT_NS={xml:s.XML},s.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],s.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],s.NCNAME_MATCHER=/^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u,function(e){e[e.RESOURCE=0]="RESOURCE",e[e.PROPERTY=1]="PROPERTY"}(u=n.ParseType||(n.ParseType={}))},{"./ParseError":76,"@rdfjs/data-model":2,"relative-to-absolute-iri":93,sax:96,stream:97}],78:[function(e,t,n){"use strict";var r={};function i(e,t,n){n||(n=Error);var i=function(e){function n(n,r,i){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,i))||this}return i=e,(r=n).prototype=Object.create(i.prototype),r.prototype.constructor=r,r.__proto__=i,n;var r,i}(n);i.prototype.name=n.name,i.prototype.code=e,r[e]=i}function o(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,n){var r,i,a,s;if("string"==typeof t&&"not "===t.substr(0,"not ".length)?(r="must not be",t=t.replace(/^not /,"")):r="must be",a=e,(void 0===s||s>a.length)&&(s=a.length)," argument"===a.substring(s-" argument".length,s))i="The ".concat(e," ").concat(r," ").concat(o(t,"type"));else{var u=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";i='The "'.concat(e,'" ').concat(u," ").concat(r," ").concat(o(t,"type"))}return i+". Received type ".concat(typeof n)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r},{}],79:[function(e,t,n){(function(n){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var i=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(c,i);for(var a=r(o.prototype),s=0;s0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),r)s.endEmitted?x(e,new w):I(e,s,t,!0);else if(s.ended)x(e,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!n?(t=s.decoder.write(t),s.objectMode||0!==t.length?I(e,s,t,!1):O(e,s)):I(e,s,t,!1)}else r||(s.reading=!1,O(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(k,e))}function k(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,C(e)}function O(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function M(e){o("readable nexttick read 0"),e.read(0)}function D(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function F(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(B,t,e))}function B(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function U(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):A(this),null;if(0===(e=T(e,t))&&t.ended)return 0===t.length&&F(this),null;var r,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&F(this)),null!==r&&this.emit("data",r),r},j.prototype._read=function(e){x(this,new _("_read()"))},j.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,o("pipe count=%d opts=%j",i.pipesCount,t);var s=t&&!1===t.end||e===n.stdout||e===n.stderr?g:u;function u(){o("onend"),e.end()}i.endEmitted?n.nextTick(s):r.once("end",s),e.on("unpipe",function t(n,a){o("onunpipe"),n===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",h),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,C(e))}}(r);e.on("drain",c);var l=!1;function h(t){o("ondata");var n=e.write(t);o("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!l&&(o("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(t){o("onerror",t),g(),e.removeListener("error",d),0===a(e,"error")&&x(e,t)}function f(){e.removeListener("finish",p),g()}function p(){o("onfinish"),e.removeListener("close",f),g()}function g(){o("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener("error",n);e._events&&e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(n):e._events.error=[n,e._events.error]:e.on("error",n)}(e,0,d),e.once("close",f),e.once("finish",p),e.emit("pipe",r),i.flowing||(o("pipe resume"),r.resume()),e},j.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,o("on readable",i.length,i.reading),i.length?A(this):i.reading||n.nextTick(M,this))),r},j.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(L,this),r},j.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(L,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(D,e,t))}(this,e)),e.paused=!1,this},j.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(o("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){o("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),j.prototype._write=function(e,t,n){n(new g("_write()"))},j.prototype._writev=null,j.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,O(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),j.prototype.destroy=h.destroy,j.prototype._undestroy=h.undestroy,j.prototype._destroy=function(e,t){t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":78,"./_stream_duplex":79,"./internal/streams/destroy":86,"./internal/streams/state":90,"./internal/streams/stream":91,_process:62,buffer:12,inherits:18,"util-deprecate":114}],84:[function(e,t,n){(function(n){"use strict";var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=e("./end-of-stream"),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function f(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[d].read();null!==n&&(e[l]=null,e[a]=null,e[s]=null,t(f(n,!1)))}}function g(e){n.nextTick(p,e)}var y=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((i(r={get stream(){return this[d]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(t,r){n.nextTick(function(){e[u]?r(e[u]):t(f(void 0,!0))})});var r,i=this[l];if(i)r=new Promise(function(e,t){return function(n,r){e.then(function(){t[c]?n(f(void 0,!0)):t[h](n,r)},r)}}(i,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(f(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,function(){return this}),i(r,"return",function(){var e=this;return new Promise(function(t,n){e[d].destroy(null,function(e){e?n(e):t(f(void 0,!0))})})}),r),y);t.exports=function(e){var t,n=Object.create(v,(i(t={},d,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,h,{value:function(e,t){var r=n[d].read();r?(n[l]=null,n[a]=null,n[s]=null,e(f(r,!1))):(n[a]=e,n[s]=t)},writable:!0}),t));return n[l]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];return null!==t&&(n[l]=null,n[a]=null,n[s]=null,t(e)),void(n[u]=e)}var r=n[a];null!==r&&(n[l]=null,n[a]=null,n[s]=null,r(f(void 0,!0))),n[c]=!0}),e.on("readable",g.bind(null,n)),n}}).call(this,e("_process"))},{"./end-of-stream":87,_process:62}],85:[function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t=a.allocUnsafe(e>>>0),n=this.head,r=0;n;)a.prototype.copy.call(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(r+=o===i.length?i:i.slice(0,e),0==(e-=o)){o===i.length?(++n,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t0,function(e){r||(r=e),e&&a.forEach(c),o||(a.forEach(c),i(r))})});return t.reduce(l)}},{"../../../errors":78,"./end-of-stream":87}],90:[function(e,t,n){"use strict";var r=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,i){var o=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},{"../../../errors":78}],91:[function(e,t,n){t.exports=e("events").EventEmitter},{events:13}],92:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":79,"./lib/_stream_passthrough.js":80,"./lib/_stream_readable.js":81,"./lib/_stream_transform.js":82,"./lib/_stream_writable.js":83,"./lib/internal/streams/end-of-stream.js":87,"./lib/internal/streams/pipeline.js":89}],93:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}(e("./lib/Resolve"))},{"./lib/Resolve":94}],94:[function(e,t,n){"use strict";function r(e){const t=[];let n=0;for(;ne.join("")).join("/")}function i(e,t){let n=t+1;t>=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);const i=e.indexOf("/",n);return i<0?e:e.substr(0,i)+r(e.substr(i))}function o(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(n,"__esModule",{value:!0}),n.resolve=function(e,t){const n=(t=t||"").indexOf("#");if(n>0&&(t=t.substr(0,n)),!e.length){if(t.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);return t}if(e.startsWith("?")){const n=t.indexOf("?");return n>0&&(t=t.substr(0,n)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){const t=e.indexOf(":");if(t<0)throw new Error(`Found invalid relative IRI '${e}' for a missing baseIRI`);return i(e,t)}const o=e.indexOf(":");if(o>=0)return i(e,o);const a=t.indexOf(":");if(a<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);const s=t.substr(0,a+1);if(0===e.indexOf("//"))return s+i(e,o);let u;if(t.indexOf("//",a)===a+1){if(u=t.indexOf("/",a+3),u<0)return t.length>a+3?t+"/"+i(e,o):s+i(e,o)}else if(u=t.indexOf("/",a+1),u<0)return s+i(e,o);if(0===e.indexOf("/"))return t.substr(0,u)+r(e);let c=t.substr(u);const l=c.lastIndexOf("/");return l>=0&&l"===r?(j(this,"onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=x.TEXT):g(r)?(this.state=x.SGML_DECL_QUOTED,this.sgmlDecl+=r):this.sgmlDecl+=r;continue;case x.SGML_DECL_QUOTED:r===this.q&&(this.state=x.SGML_DECL,this.q=""),this.sgmlDecl+=r;continue;case x.DOCTYPE:">"===r?(this.state=x.TEXT,j(this,"ondoctype",this.doctype),this.doctype=!0):(this.doctype+=r,"["===r?this.state=x.DOCTYPE_DTD:g(r)&&(this.state=x.DOCTYPE_QUOTED,this.q=r));continue;case x.DOCTYPE_QUOTED:this.doctype+=r,r===this.q&&(this.q="",this.state=x.DOCTYPE);continue;case x.DOCTYPE_DTD:this.doctype+=r,"]"===r?this.state=x.DOCTYPE:g(r)&&(this.state=x.DOCTYPE_DTD_QUOTED,this.q=r);continue;case x.DOCTYPE_DTD_QUOTED:this.doctype+=r,r===this.q&&(this.state=x.DOCTYPE_DTD,this.q="");continue;case x.COMMENT:"-"===r?this.state=x.COMMENT_ENDING:this.comment+=r;continue;case x.COMMENT_ENDING:"-"===r?(this.state=x.COMMENT_ENDED,this.comment=I(this.opt,this.comment),this.comment&&j(this,"oncomment",this.comment),this.comment=""):(this.comment+="-"+r,this.state=x.COMMENT);continue;case x.COMMENT_ENDED:">"!==r?(k(this,"Malformed comment"),this.comment+="--"+r,this.state=x.COMMENT):this.state=x.TEXT;continue;case x.CDATA:"]"===r?this.state=x.CDATA_ENDING:this.cdata+=r;continue;case x.CDATA_ENDING:"]"===r?this.state=x.CDATA_ENDING_2:(this.cdata+="]"+r,this.state=x.CDATA);continue;case x.CDATA_ENDING_2:">"===r?(this.cdata&&j(this,"oncdata",this.cdata),j(this,"onclosecdata"),this.cdata="",this.state=x.TEXT):"]"===r?this.cdata+="]":(this.cdata+="]]"+r,this.state=x.CDATA);continue;case x.PROC_INST:"?"===r?this.state=x.PROC_INST_ENDING:p(r)?this.state=x.PROC_INST_BODY:this.procInstName+=r;continue;case x.PROC_INST_BODY:if(!this.procInstBody&&p(r))continue;"?"===r?this.state=x.PROC_INST_ENDING:this.procInstBody+=r;continue;case x.PROC_INST_ENDING:">"===r?(j(this,"onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=x.TEXT):(this.procInstBody+="?"+r,this.state=x.PROC_INST_BODY);continue;case x.OPEN_TAG:v(h,r)?this.tagName+=r:(O(this),">"===r?M(this):"/"===r?this.state=x.OPEN_TAG_SLASH:(p(r)||k(this,"Invalid character in tag name"),this.state=x.ATTRIB));continue;case x.OPEN_TAG_SLASH:">"===r?(M(this,!0),D(this)):(k(this,"Forward-slash in opening tag not followed by >"),this.state=x.ATTRIB);continue;case x.ATTRIB:if(p(r))continue;">"===r?M(this):"/"===r?this.state=x.OPEN_TAG_SLASH:v(l,r)?(this.attribName=r,this.attribValue="",this.state=x.ATTRIB_NAME):k(this,"Invalid attribute name");continue;case x.ATTRIB_NAME:"="===r?this.state=x.ATTRIB_VALUE:">"===r?(k(this,"Attribute without value"),this.attribValue=this.attribName,L(this),M(this)):p(r)?this.state=x.ATTRIB_NAME_SAW_WHITE:v(h,r)?this.attribName+=r:k(this,"Invalid attribute name");continue;case x.ATTRIB_NAME_SAW_WHITE:if("="===r)this.state=x.ATTRIB_VALUE;else{if(p(r))continue;k(this,"Attribute without value"),this.tag.attributes[this.attribName]="",this.attribValue="",j(this,"onattribute",{name:this.attribName,value:""}),this.attribName="",">"===r?M(this):v(l,r)?(this.attribName=r,this.state=x.ATTRIB_NAME):(k(this,"Invalid attribute name"),this.state=x.ATTRIB)}continue;case x.ATTRIB_VALUE:if(p(r))continue;g(r)?(this.q=r,this.state=x.ATTRIB_VALUE_QUOTED):(k(this,"Unquoted attribute value"),this.state=x.ATTRIB_VALUE_UNQUOTED,this.attribValue=r);continue;case x.ATTRIB_VALUE_QUOTED:if(r!==this.q){"&"===r?this.state=x.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=r;continue}L(this),this.q="",this.state=x.ATTRIB_VALUE_CLOSED;continue;case x.ATTRIB_VALUE_CLOSED:p(r)?this.state=x.ATTRIB:">"===r?M(this):"/"===r?this.state=x.OPEN_TAG_SLASH:v(l,r)?(k(this,"No whitespace between attributes"),this.attribName=r,this.attribValue="",this.state=x.ATTRIB_NAME):k(this,"Invalid attribute name");continue;case x.ATTRIB_VALUE_UNQUOTED:if(!y(r)){"&"===r?this.state=x.ATTRIB_VALUE_ENTITY_U:this.attribValue+=r;continue}L(this),">"===r?M(this):this.state=x.ATTRIB;continue;case x.CLOSE_TAG:if(this.tagName)">"===r?D(this):v(h,r)?this.tagName+=r:this.script?(this.script+=""===r?D(this):k(this,"Invalid characters in closing tag");continue;case x.TEXT_ENTITY:case x.ATTRIB_VALUE_ENTITY_Q:case x.ATTRIB_VALUE_ENTITY_U:var a,s;switch(this.state){case x.TEXT_ENTITY:a=x.TEXT,s="textNode";break;case x.ATTRIB_VALUE_ENTITY_Q:a=x.ATTRIB_VALUE_QUOTED,s="attribValue";break;case x.ATTRIB_VALUE_ENTITY_U:a=x.ATTRIB_VALUE_UNQUOTED,s="attribValue"}";"===r?(this[s]+=(c=void 0,b=void 0,_=void 0,w=void 0,_=(b=(u=this).entity).toLowerCase(),w="",u.ENTITIES[b]?u.ENTITIES[b]:u.ENTITIES[_]?u.ENTITIES[_]:("#"===(b=_).charAt(0)&&("x"===b.charAt(1)?(b=b.slice(2),w=(c=parseInt(b,16)).toString(16)):(b=b.slice(1),w=(c=parseInt(b,10)).toString(10))),b=b.replace(/^0+/,""),isNaN(c)||w.toLowerCase()!==b?(k(u,"Invalid character entity"),"&"+u.entity+";"):String.fromCodePoint(c))),this.entity="",this.state=a):v(this.entity.length?f:d,r)?this.entity+=r:(k(this,"Invalid character in entity name"),this[s]+="&"+this.entity+r,this.entity="",this.state=a);continue;default:throw new Error(this,"Unknown state: "+this.state)}var u,c,b,_,w;return this.position>=this.bufferCheckPosition&&function(e){for(var t=Math.max(n.MAX_BUFFER_LENGTH,10),r=0,o=0,a=i.length;ot)switch(i[o]){case"textNode":N(e);break;case"cdata":j(e,"oncdata",e.cdata),e.cdata="";break;case"script":j(e,"onscript",e.script),e.script="";break;default:T(e,"Max buffer length exceeded: "+i[o])}r=Math.max(r,s)}e.bufferCheckPosition=n.MAX_BUFFER_LENGTH-r+e.position}(this),this},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){N(this),""!==this.cdata&&(j(this,"oncdata",this.cdata),this.cdata=""),""!==this.script&&(j(this,"onscript",this.script),this.script="")}};try{r=e("stream").Stream}catch(F){r=function(){}}var a=n.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function s(e,t){if(!(this instanceof s))return new s(e,t);r.apply(this),this._parser=new o(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,a.forEach(function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})})}(s.prototype=Object.create(r.prototype,{constructor:{value:s}})).write=function(n){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(n)){if(!this._decoder){var r=e("string_decoder").StringDecoder;this._decoder=new r("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,t){var n=this;return n._parser["on"+e]||-1===a.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),r.prototype.on.call(n,e,t)};var u="http://www.w3.org/XML/1998/namespace",c={xml:u,xmlns:"http://www.w3.org/2000/xmlns/"},l=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function p(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function g(e){return'"'===e||"'"===e}function y(e){return">"===e||p(e)}function v(e,t){return e.test(t)}function m(e,t){return!v(e,t)}var b,_,w,x=0;for(var S in n.STATE={BEGIN:x++,BEGIN_WHITESPACE:x++,TEXT:x++,TEXT_ENTITY:x++,OPEN_WAKA:x++,SGML_DECL:x++,SGML_DECL_QUOTED:x++,DOCTYPE:x++,DOCTYPE_QUOTED:x++,DOCTYPE_DTD:x++,DOCTYPE_DTD_QUOTED:x++,COMMENT_STARTING:x++,COMMENT:x++,COMMENT_ENDING:x++,COMMENT_ENDED:x++,CDATA:x++,CDATA_ENDING:x++,CDATA_ENDING_2:x++,PROC_INST:x++,PROC_INST_BODY:x++,PROC_INST_ENDING:x++,OPEN_TAG:x++,OPEN_TAG_SLASH:x++,ATTRIB:x++,ATTRIB_NAME:x++,ATTRIB_NAME_SAW_WHITE:x++,ATTRIB_VALUE:x++,ATTRIB_VALUE_QUOTED:x++,ATTRIB_VALUE_CLOSED:x++,ATTRIB_VALUE_UNQUOTED:x++,ATTRIB_VALUE_ENTITY_Q:x++,ATTRIB_VALUE_ENTITY_U:x++,CLOSE_TAG:x++,CLOSE_TAG_SAW_WHITE:x++,SCRIPT:x++,SCRIPT_ENDING:x++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(e){var t=n.ENTITIES[e],r="number"==typeof t?String.fromCharCode(t):t;n.ENTITIES[e]=r}),n.STATE)n.STATE[n.STATE[S]]=S;function E(e,t,n){e[t]&&e[t](n)}function j(e,t,n){e.textNode&&N(e),E(e,t,n)}function N(e){e.textNode=I(e.opt,e.textNode),e.textNode&&E(e,"ontext",e.textNode),e.textNode=""}function I(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function T(e,t){return N(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,E(e,"onerror",t),e}function A(e){return e.sawRoot&&!e.closedRoot&&k(e,"Unclosed root tag"),e.state!==x.BEGIN&&e.state!==x.BEGIN_WHITESPACE&&e.state!==x.TEXT&&T(e,"Unexpected end"),N(e),e.c="",e.closed=!0,E(e,"onend"),o.call(e,e.strict,e.opt),e}function k(e,t){if("object"!=typeof e||!(e instanceof o))throw new Error("bad call to strictFail");e.strict&&T(e,t)}function O(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,j(e,"onopentagstart",n)}function R(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function L(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=R(e.attribName,!0),n=t.local;if("xmlns"===t.prefix)if("xml"===n&&e.attribValue!==u)k(e,"xml: prefix must be bound to "+u+"\nActual: "+e.attribValue);else if("xmlns"===n&&"http://www.w3.org/2000/xmlns/"!==e.attribValue)k(e,"xmlns: prefix must be bound to http://www.w3.org/2000/xmlns/\nActual: "+e.attribValue);else{var r=e.tag,i=e.tags[e.tags.length-1]||e;r.ns===i.ns&&(r.ns=Object.create(i.ns)),r.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,j(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function M(e,t){if(e.opt.xmlns){var n=e.tag,r=R(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(k(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix),n.ns&&(e.tags[e.tags.length-1]||e).ns!==n.ns&&Object.keys(n.ns).forEach(function(t){j(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var i=0,o=e.attribList.length;i",e.tagName="",void(e.state=x.SCRIPT);j(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)k(e,"Unexpected close tag");if(t<0)return k(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=x.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,j(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];e.opt.xmlns&&o.ns!==(e.tags[e.tags.length-1]||e).ns&&Object.keys(o.ns).forEach(function(t){j(e,"onclosenamespace",{prefix:t,uri:o.ns[t]})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=x.TEXT}function C(e,t){"<"===t?(e.state=x.OPEN_WAKA,e.startTagPosition=e.position):p(t)||(k(e,"Non-whitespace before first tag."),e.textNode=t,e.state=x.TEXT)}function P(e,t){var n="";return t1114111||_(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?t.push(o):t.push(55296+((o-=65536)>>10),o%1024+56320),(n+1===r||t.length>e)&&(i+=b.apply(null,t),t.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:w,configurable:!0,writable:!0}):String.fromCodePoint=w)}(void 0===n?this.sax={}:n)}).call(this,e("buffer").Buffer)},{buffer:12,stream:97,string_decoder:113}],97:[function(e,t,n){t.exports=i;var r=e("events").EventEmitter;function i(){r.call(this)}e("inherits")(i,r),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(l(),0===r.listenerCount(this,"error"))throw e}function l(){n.removeListener("data",i),e.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("error",c),e.on("error",c),n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e}},{events:13,inherits:18,"readable-stream/duplex.js":98,"readable-stream/passthrough.js":107,"readable-stream/readable.js":108,"readable-stream/transform.js":109,"readable-stream/writable.js":110}],98:[function(e,t,n){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":99}],99:[function(e,t,n){"use strict";var r=e("process-nextick-args"),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=h;var o=Object.create(e("core-util-is"));o.inherits=e("inherits");var a=e("./_stream_readable"),s=e("./_stream_writable");o.inherits(h,a);for(var u=i(s.prototype),c=0;c0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):j(e,a)):w(e,a,t,!1))):r||(a.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(f("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(E,e):E(e))}function E(e){f("emit readable"),e.emit("readable"),A(e)}function j(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(N,e,t))}function N(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;return eo.length?o.length:e;if(i+=a===o.length?o:o.slice(0,e),0==(e-=a)){a===o.length?(++r,t.head=n.next?n.next:t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0==(e-=a)){a===o.length?(++i,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}(e,t),r}(e,t.buffer,t.decoder),n);var n}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function L(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return f("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):S(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&O(this),null;var r,i=t.needReadable;return f("need readable",i),(0===t.length||t.length-e0?k(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,f("pipe count=%d opts=%j",o.pipesCount,t);var u=t&&!1===t.end||e===n.stdout||e===n.stderr?m:c;function c(){f("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",function t(n,i){f("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,f("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",l),e.removeListener("error",g),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",m),r.removeListener("data",p),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())});var l=function(e){return function(){var t=e._readableState;f("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,A(e))}}(r);e.on("drain",l);var h=!1,d=!1;function p(t){f("ondata"),d=!1,!1!==e.write(t)||d||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==L(o.pipes,e))&&!h&&(f("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,d=!0),r.pause())}function g(t){f("onerror",t),m(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),m()}function v(){f("onfinish"),e.removeListener("close",y),m()}function m(){f("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener("error",n);e._events&&e._events.error?a(e._events.error)?e._events.error.unshift(n):e._events.error=[n,e._events.error]:e.on("error",n)}(e,0,g),e.once("close",y),e.once("finish",v),e.emit("pipe",r),o.flowing||(f("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o-1?i:o.nextTick;m.WritableState=v;var c=Object.create(e("core-util-is"));c.inherits=e("inherits");var l,h={deprecate:e("util-deprecate")},d=e("./internal/streams/stream"),f=e("safe-buffer").Buffer,p=r.Uint8Array||function(){},g=e("./internal/streams/destroy");function y(){}function v(t,n){s=s||e("./_stream_duplex");var r=n instanceof s;this.objectMode=!!(t=t||{}).objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark;this.highWaterMark=i||0===i?i:r&&(c||0===c)?c:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===t.decodeStrings),this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(o.nextTick(i,r),o.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),E(e,t))}(e,n,r,t,i);else{var a=x(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?u(_,e,n,a,i):_(e,n,a,i)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function m(t){if(s=s||e("./_stream_duplex"),!(l.call(m,this)||this instanceof s))return new m(t);this._writableState=new v(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),d.call(this)}function b(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function _(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),E(e,t)}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=new Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=n;for(var o=0,s=!0;n;)r[o]=n,n.isBuf||(s=!1),n=n.next,o+=1;r.allBuffers=s,b(e,t,!0,t.length,r,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk;if(b(e,t,!1,t.objectMode?1:u.length,u,n.encoding,n.callback),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),E(e,t)})}function E(e,t){var n=x(t);return n&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(m,d),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===m&&e&&e._writableState instanceof v}})):l=function(e){return e instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(f.isBuffer(r=e)||r instanceof p);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=y),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),o.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(r,a),i=!1),i}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n)),t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,E(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),m.prototype.destroy=g.destroy,m.prototype._undestroy=g.undestroy,m.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{"./_stream_duplex":99,"./internal/streams/destroy":105,"./internal/streams/stream":106,_process:62,"core-util-is":16,inherits:18,"process-nextick-args":61,"safe-buffer":111,timers:14,"util-deprecate":114}],104:[function(e,t,n){"use strict";var r=e("safe-buffer").Buffer,i=e("util");t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t=r.allocUnsafe(e>>>0),n=this.head,i=0;n;)n.data.copy(t,i),i+=n.data.length,n=n.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":111,util:11}],105:[function(e,t,n){"use strict";var r=e("process-nextick-args");function i(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var n=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":61}],106:[function(e,t,n){arguments[4][91][0].apply(n,arguments)},{dup:91,events:13}],107:[function(e,t,n){t.exports=e("./readable").PassThrough},{"./readable":108}],108:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":99,"./lib/_stream_passthrough.js":100,"./lib/_stream_readable.js":101,"./lib/_stream_transform.js":102,"./lib/_stream_writable.js":103}],109:[function(e,t,n){t.exports=e("./readable").Transform},{"./readable":108}],110:[function(e,t,n){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":103}],111:[function(e,t,n){var r=e("buffer"),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,n),n.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},{buffer:12}],112:[function(e,t,n){"use strict";var r=e("safe-buffer").Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=h,t=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":111}],113:[function(e,t,n){arguments[4][112][0].apply(n,arguments)},{dup:112,"safe-buffer":95}],114:[function(e,t,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(r){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],115:[function(e,t,n){"use strict";t.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},{}],116:[function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n"']/g,P=RegExp(D.source),F=RegExp(C.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,G=/<%=([\s\S]+?)%>/g,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V=/^\w*$/,q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,W=RegExp(K.source),H=/^\s+|\s+$/g,J=/^\s+/,$=/\s+$/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Q=/\{\n\/\* \[wrapped with (.+)\] \*/,Y=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/\\(\\)?/g,te=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ne=/\w*$/,re=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ae=/^0o[0-7]+$/i,se=/^(?:0|[1-9]\d*)$/,ue=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ce=/($^)/,le=/['\n\r\u2028\u2029\\]/g,he="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fe="["+de+"]",pe="["+he+"]",ge="\\d+",ye="[a-z\\xdf-\\xf6\\xf8-\\xff]",ve="[^\\ud800-\\udfff"+de+ge+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",me="\\ud83c[\\udffb-\\udfff]",be="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",we="[\\ud800-\\udbff][\\udc00-\\udfff]",xe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Se="(?:"+ye+"|"+ve+")",Ee="(?:"+xe+"|"+ve+")",je="(?:"+pe+"|"+me+")?",Ne="[\\ufe0e\\ufe0f]?"+je+"(?:\\u200d(?:"+[be,_e,we].join("|")+")[\\ufe0e\\ufe0f]?"+je+")*",Ie="(?:"+["[\\u2700-\\u27bf]",_e,we].join("|")+")"+Ne,Te="(?:"+[be+pe+"?",pe,_e,we,"[\\ud800-\\udfff]"].join("|")+")",Ae=RegExp("['\u2019]","g"),ke=RegExp(pe,"g"),Oe=RegExp(me+"(?="+me+")|"+Te+Ne,"g"),Re=RegExp([xe+"?"+ye+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[fe,xe,"$"].join("|")+")",Ee+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[fe,xe+Se,"$"].join("|")+")",xe+"?"+Se+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",xe+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ge,Ie].join("|"),"g"),Le=RegExp("[\\u200d\\ud800-\\udfff"+he+"\\ufe0e\\ufe0f]"),Me=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,De=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ce=-1,Pe={};Pe[E]=Pe[j]=Pe[N]=Pe[I]=Pe[T]=Pe[A]=Pe["[object Uint8ClampedArray]"]=Pe[k]=Pe[O]=!0,Pe[s]=Pe[u]=Pe[x]=Pe[c]=Pe[S]=Pe[l]=Pe[h]=Pe[d]=Pe[p]=Pe[g]=Pe[y]=Pe[v]=Pe[m]=Pe[b]=Pe[w]=!1;var Fe={};Fe[s]=Fe[u]=Fe[x]=Fe[S]=Fe[c]=Fe[l]=Fe[E]=Fe[j]=Fe[N]=Fe[I]=Fe[T]=Fe[p]=Fe[g]=Fe[y]=Fe[v]=Fe[m]=Fe[b]=Fe[_]=Fe[A]=Fe["[object Uint8ClampedArray]"]=Fe[k]=Fe[O]=!0,Fe[h]=Fe[d]=Fe[w]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,Ge=parseInt,ze="object"==typeof global&&global&&global.Object===Object&&global,Ve="object"==typeof self&&self&&self.Object===Object&&self,qe=ze||Ve||Function("return this")(),Ke=t&&!t.nodeType&&t,We=Ke&&"object"==typeof e&&e&&!e.nodeType&&e,He=We&&We.exports===Ke,Je=He&&ze.process,$e=function(){try{return We&&We.require&&We.require("util").types||Je&&Je.binding&&Je.binding("util")}catch(e){}}(),Xe=$e&&$e.isArrayBuffer,Qe=$e&&$e.isDate,Ye=$e&&$e.isMap,Ze=$e&&$e.isRegExp,et=$e&&$e.isSet,tt=$e&&$e.isTypedArray;function nt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function rt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function ct(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Ot(e,t){for(var n=e.length;n--&&mt(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Lt=St({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),Mt=St({"&":"&","<":"<",">":">",'"':""","'":"'"});function Dt(e){return"\\"+Be[e]}function Ct(e){return Le.test(e)}function Pt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Ft(e,t){return function(n){return e(t(n))}}function Bt(e,t){for(var n=-1,r=e.length,i=0,a=[];++n",""":'"',"'":"'"}),Kt=function e(t){var n,r=(t=null==t?qe:Kt.defaults(qe.Object(),t,Kt.pick(qe,De))).Array,he=t.Date,de=t.Error,fe=t.Function,pe=t.Math,ge=t.Object,ye=t.RegExp,ve=t.String,me=t.TypeError,be=r.prototype,_e=ge.prototype,we=t["__core-js_shared__"],xe=fe.prototype.toString,Se=_e.hasOwnProperty,Ee=0,je=(n=/[^.]+$/.exec(we&&we.keys&&we.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ne=_e.toString,Ie=xe.call(ge),Te=qe._,Oe=ye("^"+xe.call(Se).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=He?t.Buffer:void 0,Be=t.Symbol,ze=t.Uint8Array,Ve=Le?Le.allocUnsafe:void 0,Ke=Ft(ge.getPrototypeOf,ge),We=ge.create,Je=_e.propertyIsEnumerable,$e=be.splice,gt=Be?Be.isConcatSpreadable:void 0,St=Be?Be.iterator:void 0,Wt=Be?Be.toStringTag:void 0,Ht=function(){try{var e=Qi(ge,"defineProperty");return e({},"",{}),e}catch(t){}}(),Jt=t.clearTimeout!==qe.clearTimeout&&t.clearTimeout,$t=he&&he.now!==qe.Date.now&&he.now,Xt=t.setTimeout!==qe.setTimeout&&t.setTimeout,Qt=pe.ceil,Yt=pe.floor,Zt=ge.getOwnPropertySymbols,en=Le?Le.isBuffer:void 0,tn=t.isFinite,nn=be.join,rn=Ft(ge.keys,ge),on=pe.max,an=pe.min,sn=he.now,un=t.parseInt,cn=pe.random,ln=be.reverse,hn=Qi(t,"DataView"),dn=Qi(t,"Map"),fn=Qi(t,"Promise"),pn=Qi(t,"Set"),gn=Qi(t,"WeakMap"),yn=Qi(ge,"create"),vn=gn&&new gn,mn={},bn=Io(hn),_n=Io(dn),wn=Io(fn),xn=Io(pn),Sn=Io(gn),En=Be?Be.prototype:void 0,jn=En?En.valueOf:void 0,Nn=En?En.toString:void 0;function In(e){if(qa(e)&&!La(e)&&!(e instanceof On)){if(e instanceof kn)return e;if(Se.call(e,"__wrapped__"))return To(e)}return new kn(e)}var Tn=function(){function e(){}return function(t){if(!Va(t))return{};if(We)return We(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function An(){}function kn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function On(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function $n(e,t,n,r,i,o){var a,u=1&t,h=2&t,w=4&t;if(n&&(a=i?n(e,r,i,o):n(e)),void 0!==a)return a;if(!Va(e))return e;var R=La(e);if(R){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!u)return gi(e,a)}else{var L=eo(e),M=L==d||L==f;if(Pa(e))return ci(e,u);if(L==y||L==s||M&&!i){if(a=h||M?{}:no(e),!u)return h?function(e,t){return yi(e,Zi(e),t)}(e,function(e,t){return e&&yi(t,ws(t),e)}(a,e)):function(e,t){return yi(e,Yi(e),t)}(e,Kn(a,e))}else{if(!Fe[L])return i?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case x:return li(e);case c:case l:return new r(+e);case S:return function(e,t){var n=t?li(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case E:case j:case N:case I:case T:case A:case"[object Uint8ClampedArray]":case k:case O:return hi(e,n);case p:return new r;case g:case b:return new r(e);case v:return function(e){var t=new e.constructor(e.source,ne.exec(e));return t.lastIndex=e.lastIndex,t}(e);case m:return new r;case _:return jn?ge(jn.call(e)):{}}}(e,L,u)}}o||(o=new Cn);var D=o.get(e);if(D)return D;o.set(e,a),$a(e)?e.forEach(function(r){a.add($n(r,t,n,r,e,o))}):Ka(e)&&e.forEach(function(r,i){a.set(i,$n(r,t,n,i,e,o))});var C=R?void 0:(w?h?qi:Vi:h?ws:_s)(e);return it(C||e,function(r,i){C&&(r=e[i=r]),zn(a,i,$n(r,t,n,i,e,o))}),a}function Xn(e,t,n){var r=n.length;if(null==e)return!r;for(e=ge(e);r--;){var i=n[r],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Qn(e,t,n){if("function"!=typeof e)throw new me(i);return mo(function(){e.apply(void 0,n)},t)}function Yn(e,t,n,r){var i=-1,o=ut,a=!0,s=e.length,u=[],c=t.length;if(!s)return u;n&&(t=lt(t,It(n))),r?(o=ct,a=!1):t.length>=200&&(o=At,a=!1,t=new Dn(t));e:for(;++i-1},Ln.prototype.set=function(e,t){var n=this.__data__,r=Vn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Mn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(dn||Ln),string:new Rn}},Mn.prototype.delete=function(e){var t=$i(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return $i(this,e).get(e)},Mn.prototype.has=function(e){return $i(this,e).has(e)},Mn.prototype.set=function(e,t){var n=$i(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Dn.prototype.add=Dn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Dn.prototype.has=function(e){return this.__data__.has(e)},Cn.prototype.clear=function(){this.__data__=new Ln,this.size=0},Cn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Cn.prototype.get=function(e){return this.__data__.get(e)},Cn.prototype.has=function(e){return this.__data__.has(e)},Cn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ln){var r=n.__data__;if(!dn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Mn(r)}return n.set(e,t),this.size=n.size,this};var Zn=bi(sr),er=bi(ur,!0);function tr(e,t){var n=!0;return Zn(e,function(e,r,i){return n=!!t(e,r,i)}),n}function nr(e,t,n){for(var r=-1,i=e.length;++r0&&n(s)?t>1?ir(s,t-1,n,r,i):ht(i,s):r||(i[i.length]=s)}return i}var or=_i(),ar=_i(!0);function sr(e,t){return e&&or(e,t,_s)}function ur(e,t){return e&&ar(e,t,_s)}function cr(e,t){return st(t,function(t){return Ua(e[t])})}function lr(e,t){for(var n=0,r=(t=oi(t,e)).length;null!=e&&nt}function pr(e,t){return null!=e&&Se.call(e,t)}function gr(e,t){return null!=e&&t in ge(e)}function yr(e,t,n){for(var i=n?ct:ut,o=e[0].length,a=e.length,s=a,u=r(a),c=1/0,l=[];s--;){var h=e[s];s&&t&&(h=lt(h,It(t))),c=an(h.length,c),u[s]=!n&&(t||o>=120&&h.length>=120)?new Dn(s&&h):void 0}h=e[0];var d=-1,f=u[0];e:for(;++d=s?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});r--;)e[r]=e[r].value;return e}(jr(e,function(e,n,i){return{criteria:lt(t,function(t){return t(e)}),index:++r,value:e}}))}function Or(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&$e.call(s,u,1),$e.call(e,u,1);return e}function Lr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;io(i)?$e.call(e,i,1):Qr(e,i)}}return e}function Mr(e,t){return e+Yt(cn()*(t-e+1))}function Dr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Yt(t/2))&&(e+=e)}while(t);return n}function Cr(e,t){return bo(fo(e,t,Ws),e+"")}function Pr(e){return Fn(As(e))}function Fr(e,t){var n=As(e);return xo(n,Jn(t,0,n.length))}function Br(e,t,n,r){if(!Va(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,s=e;null!=s&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i>>1,a=e[o];null!==a&&!Qa(a)&&(n?a<=t:a=200){var c=t?null:Di(e);if(c)return Ut(c);a=!1,i=At,u=new Dn}else u=t?[]:s;e:for(;++r=r?e:Vr(e,t,n)}var ui=Jt||function(e){return qe.clearTimeout(e)};function ci(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function li(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function hi(e,t){var n=t?li(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function di(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=Qa(e),a=void 0!==t,s=null===t,u=t==t,c=Qa(t);if(!s&&!c&&!o&&e>t||o&&a&&u&&!s&&!c||r&&a&&u||!n&&u||!i)return 1;if(!r&&!o&&!c&&e1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=ge(t);++r-1?i[o?t[a]:a]:void 0}}function ji(e){return zi(function(t){var n=t.length,r=n,o=kn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new me(i);if(o&&!s&&"wrapper"==Wi(a))var s=new kn([],!0)}for(r=s?r:n;++r1&&b.reverse(),h&&cs))return!1;var c=o.get(e),l=o.get(t);if(c&&l)return c==t&&l==e;var h=-1,d=!0,f=2&n?new Dn:void 0;for(o.set(e,t),o.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(X,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return it(a,function(n){var r="_."+n[0];t&n[1]&&!ut(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(Q);return t?t[1].split(Y):[]}(r),n)))}function wo(e){var t=0,n=0;return function(){var r=sn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function xo(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Jo(e,n)});function ta(e){var t=In(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var ra=zi(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Hn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof On&&io(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new kn(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=vi(function(e,t,n){Se.call(e,n)?++e[n]:Wn(e,n,1)}),oa=Ei(Ro),aa=Ei(Lo);function sa(e,t){return(La(e)?it:Zn)(e,Ji(t,3))}function ua(e,t){return(La(e)?ot:er)(e,Ji(t,3))}var ca=vi(function(e,t,n){Se.call(e,n)?e[n].push(t):Wn(e,n,[t])}),la=Cr(function(e,t,n){var i=-1,o="function"==typeof t,a=Da(e)?r(e.length):[];return Zn(e,function(e){a[++i]=o?nt(t,e,n):vr(e,t,n)}),a}),ha=vi(function(e,t,n){Wn(e,n,t)});function da(e,t){return(La(e)?lt:jr)(e,Ji(t,3))}var fa=vi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Cr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),kr(e,ir(t,1),[])}),ga=$t||function(){return qe.Date.now()};function ya(e,t,n){return t=n?void 0:t,Pi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function va(e,t){var n;if("function"!=typeof t)throw new me(i);return e=rs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ma=Cr(function(e,t,n){var r=1;if(n.length){var i=Bt(n,Hi(ma));r|=32}return Pi(e,r,t,n,i)}),ba=Cr(function(e,t,n){var r=3;if(n.length){var i=Bt(n,Hi(ba));r|=32}return Pi(t,r,e,n,i)});function _a(e,t,n){var r,o,a,s,u,c,l=0,h=!1,d=!1,f=!0;if("function"!=typeof e)throw new me(i);function p(t){var n=r,i=o;return r=o=void 0,l=t,s=e.apply(i,n)}function g(e){return l=e,u=mo(v,t),h?p(e):s}function y(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=a}function v(){var e=ga();if(y(e))return m(e);u=mo(v,function(e){var n=t-(e-c);return d?an(n,a-(e-l)):n}(e))}function m(e){return u=void 0,f&&r?p(e):(r=o=void 0,s)}function b(){var e=ga(),n=y(e);if(r=arguments,o=this,c=e,n){if(void 0===u)return g(c);if(d)return ui(u),u=mo(v,t),p(c)}return void 0===u&&(u=mo(v,t)),s}return t=os(t)||0,Va(n)&&(h=!!n.leading,a=(d="maxWait"in n)?on(os(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),b.cancel=function(){void 0!==u&&ui(u),l=0,r=c=o=u=void 0},b.flush=function(){return void 0===u?s:m(ga())},b}var wa=Cr(function(e,t){return Qn(e,1,t)}),xa=Cr(function(e,t,n){return Qn(e,os(t)||0,n)});function Sa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new me(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Sa.Cache||Mn),n}function Ea(e){if("function"!=typeof e)throw new me(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Sa.Cache=Mn;var ja=ai(function(e,t){var n=(t=1==t.length&&La(t[0])?lt(t[0],It(Ji())):lt(ir(t,1),It(Ji()))).length;return Cr(function(r){for(var i=-1,o=an(r.length,n);++i=t}),Ra=mr(function(){return arguments}())?mr:function(e){return qa(e)&&Se.call(e,"callee")&&!Je.call(e,"callee")},La=r.isArray,Ma=Xe?It(Xe):function(e){return qa(e)&&dr(e)==x};function Da(e){return null!=e&&za(e.length)&&!Ua(e)}function Ca(e){return qa(e)&&Da(e)}var Pa=en||ou,Fa=Qe?It(Qe):function(e){return qa(e)&&dr(e)==l};function Ba(e){if(!qa(e))return!1;var t=dr(e);return t==h||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ha(e)}function Ua(e){if(!Va(e))return!1;var t=dr(e);return t==d||t==f||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ga(e){return"number"==typeof e&&e==rs(e)}function za(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Va(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function qa(e){return null!=e&&"object"==typeof e}var Ka=Ye?It(Ye):function(e){return qa(e)&&eo(e)==p};function Wa(e){return"number"==typeof e||qa(e)&&dr(e)==g}function Ha(e){if(!qa(e)||dr(e)!=y)return!1;var t=Ke(e);if(null===t)return!0;var n=Se.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&xe.call(n)==Ie}var Ja=Ze?It(Ze):function(e){return qa(e)&&dr(e)==v},$a=et?It(et):function(e){return qa(e)&&eo(e)==m};function Xa(e){return"string"==typeof e||!La(e)&&qa(e)&&dr(e)==b}function Qa(e){return"symbol"==typeof e||qa(e)&&dr(e)==_}var Ya=tt?It(tt):function(e){return qa(e)&&za(e.length)&&!!Pe[dr(e)]},Za=Ri(Er),es=Ri(function(e,t){return e<=t});function ts(e){if(!e)return[];if(Da(e))return Xa(e)?Vt(e):gi(e);if(St&&e[St])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[St]());var t=eo(e);return(t==p?Pt:t==m?Ut:As)(e)}function ns(e){return e?1/0===(e=os(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function rs(e){var t=ns(e),n=t%1;return t==t?n?t-n:t:0}function is(e){return e?Jn(rs(e),0,4294967295):0}function os(e){if("number"==typeof e)return e;if(Qa(e))return NaN;if(Va(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Va(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(H,"");var n=ie.test(e);return n||ae.test(e)?Ge(e.slice(2),n?2:8):re.test(e)?NaN:+e}function as(e){return yi(e,ws(e))}function ss(e){return null==e?"":$r(e)}var us=mi(function(e,t){if(co(t)||Da(t))yi(t,_s(t),e);else for(var n in t)Se.call(t,n)&&zn(e,n,t[n])}),cs=mi(function(e,t){yi(t,ws(t),e)}),ls=mi(function(e,t,n,r){yi(t,ws(t),e,r)}),hs=mi(function(e,t,n,r){yi(t,_s(t),e,r)}),ds=zi(Hn),fs=Cr(function(e,t){e=ge(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(r=1);++n1),t}),yi(e,qi(e),n),r&&(n=$n(n,7,Ui));for(var i=t.length;i--;)Qr(n,t[i]);return n}),js=zi(function(e,t){return null==e?{}:function(e,t){return Or(e,t,function(t,n){return ys(e,n)})}(e,t)});function Ns(e,t){if(null==e)return{};var n=lt(qi(e),function(e){return[e]});return t=Ji(t),Or(e,n,function(e,n){return t(e,n[0])})}var Is=Ci(_s),Ts=Ci(ws);function As(e){return null==e?[]:Tt(e,_s(e))}var ks=xi(function(e,t,n){return t=t.toLowerCase(),e+(n?Os(t):t)});function Os(e){return Bs(ss(e).toLowerCase())}function Rs(e){return(e=ss(e))&&e.replace(ue,Lt).replace(ke,"")}var Ls=xi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ms=xi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ds=wi("toLowerCase"),Cs=xi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ps=xi(function(e,t,n){return e+(n?" ":"")+Bs(t)}),Fs=xi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Bs=wi("toUpperCase");function Us(e,t,n){return e=ss(e),void 0===(t=n?void 0:t)?function(e){return Me.test(e)}(e)?function(e){return e.match(Re)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Gs=Cr(function(e,t){try{return nt(e,void 0,t)}catch(n){return Ba(n)?n:new de(n)}}),zs=zi(function(e,t){return it(t,function(t){t=No(t),Wn(e,t,ma(e[t],e))}),e});function Vs(e){return function(){return e}}var qs=ji(),Ks=ji(!0);function Ws(e){return e}function Hs(e){return xr("function"==typeof e?e:$n(e,1))}var Js=Cr(function(e,t){return function(n){return vr(n,e,t)}}),$s=Cr(function(e,t){return function(n){return vr(e,n,t)}});function Xs(e,t,n){var r=_s(t),i=cr(t,r);null!=n||Va(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=cr(t,_s(t)));var o=!(Va(n)&&"chain"in n&&!n.chain),a=Ua(e);return it(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=gi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ht([this.value()],arguments))})}),e}function Qs(){}var Ys=Ai(lt),Zs=Ai(at),eu=Ai(pt);function tu(e){return ao(e)?xt(No(e)):function(e){return function(t){return lr(t,e)}}(e)}var nu=Oi(),ru=Oi(!0);function iu(){return[]}function ou(){return!1}var au,su=Ti(function(e,t){return e+t},0),uu=Mi("ceil"),cu=Ti(function(e,t){return e/t},1),lu=Mi("floor"),hu=Ti(function(e,t){return e*t},1),du=Mi("round"),fu=Ti(function(e,t){return e-t},0);return In.after=function(e,t){if("function"!=typeof t)throw new me(i);return e=rs(e),function(){if(--e<1)return t.apply(this,arguments)}},In.ary=ya,In.assign=us,In.assignIn=cs,In.assignInWith=ls,In.assignWith=hs,In.at=ds,In.before=va,In.bind=ma,In.bindAll=zs,In.bindKey=ba,In.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return La(e)?e:[e]},In.chain=ta,In.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(rs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=r(Qt(i/t));oi?0:i+n),(r=void 0===r||r>i?i:rs(r))<0&&(r+=i),r=n>r?0:is(r);n>>0)?(e=ss(e))&&("string"==typeof t||null!=t&&!Ja(t))&&!(t=$r(t))&&Ct(e)?si(Vt(e),0,n):e.split(t,n):[]},In.spread=function(e,t){if("function"!=typeof e)throw new me(i);return t=null==t?0:on(rs(t),0),Cr(function(n){var r=n[t],i=si(n,0,t);return r&&ht(i,r),nt(e,this,i)})},In.tail=function(e){var t=null==e?0:e.length;return t?Vr(e,1,t):[]},In.take=function(e,t,n){return e&&e.length?Vr(e,0,(t=n||void 0===t?1:rs(t))<0?0:t):[]},In.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Vr(e,(t=r-(t=n||void 0===t?1:rs(t)))<0?0:t,r):[]},In.takeRightWhile=function(e,t){return e&&e.length?Zr(e,Ji(t,3),!1,!0):[]},In.takeWhile=function(e,t){return e&&e.length?Zr(e,Ji(t,3)):[]},In.tap=function(e,t){return t(e),e},In.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new me(i);return Va(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),_a(e,t,{leading:r,maxWait:t,trailing:o})},In.thru=na,In.toArray=ts,In.toPairs=Is,In.toPairsIn=Ts,In.toPath=function(e){return La(e)?lt(e,No):Qa(e)?[e]:gi(jo(ss(e)))},In.toPlainObject=as,In.transform=function(e,t,n){var r=La(e),i=r||Pa(e)||Ya(e);if(t=Ji(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Va(e)&&Ua(o)?Tn(Ke(e)):{}}return(i?it:sr)(e,function(e,r,i){return t(n,e,r,i)}),n},In.unary=function(e){return ya(e,1)},In.union=qo,In.unionBy=Ko,In.unionWith=Wo,In.uniq=function(e){return e&&e.length?Xr(e):[]},In.uniqBy=function(e,t){return e&&e.length?Xr(e,Ji(t,2)):[]},In.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xr(e,void 0,t):[]},In.unset=function(e,t){return null==e||Qr(e,t)},In.unzip=Ho,In.unzipWith=Jo,In.update=function(e,t,n){return null==e?e:Yr(e,t,ii(n))},In.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Yr(e,t,ii(n),r)},In.values=As,In.valuesIn=function(e){return null==e?[]:Tt(e,ws(e))},In.without=$o,In.words=Us,In.wrap=function(e,t){return Na(ii(t),e)},In.xor=Xo,In.xorBy=Qo,In.xorWith=Yo,In.zip=Zo,In.zipObject=function(e,t){return ni(e||[],t||[],zn)},In.zipObjectDeep=function(e,t){return ni(e||[],t||[],Br)},In.zipWith=ea,In.entries=Is,In.entriesIn=Ts,In.extend=cs,In.extendWith=ls,Xs(In,In),In.add=su,In.attempt=Gs,In.camelCase=ks,In.capitalize=Os,In.ceil=uu,In.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=os(n))==n?n:0),void 0!==t&&(t=(t=os(t))==t?t:0),Jn(os(e),t,n)},In.clone=function(e){return $n(e,4)},In.cloneDeep=function(e){return $n(e,5)},In.cloneDeepWith=function(e,t){return $n(e,5,t="function"==typeof t?t:void 0)},In.cloneWith=function(e,t){return $n(e,4,t="function"==typeof t?t:void 0)},In.conformsTo=function(e,t){return null==t||Xn(e,t,_s(t))},In.deburr=Rs,In.defaultTo=function(e,t){return null==e||e!=e?t:e},In.divide=cu,In.endsWith=function(e,t,n){e=ss(e),t=$r(t);var r=e.length,i=n=void 0===n?r:Jn(rs(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},In.eq=Aa,In.escape=function(e){return(e=ss(e))&&F.test(e)?e.replace(C,Mt):e},In.escapeRegExp=function(e){return(e=ss(e))&&W.test(e)?e.replace(K,"\\$&"):e},In.every=function(e,t,n){var r=La(e)?at:tr;return n&&oo(e,t,n)&&(t=void 0),r(e,Ji(t,3))},In.find=oa,In.findIndex=Ro,In.findKey=function(e,t){return yt(e,Ji(t,3),sr)},In.findLast=aa,In.findLastIndex=Lo,In.findLastKey=function(e,t){return yt(e,Ji(t,3),ur)},In.floor=lu,In.forEach=sa,In.forEachRight=ua,In.forIn=function(e,t){return null==e?e:or(e,Ji(t,3),ws)},In.forInRight=function(e,t){return null==e?e:ar(e,Ji(t,3),ws)},In.forOwn=function(e,t){return e&&sr(e,Ji(t,3))},In.forOwnRight=function(e,t){return e&&ur(e,Ji(t,3))},In.get=gs,In.gt=ka,In.gte=Oa,In.has=function(e,t){return null!=e&&to(e,t,pr)},In.hasIn=ys,In.head=Do,In.identity=Ws,In.includes=function(e,t,n,r){e=Da(e)?e:As(e),n=n&&!r?rs(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Xa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&mt(e,t,n)>-1},In.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:rs(n);return i<0&&(i=on(r+i,0)),mt(e,t,i)},In.inRange=function(e,t,n){return t=ns(t),void 0===n?(n=t,t=0):n=ns(n),function(e,t,n){return e>=an(t,n)&&e=-9007199254740991&&e<=9007199254740991},In.isSet=$a,In.isString=Xa,In.isSymbol=Qa,In.isTypedArray=Ya,In.isUndefined=function(e){return void 0===e},In.isWeakMap=function(e){return qa(e)&&eo(e)==w},In.isWeakSet=function(e){return qa(e)&&"[object WeakSet]"==dr(e)},In.join=function(e,t){return null==e?"":nn.call(e,t)},In.kebabCase=Ls,In.last=Bo,In.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=rs(n))<0?on(r+i,0):an(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):vt(e,_t,i,!0)},In.lowerCase=Ms,In.lowerFirst=Ds,In.lt=Za,In.lte=es,In.max=function(e){return e&&e.length?nr(e,Ws,fr):void 0},In.maxBy=function(e,t){return e&&e.length?nr(e,Ji(t,2),fr):void 0},In.mean=function(e){return wt(e,Ws)},In.meanBy=function(e,t){return wt(e,Ji(t,2))},In.min=function(e){return e&&e.length?nr(e,Ws,Er):void 0},In.minBy=function(e,t){return e&&e.length?nr(e,Ji(t,2),Er):void 0},In.stubArray=iu,In.stubFalse=ou,In.stubObject=function(){return{}},In.stubString=function(){return""},In.stubTrue=function(){return!0},In.multiply=hu,In.nth=function(e,t){return e&&e.length?Ar(e,rs(t)):void 0},In.noConflict=function(){return qe._===this&&(qe._=Te),this},In.noop=Qs,In.now=ga,In.pad=function(e,t,n){e=ss(e);var r=(t=rs(t))?zt(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return ki(Yt(i),n)+e+ki(Qt(i),n)},In.padEnd=function(e,t,n){e=ss(e);var r=(t=rs(t))?zt(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var i=cn();return an(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Mr(e,t)},In.reduce=function(e,t,n){var r=La(e)?dt:Et,i=arguments.length<3;return r(e,Ji(t,4),n,i,Zn)},In.reduceRight=function(e,t,n){var r=La(e)?ft:Et,i=arguments.length<3;return r(e,Ji(t,4),n,i,er)},In.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:rs(t),Dr(ss(e),t)},In.replace=function(){var e=arguments,t=ss(e[0]);return e.length<3?t:t.replace(e[1],e[2])},In.result=function(e,t,n){var r=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++r9007199254740991)return[];var n=4294967295,r=an(e,4294967295);e-=4294967295;for(var i=Nt(r,t=Ji(t));++n=o)return e;var s=n-zt(r);if(s<1)return r;var u=a?si(a,0,s).join(""):e.slice(0,s);if(void 0===i)return u+r;if(a&&(s+=u.length-s),Ja(i)){if(e.slice(s).search(i)){var c,l=u;for(i.global||(i=ye(i.source,ss(ne.exec(i))+"g")),i.lastIndex=0;c=i.exec(l);)var h=c.index;u=u.slice(0,void 0===h?s:h)}}else if(e.indexOf($r(i),s)!=s){var d=u.lastIndexOf(i);d>-1&&(u=u.slice(0,d))}return u+r},In.unescape=function(e){return(e=ss(e))&&P.test(e)?e.replace(D,qt):e},In.uniqueId=function(e){var t=++Ee;return ss(e)+t},In.upperCase=Fs,In.upperFirst=Bs,In.each=sa,In.eachRight=ua,In.first=Do,Xs(In,(au={},sr(In,function(e,t){Se.call(In.prototype,t)||(au[t]=e)}),au),{chain:!1}),In.VERSION="4.17.19",it(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){In[e].placeholder=In}),it(["drop","take"],function(e,t){On.prototype[e]=function(n){n=void 0===n?1:on(rs(n),0);var r=this.__filtered__&&!t?new On(this):this.clone();return r.__filtered__?r.__takeCount__=an(n,r.__takeCount__):r.__views__.push({size:an(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},On.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),it(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;On.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ji(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),it(["head","last"],function(e,t){var n="take"+(t?"Right":"");On.prototype[e]=function(){return this[n](1).value()[0]}}),it(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");On.prototype[e]=function(){return this.__filtered__?new On(this):this[n](1)}}),On.prototype.compact=function(){return this.filter(Ws)},On.prototype.find=function(e){return this.filter(e).head()},On.prototype.findLast=function(e){return this.reverse().find(e)},On.prototype.invokeMap=Cr(function(e,t){return"function"==typeof e?new On(this):this.map(function(n){return vr(n,e,t)})}),On.prototype.reject=function(e){return this.filter(Ea(Ji(e)))},On.prototype.slice=function(e,t){e=rs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new On(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=rs(t))<0?n.dropRight(-t):n.take(t-e)),n)},On.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},On.prototype.toArray=function(){return this.take(4294967295)},sr(On.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=In[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);i&&(In.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,s=t instanceof On,u=a[0],c=s||La(t),l=function(e){var t=i.apply(In,ht([e],a));return r&&h?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(s=c=!1);var h=this.__chain__,d=!!this.__actions__.length,f=o&&!h,p=s&&!d;if(!o&&c){t=p?t:new On(this);var g=e.apply(t,a);return g.__actions__.push({func:na,args:[l],thisArg:void 0}),new kn(g,h)}return f&&p?e.apply(this,a):(g=this.thru(l),f?r?g.value()[0]:g.value():g)})}),it(["pop","push","shift","sort","splice","unshift"],function(e){var t=be[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);In.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(La(i)?i:[],e)}return this[n](function(n){return t.apply(La(n)?n:[],e)})}}),sr(On.prototype,function(e,t){var n=In[t];if(n){var r=n.name+"";Se.call(mn,r)||(mn[r]=[]),mn[r].push({name:t,func:n})}}),mn[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],On.prototype.clone=function(){var e=new On(this.__wrapped__);return e.__actions__=gi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=gi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=gi(this.__views__),e},On.prototype.reverse=function(){if(this.__filtered__){var e=new On(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},On.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=La(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},In.prototype.plant=function(e){for(var t,n=this;n instanceof An;){var r=To(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},In.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof On){var t=e;return this.__actions__.length&&(t=new On(this)),(t=t.reverse()).__actions__.push({func:na,args:[Vo],thisArg:void 0}),new kn(t,this.__chain__)}return this.thru(Vo)},In.prototype.toJSON=In.prototype.valueOf=In.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},In.prototype.first=In.prototype.head,St&&(In.prototype[St]=function(){return this}),In}();qe._=Kt,void 0===(r=(function(){return Kt}).call(t,n,t,e))||(e.exports=r)}).call(this)}).call(this,n("YuTi")(e))},PDru:function(e,t){var n="undefined"!=typeof ArrayBuffer,r="undefined"!=typeof Symbol;function i(e,t){var i,o,a,s,u;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof t)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||n&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(a=0,s=e.length;a0)throw new Error("Parser error")}}function s(e,t,n){var r="";return 0!==e&&(""!==n?r+=e<0?" - ":" + ":e<0&&(r+="-"),1===(e=Math.abs(e))&&""!==t||(r+=e),r+=t),r}function u(e,t,n,r){if(!(this instanceof u))return new u(e,t,n,r);a(this,e,t,n,r)}u.prototype={w:1,x:0,y:0,z:0,add:function(e,t,n,r){return a(o,e,t,n,r),new u(this.w+o.w,this.x+o.x,this.y+o.y,this.z+o.z)},sub:function(e,t,n,r){return a(o,e,t,n,r),new u(this.w-o.w,this.x-o.x,this.y-o.y,this.z-o.z)},neg:function(){return new u(-this.w,-this.x,-this.y,-this.z)},norm:function(){var e=this.w,t=this.x,n=this.y,r=this.z;return Math.sqrt(e*e+t*t+n*n+r*r)},normSq:function(){var e=this.w,t=this.x,n=this.y,r=this.z;return e*e+t*t+n*n+r*r},normalize:function(){var e=this.w,t=this.x,n=this.y,r=this.z,i=Math.sqrt(e*e+t*t+n*n+r*r);return i=0)return new u(Math.pow(s,o.w),0,0,0);if(0===s)switch(o.w%4){case 0:return new u(Math.pow(c,o.w),0,0,0);case 1:return new u(0,Math.pow(c,o.w),0,0);case 2:return new u(-Math.pow(c,o.w),0,0,0);case 3:return new u(0,-Math.pow(c,o.w),0,0)}}return s=Math.exp(o.w*h-o.x*l),c=o.x*h+o.w*l,new u(s*Math.cos(c),s*Math.sin(c),0,0)}}return this.log().mul(o).exp()},equals:function(e,t,n,r){a(o,e,t,n,r);var i=u.EPSILON;return Math.abs(o.w-this.w).9995)return function(e){return new u(i+e*(h-i),s+e*(d-s),c+e*(f-c),l+e*(p-l)).normalize()};var y=Math.acos(g),v=Math.sin(y);return function(e){var t=y*e,n=Math.sin(t),r=Math.cos(t)-g*n/v,o=n/v;return new u(r*i+o*h,r*s+o*d,r*c+o*f,r*l+o*p)}}},u.ZERO=new u(0,0,0,0),u.ONE=new u(1,0,0,0),u.I=new u(0,1,0,0),u.J=new u(0,0,1,0),u.K=new u(0,0,0,1),u.EPSILON=1e-16,u.fromAxisAngle=function(e,t){var n=.5*t,r=e[0],i=e[1],o=e[2],a=Math.sin(n),s=Math.cos(n),c=a/Math.sqrt(r*r+i*i+o*o);return new u(s,r*c,i*c,o*c)},u.fromBetweenVectors=function(e,t){var n=e[0],r=e[1],i=e[2],o=t[0],a=t[1],s=t[2],c=n*o+r*a+i*s,l=r*s-i*a,h=i*o-n*s,d=n*a-r*o;return new u(c+Math.sqrt(c*c+l*l+h*h+d*d),l,h,d).normalize()},u.fromEuler=function(e,t,n,r){var i=.5*t,o=.5*n,a=.5*e,s=Math.cos(i),c=Math.cos(o),l=Math.cos(a),h=Math.sin(i),d=Math.sin(o),f=Math.sin(a);return void 0===r||"ZXY"===r?new u(s*c*l-h*d*f,h*c*l-s*d*f,s*d*l+h*c*f,s*c*f+h*d*l):"XYZ"===r?new u(s*c*l-h*d*f,h*c*l+s*d*f,s*d*l-h*c*f,s*c*f+h*d*l):"YXZ"===r?new u(s*c*l+h*d*f,h*c*l+s*d*f,s*d*l-h*c*f,s*c*f-h*d*l):"ZYX"===r?new u(s*c*l+h*d*f,h*c*l-s*d*f,s*d*l+h*c*f,s*c*f-h*d*l):"YZX"===r?new u(s*c*l-h*d*f,h*c*l+s*d*f,s*d*l+h*c*f,s*c*f-h*d*l):"XZY"===r?new u(s*c*l+h*d*f,h*c*l-s*d*f,s*d*l-h*c*f,s*c*f+h*d*l):null},void 0===(r=(function(){return u}).apply(t,[]))||(e.exports=r)}()},YuTi:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},cTvG:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n("FZPO");class i{fromRdf(e,t){const n=parseFloat(e.value);return t&&isNaN(n)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return t=t||n.namedNode(i.TYPES[0]),isNaN(e)?n.literal("NaN",t):isFinite(e)?e%1==0?null:n.literal(e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),t):n.literal(e>0?"INF":"-INF",t)}}t.TypeHandlerNumberDouble=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},g5aj:function(e,t,n){var r=n("04/w"),i=n("PDru");function o(){this.clear()}o.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},o.prototype.enqueue=function(e){return this.items.push(e),++this.size},o.prototype.dequeue=function(){if(this.size){var e=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,e}},o.prototype.peek=function(){if(this.size)return this.items[this.offset]},o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.offset,r=0,i=this.items.length;n=e.length)return{done:!0};var n=e[t];return t++,{value:n,done:!1}})},o.prototype.entries=function(){var e=this.items,t=this.offset,n=0;return new r(function(){if(t>=e.length)return{done:!0};var r=e[t];return t++,{value:[n++,r],done:!1}})},"undefined"!=typeof Symbol&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.toString=function(){return this.toArray().join(",")},o.prototype.toJSON=function(){return this.toArray()},o.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:o,enumerable:!1}),e},"undefined"!=typeof Symbol&&(o.prototype[Symbol.for("nodejs.util.inspect.custom")]=o.prototype.inspect),o.from=function(e){var t=new o;return i(e,function(e){t.enqueue(e)}),t},o.of=function(){return o.from(arguments)},e.exports=o},"l/hW":function(e,t,n){"use strict";e.exports=function(e){const t=e[0],n=e[1],r=e[2],i=e[3];return[Math.atan2(2*(t*n+r*i),1-2*(n*n+r*r)),Math.asin(2*(t*r-i*n)),Math.atan2(2*(t*i+n*r),1-2*(r*r+i*i))]}},m5Kp:function(e,t,n){var r=n("PPGm");e.exports=r},mMj5:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n("FZPO");class i{fromRdf(e,t){const n=parseInt(e.value,10);return t&&(isNaN(n)||e.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(String(e),t||n.namedNode(e<=i.MAX_INT&&e>=i.MIN_INT?i.TYPES[0]:i.TYPES[1]))}}t.TypeHandlerNumberInteger=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648},mtbl:function(e,t,n){var r=n("tXxl"),i=n("g5aj"),o=n("x4yT");function a(e,t,n){if(!r(e))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!e.hasNode(t))throw new Error('graphology-shortest-path: the "'+t+'" source node does not exist in the given graph.');if(!e.hasNode(n))throw new Error('graphology-shortest-path: the "'+n+'" target node does not exist in the given graph.');if((t=""+t)==(n=""+n))return[t];var i=e.inboundNeighbors.bind(e),o=e.outboundNeighbors.bind(e),a={},s={};a[t]=null,s[n]=null;var u,c,l,h,d,f,p,g,y=[t],v=[n],m=!1;e:for(;y.length&&v.length;)if(y.length<=v.length){for(u=y,y=[],d=0,p=u.length;d=t?{done:!0}:{done:!1,value:e[r++]}})},n.empty=function(){var e=new n(null);return e.done=!0,e},n.is=function(e){return e instanceof n||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=n},"12xR":function(e,t){function n(){this.value=""}n.prototype.equals=function(e){return!!e&&e.termType===this.termType},n.prototype.termType="DefaultGraph",e.exports=n},"4cw7":function(e,t,n){var r=n("12xR");function i(e,t,n,i){this.subject=e,this.predicate=t,this.object=n,this.graph=i||new r}i.prototype.equals=function(e){return!!e&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)},e.exports=i},"6smP":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{fromRdf(e){return e.value}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e,t)}}t.TypeHandlerString=r,r.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},"8Xj3":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n("FZPO");class i{fromRdf(e,t){switch(e.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return t&&r.Translator.incorrectRdfDataType(e),!1}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e?"true":"false",t||n.namedNode(i.TYPE))}}t.TypeHandlerBoolean=i,i.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},Eagr:function(e,t){function n(e){this.value=e}n.prototype.equals=function(e){return!!e&&e.termType===this.termType&&e.value===this.value},n.prototype.termType="NamedNode",e.exports=n},FZPO:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(e){throw new Error(`Invalid RDF ${e.datatype.value} value: '${e.value}'`)}registerHandler(e,t,n){for(const r of t)this.supportedRdfDatatypes.push(r),this.fromRdfHandlers[r.value]=e;for(const r of n){let t=this.toRdfHandlers[r];t||(this.toRdfHandlers[r]=t=[]),t.push(e)}}fromRdf(e,t){const n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}toRdf(e,t){const n=this.toRdfHandlers[typeof e];if(n)for(const r of n){const n=r.toRdf(e,t);if(n)return n}throw new Error(`Invalid JavaScript value: '${e}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},HXBs:function(e,t,n){e.exports=function(){"use strict";function e(t){return(e="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})(t)}function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function o(e,t,n){return(o=i()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o}).apply(null,arguments)}function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return o(e,arguments,n(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(){for(var e=arguments[0]||{},t=1,n=arguments.length;t0&&a.length>i){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=n,++e._eventsCount;return e}function E(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function j(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function N(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}function I(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}g.prototype=Object.create(null),y.EventEmitter=y,y.usingDomains=!1,y.prototype.domain=void 0,y.prototype._events=void 0,y.prototype._maxListeners=void 0,y.defaultMaxListeners=10,y.init=function(){this.domain=null,y.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new g,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},y.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},y.prototype.getMaxListeners=function(){return v(this)},y.prototype.emit=function(e){var t,n,r,i,o,a,s,u="error"===e;if(a=this._events)u=u&&null==a.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(n=a[e]))return!1;var l="function"==typeof n;switch(r=arguments.length){case 1:m(n,l,this);break;case 2:b(n,l,this,arguments[1]);break;case 3:_(n,l,this,arguments[1],arguments[2]);break;case 4:w(n,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o0;)if(n[o]===t||n[o].listener&&n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new g,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r0?Reflect.ownKeys(this._events):[]},I.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(I.prototype[Symbol.iterator]=function(){return this}),I.of=function(){var e=arguments,t=e.length,n=0;return new I(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},I.empty=function(){var e=new I(null);return e.done=!0,e},I.is=function(e){return e instanceof I||"object"==typeof e&&null!==e&&"function"==typeof e.next};var T=I,A=function(e,t){for(var n,r=arguments.length>1?t:1/0,i=r!==1/0?new Array(r):[],o=0;;){if(o===r)return i;if((n=e.next()).done)return o!==t?i.slice(0,o):i;i[o++]=n.value}},k=function(e){function n(t,n){var r;return(r=e.call(this)||this).name="GraphError",r.message=t||"",r.data=n||{},r}return t(n,e),n}(a(Error)),O=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(k),R=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(k),L=function(e){function n(t,r){var i;return(i=e.call(this,t,r)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),n.prototype.constructor),i}return t(n,e),n}(k);function M(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function D(e,t){this.key=e,this.attributes=t||{},this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function C(e,t){this.key=e,this.attributes=t||{},this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function P(e,t,n,r,i){this.key=e,this.attributes=i,this.source=n,this.target=r,this.generatedKey=t}function F(e,t,n,r,i){this.key=e,this.attributes=i,this.source=n,this.target=r,this.generatedKey=t}function B(e,t,n,r,i,o,a){var s=e.multi,u=t?"undirected":"out",c=t?"undirected":"in",l=o[u][i];void 0===l&&(l=s?new Set:n,o[u][i]=l),s&&l.add(n),r!==i&&void 0===a[c][r]&&(a[c][r]=l)}function U(e,t,n){var r=e.multi,i=n.source,o=n.target,a=i.key,s=o.key,u=i[t?"undirected":"out"],c=t?"undirected":"in";if(s in u)if(r){var l=u[s];1===l.size?(delete u[s],delete o[c][a]):l.delete(n)}else delete u[s];r||delete o[c][a]}D.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},C.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var G=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],!(o=c(this,a,s,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[i]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+arguments[1];if(!(i=c(this,o,a,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(i instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],!(o=c(this,a,s,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes.hasOwnProperty(i)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i,o){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+e,u=""+i;if(i=arguments[2],o=arguments[3],!(a=c(this,s,u,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').concat(u,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(a instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",meta:{name:i,value:o}}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i,o){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+e,u=""+i;if(i=arguments[2],o=arguments[3],!(a=c(this,s,u,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').concat(u,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof o)throw new O("Graph.".concat(t,": updater should be a function."));if("mixed"!==n&&!(a instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[i]=o(a.attributes[i]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",meta:{name:i,value:a.attributes[i]}}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],!(o=c(this,a,s,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",meta:{name:i}}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],!(o=c(this,a,s,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!h(i))throw new O("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&!(o instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));var u=o.attributes;return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",meta:{before:u,after:i}}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+i;if(i=arguments[2],!(o=c(this,a,s,n)))throw new R("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!h(i))throw new O("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&!(o instanceof r))throw new R("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return u(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",meta:{data:i}}),this}}}],z=function(){var e,t=arguments,n=-1;return new T(function r(){if(!e){if(++n>=t.length)return{done:!0};e=t[n]}var i=e.next();return i.done?(e=null,r()):i})},V=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function q(e,t){for(var n in t)t[n]instanceof Set?t[n].forEach(function(t){return e.push(t.key)}):e.push(t[n].key)}function K(e,t){for(var n in e){var r=e[n];t(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes)}}function W(e,t){for(var n in e)e[n].forEach(function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)})}function H(e){var t=Object.keys(e),n=t.length,r=null,i=0;return new T(function o(){var a;if(r){var s=r.next();if(s.done)return r=null,i++,o();a=s.value}else{if(i>=n)return{done:!0};if((a=e[t[i]])instanceof Set)return r=a.values(),o();i++}return{done:!1,value:[a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes]}})}function J(e,t,n){n in t&&(t[n]instanceof Set?t[n].forEach(function(t){return e.push(t.key)}):e.push(t[n].key))}function $(e,t,n){if(t in e)if(e[t]instanceof Set)e[t].forEach(function(e){return n(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)});else{var r=e[t];n(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes)}}function X(e,t){var n=e[t];if(n instanceof Set){var r=n.values();return new T(function(){var e=r.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}})}return T.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function Q(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return A(e._edges.keys(),e._edges.size);var n=new Array("undirected"===t?e.undirectedSize:e.directedSize),r="undirected"===t,i=0;return e._edges.forEach(function(e,t){e instanceof F===r&&(n[i++]=t)}),n}function Y(e,t,n){if(0!==e.size)if("mixed"===t||t===e.type)e._edges.forEach(function(e,t){var r=e.source,i=e.target;n(t,e.attributes,r.key,i.key,r.attributes,i.attributes)});else{var r="undirected"===t;e._edges.forEach(function(e,t){if(e instanceof F===r){var i=e.source,o=e.target;n(t,e.attributes,i.key,o.key,i.attributes,o.attributes)}})}}function Z(e,t){return 0===e.size?T.empty():"mixed"===t?(n=e._edges.values(),new T(function(){var e=n.next();if(e.done)return e;var t=e.value;return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}})):(n=e._edges.values(),new T(function e(){var r=n.next();if(r.done)return r;var i=r.value;return i instanceof F==("undirected"===t)?{value:[i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes],done:!1}:e()}));var n}function ee(e,t,n){var r=[];return"undirected"!==e&&("out"!==t&&q(r,n.in),"in"!==t&&q(r,n.out)),"directed"!==e&&q(r,n.undirected),r}function te(e,t,n,r,i){var o=e?W:K;"undirected"!==t&&("out"!==n&&o(r.in,i),"in"!==n&&o(r.out,i)),"directed"!==t&&o(r.undirected,i)}function ne(e,t,n){var r=T.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(r=z(r,H(n.in))),"in"!==t&&void 0!==n.out&&(r=z(r,H(n.out)))),"directed"!==e&&void 0!==n.undirected&&(r=z(r,H(n.undirected))),r}function re(e,t,n,r){var i=[];return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&J(i,n.in,r),void 0!==n.out&&"in"!==t&&J(i,n.out,r)),"directed"!==e&&void 0!==n.undirected&&J(i,n.undirected,r),i}function ie(e,t,n,r,i){"undirected"!==e&&(void 0!==n.in&&"out"!==t&&$(n.in,r,i),void 0!==n.out&&"in"!==t&&$(n.out,r,i)),"directed"!==e&&void 0!==n.undirected&&$(n.undirected,r,i)}function oe(e,t,n,r){var i=T.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(i=z(i,X(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(i=z(i,X(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(i=z(i,X(n.undirected,r))),i}var ae=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function se(e,t){if(void 0!==t)for(var n in t)e.add(n)}function ue(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var r=new Set;return"undirected"!==e&&("out"!==t&&se(r,n.in),"in"!==t&&se(r,n.out)),"directed"!==e&&se(r,n.undirected),A(r.values(),r.size)}function ce(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var o=i.source,a=o===e?i.target:o;n(a.key,a.attributes)}}function le(e,t,n,r){for(var i in n){var o=n[i];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===t?o.target:a;e.has(s.key)||(e.add(s.key),r(s.key,s.attributes))}}function he(e,t){var n=Object.keys(t),r=n.length,i=0;return new T(function(){if(i>=r)return{done:!0};var o=t[n[i++]];o instanceof Set&&(o=o.values().next().value);var a=o.source,s=a===e?o.target:a;return{done:!1,value:[s.key,s.attributes]}})}function de(e,t,n){var r=Object.keys(n),i=r.length,o=0;return new T(function a(){if(o>=i)return{done:!0};var s=n[r[o++]];s instanceof Set&&(s=s.values().next().value);var u=s.source,c=u===t?s.target:u;return e.has(c.key)?a():(e.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function fe(e,t,n,r,i){var o=e._nodes.get(r);if("undirected"!==t){if("out"!==n&&void 0!==o.in)for(var a in o.in)if(a===i)return!0;if("in"!==n&&void 0!==o.out)for(var s in o.out)if(s===i)return!0}if("directed"!==t&&void 0!==o.undirected)for(var u in o.undirected)if(u===i)return!0;return!1}function pe(e,t){var n={key:e};return Object.keys(t.attributes).length&&(n.attributes=u({},t.attributes)),n}function ge(e,t){var n={source:t.source.key,target:t.target.key};return t.generatedKey||(n.key=e),Object.keys(t.attributes).length&&(n.attributes=u({},t.attributes)),t instanceof F&&(n.undirected=!0),n}function ye(e){return h(e)?"key"in e?!("attributes"in e)||h(e.attributes)&&null!==e.attributes?null:"invalid-attributes":"no-key":"not-object"}function ve(e){return h(e)?"source"in e?"target"in e?!("attributes"in e)||h(e.attributes)&&null!==e.attributes?"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var me=new Set(["directed","undirected","mixed"]),be=new Set(["domain","_events","_eventsCount","_maxListeners"]),_e={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function we(e,t,n,r,i,o,a,s){if(!r&&"undirected"===e.type)throw new L("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new L("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!h(s))throw new O("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(o=""+o,a=""+a,s=s||{},!e.allowSelfLoops&&o===a)throw new L("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var u=e._nodes.get(o),c=e._nodes.get(a);if(!u)throw new R("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!c)throw new R("Graph.".concat(t,': target node "').concat(a,'" not found.'));var l={key:null,undirected:r,source:o,target:a,attributes:s};if(n&&(i=e._edgeKeyGenerator(l)),e._edges.has(i=""+i))throw new L("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));if(!e.multi&&(r?void 0!==u.undirected[a]:void 0!==u.out[a]))throw new L("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var d=new(r?F:P)(i,n,u,c,s);return e._edges.set(i,d),o===a?r?u.undirectedSelfLoops++:u.directedSelfLoops++:r?(u.undirectedDegree++,c.undirectedDegree++):(u.outDegree++,c.inDegree++),B(e,r,d,o,a,u,c),r?e._undirectedSize++:e._directedSize++,l.key=i,e.emit("edgeAdded",l),i}function xe(e,t,n,r,i,o,a,s){if(!r&&"undirected"===e.type)throw new L("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new L("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!h(s))throw new O("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(o=""+o,a=""+a,s=s||{},!e.allowSelfLoops&&o===a)throw new L("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var l,d,f=e._nodes.get(o),p=e._nodes.get(a),g=null;if(!n&&(l=e._edges.get(i))){if(l.source!==o||l.target!==a||r&&(l.source!==a||l.target!==o))throw new L("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. (').concat(l.source,", ").concat(l.target,")."));g=i}if(g||e.multi||!f||(r?void 0===f.undirected[a]:void 0===f.out[a])||(d=c(e,o,a,r?"undirected":"directed")),d)return s?(u(d.attributes,s),g):g;var y={key:null,undirected:r,source:o,target:a,attributes:s};if(n&&(i=e._edgeKeyGenerator(y)),e._edges.has(i=""+i))throw new L("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));return f||(e.addNode(o),f=e._nodes.get(o),o===a&&(p=f)),p||(e.addNode(a),p=e._nodes.get(a)),l=new(r?F:P)(i,n,f,p,s),e._edges.set(i,l),o===a?r?f.undirectedSelfLoops++:f.directedSelfLoops++:r?(f.undirectedDegree++,p.undirectedDegree++):(f.outDegree++,p.inDegree++),B(e,r,l,o,a,f,p),r?e._undirectedSize++:e._directedSize++,y.key=i,e.emit("edgeAdded",y),i}var Se=function(e){function n(t){var n;if(n=e.call(this)||this,(t=u({},_e,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new O("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new O("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!me.has(t.type))throw new O('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new O("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r,i="mixed"===t.type?M:"directed"===t.type?D:C;return f(s(n),"NodeDataClass",i),f(s(n),"_attributes",{}),f(s(n),"_nodes",new Map),f(s(n),"_edges",new Map),f(s(n),"_directedSize",0),f(s(n),"_undirectedSize",0),f(s(n),"_edgeKeyGenerator",t.edgeKeyGenerator||(r=0,function(){return"_geid".concat(r++,"_")})),f(s(n),"_options",t),be.forEach(function(e){return f(s(n),e,n[e])}),p(s(n),"order",function(){return n._nodes.size}),p(s(n),"size",function(){return n._edges.size}),p(s(n),"directedSize",function(){return n._directedSize}),p(s(n),"undirectedSize",function(){return n._undirectedSize}),p(s(n),"multi",n._options.multi),p(s(n),"type",n._options.type),p(s(n),"allowSelfLoops",n._options.allowSelfLoops),n}t(n,e);var r=n.prototype;return r.hasNode=function(e){return this._nodes.has(""+e)},r.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&n instanceof P}if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var i=r.out[t];return!(!i||this.multi&&!i.size)}throw new O("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=this._edges.get(""+e);return!!n&&n instanceof F}if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var i=r.undirected[t];return!(!i||this.multi&&!i.size)}throw new O("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.hasEdge=function(e,t){if(1===arguments.length)return this._edges.has(""+e);if(2===arguments.length){t=""+t;var n=this._nodes.get(e=""+e);if(!n)return!1;var r=void 0!==n.out&&n.out[t];return r||(r=void 0!==n.undirected&&n.undirected[t]),!(!r||this.multi&&!r.size)}throw new O("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},r.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new L("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new R('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new R('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||void 0;return r?r.key:void 0}},r.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new L("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new R('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new R('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.undirected&&n.undirected[t]||void 0;return r?r.key:void 0}},r.edge=function(e,t){if(this.multi)throw new L("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t;var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new R('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key},r.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new O('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.inDegree+(t?n.directedSelfLoops:0)},r.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new O('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:n.outDegree+(t?n.directedSelfLoops:0)},r.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new O('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(!this.hasNode(e=""+e))throw new R('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:this.inDegree(e,t)+this.outDegree(e,t)},r.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new O('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(!this.hasNode(e=""+e))throw new R('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));if("directed"===this.type)return 0;var n=this._nodes.get(e);return n.undirectedDegree+(t?2*n.undirectedSelfLoops:0)},r.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new O('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(!this.hasNode(e=""+e))throw new R('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"undirected"!==this.type&&(n+=this.directedDegree(e,t)),"directed"!==this.type&&(n+=this.undirectedDegree(e,t)),n},r.source=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},r.target=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},r.extremities=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},r.opposite=function(e,t){if(t=""+t,!this._nodes.has(e=""+e))throw new R('Graph.opposite: could not find the "'.concat(e,'" node in the graph.'));var n=this._edges.get(t);if(!n)throw new R('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var r=n.source.key,i=n.target.key;if(e!==r&&e!==i)throw new R('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(r,", ").concat(i,")."));return e===r?i:r},r.undirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.undirected: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof F},r.directed=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.directed: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof P},r.selfLoop=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.selfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},r.addNode=function(e,t){if(t&&!h(t))throw new O('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));if(t=t||{},this._nodes.has(e=""+e))throw new L('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var n=new this.NodeDataClass(e,t);return this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e},r.mergeNode=function(e,t){if(t&&!h(t))throw new O('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));t=t||{};var n=this._nodes.get(e=""+e);return n?(t&&u(n.attributes,t),e):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e)},r.dropNode=function(e){if(!this.hasNode(e=""+e))throw new R('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));for(var t=this.edges(e),n=0,r=t.length;n1){var n=""+arguments[0],r=""+arguments[1];if(!(t=c(this,n,r,this.type)))throw new R('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(!(t=this._edges.get(e=""+e)))throw new R('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var i=t.source,o=t.target,a=t.attributes,s=t instanceof F;return i===o?i.selfLoops--:s?(i.undirectedDegree--,o.undirectedDegree--):(i.outDegree--,o.inDegree--),U(this,s,t),s?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:a,source:i.key,target:o.key,undirected:s}),this},r.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},r.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},r.getAttribute=function(e){return this._attributes[e]},r.getAttributes=function(){return this._attributes},r.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},r.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",meta:{name:e,value:t}}),this},r.updateAttribute=function(e,t){if("function"!=typeof t)throw new O("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",meta:{name:e,value:this._attributes[e]}}),this},r.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",meta:{name:e}}),this},r.replaceAttributes=function(e){if(!h(e))throw new O("Graph.replaceAttributes: provided attributes are not a plain object.");var t=this._attributes;return this._attributes=e,this.emit("attributesUpdated",{type:"replace",meta:{before:t,after:e}}),this},r.mergeAttributes=function(e){if(!h(e))throw new O("Graph.mergeAttributes: provided attributes are not a plain object.");return this._attributes=u(this._attributes,e),this.emit("attributesUpdated",{type:"merge",meta:{data:this._attributes}}),this},r.getNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes[t]},r.getNodeAttributes=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new R('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},r.hasNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes.hasOwnProperty(t)},r.setNodeAttribute=function(e,t,n){var r=this._nodes.get(e=""+e);if(!r)throw new R('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new O("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return r.attributes[t]=n,this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:n}}),this},r.updateNodeAttribute=function(e,t,n){var r=this._nodes.get(e=""+e);if(!r)throw new R('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new O("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new O("Graph.updateAttribute: updater should be a function.");var i=r.attributes;return i[t]=n(i[t]),this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:i[t]}}),this},r.removeNodeAttribute=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete n.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",meta:{name:t}}),this},r.replaceNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!h(t))throw new O("Graph.replaceNodeAttributes: provided attributes are not a plain object.");var r=n.attributes;return n.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",meta:{before:r,after:t}}),this},r.mergeNodeAttributes=function(e,t){var n=this._nodes.get(e=""+e);if(!n)throw new R('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!h(t))throw new O("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return u(n.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",meta:{data:t}}),this},r.forEach=function(e){if("function"!=typeof e)throw new O("Graph.forEach: expecting a callback.");this._edges.forEach(function(t,n){var r=t.source,i=t.target;e(r.key,i.key,r.attributes,i.attributes,n,t.attributes)})},r.adjacency=function(){var e=this._edges.values();return new T(function(){var t=e.next();if(t.done)return t;var n=t.value,r=n.source,i=n.target;return{done:!1,value:[r.key,i.key,r.attributes,i.attributes,n.key,n.attributes]}})},r.nodes=function(){return A(this._nodes.keys(),this._nodes.size)},r.forEachNode=function(e){if("function"!=typeof e)throw new O("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(t,n){e(n,t.attributes)})},r.nodeEntries=function(){var e=this._nodes.values();return new T(function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:[n.key,n.attributes],done:!1}})},r.exportNode=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new R('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return pe(e,t)},r.exportEdge=function(e){var t=this._edges.get(e=""+e);if(!t)throw new R('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return ge(e,t)},r.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach(function(n,r){e[t++]=pe(r,n)});var n=new Array(this._edges.size);return t=0,this._edges.forEach(function(e,r){n[t++]=ge(r,e)}),{attributes:this.getAttributes(),nodes:e,edges:n}},r.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ye(e);if(n){if("not-object"===n)throw new O('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new O("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new O("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var r=e.key,i=e.attributes,o=void 0===i?{}:i;return t?this.mergeNode(r,o):this.addNode(r,o),this},r.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ve(e);if(n){if("not-object"===n)throw new O('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new O("Graph.importEdge: missing souce.");if("no-target"===n)throw new O("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new O("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new O("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var r=e.source,i=e.target,o=e.attributes,a=void 0===o?{}:o,s=e.undirected,u=void 0!==s&&s;return"key"in e?(t?u?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:u?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,r,i,a):(t?u?this.mergeUndirectedEdge:this.mergeDirectedEdge:u?this.addUndirectedEdge:this.addDirectedEdge).call(this,r,i,a),this},r.import=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l(e))return this.import(e.export(),n),this;if(!h(e))throw new O("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!h(e.attributes))throw new O("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}return e.nodes&&e.nodes.forEach(function(e){return t.importNode(e,n)}),e.edges&&e.edges.forEach(function(e){return t.importEdge(e,n)}),this},r.nullCopy=function(e){return new n(u({},this._options,e))},r.emptyCopy=function(e){var t=new n(u({},this._options,e));return this._nodes.forEach(function(e,n){e=new t.NodeDataClass(n,u({},e.attributes)),t._nodes.set(n,e)}),t},r.copy=function(){var e=new n(this._options);return e.import(this),e},r.upgradeToMixed=function(){return"mixed"===this.type||(this._nodes.forEach(function(e){return e.upgradeToMixed()}),this._options.type="mixed",p(this,"type",this._options.type),f(this,"NodeDataClass",M)),this},r.upgradeToMulti=function(){return this.multi||(this._options.multi=!0,p(this,"multi",!0),(e=this)._nodes.forEach(function(t,n){if(t.out)for(var r in t.out){var i=new Set;i.add(t.out[r]),t.out[r]=i,e._nodes.get(r).in[n]=i}if(t.undirected)for(var o in t.undirected)if(!(o>n)){var a=new Set;a.add(t.undirected[o]),t.undirected[o]=a,e._nodes.get(o).undirected[n]=a}})),this;var e},r.clearIndex=function(){return this._nodes.forEach(function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})}),this},r.toJSON=function(){return this.export()},r.toString=function(){var e=this.order>1||0===this.order,t=this.size>1||0===this.size;return"Graph<".concat(d(this.order)," node").concat(e?"s":"",", ").concat(d(this.size)," edge").concat(t?"s":"",">")},r.inspect=function(){var e=this,t={};this._nodes.forEach(function(e,n){t[n]=e.attributes});var n={},r={};this._edges.forEach(function(t,i){var o=t instanceof F?"--":"->",a="",s="(".concat(t.source.key,")").concat(o,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===r[s]?r[s]=0:r[s]++,a+="".concat(r[s],". ")):a+="[".concat(i,"]: "),n[a+=s]=t.attributes});var i={};for(var o in this)this.hasOwnProperty(o)&&!be.has(o)&&"function"!=typeof this[o]&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,f(i,"constructor",this.constructor),i},n}(y);"undefined"!=typeof Symbol&&(Se.prototype[Symbol.for("nodejs.util.inspect.custom")]=Se.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(e){["add","merge"].forEach(function(t){var n=e.name(t),r="add"===t?we:xe;Se.prototype[n]=e.generateKey?function(t,i,o){return r(this,n,!0,"undirected"===(e.type||this.type),null,t,i,o)}:function(t,i,o,a){return r(this,n,!1,"undirected"===(e.type||this.type),t,i,o,a)}})}),"undefined"!=typeof Symbol&&(Se.prototype[Symbol.iterator]=Se.prototype.adjacency),function(e){G.forEach(function(t){var n=t.name,r=t.attacher;r(e,n("Edge"),"mixed",P),r(e,n("DirectedEdge"),"directed",P),r(e,n("UndirectedEdge"),"undirected",F)})}(Se),function(e){V.forEach(function(t){!function(e,t){var n=t.name,r=t.type,i=t.direction;e.prototype[n]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return Q(this,r);if(1===arguments.length){var o=this._nodes.get(e=""+e);if(void 0===o)throw new R("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return ee("mixed"===r?this.type:r,i,o)}if(2===arguments.length){t=""+t;var a=this._nodes.get(e=""+e);if(!a)throw new R("Graph.".concat(n,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new R("Graph.".concat(n,': could not find the "').concat(t,'" target node in the graph.'));return re(r,i,a,t)}throw new O("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return Y(this,r,n=e);if(2===arguments.length){n=t;var a=this._nodes.get(e=""+e);if(void 0===a)throw new R("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return te(this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t;var s=this._nodes.get(e=""+e);if(!s)throw new R("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new R("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return ie(r,i,s,t,n)}throw new O("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.type,r=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e,t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return T.empty();if(!arguments.length)return Z(this,n);if(1===arguments.length){var o=this._nodes.get(e=""+e);if(!o)throw new R("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return ne(n,r,o)}if(2===arguments.length){t=""+t;var a=this._nodes.get(e=""+e);if(!a)throw new R("Graph.".concat(i,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new R("Graph.".concat(i,': could not find the "').concat(t,'" target node in the graph.'));return oe(n,r,a,t)}throw new O("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)})}(Se),function(e){ae.forEach(function(t){!function(e,t){var n=t.name,r=t.type,i=t.direction;e.prototype[n]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],o=""+arguments[1];if(!this._nodes.has(t))throw new R("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(o))throw new R("Graph.".concat(n,': could not find the "').concat(o,'" node in the graph.'));return fe(this,r,i,t,o)}if(1===arguments.length){var a=this._nodes.get(e=""+e);if(void 0===a)throw new R("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return ue("mixed"===r?this.type:r,i,a)}throw new O("Graph.".concat(n,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){var n=this._nodes.get(e=""+e);if(void 0===n)throw new R("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return ce(n,n.undirected,r);if("string"==typeof t)return ce(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&le(i,n,n.in,r),"in"!==t&&le(i,n,n.out,r)),"directed"!==e&&le(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}(e,t),function(e,t){var n=t.type,r=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return T.empty();var t=this._nodes.get(e=""+e);if(void 0===t)throw new R("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return he(n,n.undirected);if("string"==typeof t)return he(n,n[t])}var r=T.empty(),i=new Set;return"undirected"!==e&&("out"!==t&&(r=z(r,de(i,n,n.in))),"in"!==t&&(r=z(r,de(i,n,n.out)))),"directed"!==e&&(r=z(r,de(i,n,n.undirected))),r}("mixed"===n?this.type:n,r,t)}}(e,t)})}(Se);var Ee=function(e){function n(t){return e.call(this,u({type:"directed"},t))||this}return t(n,e),n}(Se),je=function(e){function n(t){return e.call(this,u({type:"undirected"},t))||this}return t(n,e),n}(Se),Ne=function(e){function n(t){return e.call(this,u({multi:!0},t))||this}return t(n,e),n}(Se),Ie=function(e){function n(t){return e.call(this,u({multi:!0,type:"directed"},t))||this}return t(n,e),n}(Se),Te=function(e){function n(t){return e.call(this,u({multi:!0,type:"undirected"},t))||this}return t(n,e),n}(Se);function Ae(e){e.from=function(t,n){var r=new e(n);return r.import(t),r}}return Ae(Se),Ae(Ee),Ae(je),Ae(Ne),Ae(Ie),Ae(Te),Se.Graph=Se,Se.DirectedGraph=Ee,Se.UndirectedGraph=je,Se.MultiGraph=Ne,Se.MultiDirectedGraph=Ie,Se.MultiUndirectedGraph=Te,Se.InvalidArgumentsGraphError=O,Se.NotFoundGraphError=R,Se.UsageGraphError=L,Se}()},Hj1c:function(e,t,n){"use strict";function r(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})}n.r(t);var i=n("JFj6");function o(e){return(o="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})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function u(e,t,n){return(u=s()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&a(i,n.prototype),i}).apply(null,arguments)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.precision,r=void 0===n?d.precision||4:n;return e=f(e),"".concat(parseFloat(e.toPrecision(r)))}function g(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function y(e){return function(e,t){return function(e,t,n){if(g(e)){n=n||((i=e).clone?i.clone():new Array(i.length));for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"";if(d.debug&&!E(e,t))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return e}d.EPSILON=1e-12,d.debug=!1,d.precision=4,d.printTypes=!1,d.printDegrees=!1,d.printRowMajor=!0;var N={};function I(e,t){N[e]||(N[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}function T(e){var t="function"==typeof Map?new Map:void 0;return(T=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return u(e,arguments,_(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),a(n,e)})(e)}var A,k=function(e){function t(){return m(this,t),b(this,_(t).apply(this,arguments))}return S(t,e),x(t,[{key:"toString",value:function(){var e="[";if(d.printRowMajor){e+="row-major:";for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=e*this.RANK,r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+p(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t2*Math.PI)throw Error("radians");var d=s*Math.tan(r/2),f=d*o;return(new t).ortho({left:-f,right:f,bottom:-d,top:d,near:c,far:h})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=void 0===t?void 0:t,r=e.fov,i=void 0===r?45*Math.PI/180:r,o=e.aspect,a=void 0===o?1:o,s=e.near,u=void 0===s?.1:s,c=e.far,l=void 0===c?500:c;if((n=n||i)>2*Math.PI)throw Error("radians");return M(this,n,a,u,l),this.check()}},{key:"determinant",value:function(){return((t=(e=this)[0])*(a=e[5])-(n=e[1])*(o=e[4]))*((h=e[10])*(y=e[15])-(d=e[11])*(g=e[14]))-(t*(s=e[6])-(r=e[2])*o)*((l=e[9])*y-d*(p=e[13]))+(t*(u=e[7])-(i=e[3])*o)*(l*g-h*p)+(n*s-r*a)*((c=e[8])*y-d*(f=e[12]))-(n*u-i*a)*(c*g-h*f)+(r*u-i*s)*(c*p-l*f);var e,t,n,r,i,o,a,s,u,c,l,h,d,f,p,g,y}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(t||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*i,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*i,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getScale(t||[-0,-0,-0]),r=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*i,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*i,e[8]=this[10]*o,e}},{key:"transpose",value:function(){return function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],d=t[10],f=t[11],p=t[12],g=t[13],y=t[14],v=t[15],m=n*s-r*a,b=n*u-i*a,_=n*c-o*a,w=r*u-i*s,x=r*c-o*s,S=i*c-o*u,E=l*g-h*p,j=l*y-d*p,N=l*v-f*p,I=h*y-d*g,T=h*v-f*g,A=d*v-f*y,k=m*A-b*T+_*I+w*N-x*j+S*E;k&&(e[0]=(s*A-u*T+c*I)*(k=1/k),e[1]=(i*T-r*A-o*I)*k,e[2]=(g*S-y*x+v*w)*k,e[3]=(d*x-h*S-f*w)*k,e[4]=(u*N-a*A-c*j)*k,e[5]=(n*A-i*N+o*j)*k,e[6]=(y*_-p*S-v*b)*k,e[7]=(l*S-d*_+f*b)*k,e[8]=(a*T-s*N+c*E)*k,e[9]=(r*N-n*T-o*E)*k,e[10]=(p*x-g*_+v*m)*k,e[11]=(h*_-l*x-f*m)*k,e[12]=(s*j-a*I-u*E)*k,e[13]=(n*I-r*j+i*E)*k,e[14]=(g*b-p*w-y*m)*k,e[15]=(l*w-h*b+d*m)*k)}(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return R(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return R(this,this,e),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],d=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*r,e[5]=a*i+l*r,e[6]=s*i+h*r,e[7]=u*i+d*r,e[8]=c*i-o*r,e[9]=l*i-a*r,e[10]=h*i-s*r,e[11]=d*i-u*r}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[8],l=t[9],h=t[10],d=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*r,e[1]=a*i-l*r,e[2]=s*i-h*r,e[3]=u*i-d*r,e[8]=o*r+c*i,e[9]=a*r+l*i,e[10]=s*r+h*i,e[11]=u*r+d*i}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[4],l=t[5],h=t[6],d=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*r,e[1]=a*i+l*r,e[2]=s*i+h*r,e[3]=u*i+d*r,e[4]=c*i-o*r,e[5]=l*i-a*r,e[6]=h*i-s*r,e[7]=d*i-u*r}(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t,n,r=(n=3,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(t,n)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=r[1],o=r[2];return this.rotateX(r[0]).rotateY(i).rotateZ(o)}},{key:"rotateAxis",value:function(e,t){return function(e,t,n,r){var i,o,a,s,u,c,l,h,d,f,p,g,y,v,m,b,_,w,x,S,E,j,N,I,T=r[0],A=r[1],k=r[2],O=Math.hypot(T,A,k);O<1e-6||(T*=O=1/O,A*=O,k*=O,i=Math.sin(n),o=Math.cos(n),u=t[1],c=t[2],l=t[3],d=t[5],f=t[6],p=t[7],y=t[9],v=t[10],m=t[11],x=T*A*(a=1-o)-k*i,S=A*A*a+o,E=k*A*a+T*i,j=T*k*a+A*i,N=A*k*a-T*i,I=k*k*a+o,e[0]=(s=t[0])*(b=T*T*a+o)+(h=t[4])*(_=A*T*a+k*i)+(g=t[8])*(w=k*T*a-A*i),e[1]=u*b+d*_+y*w,e[2]=c*b+f*_+v*w,e[3]=l*b+p*_+m*w,e[4]=s*x+h*S+g*E,e[5]=u*x+d*S+y*E,e[6]=c*x+f*S+v*E,e[7]=l*x+p*S+m*E,e[8]=s*j+h*N+g*I,e[9]=u*j+d*N+y*I,e[10]=c*j+f*N+v*I,e[11]=l*j+p*N+m*I,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?L(this,this,e):L(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return function(e,t,n){var r,i,o,a,s,u,c,l,h,d,f,p,g=n[0],y=n[1],v=n[2];t===e?(e[12]=t[0]*g+t[4]*y+t[8]*v+t[12],e[13]=t[1]*g+t[5]*y+t[9]*v+t[13],e[14]=t[2]*g+t[6]*y+t[10]*v+t[14],e[15]=t[3]*g+t[7]*y+t[11]*v+t[15]):(i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=r=t[0],e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=r*g+s*y+h*v+t[12],e[13]=i*g+u*y+d*v+t[13],e[14]=o*g+c*y+f*v+t[14],e[15]=a*g+l*y+p*v+t[15])}(this,this,e),this.check()}},{key:"transform",value:function(e,t){return 4===e.length?(j(t=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e}(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}},{key:"transformAsPoint",value:function(e,t){switch(e.length){case 2:t=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e}(t||[-0,-0],e,this);break;case 3:t=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e}(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return j(t,e.length),t}},{key:"transformAsVector",value:function(e,t){switch(e.length){case 2:t=function(e,t,n){var r=t[0],i=t[1],o=n[3]*r+n[7]*i||1;return e[0]=(n[0]*r+n[4]*i)/o,e[1]=(n[1]*r+n[5]*i)/o,e}(t||[-0,-0],e,this);break;case 3:t=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o||1;return e[0]=(n[0]*r+n[4]*i+n[8]*o)/a,e[1]=(n[1]*r+n[5]*i+n[9]*o)/a,e[2]=(n[2]*r+n[6]*i+n[10]*o)/a,e}(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return j(t,e.length),t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"transformPoint",value:function(e,t){return I("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}},{key:"transformVector",value:function(e,t){return I("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}},{key:"transformDirection",value:function(e,t){return I("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(e,t,n,r,i,o){var a=2*o/(i-r),s=(n+t)/(n-t),u=(i+r)/(i-r),c=-2*o;return e[0]=2*o/(n-t),e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=s,e[9]=u,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=c,e[15]=0,e}}]),t}(k),G=n("HXBs"),z=n("mtbl"),V=n.n(z),q=n("YXac"),K=n("l/hW"),W=n.n(K),H=n("LvDl"),J=n("L1/z");const $=i.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},i.DataFactory),X={x:$("rdf"),type:i.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")},Q=$("entity")("id"),Y={x:$("entity"),id:Q,sex:$("entity")("sex"),age:$("entity")("age"),bmi:$("entity")("bmi"),Male:i.DataFactory.literal("Male"),Female:i.DataFactory.literal("Female"),donor:$("entity")("donor"),entityType:$("entity")("entityType"),groupName:$("entity")("groupName"),groupUUID:$("entity")("groupUUID"),ontologyTerms:$("entity")("ontologyTerms"),spatialEntity:$("entity")("spatialEntity"),images:$("entity")("hasImage"),imageProviders:$("entity")("hasImageProvider")},Z=$("ccf"),ee={x:Z,spatial:{Body:Z("VHBody"),Female:Z("VHFemale"),Male:Z("VHMale"),BothSexes:Z("VHBothSexes"),FemaleOrgans:Z("VHFemaleOrgans"),MaleOrgans:Z("VHMaleOrgans")},SpatialObjectReference:Z("SpatialObjectReference"),SpatialEntity:Z("SpatialEntity"),SpatialPlacement:Z("SpatialPlacement"),spatialObjectReference:{file:Z("has_object_file"),file_format:Z("has_object_file_format"),file_subpath:Z("has_object_file_subpath")},extractionSet:{label:$("rdf")("label"),rui_rank:Z("ccf_rui_rank")},spatialEntity:{label:$("rdf")("label"),comment:$("rdf")("comment"),creator:$("dc")("creator"),creator_first_name:Z("creator_first_name"),creator_last_name:Z("creator_last_name"),creator_orcid:Z("creator_orcid"),creation_date:Z("creation_date"),updated_date:Z("updated_date"),ccf_annotations:Z("ccf_annotation"),representation_of:Z("ccf_representation_of"),reference_organ:Z("anatomical_structure_of"),extraction_set_for:Z("extraction_set_for"),extraction_set:Z("extraction_site_for"),sex:Z("has_sex"),side:Z("has_side"),rui_rank:Z("ccf_rui_rank"),slice_thickness:Z("ccf_slice_thickness"),slice_count:Z("ccf_slice_count"),x_dimension:Z("has_x_dimension"),y_dimension:Z("has_y_dimension"),z_dimension:Z("has_z_dimension"),dimension_units:Z("has_dimension_units"),object:Z("has_object_reference")},spatialPlacement:{source:Z("has_placement_source"),target:Z("has_placement_target"),placement_date:Z("has_placement_date"),x_scaling:Z("has_x_scaling"),y_scaling:Z("has_y_scaling"),z_scaling:Z("has_z_scaling"),scaling_units:Z("has_scaling_units"),x_rotation:Z("has_x_rotation"),y_rotation:Z("has_y_rotation"),z_rotation:Z("has_z_rotation"),w_rotation:Z("has_theta_rotation"),rotation_order:Z("has_rotation_order"),rotation_units:Z("has_rotation_units"),x_translation:Z("has_x_translation"),y_translation:Z("has_y_translation"),z_translation:Z("has_z_translation"),translation_units:Z("has_translation_units")}},te={x:$("uberon")},ne={x:$("lmha")},re={body:te.x("0013702"),heart:te.x("0000948"),lung:ne.x("00211"),left_lung:te.x("0002168"),right_lung:te.x("0002167"),kidney:te.x("0002113"),left_kidney:te.x("0004538"),right_kidney:te.x("0004539"),spleen:te.x("0002106"),large_intestine:te.x("0001155"),small_intestine:te.x("0002108"),rectum:te.x("0001052"),liver:te.x("0002107"),bladder:te.x("0001255"),ureter:te.x("0000056"),left_ureter:te.x("0001223"),right_ureter:te.x("0001222"),thymus:te.x("0002370"),lymph_node:te.x("0000029")};function ie(e){const t={};return Object.entries(e).forEach(([e,n])=>{t[n.id]=e}),t}const oe={spatialObjectReference:ie(ee.spatialObjectReference),spatialEntity:ie(ee.spatialEntity),spatialPlacement:ie(ee.spatialPlacement)};function ae(e,t,n,r){const o={"@id":t,"@type":n};return e.some(e=>{const t=r[e.predicate.id];if(t){const n="Literal"===e.object.termType?Object(J.fromRdf)(e.object):e.object.id;Object(H.set)(o,t,n)}return!1},i.DataFactory.namedNode(t),null,null,null),o}function se(e,t){return ae(e,t,"SpatialObjectReference",oe.spatialObjectReference)}function ue(e,t){const n=ae(e,t,"ExtractionSet",oe.spatialEntity);return n.extractionSites=Object(H.sortBy)(e.getSubjects(ee.spatialEntity.extraction_set,t,null).map(t=>ce(e,t.id)),["rui_rank"]),n}function ce(e,t){const n=ae(e,t,"SpatialEntity",oe.spatialEntity);return n.object&&(n.object=se(e,n.object)),e.forSubjects(e=>n.entityId=e.id,Y.spatialEntity,t,null),n}function le(e,t){const n=t;let r;switch(n.translation_units){case"centimeter":r=.01;break;case"millimeter":r=.001;break;case"meter":default:r=1}const i=[n.x_translation,n.y_translation,n.z_translation].map(e=>e*r),o=[n.x_rotation,n.y_rotation,n.z_rotation].map(y),a=W()(Object(q.fromEuler)(o[1],o[0],o[2],"XYZ").toVector()),s=[n.x_scaling,n.y_scaling,n.z_scaling];return e.translate(i).rotateXYZ(a).scale(s)}class he{constructor(e){this.db=e,this.createGraph()}createGraph(){this.graph=new G.DirectedGraph;const e=this.db.store;e.forSubjects(t=>{this.addSpatialObjectReference(se(e,t.id))},X.type,ee.SpatialObjectReference,null),e.forSubjects(t=>{this.addSpatialEntity(ce(e,t.id))},X.type,ee.SpatialEntity,null),e.forSubjects(t=>{this.addSpatialPlacement(function(e,t){const n=ae(e,t,"SpatialPlacement",oe.spatialPlacement);return n.source&&(n.source=ce(e,n.source)),n.target&&(n.target=ce(e,n.target)),n}(e,t.id))},X.type,ee.SpatialPlacement,null)}addSpatialEntity(e){this.graph.mergeNode(e["@id"],{type:"SpatialEntity",object:e})}addSpatialObjectReference(e){this.graph.mergeNode(e["@id"],{type:"SpatialObjectReference",object:e})}addSpatialPlacement(e){this.graph.mergeDirectedEdge(e.source["@id"],e.target["@id"],{type:"SpatialPlacement",placement:e})}getTransformationMatrix(e,t){if(e===t)return new U;if(!this.graph.hasNode(e)||!this.graph.hasNode(t))return;const n=new U,r=V()(this.graph,e,t);if(r&&r.length>0){r.reverse();let e="";for(const t of r)e&&le(n,this.graph.getEdgeAttribute(t,e,"placement")),e=t;return n}}}class de{constructor(e){this.db=e}getSpatialEntity(e){return ce(this.db.store,e)}getExtractionSets(e){return function(e,t){return Object(H.sortBy)(e.getSubjects(ee.spatialEntity.extraction_set_for,t,null).map(t=>ue(e,t.id)),["rui_rank"])}(this.db.store,e)}getExtractionSet(e){return ue(this.db.store,e)}getAnatomicalStructures(e){return function(e,t){return Object(H.sortBy)(e.getSubjects(ee.spatialEntity.reference_organ,t,null).map(t=>ce(e,t.id)).filter(e=>e["@id"]!==t),["rui_rank"])}(this.db.store,e)}getReferenceOrgans(){return function(e){const t=[];return e.forEach(n=>{n.subject.id===n.object.id&&t.push(ce(e,n.subject.id))},null,ee.spatialEntity.reference_organ,null,null),Object(H.sortBy)(t,["rui_rank"])}(this.db.store)}getReferenceBody(e){let t;switch(null==e?void 0:e.sex){case"Male":t=ee.spatial.Male.id;break;case"Female":t=ee.spatial.Female.id;break;case"Both":default:t=ee.spatial.BothSexes.id}return this.getSpatialEntity(t)}getReferenceOrganSets(e){let t;switch(null==e?void 0:e.sex){case"Male":t=ee.spatial.MaleOrgans.id;break;case"Female":t=ee.spatial.FemaleOrgans.id;break;case"Both":default:t=ee.spatial.FemaleOrgans.id}return[this.getSpatialEntity(t)]}getReferenceSceneNodes(e){const t=this.getSpatialEntity(ee.spatial.Body.id),n=this.getReferenceBody(e),r=(null==e?void 0:e.ontologyTerms)||[],i={body:0===r.indexOf(re.body.id),kidney:0===r.indexOf(re.kidney.id),right_kidney:0===r.indexOf(re.right_kidney.id),left_kidney:0===r.indexOf(re.left_kidney.id),spleen:0===r.indexOf(re.spleen.id)};let o=[this.getSceneNode(n,t,{unpickable:!0,color:[255,255,255,255]}),...this.getReferenceOrganSets(e).map(e=>this.getSceneNode(e,n,{unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!0,color:[255,255,255,255]})),this.getSceneNode(this.getSpatialEntity(ee.x("VHRightKidney").id),n,{color:[255,255,255,1],unpickable:i.kidney||i.right_kidney,zoomToOnLoad:i.right_kidney}),this.getSceneNode(this.getSpatialEntity(ee.x("VHLeftKidney").id),n,{color:[255,255,255,1],unpickable:i.kidney||i.left_kidney,zoomToOnLoad:i.left_kidney}),this.getSceneNode(this.getSpatialEntity(ee.x("VHSpleen").id),n,{color:[255,255,255,1],unpickable:i.spleen,zoomToOnLoad:i.spleen})];return(null==e?void 0:e.debug)&&(o=o.concat([this.getSceneNode(this.getSpatialEntity(ee.x("VHRightKidney").id),t,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(ee.x("VHLeftKidney").id),t,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(ee.x("VHSpleenCC1").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(ee.x("VHSpleenCC2").id),t,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(ee.x("VHSpleenCC3").id),t,{color:[0,255,0,127.5],wireframe:!0})])),o.filter(e=>void 0!==e)}getEntitySceneNodes(e){const t=this.getReferenceBody(e),n=new Set(null==e?void 0:e.highlightedEntities);return this.db.getSpatialEntities(e).map(e=>this.getSceneNode(e,t,{color:n.has(e.entityId)?[10,10,229,229.5]:[255,255,255,229.5]})).filter(e=>void 0!==e)}getSceneNode(e,t,n={}){var r,i,o;const a=e.object&&(null===(r=e.object.file_format)||void 0===r?void 0:r.startsWith("model/gltf"));let s=this.db.graph.getTransformationMatrix(a&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(s){if(a)s=(new U).rotateX(y(90)).multiplyLeft(s);else{let t;switch(e.dimension_units){case"centimeter":t=.01;break;case"millimeter":t=.001;break;case"meter":default:t=1}const n=[e.x_dimension,e.y_dimension,e.z_dimension].map(e=>e*t/2);s.scale(n)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId||void 0,representation_of:e.representation_of||void 0,scenegraph:a?null===(i=e.object)||void 0===i?void 0:i.file:void 0,scenegraphNode:a?null===(o=e.object)||void 0===o?void 0:o.file_subpath:void 0,transformMatrix:s,tooltip:e.label},n)}}getScene(e){return[...this.getReferenceSceneNodes(e),...this.getEntitySceneNodes(e)]}}function fe(e){return"string"==typeof e?parseFloat(e.replace(/[^\d\-\.]/g,"")):e}function pe(e){const{x:t,y:n,z:r}=e;return{x:fe(t),y:fe(n),z:fe(r)}}const ge="https://entity-api.hubmapconsortium.org/entities/",ye=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","","DR1-VU:","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),ve={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},me=function(){const e={};return Object.entries(re).forEach(([t,n])=>e[t]=n.id),e}(),be={BL:[me.body,me.bladder],RK:[me.body,me.kidney,me.right_kidney],LK:[me.body,me.kidney,me.left_kidney],HT:[me.body,me.heart],LI:[me.body,me.large_intestine],SI:[me.body,me.small_instestine],LL:[me.body,me.lung,me.left_lung],RL:[me.body,me.lung,me.right_lung],LY:[me.body,me.lymph_node],SP:[me.body,me.spleen],TH:[me.body,me.thymus],UR:[me.body,me.ureter],LV:[me.body,me.liver],OT:[me.body]},_e={BL:"Bladder",RK:"Right Kidney",LK:"Left Kidney",HT:"Heart",LI:"Large Intestine",SI:"Small Intestine",LL:"Left Lung",RL:"Right Lung",LY:"Lymph Node",SP:"Spleen",TH:"Thymus",UR:"Ureter",LV:"Liver",OT:"Other Organ"};class we{constructor(e,t="",n="",r){var i,o,a,s,u;this.data=e,this.assetsApi=t,this.id=this.data.uuid,this.entityType=this.data.entity_type,this.ancestors=this.data.ancestors||[],this.descendants=this.data.descendants||[],this.donor="Donor"===this.entityType?e:this.ancestors.find(e=>"Donor"===e.entity_type),this.organSample="Sample"===this.entityType&&"organ"===e.specimen_type?e:this.ancestors.find(e=>"Sample"===e.entity_type&&"organ"===e.specimen_type);const c=(this.donor.description||"").toLowerCase();let l;c.includes("female")?l="Female":c.includes("male")&&(l="Male");const h=c.match(/age\ ([0-9]+)/);let d,f,p;h&&(d=Object(H.toNumber)(h[1]));for(const E of Object(H.get)(this.donor,"metadata.organ_donor_data",[]))"Feminine gender"===E.preferred_term||"Female"===E.preferred_term?l="Female":"Masculine gender"===E.preferred_term||"Male"===E.preferred_term?l="Male":"Current chronological age"===E.preferred_term||"Age"===E.preferred_term?d=Object(H.toNumber)(E.data_value):"Body mass index"===E.preferred_term?f=Object(H.toNumber)(E.data_value):"Racial group"!==E.grouping_concept_preferred_term&&"Race"!==E.grouping_concept_preferred_term||(p=E.preferred_term);let g="";l&&d&&(g+=`${l}, Age ${d}`,f&&(g+=`, BMI ${f.toFixed(1)}`)),this.age=d,this.sex=l,this.bmi=f,this.ethnicity=p,this.label=g,this.doi=e.display_doi,this.description=e.description;const y=this.groupUUID=e.group_uuid||this.donor.group_uuid;this.groupName=ve[y]||e.group_name||this.donor.group_name,this.organName=[e,...this.ancestors,...this.descendants].map(e=>e.organ).find(e=>!!e),this.ontologyTerms=be[this.organName]||[me.body],this.organ=this.ontologyTerms[this.ontologyTerms.length-1],this.protocolUrl=this.donor.protocol_url;let v=e.rui_location||this.ancestors[0].rui_location;if(v)if("string"==typeof v&&(v=JSON.parse(v)),v.alignment_id){let t;"07a29e4c-ed43-11e8-b56a-0e8017bdda58"===y&&(v=function(e,t){e=function(e){return e=Object.assign(Object.assign({},e),{tissue_object_size:pe(e.tissue_object_size),tissue_object_rotation:pe(e.tissue_object_rotation),tissue_position_mass_point:pe(e.tissue_position_mass_point)}),Object.entries(e).forEach(([t,n])=>{"string"==typeof n&&Object(H.set)(e,t,n.replace(/^_|mm_$|_$/g,""))}),e}(e);const n=t.lab_tissue_sample_id||"";return n.match(/CC1|CC\-1/)?(e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleenCC1",e.tissue_position_mass_point={x:29.95+e.tissue_position_mass_point.x,y:40.7-60,z:0},e.tissue_object_size.x=10):n.match(/CC2|CC\-2/)?(e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleenCC2",e.tissue_position_mass_point={x:31.5+e.tissue_position_mass_point.x,y:-19.9,z:0},e.tissue_object_size.x=10):n.match(/CC3|CC\-3/)?(e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleenCC3",e.tissue_position_mass_point={x:29.35+e.tissue_position_mass_point.x,y:-16.6,z:0},e.tissue_object_size.x=10):e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleen",e}(v,e)),this.organ===me.left_kidney?t=ee.x("VHLeftKidney").id:this.organ===me.right_kidney&&(t=ee.x("VHRightKidney").id),this.spatialEntity=function(e,t,n){let r;n?r=n:"uuid-1234-5678"===e.reference_organ_id?r=ee.x("VHKidney").id:e.reference_organ_id&&(r=e.reference_organ_id),(null==r?void 0:r.endsWith("Kidney"))&&(e=function(e){return Object.assign(Object.assign({},e),{tissue_position_mass_point:{x:e.tissue_position_mass_point.x-30,y:e.tissue_position_mass_point.y-50,z:e.tissue_position_mass_point.z-30}})}(e));const i=e.tissue_object_size,o=e.tissue_object_rotation,a=e.tissue_position_mass_point;return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":"http://purl.org/ccf/0.5/"+e.alignment_id,"@type":"SpatialEntity",label:t||void 0,creator:`${e.alignment_operator_first_name} ${e.alignment_operator_last_name}`,creator_first_name:e.alignment_operator_first_name,creator_last_name:e.alignment_operator_last_name,creation_date:e.alignment_datetime,ccf_annotations:[],x_dimension:i.x,y_dimension:i.y,z_dimension:i.z,dimension_units:"millimeter",placement:{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":"http://purl.org/ccf/0.5/"+e.alignment_id+"_placement","@type":"SpatialPlacement",target:r,placement_date:e.alignment_datetime,x_scaling:1,y_scaling:1,z_scaling:1,scaling_units:"ratio",x_rotation:o.x,y_rotation:o.y,z_rotation:o.z,rotation_order:"XYZ",rotation_units:"degree",x_translation:a.x,y_translation:a.y,z_translation:a.z,translation_units:"millimeter"}}}(v,"SpatialEntity for "+this.label,t)}else v["@id"]&&(this.spatialEntity=v);let m=[];const b=[];for(const E of[e,...this.ancestors,...this.descendants]){const e=Object(H.get)(E,"metadata.files",[]).filter(e=>/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)).filter(e=>!/(multilayer\.ome\.tif|\_ac\.ome\.tif)/.test(e.rel_path)).filter(e=>"73bb26e4-ed43-11e8-8f19-0a7c1eab007a"!==y||ye.has(e.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))).map(e=>`${this.assetsApi}/${E.uuid}/${e.rel_path}`+(r?`?token=${r}`:""));e.length>0&&(m=m.concat(e),b.push(ge+E.uuid))}m.length>0&&(this.images=m,this.imageProviders=b);const _=new Map,w=new Map;let x=!1;for(const E of[...this.ancestors,e,...this.descendants]){(E.data_types||[]).forEach(e=>_.set(e,E));const e=null===(o=null===(i=E.metadata)||void 0===i?void 0:i.metadata)||void 0===o?void 0:o.assay_type;e&&w.set(e,E),"yes"!==E.contains_human_genetic_sequences&&!0!==E.contains_human_genetic_sequences||(x=!0)}this.containsHumanGeneticSequences=x,this.dataTypes=[..._.keys()].sort(),this.assayTypes=[...w.keys()].sort();const S=[...this.dataTypes,...this.assayTypes].map(e=>e.toLowerCase()).join("|");if(-1!==S.indexOf("10x")?(this.thumbnailUrl="assets/icons/ico-bulk-10x.svg",this.spatialOrBulk="Bulk"):-1!==S.indexOf("af")?(this.thumbnailUrl="assets/icons/ico-spatial-af.svg",this.spatialOrBulk="Spatial"):-1!==S.indexOf("codex")?(this.thumbnailUrl="assets/icons/ico-spatial-codex.svg",this.spatialOrBulk="Spatial"):-1!==S.indexOf("imc")?(this.thumbnailUrl="assets/icons/ico-spatial-imc.svg",this.spatialOrBulk="Spatial"):-1!==S.indexOf("lc")&&-1===S.indexOf("af")?(this.thumbnailUrl="assets/icons/ico-bulk-lc.svg",this.spatialOrBulk="Bulk"):(this.thumbnailUrl="assets/icons/ico-unknown.svg",this.spatialOrBulk="Bulk"),this.portalUrl=`${n}browse/sample/${this.id}`,m.length>0&&-1===S.indexOf("codex")){if(this.resultUrl=m[0],this.resultType="image_viewer",this.thumbnailUrl="assets/histology3.jpg","73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===y){const e=this.resultUrl.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");ye.has(e)&&(this.thumbnailUrl=`assets/thumbnails/DR1-VU/${e}`)}}else{if(_.has("codex_cytokit")){const e=null===(a=_.get("codex_cytokit"))||void 0===a?void 0:a.uuid;this.resultUrl=`${n}browse/dataset/${e}#visualization`}else if(_.has("salmon_rnaseq_10x")){const e=null===(s=_.get("salmon_rnaseq_10x"))||void 0===s?void 0:s.uuid;this.resultUrl=`${n}browse/dataset/${e}#visualization`}else if(_.has("image_pyramid")){const e=null===(u=_.get("image_pyramid"))||void 0===u?void 0:u.uuid;this.resultUrl=`${n}browse/dataset/${e}#visualization`}else this.resultUrl=this.portalUrl;this.resultType="external_link"}}toJsonLd(){var e;const t=this.data;return Object.assign(Object.assign({"@id":ge+this.id,"@type":"Entity"},Object(H.omit)(this,["data","donor","organ_sample","organSample","ancestors","descendants","assetsApi"])),{donor:ge+this.donor.uuid,shortInfo0:this.doi,shortInfo1:this.groupName,shortInfo2:t.description||this.donor.description,downloadUrl:this.portalUrl,downloadTooltip:"View in the HuBMAP Data Portal",organName:_e[this.organName]||this.organName,sex:this.sex,age:this.age,bmi:null===(e=this.bmi)||void 0===e?void 0:e.toFixed(1),ethnicity:this.ethnicity,authorGroup:this.groupName,creator:t.created_by_user_displayname,creation_date:new Date(t.create_timestamp||0).toLocaleDateString(),modified_date:new Date(t.last_modified_timestamp||0).toLocaleDateString(),donor_id:this.donor.display_doi,organ_id:this.organSample.display_doi,tissue_id:this.doi,specimen_type:this.data.specimen_type,data_types:this.dataTypes.join(", "),assay_types:this.assayTypes.join(", "),spatial_bulk:this.spatialOrBulk,contains_sequence:this.containsHumanGeneticSequences?"Yes":"No",description:t.description||this.donor.description})}}function xe(e,t){return n=>e.has(n.id)?t.add(n.id):void 0}const Se={[Y.id.id]:"id",[Y.x("label").id]:"label",[Y.x("organName").id]:"organName"},Ee={[Y.sex.id]:"Sex",[Y.age.id]:"Age",[Y.x("bmi").id]:"BMI",[Y.x("ethnicity").id]:"Ethnicity",[Y.groupName.id]:"Author Group",[Y.x("creator").id]:"Creator",[Y.x("creation_date").id]:"Date Created",[Y.x("modified_date").id]:"Date Modified",[Y.x("donor_id").id]:"HuBMAP Donor ID",[Y.x("organ_id").id]:"HuBMAP Organ ID",[Y.x("tissue_id").id]:"HUBMAP Tissue ID",[Y.x("specimen_type").id]:"Specimen Type",[Y.x("data_types").id]:"Data Type(s)",[Y.x("assay_types").id]:"Assay(s)",[Y.x("spatial_bulk").id]:"Spatial/Bulk",[Y.x("contains_sequence").id]:"Contains Sequence",[Y.x("description").id]:"Description"},je={[Y.id.id]:"id",[Y.x("label").id]:"label",[Y.x("shortInfo0").id]:["shortInfo","0"],[Y.x("shortInfo1").id]:["shortInfo","1"],[Y.x("shortInfo2").id]:["shortInfo","2"],[Y.x("thumbnailUrl").id]:"thumbnailUrl",[Y.x("downloadUrl").id]:"downloadUrl",[Y.x("downloadTooltip").id]:"downloadTooltip",[Y.x("resultUrl").id]:"resultUrl",[Y.x("resultType").id]:"resultType"},Ne={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"},Ie=Symbol("Comlink.proxy"),Te=Symbol("Comlink.endpoint"),Ae=Symbol("Comlink.releaseProxy"),ke=Symbol("Comlink.thrown"),Oe=e=>"object"==typeof e&&null!==e||"function"==typeof e,Re=new Map([["proxy",{canHandle:e=>Oe(e)&&e[Ie],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Le(e,t),[n,[n]]},deserialize:e=>(e.start(),Ce(e,[],void 0))}],["throw",{canHandle:e=>Oe(e)&&ke in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function Le(e,t=self){t.addEventListener("message",function n(r){if(!r||!r.data)return;const{id:i,type:o,path:a}=Object.assign({path:[]},r.data),s=(r.data.argumentList||[]).map(Ue);let u;try{const t=a.slice(0,-1).reduce((e,t)=>e[t],e),n=a.reduce((e,t)=>e[t],e);switch(o){case 0:u=n;break;case 1:t[a.slice(-1)[0]]=Ue(r.data.value),u=!0;break;case 2:u=n.apply(t,s);break;case 3:u=function(e){return Object.assign(e,{[Ie]:!0})}(new n(...s));break;case 4:{const{port1:t,port2:n}=new MessageChannel;Le(e,n),u=function(e,t){return Fe.set(e,t),e}(t,[t])}break;case 5:u=void 0}}catch(c){u={value:c,[ke]:0}}Promise.resolve(u).catch(e=>({value:e,[ke]:0})).then(e=>{const[r,a]=Be(e);t.postMessage(Object.assign(Object.assign({},r),{id:i}),a),5===o&&(t.removeEventListener("message",n),Me(t))})}),t.start&&t.start()}function Me(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function De(e){if(e)throw new Error("Proxy has been released and is not useable")}function Ce(e,t=[],n=function(){}){let r=!1;const i=new Proxy(n,{get(n,o){if(De(r),o===Ae)return()=>Ge(e,{type:5,path:t.map(e=>e.toString())}).then(()=>{Me(e),r=!0});if("then"===o){if(0===t.length)return{then:()=>i};const n=Ge(e,{type:0,path:t.map(e=>e.toString())}).then(Ue);return n.then.bind(n)}return Ce(e,[...t,o])},set(n,i,o){De(r);const[a,s]=Be(o);return Ge(e,{type:1,path:[...t,i].map(e=>e.toString()),value:a},s).then(Ue)},apply(n,i,o){De(r);const a=t[t.length-1];if(a===Te)return Ge(e,{type:4}).then(Ue);if("bind"===a)return Ce(e,t.slice(0,-1));const[s,u]=Pe(o);return Ge(e,{type:2,path:t.map(e=>e.toString()),argumentList:s},u).then(Ue)},construct(n,i){De(r);const[o,a]=Pe(i);return Ge(e,{type:3,path:t.map(e=>e.toString()),argumentList:o},a).then(Ue)}});return i}function Pe(e){const t=e.map(Be);return[t.map(e=>e[0]),(n=t.map(e=>e[1]),Array.prototype.concat.apply([],n))];var n}const Fe=new WeakMap;function Be(e){for(const[t,n]of Re)if(n.canHandle(e)){const[r,i]=n.serialize(e);return[{type:3,name:t,value:r},i]}return[{type:0,value:e},Fe.get(e)||[]]}function Ue(e){switch(e.type){case 3:return Re.get(e.name).deserialize(e.value);case 0:return e.value}}function Ge(e,t,n){return new Promise(r=>{const i=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.addEventListener("message",function t(n){n.data&&n.data.id&&n.data.id===i&&(e.removeEventListener("message",t),r(n.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)})}Le(new class{constructor(e=Ne){this.options=e,this.store=new i.Store,this.graph=new he(this),this.scene=new de(this)}connect(e){return r(this,void 0,void 0,function*(){return e&&(this.options=e),this.initializing||(this.initializing=this.doConnect()),yield this.initializing,this.store.size>0})}doConnect(){return r(this,void 0,void 0,function*(){const e=[];this.options.ccfOwlUrl.endsWith(".n3")?e.push(Object(i.addN3ToStore)(this.options.ccfOwlUrl,this.store)):e.push(Object(i.addRdfXmlToStore)(this.options.ccfOwlUrl,this.store)),this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith(".jsonld")?e.push(Object(i.addJsonLdToStore)(this.options.hubmapDataUrl,this.store)):e.push(function(e,t,n,o,a="",s=""){return r(this,void 0,void 0,function*(){let r;if("static"===n)r=yield fetch(t).then(e=>e.ok?e.json():void 0).catch(()=>{});else if("search-api"===n){const e={"Content-type":"application/json"};o&&o.length>0&&(e.Authorization=`Bearer ${o}`),r=yield fetch(t,{method:"POST",headers:e,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:{exists:{field:"rui_location"}}})}).then(e=>e.ok?e.json():void 0).catch(()=>{})}r?yield Object(i.addJsonLdToStore)(function(e,t="",n="",r,i=!1){const o=Object(H.get)(e,"hits.hits",[]).map(e=>Object(H.get)(e,"_source",{}));return i&&function(e){const t=[];for(const n of Object(H.sortBy)(e.concat(),["groupName","data.hubmap_display_id"])){const e={UUID:n.id,"Group Name":n.groupName,"Entity Type":n.entityType,"Sample ID":n.data.hubmap_display_id,"Donor ID":n.donor.display_doi,"Organ Sample ID":n.organSample.display_doi,"Has Datasets":"No","Has TIFFs":"","Has Thumbnails":"","Dataset ID":"","Data Type(s)":n.dataTypes.join("|"),"Assay Type(s)":n.assayTypes.join("|"),TIFFs:"",Thumbnails:""};t.push(e);for(const r of n.descendants.filter(e=>"Dataset"===e.entity_type)){e["Has Datasets"]="Yes";const i=Object(H.get)(r,"metadata.files",[]).filter(e=>/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)).map(e=>e.rel_path).map(e=>e.split("/").slice(-1)[0].split("?")[0]),o=[];if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===n.groupUUID)for(const t of i){const n=t.replace(".ome.tif","_thumbnail.png");ye.has(n)&&(o.push(n),e["Has Thumbnails"]="Yes")}i.length>0&&(e["Has TIFFs"]="Yes");const a=Object.assign({},e,{UUID:"","Entity Type":r.entity_type,"Dataset ID":r.display_doi,"Data Type(s)":(r.data_types||[]).join("|"),"Assay Type(s)":Object(H.get)(r,"metaata.metadata.assay_type",""),TIFFs:i.join("|"),Thumbnails:o.join("|")});t.push(a)}}console.log(t)}(o.map(e=>new we(e,t,n,r))),{"@context":{"@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ontologyTerms:{"@type":"@id"},ancestors:{"@type":"@id"},descendants:{"@type":"@id"},organ:{"@type":"@id"},images:{"@id":"hasImage","@type":"@id"},imageProviders:{"@id":"hasImageProvider","@type":"@id"}},"@graph":o.map(e=>new we(e,t,n,r).toJsonLd())}}(r,a,s,o),e):console.warn(`Unable to load ${t} as HuBMAP Data`)})}(this.store,this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl))),e.push(Object(i.addJsonLdToStore)("assets/kpmp/data/rui_locations.jsonld",this.store).catch(e=>console.log("Couldn't locate KPMP data."))),yield Promise.all(e),yield new Promise(e=>setTimeout(e,500)),this.graph.createGraph()})}getIds(e={}){return function(e,t){var n,r,o,a;let s=function(e){const t=new Set;return e.forSubjects(e=>t.add(e.id),Y.id,null,null),t}(e);if(s.size>0&&(!0===t.hasSpatialEntity||!1===t.hasSpatialEntity)&&(s=function(e,t,n){const r=new Set;if(e.forSubjects(xe(t,r),Y.spatialEntity,null,null),!n){const e=new Set;return t.forEach(t=>r.has(t)?void 0:e.add(t)),e}return r}(e,s,t.hasSpatialEntity)),s.size>0&&("Male"===t.sex||"Female"===t.sex)&&(s=function(e,t,n){const r=new Set;return e.forSubjects(xe(t,r),Y.sex,Y[n],null),r}(e,s,t.sex)),s.size>0&&(null===(n=t.tmc)||void 0===n?void 0:n.length)>0&&(s=function(e,t,n){const r=new Set;for(const o of n){const n=i.DataFactory.literal(o);e.forSubjects(xe(t,r),Y.groupName,n,null)}return r}(e,s,t.tmc)),s.size>0&&(null===(r=t.ontologyTerms)||void 0===r?void 0:r.length)>0&&(s=function(e,t,n){const r=new Set;for(const o of n){const n=i.DataFactory.namedNode(o);e.forSubjects(xe(t,r),Y.ontologyTerms,n,null)}return r}(e,s,t.ontologyTerms)),s.size>0&&2===(null===(o=t.ageRange)||void 0===o?void 0:o.length)&&Object(H.isFinite)(t.ageRange[0])&&Object(H.isFinite)(t.ageRange[1])){const n=Math.max(...t.ageRange),r=Math.min(...t.ageRange);1===r&&110===n||(s=function(e,t,n,r){const i=new Set;return e.some(e=>{if(t.has(e.subject.id)){const t=Object(J.fromRdf)(e.object);t>=n&&t<=r&&i.add(e.subject.id)}return!1},null,Y.age,null,null),i}(e,s,r,n))}if(s.size>0&&2===(null===(a=t.bmiRange)||void 0===a?void 0:a.length)&&Object(H.isFinite)(t.bmiRange[0])&&Object(H.isFinite)(t.bmiRange[1])){const n=Math.max(...t.bmiRange),r=Math.min(...t.bmiRange);13===r&&83===n||(s=function(e,t,n,r){const i=new Set;return e.some(e=>{if(t.has(e.subject.id)){const t=Object(J.fromRdf)(e.object);t>=n&&t<=r&&i.add(e.subject.id)}return!1},null,Y.bmi,null,null),i}(e,s,r,n))}return s}(this.store,e)}get(e){return this.store.getQuads(i.DataFactory.namedNode(e),null,null,null)}search(e={}){return[...this.getIds(e)].map(e=>this.get(e))}getSpatialEntities(e){return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),[...this.getIds(e)].map(e=>function(e,t){const n=e.getObjects(i.DataFactory.namedNode(t),Y.spatialEntity,null);return n.length>0?ce(e,n[0].id):void 0}(this.store,e))}getListResults(e){return r(this,void 0,void 0,function*(){e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0});const t=new Set(e.highlightedEntities);return[...this.getIds(e)].map(e=>function(e,t){const n={"@id":t,"@type":"ListResult"};return e.some(e=>{const t=je[e.predicate.id];if(t){const r="Literal"===e.object.termType?Object(J.fromRdf)(e.object):e.object.id;Object(H.set)(n,t,r)}return!1},i.DataFactory.namedNode(t),null,null,null),n}(this.store,e)).map(e=>Object.assign(e,{highlighted:t.has(e["@id"])})).sort((e,t)=>(e.highlighted?0:1)-(t.highlighted?0:1))})}getAggregateResults(e){return r(this,void 0,void 0,function*(){return function(e,t){const n=new Set;t.some(t=>(e.has(t.subject.id)&&n.add(t.object.id),!1),null,Y.groupUUID,null,null);const r=new Set;t.some(t=>(e.has(t.subject.id)&&r.add(t.object.id),!1),null,Y.donor,null,null);const i=new Set;return t.forSubjects(t=>{e.has(t.id)&&i.add(t.id)},Y.spatialEntity,null,null),Object.entries({Centers:n.size,Donors:r.size,Samples:i.size}).map(([e,t])=>({label:e,count:t}))}(this.getIds(e),this.store)})}getOntologyTermOccurences(e){return r(this,void 0,void 0,function*(){return function(e,t){const n={};return t.some(t=>(e.has(t.subject.id)&&(n[t.object.id]=1+(n[t.object.id]||0)),!1),null,Y.ontologyTerms,null,null),n}(this.getIds(e),this.store)})}getImageViewerData(e){return r(this,void 0,void 0,function*(){return function(e,t){const n={"@id":e,"@type":"ImageViewerData"},r={};return t.some(e=>{const t=Se[e.predicate.id];if(Ee[e.predicate.id]){const t="Literal"===e.object.termType?Object(J.fromRdf)(e.object):e.object.id;r[e.predicate.id]=""+t}if(t){const r="Literal"===e.object.termType?Object(J.fromRdf)(e.object):e.object.id;Object(H.set)(n,t,r)}return!1},i.DataFactory.namedNode(e),null,null,null),n.metadata=Object.entries(Ee).map(([e,t])=>({label:t,value:r[e]})).filter(e=>e.value),n}(e,this.store)})}getScene(e){return r(this,void 0,void 0,function*(){return this.graph.createGraph(),this.scene.getScene(e)})}})},JFj6:function(e,t,n){e.exports=function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){return i(t[a][1][e]||e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o=!1,a=0;a0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var i=[],o=t;o>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);var a;return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],11:[function(e,t,n){},{}],12:[function(e,t,n){(function(t){"use strict";var r=e("base64-js"),i=e("ieee754");function o(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=new Uint8Array(e);return n.__proto__=t.prototype,n}function t(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,n)}function a(e,n,r){if("string"==typeof e)return function(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!t.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var r=0|h(e,n),i=o(r),a=i.write(e,n);return a!==r&&(i=i.slice(0,a)),i}(e,n);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer))return function(e,n,r){if(n<0||e.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function h(e,n){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var o=!1;;)switch(n){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(e).length;default:if(o)return i?-1:M(e).length;n=(""+n).toLowerCase(),o=!0}}function d(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return E(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return x(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function p(e,n,r,i,o){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof n&&(n=t.from(n,i)),t.isBuffer(n))return 0===n.length?-1:g(e,n,r,i,o);if("number"==typeof n)return n&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,n,r):Uint8Array.prototype.lastIndexOf.call(e,n,r):g(e,[n],r,i,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var h=!0,d=0;di&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a>8,i.push(n%256),i.push(r);return i}(t,e.length-n),e,n,r)}function x(e,t,n){return r.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function S(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(r.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;ri)&&(n=i);for(var o="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function A(e,n,r,i,o,a){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>o||ne.length)throw new RangeError("Index out of range")}function k(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(e,t,n,r,o){return t=+t,n>>>=0,o||k(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function R(e,t,n,r,o){return t=+t,n>>>=0,o||k(e,0,n,8),i.write(e,t,n,r,52,8),n+8}n.Buffer=t,n.SlowBuffer=function(e){return+e!=e&&(e=0),t.alloc(+e)},n.INSPECT_MAX_BYTES=50,n.kMaxLength=2147483647,(t.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(e,t,n){return a(e,t,n)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(e,t,n){return function(e,t,n){return s(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},t.allocUnsafe=function(e){return u(e)},t.allocUnsafeSlow=function(e){return u(e)},t.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==t.prototype},t.compare=function(e,n){if(P(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),P(n,Uint8Array)&&(n=t.from(n,n.offset,n.byteLength)),!t.isBuffer(e)||!t.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===n)return 0;for(var r=e.length,i=n.length,o=0,a=Math.min(r,i);ot&&(e+=" ... "),""},t.prototype.compare=function(e,n,r,i,o){if(P(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===n&&(n=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),n<0||r>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&n>=r)return 0;if(i>=o)return-1;if(n>=r)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(i>>>=0),s=(r>>>=0)-(n>>>=0),u=Math.min(a,s),c=this.slice(i,o),l=e.slice(n,r),h=0;h>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":return m(this,e,t,n);case"latin1":case"binary":return b(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},t.prototype.slice=function(e,n){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(n=void 0===n?r:~~n)<0?(n+=r)<0&&(n=0):n>r&&(n=r),n>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},t.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},t.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},t.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},t.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);A(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},t.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);A(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},t.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},t.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,n){return O(this,e,t,!0,n)},t.prototype.writeFloatBE=function(e,t,n){return O(this,e,t,!1,n)},t.prototype.writeDoubleLE=function(e,t,n){return R(this,e,t,!0,n)},t.prototype.writeDoubleBE=function(e,t,n){return R(this,e,t,!1,n)},t.prototype.copy=function(e,n,r,i){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),n>=e.length&&(n=e.length),n||(n=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-n=0;--a)e[a+n]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),n);return o},t.prototype.fill=function(e,n,r,i){if("string"==typeof e){if("string"==typeof n?(i=n,n=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var o=e.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(e=o)}}else"number"==typeof e&&(e&=255);if(n<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=n;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function D(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function C(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function F(e){return e!=e}}).call(this,e("buffer").Buffer)},{"base64-js":10,buffer:12,ieee754:17}],13:[function(e,t,n){var r=Object.create||function(e){var t=function(){};return t.prototype=e,new t},i=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return n},o=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function a(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=r(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._maxListeners=void 0;var s,u=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),s=0===c.x}catch(x){s=!1}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function h(e,t,n){if(t)e.call(n);else for(var r=e.length,i=w(e,r),o=0;o0&&s.length>o){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else s=a[t]=n,++e._eventsCount;return e}function v(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t1&&(t=arguments[1]),t instanceof Error)throw t;var u=new Error('Unhandled "error" event. ('+t+")");throw u.context=t,u}if(!(n=a[e]))return!1;var c="function"==typeof n;switch(r=arguments.length){case 1:h(n,c,this);break;case 2:d(n,c,this,arguments[1]);break;case 3:f(n,c,this,arguments[1],arguments[2]);break;case 4:p(n,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,o=a;break}if(o<0)return this;0===o?n.shift():function(e,t){for(var n=t,r=n+1,i=e.length;r=0;o--)this.removeListener(e,t[o]);return this},a.prototype.listeners=function(e){return b(this,e,!0)},a.prototype.rawListeners=function(e){return b(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):_.call(e,t)},a.prototype.listenerCount=_,a.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],14:[function(e,t,n){(function(t,r){var i=e("process/browser.js").nextTick,o=Function.prototype.apply,a=Array.prototype.slice,s={},u=0;function c(e,t){this._id=e,this._clearFn=t}n.setTimeout=function(){return new c(o.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new c(o.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof t?t:function(e){var t=u++,r=!(arguments.length<2)&&a.call(arguments,1);return s[t]=!0,i(function(){s[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof r?r:function(e){delete s[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":62,timers:14}],15:[function(e,t,n){"use strict";t.exports=function(e){return function e(t){if(null===t||"object"!=typeof t||null!=t.toJSON)return JSON.stringify(t);if(Array.isArray(t)&&0===t.length)return"[]";if(Array.isArray(t)&&1===t.length)return"["+e(t[0])+"]";if(Array.isArray(t))return"["+t.reduce((t,n,r)=>(t=1===r?e(t):t)+","+e(n))+"]";const n=Object.keys(t);return 0===n.length?"{}":1===n.length?"{"+e(n[0])+":"+e(t[n[0]])+"}":"{"+n.sort().reduce((n,r,i)=>(n=1===i?e(n)+":"+e(t[n]):n)+","+e(r)+":"+e(t[r]))+"}"}(e)}},{}],16:[function(e,t,n){(function(e){function t(e){return Object.prototype.toString.call(e)}n.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},n.isBoolean=function(e){return"boolean"==typeof e},n.isNull=function(e){return null===e},n.isNullOrUndefined=function(e){return null==e},n.isNumber=function(e){return"number"==typeof e},n.isString=function(e){return"string"==typeof e},n.isSymbol=function(e){return"symbol"==typeof e},n.isUndefined=function(e){return void 0===e},n.isRegExp=function(e){return"[object RegExp]"===t(e)},n.isObject=function(e){return"object"==typeof e&&null!==e},n.isDate=function(e){return"[object Date]"===t(e)},n.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},n.isFunction=function(e){return"function"==typeof e},n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},n.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":19}],17:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,h=n?i-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+h],h+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*u-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-p]|=128*g}},{}],18:[function(e,t,n){t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],19:[function(e,t,n){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],20:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],21:[function(e,t,n){"use strict";const{isArray:r,isObject:i,isString:o}=e("./types"),{asArray:a}=e("./util"),{prependBase:s}=e("./url"),u=e("./JsonLdError"),c=e("./ResolvedContext");function l(e){throw new u("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function h({context:e,base:t}){if(!e)return;const n=e["@context"];if(o(n))e["@context"]=s(t,n);else if(r(n))for(let r=0;r10)throw new u("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(a.has(t))throw new u("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let s,c;a.add(t);try{c=await n(t),s=c.document||null,o(s)&&(s=JSON.parse(s))}catch(l){throw new u("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:l})}if(!i(s))throw new u("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return s="@context"in s?{"@context":s["@context"]}:{"@context":{}},c.contextUrl&&(r(s["@context"])||(s["@context"]=[s["@context"]]),s["@context"].push(c.contextUrl)),{context:s,remoteDoc:c}}}},{"./JsonLdError":22,"./ResolvedContext":27,"./types":41,"./url":42,"./util":43}],22:[function(e,t,n){"use strict";t.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",n={}){super(e),this.name=t,this.message=e,this.details=n}}},{}],23:[function(e,t,n){"use strict";t.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},{}],24:[function(e,t,n){"use strict";t.exports=e("rdf-canonize").NQuads},{"rdf-canonize":73}],25:[function(e,t,n){"use strict";const{RDF_LANGSTRING:r,RDF_PLAIN_LITERAL:i,RDF_OBJECT:o,RDF_XML_LITERAL:a,XSD_STRING:s}=e("./constants");let u;u="undefined"!=typeof Node?Node:{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},t.exports=class{parse(t){const n={"@default":[]},c=t.getSubjects();for(let l=0;l{})})=>{if(i(n)){let r=[];for(let i=0;i1&&(I=Array.from(I).sort());const T=e;for(const t of I){const n=S.compactIri({activeCtx:T,iri:t,relativeTo:{vocab:!0}}),r=p(j,n,"@context");s(r)||(e=await y({activeCtx:e,localCtx:r,options:f,propagate:!1}))}const A=Object.keys(n).sort();for(const s of A){const d=n[s];if("@id"!==s)if("@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&"@included"!==s&&g(s)){const t=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});_(x,t,d)}else{if(!i(d))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===d.length){const t=S.compactIri({activeCtx:e,iri:s,value:d,relativeTo:{vocab:!0},reverse:b}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let r=x;n&&(E(e,n,f),o(x[n])||(x[n]={}),r=x[n]),_(r,t,d,{propertyIsArray:!0})}for(const t of d){const n=S.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:b}),r=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let d=x;r&&(E(e,r,f),o(x[r])||(x[r]={}),d=x[r]);const g=p(e,n,"@container")||[],y=l(t),v=u(t);let j;v?j=t["@list"]:y&&(j=t["@graph"]);let N=await S.compact({activeCtx:e,activeProperty:n,element:v||y?j:t,options:f,compactionMap:m});if(v){if(i(N)||(N=[N]),g.includes("@list")){_(d,n,N,{valueIsArray:!0,allowDuplicate:!0});continue}N={[S.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:N},"@index"in t&&(N[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(y)if(g.includes("@graph")&&(g.includes("@id")||g.includes("@index")&&h(t))){let r;d.hasOwnProperty(n)?r=d[n]:d[n]=r={};const i=(g.includes("@id")?t["@id"]:t["@index"])||S.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});_(r,i,N,{propertyIsArray:!f.compactArrays||g.includes("@set")})}else g.includes("@graph")&&h(t)?(i(N)&&N.length>1&&(N={"@included":N}),_(d,n,N,{propertyIsArray:!f.compactArrays||g.includes("@set")})):(i(N)&&1===N.length&&f.compactArrays&&(N=N[0]),N={[S.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:N},"@id"in t&&(N[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(N[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),_(d,n,N,{propertyIsArray:!f.compactArrays||g.includes("@set")}));else if(g.includes("@language")||g.includes("@index")||g.includes("@id")||g.includes("@type")){let r,i;if(d.hasOwnProperty(n)?r=d[n]:d[n]=r={},g.includes("@language"))c(N)&&(N=N["@value"]),i=t["@language"];else if(g.includes("@index")){const r=p(e,n,"@index")||"@index",o=S.compactIri({activeCtx:e,iri:r,relativeTo:{vocab:!0}});if("@index"===r)i=t["@index"],delete N[o];else{let e;if([i,...e]=w(N[r]||[]),a(i))switch(e.length){case 0:delete N[r];break;case 1:N[r]=e[0];break;default:N[r]=e}else i=null}}else if(g.includes("@id")){const t=S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=N[t],delete N[t]}else if(g.includes("@type")){const r=S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let o;switch([i,...o]=w(N[r]||[]),o.length){case 0:delete N[r];break;case 1:N[r]=o[0];break;default:N[r]=o}1===Object.keys(N).length&&"@id"in t&&(N=await S.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:f,compactionMap:m}))}i||(i=S.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),_(r,i,N,{propertyIsArray:g.includes("@set")})}else{const e=!f.compactArrays||g.includes("@set")||g.includes("@list")||i(N)&&0===N.length||"@list"===s||"@graph"===s;_(d,n,N,{propertyIsArray:e})}}}else{if((p(e,t,"@container")||[]).includes("@index"))continue;const n=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});_(x,n,d)}else{const n=await S.compact({activeCtx:e,activeProperty:t,element:d,options:f,compactionMap:m});i(n)&&0===n.length||_(x,s,n)}else{const t=await S.compact({activeCtx:e,activeProperty:"@reverse",element:d,options:f,compactionMap:m});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const r=t[n],i=(p(e,n,"@container")||[]).includes("@set")||!f.compactArrays;_(x,n,r,{propertyIsArray:i}),delete t[n]}if(Object.keys(t).length>0){const n=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});_(x,n,t)}}else{let t=w(d).map(e=>S.compactIri({activeCtx:j,iri:e,relativeTo:{vocab:!0}}));1===t.length&&(t=t[0]);const n=S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),r=(p(e,n,"@container")||[]).includes("@set")&&v(e,1.1)||i(t)&&0===d.length;_(x,n,t,{propertyIsArray:r})}else{let t=w(d).map(t=>S.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:f.base}));1===t.length&&(t=t[0]),x[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return x}return n},S.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:i={vocab:!1},reverse:a=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const h=e.getInverse();if(g(t)&&t in h&&"@none"in h[t]&&"@type"in h[t]["@none"]&&"@none"in h[t]["@none"]["@type"])return h[t]["@none"]["@type"]["@none"];if(i.vocab&&t in h){const r=e["@language"]||"@none",i=[];o(n)&&"@index"in n&&!("@graph"in n)&&i.push("@index","@index@set"),o(n)&&"@preserve"in n&&(n=n["@preserve"][0]),l(n)?("@index"in n&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in n||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||i.push("@graph@id","@graph@id@set")):o(n)&&!c(n)&&i.push("@id","@id@set","@type","@set@type");let s="@language",h="@null";if(a)s="@type",h="@reverse",i.push("@set");else if(u(n)){"@index"in n||i.push("@list");const e=n["@list"];if(0===e.length)s="@any",h="@none";else{let t=0===e.length?r:null,n=null;for(let r=0;re.includes("_"));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const u=e.inverse[t];for(const o of r){if(!(o in u))continue;const e=u[o][i];for(const t of s)if(t in e)return e[t]}return null}(e,t,n,i,s,h);if(null!==d)return d}if(i.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const r=t.substr(n.length);if(!e.mappings.has(r))return r}}let d=null;const f=[];let p=e.fastCurieMap;const y=t.length-1;for(let r=0;r=0;--r){const i=f[r],o=i.terms;for(const r of o){const o=r+":"+t.substr(i.iri.length);e.mappings.get(r)._prefix&&(!e.mappings.has(o)||null===n&&e.mappings.get(o)["@id"]===t)&&(null===d||x(o,d)<0)&&(d=o)}}if(null!==d)return d;for(const[o,u]of e.mappings)if(u&&u._prefix&&t.startsWith(o+":"))throw new r(`Absolute IRI "${t}" confused with prefix "${o}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});return i.vocab?t:"@base"in e?e["@base"]?m(b(s,e["@base"]),t):t:m(s,t)},S.compactValue=({activeCtx:e,activeProperty:t,value:n,options:r})=>{if(c(n)){const r=p(e,t,"@type"),i=p(e,t,"@language"),o=p(e,t,"@direction"),s=p(e,t,"@container")||[],u="@index"in n&&!s.includes("@index");if(!u&&"@none"!==r){if(n["@type"]===r)return n["@value"];if("@language"in n&&n["@language"]===i&&"@direction"in n&&n["@direction"]===o)return n["@value"];if("@language"in n&&n["@language"]===i)return n["@value"];if("@direction"in n&&n["@direction"]===o)return n["@value"]}const c=Object.keys(n).length,l=1===c||2===c&&"@index"in n&&!u,h="@language"in e,d=a(n["@value"]),f=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(l&&"@none"!==r&&(!h||!d||f))return n["@value"];const g={};return u&&(g[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?g[S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=S.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(g[S.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(g[S.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),g[S.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],g}const i=f(e,t,{vocab:!0},r),o=p(e,t,"@type"),s=S.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===o},base:r.base});return"@id"===o||"@vocab"===o||"@graph"===i?s:{[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:s}}},{"./JsonLdError":22,"./context":30,"./graphTypes":37,"./types":41,"./url":42,"./util":43}],29:[function(e,t,n){"use strict";const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#";t.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:r,RDF_LIST:r+"List",RDF_FIRST:r+"first",RDF_REST:r+"rest",RDF_NIL:r+"nil",RDF_TYPE:r+"type",RDF_PLAIN_LITERAL:r+"PlainLiteral",RDF_XML_LITERAL:r+"XMLLiteral",RDF_JSON_LITERAL:r+"JSON",RDF_OBJECT:r+"object",RDF_LANGSTRING:r+"langString",XSD:i,XSD_BOOLEAN:i+"boolean",XSD_DOUBLE:i+"double",XSD_INTEGER:i+"integer",XSD_STRING:i+"string"}},{}],30:[function(e,t,n){"use strict";const r=e("./util"),i=e("./JsonLdError"),{isArray:o,isObject:a,isString:s,isUndefined:u}=e("./types"),{isAbsolute:c,isRelative:l,prependBase:h}=e("./url"),{asArray:d,compareShortestLeast:f}=e("./util"),p=new Map,g=/^@[a-zA-Z]+$/,y={};function v(e,t,n,r,i,o){if(null===t||!s(t)||y.isKeyword(t))return t;if(t.match(g))return null;if(r&&r.hasOwnProperty(t)&&!0!==i.get(t)&&y.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:o}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(a(n)&&"@id"in n)return n["@id"]}const u=t.indexOf(":");if(u>0){const n=t.substr(0,u),a=t.substr(u+1);if("_"===n||0===a.indexOf("//"))return t;r&&r.hasOwnProperty(n)&&y.createTermDefinition({activeCtx:e,localCtx:r,term:n,defined:i,options:o});const s=e.mappings.get(n);if(s&&s._prefix)return s["@id"]+a;if(c(t))return t}if(n.vocab&&"@vocab"in e)return e["@vocab"]+t;if(n.base&&"@base"in e){if(e["@base"])return h(h(o.base,e["@base"]),t)}else if(n.base)return h(o.base,t);return t}function m(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let n=0;n{if(a(t)&&"@context"in t&&o(t["@context"])&&(t=t["@context"]),0===d(t).length)return e;const g=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});a(g[0].document)&&"boolean"==typeof g[0].document["@propagate"]&&(u=g[0].document["@propagate"]);let m=e;u||m.previousContext||(m=m.clone(),m.previousContext=e);for(const o of g){let{document:u}=o;if(e=m,null===u){if(!f&&0!==Object.keys(e.protected).length){const a=n&&n.protectedMode||"error";if("error"===a)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});if("warn"===a){console.warn("WARNING: invalid context nullification");const t=o.getProcessed(e);if(t){m=e=t;continue}const i=e;m=e=y.getInitialContext(n).clone();for(const[n,o]of Object.entries(i.protected))o&&(e.mappings[n]=r.clone(i.mappings[n]));e.protected=r.clone(i.protected),o.setProcessed(i,m);continue}throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,protectedMode:a})}m=e=y.getInitialContext(n).clone();continue}const d=o.getProcessed(e);if(d){m=e=d;continue}if(a(u)&&"@context"in u&&(u=u["@context"]),!a(u))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:u});m=m.clone();const g=new Map;if("@version"in u){if(1.1!==u["@version"])throw new i("Unsupported JSON-LD version: "+u["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:u});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+u["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:u});m.processingMode="json-ld-1.1",m["@version"]=u["@version"],g.set("@version",!0)}if(m.processingMode=m.processingMode||e.processingMode,"@base"in u){let e=u["@base"];if(null===e||c(e));else{if(!l(e))throw new i('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:u});e=h(m["@base"],e)}m["@base"]=e,g.set("@base",!0)}if("@vocab"in u){const e=u["@vocab"];if(null===e)delete m["@vocab"];else{if(!s(e))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});if(!c(e)&&y.processingMode(m,1))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});m["@vocab"]=v(m,e,{vocab:!0,base:!0},void 0,void 0,n)}g.set("@vocab",!0)}if("@language"in u){const e=u["@language"];if(null===e)delete m["@language"];else{if(!s(e))throw new i('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:u});m["@language"]=e.toLowerCase()}g.set("@language",!0)}if("@direction"in u){const t=u["@direction"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:u});if(null===t)delete m["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new i('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:u});m["@direction"]=t}g.set("@direction",!0)}if("@propagate"in u){const n=u["@propagate"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:u});if("boolean"!=typeof n)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});g.set("@propagate",!0)}if("@import"in u){const r=u["@import"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:u});if(!s(r))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const o=await n.contextResolver.resolve({activeCtx:e,context:r,documentLoader:n.documentLoader,base:n.base});if(1!==o.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const a=o[0].getProcessed(e);if(a)u=a;else{const n=o[0].document;if("@import"in n)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in n)u.hasOwnProperty(e)||(u[e]=n[e]);o[0].setProcessed(e,u)}g.set("@import",!0)}g.set("@protected",u["@protected"]||!1);for(const e in u)if(y.createTermDefinition({activeCtx:m,localCtx:u,term:e,defined:g,options:n,overrideProtected:f}),a(u[e])&&"@context"in u[e]){const t=u[e]["@context"];let r=!0;if(s(t)){const e=h(n.base,t);p.has(e)?r=!1:p.add(e)}if(r)try{await y.process({activeCtx:m,localCtx:u[e]["@context"],overrideProtected:!0,options:n,cycles:p})}catch(b){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:u[e]["@context"],term:e})}}o.setProcessed(e,m)}return m},y.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:r,options:u,overrideProtected:l=!1})=>{if(r.has(n)){if(r.get(n))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let h;if(r.set(n,!1),t.hasOwnProperty(n)&&(h=t[n]),"@type"===n&&a(h)&&"@set"===(h["@container"]||"@set")&&y.processingMode(e,1.1)){const e=["@container","@id","@protected"],r=Object.keys(h);if(0===r.length||r.some(t=>!e.includes(t)))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(y.isKeyword(n))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(g))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:n});if(""===n)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const d=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let f=!1;if((s(h)||null===h)&&(f=!0,h={"@id":h}),!a(h))throw new i("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const p={};e.mappings.set(n,p),p.reverse=!1;const b=["@container","@id","@language","@reverse","@type"];y.processingMode(e,1.1)&&b.push("@context","@direction","@index","@nest","@prefix","@protected");for(const o in h)if(!b.includes(o))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+o,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const _=n.indexOf(":");if(p._termHasColon=_>0,"@reverse"in h){if("@id"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const o=h["@reverse"];if(!s(o))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(!y.isKeyword(o)&&o.match(g))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:o}),void(d?e.mappings.set(n,d):e.mappings.delete(n));const a=v(e,o,{vocab:!0,base:!1},t,r,u);if(!c(a))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});p["@id"]=a,p.reverse=!0}else if("@id"in h){let o=h["@id"];if(o&&!s(o))throw new i("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===o)p["@id"]=null;else{if(!y.isKeyword(o)&&o.match(g))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:o}),void(d?e.mappings.set(n,d):e.mappings.delete(n));if(o!==n){if(o=v(e,o,{vocab:!0,base:!1},t,r,u),!c(o)&&!y.isKeyword(o))throw new i("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)&&v(e,n,{vocab:!0,base:!1},t,new Map(r).set(n,!0),u)!==o)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});p["@id"]=o,p._prefix=f&&!p._termHasColon&&o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in p))if(p._termHasColon){const i=n.substr(0,_);if(t.hasOwnProperty(i)&&y.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:r,options:u}),e.mappings.has(i)){const t=n.substr(_+1);p["@id"]=e.mappings.get(i)["@id"]+t}else p["@id"]=n}else if("@type"===n)p["@id"]=n;else{if(!("@vocab"in e))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});p["@id"]=e["@vocab"]+n}if((!0===h["@protected"]||!0===r.get("@protected")&&!1!==h["@protected"])&&(e.protected[n]=!0,p.protected=!0),r.set(n,!0),"@type"in h){let n=h["@type"];if(!s(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(y.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=v(e,n,{vocab:!0,base:!1},t,r,u),!c(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new i("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}p["@type"]=n}if("@container"in h){const n=s(h["@container"])?[h["@container"]]:h["@container"]||[],r=["@list","@set","@index","@language"];let a=!0;const u=n.includes("@set");if(y.processingMode(e,1.1)){if(r.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(n.includes("@graph")){if(n.some(e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e))throw new i("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else a&=n.length<=(u?2:1);if(n.includes("@type")&&(p["@type"]=p["@type"]||"@id",!["@id","@vocab"].includes(p["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else a&=!o(h["@container"]),a&=n.length<=1;if(a&=n.every(e=>r.includes(e)),a&=!(u&&n.includes("@list")),!a)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+r.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(p.reverse&&!n.every(e=>["@index","@set"].includes(e)))throw new i("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});p["@container"]=n}if("@index"in h){if(!("@container"in h)||!p["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!s(h["@index"])||0===h["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});p["@index"]=h["@index"]}if("@context"in h&&(p["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let e=h["@language"];if(null!==e&&!s(e))throw new i("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),p["@language"]=e}if("@prefix"in h){if(n.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(y.isKeyword(p["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof h["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});p._prefix=!0===h["@prefix"]}if("@direction"in h){const e=h["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});p["@direction"]=e}if("@nest"in h){const e=h["@nest"];if(!s(e)||"@nest"!==e&&0===e.indexOf("@"))throw new i("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});p["@nest"]=e}const w=p["@id"];if("@context"===w||"@preserve"===w)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(d&&d.protected&&!l&&(e.protected[n]=!0,p.protected=!0,!m(d,p))){const e=u&&u.protectedMode||"error";if("error"===e)throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n});if("warn"===e)return void console.warn("WARNING: protected term redefinition",{term:n});throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,term:n,protectedMode:e})}},y.expandIri=(e,t,n,r)=>v(e,t,n,void 0,void 0,r),y.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=p.get(t);if(n)return n;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){if(this.inverse)return this.inverse;const e=this.inverse={},t=this.fastCurieMap={},n={},r=(this["@language"]||"@none").toLowerCase(),i=this["@direction"],s=this.mappings,u=[...s.keys()].sort(f);for(const o of u){const u=s.get(o);if(null===u)continue;let c=u["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===u["@id"])continue;const l=d(u["@id"]);for(const s of l){let l=e[s];const h=y.isKeyword(s);if(l)h||u._termHasColon||n[s].push(o);else if(e[s]=l={},!h&&!u._termHasColon){n[s]=[o];const e={iri:s,terms:n[s]};s[0]in t?t[s[0]].push(e):t[s[0]]=[e]}if(l[c]||(l[c]={"@language":{},"@type":{},"@any":{}}),l=l[c],a(o,l["@any"],"@none"),u.reverse)a(o,l["@type"],"@reverse");else if("@none"===u["@type"])a(o,l["@any"],"@none"),a(o,l["@language"],"@none"),a(o,l["@type"],"@none");else if("@type"in u)a(o,l["@type"],u["@type"]);else if("@language"in u&&"@direction"in u){const e=u["@language"],t=u["@direction"];a(o,l["@language"],e&&t?`${e}_${t}`.toLowerCase():e?e.toLowerCase():t?`_${t}`:"@null")}else"@language"in u?a(o,l["@language"],(u["@language"]||"@null").toLowerCase()):"@direction"in u?a(o,l["@language"],u["@direction"]?`_${u["@direction"]}`:"@none"):i?(a(o,l["@language"],`_${i}`),a(o,l["@language"],"@none"),a(o,l["@type"],"@none")):(a(o,l["@language"],r),a(o,l["@language"],"@none"),a(o,l["@type"],"@none"))}}for(const a in t)o(t,a,1);return e},clone:function(){const e={};return e.mappings=r.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=r.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===p.size&&p.clear(),p.set(t,i),i;function o(e,t,n){const r=e[t],i=e[t]={};let a,s;for(const o of r)a=o.iri,s=n>=a.length?"":a[n],s in i?i[s].push(o):i[s]=[o];for(const u in i)""!==u&&o(i,u,n+1)}function a(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},y.getContextValue=(e,t,n)=>{if(null===t){if("@context"===n)return;return null}if(e.mappings.has(t)){const r=e.mappings.get(t);if(u(n))return r;if(r.hasOwnProperty(n))return r[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},y.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,y.isKeyword=e=>{if(!s(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},{"./JsonLdError":22,"./types":41,"./url":42,"./util":43}],31:[function(e,t,n){"use strict";const{parseLinkHeader:r,buildHeaders:i}=e("../util"),{LINK_HEADER_CONTEXT:o}=e("../constants"),a=e("../JsonLdError"),s=e("../RequestQueue"),{prependBase:u}=e("../url");t.exports=({secure:t,strictSSL:n=!0,maxRedirects:c=-1,request:l,headers:h={}}={strictSSL:!0,maxRedirects:-1,headers:{}})=>{h=i(h),l=l||e("request");const d=e("http");return(new s).wrapLoader(function(e){return f(e,[])});async function f(e,i){if(0!==e.indexOf("http:")&&0!==e.indexOf("https:"))throw new a('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:e});if(t&&0!==e.indexOf("https"))throw new a('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:e});let s,p=null;if(null!==p)return p;let g=null;try{s=await function(e,t){return new Promise((n,r)=>{e(t,(e,t,i)=>{e?r(e):n({res:t,body:i})})})}(l,{url:e,headers:h,strictSSL:n,followRedirect:!1})}catch(m){throw new a("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:e,cause:m})}const{res:y,body:v}=s;if(p={contextUrl:null,documentUrl:e,document:v||null},y.statusCode>=400)throw new a(`URL "${e}" could not be dereferenced: ${d.STATUS_CODES[y.statusCode]}`,"jsonld.InvalidUrl",{code:"loading document failed",url:e,httpStatusCode:y.statusCode});if(y.headers.link&&"application/ld+json"!==y.headers["content-type"]){const t=r(y.headers.link),n=t[o];if(Array.isArray(n))throw new a("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:e});n&&(p.contextUrl=n.target),g=t.alternate,g&&"application/ld+json"==g.type&&!(y.headers["content-type"]||"").match(/^application\/(\w*\+)?json$/)&&(y.headers.location=u(e,g.target))}if((g||y.statusCode>=300&&y.statusCode<400)&&y.headers.location){if(i.length===c)throw new a("URL could not be dereferenced; there were too many redirects.","jsonld.TooManyRedirects",{code:"loading document failed",url:e,httpStatusCode:y.statusCode,redirects:i});if(-1!==i.indexOf(e))throw new a("URL could not be dereferenced; infinite redirection was detected.","jsonld.InfiniteRedirectDetected",{code:"recursive context inclusion",url:e,httpStatusCode:y.statusCode,redirects:i});return i.push(e),f(y.headers.location,i)}return i.push(e),p}}},{"../JsonLdError":22,"../RequestQueue":26,"../constants":29,"../url":42,"../util":43,http:11,request:11}],32:[function(e,t,n){"use strict";const{parseLinkHeader:r,buildHeaders:i}=e("../util"),{LINK_HEADER_CONTEXT:o}=e("../constants"),a=e("../JsonLdError"),s=e("../RequestQueue"),{prependBase:u}=e("../url"),c=/(^|(\r\n))link:/i;t.exports=({secure:e,headers:t={},xhr:n}={headers:{}})=>(t=i(t),(new s).wrapLoader(async function i(s){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new a('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(e&&0!==s.indexOf("https"))throw new a('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s});let l;try{l=await function(e,t,n){const r=new(e=e||XMLHttpRequest);return new Promise((e,i)=>{r.onload=()=>e(r),r.onerror=e=>i(e),r.open("GET",t,!0);for(const t in n)r.setRequestHeader(t,n[t]);r.send()})}(n,s,t)}catch(g){throw new a("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:g})}if(l.status>=400)throw new a("URL could not be dereferenced: "+l.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:s,httpStatusCode:l.status});let h={contextUrl:null,documentUrl:s,document:l.response},d=null;const f=l.getResponseHeader("Content-Type");let p;if(c.test(l.getAllResponseHeaders())&&(p=l.getResponseHeader("Link")),p&&"application/ld+json"!==f){const e=r(p),t=e[o];if(Array.isArray(t))throw new a("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});t&&(h.contextUrl=t.target),d=e.alternate,d&&"application/ld+json"==d.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(h=await i(u(s,d.target)))}return h}))},{"../JsonLdError":22,"../RequestQueue":26,"../constants":29,"../url":42,"../util":43}],33:[function(e,t,n){"use strict";const r=e("./JsonLdError"),{isArray:i,isObject:o,isEmptyObject:a,isString:s,isUndefined:u}=e("./types"),{isList:c,isValue:l,isGraph:h,isSubject:d}=e("./graphTypes"),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:v}=e("./context"),{isAbsolute:m}=e("./url"),{addValue:b,asArray:_,getValues:w,validateTypeValue:x}=e("./util"),S={};t.exports=S;const E=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;async function j({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:h,expandedParent:w,options:N={},insideList:A,typeKey:k,typeScopedContext:O,expansionMap:R}){const L=Object.keys(h).sort(),M=[];let D;const C=h[k]&&"@json"===f(e,i(h[k])?h[k][0]:h[k],{vocab:!0},N);for(const j of L){let k,L=h[j];if("@context"===j)continue;let P=f(e,j,{vocab:!0},N);if((null===P||!m(P)&&!g(P))&&(P=R({unmappedProperty:j,activeCtx:e,activeProperty:t,parent:h,options:N,insideList:A,value:L,expandedParent:w}),void 0===P))continue;if(g(P)){if("@reverse"===n)throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:L});if(P in w&&"@included"!==P&&"@type"!==P)throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:P})}if("@id"===P){if(!s(L)){if(!N.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(o(L)){if(!a(L))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L})}else{if(!i(L))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(!L.every(e=>s(e)))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L})}}b(w,"@id",_(L).map(t=>s(t)?f(e,t,{base:!0},N):t),{propertyIsArray:N.isFrame});continue}if("@type"===P){o(L)&&(L=Object.fromEntries(Object.entries(L).map(([e,t])=>[f(O,e,{vocab:!0}),_(t).map(e=>f(O,e,{base:!0,vocab:!0}))]))),x(L,N.isFrame),b(w,"@type",_(L).map(e=>s(e)?f(O,e,{base:!0,vocab:!0},N):e),{propertyIsArray:N.isFrame});continue}if("@included"===P&&v(e,1.1)){const n=_(await S.expand({activeCtx:e,activeProperty:t,element:L,options:N,expansionMap:R}));if(!n.every(e=>d(e)))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:L});b(w,"@included",n,{propertyIsArray:!0});continue}if("@graph"===P&&!o(L)&&!i(L))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:L});if("@value"===P){D=L,C&&v(e,1.1)?w["@value"]=L:b(w,"@value",L,{propertyIsArray:N.isFrame});continue}if("@language"===P){if(null===L)continue;if(!s(L)&&!N.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:L});L=_(L).map(e=>s(e)?e.toLowerCase():e);for(const e of L)s(e)&&!e.match(E)&&console.warn(`@language must be valid BCP47: ${e}`);b(w,"@language",L,{propertyIsArray:N.isFrame});continue}if("@direction"===P){if(!s(L)&&!N.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:L});L=_(L);for(const e of L)if(s(e)&&"ltr"!==e&&"rtl"!==e)throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:L});b(w,"@direction",L,{propertyIsArray:N.isFrame});continue}if("@index"===P){if(!s(L))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:L});b(w,"@index",L);continue}if("@reverse"===P){if(!o(L))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:L});if(k=await S.expand({activeCtx:e,activeProperty:"@reverse",element:L,options:N,expansionMap:R}),"@reverse"in k)for(const e in k["@reverse"])b(w,e,k["@reverse"][e],{propertyIsArray:!0});let t=w["@reverse"]||null;for(const e in k){if("@reverse"===e)continue;null===t&&(t=w["@reverse"]={}),b(t,e,[],{propertyIsArray:!0});const n=k[e];for(let i=0;i"@id"===e||"@index"===e)&&(k=_(k).map(e=>({"@graph":_(e)}))),F.mappings.has(j)&&F.mappings.get(j).reverse){const e=w["@reverse"]=w["@reverse"]||{};k=_(k);for(let t=0;t"@value"===f(e,t,{vocab:!0},N)))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await j({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:i,expandedParent:w,options:N,insideList:A,typeScopedContext:O,typeKey:k,expansionMap:R})}}}function N({activeCtx:e,activeProperty:t,value:n,options:r}){if(null==n)return null;const i=f(e,t,{vocab:!0},r);if("@id"===i)return f(e,n,{base:!0},r);if("@type"===i)return f(e,n,{vocab:!0,base:!0},r);const o=p(e,t,"@type");if(("@id"===o||"@graph"===i)&&s(n))return{"@id":f(e,n,{base:!0},r)};if("@vocab"===o&&s(n))return{"@id":f(e,n,{vocab:!0,base:!0},r)};if(g(i))return n;const a={};if(o&&!["@id","@vocab","@none"].includes(o))a["@type"]=o;else if(s(n)){const n=p(e,t,"@language");null!==n&&(a["@language"]=n);const r=p(e,t,"@direction");null!==r&&(a["@direction"]=r)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),a["@value"]=n,a}function I(e,t,n,o){const a=[],u=Object.keys(t).sort();for(const c of u){const u=f(e,c,{vocab:!0},o);let l=t[c];i(l)||(l=[l]);for(const e of l){if(null===e)continue;if(!s(e))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const i={"@value":e};"@none"!==u&&(i["@language"]=c.toLowerCase()),n&&(i["@direction"]=n),a.push(i)}}return a}async function T({activeCtx:e,options:t,activeProperty:n,value:o,expansionMap:a,asGraph:s,indexKey:c,propertyIndex:d}){const g=[],v=Object.keys(o).sort(),m="@type"===c;for(let _ of v){if(m){const n=p(e,_,"@context");u(n)||(e=await y({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let v,w=o[_];i(w)||(w=[w]),w=await S.expand({activeCtx:e,activeProperty:n,element:w,options:t,insideList:!1,insideIndex:!0,expansionMap:a}),v=d?"@none"===_?"@none":N({activeCtx:e,activeProperty:c,value:_,options:t}):f(e,_,{vocab:!0},t),"@id"===c?_=f(e,_,{base:!0},t):m&&(_=v);for(let e of w){if(s&&!h(e)&&(e={"@graph":[e]}),"@type"===c)"@none"===v||(e["@type"]=e["@type"]?[_].concat(e["@type"]):[_]);else{if(l(e)&&!["@language","@type","@index"].includes(c))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${c}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});d?"@none"!==v&&b(e,d,v,{propertyIsArray:!0,prependValue:!0}):"@none"===v||c in e||(e[c]=_)}g.push(e)}}return g}S.expand=async({activeCtx:e,activeProperty:t=null,element:n,options:c={},insideList:l=!1,insideIndex:h=!1,typeScopedContext:d=null,expansionMap:g=(()=>{})})=>{if(null==n)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!i(n)&&!o(n)){if(!l&&(null===t||"@graph"===f(e,t,{vocab:!0},c))){const r=await g({unmappedValue:n,activeCtx:e,activeProperty:t,options:c,insideList:l});return void 0===r?null:r}return N({activeCtx:e,activeProperty:t,value:n,options:c})}if(i(n)){let r=[];const o=p(e,t,"@container")||[];l=l||o.includes("@list");for(let a=0;a1?t.slice().sort():t:[t];for(const n of i){const t=p(d,n,"@context");u(t)||(e=await y({activeCtx:e,localCtx:t,options:c,propagate:!1}))}}let A={};await j({activeCtx:e,activeProperty:t,expandedActiveProperty:b,element:n,expandedParent:A,options:c,insideList:l,typeKey:T,typeScopedContext:d,expansionMap:g}),E=Object.keys(A);let k=E.length;if("@value"in A){if("@type"in A&&("@language"in A||"@direction"in A))throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:A});let i=k-1;if("@type"in A&&(i-=1),"@index"in A&&(i-=1),"@language"in A&&(i-=1),"@direction"in A&&(i-=1),0!==i)throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:A});const o=null===A["@value"]?[]:_(A["@value"]),u=w(A,"@type");if(v(e,1.1)&&u.includes("@json")&&1===u.length);else if(0===o.length){const r=await g({unmappedValue:A,activeCtx:e,activeProperty:t,element:n,options:c,insideList:l});A=void 0!==r?r:null}else{if(!o.every(e=>s(e)||a(e))&&"@language"in A)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:A});if(!u.every(e=>m(e)&&!(s(e)&&0===e.indexOf("_:"))||a(e)))throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:A})}}else if("@type"in A&&!i(A["@type"]))A["@type"]=[A["@type"]];else if("@set"in A||"@list"in A){if(k>1&&(2!==k||!("@index"in A)))throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:A});"@set"in A&&(A=A["@set"],E=Object.keys(A),k=E.length)}else if(1===k&&"@language"in A){const r=await g(A,{unmappedValue:A,activeCtx:e,activeProperty:t,element:n,options:c,insideList:l});A=void 0!==r?r:null}if(o(A)&&!c.keepFreeFloatingNodes&&!l&&(null===t||"@graph"===b)&&(0===k||"@value"in A||"@list"in A||1===k&&"@id"in A)){const r=await g({unmappedValue:A,activeCtx:e,activeProperty:t,element:n,options:c,insideList:l});A=void 0!==r?r:null}return A}},{"./JsonLdError":22,"./context":30,"./graphTypes":37,"./types":41,"./url":42,"./util":43}],34:[function(e,t,n){"use strict";const{isSubjectReference:r}=e("./graphTypes"),{createMergedNodeMap:i}=e("./nodeMap"),o={};t.exports=o,o.flatten=e=>{const t=i(e),n=[],o=Object.keys(t).sort();for(let i=0;i=0;--r){const i=n[r];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function p(e,t,n){const r="@"+n;let i=r in e?e[r][0]:t[n];if("embed"===n)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new u("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function g(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new u("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of a.asArray(e[0]["@id"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new u("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of a.asArray(e[0]["@type"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new u("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function y(e,t,n,s){let u=!0,c=!1;for(const l in n){let h=!1;const d=a.getValues(t,l),f=0===a.getValues(n,l).length;if("@id"===l){if(o.isEmptyObject(n["@id"][0]||{})?h=!0:n["@id"].length>=0&&(h=n["@id"].includes(d[0])),!s.requireAll)return h}else if("@type"===l){if(u=!1,f){if(d.length>0)return!1;h=!0}else if(1===n["@type"].length&&o.isEmptyObject(n["@type"][0]))h=d.length>0;else for(const e of n["@type"])h=!(!o.isObject(e)||!("@default"in e))||h||d.some(t=>t===e);if(!s.requireAll)return h}else{if(r(l))continue;{const t=a.getValues(n,l)[0];let r=!1;if(t&&(g([t]),r="@default"in t),u=!1,0===d.length&&r)continue;if(d.length>0&&f)return!1;if(void 0===t){if(d.length>0)return!1;h=!0}else if(i.isList(t)){const n=t["@list"][0];if(i.isList(d[0])){const t=d[0]["@list"];i.isValue(n)?h=t.some(e=>w(n,e)):(i.isSubject(n)||i.isSubjectReference(n))&&(h=t.some(t=>_(e,n,t,s)))}}else h=i.isValue(t)?d.some(e=>w(t,e)):i.isSubjectReference(t)?d.some(n=>_(e,t,n,s)):!!o.isObject(t)&&d.length>0}}if(!h&&s.requireAll)return!1;c=c||h}return u||c}function v(e,t){const n=e.uniqueEmbeds[e.graph],r=n[t],i=r.parent,s=r.property,u={"@id":t};if(o.isArray(i)){for(let e=0;e{const t=Object.keys(n);for(const r of t)r in n&&o.isObject(n[r].parent)&&n[r].parent["@id"]===e&&(delete n[r],c(r))};c(t)}function m(e,t){if(o.isArray(e))return e.map(e=>m(e,t));if(o.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=m(e["@list"],t),e;if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)"@id"===n&&t.bnodesToClear.includes(e[n])?delete e["@id"]:e[n]=m(e[n],t)}return e}function b(e,t,n){o.isObject(e)?a.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function _(e,t,n,r){if(!("@id"in n))return!1;const i=e.subjects[n["@id"]];return i&&y(e,i,t,r)}function w(e,t){const n=t["@value"],r=t["@type"],i=t["@language"],a=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],u=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===a.length&&0===s.length&&0===u.length||!(!a.includes(n)&&!o.isEmptyObject(a[0]))&&!!(!r&&0===s.length||s.includes(r)||r&&o.isEmptyObject(s[0]))&&!!(!i&&0===u.length||u.includes(i)||i&&o.isEmptyObject(u[0]))}t.exports=h,h.frameMergedOrDefault=(e,t,n)=>{const r={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new a.IdentifierIssuer("_:b");c(e,r.graphMap,"@default",i),n.merged&&(r.graphMap["@merged"]=l(r.graphMap),r.graph="@merged"),r.subjects=r.graphMap[r.graph];const o=[];return h.frame(r,Object.keys(r.subjects).sort(),t,o),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(r.bnodeMap).filter(e=>1===r.bnodeMap[e].length)),n.link={},m(o,n)},h.frame=(e,t,n,s,c=null)=>{g(n);const l=e.options,m={embed:p(n=n[0],l,"embed"),explicit:p(n,l,"explicit"),requireAll:p(n,l,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const _=e.link[e.graph],x=function(e,t,n,r){const i={};for(const o of t){const t=e.graphMap[e.graph][o];y(e,t,n,r)&&(i[o]=t)}return i}(e,t,n,m),S=Object.keys(x).sort();for(const g of S){const y=x[g];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===m.embed&&g in _){b(s,c,_[g]);continue}const S={"@id":g};if(0===g.indexOf("_:")&&a.addValue(e.bnodeMap,g,S,{propertyIsArray:!0}),_[g]=S,("@first"===m.embed||"@last"===m.embed)&&e.is11)throw new u("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(g))if(!e.embedded||"@never"!==m.embed&&!f(y,e.graph,e.subjectStack))if(!e.embedded||"@first"!=m.embed&&"@once"!=m.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(g)){if("@last"===m.embed&&g in e.uniqueEmbeds[e.graph]&&v(e,g),e.uniqueEmbeds[e.graph][g]={parent:s,property:c},e.subjectStack.push({subject:y,graph:e.graph}),g in e.graphMap){let t=!1,r=null;"@graph"in n?(r=n["@graph"][0],t=!("@merged"===g||"@default"===g),o.isObject(r)||(r={})):(t="@merged"!==e.graph,r={}),t&&h.frame({...e,graph:g,embedded:!1},Object.keys(e.graphMap[g]).sort(),[r],S,"@graph")}"@included"in n&&h.frame({...e,embedded:!1},t,n["@included"],S,"@included");for(const t of Object.keys(y).sort())if(r(t)){if(S[t]=a.clone(y[t]),"@type"===t)for(const t of y["@type"])0===t.indexOf("_:")&&a.addValue(e.bnodeMap,t,S,{propertyIsArray:!0})}else if(!m.explicit||t in n)for(const r of y[t]){const o=t in n?n[t]:d(m);if(i.isList(r)){const o=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:d(m),s={"@list":[]};b(S,t,s);const u=r["@list"];for(const t of u)i.isSubjectReference(t)?h.frame({...e,embedded:!0},[t["@id"]],o,s,"@list"):b(s,"@list",a.clone(t))}else i.isSubjectReference(r)?h.frame({...e,embedded:!0},[r["@id"]],o,S,t):w(o[0],r)&&b(S,t,a.clone(r))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!o.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(r(e))continue;const t=n[e][0]||{};if(!p(t,l,"omitDefault")&&!(e in S)){let n="@null";"@default"in t&&(n=a.clone(t["@default"])),o.isArray(n)||(n=[n]),S[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const r=n["@reverse"][t];for(const n of Object.keys(e.subjects))a.getValues(e.subjects[n],t).some(e=>e["@id"]===g)&&(S["@reverse"]=S["@reverse"]||{},a.addValue(S["@reverse"],t,[],{propertyIsArray:!0}),h.frame({...e,embedded:!0},[n],r,S["@reverse"][t],c))}b(s,c,S),e.subjectStack.pop()}else b(s,c,S);else b(s,c,S)}},h.cleanupNull=(e,t)=>{if(o.isArray(e))return e.map(e=>h.cleanupNull(e,t)).filter(e=>e);if("@null"===e)return null;if(o.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=h.cleanupNull(e[n],t)}return e}},{"./JsonLdError":22,"./context":30,"./graphTypes":37,"./nodeMap":39,"./types":41,"./url":42,"./util":43}],36:[function(e,t,n){"use strict";const r=e("./JsonLdError"),i=e("./graphTypes"),o=e("./types"),a=e("./util"),{RDF_LIST:s,RDF_FIRST:u,RDF_REST:c,RDF_NIL:l,RDF_TYPE:h,RDF_JSON_LITERAL:d,XSD_BOOLEAN:f,XSD_DOUBLE:p,XSD_INTEGER:g,XSD_STRING:y}=e("./constants"),v=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,m={};function b(e,t,n){if(e.termType.endsWith("Node"))return{"@id":e.value};const i={"@value":e.value};if(e.language)i["@language"]=e.language;else{let s=e.datatype.value;if(s||(s=y),s===d){s="@json";try{i["@value"]=JSON.parse(i["@value"])}catch(a){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:i["@value"],cause:a})}}if(t){if(s===f)"true"===i["@value"]?i["@value"]=!0:"false"===i["@value"]&&(i["@value"]=!1);else if(o.isNumeric(i["@value"]))if(s===g){const e=parseInt(i["@value"],10);e.toFixed(0)===i["@value"]&&(i["@value"]=e)}else s===p&&(i["@value"]=parseFloat(i["@value"]));[f,g,p,y].includes(s)||(i["@type"]=s)}else if("i18n-datatype"===n&&s.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=s.split(/[#_]/);e.length>0&&(i["@language"]=e,e.match(v)||console.warn(`@language must be valid BCP47: ${e}`)),i["@direction"]=t}else s!==y&&(i["@type"]=s)}return i}t.exports=m,m.fromRDF=async(e,{useRdfType:t=!1,useNativeTypes:n=!1,rdfDirection:r=null})=>{const d={},f={"@default":d},p={};for(const i of e){const e="DefaultGraph"===i.graph.termType?"@default":i.graph.value;e in f||(f[e]={}),"@default"===e||e in d||(d[e]={"@id":e});const o=f[e],s=i.subject.value,u=i.predicate.value,c=i.object;s in o||(o[s]={"@id":s});const g=o[s],y=c.termType.endsWith("Node");if(y&&!(c.value in o)&&(o[c.value]={"@id":c.value}),u===h&&!t&&y){a.addValue(g,"@type",c.value,{propertyIsArray:!0});continue}const v=b(c,n,r);if(a.addValue(g,u,v,{propertyIsArray:!0}),y)if(c.value===l){const e=o[c.value];"usages"in e||(e.usages=[]),e.usages.push({node:g,property:u,value:v})}else p[c.value]=!(c.value in p)&&{node:g,property:u,value:v}}for(const a in f){const e=f[a];if(!(l in e))continue;const t=e[l];if(t.usages){for(let n of t.usages){let t=n.node,r=n.property,a=n.value;const l=[],h=[];let d=Object.keys(t).length;for(;r===c&&o.isObject(p[t["@id"]])&&o.isArray(t[u])&&1===t[u].length&&o.isArray(t[c])&&1===t[c].length&&(3===d||4===d&&o.isArray(t["@type"])&&1===t["@type"].length&&t["@type"][0]===s)&&(l.push(t[u][0]),h.push(t["@id"]),n=p[t["@id"]],t=n.node,r=n.property,a=n.value,d=Object.keys(t).length,i.isBlankNode(t)););delete a["@id"],a["@list"]=l.reverse();for(const n of h)delete e[n]}delete t.usages}}const g=[],y=Object.keys(d).sort();for(const o of y){const e=d[o];if(o in f){const t=e["@graph"]=[],n=f[o],r=Object.keys(n).sort();for(const e of r){const r=n[e];i.isSubjectReference(r)||t.push(r)}}i.isSubjectReference(e)||g.push(e)}return g}},{"./JsonLdError":22,"./constants":29,"./graphTypes":37,"./types":41,"./util":43}],37:[function(e,t,n){"use strict";const r=e("./types"),i={};t.exports=i,i.isSubject=e=>!(!r.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>r.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>r.isObject(e)&&"@value"in e,i.isList=e=>r.isObject(e)&&"@list"in e,i.isGraph=e=>r.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(e=>"@id"!==e&&"@index"!==e).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>!!r.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))},{"./types":41}],38:[function(e,t,n){(function(n,r){const i=e("rdf-canonize"),o=e("./util"),a=e("./ContextResolver"),s=o.IdentifierIssuer,u=e("./JsonLdError"),c=e("lru-cache"),l=e("./NQuads"),h=e("./Rdfa"),{expand:d}=e("./expand"),{flatten:f}=e("./flatten"),{fromRDF:p}=e("./fromRdf"),{toRDF:g}=e("./toRdf"),{frameMergedOrDefault:y,cleanupNull:v}=e("./frame"),{isArray:m,isObject:b,isString:_}=e("./types"),{isSubjectReference:w}=e("./graphTypes"),{expandIri:x,getInitialContext:S,process:E,processingMode:j}=e("./context"),{compact:N,compactIri:I}=e("./compact"),{createNodeMap:T,createMergedNodeMap:A,mergeNodeMaps:k}=e("./nodeMap"),O=void 0!==n&&n.versions&&n.versions.node,R=!O&&("undefined"!=typeof window||"undefined"!=typeof self),L=function(t){const n={},L=new c({max:100});function M(e,{documentLoader:n=t.documentLoader,...r}){return Object.assign({},{documentLoader:n},r,e)}return t.compact=async function(e,n,r){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new u("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===e)return null;let i;(r=M(r,{base:_(e)?e:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new a({sharedCache:L})})).link&&(r.skipExpansion=!0),r.compactToRelative||delete r.base,i=r.skipExpansion?e:await t.expand(e,r);const c=await t.processContext(S(r),n,r);let l=await N({activeCtx:c,element:i,options:r,compactionMap:r.compactionMap});r.compactArrays&&!r.graph&&m(l)?1===l.length?l=l[0]:0===l.length&&(l={}):r.graph&&b(l)&&(l=[l]),b(n)&&"@context"in n&&(n=n["@context"]),n=o.clone(n),m(n)||(n=[n]);const h=n;n=[];for(let t=0;t0)&&n.push(h[t]);const d=n.length>0;if(1===n.length&&(n=n[0]),m(l)){const e=I({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=l;l={},d&&(l["@context"]=n),l[e]=t}else if(b(l)&&d){const e=l;l={"@context":n};for(const t in e)l[t]=e[t]}return l},t.expand=async function(e,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=M(n,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:L})})).expansionMap&&(n.expansionMap=void 0);const r={},i=[];if("expandContext"in n){const e=o.clone(n.expandContext);r.expandContext=b(e)&&"@context"in e?e:{"@context":e},i.push(r.expandContext)}let s;if(_(e)){const o=await t.get(e,n);s=o.documentUrl,r.input=o.document,o.contextUrl&&(r.remoteContext={"@context":o.contextUrl},i.push(r.remoteContext))}else r.input=o.clone(e);"base"in n||(n.base=s||"");let u=S(n);for(const t of i)u=await E({activeCtx:u,localCtx:t,options:n});let c=await d({activeCtx:u,element:r.input,options:n,expansionMap:n.expansionMap});return b(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),m(c)||(c=[c]),c},t.flatten=async function(e,n,r){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,r=M(r,{base:_(e)?e:"",contextResolver:new a({sharedCache:L})});const i=await t.expand(e,r),o=f(i);return null===n?o:(r.graph=!0,r.skipExpansion=!0,await t.compact(o,n,r))},t.frame=async function(e,n,r){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(r=M(r,{base:_(e)?e:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:L})}),_(n)){const e=await t.get(n,r);if(n=e.document,e.contextUrl){let t=n["@context"];t?m(t)?t.push(e.contextUrl):t=[t,e.contextUrl]:t=e.contextUrl,n["@context"]=t}}const i=n&&n["@context"]||{},o=await t.processContext(S(r),i,r);r.hasOwnProperty("omitGraph")||(r.omitGraph=j(o,1.1)),r.hasOwnProperty("pruneBlankNodeIdentifiers")||(r.pruneBlankNodeIdentifiers=j(o,1.1));const s=await t.expand(e,r),u={...r};u.isFrame=!0,u.keepFreeFloatingNodes=!0;const c=await t.expand(n,u),l=Object.keys(n).map(e=>x(o,e,{vocab:!0}));u.merged=!l.includes("@graph"),u.is11=j(o,1.1);const h=y(s,c,u);u.graph=!r.omitGraph,u.skipExpansion=!0,u.link={},u.framing=!0;let d=await t.compact(h,i,u);return u.link={},d=v(d,u),d},t.link=async function(e,n,r){const i={};return n&&(i["@context"]=n),i["@embed"]="@link",t.frame(e,i,r)},t.normalize=t.canonize=async function(e,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=M(n,{base:_(e)?e:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new a({sharedCache:L})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new u("Unknown canonicalization input format.","jsonld.CanonizeError");const t=l.parse(e);return i.canonize(t,n)}const r={...n};delete r.format,r.produceGeneralizedRdf=!1;const o=await t.toRDF(e,r);return i.canonize(o,n)},t.fromRDF=async function(e,t){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");t=M(t,{format:_(e)?"application/n-quads":void 0});const{format:r}=t;let{rdfParser:i}=t;if(r){if(i=i||n[r],!i)throw new u("Unknown input format.","jsonld.UnknownFormat",{format:r})}else i=()=>e;const o=await i(e);return p(o,t)},t.toRDF=async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let r;r=(n=M(n,{base:_(e)?e:"",skipExpansion:!1,contextResolver:new a({sharedCache:L})})).skipExpansion?e:await t.expand(e,n);const i=g(r,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return await l.serialize(i);throw new u("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return i},t.createNodeMap=async function(e,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=M(n,{base:_(e)?e:"",contextResolver:new a({sharedCache:L})});const r=await t.expand(e,n);return A(r,n)},t.merge=async function(e,n,r){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!m(e))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,r=M(r,{contextResolver:new a({sharedCache:L})});const i=await Promise.all(e.map(e=>{const n={...r};return t.expand(e,n)}));let u=!0;"mergeNodes"in r&&(u=r.mergeNodes);const c=r.issuer||new s("_:b"),l={"@default":{}};for(let t=0;tt._documentLoader,set:e=>t._documentLoader=e}),t.documentLoader=async e=>{throw new u("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},t.get=async function(e,n){let r;r="function"==typeof n.documentLoader?n.documentLoader:t.documentLoader;const i=await r(e);try{if(!i.document)throw new u("No remote document found at the given URL.","jsonld.NullRemoteDocument");_(i.document)&&(i.document=JSON.parse(i.document))}catch(o){throw new u("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:o,remoteDoc:i})}return i},t.processContext=async function(e,t,n){return n=M(n,{base:"",contextResolver:new a({sharedCache:L})}),null===t?S(n):(t=o.clone(t),b(t)&&"@context"in t||(t={"@context":t}),E({activeCtx:e,localCtx:t,options:n}))},t.getContextValue=e("./context").getContextValue,t.documentLoaders={},t.documentLoaders.node=e("./documentLoaders/node"),t.documentLoaders.xhr=e("./documentLoaders/xhr"),t.useDocumentLoader=function(e){if(!(e in t.documentLoaders))throw new u('Unknown document loader type: "'+e+'"',"jsonld.UnknownDocumentLoader",{type:e});t.documentLoader=t.documentLoaders[e].apply(t,Array.prototype.slice.call(arguments,1))},t.registerRDFParser=function(e,t){n[e]=t},t.unregisterRDFParser=function(e){delete n[e]},t.registerRDFParser("application/n-quads",l.parse),t.registerRDFParser("application/nquads",l.parse),t.registerRDFParser("rdfa-api",h.parse),t.url=e("./url"),t.util=o,Object.assign(t,o),t.promises=t,t.RequestQueue=e("./RequestQueue"),t.JsonLdProcessor=e("./JsonLdProcessor")(t),R&&void 0===r.JsonLdProcessor&&Object.defineProperty(r,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t.JsonLdProcessor}),O?t.useDocumentLoader("node"):"undefined"!=typeof XMLHttpRequest&&t.useDocumentLoader("xhr"),t},M=function(){return L(function(){return M()})};L(M),t.exports=M}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./ContextResolver":21,"./JsonLdError":22,"./JsonLdProcessor":23,"./NQuads":24,"./Rdfa":25,"./RequestQueue":26,"./compact":28,"./context":30,"./documentLoaders/node":31,"./documentLoaders/xhr":32,"./expand":33,"./flatten":34,"./frame":35,"./fromRdf":36,"./graphTypes":37,"./nodeMap":39,"./toRdf":40,"./types":41,"./url":42,"./util":43,_process:62,"lru-cache":44,"rdf-canonize":73}],39:[function(e,t,n){"use strict";const{isKeyword:r}=e("./context"),i=e("./graphTypes"),o=e("./types"),a=e("./util"),s=e("./JsonLdError"),u={};t.exports=u,u.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new a.IdentifierIssuer("_:b"),r={"@default":{}};return u.createNodeMap(e,r,"@default",n),u.mergeNodeMaps(r)},u.createNodeMap=(e,t,n,c,l,h)=>{if(o.isArray(e)){for(const r of e)u.createNodeMap(r,t,n,c,void 0,h);return}if(!o.isObject(e))return void(h&&h.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(h&&h.push(e))}if(h&&i.isList(e)){const r=[];return u.createNodeMap(e["@list"],t,n,c,l,r),void h.push({"@list":r})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}o.isUndefined(l)&&(l=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),h&&h.push({"@id":l});const d=t[n],f=d[l]=d[l]||{};f["@id"]=l;const p=Object.keys(e).sort();for(let o of p){if("@id"===o)continue;if("@reverse"===o){const r={"@id":l},o=e["@reverse"];for(const e in o){const s=o[e];for(const o of s){let s=o["@id"];i.isBlankNode(o)&&(s=c.getId(s)),u.createNodeMap(o,t,n,c,s),a.addValue(d[s],e,r,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){l in t||(t[l]={}),u.createNodeMap(e[o],t,l,c);continue}if("@included"===o){u.createNodeMap(e[o],t,n,c);continue}if("@type"!==o&&r(o)){if("@index"===o&&o in f&&(e[o]!==f[o]||e[o]["@id"]!==f[o]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:f});f[o]=e[o];continue}const h=e[o];if(0===o.indexOf("_:")&&(o=c.getId(o)),0!==h.length)for(let e of h)if("@type"===o&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const r=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];a.addValue(f,o,{"@id":r},{propertyIsArray:!0,allowDuplicate:!1}),u.createNodeMap(e,t,n,c,r)}else if(i.isValue(e))a.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const r=[];u.createNodeMap(e["@list"],t,n,c,l,r),e={"@list":r},a.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else u.createNodeMap(e,t,n,c,l),a.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else a.addValue(f,o,[],{propertyIsArray:!0})}},u.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const i of Object.keys(e[n]).sort()){const o=e[n][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(o).sort())if(r(e)&&"@type"!==e)s[e]=a.clone(o[e]);else for(const t of o[e])a.addValue(s,e,a.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},u.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const r of n){if("@default"===r)continue;const n=e[r];let o=t[r];o?"@graph"in o||(o["@graph"]=[]):t[r]=o={"@id":r,"@graph":[]};const a=o["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];i.isSubjectReference(t)||a.push(t)}}return t}},{"./JsonLdError":22,"./context":30,"./graphTypes":37,"./types":41,"./util":43}],40:[function(e,t,n){"use strict";const{createNodeMap:r}=e("./nodeMap"),{isKeyword:i}=e("./context"),o=e("./graphTypes"),a=e("canonicalize"),s=e("./types"),u=e("./util"),{RDF_FIRST:c,RDF_REST:l,RDF_NIL:h,RDF_TYPE:d,RDF_JSON_LITERAL:f,RDF_LANGSTRING:p,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:v,XSD_STRING:m}=e("./constants"),{isAbsolute:b}=e("./url"),_={};function w(e,t,n,r,o){const a=Object.keys(t).sort();for(const s of a){const a=t[s],u=Object.keys(a).sort();for(let t of u){const u=a[t];if("@type"===t)t=d;else if(i(t))continue;for(const i of u){const a={termType:s.startsWith("_:")?"BlankNode":"NamedNode",value:s};if(!b(s))continue;const u={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!b(t))continue;if("BlankNode"===u.termType&&!o.produceGeneralizedRdf)continue;const c=x(i,r,e,n,o.rdfDirection);c&&e.push({subject:a,predicate:u,object:c,graph:n})}}}}function x(e,t,n,r,i){const u={};if(o.isValue(e)){u.termType="Literal",u.value=void 0,u.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;"@json"===n?(u.value=a(t),u.datatype.value=f):s.isBoolean(t)?(u.value=t.toString(),u.datatype.value=n||g):s.isDouble(t)||n===y?(s.isDouble(t)||(t=parseFloat(t)),u.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),u.datatype.value=n||y):s.isNumber(t)?(u.value=t.toFixed(0),u.datatype.value=n||v):"i18n-datatype"===i&&"@direction"in e?(u.datatype.value="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`,u.value=t):"@language"in e?(u.value=t,u.datatype.value=n||p,u.language=e["@language"]):(u.value=t,u.datatype.value=n||m)}else if(o.isList(e)){const o=function(e,t,n,r,i){const o={termType:"NamedNode",value:c},a={termType:"NamedNode",value:l},s={termType:"NamedNode",value:h},u=e.pop(),d=u?{termType:"BlankNode",value:t.getId()}:s;let f=d;for(const c of e){const e=x(c,t,n,r,i),s={termType:"BlankNode",value:t.getId()};n.push({subject:f,predicate:o,object:e,graph:r}),n.push({subject:f,predicate:a,object:s,graph:r}),f=s}if(u){const e=x(u,t,n,r,i);n.push({subject:f,predicate:o,object:e,graph:r}),n.push({subject:f,predicate:a,object:s,graph:r})}return d}(e["@list"],t,n,r,i);u.termType=o.termType,u.value=o.value}else{const t=s.isObject(e)?e["@id"]:e;u.termType=t.startsWith("_:")?"BlankNode":"NamedNode",u.value=t}return"NamedNode"!==u.termType||b(u.value)?u:null}t.exports=_,_.toRDF=(e,t)=>{const n=new u.IdentifierIssuer("_:b"),i={"@default":{}};r(e,i,"@default",n);const o=[],a=Object.keys(i).sort();for(const r of a){let e;if("@default"===r)e={termType:"DefaultGraph",value:""};else{if(!b(r))continue;e=r.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},e.value=r}w(o,i[r],e,n,t)}return o}},{"./constants":29,"./context":30,"./graphTypes":37,"./nodeMap":39,"./types":41,"./url":42,"./util":43,canonicalize:15}],41:[function(e,t,n){"use strict";const r={};t.exports=r,r.isArray=Array.isArray,r.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),r.isDouble=e=>r.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),r.isEmptyObject=e=>r.isObject(e)&&0===Object.keys(e).length,r.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),r.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),r.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),r.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),r.isUndefined=e=>void 0===e},{}],42:[function(e,t,n){"use strict";const r=e("./types"),i={};t.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const n={},r=i.parsers[t||"full"],o=r.regex.exec(e);let a=r.keys.length;for(;a--;)n[r.keys[a]]=void 0===o[a]?null:o[a];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!r.isString(e)||(e=i.parse(e||""));const n=i.parse(t),o={protocol:e.protocol||""};if(null!==n.authority)o.authority=n.authority,o.path=n.path,o.query=n.query;else if(o.authority=e.authority,""===n.path)o.path=e.path,o.query=null!==n.query?n.query:e.query;else{if(0===n.path.indexOf("/"))o.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,o.path=t}o.query=n.query}""!==n.path&&(o.path=i.removeDotSegments(o.path));let a=o.protocol;return null!==o.authority&&(a+="//"+o.authority),a+=o.path,null!==o.query&&(a+="?"+o.query),null!==n.fragment&&(a+="#"+n.fragment),""===a&&(a="./"),a},i.removeBase=(e,t)=>{if(null===e)return t;e&&!r.isString(e)||(e=i.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const o=i.parse(t.substr(n.length)),a=e.normalizedPath.split("/"),s=o.normalizedPath.split("/"),u=o.fragment||o.query?0:1;for(;a.length>0&&s.length>u&&a[0]===s[0];)a.shift(),s.shift();let c="";if(a.length>0){a.pop();for(let e=0;e{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),r=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),r&&n.push("")):r&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>r.isString(e)&&o.test(e),i.isRelative=e=>r.isString(e)},{"./types":41}],43:[function(e,t,n){"use strict";const r=e("./graphTypes"),i=e("./types"),o=e("rdf-canonize").IdentifierIssuer,a=e("./JsonLdError"),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,u=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l="application/ld+json, application/json",h={};function d(e,t){if(i.isArray(t))for(let n=0;n{if(Object.keys(e).some(e=>"accept"===e.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+l+'" is supported.');return Object.assign({Accept:l},e)},h.parseLinkHeader=e=>{const t={},n=e.match(s);for(let r=0;r{if(!(i.isString(e)||i.isArray(e)&&e.every(e=>i.isString(e)))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&h.asArray(e["@default"]).every(e=>i.isString(e)))return}throw new a('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},h.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!i.isArray(n)||n.length>0}return!1},h.hasValue=(e,t,n)=>{if(h.hasProperty(e,t)){let o=e[t];const a=r.isList(o);if(i.isArray(o)||a){a&&(o=o["@list"]);for(let e=0;e{if("propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1),"valueIsArray"in r||(r.valueIsArray=!1),"allowDuplicate"in r||(r.allowDuplicate=!0),"prependValue"in r||(r.prependValue=!1),r.valueIsArray)e[t]=n;else if(i.isArray(n)){0===n.length&&r.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),r.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let i=0;i[].concat(e[t]||[]),h.removeProperty=(e,t)=>{delete e[t]},h.removeValue=(e,t,n,r)=>{"propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1);const i=h.getValues(e,t).filter(e=>!h.compareValues(e,n));0===i.length?h.removeProperty(e,t):e[t]=1!==i.length||r.propertyIsArray?i:i[0]},h.relabelBlankNodes=(e,t)=>d((t=t||{}).issuer||new o("_:b"),e),h.compareValues=(e,t)=>e===t||!(!r.isValue(e)||!r.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],h.compareShortestLeast=(e,t)=>e.length1,g=(e,t,n)=>{const r=e[d].get(t);if(r){const t=r.value;if(y(e,t)){if(m(e,r),!e[s])return}else n&&(e[f]&&(r.value.now=Date.now()),e[h].unshiftNode(r));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[u])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[u]&&n>e[u]},v=e=>{if(e[o]>e[i])for(let t=e[h].tail;e[o]>e[i]&&null!==t;){const n=t.prev;m(e,t),t=n}},m=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[o]-=n.length,e[d].delete(n.key),e[h].removeNode(t)}};class b{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const _=(e,t,n,r)=>{let i=n.value;y(e,i)&&(m(e,n),e[s]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};t.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||p;if(this[a]="function"!=typeof t?p:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[u]=e.maxAge||0,this[c]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,v(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,v(this)}get maxAge(){return this[u]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[a]&&(this[a]=e,this[o]=0,this[h].forEach(e=>{e.length=this[a](e.value,e.key),this[o]+=e.length})),v(this)}get lengthCalculator(){return this[a]}get length(){return this[o]}get itemCount(){return this[h].length}rforEach(e,t){t=t||this;for(let n=this[h].tail;null!==n;){const r=n.prev;_(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[h].head;null!==n;){const r=n.next;_(this,e,n,t),n=r}}keys(){return this[h].toArray().map(e=>e.key)}values(){return this[h].toArray().map(e=>e.value)}reset(){this[c]&&this[h]&&this[h].length&&this[h].forEach(e=>this[c](e.key,e.value)),this[d]=new Map,this[h]=new r,this[o]=0}dump(){return this[h].map(e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[h]}set(e,t,n){if((n=n||this[u])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,s=this[a](t,e);if(this[d].has(e)){if(s>this[i])return m(this,this[d].get(e)),!1;const a=this[d].get(e).value;return this[c]&&(this[l]||this[c](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[o]+=s-a.length,a.length=s,this.get(e),v(this),!0}const f=new b(e,t,s,r,n);return f.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=f.length,this[h].unshift(f),this[d].set(e,this[h].head),v(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[h].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[d].forEach((e,t)=>g(this,t,!1))}}},{yallist:116}],45:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",o="http://www.w3.org/2000/10/swap/";n.default={xsd:{decimal:i+"decimal",boolean:i+"boolean",double:i+"double",integer:i+"integer",string:i+"string"},rdf:{type:r+"type",nil:r+"nil",first:r+"first",rest:r+"rest",langString:r+"langString"},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:o+"reify#forSome",forAll:o+"reify#forAll"},log:{implies:o+"log#implies"}}},{}],46:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.termFromId=function e(t,n){if(n=n||d,!t)return n.defaultGraph();switch(t[0]){case"?":return n.variable(t.substr(1));case"_":return n.blankNode(t.substr(2));case'"':if(n===d)return new g(t);if('"'===t[t.length-1])return n.literal(t.substr(1,t.length-2));var r=t.lastIndexOf('"',t.length-1);return n.literal(t.substr(1,r-1),"@"===t[r+1]?t.substr(r+2):n.namedNode(t.substr(r+3)));case"<":const i=h.exec(t);return n.quad(e(w(i[1]),n),e(w(i[2]),n),e(w(i[3]),n),i[4]&&e(w(i[4]),n));default:return n.namedNode(t)}},n.termToId=function e(t){if("string"==typeof t)return t;if(t instanceof f&&"Quad"!==t.termType)return t.id;if(!t)return u.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return"_:"+t.value;case"Variable":return"?"+t.value;case"DefaultGraph":return"";case"Literal":return'"'+t.value+'"'+(t.language?"@"+t.language:t.datatype&&t.datatype.value!==s.string?"^^"+t.datatype.value:"");case"Quad":return`<<${_(e(t.subject))} ${_(e(t.predicate))} ${_(e(t.object))}${(0,o.isDefaultGraph)(t.graph)?"":` ${e(t.graph)}`}>>`;default:throw new Error("Unexpected termType: "+t.termType)}},n.escapeQuotes=_,n.unescapeQuotes=w,n.Triple=n.Quad=n.DefaultGraph=n.Variable=n.BlankNode=n.Literal=n.NamedNode=n.Term=n.default=void 0;var r,i=(r=e("./IRIs"))&&r.__esModule?r:{default:r},o=e("./N3Util");const{rdf:a,xsd:s}=i.default;let u,c=0;const l=/^"(.*".*)(?="[^"]*$)/,h=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,d={namedNode:function(e){return new p(e)},blankNode:function(e){return new y(e||"n3-"+c++)},variable:function(e){return new v(e)},literal:function(e,t){if("string"==typeof t)return new g('"'+e+'"@'+t.toLowerCase());let n=t?t.value:"";return""===n&&("boolean"==typeof e?n=s.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?s.integer:s.double:(n=s.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new g(""===n||n===s.string?'"'+e+'"':'"'+e+'"^^'+n)},defaultGraph:function(){return u},quad:x,triple:x};n.default=d;class f{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof f?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}toJSON(){return{termType:this.termType,value:this.value}}}n.Term=f;class p extends f{get termType(){return"NamedNode"}}n.NamedNode=p;class g extends f{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){var e=this.id,t=e.lastIndexOf('"')+1;return t`"${t.replace(/"/g,'""')}`)}function w(e){return e.replace(l,(e,t)=>`"${t.replace(/""/g,'"')}`)}function x(e,t,n,r){return new b(e,t,n,r)}n.Triple=n.Quad=b},{"./IRIs":45,"./N3Util":52}],47:[function(e,t,n){(function(t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./IRIs")),i=o(e("queue-microtask"));function o(e){return e&&e.__esModule?e:{default:e}}const{xsd:a}=r.default;var s=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,u={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},c=/[\x00-\x20<>\\"\{\}\|\^\`]/,l={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},h=/$0^/;n.default=class{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s()\[\]\{\}"'<])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,this._lineMode=!!(e=e||{}).lineMode)for(var t in this._n3Mode=!1,this)!(t in l)&&this[t]instanceof RegExp&&(this[t]=h);else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){for(var n=this._input,r=this._comments;;){for(var i,o;i=this._newline.exec(n);)r&&(o=this._comment.exec(i[0]))&&e(null,{line:this._line,type:"comment",value:o[1],prefix:""}),n=n.substr(i[0].length,n.length),this._line++;if(!i&&(i=this._whitespace.exec(n))&&(n=n.substr(i[0].length,n.length)),this._endOfFile.test(n))return t&&(r&&(o=this._comment.exec(n))&&e(null,{line:this._line,type:"comment",value:o[1],prefix:""}),e(n=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=n;var s=this._line,u="",l="",h="",d=n[0],f=null,p=0,g=!1;switch(d){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(p=1,u="^");break}if(this._previousMarker="^^","<"!==(n=n.substr(2))[0]){g=!0;break}case"<":if(f=this._unescapedIri.exec(n))u="IRI",l=f[1];else if(f=this._iri.exec(n)){if(null===(l=this._unescape(f[1]))||c.test(l))return v(this);u="IRI"}else n.length>1&&"<"===n[1]?(u="<<",p=2):this._n3Mode&&n.length>1&&"="===n[1]&&(u="inverse",p=2,l=">");break;case">":n.length>1&&">"===n[1]&&(u=">>",p=2);break;case"_":((f=this._blank.exec(n))||t&&(f=this._blank.exec(n+" ")))&&(u="blank",h="_",l=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(n))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(n)),null===l)return v(this);null===f&&0===p||(u="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(n))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(n)),null===l)return v(this);null===f&&0===p||(u="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(n))&&(u="var",l=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(n))?(u="langcode",l=f[1]):(f=this._keyword.exec(n))&&(u=f[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){u=".",p=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(n)||t&&(f=this._number.exec(n+" ")))&&(u="literal",l=f[0],h="string"==typeof f[1]?a.double:"string"==typeof f[2]?a.decimal:a.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(n))?u=f[0].toUpperCase():g=!0;break;case"f":case"t":(f=this._boolean.exec(n))?(u="literal",l=f[0],h=a.boolean):g=!0;break;case"a":(f=this._shortPredicates.exec(n))?(u="abbreviation",l="a"):g=!0;break;case"=":this._n3Mode&&n.length>1&&(u="abbreviation",">"!==n[1]?(p=1,l="="):(p=2,l=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(p=1,u=d);break;default:g=!0}if(g&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(n))?((f=this._prefixed.exec(n))||t&&(f=this._prefixed.exec(n+" ")))&&(u="prefixed",h=f[1]||"",l=this._unescape(f[2])):(u="prefix",l=f[1]||"")),"^^"===this._previousMarker)switch(u){case"prefixed":u="type";break;case"IRI":u="typeIRI";break;default:u=""}if(!u)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?v(this):this._input=n;var y={line:s,type:u,value:l,prefix:h};e(null,y),this.previousToken=y,this._previousMarker=u,n=n.substr(p||f[0].length,n.length)}function v(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1;const n=e.replace(s,(e,n,r,i)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof r){let e=Number.parseInt(r,16);return e<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in u?u[i]:(t=!0,"")});return t?null:n}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length;let r=Math.max(this._literalClosingPos,n);for(;(r=e.indexOf(t,r))>0;){let t=0;for(;"\\"===e[r-t-1];)t++;if(t%2==0){const t=e.substring(n,r),i=t.split(/\r\n|\r|\n/).length-1,o=r+n;if(1===n&&0!==i||3===n&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}r++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;var t=new Error('Unexpected "'+e+'" on line '+this._line+".");return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}tokenize(e,n){var r=this;if(this._line=1,"string"==typeof e){if(this._input=e,"function"!=typeof n){var o,a=[];if(this._tokenizeToEnd(function(e,t){e?o=e:a.push(t)},!0),o)throw o;return a}(0,i.default)(()=>r._tokenizeToEnd(n,!0))}else this._input="",this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",function(e){null!==r._input&&0!==e.length&&(r._pendingBuffer&&(e=t.concat([r._pendingBuffer,e]),r._pendingBuffer=null),128&e[e.length-1]?r._pendingBuffer=e:(r._input+=e,r._tokenizeToEnd(n,!1)))}),e.on("end",function(){null!==r._input&&r._tokenizeToEnd(n,!0)}),e.on("error",n)}}}).call(this,e("buffer").Buffer)},{"./IRIs":45,buffer:12,"queue-microtask":63}],48:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(e("./N3Lexer")),i=a(e("./N3DataFactory")),o=a(e("./IRIs"));function a(e){return e&&e.__esModule?e:{default:e}}let s=0;class u{constructor(e){this._contextStack=[],this._graph=null,this._setBase((e=e||{}).baseIRI),e.factory&&l(this,e.factory);var t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(t),i=/trig/.test(t),o=/triple/.test(t),a=/quad/.test(t),s=this._n3Mode=/n3/.test(t),u=o||a;(this._supportsNamedGraphs=!(n||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||o||s),this._supportsRDFStar=""===t||/star|\*$/.test(t),u&&(this._resolveRelativeIRI=function(e){return null}),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new r.default({lineMode:u,n3:s}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){s=0}_setBase(e){if(e){var t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,n,r,i){var o=this._n3Mode;this._contextStack.push({subject:n,predicate:r,object:i,graph:t,type:e,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?this._graph.id.substr(2)+".":".",this._quantified=Object.create(this._quantified))}_restoreContext(){var e=this._contextStack.pop(),t=this._n3Mode;this._subject=e.subject,this._predicate=e.predicate,this._object=e.object,this._graph=e.graph,t&&(this._inversePredicate=e.inverse,this._prefixes._=e.blankPrefix,this._quantified=e.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){var n;switch(e.type){case"IRI":case"typeIRI":var r=this._resolveIRI(e.value);if(null===r)return this._error("Invalid IRI",e);n=this._namedNode(r);break;case"type":case"prefixed":var i=this._prefixes[e.prefix];if(void 0===i)return this._error('Undefined prefix "'+e.prefix+':"',e);n=this._namedNode(i+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error("Expected entity but got "+e.type,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){var t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error("Unexpected "+t,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error("Expected graph but got "+e.type,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);var t=null===this._predicate;return this._restoreContext(),null===this._object?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){var t=null,n=null,r=this._subject,i=this._contextStack,o=i[i.length-1],a=this._readListItem;switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),a=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==i.length&&"list"===i[i.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(a=this._readPredicate,this._subject===this.RDF_NIL)return a}else if(a=this._getContextEndReader(),this._object===this.RDF_NIL)return a;n=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,a=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),a=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._blankNode()),null===r?null===o.predicate?o.subject=n:o.object=n:this._emit(r,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return a}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":var n=this._readEntity(e);if(void 0===n)return;t=this._literal(this._literalValue,n),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){var t,n=this._subject,r=this._graph,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error('Expected punctuation to follow "'+this._object.id+'"',e)}if(null!==n){var o=this._predicate,a=this._object;i?this._emit(a,o,n,r):this._emit(n,o,a,r)}return t}_readBlankNodePunctuation(e){var t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error('Expected punctuation to follow "'+this._object.id+'"',e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error('Expected IRI to follow prefix "'+this._prefix+':"',e);var t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){var t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){var t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error("Unexpected "+e.type,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:var t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){var r=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,r,this._graph)}return this._afterPath(e)}}_readForwardPath(e){var t,n,r=this._blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}_readBackwardPath(e){var t,n,r=this._blankNode();if(void 0!==(t=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=r):(n=this._object,this._object=r),this._emit(r,t,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error('Expected >> to follow "'+this._object.id+'"',e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){var e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,n,r){this._callback(null,this._quad(e,t,n,r||this.DEFAULTGRAPH))}_error(e,t){var n=new Error(e+" on line "+t.line+".");n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=c}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;for(var t="",n=e.length,r=-1,i=-1,o=0,a="/";r=i&&(t=t.substr(0,o)),"/"!==a)return t+"/"+e.substr(r+1);o=r+1}}}a=e[++r]}return t+e.substring(o)}parse(e,t,n){var r=this;if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):"b"+s+++"_",this._prefixCallback=n||c,this._inversePredicate=!1,this._quantified=Object.create(null),!t){var i,o=[];if(this._callback=function(e,t){e?i=e:t&&o.push(t)},this._lexer.tokenize(e).every(function(e){return r._readCallback=r._readCallback(e)}),i)throw i;return o}this._callback=t,this._lexer.tokenize(e,function(e,t){null!==e?(r._callback(e),r._callback=c):r._readCallback&&(r._readCallback=r._readCallback(t))})}}function c(){}function l(e,t){var n=t.namedNode;e._namedNode=n,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=n(o.default.rdf.first),e.RDF_REST=n(o.default.rdf.rest),e.RDF_NIL=n(o.default.rdf.nil),e.N3_FORALL=n(o.default.r.forAll),e.N3_FORSOME=n(o.default.r.forSome),e.ABBREVIATIONS={a:n(o.default.rdf.type),"=":n(o.default.owl.sameAs),">":n(o.default.log.implies)},e.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}n.default=u,l(u.prototype,i.default)},{"./IRIs":45,"./N3DataFactory":46,"./N3Lexer":47}],49:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}(e("./N3DataFactory")),o=e("stream"),a=(r=e("./IRIs"))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){return"string"==typeof e||e instanceof String}n.default=class{constructor(e,t){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,t||!e||e[0]||(t=e,e=null),this._factory=(t=t||{}).factory||i.default,e&&this.addQuads(e)}get size(){var e=this._size;if(null!==e)return e;e=0;var t,n,r=this._graphs;for(var i in r)for(var o in t=r[i].subjects)for(var a in n=t[o])e+=Object.keys(n[a]).length;return this._size=e}_addToIndex(e,t,n,r){var i=e[t]||(e[t]={}),o=i[n]||(i[n]={}),a=r in o;return a||(o[r]=null),!a}_removeFromIndex(e,t,n,r){var i,o=e[t],a=o[n];for(i in delete a[r],a)return;for(i in delete o[n],o)return;delete e[t]}_findInIndex(e,t,n,r,o,a,s,u,c,l){var h,d,f,p=!t+!n+!r>1?Object.keys(this._ids):this._entities;for(var g in t&&((h=e,e={})[t]=h[t]),e){var y=p[g];if(d=e[g])for(var v in n&&((h=d,d={})[n]=h[n]),d){var m=p[v];if(f=d[v])for(var b=(r?r in f?[r]:[]:Object.keys(f)),_=0;_{for(var o of this.getQuads(e,t,n,r))i.push(o);i.push(null)},i}countQuads(e,t,n,r){e=e&&(0,i.termToId)(e),t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);var o,a,s,c,l=0,h=this._getGraphs(r),d=this._ids;if(u(e)&&!(a=d[e])||u(t)&&!(s=d[t])||u(n)&&!(c=d[n]))return 0;for(var f in h)(o=h[f])&&(l+=e?n?this._countInIndex(o.objects,c,a,s):this._countInIndex(o.subjects,a,s,c):t?this._countInIndex(o.predicates,s,c,a):this._countInIndex(o.objects,c,a,s));return l}forEach(e,t,n,r,i){this.some(function(t){return e(t),!1},t,n,r,i)}every(e,t,n,r,i){var o=!1,a=!this.some(function(t){return o=!0,!e(t)},t,n,r,i);return o&&a}some(e,t,n,r,o){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r),o=o&&(0,i.termToId)(o);var a,s,c,l,h=this._getGraphs(o),d=this._ids;if(u(t)&&!(s=d[t])||u(n)&&!(c=d[n])||u(r)&&!(l=d[r]))return!1;for(var f in h)if(a=h[f])if(s){if(l){if(this._findInIndex(a.objects,l,s,c,"object","subject","predicate",f,e,null))return!0}else if(this._findInIndex(a.subjects,s,c,null,"subject","predicate","object",f,e,null))return!0}else if(c){if(this._findInIndex(a.predicates,c,l,null,"predicate","object","subject",f,e,null))return!0}else if(l){if(this._findInIndex(a.objects,l,null,null,"object","subject","predicate",f,e,null))return!0}else if(this._findInIndex(a.subjects,null,null,null,"subject","predicate","object",f,e,null))return!0;return!1}getSubjects(e,t,n){var r=[];return this.forSubjects(function(e){r.push(e)},e,t,n),r}forSubjects(e,t,n,r){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);var o,a,s,c=this._ids,l=this._getGraphs(r);if(e=this._uniqueEntities(e),!(u(t)&&!(a=c[t])||u(n)&&!(s=c[n])))for(r in l)(o=l[r])&&(a?s?this._loopBy2Keys(o.predicates,a,s,e):this._loopByKey1(o.subjects,a,e):s?this._loopByKey0(o.objects,s,e):this._loop(o.subjects,e))}getPredicates(e,t,n){var r=[];return this.forPredicates(function(e){r.push(e)},e,t,n),r}forPredicates(e,t,n,r){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);var o,a,s,c=this._ids,l=this._getGraphs(r);if(e=this._uniqueEntities(e),!(u(t)&&!(a=c[t])||u(n)&&!(s=c[n])))for(r in l)(o=l[r])&&(a?s?this._loopBy2Keys(o.objects,s,a,e):this._loopByKey0(o.subjects,a,e):s?this._loopByKey1(o.predicates,s,e):this._loop(o.predicates,e))}getObjects(e,t,n){var r=[];return this.forObjects(function(e){r.push(e)},e,t,n),r}forObjects(e,t,n,r){t=t&&(0,i.termToId)(t),n=n&&(0,i.termToId)(n),r=r&&(0,i.termToId)(r);var o,a,s,c=this._ids,l=this._getGraphs(r);if(e=this._uniqueEntities(e),!(u(t)&&!(a=c[t])||u(n)&&!(s=c[n])))for(r in l)(o=l[r])&&(a?s?this._loopBy2Keys(o.subjects,a,s,e):this._loopByKey1(o.objects,a,e):s?this._loopByKey0(o.predicates,s,e):this._loop(o.objects,e))}getGraphs(e,t,n){var r=[];return this.forGraphs(function(e){r.push(e)},e,t,n),r}forGraphs(e,t,n,r){for(var i in this._graphs)this.some(function(t){return e(t.graph),!0},t,n,r,i)}createBlankNode(e){var t,n;if(e)for(t=e="_:"+e,n=1;this._ids[t];)t=e+n++;else do{t="_:b"+this._blankNodeIndex++}while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){var n={},r=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},i=this.getQuads(null,a.default.rdf.rest,a.default.rdf.nil,null),o=e?[...i]:[];return i.forEach(t=>{for(var i,s,u=[],c=!1,l=t.graph,h=t.subject;h&&!c;){var d,f,p=this.getQuads(null,null,h,null),g=this.getQuads(h,null,null,null),y=null,v=null,m=null;for(d=0;d"}_encodeLiteral(e){var t=e.value;return h.test(t)&&(t=t.replace(d,g)),e.language?'"'+t+'"@'+e.language:e.datatype.value!==l.string?'"'+t+'"^^'+this._encodeIriOrBlank(e.datatype):'"'+t+'"'}_encodePredicate(e){return e.value===c.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:n,graph:r}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(n)}${(0,a.isDefaultGraph)(r)?"":` ${this._encodeIriOrBlank(r)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,n,r,i){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof r?this._writeQuad(e,t,n,u,r):this._writeQuad(e,t,n,r||u,i)}addQuads(e){for(var t=0;t.\n")}if(r){var a="",s="";for(var u in n)a+=a?"|"+u:u,s+=(s?"|":"")+n[u];a=a.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:"+s+")[^/]*$|^("+a+")([a-zA-Z][\\-_a-zA-Z0-9]*)$")}this._write(r?"\n":"",t)}blank(e,t){var n,r,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return new p("[]");case 1:if(!((n=i[0]).object instanceof p))return new p("[ "+this._encodePredicate(n.predicate)+" "+this._encodeObject(n.object)+" ]");default:for(var o="[",a=0;a0;)s.push(c%o),c=c/o|0}for(i=0;0===e[i]&&i=0;--i)r+=t[s[i]]}else r=function(e,t){var n=0,r=t.length,i=t.charAt(0),o=[0];for(n=0;n0;)o.push(s%r),s=s/r|0}var u="";for(n=0;0===e.at(n)&&n=0;--n)u+=t[o[n]];return u}(e,t);if(n){var l=new RegExp(".{1,"+n+"}","g");r=r.match(l).join("\r\n")}return r},n.decode=function(t,n){if("string"!=typeof t)throw new TypeError('"input" must be a string.');if("string"!=typeof n)throw new TypeError('"alphabet" must be a string.');var i=r[n];if(!i){i=r[n]=[];for(var o=0;o>=8;for(;h>0;)u.push(255&h),h>>=8}for(var d=0;t[d]===s&&d>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(o),s(e,n,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a,u=r.util.createBuffer();u.putBytes(t.bytes()),u.putBytes(o.substr(0,i.blockLength-(i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1)));for(var c=8*i.fullMessageLength[0],l=0;l>>0)>>>0),c=a>>>0;u.putInt32(c);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(h,n,u);var d=r.util.createBuffer();return d.putInt32(h.h0),d.putInt32(h.h1),d.putInt32(h.h2),d.putInt32(h.h3),d.putInt32(h.h4),d},i};var o=null,a=!1;function s(e,t,n){for(var r,i,o,a,s,u,c,l=n.length();l>=64;){for(i=e.h0,o=e.h1,a=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)r=n.getInt32(),t[c]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;c<20;++c)t[c]=r=(r=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|r>>>31,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;c<32;++c)t[c]=r=(r=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|r>>>31,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;c<40;++c)t[c]=r=(r=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|r>>>30,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;c<60;++c)t[c]=r=(r=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|r>>>30,r=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;c<80;++c)t[c]=r=(r=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|r>>>30,r=(i<<5|i>>>27)+(o^a^s)+u+3395469782+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;e.h0=e.h0+i|0,e.h1=e.h1+o|0,e.h2=e.h2+a|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},{"./forge":56,"./md":57,"./util":60}],59:[function(e,t,n){var r=e("./forge");e("./md"),e("./util");var i=t.exports=r.sha256=r.sha256||{};r.md.sha256=r.md.algorithms.sha256=i,i.create=function(){a||(o=String.fromCharCode(128),o+=r.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=!0);var e=null,t=r.util.createBuffer(),n=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var n=i.messageLengthSize/4,o=0;o>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(o),u(e,n,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a,s=r.util.createBuffer();s.putBytes(t.bytes()),s.putBytes(o.substr(0,i.blockLength-(i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1)));for(var c=8*i.fullMessageLength[0],l=0;l>>0)>>>0),c=a>>>0;s.putInt32(c);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(h,n,s);var d=r.util.createBuffer();return d.putInt32(h.h0),d.putInt32(h.h1),d.putInt32(h.h2),d.putInt32(h.h3),d.putInt32(h.h4),d.putInt32(h.h5),d.putInt32(h.h6),d.putInt32(h.h7),d},i};var o=null,a=!1,s=null;function u(e,t,n){for(var r,i,o,a,u,c,l,h,d,f,p,g,y=n.length();y>=64;){for(a=0;a<16;++a)t[a]=n.getInt32();for(;a<64;++a)t[a]=(r=((r=t[a-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+t[a-7]+(i=((i=t[a-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)+t[a-16]|0;for(u=e.h0,c=e.h1,l=e.h2,h=e.h3,d=e.h4,f=e.h5,p=e.h6,g=e.h7,a=0;a<64;++a)o=u&c|l&(u^c),r=g+((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(p^d&(f^p))+s[a]+t[a],g=p,p=f,f=d,d=h+r>>>0,h=l,l=c,c=u,u=r+(i=((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+o)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+c|0,e.h2=e.h2+l|0,e.h3=e.h3+h|0,e.h4=e.h4+d|0,e.h5=e.h5+f|0,e.h6=e.h6+p|0,e.h7=e.h7+g|0,y-=64}}},{"./forge":56,"./md":57,"./util":60}],60:[function(e,t,n){(function(n,r,i,o,a,s,u,c){var l=e("./forge"),h=e("./baseN"),d=t.exports=l.util=l.util||{};function f(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function p(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(d.isArrayBuffer(e)||d.isArrayBufferView(e))if(void 0!==i&&e instanceof i)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(r){for(var n=0;n15?(r=Date.now(),a(e)):(t.push(e),1===t.length&&o.setAttribute("a",i=!i))}}d.nextTick=d.setImmediate}(),d.isNodejs=void 0!==n&&n.versions&&n.versions.node,d.globalScope=d.isNodejs?r:"undefined"==typeof self?window:self,d.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},d.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},d.isArrayBufferView=function(e){return e&&d.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},d.ByteBuffer=p,d.ByteStringBuffer=p,d.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},d.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},d.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},d.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},d.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var n=this.data;t>0;)1&t&&(n+=e),(t>>>=1)>0&&(e+=e);return this.data=n,this._optimizeConstructedString(t),this},d.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},d.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(d.encodeUtf8(e))},d.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},d.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},d.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},d.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},d.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},d.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},d.ByteStringBuffer.prototype.putInt=function(e,t){f(t);var n="";do{t-=8,n+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(n)},d.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},d.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),n=2<=n&&(t-=n<<1),t},d.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},d.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},d.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},d.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},d.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},d.ByteStringBuffer.prototype.copy=function(){var e=d.createBuffer(this.data);return e.read=this.read,e},d.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},d.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},d.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},d.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var n=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+t);return r.set(n),this.data=new DataView(r.buffer),this},d.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},d.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var n=0;n>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},d.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},d.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},d.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},d.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},d.DataBuffer.prototype.putInt=function(e,t){f(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},d.DataBuffer.prototype.putSignedInt=function(e,t){return f(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},d.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),n=2<=n&&(t-=n<<1),t},d.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},d.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},d.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},d.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},d.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},d.DataBuffer.prototype.copy=function(){return new d.DataBuffer(this)},d.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},d.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},d.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},d.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(n+=e),(t>>>=1)>0&&(e+=e);return n},d.xorBytes=function(e,t,n){for(var r="",i="",o="",a=0,s=0;n>0;--n,++a)i=e.charCodeAt(a)^t.charCodeAt(a),s>=10&&(r+=o,o="",s=0),o+=String.fromCharCode(i),++s;return r+o},d.hexToBytes=function(e){var t="",n=0;for(!0&e.length&&(n=1,t+=String.fromCharCode(parseInt(e[0],16)));n>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",y=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],v="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";d.encode64=function(e,t){for(var n,r,i,o="",a="",s=0;s>2),o+=g.charAt((3&n)<<4|r>>4),isNaN(r)?o+="==":(o+=g.charAt((15&r)<<2|i>>6),o+=isNaN(i)?"=":g.charAt(63&i)),t&&o.length>t&&(a+=o.substr(0,t)+"\r\n",o=o.substr(t));return a+o},d.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,n,r,i,o="",a=0;a>4),64!==r&&(o+=String.fromCharCode((15&n)<<4|r>>2),64!==i&&(o+=String.fromCharCode((3&r)<<6|i)));return o},d.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},d.decodeUtf8=function(e){return decodeURIComponent(escape(e))},d.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:h.encode,decode:h.decode}},d.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},d.binary.raw.decode=function(e,t,n){var r=t;r||(r=new Uint8Array(e.length));for(var i=n=n||0,o=0;o>2),o+=g.charAt((3&n)<<4|r>>4),isNaN(r)?o+="==":(o+=g.charAt((15&r)<<2|i>>6),o+=isNaN(i)?"=":g.charAt(63&i)),t&&o.length>t&&(a+=o.substr(0,t)+"\r\n",o=o.substr(t));return a+o},d.binary.base64.decode=function(e,t,n){var r,i,o,a,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=n=n||0;u>4,64!==o&&(s[c++]=(15&i)<<4|o>>2,64!==a&&(s[c++]=(3&o)<<6|a));return t?c-n:s.subarray(0,c)},d.binary.base58.encode=function(e,t){return d.binary.baseN.encode(e,v,t)},d.binary.base58.decode=function(e,t){return d.binary.baseN.decode(e,v,t)},d.text={utf8:{},utf16:{}},d.text.utf8.encode=function(e,t,n){e=d.encodeUtf8(e);var r=t;r||(r=new Uint8Array(e.length));for(var i=n=n||0,o=0;o0?(i=n[r].substring(0,a),o=n[r].substring(a+1)):(i=n[r],o=null),i in t||(t[i]=[]),i in Object.prototype||null===o||t[i].push(unescape(o))}return t};return void 0===e?(null===j&&(j="undefined"!=typeof window&&window.location&&window.location.search?n(window.location.search.substring(1)):{}),t=j):t=n(e),t},d.parseFragment=function(e){var t=e,n="",r=e.indexOf("?");r>0&&(t=e.substring(0,r),n=e.substring(r+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:n,path:i,query:""===n?{}:d.getQueryVariables(n)}},d.makeRequest=function(e){var t=d.parseFragment(e),n={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,n){var r;return void 0===e?r=t.query:(r=t.query[e])&&void 0!==n&&(r=r[n]),r},getQueryLast:function(e,t){var r=n.getQuery(e);return r?r[r.length-1]:t}};return n},d.makeLink=function(e,t,n){e=jQuery.isArray(e)?e.join("/"):e;var r=jQuery.param(t||{});return e+(r.length>0?"?"+r:"")+((n=n||"").length>0?"#"+n:"")},d.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},d.format=function(e){for(var t,n,r=/%./g,i=0,o=[],a=0;t=r.exec(e);){(n=e.substring(a,r.lastIndex-2)).length>0&&o.push(n),a=r.lastIndex;var s=t[0][1];switch(s){case"s":case"o":o.push(i");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(e.substring(a)),o.join("")},d.formatNumber=function(e,t,n,r){var i=e,o=isNaN(t=Math.abs(t))?2:t,a=void 0===n?",":n,s=void 0===r?".":r,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-c).toFixed(o).slice(2):"")},d.formatSize=function(e){return e>=1073741824?d.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?d.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?d.formatNumber(e/1024,0)+" KiB":d.formatNumber(e,0)+" bytes"},d.bytesFromIP=function(e){return-1!==e.indexOf(".")?d.bytesFromIPv4(e):-1!==e.indexOf(":")?d.bytesFromIPv6(e):null},d.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=d.createBuffer(),n=0;nn[r].end-n[r].start&&(r=n.length-1)):n.push({start:s,end:s})}t.push(o)}if(n.length>0){var u=n[r];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},d.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in d&&!e.update)return t(null,d.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return d.cores=navigator.hardwareConcurrency,t(null,d.cores);if("undefined"==typeof Worker)return d.cores=1,t(null,d.cores);if("undefined"==typeof Blob)return d.cores=2,t(null,d.cores);var n=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(e){for(var t=Date.now(),n=t+4;Date.now()s.st&&i.sti.st&&s.st1)for(var n=1;n(r||(r=Promise.resolve())).then(e).catch(e=>setTimeout(()=>{throw e},0))},{}],64:[function(e,t,n){"use strict";const r=e("./util");t.exports=class{constructor({maxCallStackDepth:e=500,maxTotalCallStackDepth:t=4294967295,timeSlice:n=10}={}){this.schedule={},this.schedule.MAX_DEPTH=e,this.schedule.MAX_TOTAL_DEPTH=t,this.schedule.depth=0,this.schedule.totalDepth=0,this.schedule.timeSlice=n}doWork(e,t){const n=this.schedule;if(n.totalDepth>=n.MAX_TOTAL_DEPTH)return t(new Error("Maximum total call stack depth exceeded; canonicalization aborting."));!function i(){if(n.depth===n.MAX_DEPTH)return n.depth=0,n.running=!1,r.nextTick(i);const o=Date.now();if(n.running||(n.start=Date.now(),n.deadline=n.start+n.timeSlice),o{n.depth--,n.totalDepth--,t(e,r)});n.depth=0,n.running=!1,r.setImmediate(i)}()}forEach(e,t,n){const r=this;let i,o,a=0;if(Array.isArray(e))o=e.length,i=()=>a!==o&&(i.value=e[a++],i.key=a,!0);else{const t=Object.keys(e);o=t.length,i=()=>a!==o&&(i.key=t[a++],i.value=e[i.key],!0)}!function e(o){return o?n(o):i()?r.doWork(()=>t(i.value,i.key,e)):void n()}()}waterfall(e,t){const n=this;n.forEach(e,(e,t,r)=>n.doWork(e,r),t)}whilst(e,t,n){const r=this;!function i(o){return o?n(o):e()?void r.doWork(t,i):n()}()}}},{"./util":74}],65:[function(e,t,n){"use strict";const r=e("./util");t.exports=class e{constructor(e){this.prefix=e,this.counter=0,this.existing={}}clone(){const t=new e(this.prefix);return t.counter=this.counter,t.existing=r.clone(this.existing),t}getId(e){if(e&&e in this.existing)return this.existing[e];const t=this.prefix+this.counter;return this.counter+=1,e&&(this.existing[e]=t),t}hasId(e){return e in this.existing}}},{"./util":74}],66:[function(e,t,n){"use strict";const r=e("node-forge/lib/forge");e("node-forge/lib/md"),e("node-forge/lib/sha1"),e("node-forge/lib/sha256"),t.exports=class{constructor(e){this.md=r.md[e].create()}update(e){this.md.update(e,"utf8")}digest(){return this.md.digest().toHex()}}},{"node-forge/lib/forge":56,"node-forge/lib/md":57,"node-forge/lib/sha1":58,"node-forge/lib/sha256":59}],67:[function(e,t,n){"use strict";const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",i="http://www.w3.org/2001/XMLSchema#string",o={};function a(e,t){for(const n in e)if(e[n].termType!==t[n].termType||e[n].value!==t[n].value)return!1;return"Literal"!==e.object.termType||e.object.datatype.termType===t.object.datatype.termType&&e.object.datatype.value===t.object.datatype.value&&e.object.language===t.object.language}o.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,o.empty=new RegExp("^[ \\t]*$"),o.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),t.exports=class e{static parse(e){const t=[],n={},s=e.split(o.eoln);let c=0;for(const l of s){if(c++,o.empty.test(l))continue;const e=l.match(o.quad);if(null===e)throw new Error("N-Quads parse error on line "+c+".");const s={};if(s.subject=void 0!==e[1]?{termType:"NamedNode",value:e[1]}:{termType:"BlankNode",value:e[2]},s.predicate={termType:"NamedNode",value:e[3]},void 0!==e[4]?s.object={termType:"NamedNode",value:e[4]}:void 0!==e[5]?s.object={termType:"BlankNode",value:e[5]}:(s.object={termType:"Literal",value:void 0,datatype:{termType:"NamedNode"}},void 0!==e[7]?s.object.datatype.value=e[7]:void 0!==e[8]?(s.object.datatype.value=r,s.object.language=e[8]):s.object.datatype.value=i,s.object.value=e[6].replace(u,function(e,t,n,r){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(r)throw new Error("Unsupported U escape")})),s.graph=void 0!==e[9]?{termType:"NamedNode",value:e[9]}:void 0!==e[10]?{termType:"BlankNode",value:e[10]}:{termType:"DefaultGraph",value:""},s.graph.value in n){let e=!0;const r=n[s.graph.value];for(const t of r)if(a(t,s)){e=!1;break}e&&(r.push(s),t.push(s))}else n[s.graph.value]=[s],t.push(s)}return t}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const n=[];for(const r of t)n.push(e.serializeQuad(r));return n.sort().join("")}static serializeQuad(e){const t=e.object,n=e.graph;let o="";return[e.subject,e.predicate].forEach(e=>{o+="NamedNode"===e.termType?"<"+e.value+">":e.value,o+=" "}),"NamedNode"===t.termType?o+="<"+t.value+">":"BlankNode"===t.termType?o+=t.value:(o+='"'+t.value.replace(s,function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})+'"',t.datatype.value===r?t.language&&(o+="@"+t.language):t.datatype.value!==i&&(o+="^^<"+t.datatype.value+">")),"NamedNode"===n.termType?o+=" <"+n.value+">":"BlankNode"===n.termType&&(o+=" "+n.value),o+=" .\n",o}static legacyDatasetToQuads(e){const t=[],n={"blank node":"BlankNode",IRI:"NamedNode",literal:"Literal"};for(const o in e)e[o].forEach(e=>{const a={};for(const t in e){const o=e[t],s={termType:n[o.type],value:o.value};"Literal"===s.termType&&(s.datatype={termType:"NamedNode"},"datatype"in o&&(s.datatype.value=o.datatype),"language"in o?("datatype"in o||(s.datatype.value=r),s.language=o.language):"datatype"in o||(s.datatype.value=i)),a[t]=s}a.graph="@default"===o?{termType:"DefaultGraph",value:""}:{termType:o.startsWith("_:")?"BlankNode":"NamedNode",value:o},t.push(a)});return t}};const s=/["\\\n\r]/g,u=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],68:[function(e,t,n){"use strict";t.exports=class{constructor(e){this.list=e.sort(),this.done=!1,this.left={};for(let t=0;tt)&&(o&&i>0&&e>this.list[i-1]||!o&&ithis.list[i+1])&&(t=e,n=i)}if(null===t)this.done=!0;else{const e=this.left[t]?n-1:n+1;this.list[n]=this.list[e],this.list[e]=t;for(let n=0;nt&&(this.left[this.list[n]]=!this.left[this.list[n]])}return e}}},{}],69:[function(e,t,n){"use strict";const r=e("./AsyncAlgorithm"),i=e("./IdentifierIssuer"),o=e("./MessageDigest"),a=e("./Permutator"),s=e("./NQuads"),u=e("./util"),c={subject:"s",object:"o",graph:"g"};t.exports=class extends r{constructor(e){super(e=e||{}),this.name="URDNA2015",this.options=Object.assign({},e),this.blankNodeInfo={},this.hashToBlankNodes={},this.canonicalIssuer=new i("_:c14n"),this.hashAlgorithm="sha256"}main(e,t){const n=this;let r;n.schedule.start=Date.now(),n.quads=e;const o={};n.waterfall([t=>{n.forEach(e,(e,t,r)=>{n.forEachComponent(e,t=>{if("BlankNode"!==t.termType)return;const r=t.value;r in n.blankNodeInfo?n.blankNodeInfo[r].quads.push(e):(o[r]=!0,n.blankNodeInfo[r]={quads:[e]})}),r()},t)},e=>{let t=!0;n.whilst(()=>t,e=>{t=!1,n.hashToBlankNodes={},n.waterfall([e=>{n.forEach(o,(e,t,r)=>{n.hashFirstDegreeQuads(t,(e,i)=>{if(e)return r(e);i in n.hashToBlankNodes?n.hashToBlankNodes[i].push(t):n.hashToBlankNodes[i]=[t],r()})},e)},e=>{const r=Object.keys(n.hashToBlankNodes).sort();n.forEach(r,(e,r,i)=>{const a=n.hashToBlankNodes[e];if(a.length>1)return i();const s=a[0];n.canonicalIssuer.getId(s),delete o[s],delete n.hashToBlankNodes[e],t=!0,i()},e)}],e)},e)},e=>{const t=Object.keys(n.hashToBlankNodes).sort();n.forEach(t,(e,t,r)=>{const o=[],a=n.hashToBlankNodes[e];n.waterfall([e=>{n.forEach(a,(e,t,r)=>{if(n.canonicalIssuer.hasId(e))return r();const a=new i("_:b");a.getId(e),n.hashNDegreeQuads(e,a,(e,t)=>{if(e)return r(e);o.push(t),r()})},e)},e=>{o.sort((e,t)=>e.hasht.hash?1:0),n.forEach(o,(e,t,r)=>{for(const i in e.issuer.existing)n.canonicalIssuer.getId(i);r()},e)}],r)},e)},e=>{const t=[];n.waterfall([e=>{n.forEach(n.quads,(e,r,i)=>{n.forEachComponent(e,e=>{"BlankNode"!==e.termType||e.value.startsWith(n.canonicalIssuer.prefix)||(e.value=n.canonicalIssuer.getId(e.value))}),t.push(s.serializeQuad(e)),i()},e)},e=>(t.sort(),r=t.join(""),e())],e)}],e=>t(e,r))}hashFirstDegreeQuads(e,t){const n=this,r=n.blankNodeInfo[e];if("hash"in r)return t(null,r.hash);const i=[];n.forEach(r.quads,(t,r,o)=>{const a={predicate:t.predicate};n.forEachComponent(t,(t,r)=>{a[r]=n.modifyFirstDegreeComponent(e,t,r)}),i.push(s.serializeQuad(a)),o()},e=>{if(e)return t(e);i.sort();const a=new o(n.hashAlgorithm);for(let t=0;ta.canonicalIssuer.hasId(e)?(s=a.canonicalIssuer.getId(e),t()):n.hasId(e)?(s=n.getId(e),t()):void a.hashFirstDegreeQuads(e,(e,n)=>{if(e)return t(e);s=n,t()})],e=>{if(e)return i(e);const n=new o(a.hashAlgorithm);return n.update(r),"g"!==r&&n.update(a.getRelatedPredicate(t)),n.update(s),i(null,n.digest())})}hashNDegreeQuads(e,t,n){const r=this;let i;const s=new o(r.hashAlgorithm);r.waterfall([n=>r.createHashToRelated(e,t,(e,t)=>{if(e)return n(e);i=t,n()}),e=>{const n=Object.keys(i).sort();r.forEach(n,(e,n,o)=>{s.update(e);let u,c="";const l=new a(i[e]);r.whilst(()=>l.hasNext(),e=>{const n=l.next();let i=t.clone(),o="";const a=[];r.waterfall([t=>{r.forEach(n,(t,n,s)=>{if(r.canonicalIssuer.hasId(t)?o+=r.canonicalIssuer.getId(t):(i.hasId(t)||a.push(t),o+=i.getId(t)),0!==c.length&&o>c)return e();s()},t)},t=>{r.forEach(a,(t,n,a)=>{r.hashNDegreeQuads(t,i,(n,r)=>n?a(n):(o+=i.getId(t),o+="<"+r.hash+">",i=r.issuer,0!==c.length&&o>c?e():void a()))},t)},e=>{(0===c.length||o{if(e)return o(e);s.update(c),t=u,o()})},e)}],e=>{n(e,{hash:s.digest(),issuer:t})})}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType||((t=u.clone(t)).value=t.value===e?"_:a":"_:z"),t}getRelatedPredicate(e){return"<"+e.predicate.value+">"}createHashToRelated(e,t,n){const r=this,i={};r.forEach(r.blankNodeInfo[e].quads,(n,o,a)=>{r.forEach(n,(o,a,s)=>{if("predicate"===a||"BlankNode"!==o.termType||o.value===e)return s();const u=o.value;r.hashRelatedBlankNode(u,n,t,c[a],(e,t)=>{if(e)return s(e);t in i?i[t].push(u):i[t]=[u],s()})},a)},e=>n(e,i))}forEachComponent(e,t){for(const n in e)"predicate"!==n&&t(e[n],n,e)}}},{"./AsyncAlgorithm":64,"./IdentifierIssuer":65,"./MessageDigest":66,"./NQuads":67,"./Permutator":68,"./util":74}],70:[function(e,t,n){"use strict";const r=e("./IdentifierIssuer"),i=e("./MessageDigest"),o=e("./Permutator"),a=e("./NQuads"),s=e("./util"),u={subject:"s",object:"o",graph:"g"};t.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo={},this.hashToBlankNodes={},this.canonicalIssuer=new r("_:c14n"),this.hashAlgorithm="sha256"}main(e){const t=this;t.quads=e;const n={};for(const r of e)t.forEachComponent(r,e=>{if("BlankNode"!==e.termType)return;const i=e.value;i in t.blankNodeInfo?t.blankNodeInfo[i].quads.push(r):(n[i]=!0,t.blankNodeInfo[i]={quads:[r]})});let i=!0;for(;i;){i=!1,t.hashToBlankNodes={};for(const r in n){const e=t.hashFirstDegreeQuads(r);e in t.hashToBlankNodes?t.hashToBlankNodes[e].push(r):t.hashToBlankNodes[e]=[r]}const e=Object.keys(t.hashToBlankNodes).sort();for(let r=0;r1)continue;const s=a[0];t.canonicalIssuer.getId(s),delete n[s],delete t.hashToBlankNodes[o],i=!0}}const o=Object.keys(t.hashToBlankNodes).sort();for(let a=0;ae.hasht.hash?1:0);for(let r=0;r{"BlankNode"!==e.termType||e.value.startsWith(t.canonicalIssuer.prefix)||(e.value=t.canonicalIssuer.getId(e.value))}),s.push(a.serializeQuad(e))}return s.sort(),s.join("")}hashFirstDegreeQuads(e){const t=this,n=t.blankNodeInfo[e];if("hash"in n)return n.hash;const r=[],o=n.quads;for(let i=0;i{s[r]=t.modifyFirstDegreeComponent(e,n,r)}),r.push(a.serializeQuad(s))}r.sort();const s=new i(t.hashAlgorithm);for(let i=0;ic){a=!0;break}}if(!a){for(let e=0;e",r=s.issuer,0!==c.length&&i>c){a=!0;break}}a||(0===c.length||i"}createHashToRelated(e,t){const n=this,r={},i=n.blankNodeInfo[e].quads;for(let o=0;o{let s,u;if("BlankNode"===n.subject.termType&&n.subject.value!==e)u=n.subject.value,s="p";else{if("BlankNode"!==n.object.termType||n.object.value===e)return a();u=n.object.value,s="r"}r.hashRelatedBlankNode(u,n,t,s,(e,t)=>{if(e)return a(e);t in i?i[t].push(u):i[t]=[u],a()})},e=>n(e,i))}}},{"./URDNA2015":69,"./util":74}],72:[function(e,t,n){"use strict";const r=e("./URDNA2015Sync"),i=e("./util");t.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType||((t=i.clone(t)).value="name"===n?"_:g":t.value===e?"_:a":"_:z"),t}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=this,r={},i=n.blankNodeInfo[e].quads;for(let o=0;o{n=(n,r)=>{if(n)return t(n);e(r)}});if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(!u)throw new Error("rdf-canonize-native not available");u.canonize(e,t,n)}else if("URDNA2015"===t.algorithm)new i(t).main(e,n);else{if("URGNA2012"!==t.algorithm)throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.");new o(t).main(e,n)}return r}),c.canonizeSync=function(e,t){if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(u)return u.canonizeSync(e,t);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===t.algorithm)return new a(t).main(e);if("URGNA2012"===t.algorithm)return new s(t).main(e);if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}},{"./IdentifierIssuer":65,"./NQuads":67,"./URDNA2015":69,"./URDNA2015Sync":70,"./URGNA2012":71,"./URGNA2012Sync":72,"./util":74,"rdf-canonize-native":11}],74:[function(e,t,n){(function(e,n){"use strict";const r={};t.exports=r;const i="function"==typeof n&&n,o=i?e=>i(e):e=>setTimeout(e,0);function a(t,n,r){try{return t(n,r)}catch(i){e.nextTick(()=>{throw i})}}r.nextTick="object"==typeof e&&"function"==typeof e.nextTick?e.nextTick:o,r.setImmediate=i?o:r.nextTick,r.clone=function(e){if(e&&"object"==typeof e){let t;if(Array.isArray(e)){t=[];for(let n=0;n"[object Object]"===Object.prototype.toString.call(e),r.isUndefined=e=>void 0===e,r.callbackify=e=>async function(...t){const n=t[t.length-1];let r;"function"==typeof n&&t.pop();try{r=await e.apply(null,t)}catch(i){if("function"==typeof n)return a(n,i);throw i}return"function"==typeof n?a(n,null,r):r}}).call(this,e("_process"),e("timers").setImmediate)},{_process:62,timers:14}],75:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}(e("./lib/RdfXmlParser"))},{"./lib/RdfXmlParser":77}],76:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});class r extends Error{constructor(e,t){const n=e.saxStream._parser;super(e.trackPosition?`Line ${n.line+1} column ${n.column+1}: ${t}`:t)}}n.ParseError=r},{}],77:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const r=e("relative-to-absolute-iri"),i=e("sax"),o=e("stream"),a=e("./ParseError");class s extends o.Transform{constructor(t){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},t&&(Object.assign(this,t),this.options=t),this.dataFactory||(this.dataFactory=e("@rdfjs/data-model")),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.saxStream=i.createStream(this.strict,{xmlns:!1,position:this.trackPosition}),this.strict||(this.saxStream._parser.looseCase="toString"),this.attachSaxListeners()}static parseNamespace(e,t){const n={};let r=!1;for(const o in e.attributes)o.startsWith("xmlns")&&(5===o.length?(r=!0,n[""]=e.attributes[o]):":"===o.charAt(5)&&(r=!0,n[o.substr(6)]=e.attributes[o]));const i=t&&t.ns?t.ns:[s.DEFAULT_NS];return r?i.concat([n]):i}static expandPrefixedTerm(e,t,n){const r=e.indexOf(":");let i,o;r>=0?(i=e.substr(0,r),o=e.substr(r+1)):(i="",o=e);let s=null,u=null;for(let a=t.length-1;a>=0;a--){const e=t[a][i];if(e){s=e;break}u||(u=t[a][""])}if(!s){if(i&&"xmlns"!==i)throw new a.ParseError(n,`The prefix '${i}' in term '${e}' was not bound.`);s=u||""}return{prefix:i,local:o,uri:s}}static isValidIri(e){return s.IRI_REGEX.test(e)}import(e){const t=new o.PassThrough({readableObjectMode:!0});e.on("error",e=>n.emit("error",e)),e.on("data",e=>t.write(e)),e.on("end",()=>t.emit("end"));const n=t.pipe(new s(this.options));return n}_transform(e,t,n){try{this.saxStream.write(e,t)}catch(r){return n(r)}n()}newParseError(e){return new a.ParseError(this,e)}valueToUri(e,t){return this.uriToNamedNode(r.resolve(e,t.baseIRI))}uriToNamedNode(e){if(!s.isValidIri(e))throw this.newParseError(`Invalid URI: ${e}`);return this.dataFactory.namedNode(e)}validateNcname(e){if(!s.NCNAME_MATCHER.test(e))throw this.newParseError(`Not a valid NCName: ${e}`)}attachSaxListeners(){this.saxStream.on("error",e=>this.emit("error",e)),this.saxStream.on("opentag",this.onTag.bind(this)),this.saxStream.on("text",this.onText.bind(this)),this.saxStream.on("closetag",this.onCloseTag.bind(this)),this.saxStream.on("doctype",this.onDoctype.bind(this))}onTag(e){const t=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let n=u.RESOURCE;if(t&&(t.hadChildren=!0,n=t.childrenParseType),t&&t.childrenStringTags){const n=e.name;let r="";for(const t in e.attributes)r+=` ${t}="${e.attributes[t]}"`;t.childrenStringTags.push(`<${n}${r}>`);const i={childrenStringTags:t.childrenStringTags};return i.childrenStringEmitClosingTag=``,void this.activeTagStack.push(i)}const r={};t?(r.language=t.language,r.baseIRI=t.baseIRI):r.baseIRI=this.baseIRI,this.activeTagStack.push(r),r.ns=s.parseNamespace(e,t),n===u.RESOURCE?this.onTagResource(e,r,t,!t):this.onTagProperty(e,r,t)}onTagResource(e,t,n,i){const o=s.expandPrefixedTerm(e.name,t.ns,this);t.childrenParseType=u.PROPERTY;let a=!0;if(o.uri===s.RDF){if(!i&&s.FORBIDDEN_NODE_ELEMENTS.indexOf(o.local)>=0)throw this.newParseError(`Illegal node element name: ${o.local}`);switch(o.local){case"RDF":t.childrenParseType=u.RESOURCE;case"Description":a=!1}}const c=[],l=[];let h=null,d=!1,f=!1,p=null;for(const u in e.attributes){const i=e.attributes[u],o=s.expandPrefixedTerm(u,t.ns,this);if(n&&o.uri===s.RDF)switch(o.local){case"about":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${i} and ${h} where found.`);h=i;continue;case"ID":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${i} and ${h} where found.`);this.validateNcname(i),h="#"+i,d=!0;continue;case"nodeID":if(h)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${i} and ${h} where found.`);this.validateNcname(i),h=i,f=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":p=i;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(o.uri===s.XML){if("lang"===o.local){t.language=""===i?null:i.toLowerCase();continue}if("base"===o.local){t.baseIRI=r.resolve(i,t.baseIRI);continue}}"xml"!==o.prefix&&o.uri&&(c.push(this.uriToNamedNode(o.uri+o.local)),l.push(i))}if(null!==h&&(t.subject=f?this.dataFactory.blankNode(h):this.valueToUri(h,t),d&&this.claimNodeId(t.subject)),t.subject||(t.subject=this.dataFactory.blankNode()),a){const e=this.uriToNamedNode(o.uri+o.local);this.emitTriple(t.subject,this.dataFactory.namedNode(s.RDF+"type"),e,n?n.reifiedStatementId:null)}if(n){if(n.predicate)if(n.childrenCollectionSubject){const e=this.dataFactory.blankNode();this.emitTriple(n.childrenCollectionSubject,n.childrenCollectionPredicate,e,n.reifiedStatementId),this.emitTriple(e,this.dataFactory.namedNode(s.RDF+"first"),t.subject,t.reifiedStatementId),n.childrenCollectionSubject=e,n.childrenCollectionPredicate=this.dataFactory.namedNode(s.RDF+"rest")}else{this.emitTriple(n.subject,n.predicate,t.subject,n.reifiedStatementId);for(let e=0;e=0)throw this.newParseError(`Illegal property element name: ${r.local}`);t.predicateSubPredicates=[],t.predicateSubObjects=[];let i=!1,o=!1,a=null,c=!0;const l=[],h=[];for(const d in e.attributes){const n=e.attributes[d],r=s.expandPrefixedTerm(d,t.ns,this);if(r.uri===s.RDF)switch(r.local){case"resource":if(a)throw this.newParseError(`Found both rdf:resource (${n}) and rdf:nodeID (${a}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${n})`);t.hadChildren=!0,a=n,c=!1;continue;case"datatype":if(o)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${n}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${n})`);t.datatype=this.valueToUri(n,t);continue;case"nodeID":if(o)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${n}).`);if(t.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${n}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${n})`);this.validateNcname(n),t.hadChildren=!0,a=n,c=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(o)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(t.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${t.datatype.value})`);if(a)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${a})`);if("Resource"===n){i=!0,t.childrenParseType=u.PROPERTY;const e=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,e,t.reifiedStatementId),t.subject=e,t.predicate=null}else"Collection"===n?(i=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,c=!1):"Literal"===n&&(i=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(n),t.reifiedStatementId=this.valueToUri("#"+n,t),this.claimNodeId(t.reifiedStatementId);continue}else if(r.uri===s.XML&&"lang"===r.local){t.language=""===n?null:n.toLowerCase();continue}if("xml"!==r.prefix&&"xmlns"!==r.prefix&&r.uri){if(i||t.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${n}`);t.hadChildren=!0,o=!0,l.push(this.uriToNamedNode(r.uri+r.local)),h.push(this.dataFactory.literal(n,t.datatype||t.language))}}if(null!==a){const e=t.subject;t.subject=c?this.dataFactory.blankNode(a):this.valueToUri(a,t),this.emitTriple(e,t.predicate,t.subject,t.reifiedStatementId);for(let n=0;n/g,(e,t,n)=>(this.saxStream._parser.ENTITIES[t]=n,""))}}var u;n.RdfXmlParser=s,s.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,s.MIME_TYPE="application/rdf+xml",s.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",s.XML="http://www.w3.org/XML/1998/namespace",s.XMLNS="http://www.w3.org/2000/xmlns/",s.DEFAULT_NS={xml:s.XML},s.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],s.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],s.NCNAME_MATCHER=/^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u,function(e){e[e.RESOURCE=0]="RESOURCE",e[e.PROPERTY=1]="PROPERTY"}(u=n.ParseType||(n.ParseType={}))},{"./ParseError":76,"@rdfjs/data-model":2,"relative-to-absolute-iri":93,sax:96,stream:97}],78:[function(e,t,n){"use strict";var r={};function i(e,t,n){n||(n=Error);var i=function(e){function n(n,r,i){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,i))||this}return i=e,(r=n).prototype=Object.create(i.prototype),r.prototype.constructor=r,r.__proto__=i,n;var r,i}(n);i.prototype.name=n.name,i.prototype.code=e,r[e]=i}function o(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,n){var r,i,a,s;if("string"==typeof t&&"not "===t.substr(0,"not ".length)?(r="must not be",t=t.replace(/^not /,"")):r="must be",a=e,(void 0===s||s>a.length)&&(s=a.length)," argument"===a.substring(s-" argument".length,s))i="The ".concat(e," ").concat(r," ").concat(o(t,"type"));else{var u=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";i='The "'.concat(e,'" ').concat(u," ").concat(r," ").concat(o(t,"type"))}return i+". Received type ".concat(typeof n)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r},{}],79:[function(e,t,n){(function(n){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var i=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(c,i);for(var a=r(o.prototype),s=0;s0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),r)s.endEmitted?x(e,new w):I(e,s,t,!0);else if(s.ended)x(e,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!n?(t=s.decoder.write(t),s.objectMode||0!==t.length?I(e,s,t,!1):O(e,s)):I(e,s,t,!1)}else r||(s.reading=!1,O(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(k,e))}function k(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,C(e)}function O(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function M(e){o("readable nexttick read 0"),e.read(0)}function D(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function F(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(B,t,e))}function B(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function U(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):A(this),null;if(0===(e=T(e,t))&&t.ended)return 0===t.length&&F(this),null;var r,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&F(this)),null!==r&&this.emit("data",r),r},j.prototype._read=function(e){x(this,new _("_read()"))},j.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,o("pipe count=%d opts=%j",i.pipesCount,t);var s=t&&!1===t.end||e===n.stdout||e===n.stderr?g:u;function u(){o("onend"),e.end()}i.endEmitted?n.nextTick(s):r.once("end",s),e.on("unpipe",function t(n,a){o("onunpipe"),n===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",h),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,C(e))}}(r);e.on("drain",c);var l=!1;function h(t){o("ondata");var n=e.write(t);o("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!l&&(o("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(t){o("onerror",t),g(),e.removeListener("error",d),0===a(e,"error")&&x(e,t)}function f(){e.removeListener("finish",p),g()}function p(){o("onfinish"),e.removeListener("close",f),g()}function g(){o("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener("error",n);e._events&&e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(n):e._events.error=[n,e._events.error]:e.on("error",n)}(e,0,d),e.once("close",f),e.once("finish",p),e.emit("pipe",r),i.flowing||(o("pipe resume"),r.resume()),e},j.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,o("on readable",i.length,i.reading),i.length?A(this):i.reading||n.nextTick(M,this))),r},j.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(L,this),r},j.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(L,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(D,e,t))}(this,e)),e.paused=!1,this},j.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(o("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){o("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),j.prototype._write=function(e,t,n){n(new g("_write()"))},j.prototype._writev=null,j.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,O(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),j.prototype.destroy=h.destroy,j.prototype._undestroy=h.undestroy,j.prototype._destroy=function(e,t){t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":78,"./_stream_duplex":79,"./internal/streams/destroy":86,"./internal/streams/state":90,"./internal/streams/stream":91,_process:62,buffer:12,inherits:18,"util-deprecate":114}],84:[function(e,t,n){(function(n){"use strict";var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=e("./end-of-stream"),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function f(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[d].read();null!==n&&(e[l]=null,e[a]=null,e[s]=null,t(f(n,!1)))}}function g(e){n.nextTick(p,e)}var y=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((i(r={get stream(){return this[d]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(t,r){n.nextTick(function(){e[u]?r(e[u]):t(f(void 0,!0))})});var r,i=this[l];if(i)r=new Promise(function(e,t){return function(n,r){e.then(function(){t[c]?n(f(void 0,!0)):t[h](n,r)},r)}}(i,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(f(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,function(){return this}),i(r,"return",function(){var e=this;return new Promise(function(t,n){e[d].destroy(null,function(e){e?n(e):t(f(void 0,!0))})})}),r),y);t.exports=function(e){var t,n=Object.create(v,(i(t={},d,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,h,{value:function(e,t){var r=n[d].read();r?(n[l]=null,n[a]=null,n[s]=null,e(f(r,!1))):(n[a]=e,n[s]=t)},writable:!0}),t));return n[l]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];return null!==t&&(n[l]=null,n[a]=null,n[s]=null,t(e)),void(n[u]=e)}var r=n[a];null!==r&&(n[l]=null,n[a]=null,n[s]=null,r(f(void 0,!0))),n[c]=!0}),e.on("readable",g.bind(null,n)),n}}).call(this,e("_process"))},{"./end-of-stream":87,_process:62}],85:[function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t=a.allocUnsafe(e>>>0),n=this.head,r=0;n;)a.prototype.copy.call(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(r+=o===i.length?i:i.slice(0,e),0==(e-=o)){o===i.length?(++n,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t0,function(e){r||(r=e),e&&a.forEach(c),o||(a.forEach(c),i(r))})});return t.reduce(l)}},{"../../../errors":78,"./end-of-stream":87}],90:[function(e,t,n){"use strict";var r=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,i){var o=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},{"../../../errors":78}],91:[function(e,t,n){t.exports=e("events").EventEmitter},{events:13}],92:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":79,"./lib/_stream_passthrough.js":80,"./lib/_stream_readable.js":81,"./lib/_stream_transform.js":82,"./lib/_stream_writable.js":83,"./lib/internal/streams/end-of-stream.js":87,"./lib/internal/streams/pipeline.js":89}],93:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}(e("./lib/Resolve"))},{"./lib/Resolve":94}],94:[function(e,t,n){"use strict";function r(e){const t=[];let n=0;for(;ne.join("")).join("/")}function i(e,t){let n=t+1;t>=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);const i=e.indexOf("/",n);return i<0?e:e.substr(0,i)+r(e.substr(i))}function o(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(n,"__esModule",{value:!0}),n.resolve=function(e,t){const n=(t=t||"").indexOf("#");if(n>0&&(t=t.substr(0,n)),!e.length){if(t.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);return t}if(e.startsWith("?")){const n=t.indexOf("?");return n>0&&(t=t.substr(0,n)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){const t=e.indexOf(":");if(t<0)throw new Error(`Found invalid relative IRI '${e}' for a missing baseIRI`);return i(e,t)}const o=e.indexOf(":");if(o>=0)return i(e,o);const a=t.indexOf(":");if(a<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);const s=t.substr(0,a+1);if(0===e.indexOf("//"))return s+i(e,o);let u;if(t.indexOf("//",a)===a+1){if(u=t.indexOf("/",a+3),u<0)return t.length>a+3?t+"/"+i(e,o):s+i(e,o)}else if(u=t.indexOf("/",a+1),u<0)return s+i(e,o);if(0===e.indexOf("/"))return t.substr(0,u)+r(e);let c=t.substr(u);const l=c.lastIndexOf("/");return l>=0&&l"===r?(j(this,"onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=x.TEXT):g(r)?(this.state=x.SGML_DECL_QUOTED,this.sgmlDecl+=r):this.sgmlDecl+=r;continue;case x.SGML_DECL_QUOTED:r===this.q&&(this.state=x.SGML_DECL,this.q=""),this.sgmlDecl+=r;continue;case x.DOCTYPE:">"===r?(this.state=x.TEXT,j(this,"ondoctype",this.doctype),this.doctype=!0):(this.doctype+=r,"["===r?this.state=x.DOCTYPE_DTD:g(r)&&(this.state=x.DOCTYPE_QUOTED,this.q=r));continue;case x.DOCTYPE_QUOTED:this.doctype+=r,r===this.q&&(this.q="",this.state=x.DOCTYPE);continue;case x.DOCTYPE_DTD:this.doctype+=r,"]"===r?this.state=x.DOCTYPE:g(r)&&(this.state=x.DOCTYPE_DTD_QUOTED,this.q=r);continue;case x.DOCTYPE_DTD_QUOTED:this.doctype+=r,r===this.q&&(this.state=x.DOCTYPE_DTD,this.q="");continue;case x.COMMENT:"-"===r?this.state=x.COMMENT_ENDING:this.comment+=r;continue;case x.COMMENT_ENDING:"-"===r?(this.state=x.COMMENT_ENDED,this.comment=I(this.opt,this.comment),this.comment&&j(this,"oncomment",this.comment),this.comment=""):(this.comment+="-"+r,this.state=x.COMMENT);continue;case x.COMMENT_ENDED:">"!==r?(k(this,"Malformed comment"),this.comment+="--"+r,this.state=x.COMMENT):this.state=x.TEXT;continue;case x.CDATA:"]"===r?this.state=x.CDATA_ENDING:this.cdata+=r;continue;case x.CDATA_ENDING:"]"===r?this.state=x.CDATA_ENDING_2:(this.cdata+="]"+r,this.state=x.CDATA);continue;case x.CDATA_ENDING_2:">"===r?(this.cdata&&j(this,"oncdata",this.cdata),j(this,"onclosecdata"),this.cdata="",this.state=x.TEXT):"]"===r?this.cdata+="]":(this.cdata+="]]"+r,this.state=x.CDATA);continue;case x.PROC_INST:"?"===r?this.state=x.PROC_INST_ENDING:p(r)?this.state=x.PROC_INST_BODY:this.procInstName+=r;continue;case x.PROC_INST_BODY:if(!this.procInstBody&&p(r))continue;"?"===r?this.state=x.PROC_INST_ENDING:this.procInstBody+=r;continue;case x.PROC_INST_ENDING:">"===r?(j(this,"onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=x.TEXT):(this.procInstBody+="?"+r,this.state=x.PROC_INST_BODY);continue;case x.OPEN_TAG:v(h,r)?this.tagName+=r:(O(this),">"===r?M(this):"/"===r?this.state=x.OPEN_TAG_SLASH:(p(r)||k(this,"Invalid character in tag name"),this.state=x.ATTRIB));continue;case x.OPEN_TAG_SLASH:">"===r?(M(this,!0),D(this)):(k(this,"Forward-slash in opening tag not followed by >"),this.state=x.ATTRIB);continue;case x.ATTRIB:if(p(r))continue;">"===r?M(this):"/"===r?this.state=x.OPEN_TAG_SLASH:v(l,r)?(this.attribName=r,this.attribValue="",this.state=x.ATTRIB_NAME):k(this,"Invalid attribute name");continue;case x.ATTRIB_NAME:"="===r?this.state=x.ATTRIB_VALUE:">"===r?(k(this,"Attribute without value"),this.attribValue=this.attribName,L(this),M(this)):p(r)?this.state=x.ATTRIB_NAME_SAW_WHITE:v(h,r)?this.attribName+=r:k(this,"Invalid attribute name");continue;case x.ATTRIB_NAME_SAW_WHITE:if("="===r)this.state=x.ATTRIB_VALUE;else{if(p(r))continue;k(this,"Attribute without value"),this.tag.attributes[this.attribName]="",this.attribValue="",j(this,"onattribute",{name:this.attribName,value:""}),this.attribName="",">"===r?M(this):v(l,r)?(this.attribName=r,this.state=x.ATTRIB_NAME):(k(this,"Invalid attribute name"),this.state=x.ATTRIB)}continue;case x.ATTRIB_VALUE:if(p(r))continue;g(r)?(this.q=r,this.state=x.ATTRIB_VALUE_QUOTED):(k(this,"Unquoted attribute value"),this.state=x.ATTRIB_VALUE_UNQUOTED,this.attribValue=r);continue;case x.ATTRIB_VALUE_QUOTED:if(r!==this.q){"&"===r?this.state=x.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=r;continue}L(this),this.q="",this.state=x.ATTRIB_VALUE_CLOSED;continue;case x.ATTRIB_VALUE_CLOSED:p(r)?this.state=x.ATTRIB:">"===r?M(this):"/"===r?this.state=x.OPEN_TAG_SLASH:v(l,r)?(k(this,"No whitespace between attributes"),this.attribName=r,this.attribValue="",this.state=x.ATTRIB_NAME):k(this,"Invalid attribute name");continue;case x.ATTRIB_VALUE_UNQUOTED:if(!y(r)){"&"===r?this.state=x.ATTRIB_VALUE_ENTITY_U:this.attribValue+=r;continue}L(this),">"===r?M(this):this.state=x.ATTRIB;continue;case x.CLOSE_TAG:if(this.tagName)">"===r?D(this):v(h,r)?this.tagName+=r:this.script?(this.script+=""===r?D(this):k(this,"Invalid characters in closing tag");continue;case x.TEXT_ENTITY:case x.ATTRIB_VALUE_ENTITY_Q:case x.ATTRIB_VALUE_ENTITY_U:var a,s;switch(this.state){case x.TEXT_ENTITY:a=x.TEXT,s="textNode";break;case x.ATTRIB_VALUE_ENTITY_Q:a=x.ATTRIB_VALUE_QUOTED,s="attribValue";break;case x.ATTRIB_VALUE_ENTITY_U:a=x.ATTRIB_VALUE_UNQUOTED,s="attribValue"}";"===r?(this[s]+=(c=void 0,b=void 0,_=void 0,w=void 0,_=(b=(u=this).entity).toLowerCase(),w="",u.ENTITIES[b]?u.ENTITIES[b]:u.ENTITIES[_]?u.ENTITIES[_]:("#"===(b=_).charAt(0)&&("x"===b.charAt(1)?(b=b.slice(2),w=(c=parseInt(b,16)).toString(16)):(b=b.slice(1),w=(c=parseInt(b,10)).toString(10))),b=b.replace(/^0+/,""),isNaN(c)||w.toLowerCase()!==b?(k(u,"Invalid character entity"),"&"+u.entity+";"):String.fromCodePoint(c))),this.entity="",this.state=a):v(this.entity.length?f:d,r)?this.entity+=r:(k(this,"Invalid character in entity name"),this[s]+="&"+this.entity+r,this.entity="",this.state=a);continue;default:throw new Error(this,"Unknown state: "+this.state)}var u,c,b,_,w;return this.position>=this.bufferCheckPosition&&function(e){for(var t=Math.max(n.MAX_BUFFER_LENGTH,10),r=0,o=0,a=i.length;ot)switch(i[o]){case"textNode":N(e);break;case"cdata":j(e,"oncdata",e.cdata),e.cdata="";break;case"script":j(e,"onscript",e.script),e.script="";break;default:T(e,"Max buffer length exceeded: "+i[o])}r=Math.max(r,s)}e.bufferCheckPosition=n.MAX_BUFFER_LENGTH-r+e.position}(this),this},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){N(this),""!==this.cdata&&(j(this,"oncdata",this.cdata),this.cdata=""),""!==this.script&&(j(this,"onscript",this.script),this.script="")}};try{r=e("stream").Stream}catch(F){r=function(){}}var a=n.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function s(e,t){if(!(this instanceof s))return new s(e,t);r.apply(this),this._parser=new o(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,a.forEach(function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})})}(s.prototype=Object.create(r.prototype,{constructor:{value:s}})).write=function(n){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(n)){if(!this._decoder){var r=e("string_decoder").StringDecoder;this._decoder=new r("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,t){var n=this;return n._parser["on"+e]||-1===a.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),r.prototype.on.call(n,e,t)};var u="http://www.w3.org/XML/1998/namespace",c={xml:u,xmlns:"http://www.w3.org/2000/xmlns/"},l=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function p(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function g(e){return'"'===e||"'"===e}function y(e){return">"===e||p(e)}function v(e,t){return e.test(t)}function m(e,t){return!v(e,t)}var b,_,w,x=0;for(var S in n.STATE={BEGIN:x++,BEGIN_WHITESPACE:x++,TEXT:x++,TEXT_ENTITY:x++,OPEN_WAKA:x++,SGML_DECL:x++,SGML_DECL_QUOTED:x++,DOCTYPE:x++,DOCTYPE_QUOTED:x++,DOCTYPE_DTD:x++,DOCTYPE_DTD_QUOTED:x++,COMMENT_STARTING:x++,COMMENT:x++,COMMENT_ENDING:x++,COMMENT_ENDED:x++,CDATA:x++,CDATA_ENDING:x++,CDATA_ENDING_2:x++,PROC_INST:x++,PROC_INST_BODY:x++,PROC_INST_ENDING:x++,OPEN_TAG:x++,OPEN_TAG_SLASH:x++,ATTRIB:x++,ATTRIB_NAME:x++,ATTRIB_NAME_SAW_WHITE:x++,ATTRIB_VALUE:x++,ATTRIB_VALUE_QUOTED:x++,ATTRIB_VALUE_CLOSED:x++,ATTRIB_VALUE_UNQUOTED:x++,ATTRIB_VALUE_ENTITY_Q:x++,ATTRIB_VALUE_ENTITY_U:x++,CLOSE_TAG:x++,CLOSE_TAG_SAW_WHITE:x++,SCRIPT:x++,SCRIPT_ENDING:x++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(e){var t=n.ENTITIES[e],r="number"==typeof t?String.fromCharCode(t):t;n.ENTITIES[e]=r}),n.STATE)n.STATE[n.STATE[S]]=S;function E(e,t,n){e[t]&&e[t](n)}function j(e,t,n){e.textNode&&N(e),E(e,t,n)}function N(e){e.textNode=I(e.opt,e.textNode),e.textNode&&E(e,"ontext",e.textNode),e.textNode=""}function I(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function T(e,t){return N(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,E(e,"onerror",t),e}function A(e){return e.sawRoot&&!e.closedRoot&&k(e,"Unclosed root tag"),e.state!==x.BEGIN&&e.state!==x.BEGIN_WHITESPACE&&e.state!==x.TEXT&&T(e,"Unexpected end"),N(e),e.c="",e.closed=!0,E(e,"onend"),o.call(e,e.strict,e.opt),e}function k(e,t){if("object"!=typeof e||!(e instanceof o))throw new Error("bad call to strictFail");e.strict&&T(e,t)}function O(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,j(e,"onopentagstart",n)}function R(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function L(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=R(e.attribName,!0),n=t.local;if("xmlns"===t.prefix)if("xml"===n&&e.attribValue!==u)k(e,"xml: prefix must be bound to "+u+"\nActual: "+e.attribValue);else if("xmlns"===n&&"http://www.w3.org/2000/xmlns/"!==e.attribValue)k(e,"xmlns: prefix must be bound to http://www.w3.org/2000/xmlns/\nActual: "+e.attribValue);else{var r=e.tag,i=e.tags[e.tags.length-1]||e;r.ns===i.ns&&(r.ns=Object.create(i.ns)),r.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,j(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function M(e,t){if(e.opt.xmlns){var n=e.tag,r=R(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(k(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix),n.ns&&(e.tags[e.tags.length-1]||e).ns!==n.ns&&Object.keys(n.ns).forEach(function(t){j(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var i=0,o=e.attribList.length;i",e.tagName="",void(e.state=x.SCRIPT);j(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)k(e,"Unexpected close tag");if(t<0)return k(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=x.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,j(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];e.opt.xmlns&&o.ns!==(e.tags[e.tags.length-1]||e).ns&&Object.keys(o.ns).forEach(function(t){j(e,"onclosenamespace",{prefix:t,uri:o.ns[t]})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=x.TEXT}function C(e,t){"<"===t?(e.state=x.OPEN_WAKA,e.startTagPosition=e.position):p(t)||(k(e,"Non-whitespace before first tag."),e.textNode=t,e.state=x.TEXT)}function P(e,t){var n="";return t1114111||_(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?t.push(o):t.push(55296+((o-=65536)>>10),o%1024+56320),(n+1===r||t.length>e)&&(i+=b.apply(null,t),t.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:w,configurable:!0,writable:!0}):String.fromCodePoint=w)}(void 0===n?this.sax={}:n)}).call(this,e("buffer").Buffer)},{buffer:12,stream:97,string_decoder:113}],97:[function(e,t,n){t.exports=i;var r=e("events").EventEmitter;function i(){r.call(this)}e("inherits")(i,r),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(l(),0===r.listenerCount(this,"error"))throw e}function l(){n.removeListener("data",i),e.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("error",c),e.on("error",c),n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e}},{events:13,inherits:18,"readable-stream/duplex.js":98,"readable-stream/passthrough.js":107,"readable-stream/readable.js":108,"readable-stream/transform.js":109,"readable-stream/writable.js":110}],98:[function(e,t,n){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":99}],99:[function(e,t,n){"use strict";var r=e("process-nextick-args"),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=h;var o=Object.create(e("core-util-is"));o.inherits=e("inherits");var a=e("./_stream_readable"),s=e("./_stream_writable");o.inherits(h,a);for(var u=i(s.prototype),c=0;c0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):j(e,a)):w(e,a,t,!1))):r||(a.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(f("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(E,e):E(e))}function E(e){f("emit readable"),e.emit("readable"),A(e)}function j(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(N,e,t))}function N(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;return eo.length?o.length:e;if(i+=a===o.length?o:o.slice(0,e),0==(e-=a)){a===o.length?(++r,t.head=n.next?n.next:t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0==(e-=a)){a===o.length?(++i,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}(e,t),r}(e,t.buffer,t.decoder),n);var n}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function L(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return f("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):S(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&O(this),null;var r,i=t.needReadable;return f("need readable",i),(0===t.length||t.length-e0?k(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,f("pipe count=%d opts=%j",o.pipesCount,t);var u=t&&!1===t.end||e===n.stdout||e===n.stderr?m:c;function c(){f("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",function t(n,i){f("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,f("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",l),e.removeListener("error",g),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",m),r.removeListener("data",p),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())});var l=function(e){return function(){var t=e._readableState;f("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,A(e))}}(r);e.on("drain",l);var h=!1,d=!1;function p(t){f("ondata"),d=!1,!1!==e.write(t)||d||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==L(o.pipes,e))&&!h&&(f("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,d=!0),r.pause())}function g(t){f("onerror",t),m(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),m()}function v(){f("onfinish"),e.removeListener("close",y),m()}function m(){f("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener("error",n);e._events&&e._events.error?a(e._events.error)?e._events.error.unshift(n):e._events.error=[n,e._events.error]:e.on("error",n)}(e,0,g),e.once("close",y),e.once("finish",v),e.emit("pipe",r),o.flowing||(f("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o-1?i:o.nextTick;m.WritableState=v;var c=Object.create(e("core-util-is"));c.inherits=e("inherits");var l,h={deprecate:e("util-deprecate")},d=e("./internal/streams/stream"),f=e("safe-buffer").Buffer,p=r.Uint8Array||function(){},g=e("./internal/streams/destroy");function y(){}function v(t,n){s=s||e("./_stream_duplex");var r=n instanceof s;this.objectMode=!!(t=t||{}).objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark;this.highWaterMark=i||0===i?i:r&&(c||0===c)?c:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===t.decodeStrings),this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(o.nextTick(i,r),o.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),E(e,t))}(e,n,r,t,i);else{var a=x(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?u(_,e,n,a,i):_(e,n,a,i)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function m(t){if(s=s||e("./_stream_duplex"),!(l.call(m,this)||this instanceof s))return new m(t);this._writableState=new v(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),d.call(this)}function b(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function _(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),E(e,t)}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=new Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=n;for(var o=0,s=!0;n;)r[o]=n,n.isBuf||(s=!1),n=n.next,o+=1;r.allBuffers=s,b(e,t,!0,t.length,r,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk;if(b(e,t,!1,t.objectMode?1:u.length,u,n.encoding,n.callback),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),E(e,t)})}function E(e,t){var n=x(t);return n&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(m,d),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===m&&e&&e._writableState instanceof v}})):l=function(e){return e instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(f.isBuffer(r=e)||r instanceof p);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=y),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),o.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(r,a),i=!1),i}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n)),t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,E(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),m.prototype.destroy=g.destroy,m.prototype._undestroy=g.undestroy,m.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{"./_stream_duplex":99,"./internal/streams/destroy":105,"./internal/streams/stream":106,_process:62,"core-util-is":16,inherits:18,"process-nextick-args":61,"safe-buffer":111,timers:14,"util-deprecate":114}],104:[function(e,t,n){"use strict";var r=e("safe-buffer").Buffer,i=e("util");t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t=r.allocUnsafe(e>>>0),n=this.head,i=0;n;)n.data.copy(t,i),i+=n.data.length,n=n.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":111,util:11}],105:[function(e,t,n){"use strict";var r=e("process-nextick-args");function i(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var n=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":61}],106:[function(e,t,n){arguments[4][91][0].apply(n,arguments)},{dup:91,events:13}],107:[function(e,t,n){t.exports=e("./readable").PassThrough},{"./readable":108}],108:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":99,"./lib/_stream_passthrough.js":100,"./lib/_stream_readable.js":101,"./lib/_stream_transform.js":102,"./lib/_stream_writable.js":103}],109:[function(e,t,n){t.exports=e("./readable").Transform},{"./readable":108}],110:[function(e,t,n){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":103}],111:[function(e,t,n){var r=e("buffer"),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,n),n.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},{buffer:12}],112:[function(e,t,n){"use strict";var r=e("safe-buffer").Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=h,t=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":111}],113:[function(e,t,n){arguments[4][112][0].apply(n,arguments)},{dup:112,"safe-buffer":95}],114:[function(e,t,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(r){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],115:[function(e,t,n){"use strict";t.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},{}],116:[function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n"']/g,P=RegExp(D.source),F=RegExp(C.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,G=/<%=([\s\S]+?)%>/g,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V=/^\w*$/,q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,W=RegExp(K.source),H=/^\s+|\s+$/g,J=/^\s+/,$=/\s+$/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Q=/\{\n\/\* \[wrapped with (.+)\] \*/,Y=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/\\(\\)?/g,te=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ne=/\w*$/,re=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ae=/^0o[0-7]+$/i,se=/^(?:0|[1-9]\d*)$/,ue=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ce=/($^)/,le=/['\n\r\u2028\u2029\\]/g,he="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fe="["+de+"]",pe="["+he+"]",ge="\\d+",ye="[a-z\\xdf-\\xf6\\xf8-\\xff]",ve="[^\\ud800-\\udfff"+de+ge+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",me="\\ud83c[\\udffb-\\udfff]",be="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",we="[\\ud800-\\udbff][\\udc00-\\udfff]",xe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Se="(?:"+ye+"|"+ve+")",Ee="(?:"+xe+"|"+ve+")",je="(?:"+pe+"|"+me+")?",Ne="[\\ufe0e\\ufe0f]?"+je+"(?:\\u200d(?:"+[be,_e,we].join("|")+")[\\ufe0e\\ufe0f]?"+je+")*",Ie="(?:"+["[\\u2700-\\u27bf]",_e,we].join("|")+")"+Ne,Te="(?:"+[be+pe+"?",pe,_e,we,"[\\ud800-\\udfff]"].join("|")+")",Ae=RegExp("['\u2019]","g"),ke=RegExp(pe,"g"),Oe=RegExp(me+"(?="+me+")|"+Te+Ne,"g"),Re=RegExp([xe+"?"+ye+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[fe,xe,"$"].join("|")+")",Ee+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[fe,xe+Se,"$"].join("|")+")",xe+"?"+Se+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",xe+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ge,Ie].join("|"),"g"),Le=RegExp("[\\u200d\\ud800-\\udfff"+he+"\\ufe0e\\ufe0f]"),Me=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,De=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ce=-1,Pe={};Pe[E]=Pe[j]=Pe[N]=Pe[I]=Pe[T]=Pe[A]=Pe["[object Uint8ClampedArray]"]=Pe[k]=Pe[O]=!0,Pe[s]=Pe[u]=Pe[x]=Pe[c]=Pe[S]=Pe[l]=Pe[h]=Pe[d]=Pe[p]=Pe[g]=Pe[y]=Pe[v]=Pe[m]=Pe[b]=Pe[w]=!1;var Fe={};Fe[s]=Fe[u]=Fe[x]=Fe[S]=Fe[c]=Fe[l]=Fe[E]=Fe[j]=Fe[N]=Fe[I]=Fe[T]=Fe[p]=Fe[g]=Fe[y]=Fe[v]=Fe[m]=Fe[b]=Fe[_]=Fe[A]=Fe["[object Uint8ClampedArray]"]=Fe[k]=Fe[O]=!0,Fe[h]=Fe[d]=Fe[w]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,Ge=parseInt,ze="object"==typeof global&&global&&global.Object===Object&&global,Ve="object"==typeof self&&self&&self.Object===Object&&self,qe=ze||Ve||Function("return this")(),Ke=t&&!t.nodeType&&t,We=Ke&&"object"==typeof e&&e&&!e.nodeType&&e,He=We&&We.exports===Ke,Je=He&&ze.process,$e=function(){try{return We&&We.require&&We.require("util").types||Je&&Je.binding&&Je.binding("util")}catch(e){}}(),Xe=$e&&$e.isArrayBuffer,Qe=$e&&$e.isDate,Ye=$e&&$e.isMap,Ze=$e&&$e.isRegExp,et=$e&&$e.isSet,tt=$e&&$e.isTypedArray;function nt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function rt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function ct(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Ot(e,t){for(var n=e.length;n--&&mt(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Lt=St({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),Mt=St({"&":"&","<":"<",">":">",'"':""","'":"'"});function Dt(e){return"\\"+Be[e]}function Ct(e){return Le.test(e)}function Pt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Ft(e,t){return function(n){return e(t(n))}}function Bt(e,t){for(var n=-1,r=e.length,i=0,a=[];++n",""":'"',"'":"'"}),Kt=function e(t){var n,r=(t=null==t?qe:Kt.defaults(qe.Object(),t,Kt.pick(qe,De))).Array,he=t.Date,de=t.Error,fe=t.Function,pe=t.Math,ge=t.Object,ye=t.RegExp,ve=t.String,me=t.TypeError,be=r.prototype,_e=ge.prototype,we=t["__core-js_shared__"],xe=fe.prototype.toString,Se=_e.hasOwnProperty,Ee=0,je=(n=/[^.]+$/.exec(we&&we.keys&&we.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ne=_e.toString,Ie=xe.call(ge),Te=qe._,Oe=ye("^"+xe.call(Se).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=He?t.Buffer:void 0,Be=t.Symbol,ze=t.Uint8Array,Ve=Le?Le.allocUnsafe:void 0,Ke=Ft(ge.getPrototypeOf,ge),We=ge.create,Je=_e.propertyIsEnumerable,$e=be.splice,gt=Be?Be.isConcatSpreadable:void 0,St=Be?Be.iterator:void 0,Wt=Be?Be.toStringTag:void 0,Ht=function(){try{var e=Qi(ge,"defineProperty");return e({},"",{}),e}catch(t){}}(),Jt=t.clearTimeout!==qe.clearTimeout&&t.clearTimeout,$t=he&&he.now!==qe.Date.now&&he.now,Xt=t.setTimeout!==qe.setTimeout&&t.setTimeout,Qt=pe.ceil,Yt=pe.floor,Zt=ge.getOwnPropertySymbols,en=Le?Le.isBuffer:void 0,tn=t.isFinite,nn=be.join,rn=Ft(ge.keys,ge),on=pe.max,an=pe.min,sn=he.now,un=t.parseInt,cn=pe.random,ln=be.reverse,hn=Qi(t,"DataView"),dn=Qi(t,"Map"),fn=Qi(t,"Promise"),pn=Qi(t,"Set"),gn=Qi(t,"WeakMap"),yn=Qi(ge,"create"),vn=gn&&new gn,mn={},bn=Io(hn),_n=Io(dn),wn=Io(fn),xn=Io(pn),Sn=Io(gn),En=Be?Be.prototype:void 0,jn=En?En.valueOf:void 0,Nn=En?En.toString:void 0;function In(e){if(qa(e)&&!La(e)&&!(e instanceof On)){if(e instanceof kn)return e;if(Se.call(e,"__wrapped__"))return To(e)}return new kn(e)}var Tn=function(){function e(){}return function(t){if(!Va(t))return{};if(We)return We(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function An(){}function kn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function On(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function $n(e,t,n,r,i,o){var a,u=1&t,h=2&t,w=4&t;if(n&&(a=i?n(e,r,i,o):n(e)),void 0!==a)return a;if(!Va(e))return e;var R=La(e);if(R){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!u)return gi(e,a)}else{var L=eo(e),M=L==d||L==f;if(Pa(e))return ci(e,u);if(L==y||L==s||M&&!i){if(a=h||M?{}:no(e),!u)return h?function(e,t){return yi(e,Zi(e),t)}(e,function(e,t){return e&&yi(t,ws(t),e)}(a,e)):function(e,t){return yi(e,Yi(e),t)}(e,Kn(a,e))}else{if(!Fe[L])return i?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case x:return li(e);case c:case l:return new r(+e);case S:return function(e,t){var n=t?li(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case E:case j:case N:case I:case T:case A:case"[object Uint8ClampedArray]":case k:case O:return hi(e,n);case p:return new r;case g:case b:return new r(e);case v:return function(e){var t=new e.constructor(e.source,ne.exec(e));return t.lastIndex=e.lastIndex,t}(e);case m:return new r;case _:return jn?ge(jn.call(e)):{}}}(e,L,u)}}o||(o=new Cn);var D=o.get(e);if(D)return D;o.set(e,a),$a(e)?e.forEach(function(r){a.add($n(r,t,n,r,e,o))}):Ka(e)&&e.forEach(function(r,i){a.set(i,$n(r,t,n,i,e,o))});var C=R?void 0:(w?h?qi:Vi:h?ws:_s)(e);return it(C||e,function(r,i){C&&(r=e[i=r]),zn(a,i,$n(r,t,n,i,e,o))}),a}function Xn(e,t,n){var r=n.length;if(null==e)return!r;for(e=ge(e);r--;){var i=n[r],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Qn(e,t,n){if("function"!=typeof e)throw new me(i);return mo(function(){e.apply(void 0,n)},t)}function Yn(e,t,n,r){var i=-1,o=ut,a=!0,s=e.length,u=[],c=t.length;if(!s)return u;n&&(t=lt(t,It(n))),r?(o=ct,a=!1):t.length>=200&&(o=At,a=!1,t=new Dn(t));e:for(;++i-1},Ln.prototype.set=function(e,t){var n=this.__data__,r=Vn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Mn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(dn||Ln),string:new Rn}},Mn.prototype.delete=function(e){var t=$i(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return $i(this,e).get(e)},Mn.prototype.has=function(e){return $i(this,e).has(e)},Mn.prototype.set=function(e,t){var n=$i(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Dn.prototype.add=Dn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Dn.prototype.has=function(e){return this.__data__.has(e)},Cn.prototype.clear=function(){this.__data__=new Ln,this.size=0},Cn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Cn.prototype.get=function(e){return this.__data__.get(e)},Cn.prototype.has=function(e){return this.__data__.has(e)},Cn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ln){var r=n.__data__;if(!dn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Mn(r)}return n.set(e,t),this.size=n.size,this};var Zn=bi(sr),er=bi(ur,!0);function tr(e,t){var n=!0;return Zn(e,function(e,r,i){return n=!!t(e,r,i)}),n}function nr(e,t,n){for(var r=-1,i=e.length;++r0&&n(s)?t>1?ir(s,t-1,n,r,i):ht(i,s):r||(i[i.length]=s)}return i}var or=_i(),ar=_i(!0);function sr(e,t){return e&&or(e,t,_s)}function ur(e,t){return e&&ar(e,t,_s)}function cr(e,t){return st(t,function(t){return Ua(e[t])})}function lr(e,t){for(var n=0,r=(t=oi(t,e)).length;null!=e&&nt}function pr(e,t){return null!=e&&Se.call(e,t)}function gr(e,t){return null!=e&&t in ge(e)}function yr(e,t,n){for(var i=n?ct:ut,o=e[0].length,a=e.length,s=a,u=r(a),c=1/0,l=[];s--;){var h=e[s];s&&t&&(h=lt(h,It(t))),c=an(h.length,c),u[s]=!n&&(t||o>=120&&h.length>=120)?new Dn(s&&h):void 0}h=e[0];var d=-1,f=u[0];e:for(;++d=s?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});r--;)e[r]=e[r].value;return e}(jr(e,function(e,n,i){return{criteria:lt(t,function(t){return t(e)}),index:++r,value:e}}))}function Or(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&$e.call(s,u,1),$e.call(e,u,1);return e}function Lr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;io(i)?$e.call(e,i,1):Qr(e,i)}}return e}function Mr(e,t){return e+Yt(cn()*(t-e+1))}function Dr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Yt(t/2))&&(e+=e)}while(t);return n}function Cr(e,t){return bo(fo(e,t,Ws),e+"")}function Pr(e){return Fn(As(e))}function Fr(e,t){var n=As(e);return xo(n,Jn(t,0,n.length))}function Br(e,t,n,r){if(!Va(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,s=e;null!=s&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i>>1,a=e[o];null!==a&&!Qa(a)&&(n?a<=t:a=200){var c=t?null:Di(e);if(c)return Ut(c);a=!1,i=At,u=new Dn}else u=t?[]:s;e:for(;++r=r?e:Vr(e,t,n)}var ui=Jt||function(e){return qe.clearTimeout(e)};function ci(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function li(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function hi(e,t){var n=t?li(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function di(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=Qa(e),a=void 0!==t,s=null===t,u=t==t,c=Qa(t);if(!s&&!c&&!o&&e>t||o&&a&&u&&!s&&!c||r&&a&&u||!n&&u||!i)return 1;if(!r&&!o&&!c&&e1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=ge(t);++r-1?i[o?t[a]:a]:void 0}}function ji(e){return zi(function(t){var n=t.length,r=n,o=kn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new me(i);if(o&&!s&&"wrapper"==Wi(a))var s=new kn([],!0)}for(r=s?r:n;++r1&&b.reverse(),h&&cs))return!1;var c=o.get(e),l=o.get(t);if(c&&l)return c==t&&l==e;var h=-1,d=!0,f=2&n?new Dn:void 0;for(o.set(e,t),o.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(X,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return it(a,function(n){var r="_."+n[0];t&n[1]&&!ut(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(Q);return t?t[1].split(Y):[]}(r),n)))}function wo(e){var t=0,n=0;return function(){var r=sn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function xo(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Jo(e,n)});function ta(e){var t=In(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var ra=zi(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Hn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof On&&io(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new kn(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=vi(function(e,t,n){Se.call(e,n)?++e[n]:Wn(e,n,1)}),oa=Ei(Ro),aa=Ei(Lo);function sa(e,t){return(La(e)?it:Zn)(e,Ji(t,3))}function ua(e,t){return(La(e)?ot:er)(e,Ji(t,3))}var ca=vi(function(e,t,n){Se.call(e,n)?e[n].push(t):Wn(e,n,[t])}),la=Cr(function(e,t,n){var i=-1,o="function"==typeof t,a=Da(e)?r(e.length):[];return Zn(e,function(e){a[++i]=o?nt(t,e,n):vr(e,t,n)}),a}),ha=vi(function(e,t,n){Wn(e,n,t)});function da(e,t){return(La(e)?lt:jr)(e,Ji(t,3))}var fa=vi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Cr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),kr(e,ir(t,1),[])}),ga=$t||function(){return qe.Date.now()};function ya(e,t,n){return t=n?void 0:t,Pi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function va(e,t){var n;if("function"!=typeof t)throw new me(i);return e=rs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ma=Cr(function(e,t,n){var r=1;if(n.length){var i=Bt(n,Hi(ma));r|=32}return Pi(e,r,t,n,i)}),ba=Cr(function(e,t,n){var r=3;if(n.length){var i=Bt(n,Hi(ba));r|=32}return Pi(t,r,e,n,i)});function _a(e,t,n){var r,o,a,s,u,c,l=0,h=!1,d=!1,f=!0;if("function"!=typeof e)throw new me(i);function p(t){var n=r,i=o;return r=o=void 0,l=t,s=e.apply(i,n)}function g(e){return l=e,u=mo(v,t),h?p(e):s}function y(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=a}function v(){var e=ga();if(y(e))return m(e);u=mo(v,function(e){var n=t-(e-c);return d?an(n,a-(e-l)):n}(e))}function m(e){return u=void 0,f&&r?p(e):(r=o=void 0,s)}function b(){var e=ga(),n=y(e);if(r=arguments,o=this,c=e,n){if(void 0===u)return g(c);if(d)return ui(u),u=mo(v,t),p(c)}return void 0===u&&(u=mo(v,t)),s}return t=os(t)||0,Va(n)&&(h=!!n.leading,a=(d="maxWait"in n)?on(os(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),b.cancel=function(){void 0!==u&&ui(u),l=0,r=c=o=u=void 0},b.flush=function(){return void 0===u?s:m(ga())},b}var wa=Cr(function(e,t){return Qn(e,1,t)}),xa=Cr(function(e,t,n){return Qn(e,os(t)||0,n)});function Sa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new me(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Sa.Cache||Mn),n}function Ea(e){if("function"!=typeof e)throw new me(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Sa.Cache=Mn;var ja=ai(function(e,t){var n=(t=1==t.length&&La(t[0])?lt(t[0],It(Ji())):lt(ir(t,1),It(Ji()))).length;return Cr(function(r){for(var i=-1,o=an(r.length,n);++i=t}),Ra=mr(function(){return arguments}())?mr:function(e){return qa(e)&&Se.call(e,"callee")&&!Je.call(e,"callee")},La=r.isArray,Ma=Xe?It(Xe):function(e){return qa(e)&&dr(e)==x};function Da(e){return null!=e&&za(e.length)&&!Ua(e)}function Ca(e){return qa(e)&&Da(e)}var Pa=en||ou,Fa=Qe?It(Qe):function(e){return qa(e)&&dr(e)==l};function Ba(e){if(!qa(e))return!1;var t=dr(e);return t==h||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ha(e)}function Ua(e){if(!Va(e))return!1;var t=dr(e);return t==d||t==f||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ga(e){return"number"==typeof e&&e==rs(e)}function za(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Va(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function qa(e){return null!=e&&"object"==typeof e}var Ka=Ye?It(Ye):function(e){return qa(e)&&eo(e)==p};function Wa(e){return"number"==typeof e||qa(e)&&dr(e)==g}function Ha(e){if(!qa(e)||dr(e)!=y)return!1;var t=Ke(e);if(null===t)return!0;var n=Se.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&xe.call(n)==Ie}var Ja=Ze?It(Ze):function(e){return qa(e)&&dr(e)==v},$a=et?It(et):function(e){return qa(e)&&eo(e)==m};function Xa(e){return"string"==typeof e||!La(e)&&qa(e)&&dr(e)==b}function Qa(e){return"symbol"==typeof e||qa(e)&&dr(e)==_}var Ya=tt?It(tt):function(e){return qa(e)&&za(e.length)&&!!Pe[dr(e)]},Za=Ri(Er),es=Ri(function(e,t){return e<=t});function ts(e){if(!e)return[];if(Da(e))return Xa(e)?Vt(e):gi(e);if(St&&e[St])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[St]());var t=eo(e);return(t==p?Pt:t==m?Ut:As)(e)}function ns(e){return e?1/0===(e=os(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function rs(e){var t=ns(e),n=t%1;return t==t?n?t-n:t:0}function is(e){return e?Jn(rs(e),0,4294967295):0}function os(e){if("number"==typeof e)return e;if(Qa(e))return NaN;if(Va(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Va(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(H,"");var n=ie.test(e);return n||ae.test(e)?Ge(e.slice(2),n?2:8):re.test(e)?NaN:+e}function as(e){return yi(e,ws(e))}function ss(e){return null==e?"":$r(e)}var us=mi(function(e,t){if(co(t)||Da(t))yi(t,_s(t),e);else for(var n in t)Se.call(t,n)&&zn(e,n,t[n])}),cs=mi(function(e,t){yi(t,ws(t),e)}),ls=mi(function(e,t,n,r){yi(t,ws(t),e,r)}),hs=mi(function(e,t,n,r){yi(t,_s(t),e,r)}),ds=zi(Hn),fs=Cr(function(e,t){e=ge(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(r=1);++n1),t}),yi(e,qi(e),n),r&&(n=$n(n,7,Ui));for(var i=t.length;i--;)Qr(n,t[i]);return n}),js=zi(function(e,t){return null==e?{}:function(e,t){return Or(e,t,function(t,n){return ys(e,n)})}(e,t)});function Ns(e,t){if(null==e)return{};var n=lt(qi(e),function(e){return[e]});return t=Ji(t),Or(e,n,function(e,n){return t(e,n[0])})}var Is=Ci(_s),Ts=Ci(ws);function As(e){return null==e?[]:Tt(e,_s(e))}var ks=xi(function(e,t,n){return t=t.toLowerCase(),e+(n?Os(t):t)});function Os(e){return Bs(ss(e).toLowerCase())}function Rs(e){return(e=ss(e))&&e.replace(ue,Lt).replace(ke,"")}var Ls=xi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ms=xi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ds=wi("toLowerCase"),Cs=xi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ps=xi(function(e,t,n){return e+(n?" ":"")+Bs(t)}),Fs=xi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Bs=wi("toUpperCase");function Us(e,t,n){return e=ss(e),void 0===(t=n?void 0:t)?function(e){return Me.test(e)}(e)?function(e){return e.match(Re)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Gs=Cr(function(e,t){try{return nt(e,void 0,t)}catch(n){return Ba(n)?n:new de(n)}}),zs=zi(function(e,t){return it(t,function(t){t=No(t),Wn(e,t,ma(e[t],e))}),e});function Vs(e){return function(){return e}}var qs=ji(),Ks=ji(!0);function Ws(e){return e}function Hs(e){return xr("function"==typeof e?e:$n(e,1))}var Js=Cr(function(e,t){return function(n){return vr(n,e,t)}}),$s=Cr(function(e,t){return function(n){return vr(e,n,t)}});function Xs(e,t,n){var r=_s(t),i=cr(t,r);null!=n||Va(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=cr(t,_s(t)));var o=!(Va(n)&&"chain"in n&&!n.chain),a=Ua(e);return it(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=gi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ht([this.value()],arguments))})}),e}function Qs(){}var Ys=Ai(lt),Zs=Ai(at),eu=Ai(pt);function tu(e){return ao(e)?xt(No(e)):function(e){return function(t){return lr(t,e)}}(e)}var nu=Oi(),ru=Oi(!0);function iu(){return[]}function ou(){return!1}var au,su=Ti(function(e,t){return e+t},0),uu=Mi("ceil"),cu=Ti(function(e,t){return e/t},1),lu=Mi("floor"),hu=Ti(function(e,t){return e*t},1),du=Mi("round"),fu=Ti(function(e,t){return e-t},0);return In.after=function(e,t){if("function"!=typeof t)throw new me(i);return e=rs(e),function(){if(--e<1)return t.apply(this,arguments)}},In.ary=ya,In.assign=us,In.assignIn=cs,In.assignInWith=ls,In.assignWith=hs,In.at=ds,In.before=va,In.bind=ma,In.bindAll=zs,In.bindKey=ba,In.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return La(e)?e:[e]},In.chain=ta,In.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(rs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=r(Qt(i/t));oi?0:i+n),(r=void 0===r||r>i?i:rs(r))<0&&(r+=i),r=n>r?0:is(r);n>>0)?(e=ss(e))&&("string"==typeof t||null!=t&&!Ja(t))&&!(t=$r(t))&&Ct(e)?si(Vt(e),0,n):e.split(t,n):[]},In.spread=function(e,t){if("function"!=typeof e)throw new me(i);return t=null==t?0:on(rs(t),0),Cr(function(n){var r=n[t],i=si(n,0,t);return r&&ht(i,r),nt(e,this,i)})},In.tail=function(e){var t=null==e?0:e.length;return t?Vr(e,1,t):[]},In.take=function(e,t,n){return e&&e.length?Vr(e,0,(t=n||void 0===t?1:rs(t))<0?0:t):[]},In.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Vr(e,(t=r-(t=n||void 0===t?1:rs(t)))<0?0:t,r):[]},In.takeRightWhile=function(e,t){return e&&e.length?Zr(e,Ji(t,3),!1,!0):[]},In.takeWhile=function(e,t){return e&&e.length?Zr(e,Ji(t,3)):[]},In.tap=function(e,t){return t(e),e},In.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new me(i);return Va(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),_a(e,t,{leading:r,maxWait:t,trailing:o})},In.thru=na,In.toArray=ts,In.toPairs=Is,In.toPairsIn=Ts,In.toPath=function(e){return La(e)?lt(e,No):Qa(e)?[e]:gi(jo(ss(e)))},In.toPlainObject=as,In.transform=function(e,t,n){var r=La(e),i=r||Pa(e)||Ya(e);if(t=Ji(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Va(e)&&Ua(o)?Tn(Ke(e)):{}}return(i?it:sr)(e,function(e,r,i){return t(n,e,r,i)}),n},In.unary=function(e){return ya(e,1)},In.union=qo,In.unionBy=Ko,In.unionWith=Wo,In.uniq=function(e){return e&&e.length?Xr(e):[]},In.uniqBy=function(e,t){return e&&e.length?Xr(e,Ji(t,2)):[]},In.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xr(e,void 0,t):[]},In.unset=function(e,t){return null==e||Qr(e,t)},In.unzip=Ho,In.unzipWith=Jo,In.update=function(e,t,n){return null==e?e:Yr(e,t,ii(n))},In.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Yr(e,t,ii(n),r)},In.values=As,In.valuesIn=function(e){return null==e?[]:Tt(e,ws(e))},In.without=$o,In.words=Us,In.wrap=function(e,t){return Na(ii(t),e)},In.xor=Xo,In.xorBy=Qo,In.xorWith=Yo,In.zip=Zo,In.zipObject=function(e,t){return ni(e||[],t||[],zn)},In.zipObjectDeep=function(e,t){return ni(e||[],t||[],Br)},In.zipWith=ea,In.entries=Is,In.entriesIn=Ts,In.extend=cs,In.extendWith=ls,Xs(In,In),In.add=su,In.attempt=Gs,In.camelCase=ks,In.capitalize=Os,In.ceil=uu,In.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=os(n))==n?n:0),void 0!==t&&(t=(t=os(t))==t?t:0),Jn(os(e),t,n)},In.clone=function(e){return $n(e,4)},In.cloneDeep=function(e){return $n(e,5)},In.cloneDeepWith=function(e,t){return $n(e,5,t="function"==typeof t?t:void 0)},In.cloneWith=function(e,t){return $n(e,4,t="function"==typeof t?t:void 0)},In.conformsTo=function(e,t){return null==t||Xn(e,t,_s(t))},In.deburr=Rs,In.defaultTo=function(e,t){return null==e||e!=e?t:e},In.divide=cu,In.endsWith=function(e,t,n){e=ss(e),t=$r(t);var r=e.length,i=n=void 0===n?r:Jn(rs(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},In.eq=Aa,In.escape=function(e){return(e=ss(e))&&F.test(e)?e.replace(C,Mt):e},In.escapeRegExp=function(e){return(e=ss(e))&&W.test(e)?e.replace(K,"\\$&"):e},In.every=function(e,t,n){var r=La(e)?at:tr;return n&&oo(e,t,n)&&(t=void 0),r(e,Ji(t,3))},In.find=oa,In.findIndex=Ro,In.findKey=function(e,t){return yt(e,Ji(t,3),sr)},In.findLast=aa,In.findLastIndex=Lo,In.findLastKey=function(e,t){return yt(e,Ji(t,3),ur)},In.floor=lu,In.forEach=sa,In.forEachRight=ua,In.forIn=function(e,t){return null==e?e:or(e,Ji(t,3),ws)},In.forInRight=function(e,t){return null==e?e:ar(e,Ji(t,3),ws)},In.forOwn=function(e,t){return e&&sr(e,Ji(t,3))},In.forOwnRight=function(e,t){return e&&ur(e,Ji(t,3))},In.get=gs,In.gt=ka,In.gte=Oa,In.has=function(e,t){return null!=e&&to(e,t,pr)},In.hasIn=ys,In.head=Do,In.identity=Ws,In.includes=function(e,t,n,r){e=Da(e)?e:As(e),n=n&&!r?rs(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Xa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&mt(e,t,n)>-1},In.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:rs(n);return i<0&&(i=on(r+i,0)),mt(e,t,i)},In.inRange=function(e,t,n){return t=ns(t),void 0===n?(n=t,t=0):n=ns(n),function(e,t,n){return e>=an(t,n)&&e=-9007199254740991&&e<=9007199254740991},In.isSet=$a,In.isString=Xa,In.isSymbol=Qa,In.isTypedArray=Ya,In.isUndefined=function(e){return void 0===e},In.isWeakMap=function(e){return qa(e)&&eo(e)==w},In.isWeakSet=function(e){return qa(e)&&"[object WeakSet]"==dr(e)},In.join=function(e,t){return null==e?"":nn.call(e,t)},In.kebabCase=Ls,In.last=Bo,In.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=rs(n))<0?on(r+i,0):an(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):vt(e,_t,i,!0)},In.lowerCase=Ms,In.lowerFirst=Ds,In.lt=Za,In.lte=es,In.max=function(e){return e&&e.length?nr(e,Ws,fr):void 0},In.maxBy=function(e,t){return e&&e.length?nr(e,Ji(t,2),fr):void 0},In.mean=function(e){return wt(e,Ws)},In.meanBy=function(e,t){return wt(e,Ji(t,2))},In.min=function(e){return e&&e.length?nr(e,Ws,Er):void 0},In.minBy=function(e,t){return e&&e.length?nr(e,Ji(t,2),Er):void 0},In.stubArray=iu,In.stubFalse=ou,In.stubObject=function(){return{}},In.stubString=function(){return""},In.stubTrue=function(){return!0},In.multiply=hu,In.nth=function(e,t){return e&&e.length?Ar(e,rs(t)):void 0},In.noConflict=function(){return qe._===this&&(qe._=Te),this},In.noop=Qs,In.now=ga,In.pad=function(e,t,n){e=ss(e);var r=(t=rs(t))?zt(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return ki(Yt(i),n)+e+ki(Qt(i),n)},In.padEnd=function(e,t,n){e=ss(e);var r=(t=rs(t))?zt(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var i=cn();return an(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Mr(e,t)},In.reduce=function(e,t,n){var r=La(e)?dt:Et,i=arguments.length<3;return r(e,Ji(t,4),n,i,Zn)},In.reduceRight=function(e,t,n){var r=La(e)?ft:Et,i=arguments.length<3;return r(e,Ji(t,4),n,i,er)},In.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:rs(t),Dr(ss(e),t)},In.replace=function(){var e=arguments,t=ss(e[0]);return e.length<3?t:t.replace(e[1],e[2])},In.result=function(e,t,n){var r=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++r9007199254740991)return[];var n=4294967295,r=an(e,4294967295);e-=4294967295;for(var i=Nt(r,t=Ji(t));++n=o)return e;var s=n-zt(r);if(s<1)return r;var u=a?si(a,0,s).join(""):e.slice(0,s);if(void 0===i)return u+r;if(a&&(s+=u.length-s),Ja(i)){if(e.slice(s).search(i)){var c,l=u;for(i.global||(i=ye(i.source,ss(ne.exec(i))+"g")),i.lastIndex=0;c=i.exec(l);)var h=c.index;u=u.slice(0,void 0===h?s:h)}}else if(e.indexOf($r(i),s)!=s){var d=u.lastIndexOf(i);d>-1&&(u=u.slice(0,d))}return u+r},In.unescape=function(e){return(e=ss(e))&&P.test(e)?e.replace(D,qt):e},In.uniqueId=function(e){var t=++Ee;return ss(e)+t},In.upperCase=Fs,In.upperFirst=Bs,In.each=sa,In.eachRight=ua,In.first=Do,Xs(In,(au={},sr(In,function(e,t){Se.call(In.prototype,t)||(au[t]=e)}),au),{chain:!1}),In.VERSION="4.17.19",it(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){In[e].placeholder=In}),it(["drop","take"],function(e,t){On.prototype[e]=function(n){n=void 0===n?1:on(rs(n),0);var r=this.__filtered__&&!t?new On(this):this.clone();return r.__filtered__?r.__takeCount__=an(n,r.__takeCount__):r.__views__.push({size:an(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},On.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),it(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;On.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ji(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),it(["head","last"],function(e,t){var n="take"+(t?"Right":"");On.prototype[e]=function(){return this[n](1).value()[0]}}),it(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");On.prototype[e]=function(){return this.__filtered__?new On(this):this[n](1)}}),On.prototype.compact=function(){return this.filter(Ws)},On.prototype.find=function(e){return this.filter(e).head()},On.prototype.findLast=function(e){return this.reverse().find(e)},On.prototype.invokeMap=Cr(function(e,t){return"function"==typeof e?new On(this):this.map(function(n){return vr(n,e,t)})}),On.prototype.reject=function(e){return this.filter(Ea(Ji(e)))},On.prototype.slice=function(e,t){e=rs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new On(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=rs(t))<0?n.dropRight(-t):n.take(t-e)),n)},On.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},On.prototype.toArray=function(){return this.take(4294967295)},sr(On.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=In[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);i&&(In.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,s=t instanceof On,u=a[0],c=s||La(t),l=function(e){var t=i.apply(In,ht([e],a));return r&&h?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(s=c=!1);var h=this.__chain__,d=!!this.__actions__.length,f=o&&!h,p=s&&!d;if(!o&&c){t=p?t:new On(this);var g=e.apply(t,a);return g.__actions__.push({func:na,args:[l],thisArg:void 0}),new kn(g,h)}return f&&p?e.apply(this,a):(g=this.thru(l),f?r?g.value()[0]:g.value():g)})}),it(["pop","push","shift","sort","splice","unshift"],function(e){var t=be[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);In.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(La(i)?i:[],e)}return this[n](function(n){return t.apply(La(n)?n:[],e)})}}),sr(On.prototype,function(e,t){var n=In[t];if(n){var r=n.name+"";Se.call(mn,r)||(mn[r]=[]),mn[r].push({name:t,func:n})}}),mn[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],On.prototype.clone=function(){var e=new On(this.__wrapped__);return e.__actions__=gi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=gi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=gi(this.__views__),e},On.prototype.reverse=function(){if(this.__filtered__){var e=new On(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},On.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=La(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},In.prototype.plant=function(e){for(var t,n=this;n instanceof An;){var r=To(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},In.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof On){var t=e;return this.__actions__.length&&(t=new On(this)),(t=t.reverse()).__actions__.push({func:na,args:[Vo],thisArg:void 0}),new kn(t,this.__chain__)}return this.thru(Vo)},In.prototype.toJSON=In.prototype.valueOf=In.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},In.prototype.first=In.prototype.head,St&&(In.prototype[St]=function(){return this}),In}();qe._=Kt,void 0===(r=(function(){return Kt}).call(t,n,t,e))||(e.exports=r)}).call(this)}).call(this,n("YuTi")(e))},PDru:function(e,t){var n="undefined"!=typeof ArrayBuffer,r="undefined"!=typeof Symbol;function i(e,t){var i,o,a,s,u;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof t)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||n&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(a=0,s=e.length;a0)throw new Error("Parser error")}}function s(e,t,n){var r="";return 0!==e&&(""!==n?r+=e<0?" - ":" + ":e<0&&(r+="-"),1===(e=Math.abs(e))&&""!==t||(r+=e),r+=t),r}function u(e,t,n,r){if(!(this instanceof u))return new u(e,t,n,r);a(this,e,t,n,r)}u.prototype={w:1,x:0,y:0,z:0,add:function(e,t,n,r){return a(o,e,t,n,r),new u(this.w+o.w,this.x+o.x,this.y+o.y,this.z+o.z)},sub:function(e,t,n,r){return a(o,e,t,n,r),new u(this.w-o.w,this.x-o.x,this.y-o.y,this.z-o.z)},neg:function(){return new u(-this.w,-this.x,-this.y,-this.z)},norm:function(){var e=this.w,t=this.x,n=this.y,r=this.z;return Math.sqrt(e*e+t*t+n*n+r*r)},normSq:function(){var e=this.w,t=this.x,n=this.y,r=this.z;return e*e+t*t+n*n+r*r},normalize:function(){var e=this.w,t=this.x,n=this.y,r=this.z,i=Math.sqrt(e*e+t*t+n*n+r*r);return i=0)return new u(Math.pow(s,o.w),0,0,0);if(0===s)switch(o.w%4){case 0:return new u(Math.pow(c,o.w),0,0,0);case 1:return new u(0,Math.pow(c,o.w),0,0);case 2:return new u(-Math.pow(c,o.w),0,0,0);case 3:return new u(0,-Math.pow(c,o.w),0,0)}}return s=Math.exp(o.w*h-o.x*l),c=o.x*h+o.w*l,new u(s*Math.cos(c),s*Math.sin(c),0,0)}}return this.log().mul(o).exp()},equals:function(e,t,n,r){a(o,e,t,n,r);var i=u.EPSILON;return Math.abs(o.w-this.w).9995)return function(e){return new u(i+e*(h-i),s+e*(d-s),c+e*(f-c),l+e*(p-l)).normalize()};var y=Math.acos(g),v=Math.sin(y);return function(e){var t=y*e,n=Math.sin(t),r=Math.cos(t)-g*n/v,o=n/v;return new u(r*i+o*h,r*s+o*d,r*c+o*f,r*l+o*p)}}},u.ZERO=new u(0,0,0,0),u.ONE=new u(1,0,0,0),u.I=new u(0,1,0,0),u.J=new u(0,0,1,0),u.K=new u(0,0,0,1),u.EPSILON=1e-16,u.fromAxisAngle=function(e,t){var n=.5*t,r=e[0],i=e[1],o=e[2],a=Math.sin(n),s=Math.cos(n),c=a/Math.sqrt(r*r+i*i+o*o);return new u(s,r*c,i*c,o*c)},u.fromBetweenVectors=function(e,t){var n=e[0],r=e[1],i=e[2],o=t[0],a=t[1],s=t[2],c=n*o+r*a+i*s,l=r*s-i*a,h=i*o-n*s,d=n*a-r*o;return new u(c+Math.sqrt(c*c+l*l+h*h+d*d),l,h,d).normalize()},u.fromEuler=function(e,t,n,r){var i=.5*t,o=.5*n,a=.5*e,s=Math.cos(i),c=Math.cos(o),l=Math.cos(a),h=Math.sin(i),d=Math.sin(o),f=Math.sin(a);return void 0===r||"ZXY"===r?new u(s*c*l-h*d*f,h*c*l-s*d*f,s*d*l+h*c*f,s*c*f+h*d*l):"XYZ"===r?new u(s*c*l-h*d*f,h*c*l+s*d*f,s*d*l-h*c*f,s*c*f+h*d*l):"YXZ"===r?new u(s*c*l+h*d*f,h*c*l+s*d*f,s*d*l-h*c*f,s*c*f-h*d*l):"ZYX"===r?new u(s*c*l+h*d*f,h*c*l-s*d*f,s*d*l+h*c*f,s*c*f-h*d*l):"YZX"===r?new u(s*c*l-h*d*f,h*c*l+s*d*f,s*d*l+h*c*f,s*c*f-h*d*l):"XZY"===r?new u(s*c*l+h*d*f,h*c*l-s*d*f,s*d*l-h*c*f,s*c*f+h*d*l):null},void 0===(r=(function(){return u}).apply(t,[]))||(e.exports=r)}()},YuTi:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},cTvG:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n("FZPO");class i{fromRdf(e,t){const n=parseFloat(e.value);return t&&isNaN(n)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return t=t||n.namedNode(i.TYPES[0]),isNaN(e)?n.literal("NaN",t):isFinite(e)?e%1==0?null:n.literal(e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),t):n.literal(e>0?"INF":"-INF",t)}}t.TypeHandlerNumberDouble=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},g5aj:function(e,t,n){var r=n("04/w"),i=n("PDru");function o(){this.clear()}o.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},o.prototype.enqueue=function(e){return this.items.push(e),++this.size},o.prototype.dequeue=function(){if(this.size){var e=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,e}},o.prototype.peek=function(){if(this.size)return this.items[this.offset]},o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.offset,r=0,i=this.items.length;n=e.length)return{done:!0};var n=e[t];return t++,{value:n,done:!1}})},o.prototype.entries=function(){var e=this.items,t=this.offset,n=0;return new r(function(){if(t>=e.length)return{done:!0};var r=e[t];return t++,{value:[n++,r],done:!1}})},"undefined"!=typeof Symbol&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.toString=function(){return this.toArray().join(",")},o.prototype.toJSON=function(){return this.toArray()},o.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:o,enumerable:!1}),e},"undefined"!=typeof Symbol&&(o.prototype[Symbol.for("nodejs.util.inspect.custom")]=o.prototype.inspect),o.from=function(e){var t=new o;return i(e,function(e){t.enqueue(e)}),t},o.of=function(){return o.from(arguments)},e.exports=o},"l/hW":function(e,t,n){"use strict";e.exports=function(e){const t=e[0],n=e[1],r=e[2],i=e[3];return[Math.atan2(2*(t*n+r*i),1-2*(n*n+r*r)),Math.asin(2*(t*r-i*n)),Math.atan2(2*(t*i+n*r),1-2*(r*r+i*i))]}},m5Kp:function(e,t,n){var r=n("PPGm");e.exports=r},mMj5:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n("FZPO");class i{fromRdf(e,t){const n=parseInt(e.value,10);return t&&(isNaN(n)||e.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(String(e),t||n.namedNode(e<=i.MAX_INT&&e>=i.MIN_INT?i.TYPES[0]:i.TYPES[1]))}}t.TypeHandlerNumberInteger=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648},mtbl:function(e,t,n){var r=n("tXxl"),i=n("g5aj"),o=n("x4yT");function a(e,t,n){if(!r(e))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!e.hasNode(t))throw new Error('graphology-shortest-path: the "'+t+'" source node does not exist in the given graph.');if(!e.hasNode(n))throw new Error('graphology-shortest-path: the "'+n+'" target node does not exist in the given graph.');if((t=""+t)==(n=""+n))return[t];var i=e.inboundNeighbors.bind(e),o=e.outboundNeighbors.bind(e),a={},s={};a[t]=null,s[n]=null;var u,c,l,h,d,f,p,g,y=[t],v=[n],m=!1;e:for(;y.length&&v.length;)if(y.length<=v.length){for(u=y,y=[],d=0,p=u.length;d=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function t(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 r(e){for(var r=1;r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){s=!0,a=e}),f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function x(e,t){if(e){if("string"==typeof e)return k(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)?k(e,t):void 0}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?{done:!0}:{done:!1,value:e[n++]}})},r.empty=function(){var e=new r(null);return e.done=!0,e},r.is=function(e){return e instanceof r||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=r},"12xR":function(e,t){function r(){this.value=""}r.prototype.equals=function(e){return!!e&&e.termType===this.termType},r.prototype.termType="DefaultGraph",e.exports=r},"4cw7":function(e,t,r){var n=r("12xR");function i(e,t,r,i){this.subject=e,this.predicate=t,this.object=r,this.graph=i||new n}i.prototype.equals=function(e){return!!e&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)},e.exports=i},"6smP":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){S(this,e)}return j(e,[{key:"fromRdf",value:function(e){return e.value}},{key:"toRdf",value:function(e,t){var r=t.datatype;return t.dataFactory.literal(e,r)}}]),e}();t.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},"8Xj3":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("FZPO"),i=function(){function e(){S(this,e)}return j(e,[{key:"fromRdf",value:function(e,t){switch(e.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return t&&n.Translator.incorrectRdfDataType(e),!1}},{key:"toRdf",value:function(t,r){var n=r.datatype,i=r.dataFactory;return i.literal(t?"true":"false",n||i.namedNode(e.TYPE))}}]),e}();t.TypeHandlerBoolean=i,i.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},Eagr:function(e,t){function r(e){this.value=e}r.prototype.equals=function(e){return!!e&&e.termType===this.termType&&e.value===this.value},r.prototype.termType="NamedNode",e.exports=r},FZPO:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=function(){function e(){S(this,e),this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}return j(e,[{key:"registerHandler",value:function(e,t,r){var n,i=w(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;this.supportedRdfDatatypes.push(a),this.fromRdfHandlers[a.value]=e}}catch(l){i.e(l)}finally{i.f()}var o,s=w(r);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=this.toRdfHandlers[u];c||(this.toRdfHandlers[u]=c=[]),c.push(e)}}catch(l){s.e(l)}finally{s.f()}}},{key:"fromRdf",value:function(e,t){var r=this.fromRdfHandlers[e.datatype.value];return r?r.fromRdf(e,t):e.value}},{key:"toRdf",value:function(e,t){var r=this.toRdfHandlers[typeof e];if(r){var n,i=w(r);try{for(i.s();!(n=i.n()).done;){var a=n.value.toRdf(e,t);if(a)return a}}catch(o){i.e(o)}finally{i.f()}}throw new Error("Invalid JavaScript value: '".concat(e,"'"))}},{key:"getSupportedRdfDatatypes",value:function(){return this.supportedRdfDatatypes}},{key:"getSupportedJavaScriptPrimitives",value:function(){return Object.keys(this.toRdfHandlers)}}],[{key:"incorrectRdfDataType",value:function(e){throw new Error("Invalid RDF ".concat(e.datatype.value," value: '").concat(e.value,"'"))}}]),e}()},HXBs:function(e,t,r){e.exports=function(){"use strict";function e(t){return(e="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})(t)}function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function a(e,t,r){return(a=i()?Reflect.construct:function(e,t,r){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return r&&n(a,r.prototype),a}).apply(null,arguments)}function o(e){var t="function"==typeof Map?new Map:void 0;return(o=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return a(e,arguments,r(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),n(i,e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(){for(var e=arguments[0]||{},t=1,r=arguments.length;t0&&o.length>i){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,"function"==typeof console.warn?console.warn(s):console.log(s)}}else o=a[t]=r,++e._eventsCount;return e}function S(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function E(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function j(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function I(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}v.prototype=Object.create(null),g.EventEmitter=g,g.usingDomains=!1,g.prototype.domain=void 0,g.prototype._events=void 0,g.prototype._maxListeners=void 0,g.defaultMaxListeners=10,g.init=function(){this.domain=null,g.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new v,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},g.prototype.getMaxListeners=function(){return y(this)},g.prototype.emit=function(e){var t,r,n,i,a,o,s,u="error"===e;if(o=this._events)u=u&&null==o.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=o[e]))return!1;var l="function"==typeof r;switch(n=arguments.length){case 1:b(r,l,this);break;case 2:m(r,l,this,arguments[1]);break;case 3:_(r,l,this,arguments[1],arguments[2]);break;case 4:w(r,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),a=1;a0;)if(r[a]===t||r[a].listener&&r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new v,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n0?Reflect.ownKeys(this._events):[]},I.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(I.prototype[Symbol.iterator]=function(){return this}),I.of=function(){var e=arguments,t=e.length,r=0;return new I(function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}})},I.empty=function(){var e=new I(null);return e.done=!0,e},I.is=function(e){return e instanceof I||"object"==typeof e&&null!==e&&"function"==typeof e.next};var N=I,T=function(e,t){for(var r,n=arguments.length>1?t:1/0,i=n!==1/0?new Array(n):[],a=0;;){if(a===n)return i;if((r=e.next()).done)return a!==t?i.slice(0,a):i;i[a++]=r.value}},A=function(e){function r(t,r){var n;return(n=e.call(this)||this).name="GraphError",n.message=t||"",n.data=r||{},n}return t(r,e),r}(o(Error)),R=function(e){function r(t,n){var i;return(i=e.call(this,t,n)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),r.prototype.constructor),i}return t(r,e),r}(A),O=function(e){function r(t,n){var i;return(i=e.call(this,t,n)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),r.prototype.constructor),i}return t(r,e),r}(A),L=function(e){function r(t,n){var i;return(i=e.call(this,t,n)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),r.prototype.constructor),i}return t(r,e),r}(A);function M(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function D(e,t){this.key=e,this.attributes=t||{},this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function C(e,t){this.key=e,this.attributes=t||{},this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function P(e,t,r,n,i){this.key=e,this.attributes=i,this.source=r,this.target=n,this.generatedKey=t}function F(e,t,r,n,i){this.key=e,this.attributes=i,this.source=r,this.target=n,this.generatedKey=t}function B(e,t,r,n,i,a,o){var s=e.multi,u=t?"undirected":"out",c=t?"undirected":"in",l=a[u][i];void 0===l&&(l=s?new Set:r,a[u][i]=l),s&&l.add(r),n!==i&&void 0===o[c][n]&&(o[c][n]=l)}function U(e,t,r){var n=e.multi,i=r.source,a=r.target,o=i.key,s=a.key,u=i[t?"undirected":"out"],c=t?"undirected":"in";if(s in u)if(n){var l=u[s];1===l.size?(delete u[s],delete a[c][o]):l.delete(r)}else delete u[s];n||delete a[c][o]}D.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},C.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var G=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i){var a;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,s=""+i;if(i=arguments[2],!(a=c(this,o,s,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(s,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==r&&!(a instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return a.attributes[i]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,r,n){e.prototype[t]=function(e){var i;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,o=""+arguments[1];if(!(i=c(this,a,o,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==r&&!(i instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return i.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i){var a;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,s=""+i;if(i=arguments[2],!(a=c(this,o,s,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(s,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==r&&!(a instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return a.attributes.hasOwnProperty(i)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i,a){var o;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+e,u=""+i;if(i=arguments[2],a=arguments[3],!(o=c(this,s,u,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').concat(u,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==r&&!(o instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return o.attributes[i]=a,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",meta:{name:i,value:a}}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i,a){var o;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+e,u=""+i;if(i=arguments[2],a=arguments[3],!(o=c(this,s,u,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').concat(u,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof a)throw new R("Graph.".concat(t,": updater should be a function."));if("mixed"!==r&&!(o instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return o.attributes[i]=a(o.attributes[i]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",meta:{name:i,value:o.attributes[i]}}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i){var a;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,s=""+i;if(i=arguments[2],!(a=c(this,o,s,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(s,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==r&&!(a instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return delete a.attributes[i],this.emit("edgeAttributesUpdated",{key:a.key,type:"remove",meta:{name:i}}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i){var a;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,s=""+i;if(i=arguments[2],!(a=c(this,o,s,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(s,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!f(i))throw new R("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==r&&!(a instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));var u=a.attributes;return a.attributes=i,this.emit("edgeAttributesUpdated",{key:a.key,type:"replace",meta:{before:u,after:i}}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i){var a;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,s=""+i;if(i=arguments[2],!(a=c(this,o,s,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(s,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!f(i))throw new R("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==r&&!(a instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return u(a.attributes,i),this.emit("edgeAttributesUpdated",{key:a.key,type:"merge",meta:{data:i}}),this}}}],z=function(){var e,t=arguments,r=-1;return new N(function n(){if(!e){if(++r>=t.length)return{done:!0};e=t[r]}var i=e.next();return i.done?(e=null,n()):i})},V=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function q(e,t){for(var r in t)t[r]instanceof Set?t[r].forEach(function(t){return e.push(t.key)}):e.push(t[r].key)}function K(e,t){for(var r in e){var n=e[r];t(n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes)}}function W(e,t){for(var r in e)e[r].forEach(function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)})}function H(e){var t=Object.keys(e),r=t.length,n=null,i=0;return new N(function a(){var o;if(n){var s=n.next();if(s.done)return n=null,i++,a();o=s.value}else{if(i>=r)return{done:!0};if((o=e[t[i]])instanceof Set)return n=o.values(),a();i++}return{done:!1,value:[o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes]}})}function J(e,t,r){r in t&&(t[r]instanceof Set?t[r].forEach(function(t){return e.push(t.key)}):e.push(t[r].key))}function X(e,t,r){if(t in e)if(e[t]instanceof Set)e[t].forEach(function(e){return r(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)});else{var n=e[t];r(n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes)}}function Q(e,t){var r=e[t];if(r instanceof Set){var n=r.values();return new N(function(){var e=n.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}})}return N.of([r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes])}function Y(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return T(e._edges.keys(),e._edges.size);var r=new Array("undirected"===t?e.undirectedSize:e.directedSize),n="undirected"===t,i=0;return e._edges.forEach(function(e,t){e instanceof F===n&&(r[i++]=t)}),r}function Z(e,t,r){if(0!==e.size)if("mixed"===t||t===e.type)e._edges.forEach(function(e,t){var n=e.source,i=e.target;r(t,e.attributes,n.key,i.key,n.attributes,i.attributes)});else{var n="undirected"===t;e._edges.forEach(function(e,t){if(e instanceof F===n){var i=e.source,a=e.target;r(t,e.attributes,i.key,a.key,i.attributes,a.attributes)}})}}function $(e,t){return 0===e.size?N.empty():"mixed"===t?(r=e._edges.values(),new N(function(){var e=r.next();if(e.done)return e;var t=e.value;return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}})):(r=e._edges.values(),new N(function e(){var n=r.next();if(n.done)return n;var i=n.value;return i instanceof F==("undirected"===t)?{value:[i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes],done:!1}:e()}));var r}function ee(e,t,r){var n=[];return"undirected"!==e&&("out"!==t&&q(n,r.in),"in"!==t&&q(n,r.out)),"directed"!==e&&q(n,r.undirected),n}function te(e,t,r,n,i){var a=e?W:K;"undirected"!==t&&("out"!==r&&a(n.in,i),"in"!==r&&a(n.out,i)),"directed"!==t&&a(n.undirected,i)}function re(e,t,r){var n=N.empty();return"undirected"!==e&&("out"!==t&&void 0!==r.in&&(n=z(n,H(r.in))),"in"!==t&&void 0!==r.out&&(n=z(n,H(r.out)))),"directed"!==e&&void 0!==r.undirected&&(n=z(n,H(r.undirected))),n}function ne(e,t,r,n){var i=[];return"undirected"!==e&&(void 0!==r.in&&"out"!==t&&J(i,r.in,n),void 0!==r.out&&"in"!==t&&J(i,r.out,n)),"directed"!==e&&void 0!==r.undirected&&J(i,r.undirected,n),i}function ie(e,t,r,n,i){"undirected"!==e&&(void 0!==r.in&&"out"!==t&&X(r.in,n,i),void 0!==r.out&&"in"!==t&&X(r.out,n,i)),"directed"!==e&&void 0!==r.undirected&&X(r.undirected,n,i)}function ae(e,t,r,n){var i=N.empty();return"undirected"!==e&&(void 0!==r.in&&"out"!==t&&n in r.in&&(i=z(i,Q(r.in,n))),void 0!==r.out&&"in"!==t&&n in r.out&&(i=z(i,Q(r.out,n)))),"directed"!==e&&void 0!==r.undirected&&n in r.undirected&&(i=z(i,Q(r.undirected,n))),i}var oe=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function se(e,t){if(void 0!==t)for(var r in t)e.add(r)}function ue(e,t,r){if("mixed"!==e){if("undirected"===e)return Object.keys(r.undirected);if("string"==typeof t)return Object.keys(r[t])}var n=new Set;return"undirected"!==e&&("out"!==t&&se(n,r.in),"in"!==t&&se(n,r.out)),"directed"!==e&&se(n,r.undirected),T(n.values(),n.size)}function ce(e,t,r){for(var n in t){var i=t[n];i instanceof Set&&(i=i.values().next().value);var a=i.source,o=a===e?i.target:a;r(o.key,o.attributes)}}function le(e,t,r,n){for(var i in r){var a=r[i];a instanceof Set&&(a=a.values().next().value);var o=a.source,s=o===t?a.target:o;e.has(s.key)||(e.add(s.key),n(s.key,s.attributes))}}function fe(e,t){var r=Object.keys(t),n=r.length,i=0;return new N(function(){if(i>=n)return{done:!0};var a=t[r[i++]];a instanceof Set&&(a=a.values().next().value);var o=a.source,s=o===e?a.target:o;return{done:!1,value:[s.key,s.attributes]}})}function he(e,t,r){var n=Object.keys(r),i=n.length,a=0;return new N(function o(){if(a>=i)return{done:!0};var s=r[n[a++]];s instanceof Set&&(s=s.values().next().value);var u=s.source,c=u===t?s.target:u;return e.has(c.key)?o():(e.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function de(e,t,r,n,i){var a=e._nodes.get(n);if("undirected"!==t){if("out"!==r&&void 0!==a.in)for(var o in a.in)if(o===i)return!0;if("in"!==r&&void 0!==a.out)for(var s in a.out)if(s===i)return!0}if("directed"!==t&&void 0!==a.undirected)for(var u in a.undirected)if(u===i)return!0;return!1}function pe(e,t){var r={key:e};return Object.keys(t.attributes).length&&(r.attributes=u({},t.attributes)),r}function ve(e,t){var r={source:t.source.key,target:t.target.key};return t.generatedKey||(r.key=e),Object.keys(t.attributes).length&&(r.attributes=u({},t.attributes)),t instanceof F&&(r.undirected=!0),r}function ge(e){return f(e)?"key"in e?!("attributes"in e)||f(e.attributes)&&null!==e.attributes?null:"invalid-attributes":"no-key":"not-object"}function ye(e){return f(e)?"source"in e?"target"in e?!("attributes"in e)||f(e.attributes)&&null!==e.attributes?"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var be=new Set(["directed","undirected","mixed"]),me=new Set(["domain","_events","_eventsCount","_maxListeners"]),_e={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function we(e,t,r,n,i,a,o,s){if(!n&&"undirected"===e.type)throw new L("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(n&&"directed"===e.type)throw new L("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!f(s))throw new R("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(a=""+a,o=""+o,s=s||{},!e.allowSelfLoops&&a===o)throw new L("Graph.".concat(t,': source & target are the same ("').concat(a,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var u=e._nodes.get(a),c=e._nodes.get(o);if(!u)throw new O("Graph.".concat(t,': source node "').concat(a,'" not found.'));if(!c)throw new O("Graph.".concat(t,': target node "').concat(o,'" not found.'));var l={key:null,undirected:n,source:a,target:o,attributes:s};if(r&&(i=e._edgeKeyGenerator(l)),e._edges.has(i=""+i))throw new L("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));if(!e.multi&&(n?void 0!==u.undirected[o]:void 0!==u.out[o]))throw new L("Graph.".concat(t,': an edge linking "').concat(a,'" to "').concat(o,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var h=new(n?F:P)(i,r,u,c,s);return e._edges.set(i,h),a===o?n?u.undirectedSelfLoops++:u.directedSelfLoops++:n?(u.undirectedDegree++,c.undirectedDegree++):(u.outDegree++,c.inDegree++),B(e,n,h,a,o,u,c),n?e._undirectedSize++:e._directedSize++,l.key=i,e.emit("edgeAdded",l),i}function xe(e,t,r,n,i,a,o,s){if(!n&&"undirected"===e.type)throw new L("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(n&&"directed"===e.type)throw new L("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!f(s))throw new R("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(a=""+a,o=""+o,s=s||{},!e.allowSelfLoops&&a===o)throw new L("Graph.".concat(t,': source & target are the same ("').concat(a,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var l,h,d=e._nodes.get(a),p=e._nodes.get(o),v=null;if(!r&&(l=e._edges.get(i))){if(l.source!==a||l.target!==o||n&&(l.source!==o||l.target!==a))throw new L("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(a,'" source & "').concat(o,'" target vs. (').concat(l.source,", ").concat(l.target,")."));v=i}if(v||e.multi||!d||(n?void 0===d.undirected[o]:void 0===d.out[o])||(h=c(e,a,o,n?"undirected":"directed")),h)return s?(u(h.attributes,s),v):v;var g={key:null,undirected:n,source:a,target:o,attributes:s};if(r&&(i=e._edgeKeyGenerator(g)),e._edges.has(i=""+i))throw new L("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));return d||(e.addNode(a),d=e._nodes.get(a),a===o&&(p=d)),p||(e.addNode(o),p=e._nodes.get(o)),l=new(n?F:P)(i,r,d,p,s),e._edges.set(i,l),a===o?n?d.undirectedSelfLoops++:d.directedSelfLoops++:n?(d.undirectedDegree++,p.undirectedDegree++):(d.outDegree++,p.inDegree++),B(e,n,l,a,o,d,p),n?e._undirectedSize++:e._directedSize++,g.key=i,e.emit("edgeAdded",g),i}var ke=function(e){function r(t){var r;if(r=e.call(this)||this,(t=u({},_e,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new R("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new R("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!be.has(t.type))throw new R('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new R("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var n,i="mixed"===t.type?M:"directed"===t.type?D:C;return d(s(r),"NodeDataClass",i),d(s(r),"_attributes",{}),d(s(r),"_nodes",new Map),d(s(r),"_edges",new Map),d(s(r),"_directedSize",0),d(s(r),"_undirectedSize",0),d(s(r),"_edgeKeyGenerator",t.edgeKeyGenerator||(n=0,function(){return"_geid".concat(n++,"_")})),d(s(r),"_options",t),me.forEach(function(e){return d(s(r),e,r[e])}),p(s(r),"order",function(){return r._nodes.size}),p(s(r),"size",function(){return r._edges.size}),p(s(r),"directedSize",function(){return r._directedSize}),p(s(r),"undirectedSize",function(){return r._undirectedSize}),p(s(r),"multi",r._options.multi),p(s(r),"type",r._options.type),p(s(r),"allowSelfLoops",r._options.allowSelfLoops),r}t(r,e);var n=r.prototype;return n.hasNode=function(e){return this._nodes.has(""+e)},n.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var r=this._edges.get(""+e);return!!r&&r instanceof P}if(2===arguments.length){t=""+t;var n=this._nodes.get(e=""+e);if(!n)return!1;var i=n.out[t];return!(!i||this.multi&&!i.size)}throw new R("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},n.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var r=this._edges.get(""+e);return!!r&&r instanceof F}if(2===arguments.length){t=""+t;var n=this._nodes.get(e=""+e);if(!n)return!1;var i=n.undirected[t];return!(!i||this.multi&&!i.size)}throw new R("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},n.hasEdge=function(e,t){if(1===arguments.length)return this._edges.has(""+e);if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var n=void 0!==r.out&&r.out[t];return n||(n=void 0!==r.undirected&&r.undirected[t]),!(!n||this.multi&&!n.size)}throw new R("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},n.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new L("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var r=this._nodes.get(e);if(!r)throw new O('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new O('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var n=r.out&&r.out[t]||void 0;return n?n.key:void 0}},n.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new L("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var r=this._nodes.get(e);if(!r)throw new O('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new O('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var n=r.undirected&&r.undirected[t]||void 0;return n?n.key:void 0}},n.edge=function(e,t){if(this.multi)throw new L("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t;var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new O('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var n=r.out&&r.out[t]||r.undirected&&r.undirected[t]||void 0;if(n)return n.key},n.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new R('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:r.inDegree+(t?r.directedSelfLoops:0)},n.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new R('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:r.outDegree+(t?r.directedSelfLoops:0)},n.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new R('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(!this.hasNode(e=""+e))throw new O('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:this.inDegree(e,t)+this.outDegree(e,t)},n.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new R('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(!this.hasNode(e=""+e))throw new O('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));if("directed"===this.type)return 0;var r=this._nodes.get(e);return r.undirectedDegree+(t?2*r.undirectedSelfLoops:0)},n.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new R('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(!this.hasNode(e=""+e))throw new O('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var r=0;return"undirected"!==this.type&&(r+=this.directedDegree(e,t)),"directed"!==this.type&&(r+=this.undirectedDegree(e,t)),r},n.source=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},n.target=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},n.extremities=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},n.opposite=function(e,t){if(t=""+t,!this._nodes.has(e=""+e))throw new O('Graph.opposite: could not find the "'.concat(e,'" node in the graph.'));var r=this._edges.get(t);if(!r)throw new O('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var n=r.source.key,i=r.target.key;if(e!==n&&e!==i)throw new O('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(n,", ").concat(i,")."));return e===n?i:n},n.undirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.undirected: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof F},n.directed=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.directed: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof P},n.selfLoop=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.selfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},n.addNode=function(e,t){if(t&&!f(t))throw new R('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));if(t=t||{},this._nodes.has(e=""+e))throw new L('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var r=new this.NodeDataClass(e,t);return this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:t}),e},n.mergeNode=function(e,t){if(t&&!f(t))throw new R('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));t=t||{};var r=this._nodes.get(e=""+e);return r?(t&&u(r.attributes,t),e):(r=new this.NodeDataClass(e,t),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:t}),e)},n.dropNode=function(e){if(!this.hasNode(e=""+e))throw new O('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));for(var t=this.edges(e),r=0,n=t.length;r1){var r=""+arguments[0],n=""+arguments[1];if(!(t=c(this,r,n,this.type)))throw new O('Graph.dropEdge: could not find the "'.concat(r,'" -> "').concat(n,'" edge in the graph.'))}else if(!(t=this._edges.get(e=""+e)))throw new O('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var i=t.source,a=t.target,o=t.attributes,s=t instanceof F;return i===a?i.selfLoops--:s?(i.undirectedDegree--,a.undirectedDegree--):(i.outDegree--,a.inDegree--),U(this,s,t),s?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:o,source:i.key,target:a.key,undirected:s}),this},n.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},n.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},n.getAttribute=function(e){return this._attributes[e]},n.getAttributes=function(){return this._attributes},n.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},n.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",meta:{name:e,value:t}}),this},n.updateAttribute=function(e,t){if("function"!=typeof t)throw new R("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",meta:{name:e,value:this._attributes[e]}}),this},n.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",meta:{name:e}}),this},n.replaceAttributes=function(e){if(!f(e))throw new R("Graph.replaceAttributes: provided attributes are not a plain object.");var t=this._attributes;return this._attributes=e,this.emit("attributesUpdated",{type:"replace",meta:{before:t,after:e}}),this},n.mergeAttributes=function(e){if(!f(e))throw new R("Graph.mergeAttributes: provided attributes are not a plain object.");return this._attributes=u(this._attributes,e),this.emit("attributesUpdated",{type:"merge",meta:{data:this._attributes}}),this},n.getNodeAttribute=function(e,t){var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return r.attributes[t]},n.getNodeAttributes=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new O('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},n.hasNodeAttribute=function(e,t){var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return r.attributes.hasOwnProperty(t)},n.setNodeAttribute=function(e,t,r){var n=this._nodes.get(e=""+e);if(!n)throw new O('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new R("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return n.attributes[t]=r,this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:r}}),this},n.updateNodeAttribute=function(e,t,r){var n=this._nodes.get(e=""+e);if(!n)throw new O('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new R("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof r)throw new R("Graph.updateAttribute: updater should be a function.");var i=n.attributes;return i[t]=r(i[t]),this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:i[t]}}),this},n.removeNodeAttribute=function(e,t){var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete r.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",meta:{name:t}}),this},n.replaceNodeAttributes=function(e,t){var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!f(t))throw new R("Graph.replaceNodeAttributes: provided attributes are not a plain object.");var n=r.attributes;return r.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",meta:{before:n,after:t}}),this},n.mergeNodeAttributes=function(e,t){var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!f(t))throw new R("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return u(r.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",meta:{data:t}}),this},n.forEach=function(e){if("function"!=typeof e)throw new R("Graph.forEach: expecting a callback.");this._edges.forEach(function(t,r){var n=t.source,i=t.target;e(n.key,i.key,n.attributes,i.attributes,r,t.attributes)})},n.adjacency=function(){var e=this._edges.values();return new N(function(){var t=e.next();if(t.done)return t;var r=t.value,n=r.source,i=r.target;return{done:!1,value:[n.key,i.key,n.attributes,i.attributes,r.key,r.attributes]}})},n.nodes=function(){return T(this._nodes.keys(),this._nodes.size)},n.forEachNode=function(e){if("function"!=typeof e)throw new R("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(t,r){e(r,t.attributes)})},n.nodeEntries=function(){var e=this._nodes.values();return new N(function(){var t=e.next();if(t.done)return t;var r=t.value;return{value:[r.key,r.attributes],done:!1}})},n.exportNode=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new O('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return pe(e,t)},n.exportEdge=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return ve(e,t)},n.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach(function(r,n){e[t++]=pe(n,r)});var r=new Array(this._edges.size);return t=0,this._edges.forEach(function(e,n){r[t++]=ve(n,e)}),{attributes:this.getAttributes(),nodes:e,edges:r}},n.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=ge(e);if(r){if("not-object"===r)throw new R('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===r)throw new R("Graph.importNode: no key provided.");if("invalid-attributes"===r)throw new R("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var n=e.key,i=e.attributes,a=void 0===i?{}:i;return t?this.mergeNode(n,a):this.addNode(n,a),this},n.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=ye(e);if(r){if("not-object"===r)throw new R('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===r)throw new R("Graph.importEdge: missing souce.");if("no-target"===r)throw new R("Graph.importEdge: missing target.");if("invalid-attributes"===r)throw new R("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===r)throw new R("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var n=e.source,i=e.target,a=e.attributes,o=void 0===a?{}:a,s=e.undirected,u=void 0!==s&&s;return"key"in e?(t?u?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:u?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,n,i,o):(t?u?this.mergeUndirectedEdge:this.mergeDirectedEdge:u?this.addUndirectedEdge:this.addDirectedEdge).call(this,n,i,o),this},n.import=function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l(e))return this.import(e.export(),r),this;if(!f(e))throw new R("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!f(e.attributes))throw new R("Graph.import: invalid attributes. Expecting a plain object.");r?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}return e.nodes&&e.nodes.forEach(function(e){return t.importNode(e,r)}),e.edges&&e.edges.forEach(function(e){return t.importEdge(e,r)}),this},n.nullCopy=function(e){return new r(u({},this._options,e))},n.emptyCopy=function(e){var t=new r(u({},this._options,e));return this._nodes.forEach(function(e,r){e=new t.NodeDataClass(r,u({},e.attributes)),t._nodes.set(r,e)}),t},n.copy=function(){var e=new r(this._options);return e.import(this),e},n.upgradeToMixed=function(){return"mixed"===this.type||(this._nodes.forEach(function(e){return e.upgradeToMixed()}),this._options.type="mixed",p(this,"type",this._options.type),d(this,"NodeDataClass",M)),this},n.upgradeToMulti=function(){return this.multi||(this._options.multi=!0,p(this,"multi",!0),(e=this)._nodes.forEach(function(t,r){if(t.out)for(var n in t.out){var i=new Set;i.add(t.out[n]),t.out[n]=i,e._nodes.get(n).in[r]=i}if(t.undirected)for(var a in t.undirected)if(!(a>r)){var o=new Set;o.add(t.undirected[a]),t.undirected[a]=o,e._nodes.get(a).undirected[r]=o}})),this;var e},n.clearIndex=function(){return this._nodes.forEach(function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})}),this},n.toJSON=function(){return this.export()},n.toString=function(){var e=this.order>1||0===this.order,t=this.size>1||0===this.size;return"Graph<".concat(h(this.order)," node").concat(e?"s":"",", ").concat(h(this.size)," edge").concat(t?"s":"",">")},n.inspect=function(){var e=this,t={};this._nodes.forEach(function(e,r){t[r]=e.attributes});var r={},n={};this._edges.forEach(function(t,i){var a=t instanceof F?"--":"->",o="",s="(".concat(t.source.key,")").concat(a,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===n[s]?n[s]=0:n[s]++,o+="".concat(n[s],". ")):o+="[".concat(i,"]: "),r[o+=s]=t.attributes});var i={};for(var a in this)this.hasOwnProperty(a)&&!me.has(a)&&"function"!=typeof this[a]&&(i[a]=this[a]);return i.attributes=this._attributes,i.nodes=t,i.edges=r,d(i,"constructor",this.constructor),i},r}(g);"undefined"!=typeof Symbol&&(ke.prototype[Symbol.for("nodejs.util.inspect.custom")]=ke.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(e){["add","merge"].forEach(function(t){var r=e.name(t),n="add"===t?we:xe;ke.prototype[r]=e.generateKey?function(t,i,a){return n(this,r,!0,"undirected"===(e.type||this.type),null,t,i,a)}:function(t,i,a,o){return n(this,r,!1,"undirected"===(e.type||this.type),t,i,a,o)}})}),"undefined"!=typeof Symbol&&(ke.prototype[Symbol.iterator]=ke.prototype.adjacency),function(e){G.forEach(function(t){var r=t.name,n=t.attacher;n(e,r("Edge"),"mixed",P),n(e,r("DirectedEdge"),"directed",P),n(e,r("UndirectedEdge"),"undirected",F)})}(ke),function(e){V.forEach(function(t){!function(e,t){var r=t.name,n=t.type,i=t.direction;e.prototype[r]=function(e,t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return[];if(!arguments.length)return Y(this,n);if(1===arguments.length){var a=this._nodes.get(e=""+e);if(void 0===a)throw new O("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return ee("mixed"===n?this.type:n,i,a)}if(2===arguments.length){t=""+t;var o=this._nodes.get(e=""+e);if(!o)throw new O("Graph.".concat(r,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new O("Graph.".concat(r,': could not find the "').concat(t,'" target node in the graph.'));return ne(n,i,o,t)}throw new R("Graph.".concat(r,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var r=t.name,n=t.type,i=t.direction,a="forEach"+r[0].toUpperCase()+r.slice(1,-1);e.prototype[a]=function(e,t,r){if("mixed"===n||"mixed"===this.type||n===this.type){if(1===arguments.length)return Z(this,n,r=e);if(2===arguments.length){r=t;var o=this._nodes.get(e=""+e);if(void 0===o)throw new O("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return te(this.multi,"mixed"===n?this.type:n,i,o,r)}if(3===arguments.length){t=""+t;var s=this._nodes.get(e=""+e);if(!s)throw new O("Graph.".concat(a,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new O("Graph.".concat(a,': could not find the "').concat(t,'" target node in the graph.'));return ie(n,i,s,t,r)}throw new R("Graph.".concat(a,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var r=t.type,n=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return N.empty();if(!arguments.length)return $(this,r);if(1===arguments.length){var a=this._nodes.get(e=""+e);if(!a)throw new O("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return re(r,n,a)}if(2===arguments.length){t=""+t;var o=this._nodes.get(e=""+e);if(!o)throw new O("Graph.".concat(i,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new O("Graph.".concat(i,': could not find the "').concat(t,'" target node in the graph.'));return ae(r,n,o,t)}throw new R("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)})}(ke),function(e){oe.forEach(function(t){!function(e,t){var r=t.name,n=t.type,i=t.direction;e.prototype[r]=function(e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],a=""+arguments[1];if(!this._nodes.has(t))throw new O("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(a))throw new O("Graph.".concat(r,': could not find the "').concat(a,'" node in the graph.'));return de(this,n,i,t,a)}if(1===arguments.length){var o=this._nodes.get(e=""+e);if(void 0===o)throw new O("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return ue("mixed"===n?this.type:n,i,o)}throw new R("Graph.".concat(r,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var r=t.name,n=t.type,i=t.direction,a="forEach"+r[0].toUpperCase()+r.slice(1,-1);e.prototype[a]=function(e,t){if("mixed"===n||"mixed"===this.type||n===this.type){var r=this._nodes.get(e=""+e);if(void 0===r)throw new O("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,r,n){if("mixed"!==e){if("undirected"===e)return ce(r,r.undirected,n);if("string"==typeof t)return ce(r,r[t],n)}var i=new Set;"undirected"!==e&&("out"!==t&&le(i,r,r.in,n),"in"!==t&&le(i,r,r.out,n)),"directed"!==e&&le(i,r,r.undirected,n)}("mixed"===n?this.type:n,i,r,t)}}}(e,t),function(e,t){var r=t.type,n=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return N.empty();var t=this._nodes.get(e=""+e);if(void 0===t)throw new O("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,r){if("mixed"!==e){if("undirected"===e)return fe(r,r.undirected);if("string"==typeof t)return fe(r,r[t])}var n=N.empty(),i=new Set;return"undirected"!==e&&("out"!==t&&(n=z(n,he(i,r,r.in))),"in"!==t&&(n=z(n,he(i,r,r.out)))),"directed"!==e&&(n=z(n,he(i,r,r.undirected))),n}("mixed"===r?this.type:r,n,t)}}(e,t)})}(ke);var Se=function(e){function r(t){return e.call(this,u({type:"directed"},t))||this}return t(r,e),r}(ke),Ee=function(e){function r(t){return e.call(this,u({type:"undirected"},t))||this}return t(r,e),r}(ke),je=function(e){function r(t){return e.call(this,u({multi:!0},t))||this}return t(r,e),r}(ke),Ie=function(e){function r(t){return e.call(this,u({multi:!0,type:"directed"},t))||this}return t(r,e),r}(ke),Ne=function(e){function r(t){return e.call(this,u({multi:!0,type:"undirected"},t))||this}return t(r,e),r}(ke);function Te(e){e.from=function(t,r){var n=new e(r);return n.import(t),n}}return Te(ke),Te(Se),Te(Ee),Te(je),Te(Ie),Te(Ne),ke.Graph=ke,ke.DirectedGraph=Se,ke.UndirectedGraph=Ee,ke.MultiGraph=je,ke.MultiDirectedGraph=Ie,ke.MultiUndirectedGraph=Ne,ke.InvalidArgumentsGraphError=R,ke.NotFoundGraphError=O,ke.UsageGraphError=L,ke}()},Hj1c:function(e,t,r){"use strict";var n,i,a;function o(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{u(n.next(e))}catch(t){a(t)}}function s(e){try{u(n.throw(e))}catch(t){a(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}u((n=n.apply(e,t||[])).next())})}r.r(t);var s=r("JFj6");function u(e){return(u="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})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function f(e,t,r){return(f=l()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&c(i,r.prototype),i}).apply(null,arguments)}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},r=t.precision,n=void 0===r?m.precision||4:r;return e=_(e),"".concat(parseFloat(e.toPrecision(n)))}function k(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function E(e){return function(e,t){return function(e,t,r){if(k(e)){r=r||((i=e).clone?i.clone():new Array(i.length));for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"";if(m.debug&&!M(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}m.EPSILON=1e-12,m.debug=!1,m.precision=4,m.printTypes=!1,m.printDegrees=!1,m.printRowMajor=!0;var C={};function P(e,t){C[e]||(C[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}function F(e){var t="function"==typeof Map?new Map:void 0;return(F=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return f(e,arguments,A(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)})(e)}var B,U=function(e){function t(){return N(this,t),T(this,A(t).apply(this,arguments))}return L(t,e),O(t,[{key:"toString",value:function(){var e="[";if(m.printRowMajor){e+="row-major:";for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),r=e*this.RANK,n=0;n1&&void 0!==arguments[1]?arguments[1]:0,r=0;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r0?", ":"")+x(this[r],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t2*Math.PI)throw Error("radians");var h=s*Math.tan(n/2),d=h*a;return(new t).ortho({left:-d,right:d,bottom:-h,top:h,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,r=void 0===t?void 0:t,n=e.fov,i=void 0===n?45*Math.PI/180:n,a=e.aspect,o=void 0===a?1:a,s=e.near,u=void 0===s?.1:s,c=e.far,l=void 0===c?500:c;if((r=r||i)>2*Math.PI)throw Error("radians");return q(this,r,o,u,l),this.check()}},{key:"determinant",value:function(){return((t=(e=this)[0])*(o=e[5])-(r=e[1])*(a=e[4]))*((f=e[10])*(g=e[15])-(h=e[11])*(v=e[14]))-(t*(s=e[6])-(n=e[2])*a)*((l=e[9])*g-h*(p=e[13]))+(t*(u=e[7])-(i=e[3])*a)*(l*v-f*p)+(r*s-n*o)*((c=e[8])*g-h*(d=e[12]))-(r*u-i*o)*(c*v-f*d)+(n*u-i*s)*(c*p-l*d);var e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v,g}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getScale(t||[-0,-0,-0]),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*i,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*i,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getScale(t||[-0,-0,-0]),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=this[4]*n,e[4]=this[5]*i,e[5]=this[6]*a,e[6]=this[8]*n,e[7]=this[9]*i,e[8]=this[10]*a,e}},{key:"transpose",value:function(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],p=t[12],v=t[13],g=t[14],y=t[15],b=r*s-n*o,m=r*u-i*o,_=r*c-a*o,w=n*u-i*s,x=n*c-a*s,k=i*c-a*u,S=l*v-f*p,E=l*g-h*p,j=l*y-d*p,I=f*g-h*v,N=f*y-d*v,T=h*y-d*g,A=b*T-m*N+_*I+w*j-x*E+k*S;A&&(e[0]=(s*T-u*N+c*I)*(A=1/A),e[1]=(i*N-n*T-a*I)*A,e[2]=(v*k-g*x+y*w)*A,e[3]=(h*x-f*k-d*w)*A,e[4]=(u*j-o*T-c*E)*A,e[5]=(r*T-i*j+a*E)*A,e[6]=(g*_-p*k-y*m)*A,e[7]=(l*k-h*_+d*m)*A,e[8]=(o*N-s*j+c*S)*A,e[9]=(n*j-r*N-a*S)*A,e[10]=(p*x-v*_+y*b)*A,e[11]=(f*_-l*x-d*b)*A,e[12]=(s*E-o*I-u*S)*A,e[13]=(r*I-n*E+i*S)*A,e[14]=(v*m-p*w-g*b)*A,e[15]=(l*w-f*m+h*b)*A)}(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return z(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return z(this,this,e),this.check()}},{key:"rotateX",value:function(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+h*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=h*i-u*n}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],h=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-h*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+h*i}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],h=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+h*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=h*i-u*n}(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t,r=(3,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),3!==r.length);n=!0);}catch(u){i=!0,a=u}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}(t)||function(e,t){if(e){if("string"==typeof e)return d(e,3);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)?d(e,3):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),n=r[1],i=r[2];return this.rotateX(r[0]).rotateY(n).rotateZ(i)}},{key:"rotateAxis",value:function(e,t){return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p,v,g,y,b,m,_,w,x,k,S,E,j,I,N=n[0],T=n[1],A=n[2],R=Math.hypot(N,T,A);R<1e-6||(N*=R=1/R,T*=R,A*=R,i=Math.sin(r),a=Math.cos(r),u=t[1],c=t[2],l=t[3],h=t[5],d=t[6],p=t[7],g=t[9],y=t[10],b=t[11],x=N*T*(o=1-a)-A*i,k=T*T*o+a,S=A*T*o+N*i,E=N*A*o+T*i,j=T*A*o-N*i,I=A*A*o+a,e[0]=(s=t[0])*(m=N*N*o+a)+(f=t[4])*(_=T*N*o+A*i)+(v=t[8])*(w=A*N*o-T*i),e[1]=u*m+h*_+g*w,e[2]=c*m+d*_+y*w,e[3]=l*m+p*_+b*w,e[4]=s*x+f*k+v*S,e[5]=u*x+h*k+g*S,e[6]=c*x+d*k+y*S,e[7]=l*x+p*k+b*S,e[8]=s*E+f*j+v*I,e[9]=u*E+h*j+g*I,e[10]=c*E+d*j+y*I,e[11]=l*E+p*j+b*I,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?V(this,this,e):V(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return function(e,t,r){var n,i,a,o,s,u,c,l,f,h,d,p,v=r[0],g=r[1],y=r[2];t===e?(e[12]=t[0]*v+t[4]*g+t[8]*y+t[12],e[13]=t[1]*v+t[5]*g+t[9]*y+t[13],e[14]=t[2]*v+t[6]*g+t[10]*y+t[14],e[15]=t[3]*v+t[7]*g+t[11]*y+t[15]):(i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],e[0]=n=t[0],e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=p,e[12]=n*v+s*g+f*y+t[12],e[13]=i*v+u*g+h*y+t[13],e[14]=a*v+c*g+d*y+t[14],e[15]=o*v+l*g+p*y+t[15])}(this,this,e),this.check()}},{key:"transform",value:function(e,t){return 4===e.length?(D(t=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}},{key:"transformAsPoint",value:function(e,t){switch(e.length){case 2:t=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}(t||[-0,-0],e,this);break;case 3:t=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/(o=o||1),e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return D(t,e.length),t}},{key:"transformAsVector",value:function(e,t){switch(e.length){case 2:t=function(e,t,r){var n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}(t||[-0,-0],e,this);break;case 3:t=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return D(t,e.length),t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,r){return this.identity().translate([e,t,r])}},{key:"transformPoint",value:function(e,t){return P("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}},{key:"transformVector",value:function(e,t){return P("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}},{key:"transformDirection",value:function(e,t){return P("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(e,t,r,n,i,a){var o=2*a/(i-n),s=(r+t)/(r-t),u=(i+n)/(i-n),c=-2*a;return e[0]=2*a/(r-t),e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=s,e[9]=u,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=c,e[15]=0,e}}]),t}(U),Y=r("HXBs"),Z=r("mtbl"),$=r.n(Z),ee=r("YXac"),te=r("l/hW"),re=r.n(te),ne=r("LvDl"),ie=r("L1/z"),ae=s.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},s.DataFactory),oe={x:ae("rdf"),type:s.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")},se=ae("entity")("id"),ue={x:ae("entity"),id:se,sex:ae("entity")("sex"),age:ae("entity")("age"),bmi:ae("entity")("bmi"),Male:s.DataFactory.literal("Male"),Female:s.DataFactory.literal("Female"),donor:ae("entity")("donor"),entityType:ae("entity")("entityType"),groupName:ae("entity")("groupName"),groupUUID:ae("entity")("groupUUID"),ontologyTerms:ae("entity")("ontologyTerms"),spatialEntity:ae("entity")("spatialEntity"),images:ae("entity")("hasImage"),imageProviders:ae("entity")("hasImageProvider")},ce=ae("ccf"),le={x:ce,spatial:{Body:ce("VHBody"),Female:ce("VHFemale"),Male:ce("VHMale"),BothSexes:ce("VHBothSexes"),FemaleOrgans:ce("VHFemaleOrgans"),MaleOrgans:ce("VHMaleOrgans")},SpatialObjectReference:ce("SpatialObjectReference"),SpatialEntity:ce("SpatialEntity"),SpatialPlacement:ce("SpatialPlacement"),spatialObjectReference:{file:ce("has_object_file"),file_format:ce("has_object_file_format"),file_subpath:ce("has_object_file_subpath")},extractionSet:{label:ae("rdf")("label"),rui_rank:ce("ccf_rui_rank")},spatialEntity:{label:ae("rdf")("label"),comment:ae("rdf")("comment"),creator:ae("dc")("creator"),creator_first_name:ce("creator_first_name"),creator_last_name:ce("creator_last_name"),creator_orcid:ce("creator_orcid"),creation_date:ce("creation_date"),updated_date:ce("updated_date"),ccf_annotations:ce("ccf_annotation"),representation_of:ce("ccf_representation_of"),reference_organ:ce("anatomical_structure_of"),extraction_set_for:ce("extraction_set_for"),extraction_set:ce("extraction_site_for"),sex:ce("has_sex"),side:ce("has_side"),rui_rank:ce("ccf_rui_rank"),slice_thickness:ce("ccf_slice_thickness"),slice_count:ce("ccf_slice_count"),x_dimension:ce("has_x_dimension"),y_dimension:ce("has_y_dimension"),z_dimension:ce("has_z_dimension"),dimension_units:ce("has_dimension_units"),object:ce("has_object_reference")},spatialPlacement:{source:ce("has_placement_source"),target:ce("has_placement_target"),placement_date:ce("has_placement_date"),x_scaling:ce("has_x_scaling"),y_scaling:ce("has_y_scaling"),z_scaling:ce("has_z_scaling"),scaling_units:ce("has_scaling_units"),x_rotation:ce("has_x_rotation"),y_rotation:ce("has_y_rotation"),z_rotation:ce("has_z_rotation"),w_rotation:ce("has_theta_rotation"),rotation_order:ce("has_rotation_order"),rotation_units:ce("has_rotation_units"),x_translation:ce("has_x_translation"),y_translation:ce("has_y_translation"),z_translation:ce("has_z_translation"),translation_units:ce("has_translation_units")}},fe={x:ae("uberon")},he={x:ae("lmha")},de={body:fe.x("0013702"),heart:fe.x("0000948"),lung:he.x("00211"),left_lung:fe.x("0002168"),right_lung:fe.x("0002167"),kidney:fe.x("0002113"),left_kidney:fe.x("0004538"),right_kidney:fe.x("0004539"),spleen:fe.x("0002106"),colon:fe.x("0001155"),small_intestine:fe.x("0002108"),rectum:fe.x("0001052"),liver:fe.x("0002107"),bladder:fe.x("0001255"),ureter:fe.x("0000056"),left_ureter:fe.x("0001223"),right_ureter:fe.x("0001222"),thymus:fe.x("0002370"),lymph_node:fe.x("0000029")};function pe(e){var t={};return Object.entries(e).forEach(function(e){var r=b(e,2),n=r[0],i=r[1];t[i.id]=n}),t}var ve={spatialObjectReference:pe(le.spatialObjectReference),spatialEntity:pe(le.spatialEntity),spatialPlacement:pe(le.spatialPlacement)};function ge(e,t,r,n){var i={"@id":t,"@type":r};return e.some(function(e){var t=n[e.predicate.id];if(t){var r="Literal"===e.object.termType?Object(ie.fromRdf)(e.object):e.object.id;Object(ne.set)(i,t,r)}return!1},s.DataFactory.namedNode(t),null,null,null),i}function ye(e,t){return ge(e,t,"SpatialObjectReference",ve.spatialObjectReference)}function be(e,t){var r=ge(e,t,"ExtractionSet",ve.spatialEntity);return r.extractionSites=Object(ne.sortBy)(e.getSubjects(le.spatialEntity.extraction_set,t,null).map(function(t){return me(e,t.id)}),["rui_rank"]),r}function me(e,t){var r=ge(e,t,"SpatialEntity",ve.spatialEntity);return r.object&&(r.object=ye(e,r.object)),e.forSubjects(function(e){return r.entityId=e.id},ue.spatialEntity,t,null),r}function _e(e,t){var r,n=t;switch(n.translation_units){case"centimeter":r=.01;break;case"millimeter":r=.001;break;case"meter":default:r=1}var i=[n.x_translation,n.y_translation,n.z_translation].map(function(e){return e*r}),a=[n.x_rotation,n.y_rotation,n.z_rotation].map(E),o=re()(Object(ee.fromEuler)(a[1],a[0],a[2],"XYZ").toVector()),s=[n.x_scaling,n.y_scaling,n.z_scaling];return e.translate(i).rotateXYZ(o).scale(s)}var we=function(){function e(t){S(this,e),this.db=t,this.createGraph()}return j(e,[{key:"createGraph",value:function(){var e=this;this.graph=new Y.DirectedGraph;var t=this.db.store;t.forSubjects(function(r){e.addSpatialObjectReference(ye(t,r.id))},oe.type,le.SpatialObjectReference,null),t.forSubjects(function(r){e.addSpatialEntity(me(t,r.id))},oe.type,le.SpatialEntity,null),t.forSubjects(function(r){e.addSpatialPlacement(function(e,t){var r=ge(e,t,"SpatialPlacement",ve.spatialPlacement);return r.source&&(r.source=me(e,r.source)),r.target&&(r.target=me(e,r.target)),r}(t,r.id))},oe.type,le.SpatialPlacement,null)}},{key:"addSpatialEntity",value:function(e){this.graph.mergeNode(e["@id"],{type:"SpatialEntity",object:e})}},{key:"addSpatialObjectReference",value:function(e){this.graph.mergeNode(e["@id"],{type:"SpatialObjectReference",object:e})}},{key:"addSpatialPlacement",value:function(e){this.graph.mergeDirectedEdge(e.source["@id"],e.target["@id"],{type:"SpatialPlacement",placement:e})}},{key:"getTransformationMatrix",value:function(e,t){if(e===t)return new Q;if(this.graph.hasNode(e)&&this.graph.hasNode(t)){var r=new Q,n=$()(this.graph,e,t);if(n&&n.length>0){n.reverse();var i,a="",o=w(n);try{for(o.s();!(i=o.n()).done;){var s=i.value;a&&_e(r,this.graph.getEdgeAttribute(s,a,"placement")),a=s}}catch(u){o.e(u)}finally{o.f()}return r}}}}]),e}(),xe=function(){function e(t){S(this,e),this.db=t}return j(e,[{key:"getSpatialEntity",value:function(e){return me(this.db.store,e)}},{key:"getExtractionSets",value:function(e){return function(e,t){return Object(ne.sortBy)(e.getSubjects(le.spatialEntity.extraction_set_for,t,null).map(function(t){return be(e,t.id)}),["rui_rank"])}(this.db.store,e)}},{key:"getExtractionSet",value:function(e){return be(this.db.store,e)}},{key:"getAnatomicalStructures",value:function(e){return function(e,t){return Object(ne.sortBy)(e.getSubjects(le.spatialEntity.reference_organ,t,null).map(function(t){return me(e,t.id)}).filter(function(e){return e["@id"]!==t}),["rui_rank"])}(this.db.store,e)}},{key:"getReferenceOrgans",value:function(){return e=this.db.store,t=[],e.forEach(function(r){r.subject.id===r.object.id&&t.push(me(e,r.subject.id))},null,le.spatialEntity.reference_organ,null,null),Object(ne.sortBy)(t,["rui_rank"]);var e,t}},{key:"getReferenceBody",value:function(e){var t;switch(null==e?void 0:e.sex){case"Male":t=le.spatial.Male.id;break;case"Female":t=le.spatial.Female.id;break;case"Both":default:t=le.spatial.BothSexes.id}return this.getSpatialEntity(t)}},{key:"getReferenceOrganSets",value:function(e){var t;switch(null==e?void 0:e.sex){case"Male":t=le.spatial.MaleOrgans.id;break;case"Female":t=le.spatial.FemaleOrgans.id;break;case"Both":default:t=le.spatial.FemaleOrgans.id}return[this.getSpatialEntity(t)]}},{key:"getReferenceSceneNodes",value:function(e){var t=this,r=this.getSpatialEntity(le.spatial.Body.id),n=this.getReferenceBody(e),i=(null==e?void 0:e.ontologyTerms)||[],a={body:0===i.indexOf(de.body.id),kidney:0===i.indexOf(de.kidney.id),right_kidney:0===i.indexOf(de.right_kidney.id),left_kidney:0===i.indexOf(de.left_kidney.id),spleen:0===i.indexOf(de.spleen.id)},o=[this.getSceneNode(n,r,{unpickable:!0,color:[255,255,255,255]})].concat(g(this.getReferenceOrganSets(e).map(function(e){return t.getSceneNode(e,n,{unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!0,color:[255,255,255,255]})})),[this.getSceneNode(this.getSpatialEntity(le.x("VHRightKidney").id),n,{color:[255,255,255,1],unpickable:a.kidney||a.right_kidney,zoomToOnLoad:a.right_kidney}),this.getSceneNode(this.getSpatialEntity(le.x("VHLeftKidney").id),n,{color:[255,255,255,1],unpickable:a.kidney||a.left_kidney,zoomToOnLoad:a.left_kidney}),this.getSceneNode(this.getSpatialEntity(le.x("VHSpleen").id),n,{color:[255,255,255,1],unpickable:a.spleen,zoomToOnLoad:a.spleen})]);return(null==e?void 0:e.debug)&&(o=o.concat([this.getSceneNode(this.getSpatialEntity(le.x("VHRightKidney").id),r,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(le.x("VHLeftKidney").id),r,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(le.x("VHSpleenCC1").id),r,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(le.x("VHSpleenCC2").id),r,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(le.x("VHSpleenCC3").id),r,{color:[0,255,0,127.5],wireframe:!0})])),o.filter(function(e){return void 0!==e})}},{key:"getEntitySceneNodes",value:function(e){var t=this,r=this.getReferenceBody(e),n=new Set(null==e?void 0:e.highlightedEntities);return this.db.getSpatialEntities(e).map(function(e){return t.getSceneNode(e,r,{color:n.has(e.entityId)?[10,10,229,229.5]:[255,255,255,229.5]})}).filter(function(e){return void 0!==e})}},{key:"getSceneNode",value:function(e,t){var r,n,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.object&&(null===(r=e.object.file_format)||void 0===r?void 0:r.startsWith("model/gltf")),s=this.db.graph.getTransformationMatrix(o&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(s){if(o)s=(new Q).rotateX(E(90)).multiplyLeft(s);else{var u;switch(e.dimension_units){case"centimeter":u=.01;break;case"millimeter":u=.001;break;case"meter":default:u=1}var c=[e.x_dimension,e.y_dimension,e.z_dimension].map(function(e){return e*u/2});s.scale(c)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId||void 0,representation_of:e.representation_of||void 0,scenegraph:o?null===(n=e.object)||void 0===n?void 0:n.file:void 0,scenegraphNode:o?null===(i=e.object)||void 0===i?void 0:i.file_subpath:void 0,transformMatrix:s,tooltip:e.label},a)}}},{key:"getScene",value:function(e){return[].concat(g(this.getReferenceSceneNodes(e)),g(this.getEntitySceneNodes(e)))}}]),e}();function ke(e){return"string"==typeof e?parseFloat(e.replace(/[^\d\-\.]/g,"")):e}function Se(e){var t=e.x,r=e.y,n=e.z;return{x:ke(t),y:ke(r),z:ke(n)}}var Ee,je="https://entity-api.hubmapconsortium.org/entities/",Ie=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","","DR1-VU:","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),Ne={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},Te=(Ee={},Object.entries(de).forEach(function(e){var t=b(e,2),r=t[0],n=t[1];return Ee[r]=n.id}),Ee),Ae={BL:[Te.body,Te.bladder],RK:[Te.body,Te.kidney,Te.right_kidney],LK:[Te.body,Te.kidney,Te.left_kidney],HT:[Te.body,Te.heart],LI:[Te.body,Te.colon],SI:[Te.body,Te.small_instestine],LL:[Te.body,Te.lung,Te.left_lung],RL:[Te.body,Te.lung,Te.right_lung],LY:[Te.body,Te.lymph_node],SP:[Te.body,Te.spleen],TH:[Te.body,Te.thymus],UR:[Te.body,Te.ureter],LV:[Te.body,Te.liver],OT:[Te.body]},Re={BL:"Bladder",RK:"Right Kidney",LK:"Left Kidney",HT:"Heart",LI:"Large Intestine",SI:"Small Intestine",LL:"Left Lung",RL:"Right Lung",LY:"Lymph Node",SP:"Spleen",TH:"Thymus",UR:"Ureter",LV:"Liver",OT:"Other Organ"},Oe=function(){function e(t){var r,n,i,a,o,s=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",l=arguments.length>3?arguments[3]:void 0;S(this,e),this.data=t,this.assetsApi=u,this.id=this.data.uuid,this.entityType=this.data.entity_type,this.ancestors=this.data.ancestors||[],this.descendants=this.data.descendants||[],this.donor="Donor"===this.entityType?t:this.ancestors.find(function(e){return"Donor"===e.entity_type}),this.organSample="Sample"===this.entityType&&"organ"===t.specimen_type?t:this.ancestors.find(function(e){return"Sample"===e.entity_type&&"organ"===e.specimen_type});var f,h=(this.donor.description||"").toLowerCase();h.includes("female")?f="Female":h.includes("male")&&(f="Male");var d,p,v,y=h.match(/age\ ([0-9]+)/);y&&(d=Object(ne.toNumber)(y[1]));var m,_=w(Object(ne.get)(this.donor,"metadata.organ_donor_data",[]));try{for(_.s();!(m=_.n()).done;){var x=m.value;"Feminine gender"===x.preferred_term||"Female"===x.preferred_term?f="Female":"Masculine gender"===x.preferred_term||"Male"===x.preferred_term?f="Male":"Current chronological age"===x.preferred_term||"Age"===x.preferred_term?d=Object(ne.toNumber)(x.data_value):"Body mass index"===x.preferred_term?p=Object(ne.toNumber)(x.data_value):"Racial group"!==x.grouping_concept_preferred_term&&"Race"!==x.grouping_concept_preferred_term||(v=x.preferred_term)}}catch(q){_.e(q)}finally{_.f()}var k="";f&&d&&(k+="".concat(f,", Age ").concat(d),p&&(k+=", BMI ".concat(p.toFixed(1)))),this.age=d,this.sex=f,this.bmi=p,this.ethnicity=v,this.label=k,this.doi=t.display_doi,this.description=t.description;var E=this.groupUUID=t.group_uuid||this.donor.group_uuid;this.groupName=Ne[E]||t.group_name||this.donor.group_name,this.organName=[t].concat(g(this.ancestors),g(this.descendants)).map(function(e){return e.organ}).find(function(e){return!!e}),this.ontologyTerms=Ae[this.organName]||[Te.body],this.organ=this.ontologyTerms[this.ontologyTerms.length-1],this.protocolUrl=this.donor.protocol_url;var j=t.rui_location||this.ancestors[0].rui_location;if(j)if("string"==typeof j&&(j=JSON.parse(j)),j.alignment_id){var I;"07a29e4c-ed43-11e8-b56a-0e8017bdda58"===E&&(j=function(e,t){e=function(e){return e=Object.assign(Object.assign({},e),{tissue_object_size:Se(e.tissue_object_size),tissue_object_rotation:Se(e.tissue_object_rotation),tissue_position_mass_point:Se(e.tissue_position_mass_point)}),Object.entries(e).forEach(function(t){var r=b(t,2),n=r[0],i=r[1];"string"==typeof i&&Object(ne.set)(e,n,i.replace(/^_|mm_$|_$/g,""))}),e}(e);var r=t.lab_tissue_sample_id||"";return r.match(/CC1|CC\-1/)?(e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleenCC1",e.tissue_position_mass_point={x:29.95+e.tissue_position_mass_point.x,y:40.7-60,z:0},e.tissue_object_size.x=10):r.match(/CC2|CC\-2/)?(e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleenCC2",e.tissue_position_mass_point={x:31.5+e.tissue_position_mass_point.x,y:-19.9,z:0},e.tissue_object_size.x=10):r.match(/CC3|CC\-3/)?(e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleenCC3",e.tissue_position_mass_point={x:29.35+e.tissue_position_mass_point.x,y:-16.6,z:0},e.tissue_object_size.x=10):e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleen",e}(j,t)),this.organ===Te.left_kidney?I=le.x("VHLeftKidney").id:this.organ===Te.right_kidney&&(I=le.x("VHRightKidney").id),this.spatialEntity=function(e,t,r){var n;r?n=r:"uuid-1234-5678"===e.reference_organ_id?n=le.x("VHKidney").id:e.reference_organ_id&&(n=e.reference_organ_id),(null==n?void 0:n.endsWith("Kidney"))&&(e=function(e){return Object.assign(Object.assign({},e),{tissue_position_mass_point:{x:e.tissue_position_mass_point.x-30,y:e.tissue_position_mass_point.y-50,z:e.tissue_position_mass_point.z-30}})}(e));var i=e.tissue_object_size,a=e.tissue_object_rotation,o=e.tissue_position_mass_point;return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":"http://purl.org/ccf/0.5/"+e.alignment_id,"@type":"SpatialEntity",label:t||void 0,creator:"".concat(e.alignment_operator_first_name," ").concat(e.alignment_operator_last_name),creator_first_name:e.alignment_operator_first_name,creator_last_name:e.alignment_operator_last_name,creation_date:e.alignment_datetime,ccf_annotations:[],x_dimension:i.x,y_dimension:i.y,z_dimension:i.z,dimension_units:"millimeter",placement:{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":"http://purl.org/ccf/0.5/"+e.alignment_id+"_placement","@type":"SpatialPlacement",target:n,placement_date:e.alignment_datetime,x_scaling:1,y_scaling:1,z_scaling:1,scaling_units:"ratio",x_rotation:a.x,y_rotation:a.y,z_rotation:a.z,rotation_order:"XYZ",rotation_units:"degree",x_translation:o.x,y_translation:o.y,z_translation:o.z,translation_units:"millimeter"}}}(j,"SpatialEntity for "+this.label,I)}else j["@id"]&&(this.spatialEntity=j);for(var N=[],T=[],A=function(){var e=O[R],t=Object(ne.get)(e,"metadata.files",[]).filter(function(e){return/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)}).filter(function(e){return!/(multilayer\.ome\.tif|\_ac\.ome\.tif)/.test(e.rel_path)}).filter(function(e){return"73bb26e4-ed43-11e8-8f19-0a7c1eab007a"!==E||Ie.has(e.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))}).map(function(t){return"".concat(s.assetsApi,"/").concat(e.uuid,"/").concat(t.rel_path)+(l?"?token=".concat(l):"")});t.length>0&&(N=N.concat(t),T.push(je+e.uuid))},R=0,O=[t].concat(g(this.ancestors),g(this.descendants));R0&&(this.images=N,this.imageProviders=T);for(var L=new Map,M=new Map,D=!1,C=function(){var e=F[P];(e.data_types||[]).forEach(function(t){return L.set(t,e)});var t=null===(n=null===(r=e.metadata)||void 0===r?void 0:r.metadata)||void 0===n?void 0:n.assay_type;t&&M.set(t,e),"yes"===e.contains_human_genetic_sequences&&(D=!0)},P=0,F=[].concat(g(this.ancestors),[t],g(this.descendants));P0&&-1===B.indexOf("codex")){if(this.resultUrl=N[0],this.resultType="image_viewer",this.thumbnailUrl="assets/histology3.jpg","73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===E){var U=this.resultUrl.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");Ie.has(U)&&(this.thumbnailUrl="assets/thumbnails/DR1-VU/".concat(U))}}else{if(L.has("codex_cytokit")){var G=null===(i=L.get("codex_cytokit"))||void 0===i?void 0:i.uuid;this.resultUrl="".concat(c,"browse/dataset/").concat(G,"#visualization")}else if(L.has("salmon_rnaseq_10x")){var z=null===(a=L.get("salmon_rnaseq_10x"))||void 0===a?void 0:a.uuid;this.resultUrl="".concat(c,"browse/dataset/").concat(z,"#visualization")}else if(L.has("image_pyramid")){var V=null===(o=L.get("image_pyramid"))||void 0===o?void 0:o.uuid;this.resultUrl="".concat(c,"browse/dataset/").concat(V,"#visualization")}else this.resultUrl=this.portalUrl;this.resultType="external_link"}}return j(e,[{key:"toJsonLd",value:function(){var e,t=this.data;return Object.assign(Object.assign({"@id":je+this.id,"@type":"Entity"},Object(ne.omit)(this,["data","donor","organ_sample","organSample","ancestors","descendants","assetsApi"])),{donor:je+this.donor.uuid,shortInfo0:this.doi,shortInfo1:this.groupName,shortInfo2:t.description||this.donor.description,downloadUrl:this.portalUrl,downloadTooltip:"View in the HuBMAP Data Portal",organName:Re[this.organName]||this.organName,sex:this.sex,age:this.age,bmi:null===(e=this.bmi)||void 0===e?void 0:e.toFixed(1),ethnicity:this.ethnicity,authorGroup:this.groupName,creator:t.created_by_user_displayname,creation_date:new Date(t.create_timestamp||0).toLocaleDateString(),modified_date:new Date(t.last_modified_timestamp||0).toLocaleDateString(),donor_id:this.donor.display_doi,organ_id:this.organSample.display_doi,tissue_id:this.doi,specimen_type:this.data.specimen_type,data_types:this.dataTypes.join(", "),assay_types:this.assayTypes.join(", "),spatial_bulk:this.spatialOrBulk,contains_sequence:this.containsHumanGeneticSequences?"Yes":"No",description:t.description||this.donor.description})}}]),e}();function Le(e,t){return function(r){return e.has(r.id)?t.add(r.id):void 0}}var Me=(v(n={},ue.id.id,"id"),v(n,ue.x("label").id,"label"),v(n,ue.x("organName").id,"organName"),n),De=(v(i={},ue.sex.id,"Sex"),v(i,ue.age.id,"Age"),v(i,ue.x("bmi").id,"BMI"),v(i,ue.x("ethnicity").id,"Ethnicity"),v(i,ue.groupName.id,"Author Group"),v(i,ue.x("creator").id,"Creator"),v(i,ue.x("creation_date").id,"Date Created"),v(i,ue.x("modified_date").id,"Date Modified"),v(i,ue.x("donor_id").id,"HuBMAP Donor ID"),v(i,ue.x("organ_id").id,"HuBMAP Organ ID"),v(i,ue.x("tissue_id").id,"HUBMAP Tissue ID"),v(i,ue.x("specimen_type").id,"Specimen Type"),v(i,ue.x("data_types").id,"Data Type(s)"),v(i,ue.x("assay_types").id,"Assay(s)"),v(i,ue.x("spatial_bulk").id,"Spatial/Bulk"),v(i,ue.x("contains_sequence").id,"Contains Sequence"),v(i,ue.x("description").id,"Description"),i),Ce=(v(a={},ue.id.id,"id"),v(a,ue.x("label").id,"label"),v(a,ue.x("shortInfo0").id,["shortInfo","0"]),v(a,ue.x("shortInfo1").id,["shortInfo","1"]),v(a,ue.x("shortInfo2").id,["shortInfo","2"]),v(a,ue.x("thumbnailUrl").id,"thumbnailUrl"),v(a,ue.x("downloadUrl").id,"downloadUrl"),v(a,ue.x("downloadTooltip").id,"downloadTooltip"),v(a,ue.x("resultUrl").id,"resultUrl"),v(a,ue.x("resultType").id,"resultType"),a),Pe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"},Fe=Symbol("Comlink.proxy"),Be=Symbol("Comlink.endpoint"),Ue=Symbol("Comlink.releaseProxy"),Ge=Symbol("Comlink.thrown"),ze=function(e){return"object"==typeof e&&null!==e||"function"==typeof e},Ve=new Map([["proxy",{canHandle:function(e){return ze(e)&&e[Fe]},serialize:function(e){var t=new MessageChannel,r=t.port1,n=t.port2;return qe(e,r),[n,[n]]},deserialize:function(e){return e.start(),He(e,[],void 0)}}],["throw",{canHandle:function(e){return ze(e)&&Ge in e},serialize:function(e){var t=e.value;return[t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[]]},deserialize:function(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;t.addEventListener("message",function r(n){if(n&&n.data){var i,a=Object.assign({path:[]},n.data),o=a.id,s=a.type,u=a.path,c=(n.data.argumentList||[]).map(Ye);try{var l=u.slice(0,-1).reduce(function(e,t){return e[t]},e),f=u.reduce(function(e,t){return e[t]},e);switch(s){case 0:i=f;break;case 1:l[u.slice(-1)[0]]=Ye(n.data.value),i=!0;break;case 2:i=f.apply(l,c);break;case 3:i=function(e){return Object.assign(e,v({},Fe,!0))}(h(f,g(c)));break;case 4:var d=new MessageChannel,p=d.port1,y=d.port2;qe(e,y),i=function(e,t){return Xe.set(e,t),e}(p,[p]);break;case 5:i=void 0}}catch(m){i=v({value:m},Ge,0)}Promise.resolve(i).catch(function(e){return v({value:e},Ge,0)}).then(function(e){var n=b(Qe(e),2),i=n[0],a=n[1];t.postMessage(Object.assign(Object.assign({},i),{id:o}),a),5===s&&(t.removeEventListener("message",r),Ke(t))})}}),t.start&&t.start()}function Ke(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function We(e){if(e)throw new Error("Proxy has been released and is not useable")}function He(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=!1,i=new Proxy(r,{get:function(r,a){if(We(n),a===Ue)return function(){return Ze(e,{type:5,path:t.map(function(e){return e.toString()})}).then(function(){Ke(e),n=!0})};if("then"===a){if(0===t.length)return{then:function(){return i}};var o=Ze(e,{type:0,path:t.map(function(e){return e.toString()})}).then(Ye);return o.then.bind(o)}return He(e,[].concat(g(t),[a]))},set:function(r,i,a){We(n);var o=b(Qe(a),2),s=o[0],u=o[1];return Ze(e,{type:1,path:[].concat(g(t),[i]).map(function(e){return e.toString()}),value:s},u).then(Ye)},apply:function(r,i,a){We(n);var o=t[t.length-1];if(o===Be)return Ze(e,{type:4}).then(Ye);if("bind"===o)return He(e,t.slice(0,-1));var s=b(Je(a),2),u=s[0],c=s[1];return Ze(e,{type:2,path:t.map(function(e){return e.toString()}),argumentList:u},c).then(Ye)},construct:function(r,i){We(n);var a=b(Je(i),2),o=a[0],s=a[1];return Ze(e,{type:3,path:t.map(function(e){return e.toString()}),argumentList:o},s).then(Ye)}});return i}function Je(e){var t,r=e.map(Qe);return[r.map(function(e){return e[0]}),(t=r.map(function(e){return e[1]}),Array.prototype.concat.apply([],t))]}var Xe=new WeakMap;function Qe(e){var t,r=w(Ve);try{for(r.s();!(t=r.n()).done;){var n=b(t.value,2),i=n[0],a=n[1];if(a.canHandle(e)){var o=b(a.serialize(e),2);return[{type:3,name:i,value:o[0]},o[1]]}}}catch(s){r.e(s)}finally{r.f()}return[{type:0,value:e},Xe.get(e)||[]]}function Ye(e){switch(e.type){case 3:return Ve.get(e.name).deserialize(e.value);case 0:return e.value}}function Ze(e,t,r){return new Promise(function(n){var i=new Array(4).fill(0).map(function(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)}).join("-");e.addEventListener("message",function t(r){r.data&&r.data.id&&r.data.id===i&&(e.removeEventListener("message",t),n(r.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),r)})}qe(new(function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe;S(this,e),this.options=t,this.store=new s.Store,this.graph=new we(this),this.scene=new xe(this)}return j(e,[{key:"connect",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e&&(this.options=e),this.initializing||(this.initializing=this.doConnect()),t.next=4,this.initializing;case 4:return t.abrupt("return",this.store.size>0);case 5:case"end":return t.stop()}},t,this)}))}},{key:"doConnect",value:function(){return o(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],this.options.ccfOwlUrl.endsWith(".n3")?t.push(Object(s.addN3ToStore)(this.options.ccfOwlUrl,this.store)):t.push(Object(s.addRdfXmlToStore)(this.options.ccfOwlUrl,this.store)),this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith(".jsonld")?t.push(Object(s.addJsonLdToStore)(this.options.hubmapDataUrl,this.store)):t.push(function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";return o(this,void 0,void 0,regeneratorRuntime.mark(function o(){var u,c;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if("static"!==r){o.next=6;break}return o.next=3,fetch(t).then(function(e){return e.ok?e.json():void 0}).catch(function(){});case 3:u=o.sent,o.next=12;break;case 6:if("search-api"!==r){o.next=12;break}return c={"Content-type":"application/json"},n&&n.length>0&&(c.Authorization="Bearer ".concat(n)),o.next=11,fetch(t,{method:"POST",headers:c,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:{exists:{field:"rui_location"}}})}).then(function(e){return e.ok?e.json():void 0}).catch(function(){});case 11:u=o.sent;case 12:if(!u){o.next=17;break}return o.next=15,Object(s.addJsonLdToStore)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=Object(ne.get)(e,"hits.hits",[]).map(function(e){return Object(ne.get)(e,"_source",{})});return i&&function(e){var t,r=[],n=w(Object(ne.sortBy)(e.concat(),["groupName","data.hubmap_display_id"]));try{for(n.s();!(t=n.n()).done;){var i=t.value,a={UUID:i.id,"Group Name":i.groupName,"Entity Type":i.entityType,"Sample ID":i.data.hubmap_display_id,"Donor ID":i.donor.display_doi,"Organ Sample ID":i.organSample.display_doi,"Has Datasets":"No","Has TIFFs":"","Has Thumbnails":"","Dataset ID":"","Data Type(s)":i.dataTypes.join("|"),"Assay Type(s)":i.assayTypes.join("|"),TIFFs:"",Thumbnails:""};r.push(a);var o,s=w(i.descendants.filter(function(e){return"Dataset"===e.entity_type}));try{for(s.s();!(o=s.n()).done;){var u=o.value;a["Has Datasets"]="Yes";var c=Object(ne.get)(u,"metadata.files",[]).filter(function(e){return/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)}).map(function(e){return e.rel_path}).map(function(e){return e.split("/").slice(-1)[0].split("?")[0]}),l=[];if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===i.groupUUID){var f,h=w(c);try{for(h.s();!(f=h.n()).done;){var d=f.value.replace(".ome.tif","_thumbnail.png");Ie.has(d)&&(l.push(d),a["Has Thumbnails"]="Yes")}}catch(v){h.e(v)}finally{h.f()}}c.length>0&&(a["Has TIFFs"]="Yes");var p=Object.assign({},a,{UUID:"","Entity Type":u.entity_type,"Dataset ID":u.display_doi,"Data Type(s)":(u.data_types||[]).join("|"),"Assay Type(s)":Object(ne.get)(u,"metaata.metadata.assay_type",""),TIFFs:c.join("|"),Thumbnails:l.join("|")});r.push(p)}}catch(v){s.e(v)}finally{s.f()}}}catch(v){n.e(v)}finally{n.f()}console.log(r)}(a.map(function(e){return new Oe(e,t,r,n)})),{"@context":{"@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ontologyTerms:{"@type":"@id"},ancestors:{"@type":"@id"},descendants:{"@type":"@id"},organ:{"@type":"@id"},images:{"@id":"hasImage","@type":"@id"},imageProviders:{"@id":"hasImageProvider","@type":"@id"}},"@graph":a.map(function(e){return new Oe(e,t,r,n).toJsonLd()})}}(u,i,a,n),e);case 15:o.next=18;break;case 17:console.warn("Unable to load ".concat(t," as HuBMAP Data"));case 18:case"end":return o.stop()}},o)}))}(this.store,this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl))),t.push(Object(s.addJsonLdToStore)("assets/kpmp/data/rui_locations.jsonld",this.store).catch(function(e){return console.log("Couldn't locate KPMP data.")})),e.next=6,Promise.all(t);case 6:return e.next=8,new Promise(function(e){return setTimeout(e,500)});case 8:this.graph.createGraph();case 9:case"end":return e.stop()}},e,this)}))}},{key:"getIds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){var r,n,i,a,o=function(e){var t=new Set;return e.forSubjects(function(e){return t.add(e.id)},ue.id,null,null),t}(e);if(o.size>0&&(!0===t.hasSpatialEntity||!1===t.hasSpatialEntity)&&(o=function(e,t,r){var n=new Set;if(e.forSubjects(Le(t,n),ue.spatialEntity,null,null),!r){var i=new Set;return t.forEach(function(e){return n.has(e)?void 0:i.add(e)}),i}return n}(e,o,t.hasSpatialEntity)),o.size>0&&("Male"===t.sex||"Female"===t.sex)&&(o=function(e,t,r){var n=new Set;return e.forSubjects(Le(t,n),ue.sex,ue[r],null),n}(e,o,t.sex)),o.size>0&&(null===(r=t.tmc)||void 0===r?void 0:r.length)>0&&(o=function(e,t,r){var n,i=new Set,a=w(r);try{for(a.s();!(n=a.n()).done;){var o=n.value,u=s.DataFactory.literal(o);e.forSubjects(Le(t,i),ue.groupName,u,null)}}catch(c){a.e(c)}finally{a.f()}return i}(e,o,t.tmc)),o.size>0&&(null===(n=t.ontologyTerms)||void 0===n?void 0:n.length)>0&&(o=function(e,t,r){var n,i=new Set,a=w(r);try{for(a.s();!(n=a.n()).done;){var o=n.value,u=s.DataFactory.namedNode(o);e.forSubjects(Le(t,i),ue.ontologyTerms,u,null)}}catch(c){a.e(c)}finally{a.f()}return i}(e,o,t.ontologyTerms)),o.size>0&&2===(null===(i=t.ageRange)||void 0===i?void 0:i.length)&&Object(ne.isFinite)(t.ageRange[0])&&Object(ne.isFinite)(t.ageRange[1])){var u=Math.max.apply(Math,g(t.ageRange)),c=Math.min.apply(Math,g(t.ageRange));1===c&&110===u||(o=function(e,t,r,n){var i=new Set;return e.some(function(e){if(t.has(e.subject.id)){var a=Object(ie.fromRdf)(e.object);a>=r&&a<=n&&i.add(e.subject.id)}return!1},null,ue.age,null,null),i}(e,o,c,u))}if(o.size>0&&2===(null===(a=t.bmiRange)||void 0===a?void 0:a.length)&&Object(ne.isFinite)(t.bmiRange[0])&&Object(ne.isFinite)(t.bmiRange[1])){var l=Math.max.apply(Math,g(t.bmiRange)),f=Math.min.apply(Math,g(t.bmiRange));13===f&&83===l||(o=function(e,t,r,n){var i=new Set;return e.some(function(e){if(t.has(e.subject.id)){var a=Object(ie.fromRdf)(e.object);a>=r&&a<=n&&i.add(e.subject.id)}return!1},null,ue.bmi,null,null),i}(e,o,f,l))}return o}(this.store,e)}},{key:"get",value:function(e){return this.store.getQuads(s.DataFactory.namedNode(e),null,null,null)}},{key:"search",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return g(this.getIds(t)).map(function(t){return e.get(t)})}},{key:"getSpatialEntities",value:function(e){var t=this;return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),g(this.getIds(e)).map(function(e){return r=t.store,n=e,(i=r.getObjects(s.DataFactory.namedNode(n),ue.spatialEntity,null)).length>0?me(r,i[0].id):void 0;var r,n,i})}},{key:"getListResults",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),r=new Set(e.highlightedEntities),t.abrupt("return",g(this.getIds(e)).map(function(e){return t=n.store,i={"@id":r=e,"@type":"ListResult"},t.some(function(e){var t=Ce[e.predicate.id];if(t){var r="Literal"===e.object.termType?Object(ie.fromRdf)(e.object):e.object.id;Object(ne.set)(i,t,r)}return!1},s.DataFactory.namedNode(r),null,null,null),i;var t,r,i}).map(function(e){return Object.assign(e,{highlighted:r.has(e["@id"])})}).sort(function(e,t){return(e.highlighted?0:1)-(t.highlighted?0:1)}));case 3:case"end":return t.stop()}},t,this)}))}},{key:"getAggregateResults",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",function(e,t){var r=new Set;t.some(function(t){return e.has(t.subject.id)&&r.add(t.object.id),!1},null,ue.groupUUID,null,null);var n=new Set;t.some(function(t){return e.has(t.subject.id)&&n.add(t.object.id),!1},null,ue.donor,null,null);var i=new Set;return t.forSubjects(function(t){e.has(t.id)&&i.add(t.id)},ue.spatialEntity,null,null),Object.entries({Centers:r.size,Donors:n.size,Samples:i.size}).map(function(e){var t=b(e,2);return{label:t[0],count:t[1]}})}(this.getIds(e),this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getOntologyTermOccurences",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",function(e,t){var r={};return t.some(function(t){return e.has(t.subject.id)&&(r[t.object.id]=1+(r[t.object.id]||0)),!1},null,ue.ontologyTerms,null,null),r}(this.getIds(e),this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getImageViewerData",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",function(e,t){var r={"@id":e,"@type":"ImageViewerData"},n={};return t.some(function(e){var t=Me[e.predicate.id];if(De[e.predicate.id]){var i="Literal"===e.object.termType?Object(ie.fromRdf)(e.object):e.object.id;n[e.predicate.id]=""+i}if(t){var a="Literal"===e.object.termType?Object(ie.fromRdf)(e.object):e.object.id;Object(ne.set)(r,t,a)}return!1},s.DataFactory.namedNode(e),null,null,null),r.metadata=Object.entries(De).map(function(e){var t=b(e,2),r=t[0];return{label:t[1],value:n[r]}}).filter(function(e){return e.value}),r}(e,this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getScene",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(this.graph.createGraph(),this.scene.getScene(e)));case 1:case"end":return t.stop()}},t,this)}))}}]),e}()))},JFj6:function(t,c,l){t.exports=function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){return i(t[o][1][e]||e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a=!1,o=0;o0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0?o-4:o;for(r=0;r>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[l++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));return 1===i?a.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&a.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,r){for(var i=[],a=t;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);var o;return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],11:[function(e,t,r){},{}],12:[function(e,t,r){(function(t){"use strict";var n=e("base64-js"),i=e("ieee754");function a(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return r.__proto__=t.prototype,r}function t(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return o(e,t,r)}function o(e,r,n){if("string"==typeof e)return function(e,r){if("string"==typeof r&&""!==r||(r="utf8"),!t.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var n=0|f(e,r),i=a(n),o=i.write(e,r);return o!==n&&(i=i.slice(0,o)),i}(e,r);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer))return function(e,r,n){if(r<0||e.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function f(e,r){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var a=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return D(e).length;default:if(a)return i?-1:M(e).length;r=(""+r).toLowerCase(),a=!0}}function h(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return E(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function d(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function p(e,r,n,i,a){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),F(n=+n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof r&&(r=t.from(r,i)),t.isBuffer(r))return 0===r.length?-1:v(e,r,n,i,a);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):v(e,[r],n,i,a);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=r;as&&(r=s-u),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var o=0;o>8,i.push(r%256),i.push(n);return i}(t,e.length-r),e,r,n)}function x(e,t,r){return n.fromByteArray(0===t&&r===e.length?e:e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:o=e[i+2],128==(192&(a=e[i+1]))&&128==(192&o)&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+2],s=e[i+3],128==(192&(a=e[i+1]))&&128==(192&o)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(n.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;ni)&&(r=i);for(var a="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function T(e,r,n,i,a,o){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>a||re.length)throw new RangeError("Index out of range")}function A(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,r,n,a){return t=+t,r>>>=0,a||A(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function O(e,t,r,n,a){return t=+t,r>>>=0,a||A(e,0,r,8),i.write(e,t,r,n,52,8),r+8}r.Buffer=t,r.SlowBuffer=function(e){return+e!=e&&(e=0),t.alloc(+e)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=2147483647,(t.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(e,t,r){return o(e,t,r)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(e,t,r){return function(e,t,r){return s(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},t.allocUnsafe=function(e){return u(e)},t.allocUnsafeSlow=function(e){return u(e)},t.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==t.prototype},t.compare=function(e,r){if(P(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),P(r,Uint8Array)&&(r=t.from(r,r.offset,r.byteLength)),!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var n=e.length,i=r.length,a=0,o=Math.min(n,i);at&&(e+=" ... "),""},t.prototype.compare=function(e,r,n,i,a){if(P(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),r<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(i>>>=0),s=(n>>>=0)-(r>>>=0),u=Math.min(o,s),c=this.slice(i,a),l=e.slice(r,n),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return m(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},t.prototype.slice=function(e,r){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},t.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},t.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},t.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},t.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},t.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},t.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},t.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},t.prototype.copy=function(e,r,n,i){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r=0;--o)e[o+r]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,i),r);return a},t.prototype.fill=function(e,r,n,i){if("string"==typeof e){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var a=e.charCodeAt(0);("utf8"===i&&a<128||"latin1"===i)&&(e=a)}}else"number"==typeof e&&(e&=255);if(r<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=r;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function D(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function C(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function F(e){return e!=e}}).call(this,e("buffer").Buffer)},{"base64-js":10,buffer:12,ieee754:17}],13:[function(e,t,r){var n=Object.create||function(e){var t=function(){};return t.prototype=e,new t},i=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return r},a=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var s,u=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),s=0===c.x}catch(x){s=!1}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,r){if(t)e.call(r);else for(var n=e.length,i=w(e,n),a=0;a0&&s.length>a){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else s=o[t]=r,++e._eventsCount;return e}function y(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t1&&(t=arguments[1]),t instanceof Error)throw t;var u=new Error('Unhandled "error" event. ('+t+")");throw u.context=t,u}if(!(r=o[e]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:f(r,c,this);break;case 2:h(r,c,this,arguments[1]);break;case 3:d(r,c,this,arguments[1],arguments[2]);break;case 4:p(r,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),a=1;a=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,a=o;break}if(a<0)return this;0===a?r.shift():function(e,t){for(var r=t,n=r+1,i=e.length;n=0;a--)this.removeListener(e,t[a]);return this},o.prototype.listeners=function(e){return m(this,e,!0)},o.prototype.rawListeners=function(e){return m(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):_.call(e,t)},o.prototype.listenerCount=_,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],14:[function(e,t,r){(function(t,n){var i=e("process/browser.js").nextTick,a=Function.prototype.apply,o=Array.prototype.slice,s={},u=0;function c(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new c(a.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(a.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r.setImmediate="function"==typeof t?t:function(e){var t=u++,n=!(arguments.length<2)&&o.call(arguments,1);return s[t]=!0,i(function(){s[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof n?n:function(e){delete s[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":62,timers:14}],15:[function(e,t,r){"use strict";t.exports=function(e){return function e(t){if(null===t||"object"!=typeof t||null!=t.toJSON)return JSON.stringify(t);if(Array.isArray(t)&&0===t.length)return"[]";if(Array.isArray(t)&&1===t.length)return"["+e(t[0])+"]";if(Array.isArray(t))return"["+t.reduce(function(t,r,n){return(t=1===n?e(t):t)+","+e(r)})+"]";var r=Object.keys(t);return 0===r.length?"{}":1===r.length?"{"+e(r[0])+":"+e(t[r[0]])+"}":"{"+r.sort().reduce(function(r,n,i){return(r=1===i?e(r)+":"+e(t[r]):r)+","+e(n)+":"+e(t[n])})+"}"}(e)}},{}],16:[function(e,t,r){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},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.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":19}],17:[function(e,t,r){r.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*v}},{}],18:[function(e,t,r){t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],19:[function(e,t,r){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],20:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],21:[function(e,t,r){"use strict";var n=e("./types"),i=n.isArray,a=n.isObject,o=n.isString,s=e("./util").asArray,u=e("./url").prependBase,c=e("./JsonLdError"),l=e("./ResolvedContext");function h(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function d(e){var t=e.context,r=e.base;if(t){var n=t["@context"];if(o(n))t["@context"]=u(r,n);else if(i(n))for(var s=0;s10)){e.next=3;break}throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===r.processingMode?"loading remote context failed":"context overflow",max:10});case 3:if(!u.has(n)){e.next=5;break}throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===r.processingMode?"recursive context inclusion":"context overflow",url:n});case 5:return u.add(n),e.prev=6,e.next=9,s(n);case 9:f=e.sent,l=f.document||null,o(l)&&(l=JSON.parse(l)),e.next=17;break;case 14:throw e.prev=14,e.t0=e.catch(6),new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:n,cause:e.t0});case 17:if(a(l)){e.next=19;break}throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:n});case 19:return e.abrupt("return",(l="@context"in l?{"@context":l["@context"]}:{"@context":{}},f.contextUrl&&(i(l["@context"])||(l["@context"]=[l["@context"]]),l["@context"].push(f.contextUrl)),{context:l,remoteDoc:f}));case 20:case"end":return e.stop()}},e,null,[[6,14]])})),function(e){return t.apply(this,arguments)})}]),e}()},{"./JsonLdError":22,"./ResolvedContext":27,"./types":41,"./url":42,"./util":43}],22:[function(e,t,r){"use strict";t.exports=function(e){i(r,e);var t=a(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"An unspecified JSON-LD error occurred.",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"jsonld.Error",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return S(this,r),(e=t.call(this,n)).name=i,e.message=n,e.details=a,e}return r}(u(Error))},{}],23:[function(e,t,r){"use strict";t.exports=function(e){var t=function(){function e(){S(this,e)}return j(e,[{key:"toString",value:function(){return"[object JsonLdProcessor]"}}]),e}();return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,r)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},{}],24:[function(e,t,r){"use strict";t.exports=e("rdf-canonize").NQuads},{"rdf-canonize":73}],25:[function(e,t,r){"use strict";var n,i=e("./constants"),a=i.RDF_LANGSTRING,o=i.RDF_PLAIN_LITERAL,s=i.RDF_OBJECT,u=i.RDF_XML_LITERAL,c=i.XSD_STRING;n="undefined"!=typeof Node?Node:{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},t.exports=function(){function t(){S(this,t)}return j(t,[{key:"parse",value:function(t){for(var r={"@default":[]},i=t.getSubjects(),l=0;l1&&(C=Array.from(C).sort()),P=r,F=w(C),e.prev=27,F.s();case 29:if((B=F.n()).done){e.next=39;break}if(U=B.value,G=L.compactIri({activeCtx:P,iri:U,relativeTo:{vocab:!0}}),z=x(O,G,"@context"),e.t1=c(z),e.t1){e.next=37;break}return e.next=36,S({activeCtx:r,localCtx:z,options:m,propagate:!1});case 36:r=e.sent;case 37:e.next=29;break;case 39:e.next=44;break;case 41:e.prev=41,e.t2=e.catch(27),F.e(e.t2);case 44:return e.prev=44,F.f(),e.finish(44);case 47:V=Object.keys(f).sort(),q=w(V),e.prev=49,q.s();case 51:if((K=q.n()).done){e.next=184;break}if(W=K.value,H=f[W],"@id"===W){e.next=180;break}if("@type"===W){e.next=174;break}if("@reverse"===W){e.next=167;break}if("@preserve"===W){e.next=161;break}if("@index"===W){e.next=155;break}if("@graph"===W||"@list"===W||"@included"===W||!k(W)){e.next=64;break}J=L.compactIri({activeCtx:r,iri:W,relativeTo:{vocab:!0}}),A(T,J,H),e.next=153;break;case 64:if(o(H)){e.next=66;break}throw new i("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");case 66:0===H.length&&(X=L.compactIri({activeCtx:r,iri:W,value:H,relativeTo:{vocab:!0},reverse:N}),Q=r.mappings.has(X)?r.mappings.get(X)["@nest"]:null,Y=T,Q&&(M(r,Q,m),s(T[Q])||(T[Q]={}),Y=T[Q]),A(Y,X,H,{propertyIsArray:!0})),Z=w(H),e.prev=68,Z.s();case 70:if(($=Z.n()).done){e.next=145;break}return ee=$.value,te=L.compactIri({activeCtx:r,iri:W,value:ee,relativeTo:{vocab:!0},reverse:N}),re=r.mappings.has(te)?r.mappings.get(te)["@nest"]:null,ne=T,re&&(M(r,re,m),s(T[re])||(T[re]={}),ne=T[re]),ie=x(r,te,"@container")||[],ae=p(ee),oe=h(ee),se=void 0,oe?se=ee["@list"]:ae&&(se=ee["@graph"]),e.next=80,L.compact({activeCtx:r,activeProperty:te,element:oe||ae?se:ee,options:m,compactionMap:j});case 80:if(ue=e.sent,!oe){e.next=86;break}if(o(ue)||(ue=[ue]),!ie.includes("@list")){e.next=85;break}return A(ne,te,ue,{valueIsArray:!0,allowDuplicate:!0}),e.abrupt("continue",143);case 85:ue=v({},L.compactIri({activeCtx:r,iri:"@list",relativeTo:{vocab:!0}}),ue),"@index"in ee&&(ue[L.compactIri({activeCtx:r,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]);case 86:if(!ae){e.next=90;break}ie.includes("@graph")&&(ie.includes("@id")||ie.includes("@index")&&g(ee))?(ce=void 0,ne.hasOwnProperty(te)?ce=ne[te]:ne[te]=ce={},le=(ie.includes("@id")?ee["@id"]:ee["@index"])||L.compactIri({activeCtx:r,iri:"@none",relativeTo:{vocab:!0}}),A(ce,le,ue,{propertyIsArray:!m.compactArrays||ie.includes("@set")})):ie.includes("@graph")&&g(ee)?(o(ue)&&ue.length>1&&(ue={"@included":ue}),A(ne,te,ue,{propertyIsArray:!m.compactArrays||ie.includes("@set")})):(o(ue)&&1===ue.length&&m.compactArrays&&(ue=ue[0]),ue=v({},L.compactIri({activeCtx:r,iri:"@graph",relativeTo:{vocab:!0}}),ue),"@id"in ee&&(ue[L.compactIri({activeCtx:r,iri:"@id",relativeTo:{vocab:!0}})]=ee["@id"]),"@index"in ee&&(ue[L.compactIri({activeCtx:r,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]),A(ne,te,ue,{propertyIsArray:!m.compactArrays||ie.includes("@set")})),e.next=143;break;case 90:if(!(ie.includes("@language")||ie.includes("@index")||ie.includes("@id")||ie.includes("@type"))){e.next=141;break}if(fe=void 0,he=void 0,ne.hasOwnProperty(te)?fe=ne[te]:ne[te]=fe={},!ie.includes("@language")){e.next=96;break}d(ue)&&(ue=ue["@value"]),he=ee["@language"],e.next=138;break;case 96:if(!ie.includes("@index")){e.next=117;break}if(de=x(r,te,"@index")||"@index",pe=L.compactIri({activeCtx:r,iri:de,relativeTo:{vocab:!0}}),"@index"!==de){e.next=102;break}he=ee["@index"],delete ue[pe],e.next=115;break;case 102:if(ye=void 0,ve=R(ue[de]||[]),ge=n(ve),he=ge[0],ye=ge.slice(1),!u(he)){e.next=114;break}e.t3=ye.length,e.next=0===e.t3?107:1===e.t3?109:111;break;case 107:return delete ue[de],e.abrupt("break",112);case 109:return ue[de]=ye[0],e.abrupt("break",112);case 111:ue[de]=ye;case 112:e.next=115;break;case 114:he=null;case 115:e.next=138;break;case 117:if(!ie.includes("@id")){e.next=122;break}be=L.compactIri({activeCtx:r,iri:"@id",relativeTo:{vocab:!0}}),he=ue[be],delete ue[be],e.next=138;break;case 122:if(!ie.includes("@type")){e.next=138;break}me=L.compactIri({activeCtx:r,iri:"@type",relativeTo:{vocab:!0}}),_e=void 0,e.t4=(t=R(ue[me]||[]),a=n(t),he=a[0],(_e=a.slice(1)).length),e.next=0===e.t4?128:1===e.t4?130:132;break;case 128:return delete ue[me],e.abrupt("break",133);case 130:return ue[me]=_e[0],e.abrupt("break",133);case 132:ue[me]=_e;case 133:if(e.t5=1===Object.keys(ue).length&&"@id"in ee,!e.t5){e.next=138;break}return e.next=137,L.compact({activeCtx:r,activeProperty:te,element:{"@id":ee["@id"]},options:m,compactionMap:j});case 137:ue=e.sent;case 138:he||(he=L.compactIri({activeCtx:r,iri:"@none",relativeTo:{vocab:!0}})),A(fe,he,ue,{propertyIsArray:ie.includes("@set")}),e.next=143;break;case 141:we=!m.compactArrays||ie.includes("@set")||ie.includes("@list")||o(ue)&&0===ue.length||"@list"===W||"@graph"===W,A(ne,te,ue,{propertyIsArray:we});case 143:e.next=70;break;case 145:e.next=150;break;case 147:e.prev=147,e.t6=e.catch(68),Z.e(e.t6);case 150:return e.prev=150,Z.f(),e.finish(150);case 153:e.next=159;break;case 155:if(!(x(r,l,"@container")||[]).includes("@index")){e.next=157;break}return e.abrupt("continue",182);case 157:xe=L.compactIri({activeCtx:r,iri:W,relativeTo:{vocab:!0}}),A(T,xe,H);case 159:e.next=165;break;case 161:return e.next=163,L.compact({activeCtx:r,activeProperty:l,element:H,options:m,compactionMap:j});case 163:ke=e.sent,o(ke)&&0===ke.length||A(T,W,ke);case 165:e.next=172;break;case 167:return e.next=169,L.compact({activeCtx:r,activeProperty:"@reverse",element:H,options:m,compactionMap:j});case 169:for(Ee in Se=e.sent)r.mappings.has(Ee)&&r.mappings.get(Ee).reverse&&(je=Se[Ee],Ie=(x(r,Ee,"@container")||[]).includes("@set")||!m.compactArrays,A(T,Ee,je,{propertyIsArray:Ie}),delete Se[Ee]);Object.keys(Se).length>0&&(Ne=L.compactIri({activeCtx:r,iri:W,relativeTo:{vocab:!0}}),A(T,Ne,Se));case 172:e.next=178;break;case 174:1===(Te=R(H).map(function(e){return L.compactIri({activeCtx:O,iri:e,relativeTo:{vocab:!0}})})).length&&(Te=Te[0]),Ae=L.compactIri({activeCtx:r,iri:"@type",relativeTo:{vocab:!0}}),Re=(x(r,Ae,"@container")||[]).includes("@set")&&E(r,1.1)||o(Te)&&0===H.length,A(T,Ae,Te,{propertyIsArray:Re});case 178:e.next=182;break;case 180:1===(Oe=R(H).map(function(e){return L.compactIri({activeCtx:r,iri:e,relativeTo:{vocab:!1},base:m.base})})).length&&(Oe=Oe[0]),T[L.compactIri({activeCtx:r,iri:"@id",relativeTo:{vocab:!0}})]=Oe;case 182:e.next=51;break;case 184:e.next=189;break;case 186:e.prev=186,e.t7=e.catch(49),q.e(e.t7);case 189:return e.prev=189,q.f(),e.finish(189);case 192:return e.abrupt("return",{v:T});case 193:case"end":return e.stop()}},e,null,[[27,41,44,47],[49,186,189,192],[68,147,150,153]])})(),"t3",29);case 29:if("object"!=typeof(D=e.t3)){e.next=32;break}return e.abrupt("return",D.v);case 32:return e.abrupt("return",f);case 33:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),L.compactIri=function(e){var t=e.activeCtx,r=e.iri,n=e.value,a=void 0===n?null:n,o=e.relativeTo,u=void 0===o?{vocab:!1}:o,c=e.reverse,l=void 0!==c&&c,f=e.base,v=void 0===f?null:f;if(null===r)return r;t.isPropertyTermScoped&&t.previousContext&&(t=t.previousContext);var g=t.getInverse();if(k(r)&&r in g&&"@none"in g[r]&&"@type"in g[r]["@none"]&&"@none"in g[r]["@none"]["@type"])return g[r]["@none"]["@type"]["@none"];if(u.vocab&&r in g){var y=t["@language"]||"@none",m=[];s(a)&&"@index"in a&&!("@graph"in a)&&m.push("@index","@index@set"),s(a)&&"@preserve"in a&&(a=a["@preserve"][0]),p(a)?("@index"in a&&m.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in a&&m.push("@graph@id","@graph@id@set"),m.push("@graph","@graph@set","@set"),"@index"in a||m.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in a||m.push("@graph@id","@graph@id@set")):s(a)&&!d(a)&&m.push("@id","@id@set","@type","@set@type");var _="@language",x="@null";if(l)_="@type",x="@reverse",m.push("@set");else if(h(a)){"@index"in a||m.push("@list");var S=a["@list"];if(0===S.length)_="@any",x="@none";else{for(var E=0===S.length?y:null,j=null,T=0;T=0;--q){var K,W=U[q],H=w(W.terms);try{for(H.s();!(K=H.n()).done;){var J=K.value,X=J+":"+r.substr(W.iri.length);t.mappings.get(J)._prefix&&(!t.mappings.has(X)||null===a&&t.mappings.get(X)["@id"]===r)&&(null===B||O(X,B)<0)&&(B=X)}}catch(te){H.e(te)}finally{H.f()}}if(null!==B)return B;var Q,Y=w(t.mappings);try{for(Y.s();!(Q=Y.n()).done;){var Z=b(Q.value,2),$=Z[0],ee=Z[1];if(ee&&ee._prefix&&r.startsWith($+":"))throw new i('Absolute IRI "'.concat(r,'" confused with prefix "').concat($,'".'),"jsonld.SyntaxError",{code:"IRI confused with prefix",context:t})}}catch(te){Y.e(te)}finally{Y.f()}return u.vocab?r:"@base"in t?t["@base"]?I(N(v,t["@base"]),r):r:I(v,r)},L.compactValue=function(e){var t=e.activeCtx,r=e.activeProperty,n=e.value,i=e.options;if(d(n)){var a=x(t,r,"@type"),o=x(t,r,"@language"),s=x(t,r,"@direction"),c=x(t,r,"@container")||[],l="@index"in n&&!c.includes("@index");if(!l&&"@none"!==a){if(n["@type"]===a)return n["@value"];if("@language"in n&&n["@language"]===o&&"@direction"in n&&n["@direction"]===s)return n["@value"];if("@language"in n&&n["@language"]===o)return n["@value"];if("@direction"in n&&n["@direction"]===s)return n["@value"]}var f=Object.keys(n).length,h=1===f||2===f&&"@index"in n&&!l,p="@language"in t,g=u(n["@value"]),y=t.mappings.has(r)&&null===t.mappings.get(r)["@language"];if(h&&"@none"!==a&&(!p||!g||y))return n["@value"];var b={};return l&&(b[L.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?b[L.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=L.compactIri({activeCtx:t,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(b[L.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(b[L.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),b[L.compactIri({activeCtx:t,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],b}var m=_(t,r,{vocab:!0},i),w=x(t,r,"@type"),k=L.compactIri({activeCtx:t,iri:n["@id"],relativeTo:{vocab:"@vocab"===w},base:i.base});return"@id"===w||"@vocab"===w||"@graph"===m?k:v({},L.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}}),k)}},{"./JsonLdError":22,"./context":30,"./graphTypes":37,"./types":41,"./url":42,"./util":43}],29:[function(e,t,r){"use strict";var n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#";t.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:n,RDF_LIST:n+"List",RDF_FIRST:n+"first",RDF_REST:n+"rest",RDF_NIL:n+"nil",RDF_TYPE:n+"type",RDF_PLAIN_LITERAL:n+"PlainLiteral",RDF_XML_LITERAL:n+"XMLLiteral",RDF_JSON_LITERAL:n+"JSON",RDF_OBJECT:n+"object",RDF_LANGSTRING:n+"langString",XSD:i,XSD_BOOLEAN:i+"boolean",XSD_DOUBLE:i+"double",XSD_INTEGER:i+"integer",XSD_STRING:i+"string"}},{}],30:[function(e,t,r){"use strict";var n=e("./util"),i=e("./JsonLdError"),a=e("./types"),o=a.isArray,s=a.isObject,u=a.isString,c=a.isUndefined,l=e("./url"),h=l.isAbsolute,d=l.isRelative,p=l.prependBase,v=e("./util"),y=v.asArray,m=v.compareShortestLeast,_=new Map,x=/^@[a-zA-Z]+$/,k={};function S(e,t,r,n,i,a){if(null===t||!u(t)||k.isKeyword(t))return t;if(t.match(x))return null;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&k.createTermDefinition({activeCtx:e,localCtx:n,term:t,defined:i,options:a}),(r=r||{}).vocab){var o=e.mappings.get(t);if(null===o)return null;if(s(o)&&"@id"in o)return o["@id"]}var c=t.indexOf(":");if(c>0){var l=t.substr(0,c),f=t.substr(c+1);if("_"===l||0===f.indexOf("//"))return t;n&&n.hasOwnProperty(l)&&k.createTermDefinition({activeCtx:e,localCtx:n,term:l,defined:i,options:a});var d=e.mappings.get(l);if(d&&d._prefix)return d["@id"]+f;if(h(t))return t}if(r.vocab&&"@vocab"in e)return e["@vocab"]+t;if(r.base&&"@base"in e){if(e["@base"])return p(p(a.base,e["@base"]),t)}else if(r.base)return p(a.base,t);return t}function E(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;var r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){if(e.length!==t.length)return!1;for(var n=0;n0,"@reverse"in t){if("@id"in t)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:n});if("@nest"in t)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:n});var j=t["@reverse"];if(!u(j))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:n});if(!k.isKeyword(j)&&j.match(x))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:j}),void(g?r.mappings.set(a,g):r.mappings.delete(a));var I=S(r,j,{vocab:!0,base:!1},n,c,l);if(!h(I))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:n});b["@id"]=I,b.reverse=!0}else if("@id"in t){var N=t["@id"];if(N&&!u(N))throw new i("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:n});if(null===N)b["@id"]=null;else{if(!k.isKeyword(N)&&N.match(x))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:N}),void(g?r.mappings.set(a,g):r.mappings.delete(a));if(N!==a){if(N=S(r,N,{vocab:!0,base:!1},n,c,l),!h(N)&&!k.isKeyword(N))throw new i("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:n});if(a.match(/(?::[^:])|\//)&&S(r,a,{vocab:!0,base:!1},n,new Map(c).set(a,!0),l)!==N)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:n});b["@id"]=N,b._prefix=y&&!b._termHasColon&&N.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in b))if(b._termHasColon){var T=a.substr(0,w);if(n.hasOwnProperty(T)&&k.createTermDefinition({activeCtx:r,localCtx:n,term:T,defined:c,options:l}),r.mappings.has(T)){var A=a.substr(w+1);b["@id"]=r.mappings.get(T)["@id"]+A}else b["@id"]=a}else if("@type"===a)b["@id"]=a;else{if(!("@vocab"in r))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:n,term:a});b["@id"]=r["@vocab"]+a}if((!0===t["@protected"]||!0===c.get("@protected")&&!1!==t["@protected"])&&(r.protected[a]=!0,b.protected=!0),c.set(a,!0),"@type"in t){var R=t["@type"];if(!u(R))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:n});if("@json"===R||"@none"===R){if(k.processingMode(r,1))throw new i('Invalid JSON-LD syntax; an @context @type value must not be "'.concat(R,'" in JSON-LD 1.0 mode.'),"jsonld.SyntaxError",{code:"invalid type mapping",context:n})}else if("@id"!==R&&"@vocab"!==R){if(R=S(r,R,{vocab:!0,base:!1},n,c,l),!h(R))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:n});if(0===R.indexOf("_:"))throw new i("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:n})}b["@type"]=R}if("@container"in t){var O=u(t["@container"])?[t["@container"]]:t["@container"]||[],L=["@list","@set","@index","@language"],M=!0,D=O.includes("@set");if(k.processingMode(r,1.1)){if(L.push("@graph","@id","@type"),O.includes("@list")){if(1!==O.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:n})}else if(O.includes("@graph")){if(O.some(function(e){return"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e}))throw new i("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:n})}else M&=O.length<=(D?2:1);if(O.includes("@type")&&(b["@type"]=b["@type"]||"@id",!["@id","@vocab"].includes(b["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:n})}else M&=!o(t["@container"]),M&=O.length<=1;if(M&=O.every(function(e){return L.includes(e)}),!(M&=!(D&&O.includes("@list"))))throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+L.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:n});if(b.reverse&&!O.every(function(e){return["@index","@set"].includes(e)}))throw new i("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:n});b["@container"]=O}if("@index"in t){if(!("@container"in t)||!b["@container"].includes("@index"))throw new i('Invalid JSON-LD syntax; @index without @index in @container: "'.concat(t["@index"],'" on term "').concat(a,'".'),"jsonld.SyntaxError",{code:"invalid term definition",context:n});if(!u(t["@index"])||0===t["@index"].indexOf("@"))throw new i('Invalid JSON-LD syntax; @index must expand to an IRI: "'.concat(t["@index"],'" on term "').concat(a,'".'),"jsonld.SyntaxError",{code:"invalid term definition",context:n});b["@index"]=t["@index"]}if("@context"in t&&(b["@context"]=t["@context"]),"@language"in t&&!("@type"in t)){var C=t["@language"];if(null!==C&&!u(C))throw new i("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:n});null!==C&&(C=C.toLowerCase()),b["@language"]=C}if("@prefix"in t){if(a.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:n});if(k.isKeyword(b["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:n});if("boolean"!=typeof t["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:n});b._prefix=!0===t["@prefix"]}if("@direction"in t){var P=t["@direction"];if(null!==P&&"ltr"!==P&&"rtl"!==P)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:n});b["@direction"]=P}if("@nest"in t){var F=t["@nest"];if(!u(F)||"@nest"!==F&&0===F.indexOf("@"))throw new i("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:n});b["@nest"]=F}var B=b["@id"];if("@context"===B||"@preserve"===B)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:n});if(g&&g.protected&&!d&&(r.protected[a]=!0,b.protected=!0,!E(g,b))){var U=l&&l.protectedMode||"error";if("error"===U)throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:n,term:a});if("warn"===U)return void console.warn("WARNING: protected term redefinition",{term:a});throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:n,term:a,protectedMode:U})}},k.expandIri=function(e,t,r,n){return S(e,t,r,void 0,void 0,n)},k.getInitialContext=function(e){var t=JSON.stringify({processingMode:e.processingMode}),r=_.get(t);if(r)return r;var i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){if(this.inverse)return this.inverse;var e,t=this.inverse={},r=this.fastCurieMap={},n={},i=(this["@language"]||"@none").toLowerCase(),s=this["@direction"],u=this.mappings,c=w(g(u.keys()).sort(m));try{for(c.s();!(e=c.n()).done;){var l=e.value,f=u.get(l);if(null!==f){var h=f["@container"]||"@none";if(h=[].concat(h).sort().join(""),null!==f["@id"]){var d,p=w(y(f["@id"]));try{for(p.s();!(d=p.n()).done;){var v=d.value,b=t[v],_=k.isKeyword(v);if(b)_||f._termHasColon||n[v].push(l);else if(t[v]=b={},!_&&!f._termHasColon){n[v]=[l];var x={iri:v,terms:n[v]};v[0]in r?r[v[0]].push(x):r[v[0]]=[x]}if(b[h]||(b[h]={"@language":{},"@type":{},"@any":{}}),o(l,(b=b[h])["@any"],"@none"),f.reverse)o(l,b["@type"],"@reverse");else if("@none"===f["@type"])o(l,b["@any"],"@none"),o(l,b["@language"],"@none"),o(l,b["@type"],"@none");else if("@type"in f)o(l,b["@type"],f["@type"]);else if("@language"in f&&"@direction"in f){var S=f["@language"],E=f["@direction"];o(l,b["@language"],S&&E?"".concat(S,"_").concat(E).toLowerCase():S?S.toLowerCase():E?"_".concat(E):"@null")}else"@language"in f?o(l,b["@language"],(f["@language"]||"@null").toLowerCase()):"@direction"in f?o(l,b["@language"],f["@direction"]?"_".concat(f["@direction"]):"@none"):s?(o(l,b["@language"],"_".concat(s)),o(l,b["@language"],"@none"),o(l,b["@type"],"@none")):(o(l,b["@language"],i),o(l,b["@language"],"@none"),o(l,b["@type"],"@none"))}}catch(I){p.e(I)}finally{p.f()}}}}}catch(I){c.e(I)}finally{c.f()}for(var j in r)a(r,j,1);return t},clone:function(){var e={};return e.mappings=n.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=n.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===_.size&&_.clear(),_.set(t,i),i;function a(e,t,r){var n,i,o,s=e[t],u=e[t]={},c=w(s);try{for(c.s();!(o=c.n()).done;){var l=o.value;(i=r>=(n=l.iri).length?"":n[r])in u?u[i].push(l):u[i]=[l]}}catch(h){c.e(h)}finally{c.f()}for(var f in u)""!==f&&a(u,f,r+1)}function o(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},k.getContextValue=function(e,t,r){if(null===t){if("@context"===r)return;return null}if(e.mappings.has(t)){var n=e.mappings.get(t);if(c(r))return n;if(n.hasOwnProperty(r))return n[r]}return"@language"===r&&r in e||"@direction"===r&&r in e?e[r]:"@context"!==r?null:void 0},k.processingMode=function(e,t){return t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode},k.isKeyword=function(e){if(!u(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},{"./JsonLdError":22,"./types":41,"./url":42,"./util":43}],31:[function(e,t,r){"use strict";var n=e("../util"),i=n.parseLinkHeader,a=n.buildHeaders,o=e("../constants").LINK_HEADER_CONTEXT,s=e("../JsonLdError"),u=e("../RequestQueue"),c=e("../url").prependBase;t.exports=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{strictSSL:!0,maxRedirects:-1,headers:{}},r=t.secure,n=t.strictSSL,l=void 0===n||n,h=t.maxRedirects,d=void 0===h?-1:h,p=t.request,v=t.headers,g=void 0===v?{}:v;g=a(g),p=p||e("request");var y=e("http");return(new u).wrapLoader(function(e){return b(e,[])});function b(e,t){return m.apply(this,arguments)}function m(){return(m=f(regeneratorRuntime.mark(function e(t,n){var a,u,f,h,v,m,_,w;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0===t.indexOf("http:")||0===t.indexOf("https:")){e.next=2;break}throw new s('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:t});case 2:if(!r||0===t.indexOf("https")){e.next=4;break}throw new s('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:t});case 4:if(null===(u=null)){e.next=7;break}return e.abrupt("return",u);case 7:return f=null,e.prev=8,e.next=11,function(e,t){return new Promise(function(r,n){e(t,function(e,t,i){e?n(e):r({res:t,body:i})})})}(p,{url:t,headers:g,strictSSL:l,followRedirect:!1});case 11:a=e.sent,e.next=17;break;case 14:throw e.prev=14,e.t0=e.catch(8),new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:t,cause:e.t0});case 17:if(v=(h=a).res,m=h.body,u={contextUrl:null,documentUrl:t,document:m||null},!(v.statusCode>=400)){e.next=20;break}throw new s('URL "'.concat(t,'" could not be dereferenced: ').concat(y.STATUS_CODES[v.statusCode]),"jsonld.InvalidUrl",{code:"loading document failed",url:t,httpStatusCode:v.statusCode});case 20:if(!v.headers.link||"application/ld+json"===v.headers["content-type"]){e.next=25;break}if(_=i(v.headers.link),w=_[o],!Array.isArray(w)){e.next=24;break}throw new s("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:t});case 24:w&&(u.contextUrl=w.target),(f=_.alternate)&&"application/ld+json"==f.type&&!(v.headers["content-type"]||"").match(/^application\/(\w*\+)?json$/)&&(v.headers.location=c(t,f.target));case 25:if(!(f||v.statusCode>=300&&v.statusCode<400)||!v.headers.location){e.next=31;break}if(n.length!==d){e.next=28;break}throw new s("URL could not be dereferenced; there were too many redirects.","jsonld.TooManyRedirects",{code:"loading document failed",url:t,httpStatusCode:v.statusCode,redirects:n});case 28:if(-1===n.indexOf(t)){e.next=30;break}throw new s("URL could not be dereferenced; infinite redirection was detected.","jsonld.InfiniteRedirectDetected",{code:"recursive context inclusion",url:t,httpStatusCode:v.statusCode,redirects:n});case 30:return e.abrupt("return",(n.push(t),b(v.headers.location,n)));case 31:return e.abrupt("return",(n.push(t),u));case 32:case"end":return e.stop()}},e,null,[[8,14]])}))).apply(this,arguments)}}},{"../JsonLdError":22,"../RequestQueue":26,"../constants":29,"../url":42,"../util":43,http:11,request:11}],32:[function(e,t,r){"use strict";var n=e("../util"),i=n.parseLinkHeader,a=n.buildHeaders,o=e("../constants").LINK_HEADER_CONTEXT,s=e("../JsonLdError"),u=e("../RequestQueue"),c=e("../url").prependBase,l=/(^|(\r\n))link:/i;t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{headers:{}},t=e.secure,r=e.headers,n=void 0===r?{}:r,h=e.xhr;return n=a(n),(new u).wrapLoader(function(){var e=f(regeneratorRuntime.mark(function e(a){var u,f,d,p,v,g,y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0===a.indexOf("http:")||0===a.indexOf("https:")){e.next=2;break}throw new s('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:a});case 2:if(!t||0===a.indexOf("https")){e.next=4;break}throw new s('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:a});case 4:return e.prev=4,e.next=7,function(e,t,r){var n=new(e=e||XMLHttpRequest);return new Promise(function(e,i){for(var a in n.onload=function(){return e(n)},n.onerror=function(e){return i(e)},n.open("GET",t,!0),r)n.setRequestHeader(a,r[a]);n.send()})}(h,a,n);case 7:u=e.sent,e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(4),new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:a,cause:e.t0});case 13:if(!(u.status>=400)){e.next=15;break}throw new s("URL could not be dereferenced: "+u.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:a,httpStatusCode:u.status});case 15:if(f={contextUrl:null,documentUrl:a,document:u.response},d=null,p=u.getResponseHeader("Content-Type"),l.test(u.getAllResponseHeaders())&&(v=u.getResponseHeader("Link")),!v||"application/ld+json"===p){e.next=28;break}if(g=i(v),y=g[o],!Array.isArray(y)){e.next=21;break}throw new s("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:a});case 21:if(y&&(f.contextUrl=y.target),d=g.alternate,e.t1=d&&"application/ld+json"==d.type&&!(p||"").match(/^application\/(\w*\+)?json$/),!e.t1){e.next=28;break}return e.next=27,r(c(a,d.target));case 27:f=e.sent;case 28:return e.abrupt("return",f);case 29:case"end":return e.stop()}},e,null,[[4,10]])}));function r(t){return e.apply(this,arguments)}return r}())}},{"../JsonLdError":22,"../RequestQueue":26,"../constants":29,"../url":42,"../util":43}],33:[function(e,t,r){"use strict";var n=e("./JsonLdError"),i=e("./types"),a=i.isArray,o=i.isObject,s=i.isEmptyObject,u=i.isString,c=i.isUndefined,l=e("./graphTypes"),h=l.isList,d=l.isValue,p=l.isGraph,v=l.isSubject,g=e("./context"),y=g.expandIri,m=g.getContextValue,_=g.isKeyword,x=g.process,k=g.processingMode,S=e("./url").isAbsolute,E=e("./util"),j=E.addValue,I=E.asArray,N=E.getValues,T=E.validateTypeValue,A={};t.exports=A;var R=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function O(e){return L.apply(this,arguments)}function L(){return(L=f(regeneratorRuntime.mark(function e(t){var r,i,l,f,p,g,E,N,L,M,P,F,B,U,G,z,V,q,K,W,H,J,X,Q,Y,Z,$,ee,te,re,ne,ie,ae,oe,se,ue,ce,le,fe,he,de,pe,ve,ge,ye,be,me,_e,we,xe,ke,Se,Ee;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=t.activeCtx,i=t.activeProperty,l=t.expandedActiveProperty,f=t.element,p=t.expandedParent,g=t.options,E=void 0===g?{}:g,N=t.insideList,L=t.typeKey,M=t.typeScopedContext,P=t.expansionMap,F=Object.keys(f).sort(),B=[],G=f[L]&&"@json"===y(r,a(f[L])?f[L][0]:f[L],{vocab:!0},E),z=w(F),e.prev=4,z.s();case 6:if((V=z.n()).done){e.next=188;break}if(q=V.value,K=void 0,W=f[q],"@context"!==q){e.next=11;break}return e.abrupt("continue",186);case 11:if(null!==(H=y(r,q,{vocab:!0},E))&&(S(H)||_(H))||void 0!==(H=P({unmappedProperty:q,activeCtx:r,activeProperty:i,parent:f,options:E,insideList:N,value:W,expandedParent:p}))){e.next=14;break}return e.abrupt("continue",186);case 14:if(!_(H)){e.next=19;break}if("@reverse"!==l){e.next=17;break}throw new n("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:W});case 17:if(!(H in p)||"@included"===H||"@type"===H){e.next=19;break}throw new n("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:H});case 19:if("@id"!==H){e.next=34;break}if(u(W)){e.next=32;break}if(E.isFrame){e.next=23;break}throw new n('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:W});case 23:if(!o(W)){e.next=28;break}if(s(W)){e.next=26;break}throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:W});case 26:e.next=32;break;case 28:if(a(W)){e.next=30;break}throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:W});case 30:if(W.every(function(e){return u(e)})){e.next=32;break}throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:W});case 32:return j(p,"@id",I(W).map(function(e){return u(e)?y(r,e,{base:!0},E):e}),{propertyIsArray:E.isFrame}),e.abrupt("continue",186);case 34:if("@type"!==H){e.next=37;break}return o(W)&&(W=Object.fromEntries(Object.entries(W).map(function(e){var t=b(e,2),r=t[0],n=t[1];return[y(M,r,{vocab:!0}),I(n).map(function(e){return y(M,e,{base:!0,vocab:!0})})]}))),T(W,E.isFrame),j(p,"@type",I(W).map(function(e){return u(e)?y(M,e,{base:!0,vocab:!0},E):e}),{propertyIsArray:E.isFrame}),e.abrupt("continue",186);case 37:if("@included"!==H||!k(r,1.1)){e.next=47;break}return e.t0=I,e.next=41,A.expand({activeCtx:r,activeProperty:i,element:W,options:E,expansionMap:P});case 41:if(e.t1=e.sent,(J=(0,e.t0)(e.t1)).every(function(e){return v(e)})){e.next=45;break}throw new n("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:W});case 45:return j(p,"@included",J,{propertyIsArray:!0}),e.abrupt("continue",186);case 47:if("@graph"!==H||o(W)||a(W)){e.next=49;break}throw new n('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:W});case 49:if("@value"!==H){e.next=52;break}return U=W,G&&k(r,1.1)?p["@value"]=W:j(p,"@value",W,{propertyIsArray:E.isFrame}),e.abrupt("continue",186);case 52:if("@language"!==H){e.next=62;break}if(null!==W){e.next=55;break}return e.abrupt("continue",186);case 55:if(u(W)||E.isFrame){e.next=57;break}throw new n('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:W});case 57:W=I(W).map(function(e){return u(e)?e.toLowerCase():e}),X=w(W);try{for(X.s();!(Q=X.n()).done;)Y=Q.value,u(Y)&&!Y.match(R)&&console.warn("@language must be valid BCP47: ".concat(Y))}catch(je){X.e(je)}finally{X.f()}return j(p,"@language",W,{propertyIsArray:E.isFrame}),e.abrupt("continue",186);case 62:if("@direction"!==H){e.next=85;break}if(u(W)||E.isFrame){e.next=65;break}throw new n('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:W});case 65:W=I(W),Z=w(W),e.prev=67,Z.s();case 69:if(($=Z.n()).done){e.next=75;break}if(ee=$.value,!u(ee)||"ltr"===ee||"rtl"===ee){e.next=73;break}throw new n('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:W});case 73:e.next=69;break;case 75:e.next=80;break;case 77:e.prev=77,e.t2=e.catch(67),Z.e(e.t2);case 80:return e.prev=80,Z.f(),e.finish(80);case 83:return j(p,"@direction",W,{propertyIsArray:E.isFrame}),e.abrupt("continue",186);case 85:if("@index"!==H){e.next=90;break}if(u(W)){e.next=88;break}throw new n('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:W});case 88:return j(p,"@index",W),e.abrupt("continue",186);case 90:if("@reverse"!==H){e.next=118;break}if(o(W)){e.next=93;break}throw new n('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:W});case 93:return e.next=95,A.expand({activeCtx:r,activeProperty:"@reverse",element:W,options:E,expansionMap:P});case 95:if(!("@reverse"in(K=e.sent))){e.next=98;break}for(te in K["@reverse"])j(p,te,K["@reverse"][te],{propertyIsArray:!0});case 98:re=p["@reverse"]||null,e.t3=regeneratorRuntime.keys(K);case 100:if((e.t4=e.t3()).done){e.next=117;break}if("@reverse"!==(ne=e.t4.value)){e.next=104;break}return e.abrupt("continue",100);case 104:null===re&&(re=p["@reverse"]={}),j(re,ne,[],{propertyIsArray:!0}),ie=K[ne],ae=0;case 107:if(!(ae1?Q.slice().sort():Q:[Q],Z=w(Y),e.prev=81,Z.s();case 83:if(($=Z.n()).done){e.next=93;break}if(ee=$.value,te=m(E,ee,"@context"),e.t5=c(te),e.t5){e.next=91;break}return e.next=90,x({activeCtx:r,localCtx:te,options:d,propagate:!1});case 90:r=e.sent;case 91:e.next=83;break;case 93:e.next=98;break;case 95:e.prev=95,e.t6=e.catch(81),Z.e(e.t6);case 98:return e.prev=98,Z.f(),e.finish(98);case 101:e.next=75;break;case 103:e.next=108;break;case 105:e.prev=105,e.t7=e.catch(73),H.e(e.t7);case 108:return e.prev=108,H.f(),e.finish(108);case 111:return re={},e.next=114,O({activeCtx:r,activeProperty:l,expandedActiveProperty:F,element:f,expandedParent:re,options:d,insideList:v,typeKey:W,typeScopedContext:E,expansionMap:T});case 114:if(U=Object.keys(re),ne=U.length,!("@value"in re)){e.next=140;break}if(!("@type"in re)||!("@language"in re)&&!("@direction"in re)){e.next=119;break}throw new n('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:re});case 119:if(ie=ne-1,"@type"in re&&(ie-=1),"@index"in re&&(ie-=1),"@language"in re&&(ie-=1),"@direction"in re&&(ie-=1),0===ie){e.next=122;break}throw new n('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:re});case 122:if(ae=null===re["@value"]?[]:I(re["@value"]),oe=N(re,"@type"),!k(r,1.1)||!oe.includes("@json")||1!==oe.length){e.next=127;break}e.next=138;break;case 127:if(0!==ae.length){e.next=134;break}return e.next=130,T({unmappedValue:re,activeCtx:r,activeProperty:l,element:f,options:d,insideList:v});case 130:se=e.sent,re=void 0!==se?se:null,e.next=138;break;case 134:if(ae.every(function(e){return u(e)||s(e)})||!("@language"in re)){e.next=136;break}throw new n("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:re});case 136:if(oe.every(function(e){return S(e)&&!(u(e)&&0===e.indexOf("_:"))||s(e)})){e.next=138;break}throw new n('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:re});case 138:e.next=155;break;case 140:if(!("@type"in re)||a(re["@type"])){e.next=144;break}re["@type"]=[re["@type"]],e.next=155;break;case 144:if(!("@set"in re)&&!("@list"in re)){e.next=150;break}if(!(ne>1)||2===ne&&"@index"in re){e.next=147;break}throw new n('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:re});case 147:"@set"in re&&(re=re["@set"],U=Object.keys(re),ne=U.length),e.next=155;break;case 150:if(1!==ne||!("@language"in re)){e.next=155;break}return e.next=153,T(re,{unmappedValue:re,activeCtx:r,activeProperty:l,element:f,options:d,insideList:v});case 153:ue=e.sent,re=void 0!==ue?ue:null;case 155:if(!o(re)||d.keepFreeFloatingNodes||v||null!==l&&"@graph"!==F||!(0===ne||"@value"in re||"@list"in re||1===ne&&"@id"in re)){e.next=160;break}return e.next=158,T({unmappedValue:re,activeCtx:r,activeProperty:l,element:f,options:d,insideList:v});case 158:ce=e.sent,re=void 0!==ce?ce:null;case 160:return e.abrupt("return",re);case 161:case"end":return e.stop()}},e,null,[[38,53,56,59],[73,105,108,111],[81,95,98,101]])}));return function(t){return e.apply(this,arguments)}}()},{"./JsonLdError":22,"./context":30,"./graphTypes":37,"./types":41,"./url":42,"./util":43}],34:[function(e,t,r){"use strict";var n=e("./graphTypes").isSubjectReference,i=e("./nodeMap").createMergedNodeMap,a={};t.exports=a,a.flatten=function(e){for(var t=i(e),r=[],a=Object.keys(t).sort(),o=0;o=0;--n){var i=r[n];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function y(e,t,r){var n="@"+r,i=n in e?e[n][0]:t[r];if("embed"===r)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function b(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new c("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0]){var t,r=w(s.asArray(e[0]["@id"]));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(!o.isObject(n)&&!u.isAbsolute(n)||o.isString(n)&&0===n.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}catch(f){r.e(f)}finally{r.f()}}if("@type"in e[0]){var i,a=w(s.asArray(e[0]["@type"]));try{for(a.s();!(i=a.n()).done;){var l=i.value;if(!o.isObject(l)&&!u.isAbsolute(l)||o.isString(l)&&0===l.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}catch(f){a.e(f)}finally{a.f()}}}function m(e,t,r,n){var u=!0,c=!1;for(var l in r){var f=!1,h=s.getValues(t,l),d=0===s.getValues(r,l).length;if("@id"===l){if(o.isEmptyObject(r["@id"][0]||{})?f=!0:r["@id"].length>=0&&(f=r["@id"].includes(h[0])),!n.requireAll)return f}else if("@type"===l){if(u=!1,d){if(h.length>0)return!1;f=!0}else if(1===r["@type"].length&&o.isEmptyObject(r["@type"][0]))f=h.length>0;else{var p,v=w(r["@type"]);try{var g=function(){var e=p.value;f=!(!o.isObject(e)||!("@default"in e))||f||h.some(function(t){return t===e})};for(v.s();!(p=v.n()).done;)g()}catch(m){v.e(m)}finally{v.f()}}if(!n.requireAll)return f}else{if(i(l))continue;var y=function(){var t=s.getValues(r,l)[0],i=!1;if(t&&(b([t]),i="@default"in t),u=!1,0===h.length&&i)return"continue";if(h.length>0&&d)return{v:!1};if(void 0===t){if(h.length>0)return{v:!1};f=!0}else if(a.isList(t)){var c=t["@list"][0];if(a.isList(h[0])){var p=h[0]["@list"];a.isValue(c)?f=p.some(function(e){return E(c,e)}):(a.isSubject(c)||a.isSubjectReference(c))&&(f=p.some(function(t){return S(e,c,t,n)}))}}else f=a.isValue(t)?h.some(function(e){return E(t,e)}):a.isSubjectReference(t)?h.some(function(r){return S(e,t,r,n)}):!!o.isObject(t)&&h.length>0}();if("continue"===y)continue;if("object"==typeof y)return y.v}if(!f&&n.requireAll)return!1;c=c||f}return u||c}function _(e,t){var r=e.uniqueEmbeds[e.graph],n=r[t],i=n.parent,a=n.property,u={"@id":t};if(o.isArray(i)){for(var c=0;c4&&void 0!==arguments[4]?arguments[4]:null;b(n);var f=e.options,h={embed:y(n=n[0],f,"embed"),explicit:y(n,f,"explicit"),requireAll:y(n,f,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});var x,S=e.link[e.graph],j=function(e,t,r,n){var i,a={},o=w(t);try{for(o.s();!(i=o.n()).done;){var s=i.value,u=e.graphMap[e.graph][s];m(e,u,r,n)&&(a[s]=u)}}catch(c){o.e(c)}finally{o.f()}return a}(e,t,n,h),I=Object.keys(j).sort(),N=w(I);try{var T=function(){var b=x.value,m=j[b];if(null===l?e.uniqueEmbeds=v({},e.graph,{}):e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===h.embed&&b in S)return k(u,l,S[b]),"continue";var I={"@id":b};if(0===b.indexOf("_:")&&s.addValue(e.bnodeMap,b,I,{propertyIsArray:!0}),S[b]=I,("@first"===h.embed||"@last"===h.embed)&&e.is11)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(b))if(!e.embedded||"@never"!==h.embed&&!g(m,e.graph,e.subjectStack))if(!e.embedded||"@first"!=h.embed&&"@once"!=h.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(b)){if("@last"===h.embed&&b in e.uniqueEmbeds[e.graph]&&_(e,b),e.uniqueEmbeds[e.graph][b]={parent:u,property:l},e.subjectStack.push({subject:m,graph:e.graph}),b in e.graphMap){var N=!1,T=null;"@graph"in n?(T=n["@graph"][0],N=!("@merged"===b||"@default"===b),o.isObject(T)||(T={})):(N="@merged"!==e.graph,T={}),N&&d.frame(r(r({},e),{},{graph:b,embedded:!1}),Object.keys(e.graphMap[b]).sort(),[T],I,"@graph")}"@included"in n&&d.frame(r(r({},e),{},{embedded:!1}),t,n["@included"],I,"@included");var A,R=w(Object.keys(m).sort());try{for(R.s();!(A=R.n()).done;){var O=A.value;if(i(O)){if(I[O]=s.clone(m[O]),"@type"===O){var L,M=w(m["@type"]);try{for(M.s();!(L=M.n()).done;){var D=L.value;0===D.indexOf("_:")&&s.addValue(e.bnodeMap,D,I,{propertyIsArray:!0})}}catch(ne){M.e(ne)}finally{M.f()}}}else if(!h.explicit||O in n){var C,P=w(m[O]);try{for(P.s();!(C=P.n()).done;){var F=C.value,B=O in n?n[O]:p(h);if(a.isList(F)){var U=n[O]&&n[O][0]&&n[O][0]["@list"]?n[O][0]["@list"]:p(h),G={"@list":[]};k(I,O,G);var z,V=w(F["@list"]);try{for(V.s();!(z=V.n()).done;){var q=z.value;a.isSubjectReference(q)?d.frame(r(r({},e),{},{embedded:!0}),[q["@id"]],U,G,"@list"):k(G,"@list",s.clone(q))}}catch(ne){V.e(ne)}finally{V.f()}}else a.isSubjectReference(F)?d.frame(r(r({},e),{},{embedded:!0}),[F["@id"]],B,I,O):E(B[0],F)&&k(I,O,s.clone(F))}}catch(ne){P.e(ne)}finally{P.f()}}}}catch(ne){R.e(ne)}finally{R.f()}var K,W=w(Object.keys(n).sort());try{for(W.s();!(K=W.n()).done;){var H=K.value;if("@type"===H){if(!o.isObject(n[H][0])||!("@default"in n[H][0]))continue}else if(i(H))continue;var J=n[H][0]||{};if(!y(J,f,"omitDefault")&&!(H in I)){var X="@null";"@default"in J&&(X=s.clone(J["@default"])),o.isArray(X)||(X=[X]),I[H]=[{"@preserve":X}]}}}catch(ne){W.e(ne)}finally{W.f()}var Q,Y=w(Object.keys(n["@reverse"]||{}).sort());try{for(Y.s();!(Q=Y.n()).done;)for(var Z=Q.value,$=n["@reverse"][Z],ee=0,te=Object.keys(e.subjects);ee0&&(i["@language"]=c,c.match(_)||console.warn("@language must be valid BCP47: ".concat(c))),i["@direction"]=l}else o!==m&&(i["@type"]=o)}return i}t.exports=x,x.fromRDF=function(){var e=f(regeneratorRuntime.mark(function e(t,r){var n,s,f,p,v,g,y,b,m,_,x,S,E,j,I,N,T,A,R,O,L,M,D,C,P,F,B,U,G,z,V,q,K,W,H,J,X,Q,Y,Z,$,ee,te,re,ne,ie,ae,oe,se;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=r.useRdfType,s=void 0!==n&&n,f=r.useNativeTypes,p=void 0!==f&&f,v=r.rdfDirection,g=void 0===v?null:v,b={"@default":y={}},m={},_=w(t),e.prev=3,_.s();case 5:if((x=_.n()).done){e.next=19;break}if(S=x.value,(E="DefaultGraph"===S.graph.termType?"@default":S.graph.value)in b||(b[E]={}),"@default"===E||E in y||(y[E]={"@id":E}),j=b[E],I=S.subject.value,N=S.predicate.value,T=S.object,I in j||(j[I]={"@id":I}),A=j[I],(R=T.termType.endsWith("Node"))&&!(T.value in j)&&(j[T.value]={"@id":T.value}),N!==d||s||!R){e.next=15;break}return o.addValue(A,"@type",T.value,{propertyIsArray:!0}),e.abrupt("continue",17);case 15:O=k(T,p,g),o.addValue(A,N,O,{propertyIsArray:!0}),R&&(T.value===h?("usages"in(L=j[T.value])||(L.usages=[]),L.usages.push({node:A,property:N,value:O})):m[T.value]=!(T.value in m)&&{node:A,property:N,value:O});case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(3),_.e(e.t0);case 24:return e.prev=24,_.f(),e.finish(24);case 27:e.t1=regeneratorRuntime.keys(b);case 28:if((e.t2=e.t1()).done){e.next=37;break}if(M=e.t2.value,D=b[M],h in D){e.next=33;break}return e.abrupt("continue",28);case 33:if((C=D[h]).usages){P=w(C.usages);try{for(P.s();!(F=P.n()).done;){for(B=F.value,U=B.node,G=B.property,z=B.value,V=[],q=[],K=Object.keys(U).length;G===l&&a.isObject(m[U["@id"]])&&a.isArray(U[c])&&1===U[c].length&&a.isArray(U[l])&&1===U[l].length&&(3===K||4===K&&a.isArray(U["@type"])&&1===U["@type"].length&&U["@type"][0]===u)&&(V.push(U[c][0]),q.push(U["@id"]),B=m[U["@id"]],U=B.node,G=B.property,z=B.value,K=Object.keys(U).length,i.isBlankNode(U)););for(delete z["@id"],z["@list"]=V.reverse(),W=0,H=q;W1||!("@id"in e))},i.isSubjectReference=function(e){return n.isObject(e)&&1===Object.keys(e).length&&"@id"in e},i.isValue=function(e){return n.isObject(e)&&"@value"in e},i.isList=function(e){return n.isObject(e)&&"@list"in e},i.isGraph=function(e){return n.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(function(e){return"@id"!==e&&"@index"!==e}).length},i.isSimpleGraph=function(e){return i.isGraph(e)&&!("@id"in e)},i.isBlankNode=function(e){return!!n.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))}},{"./types":41}],38:[function(t,n,i){(function(i,a){var o=t("rdf-canonize"),s=t("./util"),u=t("./ContextResolver"),c=s.IdentifierIssuer,l=t("./JsonLdError"),h=t("lru-cache"),d=t("./NQuads"),p=t("./Rdfa"),v=t("./expand").expand,g=t("./flatten").flatten,y=t("./fromRdf").fromRDF,b=t("./toRdf").toRDF,m=t("./frame"),_=m.frameMergedOrDefault,w=m.cleanupNull,x=t("./types"),k=x.isArray,S=x.isObject,E=x.isString,j=t("./graphTypes").isSubjectReference,I=t("./context"),N=I.expandIri,T=I.getInitialContext,A=I.process,R=I.processingMode,O=t("./compact"),L=O.compact,M=O.compactIri,D=t("./nodeMap"),C=D.createNodeMap,P=D.createMergedNodeMap,F=D.mergeNodeMaps,B=void 0!==i&&i.versions&&i.versions.node,U=!B&&("undefined"!=typeof window||"undefined"!=typeof self),G=function(n){var i={},m=new h({max:100});function x(t,r){var i=r.documentLoader,a=void 0===i?n.documentLoader:i,o=e(r,["documentLoader"]);return Object.assign({},{documentLoader:a},o,t)}return n.compact=function(){var e=f(regeneratorRuntime.mark(function e(t,r,i){var a,o,f,h,d,p,v,g,y,b,_=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(_.length<2)){e.next=2;break}throw new TypeError("Could not compact, too few arguments.");case 2:if(null!==r){e.next=4;break}throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});case 4:if(null!==t){e.next=6;break}return e.abrupt("return",null);case 6:if((i=x(i,{base:E(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new c("_:b"),contextResolver:new u({sharedCache:m})})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,!i.skipExpansion){e.next=12;break}e.t0=t,e.next=15;break;case 12:return e.next=14,n.expand(t,i);case 14:e.t0=e.sent;case 15:return a=e.t0,e.next=18,n.processContext(T(i),r,i);case 18:return o=e.sent,e.next=21,L({activeCtx:o,element:a,options:i,compactionMap:i.compactionMap});case 21:f=e.sent,i.compactArrays&&!i.graph&&k(f)?1===f.length?f=f[0]:0===f.length&&(f={}):i.graph&&S(f)&&(f=[f]),S(r)&&"@context"in r&&(r=r["@context"]),r=s.clone(r),k(r)||(r=[r]),h=r,r=[];for(d=0;d0)&&r.push(h[d]);if(p=r.length>0,1===r.length&&(r=r[0]),k(f))v=M({activeCtx:o,iri:"@graph",relativeTo:{vocab:!0}}),g=f,f={},p&&(f["@context"]=r),f[v]=g;else if(S(f)&&p)for(b in y=f,f={"@context":r},y)f[b]=y[b];return e.abrupt("return",f);case 29:case"end":return e.stop()}},e)}));return function(t,r,n){return e.apply(this,arguments)}}(),n.expand=function(){var e=f(regeneratorRuntime.mark(function e(t,r){var i,a,o,c,l,f,h,d,p,g,y=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(y.length<1)){e.next=2;break}throw new TypeError("Could not expand, too few arguments.");case 2:if(!1===(r=x(r,{keepFreeFloatingNodes:!1,contextResolver:new u({sharedCache:m})})).expansionMap&&(r.expansionMap=void 0),i={},a=[],"expandContext"in r&&(o=s.clone(r.expandContext),i.expandContext=S(o)&&"@context"in o?o:{"@context":o},a.push(i.expandContext)),!E(t)){e.next=12;break}return e.next=8,n.get(t,r);case 8:l=e.sent,c=l.documentUrl,i.input=l.document,l.contextUrl&&(i.remoteContext={"@context":l.contextUrl},a.push(i.remoteContext)),e.next=13;break;case 12:i.input=s.clone(t);case 13:"base"in r||(r.base=c||""),f=T(r),h=0,d=a;case 16:if(!(h=1e21)},n.isEmptyObject=function(e){return n.isObject(e)&&0===Object.keys(e).length},n.isNumber=function(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)},n.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},n.isObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},n.isString=function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},n.isUndefined=function(e){return void 0===e}},{}],42:[function(e,t,r){"use strict";var n=e("./types"),i={};t.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=function(e,t){for(var r={},n=i.parsers[t||"full"],a=n.regex.exec(e),o=n.keys.length;o--;)r[n.keys[o]]=void 0===a[o]?null:a[o];return("https"===r.scheme&&"443"===r.port||"http"===r.scheme&&"80"===r.port)&&(r.href=r.href.replace(":"+r.port,""),r.authority=r.authority.replace(":"+r.port,""),r.port=null),r.normalizedPath=i.removeDotSegments(r.path),r},i.prependBase=function(e,t){if(null===e)return t;if(i.isAbsolute(t))return t;e&&!n.isString(e)||(e=i.parse(e||""));var r=i.parse(t),a={protocol:e.protocol||""};if(null!==r.authority)a.authority=r.authority,a.path=r.path,a.query=r.query;else if(a.authority=e.authority,""===r.path)a.path=e.path,a.query=null!==r.query?r.query:e.query;else{if(0===r.path.indexOf("/"))a.path=r.path;else{var o=e.path;((o=o.substr(0,o.lastIndexOf("/")+1)).length>0||e.authority)&&"/"!==o.substr(-1)&&(o+="/"),o+=r.path,a.path=o}a.query=r.query}""!==r.path&&(a.path=i.removeDotSegments(a.path));var s=a.protocol;return null!==a.authority&&(s+="//"+a.authority),s+=a.path,null!==a.query&&(s+="?"+a.query),null!==r.fragment&&(s+="#"+r.fragment),""===s&&(s="./"),s},i.removeBase=function(e,t){if(null===e)return t;e&&!n.isString(e)||(e=i.parse(e||""));var r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;for(var a=i.parse(t.substr(r.length)),o=e.normalizedPath.split("/"),s=a.normalizedPath.split("/"),u=a.fragment||a.query?0:1;o.length>0&&s.length>u&&o[0]===s[0];)o.shift(),s.shift();var c="";if(o.length>0){o.pop();for(var l=0;l0;){var n=t.shift(),i=0===t.length;"."!==n?".."!==n?r.push(n):(r.pop(),i&&r.push("")):i&&r.push("")}return"/"===e[0]&&r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};var a=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=function(e){return n.isString(e)&&a.test(e)},i.isRelative=function(e){return n.isString(e)}},{"./types":41}],43:[function(e,t,r){"use strict";var n=e("./graphTypes"),i=e("./types"),a=e("rdf-canonize").IdentifierIssuer,o=e("./JsonLdError"),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,u=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l="application/ld+json, application/json",f={};function h(e,t){if(i.isArray(t))for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if(Object.keys(e).some(function(e){return"accept"===e.toLowerCase()}))throw new RangeError('Accept header may not be specified; only "'+l+'" is supported.');return Object.assign({Accept:l},e)},f.parseLinkHeader=function(e){for(var t={},r=e.match(s),n=0;n0}return!1},f.hasValue=function(e,t,r){if(f.hasProperty(e,t)){var a=e[t],o=n.isList(a);if(i.isArray(a)||o){o&&(a=a["@list"]);for(var s=0;st.maxAge:e[u]&&r>e[u]},y=function(e){if(e[a]>e[i])for(var t=e[f].tail;e[a]>e[i]&&null!==t;){var r=t.prev;b(e,t),t=r}},b=function(e,t){if(t){var r=t.value;e[c]&&e[c](r.key,r.value),e[a]-=r.length,e[h].delete(r.key),e[f].removeNode(t)}},m=function e(t,r,n,i,a){S(this,e),this.key=t,this.value=r,this.length=n,this.now=i,this.maxAge=a||0},_=function(e,t,r,n){var i=r.value;g(e,i)&&(b(e,r),e[s]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};t.exports=function(){function e(t){if(S(this,e),"number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[i]=t.max||1/0;var r=t.length||p;if(this[o]="function"!=typeof r?p:r,this[s]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[u]=t.maxAge||0,this[c]=t.dispose,this[l]=t.noDisposeOnSet||!1,this[d]=t.updateAgeOnGet||!1,this.reset()}return j(e,[{key:"rforEach",value:function(e,t){t=t||this;for(var r=this[f].tail;null!==r;){var n=r.prev;_(this,e,r,t),r=n}}},{key:"forEach",value:function(e,t){t=t||this;for(var r=this[f].head;null!==r;){var n=r.next;_(this,e,r,t),r=n}}},{key:"keys",value:function(){return this[f].toArray().map(function(e){return e.key})}},{key:"values",value:function(){return this[f].toArray().map(function(e){return e.value})}},{key:"reset",value:function(){var e=this;this[c]&&this[f]&&this[f].length&&this[f].forEach(function(t){return e[c](t.key,t.value)}),this[h]=new Map,this[f]=new n,this[a]=0}},{key:"dump",value:function(){var e=this;return this[f].map(function(t){return!g(e,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}}).toArray().filter(function(e){return e})}},{key:"dumpLru",value:function(){return this[f]}},{key:"set",value:function(e,t,r){if((r=r||this[u])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");var n=r?Date.now():0,s=this[o](t,e);if(this[h].has(e)){if(s>this[i])return b(this,this[h].get(e)),!1;var d=this[h].get(e).value;return this[c]&&(this[l]||this[c](e,d.value)),d.now=n,d.maxAge=r,d.value=t,this[a]+=s-d.length,d.length=s,this.get(e),y(this),!0}var p=new m(e,t,s,n,r);return p.length>this[i]?(this[c]&&this[c](e,t),!1):(this[a]+=p.length,this[f].unshift(p),this[h].set(e,this[f].head),y(this),!0)}},{key:"has",value:function(e){if(!this[h].has(e))return!1;var t=this[h].get(e).value;return!g(this,t)}},{key:"get",value:function(e){return v(this,e,!0)}},{key:"peek",value:function(e){return v(this,e,!1)}},{key:"pop",value:function(){var e=this[f].tail;return e?(b(this,e),e.value):null}},{key:"del",value:function(e){b(this,this[h].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),r=e.length-1;r>=0;r--){var n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{var a=i-t;a>0&&this.set(n.k,n.v,a)}}}},{key:"prune",value:function(){var e=this;this[h].forEach(function(t,r){return v(e,r,!1)})}},{key:"max",set:function(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,y(this)},get:function(){return this[i]}},{key:"allowStale",set:function(e){this[s]=!!e},get:function(){return this[s]}},{key:"maxAge",set:function(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,y(this)},get:function(){return this[u]}},{key:"lengthCalculator",set:function(e){var t=this;"function"!=typeof e&&(e=p),e!==this[o]&&(this[o]=e,this[a]=0,this[f].forEach(function(e){e.length=t[o](e.value,e.key),t[a]+=e.length})),y(this)},get:function(){return this[o]}},{key:"length",get:function(){return this[a]}},{key:"itemCount",get:function(){return this[f].length}}]),e}()},{yallist:116}],45:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",a="http://www.w3.org/2000/10/swap/";r.default={xsd:{decimal:i+"decimal",boolean:i+"boolean",double:i+"double",integer:i+"integer",string:i+"string"},rdf:{type:n+"type",nil:n+"nil",first:n+"first",rest:n+"rest",langString:n+"langString"},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:a+"reify#forSome",forAll:a+"reify#forAll"},log:{implies:a+"log#implies"}}},{}],46:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.termFromId=function e(t,r){if(r=r||y,!t)return r.defaultGraph();switch(t[0]){case"?":return r.variable(t.substr(1));case"_":return r.blankNode(t.substr(2));case'"':if(r===y)return new _(t);if('"'===t[t.length-1])return r.literal(t.substr(1,t.length-2));var n=t.lastIndexOf('"',t.length-1);return r.literal(t.substr(1,n-1),"@"===t[n+1]?t.substr(n+2):r.namedNode(t.substr(n+3)));case"<":var i=g.exec(t);return r.quad(e(N(i[1]),r),e(N(i[2]),r),e(N(i[3]),r),i[4]&&e(N(i[4]),r));default:return r.namedNode(t)}},r.termToId=function e(t){if("string"==typeof t)return t;if(t instanceof b&&"Quad"!==t.termType)return t.id;if(!t)return u.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return"_:"+t.value;case"Variable":return"?"+t.value;case"DefaultGraph":return"";case"Literal":return'"'+t.value+'"'+(t.language?"@"+t.language:t.datatype&&t.datatype.value!==d.string?"^^"+t.datatype.value:"");case"Quad":return"<<".concat(I(e(t.subject))," ").concat(I(e(t.predicate))," ").concat(I(e(t.object))).concat((0,l.isDefaultGraph)(t.graph)?"":" ".concat(e(t.graph)),">>");default:throw new Error("Unexpected termType: "+t.termType)}},r.escapeQuotes=I,r.unescapeQuotes=N,r.Triple=r.Quad=r.DefaultGraph=r.Variable=r.BlankNode=r.Literal=r.NamedNode=r.Term=r.default=void 0;var n,u,c=(n=e("./IRIs"))&&n.__esModule?n:{default:n},l=e("./N3Util"),f=c.default,h=f.rdf,d=f.xsd,p=0,v=/^"(.*".*)(?="[^"]*$)/,g=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,y={namedNode:function(e){return new m(e)},blankNode:function(e){return new w(e||"n3-"+p++)},variable:function(e){return new x(e)},literal:function(e,t){if("string"==typeof t)return new _('"'+e+'"@'+t.toLowerCase());var r=t?t.value:"";return""===r&&("boolean"==typeof e?r=d.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?d.integer:d.double:(r=d.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new _(""===r||r===d.string?'"'+e+'"':'"'+e+'"^^'+r)},defaultGraph:function(){return u},quad:T,triple:T};r.default=y;var b=function(){function e(t){S(this,e),this.id=t}return j(e,[{key:"equals",value:function(t){return t instanceof e?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}},{key:"toJSON",value:function(){return{termType:this.termType,value:this.value}}},{key:"value",get:function(){return this.id}}]),e}();r.Term=b;var m=function(e){i(r,e);var t=a(r);function r(){return S(this,r),t.apply(this,arguments)}return j(r,[{key:"termType",get:function(){return"NamedNode"}}]),r}(b);r.NamedNode=m;var _=function(e){i(r,e);var t=a(r);function r(){return S(this,r),t.apply(this,arguments)}return j(r,[{key:"equals",value:function(e){return e instanceof r?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}},{key:"toJSON",value:function(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},{key:"termType",get:function(){return"Literal"}},{key:"value",get:function(){return this.id.substring(1,this.id.lastIndexOf('"'))}},{key:"language",get:function(){var e=this.id,t=e.lastIndexOf('"')+1;return t\\"\{\}\|\^\`]/,l={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},f=/$0^/;r.default=function(){function e(t){if(S(this,e),this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s()\[\]\{\}"'<])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,this._lineMode=!!(t=t||{}).lineMode)for(var r in this._n3Mode=!1,this)!(r in l)&&this[r]instanceof RegExp&&(this[r]=f);else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}return j(e,[{key:"_tokenizeToEnd",value:function(e,t){for(var r,n=this._input,i=this._comments;;){for(var a,s;a=this._newline.exec(n);)i&&(s=this._comment.exec(a[0]))&&e(null,{line:this._line,type:"comment",value:s[1],prefix:""}),n=n.substr(a[0].length,n.length),this._line++;if(!a&&(a=this._whitespace.exec(n))&&(n=n.substr(a[0].length,n.length)),this._endOfFile.test(n))return t&&(i&&(s=this._comment.exec(n))&&e(null,{line:this._line,type:"comment",value:s[1],prefix:""}),e(n=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=n;var u=this._line,l="",f="",h="",d=n[0],p=null,v=0,g=!1;switch(d){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(v=1,l="^");break}if(this._previousMarker="^^","<"!==(n=n.substr(2))[0]){g=!0;break}case"<":if(p=this._unescapedIri.exec(n))l="IRI",f=p[1];else if(p=this._iri.exec(n)){if(null===(f=this._unescape(p[1]))||c.test(f))return m(this);l="IRI"}else n.length>1&&"<"===n[1]?(l="<<",v=2):this._n3Mode&&n.length>1&&"="===n[1]&&(l="inverse",v=2,f=">");break;case">":n.length>1&&">"===n[1]&&(l=">>",v=2);break;case"_":((p=this._blank.exec(n))||t&&(p=this._blank.exec(n+" ")))&&(l="blank",h="_",f=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(n))f=p[1];else if(f=(r=this._parseLiteral(n)).value,v=r.matchLength,null===f)return m(this);null===p&&0===v||(l="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){var y;if(p=this._simpleApostropheString.exec(n))f=p[1];else if(f=(y=this._parseLiteral(n)).value,v=y.matchLength,null===f)return m(this);null===p&&0===v||(l="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(n))&&(l="var",f=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(n))?(l="langcode",f=p[1]):(p=this._keyword.exec(n))&&(l=p[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){l=".",v=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(n)||t&&(p=this._number.exec(n+" ")))&&(l="literal",f=p[0],h="string"==typeof p[1]?o.double:"string"==typeof p[2]?o.decimal:o.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(n))?l=p[0].toUpperCase():g=!0;break;case"f":case"t":(p=this._boolean.exec(n))?(l="literal",f=p[0],h=o.boolean):g=!0;break;case"a":(p=this._shortPredicates.exec(n))?(l="abbreviation",f="a"):g=!0;break;case"=":this._n3Mode&&n.length>1&&(l="abbreviation",">"!==n[1]?(v=1,f="="):(v=2,f=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(v=1,l=d);break;default:g=!0}if(g&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(n))?((p=this._prefixed.exec(n))||t&&(p=this._prefixed.exec(n+" ")))&&(l="prefixed",h=p[1]||"",f=this._unescape(p[2])):(l="prefix",f=p[1]||"")),"^^"===this._previousMarker)switch(l){case"prefixed":l="type";break;case"IRI":l="typeIRI";break;default:l=""}if(!l)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?m(this):this._input=n;var b={line:u,type:l,value:f,prefix:h};e(null,b),this.previousToken=b,this._previousMarker=l,n=n.substr(v||p[0].length,n.length)}function m(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}},{key:"_unescape",value:function(e){var t=!1,r=e.replace(s,function(e,r,n,i){if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){var a=Number.parseInt(n,16);return a<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((a-=65536)>>10),56320+(1023&a))}return i in u?u[i]:(t=!0,"")});return t?null:r}},{key:"_parseLiteral",value:function(e){if(e.length>=3){for(var t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length,n=Math.max(this._literalClosingPos,r);(n=e.indexOf(t,n))>0;){for(var i=0;"\\"===e[n-i-1];)i++;if(i%2==0){var a=e.substring(r,n),o=a.split(/\r\n|\r|\n/).length-1,s=n+r;if(1===r&&0!==o||3===r&&this._lineMode)break;return this._line+=o,{value:this._unescape(a),matchLength:s}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}},{key:"_syntaxError",value:function(e){this._input=null;var t=new Error('Unexpected "'+e+'" on line '+this._line+".");return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}},{key:"tokenize",value:function(e,r){var n=this;if(this._line=1,"string"==typeof e){if(this._input=e,"function"!=typeof r){var a,o=[];if(this._tokenizeToEnd(function(e,t){e?a=e:o.push(t)},!0),a)throw a;return o}(0,i.default)(function(){return n._tokenizeToEnd(r,!0)})}else this._input="",this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",function(e){null!==n._input&&0!==e.length&&(n._pendingBuffer&&(e=t.concat([n._pendingBuffer,e]),n._pendingBuffer=null),128&e[e.length-1]?n._pendingBuffer=e:(n._input+=e,n._tokenizeToEnd(r,!1)))}),e.on("end",function(){null!==n._input&&n._tokenizeToEnd(r,!0)}),e.on("error",r)}}]),e}()}).call(this,e("buffer").Buffer)},{"./IRIs":45,buffer:12,"queue-microtask":63}],48:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("./N3Lexer")),i=o(e("./N3DataFactory")),a=o(e("./IRIs"));function o(e){return e&&e.__esModule?e:{default:e}}var s=0,u=function(){function e(t){S(this,e),this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&l(this,t.factory);var r="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",i=/turtle/.test(r),a=/trig/.test(r),o=/triple/.test(r),s=/quad/.test(r),u=this._n3Mode=/n3/.test(r),c=o||s;(this._supportsNamedGraphs=!(i||u))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(i||a||o||u),this._supportsRDFStar=""===r||/star|\*$/.test(r),c&&(this._resolveRelativeIRI=function(e){return null}),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new n.default({lineMode:c,n3:u}),this._explicitQuantifiers=!!t.explicitQuantifiers}return j(e,[{key:"_setBase",value:function(e){if(e){var t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}},{key:"_saveContext",value:function(e,t,r,n,i){var a=this._n3Mode;this._contextStack.push({subject:r,predicate:n,object:i,graph:t,type:e,inverse:!!a&&this._inversePredicate,blankPrefix:a?this._prefixes._:"",quantified:a?this._quantified:null}),a&&(this._inversePredicate=!1,this._prefixes._=this._graph?this._graph.id.substr(2)+".":".",this._quantified=Object.create(this._quantified))}},{key:"_restoreContext",value:function(){var e=this._contextStack.pop(),t=this._n3Mode;this._subject=e.subject,this._predicate=e.predicate,this._object=e.object,this._graph=e.graph,t&&(this._inversePredicate=e.inverse,this._prefixes._=e.blankPrefix,this._quantified=e.quantified)}},{key:"_readInTopContext",value:function(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}},{key:"_readEntity",value:function(e,t){var r;switch(e.type){case"IRI":case"typeIRI":var n=this._resolveIRI(e.value);if(null===n)return this._error("Invalid IRI",e);r=this._namedNode(n);break;case"type":case"prefixed":var i=this._prefixes[e.prefix];if(void 0===i)return this._error('Undefined prefix "'+e.prefix+':"',e);r=this._namedNode(i+e.value);break;case"blank":r=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._variable(e.value.substr(1));break;default:return this._error("Expected entity but got "+e.type,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}},{key:"_readSubject",value:function(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}},{key:"_readPredicate",value:function(e){var t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error("Unexpected "+t,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}},{key:"_readObject",value:function(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}},{key:"_readPredicateOrNamedGraph",value:function(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}},{key:"_readGraph",value:function(e){return"{"!==e.type?this._error("Expected graph but got "+e.type,e):(this._graph=this._subject,this._subject=null,this._readSubject)}},{key:"_readBlankNodeHead",value:function(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}},{key:"_readBlankNodeTail",value:function(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);var t=null===this._predicate;return this._restoreContext(),null===this._object?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}},{key:"_readPredicateAfterBlank",value:function(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}},{key:"_readListItem",value:function(e){var t=null,r=null,n=this._subject,i=this._contextStack,a=i[i.length-1],o=this._readListItem;switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),o=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==i.length&&"list"===i[i.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(o=this._readPredicate,this._subject===this.RDF_NIL)return o}else if(o=this._getContextEndReader(),this._object===this.RDF_NIL)return o;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,o=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),o=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===r&&(this._subject=r=this._blankNode()),null===n?null===a.predicate?a.subject=r:a.object=r:this._emit(n,this.RDF_REST,r,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return o}},{key:"_readDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!1)}},{key:"_readListItemDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!0)}},{key:"_completeLiteral",value:function(e){var t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":var r=this._readEntity(e);if(void 0===r)return;t=this._literal(this._literalValue,r),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}},{key:"_completeSubjectLiteral",value:function(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}},{key:"_completeObjectLiteral",value:function(e,t){var r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===r.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}},{key:"_readFormulaTail",value:function(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}},{key:"_readPunctuation",value:function(e){var t,r=this._subject,n=this._graph,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error('Expected punctuation to follow "'+this._object.id+'"',e)}if(null!==r){var a=this._predicate,o=this._object;i?this._emit(o,a,r,n):this._emit(r,a,o,n)}return t}},{key:"_readBlankNodePunctuation",value:function(e){var t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error('Expected punctuation to follow "'+this._object.id+'"',e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}},{key:"_readQuadPunctuation",value:function(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}},{key:"_readPrefix",value:function(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}},{key:"_readPrefixIRI",value:function(e){if("IRI"!==e.type)return this._error('Expected IRI to follow prefix "'+this._prefix+':"',e);var t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}},{key:"_readBaseIRI",value:function(e){var t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}},{key:"_readNamedGraphLabel",value:function(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}},{key:"_readNamedGraphBlankLabel",value:function(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}},{key:"_readDeclarationPunctuation",value:function(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}},{key:"_readQuantifierList",value:function(e){var t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error("Unexpected "+e.type,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}},{key:"_readQuantifierPunctuation",value:function(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}},{key:"_getPathReader",value:function(e){return this._afterPath=e,this._readPath}},{key:"_readPath",value:function(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:var t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){var n=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,n,this._graph)}return this._afterPath(e)}}},{key:"_readForwardPath",value:function(e){var t,r,n=this._blankNode();if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}},{key:"_readBackwardPath",value:function(e){var t,r,n=this._blankNode();if(void 0!==(t=this._readEntity(e)))return null===this._predicate?(r=this._subject,this._subject=n):(r=this._object,this._object=n),this._emit(n,t,r,this._graph),this._readPath}},{key:"_readRDFStarTailOrGraph",value:function(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error('Expected >> to follow "'+this._object.id+'"',e):this._readRDFStarTail(e)}},{key:"_readRDFStarTail",value:function(e){if(">>"!==e.type)return this._error("Expected >> but got ".concat(e.type),e);var t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}},{key:"_getContextEndReader",value:function(){var e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}},{key:"_emit",value:function(e,t,r,n){this._callback(null,this._quad(e,t,r,n||this.DEFAULTGRAPH))}},{key:"_error",value:function(e,t){var r=new Error(e+" on line "+t.line+".");r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=c}},{key:"_resolveIRI",value:function(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}},{key:"_resolveRelativeIRI",value:function(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}},{key:"_removeDotSegments",value:function(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;for(var t="",r=e.length,n=-1,i=-1,a=0,o="/";n=i&&(t=t.substr(0,a)),"/"!==o)return t+"/"+e.substr(n+1);a=n+1}}}o=e[++n]}return t+e.substring(a)}},{key:"parse",value:function(e,t,r){var n=this;if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):"b"+s+++"_",this._prefixCallback=r||c,this._inversePredicate=!1,this._quantified=Object.create(null),!t){var i,a=[];if(this._callback=function(e,t){e?i=e:t&&a.push(t)},this._lexer.tokenize(e).every(function(e){return n._readCallback=n._readCallback(e)}),i)throw i;return a}this._callback=t,this._lexer.tokenize(e,function(e,t){null!==e?(n._callback(e),n._callback=c):n._readCallback&&(n._readCallback=n._readCallback(t))})}}],[{key:"_resetBlankNodePrefix",value:function(){s=0}}]),e}();function c(){}function l(e,t){var r=t.namedNode;e._namedNode=r,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=r(a.default.rdf.first),e.RDF_REST=r(a.default.rdf.rest),e.RDF_NIL=r(a.default.rdf.nil),e.N3_FORALL=r(a.default.r.forAll),e.N3_FORSOME=r(a.default.r.forSome),e.ABBREVIATIONS={a:r(a.default.rdf.type),"=":r(a.default.owl.sameAs),">":r(a.default.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}r.default=u,l(u.prototype,i.default)},{"./IRIs":45,"./N3DataFactory":46,"./N3Lexer":47}],49:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}(e("./N3DataFactory")),a=e("stream"),o=(n=e("./IRIs"))&&n.__esModule?n:{default:n};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){return"string"==typeof e||e instanceof String}r.default=function(){function e(t,r){S(this,e),this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,r||!t||t[0]||(r=t,t=null),this._factory=(r=r||{}).factory||i.default,t&&this.addQuads(t)}return j(e,[{key:"_addToIndex",value:function(e,t,r,n){var i=e[t]||(e[t]={}),a=i[r]||(i[r]={}),o=n in a;return o||(a[n]=null),!o}},{key:"_removeFromIndex",value:function(e,t,r,n){var i,a=e[t],o=a[r];for(i in delete o[n],o)return;for(i in delete a[r],a)return;delete e[t]}},{key:"_findInIndex",value:function(e,t,r,n,a,o,s,u,c,l){var f,h,d,p=!t+!r+!n>1?Object.keys(this._ids):this._entities;for(var v in t&&((f=e,e={})[t]=f[t]),e){var g=p[v];if(h=e[v])for(var y in r&&((f=h,h={})[r]=f[r]),h){var b=p[y];if(d=h[y])for(var m=(n?n in d?[n]:[]:Object.keys(d)),_=0;_0&&void 0!==arguments[0]?arguments[0]:{},r=t.remove,n=void 0!==r&&r,i=t.ignoreErrors,a=void 0!==i&&i,s={},u=a?function(){return!0}:function(e,t){throw new Error("".concat(e.value," ").concat(t))},c=this.getQuads(null,o.default.rdf.rest,o.default.rdf.nil,null),l=n?g(c):[];return c.forEach(function(t){for(var r,i,a=[],c=!1,f=t.graph,h=t.subject;h&&!c;){var d,p,v=e.getQuads(null,null,h,null),g=e.getQuads(h,null,null,null),y=null,b=null,m=null;for(d=0;d"}},{key:"_encodeLiteral",value:function(e){var t=e.value;return p.test(t)&&(t=t.replace(v,b)),e.language?'"'+t+'"@'+e.language:e.datatype.value!==d.string?'"'+t+'"^^'+this._encodeIriOrBlank(e.datatype):'"'+t+'"'}},{key:"_encodePredicate",value:function(e){return e.value===h.type?"a":this._encodeIriOrBlank(e)}},{key:"_encodeObject",value:function(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}},{key:"_encodeQuad",value:function(e){var t=e.subject,r=e.predicate,n=e.object,i=e.graph;return"<<".concat(this._encodeSubject(t)," ").concat(this._encodePredicate(r)," ").concat(this._encodeObject(n)).concat((0,u.isDefaultGraph)(i)?"":" ".concat(this._encodeIriOrBlank(i)),">>")}},{key:"_blockedWrite",value:function(){throw new Error("Cannot write because the writer has been closed.")}},{key:"addQuad",value:function(e,t,r,n,i){void 0===r?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof n?this._writeQuad(e,t,r,l,n):this._writeQuad(e,t,r,n||l,i)}},{key:"addQuads",value:function(e){for(var t=0;t.\n")}if(n){var o="",s="";for(var u in r)o+=o?"|"+u:u,s+=(s?"|":"")+r[u];o=o.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:"+s+")[^/]*$|^("+o+")([a-zA-Z][\\-_a-zA-Z0-9]*)$")}this._write(n?"\n":"",t)}},{key:"blank",value:function(e,t){var r,n,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),n=i.length){case 0:return new y("[]");case 1:if(!((r=i[0]).object instanceof y))return new y("[ "+this._encodePredicate(r.predicate)+" "+this._encodeObject(r.object)+" ]");default:for(var a="[",o=0;o0;)s.push(c%a),c=c/a|0}for(i=0;0===e[i]&&i=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r0;)a.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r=0;--r)u+=t[a[r]];return u}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},r.decode=function(t,r){if("string"!=typeof t)throw new TypeError('"input" must be a string.');if("string"!=typeof r)throw new TypeError('"alphabet" must be a string.');var i=n[r];if(!i){i=n[r]=[];for(var a=0;a>=8;for(;f>0;)u.push(255&f),f>>=8}for(var h=0;t[h]===s&&h>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(a),s(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o,u=n.util.createBuffer();u.putBytes(t.bytes()),u.putBytes(a.substr(0,i.blockLength-(i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1)));for(var c=8*i.fullMessageLength[0],l=0;l>>0)>>>0),c=o>>>0;u.putInt32(c);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(f,r,u);var h=n.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h},i};var a=null,o=!1;function s(e,t,r){for(var n,i,a,o,s,u,c,l=r.length();l>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)t[c]=n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)t[c]=n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)t[c]=n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)t[c]=n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,n=(i<<5|i>>>27)+(a&o|s&(a^o))+u+2400959708+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)t[c]=n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,n=(i<<5|i>>>27)+(a^o^s)+u+3395469782+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},{"./forge":56,"./md":57,"./util":60}],59:[function(e,t,r){var n=e("./forge");e("./md"),e("./util");var i=t.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o,s=n.util.createBuffer();s.putBytes(t.bytes()),s.putBytes(a.substr(0,i.blockLength-(i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1)));for(var c=8*i.fullMessageLength[0],l=0;l>>0)>>>0),c=o>>>0;s.putInt32(c);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(f,r,s);var h=n.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h.putInt32(f.h5),h.putInt32(f.h6),h.putInt32(f.h7),h},i};var a=null,o=!1,s=null;function u(e,t,r){for(var n,i,a,o,u,c,l,f,h,d,p,v,g=r.length();g>=64;){for(o=0;o<16;++o)t[o]=r.getInt32();for(;o<64;++o)t[o]=(n=((n=t[o-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10)+t[o-7]+(i=((i=t[o-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)+t[o-16]|0;for(u=e.h0,c=e.h1,l=e.h2,f=e.h3,h=e.h4,d=e.h5,p=e.h6,v=e.h7,o=0;o<64;++o)a=u&c|l&(u^c),n=v+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(p^h&(d^p))+s[o]+t[o],v=p,p=d,d=h,h=f+n>>>0,f=l,l=c,c=u,u=n+(i=((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+a)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+c|0,e.h2=e.h2+l|0,e.h3=e.h3+f|0,e.h4=e.h4+h|0,e.h5=e.h5+d|0,e.h6=e.h6+p|0,e.h7=e.h7+v|0,g-=64}}},{"./forge":56,"./md":57,"./util":60}],60:[function(e,t,r){(function(r,n,i,a,o,s,u,c){var l=e("./forge"),f=e("./baseN"),h=t.exports=l.util=l.util||{};function d(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function p(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(h.isArrayBuffer(e)||h.isArrayBufferView(e))if(void 0!==i&&e instanceof i)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(n){for(var r=0;r15?(n=Date.now(),o(e)):(t.push(e),1===t.length&&a.setAttribute("a",i=!i))}}h.nextTick=h.setImmediate}(),h.isNodejs=void 0!==r&&r.versions&&r.versions.node,h.globalScope=h.isNodejs?n:"undefined"==typeof self?window:self,h.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},h.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},h.isArrayBufferView=function(e){return e&&h.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},h.ByteBuffer=p,h.ByteStringBuffer=p,h.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},h.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},h.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},h.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},h.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},h.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},h.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(h.encodeUtf8(e))},h.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},h.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},h.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},h.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},h.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},h.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},h.ByteStringBuffer.prototype.putInt=function(e,t){d(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},h.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},h.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},h.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},h.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},h.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},h.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},h.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},h.ByteStringBuffer.prototype.copy=function(){var e=h.createBuffer(this.data);return e.read=this.read,e},h.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},h.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},h.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},h.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},h.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},h.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},h.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},h.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},h.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},h.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},h.DataBuffer.prototype.putInt=function(e,t){d(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},h.DataBuffer.prototype.putSignedInt=function(e,t){return d(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},h.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},h.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},h.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},h.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},h.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},h.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},h.DataBuffer.prototype.copy=function(){return new h.DataBuffer(this)},h.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},h.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},h.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},h.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},h.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+a},h.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],y="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";h.encode64=function(e,t){for(var r,n,i,a="",o="",s=0;s>2),a+=v.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=v.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":v.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+a},h.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",o=0;o>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},h.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},h.decodeUtf8=function(e){return decodeURIComponent(escape(e))},h.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:f.encode,decode:f.decode}},h.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},h.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a>2),a+=v.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=v.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":v.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+a},h.binary.base64.decode=function(e,t,r){var n,i,a,o,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=r=r||0;u>4,64!==a&&(s[c++]=(15&i)<<4|a>>2,64!==o&&(s[c++]=(3&a)<<6|o));return t?c-r:s.subarray(0,c)},h.binary.base58.encode=function(e,t){return h.binary.baseN.encode(e,y,t)},h.binary.base58.decode=function(e,t){return h.binary.baseN.decode(e,y,t)},h.text={utf8:{},utf16:{}},h.text.utf8.encode=function(e,t,r){e=h.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===E&&(E="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=E):t=r(e),t},h.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:h.getQueryVariables(r)}},h.makeRequest=function(e){var t=h.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},h.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return e+(n.length>0?"?"+n:"")+((r=r||"").length>0?"#"+r:"")},h.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.format=function(e){for(var t,r,n=/%./g,i=0,a=[],o=0;t=n.exec(e);){(r=e.substring(o,n.lastIndex-2)).length>0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":a.push(i");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},h.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")},h.formatSize=function(e){return e>=1073741824?h.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?h.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?h.formatNumber(e/1024,0)+" KiB":h.formatNumber(e,0)+" bytes"},h.bytesFromIP=function(e){return-1!==e.indexOf(".")?h.bytesFromIPv4(e):-1!==e.indexOf(":")?h.bytesFromIPv6(e):null},h.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=h.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:s,end:s})}t.push(a)}if(r.length>0){var u=r[n];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},h.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in h&&!e.update)return t(null,h.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return h.cores=navigator.hardwareConcurrency,t(null,h.cores);if("undefined"==typeof Worker)return h.cores=1,t(null,h.cores);if("undefined"==typeof Blob)return h.cores=2,t(null,h.cores);var r=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(e){for(var t=Date.now(),r=t+4;Date.now()s.st&&i.sti.st&&s.st1)for(var r=1;r0&&void 0!==arguments[0]?arguments[0]:{},r=t.maxCallStackDepth,n=void 0===r?500:r,i=t.maxTotalCallStackDepth,a=void 0===i?4294967295:i,o=t.timeSlice,s=void 0===o?10:o;S(this,e),this.schedule={},this.schedule.MAX_DEPTH=n,this.schedule.MAX_TOTAL_DEPTH=a,this.schedule.depth=0,this.schedule.totalDepth=0,this.schedule.timeSlice=s}return j(e,[{key:"doWork",value:function(e,t){var r=this.schedule;if(r.totalDepth>=r.MAX_TOTAL_DEPTH)return t(new Error("Maximum total call stack depth exceeded; canonicalization aborting."));!function i(){if(r.depth===r.MAX_DEPTH)return r.depth=0,r.running=!1,n.nextTick(i);var a=Date.now();if(r.running||(r.start=Date.now(),r.deadline=r.start+r.timeSlice),a]*)>)|(_:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),t.exports=function(){function e(){S(this,e)}return j(e,null,[{key:"parse",value:function(e){var t,r=[],s={},c=0,l=w(e.split(a.eoln));try{for(l.s();!(t=l.n()).done;){var f=t.value;if(c++,!a.empty.test(f)){var h=f.match(a.quad);if(null===h)throw new Error("N-Quads parse error on line "+c+".");var d={};if(d.subject=void 0!==h[1]?{termType:"NamedNode",value:h[1]}:{termType:"BlankNode",value:h[2]},d.predicate={termType:"NamedNode",value:h[3]},void 0!==h[4]?d.object={termType:"NamedNode",value:h[4]}:void 0!==h[5]?d.object={termType:"BlankNode",value:h[5]}:(d.object={termType:"Literal",value:void 0,datatype:{termType:"NamedNode"}},void 0!==h[7]?d.object.datatype.value=h[7]:void 0!==h[8]?(d.object.datatype.value=n,d.object.language=h[8]):d.object.datatype.value=i,d.object.value=h[6].replace(u,function(e,t,r,n){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(r)return String.fromCharCode(parseInt(r,16));if(n)throw new Error("Unsupported U escape")})),d.graph=void 0!==h[9]?{termType:"NamedNode",value:h[9]}:void 0!==h[10]?{termType:"BlankNode",value:h[10]}:{termType:"DefaultGraph",value:""},d.graph.value in s){var p,v=!0,g=s[d.graph.value],y=w(g);try{for(y.s();!(p=y.n()).done;){if(o(p.value,d)){v=!1;break}}}catch(b){y.e(b)}finally{y.f()}v&&(g.push(d),r.push(d))}else s[d.graph.value]=[d],r.push(d)}}}catch(b){l.e(b)}finally{l.f()}return r}},{key:"serialize",value:function(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));var r,n=[],i=w(t);try{for(i.s();!(r=i.n()).done;){var a=r.value;n.push(e.serializeQuad(a))}}catch(o){i.e(o)}finally{i.f()}return n.sort().join("")}},{key:"serializeQuad",value:function(e){var t=e.object,r=e.graph,a="";return[e.subject,e.predicate].forEach(function(e){a+="NamedNode"===e.termType?"<"+e.value+">":e.value,a+=" "}),"NamedNode"===t.termType?a+="<"+t.value+">":"BlankNode"===t.termType?a+=t.value:(a+='"'+t.value.replace(s,function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})+'"',t.datatype.value===n?t.language&&(a+="@"+t.language):t.datatype.value!==i&&(a+="^^<"+t.datatype.value+">")),"NamedNode"===r.termType?a+=" <"+r.value+">":"BlankNode"===r.termType&&(a+=" "+r.value),a+=" .\n"}},{key:"legacyDatasetToQuads",value:function(e){var t=[],r={"blank node":"BlankNode",IRI:"NamedNode",literal:"Literal"},a=function(a){e[a].forEach(function(e){var o={};for(var s in e){var u=e[s],c={termType:r[u.type],value:u.value};"Literal"===c.termType&&(c.datatype={termType:"NamedNode"},"datatype"in u&&(c.datatype.value=u.datatype),"language"in u?("datatype"in u||(c.datatype.value=n),c.language=u.language):"datatype"in u||(c.datatype.value=i)),o[s]=c}o.graph="@default"===a?{termType:"DefaultGraph",value:""}:{termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a},t.push(o)})};for(var o in e)a(o);return t}}]),e}();var s=/["\\\n\r]/g,u=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],68:[function(e,t,r){"use strict";t.exports=function(){function e(t){S(this,e),this.list=t.sort(),this.done=!1,this.left={};for(var r=0;rt)&&(o&&i>0&&a>this.list[i-1]||!o&&ithis.list[i+1])&&(t=a,r=i)}if(null===t)this.done=!0;else{var s=this.left[t]?r-1:r+1;this.list[r]=this.list[s],this.list[s]=t;for(var u=0;ut&&(this.left[this.list[u]]=!this.left[this.list[u]])}return e}}]),e}()},{}],69:[function(e,t,r){"use strict";var n=e("./AsyncAlgorithm"),o=e("./IdentifierIssuer"),s=e("./MessageDigest"),u=e("./Permutator"),c=e("./NQuads"),l=e("./util"),f={subject:"s",object:"o",graph:"g"};t.exports=function(e){i(r,e);var t=a(r);function r(e){var n;return S(this,r),(n=t.call(this,e=e||{})).name="URDNA2015",n.options=Object.assign({},e),n.blankNodeInfo={},n.hashToBlankNodes={},n.canonicalIssuer=new o("_:c14n"),n.hashAlgorithm="sha256",n}return j(r,[{key:"main",value:function(e,t){var r,n=this;n.schedule.start=Date.now(),n.quads=e;var i={};n.waterfall([function(t){n.forEach(e,function(e,t,r){n.forEachComponent(e,function(t){if("BlankNode"===t.termType){var r=t.value;r in n.blankNodeInfo?n.blankNodeInfo[r].quads.push(e):(i[r]=!0,n.blankNodeInfo[r]={quads:[e]})}}),r()},t)},function(e){var t=!0;n.whilst(function(){return t},function(e){t=!1,n.hashToBlankNodes={},n.waterfall([function(e){n.forEach(i,function(e,t,r){n.hashFirstDegreeQuads(t,function(e,i){if(e)return r(e);i in n.hashToBlankNodes?n.hashToBlankNodes[i].push(t):n.hashToBlankNodes[i]=[t],r()})},e)},function(e){var r=Object.keys(n.hashToBlankNodes).sort();n.forEach(r,function(e,r,a){var o=n.hashToBlankNodes[e];if(o.length>1)return a();var s=o[0];n.canonicalIssuer.getId(s),delete i[s],delete n.hashToBlankNodes[e],t=!0,a()},e)}],e)},e)},function(e){var t=Object.keys(n.hashToBlankNodes).sort();n.forEach(t,function(e,t,r){var i=[],a=n.hashToBlankNodes[e];n.waterfall([function(e){n.forEach(a,function(e,t,r){if(n.canonicalIssuer.hasId(e))return r();var a=new o("_:b");a.getId(e),n.hashNDegreeQuads(e,a,function(e,t){if(e)return r(e);i.push(t),r()})},e)},function(e){i.sort(function(e,t){return e.hasht.hash?1:0}),n.forEach(i,function(e,t,r){for(var i in e.issuer.existing)n.canonicalIssuer.getId(i);r()},e)}],r)},e)},function(e){var t=[];n.waterfall([function(e){n.forEach(n.quads,function(e,r,i){n.forEachComponent(e,function(e){"BlankNode"!==e.termType||e.value.startsWith(n.canonicalIssuer.prefix)||(e.value=n.canonicalIssuer.getId(e.value))}),t.push(c.serializeQuad(e)),i()},e)},function(e){return t.sort(),r=t.join(""),e()}],e)}],function(e){return t(e,r)})}},{key:"hashFirstDegreeQuads",value:function(e,t){var r=this,n=r.blankNodeInfo[e];if("hash"in n)return t(null,n.hash);var i=[];r.forEach(n.quads,function(t,n,a){var o={predicate:t.predicate};r.forEachComponent(t,function(t,n){o[n]=r.modifyFirstDegreeComponent(e,t,n)}),i.push(c.serializeQuad(o)),a()},function(e){if(e)return t(e);i.sort();for(var a=new s(r.hashAlgorithm),o=0;oc)return e();s()},t)},function(t){i.forEach(o,function(t,r,o){i.hashNDegreeQuads(t,n,function(r,i){return r?o(r):(a+=n.getId(t),a+="<"+i.hash+">",n=i.issuer,0!==c.length&&a>c?e():void o())})},t)},function(e){(0===c.length||a"}},{key:"createHashToRelated",value:function(e,t,r){var n=this,i={};n.forEach(n.blankNodeInfo[e].quads,function(r,a,o){n.forEach(r,function(a,o,s){if("predicate"===o||"BlankNode"!==a.termType||a.value===e)return s();var u=a.value;n.hashRelatedBlankNode(u,r,t,f[o],function(e,t){if(e)return s(e);t in i?i[t].push(u):i[t]=[u],s()})},o)},function(e){return r(e,i)})}},{key:"forEachComponent",value:function(e,t){for(var r in e)"predicate"!==r&&t(e[r],r,e)}}]),r}(n)},{"./AsyncAlgorithm":64,"./IdentifierIssuer":65,"./MessageDigest":66,"./NQuads":67,"./Permutator":68,"./util":74}],70:[function(e,t,r){"use strict";var n=e("./IdentifierIssuer"),i=e("./MessageDigest"),a=e("./Permutator"),o=e("./NQuads"),s=e("./util"),u={subject:"s",object:"o",graph:"g"};t.exports=function(){function e(){S(this,e),this.name="URDNA2015",this.blankNodeInfo={},this.hashToBlankNodes={},this.canonicalIssuer=new n("_:c14n"),this.hashAlgorithm="sha256"}return j(e,[{key:"main",value:function(e){var t=this;t.quads=e;var r,i={},a=w(e);try{var s=function(){var e=r.value;t.forEachComponent(e,function(r){if("BlankNode"===r.termType){var n=r.value;n in t.blankNodeInfo?t.blankNodeInfo[n].quads.push(e):(i[n]=!0,t.blankNodeInfo[n]={quads:[e]})}})};for(a.s();!(r=a.n()).done;)s()}catch(R){a.e(R)}finally{a.f()}for(var u=!0;u;){for(var c in u=!1,t.hashToBlankNodes={},i){var l=t.hashFirstDegreeQuads(c);l in t.hashToBlankNodes?t.hashToBlankNodes[l].push(c):t.hashToBlankNodes[l]=[c]}for(var f=Object.keys(t.hashToBlankNodes).sort(),h=0;h1)){var v=p[0];t.canonicalIssuer.getId(v),delete i[v],delete t.hashToBlankNodes[d],u=!0}}}for(var g=Object.keys(t.hashToBlankNodes).sort(),y=0;yt.hash?1:0});for(var E=0;Ef){y=!0;break}}if(!y){for(var _=0;_",p=x.issuer,0!==f.length&&v>f){y=!0;break}}y||(0===f.length||v"}},{key:"createHashToRelated",value:function(e,t){for(var r={},n=this.blankNodeInfo[e].quads,i=0;i"));var s={childrenStringTags:t.childrenStringTags};return s.childrenStringEmitClosingTag=""),void this.activeTagStack.push(s)}var u={};t?(u.language=t.language,u.baseIRI=t.baseIRI):u.baseIRI=this.baseIRI,this.activeTagStack.push(u),u.ns=f.parseNamespace(e,t),r===n.RESOURCE?this.onTagResource(e,u,t,!t):this.onTagProperty(e,u,t)}},{key:"onTagResource",value:function(e,t,r,i){var a=f.expandPrefixedTerm(e.name,t.ns,this);t.childrenParseType=n.PROPERTY;var s=!0;if(a.uri===f.RDF){if(!i&&f.FORBIDDEN_NODE_ELEMENTS.indexOf(a.local)>=0)throw this.newParseError("Illegal node element name: ".concat(a.local));switch(a.local){case"RDF":t.childrenParseType=n.RESOURCE;case"Description":s=!1}}var u=[],c=[],l=null,h=!1,d=!1,p=null;for(var v in e.attributes){var g=e.attributes[v],y=f.expandPrefixedTerm(v,t.ns,this);if(r&&y.uri===f.RDF)switch(y.local){case"about":if(l)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(l," where found."));l=g;continue;case"ID":if(l)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(l," where found."));this.validateNcname(g),l="#"+g,h=!0;continue;case"nodeID":if(l)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(l," where found."));this.validateNcname(g),l=g,d=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":p=g;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(y.uri===f.XML){if("lang"===y.local){t.language=""===g?null:g.toLowerCase();continue}if("base"===y.local){t.baseIRI=o.resolve(g,t.baseIRI);continue}}"xml"!==y.prefix&&y.uri&&(u.push(this.uriToNamedNode(y.uri+y.local)),c.push(g))}if(null!==l&&(t.subject=d?this.dataFactory.blankNode(l):this.valueToUri(l,t),h&&this.claimNodeId(t.subject)),t.subject||(t.subject=this.dataFactory.blankNode()),s){var b=this.uriToNamedNode(a.uri+a.local);this.emitTriple(t.subject,this.dataFactory.namedNode(f.RDF+"type"),b,r?r.reifiedStatementId:null)}if(r){if(r.predicate)if(r.childrenCollectionSubject){var m=this.dataFactory.blankNode();this.emitTriple(r.childrenCollectionSubject,r.childrenCollectionPredicate,m,r.reifiedStatementId),this.emitTriple(m,this.dataFactory.namedNode(f.RDF+"first"),t.subject,t.reifiedStatementId),r.childrenCollectionSubject=m,r.childrenCollectionPredicate=this.dataFactory.namedNode(f.RDF+"rest")}else{this.emitTriple(r.subject,r.predicate,t.subject,r.reifiedStatementId);for(var _=0;_=0)throw this.newParseError("Illegal property element name: ".concat(i.local));t.predicateSubPredicates=[],t.predicateSubObjects=[];var a=!1,o=!1,s=null,u=!0,c=[],l=[];for(var h in e.attributes){var d=e.attributes[h],p=f.expandPrefixedTerm(h,t.ns,this);if(p.uri===f.RDF)switch(p.local){case"resource":if(s)throw this.newParseError("Found both rdf:resource (".concat(d,") and rdf:nodeID (").concat(s,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:resource (".concat(d,")"));t.hadChildren=!0,s=d,u=!1;continue;case"datatype":if(o)throw this.newParseError("Found both non-rdf:* property attributes and rdf:datatype (".concat(d,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(d,")"));t.datatype=this.valueToUri(d,t);continue;case"nodeID":if(o)throw this.newParseError("Found both non-rdf:* property attributes and rdf:nodeID (".concat(d,")."));if(t.hadChildren)throw this.newParseError("Found both rdf:resource and rdf:nodeID (".concat(d,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID (".concat(d,")"));this.validateNcname(d),t.hadChildren=!0,s=d,u=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(o)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(t.datatype)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(t.datatype.value,")"));if(s)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (".concat(s,")"));if("Resource"===d){a=!0,t.childrenParseType=n.PROPERTY;var v=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,v,t.reifiedStatementId),t.subject=v,t.predicate=null}else"Collection"===d?(a=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,u=!1):"Literal"===d&&(a=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(d),t.reifiedStatementId=this.valueToUri("#"+d,t),this.claimNodeId(t.reifiedStatementId);continue}else if(p.uri===f.XML&&"lang"===p.local){t.language=""===d?null:d.toLowerCase();continue}if("xml"!==p.prefix&&"xmlns"!==p.prefix&&p.uri){if(a||t.datatype)throw this.newParseError("Found illegal rdf:* properties on property element with attribute: ".concat(d));t.hadChildren=!0,o=!0,c.push(this.uriToNamedNode(p.uri+p.local)),l.push(this.dataFactory.literal(d,t.datatype||t.language))}}if(null!==s){var g=t.subject;t.subject=u?this.dataFactory.blankNode(s):this.valueToUri(s,t),this.emitTriple(g,t.predicate,t.subject,t.reifiedStatementId);for(var y=0;y/g,function(e,r,n){return t.saxStream._parser.ENTITIES[r]=n,""})}}],[{key:"parseNamespace",value:function(e,t){var r={},n=!1;for(var i in e.attributes)i.startsWith("xmlns")&&(5===i.length?(n=!0,r[""]=e.attributes[i]):":"===i.charAt(5)&&(n=!0,r[i.substr(6)]=e.attributes[i]));var a=t&&t.ns?t.ns:[f.DEFAULT_NS];return n?a.concat([r]):a}},{key:"expandPrefixedTerm",value:function(e,t,r){var n,i,a=e.indexOf(":");a>=0?(n=e.substr(0,a),i=e.substr(a+1)):(n="",i=e);for(var o=null,s=null,u=t.length-1;u>=0;u--){var c=t[u][n];if(c){o=c;break}s||(s=t[u][""])}if(!o){if(n&&"xmlns"!==n)throw new l.ParseError(r,"The prefix '".concat(n,"' in term '").concat(e,"' was not bound."));o=s||""}return{prefix:n,local:i,uri:o}}},{key:"isValidIri",value:function(e){return f.IRI_REGEX.test(e)}}]),f}(c.Transform);r.RdfXmlParser=f,f.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,f.MIME_TYPE="application/rdf+xml",f.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",f.XML="http://www.w3.org/XML/1998/namespace",f.XMLNS="http://www.w3.org/2000/xmlns/",f.DEFAULT_NS={xml:f.XML},f.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],f.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],f.NCNAME_MATCHER=/^((?:[A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF]))((?:[#\x2D\.0-9A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF]))*$/,function(e){e[e.RESOURCE=0]="RESOURCE",e[e.PROPERTY=1]="PROPERTY"}(n=r.ParseType||(r.ParseType={}))},{"./ParseError":76,"@rdfjs/data-model":2,"relative-to-absolute-iri":93,sax:96,stream:97}],78:[function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){function r(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return i=e,(n=r).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i,r;var n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function a(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,r){var n,i,o,s;if("string"==typeof t&&"not "===t.substr(0,"not ".length)?(n="must not be",t=t.replace(/^not /,"")):n="must be",o=e,(void 0===s||s>o.length)&&(s=o.length)," argument"===o.substring(s-" argument".length,s))i="The ".concat(e," ").concat(n," ").concat(a(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";i='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(a(t,"type"))}return i+". Received type ".concat(typeof r)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],79:[function(e,t,r){(function(r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var i=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(c,i);for(var o=n(a.prototype),s=0;s0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)s.endEmitted?x(e,new w):I(e,s,t,!0);else if(s.ended)x(e,new m);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?I(e,s,t,!1):R(e,s)):I(e,s,t,!1)}else n||(s.reading=!1,R(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(A,e))}function A(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,C(e)}function R(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(O,e,t))}function O(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function M(e){a("readable nexttick read 0"),e.read(0)}function D(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function F(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(B,t,e))}function B(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return a("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):T(this),null;if(0===(e=N(e,t))&&t.ended)return 0===t.length&&F(this),null;var n,i=t.needReadable;return a("need readable",i),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&F(this)),null!==n&&this.emit("data",n),n},E.prototype._read=function(e){x(this,new _("_read()"))},E.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,a("pipe count=%d opts=%j",i.pipesCount,t);var s=t&&!1===t.end||e===r.stdout||e===r.stderr?v:u;function u(){a("onend"),e.end()}i.endEmitted?r.nextTick(s):n.once("end",s),e.on("unpipe",function t(r,o){a("onunpipe"),r===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,a("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),n.removeListener("end",u),n.removeListener("end",v),n.removeListener("data",f),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,C(e))}}(n);e.on("drain",c);var l=!1;function f(t){a("ondata");var r=e.write(t);a("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!l&&(a("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function h(t){a("onerror",t),v(),e.removeListener("error",h),0===o(e,"error")&&x(e,t)}function d(){e.removeListener("finish",p),v()}function p(){a("onfinish"),e.removeListener("close",d),v()}function v(){a("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener("error",r);e._events&&e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(r):e._events.error=[r,e._events.error]:e.on("error",r)}(e,0,h),e.once("close",d),e.once("finish",p),e.emit("pipe",n),i.flowing||(a("pipe resume"),n.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,a("on readable",i.length,i.reading),i.length?T(this):i.reading||r.nextTick(M,this))),n},E.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(L,this),n},E.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(L,this),t},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(D,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new v("_write()"))},E.prototype._writev=null,E.prototype.end=function(e,t,n){var i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,n){t.ending=!0,R(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,i,n),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=f.destroy,E.prototype._undestroy=f.undestroy,E.prototype._destroy=function(e,t){t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":78,"./_stream_duplex":79,"./internal/streams/destroy":86,"./internal/streams/state":90,"./internal/streams/stream":91,_process:62,buffer:12,inherits:18,"util-deprecate":114}],84:[function(e,t,r){(function(r){"use strict";var n;function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function d(e,t){return{value:e,done:t}}function p(e){var t=e[o];if(null!==t){var r=e[h].read();null!==r&&(e[l]=null,e[o]=null,e[s]=null,t(d(r,!1)))}}function v(e){r.nextTick(p,e)}var g=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(d(void 0,!0));if(this[h].destroyed)return new Promise(function(t,n){r.nextTick(function(){e[u]?n(e[u]):t(d(void 0,!0))})});var n,i=this[l];if(i)n=new Promise(function(e,t){return function(r,n){e.then(function(){t[c]?r(d(void 0,!0)):t[f](r,n)},n)}}(i,this));else{var a=this[h].read();if(null!==a)return Promise.resolve(d(a,!1));n=new Promise(this[f])}return this[l]=n,n}},Symbol.asyncIterator,function(){return this}),i(n,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),n),g);t.exports=function(e){var t,r=Object.create(y,(i(t={},h,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[h].read();n?(r[l]=null,r[o]=null,r[s]=null,e(d(n,!1))):(r[o]=e,r[s]=t)},writable:!0}),t));return r[l]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[l]=null,r[o]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[o];null!==n&&(r[l]=null,r[o]=null,r[s]=null,n(d(void 0,!0))),r[c]=!0}),e.on("readable",v.bind(null,r)),r}}).call(this,e("_process"))},{"./end-of-stream":87,_process:62}],85:[function(e,t,r){"use strict";function n(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 i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("buffer").Buffer,o=e("util").inspect,s=o&&o.custom||"inspect";t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return(t=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t=a.allocUnsafe(e>>>0),r=this.head,n=0;r;)a.prototype.copy.call(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(n+=a===i.length?i:i.slice(0,e),0==(e-=a)){a===i.length?(++r,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,this.head=r.next?r.next:this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return o(this,function(e){for(var t=1;t0,function(e){n||(n=e),e&&o.forEach(c),a||(o.forEach(c),i(n))})});return t.reduce(l)}},{"../../../errors":78,"./end-of-stream":87}],90:[function(e,t,r){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},{"../../../errors":78}],91:[function(e,t,r){t.exports=e("events").EventEmitter},{events:13}],92:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":79,"./lib/_stream_passthrough.js":80,"./lib/_stream_readable.js":81,"./lib/_stream_transform.js":82,"./lib/_stream_writable.js":83,"./lib/internal/streams/end-of-stream.js":87,"./lib/internal/streams/pipeline.js":89}],93:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(e("./lib/Resolve"))},{"./lib/Resolve":94}],94:[function(e,t,r){"use strict";function n(e){for(var t=[],r=0;r=0?"/"===e[t+1]&&"/"===e[t+2]&&(r=t+3):"/"===e[0]&&"/"===e[1]&&(r=2);var i=e.indexOf("/",r);return i<0?e:e.substr(0,i)+n(e.substr(i))}function a(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(r,"__esModule",{value:!0}),r.resolve=function(e,t){var r=(t=t||"").indexOf("#");if(r>0&&(t=t.substr(0,r)),!e.length){if(t.indexOf(":")<0)throw new Error("Found invalid baseIRI '".concat(t,"' for value '").concat(e,"'"));return t}if(e.startsWith("?")){var a=t.indexOf("?");return a>0&&(t=t.substr(0,a)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){var o=e.indexOf(":");if(o<0)throw new Error("Found invalid relative IRI '".concat(e,"' for a missing baseIRI"));return i(e,o)}var s=e.indexOf(":");if(s>=0)return i(e,s);var u=t.indexOf(":");if(u<0)throw new Error("Found invalid baseIRI '".concat(t,"' for value '").concat(e,"'"));var c,l=t.substr(0,u+1);if(0===e.indexOf("//"))return l+i(e,s);if(t.indexOf("//",u)===u+1){if((c=t.indexOf("/",u+3))<0)return t.length>u+3?t+"/"+i(e,s):l+i(e,s)}else if((c=t.indexOf("/",u+1))<0)return l+i(e,s);if(0===e.indexOf("/"))return t.substr(0,c)+n(e);var f=t.substr(c),h=f.lastIndexOf("/");return h>=0&&h"===n?(E(this,"onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=x.TEXT):v(n)?(this.state=x.SGML_DECL_QUOTED,this.sgmlDecl+=n):this.sgmlDecl+=n;continue;case x.SGML_DECL_QUOTED:n===this.q&&(this.state=x.SGML_DECL,this.q=""),this.sgmlDecl+=n;continue;case x.DOCTYPE:">"===n?(this.state=x.TEXT,E(this,"ondoctype",this.doctype),this.doctype=!0):(this.doctype+=n,"["===n?this.state=x.DOCTYPE_DTD:v(n)&&(this.state=x.DOCTYPE_QUOTED,this.q=n));continue;case x.DOCTYPE_QUOTED:this.doctype+=n,n===this.q&&(this.q="",this.state=x.DOCTYPE);continue;case x.DOCTYPE_DTD:this.doctype+=n,"]"===n?this.state=x.DOCTYPE:v(n)&&(this.state=x.DOCTYPE_DTD_QUOTED,this.q=n);continue;case x.DOCTYPE_DTD_QUOTED:this.doctype+=n,n===this.q&&(this.state=x.DOCTYPE_DTD,this.q="");continue;case x.COMMENT:"-"===n?this.state=x.COMMENT_ENDING:this.comment+=n;continue;case x.COMMENT_ENDING:"-"===n?(this.state=x.COMMENT_ENDED,this.comment=I(this.opt,this.comment),this.comment&&E(this,"oncomment",this.comment),this.comment=""):(this.comment+="-"+n,this.state=x.COMMENT);continue;case x.COMMENT_ENDED:">"!==n?(A(this,"Malformed comment"),this.comment+="--"+n,this.state=x.COMMENT):this.state=x.TEXT;continue;case x.CDATA:"]"===n?this.state=x.CDATA_ENDING:this.cdata+=n;continue;case x.CDATA_ENDING:"]"===n?this.state=x.CDATA_ENDING_2:(this.cdata+="]"+n,this.state=x.CDATA);continue;case x.CDATA_ENDING_2:">"===n?(this.cdata&&E(this,"oncdata",this.cdata),E(this,"onclosecdata"),this.cdata="",this.state=x.TEXT):"]"===n?this.cdata+="]":(this.cdata+="]]"+n,this.state=x.CDATA);continue;case x.PROC_INST:"?"===n?this.state=x.PROC_INST_ENDING:p(n)?this.state=x.PROC_INST_BODY:this.procInstName+=n;continue;case x.PROC_INST_BODY:if(!this.procInstBody&&p(n))continue;"?"===n?this.state=x.PROC_INST_ENDING:this.procInstBody+=n;continue;case x.PROC_INST_ENDING:">"===n?(E(this,"onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=x.TEXT):(this.procInstBody+="?"+n,this.state=x.PROC_INST_BODY);continue;case x.OPEN_TAG:y(f,n)?this.tagName+=n:(R(this),">"===n?M(this):"/"===n?this.state=x.OPEN_TAG_SLASH:(p(n)||A(this,"Invalid character in tag name"),this.state=x.ATTRIB));continue;case x.OPEN_TAG_SLASH:">"===n?(M(this,!0),D(this)):(A(this,"Forward-slash in opening tag not followed by >"),this.state=x.ATTRIB);continue;case x.ATTRIB:if(p(n))continue;">"===n?M(this):"/"===n?this.state=x.OPEN_TAG_SLASH:y(l,n)?(this.attribName=n,this.attribValue="",this.state=x.ATTRIB_NAME):A(this,"Invalid attribute name");continue;case x.ATTRIB_NAME:"="===n?this.state=x.ATTRIB_VALUE:">"===n?(A(this,"Attribute without value"),this.attribValue=this.attribName,L(this),M(this)):p(n)?this.state=x.ATTRIB_NAME_SAW_WHITE:y(f,n)?this.attribName+=n:A(this,"Invalid attribute name");continue;case x.ATTRIB_NAME_SAW_WHITE:if("="===n)this.state=x.ATTRIB_VALUE;else{if(p(n))continue;A(this,"Attribute without value"),this.tag.attributes[this.attribName]="",this.attribValue="",E(this,"onattribute",{name:this.attribName,value:""}),this.attribName="",">"===n?M(this):y(l,n)?(this.attribName=n,this.state=x.ATTRIB_NAME):(A(this,"Invalid attribute name"),this.state=x.ATTRIB)}continue;case x.ATTRIB_VALUE:if(p(n))continue;v(n)?(this.q=n,this.state=x.ATTRIB_VALUE_QUOTED):(A(this,"Unquoted attribute value"),this.state=x.ATTRIB_VALUE_UNQUOTED,this.attribValue=n);continue;case x.ATTRIB_VALUE_QUOTED:if(n!==this.q){"&"===n?this.state=x.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=n;continue}L(this),this.q="",this.state=x.ATTRIB_VALUE_CLOSED;continue;case x.ATTRIB_VALUE_CLOSED:p(n)?this.state=x.ATTRIB:">"===n?M(this):"/"===n?this.state=x.OPEN_TAG_SLASH:y(l,n)?(A(this,"No whitespace between attributes"),this.attribName=n,this.attribValue="",this.state=x.ATTRIB_NAME):A(this,"Invalid attribute name");continue;case x.ATTRIB_VALUE_UNQUOTED:if(!g(n)){"&"===n?this.state=x.ATTRIB_VALUE_ENTITY_U:this.attribValue+=n;continue}L(this),">"===n?M(this):this.state=x.ATTRIB;continue;case x.CLOSE_TAG:if(this.tagName)">"===n?D(this):y(f,n)?this.tagName+=n:this.script?(this.script+=""===n?D(this):A(this,"Invalid characters in closing tag");continue;case x.TEXT_ENTITY:case x.ATTRIB_VALUE_ENTITY_Q:case x.ATTRIB_VALUE_ENTITY_U:var o,s;switch(this.state){case x.TEXT_ENTITY:o=x.TEXT,s="textNode";break;case x.ATTRIB_VALUE_ENTITY_Q:o=x.ATTRIB_VALUE_QUOTED,s="attribValue";break;case x.ATTRIB_VALUE_ENTITY_U:o=x.ATTRIB_VALUE_UNQUOTED,s="attribValue"}";"===n?(this[s]+=(c=void 0,m=void 0,void 0,w=void 0,_=(m=(u=this).entity).toLowerCase(),w="",u.ENTITIES[m]?u.ENTITIES[m]:u.ENTITIES[_]?u.ENTITIES[_]:("#"===(m=_).charAt(0)&&("x"===m.charAt(1)?(m=m.slice(2),w=(c=parseInt(m,16)).toString(16)):(m=m.slice(1),w=(c=parseInt(m,10)).toString(10))),m=m.replace(/^0+/,""),isNaN(c)||w.toLowerCase()!==m?(A(u,"Invalid character entity"),"&"+u.entity+";"):String.fromCodePoint(c))),this.entity="",this.state=o):y(this.entity.length?d:h,n)?this.entity+=n:(A(this,"Invalid character in entity name"),this[s]+="&"+this.entity+n,this.entity="",this.state=o);continue;default:throw new Error(this,"Unknown state: "+this.state)}var u,c,m,_,w;return this.position>=this.bufferCheckPosition&&function(e){for(var t=Math.max(r.MAX_BUFFER_LENGTH,10),n=0,a=0,o=i.length;at)switch(i[a]){case"textNode":j(e);break;case"cdata":E(e,"oncdata",e.cdata),e.cdata="";break;case"script":E(e,"onscript",e.script),e.script="";break;default:N(e,"Max buffer length exceeded: "+i[a])}n=Math.max(n,s)}e.bufferCheckPosition=r.MAX_BUFFER_LENGTH-n+e.position}(this),this},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){j(this),""!==this.cdata&&(E(this,"oncdata",this.cdata),this.cdata=""),""!==this.script&&(E(this,"onscript",this.script),this.script="")}};try{n=e("stream").Stream}catch(F){n=function(){}}var o=r.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function s(e,t){if(!(this instanceof s))return new s(e,t);n.apply(this),this._parser=new a(e,t),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(e){r.emit("error",e),r._parser.error=null},this._decoder=null,o.forEach(function(e){Object.defineProperty(r,"on"+e,{get:function(){return r._parser["on"+e]},set:function(t){if(!t)return r.removeAllListeners(e),r._parser["on"+e]=t,t;r.on(e,t)},enumerable:!0,configurable:!1})})}(s.prototype=Object.create(n.prototype,{constructor:{value:s}})).write=function(r){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(r)){if(!this._decoder){var n=e("string_decoder").StringDecoder;this._decoder=new n("utf8")}r=this._decoder.write(r)}return this._parser.write(r.toString()),this.emit("data",r),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,t){var r=this;return r._parser["on"+e]||-1===o.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),n.prototype.on.call(r,e,t)};var u="http://www.w3.org/XML/1998/namespace",c={xml:u,xmlns:"http://www.w3.org/2000/xmlns/"},l=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,h=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function p(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function v(e){return'"'===e||"'"===e}function g(e){return">"===e||p(e)}function y(e,t){return e.test(t)}function b(e,t){return!y(e,t)}var m,_,w,x=0;for(var k in r.STATE={BEGIN:x++,BEGIN_WHITESPACE:x++,TEXT:x++,TEXT_ENTITY:x++,OPEN_WAKA:x++,SGML_DECL:x++,SGML_DECL_QUOTED:x++,DOCTYPE:x++,DOCTYPE_QUOTED:x++,DOCTYPE_DTD:x++,DOCTYPE_DTD_QUOTED:x++,COMMENT_STARTING:x++,COMMENT:x++,COMMENT_ENDING:x++,COMMENT_ENDED:x++,CDATA:x++,CDATA_ENDING:x++,CDATA_ENDING_2:x++,PROC_INST:x++,PROC_INST_BODY:x++,PROC_INST_ENDING:x++,OPEN_TAG:x++,OPEN_TAG_SLASH:x++,ATTRIB:x++,ATTRIB_NAME:x++,ATTRIB_NAME_SAW_WHITE:x++,ATTRIB_VALUE:x++,ATTRIB_VALUE_QUOTED:x++,ATTRIB_VALUE_CLOSED:x++,ATTRIB_VALUE_UNQUOTED:x++,ATTRIB_VALUE_ENTITY_Q:x++,ATTRIB_VALUE_ENTITY_U:x++,CLOSE_TAG:x++,CLOSE_TAG_SAW_WHITE:x++,SCRIPT:x++,SCRIPT_ENDING:x++},r.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},r.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(r.ENTITIES).forEach(function(e){var t=r.ENTITIES[e],n="number"==typeof t?String.fromCharCode(t):t;r.ENTITIES[e]=n}),r.STATE)r.STATE[r.STATE[k]]=k;function S(e,t,r){e[t]&&e[t](r)}function E(e,t,r){e.textNode&&j(e),S(e,t,r)}function j(e){e.textNode=I(e.opt,e.textNode),e.textNode&&S(e,"ontext",e.textNode),e.textNode=""}function I(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function N(e,t){return j(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,S(e,"onerror",t),e}function T(e){return e.sawRoot&&!e.closedRoot&&A(e,"Unclosed root tag"),e.state!==x.BEGIN&&e.state!==x.BEGIN_WHITESPACE&&e.state!==x.TEXT&&N(e,"Unexpected end"),j(e),e.c="",e.closed=!0,S(e,"onend"),a.call(e,e.strict,e.opt),e}function A(e,t){if("object"!=typeof e||!(e instanceof a))throw new Error("bad call to strictFail");e.strict&&N(e,t)}function R(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,r=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(r.ns=t.ns),e.attribList.length=0,E(e,"onopentagstart",r)}function O(e,t){var r=e.indexOf(":")<0?["",e]:e.split(":"),n=r[0],i=r[1];return t&&"xmlns"===e&&(n="xmlns",i=""),{prefix:n,local:i}}function L(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=O(e.attribName,!0),r=t.local;if("xmlns"===t.prefix)if("xml"===r&&e.attribValue!==u)A(e,"xml: prefix must be bound to "+u+"\nActual: "+e.attribValue);else if("xmlns"===r&&"http://www.w3.org/2000/xmlns/"!==e.attribValue)A(e,"xmlns: prefix must be bound to http://www.w3.org/2000/xmlns/\nActual: "+e.attribValue);else{var n=e.tag,i=e.tags[e.tags.length-1]||e;n.ns===i.ns&&(n.ns=Object.create(i.ns)),n.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,E(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function M(e,t){if(e.opt.xmlns){var r=e.tag,n=O(e.tagName);r.prefix=n.prefix,r.local=n.local,r.uri=r.ns[n.prefix]||"",r.prefix&&!r.uri&&(A(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),r.uri=n.prefix),r.ns&&(e.tags[e.tags.length-1]||e).ns!==r.ns&&Object.keys(r.ns).forEach(function(t){E(e,"onopennamespace",{prefix:t,uri:r.ns[t]})});for(var i=0,a=e.attribList.length;i",e.tagName="",void(e.state=x.SCRIPT);E(e,"onscript",e.script),e.script=""}var t=e.tags.length,r=e.tagName;e.strict||(r=r[e.looseCase]());for(var n=r;t--&&e.tags[t].name!==n;)A(e,"Unexpected close tag");if(t<0)return A(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=x.TEXT);e.tagName=r;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,E(e,"onclosetag",e.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];e.opt.xmlns&&a.ns!==(e.tags[e.tags.length-1]||e).ns&&Object.keys(a.ns).forEach(function(t){E(e,"onclosenamespace",{prefix:t,uri:a.ns[t]})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=x.TEXT}function C(e,t){"<"===t?(e.state=x.OPEN_WAKA,e.startTagPosition=e.position):p(t)||(A(e,"Non-whitespace before first tag."),e.textNode=t,e.state=x.TEXT)}function P(e,t){var r="";return t1114111||_(a)!==a)throw RangeError("Invalid code point: "+a);a<=65535?t.push(a):t.push(55296+((a-=65536)>>10),a%1024+56320),(r+1===n||t.length>e)&&(i+=m.apply(null,t),t.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:w,configurable:!0,writable:!0}):String.fromCodePoint=w)}(void 0===r?this.sax={}:r)}).call(this,e("buffer").Buffer)},{buffer:12,stream:97,string_decoder:113}],97:[function(e,t,r){t.exports=i;var n=e("events").EventEmitter;function i(){n.call(this)}e("inherits")(i,n),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var o=!1;function s(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",a),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",c),e.on("error",c),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},{events:13,inherits:18,"readable-stream/duplex.js":98,"readable-stream/passthrough.js":107,"readable-stream/readable.js":108,"readable-stream/transform.js":109,"readable-stream/writable.js":110}],98:[function(e,t,r){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":99}],99:[function(e,t,r){"use strict";var n=e("process-nextick-args"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=f;var a=Object.create(e("core-util-is"));a.inherits=e("inherits");var o=e("./_stream_readable"),s=e("./_stream_writable");a.inherits(f,o);for(var u=i(s.prototype),c=0;c0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?w(e,o,t,!1):E(e,o)):w(e,o,t,!1))):n||(o.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(S,e):S(e))}function S(e){d("emit readable"),e.emit("readable"),T(e)}function E(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return ea.length?a.length:e;if(i+=o===a.length?a:a.slice(0,e),0==(e-=o)){o===a.length?(++n,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0==(e-=o)){o===a.length?(++i,t.head=n.next?n.next:t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function R(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(O,t,e))}function O(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function L(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):k(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&R(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?A(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&R(this)),null!==n&&this.emit("data",n),n},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,d("pipe count=%d opts=%j",a.pipesCount,t);var u=t&&!1===t.end||e===r.stdout||e===r.stderr?b:c;function c(){d("onend"),e.end()}a.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",function t(r,i){d("onunpipe"),r===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,d("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",l),e.removeListener("error",v),e.removeListener("unpipe",t),n.removeListener("end",c),n.removeListener("end",b),n.removeListener("data",p),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||l())});var l=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,T(e))}}(n);e.on("drain",l);var f=!1,h=!1;function p(t){d("ondata"),h=!1,!1!==e.write(t)||h||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==L(a.pipes,e))&&!f&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function v(t){d("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){d("onfinish"),e.removeListener("close",g),b()}function b(){d("unpipe"),n.unpipe(e)}return n.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener("error",r);e._events&&e._events.error?o(e._events.error)?e._events.error.unshift(r):e._events.error=[r,e._events.error]:e.on("error",r)}(e,0,v),e.once("close",g),e.once("finish",y),e.emit("pipe",n),a.flowing||(d("pipe resume"),n.resume()),e},m.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a-1?i:a.nextTick;b.WritableState=y;var c=Object.create(e("core-util-is"));c.inherits=e("inherits");var l,f={deprecate:e("util-deprecate")},h=e("./internal/streams/stream"),d=e("safe-buffer").Buffer,p=n.Uint8Array||function(){},v=e("./internal/streams/destroy");function g(){}function y(t,r){s=s||e("./_stream_duplex");var n=r instanceof s;this.objectMode=!!(t=t||{}).objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===t.decodeStrings),this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(a.nextTick(i,n),a.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),S(e,t))}(e,r,n,t,i);else{var o=x(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||w(e,r),n?u(_,e,r,o,i):_(e,r,o,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function b(t){if(s=s||e("./_stream_duplex"),!(l.call(b,this)||this instanceof s))return new b(t);this._writableState=new y(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),h.call(this)}function m(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),S(e,t)}function w(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=new Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,m(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk;if(m(e,t,!1,t.objectMode?1:u.length,u,r.encoding,r.callback),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),S(e,t)})}function S(e,t){var r=x(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(b,h),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===b&&e&&e._writableState instanceof y}})):l=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(d.isBuffer(n=e)||n instanceof p);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=g),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),a.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(n,o),i=!1),i}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,i,a){if(!r){var o=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r)),t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,S(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{"./_stream_duplex":99,"./internal/streams/destroy":105,"./internal/streams/stream":106,_process:62,"core-util-is":16,inherits:18,"process-nextick-args":61,"safe-buffer":111,timers:14,"util-deprecate":114}],104:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=e("util");t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,i=0;r;)r.data.copy(t,i),i+=r.data.length,r=r.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":111,util:11}],105:[function(e,t,r){"use strict";var n=e("process-nextick-args");function i(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":61}],106:[function(e,t,r){arguments[4][91][0].apply(r,arguments)},{dup:91,events:13}],107:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":108}],108:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":99,"./lib/_stream_passthrough.js":100,"./lib/_stream_readable.js":101,"./lib/_stream_transform.js":102,"./lib/_stream_writable.js":103}],109:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":108}],110:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":103}],111:[function(e,t,r){var n=e("buffer"),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(a(n,r),r.Buffer=o),a(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:12}],112:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}r.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":111}],113:[function(e,t,r){arguments[4][112][0].apply(r,arguments)},{dup:112,"safe-buffer":95}],114:[function(e,t,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(n){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],115:[function(e,t,r){"use strict";t.exports=function(e){e.prototype[Symbol.iterator]=regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(!t){e.next=7;break}return e.next=4,t.value;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}},e,this)})}},{}],116:[function(e,t,r){"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var r=0,i=arguments.length;r1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(tthis.length&&(t=this.length);for(var i=0,a=this.head;null!==a&&ithis.length&&(t=this.length);for(var i=this.length,a=this.tail;null!==a&&i>t;i--)a=a.prev;for(;null!==a&&i>e;i--,a=a.prev)r.push(a.value);return r},n.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,n=this.head;null!==n&&r"']/g,P=RegExp(D.source),F=RegExp(C.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,G=/<%=([\s\S]+?)%>/g,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V=/^\w*$/,q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,W=RegExp(K.source),H=/^\s+|\s+$/g,J=/^\s+/,X=/\s+$/,Q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Y=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,$=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/\\(\\)?/g,te=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,se=/^(?:0|[1-9]\d*)$/,ue=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ce=/($^)/,le=/['\n\r\u2028\u2029\\]/g,fe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",he="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",de="["+he+"]",pe="["+fe+"]",ve="\\d+",ge="[a-z\\xdf-\\xf6\\xf8-\\xff]",ye="[^\\ud800-\\udfff"+he+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",be="\\ud83c[\\udffb-\\udfff]",me="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",we="[\\ud800-\\udbff][\\udc00-\\udfff]",xe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ke="(?:"+ge+"|"+ye+")",Se="(?:"+xe+"|"+ye+")",Ee="(?:"+pe+"|"+be+")?",je="[\\ufe0e\\ufe0f]?"+Ee+"(?:\\u200d(?:"+[me,_e,we].join("|")+")[\\ufe0e\\ufe0f]?"+Ee+")*",Ie="(?:"+["[\\u2700-\\u27bf]",_e,we].join("|")+")"+je,Ne="(?:"+[me+pe+"?",pe,_e,we,"[\\ud800-\\udfff]"].join("|")+")",Te=RegExp("['\u2019]","g"),Ae=RegExp(pe,"g"),Re=RegExp(be+"(?="+be+")|"+Ne+je,"g"),Oe=RegExp([xe+"?"+ge+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[de,xe,"$"].join("|")+")",Se+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[de,xe+ke,"$"].join("|")+")",xe+"?"+ke+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",xe+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ve,Ie].join("|"),"g"),Le=RegExp("[\\u200d\\ud800-\\udfff"+fe+"\\ufe0e\\ufe0f]"),Me=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,De=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ce=-1,Pe={};Pe[S]=Pe[E]=Pe[j]=Pe[I]=Pe[N]=Pe[T]=Pe["[object Uint8ClampedArray]"]=Pe[A]=Pe[R]=!0,Pe[s]=Pe[u]=Pe[x]=Pe[c]=Pe[k]=Pe[l]=Pe[f]=Pe[h]=Pe[p]=Pe[v]=Pe[g]=Pe[y]=Pe[b]=Pe[m]=Pe[w]=!1;var Fe={};Fe[s]=Fe[u]=Fe[x]=Fe[k]=Fe[c]=Fe[l]=Fe[S]=Fe[E]=Fe[j]=Fe[I]=Fe[N]=Fe[p]=Fe[v]=Fe[g]=Fe[y]=Fe[b]=Fe[m]=Fe[_]=Fe[T]=Fe["[object Uint8ClampedArray]"]=Fe[A]=Fe[R]=!0,Fe[f]=Fe[h]=Fe[w]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,Ge=parseInt,ze="object"==typeof global&&global&&global.Object===Object&&global,Ve="object"==typeof self&&self&&self.Object===Object&&self,qe=ze||Ve||Function("return this")(),Ke=t&&!t.nodeType&&t,We=Ke&&"object"==typeof e&&e&&!e.nodeType&&e,He=We&&We.exports===Ke,Je=He&&ze.process,Xe=function(){try{return We&&We.require&&We.require("util").types||Je&&Je.binding&&Je.binding("util")}catch(e){}}(),Qe=Xe&&Xe.isArrayBuffer,Ye=Xe&&Xe.isDate,Ze=Xe&&Xe.isMap,$e=Xe&&Xe.isRegExp,et=Xe&&Xe.isSet,tt=Xe&&Xe.isTypedArray;function rt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function nt(e,t,r,n){for(var i=-1,a=null==e?0:e.length;++i-1}function ct(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function Rt(e,t){for(var r=e.length;r--&&bt(t,e[r],0)>-1;);return r}function Ot(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Lt=kt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Mt=kt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Dt(e){return"\\"+Be[e]}function Ct(e){return Le.test(e)}function Pt(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function Ft(e,t){return function(r){return e(t(r))}}function Bt(e,t){for(var r=-1,n=e.length,i=0,o=[];++r",""":'"',"'":"'"}),Kt=function e(t){var r,n=(t=null==t?qe:Kt.defaults(qe.Object(),t,Kt.pick(qe,De))).Array,fe=t.Date,he=t.Error,de=t.Function,pe=t.Math,ve=t.Object,ge=t.RegExp,ye=t.String,be=t.TypeError,me=n.prototype,_e=ve.prototype,we=t["__core-js_shared__"],xe=de.prototype.toString,ke=_e.hasOwnProperty,Se=0,Ee=(r=/[^.]+$/.exec(we&&we.keys&&we.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",je=_e.toString,Ie=xe.call(ve),Ne=qe._,Re=ge("^"+xe.call(ke).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=He?t.Buffer:void 0,Be=t.Symbol,ze=t.Uint8Array,Ve=Le?Le.allocUnsafe:void 0,Ke=Ft(ve.getPrototypeOf,ve),We=ve.create,Je=_e.propertyIsEnumerable,Xe=me.splice,vt=Be?Be.isConcatSpreadable:void 0,kt=Be?Be.iterator:void 0,Wt=Be?Be.toStringTag:void 0,Ht=function(){try{var e=Yi(ve,"defineProperty");return e({},"",{}),e}catch(t){}}(),Jt=t.clearTimeout!==qe.clearTimeout&&t.clearTimeout,Xt=fe&&fe.now!==qe.Date.now&&fe.now,Qt=t.setTimeout!==qe.setTimeout&&t.setTimeout,Yt=pe.ceil,Zt=pe.floor,$t=ve.getOwnPropertySymbols,er=Le?Le.isBuffer:void 0,tr=t.isFinite,rr=me.join,nr=Ft(ve.keys,ve),ir=pe.max,ar=pe.min,or=fe.now,sr=t.parseInt,ur=pe.random,cr=me.reverse,lr=Yi(t,"DataView"),fr=Yi(t,"Map"),hr=Yi(t,"Promise"),dr=Yi(t,"Set"),pr=Yi(t,"WeakMap"),vr=Yi(ve,"create"),gr=pr&&new pr,yr={},br=ja(lr),mr=ja(fr),_r=ja(hr),wr=ja(dr),xr=ja(pr),kr=Be?Be.prototype:void 0,Sr=kr?kr.valueOf:void 0,Er=kr?kr.toString:void 0;function jr(e){if(qo(e)&&!Lo(e)&&!(e instanceof Ar)){if(e instanceof Tr)return e;if(ke.call(e,"__wrapped__"))return Ia(e)}return new Tr(e)}var Ir=function(){function e(){}return function(t){if(!Vo(t))return{};if(We)return We(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Nr(){}function Tr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ar(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Jr(e,t,r,n,i,a){var o,u=1&t,f=2&t,w=4&t;if(r&&(o=i?r(e,n,i,a):r(e)),void 0!==o)return o;if(!Vo(e))return e;var O=Lo(e);if(O){if(o=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&ke.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!u)return vi(e,o)}else{var L=ea(e),M=L==h||L==d;if(Po(e))return ci(e,u);if(L==g||L==s||M&&!i){if(o=f||M?{}:ra(e),!u)return f?function(e,t){return gi(e,$i(e),t)}(e,function(e,t){return e&&gi(t,ws(t),e)}(o,e)):function(e,t){return gi(e,Zi(e),t)}(e,qr(o,e))}else{if(!Fe[L])return i?e:{};o=function(e,t,r){var n=e.constructor;switch(t){case x:return li(e);case c:case l:return new n(+e);case k:return function(e,t){var r=t?li(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case S:case E:case j:case I:case N:case T:case"[object Uint8ClampedArray]":case A:case R:return fi(e,r);case p:return new n;case v:case m:return new n(e);case y:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new n;case _:return Sr?ve(Sr.call(e)):{}}}(e,L,u)}}a||(a=new Dr);var D=a.get(e);if(D)return D;a.set(e,o),Xo(e)?e.forEach(function(n){o.add(Jr(n,t,r,n,e,a))}):Ko(e)&&e.forEach(function(n,i){o.set(i,Jr(n,t,r,i,e,a))});var C=O?void 0:(w?f?qi:Vi:f?ws:_s)(e);return it(C||e,function(n,i){C&&(n=e[i=n]),Gr(o,i,Jr(n,t,r,i,e,a))}),o}function Xr(e,t,r){var n=r.length;if(null==e)return!n;for(e=ve(e);n--;){var i=r[n],a=e[i];if(void 0===a&&!(i in e)||!(0,t[i])(a))return!1}return!0}function Qr(e,t,r){if("function"!=typeof e)throw new be(i);return ya(function(){e.apply(void 0,r)},t)}function Yr(e,t,r,n){var i=-1,a=ut,o=!0,s=e.length,u=[],c=t.length;if(!s)return u;r&&(t=lt(t,It(r))),n?(a=ct,o=!1):t.length>=200&&(a=Tt,o=!1,t=new Mr(t));e:for(;++i-1},Or.prototype.set=function(e,t){var r=this.__data__,n=zr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Lr.prototype.clear=function(){this.size=0,this.__data__={hash:new Rr,map:new(fr||Or),string:new Rr}},Lr.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},Lr.prototype.get=function(e){return Xi(this,e).get(e)},Lr.prototype.has=function(e){return Xi(this,e).has(e)},Lr.prototype.set=function(e,t){var r=Xi(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Mr.prototype.add=Mr.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Mr.prototype.has=function(e){return this.__data__.has(e)},Dr.prototype.clear=function(){this.__data__=new Or,this.size=0},Dr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Dr.prototype.get=function(e){return this.__data__.get(e)},Dr.prototype.has=function(e){return this.__data__.has(e)},Dr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Or){var n=r.__data__;if(!fr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Lr(n)}return r.set(e,t),this.size=r.size,this};var Zr=mi(sn),$r=mi(un,!0);function en(e,t){var r=!0;return Zr(e,function(e,n,i){return r=!!t(e,n,i)}),r}function tn(e,t,r){for(var n=-1,i=e.length;++n0&&r(s)?t>1?nn(s,t-1,r,n,i):ft(i,s):n||(i[i.length]=s)}return i}var an=_i(),on=_i(!0);function sn(e,t){return e&&an(e,t,_s)}function un(e,t){return e&&on(e,t,_s)}function cn(e,t){return st(t,function(t){return Uo(e[t])})}function ln(e,t){for(var r=0,n=(t=ai(t,e)).length;null!=e&&rt}function pn(e,t){return null!=e&&ke.call(e,t)}function vn(e,t){return null!=e&&t in ve(e)}function gn(e,t,r){for(var i=r?ct:ut,a=e[0].length,o=e.length,s=o,u=n(o),c=1/0,l=[];s--;){var f=e[s];s&&t&&(f=lt(f,It(t))),c=ar(f.length,c),u[s]=!r&&(t||a>=120&&f.length>=120)?new Mr(s&&f):void 0}f=e[0];var h=-1,d=u[0];e:for(;++h=s?u:u*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)});n--;)e[n]=e[n].value;return e}(En(e,function(e,r,i){return{criteria:lt(t,function(t){return t(e)}),index:++n,value:e}}))}function Rn(e,t,r){for(var n=-1,i=t.length,a={};++n-1;)s!==e&&Xe.call(s,u,1),Xe.call(e,u,1);return e}function Ln(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==a){var a=i;ia(i)?Xe.call(e,i,1):Yn(e,i)}}return e}function Mn(e,t){return e+Zt(ur()*(t-e+1))}function Dn(e,t){var r="";if(!e||t<1||t>9007199254740991)return r;do{t%2&&(r+=e),(t=Zt(t/2))&&(e+=e)}while(t);return r}function Cn(e,t){return ba(ha(e,t,Ws),e+"")}function Pn(e){return Pr(Ts(e))}function Fn(e,t){var r=Ts(e);return wa(r,Hr(t,0,r.length))}function Bn(e,t,r,n){if(!Vo(e))return e;for(var i=-1,a=(t=ai(t,e)).length,o=a-1,s=e;null!=s&&++ia?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var o=n(a);++i>>1,o=e[a];null!==o&&!Yo(o)&&(r?o<=t:o=200){var c=t?null:Di(e);if(c)return Ut(c);o=!1,i=Tt,u=new Mr}else u=t?[]:s;e:for(;++n=n?e:Vn(e,t,r)}var ui=Jt||function(e){return qe.clearTimeout(e)};function ci(e,t){if(t)return e.slice();var r=e.length,n=Ve?Ve(r):new e.constructor(r);return e.copy(n),n}function li(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function fi(e,t){var r=t?li(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function hi(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=e==e,a=Yo(e),o=void 0!==t,s=null===t,u=t==t,c=Yo(t);if(!s&&!c&&!a&&e>t||a&&o&&u&&!s&&!c||n&&o&&u||!r&&u||!i)return 1;if(!n&&!a&&!c&&e1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&aa(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=ve(t);++n-1?i[a?t[o]:o]:void 0}}function Ei(e){return zi(function(t){var r=t.length,n=r,a=Tr.prototype.thru;for(e&&t.reverse();n--;){var o=t[n];if("function"!=typeof o)throw new be(i);if(a&&!s&&"wrapper"==Wi(o))var s=new Tr([],!0)}for(n=s?n:r;++n1&&m.reverse(),f&&cs))return!1;var c=a.get(e),l=a.get(t);if(c&&l)return c==t&&l==e;var f=-1,h=!0,d=2&r?new Mr:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(Q,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return it(o,function(r){var n="_."+r[0];t&r[1]&&!ut(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(Y);return t?t[1].split(Z):[]}(n),r)))}function _a(e){var t=0,r=0;return function(){var n=or(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function wa(e,t){var r=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++r1?e[t-1]:void 0;return r="function"==typeof r?(e.pop(),r):void 0,Ha(e,r)});function eo(e){var t=jr(e);return t.__chain__=!0,t}function to(e,t){return t(e)}var ro=zi(function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,i=function(t){return Wr(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ar&&ia(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:to,args:[i],thisArg:void 0}),new Tr(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),no=yi(function(e,t,r){ke.call(e,r)?++e[r]:Kr(e,r,1)}),io=Si(Ra),ao=Si(Oa);function oo(e,t){return(Lo(e)?it:Zr)(e,Ji(t,3))}function so(e,t){return(Lo(e)?at:$r)(e,Ji(t,3))}var uo=yi(function(e,t,r){ke.call(e,r)?e[r].push(t):Kr(e,r,[t])}),co=Cn(function(e,t,r){var i=-1,a="function"==typeof t,o=Do(e)?n(e.length):[];return Zr(e,function(e){o[++i]=a?rt(t,e,r):yn(e,t,r)}),o}),lo=yi(function(e,t,r){Kr(e,r,t)});function fo(e,t){return(Lo(e)?lt:En)(e,Ji(t,3))}var ho=yi(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),po=Cn(function(e,t){if(null==e)return[];var r=t.length;return r>1&&aa(e,t[0],t[1])?t=[]:r>2&&aa(t[0],t[1],t[2])&&(t=[t[0]]),An(e,nn(t,1),[])}),vo=Xt||function(){return qe.Date.now()};function go(e,t,r){return t=r?void 0:t,Pi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function yo(e,t){var r;if("function"!=typeof t)throw new be(i);return e=ns(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var bo=Cn(function(e,t,r){var n=1;if(r.length){var i=Bt(r,Hi(bo));n|=32}return Pi(e,n,t,r,i)}),mo=Cn(function(e,t,r){var n=3;if(r.length){var i=Bt(r,Hi(mo));n|=32}return Pi(t,n,e,r,i)});function _o(e,t,r){var n,a,o,s,u,c,l=0,f=!1,h=!1,d=!0;if("function"!=typeof e)throw new be(i);function p(t){var r=n,i=a;return n=a=void 0,l=t,s=e.apply(i,r)}function v(e){return l=e,u=ya(y,t),f?p(e):s}function g(e){var r=e-c;return void 0===c||r>=t||r<0||h&&e-l>=o}function y(){var e=vo();if(g(e))return b(e);u=ya(y,function(e){var r=t-(e-c);return h?ar(r,o-(e-l)):r}(e))}function b(e){return u=void 0,d&&n?p(e):(n=a=void 0,s)}function m(){var e=vo(),r=g(e);if(n=arguments,a=this,c=e,r){if(void 0===u)return v(c);if(h)return ui(u),u=ya(y,t),p(c)}return void 0===u&&(u=ya(y,t)),s}return t=as(t)||0,Vo(r)&&(f=!!r.leading,o=(h="maxWait"in r)?ir(as(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),m.cancel=function(){void 0!==u&&ui(u),l=0,n=c=a=u=void 0},m.flush=function(){return void 0===u?s:b(vo())},m}var wo=Cn(function(e,t){return Qr(e,1,t)}),xo=Cn(function(e,t,r){return Qr(e,as(t)||0,r)});function ko(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new be(i);var r=function r(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(ko.Cache||Lr),r}function So(e){if("function"!=typeof e)throw new be(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ko.Cache=Lr;var Eo=oi(function(e,t){var r=(t=1==t.length&&Lo(t[0])?lt(t[0],It(Ji())):lt(nn(t,1),It(Ji()))).length;return Cn(function(n){for(var i=-1,a=ar(n.length,r);++i=t}),Oo=bn(function(){return arguments}())?bn:function(e){return qo(e)&&ke.call(e,"callee")&&!Je.call(e,"callee")},Lo=n.isArray,Mo=Qe?It(Qe):function(e){return qo(e)&&hn(e)==x};function Do(e){return null!=e&&zo(e.length)&&!Uo(e)}function Co(e){return qo(e)&&Do(e)}var Po=er||au,Fo=Ye?It(Ye):function(e){return qo(e)&&hn(e)==l};function Bo(e){if(!qo(e))return!1;var t=hn(e);return t==f||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ho(e)}function Uo(e){if(!Vo(e))return!1;var t=hn(e);return t==h||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Go(e){return"number"==typeof e&&e==ns(e)}function zo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Vo(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function qo(e){return null!=e&&"object"==typeof e}var Ko=Ze?It(Ze):function(e){return qo(e)&&ea(e)==p};function Wo(e){return"number"==typeof e||qo(e)&&hn(e)==v}function Ho(e){if(!qo(e)||hn(e)!=g)return!1;var t=Ke(e);if(null===t)return!0;var r=ke.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&xe.call(r)==Ie}var Jo=$e?It($e):function(e){return qo(e)&&hn(e)==y},Xo=et?It(et):function(e){return qo(e)&&ea(e)==b};function Qo(e){return"string"==typeof e||!Lo(e)&&qo(e)&&hn(e)==m}function Yo(e){return"symbol"==typeof e||qo(e)&&hn(e)==_}var Zo=tt?It(tt):function(e){return qo(e)&&zo(e.length)&&!!Pe[hn(e)]},$o=Oi(Sn),es=Oi(function(e,t){return e<=t});function ts(e){if(!e)return[];if(Do(e))return Qo(e)?Vt(e):vi(e);if(kt&&e[kt])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[kt]());var t=ea(e);return(t==p?Pt:t==b?Ut:Ts)(e)}function rs(e){return e?1/0===(e=as(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ns(e){var t=rs(e),r=t%1;return t==t?r?t-r:t:0}function is(e){return e?Hr(ns(e),0,4294967295):0}function as(e){if("number"==typeof e)return e;if(Yo(e))return NaN;if(Vo(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Vo(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(H,"");var r=ie.test(e);return r||oe.test(e)?Ge(e.slice(2),r?2:8):ne.test(e)?NaN:+e}function os(e){return gi(e,ws(e))}function ss(e){return null==e?"":Xn(e)}var us=bi(function(e,t){if(ca(t)||Do(t))gi(t,_s(t),e);else for(var r in t)ke.call(t,r)&&Gr(e,r,t[r])}),cs=bi(function(e,t){gi(t,ws(t),e)}),ls=bi(function(e,t,r,n){gi(t,ws(t),e,n)}),fs=bi(function(e,t,r,n){gi(t,_s(t),e,n)}),hs=zi(Wr),ds=Cn(function(e,t){e=ve(e);var r=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&aa(t[0],t[1],i)&&(n=1);++r1),t}),gi(e,qi(e),r),n&&(r=Jr(r,7,Ui));for(var i=t.length;i--;)Yn(r,t[i]);return r}),Es=zi(function(e,t){return null==e?{}:function(e,t){return Rn(e,t,function(t,r){return gs(e,r)})}(e,t)});function js(e,t){if(null==e)return{};var r=lt(qi(e),function(e){return[e]});return t=Ji(t),Rn(e,r,function(e,r){return t(e,r[0])})}var Is=Ci(_s),Ns=Ci(ws);function Ts(e){return null==e?[]:Nt(e,_s(e))}var As=xi(function(e,t,r){return t=t.toLowerCase(),e+(r?Rs(t):t)});function Rs(e){return Bs(ss(e).toLowerCase())}function Os(e){return(e=ss(e))&&e.replace(ue,Lt).replace(Ae,"")}var Ls=xi(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),Ms=xi(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),Ds=wi("toLowerCase"),Cs=xi(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),Ps=xi(function(e,t,r){return e+(r?" ":"")+Bs(t)}),Fs=xi(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Bs=wi("toUpperCase");function Us(e,t,r){return e=ss(e),void 0===(t=r?void 0:t)?function(e){return Me.test(e)}(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.match($)||[]}(e):e.match(t)||[]}var Gs=Cn(function(e,t){try{return rt(e,void 0,t)}catch(r){return Bo(r)?r:new he(r)}}),zs=zi(function(e,t){return it(t,function(t){t=Ea(t),Kr(e,t,bo(e[t],e))}),e});function Vs(e){return function(){return e}}var qs=Ei(),Ks=Ei(!0);function Ws(e){return e}function Hs(e){return xn("function"==typeof e?e:Jr(e,1))}var Js=Cn(function(e,t){return function(r){return yn(r,e,t)}}),Xs=Cn(function(e,t){return function(r){return yn(e,r,t)}});function Qs(e,t,r){var n=_s(t),i=cn(t,n);null!=r||Vo(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=cn(t,_s(t)));var a=!(Vo(r)&&"chain"in r&&!r.chain),o=Uo(e);return it(i,function(r){var n=t[r];e[r]=n,o&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__),i=r.__actions__=vi(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,ft([this.value()],arguments))})}),e}function Ys(){}var Zs=Ti(lt),$s=Ti(ot),eu=Ti(pt);function tu(e){return oa(e)?xt(Ea(e)):function(e){return function(t){return ln(t,e)}}(e)}var ru=Ri(),nu=Ri(!0);function iu(){return[]}function au(){return!1}var ou,su=Ni(function(e,t){return e+t},0),uu=Mi("ceil"),cu=Ni(function(e,t){return e/t},1),lu=Mi("floor"),fu=Ni(function(e,t){return e*t},1),hu=Mi("round"),du=Ni(function(e,t){return e-t},0);return jr.after=function(e,t){if("function"!=typeof t)throw new be(i);return e=ns(e),function(){if(--e<1)return t.apply(this,arguments)}},jr.ary=go,jr.assign=us,jr.assignIn=cs,jr.assignInWith=ls,jr.assignWith=fs,jr.at=hs,jr.before=yo,jr.bind=bo,jr.bindAll=zs,jr.bindKey=mo,jr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Lo(e)?e:[e]},jr.chain=eo,jr.chunk=function(e,t,r){t=(r?aa(e,t,r):void 0===t)?1:ir(ns(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=n(Yt(i/t));ai?0:i+r),(n=void 0===n||n>i?i:ns(n))<0&&(n+=i),n=r>n?0:is(n);r>>0)?(e=ss(e))&&("string"==typeof t||null!=t&&!Jo(t))&&!(t=Xn(t))&&Ct(e)?si(Vt(e),0,r):e.split(t,r):[]},jr.spread=function(e,t){if("function"!=typeof e)throw new be(i);return t=null==t?0:ir(ns(t),0),Cn(function(r){var n=r[t],i=si(r,0,t);return n&&ft(i,n),rt(e,this,i)})},jr.tail=function(e){var t=null==e?0:e.length;return t?Vn(e,1,t):[]},jr.take=function(e,t,r){return e&&e.length?Vn(e,0,(t=r||void 0===t?1:ns(t))<0?0:t):[]},jr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?Vn(e,(t=n-(t=r||void 0===t?1:ns(t)))<0?0:t,n):[]},jr.takeRightWhile=function(e,t){return e&&e.length?$n(e,Ji(t,3),!1,!0):[]},jr.takeWhile=function(e,t){return e&&e.length?$n(e,Ji(t,3)):[]},jr.tap=function(e,t){return t(e),e},jr.throttle=function(e,t,r){var n=!0,a=!0;if("function"!=typeof e)throw new be(i);return Vo(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),_o(e,t,{leading:n,maxWait:t,trailing:a})},jr.thru=to,jr.toArray=ts,jr.toPairs=Is,jr.toPairsIn=Ns,jr.toPath=function(e){return Lo(e)?lt(e,Ea):Yo(e)?[e]:vi(Sa(ss(e)))},jr.toPlainObject=os,jr.transform=function(e,t,r){var n=Lo(e),i=n||Po(e)||Zo(e);if(t=Ji(t,4),null==r){var a=e&&e.constructor;r=i?n?new a:[]:Vo(e)&&Uo(a)?Ir(Ke(e)):{}}return(i?it:sn)(e,function(e,n,i){return t(r,e,n,i)}),r},jr.unary=function(e){return go(e,1)},jr.union=Va,jr.unionBy=qa,jr.unionWith=Ka,jr.uniq=function(e){return e&&e.length?Qn(e):[]},jr.uniqBy=function(e,t){return e&&e.length?Qn(e,Ji(t,2)):[]},jr.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qn(e,void 0,t):[]},jr.unset=function(e,t){return null==e||Yn(e,t)},jr.unzip=Wa,jr.unzipWith=Ha,jr.update=function(e,t,r){return null==e?e:Zn(e,t,ii(r))},jr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:void 0,null==e?e:Zn(e,t,ii(r),n)},jr.values=Ts,jr.valuesIn=function(e){return null==e?[]:Nt(e,ws(e))},jr.without=Ja,jr.words=Us,jr.wrap=function(e,t){return jo(ii(t),e)},jr.xor=Xa,jr.xorBy=Qa,jr.xorWith=Ya,jr.zip=Za,jr.zipObject=function(e,t){return ri(e||[],t||[],Gr)},jr.zipObjectDeep=function(e,t){return ri(e||[],t||[],Bn)},jr.zipWith=$a,jr.entries=Is,jr.entriesIn=Ns,jr.extend=cs,jr.extendWith=ls,Qs(jr,jr),jr.add=su,jr.attempt=Gs,jr.camelCase=As,jr.capitalize=Rs,jr.ceil=uu,jr.clamp=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=as(r))==r?r:0),void 0!==t&&(t=(t=as(t))==t?t:0),Hr(as(e),t,r)},jr.clone=function(e){return Jr(e,4)},jr.cloneDeep=function(e){return Jr(e,5)},jr.cloneDeepWith=function(e,t){return Jr(e,5,t="function"==typeof t?t:void 0)},jr.cloneWith=function(e,t){return Jr(e,4,t="function"==typeof t?t:void 0)},jr.conformsTo=function(e,t){return null==t||Xr(e,t,_s(t))},jr.deburr=Os,jr.defaultTo=function(e,t){return null==e||e!=e?t:e},jr.divide=cu,jr.endsWith=function(e,t,r){e=ss(e),t=Xn(t);var n=e.length,i=r=void 0===r?n:Hr(ns(r),0,n);return(r-=t.length)>=0&&e.slice(r,i)==t},jr.eq=To,jr.escape=function(e){return(e=ss(e))&&F.test(e)?e.replace(C,Mt):e},jr.escapeRegExp=function(e){return(e=ss(e))&&W.test(e)?e.replace(K,"\\$&"):e},jr.every=function(e,t,r){var n=Lo(e)?ot:en;return r&&aa(e,t,r)&&(t=void 0),n(e,Ji(t,3))},jr.find=io,jr.findIndex=Ra,jr.findKey=function(e,t){return gt(e,Ji(t,3),sn)},jr.findLast=ao,jr.findLastIndex=Oa,jr.findLastKey=function(e,t){return gt(e,Ji(t,3),un)},jr.floor=lu,jr.forEach=oo,jr.forEachRight=so,jr.forIn=function(e,t){return null==e?e:an(e,Ji(t,3),ws)},jr.forInRight=function(e,t){return null==e?e:on(e,Ji(t,3),ws)},jr.forOwn=function(e,t){return e&&sn(e,Ji(t,3))},jr.forOwnRight=function(e,t){return e&&un(e,Ji(t,3))},jr.get=vs,jr.gt=Ao,jr.gte=Ro,jr.has=function(e,t){return null!=e&&ta(e,t,pn)},jr.hasIn=gs,jr.head=Ma,jr.identity=Ws,jr.includes=function(e,t,r,n){e=Do(e)?e:Ts(e),r=r&&!n?ns(r):0;var i=e.length;return r<0&&(r=ir(i+r,0)),Qo(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&bt(e,t,r)>-1},jr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ns(r);return i<0&&(i=ir(n+i,0)),bt(e,t,i)},jr.inRange=function(e,t,r){return t=rs(t),void 0===r?(r=t,t=0):r=rs(r),function(e,t,r){return e>=ar(t,r)&&e=-9007199254740991&&e<=9007199254740991},jr.isSet=Xo,jr.isString=Qo,jr.isSymbol=Yo,jr.isTypedArray=Zo,jr.isUndefined=function(e){return void 0===e},jr.isWeakMap=function(e){return qo(e)&&ea(e)==w},jr.isWeakSet=function(e){return qo(e)&&"[object WeakSet]"==hn(e)},jr.join=function(e,t){return null==e?"":rr.call(e,t)},jr.kebabCase=Ls,jr.last=Fa,jr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==r&&(i=(i=ns(r))<0?ir(n+i,0):ar(i,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,i):yt(e,_t,i,!0)},jr.lowerCase=Ms,jr.lowerFirst=Ds,jr.lt=$o,jr.lte=es,jr.max=function(e){return e&&e.length?tn(e,Ws,dn):void 0},jr.maxBy=function(e,t){return e&&e.length?tn(e,Ji(t,2),dn):void 0},jr.mean=function(e){return wt(e,Ws)},jr.meanBy=function(e,t){return wt(e,Ji(t,2))},jr.min=function(e){return e&&e.length?tn(e,Ws,Sn):void 0},jr.minBy=function(e,t){return e&&e.length?tn(e,Ji(t,2),Sn):void 0},jr.stubArray=iu,jr.stubFalse=au,jr.stubObject=function(){return{}},jr.stubString=function(){return""},jr.stubTrue=function(){return!0},jr.multiply=fu,jr.nth=function(e,t){return e&&e.length?Tn(e,ns(t)):void 0},jr.noConflict=function(){return qe._===this&&(qe._=Ne),this},jr.noop=Ys,jr.now=vo,jr.pad=function(e,t,r){e=ss(e);var n=(t=ns(t))?zt(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ai(Zt(i),r)+e+Ai(Yt(i),r)},jr.padEnd=function(e,t,r){e=ss(e);var n=(t=ns(t))?zt(e):0;return t&&nt){var n=e;e=t,t=n}if(r||e%1||t%1){var i=ur();return ar(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Mn(e,t)},jr.reduce=function(e,t,r){var n=Lo(e)?ht:St,i=arguments.length<3;return n(e,Ji(t,4),r,i,Zr)},jr.reduceRight=function(e,t,r){var n=Lo(e)?dt:St,i=arguments.length<3;return n(e,Ji(t,4),r,i,$r)},jr.repeat=function(e,t,r){return t=(r?aa(e,t,r):void 0===t)?1:ns(t),Dn(ss(e),t)},jr.replace=function(){var e=arguments,t=ss(e[0]);return e.length<3?t:t.replace(e[1],e[2])},jr.result=function(e,t,r){var n=-1,i=(t=ai(t,e)).length;for(i||(i=1,e=void 0);++n9007199254740991)return[];var r=4294967295,n=ar(e,4294967295);e-=4294967295;for(var i=jt(n,t=Ji(t));++r=a)return e;var s=r-zt(n);if(s<1)return n;var u=o?si(o,0,s).join(""):e.slice(0,s);if(void 0===i)return u+n;if(o&&(s+=u.length-s),Jo(i)){if(e.slice(s).search(i)){var c,l=u;for(i.global||(i=ge(i.source,ss(re.exec(i))+"g")),i.lastIndex=0;c=i.exec(l);)var f=c.index;u=u.slice(0,void 0===f?s:f)}}else if(e.indexOf(Xn(i),s)!=s){var h=u.lastIndexOf(i);h>-1&&(u=u.slice(0,h))}return u+n},jr.unescape=function(e){return(e=ss(e))&&P.test(e)?e.replace(D,qt):e},jr.uniqueId=function(e){var t=++Se;return ss(e)+t},jr.upperCase=Fs,jr.upperFirst=Bs,jr.each=oo,jr.eachRight=so,jr.first=Ma,Qs(jr,(ou={},sn(jr,function(e,t){ke.call(jr.prototype,t)||(ou[t]=e)}),ou),{chain:!1}),jr.VERSION="4.17.19",it(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){jr[e].placeholder=jr}),it(["drop","take"],function(e,t){Ar.prototype[e]=function(r){r=void 0===r?1:ir(ns(r),0);var n=this.__filtered__&&!t?new Ar(this):this.clone();return n.__filtered__?n.__takeCount__=ar(r,n.__takeCount__):n.__views__.push({size:ar(r,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Ar.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),it(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;Ar.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ji(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),it(["head","last"],function(e,t){var r="take"+(t?"Right":"");Ar.prototype[e]=function(){return this[r](1).value()[0]}}),it(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");Ar.prototype[e]=function(){return this.__filtered__?new Ar(this):this[r](1)}}),Ar.prototype.compact=function(){return this.filter(Ws)},Ar.prototype.find=function(e){return this.filter(e).head()},Ar.prototype.findLast=function(e){return this.reverse().find(e)},Ar.prototype.invokeMap=Cn(function(e,t){return"function"==typeof e?new Ar(this):this.map(function(r){return yn(r,e,t)})}),Ar.prototype.reject=function(e){return this.filter(So(Ji(e)))},Ar.prototype.slice=function(e,t){e=ns(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Ar(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),void 0!==t&&(r=(t=ns(t))<0?r.dropRight(-t):r.take(t-e)),r)},Ar.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ar.prototype.toArray=function(){return this.take(4294967295)},sn(Ar.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=jr[n?"take"+("last"==t?"Right":""):t],a=n||/^find/.test(t);i&&(jr.prototype[t]=function(){var t=this.__wrapped__,o=n?[1]:arguments,s=t instanceof Ar,u=o[0],c=s||Lo(t),l=function(e){var t=i.apply(jr,ft([e],o));return n&&f?t[0]:t};c&&r&&"function"==typeof u&&1!=u.length&&(s=c=!1);var f=this.__chain__,h=!!this.__actions__.length,d=a&&!f,p=s&&!h;if(!a&&c){t=p?t:new Ar(this);var v=e.apply(t,o);return v.__actions__.push({func:to,args:[l],thisArg:void 0}),new Tr(v,f)}return d&&p?e.apply(this,o):(v=this.thru(l),d?n?v.value()[0]:v.value():v)})}),it(["pop","push","shift","sort","splice","unshift"],function(e){var t=me[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);jr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Lo(i)?i:[],e)}return this[r](function(r){return t.apply(Lo(r)?r:[],e)})}}),sn(Ar.prototype,function(e,t){var r=jr[t];if(r){var n=r.name+"";ke.call(yr,n)||(yr[n]=[]),yr[n].push({name:t,func:r})}}),yr[ji(void 0,2).name]=[{name:"wrapper",func:void 0}],Ar.prototype.clone=function(){var e=new Ar(this.__wrapped__);return e.__actions__=vi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=vi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=vi(this.__views__),e},Ar.prototype.reverse=function(){if(this.__filtered__){var e=new Ar(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ar.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Lo(e),n=t<0,i=r?e.length:0,a=function(e,t,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},jr.prototype.plant=function(e){for(var t,r=this;r instanceof Nr;){var n=Ia(r);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;r=r.__wrapped__}return i.__wrapped__=e,t},jr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ar){var t=e;return this.__actions__.length&&(t=new Ar(this)),(t=t.reverse()).__actions__.push({func:to,args:[za],thisArg:void 0}),new Tr(t,this.__chain__)}return this.thru(za)},jr.prototype.toJSON=jr.prototype.valueOf=jr.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},jr.prototype.first=jr.prototype.head,kt&&(jr.prototype[kt]=function(){return this}),jr}();qe._=Kt,void 0===(n=(function(){return Kt}).call(t,r,t,e))||(e.exports=n)}).call(this)}).call(this,r("YuTi")(e))},PDru:function(e,t){var r="undefined"!=typeof ArrayBuffer,n="undefined"!=typeof Symbol;function i(e,t){var i,a,o,s,u;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof t)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||r&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(o=0,s=e.length;o0)throw new Error("Parser error")}}function s(e,t,r){var n="";return 0!==e&&(""!==r?n+=e<0?" - ":" + ":e<0&&(n+="-"),1===(e=Math.abs(e))&&""!==t||(n+=e),n+=t),n}function u(e,t,r,n){if(!(this instanceof u))return new u(e,t,r,n);o(this,e,t,r,n)}u.prototype={w:1,x:0,y:0,z:0,add:function(e,t,r,n){return o(a,e,t,r,n),new u(this.w+a.w,this.x+a.x,this.y+a.y,this.z+a.z)},sub:function(e,t,r,n){return o(a,e,t,r,n),new u(this.w-a.w,this.x-a.x,this.y-a.y,this.z-a.z)},neg:function(){return new u(-this.w,-this.x,-this.y,-this.z)},norm:function(){var e=this.w,t=this.x,r=this.y,n=this.z;return Math.sqrt(e*e+t*t+r*r+n*n)},normSq:function(){var e=this.w,t=this.x,r=this.y,n=this.z;return e*e+t*t+r*r+n*n},normalize:function(){var e=this.w,t=this.x,r=this.y,n=this.z,i=Math.sqrt(e*e+t*t+r*r+n*n);return i=0)return new u(Math.pow(s,a.w),0,0,0);if(0===s)switch(a.w%4){case 0:return new u(Math.pow(c,a.w),0,0,0);case 1:return new u(0,Math.pow(c,a.w),0,0);case 2:return new u(-Math.pow(c,a.w),0,0,0);case 3:return new u(0,-Math.pow(c,a.w),0,0)}}return s=Math.exp(a.w*f-a.x*l),c=a.x*f+a.w*l,new u(s*Math.cos(c),s*Math.sin(c),0,0)}}return this.log().mul(a).exp()},equals:function(e,t,r,n){o(a,e,t,r,n);var i=u.EPSILON;return Math.abs(a.w-this.w).9995)return function(e){return new u(i+e*(f-i),s+e*(h-s),c+e*(d-c),l+e*(p-l)).normalize()};var g=Math.acos(v),y=Math.sin(g);return function(e){var t=g*e,r=Math.sin(t),n=Math.cos(t)-v*r/y,a=r/y;return new u(n*i+a*f,n*s+a*h,n*c+a*d,n*l+a*p)}}},u.ZERO=new u(0,0,0,0),u.ONE=new u(1,0,0,0),u.I=new u(0,1,0,0),u.J=new u(0,0,1,0),u.K=new u(0,0,0,1),u.EPSILON=1e-16,u.fromAxisAngle=function(e,t){var r=.5*t,n=e[0],i=e[1],a=e[2],o=Math.sin(r),s=Math.cos(r),c=o/Math.sqrt(n*n+i*i+a*a);return new u(s,n*c,i*c,a*c)},u.fromBetweenVectors=function(e,t){var r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2],c=r*a+n*o+i*s,l=n*s-i*o,f=i*a-r*s,h=r*o-n*a;return new u(c+Math.sqrt(c*c+l*l+f*f+h*h),l,f,h).normalize()},u.fromEuler=function(e,t,r,n){var i=.5*t,a=.5*r,o=.5*e,s=Math.cos(i),c=Math.cos(a),l=Math.cos(o),f=Math.sin(i),h=Math.sin(a),d=Math.sin(o);return void 0===n||"ZXY"===n?new u(s*c*l-f*h*d,f*c*l-s*h*d,s*h*l+f*c*d,s*c*d+f*h*l):"XYZ"===n?new u(s*c*l-f*h*d,f*c*l+s*h*d,s*h*l-f*c*d,s*c*d+f*h*l):"YXZ"===n?new u(s*c*l+f*h*d,f*c*l+s*h*d,s*h*l-f*c*d,s*c*d-f*h*l):"ZYX"===n?new u(s*c*l+f*h*d,f*c*l-s*h*d,s*h*l+f*c*d,s*c*d-f*h*l):"YZX"===n?new u(s*c*l-f*h*d,f*c*l+s*h*d,s*h*l+f*c*d,s*c*d-f*h*l):"XZY"===n?new u(s*c*l+f*h*d,f*c*l-s*h*d,s*h*l-f*c*d,s*c*d+f*h*l):null},void 0===(n=(function(){return u}).apply(t,[]))||(e.exports=n)}()},YuTi:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},cTvG:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("FZPO"),i=function(){function e(){S(this,e)}return j(e,[{key:"fromRdf",value:function(e,t){var r=parseFloat(e.value);return t&&isNaN(r)&&n.Translator.incorrectRdfDataType(e),r}},{key:"toRdf",value:function(t,r){var n=r.datatype,i=r.dataFactory;return n=n||i.namedNode(e.TYPES[0]),isNaN(t)?i.literal("NaN",n):isFinite(t)?t%1==0?null:i.literal(t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),n):i.literal(t>0?"INF":"-INF",n)}}]),e}();t.TypeHandlerNumberDouble=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},g5aj:function(e,t,r){var n=r("04/w"),i=r("PDru");function a(){this.clear()}a.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},a.prototype.enqueue=function(e){return this.items.push(e),++this.size},a.prototype.dequeue=function(){if(this.size){var e=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,e}},a.prototype.peek=function(){if(this.size)return this.items[this.offset]},a.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var r=this.offset,n=0,i=this.items.length;r=e.length)return{done:!0};var r=e[t];return t++,{value:r,done:!1}})},a.prototype.entries=function(){var e=this.items,t=this.offset,r=0;return new n(function(){if(t>=e.length)return{done:!0};var n=e[t];return t++,{value:[r++,n],done:!1}})},"undefined"!=typeof Symbol&&(a.prototype[Symbol.iterator]=a.prototype.values),a.prototype.toString=function(){return this.toArray().join(",")},a.prototype.toJSON=function(){return this.toArray()},a.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:a,enumerable:!1}),e},"undefined"!=typeof Symbol&&(a.prototype[Symbol.for("nodejs.util.inspect.custom")]=a.prototype.inspect),a.from=function(e){var t=new a;return i(e,function(e){t.enqueue(e)}),t},a.of=function(){return a.from(arguments)},e.exports=a},"l/hW":function(e,t,r){"use strict";e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return[Math.atan2(2*(t*r+n*i),1-2*(r*r+n*n)),Math.asin(2*(t*n-i*r)),Math.atan2(2*(t*i+r*n),1-2*(n*n+i*i))]}},m5Kp:function(e,t,r){var n=r("PPGm");e.exports=n},mMj5:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("FZPO"),i=function(){function e(){S(this,e)}return j(e,[{key:"fromRdf",value:function(e,t){var r=parseInt(e.value,10);return t&&(isNaN(r)||e.value.indexOf(".")>=0)&&n.Translator.incorrectRdfDataType(e),r}},{key:"toRdf",value:function(t,r){var n=r.datatype,i=r.dataFactory;return i.literal(String(t),n||i.namedNode(t<=e.MAX_INT&&t>=e.MIN_INT?e.TYPES[0]:e.TYPES[1]))}}]),e}();t.TypeHandlerNumberInteger=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648},mtbl:function(e,t,r){var n=r("tXxl"),i=r("g5aj"),a=r("x4yT");function o(e,t,r){if(!n(e))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!e.hasNode(t))throw new Error('graphology-shortest-path: the "'+t+'" source node does not exist in the given graph.');if(!e.hasNode(r))throw new Error('graphology-shortest-path: the "'+r+'" target node does not exist in the given graph.');if((t=""+t)==(r=""+r))return[t];var i=e.inboundNeighbors.bind(e),a=e.outboundNeighbors.bind(e),o={},s={};o[t]=null,s[r]=null;var u,c,l,f,h,d,p,v,g=[t],y=[r],b=!1;e:for(;g.length&&y.length;)if(g.length<=y.length){for(u=g,g=[],h=0,p=u.length;h=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function t(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 r(e){for(var r=1;r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(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 a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){s=!0,a=e}),f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function x(e,t){if(e){if("string"==typeof e)return k(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)?k(e,t):void 0}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?{done:!0}:{done:!1,value:e[n++]}})},r.empty=function(){var e=new r(null);return e.done=!0,e},r.is=function(e){return e instanceof r||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=r},"12xR":function(e,t){function r(){this.value=""}r.prototype.equals=function(e){return!!e&&e.termType===this.termType},r.prototype.termType="DefaultGraph",e.exports=r},"4cw7":function(e,t,r){var n=r("12xR");function i(e,t,r,i){this.subject=e,this.predicate=t,this.object=r,this.graph=i||new n}i.prototype.equals=function(e){return!!e&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)},e.exports=i},"6smP":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){S(this,e)}return j(e,[{key:"fromRdf",value:function(e){return e.value}},{key:"toRdf",value:function(e,t){var r=t.datatype;return t.dataFactory.literal(e,r)}}]),e}();t.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},"8Xj3":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("FZPO"),i=function(){function e(){S(this,e)}return j(e,[{key:"fromRdf",value:function(e,t){switch(e.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return t&&n.Translator.incorrectRdfDataType(e),!1}},{key:"toRdf",value:function(t,r){var n=r.datatype,i=r.dataFactory;return i.literal(t?"true":"false",n||i.namedNode(e.TYPE))}}]),e}();t.TypeHandlerBoolean=i,i.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},Eagr:function(e,t){function r(e){this.value=e}r.prototype.equals=function(e){return!!e&&e.termType===this.termType&&e.value===this.value},r.prototype.termType="NamedNode",e.exports=r},FZPO:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=function(){function e(){S(this,e),this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}return j(e,[{key:"registerHandler",value:function(e,t,r){var n,i=w(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;this.supportedRdfDatatypes.push(a),this.fromRdfHandlers[a.value]=e}}catch(l){i.e(l)}finally{i.f()}var o,s=w(r);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=this.toRdfHandlers[u];c||(this.toRdfHandlers[u]=c=[]),c.push(e)}}catch(l){s.e(l)}finally{s.f()}}},{key:"fromRdf",value:function(e,t){var r=this.fromRdfHandlers[e.datatype.value];return r?r.fromRdf(e,t):e.value}},{key:"toRdf",value:function(e,t){var r=this.toRdfHandlers[typeof e];if(r){var n,i=w(r);try{for(i.s();!(n=i.n()).done;){var a=n.value.toRdf(e,t);if(a)return a}}catch(o){i.e(o)}finally{i.f()}}throw new Error("Invalid JavaScript value: '".concat(e,"'"))}},{key:"getSupportedRdfDatatypes",value:function(){return this.supportedRdfDatatypes}},{key:"getSupportedJavaScriptPrimitives",value:function(){return Object.keys(this.toRdfHandlers)}}],[{key:"incorrectRdfDataType",value:function(e){throw new Error("Invalid RDF ".concat(e.datatype.value," value: '").concat(e.value,"'"))}}]),e}()},HXBs:function(e,t,r){e.exports=function(){"use strict";function e(t){return(e="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})(t)}function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function a(e,t,r){return(a=i()?Reflect.construct:function(e,t,r){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return r&&n(a,r.prototype),a}).apply(null,arguments)}function o(e){var t="function"==typeof Map?new Map:void 0;return(o=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return a(e,arguments,r(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),n(i,e)})(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(){for(var e=arguments[0]||{},t=1,r=arguments.length;t0&&o.length>i){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,"function"==typeof console.warn?console.warn(s):console.log(s)}}else o=a[t]=r,++e._eventsCount;return e}function S(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function E(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function j(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function I(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}v.prototype=Object.create(null),g.EventEmitter=g,g.usingDomains=!1,g.prototype.domain=void 0,g.prototype._events=void 0,g.prototype._maxListeners=void 0,g.defaultMaxListeners=10,g.init=function(){this.domain=null,g.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new v,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},g.prototype.getMaxListeners=function(){return y(this)},g.prototype.emit=function(e){var t,r,n,i,a,o,s,u="error"===e;if(o=this._events)u=u&&null==o.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=o[e]))return!1;var l="function"==typeof r;switch(n=arguments.length){case 1:b(r,l,this);break;case 2:m(r,l,this,arguments[1]);break;case 3:_(r,l,this,arguments[1],arguments[2]);break;case 4:w(r,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),a=1;a0;)if(r[a]===t||r[a].listener&&r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new v,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n0?Reflect.ownKeys(this._events):[]},I.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(I.prototype[Symbol.iterator]=function(){return this}),I.of=function(){var e=arguments,t=e.length,r=0;return new I(function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}})},I.empty=function(){var e=new I(null);return e.done=!0,e},I.is=function(e){return e instanceof I||"object"==typeof e&&null!==e&&"function"==typeof e.next};var N=I,T=function(e,t){for(var r,n=arguments.length>1?t:1/0,i=n!==1/0?new Array(n):[],a=0;;){if(a===n)return i;if((r=e.next()).done)return a!==t?i.slice(0,a):i;i[a++]=r.value}},A=function(e){function r(t,r){var n;return(n=e.call(this)||this).name="GraphError",n.message=t||"",n.data=r||{},n}return t(r,e),r}(o(Error)),R=function(e){function r(t,n){var i;return(i=e.call(this,t,n)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),r.prototype.constructor),i}return t(r,e),r}(A),O=function(e){function r(t,n){var i;return(i=e.call(this,t,n)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),r.prototype.constructor),i}return t(r,e),r}(A),L=function(e){function r(t,n){var i;return(i=e.call(this,t,n)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(i),r.prototype.constructor),i}return t(r,e),r}(A);function M(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function D(e,t){this.key=e,this.attributes=t||{},this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function C(e,t){this.key=e,this.attributes=t||{},this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function P(e,t,r,n,i){this.key=e,this.attributes=i,this.source=r,this.target=n,this.generatedKey=t}function F(e,t,r,n,i){this.key=e,this.attributes=i,this.source=r,this.target=n,this.generatedKey=t}function B(e,t,r,n,i,a,o){var s=e.multi,u=t?"undirected":"out",c=t?"undirected":"in",l=a[u][i];void 0===l&&(l=s?new Set:r,a[u][i]=l),s&&l.add(r),n!==i&&void 0===o[c][n]&&(o[c][n]=l)}function U(e,t,r){var n=e.multi,i=r.source,a=r.target,o=i.key,s=a.key,u=i[t?"undirected":"out"],c=t?"undirected":"in";if(s in u)if(n){var l=u[s];1===l.size?(delete u[s],delete a[c][o]):l.delete(r)}else delete u[s];n||delete a[c][o]}D.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},C.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var G=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i){var a;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,s=""+i;if(i=arguments[2],!(a=c(this,o,s,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(s,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==r&&!(a instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return a.attributes[i]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,r,n){e.prototype[t]=function(e){var i;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,o=""+arguments[1];if(!(i=c(this,a,o,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(o,'").'))}else if(!(i=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==r&&!(i instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return i.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i){var a;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,s=""+i;if(i=arguments[2],!(a=c(this,o,s,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(s,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==r&&!(a instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return a.attributes.hasOwnProperty(i)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i,a){var o;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+e,u=""+i;if(i=arguments[2],a=arguments[3],!(o=c(this,s,u,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').concat(u,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==r&&!(o instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return o.attributes[i]=a,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",meta:{name:i,value:a}}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i,a){var o;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+e,u=""+i;if(i=arguments[2],a=arguments[3],!(o=c(this,s,u,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').concat(u,'").'))}else if(!(o=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof a)throw new R("Graph.".concat(t,": updater should be a function."));if("mixed"!==r&&!(o instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return o.attributes[i]=a(o.attributes[i]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",meta:{name:i,value:o.attributes[i]}}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i){var a;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,s=""+i;if(i=arguments[2],!(a=c(this,o,s,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(s,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==r&&!(a instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return delete a.attributes[i],this.emit("edgeAttributesUpdated",{key:a.key,type:"remove",meta:{name:i}}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i){var a;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,s=""+i;if(i=arguments[2],!(a=c(this,o,s,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(s,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!f(i))throw new R("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==r&&!(a instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));var u=a.attributes;return a.attributes=i,this.emit("edgeAttributesUpdated",{key:a.key,type:"replace",meta:{before:u,after:i}}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,r,n){e.prototype[t]=function(e,i){var a;if("mixed"!==this.type&&"mixed"!==r&&r!==this.type)throw new L("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new L("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,s=""+i;if(i=arguments[2],!(a=c(this,o,s,r)))throw new O("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(s,'").'))}else if(!(a=this._edges.get(e=""+e)))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!f(i))throw new R("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==r&&!(a instanceof n))throw new O("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(r," edge in the graph."));return u(a.attributes,i),this.emit("edgeAttributesUpdated",{key:a.key,type:"merge",meta:{data:i}}),this}}}],z=function(){var e,t=arguments,r=-1;return new N(function n(){if(!e){if(++r>=t.length)return{done:!0};e=t[r]}var i=e.next();return i.done?(e=null,n()):i})},V=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function q(e,t){for(var r in t)t[r]instanceof Set?t[r].forEach(function(t){return e.push(t.key)}):e.push(t[r].key)}function K(e,t){for(var r in e){var n=e[r];t(n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes)}}function W(e,t){for(var r in e)e[r].forEach(function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)})}function H(e){var t=Object.keys(e),r=t.length,n=null,i=0;return new N(function a(){var o;if(n){var s=n.next();if(s.done)return n=null,i++,a();o=s.value}else{if(i>=r)return{done:!0};if((o=e[t[i]])instanceof Set)return n=o.values(),a();i++}return{done:!1,value:[o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes]}})}function J(e,t,r){r in t&&(t[r]instanceof Set?t[r].forEach(function(t){return e.push(t.key)}):e.push(t[r].key))}function X(e,t,r){if(t in e)if(e[t]instanceof Set)e[t].forEach(function(e){return r(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)});else{var n=e[t];r(n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes)}}function Q(e,t){var r=e[t];if(r instanceof Set){var n=r.values();return new N(function(){var e=n.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}})}return N.of([r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes])}function Y(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return T(e._edges.keys(),e._edges.size);var r=new Array("undirected"===t?e.undirectedSize:e.directedSize),n="undirected"===t,i=0;return e._edges.forEach(function(e,t){e instanceof F===n&&(r[i++]=t)}),r}function Z(e,t,r){if(0!==e.size)if("mixed"===t||t===e.type)e._edges.forEach(function(e,t){var n=e.source,i=e.target;r(t,e.attributes,n.key,i.key,n.attributes,i.attributes)});else{var n="undirected"===t;e._edges.forEach(function(e,t){if(e instanceof F===n){var i=e.source,a=e.target;r(t,e.attributes,i.key,a.key,i.attributes,a.attributes)}})}}function $(e,t){return 0===e.size?N.empty():"mixed"===t?(r=e._edges.values(),new N(function(){var e=r.next();if(e.done)return e;var t=e.value;return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}})):(r=e._edges.values(),new N(function e(){var n=r.next();if(n.done)return n;var i=n.value;return i instanceof F==("undirected"===t)?{value:[i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes],done:!1}:e()}));var r}function ee(e,t,r){var n=[];return"undirected"!==e&&("out"!==t&&q(n,r.in),"in"!==t&&q(n,r.out)),"directed"!==e&&q(n,r.undirected),n}function te(e,t,r,n,i){var a=e?W:K;"undirected"!==t&&("out"!==r&&a(n.in,i),"in"!==r&&a(n.out,i)),"directed"!==t&&a(n.undirected,i)}function re(e,t,r){var n=N.empty();return"undirected"!==e&&("out"!==t&&void 0!==r.in&&(n=z(n,H(r.in))),"in"!==t&&void 0!==r.out&&(n=z(n,H(r.out)))),"directed"!==e&&void 0!==r.undirected&&(n=z(n,H(r.undirected))),n}function ne(e,t,r,n){var i=[];return"undirected"!==e&&(void 0!==r.in&&"out"!==t&&J(i,r.in,n),void 0!==r.out&&"in"!==t&&J(i,r.out,n)),"directed"!==e&&void 0!==r.undirected&&J(i,r.undirected,n),i}function ie(e,t,r,n,i){"undirected"!==e&&(void 0!==r.in&&"out"!==t&&X(r.in,n,i),void 0!==r.out&&"in"!==t&&X(r.out,n,i)),"directed"!==e&&void 0!==r.undirected&&X(r.undirected,n,i)}function ae(e,t,r,n){var i=N.empty();return"undirected"!==e&&(void 0!==r.in&&"out"!==t&&n in r.in&&(i=z(i,Q(r.in,n))),void 0!==r.out&&"in"!==t&&n in r.out&&(i=z(i,Q(r.out,n)))),"directed"!==e&&void 0!==r.undirected&&n in r.undirected&&(i=z(i,Q(r.undirected,n))),i}var oe=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function se(e,t){if(void 0!==t)for(var r in t)e.add(r)}function ue(e,t,r){if("mixed"!==e){if("undirected"===e)return Object.keys(r.undirected);if("string"==typeof t)return Object.keys(r[t])}var n=new Set;return"undirected"!==e&&("out"!==t&&se(n,r.in),"in"!==t&&se(n,r.out)),"directed"!==e&&se(n,r.undirected),T(n.values(),n.size)}function ce(e,t,r){for(var n in t){var i=t[n];i instanceof Set&&(i=i.values().next().value);var a=i.source,o=a===e?i.target:a;r(o.key,o.attributes)}}function le(e,t,r,n){for(var i in r){var a=r[i];a instanceof Set&&(a=a.values().next().value);var o=a.source,s=o===t?a.target:o;e.has(s.key)||(e.add(s.key),n(s.key,s.attributes))}}function fe(e,t){var r=Object.keys(t),n=r.length,i=0;return new N(function(){if(i>=n)return{done:!0};var a=t[r[i++]];a instanceof Set&&(a=a.values().next().value);var o=a.source,s=o===e?a.target:o;return{done:!1,value:[s.key,s.attributes]}})}function he(e,t,r){var n=Object.keys(r),i=n.length,a=0;return new N(function o(){if(a>=i)return{done:!0};var s=r[n[a++]];s instanceof Set&&(s=s.values().next().value);var u=s.source,c=u===t?s.target:u;return e.has(c.key)?o():(e.add(c.key),{done:!1,value:[c.key,c.attributes]})})}function de(e,t,r,n,i){var a=e._nodes.get(n);if("undirected"!==t){if("out"!==r&&void 0!==a.in)for(var o in a.in)if(o===i)return!0;if("in"!==r&&void 0!==a.out)for(var s in a.out)if(s===i)return!0}if("directed"!==t&&void 0!==a.undirected)for(var u in a.undirected)if(u===i)return!0;return!1}function pe(e,t){var r={key:e};return Object.keys(t.attributes).length&&(r.attributes=u({},t.attributes)),r}function ve(e,t){var r={source:t.source.key,target:t.target.key};return t.generatedKey||(r.key=e),Object.keys(t.attributes).length&&(r.attributes=u({},t.attributes)),t instanceof F&&(r.undirected=!0),r}function ge(e){return f(e)?"key"in e?!("attributes"in e)||f(e.attributes)&&null!==e.attributes?null:"invalid-attributes":"no-key":"not-object"}function ye(e){return f(e)?"source"in e?"target"in e?!("attributes"in e)||f(e.attributes)&&null!==e.attributes?"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"invalid-attributes":"no-target":"no-source":"not-object"}var be=new Set(["directed","undirected","mixed"]),me=new Set(["domain","_events","_eventsCount","_maxListeners"]),_e={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function we(e,t,r,n,i,a,o,s){if(!n&&"undirected"===e.type)throw new L("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(n&&"directed"===e.type)throw new L("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!f(s))throw new R("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(a=""+a,o=""+o,s=s||{},!e.allowSelfLoops&&a===o)throw new L("Graph.".concat(t,': source & target are the same ("').concat(a,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var u=e._nodes.get(a),c=e._nodes.get(o);if(!u)throw new O("Graph.".concat(t,': source node "').concat(a,'" not found.'));if(!c)throw new O("Graph.".concat(t,': target node "').concat(o,'" not found.'));var l={key:null,undirected:n,source:a,target:o,attributes:s};if(r&&(i=e._edgeKeyGenerator(l)),e._edges.has(i=""+i))throw new L("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));if(!e.multi&&(n?void 0!==u.undirected[o]:void 0!==u.out[o]))throw new L("Graph.".concat(t,': an edge linking "').concat(a,'" to "').concat(o,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var h=new(n?F:P)(i,r,u,c,s);return e._edges.set(i,h),a===o?n?u.undirectedSelfLoops++:u.directedSelfLoops++:n?(u.undirectedDegree++,c.undirectedDegree++):(u.outDegree++,c.inDegree++),B(e,n,h,a,o,u,c),n?e._undirectedSize++:e._directedSize++,l.key=i,e.emit("edgeAdded",l),i}function xe(e,t,r,n,i,a,o,s){if(!n&&"undirected"===e.type)throw new L("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(n&&"directed"===e.type)throw new L("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!f(s))throw new R("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(a=""+a,o=""+o,s=s||{},!e.allowSelfLoops&&a===o)throw new L("Graph.".concat(t,': source & target are the same ("').concat(a,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var l,h,d=e._nodes.get(a),p=e._nodes.get(o),v=null;if(!r&&(l=e._edges.get(i))){if(l.source!==a||l.target!==o||n&&(l.source!==o||l.target!==a))throw new L("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(a,'" source & "').concat(o,'" target vs. (').concat(l.source,", ").concat(l.target,")."));v=i}if(v||e.multi||!d||(n?void 0===d.undirected[o]:void 0===d.out[o])||(h=c(e,a,o,n?"undirected":"directed")),h)return s?(u(h.attributes,s),v):v;var g={key:null,undirected:n,source:a,target:o,attributes:s};if(r&&(i=e._edgeKeyGenerator(g)),e._edges.has(i=""+i))throw new L("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));return d||(e.addNode(a),d=e._nodes.get(a),a===o&&(p=d)),p||(e.addNode(o),p=e._nodes.get(o)),l=new(n?F:P)(i,r,d,p,s),e._edges.set(i,l),a===o?n?d.undirectedSelfLoops++:d.directedSelfLoops++:n?(d.undirectedDegree++,p.undirectedDegree++):(d.outDegree++,p.inDegree++),B(e,n,l,a,o,d,p),n?e._undirectedSize++:e._directedSize++,g.key=i,e.emit("edgeAdded",g),i}var ke=function(e){function r(t){var r;if(r=e.call(this)||this,(t=u({},_e,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new R("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new R("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!be.has(t.type))throw new R('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new R("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var n,i="mixed"===t.type?M:"directed"===t.type?D:C;return d(s(r),"NodeDataClass",i),d(s(r),"_attributes",{}),d(s(r),"_nodes",new Map),d(s(r),"_edges",new Map),d(s(r),"_directedSize",0),d(s(r),"_undirectedSize",0),d(s(r),"_edgeKeyGenerator",t.edgeKeyGenerator||(n=0,function(){return"_geid".concat(n++,"_")})),d(s(r),"_options",t),me.forEach(function(e){return d(s(r),e,r[e])}),p(s(r),"order",function(){return r._nodes.size}),p(s(r),"size",function(){return r._edges.size}),p(s(r),"directedSize",function(){return r._directedSize}),p(s(r),"undirectedSize",function(){return r._undirectedSize}),p(s(r),"multi",r._options.multi),p(s(r),"type",r._options.type),p(s(r),"allowSelfLoops",r._options.allowSelfLoops),r}t(r,e);var n=r.prototype;return n.hasNode=function(e){return this._nodes.has(""+e)},n.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var r=this._edges.get(""+e);return!!r&&r instanceof P}if(2===arguments.length){t=""+t;var n=this._nodes.get(e=""+e);if(!n)return!1;var i=n.out[t];return!(!i||this.multi&&!i.size)}throw new R("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},n.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var r=this._edges.get(""+e);return!!r&&r instanceof F}if(2===arguments.length){t=""+t;var n=this._nodes.get(e=""+e);if(!n)return!1;var i=n.undirected[t];return!(!i||this.multi&&!i.size)}throw new R("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},n.hasEdge=function(e,t){if(1===arguments.length)return this._edges.has(""+e);if(2===arguments.length){t=""+t;var r=this._nodes.get(e=""+e);if(!r)return!1;var n=void 0!==r.out&&r.out[t];return n||(n=void 0!==r.undirected&&r.undirected[t]),!(!n||this.multi&&!n.size)}throw new R("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},n.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new L("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var r=this._nodes.get(e);if(!r)throw new O('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new O('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var n=r.out&&r.out[t]||void 0;return n?n.key:void 0}},n.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new L("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var r=this._nodes.get(e);if(!r)throw new O('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new O('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var n=r.undirected&&r.undirected[t]||void 0;return n?n.key:void 0}},n.edge=function(e,t){if(this.multi)throw new L("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t;var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new O('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var n=r.out&&r.out[t]||r.undirected&&r.undirected[t]||void 0;if(n)return n.key},n.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new R('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:r.inDegree+(t?r.directedSelfLoops:0)},n.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new R('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:r.outDegree+(t?r.directedSelfLoops:0)},n.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new R('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(!this.hasNode(e=""+e))throw new O('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:this.inDegree(e,t)+this.outDegree(e,t)},n.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new R('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(!this.hasNode(e=""+e))throw new O('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));if("directed"===this.type)return 0;var r=this._nodes.get(e);return r.undirectedDegree+(t?2*r.undirectedSelfLoops:0)},n.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new R('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(!this.hasNode(e=""+e))throw new O('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var r=0;return"undirected"!==this.type&&(r+=this.directedDegree(e,t)),"directed"!==this.type&&(r+=this.undirectedDegree(e,t)),r},n.source=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},n.target=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},n.extremities=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},n.opposite=function(e,t){if(t=""+t,!this._nodes.has(e=""+e))throw new O('Graph.opposite: could not find the "'.concat(e,'" node in the graph.'));var r=this._edges.get(t);if(!r)throw new O('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var n=r.source.key,i=r.target.key;if(e!==n&&e!==i)throw new O('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(n,", ").concat(i,")."));return e===n?i:n},n.undirected=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.undirected: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof F},n.directed=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.directed: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof P},n.selfLoop=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.selfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},n.addNode=function(e,t){if(t&&!f(t))throw new R('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));if(t=t||{},this._nodes.has(e=""+e))throw new L('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var r=new this.NodeDataClass(e,t);return this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:t}),e},n.mergeNode=function(e,t){if(t&&!f(t))throw new R('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));t=t||{};var r=this._nodes.get(e=""+e);return r?(t&&u(r.attributes,t),e):(r=new this.NodeDataClass(e,t),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:t}),e)},n.dropNode=function(e){if(!this.hasNode(e=""+e))throw new O('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));for(var t=this.edges(e),r=0,n=t.length;r1){var r=""+arguments[0],n=""+arguments[1];if(!(t=c(this,r,n,this.type)))throw new O('Graph.dropEdge: could not find the "'.concat(r,'" -> "').concat(n,'" edge in the graph.'))}else if(!(t=this._edges.get(e=""+e)))throw new O('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var i=t.source,a=t.target,o=t.attributes,s=t instanceof F;return i===a?i.selfLoops--:s?(i.undirectedDegree--,a.undirectedDegree--):(i.outDegree--,a.inDegree--),U(this,s,t),s?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:o,source:i.key,target:a.key,undirected:s}),this},n.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},n.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},n.getAttribute=function(e){return this._attributes[e]},n.getAttributes=function(){return this._attributes},n.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},n.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",meta:{name:e,value:t}}),this},n.updateAttribute=function(e,t){if("function"!=typeof t)throw new R("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",meta:{name:e,value:this._attributes[e]}}),this},n.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",meta:{name:e}}),this},n.replaceAttributes=function(e){if(!f(e))throw new R("Graph.replaceAttributes: provided attributes are not a plain object.");var t=this._attributes;return this._attributes=e,this.emit("attributesUpdated",{type:"replace",meta:{before:t,after:e}}),this},n.mergeAttributes=function(e){if(!f(e))throw new R("Graph.mergeAttributes: provided attributes are not a plain object.");return this._attributes=u(this._attributes,e),this.emit("attributesUpdated",{type:"merge",meta:{data:this._attributes}}),this},n.getNodeAttribute=function(e,t){var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return r.attributes[t]},n.getNodeAttributes=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new O('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},n.hasNodeAttribute=function(e,t){var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return r.attributes.hasOwnProperty(t)},n.setNodeAttribute=function(e,t,r){var n=this._nodes.get(e=""+e);if(!n)throw new O('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new R("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return n.attributes[t]=r,this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:r}}),this},n.updateNodeAttribute=function(e,t,r){var n=this._nodes.get(e=""+e);if(!n)throw new O('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new R("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof r)throw new R("Graph.updateAttribute: updater should be a function.");var i=n.attributes;return i[t]=r(i[t]),this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:i[t]}}),this},n.removeNodeAttribute=function(e,t){var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete r.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",meta:{name:t}}),this},n.replaceNodeAttributes=function(e,t){var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!f(t))throw new R("Graph.replaceNodeAttributes: provided attributes are not a plain object.");var n=r.attributes;return r.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",meta:{before:n,after:t}}),this},n.mergeNodeAttributes=function(e,t){var r=this._nodes.get(e=""+e);if(!r)throw new O('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!f(t))throw new R("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return u(r.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",meta:{data:t}}),this},n.forEach=function(e){if("function"!=typeof e)throw new R("Graph.forEach: expecting a callback.");this._edges.forEach(function(t,r){var n=t.source,i=t.target;e(n.key,i.key,n.attributes,i.attributes,r,t.attributes)})},n.adjacency=function(){var e=this._edges.values();return new N(function(){var t=e.next();if(t.done)return t;var r=t.value,n=r.source,i=r.target;return{done:!1,value:[n.key,i.key,n.attributes,i.attributes,r.key,r.attributes]}})},n.nodes=function(){return T(this._nodes.keys(),this._nodes.size)},n.forEachNode=function(e){if("function"!=typeof e)throw new R("Graph.forEachNode: expecting a callback.");this._nodes.forEach(function(t,r){e(r,t.attributes)})},n.nodeEntries=function(){var e=this._nodes.values();return new N(function(){var t=e.next();if(t.done)return t;var r=t.value;return{value:[r.key,r.attributes],done:!1}})},n.exportNode=function(e){var t=this._nodes.get(e=""+e);if(!t)throw new O('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return pe(e,t)},n.exportEdge=function(e){var t=this._edges.get(e=""+e);if(!t)throw new O('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return ve(e,t)},n.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach(function(r,n){e[t++]=pe(n,r)});var r=new Array(this._edges.size);return t=0,this._edges.forEach(function(e,n){r[t++]=ve(n,e)}),{attributes:this.getAttributes(),nodes:e,edges:r}},n.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=ge(e);if(r){if("not-object"===r)throw new R('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===r)throw new R("Graph.importNode: no key provided.");if("invalid-attributes"===r)throw new R("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var n=e.key,i=e.attributes,a=void 0===i?{}:i;return t?this.mergeNode(n,a):this.addNode(n,a),this},n.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=ye(e);if(r){if("not-object"===r)throw new R('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===r)throw new R("Graph.importEdge: missing souce.");if("no-target"===r)throw new R("Graph.importEdge: missing target.");if("invalid-attributes"===r)throw new R("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===r)throw new R("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var n=e.source,i=e.target,a=e.attributes,o=void 0===a?{}:a,s=e.undirected,u=void 0!==s&&s;return"key"in e?(t?u?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:u?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,n,i,o):(t?u?this.mergeUndirectedEdge:this.mergeDirectedEdge:u?this.addUndirectedEdge:this.addDirectedEdge).call(this,n,i,o),this},n.import=function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l(e))return this.import(e.export(),r),this;if(!f(e))throw new R("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!f(e.attributes))throw new R("Graph.import: invalid attributes. Expecting a plain object.");r?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}return e.nodes&&e.nodes.forEach(function(e){return t.importNode(e,r)}),e.edges&&e.edges.forEach(function(e){return t.importEdge(e,r)}),this},n.nullCopy=function(e){return new r(u({},this._options,e))},n.emptyCopy=function(e){var t=new r(u({},this._options,e));return this._nodes.forEach(function(e,r){e=new t.NodeDataClass(r,u({},e.attributes)),t._nodes.set(r,e)}),t},n.copy=function(){var e=new r(this._options);return e.import(this),e},n.upgradeToMixed=function(){return"mixed"===this.type||(this._nodes.forEach(function(e){return e.upgradeToMixed()}),this._options.type="mixed",p(this,"type",this._options.type),d(this,"NodeDataClass",M)),this},n.upgradeToMulti=function(){return this.multi||(this._options.multi=!0,p(this,"multi",!0),(e=this)._nodes.forEach(function(t,r){if(t.out)for(var n in t.out){var i=new Set;i.add(t.out[n]),t.out[n]=i,e._nodes.get(n).in[r]=i}if(t.undirected)for(var a in t.undirected)if(!(a>r)){var o=new Set;o.add(t.undirected[a]),t.undirected[a]=o,e._nodes.get(a).undirected[r]=o}})),this;var e},n.clearIndex=function(){return this._nodes.forEach(function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})}),this},n.toJSON=function(){return this.export()},n.toString=function(){var e=this.order>1||0===this.order,t=this.size>1||0===this.size;return"Graph<".concat(h(this.order)," node").concat(e?"s":"",", ").concat(h(this.size)," edge").concat(t?"s":"",">")},n.inspect=function(){var e=this,t={};this._nodes.forEach(function(e,r){t[r]=e.attributes});var r={},n={};this._edges.forEach(function(t,i){var a=t instanceof F?"--":"->",o="",s="(".concat(t.source.key,")").concat(a,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===n[s]?n[s]=0:n[s]++,o+="".concat(n[s],". ")):o+="[".concat(i,"]: "),r[o+=s]=t.attributes});var i={};for(var a in this)this.hasOwnProperty(a)&&!me.has(a)&&"function"!=typeof this[a]&&(i[a]=this[a]);return i.attributes=this._attributes,i.nodes=t,i.edges=r,d(i,"constructor",this.constructor),i},r}(g);"undefined"!=typeof Symbol&&(ke.prototype[Symbol.for("nodejs.util.inspect.custom")]=ke.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(e){["add","merge"].forEach(function(t){var r=e.name(t),n="add"===t?we:xe;ke.prototype[r]=e.generateKey?function(t,i,a){return n(this,r,!0,"undirected"===(e.type||this.type),null,t,i,a)}:function(t,i,a,o){return n(this,r,!1,"undirected"===(e.type||this.type),t,i,a,o)}})}),"undefined"!=typeof Symbol&&(ke.prototype[Symbol.iterator]=ke.prototype.adjacency),function(e){G.forEach(function(t){var r=t.name,n=t.attacher;n(e,r("Edge"),"mixed",P),n(e,r("DirectedEdge"),"directed",P),n(e,r("UndirectedEdge"),"undirected",F)})}(ke),function(e){V.forEach(function(t){!function(e,t){var r=t.name,n=t.type,i=t.direction;e.prototype[r]=function(e,t){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return[];if(!arguments.length)return Y(this,n);if(1===arguments.length){var a=this._nodes.get(e=""+e);if(void 0===a)throw new O("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return ee("mixed"===n?this.type:n,i,a)}if(2===arguments.length){t=""+t;var o=this._nodes.get(e=""+e);if(!o)throw new O("Graph.".concat(r,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new O("Graph.".concat(r,': could not find the "').concat(t,'" target node in the graph.'));return ne(n,i,o,t)}throw new R("Graph.".concat(r,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var r=t.name,n=t.type,i=t.direction,a="forEach"+r[0].toUpperCase()+r.slice(1,-1);e.prototype[a]=function(e,t,r){if("mixed"===n||"mixed"===this.type||n===this.type){if(1===arguments.length)return Z(this,n,r=e);if(2===arguments.length){r=t;var o=this._nodes.get(e=""+e);if(void 0===o)throw new O("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return te(this.multi,"mixed"===n?this.type:n,i,o,r)}if(3===arguments.length){t=""+t;var s=this._nodes.get(e=""+e);if(!s)throw new O("Graph.".concat(a,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new O("Graph.".concat(a,': could not find the "').concat(t,'" target node in the graph.'));return ie(n,i,s,t,r)}throw new R("Graph.".concat(a,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var r=t.type,n=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return N.empty();if(!arguments.length)return $(this,r);if(1===arguments.length){var a=this._nodes.get(e=""+e);if(!a)throw new O("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return re(r,n,a)}if(2===arguments.length){t=""+t;var o=this._nodes.get(e=""+e);if(!o)throw new O("Graph.".concat(i,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new O("Graph.".concat(i,': could not find the "').concat(t,'" target node in the graph.'));return ae(r,n,o,t)}throw new R("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)})}(ke),function(e){oe.forEach(function(t){!function(e,t){var r=t.name,n=t.type,i=t.direction;e.prototype[r]=function(e){if("mixed"!==n&&"mixed"!==this.type&&n!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],a=""+arguments[1];if(!this._nodes.has(t))throw new O("Graph.".concat(r,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(a))throw new O("Graph.".concat(r,': could not find the "').concat(a,'" node in the graph.'));return de(this,n,i,t,a)}if(1===arguments.length){var o=this._nodes.get(e=""+e);if(void 0===o)throw new O("Graph.".concat(r,': could not find the "').concat(e,'" node in the graph.'));return ue("mixed"===n?this.type:n,i,o)}throw new R("Graph.".concat(r,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var r=t.name,n=t.type,i=t.direction,a="forEach"+r[0].toUpperCase()+r.slice(1,-1);e.prototype[a]=function(e,t){if("mixed"===n||"mixed"===this.type||n===this.type){var r=this._nodes.get(e=""+e);if(void 0===r)throw new O("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,r,n){if("mixed"!==e){if("undirected"===e)return ce(r,r.undirected,n);if("string"==typeof t)return ce(r,r[t],n)}var i=new Set;"undirected"!==e&&("out"!==t&&le(i,r,r.in,n),"in"!==t&&le(i,r,r.out,n)),"directed"!==e&&le(i,r,r.undirected,n)}("mixed"===n?this.type:n,i,r,t)}}}(e,t),function(e,t){var r=t.type,n=t.direction,i=t.name.slice(0,-1)+"Entries";e.prototype[i]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return N.empty();var t=this._nodes.get(e=""+e);if(void 0===t)throw new O("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,r){if("mixed"!==e){if("undirected"===e)return fe(r,r.undirected);if("string"==typeof t)return fe(r,r[t])}var n=N.empty(),i=new Set;return"undirected"!==e&&("out"!==t&&(n=z(n,he(i,r,r.in))),"in"!==t&&(n=z(n,he(i,r,r.out)))),"directed"!==e&&(n=z(n,he(i,r,r.undirected))),n}("mixed"===r?this.type:r,n,t)}}(e,t)})}(ke);var Se=function(e){function r(t){return e.call(this,u({type:"directed"},t))||this}return t(r,e),r}(ke),Ee=function(e){function r(t){return e.call(this,u({type:"undirected"},t))||this}return t(r,e),r}(ke),je=function(e){function r(t){return e.call(this,u({multi:!0},t))||this}return t(r,e),r}(ke),Ie=function(e){function r(t){return e.call(this,u({multi:!0,type:"directed"},t))||this}return t(r,e),r}(ke),Ne=function(e){function r(t){return e.call(this,u({multi:!0,type:"undirected"},t))||this}return t(r,e),r}(ke);function Te(e){e.from=function(t,r){var n=new e(r);return n.import(t),n}}return Te(ke),Te(Se),Te(Ee),Te(je),Te(Ie),Te(Ne),ke.Graph=ke,ke.DirectedGraph=Se,ke.UndirectedGraph=Ee,ke.MultiGraph=je,ke.MultiDirectedGraph=Ie,ke.MultiUndirectedGraph=Ne,ke.InvalidArgumentsGraphError=R,ke.NotFoundGraphError=O,ke.UsageGraphError=L,ke}()},Hj1c:function(e,t,r){"use strict";var n,i,a;function o(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{u(n.next(e))}catch(t){a(t)}}function s(e){try{u(n.throw(e))}catch(t){a(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,s)}u((n=n.apply(e,t||[])).next())})}r.r(t);var s=r("JFj6");function u(e){return(u="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})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function f(e,t,r){return(f=l()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&c(i,r.prototype),i}).apply(null,arguments)}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},r=t.precision,n=void 0===r?m.precision||4:r;return e=_(e),"".concat(parseFloat(e.toPrecision(n)))}function k(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function E(e){return function(e,t){return function(e,t,r){if(k(e)){r=r||((i=e).clone?i.clone():new Array(i.length));for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"";if(m.debug&&!M(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}m.EPSILON=1e-12,m.debug=!1,m.precision=4,m.printTypes=!1,m.printDegrees=!1,m.printRowMajor=!0;var C={};function P(e,t){C[e]||(C[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}function F(e){var t="function"==typeof Map?new Map:void 0;return(F=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return f(e,arguments,A(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)})(e)}var B,U=function(e){function t(){return N(this,t),T(this,A(t).apply(this,arguments))}return L(t,e),O(t,[{key:"toString",value:function(){var e="[";if(m.printRowMajor){e+="row-major:";for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),r=e*this.RANK,n=0;n1&&void 0!==arguments[1]?arguments[1]:0,r=0;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r0?", ":"")+x(this[r],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t2*Math.PI)throw Error("radians");var h=s*Math.tan(n/2),d=h*a;return(new t).ortho({left:-d,right:d,bottom:-h,top:h,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,r=void 0===t?void 0:t,n=e.fov,i=void 0===n?45*Math.PI/180:n,a=e.aspect,o=void 0===a?1:a,s=e.near,u=void 0===s?.1:s,c=e.far,l=void 0===c?500:c;if((r=r||i)>2*Math.PI)throw Error("radians");return q(this,r,o,u,l),this.check()}},{key:"determinant",value:function(){return((t=(e=this)[0])*(o=e[5])-(r=e[1])*(a=e[4]))*((f=e[10])*(g=e[15])-(h=e[11])*(v=e[14]))-(t*(s=e[6])-(n=e[2])*a)*((l=e[9])*g-h*(p=e[13]))+(t*(u=e[7])-(i=e[3])*a)*(l*v-f*p)+(r*s-n*o)*((c=e[8])*g-h*(d=e[12]))-(r*u-i*o)*(c*v-f*d)+(n*u-i*s)*(c*p-l*d);var e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v,g}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getScale(t||[-0,-0,-0]),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*i,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*i,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.getScale(t||[-0,-0,-0]),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=this[4]*n,e[4]=this[5]*i,e[5]=this[6]*a,e[6]=this[8]*n,e[7]=this[9]*i,e[8]=this[10]*a,e}},{key:"transpose",value:function(){return function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],p=t[12],v=t[13],g=t[14],y=t[15],b=r*s-n*o,m=r*u-i*o,_=r*c-a*o,w=n*u-i*s,x=n*c-a*s,k=i*c-a*u,S=l*v-f*p,E=l*g-h*p,j=l*y-d*p,I=f*g-h*v,N=f*y-d*v,T=h*y-d*g,A=b*T-m*N+_*I+w*j-x*E+k*S;A&&(e[0]=(s*T-u*N+c*I)*(A=1/A),e[1]=(i*N-n*T-a*I)*A,e[2]=(v*k-g*x+y*w)*A,e[3]=(h*x-f*k-d*w)*A,e[4]=(u*j-o*T-c*E)*A,e[5]=(r*T-i*j+a*E)*A,e[6]=(g*_-p*k-y*m)*A,e[7]=(l*k-h*_+d*m)*A,e[8]=(o*N-s*j+c*S)*A,e[9]=(n*j-r*N-a*S)*A,e[10]=(p*x-v*_+y*b)*A,e[11]=(f*_-l*x-d*b)*A,e[12]=(s*E-o*I-u*S)*A,e[13]=(r*I-n*E+i*S)*A,e[14]=(v*m-p*w-g*b)*A,e[15]=(l*w-f*m+h*b)*A)}(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return z(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return z(this,this,e),this.check()}},{key:"rotateX",value:function(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+h*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=h*i-u*n}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],h=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-h*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+h*i}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],h=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+h*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=h*i-u*n}(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t,r=(3,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),3!==r.length);n=!0);}catch(u){i=!0,a=u}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}(t)||function(e,t){if(e){if("string"==typeof e)return d(e,3);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)?d(e,3):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),n=r[1],i=r[2];return this.rotateX(r[0]).rotateY(n).rotateZ(i)}},{key:"rotateAxis",value:function(e,t){return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p,v,g,y,b,m,_,w,x,k,S,E,j,I,N=n[0],T=n[1],A=n[2],R=Math.hypot(N,T,A);R<1e-6||(N*=R=1/R,T*=R,A*=R,i=Math.sin(r),a=Math.cos(r),u=t[1],c=t[2],l=t[3],h=t[5],d=t[6],p=t[7],g=t[9],y=t[10],b=t[11],x=N*T*(o=1-a)-A*i,k=T*T*o+a,S=A*T*o+N*i,E=N*A*o+T*i,j=T*A*o-N*i,I=A*A*o+a,e[0]=(s=t[0])*(m=N*N*o+a)+(f=t[4])*(_=T*N*o+A*i)+(v=t[8])*(w=A*N*o-T*i),e[1]=u*m+h*_+g*w,e[2]=c*m+d*_+y*w,e[3]=l*m+p*_+b*w,e[4]=s*x+f*k+v*S,e[5]=u*x+h*k+g*S,e[6]=c*x+d*k+y*S,e[7]=l*x+p*k+b*S,e[8]=s*E+f*j+v*I,e[9]=u*E+h*j+g*I,e[10]=c*E+d*j+y*I,e[11]=l*E+p*j+b*I,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?V(this,this,e):V(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return function(e,t,r){var n,i,a,o,s,u,c,l,f,h,d,p,v=r[0],g=r[1],y=r[2];t===e?(e[12]=t[0]*v+t[4]*g+t[8]*y+t[12],e[13]=t[1]*v+t[5]*g+t[9]*y+t[13],e[14]=t[2]*v+t[6]*g+t[10]*y+t[14],e[15]=t[3]*v+t[7]*g+t[11]*y+t[15]):(i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],e[0]=n=t[0],e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=p,e[12]=n*v+s*g+f*y+t[12],e[13]=i*v+u*g+h*y+t[13],e[14]=a*v+c*g+d*y+t[14],e[15]=o*v+l*g+p*y+t[15])}(this,this,e),this.check()}},{key:"transform",value:function(e,t){return 4===e.length?(D(t=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}},{key:"transformAsPoint",value:function(e,t){switch(e.length){case 2:t=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}(t||[-0,-0],e,this);break;case 3:t=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/(o=o||1),e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return D(t,e.length),t}},{key:"transformAsVector",value:function(e,t){switch(e.length){case 2:t=function(e,t,r){var n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}(t||[-0,-0],e,this);break;case 3:t=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return D(t,e.length),t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,r){return this.identity().translate([e,t,r])}},{key:"transformPoint",value:function(e,t){return P("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}},{key:"transformVector",value:function(e,t){return P("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}},{key:"transformDirection",value:function(e,t){return P("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}],[{key:"_computeInfinitePerspectiveOffCenter",value:function(e,t,r,n,i,a){var o=2*a/(i-n),s=(r+t)/(r-t),u=(i+n)/(i-n),c=-2*a;return e[0]=2*a/(r-t),e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=s,e[9]=u,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=c,e[15]=0,e}}]),t}(U),Y=r("HXBs"),Z=r("mtbl"),$=r.n(Z),ee=r("YXac"),te=r("l/hW"),re=r.n(te),ne=r("LvDl"),ie=r("L1/z"),ae=s.Util.prefixes({ccf:"http://purl.org/ccf/latest/ccf.owl#",entity:"http://purl.org/ccf/latest/ccf-entity.owl#",obo:"http://purl.obolibrary.org/obo/",uberon:"http://purl.obolibrary.org/obo/UBERON_",lmha:"http://purl.obolibrary.org/obo/LMHA_",rdf:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/"},s.DataFactory),oe={x:ae("rdf"),type:s.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")},se=ae("entity")("id"),ue={x:ae("entity"),id:se,sex:ae("entity")("sex"),age:ae("entity")("age"),bmi:ae("entity")("bmi"),Male:s.DataFactory.literal("Male"),Female:s.DataFactory.literal("Female"),donor:ae("entity")("donor"),entityType:ae("entity")("entityType"),groupName:ae("entity")("groupName"),groupUUID:ae("entity")("groupUUID"),ontologyTerms:ae("entity")("ontologyTerms"),spatialEntity:ae("entity")("spatialEntity"),images:ae("entity")("hasImage"),imageProviders:ae("entity")("hasImageProvider")},ce=ae("ccf"),le={x:ce,spatial:{Body:ce("VHBody"),Female:ce("VHFemale"),Male:ce("VHMale"),BothSexes:ce("VHBothSexes"),FemaleOrgans:ce("VHFemaleOrgans"),MaleOrgans:ce("VHMaleOrgans")},SpatialObjectReference:ce("SpatialObjectReference"),SpatialEntity:ce("SpatialEntity"),SpatialPlacement:ce("SpatialPlacement"),spatialObjectReference:{file:ce("has_object_file"),file_format:ce("has_object_file_format"),file_subpath:ce("has_object_file_subpath")},extractionSet:{label:ae("rdf")("label"),rui_rank:ce("ccf_rui_rank")},spatialEntity:{label:ae("rdf")("label"),comment:ae("rdf")("comment"),creator:ae("dc")("creator"),creator_first_name:ce("creator_first_name"),creator_last_name:ce("creator_last_name"),creator_orcid:ce("creator_orcid"),creation_date:ce("creation_date"),updated_date:ce("updated_date"),ccf_annotations:ce("ccf_annotation"),representation_of:ce("ccf_representation_of"),reference_organ:ce("anatomical_structure_of"),extraction_set_for:ce("extraction_set_for"),extraction_set:ce("extraction_site_for"),sex:ce("has_sex"),side:ce("has_side"),rui_rank:ce("ccf_rui_rank"),slice_thickness:ce("ccf_slice_thickness"),slice_count:ce("ccf_slice_count"),x_dimension:ce("has_x_dimension"),y_dimension:ce("has_y_dimension"),z_dimension:ce("has_z_dimension"),dimension_units:ce("has_dimension_units"),object:ce("has_object_reference")},spatialPlacement:{source:ce("has_placement_source"),target:ce("has_placement_target"),placement_date:ce("has_placement_date"),x_scaling:ce("has_x_scaling"),y_scaling:ce("has_y_scaling"),z_scaling:ce("has_z_scaling"),scaling_units:ce("has_scaling_units"),x_rotation:ce("has_x_rotation"),y_rotation:ce("has_y_rotation"),z_rotation:ce("has_z_rotation"),w_rotation:ce("has_theta_rotation"),rotation_order:ce("has_rotation_order"),rotation_units:ce("has_rotation_units"),x_translation:ce("has_x_translation"),y_translation:ce("has_y_translation"),z_translation:ce("has_z_translation"),translation_units:ce("has_translation_units")}},fe={x:ae("uberon")},he={x:ae("lmha")},de={body:fe.x("0013702"),heart:fe.x("0000948"),lung:he.x("00211"),left_lung:fe.x("0002168"),right_lung:fe.x("0002167"),kidney:fe.x("0002113"),left_kidney:fe.x("0004538"),right_kidney:fe.x("0004539"),spleen:fe.x("0002106"),large_intestine:fe.x("0001155"),small_intestine:fe.x("0002108"),rectum:fe.x("0001052"),liver:fe.x("0002107"),bladder:fe.x("0001255"),ureter:fe.x("0000056"),left_ureter:fe.x("0001223"),right_ureter:fe.x("0001222"),thymus:fe.x("0002370"),lymph_node:fe.x("0000029")};function pe(e){var t={};return Object.entries(e).forEach(function(e){var r=b(e,2),n=r[0],i=r[1];t[i.id]=n}),t}var ve={spatialObjectReference:pe(le.spatialObjectReference),spatialEntity:pe(le.spatialEntity),spatialPlacement:pe(le.spatialPlacement)};function ge(e,t,r,n){var i={"@id":t,"@type":r};return e.some(function(e){var t=n[e.predicate.id];if(t){var r="Literal"===e.object.termType?Object(ie.fromRdf)(e.object):e.object.id;Object(ne.set)(i,t,r)}return!1},s.DataFactory.namedNode(t),null,null,null),i}function ye(e,t){return ge(e,t,"SpatialObjectReference",ve.spatialObjectReference)}function be(e,t){var r=ge(e,t,"ExtractionSet",ve.spatialEntity);return r.extractionSites=Object(ne.sortBy)(e.getSubjects(le.spatialEntity.extraction_set,t,null).map(function(t){return me(e,t.id)}),["rui_rank"]),r}function me(e,t){var r=ge(e,t,"SpatialEntity",ve.spatialEntity);return r.object&&(r.object=ye(e,r.object)),e.forSubjects(function(e){return r.entityId=e.id},ue.spatialEntity,t,null),r}function _e(e,t){var r,n=t;switch(n.translation_units){case"centimeter":r=.01;break;case"millimeter":r=.001;break;case"meter":default:r=1}var i=[n.x_translation,n.y_translation,n.z_translation].map(function(e){return e*r}),a=[n.x_rotation,n.y_rotation,n.z_rotation].map(E),o=re()(Object(ee.fromEuler)(a[1],a[0],a[2],"XYZ").toVector()),s=[n.x_scaling,n.y_scaling,n.z_scaling];return e.translate(i).rotateXYZ(o).scale(s)}var we=function(){function e(t){S(this,e),this.db=t,this.createGraph()}return j(e,[{key:"createGraph",value:function(){var e=this;this.graph=new Y.DirectedGraph;var t=this.db.store;t.forSubjects(function(r){e.addSpatialObjectReference(ye(t,r.id))},oe.type,le.SpatialObjectReference,null),t.forSubjects(function(r){e.addSpatialEntity(me(t,r.id))},oe.type,le.SpatialEntity,null),t.forSubjects(function(r){e.addSpatialPlacement(function(e,t){var r=ge(e,t,"SpatialPlacement",ve.spatialPlacement);return r.source&&(r.source=me(e,r.source)),r.target&&(r.target=me(e,r.target)),r}(t,r.id))},oe.type,le.SpatialPlacement,null)}},{key:"addSpatialEntity",value:function(e){this.graph.mergeNode(e["@id"],{type:"SpatialEntity",object:e})}},{key:"addSpatialObjectReference",value:function(e){this.graph.mergeNode(e["@id"],{type:"SpatialObjectReference",object:e})}},{key:"addSpatialPlacement",value:function(e){this.graph.mergeDirectedEdge(e.source["@id"],e.target["@id"],{type:"SpatialPlacement",placement:e})}},{key:"getTransformationMatrix",value:function(e,t){if(e===t)return new Q;if(this.graph.hasNode(e)&&this.graph.hasNode(t)){var r=new Q,n=$()(this.graph,e,t);if(n&&n.length>0){n.reverse();var i,a="",o=w(n);try{for(o.s();!(i=o.n()).done;){var s=i.value;a&&_e(r,this.graph.getEdgeAttribute(s,a,"placement")),a=s}}catch(u){o.e(u)}finally{o.f()}return r}}}}]),e}(),xe=function(){function e(t){S(this,e),this.db=t}return j(e,[{key:"getSpatialEntity",value:function(e){return me(this.db.store,e)}},{key:"getExtractionSets",value:function(e){return function(e,t){return Object(ne.sortBy)(e.getSubjects(le.spatialEntity.extraction_set_for,t,null).map(function(t){return be(e,t.id)}),["rui_rank"])}(this.db.store,e)}},{key:"getExtractionSet",value:function(e){return be(this.db.store,e)}},{key:"getAnatomicalStructures",value:function(e){return function(e,t){return Object(ne.sortBy)(e.getSubjects(le.spatialEntity.reference_organ,t,null).map(function(t){return me(e,t.id)}).filter(function(e){return e["@id"]!==t}),["rui_rank"])}(this.db.store,e)}},{key:"getReferenceOrgans",value:function(){return e=this.db.store,t=[],e.forEach(function(r){r.subject.id===r.object.id&&t.push(me(e,r.subject.id))},null,le.spatialEntity.reference_organ,null,null),Object(ne.sortBy)(t,["rui_rank"]);var e,t}},{key:"getReferenceBody",value:function(e){var t;switch(null==e?void 0:e.sex){case"Male":t=le.spatial.Male.id;break;case"Female":t=le.spatial.Female.id;break;case"Both":default:t=le.spatial.BothSexes.id}return this.getSpatialEntity(t)}},{key:"getReferenceOrganSets",value:function(e){var t;switch(null==e?void 0:e.sex){case"Male":t=le.spatial.MaleOrgans.id;break;case"Female":t=le.spatial.FemaleOrgans.id;break;case"Both":default:t=le.spatial.FemaleOrgans.id}return[this.getSpatialEntity(t)]}},{key:"getReferenceSceneNodes",value:function(e){var t=this,r=this.getSpatialEntity(le.spatial.Body.id),n=this.getReferenceBody(e),i=(null==e?void 0:e.ontologyTerms)||[],a={body:0===i.indexOf(de.body.id),kidney:0===i.indexOf(de.kidney.id),right_kidney:0===i.indexOf(de.right_kidney.id),left_kidney:0===i.indexOf(de.left_kidney.id),spleen:0===i.indexOf(de.spleen.id)},o=[this.getSceneNode(n,r,{unpickable:!0,color:[255,255,255,255]})].concat(g(this.getReferenceOrganSets(e).map(function(e){return t.getSceneNode(e,n,{unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!0,color:[255,255,255,255]})})),[this.getSceneNode(this.getSpatialEntity(le.x("VHRightKidney").id),n,{color:[255,255,255,1],unpickable:a.kidney||a.right_kidney,zoomToOnLoad:a.right_kidney}),this.getSceneNode(this.getSpatialEntity(le.x("VHLeftKidney").id),n,{color:[255,255,255,1],unpickable:a.kidney||a.left_kidney,zoomToOnLoad:a.left_kidney}),this.getSceneNode(this.getSpatialEntity(le.x("VHSpleen").id),n,{color:[255,255,255,1],unpickable:a.spleen,zoomToOnLoad:a.spleen})]);return(null==e?void 0:e.debug)&&(o=o.concat([this.getSceneNode(this.getSpatialEntity(le.x("VHRightKidney").id),r,{color:[0,0,255,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(le.x("VHLeftKidney").id),r,{color:[255,0,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(le.x("VHSpleenCC1").id),r,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(le.x("VHSpleenCC2").id),r,{color:[0,255,0,127.5],wireframe:!0}),this.getSceneNode(this.getSpatialEntity(le.x("VHSpleenCC3").id),r,{color:[0,255,0,127.5],wireframe:!0})])),o.filter(function(e){return void 0!==e})}},{key:"getEntitySceneNodes",value:function(e){var t=this,r=this.getReferenceBody(e),n=new Set(null==e?void 0:e.highlightedEntities);return this.db.getSpatialEntities(e).map(function(e){return t.getSceneNode(e,r,{color:n.has(e.entityId)?[10,10,229,229.5]:[255,255,255,229.5]})}).filter(function(e){return void 0!==e})}},{key:"getSceneNode",value:function(e,t){var r,n,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.object&&(null===(r=e.object.file_format)||void 0===r?void 0:r.startsWith("model/gltf")),s=this.db.graph.getTransformationMatrix(o&&e.object?e.object["@id"]:e["@id"],t["@id"]);if(s){if(o)s=(new Q).rotateX(E(90)).multiplyLeft(s);else{var u;switch(e.dimension_units){case"centimeter":u=.01;break;case"millimeter":u=.001;break;case"meter":default:u=1}var c=[e.x_dimension,e.y_dimension,e.z_dimension].map(function(e){return e*u/2});s.scale(c)}return Object.assign({"@id":e["@id"],"@type":"SpatialSceneNode",entityId:e.entityId||void 0,representation_of:e.representation_of||void 0,scenegraph:o?null===(n=e.object)||void 0===n?void 0:n.file:void 0,scenegraphNode:o?null===(i=e.object)||void 0===i?void 0:i.file_subpath:void 0,transformMatrix:s,tooltip:e.label},a)}}},{key:"getScene",value:function(e){return[].concat(g(this.getReferenceSceneNodes(e)),g(this.getEntitySceneNodes(e)))}}]),e}();function ke(e){return"string"==typeof e?parseFloat(e.replace(/[^\d\-\.]/g,"")):e}function Se(e){var t=e.x,r=e.y,n=e.z;return{x:ke(t),y:ke(r),z:ke(n)}}var Ee,je="https://entity-api.hubmapconsortium.org/entities/",Ie=new Set(["VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0009-LK-102-7-AF_preIMS_registered_thumbnail.jpg","VAN0009-LK-102-7-IMS_NegMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-IMS_PosMode_multilayer_thumbnail.jpg","VAN0009-LK-102-7-PAS_registered_thumbnail.jpg","VAN0010-LK-155-40-AF_preIMS_registered_thumbnail.jpg","VAN0010-LK-155-40-IMS_NegMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-IMS_PosMode_multilayer_thumbnail.jpg","VAN0010-LK-155-40-PAS_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg","VAN0013-LK-202-96-AF_preIMS_registered_thumbnail.jpg","VAN0013-LK-202-96-IMS_NegMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-IMS_PosMode_multilayer_thumbnail.jpg","VAN0013-LK-202-96-PAS_registered_thumbnail.jpg","VAN0013-LK-202-97-AF_preMxIF_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc1_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc2_registered_thumbnail.jpg","VAN0013-LK-202-97-MxIF_cyc3_registered_thumbnail.jpg","VAN0014-LK-203-108-AF_preIMS_registered_thumbnail.jpg","VAN0014-LK-203-108-IMS_NegMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-IMS_PosMode_multilayer_thumbnail.jpg","VAN0014-LK-203-108-PAS_registered_thumbnail.jpg","VAN0016-LK-202-89-AF_preIMS_registered_thumbnail.jpg","VAN0016-LK-202-89-IMS_NegMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-IMS_PosMode_multilayer_thumbnail.jpg","VAN0016-LK-202-89-PAS_registered_thumbnail.jpg","","DR1-VU:","VAN0003-LK-32-21-AF_preIMS_registered_thumbnail.jpg","VAN0003-LK-32-21-IMS_NegMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-IMS_PosMode_multilayer_thumbnail.jpg","VAN0003-LK-32-21-PAS_registered_thumbnail.jpg","VAN0003-LK-32-22-AF_preMxIF_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc1_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc2_registered_thumbnail.jpg","VAN0003-LK-32-22-MxIF_cyc3_registered_thumbnail.jpg","VAN0005-RK-1-1-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-1-1-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-1-1-PAS_registered_thumbnail.jpg","VAN0005-RK-4-172-AF_preIMS_registered_thumbnail.jpg","VAN0005-RK-4-172-IMS_NegMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-IMS_PosMode_multilayer_thumbnail.jpg","VAN0005-RK-4-172-PAS_registered_thumbnail.jpg","VAN0006-LK-2-85-AF_preIMS_registered_thumbnail.jpg","VAN0006-LK-2-85-IMS_NegMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-IMS_PosMode_multilayer_thumbnail.jpg","VAN0006-LK-2-85-PAS_registered_thumbnail.jpg","VAN0006-LK-2-86-AF_preMxIF_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc1_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc2_registered_thumbnail.jpg","VAN0006-LK-2-86-MxIF_cyc3_registered_thumbnail.jpg","VAN0007-LK-203-103-AF_preIMS_registered_thumbnail.jpg","VAN0007-LK-203-103-IMS_NegMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-IMS_PosMode_multilayer_thumbnail.jpg","VAN0007-LK-203-103-PAS_registered_thumbnail.jpg","VAN0008-RK-403-100-AF_preIMS_registered_thumbnail.jpg","VAN0008-RK-403-100-IMS_NegMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-IMS_PosMode_multilayer_thumbnail.jpg","VAN0008-RK-403-100-PAS_registered_thumbnail.jpg","VAN0008-RK-403-101-AF_preMxIF_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc1_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc2_registered_thumbnail.jpg","VAN0008-RK-403-101-MxIF_cyc3_registered_thumbnail.jpg","VAN0011-RK-3-10-AF_preIMS_registered_thumbnail.jpg","VAN0011-RK-3-10-IMS_NegMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-IMS_PosMode_multilayer_thumbnail.jpg","VAN0011-RK-3-10-PAS_registered_thumbnail.jpg","VAN0011-RK-3-11-AF_preMxIF_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc1_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc2_registered_thumbnail.jpg","VAN0011-RK-3-11-MxIF_cyc3_registered_thumbnail.jpg","VAN0012-RK-103-75-AF_preIMS_registered_thumbnail.jpg","VAN0012-RK-103-75-IMS_NegMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-IMS_PosMode_multilayer_thumbnail.jpg","VAN0012-RK-103-75-PAS_registered_thumbnail.jpg","VAN0012-RK-103-76-AF_preMxIF_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc1_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc2_registered_thumbnail.jpg","VAN0012-RK-103-76-MxIF_cyc3_registered_thumbnail.jpg"]),Ne={"03b3d854-ed44-11e8-8bce-0e368f3075e8":"TMC-UCSD","07a29e4c-ed43-11e8-b56a-0e8017bdda58":"TMC-Florida","308f5ffc-ed43-11e8-b56a-0e8017bdda58":"TMC-CalTech","5bd084c8-edc2-11e8-802f-0e368f3075e8":"HBM-TestingGroup","73bb26e4-ed43-11e8-8f19-0a7c1eab007a":"TMC-Vanderbilt","def5fd76-ed43-11e8-b56a-0e8017bdda58":"TMC-Stanford"},Te=(Ee={},Object.entries(de).forEach(function(e){var t=b(e,2),r=t[0],n=t[1];return Ee[r]=n.id}),Ee),Ae={BL:[Te.body,Te.bladder],RK:[Te.body,Te.kidney,Te.right_kidney],LK:[Te.body,Te.kidney,Te.left_kidney],HT:[Te.body,Te.heart],LI:[Te.body,Te.large_intestine],SI:[Te.body,Te.small_instestine],LL:[Te.body,Te.lung,Te.left_lung],RL:[Te.body,Te.lung,Te.right_lung],LY:[Te.body,Te.lymph_node],SP:[Te.body,Te.spleen],TH:[Te.body,Te.thymus],UR:[Te.body,Te.ureter],LV:[Te.body,Te.liver],OT:[Te.body]},Re={BL:"Bladder",RK:"Right Kidney",LK:"Left Kidney",HT:"Heart",LI:"Large Intestine",SI:"Small Intestine",LL:"Left Lung",RL:"Right Lung",LY:"Lymph Node",SP:"Spleen",TH:"Thymus",UR:"Ureter",LV:"Liver",OT:"Other Organ"},Oe=function(){function e(t){var r,n,i,a,o,s=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",l=arguments.length>3?arguments[3]:void 0;S(this,e),this.data=t,this.assetsApi=u,this.id=this.data.uuid,this.entityType=this.data.entity_type,this.ancestors=this.data.ancestors||[],this.descendants=this.data.descendants||[],this.donor="Donor"===this.entityType?t:this.ancestors.find(function(e){return"Donor"===e.entity_type}),this.organSample="Sample"===this.entityType&&"organ"===t.specimen_type?t:this.ancestors.find(function(e){return"Sample"===e.entity_type&&"organ"===e.specimen_type});var f,h=(this.donor.description||"").toLowerCase();h.includes("female")?f="Female":h.includes("male")&&(f="Male");var d,p,v,y=h.match(/age\ ([0-9]+)/);y&&(d=Object(ne.toNumber)(y[1]));var m,_=w(Object(ne.get)(this.donor,"metadata.organ_donor_data",[]));try{for(_.s();!(m=_.n()).done;){var x=m.value;"Feminine gender"===x.preferred_term||"Female"===x.preferred_term?f="Female":"Masculine gender"===x.preferred_term||"Male"===x.preferred_term?f="Male":"Current chronological age"===x.preferred_term||"Age"===x.preferred_term?d=Object(ne.toNumber)(x.data_value):"Body mass index"===x.preferred_term?p=Object(ne.toNumber)(x.data_value):"Racial group"!==x.grouping_concept_preferred_term&&"Race"!==x.grouping_concept_preferred_term||(v=x.preferred_term)}}catch(q){_.e(q)}finally{_.f()}var k="";f&&d&&(k+="".concat(f,", Age ").concat(d),p&&(k+=", BMI ".concat(p.toFixed(1)))),this.age=d,this.sex=f,this.bmi=p,this.ethnicity=v,this.label=k,this.doi=t.display_doi,this.description=t.description;var E=this.groupUUID=t.group_uuid||this.donor.group_uuid;this.groupName=Ne[E]||t.group_name||this.donor.group_name,this.organName=[t].concat(g(this.ancestors),g(this.descendants)).map(function(e){return e.organ}).find(function(e){return!!e}),this.ontologyTerms=Ae[this.organName]||[Te.body],this.organ=this.ontologyTerms[this.ontologyTerms.length-1],this.protocolUrl=this.donor.protocol_url;var j=t.rui_location||this.ancestors[0].rui_location;if(j)if("string"==typeof j&&(j=JSON.parse(j)),j.alignment_id){var I;"07a29e4c-ed43-11e8-b56a-0e8017bdda58"===E&&(j=function(e,t){e=function(e){return e=Object.assign(Object.assign({},e),{tissue_object_size:Se(e.tissue_object_size),tissue_object_rotation:Se(e.tissue_object_rotation),tissue_position_mass_point:Se(e.tissue_position_mass_point)}),Object.entries(e).forEach(function(t){var r=b(t,2),n=r[0],i=r[1];"string"==typeof i&&Object(ne.set)(e,n,i.replace(/^_|mm_$|_$/g,""))}),e}(e);var r=t.lab_tissue_sample_id||"";return r.match(/CC1|CC\-1/)?(e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleenCC1",e.tissue_position_mass_point={x:29.95+e.tissue_position_mass_point.x,y:40.7-60,z:0},e.tissue_object_size.x=10):r.match(/CC2|CC\-2/)?(e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleenCC2",e.tissue_position_mass_point={x:31.5+e.tissue_position_mass_point.x,y:-19.9,z:0},e.tissue_object_size.x=10):r.match(/CC3|CC\-3/)?(e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleenCC3",e.tissue_position_mass_point={x:29.35+e.tissue_position_mass_point.x,y:-16.6,z:0},e.tissue_object_size.x=10):e.reference_organ_id="http://purl.org/ccf/latest/ccf.owl#VHSpleen",e}(j,t)),this.organ===Te.left_kidney?I=le.x("VHLeftKidney").id:this.organ===Te.right_kidney&&(I=le.x("VHRightKidney").id),this.spatialEntity=function(e,t,r){var n;r?n=r:"uuid-1234-5678"===e.reference_organ_id?n=le.x("VHKidney").id:e.reference_organ_id&&(n=e.reference_organ_id),(null==n?void 0:n.endsWith("Kidney"))&&(e=function(e){return Object.assign(Object.assign({},e),{tissue_position_mass_point:{x:e.tissue_position_mass_point.x-30,y:e.tissue_position_mass_point.y-50,z:e.tissue_position_mass_point.z-30}})}(e));var i=e.tissue_object_size,a=e.tissue_object_rotation,o=e.tissue_position_mass_point;return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":"http://purl.org/ccf/0.5/"+e.alignment_id,"@type":"SpatialEntity",label:t||void 0,creator:"".concat(e.alignment_operator_first_name," ").concat(e.alignment_operator_last_name),creator_first_name:e.alignment_operator_first_name,creator_last_name:e.alignment_operator_last_name,creation_date:e.alignment_datetime,ccf_annotations:[],x_dimension:i.x,y_dimension:i.y,z_dimension:i.z,dimension_units:"millimeter",placement:{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":"http://purl.org/ccf/0.5/"+e.alignment_id+"_placement","@type":"SpatialPlacement",target:n,placement_date:e.alignment_datetime,x_scaling:1,y_scaling:1,z_scaling:1,scaling_units:"ratio",x_rotation:a.x,y_rotation:a.y,z_rotation:a.z,rotation_order:"XYZ",rotation_units:"degree",x_translation:o.x,y_translation:o.y,z_translation:o.z,translation_units:"millimeter"}}}(j,"SpatialEntity for "+this.label,I)}else j["@id"]&&(this.spatialEntity=j);for(var N=[],T=[],A=function(){var e=O[R],t=Object(ne.get)(e,"metadata.files",[]).filter(function(e){return/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)}).filter(function(e){return!/(multilayer\.ome\.tif|\_ac\.ome\.tif)/.test(e.rel_path)}).filter(function(e){return"73bb26e4-ed43-11e8-8f19-0a7c1eab007a"!==E||Ie.has(e.rel_path.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg"))}).map(function(t){return"".concat(s.assetsApi,"/").concat(e.uuid,"/").concat(t.rel_path)+(l?"?token=".concat(l):"")});t.length>0&&(N=N.concat(t),T.push(je+e.uuid))},R=0,O=[t].concat(g(this.ancestors),g(this.descendants));R0&&(this.images=N,this.imageProviders=T);for(var L=new Map,M=new Map,D=!1,C=function(){var e=F[P];(e.data_types||[]).forEach(function(t){return L.set(t,e)});var t=null===(n=null===(r=e.metadata)||void 0===r?void 0:r.metadata)||void 0===n?void 0:n.assay_type;t&&M.set(t,e),"yes"!==e.contains_human_genetic_sequences&&!0!==e.contains_human_genetic_sequences||(D=!0)},P=0,F=[].concat(g(this.ancestors),[t],g(this.descendants));P0&&-1===B.indexOf("codex")){if(this.resultUrl=N[0],this.resultType="image_viewer",this.thumbnailUrl="assets/histology3.jpg","73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===E){var U=this.resultUrl.split("/").slice(-1)[0].split("?")[0].replace(".ome.tif","_thumbnail.jpg");Ie.has(U)&&(this.thumbnailUrl="assets/thumbnails/DR1-VU/".concat(U))}}else{if(L.has("codex_cytokit")){var G=null===(i=L.get("codex_cytokit"))||void 0===i?void 0:i.uuid;this.resultUrl="".concat(c,"browse/dataset/").concat(G,"#visualization")}else if(L.has("salmon_rnaseq_10x")){var z=null===(a=L.get("salmon_rnaseq_10x"))||void 0===a?void 0:a.uuid;this.resultUrl="".concat(c,"browse/dataset/").concat(z,"#visualization")}else if(L.has("image_pyramid")){var V=null===(o=L.get("image_pyramid"))||void 0===o?void 0:o.uuid;this.resultUrl="".concat(c,"browse/dataset/").concat(V,"#visualization")}else this.resultUrl=this.portalUrl;this.resultType="external_link"}}return j(e,[{key:"toJsonLd",value:function(){var e,t=this.data;return Object.assign(Object.assign({"@id":je+this.id,"@type":"Entity"},Object(ne.omit)(this,["data","donor","organ_sample","organSample","ancestors","descendants","assetsApi"])),{donor:je+this.donor.uuid,shortInfo0:this.doi,shortInfo1:this.groupName,shortInfo2:t.description||this.donor.description,downloadUrl:this.portalUrl,downloadTooltip:"View in the HuBMAP Data Portal",organName:Re[this.organName]||this.organName,sex:this.sex,age:this.age,bmi:null===(e=this.bmi)||void 0===e?void 0:e.toFixed(1),ethnicity:this.ethnicity,authorGroup:this.groupName,creator:t.created_by_user_displayname,creation_date:new Date(t.create_timestamp||0).toLocaleDateString(),modified_date:new Date(t.last_modified_timestamp||0).toLocaleDateString(),donor_id:this.donor.display_doi,organ_id:this.organSample.display_doi,tissue_id:this.doi,specimen_type:this.data.specimen_type,data_types:this.dataTypes.join(", "),assay_types:this.assayTypes.join(", "),spatial_bulk:this.spatialOrBulk,contains_sequence:this.containsHumanGeneticSequences?"Yes":"No",description:t.description||this.donor.description})}}]),e}();function Le(e,t){return function(r){return e.has(r.id)?t.add(r.id):void 0}}var Me=(v(n={},ue.id.id,"id"),v(n,ue.x("label").id,"label"),v(n,ue.x("organName").id,"organName"),n),De=(v(i={},ue.sex.id,"Sex"),v(i,ue.age.id,"Age"),v(i,ue.x("bmi").id,"BMI"),v(i,ue.x("ethnicity").id,"Ethnicity"),v(i,ue.groupName.id,"Author Group"),v(i,ue.x("creator").id,"Creator"),v(i,ue.x("creation_date").id,"Date Created"),v(i,ue.x("modified_date").id,"Date Modified"),v(i,ue.x("donor_id").id,"HuBMAP Donor ID"),v(i,ue.x("organ_id").id,"HuBMAP Organ ID"),v(i,ue.x("tissue_id").id,"HUBMAP Tissue ID"),v(i,ue.x("specimen_type").id,"Specimen Type"),v(i,ue.x("data_types").id,"Data Type(s)"),v(i,ue.x("assay_types").id,"Assay(s)"),v(i,ue.x("spatial_bulk").id,"Spatial/Bulk"),v(i,ue.x("contains_sequence").id,"Contains Sequence"),v(i,ue.x("description").id,"Description"),i),Ce=(v(a={},ue.id.id,"id"),v(a,ue.x("label").id,"label"),v(a,ue.x("shortInfo0").id,["shortInfo","0"]),v(a,ue.x("shortInfo1").id,["shortInfo","1"]),v(a,ue.x("shortInfo2").id,["shortInfo","2"]),v(a,ue.x("thumbnailUrl").id,"thumbnailUrl"),v(a,ue.x("downloadUrl").id,"downloadUrl"),v(a,ue.x("downloadTooltip").id,"downloadTooltip"),v(a,ue.x("resultUrl").id,"resultUrl"),v(a,ue.x("resultType").id,"resultType"),a),Pe={ccfOwlUrl:"https://purl.org/ccf/latest/ccf.owl",ccfContextUrl:"https://purl.org/ccf/latest/ccf-context.jsonld",hubmapDataService:"static",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org"},Fe=Symbol("Comlink.proxy"),Be=Symbol("Comlink.endpoint"),Ue=Symbol("Comlink.releaseProxy"),Ge=Symbol("Comlink.thrown"),ze=function(e){return"object"==typeof e&&null!==e||"function"==typeof e},Ve=new Map([["proxy",{canHandle:function(e){return ze(e)&&e[Fe]},serialize:function(e){var t=new MessageChannel,r=t.port1,n=t.port2;return qe(e,r),[n,[n]]},deserialize:function(e){return e.start(),He(e,[],void 0)}}],["throw",{canHandle:function(e){return ze(e)&&Ge in e},serialize:function(e){var t=e.value;return[t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[]]},deserialize:function(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;t.addEventListener("message",function r(n){if(n&&n.data){var i,a=Object.assign({path:[]},n.data),o=a.id,s=a.type,u=a.path,c=(n.data.argumentList||[]).map(Ye);try{var l=u.slice(0,-1).reduce(function(e,t){return e[t]},e),f=u.reduce(function(e,t){return e[t]},e);switch(s){case 0:i=f;break;case 1:l[u.slice(-1)[0]]=Ye(n.data.value),i=!0;break;case 2:i=f.apply(l,c);break;case 3:i=function(e){return Object.assign(e,v({},Fe,!0))}(h(f,g(c)));break;case 4:var d=new MessageChannel,p=d.port1,y=d.port2;qe(e,y),i=function(e,t){return Xe.set(e,t),e}(p,[p]);break;case 5:i=void 0}}catch(m){i=v({value:m},Ge,0)}Promise.resolve(i).catch(function(e){return v({value:e},Ge,0)}).then(function(e){var n=b(Qe(e),2),i=n[0],a=n[1];t.postMessage(Object.assign(Object.assign({},i),{id:o}),a),5===s&&(t.removeEventListener("message",r),Ke(t))})}}),t.start&&t.start()}function Ke(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function We(e){if(e)throw new Error("Proxy has been released and is not useable")}function He(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=!1,i=new Proxy(r,{get:function(r,a){if(We(n),a===Ue)return function(){return Ze(e,{type:5,path:t.map(function(e){return e.toString()})}).then(function(){Ke(e),n=!0})};if("then"===a){if(0===t.length)return{then:function(){return i}};var o=Ze(e,{type:0,path:t.map(function(e){return e.toString()})}).then(Ye);return o.then.bind(o)}return He(e,[].concat(g(t),[a]))},set:function(r,i,a){We(n);var o=b(Qe(a),2),s=o[0],u=o[1];return Ze(e,{type:1,path:[].concat(g(t),[i]).map(function(e){return e.toString()}),value:s},u).then(Ye)},apply:function(r,i,a){We(n);var o=t[t.length-1];if(o===Be)return Ze(e,{type:4}).then(Ye);if("bind"===o)return He(e,t.slice(0,-1));var s=b(Je(a),2),u=s[0],c=s[1];return Ze(e,{type:2,path:t.map(function(e){return e.toString()}),argumentList:u},c).then(Ye)},construct:function(r,i){We(n);var a=b(Je(i),2),o=a[0],s=a[1];return Ze(e,{type:3,path:t.map(function(e){return e.toString()}),argumentList:o},s).then(Ye)}});return i}function Je(e){var t,r=e.map(Qe);return[r.map(function(e){return e[0]}),(t=r.map(function(e){return e[1]}),Array.prototype.concat.apply([],t))]}var Xe=new WeakMap;function Qe(e){var t,r=w(Ve);try{for(r.s();!(t=r.n()).done;){var n=b(t.value,2),i=n[0],a=n[1];if(a.canHandle(e)){var o=b(a.serialize(e),2);return[{type:3,name:i,value:o[0]},o[1]]}}}catch(s){r.e(s)}finally{r.f()}return[{type:0,value:e},Xe.get(e)||[]]}function Ye(e){switch(e.type){case 3:return Ve.get(e.name).deserialize(e.value);case 0:return e.value}}function Ze(e,t,r){return new Promise(function(n){var i=new Array(4).fill(0).map(function(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)}).join("-");e.addEventListener("message",function t(r){r.data&&r.data.id&&r.data.id===i&&(e.removeEventListener("message",t),n(r.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),r)})}qe(new(function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe;S(this,e),this.options=t,this.store=new s.Store,this.graph=new we(this),this.scene=new xe(this)}return j(e,[{key:"connect",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e&&(this.options=e),this.initializing||(this.initializing=this.doConnect()),t.next=4,this.initializing;case 4:return t.abrupt("return",this.store.size>0);case 5:case"end":return t.stop()}},t,this)}))}},{key:"doConnect",value:function(){return o(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],this.options.ccfOwlUrl.endsWith(".n3")?t.push(Object(s.addN3ToStore)(this.options.ccfOwlUrl,this.store)):t.push(Object(s.addRdfXmlToStore)(this.options.ccfOwlUrl,this.store)),this.options.hubmapDataUrl&&(this.options.hubmapDataUrl.endsWith(".jsonld")?t.push(Object(s.addJsonLdToStore)(this.options.hubmapDataUrl,this.store)):t.push(function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";return o(this,void 0,void 0,regeneratorRuntime.mark(function o(){var u,c;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if("static"!==r){o.next=6;break}return o.next=3,fetch(t).then(function(e){return e.ok?e.json():void 0}).catch(function(){});case 3:u=o.sent,o.next=12;break;case 6:if("search-api"!==r){o.next=12;break}return c={"Content-type":"application/json"},n&&n.length>0&&(c.Authorization="Bearer ".concat(n)),o.next=11,fetch(t,{method:"POST",headers:c,body:JSON.stringify({version:!0,size:1e4,_source:{excludes:["donor","immediate_ancestors","immediate_descendants","origin_sample","ancestor_ids","descendant_ids"]},stored_fields:["*"],script_fields:{},docvalue_fields:[],query:{exists:{field:"rui_location"}}})}).then(function(e){return e.ok?e.json():void 0}).catch(function(){});case 11:u=o.sent;case 12:if(!u){o.next=17;break}return o.next=15,Object(s.addJsonLdToStore)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=Object(ne.get)(e,"hits.hits",[]).map(function(e){return Object(ne.get)(e,"_source",{})});return i&&function(e){var t,r=[],n=w(Object(ne.sortBy)(e.concat(),["groupName","data.hubmap_display_id"]));try{for(n.s();!(t=n.n()).done;){var i=t.value,a={UUID:i.id,"Group Name":i.groupName,"Entity Type":i.entityType,"Sample ID":i.data.hubmap_display_id,"Donor ID":i.donor.display_doi,"Organ Sample ID":i.organSample.display_doi,"Has Datasets":"No","Has TIFFs":"","Has Thumbnails":"","Dataset ID":"","Data Type(s)":i.dataTypes.join("|"),"Assay Type(s)":i.assayTypes.join("|"),TIFFs:"",Thumbnails:""};r.push(a);var o,s=w(i.descendants.filter(function(e){return"Dataset"===e.entity_type}));try{for(s.s();!(o=s.n()).done;){var u=o.value;a["Has Datasets"]="Yes";var c=Object(ne.get)(u,"metadata.files",[]).filter(function(e){return/\.(ome\.tif|ome\.tiff)$/.test(e.rel_path)}).map(function(e){return e.rel_path}).map(function(e){return e.split("/").slice(-1)[0].split("?")[0]}),l=[];if("73bb26e4-ed43-11e8-8f19-0a7c1eab007a"===i.groupUUID){var f,h=w(c);try{for(h.s();!(f=h.n()).done;){var d=f.value.replace(".ome.tif","_thumbnail.png");Ie.has(d)&&(l.push(d),a["Has Thumbnails"]="Yes")}}catch(v){h.e(v)}finally{h.f()}}c.length>0&&(a["Has TIFFs"]="Yes");var p=Object.assign({},a,{UUID:"","Entity Type":u.entity_type,"Dataset ID":u.display_doi,"Data Type(s)":(u.data_types||[]).join("|"),"Assay Type(s)":Object(ne.get)(u,"metaata.metadata.assay_type",""),TIFFs:c.join("|"),Thumbnails:l.join("|")});r.push(p)}}catch(v){s.e(v)}finally{s.f()}}}catch(v){n.e(v)}finally{n.f()}console.log(r)}(a.map(function(e){return new Oe(e,t,r,n)})),{"@context":{"@vocab":"http://purl.org/ccf/latest/ccf-entity.owl#",ontologyTerms:{"@type":"@id"},ancestors:{"@type":"@id"},descendants:{"@type":"@id"},organ:{"@type":"@id"},images:{"@id":"hasImage","@type":"@id"},imageProviders:{"@id":"hasImageProvider","@type":"@id"}},"@graph":a.map(function(e){return new Oe(e,t,r,n).toJsonLd()})}}(u,i,a,n),e);case 15:o.next=18;break;case 17:console.warn("Unable to load ".concat(t," as HuBMAP Data"));case 18:case"end":return o.stop()}},o)}))}(this.store,this.options.hubmapDataUrl,this.options.hubmapDataService,this.options.hubmapToken,this.options.hubmapAssetsUrl,this.options.hubmapPortalUrl))),t.push(Object(s.addJsonLdToStore)("assets/kpmp/data/rui_locations.jsonld",this.store).catch(function(e){return console.log("Couldn't locate KPMP data.")})),e.next=6,Promise.all(t);case 6:return e.next=8,new Promise(function(e){return setTimeout(e,500)});case 8:this.graph.createGraph();case 9:case"end":return e.stop()}},e,this)}))}},{key:"getIds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){var r,n,i,a,o=function(e){var t=new Set;return e.forSubjects(function(e){return t.add(e.id)},ue.id,null,null),t}(e);if(o.size>0&&(!0===t.hasSpatialEntity||!1===t.hasSpatialEntity)&&(o=function(e,t,r){var n=new Set;if(e.forSubjects(Le(t,n),ue.spatialEntity,null,null),!r){var i=new Set;return t.forEach(function(e){return n.has(e)?void 0:i.add(e)}),i}return n}(e,o,t.hasSpatialEntity)),o.size>0&&("Male"===t.sex||"Female"===t.sex)&&(o=function(e,t,r){var n=new Set;return e.forSubjects(Le(t,n),ue.sex,ue[r],null),n}(e,o,t.sex)),o.size>0&&(null===(r=t.tmc)||void 0===r?void 0:r.length)>0&&(o=function(e,t,r){var n,i=new Set,a=w(r);try{for(a.s();!(n=a.n()).done;){var o=n.value,u=s.DataFactory.literal(o);e.forSubjects(Le(t,i),ue.groupName,u,null)}}catch(c){a.e(c)}finally{a.f()}return i}(e,o,t.tmc)),o.size>0&&(null===(n=t.ontologyTerms)||void 0===n?void 0:n.length)>0&&(o=function(e,t,r){var n,i=new Set,a=w(r);try{for(a.s();!(n=a.n()).done;){var o=n.value,u=s.DataFactory.namedNode(o);e.forSubjects(Le(t,i),ue.ontologyTerms,u,null)}}catch(c){a.e(c)}finally{a.f()}return i}(e,o,t.ontologyTerms)),o.size>0&&2===(null===(i=t.ageRange)||void 0===i?void 0:i.length)&&Object(ne.isFinite)(t.ageRange[0])&&Object(ne.isFinite)(t.ageRange[1])){var u=Math.max.apply(Math,g(t.ageRange)),c=Math.min.apply(Math,g(t.ageRange));1===c&&110===u||(o=function(e,t,r,n){var i=new Set;return e.some(function(e){if(t.has(e.subject.id)){var a=Object(ie.fromRdf)(e.object);a>=r&&a<=n&&i.add(e.subject.id)}return!1},null,ue.age,null,null),i}(e,o,c,u))}if(o.size>0&&2===(null===(a=t.bmiRange)||void 0===a?void 0:a.length)&&Object(ne.isFinite)(t.bmiRange[0])&&Object(ne.isFinite)(t.bmiRange[1])){var l=Math.max.apply(Math,g(t.bmiRange)),f=Math.min.apply(Math,g(t.bmiRange));13===f&&83===l||(o=function(e,t,r,n){var i=new Set;return e.some(function(e){if(t.has(e.subject.id)){var a=Object(ie.fromRdf)(e.object);a>=r&&a<=n&&i.add(e.subject.id)}return!1},null,ue.bmi,null,null),i}(e,o,f,l))}return o}(this.store,e)}},{key:"get",value:function(e){return this.store.getQuads(s.DataFactory.namedNode(e),null,null,null)}},{key:"search",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return g(this.getIds(t)).map(function(t){return e.get(t)})}},{key:"getSpatialEntities",value:function(e){var t=this;return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),g(this.getIds(e)).map(function(e){return r=t.store,n=e,(i=r.getObjects(s.DataFactory.namedNode(n),ue.spatialEntity,null)).length>0?me(r,i[0].id):void 0;var r,n,i})}},{key:"getListResults",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=Object.assign(Object.assign({},e),{hasSpatialEntity:!0}),r=new Set(e.highlightedEntities),t.abrupt("return",g(this.getIds(e)).map(function(e){return t=n.store,i={"@id":r=e,"@type":"ListResult"},t.some(function(e){var t=Ce[e.predicate.id];if(t){var r="Literal"===e.object.termType?Object(ie.fromRdf)(e.object):e.object.id;Object(ne.set)(i,t,r)}return!1},s.DataFactory.namedNode(r),null,null,null),i;var t,r,i}).map(function(e){return Object.assign(e,{highlighted:r.has(e["@id"])})}).sort(function(e,t){return(e.highlighted?0:1)-(t.highlighted?0:1)}));case 3:case"end":return t.stop()}},t,this)}))}},{key:"getAggregateResults",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",function(e,t){var r=new Set;t.some(function(t){return e.has(t.subject.id)&&r.add(t.object.id),!1},null,ue.groupUUID,null,null);var n=new Set;t.some(function(t){return e.has(t.subject.id)&&n.add(t.object.id),!1},null,ue.donor,null,null);var i=new Set;return t.forSubjects(function(t){e.has(t.id)&&i.add(t.id)},ue.spatialEntity,null,null),Object.entries({Centers:r.size,Donors:n.size,Samples:i.size}).map(function(e){var t=b(e,2);return{label:t[0],count:t[1]}})}(this.getIds(e),this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getOntologyTermOccurences",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",function(e,t){var r={};return t.some(function(t){return e.has(t.subject.id)&&(r[t.object.id]=1+(r[t.object.id]||0)),!1},null,ue.ontologyTerms,null,null),r}(this.getIds(e),this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getImageViewerData",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",function(e,t){var r={"@id":e,"@type":"ImageViewerData"},n={};return t.some(function(e){var t=Me[e.predicate.id];if(De[e.predicate.id]){var i="Literal"===e.object.termType?Object(ie.fromRdf)(e.object):e.object.id;n[e.predicate.id]=""+i}if(t){var a="Literal"===e.object.termType?Object(ie.fromRdf)(e.object):e.object.id;Object(ne.set)(r,t,a)}return!1},s.DataFactory.namedNode(e),null,null,null),r.metadata=Object.entries(De).map(function(e){var t=b(e,2),r=t[0];return{label:t[1],value:n[r]}}).filter(function(e){return e.value}),r}(e,this.store));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getScene",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(this.graph.createGraph(),this.scene.getScene(e)));case 1:case"end":return t.stop()}},t,this)}))}}]),e}()))},JFj6:function(t,c,l){t.exports=function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){return i(t[o][1][e]||e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a=!1,o=0;o0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0?o-4:o;for(r=0;r>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[l++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));return 1===i?a.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&a.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,r){for(var i=[],a=t;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);var o;return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],11:[function(e,t,r){},{}],12:[function(e,t,r){(function(t){"use strict";var n=e("base64-js"),i=e("ieee754");function a(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return r.__proto__=t.prototype,r}function t(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return o(e,t,r)}function o(e,r,n){if("string"==typeof e)return function(e,r){if("string"==typeof r&&""!==r||(r="utf8"),!t.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var n=0|f(e,r),i=a(n),o=i.write(e,r);return o!==n&&(i=i.slice(0,o)),i}(e,r);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer))return function(e,r,n){if(r<0||e.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function f(e,r){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var a=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return D(e).length;default:if(a)return i?-1:M(e).length;r=(""+r).toLowerCase(),a=!0}}function h(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return E(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function d(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function p(e,r,n,i,a){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),F(n=+n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof r&&(r=t.from(r,i)),t.isBuffer(r))return 0===r.length?-1:v(e,r,n,i,a);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):v(e,[r],n,i,a);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=r;as&&(r=s-u),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var o=0;o>8,i.push(r%256),i.push(n);return i}(t,e.length-r),e,r,n)}function x(e,t,r){return n.fromByteArray(0===t&&r===e.length?e:e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:o=e[i+2],128==(192&(a=e[i+1]))&&128==(192&o)&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+2],s=e[i+3],128==(192&(a=e[i+1]))&&128==(192&o)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(n.push((l-=65536)>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;ni)&&(r=i);for(var a="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function T(e,r,n,i,a,o){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>a||re.length)throw new RangeError("Index out of range")}function A(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,r,n,a){return t=+t,r>>>=0,a||A(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function O(e,t,r,n,a){return t=+t,r>>>=0,a||A(e,0,r,8),i.write(e,t,r,n,52,8),r+8}r.Buffer=t,r.SlowBuffer=function(e){return+e!=e&&(e=0),t.alloc(+e)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=2147483647,(t.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(e,t,r){return o(e,t,r)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(e,t,r){return function(e,t,r){return s(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},t.allocUnsafe=function(e){return u(e)},t.allocUnsafeSlow=function(e){return u(e)},t.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==t.prototype},t.compare=function(e,r){if(P(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),P(r,Uint8Array)&&(r=t.from(r,r.offset,r.byteLength)),!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var n=e.length,i=r.length,a=0,o=Math.min(n,i);at&&(e+=" ... "),""},t.prototype.compare=function(e,r,n,i,a){if(P(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),r<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(i>>>=0),s=(n>>>=0)-(r>>>=0),u=Math.min(o,s),c=this.slice(i,a),l=e.slice(r,n),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return m(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},t.prototype.slice=function(e,r){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},t.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},t.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},t.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},t.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},t.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},t.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},t.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},t.prototype.copy=function(e,r,n,i){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r=0;--o)e[o+r]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,i),r);return a},t.prototype.fill=function(e,r,n,i){if("string"==typeof e){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var a=e.charCodeAt(0);("utf8"===i&&a<128||"latin1"===i)&&(e=a)}}else"number"==typeof e&&(e&=255);if(r<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=r;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function D(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function C(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function F(e){return e!=e}}).call(this,e("buffer").Buffer)},{"base64-js":10,buffer:12,ieee754:17}],13:[function(e,t,r){var n=Object.create||function(e){var t=function(){};return t.prototype=e,new t},i=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return r},a=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var s,u=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),s=0===c.x}catch(x){s=!1}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,r){if(t)e.call(r);else for(var n=e.length,i=w(e,n),a=0;a0&&s.length>a){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else s=o[t]=r,++e._eventsCount;return e}function y(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t1&&(t=arguments[1]),t instanceof Error)throw t;var u=new Error('Unhandled "error" event. ('+t+")");throw u.context=t,u}if(!(r=o[e]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:f(r,c,this);break;case 2:h(r,c,this,arguments[1]);break;case 3:d(r,c,this,arguments[1],arguments[2]);break;case 4:p(r,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),a=1;a=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,a=o;break}if(a<0)return this;0===a?r.shift():function(e,t){for(var r=t,n=r+1,i=e.length;n=0;a--)this.removeListener(e,t[a]);return this},o.prototype.listeners=function(e){return m(this,e,!0)},o.prototype.rawListeners=function(e){return m(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):_.call(e,t)},o.prototype.listenerCount=_,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],14:[function(e,t,r){(function(t,n){var i=e("process/browser.js").nextTick,a=Function.prototype.apply,o=Array.prototype.slice,s={},u=0;function c(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new c(a.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(a.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r.setImmediate="function"==typeof t?t:function(e){var t=u++,n=!(arguments.length<2)&&o.call(arguments,1);return s[t]=!0,i(function(){s[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof n?n:function(e){delete s[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":62,timers:14}],15:[function(e,t,r){"use strict";t.exports=function(e){return function e(t){if(null===t||"object"!=typeof t||null!=t.toJSON)return JSON.stringify(t);if(Array.isArray(t)&&0===t.length)return"[]";if(Array.isArray(t)&&1===t.length)return"["+e(t[0])+"]";if(Array.isArray(t))return"["+t.reduce(function(t,r,n){return(t=1===n?e(t):t)+","+e(r)})+"]";var r=Object.keys(t);return 0===r.length?"{}":1===r.length?"{"+e(r[0])+":"+e(t[r[0]])+"}":"{"+r.sort().reduce(function(r,n,i){return(r=1===i?e(r)+":"+e(t[r]):r)+","+e(n)+":"+e(t[n])})+"}"}(e)}},{}],16:[function(e,t,r){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},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.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":19}],17:[function(e,t,r){r.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*v}},{}],18:[function(e,t,r){t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],19:[function(e,t,r){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],20:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],21:[function(e,t,r){"use strict";var n=e("./types"),i=n.isArray,a=n.isObject,o=n.isString,s=e("./util").asArray,u=e("./url").prependBase,c=e("./JsonLdError"),l=e("./ResolvedContext");function h(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function d(e){var t=e.context,r=e.base;if(t){var n=t["@context"];if(o(n))t["@context"]=u(r,n);else if(i(n))for(var s=0;s10)){e.next=3;break}throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===r.processingMode?"loading remote context failed":"context overflow",max:10});case 3:if(!u.has(n)){e.next=5;break}throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===r.processingMode?"recursive context inclusion":"context overflow",url:n});case 5:return u.add(n),e.prev=6,e.next=9,s(n);case 9:f=e.sent,l=f.document||null,o(l)&&(l=JSON.parse(l)),e.next=17;break;case 14:throw e.prev=14,e.t0=e.catch(6),new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:n,cause:e.t0});case 17:if(a(l)){e.next=19;break}throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:n});case 19:return e.abrupt("return",(l="@context"in l?{"@context":l["@context"]}:{"@context":{}},f.contextUrl&&(i(l["@context"])||(l["@context"]=[l["@context"]]),l["@context"].push(f.contextUrl)),{context:l,remoteDoc:f}));case 20:case"end":return e.stop()}},e,null,[[6,14]])})),function(e){return t.apply(this,arguments)})}]),e}()},{"./JsonLdError":22,"./ResolvedContext":27,"./types":41,"./url":42,"./util":43}],22:[function(e,t,r){"use strict";t.exports=function(e){i(r,e);var t=a(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"An unspecified JSON-LD error occurred.",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"jsonld.Error",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return S(this,r),(e=t.call(this,n)).name=i,e.message=n,e.details=a,e}return r}(u(Error))},{}],23:[function(e,t,r){"use strict";t.exports=function(e){var t=function(){function e(){S(this,e)}return j(e,[{key:"toString",value:function(){return"[object JsonLdProcessor]"}}]),e}();return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,r)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},{}],24:[function(e,t,r){"use strict";t.exports=e("rdf-canonize").NQuads},{"rdf-canonize":73}],25:[function(e,t,r){"use strict";var n,i=e("./constants"),a=i.RDF_LANGSTRING,o=i.RDF_PLAIN_LITERAL,s=i.RDF_OBJECT,u=i.RDF_XML_LITERAL,c=i.XSD_STRING;n="undefined"!=typeof Node?Node:{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},t.exports=function(){function t(){S(this,t)}return j(t,[{key:"parse",value:function(t){for(var r={"@default":[]},i=t.getSubjects(),l=0;l1&&(C=Array.from(C).sort()),P=r,F=w(C),e.prev=27,F.s();case 29:if((B=F.n()).done){e.next=39;break}if(U=B.value,G=L.compactIri({activeCtx:P,iri:U,relativeTo:{vocab:!0}}),z=x(O,G,"@context"),e.t1=c(z),e.t1){e.next=37;break}return e.next=36,S({activeCtx:r,localCtx:z,options:m,propagate:!1});case 36:r=e.sent;case 37:e.next=29;break;case 39:e.next=44;break;case 41:e.prev=41,e.t2=e.catch(27),F.e(e.t2);case 44:return e.prev=44,F.f(),e.finish(44);case 47:V=Object.keys(f).sort(),q=w(V),e.prev=49,q.s();case 51:if((K=q.n()).done){e.next=184;break}if(W=K.value,H=f[W],"@id"===W){e.next=180;break}if("@type"===W){e.next=174;break}if("@reverse"===W){e.next=167;break}if("@preserve"===W){e.next=161;break}if("@index"===W){e.next=155;break}if("@graph"===W||"@list"===W||"@included"===W||!k(W)){e.next=64;break}J=L.compactIri({activeCtx:r,iri:W,relativeTo:{vocab:!0}}),A(T,J,H),e.next=153;break;case 64:if(o(H)){e.next=66;break}throw new i("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");case 66:0===H.length&&(X=L.compactIri({activeCtx:r,iri:W,value:H,relativeTo:{vocab:!0},reverse:N}),Q=r.mappings.has(X)?r.mappings.get(X)["@nest"]:null,Y=T,Q&&(M(r,Q,m),s(T[Q])||(T[Q]={}),Y=T[Q]),A(Y,X,H,{propertyIsArray:!0})),Z=w(H),e.prev=68,Z.s();case 70:if(($=Z.n()).done){e.next=145;break}return ee=$.value,te=L.compactIri({activeCtx:r,iri:W,value:ee,relativeTo:{vocab:!0},reverse:N}),re=r.mappings.has(te)?r.mappings.get(te)["@nest"]:null,ne=T,re&&(M(r,re,m),s(T[re])||(T[re]={}),ne=T[re]),ie=x(r,te,"@container")||[],ae=p(ee),oe=h(ee),se=void 0,oe?se=ee["@list"]:ae&&(se=ee["@graph"]),e.next=80,L.compact({activeCtx:r,activeProperty:te,element:oe||ae?se:ee,options:m,compactionMap:j});case 80:if(ue=e.sent,!oe){e.next=86;break}if(o(ue)||(ue=[ue]),!ie.includes("@list")){e.next=85;break}return A(ne,te,ue,{valueIsArray:!0,allowDuplicate:!0}),e.abrupt("continue",143);case 85:ue=v({},L.compactIri({activeCtx:r,iri:"@list",relativeTo:{vocab:!0}}),ue),"@index"in ee&&(ue[L.compactIri({activeCtx:r,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]);case 86:if(!ae){e.next=90;break}ie.includes("@graph")&&(ie.includes("@id")||ie.includes("@index")&&g(ee))?(ce=void 0,ne.hasOwnProperty(te)?ce=ne[te]:ne[te]=ce={},le=(ie.includes("@id")?ee["@id"]:ee["@index"])||L.compactIri({activeCtx:r,iri:"@none",relativeTo:{vocab:!0}}),A(ce,le,ue,{propertyIsArray:!m.compactArrays||ie.includes("@set")})):ie.includes("@graph")&&g(ee)?(o(ue)&&ue.length>1&&(ue={"@included":ue}),A(ne,te,ue,{propertyIsArray:!m.compactArrays||ie.includes("@set")})):(o(ue)&&1===ue.length&&m.compactArrays&&(ue=ue[0]),ue=v({},L.compactIri({activeCtx:r,iri:"@graph",relativeTo:{vocab:!0}}),ue),"@id"in ee&&(ue[L.compactIri({activeCtx:r,iri:"@id",relativeTo:{vocab:!0}})]=ee["@id"]),"@index"in ee&&(ue[L.compactIri({activeCtx:r,iri:"@index",relativeTo:{vocab:!0}})]=ee["@index"]),A(ne,te,ue,{propertyIsArray:!m.compactArrays||ie.includes("@set")})),e.next=143;break;case 90:if(!(ie.includes("@language")||ie.includes("@index")||ie.includes("@id")||ie.includes("@type"))){e.next=141;break}if(fe=void 0,he=void 0,ne.hasOwnProperty(te)?fe=ne[te]:ne[te]=fe={},!ie.includes("@language")){e.next=96;break}d(ue)&&(ue=ue["@value"]),he=ee["@language"],e.next=138;break;case 96:if(!ie.includes("@index")){e.next=117;break}if(de=x(r,te,"@index")||"@index",pe=L.compactIri({activeCtx:r,iri:de,relativeTo:{vocab:!0}}),"@index"!==de){e.next=102;break}he=ee["@index"],delete ue[pe],e.next=115;break;case 102:if(ye=void 0,ve=R(ue[de]||[]),ge=n(ve),he=ge[0],ye=ge.slice(1),!u(he)){e.next=114;break}e.t3=ye.length,e.next=0===e.t3?107:1===e.t3?109:111;break;case 107:return delete ue[de],e.abrupt("break",112);case 109:return ue[de]=ye[0],e.abrupt("break",112);case 111:ue[de]=ye;case 112:e.next=115;break;case 114:he=null;case 115:e.next=138;break;case 117:if(!ie.includes("@id")){e.next=122;break}be=L.compactIri({activeCtx:r,iri:"@id",relativeTo:{vocab:!0}}),he=ue[be],delete ue[be],e.next=138;break;case 122:if(!ie.includes("@type")){e.next=138;break}me=L.compactIri({activeCtx:r,iri:"@type",relativeTo:{vocab:!0}}),_e=void 0,e.t4=(t=R(ue[me]||[]),a=n(t),he=a[0],(_e=a.slice(1)).length),e.next=0===e.t4?128:1===e.t4?130:132;break;case 128:return delete ue[me],e.abrupt("break",133);case 130:return ue[me]=_e[0],e.abrupt("break",133);case 132:ue[me]=_e;case 133:if(e.t5=1===Object.keys(ue).length&&"@id"in ee,!e.t5){e.next=138;break}return e.next=137,L.compact({activeCtx:r,activeProperty:te,element:{"@id":ee["@id"]},options:m,compactionMap:j});case 137:ue=e.sent;case 138:he||(he=L.compactIri({activeCtx:r,iri:"@none",relativeTo:{vocab:!0}})),A(fe,he,ue,{propertyIsArray:ie.includes("@set")}),e.next=143;break;case 141:we=!m.compactArrays||ie.includes("@set")||ie.includes("@list")||o(ue)&&0===ue.length||"@list"===W||"@graph"===W,A(ne,te,ue,{propertyIsArray:we});case 143:e.next=70;break;case 145:e.next=150;break;case 147:e.prev=147,e.t6=e.catch(68),Z.e(e.t6);case 150:return e.prev=150,Z.f(),e.finish(150);case 153:e.next=159;break;case 155:if(!(x(r,l,"@container")||[]).includes("@index")){e.next=157;break}return e.abrupt("continue",182);case 157:xe=L.compactIri({activeCtx:r,iri:W,relativeTo:{vocab:!0}}),A(T,xe,H);case 159:e.next=165;break;case 161:return e.next=163,L.compact({activeCtx:r,activeProperty:l,element:H,options:m,compactionMap:j});case 163:ke=e.sent,o(ke)&&0===ke.length||A(T,W,ke);case 165:e.next=172;break;case 167:return e.next=169,L.compact({activeCtx:r,activeProperty:"@reverse",element:H,options:m,compactionMap:j});case 169:for(Ee in Se=e.sent)r.mappings.has(Ee)&&r.mappings.get(Ee).reverse&&(je=Se[Ee],Ie=(x(r,Ee,"@container")||[]).includes("@set")||!m.compactArrays,A(T,Ee,je,{propertyIsArray:Ie}),delete Se[Ee]);Object.keys(Se).length>0&&(Ne=L.compactIri({activeCtx:r,iri:W,relativeTo:{vocab:!0}}),A(T,Ne,Se));case 172:e.next=178;break;case 174:1===(Te=R(H).map(function(e){return L.compactIri({activeCtx:O,iri:e,relativeTo:{vocab:!0}})})).length&&(Te=Te[0]),Ae=L.compactIri({activeCtx:r,iri:"@type",relativeTo:{vocab:!0}}),Re=(x(r,Ae,"@container")||[]).includes("@set")&&E(r,1.1)||o(Te)&&0===H.length,A(T,Ae,Te,{propertyIsArray:Re});case 178:e.next=182;break;case 180:1===(Oe=R(H).map(function(e){return L.compactIri({activeCtx:r,iri:e,relativeTo:{vocab:!1},base:m.base})})).length&&(Oe=Oe[0]),T[L.compactIri({activeCtx:r,iri:"@id",relativeTo:{vocab:!0}})]=Oe;case 182:e.next=51;break;case 184:e.next=189;break;case 186:e.prev=186,e.t7=e.catch(49),q.e(e.t7);case 189:return e.prev=189,q.f(),e.finish(189);case 192:return e.abrupt("return",{v:T});case 193:case"end":return e.stop()}},e,null,[[27,41,44,47],[49,186,189,192],[68,147,150,153]])})(),"t3",29);case 29:if("object"!=typeof(D=e.t3)){e.next=32;break}return e.abrupt("return",D.v);case 32:return e.abrupt("return",f);case 33:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),L.compactIri=function(e){var t=e.activeCtx,r=e.iri,n=e.value,a=void 0===n?null:n,o=e.relativeTo,u=void 0===o?{vocab:!1}:o,c=e.reverse,l=void 0!==c&&c,f=e.base,v=void 0===f?null:f;if(null===r)return r;t.isPropertyTermScoped&&t.previousContext&&(t=t.previousContext);var g=t.getInverse();if(k(r)&&r in g&&"@none"in g[r]&&"@type"in g[r]["@none"]&&"@none"in g[r]["@none"]["@type"])return g[r]["@none"]["@type"]["@none"];if(u.vocab&&r in g){var y=t["@language"]||"@none",m=[];s(a)&&"@index"in a&&!("@graph"in a)&&m.push("@index","@index@set"),s(a)&&"@preserve"in a&&(a=a["@preserve"][0]),p(a)?("@index"in a&&m.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in a&&m.push("@graph@id","@graph@id@set"),m.push("@graph","@graph@set","@set"),"@index"in a||m.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in a||m.push("@graph@id","@graph@id@set")):s(a)&&!d(a)&&m.push("@id","@id@set","@type","@set@type");var _="@language",x="@null";if(l)_="@type",x="@reverse",m.push("@set");else if(h(a)){"@index"in a||m.push("@list");var S=a["@list"];if(0===S.length)_="@any",x="@none";else{for(var E=0===S.length?y:null,j=null,T=0;T=0;--q){var K,W=U[q],H=w(W.terms);try{for(H.s();!(K=H.n()).done;){var J=K.value,X=J+":"+r.substr(W.iri.length);t.mappings.get(J)._prefix&&(!t.mappings.has(X)||null===a&&t.mappings.get(X)["@id"]===r)&&(null===B||O(X,B)<0)&&(B=X)}}catch(te){H.e(te)}finally{H.f()}}if(null!==B)return B;var Q,Y=w(t.mappings);try{for(Y.s();!(Q=Y.n()).done;){var Z=b(Q.value,2),$=Z[0],ee=Z[1];if(ee&&ee._prefix&&r.startsWith($+":"))throw new i('Absolute IRI "'.concat(r,'" confused with prefix "').concat($,'".'),"jsonld.SyntaxError",{code:"IRI confused with prefix",context:t})}}catch(te){Y.e(te)}finally{Y.f()}return u.vocab?r:"@base"in t?t["@base"]?I(N(v,t["@base"]),r):r:I(v,r)},L.compactValue=function(e){var t=e.activeCtx,r=e.activeProperty,n=e.value,i=e.options;if(d(n)){var a=x(t,r,"@type"),o=x(t,r,"@language"),s=x(t,r,"@direction"),c=x(t,r,"@container")||[],l="@index"in n&&!c.includes("@index");if(!l&&"@none"!==a){if(n["@type"]===a)return n["@value"];if("@language"in n&&n["@language"]===o&&"@direction"in n&&n["@direction"]===s)return n["@value"];if("@language"in n&&n["@language"]===o)return n["@value"];if("@direction"in n&&n["@direction"]===s)return n["@value"]}var f=Object.keys(n).length,h=1===f||2===f&&"@index"in n&&!l,p="@language"in t,g=u(n["@value"]),y=t.mappings.has(r)&&null===t.mappings.get(r)["@language"];if(h&&"@none"!==a&&(!p||!g||y))return n["@value"];var b={};return l&&(b[L.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?b[L.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=L.compactIri({activeCtx:t,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(b[L.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(b[L.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),b[L.compactIri({activeCtx:t,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],b}var m=_(t,r,{vocab:!0},i),w=x(t,r,"@type"),k=L.compactIri({activeCtx:t,iri:n["@id"],relativeTo:{vocab:"@vocab"===w},base:i.base});return"@id"===w||"@vocab"===w||"@graph"===m?k:v({},L.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}}),k)}},{"./JsonLdError":22,"./context":30,"./graphTypes":37,"./types":41,"./url":42,"./util":43}],29:[function(e,t,r){"use strict";var n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#";t.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:n,RDF_LIST:n+"List",RDF_FIRST:n+"first",RDF_REST:n+"rest",RDF_NIL:n+"nil",RDF_TYPE:n+"type",RDF_PLAIN_LITERAL:n+"PlainLiteral",RDF_XML_LITERAL:n+"XMLLiteral",RDF_JSON_LITERAL:n+"JSON",RDF_OBJECT:n+"object",RDF_LANGSTRING:n+"langString",XSD:i,XSD_BOOLEAN:i+"boolean",XSD_DOUBLE:i+"double",XSD_INTEGER:i+"integer",XSD_STRING:i+"string"}},{}],30:[function(e,t,r){"use strict";var n=e("./util"),i=e("./JsonLdError"),a=e("./types"),o=a.isArray,s=a.isObject,u=a.isString,c=a.isUndefined,l=e("./url"),h=l.isAbsolute,d=l.isRelative,p=l.prependBase,v=e("./util"),y=v.asArray,m=v.compareShortestLeast,_=new Map,x=/^@[a-zA-Z]+$/,k={};function S(e,t,r,n,i,a){if(null===t||!u(t)||k.isKeyword(t))return t;if(t.match(x))return null;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&k.createTermDefinition({activeCtx:e,localCtx:n,term:t,defined:i,options:a}),(r=r||{}).vocab){var o=e.mappings.get(t);if(null===o)return null;if(s(o)&&"@id"in o)return o["@id"]}var c=t.indexOf(":");if(c>0){var l=t.substr(0,c),f=t.substr(c+1);if("_"===l||0===f.indexOf("//"))return t;n&&n.hasOwnProperty(l)&&k.createTermDefinition({activeCtx:e,localCtx:n,term:l,defined:i,options:a});var d=e.mappings.get(l);if(d&&d._prefix)return d["@id"]+f;if(h(t))return t}if(r.vocab&&"@vocab"in e)return e["@vocab"]+t;if(r.base&&"@base"in e){if(e["@base"])return p(p(a.base,e["@base"]),t)}else if(r.base)return p(a.base,t);return t}function E(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;var r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){if(e.length!==t.length)return!1;for(var n=0;n0,"@reverse"in t){if("@id"in t)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:n});if("@nest"in t)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:n});var j=t["@reverse"];if(!u(j))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:n});if(!k.isKeyword(j)&&j.match(x))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:j}),void(g?r.mappings.set(a,g):r.mappings.delete(a));var I=S(r,j,{vocab:!0,base:!1},n,c,l);if(!h(I))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:n});b["@id"]=I,b.reverse=!0}else if("@id"in t){var N=t["@id"];if(N&&!u(N))throw new i("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:n});if(null===N)b["@id"]=null;else{if(!k.isKeyword(N)&&N.match(x))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:N}),void(g?r.mappings.set(a,g):r.mappings.delete(a));if(N!==a){if(N=S(r,N,{vocab:!0,base:!1},n,c,l),!h(N)&&!k.isKeyword(N))throw new i("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:n});if(a.match(/(?::[^:])|\//)&&S(r,a,{vocab:!0,base:!1},n,new Map(c).set(a,!0),l)!==N)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:n});b["@id"]=N,b._prefix=y&&!b._termHasColon&&N.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in b))if(b._termHasColon){var T=a.substr(0,w);if(n.hasOwnProperty(T)&&k.createTermDefinition({activeCtx:r,localCtx:n,term:T,defined:c,options:l}),r.mappings.has(T)){var A=a.substr(w+1);b["@id"]=r.mappings.get(T)["@id"]+A}else b["@id"]=a}else if("@type"===a)b["@id"]=a;else{if(!("@vocab"in r))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:n,term:a});b["@id"]=r["@vocab"]+a}if((!0===t["@protected"]||!0===c.get("@protected")&&!1!==t["@protected"])&&(r.protected[a]=!0,b.protected=!0),c.set(a,!0),"@type"in t){var R=t["@type"];if(!u(R))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:n});if("@json"===R||"@none"===R){if(k.processingMode(r,1))throw new i('Invalid JSON-LD syntax; an @context @type value must not be "'.concat(R,'" in JSON-LD 1.0 mode.'),"jsonld.SyntaxError",{code:"invalid type mapping",context:n})}else if("@id"!==R&&"@vocab"!==R){if(R=S(r,R,{vocab:!0,base:!1},n,c,l),!h(R))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:n});if(0===R.indexOf("_:"))throw new i("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:n})}b["@type"]=R}if("@container"in t){var O=u(t["@container"])?[t["@container"]]:t["@container"]||[],L=["@list","@set","@index","@language"],M=!0,D=O.includes("@set");if(k.processingMode(r,1.1)){if(L.push("@graph","@id","@type"),O.includes("@list")){if(1!==O.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:n})}else if(O.includes("@graph")){if(O.some(function(e){return"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e}))throw new i("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:n})}else M&=O.length<=(D?2:1);if(O.includes("@type")&&(b["@type"]=b["@type"]||"@id",!["@id","@vocab"].includes(b["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:n})}else M&=!o(t["@container"]),M&=O.length<=1;if(M&=O.every(function(e){return L.includes(e)}),!(M&=!(D&&O.includes("@list"))))throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+L.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:n});if(b.reverse&&!O.every(function(e){return["@index","@set"].includes(e)}))throw new i("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:n});b["@container"]=O}if("@index"in t){if(!("@container"in t)||!b["@container"].includes("@index"))throw new i('Invalid JSON-LD syntax; @index without @index in @container: "'.concat(t["@index"],'" on term "').concat(a,'".'),"jsonld.SyntaxError",{code:"invalid term definition",context:n});if(!u(t["@index"])||0===t["@index"].indexOf("@"))throw new i('Invalid JSON-LD syntax; @index must expand to an IRI: "'.concat(t["@index"],'" on term "').concat(a,'".'),"jsonld.SyntaxError",{code:"invalid term definition",context:n});b["@index"]=t["@index"]}if("@context"in t&&(b["@context"]=t["@context"]),"@language"in t&&!("@type"in t)){var C=t["@language"];if(null!==C&&!u(C))throw new i("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:n});null!==C&&(C=C.toLowerCase()),b["@language"]=C}if("@prefix"in t){if(a.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:n});if(k.isKeyword(b["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:n});if("boolean"!=typeof t["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:n});b._prefix=!0===t["@prefix"]}if("@direction"in t){var P=t["@direction"];if(null!==P&&"ltr"!==P&&"rtl"!==P)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:n});b["@direction"]=P}if("@nest"in t){var F=t["@nest"];if(!u(F)||"@nest"!==F&&0===F.indexOf("@"))throw new i("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:n});b["@nest"]=F}var B=b["@id"];if("@context"===B||"@preserve"===B)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:n});if(g&&g.protected&&!d&&(r.protected[a]=!0,b.protected=!0,!E(g,b))){var U=l&&l.protectedMode||"error";if("error"===U)throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:n,term:a});if("warn"===U)return void console.warn("WARNING: protected term redefinition",{term:a});throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:n,term:a,protectedMode:U})}},k.expandIri=function(e,t,r,n){return S(e,t,r,void 0,void 0,n)},k.getInitialContext=function(e){var t=JSON.stringify({processingMode:e.processingMode}),r=_.get(t);if(r)return r;var i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){if(this.inverse)return this.inverse;var e,t=this.inverse={},r=this.fastCurieMap={},n={},i=(this["@language"]||"@none").toLowerCase(),s=this["@direction"],u=this.mappings,c=w(g(u.keys()).sort(m));try{for(c.s();!(e=c.n()).done;){var l=e.value,f=u.get(l);if(null!==f){var h=f["@container"]||"@none";if(h=[].concat(h).sort().join(""),null!==f["@id"]){var d,p=w(y(f["@id"]));try{for(p.s();!(d=p.n()).done;){var v=d.value,b=t[v],_=k.isKeyword(v);if(b)_||f._termHasColon||n[v].push(l);else if(t[v]=b={},!_&&!f._termHasColon){n[v]=[l];var x={iri:v,terms:n[v]};v[0]in r?r[v[0]].push(x):r[v[0]]=[x]}if(b[h]||(b[h]={"@language":{},"@type":{},"@any":{}}),o(l,(b=b[h])["@any"],"@none"),f.reverse)o(l,b["@type"],"@reverse");else if("@none"===f["@type"])o(l,b["@any"],"@none"),o(l,b["@language"],"@none"),o(l,b["@type"],"@none");else if("@type"in f)o(l,b["@type"],f["@type"]);else if("@language"in f&&"@direction"in f){var S=f["@language"],E=f["@direction"];o(l,b["@language"],S&&E?"".concat(S,"_").concat(E).toLowerCase():S?S.toLowerCase():E?"_".concat(E):"@null")}else"@language"in f?o(l,b["@language"],(f["@language"]||"@null").toLowerCase()):"@direction"in f?o(l,b["@language"],f["@direction"]?"_".concat(f["@direction"]):"@none"):s?(o(l,b["@language"],"_".concat(s)),o(l,b["@language"],"@none"),o(l,b["@type"],"@none")):(o(l,b["@language"],i),o(l,b["@language"],"@none"),o(l,b["@type"],"@none"))}}catch(I){p.e(I)}finally{p.f()}}}}}catch(I){c.e(I)}finally{c.f()}for(var j in r)a(r,j,1);return t},clone:function(){var e={};return e.mappings=n.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=n.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===_.size&&_.clear(),_.set(t,i),i;function a(e,t,r){var n,i,o,s=e[t],u=e[t]={},c=w(s);try{for(c.s();!(o=c.n()).done;){var l=o.value;(i=r>=(n=l.iri).length?"":n[r])in u?u[i].push(l):u[i]=[l]}}catch(h){c.e(h)}finally{c.f()}for(var f in u)""!==f&&a(u,f,r+1)}function o(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},k.getContextValue=function(e,t,r){if(null===t){if("@context"===r)return;return null}if(e.mappings.has(t)){var n=e.mappings.get(t);if(c(r))return n;if(n.hasOwnProperty(r))return n[r]}return"@language"===r&&r in e||"@direction"===r&&r in e?e[r]:"@context"!==r?null:void 0},k.processingMode=function(e,t){return t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode},k.isKeyword=function(e){if(!u(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},{"./JsonLdError":22,"./types":41,"./url":42,"./util":43}],31:[function(e,t,r){"use strict";var n=e("../util"),i=n.parseLinkHeader,a=n.buildHeaders,o=e("../constants").LINK_HEADER_CONTEXT,s=e("../JsonLdError"),u=e("../RequestQueue"),c=e("../url").prependBase;t.exports=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{strictSSL:!0,maxRedirects:-1,headers:{}},r=t.secure,n=t.strictSSL,l=void 0===n||n,h=t.maxRedirects,d=void 0===h?-1:h,p=t.request,v=t.headers,g=void 0===v?{}:v;g=a(g),p=p||e("request");var y=e("http");return(new u).wrapLoader(function(e){return b(e,[])});function b(e,t){return m.apply(this,arguments)}function m(){return(m=f(regeneratorRuntime.mark(function e(t,n){var a,u,f,h,v,m,_,w;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0===t.indexOf("http:")||0===t.indexOf("https:")){e.next=2;break}throw new s('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:t});case 2:if(!r||0===t.indexOf("https")){e.next=4;break}throw new s('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:t});case 4:if(null===(u=null)){e.next=7;break}return e.abrupt("return",u);case 7:return f=null,e.prev=8,e.next=11,function(e,t){return new Promise(function(r,n){e(t,function(e,t,i){e?n(e):r({res:t,body:i})})})}(p,{url:t,headers:g,strictSSL:l,followRedirect:!1});case 11:a=e.sent,e.next=17;break;case 14:throw e.prev=14,e.t0=e.catch(8),new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:t,cause:e.t0});case 17:if(v=(h=a).res,m=h.body,u={contextUrl:null,documentUrl:t,document:m||null},!(v.statusCode>=400)){e.next=20;break}throw new s('URL "'.concat(t,'" could not be dereferenced: ').concat(y.STATUS_CODES[v.statusCode]),"jsonld.InvalidUrl",{code:"loading document failed",url:t,httpStatusCode:v.statusCode});case 20:if(!v.headers.link||"application/ld+json"===v.headers["content-type"]){e.next=25;break}if(_=i(v.headers.link),w=_[o],!Array.isArray(w)){e.next=24;break}throw new s("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:t});case 24:w&&(u.contextUrl=w.target),(f=_.alternate)&&"application/ld+json"==f.type&&!(v.headers["content-type"]||"").match(/^application\/(\w*\+)?json$/)&&(v.headers.location=c(t,f.target));case 25:if(!(f||v.statusCode>=300&&v.statusCode<400)||!v.headers.location){e.next=31;break}if(n.length!==d){e.next=28;break}throw new s("URL could not be dereferenced; there were too many redirects.","jsonld.TooManyRedirects",{code:"loading document failed",url:t,httpStatusCode:v.statusCode,redirects:n});case 28:if(-1===n.indexOf(t)){e.next=30;break}throw new s("URL could not be dereferenced; infinite redirection was detected.","jsonld.InfiniteRedirectDetected",{code:"recursive context inclusion",url:t,httpStatusCode:v.statusCode,redirects:n});case 30:return e.abrupt("return",(n.push(t),b(v.headers.location,n)));case 31:return e.abrupt("return",(n.push(t),u));case 32:case"end":return e.stop()}},e,null,[[8,14]])}))).apply(this,arguments)}}},{"../JsonLdError":22,"../RequestQueue":26,"../constants":29,"../url":42,"../util":43,http:11,request:11}],32:[function(e,t,r){"use strict";var n=e("../util"),i=n.parseLinkHeader,a=n.buildHeaders,o=e("../constants").LINK_HEADER_CONTEXT,s=e("../JsonLdError"),u=e("../RequestQueue"),c=e("../url").prependBase,l=/(^|(\r\n))link:/i;t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{headers:{}},t=e.secure,r=e.headers,n=void 0===r?{}:r,h=e.xhr;return n=a(n),(new u).wrapLoader(function(){var e=f(regeneratorRuntime.mark(function e(a){var u,f,d,p,v,g,y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0===a.indexOf("http:")||0===a.indexOf("https:")){e.next=2;break}throw new s('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:a});case 2:if(!t||0===a.indexOf("https")){e.next=4;break}throw new s('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:a});case 4:return e.prev=4,e.next=7,function(e,t,r){var n=new(e=e||XMLHttpRequest);return new Promise(function(e,i){for(var a in n.onload=function(){return e(n)},n.onerror=function(e){return i(e)},n.open("GET",t,!0),r)n.setRequestHeader(a,r[a]);n.send()})}(h,a,n);case 7:u=e.sent,e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(4),new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:a,cause:e.t0});case 13:if(!(u.status>=400)){e.next=15;break}throw new s("URL could not be dereferenced: "+u.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:a,httpStatusCode:u.status});case 15:if(f={contextUrl:null,documentUrl:a,document:u.response},d=null,p=u.getResponseHeader("Content-Type"),l.test(u.getAllResponseHeaders())&&(v=u.getResponseHeader("Link")),!v||"application/ld+json"===p){e.next=28;break}if(g=i(v),y=g[o],!Array.isArray(y)){e.next=21;break}throw new s("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:a});case 21:if(y&&(f.contextUrl=y.target),d=g.alternate,e.t1=d&&"application/ld+json"==d.type&&!(p||"").match(/^application\/(\w*\+)?json$/),!e.t1){e.next=28;break}return e.next=27,r(c(a,d.target));case 27:f=e.sent;case 28:return e.abrupt("return",f);case 29:case"end":return e.stop()}},e,null,[[4,10]])}));function r(t){return e.apply(this,arguments)}return r}())}},{"../JsonLdError":22,"../RequestQueue":26,"../constants":29,"../url":42,"../util":43}],33:[function(e,t,r){"use strict";var n=e("./JsonLdError"),i=e("./types"),a=i.isArray,o=i.isObject,s=i.isEmptyObject,u=i.isString,c=i.isUndefined,l=e("./graphTypes"),h=l.isList,d=l.isValue,p=l.isGraph,v=l.isSubject,g=e("./context"),y=g.expandIri,m=g.getContextValue,_=g.isKeyword,x=g.process,k=g.processingMode,S=e("./url").isAbsolute,E=e("./util"),j=E.addValue,I=E.asArray,N=E.getValues,T=E.validateTypeValue,A={};t.exports=A;var R=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;function O(e){return L.apply(this,arguments)}function L(){return(L=f(regeneratorRuntime.mark(function e(t){var r,i,l,f,p,g,E,N,L,M,P,F,B,U,G,z,V,q,K,W,H,J,X,Q,Y,Z,$,ee,te,re,ne,ie,ae,oe,se,ue,ce,le,fe,he,de,pe,ve,ge,ye,be,me,_e,we,xe,ke,Se,Ee;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=t.activeCtx,i=t.activeProperty,l=t.expandedActiveProperty,f=t.element,p=t.expandedParent,g=t.options,E=void 0===g?{}:g,N=t.insideList,L=t.typeKey,M=t.typeScopedContext,P=t.expansionMap,F=Object.keys(f).sort(),B=[],G=f[L]&&"@json"===y(r,a(f[L])?f[L][0]:f[L],{vocab:!0},E),z=w(F),e.prev=4,z.s();case 6:if((V=z.n()).done){e.next=188;break}if(q=V.value,K=void 0,W=f[q],"@context"!==q){e.next=11;break}return e.abrupt("continue",186);case 11:if(null!==(H=y(r,q,{vocab:!0},E))&&(S(H)||_(H))||void 0!==(H=P({unmappedProperty:q,activeCtx:r,activeProperty:i,parent:f,options:E,insideList:N,value:W,expandedParent:p}))){e.next=14;break}return e.abrupt("continue",186);case 14:if(!_(H)){e.next=19;break}if("@reverse"!==l){e.next=17;break}throw new n("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:W});case 17:if(!(H in p)||"@included"===H||"@type"===H){e.next=19;break}throw new n("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:H});case 19:if("@id"!==H){e.next=34;break}if(u(W)){e.next=32;break}if(E.isFrame){e.next=23;break}throw new n('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:W});case 23:if(!o(W)){e.next=28;break}if(s(W)){e.next=26;break}throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:W});case 26:e.next=32;break;case 28:if(a(W)){e.next=30;break}throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:W});case 30:if(W.every(function(e){return u(e)})){e.next=32;break}throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:W});case 32:return j(p,"@id",I(W).map(function(e){return u(e)?y(r,e,{base:!0},E):e}),{propertyIsArray:E.isFrame}),e.abrupt("continue",186);case 34:if("@type"!==H){e.next=37;break}return o(W)&&(W=Object.fromEntries(Object.entries(W).map(function(e){var t=b(e,2),r=t[0],n=t[1];return[y(M,r,{vocab:!0}),I(n).map(function(e){return y(M,e,{base:!0,vocab:!0})})]}))),T(W,E.isFrame),j(p,"@type",I(W).map(function(e){return u(e)?y(M,e,{base:!0,vocab:!0},E):e}),{propertyIsArray:E.isFrame}),e.abrupt("continue",186);case 37:if("@included"!==H||!k(r,1.1)){e.next=47;break}return e.t0=I,e.next=41,A.expand({activeCtx:r,activeProperty:i,element:W,options:E,expansionMap:P});case 41:if(e.t1=e.sent,(J=(0,e.t0)(e.t1)).every(function(e){return v(e)})){e.next=45;break}throw new n("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:W});case 45:return j(p,"@included",J,{propertyIsArray:!0}),e.abrupt("continue",186);case 47:if("@graph"!==H||o(W)||a(W)){e.next=49;break}throw new n('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:W});case 49:if("@value"!==H){e.next=52;break}return U=W,G&&k(r,1.1)?p["@value"]=W:j(p,"@value",W,{propertyIsArray:E.isFrame}),e.abrupt("continue",186);case 52:if("@language"!==H){e.next=62;break}if(null!==W){e.next=55;break}return e.abrupt("continue",186);case 55:if(u(W)||E.isFrame){e.next=57;break}throw new n('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:W});case 57:W=I(W).map(function(e){return u(e)?e.toLowerCase():e}),X=w(W);try{for(X.s();!(Q=X.n()).done;)Y=Q.value,u(Y)&&!Y.match(R)&&console.warn("@language must be valid BCP47: ".concat(Y))}catch(je){X.e(je)}finally{X.f()}return j(p,"@language",W,{propertyIsArray:E.isFrame}),e.abrupt("continue",186);case 62:if("@direction"!==H){e.next=85;break}if(u(W)||E.isFrame){e.next=65;break}throw new n('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:W});case 65:W=I(W),Z=w(W),e.prev=67,Z.s();case 69:if(($=Z.n()).done){e.next=75;break}if(ee=$.value,!u(ee)||"ltr"===ee||"rtl"===ee){e.next=73;break}throw new n('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:W});case 73:e.next=69;break;case 75:e.next=80;break;case 77:e.prev=77,e.t2=e.catch(67),Z.e(e.t2);case 80:return e.prev=80,Z.f(),e.finish(80);case 83:return j(p,"@direction",W,{propertyIsArray:E.isFrame}),e.abrupt("continue",186);case 85:if("@index"!==H){e.next=90;break}if(u(W)){e.next=88;break}throw new n('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:W});case 88:return j(p,"@index",W),e.abrupt("continue",186);case 90:if("@reverse"!==H){e.next=118;break}if(o(W)){e.next=93;break}throw new n('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:W});case 93:return e.next=95,A.expand({activeCtx:r,activeProperty:"@reverse",element:W,options:E,expansionMap:P});case 95:if(!("@reverse"in(K=e.sent))){e.next=98;break}for(te in K["@reverse"])j(p,te,K["@reverse"][te],{propertyIsArray:!0});case 98:re=p["@reverse"]||null,e.t3=regeneratorRuntime.keys(K);case 100:if((e.t4=e.t3()).done){e.next=117;break}if("@reverse"!==(ne=e.t4.value)){e.next=104;break}return e.abrupt("continue",100);case 104:null===re&&(re=p["@reverse"]={}),j(re,ne,[],{propertyIsArray:!0}),ie=K[ne],ae=0;case 107:if(!(ae1?Q.slice().sort():Q:[Q],Z=w(Y),e.prev=81,Z.s();case 83:if(($=Z.n()).done){e.next=93;break}if(ee=$.value,te=m(E,ee,"@context"),e.t5=c(te),e.t5){e.next=91;break}return e.next=90,x({activeCtx:r,localCtx:te,options:d,propagate:!1});case 90:r=e.sent;case 91:e.next=83;break;case 93:e.next=98;break;case 95:e.prev=95,e.t6=e.catch(81),Z.e(e.t6);case 98:return e.prev=98,Z.f(),e.finish(98);case 101:e.next=75;break;case 103:e.next=108;break;case 105:e.prev=105,e.t7=e.catch(73),H.e(e.t7);case 108:return e.prev=108,H.f(),e.finish(108);case 111:return re={},e.next=114,O({activeCtx:r,activeProperty:l,expandedActiveProperty:F,element:f,expandedParent:re,options:d,insideList:v,typeKey:W,typeScopedContext:E,expansionMap:T});case 114:if(U=Object.keys(re),ne=U.length,!("@value"in re)){e.next=140;break}if(!("@type"in re)||!("@language"in re)&&!("@direction"in re)){e.next=119;break}throw new n('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:re});case 119:if(ie=ne-1,"@type"in re&&(ie-=1),"@index"in re&&(ie-=1),"@language"in re&&(ie-=1),"@direction"in re&&(ie-=1),0===ie){e.next=122;break}throw new n('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:re});case 122:if(ae=null===re["@value"]?[]:I(re["@value"]),oe=N(re,"@type"),!k(r,1.1)||!oe.includes("@json")||1!==oe.length){e.next=127;break}e.next=138;break;case 127:if(0!==ae.length){e.next=134;break}return e.next=130,T({unmappedValue:re,activeCtx:r,activeProperty:l,element:f,options:d,insideList:v});case 130:se=e.sent,re=void 0!==se?se:null,e.next=138;break;case 134:if(ae.every(function(e){return u(e)||s(e)})||!("@language"in re)){e.next=136;break}throw new n("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:re});case 136:if(oe.every(function(e){return S(e)&&!(u(e)&&0===e.indexOf("_:"))||s(e)})){e.next=138;break}throw new n('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:re});case 138:e.next=155;break;case 140:if(!("@type"in re)||a(re["@type"])){e.next=144;break}re["@type"]=[re["@type"]],e.next=155;break;case 144:if(!("@set"in re)&&!("@list"in re)){e.next=150;break}if(!(ne>1)||2===ne&&"@index"in re){e.next=147;break}throw new n('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:re});case 147:"@set"in re&&(re=re["@set"],U=Object.keys(re),ne=U.length),e.next=155;break;case 150:if(1!==ne||!("@language"in re)){e.next=155;break}return e.next=153,T(re,{unmappedValue:re,activeCtx:r,activeProperty:l,element:f,options:d,insideList:v});case 153:ue=e.sent,re=void 0!==ue?ue:null;case 155:if(!o(re)||d.keepFreeFloatingNodes||v||null!==l&&"@graph"!==F||!(0===ne||"@value"in re||"@list"in re||1===ne&&"@id"in re)){e.next=160;break}return e.next=158,T({unmappedValue:re,activeCtx:r,activeProperty:l,element:f,options:d,insideList:v});case 158:ce=e.sent,re=void 0!==ce?ce:null;case 160:return e.abrupt("return",re);case 161:case"end":return e.stop()}},e,null,[[38,53,56,59],[73,105,108,111],[81,95,98,101]])}));return function(t){return e.apply(this,arguments)}}()},{"./JsonLdError":22,"./context":30,"./graphTypes":37,"./types":41,"./url":42,"./util":43}],34:[function(e,t,r){"use strict";var n=e("./graphTypes").isSubjectReference,i=e("./nodeMap").createMergedNodeMap,a={};t.exports=a,a.flatten=function(e){for(var t=i(e),r=[],a=Object.keys(t).sort(),o=0;o=0;--n){var i=r[n];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function y(e,t,r){var n="@"+r,i=n in e?e[n][0]:t[r];if("embed"===r)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function b(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new c("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0]){var t,r=w(s.asArray(e[0]["@id"]));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(!o.isObject(n)&&!u.isAbsolute(n)||o.isString(n)&&0===n.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}catch(f){r.e(f)}finally{r.f()}}if("@type"in e[0]){var i,a=w(s.asArray(e[0]["@type"]));try{for(a.s();!(i=a.n()).done;){var l=i.value;if(!o.isObject(l)&&!u.isAbsolute(l)||o.isString(l)&&0===l.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}}catch(f){a.e(f)}finally{a.f()}}}function m(e,t,r,n){var u=!0,c=!1;for(var l in r){var f=!1,h=s.getValues(t,l),d=0===s.getValues(r,l).length;if("@id"===l){if(o.isEmptyObject(r["@id"][0]||{})?f=!0:r["@id"].length>=0&&(f=r["@id"].includes(h[0])),!n.requireAll)return f}else if("@type"===l){if(u=!1,d){if(h.length>0)return!1;f=!0}else if(1===r["@type"].length&&o.isEmptyObject(r["@type"][0]))f=h.length>0;else{var p,v=w(r["@type"]);try{var g=function(){var e=p.value;f=!(!o.isObject(e)||!("@default"in e))||f||h.some(function(t){return t===e})};for(v.s();!(p=v.n()).done;)g()}catch(m){v.e(m)}finally{v.f()}}if(!n.requireAll)return f}else{if(i(l))continue;var y=function(){var t=s.getValues(r,l)[0],i=!1;if(t&&(b([t]),i="@default"in t),u=!1,0===h.length&&i)return"continue";if(h.length>0&&d)return{v:!1};if(void 0===t){if(h.length>0)return{v:!1};f=!0}else if(a.isList(t)){var c=t["@list"][0];if(a.isList(h[0])){var p=h[0]["@list"];a.isValue(c)?f=p.some(function(e){return E(c,e)}):(a.isSubject(c)||a.isSubjectReference(c))&&(f=p.some(function(t){return S(e,c,t,n)}))}}else f=a.isValue(t)?h.some(function(e){return E(t,e)}):a.isSubjectReference(t)?h.some(function(r){return S(e,t,r,n)}):!!o.isObject(t)&&h.length>0}();if("continue"===y)continue;if("object"==typeof y)return y.v}if(!f&&n.requireAll)return!1;c=c||f}return u||c}function _(e,t){var r=e.uniqueEmbeds[e.graph],n=r[t],i=n.parent,a=n.property,u={"@id":t};if(o.isArray(i)){for(var c=0;c4&&void 0!==arguments[4]?arguments[4]:null;b(n);var f=e.options,h={embed:y(n=n[0],f,"embed"),explicit:y(n,f,"explicit"),requireAll:y(n,f,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});var x,S=e.link[e.graph],j=function(e,t,r,n){var i,a={},o=w(t);try{for(o.s();!(i=o.n()).done;){var s=i.value,u=e.graphMap[e.graph][s];m(e,u,r,n)&&(a[s]=u)}}catch(c){o.e(c)}finally{o.f()}return a}(e,t,n,h),I=Object.keys(j).sort(),N=w(I);try{var T=function(){var b=x.value,m=j[b];if(null===l?e.uniqueEmbeds=v({},e.graph,{}):e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===h.embed&&b in S)return k(u,l,S[b]),"continue";var I={"@id":b};if(0===b.indexOf("_:")&&s.addValue(e.bnodeMap,b,I,{propertyIsArray:!0}),S[b]=I,("@first"===h.embed||"@last"===h.embed)&&e.is11)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(b))if(!e.embedded||"@never"!==h.embed&&!g(m,e.graph,e.subjectStack))if(!e.embedded||"@first"!=h.embed&&"@once"!=h.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(b)){if("@last"===h.embed&&b in e.uniqueEmbeds[e.graph]&&_(e,b),e.uniqueEmbeds[e.graph][b]={parent:u,property:l},e.subjectStack.push({subject:m,graph:e.graph}),b in e.graphMap){var N=!1,T=null;"@graph"in n?(T=n["@graph"][0],N=!("@merged"===b||"@default"===b),o.isObject(T)||(T={})):(N="@merged"!==e.graph,T={}),N&&d.frame(r(r({},e),{},{graph:b,embedded:!1}),Object.keys(e.graphMap[b]).sort(),[T],I,"@graph")}"@included"in n&&d.frame(r(r({},e),{},{embedded:!1}),t,n["@included"],I,"@included");var A,R=w(Object.keys(m).sort());try{for(R.s();!(A=R.n()).done;){var O=A.value;if(i(O)){if(I[O]=s.clone(m[O]),"@type"===O){var L,M=w(m["@type"]);try{for(M.s();!(L=M.n()).done;){var D=L.value;0===D.indexOf("_:")&&s.addValue(e.bnodeMap,D,I,{propertyIsArray:!0})}}catch(ne){M.e(ne)}finally{M.f()}}}else if(!h.explicit||O in n){var C,P=w(m[O]);try{for(P.s();!(C=P.n()).done;){var F=C.value,B=O in n?n[O]:p(h);if(a.isList(F)){var U=n[O]&&n[O][0]&&n[O][0]["@list"]?n[O][0]["@list"]:p(h),G={"@list":[]};k(I,O,G);var z,V=w(F["@list"]);try{for(V.s();!(z=V.n()).done;){var q=z.value;a.isSubjectReference(q)?d.frame(r(r({},e),{},{embedded:!0}),[q["@id"]],U,G,"@list"):k(G,"@list",s.clone(q))}}catch(ne){V.e(ne)}finally{V.f()}}else a.isSubjectReference(F)?d.frame(r(r({},e),{},{embedded:!0}),[F["@id"]],B,I,O):E(B[0],F)&&k(I,O,s.clone(F))}}catch(ne){P.e(ne)}finally{P.f()}}}}catch(ne){R.e(ne)}finally{R.f()}var K,W=w(Object.keys(n).sort());try{for(W.s();!(K=W.n()).done;){var H=K.value;if("@type"===H){if(!o.isObject(n[H][0])||!("@default"in n[H][0]))continue}else if(i(H))continue;var J=n[H][0]||{};if(!y(J,f,"omitDefault")&&!(H in I)){var X="@null";"@default"in J&&(X=s.clone(J["@default"])),o.isArray(X)||(X=[X]),I[H]=[{"@preserve":X}]}}}catch(ne){W.e(ne)}finally{W.f()}var Q,Y=w(Object.keys(n["@reverse"]||{}).sort());try{for(Y.s();!(Q=Y.n()).done;)for(var Z=Q.value,$=n["@reverse"][Z],ee=0,te=Object.keys(e.subjects);ee0&&(i["@language"]=c,c.match(_)||console.warn("@language must be valid BCP47: ".concat(c))),i["@direction"]=l}else o!==m&&(i["@type"]=o)}return i}t.exports=x,x.fromRDF=function(){var e=f(regeneratorRuntime.mark(function e(t,r){var n,s,f,p,v,g,y,b,m,_,x,S,E,j,I,N,T,A,R,O,L,M,D,C,P,F,B,U,G,z,V,q,K,W,H,J,X,Q,Y,Z,$,ee,te,re,ne,ie,ae,oe,se;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=r.useRdfType,s=void 0!==n&&n,f=r.useNativeTypes,p=void 0!==f&&f,v=r.rdfDirection,g=void 0===v?null:v,b={"@default":y={}},m={},_=w(t),e.prev=3,_.s();case 5:if((x=_.n()).done){e.next=19;break}if(S=x.value,(E="DefaultGraph"===S.graph.termType?"@default":S.graph.value)in b||(b[E]={}),"@default"===E||E in y||(y[E]={"@id":E}),j=b[E],I=S.subject.value,N=S.predicate.value,T=S.object,I in j||(j[I]={"@id":I}),A=j[I],(R=T.termType.endsWith("Node"))&&!(T.value in j)&&(j[T.value]={"@id":T.value}),N!==d||s||!R){e.next=15;break}return o.addValue(A,"@type",T.value,{propertyIsArray:!0}),e.abrupt("continue",17);case 15:O=k(T,p,g),o.addValue(A,N,O,{propertyIsArray:!0}),R&&(T.value===h?("usages"in(L=j[T.value])||(L.usages=[]),L.usages.push({node:A,property:N,value:O})):m[T.value]=!(T.value in m)&&{node:A,property:N,value:O});case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(3),_.e(e.t0);case 24:return e.prev=24,_.f(),e.finish(24);case 27:e.t1=regeneratorRuntime.keys(b);case 28:if((e.t2=e.t1()).done){e.next=37;break}if(M=e.t2.value,D=b[M],h in D){e.next=33;break}return e.abrupt("continue",28);case 33:if((C=D[h]).usages){P=w(C.usages);try{for(P.s();!(F=P.n()).done;){for(B=F.value,U=B.node,G=B.property,z=B.value,V=[],q=[],K=Object.keys(U).length;G===l&&a.isObject(m[U["@id"]])&&a.isArray(U[c])&&1===U[c].length&&a.isArray(U[l])&&1===U[l].length&&(3===K||4===K&&a.isArray(U["@type"])&&1===U["@type"].length&&U["@type"][0]===u)&&(V.push(U[c][0]),q.push(U["@id"]),B=m[U["@id"]],U=B.node,G=B.property,z=B.value,K=Object.keys(U).length,i.isBlankNode(U)););for(delete z["@id"],z["@list"]=V.reverse(),W=0,H=q;W1||!("@id"in e))},i.isSubjectReference=function(e){return n.isObject(e)&&1===Object.keys(e).length&&"@id"in e},i.isValue=function(e){return n.isObject(e)&&"@value"in e},i.isList=function(e){return n.isObject(e)&&"@list"in e},i.isGraph=function(e){return n.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(function(e){return"@id"!==e&&"@index"!==e}).length},i.isSimpleGraph=function(e){return i.isGraph(e)&&!("@id"in e)},i.isBlankNode=function(e){return!!n.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))}},{"./types":41}],38:[function(t,n,i){(function(i,a){var o=t("rdf-canonize"),s=t("./util"),u=t("./ContextResolver"),c=s.IdentifierIssuer,l=t("./JsonLdError"),h=t("lru-cache"),d=t("./NQuads"),p=t("./Rdfa"),v=t("./expand").expand,g=t("./flatten").flatten,y=t("./fromRdf").fromRDF,b=t("./toRdf").toRDF,m=t("./frame"),_=m.frameMergedOrDefault,w=m.cleanupNull,x=t("./types"),k=x.isArray,S=x.isObject,E=x.isString,j=t("./graphTypes").isSubjectReference,I=t("./context"),N=I.expandIri,T=I.getInitialContext,A=I.process,R=I.processingMode,O=t("./compact"),L=O.compact,M=O.compactIri,D=t("./nodeMap"),C=D.createNodeMap,P=D.createMergedNodeMap,F=D.mergeNodeMaps,B=void 0!==i&&i.versions&&i.versions.node,U=!B&&("undefined"!=typeof window||"undefined"!=typeof self),G=function(n){var i={},m=new h({max:100});function x(t,r){var i=r.documentLoader,a=void 0===i?n.documentLoader:i,o=e(r,["documentLoader"]);return Object.assign({},{documentLoader:a},o,t)}return n.compact=function(){var e=f(regeneratorRuntime.mark(function e(t,r,i){var a,o,f,h,d,p,v,g,y,b,_=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(_.length<2)){e.next=2;break}throw new TypeError("Could not compact, too few arguments.");case 2:if(null!==r){e.next=4;break}throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});case 4:if(null!==t){e.next=6;break}return e.abrupt("return",null);case 6:if((i=x(i,{base:E(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new c("_:b"),contextResolver:new u({sharedCache:m})})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,!i.skipExpansion){e.next=12;break}e.t0=t,e.next=15;break;case 12:return e.next=14,n.expand(t,i);case 14:e.t0=e.sent;case 15:return a=e.t0,e.next=18,n.processContext(T(i),r,i);case 18:return o=e.sent,e.next=21,L({activeCtx:o,element:a,options:i,compactionMap:i.compactionMap});case 21:f=e.sent,i.compactArrays&&!i.graph&&k(f)?1===f.length?f=f[0]:0===f.length&&(f={}):i.graph&&S(f)&&(f=[f]),S(r)&&"@context"in r&&(r=r["@context"]),r=s.clone(r),k(r)||(r=[r]),h=r,r=[];for(d=0;d0)&&r.push(h[d]);if(p=r.length>0,1===r.length&&(r=r[0]),k(f))v=M({activeCtx:o,iri:"@graph",relativeTo:{vocab:!0}}),g=f,f={},p&&(f["@context"]=r),f[v]=g;else if(S(f)&&p)for(b in y=f,f={"@context":r},y)f[b]=y[b];return e.abrupt("return",f);case 29:case"end":return e.stop()}},e)}));return function(t,r,n){return e.apply(this,arguments)}}(),n.expand=function(){var e=f(regeneratorRuntime.mark(function e(t,r){var i,a,o,c,l,f,h,d,p,g,y=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(y.length<1)){e.next=2;break}throw new TypeError("Could not expand, too few arguments.");case 2:if(!1===(r=x(r,{keepFreeFloatingNodes:!1,contextResolver:new u({sharedCache:m})})).expansionMap&&(r.expansionMap=void 0),i={},a=[],"expandContext"in r&&(o=s.clone(r.expandContext),i.expandContext=S(o)&&"@context"in o?o:{"@context":o},a.push(i.expandContext)),!E(t)){e.next=12;break}return e.next=8,n.get(t,r);case 8:l=e.sent,c=l.documentUrl,i.input=l.document,l.contextUrl&&(i.remoteContext={"@context":l.contextUrl},a.push(i.remoteContext)),e.next=13;break;case 12:i.input=s.clone(t);case 13:"base"in r||(r.base=c||""),f=T(r),h=0,d=a;case 16:if(!(h=1e21)},n.isEmptyObject=function(e){return n.isObject(e)&&0===Object.keys(e).length},n.isNumber=function(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)},n.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},n.isObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},n.isString=function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},n.isUndefined=function(e){return void 0===e}},{}],42:[function(e,t,r){"use strict";var n=e("./types"),i={};t.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=function(e,t){for(var r={},n=i.parsers[t||"full"],a=n.regex.exec(e),o=n.keys.length;o--;)r[n.keys[o]]=void 0===a[o]?null:a[o];return("https"===r.scheme&&"443"===r.port||"http"===r.scheme&&"80"===r.port)&&(r.href=r.href.replace(":"+r.port,""),r.authority=r.authority.replace(":"+r.port,""),r.port=null),r.normalizedPath=i.removeDotSegments(r.path),r},i.prependBase=function(e,t){if(null===e)return t;if(i.isAbsolute(t))return t;e&&!n.isString(e)||(e=i.parse(e||""));var r=i.parse(t),a={protocol:e.protocol||""};if(null!==r.authority)a.authority=r.authority,a.path=r.path,a.query=r.query;else if(a.authority=e.authority,""===r.path)a.path=e.path,a.query=null!==r.query?r.query:e.query;else{if(0===r.path.indexOf("/"))a.path=r.path;else{var o=e.path;((o=o.substr(0,o.lastIndexOf("/")+1)).length>0||e.authority)&&"/"!==o.substr(-1)&&(o+="/"),o+=r.path,a.path=o}a.query=r.query}""!==r.path&&(a.path=i.removeDotSegments(a.path));var s=a.protocol;return null!==a.authority&&(s+="//"+a.authority),s+=a.path,null!==a.query&&(s+="?"+a.query),null!==r.fragment&&(s+="#"+r.fragment),""===s&&(s="./"),s},i.removeBase=function(e,t){if(null===e)return t;e&&!n.isString(e)||(e=i.parse(e||""));var r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;for(var a=i.parse(t.substr(r.length)),o=e.normalizedPath.split("/"),s=a.normalizedPath.split("/"),u=a.fragment||a.query?0:1;o.length>0&&s.length>u&&o[0]===s[0];)o.shift(),s.shift();var c="";if(o.length>0){o.pop();for(var l=0;l0;){var n=t.shift(),i=0===t.length;"."!==n?".."!==n?r.push(n):(r.pop(),i&&r.push("")):i&&r.push("")}return"/"===e[0]&&r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};var a=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=function(e){return n.isString(e)&&a.test(e)},i.isRelative=function(e){return n.isString(e)}},{"./types":41}],43:[function(e,t,r){"use strict";var n=e("./graphTypes"),i=e("./types"),a=e("rdf-canonize").IdentifierIssuer,o=e("./JsonLdError"),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,u=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l="application/ld+json, application/json",f={};function h(e,t){if(i.isArray(t))for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if(Object.keys(e).some(function(e){return"accept"===e.toLowerCase()}))throw new RangeError('Accept header may not be specified; only "'+l+'" is supported.');return Object.assign({Accept:l},e)},f.parseLinkHeader=function(e){for(var t={},r=e.match(s),n=0;n0}return!1},f.hasValue=function(e,t,r){if(f.hasProperty(e,t)){var a=e[t],o=n.isList(a);if(i.isArray(a)||o){o&&(a=a["@list"]);for(var s=0;st.maxAge:e[u]&&r>e[u]},y=function(e){if(e[a]>e[i])for(var t=e[f].tail;e[a]>e[i]&&null!==t;){var r=t.prev;b(e,t),t=r}},b=function(e,t){if(t){var r=t.value;e[c]&&e[c](r.key,r.value),e[a]-=r.length,e[h].delete(r.key),e[f].removeNode(t)}},m=function e(t,r,n,i,a){S(this,e),this.key=t,this.value=r,this.length=n,this.now=i,this.maxAge=a||0},_=function(e,t,r,n){var i=r.value;g(e,i)&&(b(e,r),e[s]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};t.exports=function(){function e(t){if(S(this,e),"number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[i]=t.max||1/0;var r=t.length||p;if(this[o]="function"!=typeof r?p:r,this[s]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[u]=t.maxAge||0,this[c]=t.dispose,this[l]=t.noDisposeOnSet||!1,this[d]=t.updateAgeOnGet||!1,this.reset()}return j(e,[{key:"rforEach",value:function(e,t){t=t||this;for(var r=this[f].tail;null!==r;){var n=r.prev;_(this,e,r,t),r=n}}},{key:"forEach",value:function(e,t){t=t||this;for(var r=this[f].head;null!==r;){var n=r.next;_(this,e,r,t),r=n}}},{key:"keys",value:function(){return this[f].toArray().map(function(e){return e.key})}},{key:"values",value:function(){return this[f].toArray().map(function(e){return e.value})}},{key:"reset",value:function(){var e=this;this[c]&&this[f]&&this[f].length&&this[f].forEach(function(t){return e[c](t.key,t.value)}),this[h]=new Map,this[f]=new n,this[a]=0}},{key:"dump",value:function(){var e=this;return this[f].map(function(t){return!g(e,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}}).toArray().filter(function(e){return e})}},{key:"dumpLru",value:function(){return this[f]}},{key:"set",value:function(e,t,r){if((r=r||this[u])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");var n=r?Date.now():0,s=this[o](t,e);if(this[h].has(e)){if(s>this[i])return b(this,this[h].get(e)),!1;var d=this[h].get(e).value;return this[c]&&(this[l]||this[c](e,d.value)),d.now=n,d.maxAge=r,d.value=t,this[a]+=s-d.length,d.length=s,this.get(e),y(this),!0}var p=new m(e,t,s,n,r);return p.length>this[i]?(this[c]&&this[c](e,t),!1):(this[a]+=p.length,this[f].unshift(p),this[h].set(e,this[f].head),y(this),!0)}},{key:"has",value:function(e){if(!this[h].has(e))return!1;var t=this[h].get(e).value;return!g(this,t)}},{key:"get",value:function(e){return v(this,e,!0)}},{key:"peek",value:function(e){return v(this,e,!1)}},{key:"pop",value:function(){var e=this[f].tail;return e?(b(this,e),e.value):null}},{key:"del",value:function(e){b(this,this[h].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),r=e.length-1;r>=0;r--){var n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{var a=i-t;a>0&&this.set(n.k,n.v,a)}}}},{key:"prune",value:function(){var e=this;this[h].forEach(function(t,r){return v(e,r,!1)})}},{key:"max",set:function(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,y(this)},get:function(){return this[i]}},{key:"allowStale",set:function(e){this[s]=!!e},get:function(){return this[s]}},{key:"maxAge",set:function(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,y(this)},get:function(){return this[u]}},{key:"lengthCalculator",set:function(e){var t=this;"function"!=typeof e&&(e=p),e!==this[o]&&(this[o]=e,this[a]=0,this[f].forEach(function(e){e.length=t[o](e.value,e.key),t[a]+=e.length})),y(this)},get:function(){return this[o]}},{key:"length",get:function(){return this[a]}},{key:"itemCount",get:function(){return this[f].length}}]),e}()},{yallist:116}],45:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",a="http://www.w3.org/2000/10/swap/";r.default={xsd:{decimal:i+"decimal",boolean:i+"boolean",double:i+"double",integer:i+"integer",string:i+"string"},rdf:{type:n+"type",nil:n+"nil",first:n+"first",rest:n+"rest",langString:n+"langString"},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:a+"reify#forSome",forAll:a+"reify#forAll"},log:{implies:a+"log#implies"}}},{}],46:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.termFromId=function e(t,r){if(r=r||y,!t)return r.defaultGraph();switch(t[0]){case"?":return r.variable(t.substr(1));case"_":return r.blankNode(t.substr(2));case'"':if(r===y)return new _(t);if('"'===t[t.length-1])return r.literal(t.substr(1,t.length-2));var n=t.lastIndexOf('"',t.length-1);return r.literal(t.substr(1,n-1),"@"===t[n+1]?t.substr(n+2):r.namedNode(t.substr(n+3)));case"<":var i=g.exec(t);return r.quad(e(N(i[1]),r),e(N(i[2]),r),e(N(i[3]),r),i[4]&&e(N(i[4]),r));default:return r.namedNode(t)}},r.termToId=function e(t){if("string"==typeof t)return t;if(t instanceof b&&"Quad"!==t.termType)return t.id;if(!t)return u.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return"_:"+t.value;case"Variable":return"?"+t.value;case"DefaultGraph":return"";case"Literal":return'"'+t.value+'"'+(t.language?"@"+t.language:t.datatype&&t.datatype.value!==d.string?"^^"+t.datatype.value:"");case"Quad":return"<<".concat(I(e(t.subject))," ").concat(I(e(t.predicate))," ").concat(I(e(t.object))).concat((0,l.isDefaultGraph)(t.graph)?"":" ".concat(e(t.graph)),">>");default:throw new Error("Unexpected termType: "+t.termType)}},r.escapeQuotes=I,r.unescapeQuotes=N,r.Triple=r.Quad=r.DefaultGraph=r.Variable=r.BlankNode=r.Literal=r.NamedNode=r.Term=r.default=void 0;var n,u,c=(n=e("./IRIs"))&&n.__esModule?n:{default:n},l=e("./N3Util"),f=c.default,h=f.rdf,d=f.xsd,p=0,v=/^"(.*".*)(?="[^"]*$)/,g=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,y={namedNode:function(e){return new m(e)},blankNode:function(e){return new w(e||"n3-"+p++)},variable:function(e){return new x(e)},literal:function(e,t){if("string"==typeof t)return new _('"'+e+'"@'+t.toLowerCase());var r=t?t.value:"";return""===r&&("boolean"==typeof e?r=d.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?d.integer:d.double:(r=d.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new _(""===r||r===d.string?'"'+e+'"':'"'+e+'"^^'+r)},defaultGraph:function(){return u},quad:T,triple:T};r.default=y;var b=function(){function e(t){S(this,e),this.id=t}return j(e,[{key:"equals",value:function(t){return t instanceof e?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}},{key:"toJSON",value:function(){return{termType:this.termType,value:this.value}}},{key:"value",get:function(){return this.id}}]),e}();r.Term=b;var m=function(e){i(r,e);var t=a(r);function r(){return S(this,r),t.apply(this,arguments)}return j(r,[{key:"termType",get:function(){return"NamedNode"}}]),r}(b);r.NamedNode=m;var _=function(e){i(r,e);var t=a(r);function r(){return S(this,r),t.apply(this,arguments)}return j(r,[{key:"equals",value:function(e){return e instanceof r?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}},{key:"toJSON",value:function(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},{key:"termType",get:function(){return"Literal"}},{key:"value",get:function(){return this.id.substring(1,this.id.lastIndexOf('"'))}},{key:"language",get:function(){var e=this.id,t=e.lastIndexOf('"')+1;return t\\"\{\}\|\^\`]/,l={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},f=/$0^/;r.default=function(){function e(t){if(S(this,e),this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s()\[\]\{\}"'<])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,this._lineMode=!!(t=t||{}).lineMode)for(var r in this._n3Mode=!1,this)!(r in l)&&this[r]instanceof RegExp&&(this[r]=f);else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}return j(e,[{key:"_tokenizeToEnd",value:function(e,t){for(var r,n=this._input,i=this._comments;;){for(var a,s;a=this._newline.exec(n);)i&&(s=this._comment.exec(a[0]))&&e(null,{line:this._line,type:"comment",value:s[1],prefix:""}),n=n.substr(a[0].length,n.length),this._line++;if(!a&&(a=this._whitespace.exec(n))&&(n=n.substr(a[0].length,n.length)),this._endOfFile.test(n))return t&&(i&&(s=this._comment.exec(n))&&e(null,{line:this._line,type:"comment",value:s[1],prefix:""}),e(n=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=n;var u=this._line,l="",f="",h="",d=n[0],p=null,v=0,g=!1;switch(d){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(v=1,l="^");break}if(this._previousMarker="^^","<"!==(n=n.substr(2))[0]){g=!0;break}case"<":if(p=this._unescapedIri.exec(n))l="IRI",f=p[1];else if(p=this._iri.exec(n)){if(null===(f=this._unescape(p[1]))||c.test(f))return m(this);l="IRI"}else n.length>1&&"<"===n[1]?(l="<<",v=2):this._n3Mode&&n.length>1&&"="===n[1]&&(l="inverse",v=2,f=">");break;case">":n.length>1&&">"===n[1]&&(l=">>",v=2);break;case"_":((p=this._blank.exec(n))||t&&(p=this._blank.exec(n+" ")))&&(l="blank",h="_",f=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(n))f=p[1];else if(f=(r=this._parseLiteral(n)).value,v=r.matchLength,null===f)return m(this);null===p&&0===v||(l="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){var y;if(p=this._simpleApostropheString.exec(n))f=p[1];else if(f=(y=this._parseLiteral(n)).value,v=y.matchLength,null===f)return m(this);null===p&&0===v||(l="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(n))&&(l="var",f=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(n))?(l="langcode",f=p[1]):(p=this._keyword.exec(n))&&(l=p[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){l=".",v=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(n)||t&&(p=this._number.exec(n+" ")))&&(l="literal",f=p[0],h="string"==typeof p[1]?o.double:"string"==typeof p[2]?o.decimal:o.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(n))?l=p[0].toUpperCase():g=!0;break;case"f":case"t":(p=this._boolean.exec(n))?(l="literal",f=p[0],h=o.boolean):g=!0;break;case"a":(p=this._shortPredicates.exec(n))?(l="abbreviation",f="a"):g=!0;break;case"=":this._n3Mode&&n.length>1&&(l="abbreviation",">"!==n[1]?(v=1,f="="):(v=2,f=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(v=1,l=d);break;default:g=!0}if(g&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(n))?((p=this._prefixed.exec(n))||t&&(p=this._prefixed.exec(n+" ")))&&(l="prefixed",h=p[1]||"",f=this._unescape(p[2])):(l="prefix",f=p[1]||"")),"^^"===this._previousMarker)switch(l){case"prefixed":l="type";break;case"IRI":l="typeIRI";break;default:l=""}if(!l)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?m(this):this._input=n;var b={line:u,type:l,value:f,prefix:h};e(null,b),this.previousToken=b,this._previousMarker=l,n=n.substr(v||p[0].length,n.length)}function m(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}},{key:"_unescape",value:function(e){var t=!1,r=e.replace(s,function(e,r,n,i){if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){var a=Number.parseInt(n,16);return a<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((a-=65536)>>10),56320+(1023&a))}return i in u?u[i]:(t=!0,"")});return t?null:r}},{key:"_parseLiteral",value:function(e){if(e.length>=3){for(var t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length,n=Math.max(this._literalClosingPos,r);(n=e.indexOf(t,n))>0;){for(var i=0;"\\"===e[n-i-1];)i++;if(i%2==0){var a=e.substring(r,n),o=a.split(/\r\n|\r|\n/).length-1,s=n+r;if(1===r&&0!==o||3===r&&this._lineMode)break;return this._line+=o,{value:this._unescape(a),matchLength:s}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}},{key:"_syntaxError",value:function(e){this._input=null;var t=new Error('Unexpected "'+e+'" on line '+this._line+".");return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}},{key:"tokenize",value:function(e,r){var n=this;if(this._line=1,"string"==typeof e){if(this._input=e,"function"!=typeof r){var a,o=[];if(this._tokenizeToEnd(function(e,t){e?a=e:o.push(t)},!0),a)throw a;return o}(0,i.default)(function(){return n._tokenizeToEnd(r,!0)})}else this._input="",this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",function(e){null!==n._input&&0!==e.length&&(n._pendingBuffer&&(e=t.concat([n._pendingBuffer,e]),n._pendingBuffer=null),128&e[e.length-1]?n._pendingBuffer=e:(n._input+=e,n._tokenizeToEnd(r,!1)))}),e.on("end",function(){null!==n._input&&n._tokenizeToEnd(r,!0)}),e.on("error",r)}}]),e}()}).call(this,e("buffer").Buffer)},{"./IRIs":45,buffer:12,"queue-microtask":63}],48:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("./N3Lexer")),i=o(e("./N3DataFactory")),a=o(e("./IRIs"));function o(e){return e&&e.__esModule?e:{default:e}}var s=0,u=function(){function e(t){S(this,e),this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&l(this,t.factory);var r="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",i=/turtle/.test(r),a=/trig/.test(r),o=/triple/.test(r),s=/quad/.test(r),u=this._n3Mode=/n3/.test(r),c=o||s;(this._supportsNamedGraphs=!(i||u))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(i||a||o||u),this._supportsRDFStar=""===r||/star|\*$/.test(r),c&&(this._resolveRelativeIRI=function(e){return null}),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new n.default({lineMode:c,n3:u}),this._explicitQuantifiers=!!t.explicitQuantifiers}return j(e,[{key:"_setBase",value:function(e){if(e){var t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}},{key:"_saveContext",value:function(e,t,r,n,i){var a=this._n3Mode;this._contextStack.push({subject:r,predicate:n,object:i,graph:t,type:e,inverse:!!a&&this._inversePredicate,blankPrefix:a?this._prefixes._:"",quantified:a?this._quantified:null}),a&&(this._inversePredicate=!1,this._prefixes._=this._graph?this._graph.id.substr(2)+".":".",this._quantified=Object.create(this._quantified))}},{key:"_restoreContext",value:function(){var e=this._contextStack.pop(),t=this._n3Mode;this._subject=e.subject,this._predicate=e.predicate,this._object=e.object,this._graph=e.graph,t&&(this._inversePredicate=e.inverse,this._prefixes._=e.blankPrefix,this._quantified=e.quantified)}},{key:"_readInTopContext",value:function(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}},{key:"_readEntity",value:function(e,t){var r;switch(e.type){case"IRI":case"typeIRI":var n=this._resolveIRI(e.value);if(null===n)return this._error("Invalid IRI",e);r=this._namedNode(n);break;case"type":case"prefixed":var i=this._prefixes[e.prefix];if(void 0===i)return this._error('Undefined prefix "'+e.prefix+':"',e);r=this._namedNode(i+e.value);break;case"blank":r=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._variable(e.value.substr(1));break;default:return this._error("Expected entity but got "+e.type,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}},{key:"_readSubject",value:function(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}},{key:"_readPredicate",value:function(e){var t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error("Unexpected "+t,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}},{key:"_readObject",value:function(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}},{key:"_readPredicateOrNamedGraph",value:function(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}},{key:"_readGraph",value:function(e){return"{"!==e.type?this._error("Expected graph but got "+e.type,e):(this._graph=this._subject,this._subject=null,this._readSubject)}},{key:"_readBlankNodeHead",value:function(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}},{key:"_readBlankNodeTail",value:function(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);var t=null===this._predicate;return this._restoreContext(),null===this._object?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._getContextEndReader()}},{key:"_readPredicateAfterBlank",value:function(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}},{key:"_readListItem",value:function(e){var t=null,r=null,n=this._subject,i=this._contextStack,a=i[i.length-1],o=this._readListItem;switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),o=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==i.length&&"list"===i[i.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(o=this._readPredicate,this._subject===this.RDF_NIL)return o}else if(o=this._getContextEndReader(),this._object===this.RDF_NIL)return o;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,o=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),o=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===r&&(this._subject=r=this._blankNode()),null===n?null===a.predicate?a.subject=r:a.object=r:this._emit(n,this.RDF_REST,r,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return o}},{key:"_readDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!1)}},{key:"_readListItemDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!0)}},{key:"_completeLiteral",value:function(e){var t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":var r=this._readEntity(e);if(void 0===r)return;t=this._literal(this._literalValue,r),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}},{key:"_completeSubjectLiteral",value:function(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}},{key:"_completeObjectLiteral",value:function(e,t){var r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===r.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}},{key:"_readFormulaTail",value:function(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}},{key:"_readPunctuation",value:function(e){var t,r=this._subject,n=this._graph,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error('Expected punctuation to follow "'+this._object.id+'"',e)}if(null!==r){var a=this._predicate,o=this._object;i?this._emit(o,a,r,n):this._emit(r,a,o,n)}return t}},{key:"_readBlankNodePunctuation",value:function(e){var t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error('Expected punctuation to follow "'+this._object.id+'"',e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}},{key:"_readQuadPunctuation",value:function(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}},{key:"_readPrefix",value:function(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}},{key:"_readPrefixIRI",value:function(e){if("IRI"!==e.type)return this._error('Expected IRI to follow prefix "'+this._prefix+':"',e);var t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}},{key:"_readBaseIRI",value:function(e){var t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}},{key:"_readNamedGraphLabel",value:function(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}},{key:"_readNamedGraphBlankLabel",value:function(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}},{key:"_readDeclarationPunctuation",value:function(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}},{key:"_readQuantifierList",value:function(e){var t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error("Unexpected "+e.type,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}},{key:"_readQuantifierPunctuation",value:function(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}},{key:"_getPathReader",value:function(e){return this._afterPath=e,this._readPath}},{key:"_readPath",value:function(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:var t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){var n=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,n,this._graph)}return this._afterPath(e)}}},{key:"_readForwardPath",value:function(e){var t,r,n=this._blankNode();if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}},{key:"_readBackwardPath",value:function(e){var t,r,n=this._blankNode();if(void 0!==(t=this._readEntity(e)))return null===this._predicate?(r=this._subject,this._subject=n):(r=this._object,this._object=n),this._emit(n,t,r,this._graph),this._readPath}},{key:"_readRDFStarTailOrGraph",value:function(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error('Expected >> to follow "'+this._object.id+'"',e):this._readRDFStarTail(e)}},{key:"_readRDFStarTail",value:function(e){if(">>"!==e.type)return this._error("Expected >> but got ".concat(e.type),e);var t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}},{key:"_getContextEndReader",value:function(){var e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}},{key:"_emit",value:function(e,t,r,n){this._callback(null,this._quad(e,t,r,n||this.DEFAULTGRAPH))}},{key:"_error",value:function(e,t){var r=new Error(e+" on line "+t.line+".");r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=c}},{key:"_resolveIRI",value:function(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}},{key:"_resolveRelativeIRI",value:function(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}},{key:"_removeDotSegments",value:function(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;for(var t="",r=e.length,n=-1,i=-1,a=0,o="/";n=i&&(t=t.substr(0,a)),"/"!==o)return t+"/"+e.substr(n+1);a=n+1}}}o=e[++n]}return t+e.substring(a)}},{key:"parse",value:function(e,t,r){var n=this;if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):"b"+s+++"_",this._prefixCallback=r||c,this._inversePredicate=!1,this._quantified=Object.create(null),!t){var i,a=[];if(this._callback=function(e,t){e?i=e:t&&a.push(t)},this._lexer.tokenize(e).every(function(e){return n._readCallback=n._readCallback(e)}),i)throw i;return a}this._callback=t,this._lexer.tokenize(e,function(e,t){null!==e?(n._callback(e),n._callback=c):n._readCallback&&(n._readCallback=n._readCallback(t))})}}],[{key:"_resetBlankNodePrefix",value:function(){s=0}}]),e}();function c(){}function l(e,t){var r=t.namedNode;e._namedNode=r,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=r(a.default.rdf.first),e.RDF_REST=r(a.default.rdf.rest),e.RDF_NIL=r(a.default.rdf.nil),e.N3_FORALL=r(a.default.r.forAll),e.N3_FORSOME=r(a.default.r.forSome),e.ABBREVIATIONS={a:r(a.default.rdf.type),"=":r(a.default.owl.sameAs),">":r(a.default.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}r.default=u,l(u.prototype,i.default)},{"./IRIs":45,"./N3DataFactory":46,"./N3Lexer":47}],49:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}(e("./N3DataFactory")),a=e("stream"),o=(n=e("./IRIs"))&&n.__esModule?n:{default:n};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){return"string"==typeof e||e instanceof String}r.default=function(){function e(t,r){S(this,e),this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,r||!t||t[0]||(r=t,t=null),this._factory=(r=r||{}).factory||i.default,t&&this.addQuads(t)}return j(e,[{key:"_addToIndex",value:function(e,t,r,n){var i=e[t]||(e[t]={}),a=i[r]||(i[r]={}),o=n in a;return o||(a[n]=null),!o}},{key:"_removeFromIndex",value:function(e,t,r,n){var i,a=e[t],o=a[r];for(i in delete o[n],o)return;for(i in delete a[r],a)return;delete e[t]}},{key:"_findInIndex",value:function(e,t,r,n,a,o,s,u,c,l){var f,h,d,p=!t+!r+!n>1?Object.keys(this._ids):this._entities;for(var v in t&&((f=e,e={})[t]=f[t]),e){var g=p[v];if(h=e[v])for(var y in r&&((f=h,h={})[r]=f[r]),h){var b=p[y];if(d=h[y])for(var m=(n?n in d?[n]:[]:Object.keys(d)),_=0;_0&&void 0!==arguments[0]?arguments[0]:{},r=t.remove,n=void 0!==r&&r,i=t.ignoreErrors,a=void 0!==i&&i,s={},u=a?function(){return!0}:function(e,t){throw new Error("".concat(e.value," ").concat(t))},c=this.getQuads(null,o.default.rdf.rest,o.default.rdf.nil,null),l=n?g(c):[];return c.forEach(function(t){for(var r,i,a=[],c=!1,f=t.graph,h=t.subject;h&&!c;){var d,p,v=e.getQuads(null,null,h,null),g=e.getQuads(h,null,null,null),y=null,b=null,m=null;for(d=0;d"}},{key:"_encodeLiteral",value:function(e){var t=e.value;return p.test(t)&&(t=t.replace(v,b)),e.language?'"'+t+'"@'+e.language:e.datatype.value!==d.string?'"'+t+'"^^'+this._encodeIriOrBlank(e.datatype):'"'+t+'"'}},{key:"_encodePredicate",value:function(e){return e.value===h.type?"a":this._encodeIriOrBlank(e)}},{key:"_encodeObject",value:function(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}},{key:"_encodeQuad",value:function(e){var t=e.subject,r=e.predicate,n=e.object,i=e.graph;return"<<".concat(this._encodeSubject(t)," ").concat(this._encodePredicate(r)," ").concat(this._encodeObject(n)).concat((0,u.isDefaultGraph)(i)?"":" ".concat(this._encodeIriOrBlank(i)),">>")}},{key:"_blockedWrite",value:function(){throw new Error("Cannot write because the writer has been closed.")}},{key:"addQuad",value:function(e,t,r,n,i){void 0===r?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof n?this._writeQuad(e,t,r,l,n):this._writeQuad(e,t,r,n||l,i)}},{key:"addQuads",value:function(e){for(var t=0;t.\n")}if(n){var o="",s="";for(var u in r)o+=o?"|"+u:u,s+=(s?"|":"")+r[u];o=o.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:"+s+")[^/]*$|^("+o+")([a-zA-Z][\\-_a-zA-Z0-9]*)$")}this._write(n?"\n":"",t)}},{key:"blank",value:function(e,t){var r,n,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),n=i.length){case 0:return new y("[]");case 1:if(!((r=i[0]).object instanceof y))return new y("[ "+this._encodePredicate(r.predicate)+" "+this._encodeObject(r.object)+" ]");default:for(var a="[",o=0;o0;)s.push(c%a),c=c/a|0}for(i=0;0===e[i]&&i=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r0;)a.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r=0;--r)u+=t[a[r]];return u}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},r.decode=function(t,r){if("string"!=typeof t)throw new TypeError('"input" must be a string.');if("string"!=typeof r)throw new TypeError('"alphabet" must be a string.');var i=n[r];if(!i){i=n[r]=[];for(var a=0;a>=8;for(;f>0;)u.push(255&f),f>>=8}for(var h=0;t[h]===s&&h>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(a),s(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o,u=n.util.createBuffer();u.putBytes(t.bytes()),u.putBytes(a.substr(0,i.blockLength-(i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1)));for(var c=8*i.fullMessageLength[0],l=0;l>>0)>>>0),c=o>>>0;u.putInt32(c);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(f,r,u);var h=n.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h},i};var a=null,o=!1;function s(e,t,r){for(var n,i,a,o,s,u,c,l=r.length();l>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)t[c]=n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)t[c]=n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)t[c]=n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)t[c]=n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,n=(i<<5|i>>>27)+(a&o|s&(a^o))+u+2400959708+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)t[c]=n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,n=(i<<5|i>>>27)+(a^o^s)+u+3395469782+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},{"./forge":56,"./md":57,"./util":60}],59:[function(e,t,r){var n=e("./forge");e("./md"),e("./util");var i=t.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o,s=n.util.createBuffer();s.putBytes(t.bytes()),s.putBytes(a.substr(0,i.blockLength-(i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1)));for(var c=8*i.fullMessageLength[0],l=0;l>>0)>>>0),c=o>>>0;s.putInt32(c);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(f,r,s);var h=n.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h.putInt32(f.h5),h.putInt32(f.h6),h.putInt32(f.h7),h},i};var a=null,o=!1,s=null;function u(e,t,r){for(var n,i,a,o,u,c,l,f,h,d,p,v,g=r.length();g>=64;){for(o=0;o<16;++o)t[o]=r.getInt32();for(;o<64;++o)t[o]=(n=((n=t[o-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10)+t[o-7]+(i=((i=t[o-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)+t[o-16]|0;for(u=e.h0,c=e.h1,l=e.h2,f=e.h3,h=e.h4,d=e.h5,p=e.h6,v=e.h7,o=0;o<64;++o)a=u&c|l&(u^c),n=v+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(p^h&(d^p))+s[o]+t[o],v=p,p=d,d=h,h=f+n>>>0,f=l,l=c,c=u,u=n+(i=((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+a)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+c|0,e.h2=e.h2+l|0,e.h3=e.h3+f|0,e.h4=e.h4+h|0,e.h5=e.h5+d|0,e.h6=e.h6+p|0,e.h7=e.h7+v|0,g-=64}}},{"./forge":56,"./md":57,"./util":60}],60:[function(e,t,r){(function(r,n,i,a,o,s,u,c){var l=e("./forge"),f=e("./baseN"),h=t.exports=l.util=l.util||{};function d(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function p(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(h.isArrayBuffer(e)||h.isArrayBufferView(e))if(void 0!==i&&e instanceof i)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(n){for(var r=0;r15?(n=Date.now(),o(e)):(t.push(e),1===t.length&&a.setAttribute("a",i=!i))}}h.nextTick=h.setImmediate}(),h.isNodejs=void 0!==r&&r.versions&&r.versions.node,h.globalScope=h.isNodejs?n:"undefined"==typeof self?window:self,h.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},h.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},h.isArrayBufferView=function(e){return e&&h.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},h.ByteBuffer=p,h.ByteStringBuffer=p,h.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},h.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},h.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},h.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},h.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},h.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},h.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(h.encodeUtf8(e))},h.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},h.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},h.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},h.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},h.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},h.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},h.ByteStringBuffer.prototype.putInt=function(e,t){d(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},h.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},h.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},h.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},h.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},h.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},h.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},h.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},h.ByteStringBuffer.prototype.copy=function(){var e=h.createBuffer(this.data);return e.read=this.read,e},h.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},h.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},h.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},h.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},h.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},h.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},h.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},h.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},h.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},h.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},h.DataBuffer.prototype.putInt=function(e,t){d(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},h.DataBuffer.prototype.putSignedInt=function(e,t){return d(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},h.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},h.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},h.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},h.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},h.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},h.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},h.DataBuffer.prototype.copy=function(){return new h.DataBuffer(this)},h.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},h.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},h.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},h.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},h.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+a},h.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],y="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";h.encode64=function(e,t){for(var r,n,i,a="",o="",s=0;s>2),a+=v.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=v.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":v.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+a},h.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",o=0;o>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},h.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},h.decodeUtf8=function(e){return decodeURIComponent(escape(e))},h.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:f.encode,decode:f.decode}},h.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},h.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a>2),a+=v.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=v.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":v.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+a},h.binary.base64.decode=function(e,t,r){var n,i,a,o,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=r=r||0;u>4,64!==a&&(s[c++]=(15&i)<<4|a>>2,64!==o&&(s[c++]=(3&a)<<6|o));return t?c-r:s.subarray(0,c)},h.binary.base58.encode=function(e,t){return h.binary.baseN.encode(e,y,t)},h.binary.base58.decode=function(e,t){return h.binary.baseN.decode(e,y,t)},h.text={utf8:{},utf16:{}},h.text.utf8.encode=function(e,t,r){e=h.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===E&&(E="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=E):t=r(e),t},h.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:h.getQueryVariables(r)}},h.makeRequest=function(e){var t=h.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},h.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return e+(n.length>0?"?"+n:"")+((r=r||"").length>0?"#"+r:"")},h.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.format=function(e){for(var t,r,n=/%./g,i=0,a=[],o=0;t=n.exec(e);){(r=e.substring(o,n.lastIndex-2)).length>0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":a.push(i");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},h.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")},h.formatSize=function(e){return e>=1073741824?h.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?h.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?h.formatNumber(e/1024,0)+" KiB":h.formatNumber(e,0)+" bytes"},h.bytesFromIP=function(e){return-1!==e.indexOf(".")?h.bytesFromIPv4(e):-1!==e.indexOf(":")?h.bytesFromIPv6(e):null},h.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=h.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:s,end:s})}t.push(a)}if(r.length>0){var u=r[n];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},h.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in h&&!e.update)return t(null,h.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return h.cores=navigator.hardwareConcurrency,t(null,h.cores);if("undefined"==typeof Worker)return h.cores=1,t(null,h.cores);if("undefined"==typeof Blob)return h.cores=2,t(null,h.cores);var r=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(e){for(var t=Date.now(),r=t+4;Date.now()s.st&&i.sti.st&&s.st1)for(var r=1;r0&&void 0!==arguments[0]?arguments[0]:{},r=t.maxCallStackDepth,n=void 0===r?500:r,i=t.maxTotalCallStackDepth,a=void 0===i?4294967295:i,o=t.timeSlice,s=void 0===o?10:o;S(this,e),this.schedule={},this.schedule.MAX_DEPTH=n,this.schedule.MAX_TOTAL_DEPTH=a,this.schedule.depth=0,this.schedule.totalDepth=0,this.schedule.timeSlice=s}return j(e,[{key:"doWork",value:function(e,t){var r=this.schedule;if(r.totalDepth>=r.MAX_TOTAL_DEPTH)return t(new Error("Maximum total call stack depth exceeded; canonicalization aborting."));!function i(){if(r.depth===r.MAX_DEPTH)return r.depth=0,r.running=!1,n.nextTick(i);var a=Date.now();if(r.running||(r.start=Date.now(),r.deadline=r.start+r.timeSlice),a]*)>)|(_:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9])(?:(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040.])*(?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_0-9-\xb7\u0300-\u036f\u203f-\u2040]))?))[ \\t]*\\.))[ \\t]*$'),t.exports=function(){function e(){S(this,e)}return j(e,null,[{key:"parse",value:function(e){var t,r=[],s={},c=0,l=w(e.split(a.eoln));try{for(l.s();!(t=l.n()).done;){var f=t.value;if(c++,!a.empty.test(f)){var h=f.match(a.quad);if(null===h)throw new Error("N-Quads parse error on line "+c+".");var d={};if(d.subject=void 0!==h[1]?{termType:"NamedNode",value:h[1]}:{termType:"BlankNode",value:h[2]},d.predicate={termType:"NamedNode",value:h[3]},void 0!==h[4]?d.object={termType:"NamedNode",value:h[4]}:void 0!==h[5]?d.object={termType:"BlankNode",value:h[5]}:(d.object={termType:"Literal",value:void 0,datatype:{termType:"NamedNode"}},void 0!==h[7]?d.object.datatype.value=h[7]:void 0!==h[8]?(d.object.datatype.value=n,d.object.language=h[8]):d.object.datatype.value=i,d.object.value=h[6].replace(u,function(e,t,r,n){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(r)return String.fromCharCode(parseInt(r,16));if(n)throw new Error("Unsupported U escape")})),d.graph=void 0!==h[9]?{termType:"NamedNode",value:h[9]}:void 0!==h[10]?{termType:"BlankNode",value:h[10]}:{termType:"DefaultGraph",value:""},d.graph.value in s){var p,v=!0,g=s[d.graph.value],y=w(g);try{for(y.s();!(p=y.n()).done;){if(o(p.value,d)){v=!1;break}}}catch(b){y.e(b)}finally{y.f()}v&&(g.push(d),r.push(d))}else s[d.graph.value]=[d],r.push(d)}}}catch(b){l.e(b)}finally{l.f()}return r}},{key:"serialize",value:function(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));var r,n=[],i=w(t);try{for(i.s();!(r=i.n()).done;){var a=r.value;n.push(e.serializeQuad(a))}}catch(o){i.e(o)}finally{i.f()}return n.sort().join("")}},{key:"serializeQuad",value:function(e){var t=e.object,r=e.graph,a="";return[e.subject,e.predicate].forEach(function(e){a+="NamedNode"===e.termType?"<"+e.value+">":e.value,a+=" "}),"NamedNode"===t.termType?a+="<"+t.value+">":"BlankNode"===t.termType?a+=t.value:(a+='"'+t.value.replace(s,function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})+'"',t.datatype.value===n?t.language&&(a+="@"+t.language):t.datatype.value!==i&&(a+="^^<"+t.datatype.value+">")),"NamedNode"===r.termType?a+=" <"+r.value+">":"BlankNode"===r.termType&&(a+=" "+r.value),a+=" .\n"}},{key:"legacyDatasetToQuads",value:function(e){var t=[],r={"blank node":"BlankNode",IRI:"NamedNode",literal:"Literal"},a=function(a){e[a].forEach(function(e){var o={};for(var s in e){var u=e[s],c={termType:r[u.type],value:u.value};"Literal"===c.termType&&(c.datatype={termType:"NamedNode"},"datatype"in u&&(c.datatype.value=u.datatype),"language"in u?("datatype"in u||(c.datatype.value=n),c.language=u.language):"datatype"in u||(c.datatype.value=i)),o[s]=c}o.graph="@default"===a?{termType:"DefaultGraph",value:""}:{termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a},t.push(o)})};for(var o in e)a(o);return t}}]),e}();var s=/["\\\n\r]/g,u=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},{}],68:[function(e,t,r){"use strict";t.exports=function(){function e(t){S(this,e),this.list=t.sort(),this.done=!1,this.left={};for(var r=0;rt)&&(o&&i>0&&a>this.list[i-1]||!o&&ithis.list[i+1])&&(t=a,r=i)}if(null===t)this.done=!0;else{var s=this.left[t]?r-1:r+1;this.list[r]=this.list[s],this.list[s]=t;for(var u=0;ut&&(this.left[this.list[u]]=!this.left[this.list[u]])}return e}}]),e}()},{}],69:[function(e,t,r){"use strict";var n=e("./AsyncAlgorithm"),o=e("./IdentifierIssuer"),s=e("./MessageDigest"),u=e("./Permutator"),c=e("./NQuads"),l=e("./util"),f={subject:"s",object:"o",graph:"g"};t.exports=function(e){i(r,e);var t=a(r);function r(e){var n;return S(this,r),(n=t.call(this,e=e||{})).name="URDNA2015",n.options=Object.assign({},e),n.blankNodeInfo={},n.hashToBlankNodes={},n.canonicalIssuer=new o("_:c14n"),n.hashAlgorithm="sha256",n}return j(r,[{key:"main",value:function(e,t){var r,n=this;n.schedule.start=Date.now(),n.quads=e;var i={};n.waterfall([function(t){n.forEach(e,function(e,t,r){n.forEachComponent(e,function(t){if("BlankNode"===t.termType){var r=t.value;r in n.blankNodeInfo?n.blankNodeInfo[r].quads.push(e):(i[r]=!0,n.blankNodeInfo[r]={quads:[e]})}}),r()},t)},function(e){var t=!0;n.whilst(function(){return t},function(e){t=!1,n.hashToBlankNodes={},n.waterfall([function(e){n.forEach(i,function(e,t,r){n.hashFirstDegreeQuads(t,function(e,i){if(e)return r(e);i in n.hashToBlankNodes?n.hashToBlankNodes[i].push(t):n.hashToBlankNodes[i]=[t],r()})},e)},function(e){var r=Object.keys(n.hashToBlankNodes).sort();n.forEach(r,function(e,r,a){var o=n.hashToBlankNodes[e];if(o.length>1)return a();var s=o[0];n.canonicalIssuer.getId(s),delete i[s],delete n.hashToBlankNodes[e],t=!0,a()},e)}],e)},e)},function(e){var t=Object.keys(n.hashToBlankNodes).sort();n.forEach(t,function(e,t,r){var i=[],a=n.hashToBlankNodes[e];n.waterfall([function(e){n.forEach(a,function(e,t,r){if(n.canonicalIssuer.hasId(e))return r();var a=new o("_:b");a.getId(e),n.hashNDegreeQuads(e,a,function(e,t){if(e)return r(e);i.push(t),r()})},e)},function(e){i.sort(function(e,t){return e.hasht.hash?1:0}),n.forEach(i,function(e,t,r){for(var i in e.issuer.existing)n.canonicalIssuer.getId(i);r()},e)}],r)},e)},function(e){var t=[];n.waterfall([function(e){n.forEach(n.quads,function(e,r,i){n.forEachComponent(e,function(e){"BlankNode"!==e.termType||e.value.startsWith(n.canonicalIssuer.prefix)||(e.value=n.canonicalIssuer.getId(e.value))}),t.push(c.serializeQuad(e)),i()},e)},function(e){return t.sort(),r=t.join(""),e()}],e)}],function(e){return t(e,r)})}},{key:"hashFirstDegreeQuads",value:function(e,t){var r=this,n=r.blankNodeInfo[e];if("hash"in n)return t(null,n.hash);var i=[];r.forEach(n.quads,function(t,n,a){var o={predicate:t.predicate};r.forEachComponent(t,function(t,n){o[n]=r.modifyFirstDegreeComponent(e,t,n)}),i.push(c.serializeQuad(o)),a()},function(e){if(e)return t(e);i.sort();for(var a=new s(r.hashAlgorithm),o=0;oc)return e();s()},t)},function(t){i.forEach(o,function(t,r,o){i.hashNDegreeQuads(t,n,function(r,i){return r?o(r):(a+=n.getId(t),a+="<"+i.hash+">",n=i.issuer,0!==c.length&&a>c?e():void o())})},t)},function(e){(0===c.length||a"}},{key:"createHashToRelated",value:function(e,t,r){var n=this,i={};n.forEach(n.blankNodeInfo[e].quads,function(r,a,o){n.forEach(r,function(a,o,s){if("predicate"===o||"BlankNode"!==a.termType||a.value===e)return s();var u=a.value;n.hashRelatedBlankNode(u,r,t,f[o],function(e,t){if(e)return s(e);t in i?i[t].push(u):i[t]=[u],s()})},o)},function(e){return r(e,i)})}},{key:"forEachComponent",value:function(e,t){for(var r in e)"predicate"!==r&&t(e[r],r,e)}}]),r}(n)},{"./AsyncAlgorithm":64,"./IdentifierIssuer":65,"./MessageDigest":66,"./NQuads":67,"./Permutator":68,"./util":74}],70:[function(e,t,r){"use strict";var n=e("./IdentifierIssuer"),i=e("./MessageDigest"),a=e("./Permutator"),o=e("./NQuads"),s=e("./util"),u={subject:"s",object:"o",graph:"g"};t.exports=function(){function e(){S(this,e),this.name="URDNA2015",this.blankNodeInfo={},this.hashToBlankNodes={},this.canonicalIssuer=new n("_:c14n"),this.hashAlgorithm="sha256"}return j(e,[{key:"main",value:function(e){var t=this;t.quads=e;var r,i={},a=w(e);try{var s=function(){var e=r.value;t.forEachComponent(e,function(r){if("BlankNode"===r.termType){var n=r.value;n in t.blankNodeInfo?t.blankNodeInfo[n].quads.push(e):(i[n]=!0,t.blankNodeInfo[n]={quads:[e]})}})};for(a.s();!(r=a.n()).done;)s()}catch(R){a.e(R)}finally{a.f()}for(var u=!0;u;){for(var c in u=!1,t.hashToBlankNodes={},i){var l=t.hashFirstDegreeQuads(c);l in t.hashToBlankNodes?t.hashToBlankNodes[l].push(c):t.hashToBlankNodes[l]=[c]}for(var f=Object.keys(t.hashToBlankNodes).sort(),h=0;h1)){var v=p[0];t.canonicalIssuer.getId(v),delete i[v],delete t.hashToBlankNodes[d],u=!0}}}for(var g=Object.keys(t.hashToBlankNodes).sort(),y=0;yt.hash?1:0});for(var E=0;Ef){y=!0;break}}if(!y){for(var _=0;_",p=x.issuer,0!==f.length&&v>f){y=!0;break}}y||(0===f.length||v"}},{key:"createHashToRelated",value:function(e,t){for(var r={},n=this.blankNodeInfo[e].quads,i=0;i"));var s={childrenStringTags:t.childrenStringTags};return s.childrenStringEmitClosingTag=""),void this.activeTagStack.push(s)}var u={};t?(u.language=t.language,u.baseIRI=t.baseIRI):u.baseIRI=this.baseIRI,this.activeTagStack.push(u),u.ns=f.parseNamespace(e,t),r===n.RESOURCE?this.onTagResource(e,u,t,!t):this.onTagProperty(e,u,t)}},{key:"onTagResource",value:function(e,t,r,i){var a=f.expandPrefixedTerm(e.name,t.ns,this);t.childrenParseType=n.PROPERTY;var s=!0;if(a.uri===f.RDF){if(!i&&f.FORBIDDEN_NODE_ELEMENTS.indexOf(a.local)>=0)throw this.newParseError("Illegal node element name: ".concat(a.local));switch(a.local){case"RDF":t.childrenParseType=n.RESOURCE;case"Description":s=!1}}var u=[],c=[],l=null,h=!1,d=!1,p=null;for(var v in e.attributes){var g=e.attributes[v],y=f.expandPrefixedTerm(v,t.ns,this);if(r&&y.uri===f.RDF)switch(y.local){case"about":if(l)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(l," where found."));l=g;continue;case"ID":if(l)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(l," where found."));this.validateNcname(g),l="#"+g,h=!0;continue;case"nodeID":if(l)throw this.newParseError("Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ".concat(g," and ").concat(l," where found."));this.validateNcname(g),l=g,d=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":p=g;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(y.uri===f.XML){if("lang"===y.local){t.language=""===g?null:g.toLowerCase();continue}if("base"===y.local){t.baseIRI=o.resolve(g,t.baseIRI);continue}}"xml"!==y.prefix&&y.uri&&(u.push(this.uriToNamedNode(y.uri+y.local)),c.push(g))}if(null!==l&&(t.subject=d?this.dataFactory.blankNode(l):this.valueToUri(l,t),h&&this.claimNodeId(t.subject)),t.subject||(t.subject=this.dataFactory.blankNode()),s){var b=this.uriToNamedNode(a.uri+a.local);this.emitTriple(t.subject,this.dataFactory.namedNode(f.RDF+"type"),b,r?r.reifiedStatementId:null)}if(r){if(r.predicate)if(r.childrenCollectionSubject){var m=this.dataFactory.blankNode();this.emitTriple(r.childrenCollectionSubject,r.childrenCollectionPredicate,m,r.reifiedStatementId),this.emitTriple(m,this.dataFactory.namedNode(f.RDF+"first"),t.subject,t.reifiedStatementId),r.childrenCollectionSubject=m,r.childrenCollectionPredicate=this.dataFactory.namedNode(f.RDF+"rest")}else{this.emitTriple(r.subject,r.predicate,t.subject,r.reifiedStatementId);for(var _=0;_=0)throw this.newParseError("Illegal property element name: ".concat(i.local));t.predicateSubPredicates=[],t.predicateSubObjects=[];var a=!1,o=!1,s=null,u=!0,c=[],l=[];for(var h in e.attributes){var d=e.attributes[h],p=f.expandPrefixedTerm(h,t.ns,this);if(p.uri===f.RDF)switch(p.local){case"resource":if(s)throw this.newParseError("Found both rdf:resource (".concat(d,") and rdf:nodeID (").concat(s,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:resource (".concat(d,")"));t.hadChildren=!0,s=d,u=!1;continue;case"datatype":if(o)throw this.newParseError("Found both non-rdf:* property attributes and rdf:datatype (".concat(d,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(d,")"));t.datatype=this.valueToUri(d,t);continue;case"nodeID":if(o)throw this.newParseError("Found both non-rdf:* property attributes and rdf:nodeID (".concat(d,")."));if(t.hadChildren)throw this.newParseError("Found both rdf:resource and rdf:nodeID (".concat(d,")."));if(a)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID (".concat(d,")"));this.validateNcname(d),t.hadChildren=!0,s=d,u=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(o)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(t.datatype)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:datatype (".concat(t.datatype.value,")"));if(s)throw this.newParseError("rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (".concat(s,")"));if("Resource"===d){a=!0,t.childrenParseType=n.PROPERTY;var v=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,v,t.reifiedStatementId),t.subject=v,t.predicate=null}else"Collection"===d?(a=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,u=!1):"Literal"===d&&(a=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(d),t.reifiedStatementId=this.valueToUri("#"+d,t),this.claimNodeId(t.reifiedStatementId);continue}else if(p.uri===f.XML&&"lang"===p.local){t.language=""===d?null:d.toLowerCase();continue}if("xml"!==p.prefix&&"xmlns"!==p.prefix&&p.uri){if(a||t.datatype)throw this.newParseError("Found illegal rdf:* properties on property element with attribute: ".concat(d));t.hadChildren=!0,o=!0,c.push(this.uriToNamedNode(p.uri+p.local)),l.push(this.dataFactory.literal(d,t.datatype||t.language))}}if(null!==s){var g=t.subject;t.subject=u?this.dataFactory.blankNode(s):this.valueToUri(s,t),this.emitTriple(g,t.predicate,t.subject,t.reifiedStatementId);for(var y=0;y/g,function(e,r,n){return t.saxStream._parser.ENTITIES[r]=n,""})}}],[{key:"parseNamespace",value:function(e,t){var r={},n=!1;for(var i in e.attributes)i.startsWith("xmlns")&&(5===i.length?(n=!0,r[""]=e.attributes[i]):":"===i.charAt(5)&&(n=!0,r[i.substr(6)]=e.attributes[i]));var a=t&&t.ns?t.ns:[f.DEFAULT_NS];return n?a.concat([r]):a}},{key:"expandPrefixedTerm",value:function(e,t,r){var n,i,a=e.indexOf(":");a>=0?(n=e.substr(0,a),i=e.substr(a+1)):(n="",i=e);for(var o=null,s=null,u=t.length-1;u>=0;u--){var c=t[u][n];if(c){o=c;break}s||(s=t[u][""])}if(!o){if(n&&"xmlns"!==n)throw new l.ParseError(r,"The prefix '".concat(n,"' in term '").concat(e,"' was not bound."));o=s||""}return{prefix:n,local:i,uri:o}}},{key:"isValidIri",value:function(e){return f.IRI_REGEX.test(e)}}]),f}(c.Transform);r.RdfXmlParser=f,f.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*):[^ "<>{}|\\\[\]`]*$/,f.MIME_TYPE="application/rdf+xml",f.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",f.XML="http://www.w3.org/XML/1998/namespace",f.XMLNS="http://www.w3.org/2000/xmlns/",f.DEFAULT_NS={xml:f.XML},f.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],f.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],f.NCNAME_MATCHER=/^((?:[A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF]))((?:[#\x2D\.0-9A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF]))*$/,function(e){e[e.RESOURCE=0]="RESOURCE",e[e.PROPERTY=1]="PROPERTY"}(n=r.ParseType||(r.ParseType={}))},{"./ParseError":76,"@rdfjs/data-model":2,"relative-to-absolute-iri":93,sax:96,stream:97}],78:[function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){function r(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return i=e,(n=r).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i,r;var n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function a(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,r){var n,i,o,s;if("string"==typeof t&&"not "===t.substr(0,"not ".length)?(n="must not be",t=t.replace(/^not /,"")):n="must be",o=e,(void 0===s||s>o.length)&&(s=o.length)," argument"===o.substring(s-" argument".length,s))i="The ".concat(e," ").concat(n," ").concat(a(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";i='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(a(t,"type"))}return i+". Received type ".concat(typeof r)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],79:[function(e,t,r){(function(r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var i=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(c,i);for(var o=n(a.prototype),s=0;s0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)s.endEmitted?x(e,new w):I(e,s,t,!0);else if(s.ended)x(e,new m);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?I(e,s,t,!1):R(e,s)):I(e,s,t,!1)}else n||(s.reading=!1,R(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(A,e))}function A(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,C(e)}function R(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(O,e,t))}function O(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function M(e){a("readable nexttick read 0"),e.read(0)}function D(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function F(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(B,t,e))}function B(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return a("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):T(this),null;if(0===(e=N(e,t))&&t.ended)return 0===t.length&&F(this),null;var n,i=t.needReadable;return a("need readable",i),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&F(this)),null!==n&&this.emit("data",n),n},E.prototype._read=function(e){x(this,new _("_read()"))},E.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,a("pipe count=%d opts=%j",i.pipesCount,t);var s=t&&!1===t.end||e===r.stdout||e===r.stderr?v:u;function u(){a("onend"),e.end()}i.endEmitted?r.nextTick(s):n.once("end",s),e.on("unpipe",function t(r,o){a("onunpipe"),r===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,a("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),n.removeListener("end",u),n.removeListener("end",v),n.removeListener("data",f),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,C(e))}}(n);e.on("drain",c);var l=!1;function f(t){a("ondata");var r=e.write(t);a("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!l&&(a("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function h(t){a("onerror",t),v(),e.removeListener("error",h),0===o(e,"error")&&x(e,t)}function d(){e.removeListener("finish",p),v()}function p(){a("onfinish"),e.removeListener("close",d),v()}function v(){a("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener("error",r);e._events&&e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(r):e._events.error=[r,e._events.error]:e.on("error",r)}(e,0,h),e.once("close",d),e.once("finish",p),e.emit("pipe",n),i.flowing||(a("pipe resume"),n.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,a("on readable",i.length,i.reading),i.length?T(this):i.reading||r.nextTick(M,this))),n},E.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(L,this),n},E.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(L,this),t},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(D,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new v("_write()"))},E.prototype._writev=null,E.prototype.end=function(e,t,n){var i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,n){t.ending=!0,R(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,i,n),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=f.destroy,E.prototype._undestroy=f.undestroy,E.prototype._destroy=function(e,t){t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":78,"./_stream_duplex":79,"./internal/streams/destroy":86,"./internal/streams/state":90,"./internal/streams/stream":91,_process:62,buffer:12,inherits:18,"util-deprecate":114}],84:[function(e,t,r){(function(r){"use strict";var n;function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function d(e,t){return{value:e,done:t}}function p(e){var t=e[o];if(null!==t){var r=e[h].read();null!==r&&(e[l]=null,e[o]=null,e[s]=null,t(d(r,!1)))}}function v(e){r.nextTick(p,e)}var g=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(d(void 0,!0));if(this[h].destroyed)return new Promise(function(t,n){r.nextTick(function(){e[u]?n(e[u]):t(d(void 0,!0))})});var n,i=this[l];if(i)n=new Promise(function(e,t){return function(r,n){e.then(function(){t[c]?r(d(void 0,!0)):t[f](r,n)},n)}}(i,this));else{var a=this[h].read();if(null!==a)return Promise.resolve(d(a,!1));n=new Promise(this[f])}return this[l]=n,n}},Symbol.asyncIterator,function(){return this}),i(n,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),n),g);t.exports=function(e){var t,r=Object.create(y,(i(t={},h,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[h].read();n?(r[l]=null,r[o]=null,r[s]=null,e(d(n,!1))):(r[o]=e,r[s]=t)},writable:!0}),t));return r[l]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[l]=null,r[o]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[o];null!==n&&(r[l]=null,r[o]=null,r[s]=null,n(d(void 0,!0))),r[c]=!0}),e.on("readable",v.bind(null,r)),r}}).call(this,e("_process"))},{"./end-of-stream":87,_process:62}],85:[function(e,t,r){"use strict";function n(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 i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("buffer").Buffer,o=e("util").inspect,s=o&&o.custom||"inspect";t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return(t=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t=a.allocUnsafe(e>>>0),r=this.head,n=0;r;)a.prototype.copy.call(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(n+=a===i.length?i:i.slice(0,e),0==(e-=a)){a===i.length?(++r,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,this.head=r.next?r.next:this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return o(this,function(e){for(var t=1;t0,function(e){n||(n=e),e&&o.forEach(c),a||(o.forEach(c),i(n))})});return t.reduce(l)}},{"../../../errors":78,"./end-of-stream":87}],90:[function(e,t,r){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},{"../../../errors":78}],91:[function(e,t,r){t.exports=e("events").EventEmitter},{events:13}],92:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":79,"./lib/_stream_passthrough.js":80,"./lib/_stream_readable.js":81,"./lib/_stream_transform.js":82,"./lib/_stream_writable.js":83,"./lib/internal/streams/end-of-stream.js":87,"./lib/internal/streams/pipeline.js":89}],93:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(e("./lib/Resolve"))},{"./lib/Resolve":94}],94:[function(e,t,r){"use strict";function n(e){for(var t=[],r=0;r=0?"/"===e[t+1]&&"/"===e[t+2]&&(r=t+3):"/"===e[0]&&"/"===e[1]&&(r=2);var i=e.indexOf("/",r);return i<0?e:e.substr(0,i)+n(e.substr(i))}function a(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(r,"__esModule",{value:!0}),r.resolve=function(e,t){var r=(t=t||"").indexOf("#");if(r>0&&(t=t.substr(0,r)),!e.length){if(t.indexOf(":")<0)throw new Error("Found invalid baseIRI '".concat(t,"' for value '").concat(e,"'"));return t}if(e.startsWith("?")){var a=t.indexOf("?");return a>0&&(t=t.substr(0,a)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){var o=e.indexOf(":");if(o<0)throw new Error("Found invalid relative IRI '".concat(e,"' for a missing baseIRI"));return i(e,o)}var s=e.indexOf(":");if(s>=0)return i(e,s);var u=t.indexOf(":");if(u<0)throw new Error("Found invalid baseIRI '".concat(t,"' for value '").concat(e,"'"));var c,l=t.substr(0,u+1);if(0===e.indexOf("//"))return l+i(e,s);if(t.indexOf("//",u)===u+1){if((c=t.indexOf("/",u+3))<0)return t.length>u+3?t+"/"+i(e,s):l+i(e,s)}else if((c=t.indexOf("/",u+1))<0)return l+i(e,s);if(0===e.indexOf("/"))return t.substr(0,c)+n(e);var f=t.substr(c),h=f.lastIndexOf("/");return h>=0&&h"===n?(E(this,"onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=x.TEXT):v(n)?(this.state=x.SGML_DECL_QUOTED,this.sgmlDecl+=n):this.sgmlDecl+=n;continue;case x.SGML_DECL_QUOTED:n===this.q&&(this.state=x.SGML_DECL,this.q=""),this.sgmlDecl+=n;continue;case x.DOCTYPE:">"===n?(this.state=x.TEXT,E(this,"ondoctype",this.doctype),this.doctype=!0):(this.doctype+=n,"["===n?this.state=x.DOCTYPE_DTD:v(n)&&(this.state=x.DOCTYPE_QUOTED,this.q=n));continue;case x.DOCTYPE_QUOTED:this.doctype+=n,n===this.q&&(this.q="",this.state=x.DOCTYPE);continue;case x.DOCTYPE_DTD:this.doctype+=n,"]"===n?this.state=x.DOCTYPE:v(n)&&(this.state=x.DOCTYPE_DTD_QUOTED,this.q=n);continue;case x.DOCTYPE_DTD_QUOTED:this.doctype+=n,n===this.q&&(this.state=x.DOCTYPE_DTD,this.q="");continue;case x.COMMENT:"-"===n?this.state=x.COMMENT_ENDING:this.comment+=n;continue;case x.COMMENT_ENDING:"-"===n?(this.state=x.COMMENT_ENDED,this.comment=I(this.opt,this.comment),this.comment&&E(this,"oncomment",this.comment),this.comment=""):(this.comment+="-"+n,this.state=x.COMMENT);continue;case x.COMMENT_ENDED:">"!==n?(A(this,"Malformed comment"),this.comment+="--"+n,this.state=x.COMMENT):this.state=x.TEXT;continue;case x.CDATA:"]"===n?this.state=x.CDATA_ENDING:this.cdata+=n;continue;case x.CDATA_ENDING:"]"===n?this.state=x.CDATA_ENDING_2:(this.cdata+="]"+n,this.state=x.CDATA);continue;case x.CDATA_ENDING_2:">"===n?(this.cdata&&E(this,"oncdata",this.cdata),E(this,"onclosecdata"),this.cdata="",this.state=x.TEXT):"]"===n?this.cdata+="]":(this.cdata+="]]"+n,this.state=x.CDATA);continue;case x.PROC_INST:"?"===n?this.state=x.PROC_INST_ENDING:p(n)?this.state=x.PROC_INST_BODY:this.procInstName+=n;continue;case x.PROC_INST_BODY:if(!this.procInstBody&&p(n))continue;"?"===n?this.state=x.PROC_INST_ENDING:this.procInstBody+=n;continue;case x.PROC_INST_ENDING:">"===n?(E(this,"onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=x.TEXT):(this.procInstBody+="?"+n,this.state=x.PROC_INST_BODY);continue;case x.OPEN_TAG:y(f,n)?this.tagName+=n:(R(this),">"===n?M(this):"/"===n?this.state=x.OPEN_TAG_SLASH:(p(n)||A(this,"Invalid character in tag name"),this.state=x.ATTRIB));continue;case x.OPEN_TAG_SLASH:">"===n?(M(this,!0),D(this)):(A(this,"Forward-slash in opening tag not followed by >"),this.state=x.ATTRIB);continue;case x.ATTRIB:if(p(n))continue;">"===n?M(this):"/"===n?this.state=x.OPEN_TAG_SLASH:y(l,n)?(this.attribName=n,this.attribValue="",this.state=x.ATTRIB_NAME):A(this,"Invalid attribute name");continue;case x.ATTRIB_NAME:"="===n?this.state=x.ATTRIB_VALUE:">"===n?(A(this,"Attribute without value"),this.attribValue=this.attribName,L(this),M(this)):p(n)?this.state=x.ATTRIB_NAME_SAW_WHITE:y(f,n)?this.attribName+=n:A(this,"Invalid attribute name");continue;case x.ATTRIB_NAME_SAW_WHITE:if("="===n)this.state=x.ATTRIB_VALUE;else{if(p(n))continue;A(this,"Attribute without value"),this.tag.attributes[this.attribName]="",this.attribValue="",E(this,"onattribute",{name:this.attribName,value:""}),this.attribName="",">"===n?M(this):y(l,n)?(this.attribName=n,this.state=x.ATTRIB_NAME):(A(this,"Invalid attribute name"),this.state=x.ATTRIB)}continue;case x.ATTRIB_VALUE:if(p(n))continue;v(n)?(this.q=n,this.state=x.ATTRIB_VALUE_QUOTED):(A(this,"Unquoted attribute value"),this.state=x.ATTRIB_VALUE_UNQUOTED,this.attribValue=n);continue;case x.ATTRIB_VALUE_QUOTED:if(n!==this.q){"&"===n?this.state=x.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=n;continue}L(this),this.q="",this.state=x.ATTRIB_VALUE_CLOSED;continue;case x.ATTRIB_VALUE_CLOSED:p(n)?this.state=x.ATTRIB:">"===n?M(this):"/"===n?this.state=x.OPEN_TAG_SLASH:y(l,n)?(A(this,"No whitespace between attributes"),this.attribName=n,this.attribValue="",this.state=x.ATTRIB_NAME):A(this,"Invalid attribute name");continue;case x.ATTRIB_VALUE_UNQUOTED:if(!g(n)){"&"===n?this.state=x.ATTRIB_VALUE_ENTITY_U:this.attribValue+=n;continue}L(this),">"===n?M(this):this.state=x.ATTRIB;continue;case x.CLOSE_TAG:if(this.tagName)">"===n?D(this):y(f,n)?this.tagName+=n:this.script?(this.script+=""===n?D(this):A(this,"Invalid characters in closing tag");continue;case x.TEXT_ENTITY:case x.ATTRIB_VALUE_ENTITY_Q:case x.ATTRIB_VALUE_ENTITY_U:var o,s;switch(this.state){case x.TEXT_ENTITY:o=x.TEXT,s="textNode";break;case x.ATTRIB_VALUE_ENTITY_Q:o=x.ATTRIB_VALUE_QUOTED,s="attribValue";break;case x.ATTRIB_VALUE_ENTITY_U:o=x.ATTRIB_VALUE_UNQUOTED,s="attribValue"}";"===n?(this[s]+=(c=void 0,m=void 0,void 0,w=void 0,_=(m=(u=this).entity).toLowerCase(),w="",u.ENTITIES[m]?u.ENTITIES[m]:u.ENTITIES[_]?u.ENTITIES[_]:("#"===(m=_).charAt(0)&&("x"===m.charAt(1)?(m=m.slice(2),w=(c=parseInt(m,16)).toString(16)):(m=m.slice(1),w=(c=parseInt(m,10)).toString(10))),m=m.replace(/^0+/,""),isNaN(c)||w.toLowerCase()!==m?(A(u,"Invalid character entity"),"&"+u.entity+";"):String.fromCodePoint(c))),this.entity="",this.state=o):y(this.entity.length?d:h,n)?this.entity+=n:(A(this,"Invalid character in entity name"),this[s]+="&"+this.entity+n,this.entity="",this.state=o);continue;default:throw new Error(this,"Unknown state: "+this.state)}var u,c,m,_,w;return this.position>=this.bufferCheckPosition&&function(e){for(var t=Math.max(r.MAX_BUFFER_LENGTH,10),n=0,a=0,o=i.length;at)switch(i[a]){case"textNode":j(e);break;case"cdata":E(e,"oncdata",e.cdata),e.cdata="";break;case"script":E(e,"onscript",e.script),e.script="";break;default:N(e,"Max buffer length exceeded: "+i[a])}n=Math.max(n,s)}e.bufferCheckPosition=r.MAX_BUFFER_LENGTH-n+e.position}(this),this},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){j(this),""!==this.cdata&&(E(this,"oncdata",this.cdata),this.cdata=""),""!==this.script&&(E(this,"onscript",this.script),this.script="")}};try{n=e("stream").Stream}catch(F){n=function(){}}var o=r.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function s(e,t){if(!(this instanceof s))return new s(e,t);n.apply(this),this._parser=new a(e,t),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(e){r.emit("error",e),r._parser.error=null},this._decoder=null,o.forEach(function(e){Object.defineProperty(r,"on"+e,{get:function(){return r._parser["on"+e]},set:function(t){if(!t)return r.removeAllListeners(e),r._parser["on"+e]=t,t;r.on(e,t)},enumerable:!0,configurable:!1})})}(s.prototype=Object.create(n.prototype,{constructor:{value:s}})).write=function(r){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(r)){if(!this._decoder){var n=e("string_decoder").StringDecoder;this._decoder=new n("utf8")}r=this._decoder.write(r)}return this._parser.write(r.toString()),this.emit("data",r),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,t){var r=this;return r._parser["on"+e]||-1===o.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),n.prototype.on.call(r,e,t)};var u="http://www.w3.org/XML/1998/namespace",c={xml:u,xmlns:"http://www.w3.org/2000/xmlns/"},l=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,h=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function p(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function v(e){return'"'===e||"'"===e}function g(e){return">"===e||p(e)}function y(e,t){return e.test(t)}function b(e,t){return!y(e,t)}var m,_,w,x=0;for(var k in r.STATE={BEGIN:x++,BEGIN_WHITESPACE:x++,TEXT:x++,TEXT_ENTITY:x++,OPEN_WAKA:x++,SGML_DECL:x++,SGML_DECL_QUOTED:x++,DOCTYPE:x++,DOCTYPE_QUOTED:x++,DOCTYPE_DTD:x++,DOCTYPE_DTD_QUOTED:x++,COMMENT_STARTING:x++,COMMENT:x++,COMMENT_ENDING:x++,COMMENT_ENDED:x++,CDATA:x++,CDATA_ENDING:x++,CDATA_ENDING_2:x++,PROC_INST:x++,PROC_INST_BODY:x++,PROC_INST_ENDING:x++,OPEN_TAG:x++,OPEN_TAG_SLASH:x++,ATTRIB:x++,ATTRIB_NAME:x++,ATTRIB_NAME_SAW_WHITE:x++,ATTRIB_VALUE:x++,ATTRIB_VALUE_QUOTED:x++,ATTRIB_VALUE_CLOSED:x++,ATTRIB_VALUE_UNQUOTED:x++,ATTRIB_VALUE_ENTITY_Q:x++,ATTRIB_VALUE_ENTITY_U:x++,CLOSE_TAG:x++,CLOSE_TAG_SAW_WHITE:x++,SCRIPT:x++,SCRIPT_ENDING:x++},r.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},r.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(r.ENTITIES).forEach(function(e){var t=r.ENTITIES[e],n="number"==typeof t?String.fromCharCode(t):t;r.ENTITIES[e]=n}),r.STATE)r.STATE[r.STATE[k]]=k;function S(e,t,r){e[t]&&e[t](r)}function E(e,t,r){e.textNode&&j(e),S(e,t,r)}function j(e){e.textNode=I(e.opt,e.textNode),e.textNode&&S(e,"ontext",e.textNode),e.textNode=""}function I(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function N(e,t){return j(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,S(e,"onerror",t),e}function T(e){return e.sawRoot&&!e.closedRoot&&A(e,"Unclosed root tag"),e.state!==x.BEGIN&&e.state!==x.BEGIN_WHITESPACE&&e.state!==x.TEXT&&N(e,"Unexpected end"),j(e),e.c="",e.closed=!0,S(e,"onend"),a.call(e,e.strict,e.opt),e}function A(e,t){if("object"!=typeof e||!(e instanceof a))throw new Error("bad call to strictFail");e.strict&&N(e,t)}function R(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,r=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(r.ns=t.ns),e.attribList.length=0,E(e,"onopentagstart",r)}function O(e,t){var r=e.indexOf(":")<0?["",e]:e.split(":"),n=r[0],i=r[1];return t&&"xmlns"===e&&(n="xmlns",i=""),{prefix:n,local:i}}function L(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=O(e.attribName,!0),r=t.local;if("xmlns"===t.prefix)if("xml"===r&&e.attribValue!==u)A(e,"xml: prefix must be bound to "+u+"\nActual: "+e.attribValue);else if("xmlns"===r&&"http://www.w3.org/2000/xmlns/"!==e.attribValue)A(e,"xmlns: prefix must be bound to http://www.w3.org/2000/xmlns/\nActual: "+e.attribValue);else{var n=e.tag,i=e.tags[e.tags.length-1]||e;n.ns===i.ns&&(n.ns=Object.create(i.ns)),n.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,E(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function M(e,t){if(e.opt.xmlns){var r=e.tag,n=O(e.tagName);r.prefix=n.prefix,r.local=n.local,r.uri=r.ns[n.prefix]||"",r.prefix&&!r.uri&&(A(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),r.uri=n.prefix),r.ns&&(e.tags[e.tags.length-1]||e).ns!==r.ns&&Object.keys(r.ns).forEach(function(t){E(e,"onopennamespace",{prefix:t,uri:r.ns[t]})});for(var i=0,a=e.attribList.length;i",e.tagName="",void(e.state=x.SCRIPT);E(e,"onscript",e.script),e.script=""}var t=e.tags.length,r=e.tagName;e.strict||(r=r[e.looseCase]());for(var n=r;t--&&e.tags[t].name!==n;)A(e,"Unexpected close tag");if(t<0)return A(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=x.TEXT);e.tagName=r;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,E(e,"onclosetag",e.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];e.opt.xmlns&&a.ns!==(e.tags[e.tags.length-1]||e).ns&&Object.keys(a.ns).forEach(function(t){E(e,"onclosenamespace",{prefix:t,uri:a.ns[t]})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=x.TEXT}function C(e,t){"<"===t?(e.state=x.OPEN_WAKA,e.startTagPosition=e.position):p(t)||(A(e,"Non-whitespace before first tag."),e.textNode=t,e.state=x.TEXT)}function P(e,t){var r="";return t1114111||_(a)!==a)throw RangeError("Invalid code point: "+a);a<=65535?t.push(a):t.push(55296+((a-=65536)>>10),a%1024+56320),(r+1===n||t.length>e)&&(i+=m.apply(null,t),t.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:w,configurable:!0,writable:!0}):String.fromCodePoint=w)}(void 0===r?this.sax={}:r)}).call(this,e("buffer").Buffer)},{buffer:12,stream:97,string_decoder:113}],97:[function(e,t,r){t.exports=i;var n=e("events").EventEmitter;function i(){n.call(this)}e("inherits")(i,n),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var o=!1;function s(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",a),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",c),e.on("error",c),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},{events:13,inherits:18,"readable-stream/duplex.js":98,"readable-stream/passthrough.js":107,"readable-stream/readable.js":108,"readable-stream/transform.js":109,"readable-stream/writable.js":110}],98:[function(e,t,r){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":99}],99:[function(e,t,r){"use strict";var n=e("process-nextick-args"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=f;var a=Object.create(e("core-util-is"));a.inherits=e("inherits");var o=e("./_stream_readable"),s=e("./_stream_writable");a.inherits(f,o);for(var u=i(s.prototype),c=0;c0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?w(e,o,t,!1):E(e,o)):w(e,o,t,!1))):n||(o.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(S,e):S(e))}function S(e){d("emit readable"),e.emit("readable"),T(e)}function E(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return ea.length?a.length:e;if(i+=o===a.length?a:a.slice(0,e),0==(e-=o)){o===a.length?(++n,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0==(e-=o)){o===a.length?(++i,t.head=n.next?n.next:t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function R(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(O,t,e))}function O(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function L(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):k(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&R(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?A(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&R(this)),null!==n&&this.emit("data",n),n},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,d("pipe count=%d opts=%j",a.pipesCount,t);var u=t&&!1===t.end||e===r.stdout||e===r.stderr?b:c;function c(){d("onend"),e.end()}a.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",function t(r,i){d("onunpipe"),r===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,d("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",l),e.removeListener("error",v),e.removeListener("unpipe",t),n.removeListener("end",c),n.removeListener("end",b),n.removeListener("data",p),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||l())});var l=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,T(e))}}(n);e.on("drain",l);var f=!1,h=!1;function p(t){d("ondata"),h=!1,!1!==e.write(t)||h||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==L(a.pipes,e))&&!f&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function v(t){d("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){d("onfinish"),e.removeListener("close",g),b()}function b(){d("unpipe"),n.unpipe(e)}return n.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener("error",r);e._events&&e._events.error?o(e._events.error)?e._events.error.unshift(r):e._events.error=[r,e._events.error]:e.on("error",r)}(e,0,v),e.once("close",g),e.once("finish",y),e.emit("pipe",n),a.flowing||(d("pipe resume"),n.resume()),e},m.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a-1?i:a.nextTick;b.WritableState=y;var c=Object.create(e("core-util-is"));c.inherits=e("inherits");var l,f={deprecate:e("util-deprecate")},h=e("./internal/streams/stream"),d=e("safe-buffer").Buffer,p=n.Uint8Array||function(){},v=e("./internal/streams/destroy");function g(){}function y(t,r){s=s||e("./_stream_duplex");var n=r instanceof s;this.objectMode=!!(t=t||{}).objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===t.decodeStrings),this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(a.nextTick(i,n),a.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),S(e,t))}(e,r,n,t,i);else{var o=x(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||w(e,r),n?u(_,e,r,o,i):_(e,r,o,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function b(t){if(s=s||e("./_stream_duplex"),!(l.call(b,this)||this instanceof s))return new b(t);this._writableState=new y(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),h.call(this)}function m(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),S(e,t)}function w(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=new Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,m(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk;if(m(e,t,!1,t.objectMode?1:u.length,u,r.encoding,r.callback),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),S(e,t)})}function S(e,t){var r=x(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(b,h),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===b&&e&&e._writableState instanceof y}})):l=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(d.isBuffer(n=e)||n instanceof p);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=g),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),a.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(n,o),i=!1),i}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,i,a){if(!r){var o=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r)),t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,S(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{"./_stream_duplex":99,"./internal/streams/destroy":105,"./internal/streams/stream":106,_process:62,"core-util-is":16,inherits:18,"process-nextick-args":61,"safe-buffer":111,timers:14,"util-deprecate":114}],104:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=e("util");t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,i=0;r;)r.data.copy(t,i),i+=r.data.length,r=r.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":111,util:11}],105:[function(e,t,r){"use strict";var n=e("process-nextick-args");function i(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":61}],106:[function(e,t,r){arguments[4][91][0].apply(r,arguments)},{dup:91,events:13}],107:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":108}],108:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":99,"./lib/_stream_passthrough.js":100,"./lib/_stream_readable.js":101,"./lib/_stream_transform.js":102,"./lib/_stream_writable.js":103}],109:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":108}],110:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":103}],111:[function(e,t,r){var n=e("buffer"),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(a(n,r),r.Buffer=o),a(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:12}],112:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}r.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":111}],113:[function(e,t,r){arguments[4][112][0].apply(r,arguments)},{dup:112,"safe-buffer":95}],114:[function(e,t,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(n){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],115:[function(e,t,r){"use strict";t.exports=function(e){e.prototype[Symbol.iterator]=regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(!t){e.next=7;break}return e.next=4,t.value;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}},e,this)})}},{}],116:[function(e,t,r){"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var r=0,i=arguments.length;r1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(tthis.length&&(t=this.length);for(var i=0,a=this.head;null!==a&&ithis.length&&(t=this.length);for(var i=this.length,a=this.tail;null!==a&&i>t;i--)a=a.prev;for(;null!==a&&i>e;i--,a=a.prev)r.push(a.value);return r},n.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,n=this.head;null!==n&&r"']/g,P=RegExp(D.source),F=RegExp(C.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,G=/<%=([\s\S]+?)%>/g,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V=/^\w*$/,q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,W=RegExp(K.source),H=/^\s+|\s+$/g,J=/^\s+/,X=/\s+$/,Q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Y=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,$=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/\\(\\)?/g,te=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,se=/^(?:0|[1-9]\d*)$/,ue=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ce=/($^)/,le=/['\n\r\u2028\u2029\\]/g,fe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",he="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",de="["+he+"]",pe="["+fe+"]",ve="\\d+",ge="[a-z\\xdf-\\xf6\\xf8-\\xff]",ye="[^\\ud800-\\udfff"+he+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",be="\\ud83c[\\udffb-\\udfff]",me="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",we="[\\ud800-\\udbff][\\udc00-\\udfff]",xe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ke="(?:"+ge+"|"+ye+")",Se="(?:"+xe+"|"+ye+")",Ee="(?:"+pe+"|"+be+")?",je="[\\ufe0e\\ufe0f]?"+Ee+"(?:\\u200d(?:"+[me,_e,we].join("|")+")[\\ufe0e\\ufe0f]?"+Ee+")*",Ie="(?:"+["[\\u2700-\\u27bf]",_e,we].join("|")+")"+je,Ne="(?:"+[me+pe+"?",pe,_e,we,"[\\ud800-\\udfff]"].join("|")+")",Te=RegExp("['\u2019]","g"),Ae=RegExp(pe,"g"),Re=RegExp(be+"(?="+be+")|"+Ne+je,"g"),Oe=RegExp([xe+"?"+ge+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[de,xe,"$"].join("|")+")",Se+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[de,xe+ke,"$"].join("|")+")",xe+"?"+ke+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",xe+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ve,Ie].join("|"),"g"),Le=RegExp("[\\u200d\\ud800-\\udfff"+fe+"\\ufe0e\\ufe0f]"),Me=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,De=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ce=-1,Pe={};Pe[S]=Pe[E]=Pe[j]=Pe[I]=Pe[N]=Pe[T]=Pe["[object Uint8ClampedArray]"]=Pe[A]=Pe[R]=!0,Pe[s]=Pe[u]=Pe[x]=Pe[c]=Pe[k]=Pe[l]=Pe[f]=Pe[h]=Pe[p]=Pe[v]=Pe[g]=Pe[y]=Pe[b]=Pe[m]=Pe[w]=!1;var Fe={};Fe[s]=Fe[u]=Fe[x]=Fe[k]=Fe[c]=Fe[l]=Fe[S]=Fe[E]=Fe[j]=Fe[I]=Fe[N]=Fe[p]=Fe[v]=Fe[g]=Fe[y]=Fe[b]=Fe[m]=Fe[_]=Fe[T]=Fe["[object Uint8ClampedArray]"]=Fe[A]=Fe[R]=!0,Fe[f]=Fe[h]=Fe[w]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,Ge=parseInt,ze="object"==typeof global&&global&&global.Object===Object&&global,Ve="object"==typeof self&&self&&self.Object===Object&&self,qe=ze||Ve||Function("return this")(),Ke=t&&!t.nodeType&&t,We=Ke&&"object"==typeof e&&e&&!e.nodeType&&e,He=We&&We.exports===Ke,Je=He&&ze.process,Xe=function(){try{return We&&We.require&&We.require("util").types||Je&&Je.binding&&Je.binding("util")}catch(e){}}(),Qe=Xe&&Xe.isArrayBuffer,Ye=Xe&&Xe.isDate,Ze=Xe&&Xe.isMap,$e=Xe&&Xe.isRegExp,et=Xe&&Xe.isSet,tt=Xe&&Xe.isTypedArray;function rt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function nt(e,t,r,n){for(var i=-1,a=null==e?0:e.length;++i-1}function ct(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function Rt(e,t){for(var r=e.length;r--&&bt(t,e[r],0)>-1;);return r}function Ot(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Lt=kt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Mt=kt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Dt(e){return"\\"+Be[e]}function Ct(e){return Le.test(e)}function Pt(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function Ft(e,t){return function(r){return e(t(r))}}function Bt(e,t){for(var r=-1,n=e.length,i=0,o=[];++r",""":'"',"'":"'"}),Kt=function e(t){var r,n=(t=null==t?qe:Kt.defaults(qe.Object(),t,Kt.pick(qe,De))).Array,fe=t.Date,he=t.Error,de=t.Function,pe=t.Math,ve=t.Object,ge=t.RegExp,ye=t.String,be=t.TypeError,me=n.prototype,_e=ve.prototype,we=t["__core-js_shared__"],xe=de.prototype.toString,ke=_e.hasOwnProperty,Se=0,Ee=(r=/[^.]+$/.exec(we&&we.keys&&we.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",je=_e.toString,Ie=xe.call(ve),Ne=qe._,Re=ge("^"+xe.call(ke).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=He?t.Buffer:void 0,Be=t.Symbol,ze=t.Uint8Array,Ve=Le?Le.allocUnsafe:void 0,Ke=Ft(ve.getPrototypeOf,ve),We=ve.create,Je=_e.propertyIsEnumerable,Xe=me.splice,vt=Be?Be.isConcatSpreadable:void 0,kt=Be?Be.iterator:void 0,Wt=Be?Be.toStringTag:void 0,Ht=function(){try{var e=Yi(ve,"defineProperty");return e({},"",{}),e}catch(t){}}(),Jt=t.clearTimeout!==qe.clearTimeout&&t.clearTimeout,Xt=fe&&fe.now!==qe.Date.now&&fe.now,Qt=t.setTimeout!==qe.setTimeout&&t.setTimeout,Yt=pe.ceil,Zt=pe.floor,$t=ve.getOwnPropertySymbols,er=Le?Le.isBuffer:void 0,tr=t.isFinite,rr=me.join,nr=Ft(ve.keys,ve),ir=pe.max,ar=pe.min,or=fe.now,sr=t.parseInt,ur=pe.random,cr=me.reverse,lr=Yi(t,"DataView"),fr=Yi(t,"Map"),hr=Yi(t,"Promise"),dr=Yi(t,"Set"),pr=Yi(t,"WeakMap"),vr=Yi(ve,"create"),gr=pr&&new pr,yr={},br=ja(lr),mr=ja(fr),_r=ja(hr),wr=ja(dr),xr=ja(pr),kr=Be?Be.prototype:void 0,Sr=kr?kr.valueOf:void 0,Er=kr?kr.toString:void 0;function jr(e){if(qo(e)&&!Lo(e)&&!(e instanceof Ar)){if(e instanceof Tr)return e;if(ke.call(e,"__wrapped__"))return Ia(e)}return new Tr(e)}var Ir=function(){function e(){}return function(t){if(!Vo(t))return{};if(We)return We(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Nr(){}function Tr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ar(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Jr(e,t,r,n,i,a){var o,u=1&t,f=2&t,w=4&t;if(r&&(o=i?r(e,n,i,a):r(e)),void 0!==o)return o;if(!Vo(e))return e;var O=Lo(e);if(O){if(o=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&ke.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!u)return vi(e,o)}else{var L=ea(e),M=L==h||L==d;if(Po(e))return ci(e,u);if(L==g||L==s||M&&!i){if(o=f||M?{}:ra(e),!u)return f?function(e,t){return gi(e,$i(e),t)}(e,function(e,t){return e&&gi(t,ws(t),e)}(o,e)):function(e,t){return gi(e,Zi(e),t)}(e,qr(o,e))}else{if(!Fe[L])return i?e:{};o=function(e,t,r){var n=e.constructor;switch(t){case x:return li(e);case c:case l:return new n(+e);case k:return function(e,t){var r=t?li(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case S:case E:case j:case I:case N:case T:case"[object Uint8ClampedArray]":case A:case R:return fi(e,r);case p:return new n;case v:case m:return new n(e);case y:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new n;case _:return Sr?ve(Sr.call(e)):{}}}(e,L,u)}}a||(a=new Dr);var D=a.get(e);if(D)return D;a.set(e,o),Xo(e)?e.forEach(function(n){o.add(Jr(n,t,r,n,e,a))}):Ko(e)&&e.forEach(function(n,i){o.set(i,Jr(n,t,r,i,e,a))});var C=O?void 0:(w?f?qi:Vi:f?ws:_s)(e);return it(C||e,function(n,i){C&&(n=e[i=n]),Gr(o,i,Jr(n,t,r,i,e,a))}),o}function Xr(e,t,r){var n=r.length;if(null==e)return!n;for(e=ve(e);n--;){var i=r[n],a=e[i];if(void 0===a&&!(i in e)||!(0,t[i])(a))return!1}return!0}function Qr(e,t,r){if("function"!=typeof e)throw new be(i);return ya(function(){e.apply(void 0,r)},t)}function Yr(e,t,r,n){var i=-1,a=ut,o=!0,s=e.length,u=[],c=t.length;if(!s)return u;r&&(t=lt(t,It(r))),n?(a=ct,o=!1):t.length>=200&&(a=Tt,o=!1,t=new Mr(t));e:for(;++i-1},Or.prototype.set=function(e,t){var r=this.__data__,n=zr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Lr.prototype.clear=function(){this.size=0,this.__data__={hash:new Rr,map:new(fr||Or),string:new Rr}},Lr.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},Lr.prototype.get=function(e){return Xi(this,e).get(e)},Lr.prototype.has=function(e){return Xi(this,e).has(e)},Lr.prototype.set=function(e,t){var r=Xi(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Mr.prototype.add=Mr.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Mr.prototype.has=function(e){return this.__data__.has(e)},Dr.prototype.clear=function(){this.__data__=new Or,this.size=0},Dr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Dr.prototype.get=function(e){return this.__data__.get(e)},Dr.prototype.has=function(e){return this.__data__.has(e)},Dr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Or){var n=r.__data__;if(!fr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Lr(n)}return r.set(e,t),this.size=r.size,this};var Zr=mi(sn),$r=mi(un,!0);function en(e,t){var r=!0;return Zr(e,function(e,n,i){return r=!!t(e,n,i)}),r}function tn(e,t,r){for(var n=-1,i=e.length;++n0&&r(s)?t>1?nn(s,t-1,r,n,i):ft(i,s):n||(i[i.length]=s)}return i}var an=_i(),on=_i(!0);function sn(e,t){return e&&an(e,t,_s)}function un(e,t){return e&&on(e,t,_s)}function cn(e,t){return st(t,function(t){return Uo(e[t])})}function ln(e,t){for(var r=0,n=(t=ai(t,e)).length;null!=e&&rt}function pn(e,t){return null!=e&&ke.call(e,t)}function vn(e,t){return null!=e&&t in ve(e)}function gn(e,t,r){for(var i=r?ct:ut,a=e[0].length,o=e.length,s=o,u=n(o),c=1/0,l=[];s--;){var f=e[s];s&&t&&(f=lt(f,It(t))),c=ar(f.length,c),u[s]=!r&&(t||a>=120&&f.length>=120)?new Mr(s&&f):void 0}f=e[0];var h=-1,d=u[0];e:for(;++h=s?u:u*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)});n--;)e[n]=e[n].value;return e}(En(e,function(e,r,i){return{criteria:lt(t,function(t){return t(e)}),index:++n,value:e}}))}function Rn(e,t,r){for(var n=-1,i=t.length,a={};++n-1;)s!==e&&Xe.call(s,u,1),Xe.call(e,u,1);return e}function Ln(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==a){var a=i;ia(i)?Xe.call(e,i,1):Yn(e,i)}}return e}function Mn(e,t){return e+Zt(ur()*(t-e+1))}function Dn(e,t){var r="";if(!e||t<1||t>9007199254740991)return r;do{t%2&&(r+=e),(t=Zt(t/2))&&(e+=e)}while(t);return r}function Cn(e,t){return ba(ha(e,t,Ws),e+"")}function Pn(e){return Pr(Ts(e))}function Fn(e,t){var r=Ts(e);return wa(r,Hr(t,0,r.length))}function Bn(e,t,r,n){if(!Vo(e))return e;for(var i=-1,a=(t=ai(t,e)).length,o=a-1,s=e;null!=s&&++ia?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var o=n(a);++i>>1,o=e[a];null!==o&&!Yo(o)&&(r?o<=t:o=200){var c=t?null:Di(e);if(c)return Ut(c);o=!1,i=Tt,u=new Mr}else u=t?[]:s;e:for(;++n=n?e:Vn(e,t,r)}var ui=Jt||function(e){return qe.clearTimeout(e)};function ci(e,t){if(t)return e.slice();var r=e.length,n=Ve?Ve(r):new e.constructor(r);return e.copy(n),n}function li(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function fi(e,t){var r=t?li(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function hi(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=e==e,a=Yo(e),o=void 0!==t,s=null===t,u=t==t,c=Yo(t);if(!s&&!c&&!a&&e>t||a&&o&&u&&!s&&!c||n&&o&&u||!r&&u||!i)return 1;if(!n&&!a&&!c&&e1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&aa(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=ve(t);++n-1?i[a?t[o]:o]:void 0}}function Ei(e){return zi(function(t){var r=t.length,n=r,a=Tr.prototype.thru;for(e&&t.reverse();n--;){var o=t[n];if("function"!=typeof o)throw new be(i);if(a&&!s&&"wrapper"==Wi(o))var s=new Tr([],!0)}for(n=s?n:r;++n1&&m.reverse(),f&&cs))return!1;var c=a.get(e),l=a.get(t);if(c&&l)return c==t&&l==e;var f=-1,h=!0,d=2&r?new Mr:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(Q,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return it(o,function(r){var n="_."+r[0];t&r[1]&&!ut(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(Y);return t?t[1].split(Z):[]}(n),r)))}function _a(e){var t=0,r=0;return function(){var n=or(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function wa(e,t){var r=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++r1?e[t-1]:void 0;return r="function"==typeof r?(e.pop(),r):void 0,Ha(e,r)});function eo(e){var t=jr(e);return t.__chain__=!0,t}function to(e,t){return t(e)}var ro=zi(function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,i=function(t){return Wr(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ar&&ia(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:to,args:[i],thisArg:void 0}),new Tr(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),no=yi(function(e,t,r){ke.call(e,r)?++e[r]:Kr(e,r,1)}),io=Si(Ra),ao=Si(Oa);function oo(e,t){return(Lo(e)?it:Zr)(e,Ji(t,3))}function so(e,t){return(Lo(e)?at:$r)(e,Ji(t,3))}var uo=yi(function(e,t,r){ke.call(e,r)?e[r].push(t):Kr(e,r,[t])}),co=Cn(function(e,t,r){var i=-1,a="function"==typeof t,o=Do(e)?n(e.length):[];return Zr(e,function(e){o[++i]=a?rt(t,e,r):yn(e,t,r)}),o}),lo=yi(function(e,t,r){Kr(e,r,t)});function fo(e,t){return(Lo(e)?lt:En)(e,Ji(t,3))}var ho=yi(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),po=Cn(function(e,t){if(null==e)return[];var r=t.length;return r>1&&aa(e,t[0],t[1])?t=[]:r>2&&aa(t[0],t[1],t[2])&&(t=[t[0]]),An(e,nn(t,1),[])}),vo=Xt||function(){return qe.Date.now()};function go(e,t,r){return t=r?void 0:t,Pi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function yo(e,t){var r;if("function"!=typeof t)throw new be(i);return e=ns(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var bo=Cn(function(e,t,r){var n=1;if(r.length){var i=Bt(r,Hi(bo));n|=32}return Pi(e,n,t,r,i)}),mo=Cn(function(e,t,r){var n=3;if(r.length){var i=Bt(r,Hi(mo));n|=32}return Pi(t,n,e,r,i)});function _o(e,t,r){var n,a,o,s,u,c,l=0,f=!1,h=!1,d=!0;if("function"!=typeof e)throw new be(i);function p(t){var r=n,i=a;return n=a=void 0,l=t,s=e.apply(i,r)}function v(e){return l=e,u=ya(y,t),f?p(e):s}function g(e){var r=e-c;return void 0===c||r>=t||r<0||h&&e-l>=o}function y(){var e=vo();if(g(e))return b(e);u=ya(y,function(e){var r=t-(e-c);return h?ar(r,o-(e-l)):r}(e))}function b(e){return u=void 0,d&&n?p(e):(n=a=void 0,s)}function m(){var e=vo(),r=g(e);if(n=arguments,a=this,c=e,r){if(void 0===u)return v(c);if(h)return ui(u),u=ya(y,t),p(c)}return void 0===u&&(u=ya(y,t)),s}return t=as(t)||0,Vo(r)&&(f=!!r.leading,o=(h="maxWait"in r)?ir(as(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),m.cancel=function(){void 0!==u&&ui(u),l=0,n=c=a=u=void 0},m.flush=function(){return void 0===u?s:b(vo())},m}var wo=Cn(function(e,t){return Qr(e,1,t)}),xo=Cn(function(e,t,r){return Qr(e,as(t)||0,r)});function ko(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new be(i);var r=function r(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(ko.Cache||Lr),r}function So(e){if("function"!=typeof e)throw new be(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ko.Cache=Lr;var Eo=oi(function(e,t){var r=(t=1==t.length&&Lo(t[0])?lt(t[0],It(Ji())):lt(nn(t,1),It(Ji()))).length;return Cn(function(n){for(var i=-1,a=ar(n.length,r);++i=t}),Oo=bn(function(){return arguments}())?bn:function(e){return qo(e)&&ke.call(e,"callee")&&!Je.call(e,"callee")},Lo=n.isArray,Mo=Qe?It(Qe):function(e){return qo(e)&&hn(e)==x};function Do(e){return null!=e&&zo(e.length)&&!Uo(e)}function Co(e){return qo(e)&&Do(e)}var Po=er||au,Fo=Ye?It(Ye):function(e){return qo(e)&&hn(e)==l};function Bo(e){if(!qo(e))return!1;var t=hn(e);return t==f||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ho(e)}function Uo(e){if(!Vo(e))return!1;var t=hn(e);return t==h||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Go(e){return"number"==typeof e&&e==ns(e)}function zo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Vo(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function qo(e){return null!=e&&"object"==typeof e}var Ko=Ze?It(Ze):function(e){return qo(e)&&ea(e)==p};function Wo(e){return"number"==typeof e||qo(e)&&hn(e)==v}function Ho(e){if(!qo(e)||hn(e)!=g)return!1;var t=Ke(e);if(null===t)return!0;var r=ke.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&xe.call(r)==Ie}var Jo=$e?It($e):function(e){return qo(e)&&hn(e)==y},Xo=et?It(et):function(e){return qo(e)&&ea(e)==b};function Qo(e){return"string"==typeof e||!Lo(e)&&qo(e)&&hn(e)==m}function Yo(e){return"symbol"==typeof e||qo(e)&&hn(e)==_}var Zo=tt?It(tt):function(e){return qo(e)&&zo(e.length)&&!!Pe[hn(e)]},$o=Oi(Sn),es=Oi(function(e,t){return e<=t});function ts(e){if(!e)return[];if(Do(e))return Qo(e)?Vt(e):vi(e);if(kt&&e[kt])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[kt]());var t=ea(e);return(t==p?Pt:t==b?Ut:Ts)(e)}function rs(e){return e?1/0===(e=as(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ns(e){var t=rs(e),r=t%1;return t==t?r?t-r:t:0}function is(e){return e?Hr(ns(e),0,4294967295):0}function as(e){if("number"==typeof e)return e;if(Yo(e))return NaN;if(Vo(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Vo(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(H,"");var r=ie.test(e);return r||oe.test(e)?Ge(e.slice(2),r?2:8):ne.test(e)?NaN:+e}function os(e){return gi(e,ws(e))}function ss(e){return null==e?"":Xn(e)}var us=bi(function(e,t){if(ca(t)||Do(t))gi(t,_s(t),e);else for(var r in t)ke.call(t,r)&&Gr(e,r,t[r])}),cs=bi(function(e,t){gi(t,ws(t),e)}),ls=bi(function(e,t,r,n){gi(t,ws(t),e,n)}),fs=bi(function(e,t,r,n){gi(t,_s(t),e,n)}),hs=zi(Wr),ds=Cn(function(e,t){e=ve(e);var r=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&aa(t[0],t[1],i)&&(n=1);++r1),t}),gi(e,qi(e),r),n&&(r=Jr(r,7,Ui));for(var i=t.length;i--;)Yn(r,t[i]);return r}),Es=zi(function(e,t){return null==e?{}:function(e,t){return Rn(e,t,function(t,r){return gs(e,r)})}(e,t)});function js(e,t){if(null==e)return{};var r=lt(qi(e),function(e){return[e]});return t=Ji(t),Rn(e,r,function(e,r){return t(e,r[0])})}var Is=Ci(_s),Ns=Ci(ws);function Ts(e){return null==e?[]:Nt(e,_s(e))}var As=xi(function(e,t,r){return t=t.toLowerCase(),e+(r?Rs(t):t)});function Rs(e){return Bs(ss(e).toLowerCase())}function Os(e){return(e=ss(e))&&e.replace(ue,Lt).replace(Ae,"")}var Ls=xi(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),Ms=xi(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),Ds=wi("toLowerCase"),Cs=xi(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),Ps=xi(function(e,t,r){return e+(r?" ":"")+Bs(t)}),Fs=xi(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Bs=wi("toUpperCase");function Us(e,t,r){return e=ss(e),void 0===(t=r?void 0:t)?function(e){return Me.test(e)}(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.match($)||[]}(e):e.match(t)||[]}var Gs=Cn(function(e,t){try{return rt(e,void 0,t)}catch(r){return Bo(r)?r:new he(r)}}),zs=zi(function(e,t){return it(t,function(t){t=Ea(t),Kr(e,t,bo(e[t],e))}),e});function Vs(e){return function(){return e}}var qs=Ei(),Ks=Ei(!0);function Ws(e){return e}function Hs(e){return xn("function"==typeof e?e:Jr(e,1))}var Js=Cn(function(e,t){return function(r){return yn(r,e,t)}}),Xs=Cn(function(e,t){return function(r){return yn(e,r,t)}});function Qs(e,t,r){var n=_s(t),i=cn(t,n);null!=r||Vo(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=cn(t,_s(t)));var a=!(Vo(r)&&"chain"in r&&!r.chain),o=Uo(e);return it(i,function(r){var n=t[r];e[r]=n,o&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__),i=r.__actions__=vi(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,ft([this.value()],arguments))})}),e}function Ys(){}var Zs=Ti(lt),$s=Ti(ot),eu=Ti(pt);function tu(e){return oa(e)?xt(Ea(e)):function(e){return function(t){return ln(t,e)}}(e)}var ru=Ri(),nu=Ri(!0);function iu(){return[]}function au(){return!1}var ou,su=Ni(function(e,t){return e+t},0),uu=Mi("ceil"),cu=Ni(function(e,t){return e/t},1),lu=Mi("floor"),fu=Ni(function(e,t){return e*t},1),hu=Mi("round"),du=Ni(function(e,t){return e-t},0);return jr.after=function(e,t){if("function"!=typeof t)throw new be(i);return e=ns(e),function(){if(--e<1)return t.apply(this,arguments)}},jr.ary=go,jr.assign=us,jr.assignIn=cs,jr.assignInWith=ls,jr.assignWith=fs,jr.at=hs,jr.before=yo,jr.bind=bo,jr.bindAll=zs,jr.bindKey=mo,jr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Lo(e)?e:[e]},jr.chain=eo,jr.chunk=function(e,t,r){t=(r?aa(e,t,r):void 0===t)?1:ir(ns(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=n(Yt(i/t));ai?0:i+r),(n=void 0===n||n>i?i:ns(n))<0&&(n+=i),n=r>n?0:is(n);r>>0)?(e=ss(e))&&("string"==typeof t||null!=t&&!Jo(t))&&!(t=Xn(t))&&Ct(e)?si(Vt(e),0,r):e.split(t,r):[]},jr.spread=function(e,t){if("function"!=typeof e)throw new be(i);return t=null==t?0:ir(ns(t),0),Cn(function(r){var n=r[t],i=si(r,0,t);return n&&ft(i,n),rt(e,this,i)})},jr.tail=function(e){var t=null==e?0:e.length;return t?Vn(e,1,t):[]},jr.take=function(e,t,r){return e&&e.length?Vn(e,0,(t=r||void 0===t?1:ns(t))<0?0:t):[]},jr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?Vn(e,(t=n-(t=r||void 0===t?1:ns(t)))<0?0:t,n):[]},jr.takeRightWhile=function(e,t){return e&&e.length?$n(e,Ji(t,3),!1,!0):[]},jr.takeWhile=function(e,t){return e&&e.length?$n(e,Ji(t,3)):[]},jr.tap=function(e,t){return t(e),e},jr.throttle=function(e,t,r){var n=!0,a=!0;if("function"!=typeof e)throw new be(i);return Vo(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),_o(e,t,{leading:n,maxWait:t,trailing:a})},jr.thru=to,jr.toArray=ts,jr.toPairs=Is,jr.toPairsIn=Ns,jr.toPath=function(e){return Lo(e)?lt(e,Ea):Yo(e)?[e]:vi(Sa(ss(e)))},jr.toPlainObject=os,jr.transform=function(e,t,r){var n=Lo(e),i=n||Po(e)||Zo(e);if(t=Ji(t,4),null==r){var a=e&&e.constructor;r=i?n?new a:[]:Vo(e)&&Uo(a)?Ir(Ke(e)):{}}return(i?it:sn)(e,function(e,n,i){return t(r,e,n,i)}),r},jr.unary=function(e){return go(e,1)},jr.union=Va,jr.unionBy=qa,jr.unionWith=Ka,jr.uniq=function(e){return e&&e.length?Qn(e):[]},jr.uniqBy=function(e,t){return e&&e.length?Qn(e,Ji(t,2)):[]},jr.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qn(e,void 0,t):[]},jr.unset=function(e,t){return null==e||Yn(e,t)},jr.unzip=Wa,jr.unzipWith=Ha,jr.update=function(e,t,r){return null==e?e:Zn(e,t,ii(r))},jr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:void 0,null==e?e:Zn(e,t,ii(r),n)},jr.values=Ts,jr.valuesIn=function(e){return null==e?[]:Nt(e,ws(e))},jr.without=Ja,jr.words=Us,jr.wrap=function(e,t){return jo(ii(t),e)},jr.xor=Xa,jr.xorBy=Qa,jr.xorWith=Ya,jr.zip=Za,jr.zipObject=function(e,t){return ri(e||[],t||[],Gr)},jr.zipObjectDeep=function(e,t){return ri(e||[],t||[],Bn)},jr.zipWith=$a,jr.entries=Is,jr.entriesIn=Ns,jr.extend=cs,jr.extendWith=ls,Qs(jr,jr),jr.add=su,jr.attempt=Gs,jr.camelCase=As,jr.capitalize=Rs,jr.ceil=uu,jr.clamp=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=as(r))==r?r:0),void 0!==t&&(t=(t=as(t))==t?t:0),Hr(as(e),t,r)},jr.clone=function(e){return Jr(e,4)},jr.cloneDeep=function(e){return Jr(e,5)},jr.cloneDeepWith=function(e,t){return Jr(e,5,t="function"==typeof t?t:void 0)},jr.cloneWith=function(e,t){return Jr(e,4,t="function"==typeof t?t:void 0)},jr.conformsTo=function(e,t){return null==t||Xr(e,t,_s(t))},jr.deburr=Os,jr.defaultTo=function(e,t){return null==e||e!=e?t:e},jr.divide=cu,jr.endsWith=function(e,t,r){e=ss(e),t=Xn(t);var n=e.length,i=r=void 0===r?n:Hr(ns(r),0,n);return(r-=t.length)>=0&&e.slice(r,i)==t},jr.eq=To,jr.escape=function(e){return(e=ss(e))&&F.test(e)?e.replace(C,Mt):e},jr.escapeRegExp=function(e){return(e=ss(e))&&W.test(e)?e.replace(K,"\\$&"):e},jr.every=function(e,t,r){var n=Lo(e)?ot:en;return r&&aa(e,t,r)&&(t=void 0),n(e,Ji(t,3))},jr.find=io,jr.findIndex=Ra,jr.findKey=function(e,t){return gt(e,Ji(t,3),sn)},jr.findLast=ao,jr.findLastIndex=Oa,jr.findLastKey=function(e,t){return gt(e,Ji(t,3),un)},jr.floor=lu,jr.forEach=oo,jr.forEachRight=so,jr.forIn=function(e,t){return null==e?e:an(e,Ji(t,3),ws)},jr.forInRight=function(e,t){return null==e?e:on(e,Ji(t,3),ws)},jr.forOwn=function(e,t){return e&&sn(e,Ji(t,3))},jr.forOwnRight=function(e,t){return e&&un(e,Ji(t,3))},jr.get=vs,jr.gt=Ao,jr.gte=Ro,jr.has=function(e,t){return null!=e&&ta(e,t,pn)},jr.hasIn=gs,jr.head=Ma,jr.identity=Ws,jr.includes=function(e,t,r,n){e=Do(e)?e:Ts(e),r=r&&!n?ns(r):0;var i=e.length;return r<0&&(r=ir(i+r,0)),Qo(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&bt(e,t,r)>-1},jr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ns(r);return i<0&&(i=ir(n+i,0)),bt(e,t,i)},jr.inRange=function(e,t,r){return t=rs(t),void 0===r?(r=t,t=0):r=rs(r),function(e,t,r){return e>=ar(t,r)&&e=-9007199254740991&&e<=9007199254740991},jr.isSet=Xo,jr.isString=Qo,jr.isSymbol=Yo,jr.isTypedArray=Zo,jr.isUndefined=function(e){return void 0===e},jr.isWeakMap=function(e){return qo(e)&&ea(e)==w},jr.isWeakSet=function(e){return qo(e)&&"[object WeakSet]"==hn(e)},jr.join=function(e,t){return null==e?"":rr.call(e,t)},jr.kebabCase=Ls,jr.last=Fa,jr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==r&&(i=(i=ns(r))<0?ir(n+i,0):ar(i,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,i):yt(e,_t,i,!0)},jr.lowerCase=Ms,jr.lowerFirst=Ds,jr.lt=$o,jr.lte=es,jr.max=function(e){return e&&e.length?tn(e,Ws,dn):void 0},jr.maxBy=function(e,t){return e&&e.length?tn(e,Ji(t,2),dn):void 0},jr.mean=function(e){return wt(e,Ws)},jr.meanBy=function(e,t){return wt(e,Ji(t,2))},jr.min=function(e){return e&&e.length?tn(e,Ws,Sn):void 0},jr.minBy=function(e,t){return e&&e.length?tn(e,Ji(t,2),Sn):void 0},jr.stubArray=iu,jr.stubFalse=au,jr.stubObject=function(){return{}},jr.stubString=function(){return""},jr.stubTrue=function(){return!0},jr.multiply=fu,jr.nth=function(e,t){return e&&e.length?Tn(e,ns(t)):void 0},jr.noConflict=function(){return qe._===this&&(qe._=Ne),this},jr.noop=Ys,jr.now=vo,jr.pad=function(e,t,r){e=ss(e);var n=(t=ns(t))?zt(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ai(Zt(i),r)+e+Ai(Yt(i),r)},jr.padEnd=function(e,t,r){e=ss(e);var n=(t=ns(t))?zt(e):0;return t&&nt){var n=e;e=t,t=n}if(r||e%1||t%1){var i=ur();return ar(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Mn(e,t)},jr.reduce=function(e,t,r){var n=Lo(e)?ht:St,i=arguments.length<3;return n(e,Ji(t,4),r,i,Zr)},jr.reduceRight=function(e,t,r){var n=Lo(e)?dt:St,i=arguments.length<3;return n(e,Ji(t,4),r,i,$r)},jr.repeat=function(e,t,r){return t=(r?aa(e,t,r):void 0===t)?1:ns(t),Dn(ss(e),t)},jr.replace=function(){var e=arguments,t=ss(e[0]);return e.length<3?t:t.replace(e[1],e[2])},jr.result=function(e,t,r){var n=-1,i=(t=ai(t,e)).length;for(i||(i=1,e=void 0);++n9007199254740991)return[];var r=4294967295,n=ar(e,4294967295);e-=4294967295;for(var i=jt(n,t=Ji(t));++r=a)return e;var s=r-zt(n);if(s<1)return n;var u=o?si(o,0,s).join(""):e.slice(0,s);if(void 0===i)return u+n;if(o&&(s+=u.length-s),Jo(i)){if(e.slice(s).search(i)){var c,l=u;for(i.global||(i=ge(i.source,ss(re.exec(i))+"g")),i.lastIndex=0;c=i.exec(l);)var f=c.index;u=u.slice(0,void 0===f?s:f)}}else if(e.indexOf(Xn(i),s)!=s){var h=u.lastIndexOf(i);h>-1&&(u=u.slice(0,h))}return u+n},jr.unescape=function(e){return(e=ss(e))&&P.test(e)?e.replace(D,qt):e},jr.uniqueId=function(e){var t=++Se;return ss(e)+t},jr.upperCase=Fs,jr.upperFirst=Bs,jr.each=oo,jr.eachRight=so,jr.first=Ma,Qs(jr,(ou={},sn(jr,function(e,t){ke.call(jr.prototype,t)||(ou[t]=e)}),ou),{chain:!1}),jr.VERSION="4.17.19",it(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){jr[e].placeholder=jr}),it(["drop","take"],function(e,t){Ar.prototype[e]=function(r){r=void 0===r?1:ir(ns(r),0);var n=this.__filtered__&&!t?new Ar(this):this.clone();return n.__filtered__?n.__takeCount__=ar(r,n.__takeCount__):n.__views__.push({size:ar(r,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Ar.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),it(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;Ar.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ji(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),it(["head","last"],function(e,t){var r="take"+(t?"Right":"");Ar.prototype[e]=function(){return this[r](1).value()[0]}}),it(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");Ar.prototype[e]=function(){return this.__filtered__?new Ar(this):this[r](1)}}),Ar.prototype.compact=function(){return this.filter(Ws)},Ar.prototype.find=function(e){return this.filter(e).head()},Ar.prototype.findLast=function(e){return this.reverse().find(e)},Ar.prototype.invokeMap=Cn(function(e,t){return"function"==typeof e?new Ar(this):this.map(function(r){return yn(r,e,t)})}),Ar.prototype.reject=function(e){return this.filter(So(Ji(e)))},Ar.prototype.slice=function(e,t){e=ns(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Ar(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),void 0!==t&&(r=(t=ns(t))<0?r.dropRight(-t):r.take(t-e)),r)},Ar.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ar.prototype.toArray=function(){return this.take(4294967295)},sn(Ar.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=jr[n?"take"+("last"==t?"Right":""):t],a=n||/^find/.test(t);i&&(jr.prototype[t]=function(){var t=this.__wrapped__,o=n?[1]:arguments,s=t instanceof Ar,u=o[0],c=s||Lo(t),l=function(e){var t=i.apply(jr,ft([e],o));return n&&f?t[0]:t};c&&r&&"function"==typeof u&&1!=u.length&&(s=c=!1);var f=this.__chain__,h=!!this.__actions__.length,d=a&&!f,p=s&&!h;if(!a&&c){t=p?t:new Ar(this);var v=e.apply(t,o);return v.__actions__.push({func:to,args:[l],thisArg:void 0}),new Tr(v,f)}return d&&p?e.apply(this,o):(v=this.thru(l),d?n?v.value()[0]:v.value():v)})}),it(["pop","push","shift","sort","splice","unshift"],function(e){var t=me[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);jr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Lo(i)?i:[],e)}return this[r](function(r){return t.apply(Lo(r)?r:[],e)})}}),sn(Ar.prototype,function(e,t){var r=jr[t];if(r){var n=r.name+"";ke.call(yr,n)||(yr[n]=[]),yr[n].push({name:t,func:r})}}),yr[ji(void 0,2).name]=[{name:"wrapper",func:void 0}],Ar.prototype.clone=function(){var e=new Ar(this.__wrapped__);return e.__actions__=vi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=vi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=vi(this.__views__),e},Ar.prototype.reverse=function(){if(this.__filtered__){var e=new Ar(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ar.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Lo(e),n=t<0,i=r?e.length:0,a=function(e,t,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},jr.prototype.plant=function(e){for(var t,r=this;r instanceof Nr;){var n=Ia(r);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;r=r.__wrapped__}return i.__wrapped__=e,t},jr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ar){var t=e;return this.__actions__.length&&(t=new Ar(this)),(t=t.reverse()).__actions__.push({func:to,args:[za],thisArg:void 0}),new Tr(t,this.__chain__)}return this.thru(za)},jr.prototype.toJSON=jr.prototype.valueOf=jr.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},jr.prototype.first=jr.prototype.head,kt&&(jr.prototype[kt]=function(){return this}),jr}();qe._=Kt,void 0===(n=(function(){return Kt}).call(t,r,t,e))||(e.exports=n)}).call(this)}).call(this,r("YuTi")(e))},PDru:function(e,t){var r="undefined"!=typeof ArrayBuffer,n="undefined"!=typeof Symbol;function i(e,t){var i,a,o,s,u;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof t)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||r&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(o=0,s=e.length;o0)throw new Error("Parser error")}}function s(e,t,r){var n="";return 0!==e&&(""!==r?n+=e<0?" - ":" + ":e<0&&(n+="-"),1===(e=Math.abs(e))&&""!==t||(n+=e),n+=t),n}function u(e,t,r,n){if(!(this instanceof u))return new u(e,t,r,n);o(this,e,t,r,n)}u.prototype={w:1,x:0,y:0,z:0,add:function(e,t,r,n){return o(a,e,t,r,n),new u(this.w+a.w,this.x+a.x,this.y+a.y,this.z+a.z)},sub:function(e,t,r,n){return o(a,e,t,r,n),new u(this.w-a.w,this.x-a.x,this.y-a.y,this.z-a.z)},neg:function(){return new u(-this.w,-this.x,-this.y,-this.z)},norm:function(){var e=this.w,t=this.x,r=this.y,n=this.z;return Math.sqrt(e*e+t*t+r*r+n*n)},normSq:function(){var e=this.w,t=this.x,r=this.y,n=this.z;return e*e+t*t+r*r+n*n},normalize:function(){var e=this.w,t=this.x,r=this.y,n=this.z,i=Math.sqrt(e*e+t*t+r*r+n*n);return i=0)return new u(Math.pow(s,a.w),0,0,0);if(0===s)switch(a.w%4){case 0:return new u(Math.pow(c,a.w),0,0,0);case 1:return new u(0,Math.pow(c,a.w),0,0);case 2:return new u(-Math.pow(c,a.w),0,0,0);case 3:return new u(0,-Math.pow(c,a.w),0,0)}}return s=Math.exp(a.w*f-a.x*l),c=a.x*f+a.w*l,new u(s*Math.cos(c),s*Math.sin(c),0,0)}}return this.log().mul(a).exp()},equals:function(e,t,r,n){o(a,e,t,r,n);var i=u.EPSILON;return Math.abs(a.w-this.w).9995)return function(e){return new u(i+e*(f-i),s+e*(h-s),c+e*(d-c),l+e*(p-l)).normalize()};var g=Math.acos(v),y=Math.sin(g);return function(e){var t=g*e,r=Math.sin(t),n=Math.cos(t)-v*r/y,a=r/y;return new u(n*i+a*f,n*s+a*h,n*c+a*d,n*l+a*p)}}},u.ZERO=new u(0,0,0,0),u.ONE=new u(1,0,0,0),u.I=new u(0,1,0,0),u.J=new u(0,0,1,0),u.K=new u(0,0,0,1),u.EPSILON=1e-16,u.fromAxisAngle=function(e,t){var r=.5*t,n=e[0],i=e[1],a=e[2],o=Math.sin(r),s=Math.cos(r),c=o/Math.sqrt(n*n+i*i+a*a);return new u(s,n*c,i*c,a*c)},u.fromBetweenVectors=function(e,t){var r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2],c=r*a+n*o+i*s,l=n*s-i*o,f=i*a-r*s,h=r*o-n*a;return new u(c+Math.sqrt(c*c+l*l+f*f+h*h),l,f,h).normalize()},u.fromEuler=function(e,t,r,n){var i=.5*t,a=.5*r,o=.5*e,s=Math.cos(i),c=Math.cos(a),l=Math.cos(o),f=Math.sin(i),h=Math.sin(a),d=Math.sin(o);return void 0===n||"ZXY"===n?new u(s*c*l-f*h*d,f*c*l-s*h*d,s*h*l+f*c*d,s*c*d+f*h*l):"XYZ"===n?new u(s*c*l-f*h*d,f*c*l+s*h*d,s*h*l-f*c*d,s*c*d+f*h*l):"YXZ"===n?new u(s*c*l+f*h*d,f*c*l+s*h*d,s*h*l-f*c*d,s*c*d-f*h*l):"ZYX"===n?new u(s*c*l+f*h*d,f*c*l-s*h*d,s*h*l+f*c*d,s*c*d-f*h*l):"YZX"===n?new u(s*c*l-f*h*d,f*c*l+s*h*d,s*h*l+f*c*d,s*c*d-f*h*l):"XZY"===n?new u(s*c*l+f*h*d,f*c*l-s*h*d,s*h*l-f*c*d,s*c*d+f*h*l):null},void 0===(n=(function(){return u}).apply(t,[]))||(e.exports=n)}()},YuTi:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},cTvG:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("FZPO"),i=function(){function e(){S(this,e)}return j(e,[{key:"fromRdf",value:function(e,t){var r=parseFloat(e.value);return t&&isNaN(r)&&n.Translator.incorrectRdfDataType(e),r}},{key:"toRdf",value:function(t,r){var n=r.datatype,i=r.dataFactory;return n=n||i.namedNode(e.TYPES[0]),isNaN(t)?i.literal("NaN",n):isFinite(t)?t%1==0?null:i.literal(t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),n):i.literal(t>0?"INF":"-INF",n)}}]),e}();t.TypeHandlerNumberDouble=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},g5aj:function(e,t,r){var n=r("04/w"),i=r("PDru");function a(){this.clear()}a.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},a.prototype.enqueue=function(e){return this.items.push(e),++this.size},a.prototype.dequeue=function(){if(this.size){var e=this.items[this.offset];return 2*++this.offset>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,e}},a.prototype.peek=function(){if(this.size)return this.items[this.offset]},a.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var r=this.offset,n=0,i=this.items.length;r=e.length)return{done:!0};var r=e[t];return t++,{value:r,done:!1}})},a.prototype.entries=function(){var e=this.items,t=this.offset,r=0;return new n(function(){if(t>=e.length)return{done:!0};var n=e[t];return t++,{value:[r++,n],done:!1}})},"undefined"!=typeof Symbol&&(a.prototype[Symbol.iterator]=a.prototype.values),a.prototype.toString=function(){return this.toArray().join(",")},a.prototype.toJSON=function(){return this.toArray()},a.prototype.inspect=function(){var e=this.toArray();return Object.defineProperty(e,"constructor",{value:a,enumerable:!1}),e},"undefined"!=typeof Symbol&&(a.prototype[Symbol.for("nodejs.util.inspect.custom")]=a.prototype.inspect),a.from=function(e){var t=new a;return i(e,function(e){t.enqueue(e)}),t},a.of=function(){return a.from(arguments)},e.exports=a},"l/hW":function(e,t,r){"use strict";e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return[Math.atan2(2*(t*r+n*i),1-2*(r*r+n*n)),Math.asin(2*(t*n-i*r)),Math.atan2(2*(t*i+r*n),1-2*(n*n+i*i))]}},m5Kp:function(e,t,r){var n=r("PPGm");e.exports=n},mMj5:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("FZPO"),i=function(){function e(){S(this,e)}return j(e,[{key:"fromRdf",value:function(e,t){var r=parseInt(e.value,10);return t&&(isNaN(r)||e.value.indexOf(".")>=0)&&n.Translator.incorrectRdfDataType(e),r}},{key:"toRdf",value:function(t,r){var n=r.datatype,i=r.dataFactory;return i.literal(String(t),n||i.namedNode(t<=e.MAX_INT&&t>=e.MIN_INT?e.TYPES[0]:e.TYPES[1]))}}]),e}();t.TypeHandlerNumberInteger=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648},mtbl:function(e,t,r){var n=r("tXxl"),i=r("g5aj"),a=r("x4yT");function o(e,t,r){if(!n(e))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!e.hasNode(t))throw new Error('graphology-shortest-path: the "'+t+'" source node does not exist in the given graph.');if(!e.hasNode(r))throw new Error('graphology-shortest-path: the "'+r+'" target node does not exist in the given graph.');if((t=""+t)==(r=""+r))return[t];var i=e.inboundNeighbors.bind(e),a=e.outboundNeighbors.bind(e),o={},s={};o[t]=null,s[r]=null;var u,c,l,f,h,d,p,v,g=[t],y=[r],b=!1;e:for(;g.length&&y.length;)if(g.length<=y.length){for(u=g,g=[],h=0,p=u.length;h \ No newline at end of file + \ No newline at end of file diff --git a/docs/classes/HuBMAPEntity.html b/docs/classes/HuBMAPEntity.html index ed0a1e219..7b4bf732d 100644 --- a/docs/classes/HuBMAPEntity.html +++ b/docs/classes/HuBMAPEntity.html @@ -1285,7 +1285,7 @@

RK: [RUI_ORGANS.body, RUI_ORGANS.kidney, RUI_ORGANS.right_kidney], LK: [RUI_ORGANS.body, RUI_ORGANS.kidney, RUI_ORGANS.left_kidney], HT: [RUI_ORGANS.body, RUI_ORGANS.heart], - LI: [RUI_ORGANS.body, RUI_ORGANS.colon], // large_intestine + LI: [RUI_ORGANS.body, RUI_ORGANS.large_intestine], // large_intestine SI: [RUI_ORGANS.body, RUI_ORGANS.small_instestine], LL: [RUI_ORGANS.body, RUI_ORGANS.lung, RUI_ORGANS.left_lung], RL: [RUI_ORGANS.body, RUI_ORGANS.lung, RUI_ORGANS.right_lung], @@ -1510,7 +1510,7 @@

if (assayType) { assayTypes.set(assayType, e); } - if (e.contains_human_genetic_sequences === 'yes') { + if (e.contains_human_genetic_sequences === 'yes' || e.contains_human_genetic_sequences === true) { containsSequence = true; } } diff --git a/docs/components/BlockSizeInputComponent.html b/docs/components/BlockSizeInputComponent.html index ffb003bb1..26580df79 100644 --- a/docs/components/BlockSizeInputComponent.html +++ b/docs/components/BlockSizeInputComponent.html @@ -500,7 +500,7 @@

<div class="header">
-  <span class="text title">Tissue Block Size (mm)</span>
+  <span class="text title">Tissue Block Dimensions (mm)</span>
   <div class="filler"></div>
   <mat-icon matRipple [matRippleCentered]="true" [matRippleUnbounded]="true" class="icon refresh" (click)="refreshBlockSize()">refresh</mat-icon>
 </div>
@@ -509,19 +509,19 @@ 

<mat-form-field class="field" floatLabel="always"> <mat-label class="text label">Width (X)</mat-label> <input matInput class="input" type="number" placeholder="" [value]="blockSize.x" - (input)="updateBlockSizes($event, 'x')"> + (input)="updateBlockSizes($event, 'x')" matTooltip="Enter tissue block width."> </mat-form-field> <mat-form-field class="field" floatLabel="always"> <mat-label class="text label">Height (Y)</mat-label> <input matInput class="input" type="number" placeholder="" [value]="blockSize.y" - (input)="updateBlockSizes($event, 'y')"> + (input)="updateBlockSizes($event, 'y')" matTooltip="Enter tissue block height."> </mat-form-field> <mat-form-field class="field" floatLabel="always"> <mat-label class="text label">Depth (Z)</mat-label> <input matInput class="input" type="number" placeholder="" [value]="blockSize.z" - (input)="updateBlockSizes($event, 'z')"> + (input)="updateBlockSizes($event, 'z')" matTooltip="Enter tissue block depth."> </mat-form-field> </div>

@@ -600,7 +600,7 @@