rdflib 2.2.22-1e22b5ce → 2.2.22-2cea0982
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rdflib.min.js +1 -1
- package/dist/rdflib.min.js.LICENSE.txt +2 -0
- package/dist/rdflib.min.js.map +1 -1
- package/esm/jsonldparser.js +1 -1
- package/esm/serialize.js +3 -19
- package/esm/serializer.js +23 -0
- package/lib/formula.d.ts +1 -1
- package/lib/jsonldparser.js +1 -1
- package/lib/serialize.d.ts +1 -1
- package/lib/serialize.js +3 -20
- package/lib/serializer.d.ts +1 -0
- package/lib/serializer.js +24 -0
- package/lib/store.d.ts +1 -1
- package/package.json +4 -4
- package/src/jsonldparser.js +1 -1
- package/src/serialize.ts +4 -14
- package/src/serializer.js +24 -0
package/dist/rdflib.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see rdflib.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("window")):"function"==typeof define&&define.amd?define(["window"],t):"object"==typeof exports?exports.$rdf=t(require("window")):e.$rdf=t(e.window)}(self,(e=>(()=>{var t={8333:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},7308:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={debug(e){},warn(e){},info(e){},error(e){},success(e){},msg(e){}}},6545:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(240),i=r(8333),o=r(4806),s=r(9247),a=r(2598),l=r(5904);class c extends o.Z{constructor(e){if(super((0,a._)(e)),(0,n.Z)(this,"termType",s.XM),(0,n.Z)(this,"classOrder",i.Z.NamedNode),!this.value)throw new Error("Missing IRI for NamedNode");if(!this.value.includes(":"))throw new Error('NamedNode IRI "'+e+'" must be absolute.');if(this.value.includes(" "))throw new Error('Error: NamedNode IRI "'+e+'" must not contain unencoded spaces.')}dir(){var e=this.value.split("#")[0],t=e.slice(0,-1).lastIndexOf("/"),r=e.indexOf("//");return r>=0&&t<r+2||t<0?null:new c(e.slice(0,t+1))}site(){var e=this.value.split("#")[0],t=e.indexOf("//");if(t<0)throw new Error("This URI does not have a web site part (origin)");var r=e.indexOf("/",t+2);return new c(r<0?e.slice(0)+"/":e.slice(0,r+1))}doc(){return this.value.indexOf("#")<0?this:new c(this.value.split("#")[0])}toString(){return"<"+this.value+">"}id(){return this.value.split("#")[1]}get uri(){return this.value}set uri(e){this.value=e}static fromValue(e){return null==e||(0,l.jt)(e)?e:new c(e)}}},4806:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(240),i=r(292);class o{constructor(e){(0,n.Z)(this,"termType",void 0),(0,n.Z)(this,"classOrder",void 0),(0,n.Z)(this,"value",void 0),this.value=e}substitute(e){return i.log("@@@ node substitute"+this),this}compareTerm(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.value<e.value?-1:this.value>e.value?1:0}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value}hashString(){return this.toCanonical()}sameTerm(e){return this.equals(e)}toCanonical(){return this.toNT()}toNT(){return this.toString()}toNQ(){return this.toNT()}toString(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}(0,n.Z)(o,"fromValue",void 0),(0,n.Z)(o,"toJS",void 0)},9247:(e,t,r)=>{"use strict";r.d(t,{D7:()=>T,Eo:()=>_,Is:()=>v,NK:()=>a,UH:()=>s,V1:()=>i,XM:()=>n,_A:()=>u,aV:()=>m,b4:()=>y,fb:()=>l,lL:()=>g,ls:()=>c,oW:()=>b,qS:()=>p,sZ:()=>f,ui:()=>d,us:()=>h,xH:()=>o,xm:()=>w,z8:()=>x});const n="NamedNode",i="BlankNode",o="Literal",s="Variable",a="DefaultGraph",l="Collection",c="Empty",u="Graph",h="text/html",d="application/ld+json",p="text/n3",f="application/n3",g="application/nquads",y="application/n-quads",m="application/n-triples",v="application/rdf+xml",b="application/sparql-update",w="application/sparql-update-single-match",x="text/turtle",_="application/x-turtle",T="application/xhtml+xml"},3357:(e,t,r)=>{"use strict";r.r(t),r.d(t,{docpart:()=>s,document:()=>a,hostpart:()=>l,join:()=>c,protocol:()=>u,refTo:()=>h});var n=r(6545),i=r(292),o=o||i.log;function s(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}function a(e){return new n.Z(s(e))}function l(e){var t=/[^\/]*\/\/([^\/]*)\//.exec(e);return t?t[1]:""}function c(e,t){var r,n,i,s,a,l=t.indexOf("#");if(l>0&&(t=t.slice(0,l)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(e.indexOf(":")>=0)return e;if(r=t.indexOf(":"),0===t.length)return e;if(r<0)return o("Invalid base: "+t+" in join with given: "+e),e;if(n=t.slice(0,+r+1||9e9),0===e.indexOf("//"))return n+e;if(t.indexOf("//",r)===r+1){if((i=t.indexOf("/",r+3))<0)return t.length-r-3>0?t+"/"+e:n+e}else if((i=t.indexOf("/",r+1))<0)return t.length-r-1>0?t+"/"+e:n+e;if(0===e.indexOf("/"))return t.slice(0,i)+e;if((s=(a=t.slice(i)).lastIndexOf("/"))<0)return n+e;for(s>=0&&s<a.length-1&&(a=a.slice(0,+s+1||9e9)),a+=e;a.match(/[^\/]*\/\.\.\//);)a=a.replace(/[^\/]*\/\.\.\//,"");return a=(a=a.replace(/\.\//g,"")).replace(/\/\.$/,"/"),t.slice(0,i)+a}function u(e){const t=e.indexOf(":");return t<0?null:e.slice(0,t)}function h(e,t){var r,n,i,o,s,a,l,c,u,h,d,p,f=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!e)return t;if(e===t)return"";for(r=l=0,o=t.length;l<o&&t[r]===e[r];r=++l);if(e.slice(0,r).match(f)&&((n=t.indexOf("//"))<0&&(n=-2),i=t.indexOf("/",n+2),"/"!==t[i+1]&&"/"!==e[i+1]&&t.slice(0,i)===e.slice(0,i)))return t.slice(i);if("#"===t[r]&&e.length===r)return t.slice(r);for(;r>0&&"/"!==t[r-1];)r--;if(r<3)return t;if(e.indexOf("//",r-2)>0||t.indexOf("//",r-2)>0)return t;if(e.indexOf(":",r)>0)return t;for(a=0,c=0,s=(h=e.slice(r)).length;c<s;c++)"/"===h[c]&&a++;if(0===a&&r<t.length&&"#"===t[r])return"./"+t.slice(r);if(0===a&&r===t.length)return"./";if(p="",a>0)for(u=1,d=a;d>=1?u<=d:u>=d;d>=1?++u:--u)p+="../";return p+t.slice(r)}},5115:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DOMParserFactory:()=>d,RDFArrayRemove:()=>w,callbackify:()=>h,domToString:()=>p,dtstamp:()=>g,dumpNode:()=>f,heavyCompare:()=>y,heavyCompareSPO:()=>m,linkRelationProperty:()=>u,log:()=>n.Z,mediaTypeClass:()=>c,output:()=>v,parseXML:()=>b,stackString:()=>_,string:()=>l,string_startswith:()=>x,uri:()=>i});var n=r(7308),i=r(3357),o=r(6545),s=r(870);e=r.hmd(e);var a=r(292);const l={template:function(e,t){for(var r=e.split("%s"),n="",i=0;i<t.length;i++)t[i]+="",n+=r[i]+t[i];return n+r.slice(t.length).join()}};function c(e){return e=e.split(";")[0].trim(),new o.Z("http://www.w3.org/ns/iana/media-types/"+e+"#Resource")}function u(e){return new o.Z("http://www.w3.org/ns/iana/link-relations/relation#"+e.trim())}function h(e,t){e.callbacks={};for(var r=t.length-1;r>=0;r--)e.callbacks[t[r]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,r){e.callbacks[t].push(r)},e.removeCallback=function(t,r){for(var n=0;n<e.callbacks[t].length;n++)if(e.callbacks[t][n].name===r)return e.callbacks[t].splice(n,1),!0;return!1},e.insertCallback=function(t,r){e.callbacks[t].unshift(r)},e.fireCallbacks=function(t,r){var n,i=[],o=[],s=e.callbacks[t].length;let a;for(n=s-1;n>=0;n--)a=e.callbacks[t][n],a&&a.apply(e,r)&&i.push(a);for(n=i.length-1;n>=0;n--)o.push(i[n]);for(n=s;n<e.callbacks[t].length;n++)o.push(e.callbacks[t][n]);e.callbacks[t]=o}}function d(){return window.DOMParser?new s.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function p(e,t){var r=[];(t=t||{})&&t.selfClosing&&t.selfClosing.split(" ").forEach((function(e){r[e]=!0}));var n=[];return t&&t.skipAttributes&&t.skipAttributes.split(" ").forEach((function(e){n[e]=!0})),f(e,t,r,n)}function f(e,t,r,n){var i,o="",s=[!1];if(void 0===e.nodeType)return o;if(1===e.nodeType){if(e.hasAttribute("class")&&t&&t.classWithChildText&&e.matches(t.classWithChildText.class))o+=e.querySelector(t.classWithChildText.element).textContent;else if(!(t&&t.skipNodeWithClass&&e.matches("."+t.skipNodeWithClass))){var l=e.nodeName.toLowerCase();o+="<"+l;var c=[];for(i=e.attributes.length-1;i>=0;i--){var u=e.attributes[i];if(!(n&&n.length>0&&n[u.name]||/^\d+$/.test(u.name))){if("class"===u.name&&t&&t.replaceClassItemWith&&u.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var h=new RegExp(t.replaceClassItemWith.source,"g");u.value=u.value.replace(h,t.replaceClassItemWith.target).trim()}"class"===u.name&&t&&t.skipClassWithValue&&t.skipClassWithValue===u.value||c.push(u.name+"='"+u.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,""")+"'")}}if(c.length>0&&(t&&t.sortAttributes&&c.sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),o+=" "+c.join(" ")),r&&r.ename)o+=" />";else{for(o+=">",o+="html"===l?"\n ":"",s.push("style"===l||"script"===l),i=0;i<e.childNodes.length;i++)o+=f(e.childNodes[i]);s.pop(),o+="body"===l?"</"+l+">\n":"</"+l+">"}}}else if(8===e.nodeType)o+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var d=e.nodeValue.replace(/\n+$/,"");o+=s[s.length-1]?d:d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}else a.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),a.log(e);return o}function g(){var e=new Date,t=e.getYear()+1900,r=e.getMonth()+1,n=e.getDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),s=e.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),o<10&&(o="0"+o),s<10&&(s="0"+s),t+"-"+r+"-"+n+"T"+i+":"+o+":"+s+"Z"}function y(e,t,r,n){var i=function(e){return"BlankNode"===e.termType?null:e},o=function(e){var t=r.statementsMatching(e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})).concat(r.statementsMatching(void 0,void 0,e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})));return t.sort(),t.join("\n")};const s=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(e,t):e.compareTerm(t);return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===s?0:o(e)>o(t)?1:o(e)<o(t)?-1:s:n&&e.uri&&t.uri?(n[e.uri]||e.uri).localeCompare(n[t.uri]||t.uri):s}function m(e,t,r,n){return y(e.subject,t.subject,r,n)||y(e.predicate,t.predicate,r,n)||y(e.object,t.object,r,n)}function v(e){var t=document.createElement("div");t.textContent=e,document.body.appendChild(t)}function b(t,r){return r=r||{},e&&e.exports?(new s.DOMParser).parseFromString(t,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new s.DOMParser).parseFromString(t,"application/xml")}function w(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.why))return void e.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+t+" "+t.why)}function x(e,t){return e.slice(0,t.length)===t}function _(e){var t=e+"\n";if(!e.stack)return t+"No stack available.\n";for(var r=e.stack.toString().split("\n"),n=[],i=0;i<r.length;i++){var o=r[i];if(o.indexOf("ecmaunit.js")>-1)break;"("==o.charAt(0)&&(o="function"+o);var s=o.split("@");n.push(s)}for(i=0;i<n.length;i++)t+=" "+n[i][1]+"\n "+n[i][0];return t}},2598:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?e:e.value}r.d(t,{_:()=>n})},5904:(e,t,r)=>{"use strict";r.d(t,{B2:()=>g,NA:()=>b,NX:()=>f,PY:()=>p,Pv:()=>o,Uc:()=>a,Yi:()=>i,cG:()=>u,f:()=>l,jt:()=>h,lt:()=>v,lx:()=>m,n_:()=>d,nq:()=>c,uZ:()=>s,zz:()=>y});var n=r(9247);function i(e){return"object"==typeof e&&null!==e&&"subject"in e}function o(e){return"object"==typeof e&&null!==e&&"statements"in e}function s(e){return h(e)&&e.termType===n.fb}function a(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.fb||e.termType===n.xH||e.termType===n._A)}function l(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.fb||e.termType===n.xH||e.termType===n._A)}function c(e){return h(e)&&(e.termType===n.XM||e.termType===n.V1||e.termType===n.UH)}function u(e){return h(e)&&e.termType===n.UH}function h(e){return"object"==typeof e&&null!==e&&"termType"in e}function d(e){return e.termType===n.xH}function p(e){return"object"==typeof e&&null!==e&&"subject"in e&&"predicate"in e&&"object"in e}function f(e){return h(e)&&"NamedNode"===e.termType}function g(e){return h(e)&&"termType"in e&&"BlankNode"===e.termType}function y(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1)}function m(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH)}function v(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.xH)}function b(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.NK)}},6118:(e,t,r)=>{"use strict";var n=r(2530),i=r(292);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},o(e)}var s,a,l=r(8619).codes,c=l.ERR_AMBIGUOUS_ARGUMENT,u=l.ERR_INVALID_ARG_TYPE,h=l.ERR_INVALID_ARG_VALUE,d=l.ERR_INVALID_RETURN_VALUE,p=l.ERR_MISSING_ARGS,f=r(6979),g=r(5663).inspect,y=r(5663).types,m=y.isPromise,v=y.isRegExp,b=Object.assign?Object.assign:r(1662).assign,w=Object.is?Object.is:r(7402);function x(){var e=r(1667);s=e.isDeepEqual,a=e.isDeepStrictEqual}new Map;var _=!1,T=e.exports=O,N={};function j(e){if(e.message instanceof Error)throw e.message;throw new f(e)}function E(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new f({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function O(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];E.apply(void 0,[O,t.length].concat(t))}T.fail=function e(t,r,o,s,a){var l,c=arguments.length;if(0===c)l="Failed";else if(1===c)o=t,t=void 0;else{if(!1===_){_=!0;var u=n.emitWarning?n.emitWarning:i.warn.bind(i);u("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===c&&(s="!=")}if(o instanceof Error)throw o;var h={actual:t,expected:r,operator:void 0===s?"fail":s,stackStartFn:a||e};void 0!==o&&(h.message=o);var d=new f(h);throw l&&(d.message=l,d.generatedMessage=!0),d},T.AssertionError=f,T.ok=O,T.equal=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");t!=r&&j({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},T.notEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");t==r&&j({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},T.deepEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===s&&x(),s(t,r)||j({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},T.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===s&&x(),s(t,r)&&j({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},T.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===s&&x(),a(t,r)||j({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},T.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===s&&x(),a(t,r)&&j({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},T.strictEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");w(t,r)||j({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},T.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");w(t,r)&&j({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var S=function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&v(t[e])&&t[e].test(n[e])?i[e]=n[e]:i[e]=t[e])}))};function I(e,t,r,n,i,o){if(!(r in e)||!a(e[r],t[r])){if(!n){var s=new S(e,i),l=new S(t,i,e),c=new f({actual:s,expected:l,operator:"deepStrictEqual",stackStartFn:o});throw c.actual=e,c.expected=t,c.operator=o.name,c}j({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}function A(e,t,r,n){if("function"!=typeof t){if(v(t))return t.test(e);if(2===arguments.length)throw new u("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var i=new f({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var a=Object.keys(t);if(t instanceof Error)a.push("name","message");else if(0===a.length)throw new h("error",t,"may not be an empty object");return void 0===s&&x(),a.forEach((function(i){"string"==typeof e[i]&&v(t[i])&&t[i].test(e[i])||I(e,t,i,r,a,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function k(e){if("function"!=typeof e)throw new u("fn","Function",e);try{e()}catch(e){return e}return N}function R(e){return m(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function C(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!R(t=e()))throw new d("instance of Promise","promiseFn",t)}else{if(!R(e))throw new u("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return N})).catch((function(e){return e}))}))}function D(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new u("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new c("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new c("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new u("error",["Object","Error","Function","RegExp"],r);if(t===N){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var s="rejects"===e.name?"rejection":"exception";j({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(s).concat(i),stackStartFn:e})}if(r&&!A(t,r,n,e))throw t}function L(e,t,r,n){if(t!==N){if("string"==typeof r&&(n=r,r=void 0),!r||A(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";j({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function P(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];E.apply(void 0,[P,t.length].concat(t))}T.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];D.apply(void 0,[e,k(t)].concat(n))},T.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return D.apply(void 0,[e,t].concat(n))}))},T.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];L.apply(void 0,[e,k(t)].concat(n))},T.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return L.apply(void 0,[e,t].concat(n))}))},T.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=g(t);var n=new f({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var s=i.split("\n");s.shift();for(var a=n.stack.split("\n"),l=0;l<s.length;l++){var c=a.indexOf(s[l]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},T.strict=b(P,T,{equal:T.strictEqual,deepEqual:T.deepStrictEqual,notEqual:T.notStrictEqual,notDeepEqual:T.notDeepStrictEqual}),T.strict.strict=T.strict},6979:(e,t,r)=>{"use strict";var n=r(2530);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}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?a(e):t}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;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,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},l(e)}function c(){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,r){return u=c()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&h(i,r.prototype),i},u.apply(null,arguments)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function p(e){return p="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},p(e)}var f=r(5663).inspect,g=r(8619).codes.ERR_INVALID_ARG_TYPE;function y(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var m="",v="",b="",w="",x={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function T(e){return f(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var N=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==p(e)||null===e)throw new g("options","Object",e);var i=e.message,o=e.operator,l=e.stackStartFn,c=e.actual,u=e.expected,h=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=s(this,d(t).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(m="[34m",v="[32m",w="[39m",b="[31m"):(m="",v="",w="",b="")),"object"===p(c)&&null!==c&&"object"===p(u)&&null!==u&&"stack"in c&&c instanceof Error&&"stack"in u&&u instanceof Error&&(c=_(c),u=_(u)),"deepStrictEqual"===o||"strictEqual"===o)r=s(this,d(t).call(this,function(e,t,r){var i="",o="",s=0,a="",l=!1,c=T(e),u=c.split("\n"),h=T(t).split("\n"),d=0,f="";if("strictEqual"===r&&"object"===p(e)&&"object"===p(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===h.length&&u[0]!==h[0]){var g=u[0].length+h[0].length;if(g<=10){if(!("object"===p(e)&&null!==e||"object"===p(t)&&null!==t||0===e&&0===t))return"".concat(x[r],"\n\n")+"".concat(u[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&g<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;u[0][d]===h[0][d];)d++;d>2&&(f="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",d),"^"),d=0)}}for(var _=u[u.length-1],N=h[h.length-1];_===N&&(d++<2?a="\n ".concat(_).concat(a):i=_,u.pop(),h.pop(),0!==u.length&&0!==h.length);)_=u[u.length-1],N=h[h.length-1];var j=Math.max(u.length,h.length);if(0===j){var E=c.split("\n");if(E.length>30)for(E[26]="".concat(m,"...").concat(w);E.length>27;)E.pop();return"".concat(x.notIdentical,"\n\n").concat(E.join("\n"),"\n")}d>3&&(a="\n".concat(m,"...").concat(w).concat(a),l=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var O=0,S=x[r]+"\n".concat(v,"+ actual").concat(w," ").concat(b,"- expected").concat(w),I=" ".concat(m,"...").concat(w," Lines skipped");for(d=0;d<j;d++){var A=d-s;if(u.length<d+1)A>1&&d>2&&(A>4?(o+="\n".concat(m,"...").concat(w),l=!0):A>3&&(o+="\n ".concat(h[d-2]),O++),o+="\n ".concat(h[d-1]),O++),s=d,i+="\n".concat(b,"-").concat(w," ").concat(h[d]),O++;else if(h.length<d+1)A>1&&d>2&&(A>4?(o+="\n".concat(m,"...").concat(w),l=!0):A>3&&(o+="\n ".concat(u[d-2]),O++),o+="\n ".concat(u[d-1]),O++),s=d,o+="\n".concat(v,"+").concat(w," ").concat(u[d]),O++;else{var k=h[d],R=u[d],C=R!==k&&(!y(R,",")||R.slice(0,-1)!==k);C&&y(k,",")&&k.slice(0,-1)===R&&(C=!1,R+=","),C?(A>1&&d>2&&(A>4?(o+="\n".concat(m,"...").concat(w),l=!0):A>3&&(o+="\n ".concat(u[d-2]),O++),o+="\n ".concat(u[d-1]),O++),s=d,o+="\n".concat(v,"+").concat(w," ").concat(R),i+="\n".concat(b,"-").concat(w," ").concat(k),O+=2):(o+=i,i="",1!==A&&0!==d||(o+="\n ".concat(R),O++))}if(O>20&&d<j-2)return"".concat(S).concat(I,"\n").concat(o,"\n").concat(m,"...").concat(w).concat(i,"\n")+"".concat(m,"...").concat(w)}return"".concat(S).concat(l?I:"","\n").concat(o).concat(i).concat(a).concat(f)}(c,u,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var f=x[o],N=T(c).split("\n");if("notStrictEqual"===o&&"object"===p(c)&&null!==c&&(f=x.notStrictEqualObject),N.length>30)for(N[26]="".concat(m,"...").concat(w);N.length>27;)N.pop();r=1===N.length?s(this,d(t).call(this,"".concat(f," ").concat(N[0]))):s(this,d(t).call(this,"".concat(f,"\n\n").concat(N.join("\n"),"\n")))}else{var j=T(c),E="",O=x[o];"notDeepEqual"===o||"notEqual"===o?(j="".concat(x[o],"\n\n").concat(j)).length>1024&&(j="".concat(j.slice(0,1021),"...")):(E="".concat(T(u)),j.length>512&&(j="".concat(j.slice(0,509),"...")),E.length>512&&(E="".concat(E.slice(0,509),"...")),"deepEqual"===o||"equal"===o?j="".concat(O,"\n\n").concat(j,"\n\nshould equal\n\n"):E=" ".concat(o," ").concat(E)),r=s(this,d(t).call(this,"".concat(j).concat(E)))}return Error.stackTraceLimit=h,r.generatedMessage=!i,Object.defineProperty(a(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=u,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(a(r),l),r.stack,r.name="AssertionError",s(r)}var r,l;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),r=t,l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:f.custom,value:function(e,t){return f(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],l&&o(r.prototype,l),t}(l(Error));e.exports=N},8619:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var s,a,l={};function c(e,t,r){r||(r=Error);var s=function(r){function s(r,o,a){var l;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),l=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i(s).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,o,a))),l.code=e,l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(s,r),s}(r);l[e]=s}function u(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))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,a,l,c,h;if(void 0===s&&(s=r(6118)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(0,a.length)===a)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))l="The ".concat(e," ").concat(o," ").concat(u(t,"type"));else{var d=("number"!=typeof h&&(h=0),h+".".length>(c=e).length||-1===c.indexOf(".",h)?"argument":"property");l='The "'.concat(e,'" ').concat(d," ").concat(o," ").concat(u(t,"type"))}return l+". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(5663));var i=a.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(6118)),s(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=l},1667:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="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},i(e)}var o=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},a=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},l=Object.is?Object.is:r(7402),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},u=Number.isNaN?Number.isNaN:r(8622);function h(e){return e.call.bind(e)}var d=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),f=h(Object.prototype.toString),g=r(5663).types,y=g.isAnyArrayBuffer,m=g.isArrayBufferView,v=g.isDate,b=g.isMap,w=g.isRegExp,x=g.isSet,_=g.isNativeError,T=g.isBoxedPrimitive,N=g.isNumberObject,j=g.isStringObject,E=g.isBooleanObject,O=g.isBigIntObject,S=g.isSymbolObject,I=g.isFloat32Array,A=g.isFloat64Array;function k(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function R(e){return Object.keys(e).filter(k).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function C(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function D(e,t,r,n){if(e===t)return 0!==e||!r||l(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&u(e)&&u(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var s,a,c,h,d=f(e);if(d!==f(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var p=R(e),g=R(t);return p.length===g.length&&P(e,t,r,n,1,p)}if("[object Object]"===d&&(!b(e)&&b(t)||!x(e)&&x(t)))return!1;if(v(e)){if(!v(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(c=e,h=t,!(o?c.source===h.source&&c.flags===h.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(h))))return!1}else if(_(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(m(e)){if(r||!I(e)&&!A(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===C(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var k=R(e),D=R(t);return k.length===D.length&&P(e,t,r,n,0,k)}if(x(e))return!(!x(t)||e.size!==t.size)&&P(e,t,r,n,2);if(b(e))return!(!b(t)||e.size!==t.size)&&P(e,t,r,n,3);if(y(e)){if(a=t,(s=e).byteLength!==a.byteLength||0!==C(new Uint8Array(s),new Uint8Array(a)))return!1}else if(T(e)&&!function(e,t){return N(e)?N(t)&&l(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):j(e)?j(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):E(e)?E(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):O(e)?O(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):S(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return P(e,t,r,n,0)}function L(e,t){return t.filter((function(t){return p(e,t)}))}function P(e,t,r,n,i,o){if(5===arguments.length){o=Object.keys(e);var s=Object.keys(t);if(o.length!==s.length)return!1}for(var a=0;a<o.length;a++)if(!d(t,o[a]))return!1;if(r&&5===arguments.length){var l=c(e);if(0!==l.length){var u=0;for(a=0;a<l.length;a++){var h=l[a];if(p(e,h)){if(!p(t,h))return!1;o.push(h),u++}else if(p(t,h))return!1}var f=c(t);if(l.length!==f.length&&L(t,f).length!==u)return!1}else{var g=c(t);if(0!==g.length&&0!==L(t,g).length)return!1}}if(0===o.length&&(0===i||1===i&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var y=n.val1.get(e);if(void 0!==y){var m=n.val2.get(t);if(void 0!==m)return y===m}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var v=H(e,t,r,o,n,i);return n.val1.delete(e),n.val2.delete(t),v}function M(e,t,r,n){for(var i=s(e),o=0;o<i.length;o++){var a=i[o];if(D(t,a,r,n))return e.delete(a),!0}return!1}function F(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(u(e))return!1}return!0}function U(e,t,r){var n=F(r);return null!=n?n:t.has(n)&&!e.has(n)}function B(e,t,r,n,i){var o=F(r);if(null!=o)return o;var s=t.get(o);return!(void 0===s&&!t.has(o)||!D(n,s,!1,i))&&!e.has(o)&&D(n,s,!1,i)}function q(e,t,r,n,i,o){for(var a=s(e),l=0;l<a.length;l++){var c=a[l];if(D(r,c,i,o)&&D(n,t.get(c),i,o))return e.delete(c),!0}return!1}function H(e,t,r,o,l,c){var u=0;if(2===c){if(!function(e,t,r,n){for(var o=null,a=s(e),l=0;l<a.length;l++){var c=a[l];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!t.has(c)){if(r)return!1;if(!U(e,t,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var u=s(t),h=0;h<u.length;h++){var d=u[h];if("object"===i(d)&&null!==d){if(!M(o,d,r,n))return!1}else if(!r&&!e.has(d)&&!M(o,d,r,n))return!1}return 0===o.size}return!0}(e,t,r,l))return!1}else if(3===c){if(!function(e,t,r,o){for(var s=null,l=a(e),c=0;c<l.length;c++){var u=n(l[c],2),h=u[0],d=u[1];if("object"===i(h)&&null!==h)null===s&&(s=new Set),s.add(h);else{var p=t.get(h);if(void 0===p&&!t.has(h)||!D(d,p,r,o)){if(r)return!1;if(!B(e,t,h,d,o))return!1;null===s&&(s=new Set),s.add(h)}}}if(null!==s){for(var f=a(t),g=0;g<f.length;g++){var y=n(f[g],2),m=(h=y[0],y[1]);if("object"===i(h)&&null!==h){if(!q(s,e,h,m,r,o))return!1}else if(!(r||e.has(h)&&D(e.get(h),m,!1,o)||q(s,e,h,m,!1,o)))return!1}return 0===s.size}return!0}(e,t,r,l))return!1}else if(1===c)for(;u<e.length;u++){if(!d(e,u)){if(d(t,u))return!1;for(var h=Object.keys(e);u<h.length;u++){var p=h[u];if(!d(t,p)||!D(e[p],t[p],r,l))return!1}return h.length===Object.keys(t).length}if(!d(t,u)||!D(e[u],t[u],r,l))return!1}for(u=0;u<o.length;u++){var f=o[u];if(!D(e[f],t[f],r,l))return!1}return!0}e.exports={isDeepEqual:function(e,t){return D(e,t,!1)},isDeepStrictEqual:function(e,t){return D(e,t,!0)}}},5155:(e,t)=>{"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=l(e),s=o[0],a=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),u=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,l=n-i;a<l;a+=s)o.push(c(e,a,a+s>l?l:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)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 c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2486:(e,t,r)=>{"use strict";var n=r(292);const i=r(5155),o=r(4525),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=c,t.h2=50;const a=2147483647;function l(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(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 d(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=l(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return f(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|g(e.length),r=l(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?l(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return h(e),l(e<0?0:0|g(e))}function p(e){const t=e.length<0?0:0|g(e.length),r=l(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function f(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function g(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(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);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let 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 k(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){let o,s=1,a=e.length,l=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;s=2,a/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function x(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Q(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return X(G(t,e.length-r),e,r,n)}function T(e,t,r,n){return X(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function N(e,t,r,n){return X(J(t),e,r,n)}function j(e,t,r,n){return X(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=S));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||void 0===n||"function"!=typeof n.error||n.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?l(e):void 0!==t?"string"==typeof r?l(e).fill(t,r):l(e).fill(t):l(e)}(e,t,r)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(W(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),W(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(W(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?O(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(W(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<a;++e)if(l[e]!==u[e]){o=l[e],s=u[e];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const 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");let o=!1;for(;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return N(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function A(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function k(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){Z(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){Z(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function M(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=K((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=K((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=K((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=K((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(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},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(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},c.prototype.writeBigUInt64LE=K((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=K((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(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},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(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},c.prototype.writeBigInt64LE=K((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=K((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const B={};function q(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function H(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Z(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,i,o)}function $(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw $(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=H(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.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;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function K(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},7615:(e,t,r)=>{"use strict";var n=r(1801),i=r(2550),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},2550:(e,t,r)=>{"use strict";var n=r(1930),i=r(1801),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),l=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),u=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=a(n,s,arguments);if(l&&c){var r=l(t,"length");r.configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var h=function(){return a(n,o,arguments)};c?c(e.exports,"apply",{value:h}):e.exports.apply=h},8981:e=>{"use strict";e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,r,n)=>t+(0===n?"":",")+e(void 0===r||"symbol"==typeof r?null:r)),"")+"]":"{"+Object.keys(t).sort().reduce(((r,n,i)=>void 0===t[n]||"symbol"==typeof t[n]?r:r+(0===r.length?"":",")+e(n)+":"+e(t[n])),"")+"}"}},292:(e,t,r)=>{var n=r(5663),i=r(6118);function o(){return(new Date).getTime()}var s,a=Array.prototype.slice,l={};s=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){s.log.apply(s,arguments)},"info"],[function(){s.log.apply(s,arguments)},"warn"],[function(){s.warn.apply(s,arguments)},"error"],[function(e){l[e]=o()},"time"],[function(e){var t=l[e];if(!t)throw new Error("No such label: "+e);delete l[e];var r=o()-t;s.log(e+": "+r+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=n.format.apply(null,arguments),s.error(e.stack)},"trace"],[function(e){s.log(n.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=a.call(arguments,1);i.ok(!1,n.format.apply(null,t))}},"assert"]],u=0;u<c.length;u++){var h=c[u],d=h[0],p=h[1];s[p]||(s[p]=d)}e.exports=s},7297:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=u(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=u(t)},d.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),h(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),h(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),v.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];x.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function T(e,r){return new Promise((function(n,o){var s=new b(e,r);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new x(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",l)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}T.polyfill=!0,e.fetch||(e.fetch=T,e.Headers=d,e.Request=b,e.Response=x),t.Headers=d,t.Request=b,t.Response=x,t.fetch=T,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},9170:(e,t,r)=>{"use strict";var n=r(806),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,l=r(8198)(),c=a&&l,u=function(e,t,r,n){var i;(!(t in e)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(c?a(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},h=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=s.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)u(e,o[a],t[o[a]],r[o[a]])};h.supportsDescriptors=!!c,e.exports=h},1662:e=>{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),s=0,a=o.length;s<a;s++){var l=o[s],c=Object.getOwnPropertyDescriptor(i,l);void 0!==c&&c.enumerable&&(r[l]=i[l])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},4843:(e,t,r)=>{"use strict";var n=r(5443),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))},a=function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)},l=function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))};e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(e)?s(e,t,o):"string"==typeof e?a(e,t,o):l(e,t,o)}},9930:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function(e){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var s,a=r.call(arguments,1),l=function(){if(this instanceof s){var t=o.apply(this,a.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),u=[],h=0;h<c;h++)u.push("$"+h);if(s=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(l),o.prototype){var d=function(){};d.prototype=o.prototype,s.prototype=new d,d.prototype=null}return s}},1930:(e,t,r)=>{"use strict";var n=r(9930);e.exports=Function.prototype.bind||n},1801:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(e){l=null}var c=function(){throw new s},u=l?function(){try{return c}catch(e){try{return l(arguments,"callee").get}catch(e){return c}}}():c,h=r(9905)(),d=Object.getPrototypeOf||function(e){return e.__proto__},p={},f="undefined"==typeof Uint8Array?n:d(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?d(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":u,"%TypedArray%":f,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=d(i.prototype))}return g[t]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=r(1930),b=r(9284),w=v.call(Function.call,Array.prototype.concat),x=v.call(Function.apply,Array.prototype.splice),_=v.call(Function.call,String.prototype.replace),T=v.call(Function.call,String.prototype.slice),N=v.call(Function.call,RegExp.prototype.exec),j=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,O=function(e){var t=T(e,0,1),r=T(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(e,j,(function(e,t,r,i){n[n.length]=r?_(i,E,"$1"):t||e})),n},S=function(e,t){var r,n=e;if(b(m,n)&&(n="%"+(r=m[n])[0]+"%"),b(g,n)){var o=g[n];if(o===p&&(o=y(n)),void 0===o&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===N(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=O(e),n=r.length>0?r[0]:"",o=S("%"+n+"%",t),a=o.name,c=o.value,u=!1,h=o.alias;h&&(n=h[0],x(r,w([0,1],h)));for(var d=1,p=!0;d<r.length;d+=1){var f=r[d],y=T(f,0,1),m=T(f,-1);if(('"'===y||"'"===y||"`"===y||'"'===m||"'"===m||"`"===m)&&y!==m)throw new i("property names with quotes must have matching quotes");if("constructor"!==f&&p||(u=!0),b(g,a="%"+(n+="."+f)+"%"))c=g[a];else if(null!=c){if(!(f in c)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(l&&d+1>=r.length){var v=l(c,f);c=(p=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:c[f]}else p=b(c,f),c=c[f];p&&!u&&(g[a]=c)}}return c}},3828:(e,t,r)=>{"use strict";var n=r(1801)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},8198:(e,t,r)=>{"use strict";var n=r(1801)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},9905:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5682);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5682:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},4111:(e,t,r)=>{"use strict";var n=r(5682);e.exports=function(){return n()&&!!Symbol.toStringTag}},9284:(e,t,r)=>{"use strict";var n=r(1930);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4525:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,c=l>>1,u=-7,h=r?i-1:0,d=r?-1:1,p=e[t+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,c=8*o-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,f=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=f,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+p]=255&s,p+=f,s/=256,c-=8);e[r+p-f]|=128*g}},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7092:(e,t,r)=>{"use strict";var n=r(4111)(),i=r(7615)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},5443:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var d=document.all;l.call(d)===l.call(document.all)&&(h=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(s(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},7427:(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(4111)(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(s.test(o.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(e);if(!l)return!1;if(void 0===n){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&l(t)}return l(e)===n}},2100:e=>{"use strict";e.exports=function(e){return e!=e}},8622:(e,t,r)=>{"use strict";var n=r(2550),i=r(9170),o=r(2100),s=r(4358),a=r(6232),l=n(s(),Number);i(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},4358:(e,t,r)=>{"use strict";var n=r(2100);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6232:(e,t,r)=>{"use strict";var n=r(9170),i=r(4358);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2527:(e,t,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),s=o("Object.prototype.toString"),a=r(4111)(),l=r(3828),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),h=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},d=o("String.prototype.slice"),p={},f=Object.getPrototypeOf;a&&l&&f&&n(u,(function(e){var t=new c[e];if(Symbol.toStringTag in t){var r=f(t),n=l(r,Symbol.toStringTag);if(!n){var i=f(r);n=l(i,Symbol.toStringTag)}p[e]=n.get}})),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!a||!(Symbol.toStringTag in e)){var t=d(s(e),8,-1);return h(u,t)>-1}return!!l&&function(e){var t=!1;return n(p,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},5777:(e,t,r)=>{"use strict";const{isArray:n,isObject:i,isString:o}=r(8285),{asArray:s}=r(4768),{prependBase:a}=r(3866),l=r(9699),c=r(1898);function u(e){throw new l("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 r=e["@context"];if(o(r))e["@context"]=a(t,r);else if(n(r))for(let e=0;e<r.length;++e){const n=r[e];o(n)?r[e]=a(t,n):i(n)&&h({context:{"@context":n},base:t})}else if(i(r))for(const e in r)h({context:r[e],base:t})}e.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:r,base:a,cycles:l=new Set}){t&&i(t)&&t["@context"]&&(t=t["@context"]),t=s(t);const h=[];for(const s of t){if(o(s)){let t=this._get(s);t||(t=await this._resolveRemoteContext({activeCtx:e,url:s,documentLoader:r,base:a,cycles:l})),n(t)?h.push(...t):h.push(t);continue}if(null===s){h.push(new c({document:null}));continue}i(s)||u(t);const d=JSON.stringify(s);let p=this._get(d);p||(p=new c({document:s}),this._cacheResolvedContext({key:d,resolved:p,tag:"static"})),h.push(p)}return h}_get(e){let t=this.perOpCache.get(e);if(!t){const r=this.sharedCache.get(e);r&&(t=r.get("static"),t&&this.perOpCache.set(e,t))}return t}_cacheResolvedContext({key:e,resolved:t,tag:r}){if(this.perOpCache.set(e,t),void 0!==r){let n=this.sharedCache.get(e);n||(n=new Map,this.sharedCache.set(e,n)),n.set(r,t)}return t}async _resolveRemoteContext({activeCtx:e,url:t,documentLoader:r,base:n,cycles:i}){t=a(n,t);const{context:o,remoteDoc:s}=await this._fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:i});h({context:o,base:n=s.documentUrl||t});const l=await this.resolve({activeCtx:e,context:o,documentLoader:r,base:n,cycles:i});return this._cacheResolvedContext({key:t,resolved:l,tag:s.tag}),l}async _fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:s}){if(s.size>10)throw new l("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(s.has(t))throw new l("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let a,c;s.add(t);try{c=await r(t),a=c.document||null,o(a)&&(a=JSON.parse(a))}catch(e){throw new l("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:e})}if(!i(a))throw new l("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 a="@context"in a?{"@context":a["@context"]}:{"@context":{}},c.contextUrl&&(n(a["@context"])||(a["@context"]=[a["@context"]]),a["@context"].push(c.contextUrl)),{context:a,remoteDoc:c}}}},9699:e=>{"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",r={}){super(e),this.name=t,this.message=e,this.details=r}}},7298:e=>{"use strict";e.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,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}},7990:(e,t,r)=>{"use strict";e.exports=r(2948).NQuads},3114:e=>{"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}},1898:(e,t,r)=>{"use strict";const n=r(3666);e.exports=class{constructor({document:e}){this.document=e,this.cache=new n({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},120:(e,t,r)=>{"use strict";const n=r(9699),{isArray:i,isObject:o,isString:s,isUndefined:a}=r(8285),{isList:l,isValue:c,isGraph:u,isSimpleGraph:h,isSubjectReference:d}=r(478),{expandIri:p,getContextValue:f,isKeyword:g,process:y,processingMode:m}=r(2182),{removeBase:v,prependBase:b}=r(3866),{REGEX_KEYWORD:w,addValue:x,asArray:_,compareShortestLeast:T}=r(4768),N={};function j(e,t,r){if("@nest"!==p(e,t,{vocab:!0},r))throw new n("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=N,N.compact=async({activeCtx:e,activeProperty:t=null,element:r,options:p={}})=>{if(i(r)){let n=[];for(let i=0;i<r.length;++i){const o=await N.compact({activeCtx:e,activeProperty:t,element:r[i],options:p});null!==o&&n.push(o)}return p.compactArrays&&1===n.length&&0===(f(e,t,"@container")||[]).length&&(n=n[0]),n}const v=f(e,t,"@context");if(a(v)||(e=await y({activeCtx:e,localCtx:v,propagate:!0,overrideProtected:!0,options:p})),o(r)){if(p.link&&"@id"in r&&p.link.hasOwnProperty(r["@id"])){const e=p.link[r["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===r)return e[t].compacted}if(c(r)||d(r)){const n=N.compactValue({activeCtx:e,activeProperty:t,value:r,options:p});return p.link&&d(r)&&(p.link.hasOwnProperty(r["@id"])||(p.link[r["@id"]]=[]),p.link[r["@id"]].push({expanded:r,compacted:n})),n}if(l(r)&&(f(e,t,"@container")||[]).includes("@list"))return N.compact({activeCtx:e,activeProperty:t,element:r["@list"],options:p});const v="@reverse"===t,b={},w=e;c(r)||d(r)||(e=e.revertToPreviousContext());const T=f(w,t,"@context");a(T)||(e=await y({activeCtx:e,localCtx:T,propagate:!0,overrideProtected:!0,options:p})),p.link&&"@id"in r&&(p.link.hasOwnProperty(r["@id"])||(p.link[r["@id"]]=[]),p.link[r["@id"]].push({expanded:r,compacted:b}));let E=r["@type"]||[];E.length>1&&(E=Array.from(E).sort());const O=e;for(const t of E){const r=N.compactIri({activeCtx:O,iri:t,relativeTo:{vocab:!0}}),n=f(w,r,"@context");a(n)||(e=await y({activeCtx:e,localCtx:n,options:p,propagate:!1}))}const S=Object.keys(r).sort();for(const a of S){const d=r[a];if("@id"!==a)if("@type"!==a)if("@reverse"!==a)if("@preserve"!==a)if("@index"!==a)if("@graph"!==a&&"@list"!==a&&"@included"!==a&&g(a)){const t=N.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,t,d)}else{if(!i(d))throw new n("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===d.length){const t=N.compactIri({activeCtx:e,iri:a,value:d,relativeTo:{vocab:!0},reverse:v}),r=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let n=b;r&&(j(e,r,p),o(b[r])||(b[r]={}),n=b[r]),x(n,t,d,{propertyIsArray:!0})}for(const t of d){const r=N.compactIri({activeCtx:e,iri:a,value:t,relativeTo:{vocab:!0},reverse:v}),n=e.mappings.has(r)?e.mappings.get(r)["@nest"]:null;let d=b;n&&(j(e,n,p),o(b[n])||(b[n]={}),d=b[n]);const g=f(e,r,"@container")||[],y=u(t),m=l(t);let w;m?w=t["@list"]:y&&(w=t["@graph"]);let T=await N.compact({activeCtx:e,activeProperty:r,element:m||y?w:t,options:p});if(m){if(i(T)||(T=[T]),g.includes("@list")){x(d,r,T,{valueIsArray:!0,allowDuplicate:!0});continue}T={[N.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:T},"@index"in t&&(T[N.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 n;d.hasOwnProperty(r)?n=d[r]:d[r]=n={};const i=(g.includes("@id")?t["@id"]:t["@index"])||N.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});x(n,i,T,{propertyIsArray:!p.compactArrays||g.includes("@set")})}else g.includes("@graph")&&h(t)?(i(T)&&T.length>1&&(T={"@included":T}),x(d,r,T,{propertyIsArray:!p.compactArrays||g.includes("@set")})):(i(T)&&1===T.length&&p.compactArrays&&(T=T[0]),T={[N.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:T},"@id"in t&&(T[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(T[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),x(d,r,T,{propertyIsArray:!p.compactArrays||g.includes("@set")}));else if(g.includes("@language")||g.includes("@index")||g.includes("@id")||g.includes("@type")){let n,i;if(d.hasOwnProperty(r)?n=d[r]:d[r]=n={},g.includes("@language"))c(T)&&(T=T["@value"]),i=t["@language"];else if(g.includes("@index")){const n=f(e,r,"@index")||"@index",o=N.compactIri({activeCtx:e,iri:n,relativeTo:{vocab:!0}});if("@index"===n)i=t["@index"],delete T[o];else{let e;if([i,...e]=_(T[n]||[]),s(i))switch(e.length){case 0:delete T[n];break;case 1:T[n]=e[0];break;default:T[n]=e}else i=null}}else if(g.includes("@id")){const t=N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=T[t],delete T[t]}else if(g.includes("@type")){const n=N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let o;switch([i,...o]=_(T[n]||[]),o.length){case 0:delete T[n];break;case 1:T[n]=o[0];break;default:T[n]=o}1===Object.keys(T).length&&"@id"in t&&(T=await N.compact({activeCtx:e,activeProperty:r,element:{"@id":t["@id"]},options:p}))}i||(i=N.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),x(n,i,T,{propertyIsArray:g.includes("@set")})}else{const e=!p.compactArrays||g.includes("@set")||g.includes("@list")||i(T)&&0===T.length||"@list"===a||"@graph"===a;x(d,r,T,{propertyIsArray:e})}}}else{if((f(e,t,"@container")||[]).includes("@index"))continue;const r=N.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,r,d)}else{const r=await N.compact({activeCtx:e,activeProperty:t,element:d,options:p});i(r)&&0===r.length||x(b,a,r)}else{const t=await N.compact({activeCtx:e,activeProperty:"@reverse",element:d,options:p});for(const r in t)if(e.mappings.has(r)&&e.mappings.get(r).reverse){const n=t[r],i=(f(e,r,"@container")||[]).includes("@set")||!p.compactArrays;x(b,r,n,{propertyIsArray:i}),delete t[r]}if(Object.keys(t).length>0){const r=N.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,r,t)}}else{let t=_(d).map((e=>N.compactIri({activeCtx:w,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const r=N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),n=(f(e,r,"@container")||[]).includes("@set")&&m(e,1.1)||i(t)&&0===d.length;x(b,r,t,{propertyIsArray:n})}else{let t=_(d).map((t=>N.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:p.base})));1===t.length&&(t=t[0]),b[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return b}return r},N.compactIri=({activeCtx:e,iri:t,value:r=null,relativeTo:i={vocab:!1},reverse:s=!1,base:a=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 n=e["@language"]||"@none",i=[];o(r)&&"@index"in r&&!("@graph"in r)&&i.push("@index","@index@set"),o(r)&&"@preserve"in r&&(r=r["@preserve"][0]),u(r)?("@index"in r&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in r||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r||i.push("@graph@id","@graph@id@set")):o(r)&&!c(r)&&i.push("@id","@id@set","@type","@set@type");let a="@language",h="@null";if(s)a="@type",h="@reverse",i.push("@set");else if(l(r)){"@index"in r||i.push("@list");const e=r["@list"];if(0===e.length)a="@any",h="@none";else{let t=0===e.length?n:null,r=null;for(let n=0;n<e.length;++n){const i=e[n];let o="@none",s="@none";if(c(i)?"@direction"in i?o=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`:"@language"in i?o=i["@language"].toLowerCase():"@type"in i?s=i["@type"]:o="@null":s="@id",null===t?t=o:o!==t&&c(i)&&(t="@none"),null===r?r=s:s!==r&&(r="@none"),"@none"===t&&"@none"===r)break}t=t||"@none",r=r||"@none","@none"!==r?(a="@type",h=r):h=t}}else{if(c(r))if("@language"in r&&!("@index"in r)){i.push("@language","@language@set"),h=r["@language"];const e=r["@direction"];e&&(h=`${h}_${e}`)}else"@direction"in r&&!("@index"in r)?h=`_${r["@direction"]}`:"@type"in r&&(a="@type",h=r["@type"]);else a="@type",h="@id";i.push("@set")}i.push("@none"),o(r)&&!("@index"in r)&&i.push("@index","@index@set"),c(r)&&1===Object.keys(r).length&&i.push("@language","@language@set");const d=function(e,t,r,n,i,s){null===s&&(s="@null");const a=[];if(("@id"===s||"@reverse"===s)&&o(r)&&"@id"in r){"@reverse"===s&&a.push("@reverse");const t=N.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===r["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}else{a.push(s);const e=a.find((e=>e.includes("_")));e&&a.push(e.replace(/^[^_]+_/,"_"))}a.push("@none");const l=e.inverse[t];for(const e of n){if(!(e in l))continue;const t=l[e][i];for(const e of a)if(e in t)return t[e]}return null}(e,t,r,i,a,h);if(null!==d)return d}if(i.vocab&&"@vocab"in e){const r=e["@vocab"];if(0===t.indexOf(r)&&t!==r){const n=t.substr(r.length);if(!e.mappings.has(n))return n}}let d=null;const p=[];let f=e.fastCurieMap;const y=t.length-1;for(let e=0;e<y&&t[e]in f;++e)f=f[t[e]],""in f&&p.push(f[""][0]);for(let n=p.length-1;n>=0;--n){const i=p[n],o=i.terms;for(const n of o){const o=n+":"+t.substr(i.iri.length);e.mappings.get(n)._prefix&&(!e.mappings.has(o)||null===r&&e.mappings.get(o)["@id"]===t)&&(null===d||T(o,d)<0)&&(d=o)}}if(null!==d)return d;for(const[r,i]of e.mappings)if(i&&i._prefix&&t.startsWith(r+":"))throw new n(`Absolute IRI "${t}" confused with prefix "${r}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!i.vocab){if("@base"in e){if(e["@base"]){const r=v(b(a,e["@base"]),t);return w.test(r)?`./${r}`:r}return t}return v(a,t)}return t},N.compactValue=({activeCtx:e,activeProperty:t,value:r,options:n})=>{if(c(r)){const n=f(e,t,"@type"),i=f(e,t,"@language"),o=f(e,t,"@direction"),a=f(e,t,"@container")||[],l="@index"in r&&!a.includes("@index");if(!l&&"@none"!==n){if(r["@type"]===n)return r["@value"];if("@language"in r&&r["@language"]===i&&"@direction"in r&&r["@direction"]===o)return r["@value"];if("@language"in r&&r["@language"]===i)return r["@value"];if("@direction"in r&&r["@direction"]===o)return r["@value"]}const c=Object.keys(r).length,u=1===c||2===c&&"@index"in r&&!l,h="@language"in e,d=s(r["@value"]),p=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(u&&"@none"!==n&&(!h||!d||p))return r["@value"];const g={};return l&&(g[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=r["@index"]),"@type"in r?g[N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=N.compactIri({activeCtx:e,iri:r["@type"],relativeTo:{vocab:!0}}):"@language"in r&&(g[N.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=r["@language"]),"@direction"in r&&(g[N.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=r["@direction"]),g[N.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=r["@value"],g}const i=p(e,t,{vocab:!0},n),o=f(e,t,"@type"),a=N.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:"@vocab"===o},base:n.base});return"@id"===o||"@vocab"===o||"@graph"===i?a:{[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:a}}},2445:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},2182:(e,t,r)=>{"use strict";const n=r(4768),i=r(9699),{isArray:o,isObject:s,isString:a,isUndefined:l}=r(8285),{isAbsolute:c,isRelative:u,prependBase:h}=r(3866),{handleEvent:d}=r(5746),{REGEX_BCP47:p,REGEX_KEYWORD:f,asArray:g,compareShortestLeast:y}=r(4768),m=new Map,v={};function b(e,t,r,n,i,o){if(null===t||!a(t)||v.isKeyword(t))return t;if(t.match(f))return null;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&v.createTermDefinition({activeCtx:e,localCtx:n,term:t,defined:i,options:o}),(r=r||{}).vocab){const r=e.mappings.get(t);if(null===r)return null;if(s(r)&&"@id"in r)return r["@id"]}const l=t.indexOf(":");if(l>0){const r=t.substr(0,l),s=t.substr(l+1);if("_"===r||0===s.indexOf("//"))return t;n&&n.hasOwnProperty(r)&&v.createTermDefinition({activeCtx:e,localCtx:n,term:r,defined:i,options:o});const a=e.mappings.get(r);if(a&&a._prefix)return a["@id"]+s;if(c(t))return t}if(r.vocab&&"@vocab"in e)t=e["@vocab"]+t;else if(r.base){let r,n;"@base"in e?e["@base"]?(n=h(o.base,e["@base"]),r=h(n,t)):(n=e["@base"],r=t):(n=o.base,r=h(o.base,t)),t=r}return t}function w(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!w(e[r],t[r]))return!1;return!0}const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r in e){let n=e[r],i=t[r];if("@container"===r&&Array.isArray(n)&&Array.isArray(i)&&(n=n.slice().sort(),i=i.slice().sort()),!w(n,i))return!1}return!0}e.exports=v,v.process=async({activeCtx:e,localCtx:t,options:r,propagate:n=!0,overrideProtected:l=!1,cycles:f=new Set})=>{if(s(t)&&"@context"in t&&o(t["@context"])&&(t=t["@context"]),0===g(t).length)return e;const y=[],m=[({event:e,next:t})=>{y.push(e),t()}];r.eventHandler&&m.push(r.eventHandler);const w=r;r={...r,eventHandler:m};const x=await r.contextResolver.resolve({activeCtx:e,context:t,documentLoader:r.documentLoader,base:r.base});s(x[0].document)&&"boolean"==typeof x[0].document["@propagate"]&&(n=x[0].document["@propagate"]);let _=e;n||_.previousContext||(_=_.clone(),_.previousContext=e);for(const n of x){let{document:o}=n;if(e=_,null===o){if(!l&&0!==Object.keys(e.protected).length)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});_=e=v.getInitialContext(r).clone();continue}const g=n.getProcessed(e);if(g){if(w.eventHandler)for(const e of g.events)d({event:e,options:w});_=e=g.context;continue}if(s(o)&&"@context"in o&&(o=o["@context"]),!s(o))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:o});_=_.clone();const m=new Map;if("@version"in o){if(1.1!==o["@version"])throw new i("Unsupported JSON-LD version: "+o["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:o});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+o["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:o});_.processingMode="json-ld-1.1",_["@version"]=o["@version"],m.set("@version",!0)}if(_.processingMode=_.processingMode||e.processingMode,"@base"in o){let e=o["@base"];if(null===e||c(e));else{if(!u(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:o});e=h(_["@base"],e)}_["@base"]=e,m.set("@base",!0)}if("@vocab"in o){const e=o["@vocab"];if(null===e)delete _["@vocab"];else{if(!a(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:o});if(!c(e)&&v.processingMode(_,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:o});{const t=b(_,e,{vocab:!0,base:!0},void 0,void 0,r);c(t)||r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:r}),_["@vocab"]=t}}m.set("@vocab",!0)}if("@language"in o){const e=o["@language"];if(null===e)delete _["@language"];else{if(!a(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:o});e.match(p)||r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:r}),_["@language"]=e.toLowerCase()}m.set("@language",!0)}if("@direction"in o){const t=o["@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:o});if(null===t)delete _["@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:o});_["@direction"]=t}m.set("@direction",!0)}if("@propagate"in o){const r=o["@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:o});if("boolean"!=typeof r)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});m.set("@propagate",!0)}if("@import"in o){const n=o["@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:o});if(!a(n))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const s=await r.contextResolver.resolve({activeCtx:e,context:n,documentLoader:r.documentLoader,base:r.base});if(1!==s.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const l=s[0].getProcessed(e);if(l)o=l;else{const r=s[0].document;if("@import"in r)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 r)o.hasOwnProperty(e)||(o[e]=r[e]);s[0].setProcessed(e,o)}m.set("@import",!0)}m.set("@protected",o["@protected"]||!1);for(const e in o)if(v.createTermDefinition({activeCtx:_,localCtx:o,term:e,defined:m,options:r,overrideProtected:l}),s(o[e])&&"@context"in o[e]){const t=o[e]["@context"];let n=!0;if(a(t)){const e=h(r.base,t);f.has(e)?n=!1:f.add(e)}if(n)try{await v.process({activeCtx:_.clone(),localCtx:o[e]["@context"],overrideProtected:!0,options:r,cycles:f})}catch(t){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:o[e]["@context"],term:e})}}n.setProcessed(e,{context:_,events:y})}return _},v.createTermDefinition=({activeCtx:e,localCtx:t,term:r,defined:n,options:l,overrideProtected:u=!1})=>{if(n.has(r)){if(n.get(r))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:r})}let h;if(n.set(r,!1),t.hasOwnProperty(r)&&(h=t[r]),"@type"===r&&s(h)&&"@set"===(h["@container"]||"@set")&&v.processingMode(e,1.1)){const e=["@container","@id","@protected"],n=Object.keys(h);if(0===n.length||n.some((t=>!e.includes(t))))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r})}else{if(v.isKeyword(r))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r});if(r.match(f))return void(l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:r}},options:l}));if(""===r)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const p=e.mappings.get(r);e.mappings.has(r)&&e.mappings.delete(r);let g=!1;if((a(h)||null===h)&&(g=!0,h={"@id":h}),!s(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 y={};e.mappings.set(r,y),y.reverse=!1;const m=["@container","@id","@language","@reverse","@type"];v.processingMode(e,1.1)&&m.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in h)if(!m.includes(e))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const x=r.indexOf(":");if(y._termHasColon=x>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(!a(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(o.match(f))return l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:o}},options:l}),void(p?e.mappings.set(r,p):e.mappings.delete(r));const s=b(e,o,{vocab:!0,base:!1},t,n,l);if(!c(s))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});y["@id"]=s,y.reverse=!0}else if("@id"in h){let o=h["@id"];if(o&&!a(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)y["@id"]=null;else{if(!v.isKeyword(o)&&o.match(f))return l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:o}},options:l}),void(p?e.mappings.set(r,p):e.mappings.delete(r));if(o!==r){if(o=b(e,o,{vocab:!0,base:!1},t,n,l),!c(o)&&!v.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(r.match(/(?::[^:])|\//)&&b(e,r,{vocab:!0,base:!1},t,new Map(n).set(r,!0),l)!==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});y["@id"]=o,y._prefix=g&&!y._termHasColon&&o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in y))if(y._termHasColon){const i=r.substr(0,x);if(t.hasOwnProperty(i)&&v.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:n,options:l}),e.mappings.has(i)){const t=r.substr(x+1);y["@id"]=e.mappings.get(i)["@id"]+t}else y["@id"]=r}else if("@type"===r)y["@id"]=r;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:r});y["@id"]=e["@vocab"]+r}if((!0===h["@protected"]||!0===n.get("@protected")&&!1!==h["@protected"])&&(e.protected[r]=!0,y.protected=!0),n.set(r,!0),"@type"in h){let r=h["@type"];if(!a(r))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"===r||"@none"===r){if(v.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${r}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==r&&"@vocab"!==r){if(r=b(e,r,{vocab:!0,base:!1},t,n,l),!c(r))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===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:t})}y["@type"]=r}if("@container"in h){const r=a(h["@container"])?[h["@container"]]:h["@container"]||[],n=["@list","@set","@index","@language"];let s=!0;const l=r.includes("@set");if(v.processingMode(e,1.1)){if(n.push("@graph","@id","@type"),r.includes("@list")){if(1!==r.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(r.includes("@graph")){if(r.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 s&=r.length<=(l?2:1);if(r.includes("@type")&&(y["@type"]=y["@type"]||"@id",!["@id","@vocab"].includes(y["@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 s&=!o(h["@container"]),s&=r.length<=1;if(s&=r.every((e=>n.includes(e))),s&=!(l&&r.includes("@list")),!s)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+n.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(y.reverse&&!r.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});y["@container"]=r}if("@index"in h){if(!("@container"in h)||!y["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!a(h["@index"])||0===h["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});y["@index"]=h["@index"]}if("@context"in h&&(y["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let e=h["@language"];if(null!==e&&!a(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()),y["@language"]=e}if("@prefix"in h){if(r.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(v.isKeyword(y["@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});y._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});y["@direction"]=e}if("@nest"in h){const e=h["@nest"];if(!a(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});y["@nest"]=e}const _=y["@id"];if("@context"===_||"@preserve"===_)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(p&&p.protected&&!u&&(e.protected[r]=!0,y.protected=!0,!w(p,y)))throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:r})},v.expandIri=(e,t,r,n)=>b(e,t,r,void 0,void 0,n),v.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),r=m.get(t);if(r)return r;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},r=e.fastCurieMap={},n={},i=(e["@language"]||"@none").toLowerCase(),a=e["@direction"],l=e.mappings,c=[...l.keys()].sort(y);for(const e of c){const o=l.get(e);if(null===o)continue;let c=o["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===o["@id"])continue;const u=g(o["@id"]);for(const l of u){let u=t[l];const h=v.isKeyword(l);if(u)h||o._termHasColon||n[l].push(e);else if(t[l]=u={},!h&&!o._termHasColon){n[l]=[e];const t={iri:l,terms:n[l]};l[0]in r?r[l[0]].push(t):r[l[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],s(e,u["@any"],"@none"),o.reverse)s(e,u["@type"],"@reverse");else if("@none"===o["@type"])s(e,u["@any"],"@none"),s(e,u["@language"],"@none"),s(e,u["@type"],"@none");else if("@type"in o)s(e,u["@type"],o["@type"]);else if("@language"in o&&"@direction"in o){const t=o["@language"],r=o["@direction"];s(e,u["@language"],t&&r?`${t}_${r}`.toLowerCase():t?t.toLowerCase():r?`_${r}`:"@null")}else"@language"in o?s(e,u["@language"],(o["@language"]||"@null").toLowerCase()):"@direction"in o?o["@direction"]?s(e,u["@language"],`_${o["@direction"]}`):s(e,u["@language"],"@none"):a?(s(e,u["@language"],`_${a}`),s(e,u["@language"],"@none"),s(e,u["@type"],"@none")):(s(e,u["@language"],i),s(e,u["@language"],"@none"),s(e,u["@type"],"@none"))}}for(const e in r)o(r,e,1);return t},clone:function(){const 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===m.size&&m.clear(),m.set(t,i),i;function o(e,t,r){const n=e[t],i=e[t]={};let s,a;for(const e of n)s=e.iri,a=r>=s.length?"":s[r],a in i?i[a].push(e):i[a]=[e];for(const e in i)""!==e&&o(i,e,r+1)}function s(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},v.getContextValue=(e,t,r)=>{if(null===t){if("@context"===r)return;return null}if(e.mappings.has(t)){const n=e.mappings.get(t);if(l(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},v.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,v.isKeyword=e=>{if(!a(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}},2872:(e,t,r)=>{"use strict";const{parseLinkHeader:n,buildHeaders:i}=r(4768),{LINK_HEADER_CONTEXT:o}=r(2445),s=r(9699),a=r(3114),{prependBase:l}=r(3866),c=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:r}={headers:{}})=>(t=i(t),(new a).wrapLoader((async function i(a){if(0!==a.indexOf("http:")&&0!==a.indexOf("https:"))throw new s('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:a});if(e&&0!==a.indexOf("https"))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});let u;try{u=await function(e,t,r){const n=new(e=e||XMLHttpRequest);return new Promise(((e,i)=>{n.onload=()=>e(n),n.onerror=e=>i(e),n.open("GET",t,!0);for(const e in r)n.setRequestHeader(e,r[e]);n.send()}))}(r,a,t)}catch(e){throw new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:a,cause:e})}if(u.status>=400)throw new s("URL could not be dereferenced: "+u.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:a,httpStatusCode:u.status});let h={contextUrl:null,documentUrl:a,document:u.response},d=null;const p=u.getResponseHeader("Content-Type");let f;if(c.test(u.getAllResponseHeaders())&&(f=u.getResponseHeader("Link")),f&&"application/ld+json"!==p){const e=n(f),t=e[o];if(Array.isArray(t))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});t&&(h.contextUrl=t.target),d=e.alternate,d&&"application/ld+json"==d.type&&!(p||"").match(/^application\/(\w*\+)?json$/)&&(h=await i(l(a,d.target)))}return h})))},5746:(e,t,r)=>{"use strict";var n=r(292);const i=r(9699),{isArray:o}=r(8285),{asArray:s}=r(4768),a={};function l({event:e,handlers:t}){let r=!0;for(let n=0;r&&n<t.length;++n){r=!1;const s=t[n];if(o(s))r=l({event:e,handlers:s});else if("function"==typeof s)s({event:e,next:()=>{r=!0}});else{if("object"!=typeof s)throw new i("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in s?s[e.code]({event:e,next:()=>{r=!0}}):r=!0}}return r}e.exports=a,a.defaultEventHandler=null,a.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?a.safeEventHandler:[],e.eventHandler?s(e.eventHandler):[],a.defaultEventHandler?a.defaultEventHandler:[]);return 0===t.length?null:t},a.handleEvent=({event:e,options:t})=>{l({event:e,handlers:t.eventHandler})};const c=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference"]);a.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&c.has(e.code))throw new i("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},a.logEventHandler=function({event:e,next:t}){n.log(`EVENT: ${e.message}`,{event:e}),t()},a.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&n.warn(`WARNING: ${e.message}`,{event:e}),t()},a.unhandledEventHandler=function({event:e}){throw new i("No handler for event.","jsonld.UnhandledEvent",{event:e})},a.setDefaultEventHandler=function({eventHandler:e}={}){a.defaultEventHandler=e?s(e):null}},570:(e,t,r)=>{"use strict";const n=r(9699),{isArray:i,isObject:o,isEmptyObject:s,isString:a,isUndefined:l}=r(8285),{isList:c,isValue:u,isGraph:h,isSubject:d}=r(478),{expandIri:p,getContextValue:f,isKeyword:g,process:y,processingMode:m}=r(2182),{isAbsolute:v}=r(3866),{REGEX_BCP47:b,REGEX_KEYWORD:w,addValue:x,asArray:_,getValues:T,validateTypeValue:N}=r(4768),{handleEvent:j}=r(5746),E={};async function O({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:h,expandedParent:w,options:T={},insideList:S,typeKey:k,typeScopedContext:R}){const C=Object.keys(h).sort(),D=[];let L;const P=h[k]&&"@json"===p(e,i(h[k])?h[k][0]:h[k],{vocab:!0},{...T,typeExpansion:!0});for(const O of C){let S,k=h[O];if("@context"===O)continue;const C=p(e,O,{vocab:!0},T);if(null===C||!v(C)&&!g(C)){T.eventHandler&&j({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:O,expandedProperty:C}},options:T});continue}if(g(C)){if("@reverse"===r)throw new n("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:k});if(C in w&&"@included"!==C&&"@type"!==C)throw new n("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:C})}if("@id"===C){if(!a(k)){if(!T.isFrame)throw new n('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:k});if(o(k)){if(!s(k))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:k})}else{if(!i(k))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:k});if(!k.every((e=>a(e))))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:k})}}x(w,"@id",_(k).map((t=>{if(a(t)){const r=p(e,t,{base:!0},T);return T.eventHandler&&(null===r?j(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:T}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:T}):v(r)||j({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:r}},options:T})),r}return t})),{propertyIsArray:T.isFrame});continue}if("@type"===C){o(k)&&(k=Object.fromEntries(Object.entries(k).map((([e,t])=>[p(R,e,{vocab:!0}),_(t).map((e=>p(R,e,{base:!0,vocab:!0},{...T,typeExpansion:!0})))])))),N(k,T.isFrame),x(w,"@type",_(k).map((e=>{if(a(e)){const t=p(R,e,{base:!0,vocab:!0},{...T,typeExpansion:!0});return v(t)||T.eventHandler&&j({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:T}),t}return e})),{propertyIsArray:T.isFrame});continue}if("@included"===C&&m(e,1.1)){const r=_(await E.expand({activeCtx:e,activeProperty:t,element:k,options:T}));if(!r.every((e=>d(e))))throw new n("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:k});x(w,"@included",r,{propertyIsArray:!0});continue}if("@graph"===C&&!o(k)&&!i(k))throw new n('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:k});if("@value"===C){L=k,P&&m(e,1.1)?w["@value"]=k:x(w,"@value",k,{propertyIsArray:T.isFrame});continue}if("@language"===C){if(null===k)continue;if(!a(k)&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:k});k=_(k).map((e=>a(e)?e.toLowerCase():e));for(const e of k)a(e)&&!e.match(b)&&T.eventHandler&&j({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:T});x(w,"@language",k,{propertyIsArray:T.isFrame});continue}if("@direction"===C){if(!a(k)&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:k});k=_(k);for(const e of k)if(a(e)&&"ltr"!==e&&"rtl"!==e)throw new n('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:k});x(w,"@direction",k,{propertyIsArray:T.isFrame});continue}if("@index"===C){if(!a(k))throw new n('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:k});x(w,"@index",k);continue}if("@reverse"===C){if(!o(k))throw new n('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:k});if(S=await E.expand({activeCtx:e,activeProperty:"@reverse",element:k,options:T}),"@reverse"in S)for(const e in S["@reverse"])x(w,e,S["@reverse"][e],{propertyIsArray:!0});let t=w["@reverse"]||null;for(const e in S){if("@reverse"===e)continue;null===t&&(t=w["@reverse"]={}),x(t,e,[],{propertyIsArray:!0});const r=S[e];for(let i=0;i<r.length;++i){const o=r[i];if(u(o)||c(o))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:S});x(t,e,o,{propertyIsArray:!0})}}continue}if("@nest"===C){D.push(O);continue}let M=e;const F=f(e,O,"@context");l(F)||(M=await y({activeCtx:e,localCtx:F,propagate:!0,overrideProtected:!0,options:T}));const U=f(M,O,"@container")||[];if(U.includes("@language")&&o(k))S=I(M,k,f(M,O,"@direction"),T);else if(U.includes("@index")&&o(k)){const t=U.includes("@graph"),r=f(M,O,"@index")||"@index",n="@index"!==r&&p(e,r,{vocab:!0},T);S=await A({activeCtx:M,options:T,activeProperty:O,value:k,asGraph:t,indexKey:r,propertyIndex:n})}else if(U.includes("@id")&&o(k)){const e=U.includes("@graph");S=await A({activeCtx:M,options:T,activeProperty:O,value:k,asGraph:e,indexKey:"@id"})}else if(U.includes("@type")&&o(k))S=await A({activeCtx:M.revertToPreviousContext(),options:T,activeProperty:O,value:k,asGraph:!1,indexKey:"@type"});else{const n="@list"===C;if(n||"@set"===C){let e=t;n&&"@graph"===r&&(e=null),S=await E.expand({activeCtx:M,activeProperty:e,element:k,options:T,insideList:n})}else S="@json"===f(e,O,"@type")?{"@type":"@json","@value":k}:await E.expand({activeCtx:M,activeProperty:O,element:k,options:T,insideList:!1})}if(null!==S||"@value"===C)if("@list"!==C&&!c(S)&&U.includes("@list")&&(S={"@list":_(S)}),U.includes("@graph")&&!U.some((e=>"@id"===e||"@index"===e))&&(S=_(S).map((e=>({"@graph":_(e)})))),M.mappings.has(O)&&M.mappings.get(O).reverse){const e=w["@reverse"]=w["@reverse"]||{};S=_(S);for(let t=0;t<S.length;++t){const r=S[t];if(u(r)||c(r))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:S});x(e,C,r,{propertyIsArray:!0})}}else x(w,C,S,{propertyIsArray:!0})}if("@value"in w)if("@json"===w["@type"]&&m(e,1.1));else if((o(L)||i(L))&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:L});for(const s of D){const a=i(h[s])?h[s]:[h[s]];for(const i of a){if(!o(i)||Object.keys(i).some((t=>"@value"===p(e,t,{vocab:!0},T))))throw new n("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await O({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:i,expandedParent:w,options:T,insideList:S,typeScopedContext:R,typeKey:k})}}}function S({activeCtx:e,activeProperty:t,value:r,options:n}){if(null==r)return null;const i=p(e,t,{vocab:!0},n);if("@id"===i)return p(e,r,{base:!0},n);if("@type"===i)return p(e,r,{vocab:!0,base:!0},{...n,typeExpansion:!0});const o=f(e,t,"@type");if(("@id"===o||"@graph"===i)&&a(r)){const i=p(e,r,{base:!0},n);return null===i&&r.match(w)&&n.eventHandler&&j({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:n}),{"@id":i}}if("@vocab"===o&&a(r))return{"@id":p(e,r,{vocab:!0,base:!0},n)};if(g(i))return r;const s={};if(o&&!["@id","@vocab","@none"].includes(o))s["@type"]=o;else if(a(r)){const r=f(e,t,"@language");null!==r&&(s["@language"]=r);const n=f(e,t,"@direction");null!==n&&(s["@direction"]=n)}return["boolean","number","string"].includes(typeof r)||(r=r.toString()),s["@value"]=r,s}function I(e,t,r,o){const s=[],l=Object.keys(t).sort();for(const c of l){const l=p(e,c,{vocab:!0},o);let u=t[c];i(u)||(u=[u]);for(const e of u){if(null===e)continue;if(!a(e))throw new n("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const i={"@value":e};"@none"!==l&&(c.match(b)||o.eventHandler&&j({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:c}},options:o}),i["@language"]=c.toLowerCase()),r&&(i["@direction"]=r),s.push(i)}}return s}async function A({activeCtx:e,options:t,activeProperty:r,value:o,asGraph:s,indexKey:a,propertyIndex:c}){const d=[],g=Object.keys(o).sort(),m="@type"===a;for(let v of g){if(m){const r=f(e,v,"@context");l(r)||(e=await y({activeCtx:e,localCtx:r,propagate:!1,options:t}))}let g,b=o[v];i(b)||(b=[b]),b=await E.expand({activeCtx:e,activeProperty:r,element:b,options:t,insideList:!1,insideIndex:!0}),g=c?"@none"===v?"@none":S({activeCtx:e,activeProperty:a,value:v,options:t}):p(e,v,{vocab:!0},t),"@id"===a?v=p(e,v,{base:!0},t):m&&(v=g);for(let e of b){if(s&&!h(e)&&(e={"@graph":[e]}),"@type"===a)"@none"===g||(e["@type"]?e["@type"]=[v].concat(e["@type"]):e["@type"]=[v]);else{if(u(e)&&!["@language","@type","@index"].includes(a))throw new n(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${a}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});c?"@none"!==g&&x(e,c,g,{propertyIsArray:!0,prependValue:!0}):"@none"===g||a in e||(e[a]=v)}d.push(e)}}return d}e.exports=E,E.expand=async({activeCtx:e,activeProperty:t=null,element:r,options:c={},insideList:u=!1,insideIndex:h=!1,typeScopedContext:d=null})=>{if(null==r)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!i(r)&&!o(r))return u||null!==t&&"@graph"!==p(e,t,{vocab:!0},c)?S({activeCtx:e,activeProperty:t,value:r,options:c}):(c.eventHandler&&j({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:r}},options:c}),null);if(i(r)){let n=[];const o=f(e,t,"@container")||[];u=u||o.includes("@list");for(let o=0;o<r.length;++o){let s=await E.expand({activeCtx:e,activeProperty:t,element:r[o],options:c,insideIndex:h,typeScopedContext:d});u&&i(s)&&(s={"@list":s}),null!==s&&(i(s)?n=n.concat(s):n.push(s))}return n}const g=p(e,t,{vocab:!0},c),b=f(e,t,"@context");d=d||(e.previousContext?e:null);let w=Object.keys(r).sort(),x=!h;if(x&&d&&w.length<=2&&!w.includes("@context"))for(const t of w){const r=p(d,t,{vocab:!0},c);if("@value"===r){x=!1,e=d;break}if("@id"===r&&1===w.length){x=!1;break}}x&&(e=e.revertToPreviousContext()),l(b)||(e=await y({activeCtx:e,localCtx:b,propagate:!0,overrideProtected:!0,options:c})),"@context"in r&&(e=await y({activeCtx:e,localCtx:r["@context"],options:c})),d=e;let N=null;for(const t of w)if("@type"===p(e,t,{vocab:!0},c)){N=N||t;const n=r[t],i=Array.isArray(n)?n.length>1?n.slice().sort():n:[n];for(const t of i){const r=f(d,t,"@context");l(r)||(e=await y({activeCtx:e,localCtx:r,options:c,propagate:!1}))}}let I={};await O({activeCtx:e,activeProperty:t,expandedActiveProperty:g,element:r,expandedParent:I,options:c,insideList:u,typeKey:N,typeScopedContext:d}),w=Object.keys(I);let A=w.length;if("@value"in I){if("@type"in I&&("@language"in I||"@direction"in I))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:I});let t=A-1;if("@type"in I&&(t-=1),"@index"in I&&(t-=1),"@language"in I&&(t-=1),"@direction"in I&&(t-=1),0!==t)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:I});const r=null===I["@value"]?[]:_(I["@value"]),i=T(I,"@type");if(m(e,1.1)&&i.includes("@json")&&1===i.length);else if(0===r.length)c.eventHandler&&j({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:I}},options:c}),I=null;else{if(!r.every((e=>a(e)||s(e)))&&"@language"in I)throw new n("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:I});if(!i.every((e=>v(e)&&!(a(e)&&0===e.indexOf("_:"))||s(e))))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:I})}}else if("@type"in I&&!i(I["@type"]))I["@type"]=[I["@type"]];else if("@set"in I||"@list"in I){if(A>1&&(2!==A||!("@index"in I)))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:I});"@set"in I&&(I=I["@set"],w=Object.keys(I),A=w.length)}else 1===A&&"@language"in I&&(c.eventHandler&&j({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:I}},options:c}),I=null);if(o(I)&&!c.keepFreeFloatingNodes&&!u&&(null===t||"@graph"===g)&&(0===A||"@value"in I||"@list"in I||1===A&&"@id"in I)){if(c.eventHandler){let e,t;0===A?(e="empty object",t="Dropping empty object."):"@value"in I?(e="object with only @value",t="Dropping object with only @value."):"@list"in I?(e="object with only @list",t="Dropping object with only @list."):1===A&&"@id"in I&&(e="object with only @id",t="Dropping object with only @id."),j({event:{type:["JsonLdEvent"],code:e,level:"warning",message:t,details:{value:I}},options:c})}I=null}return I}},1409:(e,t,r)=>{"use strict";const{isSubjectReference:n}=r(478),{createMergedNodeMap:i}=r(9646),o={};e.exports=o,o.flatten=e=>{const t=i(e),r=[],o=Object.keys(t).sort();for(let e=0;e<o.length;++e){const i=t[o[e]];n(i)||r.push(i)}return r}},1849:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),s=r(4768),a=r(3866),l=r(9699),{createNodeMap:c,mergeNodeMapGraphs:u}=r(9646),h={};function d(e){const t={};for(const r in e)void 0!==e[r]&&(t["@"+r]=[e[r]]);return[t]}function p(e,t,r){for(let n=r.length-1;n>=0;--n){const i=r[n];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function f(e,t,r){const n="@"+r;let 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 l("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 l("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 s.asArray(e[0]["@id"]))if(!o.isObject(t)&&!a.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of s.asArray(e[0]["@type"]))if(!o.isObject(t)&&!a.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function y(e,t,r,a){let l=!0,c=!1;for(const u in r){let h=!1;const d=s.getValues(t,u),p=0===s.getValues(r,u).length;if("@id"===u){if(o.isEmptyObject(r["@id"][0]||{})?h=!0:r["@id"].length>=0&&(h=r["@id"].includes(d[0])),!a.requireAll)return h}else if("@type"===u){if(l=!1,p){if(d.length>0)return!1;h=!0}else if(1===r["@type"].length&&o.isEmptyObject(r["@type"][0]))h=d.length>0;else for(const e of r["@type"])h=!(!o.isObject(e)||!("@default"in e))||h||d.some((t=>t===e));if(!a.requireAll)return h}else{if(n(u))continue;{const t=s.getValues(r,u)[0];let n=!1;if(t&&(g([t]),n="@default"in t),l=!1,0===d.length&&n)continue;if(d.length>0&&p)return!1;if(void 0===t){if(d.length>0)return!1;h=!0}else if(i.isList(t)){const r=t["@list"][0];if(i.isList(d[0])){const t=d[0]["@list"];i.isValue(r)?h=t.some((e=>x(r,e))):(i.isSubject(r)||i.isSubjectReference(r))&&(h=t.some((t=>w(e,r,t,a))))}}else h=i.isValue(t)?d.some((e=>x(t,e))):i.isSubjectReference(t)?d.some((r=>w(e,t,r,a))):!!o.isObject(t)&&d.length>0}}if(!h&&a.requireAll)return!1;c=c||h}return l||c}function m(e,t){const r=e.uniqueEmbeds[e.graph],n=r[t],i=n.parent,a=n.property,l={"@id":t};if(o.isArray(i)){for(let e=0;e<i.length;++e)if(s.compareValues(i[e],l)){i[e]=l;break}}else{const e=o.isArray(i[a]);s.removeValue(i,a,l,{propertyIsArray:e}),s.addValue(i,a,l,{propertyIsArray:e})}const c=e=>{const t=Object.keys(r);for(const n of t)n in r&&o.isObject(r[n].parent)&&r[n].parent["@id"]===e&&(delete r[n],c(n))};c(t)}function v(e,t){if(o.isArray(e))return e.map((e=>v(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"]=v(e["@list"],t),e;if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)"@id"===r&&t.bnodesToClear.includes(e[r])?delete e["@id"]:e[r]=v(e[r],t)}return e}function b(e,t,r){o.isObject(e)?s.addValue(e,t,r,{propertyIsArray:!0}):e.push(r)}function w(e,t,r,n){if(!("@id"in r))return!1;const i=e.subjects[r["@id"]];return i&&y(e,i,t,n)}function x(e,t){const r=t["@value"],n=t["@type"],i=t["@language"],s=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],a=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],l=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===s.length&&0===a.length&&0===l.length||!(!s.includes(r)&&!o.isEmptyObject(s[0]))&&!!(!n&&0===a.length||a.includes(n)||n&&o.isEmptyObject(a[0]))&&!!(!i&&0===l.length||l.includes(i)||i&&o.isEmptyObject(l[0]))}e.exports=h,h.frameMergedOrDefault=(e,t,r)=>{const n={options:r,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new s.IdentifierIssuer("_:b");c(e,n.graphMap,"@default",i),r.merged&&(n.graphMap["@merged"]=u(n.graphMap),n.graph="@merged"),n.subjects=n.graphMap[n.graph];const o=[];return h.frame(n,Object.keys(n.subjects).sort(),t,o),r.pruneBlankNodeIdentifiers&&(r.bnodesToClear=Object.keys(n.bnodeMap).filter((e=>1===n.bnodeMap[e].length))),r.link={},v(o,r)},h.frame=(e,t,r,a,c=null)=>{g(r),r=r[0];const u=e.options,v={embed:f(r,u,"embed"),explicit:f(r,u,"explicit"),requireAll:f(r,u,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const w=e.link[e.graph],_=function(e,t,r,n){const i={};for(const o of t){const t=e.graphMap[e.graph][o];y(e,t,r,n)&&(i[o]=t)}return i}(e,t,r,v),T=Object.keys(_).sort();for(const g of T){const y=_[g];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===v.embed&&g in w){b(a,c,w[g]);continue}const T={"@id":g};if(0===g.indexOf("_:")&&s.addValue(e.bnodeMap,g,T,{propertyIsArray:!0}),w[g]=T,("@first"===v.embed||"@last"===v.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:r});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(g))if(!e.embedded||"@never"!==v.embed&&!p(y,e.graph,e.subjectStack))if(!e.embedded||"@first"!=v.embed&&"@once"!=v.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(g)){if("@last"===v.embed&&g in e.uniqueEmbeds[e.graph]&&m(e,g),e.uniqueEmbeds[e.graph][g]={parent:a,property:c},e.subjectStack.push({subject:y,graph:e.graph}),g in e.graphMap){let t=!1,n=null;"@graph"in r?(n=r["@graph"][0],t=!("@merged"===g||"@default"===g),o.isObject(n)||(n={})):(t="@merged"!==e.graph,n={}),t&&h.frame({...e,graph:g,embedded:!1},Object.keys(e.graphMap[g]).sort(),[n],T,"@graph")}"@included"in r&&h.frame({...e,embedded:!1},t,r["@included"],T,"@included");for(const t of Object.keys(y).sort())if(n(t)){if(T[t]=s.clone(y[t]),"@type"===t)for(const t of y["@type"])0===t.indexOf("_:")&&s.addValue(e.bnodeMap,t,T,{propertyIsArray:!0})}else if(!v.explicit||t in r)for(const n of y[t]){const o=t in r?r[t]:d(v);if(i.isList(n)){const o=r[t]&&r[t][0]&&r[t][0]["@list"]?r[t][0]["@list"]:d(v),a={"@list":[]};b(T,t,a);const l=n["@list"];for(const t of l)i.isSubjectReference(t)?h.frame({...e,embedded:!0},[t["@id"]],o,a,"@list"):b(a,"@list",s.clone(t))}else i.isSubjectReference(n)?h.frame({...e,embedded:!0},[n["@id"]],o,T,t):x(o[0],n)&&b(T,t,s.clone(n))}for(const e of Object.keys(r).sort()){if("@type"===e){if(!o.isObject(r[e][0])||!("@default"in r[e][0]))continue}else if(n(e))continue;const t=r[e][0]||{};if(!f(t,u,"omitDefault")&&!(e in T)){let r="@null";"@default"in t&&(r=s.clone(t["@default"])),o.isArray(r)||(r=[r]),T[e]=[{"@preserve":r}]}}for(const t of Object.keys(r["@reverse"]||{}).sort()){const n=r["@reverse"][t];for(const r of Object.keys(e.subjects))s.getValues(e.subjects[r],t).some((e=>e["@id"]===g))&&(T["@reverse"]=T["@reverse"]||{},s.addValue(T["@reverse"],t,[],{propertyIsArray:!0}),h.frame({...e,embedded:!0},[r],n,T["@reverse"][t],c))}b(a,c,T),e.subjectStack.pop()}else b(a,c,T);else b(a,c,T)}},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 r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)e[r]=h.cleanupNull(e[r],t)}return e}},1176:(e,t,r)=>{"use strict";const n=r(9699),i=r(478),o=r(8285),{REGEX_BCP47:s,addValue:a}=r(4768),{handleEvent:l}=r(5746),{RDF_LIST:c,RDF_FIRST:u,RDF_REST:h,RDF_NIL:d,RDF_TYPE:p,RDF_JSON_LITERAL:f,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:m,XSD_STRING:v}=r(2445),b={};function w(e,t,r,i){if(e.termType.endsWith("Node"))return{"@id":e.value};const a={"@value":e.value};if(e.language)e.language.match(s)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:i}),a["@language"]=e.language;else{let c=e.datatype.value;if(c||(c=v),c===f){c="@json";try{a["@value"]=JSON.parse(a["@value"])}catch(e){throw new n("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:a["@value"],cause:e})}}if(t){if(c===g)"true"===a["@value"]?a["@value"]=!0:"false"===a["@value"]&&(a["@value"]=!1);else if(o.isNumeric(a["@value"]))if(c===m){const e=parseInt(a["@value"],10);e.toFixed(0)===a["@value"]&&(a["@value"]=e)}else c===y&&(a["@value"]=parseFloat(a["@value"]));[g,m,y,v].includes(c)||(a["@type"]=c)}else if("i18n-datatype"===r&&c.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=c.split(/[#_]/);e.length>0&&(a["@language"]=e,e.match(s)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:i})),a["@direction"]=t}else c!==v&&(a["@type"]=c)}return a}e.exports=b,b.fromRDF=async(e,t)=>{const r={},n={"@default":r},s={},{useRdfType:l=!1,useNativeTypes:f=!1,rdfDirection:g=null}=t;for(const i of e){const e="DefaultGraph"===i.graph.termType?"@default":i.graph.value;e in n||(n[e]={}),"@default"===e||e in r||(r[e]={"@id":e});const o=n[e],c=i.subject.value,u=i.predicate.value,h=i.object;c in o||(o[c]={"@id":c});const y=o[c],m=h.termType.endsWith("Node");if(m&&!(h.value in o)&&(o[h.value]={"@id":h.value}),u===p&&!l&&m){a(y,"@type",h.value,{propertyIsArray:!0});continue}const v=w(h,f,g,t);if(a(y,u,v,{propertyIsArray:!0}),m)if(h.value===d){const e=o[h.value];"usages"in e||(e.usages=[]),e.usages.push({node:y,property:u,value:v})}else h.value in s?s[h.value]=!1:s[h.value]={node:y,property:u,value:v}}for(const e in n){const t=n[e];if(!(d in t))continue;const r=t[d];if(r.usages){for(let e of r.usages){let r=e.node,n=e.property,a=e.value;const l=[],d=[];let p=Object.keys(r).length;for(;n===h&&o.isObject(s[r["@id"]])&&o.isArray(r[u])&&1===r[u].length&&o.isArray(r[h])&&1===r[h].length&&(3===p||4===p&&o.isArray(r["@type"])&&1===r["@type"].length&&r["@type"][0]===c)&&(l.push(r[u][0]),d.push(r["@id"]),e=s[r["@id"]],r=e.node,n=e.property,a=e.value,p=Object.keys(r).length,i.isBlankNode(r)););delete a["@id"],a["@list"]=l.reverse();for(const e of d)delete t[e]}delete r.usages}}const y=[],m=Object.keys(r).sort();for(const e of m){const t=r[e];if(e in n){const r=t["@graph"]=[],o=n[e],s=Object.keys(o).sort();for(const e of s){const t=o[e];i.isSubjectReference(t)||r.push(t)}}i.isSubjectReference(t)||y.push(t)}return y}},478:(e,t,r)=>{"use strict";const n=r(8285),i={};e.exports=i,i.isSubject=e=>!(!n.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>n.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>n.isObject(e)&&"@value"in e,i.isList=e=>n.isObject(e)&&"@list"in e,i.isGraph=e=>n.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=>{if(n.isObject(e)){if("@id"in e){const t=e["@id"];return!n.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1}},730:(e,t,r)=>{const n=r(2948),i=r(1402),o=r(4768),s=r(5777),a=o.IdentifierIssuer,l=r(9699),c=r(3666),u=r(7990),{expand:h}=r(570),{flatten:d}=r(1409),{fromRDF:p}=r(1176),{toRDF:f}=r(2189),{frameMergedOrDefault:g,cleanupNull:y}=r(1849),{isArray:m,isObject:v,isString:b}=r(8285),{isSubjectReference:w}=r(478),{expandIri:x,getInitialContext:_,process:T,processingMode:N}=r(2182),{compact:j,compactIri:E}=r(120),{createNodeMap:O,createMergedNodeMap:S,mergeNodeMaps:I}=r(9646),{logEventHandler:A,logWarningEventHandler:k,safeEventHandler:R,setDefaultEventHandler:C,setupEventHandler:D,strictEventHandler:L,unhandledEventHandler:P}=r(5746),M=function(e){const t={},M=new c({max:100});function F(t,{documentLoader:r=e.documentLoader,...n}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:r},n,t,{eventHandler:D({options:t})})}return e.compact=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===r)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(n=F(n,{base:b(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new a("_:b"),contextResolver:new s({sharedCache:M})})).link&&(n.skipExpansion=!0),n.compactToRelative||delete n.base,i=n.skipExpansion?t:await e.expand(t,n);const c=await e.processContext(_(n),r,n);let u=await j({activeCtx:c,element:i,options:n});n.compactArrays&&!n.graph&&m(u)?1===u.length?u=u[0]:0===u.length&&(u={}):n.graph&&v(u)&&(u=[u]),v(r)&&"@context"in r&&(r=r["@context"]),r=o.clone(r),m(r)||(r=[r]);const h=r;r=[];for(let e=0;e<h.length;++e)(!v(h[e])||Object.keys(h[e]).length>0)&&r.push(h[e]);const d=r.length>0;if(1===r.length&&(r=r[0]),m(u)){const e=E({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=u;u={},d&&(u["@context"]=r),u[e]=t}else if(v(u)&&d){const e=u;u={"@context":r};for(const t in e)u[t]=e[t]}return u},e.expand=async function(t,r){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const n={},i=[];if("expandContext"in(r=F(r,{keepFreeFloatingNodes:!1,contextResolver:new s({sharedCache:M})}))){const e=o.clone(r.expandContext);v(e)&&"@context"in e?n.expandContext=e:n.expandContext={"@context":e},i.push(n.expandContext)}let a;if(b(t)){const o=await e.get(t,r);a=o.documentUrl,n.input=o.document,o.contextUrl&&(n.remoteContext={"@context":o.contextUrl},i.push(n.remoteContext))}else n.input=o.clone(t);"base"in r||(r.base=a||"");let l=_(r);for(const e of i)l=await T({activeCtx:l,localCtx:e,options:r});let c=await h({activeCtx:l,element:n.input,options:r});return v(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),m(c)||(c=[c]),c},e.flatten=async function(t,r,n){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");r="function"==typeof r?null:r||null,n=F(n,{base:b(t)?t:"",contextResolver:new s({sharedCache:M})});const i=await e.expand(t,n),o=d(i);if(null===r)return o;n.graph=!0,n.skipExpansion=!0;const a=await e.compact(o,r,n);return a},e.frame=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(n=F(n,{base:b(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new s({sharedCache:M})}),b(r)){const t=await e.get(r,n);if(r=t.document,t.contextUrl){let e=r["@context"];e?m(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,r["@context"]=e}}const i=r&&r["@context"]||{},o=await e.processContext(_(n),i,n);n.hasOwnProperty("omitGraph")||(n.omitGraph=N(o,1.1)),n.hasOwnProperty("pruneBlankNodeIdentifiers")||(n.pruneBlankNodeIdentifiers=N(o,1.1));const a=await e.expand(t,n),l={...n};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(r,l),u=Object.keys(r).map((e=>x(o,e,{vocab:!0})));l.merged=!u.includes("@graph"),l.is11=N(o,1.1);const h=g(a,c,l);l.graph=!n.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let d=await e.compact(h,i,l);return l.link={},d=y(d,l),d},e.link=async function(t,r,n){const i={};return r&&(i["@context"]=r),i["@embed"]="@link",e.frame(t,i,n)},e.normalize=e.canonize=async function(t,r){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(r=F(r,{base:b(t)?t:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new s({sharedCache:M})}))){if("application/n-quads"!==r.inputFormat&&"application/nquads"!==r.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=u.parse(t);return n.canonize(e,r)}const i={...r};delete i.format,i.produceGeneralizedRdf=!1;const o=await e.toRDF(t,i);return n.canonize(o,r)},e.fromRDF=async function(e,r){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");r=F(r,{format:b(e)?"application/n-quads":void 0});const{format:n}=r;let{rdfParser:i}=r;if(n){if(i=i||t[n],!i)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:n})}else i=()=>e;const o=await i(e);return p(o,r)},e.toRDF=async function(t,r){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let n;n=(r=F(r,{base:b(t)?t:"",skipExpansion:!1,contextResolver:new s({sharedCache:M})})).skipExpansion?t:await e.expand(t,r);const i=f(n,r);if(r.format){if("application/n-quads"===r.format||"application/nquads"===r.format)return u.serialize(i);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:r.format})}return i},e.createNodeMap=async function(t,r){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");r=F(r,{base:b(t)?t:"",contextResolver:new s({sharedCache:M})});const n=await e.expand(t,r);return S(n,r)},e.merge=async function(t,r,n){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!m(t))throw new TypeError('Could not merge, "docs" must be an array.');r="function"==typeof r?null:r||null,n=F(n,{contextResolver:new s({sharedCache:M})});const i=await Promise.all(t.map((t=>{const r={...n};return e.expand(t,r)})));let l=!0;"mergeNodes"in n&&(l=n.mergeNodes);const c=n.issuer||new a("_:b"),u={"@default":{}};for(let e=0;e<i.length;++e){const t=o.relabelBlankNodes(i[e],{issuer:new a("_:b"+e+"-")}),r=l||0===e?u:{"@default":{}};if(O(t,r,"@default",c),r!==u)for(const e in r){const t=r[e];if(!(e in u)){u[e]=t;continue}const n=u[e];for(const e in t)e in n||(n[e]=t[e])}}const h=I(u),d=[],p=Object.keys(h).sort();for(let e=0;e<p.length;++e){const t=h[p[e]];w(t)||d.push(t)}if(null===r)return d;n.graph=!0,n.skipExpansion=!0;const f=await e.compact(d,r,n);return f},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,r){let n;n="function"==typeof r.documentLoader?r.documentLoader:e.documentLoader;const i=await n(t);try{if(!i.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");b(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new l("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,r){return r=F(r,{base:"",contextResolver:new s({sharedCache:M})}),null===t?_(r):(t=o.clone(t),v(t)&&"@context"in t||(t={"@context":t}),T({activeCtx:e,localCtx:t,options:r}))},e.getContextValue=r(2182).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,r){t[e]=r},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",u.parse),e.registerRDFParser("application/nquads",u.parse),e.url=r(3866),e.logEventHandler=A,e.logWarningEventHandler=k,e.safeEventHandler=R,e.setDefaultEventHandler=C,e.strictEventHandler=L,e.unhandledEventHandler=P,e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=r(3114),e.JsonLdProcessor=r(7298)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},F=function(){return M((function(){return F()}))};M(F),e.exports=F},9646:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),s=r(4768),a=r(9699),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const r=(t=t||{}).issuer||new s.IdentifierIssuer("_:b"),n={"@default":{}};return l.createNodeMap(e,n,"@default",r),l.mergeNodeMaps(n)},l.createNodeMap=(e,t,r,c,u,h)=>{if(o.isArray(e)){for(const n of e)l.createNodeMap(n,t,r,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 n=[];return l.createNodeMap(e["@list"],t,r,c,u,n),void h.push({"@list":n})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}o.isUndefined(u)&&(u=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),h&&h.push({"@id":u});const d=t[r],p=d[u]=d[u]||{};p["@id"]=u;const f=Object.keys(e).sort();for(let o of f){if("@id"===o)continue;if("@reverse"===o){const n={"@id":u},o=e["@reverse"];for(const e in o){const a=o[e];for(const o of a){let a=o["@id"];i.isBlankNode(o)&&(a=c.getId(a)),l.createNodeMap(o,t,r,c,a),s.addValue(d[a],e,n,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){u in t||(t[u]={}),l.createNodeMap(e[o],t,u,c);continue}if("@included"===o){l.createNodeMap(e[o],t,r,c);continue}if("@type"!==o&&n(o)){if("@index"===o&&o in p&&(e[o]!==p[o]||e[o]["@id"]!==p[o]["@id"]))throw new a("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:p});p[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 n=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];s.addValue(p,o,{"@id":n},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,r,c,n)}else if(i.isValue(e))s.addValue(p,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const n=[];l.createNodeMap(e["@list"],t,r,c,u,n),e={"@list":n},s.addValue(p,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,r,c,u),s.addValue(p,o,e,{propertyIsArray:!0,allowDuplicate:!1});else s.addValue(p,o,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const r of Object.keys(e).sort())for(const i of Object.keys(e[r]).sort()){const o=e[r][i];i in t||(t[i]={"@id":i});const a=t[i];for(const e of Object.keys(o).sort())if(n(e)&&"@type"!==e)a[e]=s.clone(o[e]);else for(const t of o[e])s.addValue(a,e,s.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.mergeNodeMaps=e=>{const t=e["@default"],r=Object.keys(e).sort();for(const n of r){if("@default"===n)continue;const r=e[n];let o=t[n];o?"@graph"in o||(o["@graph"]=[]):t[n]=o={"@id":n,"@graph":[]};const s=o["@graph"];for(const e of Object.keys(r).sort()){const t=r[e];i.isSubjectReference(t)||s.push(t)}}return t}},1402:(e,t,r)=>{"use strict";const n=r(2872),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=n,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},2189:(e,t,r)=>{"use strict";const{createNodeMap:n}=r(9646),{isKeyword:i}=r(2182),o=r(478),s=r(8981),a=r(8285),l=r(4768),{handleEvent:c}=r(5746),{RDF_FIRST:u,RDF_REST:h,RDF_NIL:d,RDF_TYPE:p,RDF_JSON_LITERAL:f,RDF_LANGSTRING:g,XSD_BOOLEAN:y,XSD_DOUBLE:m,XSD_INTEGER:v,XSD_STRING:b}=r(2445),{isAbsolute:w}=r(3866),x={};function _(e,t,r,n,o){const s=Object.keys(t).sort();for(const a of s){const s=t[a],l=Object.keys(s).sort();for(let t of l){const l=s[t];if("@type"===t)t=p;else if(i(t))continue;for(const i of l){const s={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!w(a)){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:a}},options:o});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!w(t)){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:o});continue}if("BlankNode"===l.termType&&!o.produceGeneralizedRdf){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:n.getOldIds().find((e=>n.getId(e)===t))}},options:o});continue}const u=T(i,n,e,r,o.rdfDirection,o);u&&e.push({subject:s,predicate:l,object:u,graph:r})}}}}function T(e,t,r,n,i,l){const p={};if(o.isValue(e)){p.termType="Literal",p.value=void 0,p.datatype={termType:"NamedNode"};let t=e["@value"];const r=e["@type"]||null;if("@json"===r)p.value=s(t),p.datatype.value=f;else if(a.isBoolean(t))p.value=t.toString(),p.datatype.value=r||y;else if(a.isDouble(t)||r===m)a.isDouble(t)||(t=parseFloat(t)),p.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),p.datatype.value=r||m;else if(a.isNumber(t))p.value=t.toFixed(0),p.datatype.value=r||v;else if("i18n-datatype"===i&&"@direction"in e){const r="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`;p.datatype.value=r,p.value=t}else"@language"in e?(p.value=t,p.datatype.value=r||g,p.language=e["@language"]):(p.value=t,p.datatype.value=r||b)}else if(o.isList(e)){const o=function(e,t,r,n,i,o){const s={termType:"NamedNode",value:u},a={termType:"NamedNode",value:h},l={termType:"NamedNode",value:d},c=e.pop(),p=c?{termType:"BlankNode",value:t.getId()}:l;let f=p;for(const l of e){const e=T(l,t,r,n,i,o),c={termType:"BlankNode",value:t.getId()};r.push({subject:f,predicate:s,object:e,graph:n}),r.push({subject:f,predicate:a,object:c,graph:n}),f=c}if(c){const e=T(c,t,r,n,i,o);r.push({subject:f,predicate:s,object:e,graph:n}),r.push({subject:f,predicate:a,object:l,graph:n})}return p}(e["@list"],t,r,n,i,l);p.termType=o.termType,p.value=o.value}else{const t=a.isObject(e)?e["@id"]:e;p.termType=t.startsWith("_:")?"BlankNode":"NamedNode",p.value=t}return"NamedNode"!==p.termType||w(p.value)?p:(l.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:p.value}},options:l}),null)}e.exports=x,x.toRDF=(e,t)=>{const r=new l.IdentifierIssuer("_:b"),i={"@default":{}};n(e,i,"@default",r);const o=[],s=Object.keys(i).sort();for(const e of s){let n;if("@default"===e)n={termType:"DefaultGraph",value:""};else{if(!w(e)){t.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}n=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},n.value=e}_(o,i[e],n,r,t)}return o}},8285:e=>{"use strict";const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},3866:(e,t,r)=>{"use strict";const n=r(8285),i={};e.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 r={},n=i.parsers[t||"full"],o=n.regex.exec(e);let s=n.keys.length;for(;s--;)r[n.keys[s]]=void 0===o[s]?null:o[s];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=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!n.isString(e)||(e=i.parse(e||""));const r=i.parse(t),o={protocol:e.protocol||""};if(null!==r.authority)o.authority=r.authority,o.path=r.path,o.query=r.query;else if(o.authority=e.authority,""===r.path)o.path=e.path,null!==r.query?o.query=r.query:o.query=e.query;else{if(0===r.path.indexOf("/"))o.path=r.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=r.path,o.path=t}o.query=r.query}""!==r.path&&(o.path=i.removeDotSegments(o.path));let s=o.protocol;return null!==o.authority&&(s+="//"+o.authority),s+=o.path,null!==o.query&&(s+="?"+o.query),null!==r.fragment&&(s+="#"+r.fragment),""===s&&(s="./"),s},i.removeBase=(e,t)=>{if(null===e)return t;e&&!n.isString(e)||(e=i.parse(e||""));let r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;const o=i.parse(t.substr(r.length)),s=e.normalizedPath.split("/"),a=o.normalizedPath.split("/"),l=o.fragment||o.query?0:1;for(;s.length>0&&a.length>l&&s[0]===a[0];)s.shift(),a.shift();let c="";if(s.length>0){s.pop();for(let e=0;e<s.length;++e)c+="../"}return c+=a.join("/"),null!==o.query&&(c+="?"+o.query),null!==o.fragment&&(c+="#"+o.fragment),""===c&&(c="./"),c},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),r=[];for(;t.length>0;){const e=t.shift(),n=0===t.length;"."!==e?".."!==e?r.push(e):(r.pop(),n&&r.push("")):n&&r.push("")}return"/"===e[0]&&r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>n.isString(e)&&o.test(e),i.isRelative=e=>n.isString(e)},4768:(e,t,r)=>{"use strict";const n=r(478),i=r(8285),o=r(2948).IdentifierIssuer,s=r(9699),a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u="application/ld+json, application/json",h={};function d(e,t){if(i.isArray(t))for(let r=0;r<t.length;++r)t[r]=d(e,t[r]);else if(n.isList(t))t["@list"]=d(e,t["@list"]);else if(i.isObject(t)){n.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const r=Object.keys(t).sort();for(let n=0;n<r.length;++n){const i=r[n];"@id"!==i&&(t[i]=d(e,t[i]))}}return t}e.exports=h,h.IdentifierIssuer=o,h.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,h.REGEX_KEYWORD=/^@[a-zA-Z]+$/,h.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let r=0;r<e.length;++r)t[r]=h.clone(e[r])}else if(e instanceof Map){t=new Map;for(const[r,n]of e)t.set(r,h.clone(n))}else if(e instanceof Set){t=new Set;for(const r of e)t.add(h.clone(r))}else if(i.isObject(e)){t={};for(const r in e)t[r]=h.clone(e[r])}else t=e.toString();return t}return e},h.asArray=function(e){return Array.isArray(e)?e:[e]},h.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+u+'" is supported.');return Object.assign({Accept:u},e)},h.parseLinkHeader=e=>{const t={},r=e.match(a);for(let e=0;e<r.length;++e){let n=r[e].match(l);if(!n)continue;const i={target:n[1]},o=n[2];for(;n=c.exec(o);)i[n[1]]=void 0===n[2]?n[3]:n[2];const s=i.rel||"";Array.isArray(t[s])?t[s].push(i):t.hasOwnProperty(s)?t[s]=[t[s],i]:t[s]=i}return t},h.validateTypeValue=(e,t)=>{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 s('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 r=e[t];return!i.isArray(r)||r.length>0}return!1},h.hasValue=(e,t,r)=>{if(h.hasProperty(e,t)){let o=e[t];const s=n.isList(o);if(i.isArray(o)||s){s&&(o=o["@list"]);for(let e=0;e<o.length;++e)if(h.compareValues(r,o[e]))return!0}else if(!i.isArray(r))return h.compareValues(r,o)}return!1},h.addValue=(e,t,r,n)=>{if("propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1),"valueIsArray"in n||(n.valueIsArray=!1),"allowDuplicate"in n||(n.allowDuplicate=!0),"prependValue"in n||(n.prependValue=!1),n.valueIsArray)e[t]=r;else if(i.isArray(r)){0===r.length&&n.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),n.prependValue&&(r=r.concat(e[t]),e[t]=[]);for(let i=0;i<r.length;++i)h.addValue(e,t,r[i],n)}else if(e.hasOwnProperty(t)){const o=!n.allowDuplicate&&h.hasValue(e,t,r);i.isArray(e[t])||o&&!n.propertyIsArray||(e[t]=[e[t]]),o||(n.prependValue?e[t].unshift(r):e[t].push(r))}else e[t]=n.propertyIsArray?[r]:r},h.getValues=(e,t)=>[].concat(e[t]||[]),h.removeProperty=(e,t)=>{delete e[t]},h.removeValue=(e,t,r,n)=>{"propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1);const i=h.getValues(e,t).filter((e=>!h.compareValues(e,r)));0===i.length?h.removeProperty(e,t):1!==i.length||n.propertyIsArray?e[t]=i:e[t]=i[0]},h.relabelBlankNodes=(e,t)=>d((t=t||{}).issuer||new o("_:b"),e),h.compareValues=(e,t)=>e===t||!(!n.isValue(e)||!n.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.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},3666:(e,t,r)=>{"use strict";const n=r(1123),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),h=Symbol("lruList"),d=Symbol("cache"),p=Symbol("updateAgeOnGet"),f=()=>1,g=(e,t,r)=>{const n=e[d].get(t);if(n){const t=n.value;if(y(e,t)){if(v(e,n),!e[a])return}else r&&(e[p]&&(n.value.now=Date.now()),e[h].unshiftNode(n));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},m=e=>{if(e[o]>e[i])for(let t=e[h].tail;e[o]>e[i]&&null!==t;){const r=t.prev;v(e,t),t=r}},v=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[d].delete(r.key),e[h].removeNode(t)}};class b{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const w=(e,t,r,n)=>{let i=r.value;y(e,i)&&(v(e,r),e[a]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.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||f;if(this[s]="function"!=typeof t?f:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[p]=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,m(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,m(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[s]&&(this[s]=e,this[o]=0,this[h].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),m(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[h].length}rforEach(e,t){t=t||this;for(let r=this[h].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[h].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}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 n,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,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[d].has(e)){if(a>this[i])return v(this,this[d].get(e)),!1;const s=this[d].get(e).value;return this[c]&&(this[u]||this[c](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),m(this),!0}const p=new b(e,t,a,n,r);return p.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=p.length,this[h].unshift(p),this[d].set(e,this[h].head),m(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?(v(this,e),e.value):null}del(e){v(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[d].forEach(((e,t)=>g(this,t,!1)))}}},8720:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},7402:(e,t,r)=>{"use strict";var n=r(9170),i=r(2550),o=r(8720),s=r(5280),a=r(9129),l=i(s(),Object);n(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},5280:(e,t,r)=>{"use strict";var n=r(8720);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9129:(e,t,r)=>{"use strict";var n=r(5280),i=r(9170);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8383:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(4418),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{h(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=s(e),a=t&&"[object String]"===o.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var f=c&&r;if(a&&e.length>0&&!i.call(e,0))for(var g=0;g<e.length;++g)d.push(String(g));if(n&&e.length>0)for(var y=0;y<e.length;++y)d.push(String(y));else for(var m in e)f&&"prototype"===m||!i.call(e,m)||d.push(String(m));if(l)for(var v=function(e){if("undefined"==typeof window||!p)return h(e);try{return h(e)}catch(e){return!1}}(e),b=0;b<u.length;++b)v&&"constructor"===u[b]||!i.call(e,u[b])||d.push(u[b]);return d}}e.exports=n},806:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(4418),o=Object.keys,s=o?function(e){return o(e)}:r(8383),a=Object.keys;s.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(n.call(e)):a(e)})}else Object.keys=s;return Object.keys||s},e.exports=s},4418:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},2530:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,l=[],c=!1,u=-1;function h(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&d())}function d(){if(!c){var e=s(h);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function f(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new p(e,t)),1!==l.length||c||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=f,n.addListener=f,n.once=f,n.off=f,n.removeListener=f,n.removeAllListeners=f,n.emit=f,n.prependListener=f,n.prependOnceListener=f,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5929:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},2948:(e,t,r)=>{e.exports=r(2874)},577:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,r=0){this.prefix=e,this._existing=t,this.counter=r}clone(){const{prefix:t,_existing:r,counter:n}=this;return new e(t,new Map(r),n)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},4071:(e,t,r)=>{"use strict";r(4828);const n=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!n||!n.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await n.subtle.digest(this.algorithm,e));let r="";for(let e=0;e<t.length;++e)r+=t[e].toString(16).padStart(2,"0");return r}}},6327:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",r="http://www.w3.org/2001/XMLSchema#string",n="NamedNode",i="BlankNode",o="Literal",s="DefaultGraph",a={};a.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,a.empty=new RegExp("^[ \\t]*$"),a.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]*\\.))[ \\t]*$'),e.exports=class e{static parse(e){const l=[],u={},h=e.split(a.eoln);let d=0;for(const e of h){if(d++,a.empty.test(e))continue;const h=e.match(a.quad);if(null===h)throw new Error("N-Quads parse error on line "+d+".");const g={subject:null,predicate:null,object:null,graph:null};if(void 0!==h[1]?g.subject={termType:n,value:h[1]}:g.subject={termType:i,value:h[2]},g.predicate={termType:n,value:h[3]},void 0!==h[4]?g.object={termType:n,value:h[4]}:void 0!==h[5]?g.object={termType:i,value:h[5]}:(g.object={termType:o,value:void 0,datatype:{termType:n}},void 0!==h[7]?g.object.datatype.value=h[7]:void 0!==h[8]?(g.object.datatype.value=t,g.object.language=h[8]):g.object.datatype.value=r,g.object.value=h[6].replace(c,(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")}))),void 0!==h[9]?g.graph={termType:n,value:h[9]}:void 0!==h[10]?g.graph={termType:i,value:h[10]}:g.graph={termType:s,value:""},g.graph.value in u){let e=!0;const t=u[g.graph.value];for(const r of t)if(f=g,(p=r).subject.termType===f.subject.termType&&p.object.termType===f.object.termType&&p.subject.value===f.subject.value&&p.predicate.value===f.predicate.value&&p.object.value===f.object.value&&(p.object.termType!==o||p.object.datatype.termType===f.object.datatype.termType&&p.object.language===f.object.language&&p.object.datatype.value===f.object.datatype.value)){e=!1;break}e&&(t.push(g),l.push(g))}else u[g.graph.value]=[g],l.push(g)}var p,f;return l}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const r=[];for(const n of t)r.push(e.serializeQuad(n));return r.sort().join("")}static serializeQuadComponents(e,o,s,a){let c="";return e.termType===n?c+=`<${e.value}>`:c+=`${e.value}`,c+=` <${o.value}> `,s.termType===n?c+=`<${s.value}>`:s.termType===i?c+=s.value:(c+=`"${function(e){return e.replace(l,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(s.value)}"`,s.datatype.value===t?s.language&&(c+=`@${s.language}`):s.datatype.value!==r&&(c+=`^^<${s.datatype.value}>`)),a.termType===n?c+=` <${a.value}>`:a.termType===i&&(c+=` ${a.value}`),c+=" .\n",c}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const a=[],l={"blank node":i,IRI:n,literal:o};for(const c in e)e[c].forEach((e=>{const u={};for(const i in e){const s=e[i],a={termType:l[s.type],value:s.value};a.termType===o&&(a.datatype={termType:n},"datatype"in s&&(a.datatype.value=s.datatype),"language"in s?("datatype"in s||(a.datatype.value=t),a.language=s.language):"datatype"in s||(a.datatype.value=r)),u[i]=a}u.graph="@default"===c?{termType:s,value:""}:{termType:c.startsWith("_:")?i:n,value:c},a.push(u)}));return a}};const l=/["\\\n\r]/g,c=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},83:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,r=e.slice();let n=null,i=0;const o=e.length;for(let r=0;r<o;++r){const s=e[r],a=t.get(s);(null===n||s>n)&&(a&&r>0&&s>e[r-1]||!a&&r<o-1&&s>e[r+1])&&(n=s,i=r)}if(null===n)this.done=!0;else{const r=t.get(n)?i-1:i+1;e[i]=e[r],e[r]=n;for(const r of e)r>n&&t.set(r,!t.get(r))}return r}}},4515:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),s=r(6327);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];let i=0;for(const e of r)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const o=[...t.keys()].sort(),l=[];for(const e of o){const r=t.get(e);if(r.length>1){l.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of l){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=await this.hashNDegreeQuads(r,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=s.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join("")}async hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(s.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=await i.digest(),r.hash}async hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}async hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=await this.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){n.update(e);let r,s="";const a=new o(i.get(e));let l=0;for(;a.hasNext();){const e=a.next();++l%3==0&&await this._yield();let n=t.clone(),i="";const o=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||o.push(t),i+=n.getId(t)),0!==s.length&&i>s){c=!0;break}if(!c){for(const e of o){const t=await this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==s.length&&i>s){c=!0;break}}c||(0===s.length||i<s)&&(s=i,r=n)}}n.update(s),t=r}return{hash:await n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:e,issuer:t,hashToRelated:r})]);return r}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=await this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const s=t.value,a=await this.hashRelatedBlankNode(s,e,i,r),l=o.get(a);l?l.push(s):o.set(a,[s])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},2160:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),s=r(6327);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];for(const e of r)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),o=[];for(const e of i){const r=t.get(e);if(r.length>1){o.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of o){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=this.hashNDegreeQuads(r,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=s.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(s.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=i.digest(),r.hash}hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=this.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){n.update(e);let r,s="";const a=new o(i.get(e));for(;a.hasNext();){const e=a.next();let n=t.clone(),i="";const o=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||o.push(t),i+=n.getId(t)),0!==s.length&&i>s){l=!0;break}if(!l){for(const e of o){const t=this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==s.length&&i>s){l=!0;break}}l||(0===s.length||i<s)&&(s=i,r=n)}}n.update(s),t=r}return{hash:n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:r});return r}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const s=t.value,a=this.hashRelatedBlankNode(s,e,i,r),l=o.get(a);l?l.push(s):o.set(a,[s])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},3663:(e,t,r)=>{"use strict";const n=r(4071),i=r(4515);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n){let n,s;if("BlankNode"===o.subject.termType&&o.subject.value!==e)s=o.subject.value,n="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;s=o.object.value,n="r"}++i%100==0&&await this._yield();const a=await this.hashRelatedBlankNode(s,o,t,n),l=r.get(a);l?l.push(s):r.set(a,[s])}return r}}},5393:(e,t,r)=>{"use strict";const n=r(4071),i=r(2160);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n){let n,o;if("BlankNode"===i.subject.termType&&i.subject.value!==e)o=i.subject.value,n="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;o=i.object.value,n="r"}const s=this.hashRelatedBlankNode(o,i,t,n),a=r.get(s);a?a.push(o):r.set(s,[o])}return r}}},2874:(e,t,r)=>{"use strict";const n=r(4515),i=r(3663),o=r(2160),s=r(5393);let a;try{a=r(7670)}catch(e){}t.NQuads=r(6327),t.IdentifierIssuer=r(577),t._rdfCanonizeNative=function(e){return e&&(a=e),a},t.canonize=async function(e,r){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),r.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((t,n)=>a.canonize(e,r,((e,r)=>e?n(e):t(r)))))}if("URDNA2015"===r.algorithm)return new n(r).main(e);if("URGNA2012"===r.algorithm){if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(r).main(e)}if(!("algorithm"in r))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm)},t._canonizeSync=function(e,r){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),r.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return a.canonizeSync(e,r)}if("URDNA2015"===r.algorithm)return new o(r).main(e);if("URGNA2012"===r.algorithm){if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new s(r).main(e)}if(!("algorithm"in r))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm)}},4828:function(e,t,r){var n=r(2530);!function(e,t){"use strict";if(!e.setImmediate){var r,i,o,s,a,l=1,c={},u=!1,h=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){n.nextTick((function(){f(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&f(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){f(e.data)},r=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(e){var t=h.createElement("script");t.onreadystatechange=function(){f(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(f,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return c[l]=i,r(l),l++},d.clearImmediate=p}function p(e){delete c[e]}function f(e){if(u)setTimeout(f,0,e);else{var t=c[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{p(e),u=!1}}}}}("undefined"==typeof self?void 0===r.g?this:r.g:self)},9523:e=>{const t={acl:"http://www.w3.org/ns/auth/acl#",arg:"http://www.w3.org/ns/pim/arg#",as:"https://www.w3.org/ns/activitystreams#",cal:"http://www.w3.org/2002/12/cal/ical#",cert:"http://www.w3.org/ns/auth/cert#",contact:"http://www.w3.org/2000/10/swap/pim/contact#",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",doap:"http://usefulinc.com/ns/doap#",foaf:"http://xmlns.com/foaf/0.1/",geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",gpx:"http://www.w3.org/ns/pim/gpx#",http:"http://www.w3.org/2007/ont/http#",httph:"http://www.w3.org/2007/ont/httph#",icalTZ:"http://www.w3.org/2002/12/cal/icaltzd#",ldp:"http://www.w3.org/ns/ldp#",link:"http://www.w3.org/2007/ont/link#",log:"http://www.w3.org/2000/10/swap/log#",meeting:"http://www.w3.org/ns/pim/meeting#",mo:"http://purl.org/ontology/mo/",org:"http://www.w3.org/ns/org#",owl:"http://www.w3.org/2002/07/owl#",pad:"http://www.w3.org/ns/pim/pad#",patch:"http://www.w3.org/ns/pim/patch#",prov:"http://www.w3.org/ns/prov#",qu:"http://www.w3.org/2000/10/swap/pim/qif#",trip:"http://www.w3.org/ns/pim/trip#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rss:"http://purl.org/rss/1.0/",sched:"http://www.w3.org/ns/pim/schedule#",schema:"http://schema.org/",sioc:"http://rdfs.org/sioc/ns#",solid:"http://www.w3.org/ns/solid/terms#",space:"http://www.w3.org/ns/pim/space#",stat:"http://www.w3.org/ns/posix/stat#",tab:"http://www.w3.org/2007/ont/link#",tabont:"http://www.w3.org/2007/ont/link#",ui:"http://www.w3.org/ns/ui#",vcard:"http://www.w3.org/2006/vcard/ns#",wf:"http://www.w3.org/2005/01/wf/flow#",xsd:"http://www.w3.org/2001/XMLSchema#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/"};e.exports=function(e={namedNode:e=>e}){const r={};for(const n in t){const i=t[n];r[n]=function(t=""){return e.namedNode(i+t)}}return r}},9397:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},4489:(e,t,r)=>{"use strict";var n=r(7092),i=r(7427),o=r(4010),s=r(2527);function a(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=a(Object.prototype.toString),h=a(Number.prototype.valueOf),d=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(l)var f=a(BigInt.prototype.valueOf);if(c)var g=a(Symbol.prototype.valueOf);function y(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===u(e)}function v(e){return"[object Set]"===u(e)}function b(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function x(e){return"[object ArrayBuffer]"===u(e)}function _(e){return"undefined"!=typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function T(e){return"[object DataView]"===u(e)}function N(e){return"undefined"!=typeof DataView&&(T.working?T(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||N(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=_,T.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&T(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=N;var j="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function E(e){return"[object SharedArrayBuffer]"===u(e)}function O(e){return void 0!==j&&(void 0===E.working&&(E.working=E(new j)),E.working?E(e):e instanceof j)}function S(e){return y(e,h)}function I(e){return y(e,d)}function A(e){return y(e,p)}function k(e){return l&&y(e,f)}function R(e){return c&&y(e,g)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},t.isGeneratorObject=function(e){return"[object Generator]"===u(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},t.isNumberObject=S,t.isStringObject=I,t.isBooleanObject=A,t.isBigIntObject=k,t.isSymbolObject=R,t.isBoxedPrimitive=function(e){return S(e)||I(e)||A(e)||k(e)||R(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(_(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},5663:(e,t,r)=>{var n=r(2530),i=r(292),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},s=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(s,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r<i;a=n[++r])v(a)||!T(a)?o+=" "+a:o+=" "+u(a);return o},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?i.trace(r):i.error(r),o=!0}return e.apply(this,arguments)}};var a={},l=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),l=new RegExp("^"+c+"$","i")}function u(e,r){var n={seen:[],stylize:d};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),p(n,e,n.depth)}function h(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function d(e,t){return e}function p(e,r,n){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return w(i)||(i=p(e,i,n)),i}var o=function(e,t){if(x(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),j(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return f(r);if(0===s.length){if(E(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(N(r))return e.stylize(Date.prototype.toString.call(r),"date");if(j(r))return f(r)}var c,u="",h=!1,d=["{","}"];return y(r)&&(h=!0,d=["[","]"]),E(r)&&(u=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(u=" "+RegExp.prototype.toString.call(r)),N(r)&&(u=" "+Date.prototype.toUTCString.call(r)),j(r)&&(u=" "+f(r)),0!==s.length||h&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=h?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)k(t,String(s))?o.push(g(e,t,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(g(e,t,r,n,i,!0))})),o}(e,r,n,a,s):s.map((function(t){return g(e,r,n,a,t,h)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,u,d)):d[0]+u+d[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function g(e,t,r,n,i,o){var s,a,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),k(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(l.value)<0?(a=v(r)?p(e,l.value,null):p(e,l.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),x(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function y(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function x(e){return void 0===e}function _(e){return T(e)&&"[object RegExp]"===O(e)}function T(e){return"object"==typeof e&&null!==e}function N(e){return T(e)&&"[object Date]"===O(e)}function j(e){return T(e)&&("[object Error]"===O(e)||e instanceof Error)}function E(e){return"function"==typeof e}function O(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(l.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);i.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(4489),t.isArray=y,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=x,t.isRegExp=_,t.types.isRegExp=_,t.isObject=T,t.isDate=N,t.types.isDate=N,t.isError=j,t.types.isNativeError=j,t.isFunction=E,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(9397);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),I[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){i.log("%s - %s",A(),t.format.apply(t,arguments))},t.inherits=r(8575),t._extend=function(e,t){if(!t||!T(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),R&&Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=R,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};e.apply(this,t).then((function(e){n.nextTick(s.bind(null,null,e))}),(function(e){n.nextTick(C.bind(null,e,s))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},4010:(e,t,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),s=r(3828),a=o("Object.prototype.toString"),l=r(4111)(),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),h=o("String.prototype.slice"),d={},p=Object.getPrototypeOf;l&&s&&p&&n(u,(function(e){if("function"==typeof c[e]){var t=new c[e];if(Symbol.toStringTag in t){var r=p(t),n=s(r,Symbol.toStringTag);if(!n){var i=p(r);n=s(i,Symbol.toStringTag)}d[e]=n.get}}}));var f=r(2527);e.exports=function(e){return!!f(e)&&(l&&Symbol.toStringTag in e?function(e){var t=!1;return n(d,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):h(a(e),8,-1))}},7876:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},1123:(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;r<i;r++)t.push(arguments[r]);return t}function i(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)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(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.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)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var s=[];for(n=0;o&&n<t;n++)s.push(o.value),o=this.removeNode(o);for(null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev),n=0;n<r.length;n++)o=i(this,o,r[n]);return s},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(7876)(n)}catch(e){}},870:t=>{"use strict";t.exports=e},7670:()=>{},4343:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},240:(e,t,r)=>{"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{Z:()=>n})}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{BlankNode:()=>a,Collection:()=>p,ConnectedStore:()=>ir,DataFactory:()=>Ut,Empty:()=>f,Fetcher:()=>Ct,Formula:()=>$,IndexedFormula:()=>ee,Literal:()=>h,LiveStore:()=>or,N3Parser:()=>_e,NamedNode:()=>l.Z,Namespace:()=>S,NextId:()=>nr,Node:()=>z,Query:()=>J,RDFParser:()=>dt,RDFaProcessor:()=>ut,SPARQLToQuery:()=>Pt,Serializer:()=>D,Statement:()=>w,Store:()=>ee,UpdateManager:()=>Mt,UpdatesSocket:()=>Bt,UpdatesVia:()=>qt,Util:()=>I,Variable:()=>_,blankNode:()=>Xt,defaultGraph:()=>Wt,fetcher:()=>Zt,fromNT:()=>tr,graph:()=>$t,isBlankNode:()=>c.B2,isCollection:()=>c.uZ,isGraph:()=>c.NA,isLiteral:()=>c.n_,isNamedNode:()=>c.NX,isPredicate:()=>c.lx,isQuad:()=>c.PY,isRDFObject:()=>c.lt,isRDFlibObject:()=>c.Uc,isRDFlibPredicate:()=>c.nq,isRDFlibSubject:()=>c.f,isStatement:()=>c.Yi,isStore:()=>c.Pv,isSubject:()=>c.zz,isTerm:()=>c.jt,isVariable:()=>c.cG,jsonParser:()=>Dt,lit:()=>zt,literal:()=>Qt,log:()=>O.Z,namedNode:()=>Gt,parse:()=>ft,quad:()=>Yt,queryToSPARQL:()=>Lt,serialize:()=>F,sparqlUpdateParser:()=>pt,st:()=>Vt,sym:()=>Gt,term:()=>rr,termValue:()=>mt._,triple:()=>Kt,uri:()=>x,variable:()=>Jt});var e=n(240),t=n(8333),r=n(4806),o=n(9247),s=n(292);class a extends r.Z{static getId(e){if(e){if("string"!=typeof e)throw s.log("Bad blank id:",e),new Error("Bad id argument to new blank node: "+e);if(e.includes("#")){let t=e.split("#");return t[t.length-1]}return e}return"n"+a.nextId++}constructor(r){super(a.getId(r)),(0,e.Z)(this,"termType",o.V1),(0,e.Z)(this,"classOrder",t.Z.BlankNode),(0,e.Z)(this,"isBlank",1),(0,e.Z)(this,"isVar",1)}get id(){return this.value}set id(e){this.value=e}compareTerm(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.id<e.id?-1:this.id>e.id?1:0}copy(e){var t=new a;return e.copyTo(this,t),t}toCanonical(){return a.NTAnonymousNodePrefix+this.value}toString(){return a.NTAnonymousNodePrefix+this.id}}(0,e.Z)(a,"nextId",0),(0,e.Z)(a,"NTAnonymousNodePrefix","_:");var l=n(6545),c=n(5904);const u={boolean:new l.Z("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new l.Z("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new l.Z("http://www.w3.org/2001/XMLSchema#decimal"),double:new l.Z("http://www.w3.org/2001/XMLSchema#double"),integer:new l.Z("http://www.w3.org/2001/XMLSchema#integer"),langString:new l.Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new l.Z("http://www.w3.org/2001/XMLSchema#string")};class h extends r.Z{constructor(r,n,i){super(r),(0,e.Z)(this,"termType",o.xH),(0,e.Z)(this,"classOrder",t.Z.Literal),(0,e.Z)(this,"datatype",u.string),(0,e.Z)(this,"isVar",0),(0,e.Z)(this,"language",""),n?(this.language=n,this.datatype=u.langString):this.datatype=i?l.Z.fromValue(i):u.string}copy(){return new h(this.value,this.lang,this.datatype)}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(!this.datatype&&!e.datatype||this.datatype&&this.datatype.equals(e.datatype))}get lang(){return this.language}set lang(e){this.language=e||""}toNT(){return h.toNT(this)}static toNT(e){if("number"==typeof e.value)return""+e.value;if("string"!=typeof e.value)throw new Error("Value of RDF literal is not string or number: "+e.value);var t=e.value;return t='"'+(t=(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',e.language?t+="@"+e.language:e.datatype.equals(u.string)||(t+="^^"+e.datatype.toCanonical()),t}toString(){return""+this.value}static fromBoolean(e){return new h(e?"1":"0",null,u.boolean)}static fromDate(e){if(!(e instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");let t=function(e){return(""+(100+e)).slice(1,3)},r=e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"Z";return new h(r,null,u.dateTime)}static fromNumber(e){if("number"!=typeof e)throw new TypeError("Invalid argument to Literal.fromNumber()");let t;const r=e.toString();return t=r.indexOf("e")<0&&Math.abs(e)<=Number.MAX_SAFE_INTEGER?Number.isInteger(e)?u.integer:u.decimal:u.double,new h(r,null,t)}static fromValue(e){if((0,c.n_)(e))return e;switch(typeof e){case"object":if(e instanceof Date)return h.fromDate(e);case"boolean":return h.fromBoolean(e);case"number":return h.fromNumber(e);case"string":return new h(e)}throw new Error("Can't make literal from "+e+" of type "+typeof e)}}function d(e){return null==e||(0,c.jt)(e)?e:Array.isArray(e)?new p(e):h.fromValue(e)}class p extends r.Z{constructor(r){super((a.nextId++).toString()),(0,e.Z)(this,"termType",o.fb),(0,e.Z)(this,"classOrder",t.Z.Collection),(0,e.Z)(this,"closed",!1),(0,e.Z)(this,"compareTerm",a.prototype.compareTerm),(0,e.Z)(this,"elements",[]),(0,e.Z)(this,"isVar",0),r&&r.length>0&&r.forEach((e=>{this.elements.push(d(e))}))}get id(){return this.value}set id(e){this.value=e}append(e){return this.elements.push(e)}close(){return this.closed=!0,this.closed}shift(){return this.elements.shift()}substitute(e){const t=this.elements.map((t=>t.substitute(e)));return new p(t)}toNT(){return p.toNT(this)}static toNT(e){return a.NTAnonymousNodePrefix+e.id}toString(){return"("+this.elements.join(" ")+")"}unshift(e){return this.elements.unshift(e)}}(0,e.Z)(p,"termType",o.fb);class f extends r.Z{constructor(){super(""),(0,e.Z)(this,"termType",o.ls)}toString(){return"()"}}const g="chrome:theSession";new l.Z(g);class y extends r.Z{constructor(){super(""),(0,e.Z)(this,"value",""),(0,e.Z)(this,"termType",o.NK),(0,e.Z)(this,"uri",g)}toCanonical(){return this.value}toString(){return"DefaultGraph"}}function m(e){return!!e&&e.termType===o.NK}var v=n(292);const b=new y;class w{constructor(t,n,i,o){(0,e.Z)(this,"subject",void 0),(0,e.Z)(this,"predicate",void 0),(0,e.Z)(this,"object",void 0),(0,e.Z)(this,"graph",void 0),this.subject=r.Z.fromValue(t),this.predicate=r.Z.fromValue(n),this.object=r.Z.fromValue(i),this.graph=null==o?b:r.Z.fromValue(o)}get why(){return this.graph}set why(e){this.graph=e}equals(e){return e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}substitute(e){const t=new w(this.subject.substitute(e),this.predicate.substitute(e),this.object.substitute(e),m(this.graph)?this.graph:this.graph.substitute(e));return v.log("@@@ statement substitute:"+t),t}toCanonical(){let e=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==o.NK&&e.push(this.graph.toCanonical()),e.join(" ")+" ."}toNT(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}toNQ(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),m(this.graph)?"":this.graph.toNT()].join(" ")+" ."}toString(){return this.toNT()}}var x=n(3357);class _ extends r.Z{constructor(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(r),(0,e.Z)(this,"termType",o.UH),(0,e.Z)(this,"base","varid:"),(0,e.Z)(this,"classOrder",t.Z.Variable),(0,e.Z)(this,"isVar",1),(0,e.Z)(this,"uri",void 0),this.base="varid:",this.uri=x.join(r,this.base)}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value}hashString(){return this.toString()}substitute(e){var t;return null!=(t=e[this.toNT()])?t:this}toString(){return _.toString(this)}static toString(e){return e.uri.slice(0,e.base.length)===e.base?`?${e.uri.slice(e.base.length)}`:`?${e.uri}`}}let T;!function(e){e.collections="COLLECTIONS",e.defaultGraphType="DEFAULT_GRAPH_TYPE",e.equalsMethod="EQUALS_METHOD",e.id="ID",e.identity="IDENTITY",e.reversibleId="REVERSIBLE_ID",e.variableType="VARIABLE_TYPE"}(T||(T={}));const N=new y,j={supports:{[T.collections]:!1,[T.defaultGraphType]:!1,[T.equalsMethod]:!0,[T.identity]:!1,[T.id]:!0,[T.reversibleId]:!1,[T.variableType]:!0},blankNode:e=>new a(e),defaultGraph:()=>N,equals(e,t){return e===t||!e||!t||((0,c.PY)(e)||(0,c.PY)(t)?!(!(0,c.PY)(e)||!(0,c.PY)(t))&&this.equals(e.subject,t.subject)&&this.equals(e.predicate,t.predicate)&&this.equals(e.object,t.object)&&this.equals(e.graph,t.graph):!(!(0,c.jt)(e)||!(0,c.jt)(t))&&this.id(e)===this.id(t))},id(e){if(!e)return"undefined";if((0,c.PY)(e))return this.quadToNQ(e);switch(e.termType){case o.NK:return"defaultGraph";case o.UH:return _.toString(e);default:const t=this.termToNQ(e);if(t)return t;throw new Error(`Can't id term with type '${e.termType}'`)}},isQuad:e=>e instanceof w,literal(e,t){if("string"!=typeof e&&!t)return h.fromValue(e);const r="string"==typeof e?e:""+e;return"string"==typeof t?-1===t.indexOf(":")?new h(r,t):new h(r,null,this.namedNode(t)):new h(r,null,t)},namedNode:e=>new l.Z(e),quad:(e,t,r,n)=>new w(e,t,r,n||N),triple(e,t,r,n){return this.quad(e,t,r,n)},quadToNQ(e){return`${this.termToNQ(e.subject)} ${this.termToNQ(e.predicate)} ${this.termToNQ(e.object)} ${this.termToNQ(e.graph)} .`},termToNQ(e){switch(e.termType){case o.V1:return"_:"+e.value;case o.NK:return"";case o.ls:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case o.xH:return h.toNT(e);case o._A:case o.XM:return"<"+e.value+">";case o.fb:return"("+e.elements.map((e=>this.termToNQ(e))).join(" ")+")";default:throw new Error(`Can't serialize nonstandard term type (was '${e.termType}')`)}},toNQ(e){return this.isQuad(e)?this.quadToNQ(e):this.termToNQ(e)},variable:e=>new _(e)},E=j;var O=n(7308);function S(e,t){const r=t||{namedNode:e=>new l.Z(e)};return function(t){return r.namedNode(e+(t||""))}}var I=n(5115);function A(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E;return{boolean:e.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:e.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:e.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:e.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:e.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:e.namedNode("http://www.w3.org/2001/XMLSchema#string")}}A(E);var k=n(9523),R=n.n(k),C=n(292);function D(e){return new L(e)}class L{constructor(t){(0,e.Z)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,e.Z)(this,"_notNameChars",this._notQNameChars+":"),(0,e.Z)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,e.Z)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,e.Z)(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];const r=Object.keys(R()());for(const e in r){const t=R()()[r[e]](""),n=r[e];this.prefixes[t]=n,this.namespaces[n]=t}this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=t,this.rdfFactory=t.rdfFactory||E,this.xsd=A(this.rdfFactory)}setBase(e){return this.base=e,this}setFlags(e){return this.flags=e||"",this}toStr(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t}fromStr(e){if("{"===e[0]){var t=this.formulas[e];return t||C.log("No formula object for "+e),t}return this.store.fromNT(e)}setNamespaces(e){for(var t in e)this.setPrefix(t,e[t]);return this}setPrefix(e,t){if("default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t){for(let t in this.prefixes)this.prefixes[t]==e&&delete this.prefixes[t];this.prefixes[t]=e,this.namespaces[e]=t}}suggestPrefix(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))}suggestNamespaces(e){for(var t in e)this.suggestPrefix(t,e[t]);return this}checkIntegrity(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")}makeUpPrefix(e){var t=e,r=function(t){return!!this.validPrefix.test(t)&&"ns"!==t&&!(t in this.namespaces)&&(this.prefixes[e]=t,this.namespaces[t]=e,t)}.bind(this);"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var n=t.lastIndexOf("/");n>=0&&(t=t.slice(n+1));for(var i=0;i<t.length&&this.prefixchars.indexOf(t[i]);)i++;if((t=t.slice(0,i)).length<6&&r(t))return t;if(r(t.slice(0,3)))return t.slice(0,3);if(r(t.slice(0,2)))return t.slice(0,2);if(r(t.slice(0,4)))return t.slice(0,4);if(r(t.slice(0,1)))return t.slice(0,1);if(r(t.slice(0,5)))return t.slice(0,5);this.validPrefix.test(t)||(t="n");for(var o=0;;o++)if(r(t.slice(0,3)+o))return t.slice(0,3)+o}rootSubjects(e){for(var t={},r={},n={},i=0;i<e.length;i++){var o=e[i],s=function(e){t.hasOwnProperty(e)||(t[e]=[]),t[e].push(o.subject)};[o.subject,o.predicate,o.object].map((function(e){"BlankNode"===e.termType?n[e.toNT()]=!0:"Collection"===e.termType&&e.elements.forEach((function(e){s(e)}))})),s(e[i].object);var a=r[this.toStr(o.subject)];a||(a=[]),a.push(o),r[this.toStr(o.subject)]=a}var l=[];for(var c in r)if(r.hasOwnProperty(c)){var u=this.fromStr(c);"BlankNode"===u.termType&&t[u]&&1===t[u].length||l.push(u)}this.incoming=t;for(var h={},d=0;d<l.length;d++)h[l[d].toNT()]=!0;return{roots:l,subjects:r,rootsHash:h,incoming:t}}toN3(e){return this.statementsToN3(e.statements)}explicitURI(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?x.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,r="",n=0;n<e.length;n++)r+=(t=e.charCodeAt(n))>65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[n];return r}(e):encodeURI(e))+">"}statementsToNTriples(e){var t=e.slice();t.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,o=this.store,s=this.rdfFactory,a=function(e){if("Collection"!==e.termType)return i.atomicTermToN3(e);for(var t=e.elements,l=o.sym(n+"nill"),c=t.length-1;c>=0;c--){var u=s.blankNode();r+=a(u)+" "+a(o.sym(n+"first"))+" "+a(t[c])+".\n",r+=a(u)+" "+a(o.sym(n+"rest"))+" "+a(l)+".\n",l=u}return i.atomicTermToN3(l)},l=0;l<t.length;l++){var c=t[l],u="";u+=a(c.subject)+" ",u+=a(c.predicate)+" ",u+=a(c.object)+" ",this.flags.indexOf("q")>=0&&(u+=a(c.why)+" "),r+=u+=".\n"}return r}statementsToN3(e){var t=this.store,r={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};e.sort((function(e,n){return I.heavyCompareSPO(e,n,t,r)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var n={};this.flags.indexOf("s")<0&&(n["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(n["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(n["http://www.w3.org/2000/10/swap/log#implies"]="=>");var i=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},o=function(e){for(var t="",r=0;r<e.length;r++){var n=e[r],i="string"==typeof n?n:o(n);if(0!==r){var s=t.slice(-1)||" ";","===i||";"===i||("."!==i||"0123456789.:".includes(s))&&(t+=" ")}t+=i}return t},s=function(e,t){var r="",n=1e5;void 0===t&&(t=-1);for(var a=0;a<e.length;a++){var l=e[a];if("string"!=typeof l){var c=s(l,t+1);if(c.length<10*(80-4*t)&&c.indexOf('"""')<0){var u=o(l);u.length<80-4*t&&(l=u,c="")}c&&(n=1e4),r+=c}if("string"==typeof l){if(1===l.length&&"\n"===r.slice(-1)&&",.;".indexOf(l)>=0){r=r.slice(0,-1),"."==l&&"0123456789.:".includes(r.charAt(r.length-1))&&(r+=" ",n+=1),r+=l+"\n",n+=1;continue}if(n<4*t+4||n+l.length+1<80&&";.".indexOf(r[r.length-2])<0)r=r.slice(0,-1)+" "+l+"\n",n+=l.length+1;else{let e=i(4*t)+l;r+=e+"\n",n=e.length,t<0&&(r+="\n",n=1e5)}}}return r},a=function(e){for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(l(o,t))}return n}.bind(this);function l(e,t){return"BlankNode"!==e.termType||t.incoming[e]?[h(e,t)].concat([c(e,t)]).concat(["."]):u(e,t,!0).concat(["."])}var c=function(e,t){var r=[],i=null,o=t.subjects[this.toStr(e)]||[];if(void 0===o)throw new Error("Cant find statements for "+e);for(var s=[],a=0;a<o.length;a++){var l=o[a];l.predicate.uri===i?s.push(","):(i&&(r=r.concat([s]).concat([";"]),s=[]),r.push(n[l.predicate.uri]?n[l.predicate.uri]:h(l.predicate,t))),i=l.predicate.uri,s.push(u(l.object,t))}return r.concat([s])}.bind(this),u=function(e,t,r){return"BlankNode"!==e.termType||!r&&void 0!==t.rootsHash[e.toNT()]?h(e,t):t.subjects[this.toStr(e)]?["[",c(e,t),"]"]:"[]"}.bind(this);L.prototype.termToN3=h;var h=function(e,t){var r,n;switch(e.termType){case"Graph":return(n=(n=["{"]).concat(a(e.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<e.elements.length;r++)n.push([u(e.elements[r],t)]);return n.push(")"),n;default:return this.atomicTermToN3(e)}}.bind(this),d=function(){var e="";for(var t in this.defaultNamespace&&(e+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(t)&&this.namespacesUsed[t]&&(e+="@prefix "+this.prefixes[t]+": "+this.explicitURI(t)+".\n");return e+"\n"}.bind(this),p=a(e);return d()+s(p)}atomicTermToN3(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var r=e.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return r;case"http://www.w3.org/2001/XMLSchema#decimal":return r.indexOf(".")<0&&(r+=".0"),r;case"http://www.w3.org/2001/XMLSchema#double":{const e=r.toLowerCase().indexOf("e")>0;return r.indexOf(".")<0&&!e&&(r+=".0"),e||(r+="e0"),r}case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===e.value?"true":"false"}var n=this.stringToN3(e.value);return e.language?n+="@"+e.language:e.datatype.equals(this.xsd.string)||(n+="^^"+this.atomicTermToN3(e.datatype,t)),n;case"NamedNode":return this.symbolToN3(e);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}}stringToN3(e,t){t||(t="e");var r,n,i,o,s,a="";for(e.length>20&&'"'!==e.slice(-1)&&t.indexOf("n")<0&&(e.indexOf("\n")>0||e.indexOf('"')>0)?(o='"""',s=this.forbidden3):(o='"',s=this.forbidden1),r=0;r<e.length&&(s.lastIndex=0,null!=s.exec(e.slice(r)));){n=r+s.lastIndex-1,a+=e.slice(r,n);var l=e[n];'"'===l&&'"""'===o&&'"""'!==e.slice(n,n+3)?a+=l:(i='\b\f\r\t\v\n\\"'.indexOf(l))>=0?a+="\\"+'bfrtvn\\"'[i]:t.indexOf("e")>=0?a+="\\u"+("000"+l.charCodeAt(0).toString(16).toLowerCase()).slice(-4):a+=l,r=n+1}return o+a+e.slice(r)+o}symbolToN3(e){var t=e.uri,r=t.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=t.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===t.indexOf("http")||0===t.indexOf("ws")||0===t.indexOf("file"))){for(var n=!0,i=r+1;i<t.length;i++)if(this._notNameChars.indexOf(t[i])>=0){n=!1;break}if(n){var o=t.slice(r+1),s=t.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var a=this.prefixes[s];if(a||(a=this.makeUpPrefix(s)),a)return this.namespacesUsed[s]=!0,a+":"+o}}return this.explicitURI(t)}writeStore(e){var t=this.store,r=t.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var o in i){var s=t.fromNT(o);n&&s.equals(n)||e("\n"+this.atomicTermToN3(s)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,s))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){e("\n<"+r.object.value+"> log:metadata {\n");var n=t.statementsMatching(void 0,void 0,void 0,r.subject);e(this.statementsToN3(this.statementsToN3(n))),e("}.\n")}));var a=[];n&&a.push(n);var l=[];a.map((function(e){l=l.concat(t.statementsMatching(void 0,void 0,void 0,e))})),e(this.statementsToN3(l))}statementsToXML(e){var t=[];t["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",n=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},i=function(e){for(var t="",r=0;r<e.length;r++){var n=e[r];t+="string"==typeof n?n:i(n)}return t},o=function(e,t){var r,s="",a=1e5;t||(t=0);for(var l=0;l<e.length;l++){var c=e[l];if("string"!=typeof c){var u=o(c,t+1);u.length<10*(80-4*t)&&u.indexOf('"""')<0&&(r=i(c)).length<80-4*t&&(c=" "+r,u=""),u&&(a=1e4),s+=u}"string"==typeof c&&(a<4*t+4?(s=s.slice(0,-1)+" "+c+"\n",a+=c.length+1):(s+=(r=n(4*t)+c)+"\n",a=r.length))}return s},s=function(e){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(c(o,t))}return n}.bind(this);function a(e){return void 0===e?"@@@undefined@@@@":e.replace(/[&<"]/g,(function(e){switch(e[0]){case"&":return"&";case"<":return"<";case'"':return"""}}))}var l=function(e){return a(this.base?x.refTo(this.base,e.uri):e.uri)}.bind(this),c=function(e,t){var n,i,o,s,p=[],f=t.subjects[this.toStr(e)];if(void 0===f)return h(e,t);f.sort((function(e,t){var n=e.predicate.uri,i=t.predicate.uri;if(n.substring(0,r.length)===r||i.substring(0,r.length)===r)return n.localeCompare(i);var o=n.substring(r.length),s=i.substring(r.length),a=parseInt(o,10),l=parseInt(s,10);return isNaN(a)||isNaN(l)||a!==o||l!==s?n.localeCompare(i):a-l}));for(var g=0;g<f.length;g++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=f[g]).predicate.uri||n||"NamedNode"!==o.object.termType){if((s=o.predicate).uri.substr(0,r.length)===r){var y=s.uri.substr(r.length);y===parseInt(y,10).toString()&&(s=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=d(s),o.object.termType){case"BlankNode":p=1===t.incoming[o.object].length?p.concat(["<"+i+' rdf:parseType="Resource">',c(o.object,t),"</"+i+">"]):p.concat(["<"+i+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":p=p.concat(["<"+i+' rdf:resource="'+l(o.object)+'"/>']);break;case"Literal":p=p.concat(["<"+i+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.uri)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+i+">"]);break;case"Collection":p=p.concat(["<"+i+' rdf:parseType="Collection">',u(o.object,t),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else n=o.object;var m=n?d(n):"rdf:Description",v="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(v=' rdf:nodeID="'+e.toNT().slice(2)+'"'):v=' rdf:about="'+l(e)+'"',["<"+m+v+">"].concat([p]).concat(["</"+m+">"])}.bind(this);function u(e,t){for(var r=[],n=0;n<e.elements.length;n++)r.push(c(e.elements[n],t));return r}var h=function(e,t){var r=[],n=t.subjects[this.toStr(e)];if(!n)return r;n.sort();for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"BlankNode":r=t.rootsHash[o.object.toNT()]?r.concat(["<"+d(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+d(o.predicate)+">"]):r.concat(["<"+d(o.predicate)+' rdf:parseType="Resource">',h(o.object,t),"</"+d(o.predicate)+">"]);break;case"NamedNode":r=r.concat(["<"+d(o.predicate)+' rdf:resource="'+l(o.object)+'"/>']);break;case"Literal":r=r.concat(["<"+d(o.predicate)+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+d(o.predicate)+">"]);break;case"Collection":r=r.concat(["<"+d(o.predicate)+' rdf:parseType="Collection">',u(o.object,t),"</"+d(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return r}.bind(this),d=function(e){var r=e.uri,n=r.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=r.lastIndexOf("/")),n<0)throw new Error("Cannot make qname out of <"+r+">");for(var i=n+1;i<r.length;i++)if(this._notNameChars.indexOf(r[i])>=0)throw new Error('Invalid character "'+r[i]+'" cannot be in XML qname for URI: '+r);var o=r.slice(n+1),s=r.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return o;var a=this.prefixes[s];return a||(a=this.makeUpPrefix(s)),t[s]=!0,a+":"+o}.bind(this),p=s(e),f="<rdf:RDF";for(var g in this.defaultNamespace&&(f+=' xmlns="'+a(this.defaultNamespace)+'"'),t)if(t.hasOwnProperty(g)){var y=this.base&&this.flags.includes("z")?x.refTo(this.base,g):g;f+="\n xmlns:"+this.prefixes[g]+'="'+a(y)+'"'}return o([f+=">",p,"</rdf:RDF>"],-1)}}var P=n(730),M=n.n(P);function F(e,t,r,n,i,s){r=r||(null==e?void 0:e.value);const a=s||{};n=n||o.z8;try{var l=D(t);a.flags&&l.setFlags(a.flags);var c=t.statementsMatching(void 0,void 0,void 0,e);switch("namespaces"in t&&l.suggestNamespaces(t.namespaces),a.namespaces&&l.setNamespaces(a.namespaces),l.setBase(r),n){case o.Is:return u(null,l.statementsToXML(c));case o.qS:case o.sZ:return u(null,l.statementsToN3(c));case o.z8:case o.Eo:return l.setFlags("si"),u(null,l.statementsToN3(c));case o.aV:return l.setFlags("deinprstux"),u(null,l.statementsToNTriples(c));case o.ui:return l.setFlags("deinprstux"),function(e){try{return P.fromRDF(e,{format:"application/n-quads"}).then((e=>JSON.stringify(e)))}catch(e){throw e}}(l.statementsToNTriples(c));case o.b4:case o.lL:return l.setFlags("deinprstux q"),u(null,l.statementsToNTriples(c));default:throw new Error("Serialize: Content-type "+n+" not supported for data write.")}}catch(e){if(i)return i(e,void 0);throw e}function u(e,t){return i?void i(e,t):t}}const U=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],B="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function q(e,t,r){const n=[];return r.reduce(((t,r,i,o)=>{let s;return n.push(e.quad(t,e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),o[i])),i<o.length-1?(s=e.blankNode(),n.push(e.quad(t,e.namedNode(B),s))):n.push(e.quad(t,e.namedNode(B),e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),s}),t),n}function H(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;var n=e.length;for(r<0&&(r=n+r);r<n;r++)if(e[r]===t)return r;return-1}var Z=n(292);class $ extends r.Z{constructor(){var r;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};super(""),r=this,this.statements=n,this.constraints=i,this.initBindings=s,this.optional=a,(0,e.Z)(this,"termType",o._A),(0,e.Z)(this,"classOrder",t.Z.Graph),(0,e.Z)(this,"fetcher",void 0),(0,e.Z)(this,"isVar",0),(0,e.Z)(this,"ns",S),(0,e.Z)(this,"rdfFactory",void 0),this.rdfFactory=l&&l.rdfFactory||E;for(const e of U)this[e]=function(){return r.rdfFactory[e](...arguments)}}add(e,t,r,n){return 1===arguments.length&&e.forEach((e=>this.add(e.subject,e.predicate,e.object,e.graph))),this.statements.push(this.rdfFactory.quad(e,t,r,n))}addStatement(e){return this.add(e)}bnode(e){return this.rdfFactory.blankNode(e)}addAll(e){e.forEach((e=>{this.add(e.subject,e.predicate,e.object,e.graph)}))}any(e,t,r,n){const i=this.anyStatementMatching(e,t,r,n);return null==i?null:null==e?i.subject:null==t?i.predicate:null==r?i.object:null}anyValue(e,t,r,n){const i=this.any(e,t,r,n);return i?i.value:void 0}anyJS(e,t,n,i){const o=this.any(e,t,n,i);return o?r.Z.toJS(o):void 0}anyStatementMatching(e,t,r,n){let i=this.statementsMatching(e,t,r,n,!0);if(i&&0!==i.length)return i[0]}id(e){return this.rdfFactory.id(e)}statementsMatching(e,t,r,n,i){const o=this.statements.filter((i=>(!e||e.equals(i.subject))&&(!t||t.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))));return i?0===o.length?[]:[o[0]]:o}bottomTypeURIs(e){let t,r,n,i,o,s,a,l;t=[];for(let c in e)if(e.hasOwnProperty(c)){for(l=e[c],a=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(c)),r=!0,i=0,o=a.length;i<o;i++)if(n=a[i],s=n.uri,s in e){r=!1;break}r&&(t[c]=l)}return t}collection(){return new p}each(e,t,r,n){const i=[];let o=this.statementsMatching(e,t,r,n,!1);if(null==e)for(let e=0,t=o.length;e<t;e++)i.push(o[e].subject);else if(null==t)for(let e=0,t=o.length;e<t;e++)i.push(o[e].predicate);else if(null==r)for(let e=0,t=o.length;e<t;e++)i.push(o[e].object);else if(null==n)for(let e=0,t=o.length;e<t;e++)i.push(new l.Z(o[e].graph.value));return i}equals(e){return!!e&&this.hashString()===e.hashString()}findMembersNT(e){let t,r,n,i,o,s,a,l,c,u,h,d,p,f;d={},d[e.toNT()]=!0,i={},s=this.transitiveClosure(d,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0);for(let e in s)if(s.hasOwnProperty(e)){a=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(e));for(let e=0,t=a.length;e<t;e++)p=a[e],i[p.subject.toNT()]=p;l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(e));for(let e=0,r=l.length;e<r;e++)for(o=l[e],c=this.statementsMatching(void 0,o),n=0,t=c.length;n<t;n++)p=c[n],i[p.subject.toNT()]=p;u=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(e));for(let e=0,t=u.length;e<t;e++)for(o=u[e],h=this.statementsMatching(void 0,o),f=0,r=h.length;f<r;f++)p=h[f],i[p.object.toNT()]=p}return i}findMemberURIs(e){return this.NTtoURI(this.findMembersNT(e))}findSubClassesNT(e){let t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}findSuperClassesNT(e){let t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypesNT(e){let t,r,n,i,o,s,a,l,c;n="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",c=[],i=this.statementsMatching(e,void 0,void 0);for(let e=0,t=i.length;e<t;e++)if(l=i[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===l.predicate.uri)c[l.object.toNT()]=l;else{o=this.each(l.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"));for(let e=0,t=o.length;e<t;e++)r=o[e],c[r.toNT()]=l}s=this.statementsMatching(void 0,void 0,e);for(let e=0,r=s.length;e<r;e++){l=s[e],a=this.each(l.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"));for(let e=0,r=a.length;e<r;e++)t=a[e],c[t.toNT()]=l}return this.transitiveClosure(c,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypeURIs(e){return this.NTtoURI(this.findTypesNT(e))}connectedStatements(e,t,r){r=r||[];let n=[e],i={},o={},s=[],a=this,l=function(e){let l=function(e){"BlankNode"!==e.termType||i[e.value]||(i[e.value]=!0,n.push(e))},c=a.statementsMatching(null,null,e,t).concat(a.statementsMatching(e,null,null,t));c=c.filter((function(e){if(r[e.predicate.value])return!1;let t=e.toNT();return!o[t]&&(o[t]=!0,!0)})),c.forEach((function(e){l(e.subject),l(e.object)})),s=s.concat(c)};for(;n.length;)l(n.shift());return s}formula(e){return new $}fromNT(e){let t,r,n;switch(e[0]){case"<":return this.sym(e.slice(1,-1));case'"':if(n=void 0,t=void 0,r=e.lastIndexOf('"'),r<e.length-1)if("@"===e[r+1])n=e.slice(r+2);else{if("^^"!==e.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+e);t=this.fromNT(e.slice(r+3))}return e=(e=(e=(e=e.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(e,n||t);case"_":return this.rdfFactory.blankNode(e.slice(2));case"?":return new _(e.slice(1))}throw new Error("Can't convert from NT: "+e)}holds(e,t,r,n){let i;if(1===arguments.length){if(!e)return!0;if(e instanceof Array){for(i=0;i<e.length;i++)if(!this.holds(e[i]))return!1;return!0}if((0,c.Yi)(e))return this.holds(e.subject,e.predicate,e.object,e.graph);if(e.statements)return this.holds(e.statements)}return null!=this.anyStatementMatching(e,t,r,n)}holdsStatement(e){return this.holds(e.subject,e.predicate,e.object,e.graph)}list(e,t){if(t.rdfFactory.supports.COLLECTIONS){const r=t.rdfFactory.collection();return e.forEach((function(e){r.append(e)})),r}{const r=t.rdfFactory.blankNode(),n=q(t.rdfFactory,r,e);return t.addAll(n),r}}NTtoURI(e){let t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],"<"===t[0]&&(n[t.slice(1,-1)]=r));return n}serialize(e,t,r,n){return F(r,this,e,t,void 0,n)}substitute(e){let t=this.statements.map((function(t){return t.substitute(e)}));Z.log("Formula subs statmnts:"+t);const r=new $;return r.addAll(t),Z.log("indexed-form subs formula:"+r),r}sym(e,t){if(t)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(e)}the(e,t,r,n){let i=this.any(e,t,r,n);return null==i&&O.Z.error("No value found for the() {"+e+" "+t+" "+r+"}."),i}transitiveClosure(e,t,r){let n,i,o,s,a,l,c={};Object.assign(c,e);let u={};for(;;){if(l=function(){for(let e in c)if(c.hasOwnProperty(e))return e}(),null==l)return u;for(a=r?this.each(void 0,t,this.fromNT(l)):this.each(this.fromNT(l),t),i=0,o=a.length;i<o;i++)n=a[i],s=n.toNT(),s in u||s in c||(c[s]=c[l]);u[l]=c[l],delete c[l]}}topTypeURIs(e){let t,r,n,i,o,s,a,l;for(n in a=[],e)if(e.hasOwnProperty(n)){for(l=e[n],o=0,s=this.each(this.rdfFactory.namedNode(n),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf")),t=0,i=s.length;t<i;t++)if(r=s[t],"http://www.w3.org/2000/01/rdf-schema#Resource"!==r.uri){o++;break}o||(a[n]=l)}return a["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete a["http://www.w3.org/2000/01/rdf-schema#Resource"],a["http://www.w3.org/2002/07/owl#Thing"]&&delete a["http://www.w3.org/2002/07/owl#Thing"],a}toString(){return"{"+this.statements.join("\n")+"}"}variable(e){return new _(e)}whether(e,t,r,n){return this.statementsMatching(e,t,r,n,!1).length}}r.Z.fromValue=d;const z=r.Z,V={xsd:S("http://www.w3.org/2001/XMLSchema#")};r.Z.toJS=function(e){return(0,c.uZ)(e)?e.elements.map(r.Z.toJS):(0,c.n_)(e)?e.datatype.equals(V.xsd("boolean"))?"1"===e.value||"true"===e.value:e.datatype.equals(V.xsd("dateTime"))||e.datatype.equals(V.xsd("date"))?new Date(e.value):e.datatype.equals(V.xsd("integer"))||e.datatype.equals(V.xsd("float"))||e.datatype.equals(V.xsd("decimal"))?Number(e.value):e.value:e};var G=n(292);class J{constructor(e,t){this.pat=new ee,this.vars=[],this.name=e,this.id=t}}function X(e,t,r,n){function i(e){var t,r="";for(t in e)e.hasOwnProperty(t)&&(r+=" "+t+" -> "+e[t]);return r}function o(e){var t,r="Bindings: ",n=e.length;for(t=0;t<n;t++)r+=i(e[t][0])+";\n\t";return r}function s(e,t,r,n){var i;if(e.length!==t.length)return[];if(!e.length)return[[[],null]];var o=function(e,t,r,n){var i=r[e];if(void 0===i){if(e.isVar){var o=[];return o[e]=t,[[o,null]]}i=e}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[t]&&(t=n.redirections[t]),i.equals(t)||i.uri&&i.uri===g?[[[],null]]:[];if(e instanceof Array)return t instanceof Array?s(e,t,r):[];throw new Error("query.js: oops - code not written yet")}(e[0],t[0],r,n);if(0===o.length)return o;var a,l,c,u,h,d,p,f=[],y=o.length;for(a=0;a<y;a++){for(h in p=[],l=o[a][0])l.hasOwnProperty(h)&&(p[h]=l[h]);for(h in r)r.hasOwnProperty(h)&&(p[h]=r[h]);for(u=(i=s(e.slice(1),t.slice(1),p,n)).length,c=0;c<u;c++){for(h in d=i[c][0],l)l.hasOwnProperty(h)&&(d[h]=l[h]);f.push([d,null])}}return f}function a(e,t){var r,n={};for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function l(e,t){return this.trunkBindings=t,this.originalCallback=e,this.branches=[],this}function c(e,t){return this.count=0,this.success=!1,this.done=!1,this.callback=e,this.onDone=t,this}l.prototype.checkAllDone=function(){var e;for(e=0;e<this.branches.length;e++)if(!this.branches[e].done)return;O.Z.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},l.prototype.doCallBacks=function(e,t){var r;if(e<0)return this.originalCallback(t);for(r=0;r<this.branches[e].results.length;r++)this.doCallBacks(e-1,a(t,this.branches[e].results[r]))},c.prototype.reportMatch=function(e){this.callback(e),this.success=!0},c.prototype.reportDone=function(){this.done=!0,O.Z.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var u=function(e){return this.count=0,this.done=!1,this.results=[],this.junction=e,e.branches.push(this),this};function h(e,t,r){var n,i,o,s,a,l;for(t.nvars=0,t.index=null,n=[t.subject,t.predicate,t.object,t.why],s=[e.subjectIndex,e.predicateIndex,e.objectIndex,e.whyIndex],o=0;o<4;o++){let c=n[o];if(c.uri&&c.uri===g);else if(c.isVar&&void 0===r[c])t.nvars++;else{if(void 0,c=void 0===(l=r[a=n[o]])?a:l,e.redirections[e.id(c)]&&(c=e.redirections[e.id(c)]),!(i=s[o][e.id(c)]))return t.index=[],!1;(null===t.index||t.index.length>i.length)&&(t.index=i)}}return null===t.index&&(t.index=e.statements),!0}function d(e,t){return e.nvars!==t.nvars?e.nvars-t.nvars:e.index.length-t.index.length}u.prototype.reportMatch=function(e){this.results.push(e)},u.prototype.reportDone=function(){O.Z.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),O.Z.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var p=function(e,r,n,o,s,a,c){O.Z.debug("Match begins, Branch count now: "+c.count+" for "+c.pattern_debug);var h,d,f=r.statements;if(0===f.length){if(O.Z.debug("FOUND MATCH WITH BINDINGS:"+i(n)),0===r.optional.length)c.reportMatch(n);else{O.Z.debug("OPTIONAL: "+r.optional);var g,m=new l(t,n),v=[];for(g=0;g<r.optional.length;g++)v[g]=new u(m),v[g].pattern_debug=r.optional[g];for(g=0;g<r.optional.length;g++)v[g].count=v[g].count+1,p(e,r.optional[g],n,"",s,t,v[g])}return c.count--,void O.Z.debug("Match ends -- success , Branch count now: "+c.count+" for "+c.pattern_debug)}var b=f.length;if(s){var w=function(t,i){var l=t.uri.split("#")[0];s.nowOrWhenFetched(l,void 0,(function(i,l,u){i||G.log("Error following link to <"+t.uri+"> in query: "+l),p(e,r,n,o,s,a,c)}))};for(d=0;d<b;d++){if(h=f[d],void 0!==n[h.subject]&&n[h.subject].uri&&s&&"unrequested"===s.getState((0,x.docpart)(n[h.subject].uri)))return void w(n[h.subject]);if(void 0!==n[h.object]&&n[h.object].uri&&s&&"unrequested"===s.getState((0,x.docpart)(n[h.object].uri)))return void w(n[h.object])}}y(e,r,n,o,s,a,c)},f=function(e,t){var r,n,i=!0;for(r in e)e.hasOwnProperty(r)&&t[r]&&(n=t[r].test)&&!n(e[r])&&(i=!1);return i},y=function(e,t,r,n,a,l,c){var u,g,y,m,v,b,w,x=t.statements,_=x.length;for(u=0;u<_;u++)h(e,w=x[u],r);x.sort(d),w=x[0];var T,N=e.formula();N.optional=t.optional,N.constraints=t.constraints,N.statements=x.slice(1),O.Z.debug(n+"match2 searching "+w.index.length+" for "+w+"; bindings so far="+i(r));var j,E,S=w.index.length,I=0;for(T=0;T<S;T++)for(E=w.index[T],j=s([w.subject,w.predicate,w.object,w.why],[E.subject,E.predicate,E.object,E.why],r,e),O.Z.info(n+" From first: "+j.length+": "+o(j)),y=j.length,g=0;g<y;g++)if(v=[],b=j[g][0],f(b,t.constraints)){for(m in b)b.hasOwnProperty(m)&&(v[m]=b[m]);for(m in r)r.hasOwnProperty(m)&&(v[m]=r[m]);c.count++,I++,p(e,N,v,n+" ",a,l,c)}else O.Z.debug("Branch count CS: "+c.count);c.count--,0===I&&O.Z.debug("Match2 fails completely on "+w),O.Z.debug("Match2 ends, Branch count: "+c.count+" for "+c.pattern_debug),0===c.count&&(O.Z.debug("Branch finished."),c.reportDone())},m=this;O.Z.debug("Query on "+this.statements.length);var v=new c(t,n);v.count++,e.sync?p(m,e.pat,e.pat.initBindings,"",r,t,v):setTimeout((function(){p(m,e.pat,e.pat.initBindings,"",r,t,v)}),0)}const W="http://www.w3.org/2002/07/owl#";function Q(e,t,r,n){var i=e.any(t,r,void 0);return!!i&&(e.equate(i,n),!0)}function Y(e,t,r,n){var i=e.any(void 0,r,n);return!!i&&(e.equate(i,t),!0)}function K(e,t,r,n,i){e.typeCallback&&e.typeCallback(e,n,i);var o=e.classActions[e.id(n)],s=!1;if(o)for(var a=0;a<o.length;a++)s=s||o[a](e,t,r,n,i);return s}class ee extends ${constructor(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(void 0,void 0,void 0,void 0,r),(0,e.Z)(this,"updater",void 0),(0,e.Z)(this,"namespaces",void 0),(0,e.Z)(this,"classActions",void 0),(0,e.Z)(this,"propertyActions",void 0),(0,e.Z)(this,"redirections",void 0),(0,e.Z)(this,"aliases",void 0),(0,e.Z)(this,"HTTPRedirects",void 0),(0,e.Z)(this,"subjectIndex",void 0),(0,e.Z)(this,"predicateIndex",void 0),(0,e.Z)(this,"objectIndex",void 0),(0,e.Z)(this,"whyIndex",void 0),(0,e.Z)(this,"index",void 0),(0,e.Z)(this,"features",void 0),(0,e.Z)(this,"_universalVariables",void 0),(0,e.Z)(this,"_existentialVariables",void 0),(0,e.Z)(this,"rdfArrayRemove",void 0),(0,e.Z)(this,"dataCallbacks",void 0),this.propertyActions={},this.classActions={},this.redirections=[],this.aliases=[],this.HTTPRedirects=[],this.subjectIndex=[],this.predicateIndex=[],this.objectIndex=[],this.whyIndex=[],this.index=[this.subjectIndex,this.predicateIndex,this.objectIndex,this.whyIndex],this.namespaces={},this.features=t||[],this.rdfArrayRemove=r.rdfArrayRemove||I.RDFArrayRemove,r.dataCallback&&(this.dataCallbacks=[r.dataCallback]),this.initPropertyActions(this.features)}static get defaultGraphURI(){return g}substitute(e){var t=this.statements.map((function(t){return t.substitute(e)})),r=new ee;return r.add(t),r}addDataCallback(e){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(e)}applyPatch(e,t,r){var n,i=this,o=null;function s(s){if(e.delete){n=e.delete,o&&(n=n.substitute(o)),n=n.statements;var a=[],l=n.map((function(e){var r=i.statementsMatching(e.subject,e.predicate,e.object,t);return 0===r.length?(a.push(e),null):r[0]}));if(a.length)return r("Could not find to delete: "+a.join("\n or "));l.map((function(e){i.remove(e)}))}e.insert&&(n=e.insert,o&&(n=n.substitute(o)),(n=n.statements).map((function(e){e.graph=t,i.add(e.subject,e.predicate,e.object,e.graph)}))),s()}if(e.where){var a=new J("patch");a.pat=e.where,a.pat.statements.map((function(e){e.graph=Gt(t.value)})),a.sync=!0;var l=[];i.query(a,(function(e){l.push(e)}),i.fetcher,(function(){return 0===l.length?r("No match found to be patched:"+e.where):l.length>1?r("Patch ambiguous. No patch done."):(o=l[0],void s(r))}))}else s(r)}declareExistential(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}initPropertyActions(e){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[K],H(e,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${W}sameAs`))]=[function(e,t,r,n,i){return e.equate(t,n),!0}]),H(e,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${W}InverseFunctionalProperty`))]=[function(e,t,r,n,i){return e.newPropertyAction(t,Y)}]),H(e,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${W}FunctionalProperty`))]=[function(e,t,r,n,i){return e.newPropertyAction(t,Q)}])}addStatement(e){return this.add(e.subject,e.predicate,e.object,e.graph),this.statements.length}add(e,t,r,n){var i,o,s;if(1===arguments.length){if(e instanceof Array)for(i=0;i<e.length;i++)this.add(e[i]);else(0,c.PY)(e)?this.add(e.subject,e.predicate,e.object,e.graph):(0,c.Pv)(e)&&this.add(e.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof e&&(e=this.rdfFactory.namedNode(e)),t=z.fromValue(t);const a=z.fromValue(r);if(n=z.fromValue(n),!(0,c.f)(e))throw new Error("Subject is not a subject type");if(!(0,c.nq)(t))throw new Error(`Predicate ${t} is not a predicate type`);if(!(0,c.Uc)(a))throw new Error(`Object ${a} is not an object type`);if(!(0,c.NA)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,t,n);var l=this.id(this.canon(t)),u=!1;if(o=this.propertyActions[l])for(i=0;i<o.length;i++)u=u||o[i](this,e,t,a,n);if(this.holds(e,t,a,n))return null;var h=[this.id(this.canon(e)),l,this.id(this.canon(a)),this.id(this.canon(n))];for(s=this.rdfFactory.quad(e,t,a,n),i=0;i<4;i++){var d=this.index[i],p=h[i];d[p]||(d[p]=[]),d[p].push(s)}if(this.statements.push(s),this.dataCallbacks)for(const e of this.dataCallbacks)e(s);return s}canon(e){if(!e)return e;const t=this.redirections[this.id(e)];if(t)return t;switch(e.termType){case o.V1:return new a(e.value);case o.fb:return e;case o.NK:return new y;case o.ls:case o._A:return e;case o.xH:return new h(e.value,e.language,e.datatype);case o.XM:return new l.Z(e.value);case o.UH:return new _(e.value);default:throw new Error(`Term Type not recognized for canonization: ${e.termType}`)}}check(){this.checkStatementList(this.statements);for(var e=0;e<4;e++){var t=this.index[e];for(var r in t)t.hasOwnProperty(r)&&this.checkStatementList(t[r],e)}}checkStatementList(e,t){void 0===t&&(t=0);for(var r,n=" found in "+["subject","predicate","object","why"][t]+" index.",i=0;i<e.length;i++){for(var o=[(r=e[i]).subject,r.predicate,r.object,r.graph],s=function(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.graph))return!0},a=0;a<4;a++){var l=this.canon(o[a]),c=this.id(l);this.index[a][c]&&s(this.index[a][c],r)}if(!s(this.statements,r))throw new Error("Statement list does not statement "+r+"@"+r.graph+n)}}close(){return this}compareTerms(e,r){return Object.prototype.hasOwnProperty.call(e,"compareTerm")?e.compareTerm(r):t.Z[e.termType]<t.Z[r.termType]?-1:t.Z[e.termType]>t.Z[r.termType]?1:e.value<r.value?-1:e.value>r.value?1:0}copyTo(e,t,r){r||(r=[]);var n=this.statementsMatching(e);-1!==H(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,e));for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"NamedNode":this.add(t,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(t,o.predicate,o.object.copy(this))}-1!==H(r,"delete")&&this.remove(o)}}equate(e,t){const r=this.canon(e),n=this.canon(t);var i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}formula(e){return new ee(e)}get length(){return this.statements.length}match(e,t,r,n){return this.statementsMatching(z.fromValue(e),z.fromValue(t),z.fromValue(r),z.fromValue(n))}mentionsURI(e){var t="<"+e+">";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}newExistential(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}newPropertyAction(e,t){var r=this.id(e);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(t);for(var n=this.statementsMatching(void 0,e,void 0),i=!1,o=0;o<n.length;o++)i=i||t(this,n[o].subject,e,n[o].object);return i}newUniversal(e){var t=this.sym(e);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(t),t}variable(e){return new _(e)}nextSymbol(e){for(var t=0;;t++){var r=e.value+"#n"+t;if(!this.mentionsURI(r))return this.sym(r)}}query(e,t,r,n){return X.call(this,e,t,r,n)}querySync(e){var t=[],r=!1;if(e.sync=!0,X.call(this,e,(function(e){t.push(e)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return t}remove(e){if(e instanceof Array){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}if((0,c.Pv)(e))return this.remove(e.statements);var r=this.statementsMatching(e.subject,e.predicate,e.object,e.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+e);return this.removeStatement(r[0]),this}removeDocument(e){for(var t=this.statementsMatching(void 0,void 0,void 0,e).slice(),r=0;r<t.length;r++)this.removeStatement(t[r]);return this}removeMany(e,t,r,n,i){for(var o=this.statementsMatching(e,t,r,n,!1),s=[],a=0;a<o.length;a++)s.push(o[a]);for(i&&(s=s.slice(0,i)),a=0;a<s.length;a++)this.remove(s[a])}removeMatches(e,t,r,n){return this.removeMany(e,t,r,n),this}removeStatement(e){for(var t=[e.subject,e.predicate,e.object,e.graph],r=0;r<4;r++){var n=this.canon(t[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],e)}return this.rdfArrayRemove(this.statements,e),this}removeStatements(e){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}replaceWith(e,t){for(var r=this.id(e),n=this.id(t),i=function(e){var t=e[r];if(t){var i=e[n];e[n]=i?t.concat(i):t,delete e[r]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[r]=t,e.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(e),this.aliases[r])for(o=0;o<this.aliases[r].length;o++)this.redirections[this.id(this.aliases[r][o])]=t,this.aliases[n].push(this.aliases[r][o]);this.add(t,this.sym("http://www.w3.org/2007/ont/link#uri"),e),this.fetcher&&this.fetcher.nowKnownAs(e,t)}return i(this.classActions),i(this.propertyActions),!0}allAliases(e){var t=this.aliases[this.id(this.canon(e))]||[];return t.push(this.canon(e)),t}sameThings(e,t){if(e.equals(t))return!0;var r=this.canon(e);if(!r)return!1;var n=this.canon(t);return!!n&&r.value===n.value}setPrefixForURI(e,t){if(("tab"!==e||!this.namespaces.tab)&&"ns"!==e.slice(0,2)&&"default"!==e.slice(0,7)){for(let e in this.namespaces)this.namespaces[e]==t&&delete this.namespaces[e];this.namespaces[e]=t}}statementsMatching(e,t,r,n,i){var o,s,a=[e,t,r,n],l=[],c=[],u=[],h=[];for(o=0;o<4;o++)l[o]=this.canon(z.fromValue(a[o])),l[o]?(h.push(o),c[o]=this.id(l[o])):u.push(o);if(0===h.length)return this.statements;if(1===h.length)return o=h[0],(s=this.index[o][c[o]])&&i&&s.length>1&&(s=s.slice(0,1)),s||[];var d,p,f=1e10;for(p=0;p<h.length;p++){if(o=h[p],!(s=this.index[o][c[o]]))return[];s.length<f&&(f=s.length,d=p)}for(var g=h[d],y=this.index[g][c[g]],m=h.slice(0,d).concat(h.slice(d+1)),v=[],b=["subject","predicate","object","why"],w=0;w<y.length;w++){var x=y[w];for(p=0;p<m.length;p++)if(o=m[p],!this.canon(x[b[o]]).equals(l[o])){x=null;break}if(null!=x&&(v.push(x),i))break}return v}uris(e){var t=this.canon(e),r=this.aliases[this.id(t)];if(!t.value)return[];var n=[t.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}serialize(e,t,r,n){var i;return F(r,this,e,t,void 0,n={...n||{},namespaces:null!==(i=n)&&void 0!==i&&i.namespaces?{...this.namespaces,...n.namespaces}:{...this.namespaces}})}}(0,e.Z)(ee,"handleRDFType",void 0),ee.handleRDFType=K;const te=S("http://www.w3.org/1999/02/22-rdf-syntax-ns#");function re(e,t){function r(n,i,o){const s=e.statementsMatching(n,te("rest"),null,t);if(1!==s.length)throw new Error(`Bad list structure: no rest at ${n}`);const a=e.statementsMatching(n,te("first"),null,t);if(1!==a.length)throw new Error(`Bad list structure: rest but ${a.length} firsts at ${n}`);const l=[a[0].object].concat(i),c=o.concat(s).concat(a),u=e.statementsMatching(null,te("rest"),n,t);if(0===u.length){const r=new p(l);return e.remove(c),void function(e,t,r,n){for(const i of e.statementsMatching(r,null,null,n)){const r=new w(t,i.predicate,i.object,n);e.remove(i),e.add(r)}for(const i of e.statementsMatching(null,r,null,n))e.remove(i),e.add(new w(i.subject,t,i.object,n));for(const i of e.statementsMatching(null,null,r,n))e.remove(i),e.add(new w(i.subject,i.predicate,t,n))}(e,r,n,t)}if(1!==u.length)throw new Error(`Bad list structure: ${u.length} pres at ${n}`);const h=u[0].subject;if("BlankNode"!==h.termType)throw new Error(`Bad list element node ${h} type: ${h.termType} `);r(h,l,c)}!function(e,t){const r=te("nil");for(const n of e.statementsMatching(r,null,null,t)){e.remove(n);const r=new p;e.add(new w(r,n.predicate,n.object,t))}for(const n of e.statementsMatching(null,null,r,t))if(!n.predicate.sameTerm(te("rest"))){e.remove(n);const r=new p;e.add(new w(n.subject,n.predicate,r,t))}}(e,t),e.statementsMatching(null,te("rest"),te("nil"),t).forEach((e=>{if("BlankNode"!==e.subject.termType)throw new Error(`Bad list element node ${e.subject} type: ${e.subject.termType} `);r(e.subject,[],[])}))}var ne="http://www.w3.org/2000/10/swap/log#",ie=function(e){return e},oe=function(e){return e},se=function(e){if(e.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},ae=function(e){return e.length},le=function(e,t,r){if(void 0===e.slice)throw"@@ mising.js: No .slice function for "+e+" of type "+typeof e;return void 0===r||null==r?e.slice(t):e.slice(t,r)},ce=Error("dummy error stop iteration"),ue=function(e){return this.last=0,this.li=e,this.next=function(){if(this.last==this.li.length)throw ce;return this.li[this.last++]},this},he=function(e,t){return e.indexOf(t)},de=function(e,t){if(!e){if(t)throw"python Assertion failed: "+t;throw"(python) Assertion failed."}};String.prototype.encode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}(this)},String.prototype.decode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return this};var pe=function(e,t){return x.join(t,e)},fe="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",ge="http://www.w3.org/2002/07/owl#sameAs",ye="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",me=ye+":",ve=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),be=new RegExp("^[0-9][0-9][0-9][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]*)?)?)?Z?"),we=new RegExp('[\\\\\\r\\n\\"]',"g"),xe=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const _e=function(e,t,r,n,i,o,s,a){return new Te(e,t,r,n,i,o,s,a)};class Te{constructor(e,t,r,n,i,o,s,a){void 0===t&&(t=null),void 0===r&&(r=""),void 0===n&&(n=null),void 0===i&&(i=""),void 0===o&&(o=null),void 0===s&&(s=""),void 0===a&&(a=null),this._bindings=new se([]),this._flags=s,""!=r&&(de(r.indexOf(":")>=0,"Document URI not absolute: "+r),this._bindings[""]=r+"#"),this._store=e,i&&e.setGenPrefix(i),this._thisDoc=r,this.source=e.sym(r),this.lines=0,this.statementCount=0,this.hasNil=!1,this.startOfLine=0,this.previousLine=0,this._genPrefix=i,this.keywords=new oe(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new se([]),this._variables=new se([]),this._parentVariables=new se([]),this._reason=a,this._reason2=null,this._baseURI=n||r||null,de(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==t?this._thisDoc?this._formula=e.formula(r+"#_formula"):this._formula=e.formula():this._formula=t,this._context=this._formula,this._parentContext=null}here(e){return this._genPrefix+"_L"+this.lines+"C"+(e-this.startOfLine+1)}formula(){return this._formula}loadStream(e){return this.loadBuf(e.read())}loadBuf(e){return this.startDoc(),this.feed(e),this.endDoc()}feed(e){for(var t=e.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(t,r);if(n<0)return;if((r=this.directiveOrStatement(t,n))<0)throw Ne(this._thisDoc,this.lines,t,n,"expected directive or statement")}}directiveOrStatement(e,t){var r,n=this.skipSpace(e,t);return n<0?n:(r=this.directive(e,n))>=0||(r=this.statement(e,n))>=0?this.checkDot(e,r):r}tok(e,t,r){if("@"==t.slice(r,r+1))r+=1;else if(H(this.keywords,e)<0)return-1;var n=r+ae(e);return t.slice(r,n)==e&&ye.indexOf(t.charAt(n))>=0?n:-1}directive(e,t){if((o=this.skipSpace(e,t))<0)return o;var r=new oe([]);if((o=this.tok("bind",e,t))>0)throw Ne(this._thisDoc,this.lines,e,t,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!1))<0)throw Ne(this._thisDoc,this.lines,e,t,"'@keywords' needs comma separated list of words");return this.setKeywords(le(r,null,null)),t}if((o=this.tok("forAll",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!0))<0)throw Ne(this._thisDoc,this.lines,e,t,"Bad variable list after @forAll");var n=new ue(r);try{for(;;){var i=n.next();(H(this._variables,i)<0||H(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(e){if(e!=ce)throw e}return t}if((o=this.tok("forSome",e,t))>0){if((t=this.commaSeparatedList(e,o,r,this.uri_ref2))<0)throw Ne(this._thisDoc,this.lines,e,t,"Bad variable list after @forSome");n=new ue(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(e){if(e!=ce)throw e}return t}if((o=this.tok("prefix",e,t))>=0){var o,s=new oe([]);if((t=this.qname(e,o,s))<0)throw Ne(this._thisDoc,this.lines,e,o,"expected qname after @prefix");if((o=this.uri_ref2(e,t,s))<0)throw Ne(this._thisDoc,this.lines,e,t,"expected <uriref> after @prefix _qname_");var a=s[1].uri;return this._baseURI?a=pe(this._baseURI,a):de(a.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),de(a.indexOf(":")>=0),this._bindings[s[0][0]]=a,this.bind(s[0][0],function(e){return encodeURI(e)}(a)),o}if((o=this.tok("base",e,t))>=0){if(s=new oe([]),(t=this.uri_ref2(e,o,s))<0)throw Ne(this._thisDoc,this.lines,e,o,"expected <uri> after @base ");if(a=s[0].uri,!this._baseURI)throw Ne(this._thisDoc,this.lines,e,o,"With no previous base URI, cannot use relative URI in @base <"+a+">");return a=pe(this._baseURI,a),de(a.indexOf(":")>=0),this._baseURI=a,t}return-1}bind(e,t){""==e||this._store.setPrefixForURI(e,t)}setKeywords(e){null==e?this.keywordsSet=0:(this.keywords=e,this.keywordsSet=1)}startDoc(){}endDoc(){return this.hasNil&&this._store.rdfFactory.supports.COLLECTIONS&&re(this._store,this.source),this._formula}makeStatement(e){e[0].add(e[2],e[1],e[3],this.source),(e[2].uri&&e[2].uri===fe||e[3].uri&&e[3].uri===fe)&&(this.hasNil=!0),this.statementCount+=1}statement(e,t){var r=new oe([]);if((t=this.object(e,t,r))<0)return t;var n=this.property_list(e,t,r[0]);if(n<0)throw Ne(this._thisDoc,this.lines,e,t,"expected propertylist");return n}subject(e,t,r){return this.item(e,t,r)}verb(e,t,r){if((i=this.skipSpace(e,t))<0)return i;var n=new oe([]);if((i=this.tok("has",e,t))>=0){if((t=this.prop(e,i,n))<0)throw Ne(this._thisDoc,this.lines,e,i,"expected property after 'has'");return r.push(new ie(["->",n[0]])),t}if((i=this.tok("is",e,t))>=0){if((t=this.prop(e,i,n))<0)throw Ne(this._thisDoc,this.lines,e,i,"expected <property> after 'is'");if((i=this.skipSpace(e,t))<0)throw Ne(this._thisDoc,this.lines,e,t,"End of file found, expected property after 'is'");var i;if(t=i,(i=this.tok("of",e,t))<0)throw Ne(this._thisDoc,this.lines,e,t,"expected 'of' after 'is' <prop>");return r.push(new ie(["<-",n[0]])),i}if((i=this.tok("a",e,t))>=0)return r.push(new ie(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==e.slice(t,t+2))return r.push(new ie(["<-",this._store.sym(ne+"implies")])),t+2;if("="==e.slice(t,t+1))return">"==e.slice(t+1,t+2)?(r.push(new ie(["->",this._store.sym(ne+"implies")])),t+2):(r.push(new ie(["->",this._store.sym(ge)])),t+1);if(":="==e.slice(t,t+2))return r.push(new ie(["->",ne+"becomes"])),t+2;if((i=this.prop(e,t,n))>=0)return r.push(new ie(["->",n[0]])),i;if(">-"==e.slice(t,t+2)||"<-"==e.slice(t,t+2))throw Ne(this._thisDoc,this.lines,e,i,">- ... -> syntax is obsolete.");return-1}prop(e,t,r){return this.item(e,t,r)}item(e,t,r){return this.path(e,t,r)}blankNode(e){return this._context.bnode(e,this._reason2)}path(e,t,r){if((o=this.nodeOrLiteral(e,t,r))<0)return o;for(;"!^.".indexOf(e.slice(o,o+1))>=0;){var n=e.slice(o,o+1);if("."==n){var i=e.slice(o+1,o+2);if(!i||me.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var o,s=r.pop(),a=this.blankNode(this.here(o));if((o=this.node(e,o+1,r))<0)throw Ne(this._thisDoc,this.lines,e,o,"EOF found in middle of path syntax");var l=r.pop();"^"==n?this.makeStatement(new ie([this._context,l,a,s])):this.makeStatement(new ie([this._context,l,s,a])),r.push(a)}return o}anonymousNode(e){if(t=this._anonymousNodes[e])return t;var t=this._store.bnode(e);return this._anonymousNodes[e]=t,t}node(e,t,r,n){void 0===n&&(n=null);var i=n;if((u=this.skipSpace(e,t))<0)return u;t=u;var o=e.slice(t,t+1);if("["==o){var s=this.here(t);if((u=this.skipSpace(e,t+1))<0)throw Ne(this._thisDoc,this.lines,e,t,"EOF after '['");if("="==e.slice(u,u+1)){t=u+1;var a=new oe([]);if(!((u=this.objectList(e,t,a))>=0))throw Ne(this._thisDoc,this.lines,e,t,"objectList expected after [= ");if(i=a[0],ae(a)>1){var l=new ue(a);try{for(;;){var c=l.next();this.makeStatement(new ie([this._context,this._store.sym(ge),i,c]))}}catch(e){if(e!=ce)throw e}}if((u=this.skipSpace(e,u))<0)throw Ne(this._thisDoc,this.lines,e,t,"EOF when objectList expected after [ = ");if(";"==e.slice(u,u+1))var u=u+1}if(null==i&&(i=this.blankNode(s)),(t=this.property_list(e,u,i))<0)throw Ne(this._thisDoc,this.lines,e,u,"property_list expected");if((u=this.skipSpace(e,t))<0)throw Ne(this._thisDoc,this.lines,e,t,"EOF when ']' expected after [ <propertyList>");if("]"!=e.slice(u,u+1))throw Ne(this._thisDoc,this.lines,e,u,"']' expected");return r.push(i),u+1}if("{"==o){if("$"==e.slice(t+1,t+2)){u=(t+=1)+1;for(var h=new oe([]),d=!0;;){if((t=this.skipSpace(e,u))<0)throw Ne(this._thisDoc,this.lines,e,t,"needed '$}', found end.");if("$}"==e.slice(t,t+2)){u=t+2;break}if(d)d=!1;else{if(","!=e.slice(t,t+1))throw Ne(this._thisDoc,this.lines,e,t,"expected: ','");t+=1}var p=new oe([]);if((u=this.item(e,t,p))<0)throw Ne(this._thisDoc,this.lines,e,t,"expected item in set or '$}'");h.push(p[0])}return r.push(this._store.newSet(h,this._context)),u}u=t+1;var f=this._parentContext;this._parentContext=this._context;var g=this._anonymousNodes,y=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new se([]),this._variables=this._variables.slice();var m=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((t=this.skipSpace(e,u))<0)throw Ne(this._thisDoc,this.lines,e,t,"needed '}', found end.");if("}"==e.slice(t,t+1)){u=t+1;break}if((u=this.directiveOrStatement(e,t))<0)throw Ne(this._thisDoc,this.lines,e,t,"expected statement or '}'")}return this._anonymousNodes=g,this._variables=this._parentVariables,this._parentVariables=y,this._context=this._parentContext,this._reason2=m,this._parentContext=f,r.push(i.close()),u}if("("==o){var v=this._store.list;for("$"==e.slice(t+1,t+2)&&(v=this._store.newSet,t+=1),u=t+1,h=new oe([]);;){if((t=this.skipSpace(e,u))<0)throw Ne(this._thisDoc,this.lines,e,t,"needed ')', found end.");if(")"==e.slice(t,t+1)){u=t+1;break}if(p=new oe([]),(u=this.item(e,t,p))<0)throw Ne(this._thisDoc,this.lines,e,t,"expected item in list or ')'");h.push(p[0])}return r.push(v(h,this._context)),u}if((u=this.tok("this",e,t))>=0)throw Ne(this._thisDoc,this.lines,e,t,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(u=this.tok("true",e,t))>=0?(r.push(!0),u):(u=this.tok("false",e,t))>=0?(r.push(!1),u):null==i&&(u=this.uri_ref2(e,t,r))>=0?u:-1}property_list(e,t,r){for(;;){if((u=this.skipSpace(e,t))<0)throw Ne(this._thisDoc,this.lines,e,t,"EOF found when expected verb in property list");if(":-"!=e.slice(u,u+2)){t=u;var n=new oe([]);if((u=this.verb(e,t,n))<=0)return t;var i=new oe([]);if((t=this.objectList(e,u,i))<0)throw Ne(this._thisDoc,this.lines,e,u,"objectList expected");var o=new ue(i);try{for(;;){var s=o.next(),a=n[0],l=a[0],c=a[1];"->"==l?this.makeStatement(new ie([this._context,c,r,s])):this.makeStatement(new ie([this._context,c,s,r]))}}catch(e){if(e!=ce)throw e}if((u=this.skipSpace(e,t))<0)throw Ne(this._thisDoc,this.lines,e,u,"EOF found in list of objects");if(";"!=e.slice(t,t+1))return t;t+=1}else{t=u+2;var u,h=new oe([]);if((u=this.node(e,t,h,r))<0)throw Ne(this._thisDoc,this.lines,e,t,"bad {} or () or [] node after :- ");t=u}}}commaSeparatedList(e,t,r,n){if((i=this.skipSpace(e,t))<0)throw Ne(this._thisDoc,this.lines,e,i,"EOF found expecting comma sep list");if("."==e.charAt(i))return t;if(n)var i=this.uri_ref2(e,i,r);else i=this.bareWord(e,i,r);if(i<0)return-1;for(;;){if((t=this.skipSpace(e,i))<0)return t;var o=e.slice(t,t+1);if(","!=o)return"."!=o?-1:t;if((i=n?this.uri_ref2(e,t+1,r):this.bareWord(e,t+1,r))<0)throw Ne(this._thisDoc,this.lines,e,i,"bad list content")}}objectList(e,t,r){if((t=this.object(e,t,r))<0)return-1;for(;;){var n=this.skipSpace(e,t);if(n<0)throw Ne(this._thisDoc,this.lines,e,n,"EOF found after object");if(","!=e.slice(n,n+1))return n;if((t=this.object(e,n+1,r))<0)return t}}checkDot(e,t){var r=this.skipSpace(e,t);if(r<0)return r;if("."==e.slice(r,r+1))return r+1;if("}"==e.slice(r,r+1))return r;if("]"==e.slice(r,r+1))return r;throw Ne(this._thisDoc,this.lines,e,r,"expected '.' or '}' or ']' at end of statement")}uri_ref2(e,t,r){var n=new oe([]);if((d=this.qname(e,t,n))>=0){var i=n[0],o=i[0],s=i[1];if(null==o){de(0,"not used?");var a=this._baseURI+"#"}else if(!(a=this._bindings[o])){if("_"==o)return r.push(this.anonymousNode(s)),d;throw Ne(this._thisDoc,this.lines,e,t,"Prefix "+o+" not bound.")}var l=this._store.sym(a+s);return H(this._variables,l)>=0?r.push(this._variables[l]):r.push(l),d}if((t=this.skipSpace(e,t))<0)return-1;if("?"==e.charAt(t)){var c=new oe([]);return(d=this.variable(e,t,c))>0?(r.push(c[0]),d):-1}if("<"==e.charAt(t)){for(var u=t+=1;t<ae(e);){if(">"==e.charAt(t)){var h=e.slice(u,t);return this._baseURI?h=pe(this._baseURI,h):de(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==e.slice(t-1,t)&&"#"!=le(h,-1,null)&&(h+="#"),l=this._store.sym(h),H(this._variables,l)>=0?r.push(this._variables[l]):r.push(l),t+1}t+=1}throw Ne(this._thisDoc,this.lines,e,d,"unterminated URI reference")}if(this.keywordsSet){var d;if(c=new oe([]),(d=this.bareWord(e,t,c))<0)return-1;if(H(this.keywords,c[0])>=0)throw Ne(this._thisDoc,this.lines,e,t,'Keyword "'+c[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+c[0])),d}return-1}skipSpace(e,t){for(var r=t||0;r<e.length;r++){var n=e.charAt(r);if(" \n\r\t\f\v \u2028\u2029 ".indexOf(n)<0){if("#"!==e.charAt(r))return r;for(;;r++){if(r===e.length)return-1;if("\n"===e.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===e.charAt(r)&&(this.lines=this.lines+1)}return-1}variable(e,t,r){if((n=this.skipSpace(e,t))<0)return-1;if("?"!=e.slice(n,n+1))return-1;var n;if(t=n+=1,"0123456789-".indexOf(e.charAt(n))>=0)throw Ne(this._thisDoc,this.lines,e,n,"Varible name can't start with '"+e.charAt(n)+"s'");for(;t<ae(e)&&me.indexOf(e.charAt(t))<0;)t+=1;if(null==this._parentContext)throw Ne(this._thisDoc,this.lines,e,n,"Can't use ?xxx syntax for variable in outermost level: "+e.slice(n-1,t));return r.push(this._store.variable(e.slice(n,t))),t}bareWord(e,t,r){var n=this.skipSpace(e,t);if(n<0)return-1;var i=e.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(me.indexOf(i)>=0)return-1;for(t=n;t<ae(e)&&me.indexOf(e.charAt(t))<0;)t+=1;return r.push(e.slice(n,t)),t}qname(e,t,r){if((t=this.skipSpace(e,t))<0)return-1;var n=e.charAt(t);if("0123456789-+".indexOf(n)>=0)return-1;if(me.indexOf(n)<0){var i=n;for(t+=1;t<ae(e)&&(n=e.charAt(t),me.indexOf(n)<0);)i+=n,t+=1}else i="";if(t<ae(e)&&":"==e.charAt(t)){var o=i;for(t+=1,i="";t<ae(e)&&(n=e.charAt(t),me.indexOf(n)<0);)i+=n,t+=1;return r.push(new ie([o,i])),t}return i&&this.keywordsSet&&H(this.keywords,i)<0?(r.push(new ie(["",i])),t):-1}object(e,t,r){if((o=this.subject(e,t,r))>=0)return o;{if((o=this.skipSpace(e,t))<0)return-1;t=o;var n=null;let a=e.charAt(t);if('"'==a||"'"==a){n=e.slice(t,t+3==a+a)?a+a+a:a,t+=ae(n);var i=this.strconst(e,t,n),o=i[0],s=i[1];return r.push(this._store.literal(s)),o}return-1}}nodeOrLiteral(e,t,r){if((l=this.node(e,t,r))>=0)return l;if((l=this.skipSpace(e,t))<0)return-1;t=l;var n=e.charAt(t);if("-+0987654321".indexOf(n)>=0){if(be.lastIndex=0,null!=(h=be.exec(e.slice(t))))l=t+(i=h[0]).length,i.indexOf("T")>=0?r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var i;if(ve.lastIndex=0,null==(h=ve.exec(e.slice(t))))throw Ne(this._thisDoc,this.lines,e,t,"Bad number or date syntax");l=t+ve.lastIndex,(i=e.slice(t,l)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):e.slice(t,l).indexOf(".")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):r.push(this._store.literal(parseInt(i),this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return l}if('"'==e.charAt(t)){if('"""'==e.slice(t,t+3))var o='"""';else o='"';t+=ae(o);var s=null,a=this.strconst(e,t,o),l=a[0],c=a[1],u=null;if("@"==e.slice(l,l+1)){var h;if(xe.lastIndex=0,null==(h=xe.exec(e.slice(l+1))))throw Ne(this._thisDoc,startline,e,t,"Bad language code syntax on string literal, after @");t=xe.lastIndex+l+1,u=e.slice(l+1,t),l=t}if("^^"==e.slice(l,l+2)){var d=new oe([]);l=this.uri_ref2(e,l+2,d),s=d[0]}return r.push(this._store.literal(c,u||s)),l}return-1}strconst(e,t,r){for(var n=t,i="",o=this.lines;n<ae(e);){if(t=n+ae(r),e.slice(n,t)==r)return new ie([t,i]);if('"'!=e.charAt(n)){if(we.lastIndex=0,!we.exec(e.slice(n)))throw Ne(this._thisDoc,o,e,n,"Closing quote missing in string at ^ in "+e.slice(n-20,n)+"^"+e.slice(n,n+20));if(t=n+we.lastIndex-1,i+=e.slice(n,t),'"'!=(l=e.charAt(t)))if("\r"!=l){if("\n"==l){if('"'==r)throw Ne(this._thisDoc,o,e,t,"newline found in string literal");this.lines=this.lines+1,i+=l,n=t+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==l){if(n=t+1,!(l=e.slice(n,n+1)))throw Ne(this._thisDoc,o,e,t,"unterminated string literal (2)");var s=he('abfrtvn\\"',l);if(s>=0)i+='a\b\f\r\t\v\n\\"'.charAt(s),n+=1;else if("u"==l)n=(a=this.uEscape(e,n+1,o))[0],i+=l=a[1];else{if("U"!=l)throw Ne(this._thisDoc,this.lines,e,t,"bad escape");var a,l;n=(a=this.UEscape(e,n+1,o))[0],i+=l=a[1]}}}else n=t+1;else n=t}else i=i+'"',n=n+1}throw Ne(this._thisDoc,this.lines,e,t,"unterminated string literal")}uEscape(e,t,r){for(var n=t,i=0,o=0;i<4;){var s=e.slice(n,n+1).toLowerCase();if(n+=1,""==s)throw Ne(this._thisDoc,r,e,t,"unterminated string literal(3)");var a=he("0123456789abcdef",s);if(a<0)throw Ne(this._thisDoc,r,e,t,"bad string literal hex escape");o=16*o+a,i+=1}var l=String.fromCharCode(o);return new ie([n,l])}UEscape(e,t,r){for(var n=t,i=0,o="\\U";i<8;){var s=e.slice(n,n+1).toLowerCase();if(n+=1,""==s)throw Ne(this._thisDoc,r,e,t,"unterminated string literal(3)");if(he("0123456789abcdef",s)<0)throw Ne(this._thisDoc,r,e,t,"bad string literal hex escape");o+=s,i+=1}var a,l=(a="0x"+le(o,2,10)-0,String.fromCharCode(a));return new ie([n,l])}}function Ne(e,t,r,n,i){let o=t+1,s="Line "+o+" of <"+e+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',a=new SyntaxError(s,e,o);return a.lineNo=o,a.characterInFile=n,a.syntaxProblem=i,a}const je={...E,supports:{[T.collections]:!0,[T.defaultGraphType]:!1,[T.equalsMethod]:!0,[T.identity]:!1,[T.id]:!0,[T.reversibleId]:!1,[T.variableType]:!0},collection:e=>new p(e),id(e){return(0,c.uZ)(e)?`( ${e.elements.map((e=>this.id(e))).join(", ")} )`:(0,c.cG)(e)?_.toString(e):E.id(e)},termToNQ:e=>e.termType===o.fb?p.toNT(e):E.termToNQ(e)},Ee=je;function Oe(e,t){return"string"==typeof t?e.rdfFactory.literal(t):Object.prototype.hasOwnProperty.call(t,"@list")?!0===e.rdfFactory.supports.COLLECTIONS?function(e,t){if(!Array.isArray(t))throw new TypeError("Object must be an array");return e.rdfFactory.collection(t.map((t=>Oe(e,t))))}(e,t["@list"]):function(e,t){const r=t["@id"]?Ie(e,t):e.rdfFactory.blankNode(),n=t["@list"].map((t=>Oe(e,t))),i=q(e.rdfFactory,r,n);return e.addAll(i),r}(e,t):Object.prototype.hasOwnProperty.call(t,"@id")?Ie(e,t):Object.prototype.hasOwnProperty.call(t,"@language")?e.rdfFactory.literal(t["@value"],t["@language"]):Object.prototype.hasOwnProperty.call(t,"@type")?e.rdfFactory.literal(t["@value"],e.rdfFactory.namedNode(t["@type"])):Object.prototype.hasOwnProperty.call(t,"@value")?e.rdfFactory.literal(t["@value"]):e.rdfFactory.literal(t)}function Se(e,t,r,n){const i=r&&Object.prototype.hasOwnProperty.call(r,"termType")?r.value:r;return M().flatten(JSON.parse(e),null,{base:i}).then((e=>e.reduce(((e,n)=>t=Ae(t,r,n)),t))).then(n).catch(n)}function Ie(e,t){return t["@id"].startsWith("_:")?e.rdfFactory.blankNode(t["@id"].substring(2)):e.rdfFactory.namedNode(t["@id"])}function Ae(e,t,r){const n=r["@id"]?Ie(e,r):e.rdfFactory.blankNode();for(const i of Object.keys(r)){if("@id"===i)continue;if("@graph"==i){const t=n,o=r[i];for(let r=0;r<o.length;r++)e=Ae(e,t,o[r])}const o=r[i];if(Array.isArray(o))for(let r=0;r<o.length;r++)e.addStatement(ke(e,n,i,o[r],t));else e.addStatement(ke(e,n,i,o,t))}return e}function ke(e,t,r,n,i){let o,s;return"@type"===r?(o=e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),s=e.rdfFactory.namedNode(n)):(o=e.rdfFactory.namedNode(r),s=Oe(e,n)),e.rdfFactory.quad(t,o,s,e.rdfFactory.namedNode(i))}const Re="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Ce="http://www.w3.org/2001/XMLSchema#",De="http://www.w3.org/2000/10/swap/",Le={xsd:{decimal:`${Ce}decimal`,boolean:`${Ce}boolean`,double:`${Ce}double`,integer:`${Ce}integer`,string:`${Ce}string`},rdf:{type:`${Re}type`,nil:`${Re}nil`,first:`${Re}first`,rest:`${Re}rest`,langString:`${Re}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${De}reify#forSome`,forAll:`${De}reify#forAll`},log:{implies:`${De}log#implies`}};var Pe=n(5929),Me=n.n(Pe),Fe=n(2486).lW;const{xsd:Ue}=Le,Be=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,qe={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},He=/[\x00-\x20<>\\"\{\}\|\^\`]/,Ze={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},$e=/$0^/;class ze{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]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in Ze)&&this[e]instanceof RegExp&&(this[e]=$e)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let e,s;for(;e=this._newline.exec(r);)this._comments&&(s=this._comment.exec(e[0]))&&i("comment",s[1],"",this._line,e[0].length),r=r.substr(e[0].length,r.length),n=r.length,this._line++;if(!e&&(e=this._whitespace.exec(r))&&(r=r.substr(e[0].length,r.length)),this._endOfFile.test(r))return t&&(this._comments&&(s=this._comment.exec(r))&&i("comment",s[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const a=this._line,l=r[0];let c="",u="",h="",d=null,p=0,f=!1;switch(l){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(p=1,c="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){f=!0;break}case"<":if(d=this._unescapedIri.exec(r))c="IRI",u=d[1];else if(d=this._iri.exec(r)){if(u=this._unescape(d[1]),null===u||He.test(u))return o(this);c="IRI"}else r.length>1&&"<"===r[1]?(c="<<",p=2):this._n3Mode&&r.length>1&&"="===r[1]&&(c="inverse",p=2,u=">");break;case">":r.length>1&&">"===r[1]&&(c=">>",p=2);break;case"_":((d=this._blank.exec(r))||t&&(d=this._blank.exec(`${r} `)))&&(c="blank",h="_",u=d[1]);break;case'"':if(d=this._simpleQuotedString.exec(r))u=d[1];else if(({value:u,matchLength:p}=this._parseLiteral(r)),null===u)return o(this);null===d&&0===p||(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(d=this._simpleApostropheString.exec(r))u=d[1];else if(({value:u,matchLength:p}=this._parseLiteral(r)),null===u)return o(this);null===d&&0===p||(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(d=this._variable.exec(r))&&(c="var",u=d[0]);break;case"@":"literal"===this._previousMarker&&(d=this._langcode.exec(r))?(c="langcode",u=d[1]):(d=this._keyword.exec(r))&&(c=d[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){c=".",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"-":(d=this._number.exec(r)||t&&(d=this._number.exec(`${r} `)))&&(c="literal",u=d[0],h="string"==typeof d[1]?Ue.double:"string"==typeof d[2]?Ue.decimal:Ue.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(d=this._sparqlKeyword.exec(r))?c=d[0].toUpperCase():f=!0;break;case"f":case"t":(d=this._boolean.exec(r))?(c="literal",u=d[0],h=Ue.boolean):f=!0;break;case"a":(d=this._shortPredicates.exec(r))?(c="abbreviation",u="a"):f=!0;break;case"=":this._n3Mode&&r.length>1&&(c="abbreviation",">"!==r[1]?(p=1,u="="):(p=2,u=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(p=1,c=l);break;default:f=!0}if(f&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(d=this._prefix.exec(r))?((d=this._prefixed.exec(r))||t&&(d=this._prefixed.exec(`${r} `)))&&(c="prefixed",h=d[1]||"",u=this._unescape(d[2])):(c="prefix",u=d[1]||"")),"^^"===this._previousMarker)switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const g=p||d[0].length,y=i(c,u,h,a,g);this.previousToken=y,this._previousMarker=c,r=r.substr(g,r.length)}function i(t,i,o,s,a){const l=r?n-r.length:n,c={type:t,value:i,prefix:o,line:s,start:l,end:l+a};return e(null,c),c}function o(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(Be,((e,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let e=Number.parseInt(n,16);return e<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in qe?qe[i]:(t=!0,"")}));return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let n=Math.max(this._literalClosingPos,r);for(;(n=e.indexOf(t,n))>0;){let t=0;for(;"\\"===e[n-t-1];)t++;if(t%2==0){const t=e.substring(r,n),i=t.split(/\r\n|\r|\n/).length-1,o=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((r,n)=>r?t=r:e.push(n)),!0),t)throw t;return e}Me()((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=Fe.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}const{rdf:Ve,xsd:Ge}=Le;let Je,Xe=0;const We={namedNode:function(e){return new Ye(e)},blankNode:function(e){return new et(e||"n3-"+Xe++)},variable:function(e){return new tt(e)},literal:function(e,t){if("string"==typeof t)return new Ke(`"${e}"@${t.toLowerCase()}`);let r=t?t.value:"";return""===r&&("boolean"==typeof e?r=Ge.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?Ge.integer:Ge.double:(r=Ge.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),""===r||r===Ge.string?new Ke(`"${e}"`):new Ke(`"${e}"^^${r}`)},defaultGraph:function(){return Je},quad:nt,triple:nt};class Qe{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Qe?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class Ye extends Qe{get termType(){return"NamedNode"}}class Ke extends Qe{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new Ye(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return"^"===r?e.substr(t+2):"@"!==r?Ge.string:Ve.langString}equals(e){return e instanceof Ke?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}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class et extends Qe{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class tt extends Qe{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}Je=new class extends Qe{constructor(){return super(""),Je||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class rt extends Qe{constructor(e,t,r,n){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=n||Je}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function nt(e,t,r,n){return new rt(e,t,r,n)}let it=0;class ot{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&at(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),n=/trig/.test(t),i=/triple/.test(t),o=/quad/.test(t),s=this._n3Mode=/n3/.test(t),a=i||o;(this._supportsNamedGraphs=!(r||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||s),this._supportsRDFStar=""===t||/star|\*$/.test(t),a&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new ze({lineMode:a,n3:s}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){it=0}_setBase(e){if(e){const 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,r,n,i){const o=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:i,graph:t,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(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.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){let r;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);r=this._namedNode(t);break;case"type":case"prefixed":const n=this._prefixes[e.prefix];if(void 0===n)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._namedNode(n+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}_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){const 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"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;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);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const i=this._subject,o=this._contextStack,s=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),n=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("list",e),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),n=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===i?null===s.predicate?s.subject=r:s.object=r:this._emit(i,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 n}_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":const 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}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const 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))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,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){const e=this._predicate,t=this._object;i?this._emit(t,e,n,r):this._emit(n,e,t,r)}return t}_readBlankNodePunctuation(e){let 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);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const 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){let 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:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const 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}_readBackwardPath(e){const t=this._blankNode();let r,n;if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,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("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const 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,r,n){this._callback(null,this._quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=st}_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;const t=e.length;let r="",n=-1,i=-1,o=0,s="/";for(;n<t;){switch(s){case":":if(i<0&&"/"===e[++n]&&"/"===e[++n])for(;(i=n+1)<t&&"/"!==e[i];)n=i;break;case"?":case"#":n=t;break;case"/":if("."===e[n+1])switch(s=e[1+ ++n],s){case"/":r+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+e.substring(o,n)+e.substr(n+1);case".":if(s=e[1+ ++n],void 0===s||"/"===s||"?"===s||"#"===s){if(r+=e.substring(o,n-2),(o=r.lastIndexOf("/"))>=i&&(r=r.substr(0,o)),"/"!==s)return`${r}/${e.substr(n+1)}`;o=n+1}}}s=e[++n]}return r+e.substring(o)}parse(e,t,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${it++}_`,this._prefixCallback=r||st,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let r;if(this._callback=(e,n)=>{e?r=e:n&&t.push(n)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),r)throw r;return t}this._callback=t,this._lexer.tokenize(e,((e,t)=>{null!==e?(this._callback(e),this._callback=st):this._readCallback&&(this._readCallback=this._readCallback(t))}))}}function st(){}function at(e,t){const 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(Le.rdf.first),e.RDF_REST=r(Le.rdf.rest),e.RDF_NIL=r(Le.rdf.nil),e.N3_FORALL=r(Le.r.forAll),e.N3_FORSOME=r(Le.r.forSome),e.ABBREVIATIONS={a:r(Le.rdf.type),"=":r(Le.owl.sameAs),">":r(Le.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}at(ot.prototype,We);var lt=n(292);if(void 0===ct)var ct={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};class ut{constructor(e,t){this.options=t||{},this.kb=e,this.target=t.target||{graph:{subjects:{},prefixes:{},terms:{}}},this.blankNodes=[],this.htmlOptions={selfClosing:"br img input area base basefont col colgroup source wbr isindex link meta param hr"},this.theOne="_:"+(new Date).getTime(),this.language=null,this.vocabulary=null,this.blankCounter=0,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}],this.inXHTMLMode=!1,this.absURIRE=/[\w\_\-]+:\S+/,this.finishedHandlers=[],this.init()}addTriple(e,t,r,n){var i,o,s,a;i=void 0===t?E.namedNode(this.options.base):this.toRDFNodeObject(t),s=this.toRDFNodeObject(r),o=this.toRDFNodeObject(n),a=E.namedNode(this.options.base),this.kb.add(i,s,o,a)}ancestorPath(e){for(var t="";e&&e.nodeType!==ct.DOCUMENT_NODE;)t="/"+e.localName+t,e=e.parentNode;return t}copyMappings(e){var t={};for(var r in e)t[r]=e[r];return t}copyProperties(){}deriveDateTimeType(e){for(var t=0;t<ut.dateTimeTypes.length;t++){var r=ut.dateTimeTypes[t].pattern.exec(e);if(r&&r[0].length===e.length)return ut.dateTimeTypes[t].type}return null}init(){}newBlankNode(){return this.blankCounter++,"_:"+this.blankCounter}newSubjectOrigin(e,t){}parseCURIE(e,t,r){var n,i=e.indexOf(":");if(i>=0){var o=e.substring(0,i);if(""===o)return(n=t[""])?n+e.substring(i+1):null;if("_"===o)return"_:"+e.substring(i+1);if(ut.NCNAME.test(o)&&(n=t[o]))return n+e.substring(i+1)}return null}parseCURIEOrURI(e,t,r){return this.parseCURIE(e,t,r)||this.resolveAndNormalize(r,e)}parsePredicate(e,t,r,n,i,o){if(""===e)return null;var s=this.parseTermOrCURIEOrAbsURI(e,t,o?null:r,n,i);return s&&0===s.indexOf("_:")?null:s}parsePrefixMappings(e,t){for(var r=this.tokenize(e),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(t[n]=this.options.base?x.join(r[i],this.options.base):r[i],n=null)}static parseRDFaDOM(e,t,r){var n=new ut(t,{base:r});e.baseURI||(e.baseURI=r),n.process(e,{baseURI:r})}parseSafeCURIEOrCURIEOrURI(e,t,r){return"["===(e=this.trim(e)).charAt(0)&&"]"===e.charAt(e.length-1)?0===(e=(e=e.substring(1,e.length-1)).trim(e)).length?null:"_:"===e?this.theOne:this.parseCURIE(e,t,r):this.parseCURIEOrURI(e,t,r)}parseTermOrCURIEOrAbsURI(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;if(r){if(t&&!this.absURIRE.exec(e))return t+e;var s=r[e];if(s)return s;if(s=r[e.toLowerCase()])return s}return this.absURIRE.exec(e)?this.resolveAndNormalize(i,e):null}parseTermOrCURIEOrURI(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;var s=r[e];return s||((s=r[e.toLowerCase()])?s:t&&!this.absURIRE.exec(e)?t+e:this.resolveAndNormalize(i,e))}parseURI(e){return e}process(e,t){var r;t=t||{},e.nodeType===ct.DOCUMENT_NODE?(e.baseURI&&!t.baseURI&&(t.baseURI=e.baseURI),r=e.baseURI,(e=e.documentElement).baseURI||(e.baseURI=r),this.setContext(e)):e.parentNode.nodeType===ct.DOCUMENT_NODE&&this.setContext(e);var n=[],i=function(e){if(!e&&t&&t.baseURI)return t.baseURI;var r=e.indexOf("#");return r>=0&&(e=e.substring(0,r)),t&&t.baseURIMap&&(e=t.baseURIMap(e)),e};for(n.push({current:e,context:this.push(null,i(e.baseURI))});n.length>0;){var o=n.shift();if(o.parent){if(o.context.parent&&o.context.parent.listMapping===o.listMapping)continue;for(let e in o.listMapping){var s=o.listMapping[e];if(0!==s.length){var a=[];for(let e=0;e<s.length;e++)a.push(this.newBlankNode());for(let e=0;e<a.length;e++)this.addTriple(o.parent,a[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",s[e]),this.addTriple(o.parent,a[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:ut.objectURI,value:e+1<a.length?a[e+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(o.parent,o.subject,e,{type:ut.objectURI,value:a[0]})}else this.addTriple(o.parent,o.subject,e,{type:ut.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var l=o.current,c=o.context,u=!1,h=null,d=null,p=null,f=c.prefixes,g=!1,y=[],m=c.listMapping,v=!c.parent,b=c.language,w=c.vocabulary;r=this.parseURI(i(l.baseURI)),l.item=null;var _=l.getAttributeNode("vocab");if(_){let e=this.trim(_.value);if(e.length>0){w=e;var T=r.spec;this.addTriple(l,T,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:ut.objectURI,value:w})}else w=this.vocabulary}for(var N=0;N<l.attributes.length;N++){var j=l.attributes[N];if("x"===j.nodeName.charAt(0)&&0===j.nodeName.indexOf("xmlns:")){g||(f=this.copyMappings(f),g=!0);var E=j.nodeName.substring(6),O=ut.trim(j.value);f[E]=this.options.base?x.join(O,this.options.base):O}}var S=l.getAttributeNode("prefix");S&&(g||(f=this.copyMappings(f),g=!0),this.parsePrefixMappings(S.value,f));var I=null;for(let e=0;!I&&e<this.langAttributes.length;e++)I=l.getAttributeNodeNS(this.langAttributes[e].namespaceURI,this.langAttributes[e].localName);if(I){let e=ut.trim(I.value);b=e.length>0?e:null}var A,k,R=l.getAttributeNode("rel"),C=l.getAttributeNode("rev"),D=l.getAttributeNode("typeof"),L=l.getAttributeNode("property"),P=l.getAttributeNode("datatype"),M=this.inHTMLMode?l.getAttributeNode("datetime"):null,F=l.getAttributeNode("content"),U=l.getAttributeNode("about"),B=l.getAttributeNode("src"),q=l.getAttributeNode("resource"),H=l.getAttributeNode("href"),Z=l.getAttributeNode("inlist"),$=[];if(R){k=this.tokenize(R.value);for(let e=0;e<k.length;e++)A=this.parsePredicate(k[e],w,c.terms,f,r,this.inHTMLMode&&null!==L),A&&$.push(A)}var z=[];if(C){k=this.tokenize(C.value);for(let e=0;e<k.length;e++)A=this.parsePredicate(k[e],w,c.terms,f,r,this.inHTMLMode&&L),A&&z.push(A)}if(this.inHTMLMode&&(R||C)&&L&&(0===$.length&&(R=null),0===z.length&&(C=null)),R||C?(U&&(h=this.parseSafeCURIEOrCURIEOrURI(U.value,f,r)),D&&(p=h),h||(l.parentNode.nodeType===ct.DOCUMENT_NODE?h=i(l.baseURI):c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject)),q&&(d=this.parseSafeCURIEOrCURIEOrURI(q.value,f,r)),d||(H?d=this.resolveAndNormalize(r,encodeURI(H.value)):B?d=this.resolveAndNormalize(r,encodeURI(B.value)):!D||U||this.inXHTMLMode&&("head"===l.localName||"body"===l.localName)||(d=this.newBlankNode())),!D||U||!this.inXHTMLMode||"head"!==l.localName&&"body"!==l.localName?D&&!U&&(p=d):p=h):!L||F||P?(U&&(h=this.parseSafeCURIEOrCURIEOrURI(U.value,f,r)),!h&&q&&(h=this.parseSafeCURIEOrCURIEOrURI(q.value,f,r)),!h&&H&&(h=this.resolveAndNormalize(r,encodeURI(H.value))),!h&&B&&(h=this.resolveAndNormalize(r,encodeURI(B.value))),h||(l.parentNode.nodeType===ct.DOCUMENT_NODE?h=i(l.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==l.localName&&"body"!==l.localName?D?h=this.newBlankNode():c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject,L||(u=!0)):h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject),D&&(p=h)):(U&&(h=this.parseSafeCURIEOrCURIEOrURI(U.value,f,r),D&&(p=h)),h||l.parentNode.nodeType!==ct.DOCUMENT_NODE?!h&&c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject):(h=i(l.baseURI),D&&(p=h)),D&&!p&&(q&&(p=this.parseSafeCURIEOrCURIEOrURI(q.value,f,r)),!p&&H&&(p=this.resolveAndNormalize(r,encodeURI(H.value))),!p&&B&&(p=this.resolveAndNormalize(r,encodeURI(B.value))),p||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==l.localName&&"body"!==l.localName||(p=h),p||(p=this.newBlankNode()),d=p)),h&&(U||q||p)){var V=h;D&&!U&&!q&&d&&(V=d),this.newSubjectOrigin(l,V)}if(p){k=this.tokenize(D.value);for(let e=0;e<k.length;e++){var G=this.parseTermOrCURIEOrAbsURI(k[e],w,c.terms,f,r);G&&this.addTriple(l,p,ut.typeURI,{type:ut.objectURI,value:G})}}if(h&&h!==c.parentObject&&(m={},v=!0),d){if(R&&Z)for(let e=0;e<$.length;e++){let t=m[$[e]];t||(t=[],m[$[e]]=t),t.push({type:ut.objectURI,value:d})}else if(R)for(let e=0;e<$.length;e++)this.addTriple(l,h,$[e],{type:ut.objectURI,value:d});if(C)for(let e=0;e<z.length;e++)this.addTriple(l,d,z[e],{type:ut.objectURI,value:h})}else{if(h&&!d&&(R||C)&&(d=this.newBlankNode()),R&&Z)for(let e=0;e<$.length;e++){let t=m[$[e]];t||(t=[],m[A]=t),y.push({predicate:$[e],list:t})}else if(R)for(let e=0;e<$.length;e++)y.push({predicate:$[e],forward:!0});if(C)for(let e=0;e<z.length;e++)y.push({predicate:z[e],forward:!1})}if(L){var J=null,X=null;P?(J=""===P.value?ut.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(P.value,w,c.terms,f,r),X=M&&!F?M.value:J===ut.XMLLiteralURI||J===ut.HTMLLiteralURI?null:F?F.value:l.textContent):F?(J=ut.PlainLiteralURI,X=F.value):M?(X=M.value,(J=ut.deriveDateTimeType(X))||(J=ut.PlainLiteralURI)):R||C||(q&&(X=this.parseSafeCURIEOrCURIEOrURI(q.value,f,r)),!X&&H?X=this.resolveAndNormalize(r,encodeURI(H.value)):!X&&B&&(X=this.resolveAndNormalize(r,encodeURI(B.value))),X&&(J=ut.objectURI)),J||(D&&!U?(J=ut.objectURI,X=p):(X=l.textContent,this.inHTMLMode&&"time"===l.localName&&(J=ut.deriveDateTimeType(X)),J||(J=ut.PlainLiteralURI))),k=this.tokenize(L.value);for(let e=0;e<k.length;e++){let t=this.parsePredicate(k[e],w,c.terms,f,r);if(t)if(Z){let e=m[t];e||(e=[],m[t]=e),e.push(J===ut.XMLLiteralURI||J===ut.HTMLLiteralURI?{type:J,value:l.childNodes}:{type:J||ut.PlainLiteralURI,value:X,language:b})}else J===ut.XMLLiteralURI||J===ut.HTMLLiteralURI?this.addTriple(l,h,t,{type:J,value:l.childNodes}):this.addTriple(l,h,t,{type:J||ut.PlainLiteralURI,value:X,language:b})}}if(h&&!u)for(let e=0;e<c.incomplete.length;e++)c.incomplete[e].list?c.incomplete[e].list.push({type:ut.objectURI,value:h}):c.incomplete[e].forward?this.addTriple(l,c.subject,c.incomplete[e].predicate,{type:ut.objectURI,value:h}):this.addTriple(l,h,c.incomplete[e].predicate,{type:ut.objectURI,value:c.subject});var W=null,Q=h;u?((W=this.push(c,c.subject)).parentObject=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject,W.incomplete=c.incomplete,W.language=b,W.prefixes=f,W.vocabulary=w):((W=this.push(c,h)).parentObject=d||h||c.subject,W.prefixes=f,W.incomplete=y,d&&(Q=d,m={},v=!0),W.listMapping=m,W.language=b,W.vocabulary=w),v&&n.unshift({parent:l,context:c,subject:Q,listMapping:m});for(var Y=l.lastChild;Y;Y=Y.previousSibling)Y.nodeType===ct.ELEMENT_NODE&&n.unshift({current:Y,context:W})}}this.inHTMLMode&&this.copyProperties();for(let t=0;t<this.finishedHandlers.length;t++)this.finishedHandlers[t](e)}push(e,t){return{parent:e,subject:t||(e?e.subject:null),parentObject:null,incomplete:[],listMapping:e?e.listMapping:{},language:e?e.language:this.language,prefixes:e?e.prefixes:this.target.graph.prefixes,terms:e?e.terms:this.target.graph.terms,vocabulary:e?e.vocabulary:this.vocabulary}}resolveAndNormalize(e,t){return x.join(t,e)}setContext(e){"html"===e.localName&&"XHTML+RDFa 1.1"===e.getAttribute("version")?this.setXHTMLContext():"html"===e.localName||"http://www.w3.org/1999/xhtml"===e.namespaceURI?"undefined"!=typeof document&&document.doctype?"-//W3C//DTD XHTML+RDFa 1.0//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"===document.doctype.systemId?(lt.log("WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode."),this.setHTMLContext()):"-//W3C//DTD XHTML+RDFa 1.1//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"===document.doctype.systemId?this.setXHTMLContext():this.setHTMLContext():this.setHTMLContext():this.setXMLContext()}setHTMLContext(){this.setInitialContext(),this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.inXHTMLMode=!1,this.inHTMLMode=!0}setInitialContext(){this.vocabulary=null,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}]}setXHTMLContext(){this.setInitialContext(),this.inXHTMLMode=!0,this.inHTMLMode=!1,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.target.graph.terms.alternate="http://www.w3.org/1999/xhtml/vocab#alternate",this.target.graph.terms.appendix="http://www.w3.org/1999/xhtml/vocab#appendix",this.target.graph.terms.bookmark="http://www.w3.org/1999/xhtml/vocab#bookmark",this.target.graph.terms.cite="http://www.w3.org/1999/xhtml/vocab#cite",this.target.graph.terms.chapter="http://www.w3.org/1999/xhtml/vocab#chapter",this.target.graph.terms.contents="http://www.w3.org/1999/xhtml/vocab#contents",this.target.graph.terms.copyright="http://www.w3.org/1999/xhtml/vocab#copyright",this.target.graph.terms.first="http://www.w3.org/1999/xhtml/vocab#first",this.target.graph.terms.glossary="http://www.w3.org/1999/xhtml/vocab#glossary",this.target.graph.terms.help="http://www.w3.org/1999/xhtml/vocab#help",this.target.graph.terms.icon="http://www.w3.org/1999/xhtml/vocab#icon",this.target.graph.terms.index="http://www.w3.org/1999/xhtml/vocab#index",this.target.graph.terms.last="http://www.w3.org/1999/xhtml/vocab#last",this.target.graph.terms.license="http://www.w3.org/1999/xhtml/vocab#license",this.target.graph.terms.meta="http://www.w3.org/1999/xhtml/vocab#meta",this.target.graph.terms.next="http://www.w3.org/1999/xhtml/vocab#next",this.target.graph.terms.prev="http://www.w3.org/1999/xhtml/vocab#prev",this.target.graph.terms.previous="http://www.w3.org/1999/xhtml/vocab#previous",this.target.graph.terms.section="http://www.w3.org/1999/xhtml/vocab#section",this.target.graph.terms.stylesheet="http://www.w3.org/1999/xhtml/vocab#stylesheet",this.target.graph.terms.subsection="http://www.w3.org/1999/xhtml/vocab#subsection",this.target.graph.terms.start="http://www.w3.org/1999/xhtml/vocab#start",this.target.graph.terms.top="http://www.w3.org/1999/xhtml/vocab#top",this.target.graph.terms.up="http://www.w3.org/1999/xhtml/vocab#up",this.target.graph.terms.p3pv1="http://www.w3.org/1999/xhtml/vocab#p3pv1",this.target.graph.terms.related="http://www.w3.org/1999/xhtml/vocab#related",this.target.graph.terms.role="http://www.w3.org/1999/xhtml/vocab#role",this.target.graph.terms.transformation="http://www.w3.org/1999/xhtml/vocab#transformation"}setXMLContext(){this.setInitialContext(),this.inXHTMLMode=!1,this.inHTMLMode=!1}tokenize(e){return this.trim(e).split(/\s+/)}static tokenize(e){return this.trim(e).split(/\s+/)}toRDFNodeObject(e){if(void 0!==e){if("string"==typeof e)return"_:"===e.substring(0,2)?(void 0===this.blankNodes[e.substring(2)]&&(this.blankNodes[e.substring(2)]=new a(e.substring(2))),this.blankNodes[e.substring(2)]):E.namedNode(e);switch(e.type){case ut.objectURI:return"_:"===e.value.substring(0,2)?(void 0===this.blankNodes[e.value.substring(2)]&&(this.blankNodes[e.value.substring(2)]=new a(e.value.substring(2))),this.blankNodes[e.value.substring(2)]):E.namedNode(e.value);case ut.PlainLiteralURI:return new h(e.value,e.language||"");case ut.XMLLiteralURI:case ut.HTMLLiteralURI:var t="";return Object.keys(e.value).forEach((r=>{t+=I.domToString(e.value[r],this.htmlOptions)})),new h(t,"",new l.Z(e.type));default:return new h(e.value,"",new l.Z(e.type))}}}trim(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}static trim(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}ut.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",ut.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",ut.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",ut.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",ut.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",ut.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",ut.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",ut.NCNAME=new RegExp("^"+ut.nameStartChar+ut.nameChar+"*$"),ut.dateTimeTypes=[{pattern:/-?P(?:[0-9]+Y)?(?:[0-9]+M)?(?:[0-9]+D)?(?:T(?:[0-9]+H)?(?:[0-9]+M)?(?:[0-9]+(?:\.[0-9]+)?S)?)?/,type:"http://www.w3.org/2001/XMLSchema#duration"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9]T(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#dateTime"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9](?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#date"},{pattern:/(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#time"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]/,type:"http://www.w3.org/2001/XMLSchema#gYearMonth"},{pattern:/-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,type:"http://www.w3.org/2001/XMLSchema#gYear"}];const ht=ut.parseRDFaDOM;class dt{constructor(e){this.store=e,this.bnodes={},this.why=null,this.reify=!1}frameFactory(e,t,r){return{NODE:1,ARC:2,parent:t,parser:e,store:e.store,element:r,lastChild:0,base:null,lang:null,node:null,nodeType:null,listIndex:1,rdfid:null,datatype:null,collection:!1,terminateFrame:function(){this.collection&&this.node.close()},addSymbol:function(e,t){t=x.join(t,this.base),this.node=this.store.sym(t),this.nodeType=e},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var e=this.store.sym(x.join("#"+this.parent.rdfid,this.base));this.store.add(e,this.store.sym(dt.ns.RDF+"type"),this.store.sym(dt.ns.RDF+"Statement"),this.parser.why),this.store.add(e,this.store.sym(dt.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(e,this.store.sym(dt.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(e,this.store.sym(dt.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType===this.NODE&&this.parent.nodeType===this.ARC&&this.parent.parent.nodeType===this.NODE},addNode:function(e){this.addSymbol(this.NODE,e),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(e){null!=e?null!=this.parser.bnodes[e]?this.node=this.parser.bnodes[e]:this.node=this.parser.bnodes[e]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(e){e===dt.ns.RDF+"li"&&(e=dt.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,e)},addLiteral:function(e){this.parent.datatype&&this.parent.datatype!==dt.ns.RDF+"langString"?this.node=this.store.literal(e,this.store.sym(this.parent.datatype)):this.node=this.store.literal(e,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}getAttributeNodeNS(e,t,r){var n=null;if(e.getAttributeNodeNS)n=e.getAttributeNodeNS(t,r);else for(var i,o=e.attributes,s=0;s<o.length;++s)if((i=o[s]).namespaceURI===t&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}parse(e,t,r){var n,i=e.childNodes;if(this.cleanParser(),e.nodeType===dt.nodeType.DOCUMENT){for(var o=0;o<i.length;o++)if(i[o].nodeType===dt.nodeType.ELEMENT){n=i[o];break}}else{if(e.nodeType!==dt.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+t+". Halting. ");n=e}this.why=r;var s=this.frameFactory(this);return this.base=t,s.base=t,s.lang=null,this.parseDOM(this.buildFrame(s,n)),!0}parseDOM(e){for(var t,r=function(e){var t="";if(null==e.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+e.localName+" in "+this.base);return e.namespaceURI&&(t+=e.namespaceURI),e.localName?t+=e.localName:e.nodeName&&(e.nodeName.indexOf(":")>=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}.bind(this),n=!0;e.parent;){var i=e.element,o=i.attributes;if(i.nodeType===dt.nodeType.TEXT||i.nodeType===dt.nodeType.CDATA_SECTION)e.parent.nodeType===e.NODE&&(e.addArc(dt.ns.RDF+"value"),e=this.buildFrame(e)),e.addLiteral(i.nodeValue);else if(r(i)!==dt.ns.RDF+"RDF")if(e.parent&&e.parent.collection&&(e.addCollectionArc(),(e=this.buildFrame(e,e.element)).parent.element=null),e.parent&&e.parent.nodeType&&e.parent.nodeType!==e.ARC){e.addArc(r(i)),this.reify&&(t=this.getAttributeNodeNS(i,dt.ns.RDF,"ID"))&&(e.rdfid=t.nodeValue,i.removeAttributeNode(t));var s=this.getAttributeNodeNS(i,dt.ns.RDF,"parseType"),a=this.getAttributeNodeNS(i,dt.ns.RDF,"datatype");if(a&&(e.datatype=a.nodeValue,i.removeAttributeNode(a)),s){var l=s.nodeValue;"Literal"===l?(e.datatype=dt.ns.RDF+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(i.childNodes),n=!1):"Resource"===l?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"===l&&((e=this.buildFrame(e,e.element)).parent.element=null,e.addCollection()),i.removeAttributeNode(s)}if(0!==o.length){var c=this.getAttributeNodeNS(i,dt.ns.RDF,"resource"),u=this.getAttributeNodeNS(i,dt.ns.RDF,"nodeID");e=this.buildFrame(e),c?(e.addNode(c.nodeValue),i.removeAttributeNode(c)):u?(e.addBNode(u.nodeValue),i.removeAttributeNode(u)):e.addBNode();for(var h=o.length-1;h>=0;h--){var d=this.buildFrame(e);d.addArc(r(o[h])),r(o[h])===dt.ns.RDF+"type"?this.buildFrame(d).addNode(o[h].nodeValue):this.buildFrame(d).addLiteral(o[h].nodeValue)}}else 0===i.childNodes.length&&this.buildFrame(e).addLiteral("")}else{var p=this.getAttributeNodeNS(i,dt.ns.RDF,"about");if(t=this.getAttributeNodeNS(i,dt.ns.RDF,"ID"),p&&t)throw new Error("RDFParser: "+i.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!p&&t)e.addNode("#"+t.nodeValue),i.removeAttributeNode(t);else if(null==p&&null==t){var f=this.getAttributeNodeNS(i,dt.ns.RDF,"nodeID");f?(e.addBNode(f.nodeValue),i.removeAttributeNode(f)):e.addBNode()}else e.addNode(p.nodeValue),i.removeAttributeNode(p);var g=this.getAttributeNodeNS(i,dt.ns.RDF,"type");dt.ns.RDF+"Description"!==r(i)&&(g={nodeValue:r(i)}),null!=g&&(this.store.add(e.node,this.store.sym(dt.ns.RDF+"type"),this.store.sym(x.join(g.nodeValue,e.base)),this.why),g.nodeName&&i.removeAttributeNode(g));for(var y=o.length-1;y>=0;y--)this.store.add(e.node,this.store.sym(r(o[y])),this.store.literal(o[y].nodeValue,e.lang),this.why)}for(i=e.element;e.parent;){for(var m=e;null==i;)i=(e=e.parent).element;var v=i.childNodes&&i.childNodes[e.lastChild];if(v&&n){if((v.nodeType===dt.nodeType.ELEMENT||v.nodeType===dt.nodeType.TEXT||v.nodeType===dt.nodeType.CDATA_SECTION)&&(v.nodeType!==dt.nodeType.TEXT&&v.nodeType!==dt.nodeType.CDATA_SECTION||1===i.childNodes.length)){e.lastChild++,e=this.buildFrame(m,i.childNodes[e.lastChild-1]);break}e.lastChild++}else{if(e.terminateFrame(),!(e=e.parent))break;i=e.element,n=!0}}}}cleanParser(){this.bnodes={},this.why=null}buildFrame(e,t){var r=this.frameFactory(this,e,t);if(e&&(r.base=e.base,r.lang=e.lang),!t||t.nodeType===dt.nodeType.TEXT||t.nodeType===dt.nodeType.CDATA_SECTION)return r;var n=t.attributes,i=t.getAttributeNode("xml:base");null!=i&&(r.base=i.nodeValue,t.removeAttribute("xml:base"));var o=t.getAttributeNode("xml:lang");null!=o&&(r.lang=o.nodeValue,t.removeAttribute("xml:lang"));for(var s=n.length-1;s>=0;s--)if("xml"===n[s].nodeName.substr(0,3)){if("xmlns:"===n[s].name.slice(0,6)){var a=n[s].nodeValue;this.base&&(a=x.join(a,this.base)),this.store.setPrefixForURI(n[s].name.slice(6),a)}t.removeAttributeNode(n[s])}return r}}function pt(e,t,r){var n,i,o,s=["INSERT","DELETE","WHERE"],a=S("http://www.w3.org/ns/pim/patch#"),l=_e(t,t,r,r,null,null,"",null),c={},u=function(e,t,r,n,i){return"Line "+(t+1)+" of <"+e+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var h=t.sym(r+"#query");for(c.query=h;;){if((i=l.skipSpace(e,n))<0)return c;if(";"===e[i]){if((n=l.skipSpace(e,i+1))<0)return c;i=n}var d=!1;for(o=0;o<s.length;o++){var p=s[o];if(e.slice(i,i+p.length)===p){if((n=l.skipSpace(e,i+p.length))<0)throw u(l._thisDoc,l.lines,e,i+p.length,"found EOF, needed {...} after "+p);if(("INSERT"===p||"DELETE"===p)&&"DATA"===e.slice(n,n+4)){if((i=l.skipSpace(e,n+4))<0)throw u(l._thisDoc,l.lines,e,n+4,"needed {...} after INSERT DATA "+p);n=i}var f=[];if((i=l.node(e,n,f))<0)throw u(l._thisDoc,l.lines,e,n,"bad syntax or EOF in {...} after "+p);c[p.toLowerCase()]=f[0],t.add(h,a(p.toLowerCase()),f[0]),d=!0,n=i}}if(!d&&"@prefix"===e.slice(i,i+7)){if((n=l.directive(e,i))<0)throw u(l._thisDoc,l.lines,e,n,"bad syntax or EOF after @prefix ");n=l.checkDot(e,n),d=!0}if(!d)throw u(l._thisDoc,l.lines,e,i,"Unknown syntax at start of statememt: '"+e.slice(i).slice(0,20)+"'")}}function ft(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",i=arguments.length>4?arguments[4]:void 0;n=n||o.z8,n=n.split(";")[0];try{if(n===o.qS||n===o.z8){var s=_e(t,t,r,r,null,null,"",null);s.loadBuf(e),c()}else if(n===o.Is){var a=new dt(t);a.parse(I.parseXML(e),r,t.sym(r)),c()}else if(n===o.D7)ht(I.parseXML(e,{contentType:o.D7}),t,r),c();else if(n===o.us)ht(I.parseXML(e,{contentType:o.us}),t,r),c();else if(n===o.oW||n===o.xm)pt(e,t,r),c();else if(n===o.ui)Se(e,t,r,c);else{if(n!==o.b4&&n!==o.lL)throw void 0===n?new Error("contentType is undefined"):new Error("Don't know how to parse "+n+" yet");var l=new ot({factory:Ee});h(null,e)}}catch(e){u(e)}function c(){i&&i(null,t)}function u(e){if(n!==o.ui||n!==o.b4||n!==o.lL){if(!i){let t=new Error(e+" while trying to parse <"+r+"> as "+n);throw t.cause=e,t}i(e,t)}}function h(e,r){e&&i(e,t);try{l.parse(r,d)}catch(e){i(e,t)}}function d(e,r){r?t.add(r.subject,r.predicate,r.object,r.graph):i(e,t)}ft.handled={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/sparql-update":!0,"application/sparql-update-single-match":!0,"application/ld+json":!0,"application/nquads":!0,"application/n-quads":!0}}(0,e.Z)(dt,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,e.Z)(dt,"nodeType",{ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12});var gt=n(7297),yt=n.n(gt),mt=n(2598),vt=n(292);const bt={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},wt={rdf:o.Is,owl:o.Is,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},xt=e=>({link:S("http://www.w3.org/2007/ont/link#",e),http:S("http://www.w3.org/2007/ont/http#",e),httph:S("http://www.w3.org/2007/ont/httph#",e),rdf:S("http://www.w3.org/1999/02/22-rdf-syntax-ns#",e),rdfs:S("http://www.w3.org/2000/01/rdf-schema#",e),dc:S("http://purl.org/dc/elements/1.1/",e),ldp:S("http://www.w3.org/ns/ldp#",e)}),_t=xt();class Tt{constructor(t,r){(0,e.Z)(this,"response",void 0),(0,e.Z)(this,"dom",void 0),this.response=t,this.dom=r}}(0,e.Z)(Tt,"pattern",void 0);class Nt extends Tt{static toString(){return"RDFXMLHandler"}static register(e){e.mediatypes[o.Is]={q:.9}}parse(e,t,r){let n=e.store;if(this.dom||(this.dom=I.parseXML(t)),"parsererror"===this.dom.documentElement.nodeName)return e.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");let i=new dt(n);try{i.parse(this.dom,r.original.value,r.original)}catch(t){return e.failFetch(r,"Syntax error parsing RDF/XML! "+t,"parse_error")}return r.noMeta||n.add(r.original,_t.rdf("type"),_t.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}Nt.pattern=new RegExp("application/rdf\\+xml");class jt extends Tt{static toString(){return"XHTMLHandler"}static register(e){e.mediatypes[o.D7]={}}parse(e,t,r){let n,i;this.dom||(this.dom=I.parseXML(t));let o=e.store,s=this.dom.getElementsByTagName("title");s.length>0&&o.add(r.resource,_t.dc("title"),o.rdfFactory.literal(s[0].textContent),r.resource);let a=this.dom.getElementsByTagName("link");for(let t=a.length-1;t>=0;t--)n=a[t].getAttribute("rel"),i=!1,n||(n=a[t].getAttribute("rev"),i=!0),n&&e.linkData(r.original,n,a[t].getAttribute("href"),r.resource,i);let l=this.dom.getElementsByTagName("script");for(let e=0;e<l.length;e++){let t=l[e].getAttribute("type");bt[t]&&(ft(l[e].textContent,o,r.original.value,t),ft(l[e].textContent,o,r.original.value,t))}if(r.noMeta||o.add(r.resource,_t.rdf("type"),_t.link("WebPage"),e.appNode),!r.noRDFa&&ht)try{ht(this.dom,o,r.original.value)}catch(t){let n="Error trying to parse "+r.resource+" as RDFa:\n"+t+":\n"+t.stack;return e.failFetch(r,n,"parse_error")}return e.doneFetch(r,this.response)}}jt.pattern=new RegExp("application/xhtml");class Et extends Tt{static toString(){return"XMLHandler"}static register(e){e.mediatypes["text/xml"]={q:.5},e.mediatypes["application/xml"]={q:.5}}static isElement(e){return e.nodeType===Node.ELEMENT_NODE}parse(e,t,r){let n=I.parseXML(t);for(let i=0;i<n.childNodes.length;i++){const o=n.childNodes[i];if(Et.isElement(o)){let i=o.namespaceURI;if(i&&i===i.rdf)return e.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new Nt(this.response,n).parse(e,t,r);break}}if(n.doctype&&"html"===n.doctype.name&&n.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&n.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new jt(this.response,n).parse(e,t,r);let i=n.getElementsByTagName("html")[0];if(i){let o=i.getAttribute("xmlns");if(o&&o.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return e.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new jt(this.response,n).parse(e,t,r)}return e.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+t.slice(0,80),901)}}Et.pattern=new RegExp("(text|application)/(.*)xml");class Ot extends Tt{static toString(){return"HTMLHandler"}static register(e){e.mediatypes["text/html"]={q:.9}}parse(e,t,r){let n=e.store;if(Rt(t))return e.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new jt(this.response).parse(e,t,r);if(function(e){const t=e.indexOf("<!DOCTYPE html"),r=e.indexOf(">");return!(-1===t||-1===r||t>r)&&-1!==e.substr(t,r-t).indexOf("XHTML")}(t))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new jt(this.response).parse(e,t,r);if(function(e){return!!e.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(t))return e.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new jt(this.response).parse(e,t,r);let i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(t);return i&&n.add(r.resource,_t.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,_t.rdf("type"),_t.link("WebPage"),e.appNode),e.addStatus(r.req,"non-XML HTML document, not parsed for data."),e.doneFetch(r,this.response)}}Ot.pattern=new RegExp("text/html");class St extends Tt{static toString(){return"JsonLdHandler"}static register(e){e.mediatypes["application/ld+json"]={q:.9}}parse(e,t,r,n){const i=e.store;return new Promise(((o,s)=>{try{Se(t,i,r.original.value,(()=>{o(e.doneFetch(r,n))}))}catch(t){const i="Error trying to parse "+r.resource+" as JSON-LD:\n"+t;o(e.failFetch(r,i,"parse_error",n))}}))}}St.pattern=/application\/ld\+json/;class It extends Tt{static toString(){return"TextHandler"}static register(e){e.mediatypes["text/plain"]={q:.5}}parse(e,t,r){return Rt(t)?(e.addStatus(r.req,"Warning: "+r.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new Et(this.response).parse(e,t,r)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new Et(this.response).parse(e,t,r)):(e.addStatus(r.req,"Plain text document, no known RDF semantics."),e.doneFetch(r,this.response))}}It.pattern=new RegExp("text/plain");class At extends Tt{static toString(){return"N3Handler"}static register(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}parse(e,t,r,n){let i=e.store,o=_e(i,i,r.original.value,r.original.value,null,null,"",null);try{o.loadBuf(t)}catch(t){let i="Error trying to parse "+r.resource+" as Notation3:\n"+t;return e.failFetch(r,i,"parse_error",n)}return e.addStatus(r.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),e.store.add(r.original,_t.rdf("type"),_t.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}At.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");const kt={RDFXMLHandler:Nt,XHTMLHandler:jt,XMLHandler:Et,HTMLHandler:Ot,TextHandler:It,N3Handler:At,JsonLdHandler:St};function Rt(e){return!!e.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}class Ct{constructor(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,e.Z)(this,"store",void 0),(0,e.Z)(this,"timeout",void 0),(0,e.Z)(this,"_fetch",void 0),(0,e.Z)(this,"mediatypes",void 0),(0,e.Z)(this,"appNode",void 0),(0,e.Z)(this,"requested",void 0),(0,e.Z)(this,"timeouts",void 0),(0,e.Z)(this,"redirectedTo",void 0),(0,e.Z)(this,"fetchQueue",void 0),(0,e.Z)(this,"fetchCallbacks",void 0),(0,e.Z)(this,"nonexistent",void 0),(0,e.Z)(this,"lookedUp",void 0),(0,e.Z)(this,"handlers",void 0),(0,e.Z)(this,"ns",void 0),(0,e.Z)(this,"fireCallbacks",void 0),this.store=t||new ee,this.ns=xt(this.store.rdfFactory),this.timeout=r.timeout||3e4,this._fetch=r.fetch||void 0!==n.g&&(n.g.solidFetcher||n.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||yt(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.rdfFactory.blankNode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},I.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(r.handlers||kt).map((e=>this.addHandler(kt[e])))}static crossSiteProxy(e){return Ct.crossSiteProxyTemplate?Ct.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):void 0}static offlineOverride(e){let t=e;var r;return"undefined"!=typeof window&&window.panes&&(r=window.panes.UI)&&r.preferences&&r.preferences.get("offlineModeUsingLocalhost")&&"http://"===t.slice(0,7)&&"localhost/"!==t.slice(7,17)&&(t="http://localhost/"+t.slice(7),O.Z.warn("Localhost kludge for offline use: actually getting <"+t+">")),t}static proxyIfNecessary(e){var t;if("undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.isExtension)return e;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){let t=e.split("/").slice(2);const r=(e,t)=>{let n=t[e.shift()];return n?"string"==typeof n?n+e.join("/"):e?r(e,n):null:null},n=r(t,$SolidTestEnvironment.localSiteMap);if(n)return n}return Ct.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===e.slice(0,5)?Ct.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):e}static unsupportedProtocol(e){let t=x.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}static setCredentials(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===t.credentials&&(void 0!==t.withCredentials?t.credentials=t.withCredentials?"include":"omit":t.credentials="include")}load(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=Object.assign({},t),e instanceof Array)return Promise.all(e.map((e=>this.load(e,Object.assign({},t)))));const r=e;let n=(0,mt._)(r);n=n.split("#")[0],t=this.initFetchOptions(n,t);const i=this.initFetchOptions(n,t);return this.pendingFetchPromise(n,i.baseURI,i)}async pendingFetchPromise(e,t,r){let n;return!r.force&&await this.fetchQueue[t]?n=this.fetchQueue[t]:(n=Promise.race([this.setRequestTimeout(e,r),this.fetchUri(e,r)]),this.fetchQueue[t]=n,this.cleanupFetchRequest(t,void 0,this.timeout)),n.then((t=>(e in this.timeouts&&(this.timeouts[e].forEach(clearTimeout),delete this.timeouts[e]),t)))}cleanupFetchRequest(e,t,r){void 0!==t&&vt.warn("_options is deprecated"),this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((()=>{this.isPending(e)||delete this.fetchQueue[e]}),r))}initFetchOptions(e,t){let r=this.store;!t.method||"GET"===t.method.toUpperCase()||(t.force=!0),t.resource=r.rdfFactory.namedNode(e),t.baseURI=t.baseURI||e,t.original=r.rdfFactory.namedNode(t.baseURI),t.req=r.bnode(),t.headers=t.headers||new gt.Headers,t.contentType&&(t.headers["content-type"]=t.contentType),t.force&&(t.cache="no-cache");let n=this.acceptString();t.headers.accept=n;let i=Ct.offlineOverride(e);t.requestedURI=i,Ct.setCredentials(i,t);let o=Ct.proxyIfNecessary(i);return i!==o&&(t.proxyUsed=!0),t.actualProxyURI=o,t}fetchUri(e,t){if(!e)return Promise.reject(new Error("Cannot fetch an empty uri"));if(Ct.unsupportedProtocol(e))return this.failFetch(t,"fetcher: Unsupported protocol","unsupported_protocol");let r=this.getState(e);if(t.force)delete this.nonexistent[e];else{if("fetched"===r)return Promise.resolve(this.doneFetch(t,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===r&&404===this.requested[e]){let r="Previously failed: "+this.requested[e],n={url:e,status:this.requested[e],statusText:r,responseText:r,headers:new gt.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(t,r,this.requested[e],n)}}this.fireCallbacks("request",[e]),this.requested[e]=!0,t.noMeta||this.saveRequestMetadata(e,t);let{actualProxyURI:n}=t;return this._fetch(n,t).then((r=>this.handleResponse(r,e,t)),(r=>{let i={url:n,status:999,statusText:(r.name||"network failure")+": "+(r.errno||r.code||r.type),responseText:r.message,headers:new gt.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return vt.log("Fetcher: <"+n+"> Non-HTTP fetch exception: "+r),this.handleError(i,e,t)}))}nowOrWhenFetched(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,mt._)(e);"function"==typeof t?r=t:void 0===t||((0,c.NX)(t)?n.referringTerm=t:n=t),this.load(i,n).then((e=>{if(r)if(e)if(e.ok)r(!0,"OK",e);else{let t="HTTP error: Status "+e.status+" ("+e.statusText+")";e.responseText&&(t+=" "+e.responseText),vt.log(t+" fetching "+i),r(!1,t,e)}else{let e="@@ nowOrWhenFetched: no response object!";vt.log(e),r(!1,e)}}),(function(e){var t=e.message||e.statusText;t="Failed to load <"+i+"> "+t,vt.log(t),e.response&&e.response.status&&(t+=" status: "+e.response.status),r(!1,t,e.response)}))}addStatus(e,t){let r=new Date;t="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+t;let n=this.store;const i=n.the(e,this.ns.link("status"));(0,c.uZ)(i)?i.append(n.rdfFactory.literal(t)):O.Z.warn("web.js: No list to add to: "+i+","+t)}failFetch(e,t,r,n){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,this.ns.link("error"),this.store.rdfFactory.literal(t));let i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.equals(e.original),this.requested[x.docpart(e.original.value)]=r,this.fireCallbacks("fail",[e.original.value,t]));var o=new Error("Fetcher: "+t);return o.status=r,o.statusText=t,o.response=n,Promise.reject(o)}linkData(e,t,r,n,i){if(!r)return;let o,s=this.store,a=s.rdfFactory.namedNode(x.join(r,e.value));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(a.value===e.value)return;o=this.ns.rdfs("seeAlso")}else o="type"===t?s.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):s.rdfFactory.namedNode(x.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?s.add(a,o,e,n):s.add(e,o,a,n)}parseLinkHeader(e,t,r){if(!e)return;const n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(let e=0;e<i.length;e++){let o=i[e].split(">"),s=o[0].substring(1),a=o[1].match(n);if(null==a)return;for(let e=0;e<a.length;e++){let n=a[e].split("=")[1].replace(/["']/g,"");this.linkData(t,n,s,r)}}}doneFetch(e,t){return this.addStatus(e.req,"Done."),this.requested[e.original.value]="done",this.fireCallbacks("done",[e.original.value]),t.req=e.req,t}nowKnownAs(e,t){this.lookedUp[e.value]?this.lookedUp[t.value]||this.lookUpThing(t,e):this.lookedUp[t.value]&&(this.lookedUp[e.value]||this.lookUpThing(e,t))}putBack(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(0,mt._)(e);let n=new l.Z(r).doc();return t.contentType=t["content-type"]||t["Content-Type"]||t.contentType||o.z8,"application/ld+json"===t.contentType?new Promise(((r,i)=>{F(n,this.store,n.uri,t.contentType,((n,o)=>{n?i(n):(t.data=o,this.webOperation("PUT",e,t).then((e=>r(e))).catch((e=>i(e))))}))})):(t.data=F(n,this.store,n.value,t.contentType),this.webOperation("PUT",r,t))}webCopy(e,t,r){return this.webOperation("GET",e).then((e=>this.webOperation("PUT",t,{data:e.responseText,contentType:r})))}delete(e,t){return this.webOperation("DELETE",e,t).then((t=>(this.requested[e]=404,this.nonexistent[e]=!0,this.unload(this.store.rdfFactory.namedNode(e)),t)))}async createIfNotExists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.z8,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=this;try{var i=await n.load(e)}catch(o){if(404===o.response.status){vt.log("createIfNotExists: doc does NOT exist, will create... "+e);try{i=await n.webOperation("PUT",e.value,{data:r,contentType:t})}catch(t){throw vt.log("createIfNotExists doc FAILED: "+e+": "+t),t}return delete n.requested[e.value],i}throw vt.log("createIfNotExists doc load error NOT 404: "+e+": "+o),o}return i}createContainer(e,t,r){let n={"content-type":o.z8,link:this.ns.ldp("BasicContainer")+'; rel="type"'};t&&(n.slug=t);let i={headers:n};return r&&(i.body=r),this.webOperation("POST",e,i)}invalidateCache(e){const t=(0,mt._)(e),r=this;if(r.fetchQueue&&r.fetchQueue[t]&&(vt.log("Internal error - fetchQueue exists "+t),"resolved"===r.fetchQueue[t].PromiseStatus?delete r.fetchQueue[t]:(delete r.fetchQueue[t],vt.log("*** Fetcher: pending fetchQueue deleted "+t))),r.requested[t]&&"done"!==r.requested[t]&&"failed"!==r.requested[t]&&404!==r.requested[t]){let e=`Rdflib: fetcher: Destructive operation on <${r.requested[t]}> file being fetched! `+t;vt.error(e)}else delete r.requested[t],delete r.nonexistent[t]}webOperation(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,mt._)(t);r.method=e,r.body=r.data||r.body,r.force=!0;const i=this;if(r.body&&!r.contentType)throw new Error("Web operation sending data must have a defined contentType.");return r.contentType&&(r.headers=r.headers||{},r.headers["content-type"]=r.contentType),Ct.setCredentials(n,r),new Promise((function(t,o){i._fetch(n,r).then((r=>{if(r.ok)"PUT"!==e&&"PATCH"!==e&&"POST"!==e&&"DELETE"!==e||i.invalidateCache(n),r.text?r.text().then((e=>{r.responseText=e,t(r)})):t(r);else{let t="Web error: "+r.status;r.statusText&&(t+=" ("+r.statusText+")"),t+=" on "+e+" of <"+n+">",r.responseText&&(t+=": "+r.responseText);let i=new Error(t);i.response=r,o(i)}}),(t=>{o(new Error("Fetch error for "+e+" of <"+n+">:"+t))}))}))}lookUpThing(e,t){let r=this.store.uris(e);return r=r.map((e=>x.docpart(e))),r.forEach((e=>{this.lookedUp[e]=!0})),this.load(r,{referringTerm:t})}getHeader(e,t){const r=this.store,n=e.value,i=r.each(void 0,this.ns.link("requestedURI"),r.rdfFactory.literal(n));for(let e=0;e<i.length;e++){let n=i[e];if(void 0!==n){let e=r.any(n,this.ns.link("response"));if(void 0!==e&&r.anyValue(e,this.ns.http("status"))&&r.anyValue(e,this.ns.http("status")).startsWith("2")){let n=r.each(e,this.ns.httph(t.toLowerCase()));return n.length?n.map((e=>e.value)):[]}}}}saveRequestMetadata(e,t){let r=t.req,n=this.store,i=t.referringTerm;this.addStatus(t.req,"Accept: "+t.headers.accept),(0,c.NX)(i)&&n.add(n.rdfFactory.namedNode(e),this.ns.link("requestedBy"),i,this.appNode),t.original&&t.original.value!==e&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(t.original.value),this.appNode);const o=new Date,s="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(s+" Request for "+e),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(e),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}saveResponseMetadata(e,t){const r=this.store;let n=r.bnode();return r.add(t.req,this.ns.link("response"),n,n),r.add(n,this.ns.http("status"),r.rdfFactory.literal(e.status),n),r.add(n,this.ns.http("statusText"),r.rdfFactory.literal(e.statusText),n),e.headers.forEach(((e,i)=>{r.add(n,this.ns.httph(i),this.store.rdfFactory.literal(e),n),"content-type"===i&&r.add(t.resource,this.ns.rdf("type"),r.rdfFactory.namedNode(I.mediaTypeClass(e).value),n)})),n}objectRefresh(e){let t=this.store.uris(e);if(void 0!==t)for(let e=0;e<t.length;e++)this.refresh(this.store.rdfFactory.namedNode(x.docpart(t[e])))}refresh(e,t){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(e,{force:!0,clearPreviousData:!0},t)}refreshIfExpired(e,t){let r=this.getHeader(e,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(e,t):t(!0,"Not expired",{})}retract(e){this.store.removeMany(void 0,void 0,void 0,e),e.value&&delete this.requested[x.docpart(e.value)],this.fireCallbacks("retract",arguments)}getState(e){return void 0===this.requested[e]?"unrequested":!0===this.requested[e]?"requested":"done"===this.requested[e]?"fetched":"redirected"===this.requested[e]?this.getState(this.redirectedTo[e]):"failed"}isPending(e){return!0===this.requested[e]}unload(e){this.store.removeDocument(e),delete this.requested[e.value]}addHandler(e){this.handlers.push(e),e.register(this)}retryNoCredentials(e,t){vt.log("Fetcher: CORS: RETRYING with NO CREDENTIALS for "+t.resource),t.retriedWithNoCredentials=!0,delete this.requested[e],delete this.fetchQueue[e];let r=Object.assign({},t,{credentials:"omit"});return this.addStatus(t.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(e,r)}isCrossSite(e){if("undefined"==typeof document||!document.location)return!1;const t=x.hostpart,r=""+document.location;return(t(r)&&t(e)&&t(r))!==t(e)}handleError(e,t,r){if(this.isCrossSite(t)){if(r.credentials&&"include"===r.credentials&&!r.retriedWithNoCredentials)return this.retryNoCredentials(t,r);let e=Ct.crossSiteProxy(t);if(e&&!r.proxyUsed)return vt.log("web: Direct failed so trying proxy "+e),this.redirectToProxy(e,r)}var n;return e instanceof Error?n="Fetch error: "+e.message:(n=e.statusText,e.responseText&&(n+=` ${e.responseText}`)),this.failFetch(r,n,e.status||998,e)}addType(e,t,r,n){let i=t;if(n){var o=r.any(i,this.ns.link("requestedURI"));o&&o.value!==n&&r.add(r.rdfFactory.namedNode(n),this.ns.rdf("type"),e,this.appNode)}for(;;){const t=r.any(i,this.ns.link("requestedURI"));if(t&&t.value&&r.add(r.rdfFactory.namedNode(t.value),this.ns.rdf("type"),e,this.appNode),i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i),!i)break;var s=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var a=r.any(s,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!a)break;if("301"!==a&&"302"!==a)break}}handleResponse(e,t,r){const n=this.store,i=e.headers,o=r.req,s=this.saveResponseMetadata(e,r),a=this.normalizedContentType(r,i)||"";let l=i.get("content-location");if(0===e.status)return vt.log("Masked error - status 0 for "+t),this.handleError(e,t,r);if(e.status>=400)return 404===e.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then((()=>{let t=r.resource+" "+e.statusText;return this.failFetch(r,t,e.status,e)}));var c=null,u=null;if(l&&(u=x.join(l,t))!==t&&(c=u),200===e.status){this.addType(this.ns.link("Document"),o,n,t),c&&this.addType(this.ns.link("Document"),o,n,c),r.clearPreviousData&&n.removeDocument(r.resource);let e=a.includes("image/")||a.includes("application/pdf");a&&e&&(this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,n,t),c&&this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,n,c))}if(l){if(!r.force&&c&&"done"===this.requested[u])return this.doneFetch(r,e);this.requested[u]=!0}this.parseLinkHeader(i.get("link"),r.original,o);let h=this.handlerForContentType(a,e);return h?e.text().then((t=>(e.responseText=t,h.parse(this,t,r,e)))):(this.addStatus(o,"Fetch over. No data handled."),this.doneFetch(r,e))}saveErrorResponse(e,t){let r=this.store;return e.text().then((e=>{e.length>10&&r.add(t,this.ns.http("content"),r.rdfFactory.literal(e),t)}))}handlerForContentType(e,t){if(!e)return null;let r=this.handlers.find((t=>e.match(t.pattern)));return r?new r(t):null}guessContentType(e){return wt[e.split(".").pop()]}normalizedContentType(e,t){if(e.forceContentType)return e.forceContentType;let r=t.get("content-type");if(!r||r.includes("application/octet-stream")){let t=this.guessContentType(e.resource.value);if(t)return t}let n=x.protocol(e.resource.value);return!r&&["file","chrome"].includes(n)?"text/xml":r}redirectToProxy(e,t){this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;const r=this.store,n=t.req;t.noMeta||(r.add(n,this.ns.link("redirectedTo"),r.rdfFactory.namedNode(e),n),this.addStatus(n,"redirected to new request")),this.requested[t.resource.value]="redirected",this.redirectedTo[t.resource.value]=e;let i=Object.assign({},t);return i.baseURI=t.resource.value,this.fetchUri(e,i).then((e=>(i.noMeta||r.add(n,this.ns.link("redirectedRequest"),i.req,this.appNode),e)))}setRequestTimeout(e,t){return new Promise((r=>{this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((()=>{!this.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||r(this.failFetch(t,`Request to ${e} timed out`,"timeout"))}),this.timeout))}))}addFetchCallback(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}acceptString(){let e="";for(let t in this.mediatypes){""!==e&&(e+=", "),e+=t;for(let r in this.mediatypes[t])e+=";"+r+"="+this.mediatypes[t][r]}return e}}(0,e.Z)(Ct,"HANDLERS",void 0),(0,e.Z)(Ct,"CONTENT_TYPE_BY_EXT",void 0),(0,e.Z)(Ct,"crossSiteProxyTemplate",void 0),Ct.HANDLERS=kt,Ct.CONTENT_TYPE_BY_EXT=wt;const Dt={parseJSON:function(e,t,r){var n,i,o,s={},a=r.sym(t);for(var l in e){0===l.indexOf("_:")?s[l]?n=s[l]:(n=r.bnode(l),s[l]=n):n=r.sym(l);var c=e[l];for(var u in c){var h=c[u];for(var d in i=r.sym(u),h){var p=h[d];if("uri"===p.type)o=r.sym(p.value),r.add(n,i,o,a);else if("BlankNode"===p.type)s[p.value]?o=s[p.value]:(o=r.bnode(p.value),s[p.value]=o),r.add(n,i,o,a);else{if("Literal"!==p.type)throw new Error("error: unexpected termtype: "+d.type);o=p.datatype?r.literal(p.value,void 0,r.sym(p.datatype)):p.lang?r.literal(p.value,p.lang):r.literal(p.value),r.add(n,i,o,a)}}}}}};function Lt(e){var t=0;function r(e){var t="",r=e.statements;for(var n in r)O.Z.debug("Found statement: "+r),t+=s()+r[n]+"\n";return t}function n(e){var t="";for(var r in e.constraints){var n=e.constraints[r];t+=s()+"FILTER ( "+n.describe(r)+" ) \n"}return t}function i(e){for(var o="",a=0;a<e.optional.length;a++)O.Z.debug("Found optional query"),o+=s()+"OPTIONAL { \n",t++,o+=r(e.optional[a]),o+=n(e.optional[a]),o+=i(e.optional[a]),t--,o+=s()+"}\n";return o}function o(e){var o=s()+"WHERE \n{ \n";return t++,o+=r(e),o+=n(e),o+=i(e),t--,o+"}"}function s(){for(var e="",r=0;r<t;r++)e+=" ";return e}return function(e){return function(e){for(var t=s()+"SELECT ",r=0;r<e.vars.length;r++)t+=e.vars[r]+" ";return t+"\n"}(e)+o(e.pat)}(e)}function Pt(e,t,r){var n=[];function i(e){if(n[e])return n[e];var t=r.variable(e);return n[e]=t,t}function o(e){return"string"==typeof e&&e.match(/[^ \n\t]/)}function s(e){return"string"==typeof e&&e.match(/^[\?\$]/)}function a(e){return"string"==typeof e?e.replace(/^</,"<").replace(/>$/,">"):e}function l(e){return"string"==typeof e&&e.match(/^<[^>]*>$/)}function c(e){return"string"==typeof e&&(e.match(/^_:/)||e.match(/^$/))}function u(e){return"string"==typeof e&&e.match(/:$/)}function h(e){return"string"==typeof e&&e.match(/^:|^[^_][^:]*:/)}function d(e){return e.split(":")[0]}function p(e){return e.split(":")[1]}function f(e){return l(e)?e.slice(1,e.length-1):e}function g(e){var t=-1===e.indexOf("'")?null:e.indexOf("'"),n=-1===e.indexOf('"')?null:e.indexOf('"');if(!t&&!n){var i=new Array(1);return i[0]=e,i}var o,s,a=new Array(2);if(!t||n&&n<t)o='"',s=n;else{if(n&&!(t&&t<n))return O.Z.error("SQARQL QUERY OOPS!"),a;o="'",s=t}a[0]=e.slice(0,s);var l,c=e.slice(s+1).indexOf(o);return-1===c?(O.Z.error("SPARQL parsing error: no matching parentheses in literal "+e),e):(e.slice(c+s+2).match(/^\^\^/)?(l=e.slice(c+s+2).indexOf(" "),a[1]=r.literal(e.slice(s+1,s+1+c),r.sym(f(e.slice(s+4+c,s+2+c+l)))),a=a.concat(g(e.slice(c+s+3+l)))):e.slice(c+s+2).match(/^@/)?(l=e.slice(c+s+2).indexOf(" "),a[1]=r.literal(e.slice(s+1,s+1+c),e.slice(s+3+c,s+2+c+l),null),a=a.concat(g(e.slice(c+s+2+l)))):(a[1]=r.literal(e.slice(s+1,s+1+c)),O.Z.info("Literal found: "+a[1]),a=a.concat(g(e.slice(c+s+2)))),a)}function y(e){e=e.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),O.Z.info("New str into spaceDelimit: \n"+e);var t=[],r=e.split(" ");for(var n in r)o(r[n])&&(t=t.concat(r[n]));return t}function m(e,t){for(var r=0;r<t.length;r++)if("string"==typeof t[r]&&t[r].toLowerCase()===e.toLowerCase())return r;return null}function v(e,t){for(var r=[],n=0;n<t.length;n++)"string"==typeof t[n]&&t[n].toLowerCase()===e.toLowerCase()&&r.push(n);return r}function b(e,t,r){O.Z.info("Looking for a close bracket of type "+r+" in "+e);for(var n=0,i=0;i<e.length;i++)if(e[i]===t&&n++,e[i]===r&&n--,n<0)return i;return O.Z.error("Statement had no close parenthesis in SPARQL query"),0}function w(e){return this.describe=function(t){return t+" = "+e.toNT()},this.test=function(t){return e.equals(t)},this}function x(e){this.describe=function(t){return"REGEXP( '"+e+"' , "+t+" )"},this.test=function(t){var r=new RegExp(e);return!!t.value&&r.test(t.value)}}function _(e,t){3!==e.length||"Variable"!==e[0].termType||"NamedNode"!==e[2].termType&&"Literal"!==e[2].termType?6===e.length&&"string"==typeof e[0]&&"regexp"===e[0].toLowerCase()&&"("===e[1]&&")"===e[5]&&","===e[3]&&"Variable"===e[4].termType&&"Literal"===e[2].termType&&(O.Z.debug("Constraint added: "+e),t.constraints[e[4]]=new x(e[2].value)):"="===e[1]||">"===e[1]||"<"===e[1]?(O.Z.debug("Constraint added: "+e),t.constraints[e[0]]=new w(e[2])):O.Z.warn("I don't know how to handle the constraint: "+e)}function T(e,t){O.Z.debug("Optional query: "+e+" not yet implemented.");var n=r.formula();N(e,n),t.optional.push(n)}function N(e,t){var n,o,u=function(e){for(var t=[],n=0;n<e.length;n++)"string"==typeof e[n]?(e[n]=a(e[n]),s(e[n])?t[n]=i(e[n].slice(1)):c(e[n])?(O.Z.info(e[n]+" was identified as a bnode."),t[n]=r.bnode()):l(e[n])?(O.Z.info(e[n]+" was identified as a symbol."),t[n]=r.sym(f(e[n]))):h(e[n])?(O.Z.info(e[n]+" was identified as a prefixed symbol"),S[d(e[n])]?t[n]=r.sym(e[n]=S[d(e[n])]+p(e[n])):(O.Z.error("SPARQL error: "+e[n]+" with prefix "+d(e[n])+" does not have a correct prefix entry."),t[n]=e[n])):t[n]=e[n]):t[n]=e[n];return t}(e);for(O.Z.debug("WHERE: "+u);m("OPTIONAL",u);)o=m("OPTIONAL",u),O.Z.debug("OPT: "+o+" "+u[o]+" in "+u),"{"!==u[o+1]&&O.Z.warn("Bad optional opening bracket in word "+o),-1===(n=b(u.slice(o+2),"{","}"))?O.Z.error("No matching bracket in word "+o):(T(u.slice(o+2,o+2+n),t),o=m("OPTIONAL",u),n=b(u.slice(o+2),"{","}"),u.splice(o,n+3));for(O.Z.debug("WHERE after optionals: "+u);m("FILTER",u);){var g=m("FILTER",u);"("!==u[g+1]&&O.Z.warn("Bad filter opening bracket in word "+g),-1===(n=b(u.slice(g+2),"(",")"))?O.Z.error("No matching bracket in word "+g):(_(u.slice(g+2,g+2+n),t),g=m("FILTER",u),n=b(u.slice(g+2),"(",")"),u.splice(g,n+3))}O.Z.debug("WHERE after filters and optionals: "+u),function(e,t){var r=new Array(1);r[0]=-1;for(var n=r.concat(v(".",e)),i=[],o=0;o<n.length-1;o++)i[o]=e.slice(n[o]+1,n[o+1]);for(o in i){O.Z.info("s+p+o "+o+" = "+i[o]);var s=i[o][0];i[o].splice(0,1);var a=r.concat(v(";",i[o]));a.push(i[o].length);for(var l=[],c=0;c<a.length-1;c++)l[c]=i[o].slice(a[c]+1,a[c+1]);for(o in l){O.Z.info("p+o "+o+" = "+i[o]);var u=l[o][0];l[o].splice(0,1);var h=r.concat(v(",",l[o]));h.push(l[o].length);var d=[];for(c=0;c<h.length-1;c++)d[c]=l[o].slice(h[c]+1,h[c+1]);for(o in d){var p=d[o][0];O.Z.info("Subj="+s+" Pred="+u+" Obj="+p),t.add(s,u,p)}}}}(u,t)}O.Z.info("SPARQL input: \n"+e);var j=new J,E=function(e){var t=g(e),r=[];for(var n in t)r="string"==typeof t[n]?r.concat(y(t[n])):r.concat(t[n]);return r=function(e){for(var t=e,r=0;r<t.length;r++)if("a"===t[r]&&(t[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===t[r]&&"of"===t[r+2]){t.splice(r,1),t.splice(r+1,1);var n=t[r-1];t[r-1]=t[r+1],t[r+1]=n}return t}(r),O.Z.info("SPARQL Tokens: "+r),r}(e),S=function(e){var t=v("PREFIX",e),r=[];for(var n in t){var i=e[t[n]+1],o=e[t[n]+2];if(u(i))if(l(o)){O.Z.info("Prefix found: "+i+" -> "+o);var s=d(i),a=f(o);r[s]=a}else O.Z.error("Invalid SPARQL symbol: "+o);else O.Z.error("Invalid SPARQL prefix: "+i)}return r}(E);S.rdf||(S.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),S.rdfs||(S.rdfs="http://www.w3.org/2000/01/rdf-schema#");var I=m("SELECT",E),A=m("WHERE",E);if(I<0||A<0||I>A)return O.Z.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(e,t){for(var r in O.Z.info("SPARQL vars: "+e),e)if(s(e[r])){O.Z.info("Added "+e[r]+" to query variables from SPARQL");var n=i(e[r].slice(1));t.vars.push(n),n.label=e[r].slice(1)}else O.Z.warn("Incorrect SPARQL variable in SELECT: "+e[r])}(E.slice(I+1,A),j),N(E.slice(A+2,E.length-1),j.pat),t)return j;for(var k in j.pat.statements){var R=j.pat.statements[k];"NamedNode"===R.subject.termType&&r.fetcher&&r.fetcher.lookUpThing(R.subject,"sparql:"+R.subject),"NamedNode"===R.object.termType&&r.fetcher&&r.fetcher.lookUpThing(R.object,"sparql:"+R.object)}return j}class Mt{constructor(t){if((0,e.Z)(this,"store",void 0),(0,e.Z)(this,"ifps",void 0),(0,e.Z)(this,"fps",void 0),(0,e.Z)(this,"patchControl",void 0),(0,e.Z)(this,"ns",void 0),(t=t||new ee).updater)throw new Error("You can't have two UpdateManagers for the same store");t.fetcher||(t.fetcher=new Ct(t)),this.store=t,t.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=S("http://www.w3.org/2007/ont/link#"),this.ns.http=S("http://www.w3.org/2007/ont/http#"),this.ns.httph=S("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=S("http://www.w3.org/ns/ldp#"),this.ns.rdf=S("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=S("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=S("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=S("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}patchControlFor(e){return this.patchControl[e.value]||(this.patchControl[e.value]=[]),this.patchControl[e.value]}isHttpUri(e){return"http"===e.slice(0,4)}editable(e,t){if(!e)return!1;if(t||(t=this.store),e=(0,mt._)(e),!this.isHttpUri(e)&&t.holds(this.store.rdfFactory.namedNode(e),this.store.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.store.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";for(var r,n,i=!1,o=t.each(void 0,this.ns.link("requestedURI"),(0,x.docpart)(e)),s=0;s<o.length;s++)if(void 0!==(r=o[s])){var a=t.any(r,this.ns.link("response"));if(void 0!==r){var l=t.anyValue(a,this.ns.httph("wac-allow"));if(l)for(var c of l.split(",")){var u=c.split("=");if(u[0].includes("user")&&!u[1].includes("write")&&!u[1].includes("append"))return!1}var h=t.each(a,this.ns.httph("accept-patch"));if(h.length)for(let e=0;e<h.length;e++){if((n=h[e].value.trim()).indexOf("application/sparql-update")>=0)return"SPARQL";if(n.indexOf("application/sparql-update-single-match")>=0)return"SPARQL"}var d=t.each(a,this.ns.httph("ms-author-via"));if(d.length)for(let e=0;e<d.length;e++){if((n=d[e].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(n.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(e))return!!l&&"LOCALFILE";var p=t.each(a,this.ns.http("status"));if(p.length)for(let e=0;e<p.length;e++)200!==p[e]&&404!==p[e]||(i=!0)}}if(0===o.length);else if(i)return!1}anonymize(e){return"_:"===e.toNT().substr(0,2)&&this.mentioned(e)?"?"+e.toNT().substr(2):e.toNT()}anonymizeNT(e){return this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" ."}nTriples(e){return`${e.subject.toNT()} ${e.predicate.toNT()} ${e.object.toNT()} .`}statementBnodes(e){return[e.subject,e.predicate,e.object].filter((function(e){return(0,c.B2)(e)}))}statementArrayBnodes(e){var t=[];for(let r=0;r<e.length;r++)t=t.concat(this.statementBnodes(e[r]));t.sort();var r=[];for(let e=0;e<t.length;e++)0!==e&&t[e].equals(t[e-1])||r.push(t[e]);return r}cacheIfps(){this.ifps={};var e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty"));for(let t=0;t<e.length;t++)this.ifps[e[t].value]=!0;this.fps={},e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(let t=0;t<e.length;t++)this.fps[e[t].value]=!0}bnodeContext2(e,t,r){var n,i,o=this.store.statementsMatching(void 0,void 0,e,t);for(let e=0;e<o.length;e++)if(this.fps[o[e].predicate.value]){if(!(n=o[e].subject).isBlank)return[o[e]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[e]])}o=this.store.statementsMatching(e,void 0,void 0,t);for(let e=0;e<o.length;e++)if(this.ifps[o[e].predicate.value]){if(!(n=o[e].object).isBlank)return[o[e]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[e]])}return null}bnodeContext1(e,t){for(var r=0;r<3;r++){var n=this.bnodeContext2(e,t,r);if(null!==n)return n}return this.store.connectedStatements(e,t)}mentioned(e){return 0!==this.store.statementsMatching(e,null,null,null).length||0!==this.store.statementsMatching(null,e).length||0!==this.store.statementsMatching(null,null,e).length}bnodeContext(e,t){var r=[];if(e.length){this.cacheIfps();for(let i=0;i<e.length;i++){var n=e[i];this.mentioned(n)&&(r=r.concat(this.bnodeContext1(n,t)))}}return r}statementContext(e){var t=this.statementBnodes(e);return this.bnodeContext(t,e.graph)}contextWhere(e){var t=this;return e&&0!==e.length?"WHERE { "+e.map((function(e){return t.anonymizeNT(e)})).join("\n")+" }\n":""}fire(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((()=>{if(!e)throw new Error("No URI given for remote editing operation: "+t);return n.noMeta=!0,n.contentType="application/sparql-update",n.body=t,this.store.fetcher.webOperation("PATCH",e,n)})).then((n=>{if(!n.ok){let r="UpdateManager: update failed for <"+e+"> status="+n.status+", "+n.statusText+"\n for query: "+t;throw new Error(r)}r(e,n.ok,n.responseText,n)})).catch((t=>{r(e,!1,t.message,t)}))}update_statement(e){if(!e||e.graph){var t=this,r=this.statementContext(e);return{statement:e?[e.subject,e.predicate,e.object,e.graph]:void 0,statementNT:e?this.anonymizeNT(e):void 0,where:t.contextWhere(r),set_object:function(e,r){var n=this.where;n+="DELETE DATA { "+this.statementNT+" } ;\n",n+="INSERT DATA { "+this.anonymize(this.statement[0])+" "+this.anonymize(this.statement[1])+" "+this.anonymize(e)+" . }\n",t.fire(this.statement[3].value,n,r)}}}}insert_statement(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){var i="";for(let t=0;t<e.length;t++)i+=e[t]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}delete_statement(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){var i="";for(let t=0;t<e.length;t++)i+=e[t]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}requestDownstreamAction(e,t){var r=this.patchControlFor(e);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+t)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=t;else t(e)}clearUpstreamCount(e){this.patchControlFor(e).upstreamCount=0}getUpdatesVia(e){var t=this.store.fetcher.getHeader(e,"updates-via");return t&&t.length?t[0].trim():null}addDownstreamChangeListener(e,t){var r=this.patchControlFor(e);r.downstreamChangeListeners||(r.downstreamChangeListeners=[]),r.downstreamChangeListeners.push(t),this.setRefreshHandler(e,(e=>{this.reloadAndSync(e)}))}reloadAndSync(e){var t=this.patchControlFor(e),r=this;if(t.reloading)t.outOfDate=!0;else{t.reloading=!0;var n=1e3,i=function(){r.reload(r.store,e,(function(e,r,o){if(e){if(t.downstreamChangeListeners)for(let e=0;e<t.downstreamChangeListeners.length;e++)t.downstreamChangeListeners[e]();t.reloading=!1,t.outOfDate&&(t.outOfDate=!1,i())}else t.reloading=!1,0===o.status&&(t.reloading=!0,setTimeout(i,n*=2))}))};i()}}setRefreshHandler(e,t){let r=this.getUpdatesVia(e);var n=t,i=this,o=this,s=1500,a=0;if(!r)return!1;r=(0,x.join)(r,e.value);const l=r.replace(/^http:/,"ws:").replace(/^https:/,"wss:");var c=function(){var t;if("undefined"!=typeof WebSocket)t=new WebSocket(l);else{if("undefined"==typeof window||!window.WebSocket)return;t=window.WebSocket(l)}t.onopen=function(){s=1500,this.send("sub "+e.value),a&&o.requestDownstreamAction(e,n)};var r=i.patchControlFor(e);r.upstreamCount=0,t.onerror=function(e){},t.onclose=function(e){s*=2,a+=1,setTimeout((function(){c()}),s)},t.onmessage=function(t){if(t.data&&"pub"===t.data.slice(0,3)){if("upstreamCount"in r&&(r.upstreamCount-=1,r.upstreamCount>=0))return;r.upstreamCount=0,i.requestDownstreamAction(e,n)}}};return c(),!0}updateMany(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=e.concat(t).map((e=>e.why)),n=this,i=[];r.forEach((e=>{i.find((t=>t.equals(e)))||i.push(e)}));const o=i.map((r=>n.update(e.filter((e=>e.why.equals(r))),t.filter((e=>e.why.equals(r))))));return o.length,Promise.all(o)}update(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!r){var o=this;return new Promise((function(r,s){o.update(e,t,(function(e,t,n){t?r():s(new Error(n))}),n,i)}))}try{var s=this.store,a=e?(0,c.Pv)(e)?e.statements:e instanceof Array?e:[e]:[],l=t?(0,c.Pv)(t)?t.statements:t instanceof Array?t:[t]:[];if(!(a instanceof Array))throw new Error("Type Error "+typeof a+": "+a);if(!(l instanceof Array))throw new Error("Type Error "+typeof l+": "+l);if(0===a.length&&0===l.length)return r(null,!0);var u=a.length?a[0].graph:l[0].graph;if(!u){let e="Error patching: statement does not specify which document to patch:"+a[0]+", "+l[0];throw new Error(e)}var h=this.patchControlFor(u),d=Date.now(),p=["subject","predicate","object","why"],f={delete:a,insert:l};["insert","delete"].map((function(e){f[e].map((function(e){if(!u.equals(e.graph))throw new Error("update: destination "+u+" inconsistent with delete quad "+e.graph);p.map((function(t){if(void 0===e[t])throw new Error("update: undefined "+t+" of statement.")}))}))}));var g=this.editable(u.value,s);if(!1===g)throw new Error("Update: Can't make changes in uneditable "+u);if(void 0===g){if(n)throw new Error("Update: Loaded "+u+"but stil can't figure out what editing protcol it supports.");return void this.store.fetcher.load(u).then((n=>{this.update(e,t,r,!0,i)}),(n=>{if(404!==n.response.status)throw new Error(`Update: Can't get updatability status ${u} before patching: ${n}`);this.update(e,t,r,!0,i)}))}if(g.indexOf("SPARQL")>=0){var y=[];a.length&&(y=this.statementArrayBnodes(a)),l.length&&(y=y.concat(this.statementArrayBnodes(l)));var m=this.bnodeContext(y,u),v=this.contextWhere(m),b="";if(v.length){if(a.length){b+="DELETE { ";for(let e=0;e<a.length;e++)b+=this.anonymizeNT(a[e])+"\n";b+=" }\n"}if(l.length){b+="INSERT { ";for(let e=0;e<l.length;e++)b+=this.anonymizeNT(l[e])+"\n";b+=" }\n"}b+=v}else{if(a.length){b+="DELETE DATA { ";for(let e=0;e<a.length;e++)b+=this.anonymizeNT(a[e])+"\n";b+=" } \n"}if(l.length){a.length&&(b+=" ; "),b+="INSERT DATA { ";for(let e=0;e<l.length;e++)b+=this.nTriples(l[e])+"\n";b+=" }\n"}}h.pendingUpstream=h.pendingUpstream?h.pendingUpstream+1:1,"upstreamCount"in h&&(h.upstreamCount+=1),this.fire(u.value,b,((e,t,n,i)=>{if(i.elapsedTimeMs=Date.now()-d,t){try{s.remove(a)}catch(e){t=!1,n="Remote Ok BUT error deleting "+a.length+" from store!!! "+e}for(let e=0;e<l.length;e++)s.add(l[e].subject,l[e].predicate,l[e].object,u)}if(r(e,t,n,i),h.pendingUpstream-=1,0===h.pendingUpstream&&h.downstreamAction){var o=h.downstreamAction;delete h.downstreamAction,o(u)}}),i)}else if(g.indexOf("DAV")>=0)this.updateDav(u,a,l,r,i);else{if(!(g.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+g+"' for "+u);try{this.updateLocalFile(u,a,l,r,i)}catch(e){r(u.value,!1,"Exception trying to write back file <"+u.value+">\n")}}}catch(e){r(void 0,!1,"Exception in update: "+e+"\n"+I.stackString(e))}}updateDav(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store;var s=o.any(e,this.ns.link("request"));if(!s)throw new Error("No record of our HTTP GET request for document: "+e);var a=o.any(s,this.ns.link("response"));if(!a)return null;var l=o.the(a,this.ns.httph("content-type")).value;let c=o.statementsMatching(void 0,void 0,void 0,e).slice();for(let e=0;e<t.length;e++)I.RDFArrayRemove(c,t[e]);for(let e=0;e<r.length;e++)c.push(r[e]);const u=this.serialize(e.value,c,l);var h,d=o.the(a,this.ns.httph("content-location"));return d&&(h=(0,x.join)(d.value,h)),i.contentType=l,i.noMeta=!0,i.body=u,o.fetcher.webOperation("PUT",h,i).then((i=>{if(!i.ok)throw new Error(i.error);for(let e=0;e<t.length;e++)o.remove(t[e]);for(let t=0;t<r.length;t++)o.add(r[t].subject,r[t].predicate,r[t].object,e);n(e.value,i.ok,i.responseText,i)})).catch((t=>{n(e.value,!1,t.message,t)}))}updateLocalFile(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=this.store;let s=o.statementsMatching(void 0,void 0,void 0,e).slice();for(let e=0;e<t.length;e++)I.RDFArrayRemove(s,t[e]);for(let e=0;e<r.length;e++)s.push(r[e]);var a=e.value.lastIndexOf(".");if(a<1)throw new Error("Rewriting file: No filename extension: "+e.value);var l=e.value.slice(a+1);let c=Ct.CONTENT_TYPE_BY_EXT[l];if(!c)throw new Error("File extension ."+l+" not supported for data write");i.body=this.serialize(e.value,s,c),i.contentType=c,o.fetcher.webOperation("PUT",e.value,i).then((i=>{if(!i.ok)return n(e.value,!1,i.error);for(let e=0;e<t.length;e++)o.remove(t[e]);for(let t=0;t<r.length;t++)o.add(r[t].subject,r[t].predicate,r[t].object,e);n(e.value,!0,"")}))}serialize(e,t,r){const n=this.store;let i;if("string"==typeof t)return t;var o=D(n);switch(o.suggestNamespaces(n.namespaces),o.setBase(e),r){case"text/xml":case"application/rdf+xml":i=o.statementsToXML(t);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":i=o.statementsToN3(t);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return i}put(e,t,r,n){const i=this.store;let o;return Promise.resolve().then((()=>(o=this.serialize(e.value,t,r),i.fetcher.webOperation("PUT",e.value,{contentType:r,body:o})))).then((r=>{if(!r.ok)return n(e.value,r.ok,r.error,r);delete i.fetcher.nonexistent[e.value],delete i.fetcher.requested[e.value],"string"!=typeof t&&t.map((e=>{i.addStatement(e)})),n(e.value,r.ok,"",r)})).catch((t=>{n(e.value,!1,t.message)}))}reload(e,t,r){var n=Date.now();e.fetcher.nowOrWhenFetched(t.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(e,i,o){if(e)if(o.onErrorWasCalled||200!==o.status)r(!1,"Non-HTTP error reloading data: "+i,o);else{var s=Date.now()-n;t.reloadTimeTotal||(t.reloadTimeTotal=0),t.reloadTimeCount||(t.reloadTimeCount=0),t.reloadTimeTotal+=s,t.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,o)}))}}const Ft={...Ee,fetcher:(e,t)=>new Ct(e,t),graph(){return new ee(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,(arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)||{rdfFactory:Ee})},lit(e,t,r){return this.literal(""+e,t||r)},st(e,t,r,n){return this.quad(e,t,r,n)}},Ut=Ft;class Bt{constructor(e,t){this.parent=e,this.via=t,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(t),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(e){this.onError(e)}}_decode(e){var t,r,n,i,o,s,a;for(r in i={},o=function(){var r,n,i,o;for(o=[],r=0,n=(i=e.split("&")).length;r<n;r++)t=i[r],o.push(t.split("="));return o}())t=o[r],a=(s=[decodeURIComponent(t[0]),decodeURIComponent(t[1])])[1],null==i[n=s[0]]&&(i[n]=[]),i[n].push(a);return i}_send(e,t,r){var n,i;return i=[e,t,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}_subscribe(e){return this._send("sub",e,""),this.subscribed[e]=!0,this.subscribed[e]}onClose(e){var t;for(t in this.connected=!1,this.subscribed)this.pending[t]=!0;return this.subscribed={},this.subscribed}onError(e){throw new Error("onError"+e)}onMessage(e){var t,r;return"ping"===(r=e.data.split(" "))[0]?"function"==typeof(t=this.socket).send?t.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}onOpen(e){var t,r;for(r in this.connected=!0,t=[],this.pending)delete this.pending[r],t.push(this._subscribe(r));return t}subscribe(e){return this.connected?this._subscribe(e):(this.pending[e]=!0,this.pending[e])}}class qt{constructor(e){this.fetcher=e,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}onHeaders(e){var t,r,n;return null==e.headers||"undefined"==typeof WebSocket||null===WebSocket||(t=e.headers.etag,n=e.headers["updates-via"],r=e.uri,t&&n&&(this.graph[r]={etag:t,via:n},this.register(n,r))),!0}onUpdate(e,t){return this.fetcher.refresh(Ut.namedNode(e))}register(e,t){return null==this.via[e]&&(this.via[e]=new Bt(this,e)),this.via[e].subscribe(t)}}const Ht={};for(const e in Ut)"function"==typeof Ut[e]&&(Ht[e]=Ut[e].bind(Ut));const{fetcher:Zt,graph:$t,lit:zt,st:Vt,namedNode:Gt,variable:Jt,blankNode:Xt,defaultGraph:Wt,literal:Qt,quad:Yt,triple:Kt}=Ht,er=new $,tr=e=>er.fromNT(e),rr=z.fromValue,nr=a.nextId;class ir extends ee{constructor(t){super(t),(0,e.Z)(this,"fetcher",void 0),this.fetcher=new Ct(this,{})}}class or extends ir{constructor(t){super(t),(0,e.Z)(this,"updater",void 0),this.updater=new Mt(this)}}})(),i})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("window")):"function"==typeof define&&define.amd?define(["window"],t):"object"==typeof exports?exports.$rdf=t(require("window")):e.$rdf=t(e.window)}(self,(e=>(()=>{var t={8333:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},7308:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={debug(e){},warn(e){},info(e){},error(e){},success(e){},msg(e){}}},6545:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(240),i=r(8333),o=r(4806),s=r(9247),a=r(2598),l=r(5904);class c extends o.Z{constructor(e){if(super((0,a._)(e)),(0,n.Z)(this,"termType",s.XM),(0,n.Z)(this,"classOrder",i.Z.NamedNode),!this.value)throw new Error("Missing IRI for NamedNode");if(!this.value.includes(":"))throw new Error('NamedNode IRI "'+e+'" must be absolute.');if(this.value.includes(" "))throw new Error('Error: NamedNode IRI "'+e+'" must not contain unencoded spaces.')}dir(){var e=this.value.split("#")[0],t=e.slice(0,-1).lastIndexOf("/"),r=e.indexOf("//");return r>=0&&t<r+2||t<0?null:new c(e.slice(0,t+1))}site(){var e=this.value.split("#")[0],t=e.indexOf("//");if(t<0)throw new Error("This URI does not have a web site part (origin)");var r=e.indexOf("/",t+2);return new c(r<0?e.slice(0)+"/":e.slice(0,r+1))}doc(){return this.value.indexOf("#")<0?this:new c(this.value.split("#")[0])}toString(){return"<"+this.value+">"}id(){return this.value.split("#")[1]}get uri(){return this.value}set uri(e){this.value=e}static fromValue(e){return null==e||(0,l.jt)(e)?e:new c(e)}}},4806:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(240),i=r(292);class o{constructor(e){(0,n.Z)(this,"termType",void 0),(0,n.Z)(this,"classOrder",void 0),(0,n.Z)(this,"value",void 0),this.value=e}substitute(e){return i.log("@@@ node substitute"+this),this}compareTerm(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.value<e.value?-1:this.value>e.value?1:0}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value}hashString(){return this.toCanonical()}sameTerm(e){return this.equals(e)}toCanonical(){return this.toNT()}toNT(){return this.toString()}toNQ(){return this.toNT()}toString(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}(0,n.Z)(o,"fromValue",void 0),(0,n.Z)(o,"toJS",void 0)},9247:(e,t,r)=>{"use strict";r.d(t,{D7:()=>j,Eo:()=>_,Is:()=>v,NK:()=>a,UH:()=>s,V1:()=>i,XM:()=>n,_A:()=>u,aV:()=>m,b4:()=>y,fb:()=>l,lL:()=>g,ls:()=>c,oW:()=>b,qS:()=>f,sZ:()=>p,ui:()=>d,us:()=>h,xH:()=>o,xm:()=>w,z8:()=>x});const n="NamedNode",i="BlankNode",o="Literal",s="Variable",a="DefaultGraph",l="Collection",c="Empty",u="Graph",h="text/html",d="application/ld+json",f="text/n3",p="application/n3",g="application/nquads",y="application/n-quads",m="application/n-triples",v="application/rdf+xml",b="application/sparql-update",w="application/sparql-update-single-match",x="text/turtle",_="application/x-turtle",j="application/xhtml+xml"},3357:(e,t,r)=>{"use strict";r.r(t),r.d(t,{docpart:()=>s,document:()=>a,hostpart:()=>l,join:()=>c,protocol:()=>u,refTo:()=>h});var n=r(6545),i=r(292),o=o||i.log;function s(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}function a(e){return new n.Z(s(e))}function l(e){var t=/[^\/]*\/\/([^\/]*)\//.exec(e);return t?t[1]:""}function c(e,t){var r,n,i,s,a,l=t.indexOf("#");if(l>0&&(t=t.slice(0,l)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(e.indexOf(":")>=0)return e;if(r=t.indexOf(":"),0===t.length)return e;if(r<0)return o("Invalid base: "+t+" in join with given: "+e),e;if(n=t.slice(0,+r+1||9e9),0===e.indexOf("//"))return n+e;if(t.indexOf("//",r)===r+1){if((i=t.indexOf("/",r+3))<0)return t.length-r-3>0?t+"/"+e:n+e}else if((i=t.indexOf("/",r+1))<0)return t.length-r-1>0?t+"/"+e:n+e;if(0===e.indexOf("/"))return t.slice(0,i)+e;if((s=(a=t.slice(i)).lastIndexOf("/"))<0)return n+e;for(s>=0&&s<a.length-1&&(a=a.slice(0,+s+1||9e9)),a+=e;a.match(/[^\/]*\/\.\.\//);)a=a.replace(/[^\/]*\/\.\.\//,"");return a=(a=a.replace(/\.\//g,"")).replace(/\/\.$/,"/"),t.slice(0,i)+a}function u(e){const t=e.indexOf(":");return t<0?null:e.slice(0,t)}function h(e,t){var r,n,i,o,s,a,l,c,u,h,d,f,p=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!e)return t;if(e===t)return"";for(r=l=0,o=t.length;l<o&&t[r]===e[r];r=++l);if(e.slice(0,r).match(p)&&((n=t.indexOf("//"))<0&&(n=-2),i=t.indexOf("/",n+2),"/"!==t[i+1]&&"/"!==e[i+1]&&t.slice(0,i)===e.slice(0,i)))return t.slice(i);if("#"===t[r]&&e.length===r)return t.slice(r);for(;r>0&&"/"!==t[r-1];)r--;if(r<3)return t;if(e.indexOf("//",r-2)>0||t.indexOf("//",r-2)>0)return t;if(e.indexOf(":",r)>0)return t;for(a=0,c=0,s=(h=e.slice(r)).length;c<s;c++)"/"===h[c]&&a++;if(0===a&&r<t.length&&"#"===t[r])return"./"+t.slice(r);if(0===a&&r===t.length)return"./";if(f="",a>0)for(u=1,d=a;d>=1?u<=d:u>=d;d>=1?++u:--u)f+="../";return f+t.slice(r)}},5115:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DOMParserFactory:()=>d,RDFArrayRemove:()=>w,callbackify:()=>h,domToString:()=>f,dtstamp:()=>g,dumpNode:()=>p,heavyCompare:()=>y,heavyCompareSPO:()=>m,linkRelationProperty:()=>u,log:()=>n.Z,mediaTypeClass:()=>c,output:()=>v,parseXML:()=>b,stackString:()=>_,string:()=>l,string_startswith:()=>x,uri:()=>i});var n=r(7308),i=r(3357),o=r(6545),s=r(870);e=r.hmd(e);var a=r(292);const l={template:function(e,t){for(var r=e.split("%s"),n="",i=0;i<t.length;i++)t[i]+="",n+=r[i]+t[i];return n+r.slice(t.length).join()}};function c(e){return e=e.split(";")[0].trim(),new o.Z("http://www.w3.org/ns/iana/media-types/"+e+"#Resource")}function u(e){return new o.Z("http://www.w3.org/ns/iana/link-relations/relation#"+e.trim())}function h(e,t){e.callbacks={};for(var r=t.length-1;r>=0;r--)e.callbacks[t[r]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,r){e.callbacks[t].push(r)},e.removeCallback=function(t,r){for(var n=0;n<e.callbacks[t].length;n++)if(e.callbacks[t][n].name===r)return e.callbacks[t].splice(n,1),!0;return!1},e.insertCallback=function(t,r){e.callbacks[t].unshift(r)},e.fireCallbacks=function(t,r){var n,i=[],o=[],s=e.callbacks[t].length;let a;for(n=s-1;n>=0;n--)a=e.callbacks[t][n],a&&a.apply(e,r)&&i.push(a);for(n=i.length-1;n>=0;n--)o.push(i[n]);for(n=s;n<e.callbacks[t].length;n++)o.push(e.callbacks[t][n]);e.callbacks[t]=o}}function d(){return window.DOMParser?new s.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function f(e,t){var r=[];(t=t||{})&&t.selfClosing&&t.selfClosing.split(" ").forEach((function(e){r[e]=!0}));var n=[];return t&&t.skipAttributes&&t.skipAttributes.split(" ").forEach((function(e){n[e]=!0})),p(e,t,r,n)}function p(e,t,r,n){var i,o="",s=[!1];if(void 0===e.nodeType)return o;if(1===e.nodeType){if(e.hasAttribute("class")&&t&&t.classWithChildText&&e.matches(t.classWithChildText.class))o+=e.querySelector(t.classWithChildText.element).textContent;else if(!(t&&t.skipNodeWithClass&&e.matches("."+t.skipNodeWithClass))){var l=e.nodeName.toLowerCase();o+="<"+l;var c=[];for(i=e.attributes.length-1;i>=0;i--){var u=e.attributes[i];if(!(n&&n.length>0&&n[u.name]||/^\d+$/.test(u.name))){if("class"===u.name&&t&&t.replaceClassItemWith&&u.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var h=new RegExp(t.replaceClassItemWith.source,"g");u.value=u.value.replace(h,t.replaceClassItemWith.target).trim()}"class"===u.name&&t&&t.skipClassWithValue&&t.skipClassWithValue===u.value||c.push(u.name+"='"+u.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,""")+"'")}}if(c.length>0&&(t&&t.sortAttributes&&c.sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),o+=" "+c.join(" ")),r&&r.ename)o+=" />";else{for(o+=">",o+="html"===l?"\n ":"",s.push("style"===l||"script"===l),i=0;i<e.childNodes.length;i++)o+=p(e.childNodes[i]);s.pop(),o+="body"===l?"</"+l+">\n":"</"+l+">"}}}else if(8===e.nodeType)o+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var d=e.nodeValue.replace(/\n+$/,"");o+=s[s.length-1]?d:d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}else a.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),a.log(e);return o}function g(){var e=new Date,t=e.getYear()+1900,r=e.getMonth()+1,n=e.getDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),s=e.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),o<10&&(o="0"+o),s<10&&(s="0"+s),t+"-"+r+"-"+n+"T"+i+":"+o+":"+s+"Z"}function y(e,t,r,n){var i=function(e){return"BlankNode"===e.termType?null:e},o=function(e){var t=r.statementsMatching(e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})).concat(r.statementsMatching(void 0,void 0,e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})));return t.sort(),t.join("\n")};const s=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(e,t):e.compareTerm(t);return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===s?0:o(e)>o(t)?1:o(e)<o(t)?-1:s:n&&e.uri&&t.uri?(n[e.uri]||e.uri).localeCompare(n[t.uri]||t.uri):s}function m(e,t,r,n){return y(e.subject,t.subject,r,n)||y(e.predicate,t.predicate,r,n)||y(e.object,t.object,r,n)}function v(e){var t=document.createElement("div");t.textContent=e,document.body.appendChild(t)}function b(t,r){return r=r||{},e&&e.exports?(new s.DOMParser).parseFromString(t,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new s.DOMParser).parseFromString(t,"application/xml")}function w(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.why))return void e.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+t+" "+t.why)}function x(e,t){return e.slice(0,t.length)===t}function _(e){var t=e+"\n";if(!e.stack)return t+"No stack available.\n";for(var r=e.stack.toString().split("\n"),n=[],i=0;i<r.length;i++){var o=r[i];if(o.indexOf("ecmaunit.js")>-1)break;"("==o.charAt(0)&&(o="function"+o);var s=o.split("@");n.push(s)}for(i=0;i<n.length;i++)t+=" "+n[i][1]+"\n "+n[i][0];return t}},2598:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?e:e.value}r.d(t,{_:()=>n})},5904:(e,t,r)=>{"use strict";r.d(t,{B2:()=>g,NA:()=>b,NX:()=>p,PY:()=>f,Pv:()=>o,Uc:()=>a,Yi:()=>i,cG:()=>u,f:()=>l,jt:()=>h,lt:()=>v,lx:()=>m,n_:()=>d,nq:()=>c,uZ:()=>s,zz:()=>y});var n=r(9247);function i(e){return"object"==typeof e&&null!==e&&"subject"in e}function o(e){return"object"==typeof e&&null!==e&&"statements"in e}function s(e){return h(e)&&e.termType===n.fb}function a(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.fb||e.termType===n.xH||e.termType===n._A)}function l(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.fb||e.termType===n.xH||e.termType===n._A)}function c(e){return h(e)&&(e.termType===n.XM||e.termType===n.V1||e.termType===n.UH)}function u(e){return h(e)&&e.termType===n.UH}function h(e){return"object"==typeof e&&null!==e&&"termType"in e}function d(e){return e.termType===n.xH}function f(e){return"object"==typeof e&&null!==e&&"subject"in e&&"predicate"in e&&"object"in e}function p(e){return h(e)&&"NamedNode"===e.termType}function g(e){return h(e)&&"termType"in e&&"BlankNode"===e.termType}function y(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1)}function m(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH)}function v(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.xH)}function b(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.NK)}},5619:function(e,t,r){var n;void 0===(n=function(){"use strict";function e(t,r,n,i){this.message=t,this.expected=r,this.found=n,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t,r="";for(t=0;t<e.parts.length;t++)r+=e.parts[t]instanceof Array?o(e.parts[t][0])+"-"+o(e.parts[t][1]):o(e.parts[t]);return"["+(e.inverted?"^":"")+r+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}return"Expected "+function(e){var t,n,i,o=new Array(e.length);for(t=0;t<e.length;t++)o[t]=(i=e[t],r[i.type](i));if(o.sort(),o.length>0){for(t=1,n=1;t<o.length;t++)o[t-1]!==o[t]&&(o[n]=o[t],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,n){n=void 0!==n?n:{};var i,o={},s={turtleDoc:Pt},a=Pt,l=".",c=Rt(".",!1),u=Rt("#",!1),h=/^[^\n]/,d=kt(["\n"],!0,!1),f=Rt("\n",!1),p=function(e){return e.join("")},g="@prefix",y=Rt("@prefix",!1),m=function(e,t){return hr.addPrefix(""===e?"0":e,t),{}},v="@base",b=Rt("@base",!1),w=function(e){return hr.addBase(e),{}},x=/^[Bb]/,_=kt(["B","b"],!1,!1),j=/^[Aa]/,T=kt(["A","a"],!1,!1),N=/^[Ss]/,A=kt(["S","s"],!1,!1),E=/^[Ee]/,O=kt(["E","e"],!1,!1),S=/^[Pp]/,I=kt(["P","p"],!1,!1),R=/^[Rr]/,k=kt(["R","r"],!1,!1),C=/^[Ff]/,D=kt(["F","f"],!1,!1),L=/^[Ii]/,P=kt(["I","i"],!1,!1),F=/^[Xx]/,M=kt(["X","x"],!1,!1),U=Rt(";",!1),B=function(e,t,r,n){var i={};return i[r]=n,i},q=function(e,t,r){return r},H=Rt(",",!1),Z=function(e,t){return t},$=Rt("a",!1),z=Rt("[",!1),V=Rt("]",!1),X=Rt("(",!1),J=Rt(")",!1),G="^^",W=Rt("^^",!1),Q="true",Y=Rt("true",!1),K="false",ee=Rt("false",!1),te=Rt("<",!1),re=/^[^\0- <>"{}|\^`\\]/,ne=kt([["\0"," "],"<",">",'"',"{","}","|","^","`","\\"],!0,!1),ie=Rt(">",!1),oe=":",se=Rt(":",!1),ae="_:",le=Rt("_:",!1),ce=/^[0-9]/,ue=kt([["0","9"]],!1,!1),he=Rt("@",!1),de=/^[a-zA-Z]/,fe=kt([["a","z"],["A","Z"]],!1,!1),pe="-",ge=Rt("-",!1),ye=/^[a-zA-Z0-9]/,me=kt([["a","z"],["A","Z"],["0","9"]],!1,!1),ve=function(e,t){return"-"+t.join("")},be=/^[+\-]/,we=kt(["+","-"],!1,!1),xe=/^[eE]/,_e=kt(["e","E"],!1,!1),je='"',Te=Rt('"',!1),Ne=/^[^"\\\n\r]/,Ae=kt(['"',"\\","\n","\r"],!0,!1),Ee="'",Oe=Rt("'",!1),Se=/^[^'\\\n\r]/,Ie=kt(["'","\\","\n","\r"],!0,!1),Re="'''",ke=Rt("'''",!1),Ce=/^[^'\\]/,De=kt(["'","\\"],!0,!1),Le="''",Pe=Rt("''",!1),Fe=function(e,t){return"''"+t.join("")},Me=function(e,t){return"'"+t.join("")},Ue=function(e,t){return e.join("")+t.join("")},Be='"""',qe=Rt('"""',!1),He=/^[^"\\]/,Ze=kt(['"',"\\"],!0,!1),$e='""',ze=Rt('""',!1),Ve=function(e,t){return'""'+t.join("")},Xe=function(e,t){return'"'+t.join("")},Je=Rt("\\U",!1),Ge=Rt("\\u",!1),We=Rt("\\t",!1),Qe=Rt("\\b",!1),Ye=Rt("\\n",!1),Ke=Rt("\\r",!1),et=Rt("\\f",!1),tt=Rt('\\"',!1),rt=Rt("\\'",!1),nt=Rt("\\\\",!1),it=/^[ \t\r\n]/,ot=kt([" ","\t","\r","\n"],!1,!1),st=/^[\uD800-\uDBFF]/,at=kt([["\ud800","\udbff"]],!1,!1),lt=/^[\uDC00-\uDFFF]/,ct=kt([["\udc00","\udfff"]],!1,!1),ut=/^[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]/,ht=kt([["A","Z"],["a","z"],["À","Ö"],["Ø","ö"],["ø","˿"],["Ͱ","ͽ"],["Ϳ",""],["",""],["⁰",""],["Ⰰ",""],["、",""],["豈","﷏"],["ﷰ","�"]],!1,!1),dt=Rt("_",!1),ft=Rt("·",!1),pt=/^[\u0300-\u036F]/,gt=kt([["̀","ͯ"]],!1,!1),yt=/^[\u203F-\u2040]/,mt=kt([["‿","⁀"]],!1,!1),vt=function(e,t,r,n){return r.join("")+n.join("")},bt=Rt("%",!1),wt=/^[0-9A-Fa-f]/,xt=kt([["0","9"],["A","F"],["a","f"]],!1,!1),_t=Rt("\\",!1),jt=/^[_~.!$&'()*+,;=\/?#@%\-]/,Tt=kt(["_","~",".","!","$","&","'","(",")","*","+",",",";","=","/","?","#","@","%","-"],!1,!1),Nt=0,At=0,Et=[{line:1,column:1}],Ot=0,St=[];if("startRule"in n){if(!(n.startRule in s))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=s[n.startRule]}function It(t,r){throw function(t,r){return new e(t,null,null,r)}(t,r=void 0!==r?r:Dt(At,Nt))}function Rt(e,t){return{type:"literal",text:e,ignoreCase:t}}function kt(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Ct(e){var r,n=Et[e];if(n)return n;for(r=e-1;!Et[r];)r--;for(n={line:(n=Et[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Et[e]=n,n}function Dt(e,t){var r=Ct(e),n=Ct(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function Lt(e){Nt<Ot||(Nt>Ot&&(Ot=Nt,St=[]),St.push(e))}function Pt(){var e,t,r,n,i,s;for(e=Nt,t=[],r=Ft();r!==o;)t.push(r),r=Ft();if(t!==o){for(r=[],n=Mt();n!==o;)r.push(n),n=Mt();r!==o?(At=e,i=t,(s=hr.toJSON())["@graph"]=[],i.filter((e=>Array.isArray(e))).forEach((e=>{e.forEach((e=>{s["@graph"].push(e)}))})),1===s["@graph"].length&&(Object.assign(s,s["@graph"][0]),delete s["@graph"]),e=t=s):(Nt=e,e=o)}else Nt=e,e=o;return e}function Ft(){var e,r,n,i;if((e=function(){var e;return(e=function(){var e,r,n,i,s,a,u,h,d;for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if(t.substr(Nt,7)===g?(n=g,Nt+=7):(n=o,Lt(y)),n!==o){for(i=[],s=Mt();s!==o;)i.push(s),s=Mt();if(i!==o)if((s=Wt())!==o){for(a=[],u=Mt();u!==o;)a.push(u),u=Mt();if(a!==o)if((u=Jt())!==o){for(h=[],d=Mt();d!==o;)h.push(d),d=Mt();h!==o?(46===t.charCodeAt(Nt)?(d=l,Nt++):(d=o,Lt(c)),d!==o?(At=e,e=r=m(s,u)):(Nt=e,e=o)):(Nt=e,e=o)}else Nt=e,e=o;else Nt=e,e=o}else Nt=e,e=o;else Nt=e,e=o}else Nt=e,e=o;else Nt=e,e=o;return e}())===o&&(e=function(){var e,r,n,i,s,a,u;for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if(t.substr(Nt,5)===v?(n=v,Nt+=5):(n=o,Lt(b)),n!==o){for(i=[],s=Mt();s!==o;)i.push(s),s=Mt();if(i!==o)if((s=Jt())!==o){for(a=[],u=Mt();u!==o;)a.push(u),u=Mt();a!==o?(46===t.charCodeAt(Nt)?(u=l,Nt++):(u=o,Lt(c)),u!==o?(At=e,e=r=w(s)):(Nt=e,e=o)):(Nt=e,e=o)}else Nt=e,e=o;else Nt=e,e=o}else Nt=e,e=o;else Nt=e,e=o;return e}())===o&&(e=function(){var e,r,n,i,s,a,l,c,u,h,d,f;for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if(S.test(t.charAt(Nt))?(n=t.charAt(Nt),Nt++):(n=o,Lt(I)),n!==o)if(R.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(k)),i!==o)if(E.test(t.charAt(Nt))?(s=t.charAt(Nt),Nt++):(s=o,Lt(O)),s!==o)if(C.test(t.charAt(Nt))?(a=t.charAt(Nt),Nt++):(a=o,Lt(D)),a!==o)if(L.test(t.charAt(Nt))?(l=t.charAt(Nt),Nt++):(l=o,Lt(P)),l!==o)if(F.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(M)),c!==o){for(u=[],h=Mt();h!==o;)u.push(h),h=Mt();if(u!==o)if((h=Wt())!==o){for(d=[],f=Mt();f!==o;)d.push(f),f=Mt();d!==o&&(f=Jt())!==o?(At=e,e=r=m(h,f)):(Nt=e,e=o)}else Nt=e,e=o;else Nt=e,e=o}else Nt=e,e=o;else Nt=e,e=o;else Nt=e,e=o;else Nt=e,e=o;else Nt=e,e=o;else Nt=e,e=o;else Nt=e,e=o;return e}())===o&&(e=function(){var e,r,n,i,s,a,l,c;for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if(x.test(t.charAt(Nt))?(n=t.charAt(Nt),Nt++):(n=o,Lt(_)),n!==o)if(j.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(T)),i!==o)if(N.test(t.charAt(Nt))?(s=t.charAt(Nt),Nt++):(s=o,Lt(A)),s!==o)if(E.test(t.charAt(Nt))?(a=t.charAt(Nt),Nt++):(a=o,Lt(O)),a!==o){for(l=[],c=Mt();c!==o;)l.push(c),c=Mt();l!==o&&(c=Jt())!==o?(At=e,e=r=w(c)):(Nt=e,e=o)}else Nt=e,e=o;else Nt=e,e=o;else Nt=e,e=o;else Nt=e,e=o;else Nt=e,e=o;return e}()),e}())===o)if(e=Nt,(r=function(){var e,t,r;return e=Nt,(t=function(){var e,t;return e=Nt,(t=$t())!==o&&(At=e,r=t,t=dr(r,!0)),(e=t)===o&&(e=Xt())===o&&(e=Vt()),e;var r}())!==o&&(r=Ut())!==o?(At=e,n=t,i=r,s={},"string"==typeof n&&"[]"!==n?s["@id"]=n:"object"==typeof n&&Object.assign(s,n),i&&Object.assign(s,i),e=t=[s]):(Nt=e,e=o),e===o&&(e=Nt,(t=Zt())!==o?((r=Ut())===o&&(r=null),r!==o?(At=e,e=t=function(e,t){var r={};return e&&Object.assign(r,e),t&&Object.assign(r,t),[r]}(t,r)):(Nt=e,e=o)):(Nt=e,e=o)),e;var n,i,s}())!==o){for(n=[],i=Mt();i!==o;)n.push(i),i=Mt();n!==o?(46===t.charCodeAt(Nt)?(i=l,Nt++):(i=o,Lt(c)),i!==o?(At=e,e=r):(Nt=e,e=o)):(Nt=e,e=o)}else Nt=e,e=o;return e}function Mt(){var e;return(e=function(){var e;return it.test(t.charAt(Nt))?(e=t.charAt(Nt),Nt++):(e=o,Lt(ot)),e}())===o&&(e=function(){var e,r,n,i;if(e=Nt,35===t.charCodeAt(Nt)?(r="#",Nt++):(r=o,Lt(u)),r!==o){for(n=[],h.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(d));i!==o;)n.push(i),h.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(d));n!==o?(10===t.charCodeAt(Nt)?(i="\n",Nt++):(i=o,Lt(f)),i!==o?(At=e,e=r=p(n)):(Nt=e,e=o)):(Nt=e,e=o)}else Nt=e,e=o;return e}()),e}function Ut(){var e,r,n,i,s,a,l,c,u,h,d,f,p,g;if(e=Nt,(r=qt())!==o)if((n=Bt())!==o){for(i=[],s=Nt,a=[],l=Mt();l!==o;)a.push(l),l=Mt();for(a!==o?(59===t.charCodeAt(Nt)?(l=";",Nt++):(l=o,Lt(U)),l!==o?(c=Nt,(u=qt())!==o&&(h=Bt())!==o?(At=c,c=u=B(0,0,u,h)):(Nt=c,c=o),c===o&&(c=null),c!==o?(At=s,s=a=q(0,0,c)):(Nt=s,s=o)):(Nt=s,s=o)):(Nt=s,s=o);s!==o;){for(i.push(s),s=Nt,a=[],l=Mt();l!==o;)a.push(l),l=Mt();a!==o?(59===t.charCodeAt(Nt)?(l=";",Nt++):(l=o,Lt(U)),l!==o?(c=Nt,(u=qt())!==o&&(h=Bt())!==o?(At=c,c=u=B(0,0,u,h)):(Nt=c,c=o),c===o&&(c=null),c!==o?(At=s,s=a=q(0,0,c)):(Nt=s,s=o)):(Nt=s,s=o)):(Nt=s,s=o)}i!==o?(At=e,d=r,f=n,g={},(p=i).unshift(function(e,t){var r={};return r[e]=t,r}(d,f)),p.forEach((e=>{e&&Object.keys(e).forEach((t=>{e[t].forEach((e=>{"@type"===t&&void 0!==e["@id"]&&(e=e["@id"]),void 0===g[t]?g[t]=e:Array.isArray(g[t])?g[t].push(e):g[t]=[g[t],e]}))}))})),e=r=g):(Nt=e,e=o)}else Nt=e,e=o;else Nt=e,e=o;return e}function Bt(){var e,r,n,i,s,a,l,c,u;if(e=Nt,(r=Ht())!==o){for(n=[],i=Nt,s=[],a=Mt();a!==o;)s.push(a),a=Mt();for(s!==o?(44===t.charCodeAt(Nt)?(a=",",Nt++):(a=o,Lt(H)),a!==o&&(l=Ht())!==o?(At=i,i=s=Z(0,l)):(Nt=i,i=o)):(Nt=i,i=o);i!==o;){for(n.push(i),i=Nt,s=[],a=Mt();a!==o;)s.push(a),a=Mt();s!==o?(44===t.charCodeAt(Nt)?(a=",",Nt++):(a=o,Lt(H)),a!==o&&(l=Ht())!==o?(At=i,i=s=Z(0,l)):(Nt=i,i=o)):(Nt=i,i=o)}n!==o?(At=e,c=r,(u=n).unshift(c),e=r=u):(Nt=e,e=o)}else Nt=e,e=o;return e}function qt(){var e,r,n;if(e=Nt,(r=function(){var e,t,r;for(e=Nt,t=[],r=Mt();r!==o;)t.push(r),r=Mt();return t!==o&&(r=Vt())!==o?(At=e,e=t=r):(Nt=e,e=o),e}())!==o&&(At=e),(e=r)===o){for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();r!==o?(97===t.charCodeAt(Nt)?(n="a",Nt++):(n=o,Lt($)),n!==o?(At=e,e=r="@type"):(Nt=e,e=o)):(Nt=e,e=o)}return e}function Ht(){var e,r;return(e=function(){var e;return(e=function(){var e,r,n,i,s,a,l;for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if((n=zt())!==o){for(i=[],s=Mt();s!==o;)i.push(s),s=Mt();i!==o&&(s=function(){var e,r,n,i,s,a,l,c;if(e=Nt,64===t.charCodeAt(Nt)?(r="@",Nt++):(r=o,Lt(he)),r!==o){if(n=[],de.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(fe)),i!==o)for(;i!==o;)n.push(i),de.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(fe));else n=o;if(n!==o){if(i=[],s=Nt,45===t.charCodeAt(Nt)?(a=pe,Nt++):(a=o,Lt(ge)),a!==o){if(l=[],ye.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(me)),c!==o)for(;c!==o;)l.push(c),ye.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(me));else l=o;l!==o?(At=s,s=a=ve(0,l)):(Nt=s,s=o)}else Nt=s,s=o;for(;s!==o;)if(i.push(s),s=Nt,45===t.charCodeAt(Nt)?(a=pe,Nt++):(a=o,Lt(ge)),a!==o){if(l=[],ye.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(me)),c!==o)for(;c!==o;)l.push(c),ye.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(me));else l=o;l!==o?(At=s,s=a=ve(0,l)):(Nt=s,s=o)}else Nt=s,s=o;i!==o?(At=e,u=i,e=r=n.join("")+u.join("")):(Nt=e,e=o)}else Nt=e,e=o}else Nt=e,e=o;var u;return e}())!==o?(At=e,e=r={"@value":n,"@language":s}):(Nt=e,e=o)}else Nt=e,e=o;else Nt=e,e=o;if(e===o){for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if((n=zt())!==o){for(i=[],s=Mt();s!==o;)i.push(s),s=Mt();if(i!==o)if(t.substr(Nt,2)===G?(s=G,Nt+=2):(s=o,Lt(W)),s!==o){for(a=[],l=Mt();l!==o;)a.push(l),l=Mt();a!==o&&(l=Vt())!==o?(At=e,e=r=function(e,t){if("http://www.w3.org/2001/XMLSchema#boolean"===t&&"true"===e)return!0;if("http://www.w3.org/2001/XMLSchema#boolean"===t&&"false"===e)return!1;if("http://www.w3.org/2001/XMLSchema#integer"===t)return parseInt(e);if("http://www.w3.org/2001/XMLSchema#double"===t)return parseFloat(e);const r=hr.resolve(t,!0);if(r){const n=t.split(":")[0];if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"true"===e)return hr.decrement(n),!0;if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"false"===e)return hr.decrement(n),!1;if("http://www.w3.org/2001/XMLSchema#integer"===r)return hr.decrement(n),parseInt(e);if("http://www.w3.org/2001/XMLSchema#double"===r)return hr.decrement(n),parseFloat(e)}return{"@value":e,"@type":t}}(n,l)):(Nt=e,e=o)}else Nt=e,e=o;else Nt=e,e=o}else Nt=e,e=o;else Nt=e,e=o;if(e===o){for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();r!==o&&(n=zt())!==o?(At=e,e=r=n):(Nt=e,e=o)}}return e}())===o&&(e=function(){var e,r,n;for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();return r!==o?((n=function(){var e,r,n,i,s,a,u,h,d;if(e=Nt,r=Nt,n=Nt,be.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(we)),i===o&&(i=null),i!==o){if(s=Nt,a=[],ce.test(t.charAt(Nt))?(u=t.charAt(Nt),Nt++):(u=o,Lt(ue)),u!==o)for(;u!==o;)a.push(u),ce.test(t.charAt(Nt))?(u=t.charAt(Nt),Nt++):(u=o,Lt(ue));else a=o;if(a!==o)if(46===t.charCodeAt(Nt)?(u=l,Nt++):(u=o,Lt(c)),u!==o){for(h=[],ce.test(t.charAt(Nt))?(d=t.charAt(Nt),Nt++):(d=o,Lt(ue));d!==o;)h.push(d),ce.test(t.charAt(Nt))?(d=t.charAt(Nt),Nt++):(d=o,Lt(ue));h!==o&&(d=Qt())!==o?s=a=[a,u,h,d]:(Nt=s,s=o)}else Nt=s,s=o;else Nt=s,s=o;if(s===o){if(s=Nt,46===t.charCodeAt(Nt)?(a=l,Nt++):(a=o,Lt(c)),a!==o){if(u=[],ce.test(t.charAt(Nt))?(h=t.charAt(Nt),Nt++):(h=o,Lt(ue)),h!==o)for(;h!==o;)u.push(h),ce.test(t.charAt(Nt))?(h=t.charAt(Nt),Nt++):(h=o,Lt(ue));else u=o;u!==o&&(h=Qt())!==o?s=a=[a,u,h]:(Nt=s,s=o)}else Nt=s,s=o;if(s===o){if(s=Nt,a=[],ce.test(t.charAt(Nt))?(u=t.charAt(Nt),Nt++):(u=o,Lt(ue)),u!==o)for(;u!==o;)a.push(u),ce.test(t.charAt(Nt))?(u=t.charAt(Nt),Nt++):(u=o,Lt(ue));else a=o;a!==o&&(u=Qt())!==o?s=a=[a,u]:(Nt=s,s=o)}}s!==o?n=i=[i,s]:(Nt=n,n=o)}else Nt=n,n=o;return(r=n!==o?t.substring(r,Nt):n)!==o&&(At=e,f=r,r={"@value":f,"@type":"http://www.w3.org/2001/XMLSchema#double"}),r;var f}())===o&&(n=function(){var e,r,n,i,s,a,u,h;if(e=Nt,r=Nt,n=Nt,be.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(we)),i===o&&(i=null),i!==o){for(s=[],ce.test(t.charAt(Nt))?(a=t.charAt(Nt),Nt++):(a=o,Lt(ue));a!==o;)s.push(a),ce.test(t.charAt(Nt))?(a=t.charAt(Nt),Nt++):(a=o,Lt(ue));if(s!==o)if(46===t.charCodeAt(Nt)?(a=l,Nt++):(a=o,Lt(c)),a!==o){if(u=[],ce.test(t.charAt(Nt))?(h=t.charAt(Nt),Nt++):(h=o,Lt(ue)),h!==o)for(;h!==o;)u.push(h),ce.test(t.charAt(Nt))?(h=t.charAt(Nt),Nt++):(h=o,Lt(ue));else u=o;u!==o?n=i=[i,s,a,u]:(Nt=n,n=o)}else Nt=n,n=o;else Nt=n,n=o}else Nt=n,n=o;return(r=n!==o?t.substring(r,Nt):n)!==o&&(At=e,d=r,r={"@value":d,"@type":"http://www.w3.org/2001/XMLSchema#decimal"}),r;var d}())===o&&(n=function(){var e,r,n,i,s,a;if(e=Nt,r=Nt,n=Nt,be.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(we)),i===o&&(i=null),i!==o){if(s=[],ce.test(t.charAt(Nt))?(a=t.charAt(Nt),Nt++):(a=o,Lt(ue)),a!==o)for(;a!==o;)s.push(a),ce.test(t.charAt(Nt))?(a=t.charAt(Nt),Nt++):(a=o,Lt(ue));else s=o;s!==o?n=i=[i,s]:(Nt=n,n=o)}else Nt=n,n=o;return(r=n!==o?t.substring(r,Nt):n)!==o&&(At=e,l=r,r=l.match(/^[0+][0-9]+$/)?{"@value":l,"@type":"http://www.w3.org/2001/XMLSchema#integer"}:parseInt(l)),r;var l}()),n!==o?(At=e,e=r=n):(Nt=e,e=o)):(Nt=e,e=o),e}())===o&&(e=function(){var e,r,n;for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o?(t.substr(Nt,4)===Q?(n=Q,Nt+=4):(n=o,Lt(Y)),n!==o?(At=e,e=r=!0):(Nt=e,e=o)):(Nt=e,e=o),e===o){for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();r!==o?(t.substr(Nt,5)===K?(n=K,Nt+=5):(n=o,Lt(ee)),n!==o?(At=e,e=r=!1):(Nt=e,e=o)):(Nt=e,e=o)}return e}()),e}())===o&&(e=Nt,(r=$t())!==o&&(At=e,r=dr(r,!1)),(e=r)===o&&(e=Nt,(r=Xt())!==o&&(At=e,r=function(e){return"[]"===e?{}:{"@id":e}}(r)),(e=r)===o&&(e=Nt,(r=Zt())!==o&&(At=e),(e=r)===o&&(e=Nt,(r=Vt())!==o&&(At=e,r=function(e){return{"@id":e}}(r)),e=r)))),e}function Zt(){var e,r,n,i,s,a;for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if(91===t.charCodeAt(Nt)?(n="[",Nt++):(n=o,Lt(z)),n!==o)if((i=Ut())!==o){for(s=[],a=Mt();a!==o;)s.push(a),a=Mt();s!==o?(93===t.charCodeAt(Nt)?(a="]",Nt++):(a=o,Lt(V)),a!==o?(At=e,e=r=i):(Nt=e,e=o)):(Nt=e,e=o)}else Nt=e,e=o;else Nt=e,e=o;else Nt=e,e=o;return e}function $t(){var e,r,n,i,s,a;for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o)if(40===t.charCodeAt(Nt)?(n="(",Nt++):(n=o,Lt(X)),n!==o){for(i=[],s=Ht();s!==o;)i.push(s),s=Ht();if(i!==o){for(s=[],a=Mt();a!==o;)s.push(a),a=Mt();s!==o?(41===t.charCodeAt(Nt)?(a=")",Nt++):(a=o,Lt(J)),a!==o?(At=e,e=r={"@list":i}):(Nt=e,e=o)):(Nt=e,e=o)}else Nt=e,e=o}else Nt=e,e=o;else Nt=e,e=o;return e}function zt(){var e,r,n;for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();return r!==o?((n=function(){var e,r,n,i,s,a,l,c;if(e=Nt,t.substr(Nt,3)===Re?(r=Re,Nt+=3):(r=o,Lt(ke)),r!==o){for(n=[],Ce.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(De)),i===o&&(i=Kt())===o&&(i=Yt());i!==o;)n.push(i),Ce.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(De)),i===o&&(i=Kt())===o&&(i=Yt());if(n!==o){if(i=[],s=Nt,t.substr(Nt,2)===Le?(a=Le,Nt+=2):(a=o,Lt(Pe)),a!==o){if(l=[],Ce.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(De)),c===o&&(c=Kt())===o&&(c=Yt()),c!==o)for(;c!==o;)l.push(c),Ce.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(De)),c===o&&(c=Kt())===o&&(c=Yt());else l=o;l!==o?(At=s,s=a=Fe(0,l)):(Nt=s,s=o)}else Nt=s,s=o;if(s===o)if(s=Nt,39===t.charCodeAt(Nt)?(a=Ee,Nt++):(a=o,Lt(Oe)),a!==o){if(l=[],Ce.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(De)),c===o&&(c=Kt())===o&&(c=Yt()),c!==o)for(;c!==o;)l.push(c),Ce.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(De)),c===o&&(c=Kt())===o&&(c=Yt());else l=o;l!==o?(At=s,s=a=Me(0,l)):(Nt=s,s=o)}else Nt=s,s=o;for(;s!==o;){if(i.push(s),s=Nt,t.substr(Nt,2)===Le?(a=Le,Nt+=2):(a=o,Lt(Pe)),a!==o){if(l=[],Ce.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(De)),c===o&&(c=Kt())===o&&(c=Yt()),c!==o)for(;c!==o;)l.push(c),Ce.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(De)),c===o&&(c=Kt())===o&&(c=Yt());else l=o;l!==o?(At=s,s=a=Fe(0,l)):(Nt=s,s=o)}else Nt=s,s=o;if(s===o)if(s=Nt,39===t.charCodeAt(Nt)?(a=Ee,Nt++):(a=o,Lt(Oe)),a!==o){if(l=[],Ce.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(De)),c===o&&(c=Kt())===o&&(c=Yt()),c!==o)for(;c!==o;)l.push(c),Ce.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(De)),c===o&&(c=Kt())===o&&(c=Yt());else l=o;l!==o?(At=s,s=a=Me(0,l)):(Nt=s,s=o)}else Nt=s,s=o}i!==o?(t.substr(Nt,3)===Re?(s=Re,Nt+=3):(s=o,Lt(ke)),s!==o?(At=e,e=r=Ue(n,i)):(Nt=e,e=o)):(Nt=e,e=o)}else Nt=e,e=o}else Nt=e,e=o;return e}())===o&&(n=function(){var e,r,n,i,s,a,l,c;if(e=Nt,t.substr(Nt,3)===Be?(r=Be,Nt+=3):(r=o,Lt(qe)),r!==o){for(n=[],He.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(Ze)),i===o&&(i=Kt())===o&&(i=Yt());i!==o;)n.push(i),He.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(Ze)),i===o&&(i=Kt())===o&&(i=Yt());if(n!==o){if(i=[],s=Nt,t.substr(Nt,2)===$e?(a=$e,Nt+=2):(a=o,Lt(ze)),a!==o){if(l=[],He.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(Ze)),c===o&&(c=Kt())===o&&(c=Yt()),c!==o)for(;c!==o;)l.push(c),He.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(Ze)),c===o&&(c=Kt())===o&&(c=Yt());else l=o;l!==o?(At=s,s=a=Ve(0,l)):(Nt=s,s=o)}else Nt=s,s=o;if(s===o)if(s=Nt,34===t.charCodeAt(Nt)?(a=je,Nt++):(a=o,Lt(Te)),a!==o){if(l=[],He.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(Ze)),c===o&&(c=Kt())===o&&(c=Yt()),c!==o)for(;c!==o;)l.push(c),He.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(Ze)),c===o&&(c=Kt())===o&&(c=Yt());else l=o;l!==o?(At=s,s=a=Xe(0,l)):(Nt=s,s=o)}else Nt=s,s=o;for(;s!==o;){if(i.push(s),s=Nt,t.substr(Nt,2)===$e?(a=$e,Nt+=2):(a=o,Lt(ze)),a!==o){if(l=[],He.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(Ze)),c===o&&(c=Kt())===o&&(c=Yt()),c!==o)for(;c!==o;)l.push(c),He.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(Ze)),c===o&&(c=Kt())===o&&(c=Yt());else l=o;l!==o?(At=s,s=a=Ve(0,l)):(Nt=s,s=o)}else Nt=s,s=o;if(s===o)if(s=Nt,34===t.charCodeAt(Nt)?(a=je,Nt++):(a=o,Lt(Te)),a!==o){if(l=[],He.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(Ze)),c===o&&(c=Kt())===o&&(c=Yt()),c!==o)for(;c!==o;)l.push(c),He.test(t.charAt(Nt))?(c=t.charAt(Nt),Nt++):(c=o,Lt(Ze)),c===o&&(c=Kt())===o&&(c=Yt());else l=o;l!==o?(At=s,s=a=Xe(0,l)):(Nt=s,s=o)}else Nt=s,s=o}i!==o?(t.substr(Nt,3)===Be?(s=Be,Nt+=3):(s=o,Lt(qe)),s!==o?(At=e,e=r=Ue(n,i)):(Nt=e,e=o)):(Nt=e,e=o)}else Nt=e,e=o}else Nt=e,e=o;return e}())===o&&(n=function(){var e,r,n,i;if(e=Nt,39===t.charCodeAt(Nt)?(r=Ee,Nt++):(r=o,Lt(Oe)),r!==o){for(n=[],Se.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(Ie)),i===o&&(i=Kt())===o&&(i=Yt());i!==o;)n.push(i),Se.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(Ie)),i===o&&(i=Kt())===o&&(i=Yt());n!==o?(39===t.charCodeAt(Nt)?(i=Ee,Nt++):(i=o,Lt(Oe)),i!==o?(At=e,e=r=p(n)):(Nt=e,e=o)):(Nt=e,e=o)}else Nt=e,e=o;return e}())===o&&(n=function(){var e,r,n,i;if(e=Nt,34===t.charCodeAt(Nt)?(r=je,Nt++):(r=o,Lt(Te)),r!==o){for(n=[],Ne.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(Ae)),i===o&&(i=Kt())===o&&(i=Yt());i!==o;)n.push(i),Ne.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(Ae)),i===o&&(i=Kt())===o&&(i=Yt());n!==o?(34===t.charCodeAt(Nt)?(i=je,Nt++):(i=o,Lt(Te)),i!==o?(At=e,e=r=p(n)):(Nt=e,e=o)):(Nt=e,e=o)}else Nt=e,e=o;return e}()),n!==o?(At=e,e=r=n):(Nt=e,e=o)):(Nt=e,e=o),e}function Vt(){var e,r,n;for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o&&(n=Jt())!==o?(At=e,e=r=n):(Nt=e,e=o),e===o){for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();r!==o&&(n=function(){var e,r;return(e=function(){var e,r,n;return e=Nt,(r=Gt())!==o&&(n=function(){var e,r,n,i,s,a,u,h;if(e=Nt,(r=tr())===o&&(58===t.charCodeAt(Nt)?(r=oe,Nt++):(r=o,Lt(se)),r===o&&(ce.test(t.charAt(Nt))?(r=t.charAt(Nt),Nt++):(r=o,Lt(ue)),r===o&&(r=ir()))),r!==o){for(n=[],(i=rr())===o&&(58===t.charCodeAt(Nt)?(i=oe,Nt++):(i=o,Lt(se)),i===o&&(i=ir()));i!==o;)n.push(i),(i=rr())===o&&(58===t.charCodeAt(Nt)?(i=oe,Nt++):(i=o,Lt(se)),i===o&&(i=ir()));if(n!==o){if(i=[],s=Nt,a=[],46===t.charCodeAt(Nt)?(u=l,Nt++):(u=o,Lt(c)),u!==o)for(;u!==o;)a.push(u),46===t.charCodeAt(Nt)?(u=l,Nt++):(u=o,Lt(c));else a=o;if(a!==o){if(u=[],(h=rr())===o&&(58===t.charCodeAt(Nt)?(h=oe,Nt++):(h=o,Lt(se)),h===o&&(h=ir())),h!==o)for(;h!==o;)u.push(h),(h=rr())===o&&(58===t.charCodeAt(Nt)?(h=oe,Nt++):(h=o,Lt(se)),h===o&&(h=ir()));else u=o;u!==o?(At=s,s=a=vt(0,0,a,u)):(Nt=s,s=o)}else Nt=s,s=o;for(;s!==o;){if(i.push(s),s=Nt,a=[],46===t.charCodeAt(Nt)?(u=l,Nt++):(u=o,Lt(c)),u!==o)for(;u!==o;)a.push(u),46===t.charCodeAt(Nt)?(u=l,Nt++):(u=o,Lt(c));else a=o;if(a!==o){if(u=[],(h=rr())===o&&(58===t.charCodeAt(Nt)?(h=oe,Nt++):(h=o,Lt(se)),h===o&&(h=ir())),h!==o)for(;h!==o;)u.push(h),(h=rr())===o&&(58===t.charCodeAt(Nt)?(h=oe,Nt++):(h=o,Lt(se)),h===o&&(h=ir()));else u=o;u!==o?(At=s,s=a=vt(0,0,a,u)):(Nt=s,s=o)}else Nt=s,s=o}i!==o?(At=e,d=i,e=r=r+n.join("")+d.join("")):(Nt=e,e=o)}else Nt=e,e=o}else Nt=e,e=o;var d;return e}())!==o?(At=e,i=r,s=n,hr.increment(i),e=r=hr.resolve(i+":"+s)):(Nt=e,e=o),e;var i,s}())===o&&(e=Nt,(r=Gt())!==o&&(At=e,n=r,r=n+":"),e=r),e;var n}())!==o?(At=e,e=r=n):(Nt=e,e=o)}return e}function Xt(){var e,r,n;for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();if(r!==o&&(n=function(){var e,r,n,i,s,a,u,h,d,f;if(e=Nt,r=Nt,t.substr(Nt,2)===ae?(n=ae,Nt+=2):(n=o,Lt(le)),n!==o)if((i=tr())===o&&(ce.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(ue))),i!==o){for(s=[],a=rr();a!==o;)s.push(a),a=rr();if(s!==o){if(a=[],u=Nt,h=[],46===t.charCodeAt(Nt)?(d=l,Nt++):(d=o,Lt(c)),d!==o)for(;d!==o;)h.push(d),46===t.charCodeAt(Nt)?(d=l,Nt++):(d=o,Lt(c));else h=o;if(h!==o){if(d=[],(f=rr())!==o)for(;f!==o;)d.push(f),f=rr();else d=o;d!==o?u=h=[h,d]:(Nt=u,u=o)}else Nt=u,u=o;for(;u!==o;){if(a.push(u),u=Nt,h=[],46===t.charCodeAt(Nt)?(d=l,Nt++):(d=o,Lt(c)),d!==o)for(;d!==o;)h.push(d),46===t.charCodeAt(Nt)?(d=l,Nt++):(d=o,Lt(c));else h=o;if(h!==o){if(d=[],(f=rr())!==o)for(;f!==o;)d.push(f),f=rr();else d=o;d!==o?u=h=[h,d]:(Nt=u,u=o)}else Nt=u,u=o}a!==o?r=n=[n,i,s,a]:(Nt=r,r=o)}else Nt=r,r=o}else Nt=r,r=o;else Nt=r,r=o;return r!==o?t.substring(e,Nt):r}())!==o?(At=e,e=r=n):(Nt=e,e=o),e===o){for(e=Nt,r=[],n=Mt();n!==o;)r.push(n),n=Mt();r!==o&&(n=function(){var e,r,n,i;if(e=Nt,91===t.charCodeAt(Nt)?(r="[",Nt++):(r=o,Lt(z)),r!==o){for(n=[],i=Mt();i!==o;)n.push(i),i=Mt();n!==o?(93===t.charCodeAt(Nt)?(i="]",Nt++):(i=o,Lt(V)),i!==o?(At=e,e=r="[]"):(Nt=e,e=o)):(Nt=e,e=o)}else Nt=e,e=o;return e}())!==o?(At=e,e=r=n):(Nt=e,e=o)}return e}function Jt(){var e,r,n,i;if(e=Nt,60===t.charCodeAt(Nt)?(r="<",Nt++):(r=o,Lt(te)),r!==o){for(n=[],re.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(ne)),i===o&&(i=Yt());i!==o;)n.push(i),re.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(ne)),i===o&&(i=Yt());n!==o?(62===t.charCodeAt(Nt)?(i=">",Nt++):(i=o,Lt(ie)),i!==o?(At=e,e=r=function(e){const t=e.map((e=>65536<=e.codePointAt(0)&&e.codePointAt(0)<=983039?"a":1===e.length?e:6===e.length?String.fromCharCode("0x"+e.substring(2)):10===e.length?String.fromCodePoint("0x"+e.substring(2)):e)).join("");if(t.match(/^[^\u0000-\u0020<>"{}|^`\\]*$/)){var r=e.join("");try{return hr.resolve(r)}catch(e){It("Invalid IRIREF "+r)}}else It("Invalid IRIREF "+e.join("")+" / "+t)}(n)):(Nt=e,e=o)):(Nt=e,e=o)}else Nt=e,e=o;return e}function Gt(){var e,r,n,i;return e=Nt,(r=nr())===o&&(r=null),r!==o?(58===t.charCodeAt(Nt)?(n=oe,Nt++):(n=o,Lt(se)),n!==o?(At=e,i=(i=r)||"0",!1===hr.hasPrefix(i)&&It("undefined prefix "+i),e=r=i):(Nt=e,e=o)):(Nt=e,e=o),e}function Wt(){var e,r,n;return e=Nt,(r=nr())===o&&(r=null),r!==o?(58===t.charCodeAt(Nt)?(n=oe,Nt++):(n=o,Lt(se)),n!==o?(At=e,e=r=r||""):(Nt=e,e=o)):(Nt=e,e=o),e}function Qt(){var e,r,n,i,s,a;if(e=Nt,r=Nt,xe.test(t.charAt(Nt))?(n=t.charAt(Nt),Nt++):(n=o,Lt(_e)),n!==o)if(be.test(t.charAt(Nt))?(i=t.charAt(Nt),Nt++):(i=o,Lt(we)),i===o&&(i=null),i!==o){if(s=[],ce.test(t.charAt(Nt))?(a=t.charAt(Nt),Nt++):(a=o,Lt(ue)),a!==o)for(;a!==o;)s.push(a),ce.test(t.charAt(Nt))?(a=t.charAt(Nt),Nt++):(a=o,Lt(ue));else s=o;s!==o?r=n=[n,i,s]:(Nt=r,r=o)}else Nt=r,r=o;else Nt=r,r=o;return r!==o?t.substring(e,Nt):r}function Yt(){var e,r,n,i,s,a,l,c,u,h,d,f;return e=Nt,"\\U"===t.substr(Nt,2)?(r="\\U",Nt+=2):(r=o,Lt(Je)),r!==o?(n=Nt,(i=or())!==o&&(s=or())!==o&&(a=or())!==o&&(l=or())!==o&&(c=or())!==o&&(u=or())!==o&&(h=or())!==o&&(d=or())!==o?n=i=[i,s,a,l,c,u,h,d]:(Nt=n,n=o),n!==o?(At=e,f=n,e=r=String.fromCodePoint(parseInt(f.join(""),16))):(Nt=e,e=o)):(Nt=e,e=o),e===o&&(e=Nt,"\\u"===t.substr(Nt,2)?(r="\\u",Nt+=2):(r=o,Lt(Ge)),r!==o?(n=Nt,(i=or())!==o&&(s=or())!==o&&(a=or())!==o&&(l=or())!==o?n=i=[i,s,a,l]:(Nt=n,n=o),n!==o?(At=e,e=r=function(e){return String.fromCharCode(parseInt(e.join(""),16))}(n)):(Nt=e,e=o)):(Nt=e,e=o)),e}function Kt(){var e,r;return e=Nt,"\\t"===t.substr(Nt,2)?(r="\\t",Nt+=2):(r=o,Lt(We)),r!==o&&(At=e,r="\t"),(e=r)===o&&(e=Nt,"\\b"===t.substr(Nt,2)?(r="\\b",Nt+=2):(r=o,Lt(Qe)),r!==o&&(At=e,r="\b"),(e=r)===o&&(e=Nt,"\\n"===t.substr(Nt,2)?(r="\\n",Nt+=2):(r=o,Lt(Ye)),r!==o&&(At=e,r="\n"),(e=r)===o&&(e=Nt,"\\r"===t.substr(Nt,2)?(r="\\r",Nt+=2):(r=o,Lt(Ke)),r!==o&&(At=e,r="\r"),(e=r)===o&&(e=Nt,"\\f"===t.substr(Nt,2)?(r="\\f",Nt+=2):(r=o,Lt(et)),r!==o&&(At=e,r="\f"),(e=r)===o&&(e=Nt,'\\"'===t.substr(Nt,2)?(r='\\"',Nt+=2):(r=o,Lt(tt)),r!==o&&(At=e,r='"'),(e=r)===o&&(e=Nt,"\\'"===t.substr(Nt,2)?(r="\\'",Nt+=2):(r=o,Lt(rt)),r!==o&&(At=e,r="'"),(e=r)===o&&(e=Nt,"\\\\"===t.substr(Nt,2)?(r="\\\\",Nt+=2):(r=o,Lt(nt)),r!==o&&(At=e,r="\\"),e=r))))))),e}function er(){var e,r,n;return e=Nt,st.test(t.charAt(Nt))?(r=t.charAt(Nt),Nt++):(r=o,Lt(at)),r!==o?(lt.test(t.charAt(Nt))?(n=t.charAt(Nt),Nt++):(n=o,Lt(ct)),n!==o?(At=e,e=r=r+n):(Nt=e,e=o)):(Nt=e,e=o),e===o&&(ut.test(t.charAt(Nt))?(e=t.charAt(Nt),Nt++):(e=o,Lt(ht))),e}function tr(){var e;return(e=er())===o&&(95===t.charCodeAt(Nt)?(e="_",Nt++):(e=o,Lt(dt))),e}function rr(){var e;return(e=tr())===o&&(45===t.charCodeAt(Nt)?(e=pe,Nt++):(e=o,Lt(ge)),e===o&&(ce.test(t.charAt(Nt))?(e=t.charAt(Nt),Nt++):(e=o,Lt(ue)),e===o&&(183===t.charCodeAt(Nt)?(e="·",Nt++):(e=o,Lt(ft)),e===o&&(pt.test(t.charAt(Nt))?(e=t.charAt(Nt),Nt++):(e=o,Lt(gt)),e===o&&(yt.test(t.charAt(Nt))?(e=t.charAt(Nt),Nt++):(e=o,Lt(mt))))))),e}function nr(){var e,r,n,i,s,a,u,h,d;if(e=Nt,r=Nt,(n=er())!==o){for(i=[],s=rr();s!==o;)i.push(s),s=rr();if(i!==o){if(s=[],a=Nt,u=[],46===t.charCodeAt(Nt)?(h=l,Nt++):(h=o,Lt(c)),h!==o)for(;h!==o;)u.push(h),46===t.charCodeAt(Nt)?(h=l,Nt++):(h=o,Lt(c));else u=o;if(u!==o){if(h=[],(d=rr())!==o)for(;d!==o;)h.push(d),d=rr();else h=o;h!==o?a=u=[u,h]:(Nt=a,a=o)}else Nt=a,a=o;for(;a!==o;){if(s.push(a),a=Nt,u=[],46===t.charCodeAt(Nt)?(h=l,Nt++):(h=o,Lt(c)),h!==o)for(;h!==o;)u.push(h),46===t.charCodeAt(Nt)?(h=l,Nt++):(h=o,Lt(c));else u=o;if(u!==o){if(h=[],(d=rr())!==o)for(;d!==o;)h.push(d),d=rr();else h=o;h!==o?a=u=[u,h]:(Nt=a,a=o)}else Nt=a,a=o}s!==o?r=n=[n,i,s]:(Nt=r,r=o)}else Nt=r,r=o}else Nt=r,r=o;return r!==o?t.substring(e,Nt):r}function ir(){var e;return(e=function(){var e,r,n,i,s;return e=Nt,r=Nt,37===t.charCodeAt(Nt)?(n="%",Nt++):(n=o,Lt(bt)),n!==o&&(i=or())!==o&&(s=or())!==o?r=n=[n,i,s]:(Nt=r,r=o),r!==o?t.substring(e,Nt):r}())===o&&(e=function(){var e,r,n;return e=Nt,92===t.charCodeAt(Nt)?(r="\\",Nt++):(r=o,Lt(_t)),r!==o?(jt.test(t.charAt(Nt))?(n=t.charAt(Nt),Nt++):(n=o,Lt(Tt)),n!==o?(At=e,e=r=n):(Nt=e,e=o)):(Nt=e,e=o),e}()),e}function or(){var e;return wt.test(t.charAt(Nt))?(e=t.charAt(Nt),Nt++):(e=o,Lt(xt)),e}var sr,ar,lr,cr=new Function("try {return this===window;}catch(e){ return false;}")()?window.URL:r(4044).URL,ur=function(e){return e.match(/^[a-z](.*?):(.+?)/g)},hr={base:[],data:{},addBase:function(e){if(0===hr.base.length)return void hr.base.push(e);const t=hr.base[hr.base.length-1];t!==e&&hr.base.push(new cr(e,t).toString())},addPrefix:function(e,t){const r=hr.data[e];void 0===r?hr.data[e]=[{uri:t,count:0}]:r[r.length-1].uri!==t&&r.push({uri:t,count:0})},hasPrefix:function(e){return void 0!==this.data[e]},resolve:function(e,t){const r=Object.keys(hr.data).find((t=>0===e.indexOf(t+":")));if(void 0!==r){const n=hr.data[r];if(1===n.length&&!0!==t&&ur(n[0].uri))return e;const i=n[n.length-1].uri;return e.replace(r+":",i)}var i=0===hr.base.length?n.baseIRI:hr.base[hr.base.length-1];return!i||e.match(/^(http:|https:|urn:|file:)/)?e:0===e.indexOf("//")&&i?i.split("//")[0]+e:new cr(e,i).toString()},increment:function(e){const t=hr.data[e];void 0!==t&&t[t.length-1].count++},decrement:function(e){const t=hr.data[e];void 0!==t&&t[t.length-1].count--},toJSON:function(){const e={};return hr.base.length>0&&(void 0===e["@context"]&&(e["@context"]={}),e["@context"]["@base"]=hr.base[0]),Object.keys(hr.data).forEach((t=>{const r=hr.data[t][0];"http://www.w3.org/2001/XMLSchema#"===r.uri&&r.count<1||ur(r.uri)&&(void 0===e["@context"]&&(e["@context"]={}),e["@context"][t]=r.uri)})),e}};function dr(e,t){if(void 0===e["@list"])return e;if(!t&&!e["@list"].find((e=>void 0!==e["@list"])))return e;if(0===e["@list"].length)return{"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};var r={},n=null;return e["@list"].forEach((e=>{null===n?n=r:(n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={},n=n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]),n["http://www.w3.org/1999/02/22-rdf-syntax-ns#first"]=dr(e,!0),n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"}})),r}if((i=a())!==o&&Nt===t.length)return i;throw i!==o&&Nt<t.length&&Lt({type:"end"}),sr=St,ar=Ot<t.length?t.charAt(Ot):null,lr=Ot<t.length?Dt(Ot,Ot+1):Dt(Ot,Ot),new e(e.buildMessage(sr,ar),sr,ar,lr)}}}.apply(t,[]))||(e.exports=n)},6118:(e,t,r)=>{"use strict";var n=r(2530),i=r(292);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},o(e)}var s,a,l=r(8619).codes,c=l.ERR_AMBIGUOUS_ARGUMENT,u=l.ERR_INVALID_ARG_TYPE,h=l.ERR_INVALID_ARG_VALUE,d=l.ERR_INVALID_RETURN_VALUE,f=l.ERR_MISSING_ARGS,p=r(6979),g=r(5663).inspect,y=r(5663).types,m=y.isPromise,v=y.isRegExp,b=Object.assign?Object.assign:r(1662).assign,w=Object.is?Object.is:r(7402);function x(){var e=r(1667);s=e.isDeepEqual,a=e.isDeepStrictEqual}new Map;var _=!1,j=e.exports=E,T={};function N(e){if(e.message instanceof Error)throw e.message;throw new p(e)}function A(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new p({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function E(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];A.apply(void 0,[E,t.length].concat(t))}j.fail=function e(t,r,o,s,a){var l,c=arguments.length;if(0===c)l="Failed";else if(1===c)o=t,t=void 0;else{if(!1===_){_=!0;var u=n.emitWarning?n.emitWarning:i.warn.bind(i);u("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===c&&(s="!=")}if(o instanceof Error)throw o;var h={actual:t,expected:r,operator:void 0===s?"fail":s,stackStartFn:a||e};void 0!==o&&(h.message=o);var d=new p(h);throw l&&(d.message=l,d.generatedMessage=!0),d},j.AssertionError=p,j.ok=E,j.equal=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");t!=r&&N({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},j.notEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");t==r&&N({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},j.deepEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===s&&x(),s(t,r)||N({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},j.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===s&&x(),s(t,r)&&N({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},j.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===s&&x(),a(t,r)||N({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},j.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===s&&x(),a(t,r)&&N({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},j.strictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");w(t,r)||N({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},j.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");w(t,r)&&N({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var O=function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&v(t[e])&&t[e].test(n[e])?i[e]=n[e]:i[e]=t[e])}))};function S(e,t,r,n,i,o){if(!(r in e)||!a(e[r],t[r])){if(!n){var s=new O(e,i),l=new O(t,i,e),c=new p({actual:s,expected:l,operator:"deepStrictEqual",stackStartFn:o});throw c.actual=e,c.expected=t,c.operator=o.name,c}N({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}function I(e,t,r,n){if("function"!=typeof t){if(v(t))return t.test(e);if(2===arguments.length)throw new u("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var i=new p({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var a=Object.keys(t);if(t instanceof Error)a.push("name","message");else if(0===a.length)throw new h("error",t,"may not be an empty object");return void 0===s&&x(),a.forEach((function(i){"string"==typeof e[i]&&v(t[i])&&t[i].test(e[i])||S(e,t,i,r,a,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function R(e){if("function"!=typeof e)throw new u("fn","Function",e);try{e()}catch(e){return e}return T}function k(e){return m(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function C(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!k(t=e()))throw new d("instance of Promise","promiseFn",t)}else{if(!k(e))throw new u("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return T})).catch((function(e){return e}))}))}function D(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new u("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new c("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new c("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new u("error",["Object","Error","Function","RegExp"],r);if(t===T){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var s="rejects"===e.name?"rejection":"exception";N({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(s).concat(i),stackStartFn:e})}if(r&&!I(t,r,n,e))throw t}function L(e,t,r,n){if(t!==T){if("string"==typeof r&&(n=r,r=void 0),!r||I(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";N({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function P(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];A.apply(void 0,[P,t.length].concat(t))}j.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];D.apply(void 0,[e,R(t)].concat(n))},j.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return D.apply(void 0,[e,t].concat(n))}))},j.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];L.apply(void 0,[e,R(t)].concat(n))},j.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return L.apply(void 0,[e,t].concat(n))}))},j.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=g(t);var n=new p({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var s=i.split("\n");s.shift();for(var a=n.stack.split("\n"),l=0;l<s.length;l++){var c=a.indexOf(s[l]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},j.strict=b(P,j,{equal:j.strictEqual,deepEqual:j.deepStrictEqual,notEqual:j.notStrictEqual,notDeepEqual:j.notDeepStrictEqual}),j.strict.strict=j.strict},6979:(e,t,r)=>{"use strict";var n=r(2530);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}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?a(e):t}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;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,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},l(e)}function c(){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,r){return u=c()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&h(i,r.prototype),i},u.apply(null,arguments)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e){return f="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},f(e)}var p=r(5663).inspect,g=r(8619).codes.ERR_INVALID_ARG_TYPE;function y(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var m="",v="",b="",w="",x={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function j(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var T=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==f(e)||null===e)throw new g("options","Object",e);var i=e.message,o=e.operator,l=e.stackStartFn,c=e.actual,u=e.expected,h=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=s(this,d(t).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(m="[34m",v="[32m",w="[39m",b="[31m"):(m="",v="",w="",b="")),"object"===f(c)&&null!==c&&"object"===f(u)&&null!==u&&"stack"in c&&c instanceof Error&&"stack"in u&&u instanceof Error&&(c=_(c),u=_(u)),"deepStrictEqual"===o||"strictEqual"===o)r=s(this,d(t).call(this,function(e,t,r){var i="",o="",s=0,a="",l=!1,c=j(e),u=c.split("\n"),h=j(t).split("\n"),d=0,p="";if("strictEqual"===r&&"object"===f(e)&&"object"===f(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===h.length&&u[0]!==h[0]){var g=u[0].length+h[0].length;if(g<=10){if(!("object"===f(e)&&null!==e||"object"===f(t)&&null!==t||0===e&&0===t))return"".concat(x[r],"\n\n")+"".concat(u[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&g<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;u[0][d]===h[0][d];)d++;d>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",d),"^"),d=0)}}for(var _=u[u.length-1],T=h[h.length-1];_===T&&(d++<2?a="\n ".concat(_).concat(a):i=_,u.pop(),h.pop(),0!==u.length&&0!==h.length);)_=u[u.length-1],T=h[h.length-1];var N=Math.max(u.length,h.length);if(0===N){var A=c.split("\n");if(A.length>30)for(A[26]="".concat(m,"...").concat(w);A.length>27;)A.pop();return"".concat(x.notIdentical,"\n\n").concat(A.join("\n"),"\n")}d>3&&(a="\n".concat(m,"...").concat(w).concat(a),l=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var E=0,O=x[r]+"\n".concat(v,"+ actual").concat(w," ").concat(b,"- expected").concat(w),S=" ".concat(m,"...").concat(w," Lines skipped");for(d=0;d<N;d++){var I=d-s;if(u.length<d+1)I>1&&d>2&&(I>4?(o+="\n".concat(m,"...").concat(w),l=!0):I>3&&(o+="\n ".concat(h[d-2]),E++),o+="\n ".concat(h[d-1]),E++),s=d,i+="\n".concat(b,"-").concat(w," ").concat(h[d]),E++;else if(h.length<d+1)I>1&&d>2&&(I>4?(o+="\n".concat(m,"...").concat(w),l=!0):I>3&&(o+="\n ".concat(u[d-2]),E++),o+="\n ".concat(u[d-1]),E++),s=d,o+="\n".concat(v,"+").concat(w," ").concat(u[d]),E++;else{var R=h[d],k=u[d],C=k!==R&&(!y(k,",")||k.slice(0,-1)!==R);C&&y(R,",")&&R.slice(0,-1)===k&&(C=!1,k+=","),C?(I>1&&d>2&&(I>4?(o+="\n".concat(m,"...").concat(w),l=!0):I>3&&(o+="\n ".concat(u[d-2]),E++),o+="\n ".concat(u[d-1]),E++),s=d,o+="\n".concat(v,"+").concat(w," ").concat(k),i+="\n".concat(b,"-").concat(w," ").concat(R),E+=2):(o+=i,i="",1!==I&&0!==d||(o+="\n ".concat(k),E++))}if(E>20&&d<N-2)return"".concat(O).concat(S,"\n").concat(o,"\n").concat(m,"...").concat(w).concat(i,"\n")+"".concat(m,"...").concat(w)}return"".concat(O).concat(l?S:"","\n").concat(o).concat(i).concat(a).concat(p)}(c,u,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var p=x[o],T=j(c).split("\n");if("notStrictEqual"===o&&"object"===f(c)&&null!==c&&(p=x.notStrictEqualObject),T.length>30)for(T[26]="".concat(m,"...").concat(w);T.length>27;)T.pop();r=1===T.length?s(this,d(t).call(this,"".concat(p," ").concat(T[0]))):s(this,d(t).call(this,"".concat(p,"\n\n").concat(T.join("\n"),"\n")))}else{var N=j(c),A="",E=x[o];"notDeepEqual"===o||"notEqual"===o?(N="".concat(x[o],"\n\n").concat(N)).length>1024&&(N="".concat(N.slice(0,1021),"...")):(A="".concat(j(u)),N.length>512&&(N="".concat(N.slice(0,509),"...")),A.length>512&&(A="".concat(A.slice(0,509),"...")),"deepEqual"===o||"equal"===o?N="".concat(E,"\n\n").concat(N,"\n\nshould equal\n\n"):A=" ".concat(o," ").concat(A)),r=s(this,d(t).call(this,"".concat(N).concat(A)))}return Error.stackTraceLimit=h,r.generatedMessage=!i,Object.defineProperty(a(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=u,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(a(r),l),r.stack,r.name="AssertionError",s(r)}var r,l;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),r=t,l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(e,t){return p(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],l&&o(r.prototype,l),t}(l(Error));e.exports=T},8619:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var s,a,l={};function c(e,t,r){r||(r=Error);var s=function(r){function s(r,o,a){var l;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),l=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i(s).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,o,a))),l.code=e,l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(s,r),s}(r);l[e]=s}function u(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))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,a,l,c,h;if(void 0===s&&(s=r(6118)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(0,a.length)===a)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))l="The ".concat(e," ").concat(o," ").concat(u(t,"type"));else{var d=("number"!=typeof h&&(h=0),h+".".length>(c=e).length||-1===c.indexOf(".",h)?"argument":"property");l='The "'.concat(e,'" ').concat(d," ").concat(o," ").concat(u(t,"type"))}return l+". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(5663));var i=a.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(6118)),s(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=l},1667:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="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},i(e)}var o=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},a=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},l=Object.is?Object.is:r(7402),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},u=Number.isNaN?Number.isNaN:r(8622);function h(e){return e.call.bind(e)}var d=h(Object.prototype.hasOwnProperty),f=h(Object.prototype.propertyIsEnumerable),p=h(Object.prototype.toString),g=r(5663).types,y=g.isAnyArrayBuffer,m=g.isArrayBufferView,v=g.isDate,b=g.isMap,w=g.isRegExp,x=g.isSet,_=g.isNativeError,j=g.isBoxedPrimitive,T=g.isNumberObject,N=g.isStringObject,A=g.isBooleanObject,E=g.isBigIntObject,O=g.isSymbolObject,S=g.isFloat32Array,I=g.isFloat64Array;function R(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function k(e){return Object.keys(e).filter(R).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function C(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function D(e,t,r,n){if(e===t)return 0!==e||!r||l(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&u(e)&&u(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var s,a,c,h,d=p(e);if(d!==p(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var f=k(e),g=k(t);return f.length===g.length&&P(e,t,r,n,1,f)}if("[object Object]"===d&&(!b(e)&&b(t)||!x(e)&&x(t)))return!1;if(v(e)){if(!v(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(c=e,h=t,!(o?c.source===h.source&&c.flags===h.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(h))))return!1}else if(_(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(m(e)){if(r||!S(e)&&!I(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===C(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var R=k(e),D=k(t);return R.length===D.length&&P(e,t,r,n,0,R)}if(x(e))return!(!x(t)||e.size!==t.size)&&P(e,t,r,n,2);if(b(e))return!(!b(t)||e.size!==t.size)&&P(e,t,r,n,3);if(y(e)){if(a=t,(s=e).byteLength!==a.byteLength||0!==C(new Uint8Array(s),new Uint8Array(a)))return!1}else if(j(e)&&!function(e,t){return T(e)?T(t)&&l(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):N(e)?N(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):A(e)?A(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):E(e)?E(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):O(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return P(e,t,r,n,0)}function L(e,t){return t.filter((function(t){return f(e,t)}))}function P(e,t,r,n,i,o){if(5===arguments.length){o=Object.keys(e);var s=Object.keys(t);if(o.length!==s.length)return!1}for(var a=0;a<o.length;a++)if(!d(t,o[a]))return!1;if(r&&5===arguments.length){var l=c(e);if(0!==l.length){var u=0;for(a=0;a<l.length;a++){var h=l[a];if(f(e,h)){if(!f(t,h))return!1;o.push(h),u++}else if(f(t,h))return!1}var p=c(t);if(l.length!==p.length&&L(t,p).length!==u)return!1}else{var g=c(t);if(0!==g.length&&0!==L(t,g).length)return!1}}if(0===o.length&&(0===i||1===i&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var y=n.val1.get(e);if(void 0!==y){var m=n.val2.get(t);if(void 0!==m)return y===m}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var v=H(e,t,r,o,n,i);return n.val1.delete(e),n.val2.delete(t),v}function F(e,t,r,n){for(var i=s(e),o=0;o<i.length;o++){var a=i[o];if(D(t,a,r,n))return e.delete(a),!0}return!1}function M(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(u(e))return!1}return!0}function U(e,t,r){var n=M(r);return null!=n?n:t.has(n)&&!e.has(n)}function B(e,t,r,n,i){var o=M(r);if(null!=o)return o;var s=t.get(o);return!(void 0===s&&!t.has(o)||!D(n,s,!1,i))&&!e.has(o)&&D(n,s,!1,i)}function q(e,t,r,n,i,o){for(var a=s(e),l=0;l<a.length;l++){var c=a[l];if(D(r,c,i,o)&&D(n,t.get(c),i,o))return e.delete(c),!0}return!1}function H(e,t,r,o,l,c){var u=0;if(2===c){if(!function(e,t,r,n){for(var o=null,a=s(e),l=0;l<a.length;l++){var c=a[l];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!t.has(c)){if(r)return!1;if(!U(e,t,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var u=s(t),h=0;h<u.length;h++){var d=u[h];if("object"===i(d)&&null!==d){if(!F(o,d,r,n))return!1}else if(!r&&!e.has(d)&&!F(o,d,r,n))return!1}return 0===o.size}return!0}(e,t,r,l))return!1}else if(3===c){if(!function(e,t,r,o){for(var s=null,l=a(e),c=0;c<l.length;c++){var u=n(l[c],2),h=u[0],d=u[1];if("object"===i(h)&&null!==h)null===s&&(s=new Set),s.add(h);else{var f=t.get(h);if(void 0===f&&!t.has(h)||!D(d,f,r,o)){if(r)return!1;if(!B(e,t,h,d,o))return!1;null===s&&(s=new Set),s.add(h)}}}if(null!==s){for(var p=a(t),g=0;g<p.length;g++){var y=n(p[g],2),m=(h=y[0],y[1]);if("object"===i(h)&&null!==h){if(!q(s,e,h,m,r,o))return!1}else if(!(r||e.has(h)&&D(e.get(h),m,!1,o)||q(s,e,h,m,!1,o)))return!1}return 0===s.size}return!0}(e,t,r,l))return!1}else if(1===c)for(;u<e.length;u++){if(!d(e,u)){if(d(t,u))return!1;for(var h=Object.keys(e);u<h.length;u++){var f=h[u];if(!d(t,f)||!D(e[f],t[f],r,l))return!1}return h.length===Object.keys(t).length}if(!d(t,u)||!D(e[u],t[u],r,l))return!1}for(u=0;u<o.length;u++){var p=o[u];if(!D(e[p],t[p],r,l))return!1}return!0}e.exports={isDeepEqual:function(e,t){return D(e,t,!1)},isDeepStrictEqual:function(e,t){return D(e,t,!0)}}},5155:(e,t)=>{"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=l(e),s=o[0],a=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),u=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,l=n-i;a<l;a+=s)o.push(c(e,a,a+s>l?l:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)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 c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2486:(e,t,r)=>{"use strict";var n=r(292);const i=r(5155),o=r(4525),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=c,t.h2=50;const a=2147483647;function l(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(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 d(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=l(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|g(e.length),r=l(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?l(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return h(e),l(e<0?0:0|g(e))}function f(e){const t=e.length<0?0:0|g(e.length),r=l(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function g(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(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);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(i)return n?-1:X(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let 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 R(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){let o,s=1,a=e.length,l=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;s=2,a/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function x(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Q(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return G(X(t,e.length-r),e,r,n)}function j(e,t,r,n){return G(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function T(e,t,r,n){return G(J(t),e,r,n)}function N(e,t,r,n){return G(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function E(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||void 0===n||"function"!=typeof n.error||n.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?l(e):void 0!==t?"string"==typeof r?l(e).fill(t,r):l(e).fill(t):l(e)}(e,t,r)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(W(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),W(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(W(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(W(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<a;++e)if(l[e]!==u[e]){o=l[e],s=u[e];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const 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");let o=!1;for(;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return j(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function S(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function R(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function k(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){Z(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){Z(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function F(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,i){return t=+t,r>>>=0,i||F(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||F(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=K((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=K((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=K((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=K((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(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},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(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},c.prototype.writeBigUInt64LE=K((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=K((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(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},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(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},c.prototype.writeBigInt64LE=K((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=K((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const B={};function q(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function H(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Z(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,i,o)}function $(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw $(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=H(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function X(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.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;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function K(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},7615:(e,t,r)=>{"use strict";var n=r(1801),i=r(2550),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},2550:(e,t,r)=>{"use strict";var n=r(1930),i=r(1801),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),l=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),u=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=a(n,s,arguments);if(l&&c){var r=l(t,"length");r.configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var h=function(){return a(n,o,arguments)};c?c(e.exports,"apply",{value:h}):e.exports.apply=h},8981:e=>{"use strict";e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,r,n)=>t+(0===n?"":",")+e(void 0===r||"symbol"==typeof r?null:r)),"")+"]":"{"+Object.keys(t).sort().reduce(((r,n,i)=>void 0===t[n]||"symbol"==typeof t[n]?r:r+(0===r.length?"":",")+e(n)+":"+e(t[n])),"")+"}"}},292:(e,t,r)=>{var n=r(5663),i=r(6118);function o(){return(new Date).getTime()}var s,a=Array.prototype.slice,l={};s=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){s.log.apply(s,arguments)},"info"],[function(){s.log.apply(s,arguments)},"warn"],[function(){s.warn.apply(s,arguments)},"error"],[function(e){l[e]=o()},"time"],[function(e){var t=l[e];if(!t)throw new Error("No such label: "+e);delete l[e];var r=o()-t;s.log(e+": "+r+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=n.format.apply(null,arguments),s.error(e.stack)},"trace"],[function(e){s.log(n.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=a.call(arguments,1);i.ok(!1,n.format.apply(null,t))}},"assert"]],u=0;u<c.length;u++){var h=c[u],d=h[0],f=h[1];s[f]||(s[f]=d)}e.exports=s},7297:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r,n=f(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=p(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=u(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=u(t)},d.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),h(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),h(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),v.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];x.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function j(e,r){return new Promise((function(n,o){var s=new b(e,r);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new x(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",l)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}j.polyfill=!0,e.fetch||(e.fetch=j,e.Headers=d,e.Request=b,e.Response=x),t.Headers=d,t.Request=b,t.Response=x,t.fetch=j,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},9170:(e,t,r)=>{"use strict";var n=r(806),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,l=r(8198)(),c=a&&l,u=function(e,t,r,n){var i;(!(t in e)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(c?a(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},h=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=s.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)u(e,o[a],t[o[a]],r[o[a]])};h.supportsDescriptors=!!c,e.exports=h},1662:e=>{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),s=0,a=o.length;s<a;s++){var l=o[s],c=Object.getOwnPropertyDescriptor(i,l);void 0!==c&&c.enumerable&&(r[l]=i[l])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},4843:(e,t,r)=>{"use strict";var n=r(5443),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))},a=function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)},l=function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))};e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(e)?s(e,t,o):"string"==typeof e?a(e,t,o):l(e,t,o)}},9930:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function(e){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var s,a=r.call(arguments,1),l=function(){if(this instanceof s){var t=o.apply(this,a.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),u=[],h=0;h<c;h++)u.push("$"+h);if(s=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(l),o.prototype){var d=function(){};d.prototype=o.prototype,s.prototype=new d,d.prototype=null}return s}},1930:(e,t,r)=>{"use strict";var n=r(9930);e.exports=Function.prototype.bind||n},1801:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(e){l=null}var c=function(){throw new s},u=l?function(){try{return c}catch(e){try{return l(arguments,"callee").get}catch(e){return c}}}():c,h=r(9905)(),d=Object.getPrototypeOf||function(e){return e.__proto__},f={},p="undefined"==typeof Uint8Array?n:d(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?d(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":u,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=d(i.prototype))}return g[t]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=r(1930),b=r(9284),w=v.call(Function.call,Array.prototype.concat),x=v.call(Function.apply,Array.prototype.splice),_=v.call(Function.call,String.prototype.replace),j=v.call(Function.call,String.prototype.slice),T=v.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,E=function(e){var t=j(e,0,1),r=j(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(e,N,(function(e,t,r,i){n[n.length]=r?_(i,A,"$1"):t||e})),n},O=function(e,t){var r,n=e;if(b(m,n)&&(n="%"+(r=m[n])[0]+"%"),b(g,n)){var o=g[n];if(o===f&&(o=y(n)),void 0===o&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=E(e),n=r.length>0?r[0]:"",o=O("%"+n+"%",t),a=o.name,c=o.value,u=!1,h=o.alias;h&&(n=h[0],x(r,w([0,1],h)));for(var d=1,f=!0;d<r.length;d+=1){var p=r[d],y=j(p,0,1),m=j(p,-1);if(('"'===y||"'"===y||"`"===y||'"'===m||"'"===m||"`"===m)&&y!==m)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&f||(u=!0),b(g,a="%"+(n+="."+p)+"%"))c=g[a];else if(null!=c){if(!(p in c)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(l&&d+1>=r.length){var v=l(c,p);c=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:c[p]}else f=b(c,p),c=c[p];f&&!u&&(g[a]=c)}}return c}},3828:(e,t,r)=>{"use strict";var n=r(1801)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},8198:(e,t,r)=>{"use strict";var n=r(1801)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},9905:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5682);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5682:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},4111:(e,t,r)=>{"use strict";var n=r(5682);e.exports=function(){return n()&&!!Symbol.toStringTag}},9284:(e,t,r)=>{"use strict";var n=r(1930);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4525:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,c=l>>1,u=-7,h=r?i-1:0,d=r?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=a;u>0;o=256*o+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=c}return(f?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,c=8*o-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+f]=255&s,f+=p,s/=256,c-=8);e[r+f-p]|=128*g}},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7092:(e,t,r)=>{"use strict";var n=r(4111)(),i=r(7615)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},5443:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var d=document.all;l.call(d)===l.call(document.all)&&(h=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(s(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},7427:(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(4111)(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(s.test(o.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(e);if(!l)return!1;if(void 0===n){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&l(t)}return l(e)===n}},2100:e=>{"use strict";e.exports=function(e){return e!=e}},8622:(e,t,r)=>{"use strict";var n=r(2550),i=r(9170),o=r(2100),s=r(4358),a=r(6232),l=n(s(),Number);i(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},4358:(e,t,r)=>{"use strict";var n=r(2100);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6232:(e,t,r)=>{"use strict";var n=r(9170),i=r(4358);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2527:(e,t,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),s=o("Object.prototype.toString"),a=r(4111)(),l=r(3828),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),h=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},d=o("String.prototype.slice"),f={},p=Object.getPrototypeOf;a&&l&&p&&n(u,(function(e){var t=new c[e];if(Symbol.toStringTag in t){var r=p(t),n=l(r,Symbol.toStringTag);if(!n){var i=p(r);n=l(i,Symbol.toStringTag)}f[e]=n.get}})),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!a||!(Symbol.toStringTag in e)){var t=d(s(e),8,-1);return h(u,t)>-1}return!!l&&function(e){var t=!1;return n(f,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},5777:(e,t,r)=>{"use strict";const{isArray:n,isObject:i,isString:o}=r(8285),{asArray:s}=r(4768),{prependBase:a}=r(3866),l=r(9699),c=r(1898);function u(e){throw new l("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 r=e["@context"];if(o(r))e["@context"]=a(t,r);else if(n(r))for(let e=0;e<r.length;++e){const n=r[e];o(n)?r[e]=a(t,n):i(n)&&h({context:{"@context":n},base:t})}else if(i(r))for(const e in r)h({context:r[e],base:t})}e.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:r,base:a,cycles:l=new Set}){t&&i(t)&&t["@context"]&&(t=t["@context"]),t=s(t);const h=[];for(const s of t){if(o(s)){let t=this._get(s);t||(t=await this._resolveRemoteContext({activeCtx:e,url:s,documentLoader:r,base:a,cycles:l})),n(t)?h.push(...t):h.push(t);continue}if(null===s){h.push(new c({document:null}));continue}i(s)||u(t);const d=JSON.stringify(s);let f=this._get(d);f||(f=new c({document:s}),this._cacheResolvedContext({key:d,resolved:f,tag:"static"})),h.push(f)}return h}_get(e){let t=this.perOpCache.get(e);if(!t){const r=this.sharedCache.get(e);r&&(t=r.get("static"),t&&this.perOpCache.set(e,t))}return t}_cacheResolvedContext({key:e,resolved:t,tag:r}){if(this.perOpCache.set(e,t),void 0!==r){let n=this.sharedCache.get(e);n||(n=new Map,this.sharedCache.set(e,n)),n.set(r,t)}return t}async _resolveRemoteContext({activeCtx:e,url:t,documentLoader:r,base:n,cycles:i}){t=a(n,t);const{context:o,remoteDoc:s}=await this._fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:i});h({context:o,base:n=s.documentUrl||t});const l=await this.resolve({activeCtx:e,context:o,documentLoader:r,base:n,cycles:i});return this._cacheResolvedContext({key:t,resolved:l,tag:s.tag}),l}async _fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:s}){if(s.size>10)throw new l("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(s.has(t))throw new l("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let a,c;s.add(t);try{c=await r(t),a=c.document||null,o(a)&&(a=JSON.parse(a))}catch(e){throw new l("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:e})}if(!i(a))throw new l("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 a="@context"in a?{"@context":a["@context"]}:{"@context":{}},c.contextUrl&&(n(a["@context"])||(a["@context"]=[a["@context"]]),a["@context"].push(c.contextUrl)),{context:a,remoteDoc:c}}}},9699:e=>{"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",r={}){super(e),this.name=t,this.message=e,this.details=r}}},7298:e=>{"use strict";e.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,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}},7990:(e,t,r)=>{"use strict";e.exports=r(2948).NQuads},3114:e=>{"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}},1898:(e,t,r)=>{"use strict";const n=r(3666);e.exports=class{constructor({document:e}){this.document=e,this.cache=new n({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},120:(e,t,r)=>{"use strict";const n=r(9699),{isArray:i,isObject:o,isString:s,isUndefined:a}=r(8285),{isList:l,isValue:c,isGraph:u,isSimpleGraph:h,isSubjectReference:d}=r(478),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:m}=r(2182),{removeBase:v,prependBase:b}=r(3866),{REGEX_KEYWORD:w,addValue:x,asArray:_,compareShortestLeast:j}=r(4768),T={};function N(e,t,r){if("@nest"!==f(e,t,{vocab:!0},r))throw new n("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=T,T.compact=async({activeCtx:e,activeProperty:t=null,element:r,options:f={}})=>{if(i(r)){let n=[];for(let i=0;i<r.length;++i){const o=await T.compact({activeCtx:e,activeProperty:t,element:r[i],options:f});null!==o&&n.push(o)}return f.compactArrays&&1===n.length&&0===(p(e,t,"@container")||[]).length&&(n=n[0]),n}const v=p(e,t,"@context");if(a(v)||(e=await y({activeCtx:e,localCtx:v,propagate:!0,overrideProtected:!0,options:f})),o(r)){if(f.link&&"@id"in r&&f.link.hasOwnProperty(r["@id"])){const e=f.link[r["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===r)return e[t].compacted}if(c(r)||d(r)){const n=T.compactValue({activeCtx:e,activeProperty:t,value:r,options:f});return f.link&&d(r)&&(f.link.hasOwnProperty(r["@id"])||(f.link[r["@id"]]=[]),f.link[r["@id"]].push({expanded:r,compacted:n})),n}if(l(r)&&(p(e,t,"@container")||[]).includes("@list"))return T.compact({activeCtx:e,activeProperty:t,element:r["@list"],options:f});const v="@reverse"===t,b={},w=e;c(r)||d(r)||(e=e.revertToPreviousContext());const j=p(w,t,"@context");a(j)||(e=await y({activeCtx:e,localCtx:j,propagate:!0,overrideProtected:!0,options:f})),f.link&&"@id"in r&&(f.link.hasOwnProperty(r["@id"])||(f.link[r["@id"]]=[]),f.link[r["@id"]].push({expanded:r,compacted:b}));let A=r["@type"]||[];A.length>1&&(A=Array.from(A).sort());const E=e;for(const t of A){const r=T.compactIri({activeCtx:E,iri:t,relativeTo:{vocab:!0}}),n=p(w,r,"@context");a(n)||(e=await y({activeCtx:e,localCtx:n,options:f,propagate:!1}))}const O=Object.keys(r).sort();for(const a of O){const d=r[a];if("@id"!==a)if("@type"!==a)if("@reverse"!==a)if("@preserve"!==a)if("@index"!==a)if("@graph"!==a&&"@list"!==a&&"@included"!==a&&g(a)){const t=T.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,t,d)}else{if(!i(d))throw new n("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===d.length){const t=T.compactIri({activeCtx:e,iri:a,value:d,relativeTo:{vocab:!0},reverse:v}),r=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let n=b;r&&(N(e,r,f),o(b[r])||(b[r]={}),n=b[r]),x(n,t,d,{propertyIsArray:!0})}for(const t of d){const r=T.compactIri({activeCtx:e,iri:a,value:t,relativeTo:{vocab:!0},reverse:v}),n=e.mappings.has(r)?e.mappings.get(r)["@nest"]:null;let d=b;n&&(N(e,n,f),o(b[n])||(b[n]={}),d=b[n]);const g=p(e,r,"@container")||[],y=u(t),m=l(t);let w;m?w=t["@list"]:y&&(w=t["@graph"]);let j=await T.compact({activeCtx:e,activeProperty:r,element:m||y?w:t,options:f});if(m){if(i(j)||(j=[j]),g.includes("@list")){x(d,r,j,{valueIsArray:!0,allowDuplicate:!0});continue}j={[T.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:j},"@index"in t&&(j[T.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 n;d.hasOwnProperty(r)?n=d[r]:d[r]=n={};const i=(g.includes("@id")?t["@id"]:t["@index"])||T.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});x(n,i,j,{propertyIsArray:!f.compactArrays||g.includes("@set")})}else g.includes("@graph")&&h(t)?(i(j)&&j.length>1&&(j={"@included":j}),x(d,r,j,{propertyIsArray:!f.compactArrays||g.includes("@set")})):(i(j)&&1===j.length&&f.compactArrays&&(j=j[0]),j={[T.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:j},"@id"in t&&(j[T.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(j[T.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),x(d,r,j,{propertyIsArray:!f.compactArrays||g.includes("@set")}));else if(g.includes("@language")||g.includes("@index")||g.includes("@id")||g.includes("@type")){let n,i;if(d.hasOwnProperty(r)?n=d[r]:d[r]=n={},g.includes("@language"))c(j)&&(j=j["@value"]),i=t["@language"];else if(g.includes("@index")){const n=p(e,r,"@index")||"@index",o=T.compactIri({activeCtx:e,iri:n,relativeTo:{vocab:!0}});if("@index"===n)i=t["@index"],delete j[o];else{let e;if([i,...e]=_(j[n]||[]),s(i))switch(e.length){case 0:delete j[n];break;case 1:j[n]=e[0];break;default:j[n]=e}else i=null}}else if(g.includes("@id")){const t=T.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=j[t],delete j[t]}else if(g.includes("@type")){const n=T.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let o;switch([i,...o]=_(j[n]||[]),o.length){case 0:delete j[n];break;case 1:j[n]=o[0];break;default:j[n]=o}1===Object.keys(j).length&&"@id"in t&&(j=await T.compact({activeCtx:e,activeProperty:r,element:{"@id":t["@id"]},options:f}))}i||(i=T.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),x(n,i,j,{propertyIsArray:g.includes("@set")})}else{const e=!f.compactArrays||g.includes("@set")||g.includes("@list")||i(j)&&0===j.length||"@list"===a||"@graph"===a;x(d,r,j,{propertyIsArray:e})}}}else{if((p(e,t,"@container")||[]).includes("@index"))continue;const r=T.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,r,d)}else{const r=await T.compact({activeCtx:e,activeProperty:t,element:d,options:f});i(r)&&0===r.length||x(b,a,r)}else{const t=await T.compact({activeCtx:e,activeProperty:"@reverse",element:d,options:f});for(const r in t)if(e.mappings.has(r)&&e.mappings.get(r).reverse){const n=t[r],i=(p(e,r,"@container")||[]).includes("@set")||!f.compactArrays;x(b,r,n,{propertyIsArray:i}),delete t[r]}if(Object.keys(t).length>0){const r=T.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,r,t)}}else{let t=_(d).map((e=>T.compactIri({activeCtx:w,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const r=T.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),n=(p(e,r,"@container")||[]).includes("@set")&&m(e,1.1)||i(t)&&0===d.length;x(b,r,t,{propertyIsArray:n})}else{let t=_(d).map((t=>T.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:f.base})));1===t.length&&(t=t[0]),b[T.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return b}return r},T.compactIri=({activeCtx:e,iri:t,value:r=null,relativeTo:i={vocab:!1},reverse:s=!1,base:a=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 n=e["@language"]||"@none",i=[];o(r)&&"@index"in r&&!("@graph"in r)&&i.push("@index","@index@set"),o(r)&&"@preserve"in r&&(r=r["@preserve"][0]),u(r)?("@index"in r&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in r||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r||i.push("@graph@id","@graph@id@set")):o(r)&&!c(r)&&i.push("@id","@id@set","@type","@set@type");let a="@language",h="@null";if(s)a="@type",h="@reverse",i.push("@set");else if(l(r)){"@index"in r||i.push("@list");const e=r["@list"];if(0===e.length)a="@any",h="@none";else{let t=0===e.length?n:null,r=null;for(let n=0;n<e.length;++n){const i=e[n];let o="@none",s="@none";if(c(i)?"@direction"in i?o=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`:"@language"in i?o=i["@language"].toLowerCase():"@type"in i?s=i["@type"]:o="@null":s="@id",null===t?t=o:o!==t&&c(i)&&(t="@none"),null===r?r=s:s!==r&&(r="@none"),"@none"===t&&"@none"===r)break}t=t||"@none",r=r||"@none","@none"!==r?(a="@type",h=r):h=t}}else{if(c(r))if("@language"in r&&!("@index"in r)){i.push("@language","@language@set"),h=r["@language"];const e=r["@direction"];e&&(h=`${h}_${e}`)}else"@direction"in r&&!("@index"in r)?h=`_${r["@direction"]}`:"@type"in r&&(a="@type",h=r["@type"]);else a="@type",h="@id";i.push("@set")}i.push("@none"),o(r)&&!("@index"in r)&&i.push("@index","@index@set"),c(r)&&1===Object.keys(r).length&&i.push("@language","@language@set");const d=function(e,t,r,n,i,s){null===s&&(s="@null");const a=[];if(("@id"===s||"@reverse"===s)&&o(r)&&"@id"in r){"@reverse"===s&&a.push("@reverse");const t=T.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===r["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}else{a.push(s);const e=a.find((e=>e.includes("_")));e&&a.push(e.replace(/^[^_]+_/,"_"))}a.push("@none");const l=e.inverse[t];for(const e of n){if(!(e in l))continue;const t=l[e][i];for(const e of a)if(e in t)return t[e]}return null}(e,t,r,i,a,h);if(null!==d)return d}if(i.vocab&&"@vocab"in e){const r=e["@vocab"];if(0===t.indexOf(r)&&t!==r){const n=t.substr(r.length);if(!e.mappings.has(n))return n}}let d=null;const f=[];let p=e.fastCurieMap;const y=t.length-1;for(let e=0;e<y&&t[e]in p;++e)p=p[t[e]],""in p&&f.push(p[""][0]);for(let n=f.length-1;n>=0;--n){const i=f[n],o=i.terms;for(const n of o){const o=n+":"+t.substr(i.iri.length);e.mappings.get(n)._prefix&&(!e.mappings.has(o)||null===r&&e.mappings.get(o)["@id"]===t)&&(null===d||j(o,d)<0)&&(d=o)}}if(null!==d)return d;for(const[r,i]of e.mappings)if(i&&i._prefix&&t.startsWith(r+":"))throw new n(`Absolute IRI "${t}" confused with prefix "${r}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!i.vocab){if("@base"in e){if(e["@base"]){const r=v(b(a,e["@base"]),t);return w.test(r)?`./${r}`:r}return t}return v(a,t)}return t},T.compactValue=({activeCtx:e,activeProperty:t,value:r,options:n})=>{if(c(r)){const n=p(e,t,"@type"),i=p(e,t,"@language"),o=p(e,t,"@direction"),a=p(e,t,"@container")||[],l="@index"in r&&!a.includes("@index");if(!l&&"@none"!==n){if(r["@type"]===n)return r["@value"];if("@language"in r&&r["@language"]===i&&"@direction"in r&&r["@direction"]===o)return r["@value"];if("@language"in r&&r["@language"]===i)return r["@value"];if("@direction"in r&&r["@direction"]===o)return r["@value"]}const c=Object.keys(r).length,u=1===c||2===c&&"@index"in r&&!l,h="@language"in e,d=s(r["@value"]),f=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(u&&"@none"!==n&&(!h||!d||f))return r["@value"];const g={};return l&&(g[T.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=r["@index"]),"@type"in r?g[T.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=T.compactIri({activeCtx:e,iri:r["@type"],relativeTo:{vocab:!0}}):"@language"in r&&(g[T.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=r["@language"]),"@direction"in r&&(g[T.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=r["@direction"]),g[T.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=r["@value"],g}const i=f(e,t,{vocab:!0},n),o=p(e,t,"@type"),a=T.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:"@vocab"===o},base:n.base});return"@id"===o||"@vocab"===o||"@graph"===i?a:{[T.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:a}}},2445:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},2182:(e,t,r)=>{"use strict";const n=r(4768),i=r(9699),{isArray:o,isObject:s,isString:a,isUndefined:l}=r(8285),{isAbsolute:c,isRelative:u,prependBase:h}=r(3866),{handleEvent:d}=r(5746),{REGEX_BCP47:f,REGEX_KEYWORD:p,asArray:g,compareShortestLeast:y}=r(4768),m=new Map,v={};function b(e,t,r,n,i,o){if(null===t||!a(t)||v.isKeyword(t))return t;if(t.match(p))return null;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&v.createTermDefinition({activeCtx:e,localCtx:n,term:t,defined:i,options:o}),(r=r||{}).vocab){const r=e.mappings.get(t);if(null===r)return null;if(s(r)&&"@id"in r)return r["@id"]}const l=t.indexOf(":");if(l>0){const r=t.substr(0,l),s=t.substr(l+1);if("_"===r||0===s.indexOf("//"))return t;n&&n.hasOwnProperty(r)&&v.createTermDefinition({activeCtx:e,localCtx:n,term:r,defined:i,options:o});const a=e.mappings.get(r);if(a&&a._prefix)return a["@id"]+s;if(c(t))return t}if(r.vocab&&"@vocab"in e)t=e["@vocab"]+t;else if(r.base){let r,n;"@base"in e?e["@base"]?(n=h(o.base,e["@base"]),r=h(n,t)):(n=e["@base"],r=t):(n=o.base,r=h(o.base,t)),t=r}return t}function w(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!w(e[r],t[r]))return!1;return!0}const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r in e){let n=e[r],i=t[r];if("@container"===r&&Array.isArray(n)&&Array.isArray(i)&&(n=n.slice().sort(),i=i.slice().sort()),!w(n,i))return!1}return!0}e.exports=v,v.process=async({activeCtx:e,localCtx:t,options:r,propagate:n=!0,overrideProtected:l=!1,cycles:p=new Set})=>{if(s(t)&&"@context"in t&&o(t["@context"])&&(t=t["@context"]),0===g(t).length)return e;const y=[],m=[({event:e,next:t})=>{y.push(e),t()}];r.eventHandler&&m.push(r.eventHandler);const w=r;r={...r,eventHandler:m};const x=await r.contextResolver.resolve({activeCtx:e,context:t,documentLoader:r.documentLoader,base:r.base});s(x[0].document)&&"boolean"==typeof x[0].document["@propagate"]&&(n=x[0].document["@propagate"]);let _=e;n||_.previousContext||(_=_.clone(),_.previousContext=e);for(const n of x){let{document:o}=n;if(e=_,null===o){if(!l&&0!==Object.keys(e.protected).length)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});_=e=v.getInitialContext(r).clone();continue}const g=n.getProcessed(e);if(g){if(w.eventHandler)for(const e of g.events)d({event:e,options:w});_=e=g.context;continue}if(s(o)&&"@context"in o&&(o=o["@context"]),!s(o))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:o});_=_.clone();const m=new Map;if("@version"in o){if(1.1!==o["@version"])throw new i("Unsupported JSON-LD version: "+o["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:o});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+o["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:o});_.processingMode="json-ld-1.1",_["@version"]=o["@version"],m.set("@version",!0)}if(_.processingMode=_.processingMode||e.processingMode,"@base"in o){let e=o["@base"];if(null===e||c(e));else{if(!u(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:o});e=h(_["@base"],e)}_["@base"]=e,m.set("@base",!0)}if("@vocab"in o){const e=o["@vocab"];if(null===e)delete _["@vocab"];else{if(!a(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:o});if(!c(e)&&v.processingMode(_,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:o});{const t=b(_,e,{vocab:!0,base:!0},void 0,void 0,r);c(t)||r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:r}),_["@vocab"]=t}}m.set("@vocab",!0)}if("@language"in o){const e=o["@language"];if(null===e)delete _["@language"];else{if(!a(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:o});e.match(f)||r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:r}),_["@language"]=e.toLowerCase()}m.set("@language",!0)}if("@direction"in o){const t=o["@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:o});if(null===t)delete _["@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:o});_["@direction"]=t}m.set("@direction",!0)}if("@propagate"in o){const r=o["@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:o});if("boolean"!=typeof r)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});m.set("@propagate",!0)}if("@import"in o){const n=o["@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:o});if(!a(n))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const s=await r.contextResolver.resolve({activeCtx:e,context:n,documentLoader:r.documentLoader,base:r.base});if(1!==s.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const l=s[0].getProcessed(e);if(l)o=l;else{const r=s[0].document;if("@import"in r)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 r)o.hasOwnProperty(e)||(o[e]=r[e]);s[0].setProcessed(e,o)}m.set("@import",!0)}m.set("@protected",o["@protected"]||!1);for(const e in o)if(v.createTermDefinition({activeCtx:_,localCtx:o,term:e,defined:m,options:r,overrideProtected:l}),s(o[e])&&"@context"in o[e]){const t=o[e]["@context"];let n=!0;if(a(t)){const e=h(r.base,t);p.has(e)?n=!1:p.add(e)}if(n)try{await v.process({activeCtx:_.clone(),localCtx:o[e]["@context"],overrideProtected:!0,options:r,cycles:p})}catch(t){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:o[e]["@context"],term:e})}}n.setProcessed(e,{context:_,events:y})}return _},v.createTermDefinition=({activeCtx:e,localCtx:t,term:r,defined:n,options:l,overrideProtected:u=!1})=>{if(n.has(r)){if(n.get(r))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:r})}let h;if(n.set(r,!1),t.hasOwnProperty(r)&&(h=t[r]),"@type"===r&&s(h)&&"@set"===(h["@container"]||"@set")&&v.processingMode(e,1.1)){const e=["@container","@id","@protected"],n=Object.keys(h);if(0===n.length||n.some((t=>!e.includes(t))))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r})}else{if(v.isKeyword(r))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r});if(r.match(p))return void(l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:r}},options:l}));if(""===r)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const f=e.mappings.get(r);e.mappings.has(r)&&e.mappings.delete(r);let g=!1;if((a(h)||null===h)&&(g=!0,h={"@id":h}),!s(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 y={};e.mappings.set(r,y),y.reverse=!1;const m=["@container","@id","@language","@reverse","@type"];v.processingMode(e,1.1)&&m.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in h)if(!m.includes(e))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const x=r.indexOf(":");if(y._termHasColon=x>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(!a(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(o.match(p))return l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:o}},options:l}),void(f?e.mappings.set(r,f):e.mappings.delete(r));const s=b(e,o,{vocab:!0,base:!1},t,n,l);if(!c(s))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});y["@id"]=s,y.reverse=!0}else if("@id"in h){let o=h["@id"];if(o&&!a(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)y["@id"]=null;else{if(!v.isKeyword(o)&&o.match(p))return l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:o}},options:l}),void(f?e.mappings.set(r,f):e.mappings.delete(r));if(o!==r){if(o=b(e,o,{vocab:!0,base:!1},t,n,l),!c(o)&&!v.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(r.match(/(?::[^:])|\//)&&b(e,r,{vocab:!0,base:!1},t,new Map(n).set(r,!0),l)!==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});y["@id"]=o,y._prefix=g&&!y._termHasColon&&o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in y))if(y._termHasColon){const i=r.substr(0,x);if(t.hasOwnProperty(i)&&v.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:n,options:l}),e.mappings.has(i)){const t=r.substr(x+1);y["@id"]=e.mappings.get(i)["@id"]+t}else y["@id"]=r}else if("@type"===r)y["@id"]=r;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:r});y["@id"]=e["@vocab"]+r}if((!0===h["@protected"]||!0===n.get("@protected")&&!1!==h["@protected"])&&(e.protected[r]=!0,y.protected=!0),n.set(r,!0),"@type"in h){let r=h["@type"];if(!a(r))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"===r||"@none"===r){if(v.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${r}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==r&&"@vocab"!==r){if(r=b(e,r,{vocab:!0,base:!1},t,n,l),!c(r))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===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:t})}y["@type"]=r}if("@container"in h){const r=a(h["@container"])?[h["@container"]]:h["@container"]||[],n=["@list","@set","@index","@language"];let s=!0;const l=r.includes("@set");if(v.processingMode(e,1.1)){if(n.push("@graph","@id","@type"),r.includes("@list")){if(1!==r.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(r.includes("@graph")){if(r.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 s&=r.length<=(l?2:1);if(r.includes("@type")&&(y["@type"]=y["@type"]||"@id",!["@id","@vocab"].includes(y["@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 s&=!o(h["@container"]),s&=r.length<=1;if(s&=r.every((e=>n.includes(e))),s&=!(l&&r.includes("@list")),!s)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+n.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(y.reverse&&!r.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});y["@container"]=r}if("@index"in h){if(!("@container"in h)||!y["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!a(h["@index"])||0===h["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});y["@index"]=h["@index"]}if("@context"in h&&(y["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let e=h["@language"];if(null!==e&&!a(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()),y["@language"]=e}if("@prefix"in h){if(r.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(v.isKeyword(y["@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});y._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});y["@direction"]=e}if("@nest"in h){const e=h["@nest"];if(!a(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});y["@nest"]=e}const _=y["@id"];if("@context"===_||"@preserve"===_)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(f&&f.protected&&!u&&(e.protected[r]=!0,y.protected=!0,!w(f,y)))throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:r})},v.expandIri=(e,t,r,n)=>b(e,t,r,void 0,void 0,n),v.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),r=m.get(t);if(r)return r;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},r=e.fastCurieMap={},n={},i=(e["@language"]||"@none").toLowerCase(),a=e["@direction"],l=e.mappings,c=[...l.keys()].sort(y);for(const e of c){const o=l.get(e);if(null===o)continue;let c=o["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===o["@id"])continue;const u=g(o["@id"]);for(const l of u){let u=t[l];const h=v.isKeyword(l);if(u)h||o._termHasColon||n[l].push(e);else if(t[l]=u={},!h&&!o._termHasColon){n[l]=[e];const t={iri:l,terms:n[l]};l[0]in r?r[l[0]].push(t):r[l[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],s(e,u["@any"],"@none"),o.reverse)s(e,u["@type"],"@reverse");else if("@none"===o["@type"])s(e,u["@any"],"@none"),s(e,u["@language"],"@none"),s(e,u["@type"],"@none");else if("@type"in o)s(e,u["@type"],o["@type"]);else if("@language"in o&&"@direction"in o){const t=o["@language"],r=o["@direction"];s(e,u["@language"],t&&r?`${t}_${r}`.toLowerCase():t?t.toLowerCase():r?`_${r}`:"@null")}else"@language"in o?s(e,u["@language"],(o["@language"]||"@null").toLowerCase()):"@direction"in o?o["@direction"]?s(e,u["@language"],`_${o["@direction"]}`):s(e,u["@language"],"@none"):a?(s(e,u["@language"],`_${a}`),s(e,u["@language"],"@none"),s(e,u["@type"],"@none")):(s(e,u["@language"],i),s(e,u["@language"],"@none"),s(e,u["@type"],"@none"))}}for(const e in r)o(r,e,1);return t},clone:function(){const 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===m.size&&m.clear(),m.set(t,i),i;function o(e,t,r){const n=e[t],i=e[t]={};let s,a;for(const e of n)s=e.iri,a=r>=s.length?"":s[r],a in i?i[a].push(e):i[a]=[e];for(const e in i)""!==e&&o(i,e,r+1)}function s(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},v.getContextValue=(e,t,r)=>{if(null===t){if("@context"===r)return;return null}if(e.mappings.has(t)){const n=e.mappings.get(t);if(l(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},v.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,v.isKeyword=e=>{if(!a(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}},2872:(e,t,r)=>{"use strict";const{parseLinkHeader:n,buildHeaders:i}=r(4768),{LINK_HEADER_CONTEXT:o}=r(2445),s=r(9699),a=r(3114),{prependBase:l}=r(3866),c=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:r}={headers:{}})=>(t=i(t),(new a).wrapLoader((async function i(a){if(0!==a.indexOf("http:")&&0!==a.indexOf("https:"))throw new s('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:a});if(e&&0!==a.indexOf("https"))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});let u;try{u=await function(e,t,r){const n=new(e=e||XMLHttpRequest);return new Promise(((e,i)=>{n.onload=()=>e(n),n.onerror=e=>i(e),n.open("GET",t,!0);for(const e in r)n.setRequestHeader(e,r[e]);n.send()}))}(r,a,t)}catch(e){throw new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:a,cause:e})}if(u.status>=400)throw new s("URL could not be dereferenced: "+u.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:a,httpStatusCode:u.status});let h={contextUrl:null,documentUrl:a,document:u.response},d=null;const f=u.getResponseHeader("Content-Type");let p;if(c.test(u.getAllResponseHeaders())&&(p=u.getResponseHeader("Link")),p&&"application/ld+json"!==f){const e=n(p),t=e[o];if(Array.isArray(t))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});t&&(h.contextUrl=t.target),d=e.alternate,d&&"application/ld+json"==d.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(h=await i(l(a,d.target)))}return h})))},5746:(e,t,r)=>{"use strict";var n=r(292);const i=r(9699),{isArray:o}=r(8285),{asArray:s}=r(4768),a={};function l({event:e,handlers:t}){let r=!0;for(let n=0;r&&n<t.length;++n){r=!1;const s=t[n];if(o(s))r=l({event:e,handlers:s});else if("function"==typeof s)s({event:e,next:()=>{r=!0}});else{if("object"!=typeof s)throw new i("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in s?s[e.code]({event:e,next:()=>{r=!0}}):r=!0}}return r}e.exports=a,a.defaultEventHandler=null,a.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?a.safeEventHandler:[],e.eventHandler?s(e.eventHandler):[],a.defaultEventHandler?a.defaultEventHandler:[]);return 0===t.length?null:t},a.handleEvent=({event:e,options:t})=>{l({event:e,handlers:t.eventHandler})};const c=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference"]);a.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&c.has(e.code))throw new i("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},a.logEventHandler=function({event:e,next:t}){n.log(`EVENT: ${e.message}`,{event:e}),t()},a.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&n.warn(`WARNING: ${e.message}`,{event:e}),t()},a.unhandledEventHandler=function({event:e}){throw new i("No handler for event.","jsonld.UnhandledEvent",{event:e})},a.setDefaultEventHandler=function({eventHandler:e}={}){a.defaultEventHandler=e?s(e):null}},570:(e,t,r)=>{"use strict";const n=r(9699),{isArray:i,isObject:o,isEmptyObject:s,isString:a,isUndefined:l}=r(8285),{isList:c,isValue:u,isGraph:h,isSubject:d}=r(478),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:m}=r(2182),{isAbsolute:v}=r(3866),{REGEX_BCP47:b,REGEX_KEYWORD:w,addValue:x,asArray:_,getValues:j,validateTypeValue:T}=r(4768),{handleEvent:N}=r(5746),A={};async function E({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:h,expandedParent:w,options:j={},insideList:O,typeKey:R,typeScopedContext:k}){const C=Object.keys(h).sort(),D=[];let L;const P=h[R]&&"@json"===f(e,i(h[R])?h[R][0]:h[R],{vocab:!0},{...j,typeExpansion:!0});for(const E of C){let O,R=h[E];if("@context"===E)continue;const C=f(e,E,{vocab:!0},j);if(null===C||!v(C)&&!g(C)){j.eventHandler&&N({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:E,expandedProperty:C}},options:j});continue}if(g(C)){if("@reverse"===r)throw new n("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:R});if(C in w&&"@included"!==C&&"@type"!==C)throw new n("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:C})}if("@id"===C){if(!a(R)){if(!j.isFrame)throw new n('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:R});if(o(R)){if(!s(R))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:R})}else{if(!i(R))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:R});if(!R.every((e=>a(e))))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:R})}}x(w,"@id",_(R).map((t=>{if(a(t)){const r=f(e,t,{base:!0},j);return j.eventHandler&&(null===r?N(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:j}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:j}):v(r)||N({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:r}},options:j})),r}return t})),{propertyIsArray:j.isFrame});continue}if("@type"===C){o(R)&&(R=Object.fromEntries(Object.entries(R).map((([e,t])=>[f(k,e,{vocab:!0}),_(t).map((e=>f(k,e,{base:!0,vocab:!0},{...j,typeExpansion:!0})))])))),T(R,j.isFrame),x(w,"@type",_(R).map((e=>{if(a(e)){const t=f(k,e,{base:!0,vocab:!0},{...j,typeExpansion:!0});return v(t)||j.eventHandler&&N({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:j}),t}return e})),{propertyIsArray:j.isFrame});continue}if("@included"===C&&m(e,1.1)){const r=_(await A.expand({activeCtx:e,activeProperty:t,element:R,options:j}));if(!r.every((e=>d(e))))throw new n("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:R});x(w,"@included",r,{propertyIsArray:!0});continue}if("@graph"===C&&!o(R)&&!i(R))throw new n('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:R});if("@value"===C){L=R,P&&m(e,1.1)?w["@value"]=R:x(w,"@value",R,{propertyIsArray:j.isFrame});continue}if("@language"===C){if(null===R)continue;if(!a(R)&&!j.isFrame)throw new n('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:R});R=_(R).map((e=>a(e)?e.toLowerCase():e));for(const e of R)a(e)&&!e.match(b)&&j.eventHandler&&N({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:j});x(w,"@language",R,{propertyIsArray:j.isFrame});continue}if("@direction"===C){if(!a(R)&&!j.isFrame)throw new n('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:R});R=_(R);for(const e of R)if(a(e)&&"ltr"!==e&&"rtl"!==e)throw new n('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:R});x(w,"@direction",R,{propertyIsArray:j.isFrame});continue}if("@index"===C){if(!a(R))throw new n('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:R});x(w,"@index",R);continue}if("@reverse"===C){if(!o(R))throw new n('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:R});if(O=await A.expand({activeCtx:e,activeProperty:"@reverse",element:R,options:j}),"@reverse"in O)for(const e in O["@reverse"])x(w,e,O["@reverse"][e],{propertyIsArray:!0});let t=w["@reverse"]||null;for(const e in O){if("@reverse"===e)continue;null===t&&(t=w["@reverse"]={}),x(t,e,[],{propertyIsArray:!0});const r=O[e];for(let i=0;i<r.length;++i){const o=r[i];if(u(o)||c(o))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:O});x(t,e,o,{propertyIsArray:!0})}}continue}if("@nest"===C){D.push(E);continue}let F=e;const M=p(e,E,"@context");l(M)||(F=await y({activeCtx:e,localCtx:M,propagate:!0,overrideProtected:!0,options:j}));const U=p(F,E,"@container")||[];if(U.includes("@language")&&o(R))O=S(F,R,p(F,E,"@direction"),j);else if(U.includes("@index")&&o(R)){const t=U.includes("@graph"),r=p(F,E,"@index")||"@index",n="@index"!==r&&f(e,r,{vocab:!0},j);O=await I({activeCtx:F,options:j,activeProperty:E,value:R,asGraph:t,indexKey:r,propertyIndex:n})}else if(U.includes("@id")&&o(R)){const e=U.includes("@graph");O=await I({activeCtx:F,options:j,activeProperty:E,value:R,asGraph:e,indexKey:"@id"})}else if(U.includes("@type")&&o(R))O=await I({activeCtx:F.revertToPreviousContext(),options:j,activeProperty:E,value:R,asGraph:!1,indexKey:"@type"});else{const n="@list"===C;if(n||"@set"===C){let e=t;n&&"@graph"===r&&(e=null),O=await A.expand({activeCtx:F,activeProperty:e,element:R,options:j,insideList:n})}else O="@json"===p(e,E,"@type")?{"@type":"@json","@value":R}:await A.expand({activeCtx:F,activeProperty:E,element:R,options:j,insideList:!1})}if(null!==O||"@value"===C)if("@list"!==C&&!c(O)&&U.includes("@list")&&(O={"@list":_(O)}),U.includes("@graph")&&!U.some((e=>"@id"===e||"@index"===e))&&(O=_(O).map((e=>({"@graph":_(e)})))),F.mappings.has(E)&&F.mappings.get(E).reverse){const e=w["@reverse"]=w["@reverse"]||{};O=_(O);for(let t=0;t<O.length;++t){const r=O[t];if(u(r)||c(r))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:O});x(e,C,r,{propertyIsArray:!0})}}else x(w,C,O,{propertyIsArray:!0})}if("@value"in w)if("@json"===w["@type"]&&m(e,1.1));else if((o(L)||i(L))&&!j.isFrame)throw new n('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:L});for(const s of D){const a=i(h[s])?h[s]:[h[s]];for(const i of a){if(!o(i)||Object.keys(i).some((t=>"@value"===f(e,t,{vocab:!0},j))))throw new n("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await E({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:i,expandedParent:w,options:j,insideList:O,typeScopedContext:k,typeKey:R})}}}function O({activeCtx:e,activeProperty:t,value:r,options:n}){if(null==r)return null;const i=f(e,t,{vocab:!0},n);if("@id"===i)return f(e,r,{base:!0},n);if("@type"===i)return f(e,r,{vocab:!0,base:!0},{...n,typeExpansion:!0});const o=p(e,t,"@type");if(("@id"===o||"@graph"===i)&&a(r)){const i=f(e,r,{base:!0},n);return null===i&&r.match(w)&&n.eventHandler&&N({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:n}),{"@id":i}}if("@vocab"===o&&a(r))return{"@id":f(e,r,{vocab:!0,base:!0},n)};if(g(i))return r;const s={};if(o&&!["@id","@vocab","@none"].includes(o))s["@type"]=o;else if(a(r)){const r=p(e,t,"@language");null!==r&&(s["@language"]=r);const n=p(e,t,"@direction");null!==n&&(s["@direction"]=n)}return["boolean","number","string"].includes(typeof r)||(r=r.toString()),s["@value"]=r,s}function S(e,t,r,o){const s=[],l=Object.keys(t).sort();for(const c of l){const l=f(e,c,{vocab:!0},o);let u=t[c];i(u)||(u=[u]);for(const e of u){if(null===e)continue;if(!a(e))throw new n("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const i={"@value":e};"@none"!==l&&(c.match(b)||o.eventHandler&&N({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:c}},options:o}),i["@language"]=c.toLowerCase()),r&&(i["@direction"]=r),s.push(i)}}return s}async function I({activeCtx:e,options:t,activeProperty:r,value:o,asGraph:s,indexKey:a,propertyIndex:c}){const d=[],g=Object.keys(o).sort(),m="@type"===a;for(let v of g){if(m){const r=p(e,v,"@context");l(r)||(e=await y({activeCtx:e,localCtx:r,propagate:!1,options:t}))}let g,b=o[v];i(b)||(b=[b]),b=await A.expand({activeCtx:e,activeProperty:r,element:b,options:t,insideList:!1,insideIndex:!0}),g=c?"@none"===v?"@none":O({activeCtx:e,activeProperty:a,value:v,options:t}):f(e,v,{vocab:!0},t),"@id"===a?v=f(e,v,{base:!0},t):m&&(v=g);for(let e of b){if(s&&!h(e)&&(e={"@graph":[e]}),"@type"===a)"@none"===g||(e["@type"]?e["@type"]=[v].concat(e["@type"]):e["@type"]=[v]);else{if(u(e)&&!["@language","@type","@index"].includes(a))throw new n(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${a}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});c?"@none"!==g&&x(e,c,g,{propertyIsArray:!0,prependValue:!0}):"@none"===g||a in e||(e[a]=v)}d.push(e)}}return d}e.exports=A,A.expand=async({activeCtx:e,activeProperty:t=null,element:r,options:c={},insideList:u=!1,insideIndex:h=!1,typeScopedContext:d=null})=>{if(null==r)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!i(r)&&!o(r))return u||null!==t&&"@graph"!==f(e,t,{vocab:!0},c)?O({activeCtx:e,activeProperty:t,value:r,options:c}):(c.eventHandler&&N({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:r}},options:c}),null);if(i(r)){let n=[];const o=p(e,t,"@container")||[];u=u||o.includes("@list");for(let o=0;o<r.length;++o){let s=await A.expand({activeCtx:e,activeProperty:t,element:r[o],options:c,insideIndex:h,typeScopedContext:d});u&&i(s)&&(s={"@list":s}),null!==s&&(i(s)?n=n.concat(s):n.push(s))}return n}const g=f(e,t,{vocab:!0},c),b=p(e,t,"@context");d=d||(e.previousContext?e:null);let w=Object.keys(r).sort(),x=!h;if(x&&d&&w.length<=2&&!w.includes("@context"))for(const t of w){const r=f(d,t,{vocab:!0},c);if("@value"===r){x=!1,e=d;break}if("@id"===r&&1===w.length){x=!1;break}}x&&(e=e.revertToPreviousContext()),l(b)||(e=await y({activeCtx:e,localCtx:b,propagate:!0,overrideProtected:!0,options:c})),"@context"in r&&(e=await y({activeCtx:e,localCtx:r["@context"],options:c})),d=e;let T=null;for(const t of w)if("@type"===f(e,t,{vocab:!0},c)){T=T||t;const n=r[t],i=Array.isArray(n)?n.length>1?n.slice().sort():n:[n];for(const t of i){const r=p(d,t,"@context");l(r)||(e=await y({activeCtx:e,localCtx:r,options:c,propagate:!1}))}}let S={};await E({activeCtx:e,activeProperty:t,expandedActiveProperty:g,element:r,expandedParent:S,options:c,insideList:u,typeKey:T,typeScopedContext:d}),w=Object.keys(S);let I=w.length;if("@value"in S){if("@type"in S&&("@language"in S||"@direction"in S))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:S});let t=I-1;if("@type"in S&&(t-=1),"@index"in S&&(t-=1),"@language"in S&&(t-=1),"@direction"in S&&(t-=1),0!==t)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:S});const r=null===S["@value"]?[]:_(S["@value"]),i=j(S,"@type");if(m(e,1.1)&&i.includes("@json")&&1===i.length);else if(0===r.length)c.eventHandler&&N({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:S}},options:c}),S=null;else{if(!r.every((e=>a(e)||s(e)))&&"@language"in S)throw new n("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:S});if(!i.every((e=>v(e)&&!(a(e)&&0===e.indexOf("_:"))||s(e))))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:S})}}else if("@type"in S&&!i(S["@type"]))S["@type"]=[S["@type"]];else if("@set"in S||"@list"in S){if(I>1&&(2!==I||!("@index"in S)))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:S});"@set"in S&&(S=S["@set"],w=Object.keys(S),I=w.length)}else 1===I&&"@language"in S&&(c.eventHandler&&N({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:S}},options:c}),S=null);if(o(S)&&!c.keepFreeFloatingNodes&&!u&&(null===t||"@graph"===g)&&(0===I||"@value"in S||"@list"in S||1===I&&"@id"in S)){if(c.eventHandler){let e,t;0===I?(e="empty object",t="Dropping empty object."):"@value"in S?(e="object with only @value",t="Dropping object with only @value."):"@list"in S?(e="object with only @list",t="Dropping object with only @list."):1===I&&"@id"in S&&(e="object with only @id",t="Dropping object with only @id."),N({event:{type:["JsonLdEvent"],code:e,level:"warning",message:t,details:{value:S}},options:c})}S=null}return S}},1409:(e,t,r)=>{"use strict";const{isSubjectReference:n}=r(478),{createMergedNodeMap:i}=r(9646),o={};e.exports=o,o.flatten=e=>{const t=i(e),r=[],o=Object.keys(t).sort();for(let e=0;e<o.length;++e){const i=t[o[e]];n(i)||r.push(i)}return r}},1849:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),s=r(4768),a=r(3866),l=r(9699),{createNodeMap:c,mergeNodeMapGraphs:u}=r(9646),h={};function d(e){const t={};for(const r in e)void 0!==e[r]&&(t["@"+r]=[e[r]]);return[t]}function f(e,t,r){for(let n=r.length-1;n>=0;--n){const i=r[n];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function p(e,t,r){const n="@"+r;let 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 l("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 l("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 s.asArray(e[0]["@id"]))if(!o.isObject(t)&&!a.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of s.asArray(e[0]["@type"]))if(!o.isObject(t)&&!a.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function y(e,t,r,a){let l=!0,c=!1;for(const u in r){let h=!1;const d=s.getValues(t,u),f=0===s.getValues(r,u).length;if("@id"===u){if(o.isEmptyObject(r["@id"][0]||{})?h=!0:r["@id"].length>=0&&(h=r["@id"].includes(d[0])),!a.requireAll)return h}else if("@type"===u){if(l=!1,f){if(d.length>0)return!1;h=!0}else if(1===r["@type"].length&&o.isEmptyObject(r["@type"][0]))h=d.length>0;else for(const e of r["@type"])h=!(!o.isObject(e)||!("@default"in e))||h||d.some((t=>t===e));if(!a.requireAll)return h}else{if(n(u))continue;{const t=s.getValues(r,u)[0];let n=!1;if(t&&(g([t]),n="@default"in t),l=!1,0===d.length&&n)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 r=t["@list"][0];if(i.isList(d[0])){const t=d[0]["@list"];i.isValue(r)?h=t.some((e=>x(r,e))):(i.isSubject(r)||i.isSubjectReference(r))&&(h=t.some((t=>w(e,r,t,a))))}}else h=i.isValue(t)?d.some((e=>x(t,e))):i.isSubjectReference(t)?d.some((r=>w(e,t,r,a))):!!o.isObject(t)&&d.length>0}}if(!h&&a.requireAll)return!1;c=c||h}return l||c}function m(e,t){const r=e.uniqueEmbeds[e.graph],n=r[t],i=n.parent,a=n.property,l={"@id":t};if(o.isArray(i)){for(let e=0;e<i.length;++e)if(s.compareValues(i[e],l)){i[e]=l;break}}else{const e=o.isArray(i[a]);s.removeValue(i,a,l,{propertyIsArray:e}),s.addValue(i,a,l,{propertyIsArray:e})}const c=e=>{const t=Object.keys(r);for(const n of t)n in r&&o.isObject(r[n].parent)&&r[n].parent["@id"]===e&&(delete r[n],c(n))};c(t)}function v(e,t){if(o.isArray(e))return e.map((e=>v(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"]=v(e["@list"],t),e;if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)"@id"===r&&t.bnodesToClear.includes(e[r])?delete e["@id"]:e[r]=v(e[r],t)}return e}function b(e,t,r){o.isObject(e)?s.addValue(e,t,r,{propertyIsArray:!0}):e.push(r)}function w(e,t,r,n){if(!("@id"in r))return!1;const i=e.subjects[r["@id"]];return i&&y(e,i,t,n)}function x(e,t){const r=t["@value"],n=t["@type"],i=t["@language"],s=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],a=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],l=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===s.length&&0===a.length&&0===l.length||!(!s.includes(r)&&!o.isEmptyObject(s[0]))&&!!(!n&&0===a.length||a.includes(n)||n&&o.isEmptyObject(a[0]))&&!!(!i&&0===l.length||l.includes(i)||i&&o.isEmptyObject(l[0]))}e.exports=h,h.frameMergedOrDefault=(e,t,r)=>{const n={options:r,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new s.IdentifierIssuer("_:b");c(e,n.graphMap,"@default",i),r.merged&&(n.graphMap["@merged"]=u(n.graphMap),n.graph="@merged"),n.subjects=n.graphMap[n.graph];const o=[];return h.frame(n,Object.keys(n.subjects).sort(),t,o),r.pruneBlankNodeIdentifiers&&(r.bnodesToClear=Object.keys(n.bnodeMap).filter((e=>1===n.bnodeMap[e].length))),r.link={},v(o,r)},h.frame=(e,t,r,a,c=null)=>{g(r),r=r[0];const u=e.options,v={embed:p(r,u,"embed"),explicit:p(r,u,"explicit"),requireAll:p(r,u,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const w=e.link[e.graph],_=function(e,t,r,n){const i={};for(const o of t){const t=e.graphMap[e.graph][o];y(e,t,r,n)&&(i[o]=t)}return i}(e,t,r,v),j=Object.keys(_).sort();for(const g of j){const y=_[g];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===v.embed&&g in w){b(a,c,w[g]);continue}const j={"@id":g};if(0===g.indexOf("_:")&&s.addValue(e.bnodeMap,g,j,{propertyIsArray:!0}),w[g]=j,("@first"===v.embed||"@last"===v.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:r});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(g))if(!e.embedded||"@never"!==v.embed&&!f(y,e.graph,e.subjectStack))if(!e.embedded||"@first"!=v.embed&&"@once"!=v.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(g)){if("@last"===v.embed&&g in e.uniqueEmbeds[e.graph]&&m(e,g),e.uniqueEmbeds[e.graph][g]={parent:a,property:c},e.subjectStack.push({subject:y,graph:e.graph}),g in e.graphMap){let t=!1,n=null;"@graph"in r?(n=r["@graph"][0],t=!("@merged"===g||"@default"===g),o.isObject(n)||(n={})):(t="@merged"!==e.graph,n={}),t&&h.frame({...e,graph:g,embedded:!1},Object.keys(e.graphMap[g]).sort(),[n],j,"@graph")}"@included"in r&&h.frame({...e,embedded:!1},t,r["@included"],j,"@included");for(const t of Object.keys(y).sort())if(n(t)){if(j[t]=s.clone(y[t]),"@type"===t)for(const t of y["@type"])0===t.indexOf("_:")&&s.addValue(e.bnodeMap,t,j,{propertyIsArray:!0})}else if(!v.explicit||t in r)for(const n of y[t]){const o=t in r?r[t]:d(v);if(i.isList(n)){const o=r[t]&&r[t][0]&&r[t][0]["@list"]?r[t][0]["@list"]:d(v),a={"@list":[]};b(j,t,a);const l=n["@list"];for(const t of l)i.isSubjectReference(t)?h.frame({...e,embedded:!0},[t["@id"]],o,a,"@list"):b(a,"@list",s.clone(t))}else i.isSubjectReference(n)?h.frame({...e,embedded:!0},[n["@id"]],o,j,t):x(o[0],n)&&b(j,t,s.clone(n))}for(const e of Object.keys(r).sort()){if("@type"===e){if(!o.isObject(r[e][0])||!("@default"in r[e][0]))continue}else if(n(e))continue;const t=r[e][0]||{};if(!p(t,u,"omitDefault")&&!(e in j)){let r="@null";"@default"in t&&(r=s.clone(t["@default"])),o.isArray(r)||(r=[r]),j[e]=[{"@preserve":r}]}}for(const t of Object.keys(r["@reverse"]||{}).sort()){const n=r["@reverse"][t];for(const r of Object.keys(e.subjects))s.getValues(e.subjects[r],t).some((e=>e["@id"]===g))&&(j["@reverse"]=j["@reverse"]||{},s.addValue(j["@reverse"],t,[],{propertyIsArray:!0}),h.frame({...e,embedded:!0},[r],n,j["@reverse"][t],c))}b(a,c,j),e.subjectStack.pop()}else b(a,c,j);else b(a,c,j)}},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 r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)e[r]=h.cleanupNull(e[r],t)}return e}},1176:(e,t,r)=>{"use strict";const n=r(9699),i=r(478),o=r(8285),{REGEX_BCP47:s,addValue:a}=r(4768),{handleEvent:l}=r(5746),{RDF_LIST:c,RDF_FIRST:u,RDF_REST:h,RDF_NIL:d,RDF_TYPE:f,RDF_JSON_LITERAL:p,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:m,XSD_STRING:v}=r(2445),b={};function w(e,t,r,i){if(e.termType.endsWith("Node"))return{"@id":e.value};const a={"@value":e.value};if(e.language)e.language.match(s)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:i}),a["@language"]=e.language;else{let c=e.datatype.value;if(c||(c=v),c===p){c="@json";try{a["@value"]=JSON.parse(a["@value"])}catch(e){throw new n("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:a["@value"],cause:e})}}if(t){if(c===g)"true"===a["@value"]?a["@value"]=!0:"false"===a["@value"]&&(a["@value"]=!1);else if(o.isNumeric(a["@value"]))if(c===m){const e=parseInt(a["@value"],10);e.toFixed(0)===a["@value"]&&(a["@value"]=e)}else c===y&&(a["@value"]=parseFloat(a["@value"]));[g,m,y,v].includes(c)||(a["@type"]=c)}else if("i18n-datatype"===r&&c.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=c.split(/[#_]/);e.length>0&&(a["@language"]=e,e.match(s)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:i})),a["@direction"]=t}else c!==v&&(a["@type"]=c)}return a}e.exports=b,b.fromRDF=async(e,t)=>{const r={},n={"@default":r},s={},{useRdfType:l=!1,useNativeTypes:p=!1,rdfDirection:g=null}=t;for(const i of e){const e="DefaultGraph"===i.graph.termType?"@default":i.graph.value;e in n||(n[e]={}),"@default"===e||e in r||(r[e]={"@id":e});const o=n[e],c=i.subject.value,u=i.predicate.value,h=i.object;c in o||(o[c]={"@id":c});const y=o[c],m=h.termType.endsWith("Node");if(m&&!(h.value in o)&&(o[h.value]={"@id":h.value}),u===f&&!l&&m){a(y,"@type",h.value,{propertyIsArray:!0});continue}const v=w(h,p,g,t);if(a(y,u,v,{propertyIsArray:!0}),m)if(h.value===d){const e=o[h.value];"usages"in e||(e.usages=[]),e.usages.push({node:y,property:u,value:v})}else h.value in s?s[h.value]=!1:s[h.value]={node:y,property:u,value:v}}for(const e in n){const t=n[e];if(!(d in t))continue;const r=t[d];if(r.usages){for(let e of r.usages){let r=e.node,n=e.property,a=e.value;const l=[],d=[];let f=Object.keys(r).length;for(;n===h&&o.isObject(s[r["@id"]])&&o.isArray(r[u])&&1===r[u].length&&o.isArray(r[h])&&1===r[h].length&&(3===f||4===f&&o.isArray(r["@type"])&&1===r["@type"].length&&r["@type"][0]===c)&&(l.push(r[u][0]),d.push(r["@id"]),e=s[r["@id"]],r=e.node,n=e.property,a=e.value,f=Object.keys(r).length,i.isBlankNode(r)););delete a["@id"],a["@list"]=l.reverse();for(const e of d)delete t[e]}delete r.usages}}const y=[],m=Object.keys(r).sort();for(const e of m){const t=r[e];if(e in n){const r=t["@graph"]=[],o=n[e],s=Object.keys(o).sort();for(const e of s){const t=o[e];i.isSubjectReference(t)||r.push(t)}}i.isSubjectReference(t)||y.push(t)}return y}},478:(e,t,r)=>{"use strict";const n=r(8285),i={};e.exports=i,i.isSubject=e=>!(!n.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>n.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>n.isObject(e)&&"@value"in e,i.isList=e=>n.isObject(e)&&"@list"in e,i.isGraph=e=>n.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=>{if(n.isObject(e)){if("@id"in e){const t=e["@id"];return!n.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1}},730:(e,t,r)=>{const n=r(2948),i=r(1402),o=r(4768),s=r(5777),a=o.IdentifierIssuer,l=r(9699),c=r(3666),u=r(7990),{expand:h}=r(570),{flatten:d}=r(1409),{fromRDF:f}=r(1176),{toRDF:p}=r(2189),{frameMergedOrDefault:g,cleanupNull:y}=r(1849),{isArray:m,isObject:v,isString:b}=r(8285),{isSubjectReference:w}=r(478),{expandIri:x,getInitialContext:_,process:j,processingMode:T}=r(2182),{compact:N,compactIri:A}=r(120),{createNodeMap:E,createMergedNodeMap:O,mergeNodeMaps:S}=r(9646),{logEventHandler:I,logWarningEventHandler:R,safeEventHandler:k,setDefaultEventHandler:C,setupEventHandler:D,strictEventHandler:L,unhandledEventHandler:P}=r(5746),F=function(e){const t={},F=new c({max:100});function M(t,{documentLoader:r=e.documentLoader,...n}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:r},n,t,{eventHandler:D({options:t})})}return e.compact=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===r)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(n=M(n,{base:b(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new a("_:b"),contextResolver:new s({sharedCache:F})})).link&&(n.skipExpansion=!0),n.compactToRelative||delete n.base,i=n.skipExpansion?t:await e.expand(t,n);const c=await e.processContext(_(n),r,n);let u=await N({activeCtx:c,element:i,options:n});n.compactArrays&&!n.graph&&m(u)?1===u.length?u=u[0]:0===u.length&&(u={}):n.graph&&v(u)&&(u=[u]),v(r)&&"@context"in r&&(r=r["@context"]),r=o.clone(r),m(r)||(r=[r]);const h=r;r=[];for(let e=0;e<h.length;++e)(!v(h[e])||Object.keys(h[e]).length>0)&&r.push(h[e]);const d=r.length>0;if(1===r.length&&(r=r[0]),m(u)){const e=A({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=u;u={},d&&(u["@context"]=r),u[e]=t}else if(v(u)&&d){const e=u;u={"@context":r};for(const t in e)u[t]=e[t]}return u},e.expand=async function(t,r){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const n={},i=[];if("expandContext"in(r=M(r,{keepFreeFloatingNodes:!1,contextResolver:new s({sharedCache:F})}))){const e=o.clone(r.expandContext);v(e)&&"@context"in e?n.expandContext=e:n.expandContext={"@context":e},i.push(n.expandContext)}let a;if(b(t)){const o=await e.get(t,r);a=o.documentUrl,n.input=o.document,o.contextUrl&&(n.remoteContext={"@context":o.contextUrl},i.push(n.remoteContext))}else n.input=o.clone(t);"base"in r||(r.base=a||"");let l=_(r);for(const e of i)l=await j({activeCtx:l,localCtx:e,options:r});let c=await h({activeCtx:l,element:n.input,options:r});return v(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),m(c)||(c=[c]),c},e.flatten=async function(t,r,n){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");r="function"==typeof r?null:r||null,n=M(n,{base:b(t)?t:"",contextResolver:new s({sharedCache:F})});const i=await e.expand(t,n),o=d(i);if(null===r)return o;n.graph=!0,n.skipExpansion=!0;const a=await e.compact(o,r,n);return a},e.frame=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(n=M(n,{base:b(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new s({sharedCache:F})}),b(r)){const t=await e.get(r,n);if(r=t.document,t.contextUrl){let e=r["@context"];e?m(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,r["@context"]=e}}const i=r&&r["@context"]||{},o=await e.processContext(_(n),i,n);n.hasOwnProperty("omitGraph")||(n.omitGraph=T(o,1.1)),n.hasOwnProperty("pruneBlankNodeIdentifiers")||(n.pruneBlankNodeIdentifiers=T(o,1.1));const a=await e.expand(t,n),l={...n};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(r,l),u=Object.keys(r).map((e=>x(o,e,{vocab:!0})));l.merged=!u.includes("@graph"),l.is11=T(o,1.1);const h=g(a,c,l);l.graph=!n.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let d=await e.compact(h,i,l);return l.link={},d=y(d,l),d},e.link=async function(t,r,n){const i={};return r&&(i["@context"]=r),i["@embed"]="@link",e.frame(t,i,n)},e.normalize=e.canonize=async function(t,r){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(r=M(r,{base:b(t)?t:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new s({sharedCache:F})}))){if("application/n-quads"!==r.inputFormat&&"application/nquads"!==r.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=u.parse(t);return n.canonize(e,r)}const i={...r};delete i.format,i.produceGeneralizedRdf=!1;const o=await e.toRDF(t,i);return n.canonize(o,r)},e.fromRDF=async function(e,r){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");r=M(r,{format:b(e)?"application/n-quads":void 0});const{format:n}=r;let{rdfParser:i}=r;if(n){if(i=i||t[n],!i)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:n})}else i=()=>e;const o=await i(e);return f(o,r)},e.toRDF=async function(t,r){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let n;n=(r=M(r,{base:b(t)?t:"",skipExpansion:!1,contextResolver:new s({sharedCache:F})})).skipExpansion?t:await e.expand(t,r);const i=p(n,r);if(r.format){if("application/n-quads"===r.format||"application/nquads"===r.format)return u.serialize(i);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:r.format})}return i},e.createNodeMap=async function(t,r){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");r=M(r,{base:b(t)?t:"",contextResolver:new s({sharedCache:F})});const n=await e.expand(t,r);return O(n,r)},e.merge=async function(t,r,n){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!m(t))throw new TypeError('Could not merge, "docs" must be an array.');r="function"==typeof r?null:r||null,n=M(n,{contextResolver:new s({sharedCache:F})});const i=await Promise.all(t.map((t=>{const r={...n};return e.expand(t,r)})));let l=!0;"mergeNodes"in n&&(l=n.mergeNodes);const c=n.issuer||new a("_:b"),u={"@default":{}};for(let e=0;e<i.length;++e){const t=o.relabelBlankNodes(i[e],{issuer:new a("_:b"+e+"-")}),r=l||0===e?u:{"@default":{}};if(E(t,r,"@default",c),r!==u)for(const e in r){const t=r[e];if(!(e in u)){u[e]=t;continue}const n=u[e];for(const e in t)e in n||(n[e]=t[e])}}const h=S(u),d=[],f=Object.keys(h).sort();for(let e=0;e<f.length;++e){const t=h[f[e]];w(t)||d.push(t)}if(null===r)return d;n.graph=!0,n.skipExpansion=!0;const p=await e.compact(d,r,n);return p},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,r){let n;n="function"==typeof r.documentLoader?r.documentLoader:e.documentLoader;const i=await n(t);try{if(!i.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");b(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new l("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,r){return r=M(r,{base:"",contextResolver:new s({sharedCache:F})}),null===t?_(r):(t=o.clone(t),v(t)&&"@context"in t||(t={"@context":t}),j({activeCtx:e,localCtx:t,options:r}))},e.getContextValue=r(2182).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,r){t[e]=r},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",u.parse),e.registerRDFParser("application/nquads",u.parse),e.url=r(3866),e.logEventHandler=I,e.logWarningEventHandler=R,e.safeEventHandler=k,e.setDefaultEventHandler=C,e.strictEventHandler=L,e.unhandledEventHandler=P,e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=r(3114),e.JsonLdProcessor=r(7298)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},M=function(){return F((function(){return M()}))};F(M),e.exports=M},9646:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),s=r(4768),a=r(9699),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const r=(t=t||{}).issuer||new s.IdentifierIssuer("_:b"),n={"@default":{}};return l.createNodeMap(e,n,"@default",r),l.mergeNodeMaps(n)},l.createNodeMap=(e,t,r,c,u,h)=>{if(o.isArray(e)){for(const n of e)l.createNodeMap(n,t,r,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 n=[];return l.createNodeMap(e["@list"],t,r,c,u,n),void h.push({"@list":n})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}o.isUndefined(u)&&(u=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),h&&h.push({"@id":u});const d=t[r],f=d[u]=d[u]||{};f["@id"]=u;const p=Object.keys(e).sort();for(let o of p){if("@id"===o)continue;if("@reverse"===o){const n={"@id":u},o=e["@reverse"];for(const e in o){const a=o[e];for(const o of a){let a=o["@id"];i.isBlankNode(o)&&(a=c.getId(a)),l.createNodeMap(o,t,r,c,a),s.addValue(d[a],e,n,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){u in t||(t[u]={}),l.createNodeMap(e[o],t,u,c);continue}if("@included"===o){l.createNodeMap(e[o],t,r,c);continue}if("@type"!==o&&n(o)){if("@index"===o&&o in f&&(e[o]!==f[o]||e[o]["@id"]!==f[o]["@id"]))throw new a("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 n=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];s.addValue(f,o,{"@id":n},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,r,c,n)}else if(i.isValue(e))s.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const n=[];l.createNodeMap(e["@list"],t,r,c,u,n),e={"@list":n},s.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,r,c,u),s.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else s.addValue(f,o,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const r of Object.keys(e).sort())for(const i of Object.keys(e[r]).sort()){const o=e[r][i];i in t||(t[i]={"@id":i});const a=t[i];for(const e of Object.keys(o).sort())if(n(e)&&"@type"!==e)a[e]=s.clone(o[e]);else for(const t of o[e])s.addValue(a,e,s.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.mergeNodeMaps=e=>{const t=e["@default"],r=Object.keys(e).sort();for(const n of r){if("@default"===n)continue;const r=e[n];let o=t[n];o?"@graph"in o||(o["@graph"]=[]):t[n]=o={"@id":n,"@graph":[]};const s=o["@graph"];for(const e of Object.keys(r).sort()){const t=r[e];i.isSubjectReference(t)||s.push(t)}}return t}},1402:(e,t,r)=>{"use strict";const n=r(2872),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=n,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},2189:(e,t,r)=>{"use strict";const{createNodeMap:n}=r(9646),{isKeyword:i}=r(2182),o=r(478),s=r(8981),a=r(8285),l=r(4768),{handleEvent:c}=r(5746),{RDF_FIRST:u,RDF_REST:h,RDF_NIL:d,RDF_TYPE:f,RDF_JSON_LITERAL:p,RDF_LANGSTRING:g,XSD_BOOLEAN:y,XSD_DOUBLE:m,XSD_INTEGER:v,XSD_STRING:b}=r(2445),{isAbsolute:w}=r(3866),x={};function _(e,t,r,n,o){const s=Object.keys(t).sort();for(const a of s){const s=t[a],l=Object.keys(s).sort();for(let t of l){const l=s[t];if("@type"===t)t=f;else if(i(t))continue;for(const i of l){const s={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!w(a)){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:a}},options:o});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!w(t)){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:o});continue}if("BlankNode"===l.termType&&!o.produceGeneralizedRdf){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:n.getOldIds().find((e=>n.getId(e)===t))}},options:o});continue}const u=j(i,n,e,r,o.rdfDirection,o);u&&e.push({subject:s,predicate:l,object:u,graph:r})}}}}function j(e,t,r,n,i,l){const f={};if(o.isValue(e)){f.termType="Literal",f.value=void 0,f.datatype={termType:"NamedNode"};let t=e["@value"];const r=e["@type"]||null;if("@json"===r)f.value=s(t),f.datatype.value=p;else if(a.isBoolean(t))f.value=t.toString(),f.datatype.value=r||y;else if(a.isDouble(t)||r===m)a.isDouble(t)||(t=parseFloat(t)),f.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),f.datatype.value=r||m;else if(a.isNumber(t))f.value=t.toFixed(0),f.datatype.value=r||v;else if("i18n-datatype"===i&&"@direction"in e){const r="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`;f.datatype.value=r,f.value=t}else"@language"in e?(f.value=t,f.datatype.value=r||g,f.language=e["@language"]):(f.value=t,f.datatype.value=r||b)}else if(o.isList(e)){const o=function(e,t,r,n,i,o){const s={termType:"NamedNode",value:u},a={termType:"NamedNode",value:h},l={termType:"NamedNode",value:d},c=e.pop(),f=c?{termType:"BlankNode",value:t.getId()}:l;let p=f;for(const l of e){const e=j(l,t,r,n,i,o),c={termType:"BlankNode",value:t.getId()};r.push({subject:p,predicate:s,object:e,graph:n}),r.push({subject:p,predicate:a,object:c,graph:n}),p=c}if(c){const e=j(c,t,r,n,i,o);r.push({subject:p,predicate:s,object:e,graph:n}),r.push({subject:p,predicate:a,object:l,graph:n})}return f}(e["@list"],t,r,n,i,l);f.termType=o.termType,f.value=o.value}else{const t=a.isObject(e)?e["@id"]:e;f.termType=t.startsWith("_:")?"BlankNode":"NamedNode",f.value=t}return"NamedNode"!==f.termType||w(f.value)?f:(l.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:f.value}},options:l}),null)}e.exports=x,x.toRDF=(e,t)=>{const r=new l.IdentifierIssuer("_:b"),i={"@default":{}};n(e,i,"@default",r);const o=[],s=Object.keys(i).sort();for(const e of s){let n;if("@default"===e)n={termType:"DefaultGraph",value:""};else{if(!w(e)){t.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}n=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},n.value=e}_(o,i[e],n,r,t)}return o}},8285:e=>{"use strict";const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},3866:(e,t,r)=>{"use strict";const n=r(8285),i={};e.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 r={},n=i.parsers[t||"full"],o=n.regex.exec(e);let s=n.keys.length;for(;s--;)r[n.keys[s]]=void 0===o[s]?null:o[s];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=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!n.isString(e)||(e=i.parse(e||""));const r=i.parse(t),o={protocol:e.protocol||""};if(null!==r.authority)o.authority=r.authority,o.path=r.path,o.query=r.query;else if(o.authority=e.authority,""===r.path)o.path=e.path,null!==r.query?o.query=r.query:o.query=e.query;else{if(0===r.path.indexOf("/"))o.path=r.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=r.path,o.path=t}o.query=r.query}""!==r.path&&(o.path=i.removeDotSegments(o.path));let s=o.protocol;return null!==o.authority&&(s+="//"+o.authority),s+=o.path,null!==o.query&&(s+="?"+o.query),null!==r.fragment&&(s+="#"+r.fragment),""===s&&(s="./"),s},i.removeBase=(e,t)=>{if(null===e)return t;e&&!n.isString(e)||(e=i.parse(e||""));let r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;const o=i.parse(t.substr(r.length)),s=e.normalizedPath.split("/"),a=o.normalizedPath.split("/"),l=o.fragment||o.query?0:1;for(;s.length>0&&a.length>l&&s[0]===a[0];)s.shift(),a.shift();let c="";if(s.length>0){s.pop();for(let e=0;e<s.length;++e)c+="../"}return c+=a.join("/"),null!==o.query&&(c+="?"+o.query),null!==o.fragment&&(c+="#"+o.fragment),""===c&&(c="./"),c},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),r=[];for(;t.length>0;){const e=t.shift(),n=0===t.length;"."!==e?".."!==e?r.push(e):(r.pop(),n&&r.push("")):n&&r.push("")}return"/"===e[0]&&r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>n.isString(e)&&o.test(e),i.isRelative=e=>n.isString(e)},4768:(e,t,r)=>{"use strict";const n=r(478),i=r(8285),o=r(2948).IdentifierIssuer,s=r(9699),a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u="application/ld+json, application/json",h={};function d(e,t){if(i.isArray(t))for(let r=0;r<t.length;++r)t[r]=d(e,t[r]);else if(n.isList(t))t["@list"]=d(e,t["@list"]);else if(i.isObject(t)){n.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const r=Object.keys(t).sort();for(let n=0;n<r.length;++n){const i=r[n];"@id"!==i&&(t[i]=d(e,t[i]))}}return t}e.exports=h,h.IdentifierIssuer=o,h.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,h.REGEX_KEYWORD=/^@[a-zA-Z]+$/,h.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let r=0;r<e.length;++r)t[r]=h.clone(e[r])}else if(e instanceof Map){t=new Map;for(const[r,n]of e)t.set(r,h.clone(n))}else if(e instanceof Set){t=new Set;for(const r of e)t.add(h.clone(r))}else if(i.isObject(e)){t={};for(const r in e)t[r]=h.clone(e[r])}else t=e.toString();return t}return e},h.asArray=function(e){return Array.isArray(e)?e:[e]},h.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+u+'" is supported.');return Object.assign({Accept:u},e)},h.parseLinkHeader=e=>{const t={},r=e.match(a);for(let e=0;e<r.length;++e){let n=r[e].match(l);if(!n)continue;const i={target:n[1]},o=n[2];for(;n=c.exec(o);)i[n[1]]=void 0===n[2]?n[3]:n[2];const s=i.rel||"";Array.isArray(t[s])?t[s].push(i):t.hasOwnProperty(s)?t[s]=[t[s],i]:t[s]=i}return t},h.validateTypeValue=(e,t)=>{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 s('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 r=e[t];return!i.isArray(r)||r.length>0}return!1},h.hasValue=(e,t,r)=>{if(h.hasProperty(e,t)){let o=e[t];const s=n.isList(o);if(i.isArray(o)||s){s&&(o=o["@list"]);for(let e=0;e<o.length;++e)if(h.compareValues(r,o[e]))return!0}else if(!i.isArray(r))return h.compareValues(r,o)}return!1},h.addValue=(e,t,r,n)=>{if("propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1),"valueIsArray"in n||(n.valueIsArray=!1),"allowDuplicate"in n||(n.allowDuplicate=!0),"prependValue"in n||(n.prependValue=!1),n.valueIsArray)e[t]=r;else if(i.isArray(r)){0===r.length&&n.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),n.prependValue&&(r=r.concat(e[t]),e[t]=[]);for(let i=0;i<r.length;++i)h.addValue(e,t,r[i],n)}else if(e.hasOwnProperty(t)){const o=!n.allowDuplicate&&h.hasValue(e,t,r);i.isArray(e[t])||o&&!n.propertyIsArray||(e[t]=[e[t]]),o||(n.prependValue?e[t].unshift(r):e[t].push(r))}else e[t]=n.propertyIsArray?[r]:r},h.getValues=(e,t)=>[].concat(e[t]||[]),h.removeProperty=(e,t)=>{delete e[t]},h.removeValue=(e,t,r,n)=>{"propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1);const i=h.getValues(e,t).filter((e=>!h.compareValues(e,r)));0===i.length?h.removeProperty(e,t):1!==i.length||n.propertyIsArray?e[t]=i:e[t]=i[0]},h.relabelBlankNodes=(e,t)=>d((t=t||{}).issuer||new o("_:b"),e),h.compareValues=(e,t)=>e===t||!(!n.isValue(e)||!n.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.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},3666:(e,t,r)=>{"use strict";const n=r(1123),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),h=Symbol("lruList"),d=Symbol("cache"),f=Symbol("updateAgeOnGet"),p=()=>1,g=(e,t,r)=>{const n=e[d].get(t);if(n){const t=n.value;if(y(e,t)){if(v(e,n),!e[a])return}else r&&(e[f]&&(n.value.now=Date.now()),e[h].unshiftNode(n));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},m=e=>{if(e[o]>e[i])for(let t=e[h].tail;e[o]>e[i]&&null!==t;){const r=t.prev;v(e,t),t=r}},v=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[d].delete(r.key),e[h].removeNode(t)}};class b{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const w=(e,t,r,n)=>{let i=r.value;y(e,i)&&(v(e,r),e[a]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.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[s]="function"!=typeof t?p:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=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,m(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,m(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[s]&&(this[s]=e,this[o]=0,this[h].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),m(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[h].length}rforEach(e,t){t=t||this;for(let r=this[h].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[h].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}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 n,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,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[d].has(e)){if(a>this[i])return v(this,this[d].get(e)),!1;const s=this[d].get(e).value;return this[c]&&(this[u]||this[c](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),m(this),!0}const f=new b(e,t,a,n,r);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),m(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?(v(this,e),e.value):null}del(e){v(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[d].forEach(((e,t)=>g(this,t,!1)))}}},8720:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},7402:(e,t,r)=>{"use strict";var n=r(9170),i=r(2550),o=r(8720),s=r(5280),a=r(9129),l=i(s(),Object);n(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},5280:(e,t,r)=>{"use strict";var n=r(8720);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9129:(e,t,r)=>{"use strict";var n=r(5280),i=r(9170);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8383:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(4418),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{h(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=s(e),a=t&&"[object String]"===o.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(a&&e.length>0&&!i.call(e,0))for(var g=0;g<e.length;++g)d.push(String(g));if(n&&e.length>0)for(var y=0;y<e.length;++y)d.push(String(y));else for(var m in e)p&&"prototype"===m||!i.call(e,m)||d.push(String(m));if(l)for(var v=function(e){if("undefined"==typeof window||!f)return h(e);try{return h(e)}catch(e){return!1}}(e),b=0;b<u.length;++b)v&&"constructor"===u[b]||!i.call(e,u[b])||d.push(u[b]);return d}}e.exports=n},806:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(4418),o=Object.keys,s=o?function(e){return o(e)}:r(8383),a=Object.keys;s.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(n.call(e)):a(e)})}else Object.keys=s;return Object.keys||s},e.exports=s},4418:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},2530:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,l=[],c=!1,u=-1;function h(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&d())}function d(){if(!c){var e=s(h);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new f(e,t)),1!==l.length||c||s(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},6063:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,i){r=r||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(r);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var l=e.length;a>0&&l>a&&(l=a);for(var c=0;c<l;++c){var u,h,d,f,p=e[c].replace(s,"%20"),g=p.indexOf(n);g>=0?(u=p.substr(0,g),h=p.substr(g+1)):(u=p,h=""),d=decodeURIComponent(u),f=decodeURIComponent(h),t(o,d)?Array.isArray(o[d])?o[d].push(f):o[d]=[o[d],f]:o[d]=f}return o}},1957:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,n,i){return r=r||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(t(i))+n;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(t(e))})).join(r):o+encodeURIComponent(t(e[i]))})).join(r):i?encodeURIComponent(t(i))+n+encodeURIComponent(t(e)):""}},5582:(e,t,r)=>{"use strict";t.decode=t.parse=r(6063),t.encode=t.stringify=r(1957)},5929:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},2948:(e,t,r)=>{e.exports=r(2874)},577:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,r=0){this.prefix=e,this._existing=t,this.counter=r}clone(){const{prefix:t,_existing:r,counter:n}=this;return new e(t,new Map(r),n)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},4071:(e,t,r)=>{"use strict";r(4828);const n=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!n||!n.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await n.subtle.digest(this.algorithm,e));let r="";for(let e=0;e<t.length;++e)r+=t[e].toString(16).padStart(2,"0");return r}}},6327:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",r="http://www.w3.org/2001/XMLSchema#string",n="NamedNode",i="BlankNode",o="Literal",s="DefaultGraph",a={};a.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,a.empty=new RegExp("^[ \\t]*$"),a.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]*\\.))[ \\t]*$'),e.exports=class e{static parse(e){const l=[],u={},h=e.split(a.eoln);let d=0;for(const e of h){if(d++,a.empty.test(e))continue;const h=e.match(a.quad);if(null===h)throw new Error("N-Quads parse error on line "+d+".");const g={subject:null,predicate:null,object:null,graph:null};if(void 0!==h[1]?g.subject={termType:n,value:h[1]}:g.subject={termType:i,value:h[2]},g.predicate={termType:n,value:h[3]},void 0!==h[4]?g.object={termType:n,value:h[4]}:void 0!==h[5]?g.object={termType:i,value:h[5]}:(g.object={termType:o,value:void 0,datatype:{termType:n}},void 0!==h[7]?g.object.datatype.value=h[7]:void 0!==h[8]?(g.object.datatype.value=t,g.object.language=h[8]):g.object.datatype.value=r,g.object.value=h[6].replace(c,(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")}))),void 0!==h[9]?g.graph={termType:n,value:h[9]}:void 0!==h[10]?g.graph={termType:i,value:h[10]}:g.graph={termType:s,value:""},g.graph.value in u){let e=!0;const t=u[g.graph.value];for(const r of t)if(p=g,(f=r).subject.termType===p.subject.termType&&f.object.termType===p.object.termType&&f.subject.value===p.subject.value&&f.predicate.value===p.predicate.value&&f.object.value===p.object.value&&(f.object.termType!==o||f.object.datatype.termType===p.object.datatype.termType&&f.object.language===p.object.language&&f.object.datatype.value===p.object.datatype.value)){e=!1;break}e&&(t.push(g),l.push(g))}else u[g.graph.value]=[g],l.push(g)}var f,p;return l}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const r=[];for(const n of t)r.push(e.serializeQuad(n));return r.sort().join("")}static serializeQuadComponents(e,o,s,a){let c="";return e.termType===n?c+=`<${e.value}>`:c+=`${e.value}`,c+=` <${o.value}> `,s.termType===n?c+=`<${s.value}>`:s.termType===i?c+=s.value:(c+=`"${function(e){return e.replace(l,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(s.value)}"`,s.datatype.value===t?s.language&&(c+=`@${s.language}`):s.datatype.value!==r&&(c+=`^^<${s.datatype.value}>`)),a.termType===n?c+=` <${a.value}>`:a.termType===i&&(c+=` ${a.value}`),c+=" .\n",c}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const a=[],l={"blank node":i,IRI:n,literal:o};for(const c in e)e[c].forEach((e=>{const u={};for(const i in e){const s=e[i],a={termType:l[s.type],value:s.value};a.termType===o&&(a.datatype={termType:n},"datatype"in s&&(a.datatype.value=s.datatype),"language"in s?("datatype"in s||(a.datatype.value=t),a.language=s.language):"datatype"in s||(a.datatype.value=r)),u[i]=a}u.graph="@default"===c?{termType:s,value:""}:{termType:c.startsWith("_:")?i:n,value:c},a.push(u)}));return a}};const l=/["\\\n\r]/g,c=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},83:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,r=e.slice();let n=null,i=0;const o=e.length;for(let r=0;r<o;++r){const s=e[r],a=t.get(s);(null===n||s>n)&&(a&&r>0&&s>e[r-1]||!a&&r<o-1&&s>e[r+1])&&(n=s,i=r)}if(null===n)this.done=!0;else{const r=t.get(n)?i-1:i+1;e[i]=e[r],e[r]=n;for(const r of e)r>n&&t.set(r,!t.get(r))}return r}}},4515:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),s=r(6327);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];let i=0;for(const e of r)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const o=[...t.keys()].sort(),l=[];for(const e of o){const r=t.get(e);if(r.length>1){l.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of l){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=await this.hashNDegreeQuads(r,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=s.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join("")}async hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(s.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=await i.digest(),r.hash}async hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}async hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=await this.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){n.update(e);let r,s="";const a=new o(i.get(e));let l=0;for(;a.hasNext();){const e=a.next();++l%3==0&&await this._yield();let n=t.clone(),i="";const o=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||o.push(t),i+=n.getId(t)),0!==s.length&&i>s){c=!0;break}if(!c){for(const e of o){const t=await this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==s.length&&i>s){c=!0;break}}c||(0===s.length||i<s)&&(s=i,r=n)}}n.update(s),t=r}return{hash:await n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:e,issuer:t,hashToRelated:r})]);return r}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=await this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const s=t.value,a=await this.hashRelatedBlankNode(s,e,i,r),l=o.get(a);l?l.push(s):o.set(a,[s])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},2160:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),s=r(6327);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];for(const e of r)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),o=[];for(const e of i){const r=t.get(e);if(r.length>1){o.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of o){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=this.hashNDegreeQuads(r,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=s.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(s.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=i.digest(),r.hash}hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=this.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){n.update(e);let r,s="";const a=new o(i.get(e));for(;a.hasNext();){const e=a.next();let n=t.clone(),i="";const o=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||o.push(t),i+=n.getId(t)),0!==s.length&&i>s){l=!0;break}if(!l){for(const e of o){const t=this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==s.length&&i>s){l=!0;break}}l||(0===s.length||i<s)&&(s=i,r=n)}}n.update(s),t=r}return{hash:n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:r});return r}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const s=t.value,a=this.hashRelatedBlankNode(s,e,i,r),l=o.get(a);l?l.push(s):o.set(a,[s])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},3663:(e,t,r)=>{"use strict";const n=r(4071),i=r(4515);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n){let n,s;if("BlankNode"===o.subject.termType&&o.subject.value!==e)s=o.subject.value,n="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;s=o.object.value,n="r"}++i%100==0&&await this._yield();const a=await this.hashRelatedBlankNode(s,o,t,n),l=r.get(a);l?l.push(s):r.set(a,[s])}return r}}},5393:(e,t,r)=>{"use strict";const n=r(4071),i=r(2160);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n){let n,o;if("BlankNode"===i.subject.termType&&i.subject.value!==e)o=i.subject.value,n="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;o=i.object.value,n="r"}const s=this.hashRelatedBlankNode(o,i,t,n),a=r.get(s);a?a.push(o):r.set(s,[o])}return r}}},2874:(e,t,r)=>{"use strict";const n=r(4515),i=r(3663),o=r(2160),s=r(5393);let a;try{a=r(7670)}catch(e){}t.NQuads=r(6327),t.IdentifierIssuer=r(577),t._rdfCanonizeNative=function(e){return e&&(a=e),a},t.canonize=async function(e,r){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),r.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((t,n)=>a.canonize(e,r,((e,r)=>e?n(e):t(r)))))}if("URDNA2015"===r.algorithm)return new n(r).main(e);if("URGNA2012"===r.algorithm){if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(r).main(e)}if(!("algorithm"in r))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm)},t._canonizeSync=function(e,r){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),r.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return a.canonizeSync(e,r)}if("URDNA2015"===r.algorithm)return new o(r).main(e);if("URGNA2012"===r.algorithm){if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new s(r).main(e)}if(!("algorithm"in r))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm)}},4828:function(e,t,r){var n=r(2530);!function(e,t){"use strict";if(!e.setImmediate){var r,i,o,s,a,l=1,c={},u=!1,h=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){n.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return c[l]=i,r(l),l++},d.clearImmediate=f}function f(e){delete c[e]}function p(e){if(u)setTimeout(p,0,e);else{var t=c[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{f(e),u=!1}}}}}("undefined"==typeof self?void 0===r.g?this:r.g:self)},9523:e=>{const t={acl:"http://www.w3.org/ns/auth/acl#",arg:"http://www.w3.org/ns/pim/arg#",as:"https://www.w3.org/ns/activitystreams#",cal:"http://www.w3.org/2002/12/cal/ical#",cert:"http://www.w3.org/ns/auth/cert#",contact:"http://www.w3.org/2000/10/swap/pim/contact#",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",doap:"http://usefulinc.com/ns/doap#",foaf:"http://xmlns.com/foaf/0.1/",geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",gpx:"http://www.w3.org/ns/pim/gpx#",http:"http://www.w3.org/2007/ont/http#",httph:"http://www.w3.org/2007/ont/httph#",icalTZ:"http://www.w3.org/2002/12/cal/icaltzd#",ldp:"http://www.w3.org/ns/ldp#",link:"http://www.w3.org/2007/ont/link#",log:"http://www.w3.org/2000/10/swap/log#",meeting:"http://www.w3.org/ns/pim/meeting#",mo:"http://purl.org/ontology/mo/",org:"http://www.w3.org/ns/org#",owl:"http://www.w3.org/2002/07/owl#",pad:"http://www.w3.org/ns/pim/pad#",patch:"http://www.w3.org/ns/pim/patch#",prov:"http://www.w3.org/ns/prov#",qu:"http://www.w3.org/2000/10/swap/pim/qif#",trip:"http://www.w3.org/ns/pim/trip#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rss:"http://purl.org/rss/1.0/",sched:"http://www.w3.org/ns/pim/schedule#",schema:"http://schema.org/",sioc:"http://rdfs.org/sioc/ns#",solid:"http://www.w3.org/ns/solid/terms#",space:"http://www.w3.org/ns/pim/space#",stat:"http://www.w3.org/ns/posix/stat#",tab:"http://www.w3.org/2007/ont/link#",tabont:"http://www.w3.org/2007/ont/link#",ui:"http://www.w3.org/ns/ui#",vcard:"http://www.w3.org/2006/vcard/ns#",wf:"http://www.w3.org/2005/01/wf/flow#",xsd:"http://www.w3.org/2001/XMLSchema#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/"};e.exports=function(e={namedNode:e=>e}){const r={};for(const n in t){const i=t[n];r[n]=function(t=""){return e.namedNode(i+t)}}return r}},8928:function(e,t,r){var n;e=r.nmd(e),function(i){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var s,a=2147483647,l=36,c=/^xn--/,u=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function g(e){throw RangeError(d[e])}function y(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function m(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+y((e=e.replace(h,".")).split("."),t).join(".")}function v(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function b(e){return y(e,(function(e){var t="";return e>65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+p(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,r){var n=0;for(e=r?f(e/700):e>>1,e+=f(e/t);e>455;n+=l)e=f(e/35);return f(n+36*e/(e+38))}function _(e){var t,r,n,i,o,s,c,u,h,d,p,y=[],m=e.length,v=0,w=128,_=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&g("not-basic"),y.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<m;){for(o=v,s=1,c=l;i>=m&&g("invalid-input"),((u=(p=e.charCodeAt(i++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:l)>=l||u>f((a-v)/s))&&g("overflow"),v+=u*s,!(u<(h=c<=_?1:c>=_+26?26:c-_));c+=l)s>f(a/(d=l-h))&&g("overflow"),s*=d;_=x(v-o,t=y.length+1,0==o),f(v/t)>a-w&&g("overflow"),w+=f(v/t),v%=t,y.splice(v++,0,w)}return b(y)}function j(e){var t,r,n,i,o,s,c,u,h,d,y,m,b,_,j,T=[];for(m=(e=v(e)).length,t=128,r=0,o=72,s=0;s<m;++s)(y=e[s])<128&&T.push(p(y));for(n=i=T.length,i&&T.push("-");n<m;){for(c=a,s=0;s<m;++s)(y=e[s])>=t&&y<c&&(c=y);for(c-t>f((a-r)/(b=n+1))&&g("overflow"),r+=(c-t)*b,t=c,s=0;s<m;++s)if((y=e[s])<t&&++r>a&&g("overflow"),y==t){for(u=r,h=l;!(u<(d=h<=o?1:h>=o+26?26:h-o));h+=l)j=u-d,_=l-d,T.push(p(w(d+j%_,0))),u=f(j/_);T.push(p(w(u,0))),o=x(r,b,n==i),r=0,++n}++r,++t}return T.join("")}s={version:"1.3.2",ucs2:{decode:v,encode:b},decode:_,encode:j,toASCII:function(e){return m(e,(function(e){return u.test(e)?"xn--"+j(e):e}))},toUnicode:function(e){return m(e,(function(e){return c.test(e)?_(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}()},4044:(e,t,r)=>{"use strict";var n=r(8928),i=r(944);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),h=["%","/","?",";","#"].concat(u),d=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=r(5582);o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o<e.indexOf("#")?"?":"#",c=e.split(a);c[0]=c[0].replace(/\\/g,"/");var b=e=c.join(a);if(b=b.trim(),!r&&1===e.split("#").length){var w=l.exec(b);if(w)return this.path=b,this.href=b,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=s.exec(b);if(x){var _=(x=x[0]).toLowerCase();this.protocol=_,b=b.substr(x.length)}if(r||x||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var j="//"===b.substr(0,2);!j||x&&y[x]||(b=b.substr(2),this.slashes=!0)}if(!y[x]&&(j||x&&!m[x])){for(var T,N,A=-1,E=0;E<d.length;E++)-1!==(O=b.indexOf(d[E]))&&(-1===A||O<A)&&(A=O);for(-1!==(N=-1===A?b.lastIndexOf("@"):b.lastIndexOf("@",A))&&(T=b.slice(0,N),b=b.slice(N+1),this.auth=decodeURIComponent(T)),A=-1,E=0;E<h.length;E++){var O;-1!==(O=b.indexOf(h[E]))&&(-1===A||O<A)&&(A=O)}-1===A&&(A=b.length),this.host=b.slice(0,A),b=b.slice(A),this.parseHost(),this.hostname=this.hostname||"";var S="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!S)for(var I=this.hostname.split(/\./),R=(E=0,I.length);E<R;E++){var k=I[E];if(k&&!k.match(f)){for(var C="",D=0,L=k.length;D<L;D++)k.charCodeAt(D)>127?C+="x":C+=k[D];if(!C.match(f)){var P=I.slice(0,E),F=I.slice(E+1),M=k.match(p);M&&(P.push(M[1]),F.unshift(M[2])),F.length&&(b="/"+F.join(".")+b),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),S||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+U,this.href+=this.host,S&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[_])for(E=0,R=u.length;E<R;E++){var q=u[E];if(-1!==b.indexOf(q)){var H=encodeURIComponent(q);H===q&&(H=escape(q)),b=b.split(q).join(H)}}var Z=b.indexOf("#");-1!==Z&&(this.hash=b.substr(Z),b=b.slice(0,Z));var $=b.indexOf("?");if(-1!==$?(this.search=b.substr($),this.query=b.substr($+1),t&&(this.query=v.parse(this.query)),b=b.slice(0,$)):t&&(this.search="",this.query={}),b&&(this.pathname=b),m[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var z=this.search||"";this.path=U+z}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,s="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(s=v.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||m[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),t+o+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(function(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),s=0;s<n.length;s++){var a=n[s];r[a]=this[a]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var l=Object.keys(e),c=0;c<l.length;c++){var u=l[c];"protocol"!==u&&(r[u]=e[u])}return m[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!m[e.protocol]){for(var h=Object.keys(e),d=0;d<h.length;d++){var f=h[d];r[f]=e[f]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||y[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var g=r.pathname||"",v=r.search||"";r.path=g+v}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),x=w||b||r.host&&e.pathname,_=x,j=r.pathname&&r.pathname.split("/")||[],T=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!m[r.protocol]);if(T&&(r.hostname="",r.port=null,r.host&&(""===j[0]?j[0]=r.host:j.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),x=x&&(""===p[0]||""===j[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,j=p;else if(p.length)j||(j=[]),j.pop(),j=j.concat(p),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search))return T&&(r.hostname=r.host=j.shift(),(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift())),r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!j.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var N=j.slice(-1)[0],A=(r.host||e.host||j.length>1)&&("."===N||".."===N)||""===N,E=0,O=j.length;O>=0;O--)"."===(N=j[O])?j.splice(O,1):".."===N?(j.splice(O,1),E++):E&&(j.splice(O,1),E--);if(!x&&!_)for(;E--;E)j.unshift("..");!x||""===j[0]||j[0]&&"/"===j[0].charAt(0)||j.unshift(""),A&&"/"!==j.join("/").substr(-1)&&j.push("");var S,I=""===j[0]||j[0]&&"/"===j[0].charAt(0);return T&&(r.hostname=r.host=I?"":j.length?j.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift())),(x=x||r.host&&j.length)&&!I&&j.unshift(""),j.length?r.pathname=j.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},944:e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},9397:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},4489:(e,t,r)=>{"use strict";var n=r(7092),i=r(7427),o=r(4010),s=r(2527);function a(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=a(Object.prototype.toString),h=a(Number.prototype.valueOf),d=a(String.prototype.valueOf),f=a(Boolean.prototype.valueOf);if(l)var p=a(BigInt.prototype.valueOf);if(c)var g=a(Symbol.prototype.valueOf);function y(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===u(e)}function v(e){return"[object Set]"===u(e)}function b(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function x(e){return"[object ArrayBuffer]"===u(e)}function _(e){return"undefined"!=typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function j(e){return"[object DataView]"===u(e)}function T(e){return"undefined"!=typeof DataView&&(j.working?j(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||T(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=_,j.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&j(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=T;var N="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(e){return"[object SharedArrayBuffer]"===u(e)}function E(e){return void 0!==N&&(void 0===A.working&&(A.working=A(new N)),A.working?A(e):e instanceof N)}function O(e){return y(e,h)}function S(e){return y(e,d)}function I(e){return y(e,f)}function R(e){return l&&y(e,p)}function k(e){return c&&y(e,g)}t.isSharedArrayBuffer=E,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},t.isGeneratorObject=function(e){return"[object Generator]"===u(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},t.isNumberObject=O,t.isStringObject=S,t.isBooleanObject=I,t.isBigIntObject=R,t.isSymbolObject=k,t.isBoxedPrimitive=function(e){return O(e)||S(e)||I(e)||R(e)||k(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(_(e)||E(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},5663:(e,t,r)=>{var n=r(2530),i=r(292),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},s=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(s,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r<i;a=n[++r])v(a)||!j(a)?o+=" "+a:o+=" "+u(a);return o},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?i.trace(r):i.error(r),o=!0}return e.apply(this,arguments)}};var a={},l=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),l=new RegExp("^"+c+"$","i")}function u(e,r){var n={seen:[],stylize:d};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),f(n,e,n.depth)}function h(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function d(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return w(i)||(i=f(e,i,n)),i}var o=function(e,t){if(x(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),N(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(A(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(T(r))return e.stylize(Date.prototype.toString.call(r),"date");if(N(r))return p(r)}var c,u="",h=!1,d=["{","}"];return y(r)&&(h=!0,d=["[","]"]),A(r)&&(u=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(u=" "+RegExp.prototype.toString.call(r)),T(r)&&(u=" "+Date.prototype.toUTCString.call(r)),N(r)&&(u=" "+p(r)),0!==s.length||h&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=h?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)R(t,String(s))?o.push(g(e,t,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(g(e,t,r,n,i,!0))})),o}(e,r,n,a,s):s.map((function(t){return g(e,r,n,a,t,h)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,u,d)):d[0]+u+d[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function g(e,t,r,n,i,o){var s,a,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),R(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(l.value)<0?(a=v(r)?f(e,l.value,null):f(e,l.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),x(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function y(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function x(e){return void 0===e}function _(e){return j(e)&&"[object RegExp]"===E(e)}function j(e){return"object"==typeof e&&null!==e}function T(e){return j(e)&&"[object Date]"===E(e)}function N(e){return j(e)&&("[object Error]"===E(e)||e instanceof Error)}function A(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(l.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);i.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(4489),t.isArray=y,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=x,t.isRegExp=_,t.types.isRegExp=_,t.isObject=j,t.isDate=T,t.types.isDate=T,t.isError=N,t.types.isNativeError=N,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(9397);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var e=new Date,t=[O(e.getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":");return[e.getDate(),S[e.getMonth()],t].join(" ")}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){i.log("%s - %s",I(),t.format.apply(t,arguments))},t.inherits=r(8575),t._extend=function(e,t){if(!t||!j(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(k&&e[k]){var t;if("function"!=typeof(t=e[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,k,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),k&&Object.defineProperty(t,k,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=k,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};e.apply(this,t).then((function(e){n.nextTick(s.bind(null,null,e))}),(function(e){n.nextTick(C.bind(null,e,s))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},4010:(e,t,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),s=r(3828),a=o("Object.prototype.toString"),l=r(4111)(),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),h=o("String.prototype.slice"),d={},f=Object.getPrototypeOf;l&&s&&f&&n(u,(function(e){if("function"==typeof c[e]){var t=new c[e];if(Symbol.toStringTag in t){var r=f(t),n=s(r,Symbol.toStringTag);if(!n){var i=f(r);n=s(i,Symbol.toStringTag)}d[e]=n.get}}}));var p=r(2527);e.exports=function(e){return!!p(e)&&(l&&Symbol.toStringTag in e?function(e){var t=!1;return n(d,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):h(a(e),8,-1))}},7876:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},1123:(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;r<i;r++)t.push(arguments[r]);return t}function i(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)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(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.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)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var s=[];for(n=0;o&&n<t;n++)s.push(o.value),o=this.removeNode(o);for(null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev),n=0;n<r.length;n++)o=i(this,o,r[n]);return s},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(7876)(n)}catch(e){}},870:t=>{"use strict";t.exports=e},7670:()=>{},4343:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},240:(e,t,r)=>{"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{Z:()=>n})}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var i={};return(()=>{"use strict";n.r(i),n.d(i,{BlankNode:()=>a,Collection:()=>f,ConnectedStore:()=>or,DataFactory:()=>Bt,Empty:()=>p,Fetcher:()=>Dt,Formula:()=>Z,IndexedFormula:()=>K,Literal:()=>h,LiveStore:()=>sr,N3Parser:()=>xe,NamedNode:()=>l.Z,Namespace:()=>O,NextId:()=>ir,Node:()=>$,Query:()=>X,RDFParser:()=>ft,RDFaProcessor:()=>ht,SPARQLToQuery:()=>Ft,Serializer:()=>L,Statement:()=>w,Store:()=>K,UpdateManager:()=>Mt,UpdatesSocket:()=>qt,UpdatesVia:()=>Ht,Util:()=>S,Variable:()=>_,blankNode:()=>Wt,defaultGraph:()=>Qt,fetcher:()=>$t,fromNT:()=>rr,graph:()=>zt,isBlankNode:()=>c.B2,isCollection:()=>c.uZ,isGraph:()=>c.NA,isLiteral:()=>c.n_,isNamedNode:()=>c.NX,isPredicate:()=>c.lx,isQuad:()=>c.PY,isRDFObject:()=>c.lt,isRDFlibObject:()=>c.Uc,isRDFlibPredicate:()=>c.nq,isRDFlibSubject:()=>c.f,isStatement:()=>c.Yi,isStore:()=>c.Pv,isSubject:()=>c.zz,isTerm:()=>c.jt,isVariable:()=>c.cG,jsonParser:()=>Lt,lit:()=>Vt,literal:()=>Yt,log:()=>E.Z,namedNode:()=>Jt,parse:()=>gt,quad:()=>Kt,queryToSPARQL:()=>Pt,serialize:()=>F,sparqlUpdateParser:()=>pt,st:()=>Xt,sym:()=>Jt,term:()=>nr,termValue:()=>vt._,triple:()=>er,uri:()=>x,variable:()=>Gt});var e=n(240),t=n(8333),r=n(4806),o=n(9247),s=n(292);class a extends r.Z{static getId(e){if(e){if("string"!=typeof e)throw s.log("Bad blank id:",e),new Error("Bad id argument to new blank node: "+e);if(e.includes("#")){let t=e.split("#");return t[t.length-1]}return e}return"n"+a.nextId++}constructor(r){super(a.getId(r)),(0,e.Z)(this,"termType",o.V1),(0,e.Z)(this,"classOrder",t.Z.BlankNode),(0,e.Z)(this,"isBlank",1),(0,e.Z)(this,"isVar",1)}get id(){return this.value}set id(e){this.value=e}compareTerm(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.id<e.id?-1:this.id>e.id?1:0}copy(e){var t=new a;return e.copyTo(this,t),t}toCanonical(){return a.NTAnonymousNodePrefix+this.value}toString(){return a.NTAnonymousNodePrefix+this.id}}(0,e.Z)(a,"nextId",0),(0,e.Z)(a,"NTAnonymousNodePrefix","_:");var l=n(6545),c=n(5904);const u={boolean:new l.Z("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new l.Z("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new l.Z("http://www.w3.org/2001/XMLSchema#decimal"),double:new l.Z("http://www.w3.org/2001/XMLSchema#double"),integer:new l.Z("http://www.w3.org/2001/XMLSchema#integer"),langString:new l.Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new l.Z("http://www.w3.org/2001/XMLSchema#string")};class h extends r.Z{constructor(r,n,i){super(r),(0,e.Z)(this,"termType",o.xH),(0,e.Z)(this,"classOrder",t.Z.Literal),(0,e.Z)(this,"datatype",u.string),(0,e.Z)(this,"isVar",0),(0,e.Z)(this,"language",""),n?(this.language=n,this.datatype=u.langString):this.datatype=i?l.Z.fromValue(i):u.string}copy(){return new h(this.value,this.lang,this.datatype)}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(!this.datatype&&!e.datatype||this.datatype&&this.datatype.equals(e.datatype))}get lang(){return this.language}set lang(e){this.language=e||""}toNT(){return h.toNT(this)}static toNT(e){if("number"==typeof e.value)return""+e.value;if("string"!=typeof e.value)throw new Error("Value of RDF literal is not string or number: "+e.value);var t=e.value;return t='"'+(t=(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',e.language?t+="@"+e.language:e.datatype.equals(u.string)||(t+="^^"+e.datatype.toCanonical()),t}toString(){return""+this.value}static fromBoolean(e){return new h(e?"1":"0",null,u.boolean)}static fromDate(e){if(!(e instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");let t=function(e){return(""+(100+e)).slice(1,3)},r=e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"Z";return new h(r,null,u.dateTime)}static fromNumber(e){if("number"!=typeof e)throw new TypeError("Invalid argument to Literal.fromNumber()");let t;const r=e.toString();return t=r.indexOf("e")<0&&Math.abs(e)<=Number.MAX_SAFE_INTEGER?Number.isInteger(e)?u.integer:u.decimal:u.double,new h(r,null,t)}static fromValue(e){if((0,c.n_)(e))return e;switch(typeof e){case"object":if(e instanceof Date)return h.fromDate(e);case"boolean":return h.fromBoolean(e);case"number":return h.fromNumber(e);case"string":return new h(e)}throw new Error("Can't make literal from "+e+" of type "+typeof e)}}function d(e){return null==e||(0,c.jt)(e)?e:Array.isArray(e)?new f(e):h.fromValue(e)}class f extends r.Z{constructor(r){super((a.nextId++).toString()),(0,e.Z)(this,"termType",o.fb),(0,e.Z)(this,"classOrder",t.Z.Collection),(0,e.Z)(this,"closed",!1),(0,e.Z)(this,"compareTerm",a.prototype.compareTerm),(0,e.Z)(this,"elements",[]),(0,e.Z)(this,"isVar",0),r&&r.length>0&&r.forEach((e=>{this.elements.push(d(e))}))}get id(){return this.value}set id(e){this.value=e}append(e){return this.elements.push(e)}close(){return this.closed=!0,this.closed}shift(){return this.elements.shift()}substitute(e){const t=this.elements.map((t=>t.substitute(e)));return new f(t)}toNT(){return f.toNT(this)}static toNT(e){return a.NTAnonymousNodePrefix+e.id}toString(){return"("+this.elements.join(" ")+")"}unshift(e){return this.elements.unshift(e)}}(0,e.Z)(f,"termType",o.fb);class p extends r.Z{constructor(){super(""),(0,e.Z)(this,"termType",o.ls)}toString(){return"()"}}const g="chrome:theSession";new l.Z(g);class y extends r.Z{constructor(){super(""),(0,e.Z)(this,"value",""),(0,e.Z)(this,"termType",o.NK),(0,e.Z)(this,"uri",g)}toCanonical(){return this.value}toString(){return"DefaultGraph"}}function m(e){return!!e&&e.termType===o.NK}var v=n(292);const b=new y;class w{constructor(t,n,i,o){(0,e.Z)(this,"subject",void 0),(0,e.Z)(this,"predicate",void 0),(0,e.Z)(this,"object",void 0),(0,e.Z)(this,"graph",void 0),this.subject=r.Z.fromValue(t),this.predicate=r.Z.fromValue(n),this.object=r.Z.fromValue(i),this.graph=null==o?b:r.Z.fromValue(o)}get why(){return this.graph}set why(e){this.graph=e}equals(e){return e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}substitute(e){const t=new w(this.subject.substitute(e),this.predicate.substitute(e),this.object.substitute(e),m(this.graph)?this.graph:this.graph.substitute(e));return v.log("@@@ statement substitute:"+t),t}toCanonical(){let e=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==o.NK&&e.push(this.graph.toCanonical()),e.join(" ")+" ."}toNT(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}toNQ(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),m(this.graph)?"":this.graph.toNT()].join(" ")+" ."}toString(){return this.toNT()}}var x=n(3357);class _ extends r.Z{constructor(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(r),(0,e.Z)(this,"termType",o.UH),(0,e.Z)(this,"base","varid:"),(0,e.Z)(this,"classOrder",t.Z.Variable),(0,e.Z)(this,"isVar",1),(0,e.Z)(this,"uri",void 0),this.base="varid:",this.uri=x.join(r,this.base)}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value}hashString(){return this.toString()}substitute(e){var t;return null!=(t=e[this.toNT()])?t:this}toString(){return _.toString(this)}static toString(e){return e.uri.slice(0,e.base.length)===e.base?`?${e.uri.slice(e.base.length)}`:`?${e.uri}`}}let j;!function(e){e.collections="COLLECTIONS",e.defaultGraphType="DEFAULT_GRAPH_TYPE",e.equalsMethod="EQUALS_METHOD",e.id="ID",e.identity="IDENTITY",e.reversibleId="REVERSIBLE_ID",e.variableType="VARIABLE_TYPE"}(j||(j={}));const T=new y,N={supports:{[j.collections]:!1,[j.defaultGraphType]:!1,[j.equalsMethod]:!0,[j.identity]:!1,[j.id]:!0,[j.reversibleId]:!1,[j.variableType]:!0},blankNode:e=>new a(e),defaultGraph:()=>T,equals(e,t){return e===t||!e||!t||((0,c.PY)(e)||(0,c.PY)(t)?!(!(0,c.PY)(e)||!(0,c.PY)(t))&&this.equals(e.subject,t.subject)&&this.equals(e.predicate,t.predicate)&&this.equals(e.object,t.object)&&this.equals(e.graph,t.graph):!(!(0,c.jt)(e)||!(0,c.jt)(t))&&this.id(e)===this.id(t))},id(e){if(!e)return"undefined";if((0,c.PY)(e))return this.quadToNQ(e);switch(e.termType){case o.NK:return"defaultGraph";case o.UH:return _.toString(e);default:const t=this.termToNQ(e);if(t)return t;throw new Error(`Can't id term with type '${e.termType}'`)}},isQuad:e=>e instanceof w,literal(e,t){if("string"!=typeof e&&!t)return h.fromValue(e);const r="string"==typeof e?e:""+e;return"string"==typeof t?-1===t.indexOf(":")?new h(r,t):new h(r,null,this.namedNode(t)):new h(r,null,t)},namedNode:e=>new l.Z(e),quad:(e,t,r,n)=>new w(e,t,r,n||T),triple(e,t,r,n){return this.quad(e,t,r,n)},quadToNQ(e){return`${this.termToNQ(e.subject)} ${this.termToNQ(e.predicate)} ${this.termToNQ(e.object)} ${this.termToNQ(e.graph)} .`},termToNQ(e){switch(e.termType){case o.V1:return"_:"+e.value;case o.NK:return"";case o.ls:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case o.xH:return h.toNT(e);case o._A:case o.XM:return"<"+e.value+">";case o.fb:return"("+e.elements.map((e=>this.termToNQ(e))).join(" ")+")";default:throw new Error(`Can't serialize nonstandard term type (was '${e.termType}')`)}},toNQ(e){return this.isQuad(e)?this.quadToNQ(e):this.termToNQ(e)},variable:e=>new _(e)},A=N;var E=n(7308);function O(e,t){const r=t||{namedNode:e=>new l.Z(e)};return function(t){return r.namedNode(e+(t||""))}}var S=n(5115);function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A;return{boolean:e.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:e.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:e.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:e.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:e.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:e.namedNode("http://www.w3.org/2001/XMLSchema#string")}}I(A);var R=n(9523),k=n.n(R),C=n(5619),D=n(292);function L(e){return new P(e)}class P{constructor(t){(0,e.Z)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,e.Z)(this,"_notNameChars",this._notQNameChars+":"),(0,e.Z)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,e.Z)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,e.Z)(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];const r=Object.keys(k()());for(const e in r){const t=k()()[r[e]](""),n=r[e];this.prefixes[t]=n,this.namespaces[n]=t}this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=t,this.rdfFactory=t.rdfFactory||A,this.xsd=I(this.rdfFactory)}setBase(e){return this.base=e,this}setFlags(e){return this.flags=e||"",this}toStr(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t}fromStr(e){if("{"===e[0]){var t=this.formulas[e];return t||D.log("No formula object for "+e),t}return this.store.fromNT(e)}setNamespaces(e){for(var t in e)this.setPrefix(t,e[t]);return this}setPrefix(e,t){if("default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t){for(let t in this.prefixes)this.prefixes[t]==e&&delete this.prefixes[t];this.prefixes[t]=e,this.namespaces[e]=t}}suggestPrefix(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))}suggestNamespaces(e){for(var t in e)this.suggestPrefix(t,e[t]);return this}checkIntegrity(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")}makeUpPrefix(e){var t=e,r=function(t){return!!this.validPrefix.test(t)&&"ns"!==t&&!(t in this.namespaces)&&(this.prefixes[e]=t,this.namespaces[t]=e,t)}.bind(this);"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var n=t.lastIndexOf("/");n>=0&&(t=t.slice(n+1));for(var i=0;i<t.length&&this.prefixchars.indexOf(t[i]);)i++;if((t=t.slice(0,i)).length<6&&r(t))return t;if(r(t.slice(0,3)))return t.slice(0,3);if(r(t.slice(0,2)))return t.slice(0,2);if(r(t.slice(0,4)))return t.slice(0,4);if(r(t.slice(0,1)))return t.slice(0,1);if(r(t.slice(0,5)))return t.slice(0,5);this.validPrefix.test(t)||(t="n");for(var o=0;;o++)if(r(t.slice(0,3)+o))return t.slice(0,3)+o}rootSubjects(e){for(var t={},r={},n={},i=0;i<e.length;i++){var o=e[i],s=function(e){t.hasOwnProperty(e)||(t[e]=[]),t[e].push(o.subject)};[o.subject,o.predicate,o.object].map((function(e){"BlankNode"===e.termType?n[e.toNT()]=!0:"Collection"===e.termType&&e.elements.forEach((function(e){s(e)}))})),s(e[i].object);var a=r[this.toStr(o.subject)];a||(a=[]),a.push(o),r[this.toStr(o.subject)]=a}var l=[];for(var c in r)if(r.hasOwnProperty(c)){var u=this.fromStr(c);"BlankNode"===u.termType&&t[u]&&1===t[u].length||l.push(u)}this.incoming=t;for(var h={},d=0;d<l.length;d++)h[l[d].toNT()]=!0;return{roots:l,subjects:r,rootsHash:h,incoming:t}}toN3(e){return this.statementsToN3(e.statements)}explicitURI(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?x.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,r="",n=0;n<e.length;n++)r+=(t=e.charCodeAt(n))>65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[n];return r}(e):encodeURI(e))+">"}statementsToNTriples(e){var t=e.slice();t.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,o=this.store,s=this.rdfFactory,a=function(e){if("Collection"!==e.termType)return i.atomicTermToN3(e);for(var t=e.elements,l=o.sym(n+"nill"),c=t.length-1;c>=0;c--){var u=s.blankNode();r+=a(u)+" "+a(o.sym(n+"first"))+" "+a(t[c])+".\n",r+=a(u)+" "+a(o.sym(n+"rest"))+" "+a(l)+".\n",l=u}return i.atomicTermToN3(l)},l=0;l<t.length;l++){var c=t[l],u="";u+=a(c.subject)+" ",u+=a(c.predicate)+" ",u+=a(c.object)+" ",this.flags.indexOf("q")>=0&&(u+=a(c.why)+" "),r+=u+=".\n"}return r}statementsToN3(e){var t=this.store,r={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};e.sort((function(e,n){return S.heavyCompareSPO(e,n,t,r)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var n={};this.flags.indexOf("s")<0&&(n["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(n["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(n["http://www.w3.org/2000/10/swap/log#implies"]="=>");var i=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},o=function(e){for(var t="",r=0;r<e.length;r++){var n=e[r],i="string"==typeof n?n:o(n);if(0!==r){var s=t.slice(-1)||" ";","===i||";"===i||("."!==i||"0123456789.:".includes(s))&&(t+=" ")}t+=i}return t},s=function(e,t){var r="",n=1e5;void 0===t&&(t=-1);for(var a=0;a<e.length;a++){var l=e[a];if("string"!=typeof l){var c=s(l,t+1);if(c.length<10*(80-4*t)&&c.indexOf('"""')<0){var u=o(l);u.length<80-4*t&&(l=u,c="")}c&&(n=1e4),r+=c}if("string"==typeof l){if(1===l.length&&"\n"===r.slice(-1)&&",.;".indexOf(l)>=0){r=r.slice(0,-1),"."==l&&"0123456789.:".includes(r.charAt(r.length-1))&&(r+=" ",n+=1),r+=l+"\n",n+=1;continue}if(n<4*t+4||n+l.length+1<80&&";.".indexOf(r[r.length-2])<0)r=r.slice(0,-1)+" "+l+"\n",n+=l.length+1;else{let e=i(4*t)+l;r+=e+"\n",n=e.length,t<0&&(r+="\n",n=1e5)}}}return r},a=function(e){for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(l(o,t))}return n}.bind(this);function l(e,t){return"BlankNode"!==e.termType||t.incoming[e]?[h(e,t)].concat([c(e,t)]).concat(["."]):u(e,t,!0).concat(["."])}var c=function(e,t){var r=[],i=null,o=t.subjects[this.toStr(e)]||[];if(void 0===o)throw new Error("Cant find statements for "+e);for(var s=[],a=0;a<o.length;a++){var l=o[a];l.predicate.uri===i?s.push(","):(i&&(r=r.concat([s]).concat([";"]),s=[]),r.push(n[l.predicate.uri]?n[l.predicate.uri]:h(l.predicate,t))),i=l.predicate.uri,s.push(u(l.object,t))}return r.concat([s])}.bind(this),u=function(e,t,r){return"BlankNode"!==e.termType||!r&&void 0!==t.rootsHash[e.toNT()]?h(e,t):t.subjects[this.toStr(e)]?["[",c(e,t),"]"]:"[]"}.bind(this);P.prototype.termToN3=h;var h=function(e,t){var r,n;switch(e.termType){case"Graph":return(n=(n=["{"]).concat(a(e.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<e.elements.length;r++)n.push([u(e.elements[r],t)]);return n.push(")"),n;default:return this.atomicTermToN3(e)}}.bind(this),d=function(){var e="";for(var t in this.defaultNamespace&&(e+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(t)&&this.namespacesUsed[t]&&(e+="@prefix "+this.prefixes[t]+": "+this.explicitURI(t)+".\n");return e+"\n"}.bind(this),f=a(e);return d()+s(f)}atomicTermToN3(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var r=e.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return r;case"http://www.w3.org/2001/XMLSchema#decimal":return r.indexOf(".")<0&&(r+=".0"),r;case"http://www.w3.org/2001/XMLSchema#double":{const e=r.toLowerCase().indexOf("e")>0;return r.indexOf(".")<0&&!e&&(r+=".0"),e||(r+="e0"),r}case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===e.value?"true":"false"}var n=this.stringToN3(e.value);return e.language?n+="@"+e.language:e.datatype.equals(this.xsd.string)||(n+="^^"+this.atomicTermToN3(e.datatype,t)),n;case"NamedNode":return this.symbolToN3(e);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}}stringToN3(e,t){t||(t="e");var r,n,i,o,s,a="";for(e.length>20&&'"'!==e.slice(-1)&&t.indexOf("n")<0&&(e.indexOf("\n")>0||e.indexOf('"')>0)?(o='"""',s=this.forbidden3):(o='"',s=this.forbidden1),r=0;r<e.length&&(s.lastIndex=0,null!=s.exec(e.slice(r)));){n=r+s.lastIndex-1,a+=e.slice(r,n);var l=e[n];'"'===l&&'"""'===o&&'"""'!==e.slice(n,n+3)?a+=l:(i='\b\f\r\t\v\n\\"'.indexOf(l))>=0?a+="\\"+'bfrtvn\\"'[i]:t.indexOf("e")>=0?a+="\\u"+("000"+l.charCodeAt(0).toString(16).toLowerCase()).slice(-4):a+=l,r=n+1}return o+a+e.slice(r)+o}symbolToN3(e){var t=e.uri,r=t.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=t.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===t.indexOf("http")||0===t.indexOf("ws")||0===t.indexOf("file"))){for(var n=!0,i=r+1;i<t.length;i++)if(this._notNameChars.indexOf(t[i])>=0){n=!1;break}if(n){var o=t.slice(r+1),s=t.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var a=this.prefixes[s];if(a||(a=this.makeUpPrefix(s)),a)return this.namespacesUsed[s]=!0,a+":"+o}}return this.explicitURI(t)}writeStore(e){var t=this.store,r=t.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var o in i){var s=t.fromNT(o);n&&s.equals(n)||e("\n"+this.atomicTermToN3(s)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,s))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){e("\n<"+r.object.value+"> log:metadata {\n");var n=t.statementsMatching(void 0,void 0,void 0,r.subject);e(this.statementsToN3(this.statementsToN3(n))),e("}.\n")}));var a=[];n&&a.push(n);var l=[];a.map((function(e){l=l.concat(t.statementsMatching(void 0,void 0,void 0,e))})),e(this.statementsToN3(l))}statementsToXML(e){var t=[];t["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",n=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},i=function(e){for(var t="",r=0;r<e.length;r++){var n=e[r];t+="string"==typeof n?n:i(n)}return t},o=function(e,t){var r,s="",a=1e5;t||(t=0);for(var l=0;l<e.length;l++){var c=e[l];if("string"!=typeof c){var u=o(c,t+1);u.length<10*(80-4*t)&&u.indexOf('"""')<0&&(r=i(c)).length<80-4*t&&(c=" "+r,u=""),u&&(a=1e4),s+=u}"string"==typeof c&&(a<4*t+4?(s=s.slice(0,-1)+" "+c+"\n",a+=c.length+1):(s+=(r=n(4*t)+c)+"\n",a=r.length))}return s},s=function(e){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(c(o,t))}return n}.bind(this);function a(e){return void 0===e?"@@@undefined@@@@":e.replace(/[&<"]/g,(function(e){switch(e[0]){case"&":return"&";case"<":return"<";case'"':return"""}}))}var l=function(e){return a(this.base?x.refTo(this.base,e.uri):e.uri)}.bind(this),c=function(e,t){var n,i,o,s,f=[],p=t.subjects[this.toStr(e)];if(void 0===p)return h(e,t);p.sort((function(e,t){var n=e.predicate.uri,i=t.predicate.uri;if(n.substring(0,r.length)===r||i.substring(0,r.length)===r)return n.localeCompare(i);var o=n.substring(r.length),s=i.substring(r.length),a=parseInt(o,10),l=parseInt(s,10);return isNaN(a)||isNaN(l)||a!==o||l!==s?n.localeCompare(i):a-l}));for(var g=0;g<p.length;g++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=p[g]).predicate.uri||n||"NamedNode"!==o.object.termType){if((s=o.predicate).uri.substr(0,r.length)===r){var y=s.uri.substr(r.length);y===parseInt(y,10).toString()&&(s=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=d(s),o.object.termType){case"BlankNode":f=1===t.incoming[o.object].length?f.concat(["<"+i+' rdf:parseType="Resource">',c(o.object,t),"</"+i+">"]):f.concat(["<"+i+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":f=f.concat(["<"+i+' rdf:resource="'+l(o.object)+'"/>']);break;case"Literal":f=f.concat(["<"+i+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.uri)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+i+">"]);break;case"Collection":f=f.concat(["<"+i+' rdf:parseType="Collection">',u(o.object,t),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else n=o.object;var m=n?d(n):"rdf:Description",v="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(v=' rdf:nodeID="'+e.toNT().slice(2)+'"'):v=' rdf:about="'+l(e)+'"',["<"+m+v+">"].concat([f]).concat(["</"+m+">"])}.bind(this);function u(e,t){for(var r=[],n=0;n<e.elements.length;n++)r.push(c(e.elements[n],t));return r}var h=function(e,t){var r=[],n=t.subjects[this.toStr(e)];if(!n)return r;n.sort();for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"BlankNode":r=t.rootsHash[o.object.toNT()]?r.concat(["<"+d(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+d(o.predicate)+">"]):r.concat(["<"+d(o.predicate)+' rdf:parseType="Resource">',h(o.object,t),"</"+d(o.predicate)+">"]);break;case"NamedNode":r=r.concat(["<"+d(o.predicate)+' rdf:resource="'+l(o.object)+'"/>']);break;case"Literal":r=r.concat(["<"+d(o.predicate)+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+d(o.predicate)+">"]);break;case"Collection":r=r.concat(["<"+d(o.predicate)+' rdf:parseType="Collection">',u(o.object,t),"</"+d(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return r}.bind(this),d=function(e){var r=e.uri,n=r.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=r.lastIndexOf("/")),n<0)throw new Error("Cannot make qname out of <"+r+">");for(var i=n+1;i<r.length;i++)if(this._notNameChars.indexOf(r[i])>=0)throw new Error('Invalid character "'+r[i]+'" cannot be in XML qname for URI: '+r);var o=r.slice(n+1),s=r.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return o;var a=this.prefixes[s];return a||(a=this.makeUpPrefix(s)),t[s]=!0,a+":"+o}.bind(this),f=s(e),p="<rdf:RDF";for(var g in this.defaultNamespace&&(p+=' xmlns="'+a(this.defaultNamespace)+'"'),t)if(t.hasOwnProperty(g)){var y=this.base&&this.flags.includes("z")?x.refTo(this.base,g):g;p+="\n xmlns:"+this.prefixes[g]+'="'+a(y)+'"'}return o([p+=">",f,"</rdf:RDF>"],-1)}statementsToJsonld(e){const t=this.statementsToN3(e),r=C.parse(t);return JSON.stringify(r,null,2)}}function F(e,t,r,n,i,s){r=r||(null==e?void 0:e.value);const a=s||{};n=n||o.z8;try{var l=L(t);a.flags&&l.setFlags(a.flags);var c=t.statementsMatching(void 0,void 0,void 0,e);switch("namespaces"in t&&l.suggestNamespaces(t.namespaces),a.namespaces&&l.setNamespaces(a.namespaces),l.setBase(r),n){case o.Is:return u(null,l.statementsToXML(c));case o.qS:case o.sZ:return u(null,l.statementsToN3(c));case o.z8:case o.Eo:return l.setFlags("si"),u(null,l.statementsToN3(c));case o.aV:return l.setFlags("deinprstux"),u(null,l.statementsToNTriples(c));case o.ui:return l.setFlags("si"),u(null,l.statementsToJsonld(c));case o.b4:case o.lL:return l.setFlags("deinprstux q"),u(null,l.statementsToNTriples(c));default:throw new Error("Serialize: Content-type "+n+" not supported for data write.")}}catch(e){if(i)return i(e,void 0);throw e}function u(e,t){return i?void i(e,t):t}}const M=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],U="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function B(e,t,r){const n=[];return r.reduce(((t,r,i,o)=>{let s;return n.push(e.quad(t,e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),o[i])),i<o.length-1?(s=e.blankNode(),n.push(e.quad(t,e.namedNode(U),s))):n.push(e.quad(t,e.namedNode(U),e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),s}),t),n}function q(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;var n=e.length;for(r<0&&(r=n+r);r<n;r++)if(e[r]===t)return r;return-1}var H=n(292);class Z extends r.Z{constructor(){var r;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};super(""),r=this,this.statements=n,this.constraints=i,this.initBindings=s,this.optional=a,(0,e.Z)(this,"termType",o._A),(0,e.Z)(this,"classOrder",t.Z.Graph),(0,e.Z)(this,"fetcher",void 0),(0,e.Z)(this,"isVar",0),(0,e.Z)(this,"ns",O),(0,e.Z)(this,"rdfFactory",void 0),this.rdfFactory=l&&l.rdfFactory||A;for(const e of M)this[e]=function(){return r.rdfFactory[e](...arguments)}}add(e,t,r,n){return 1===arguments.length&&e.forEach((e=>this.add(e.subject,e.predicate,e.object,e.graph))),this.statements.push(this.rdfFactory.quad(e,t,r,n))}addStatement(e){return this.add(e)}bnode(e){return this.rdfFactory.blankNode(e)}addAll(e){e.forEach((e=>{this.add(e.subject,e.predicate,e.object,e.graph)}))}any(e,t,r,n){const i=this.anyStatementMatching(e,t,r,n);return null==i?null:null==e?i.subject:null==t?i.predicate:null==r?i.object:null}anyValue(e,t,r,n){const i=this.any(e,t,r,n);return i?i.value:void 0}anyJS(e,t,n,i){const o=this.any(e,t,n,i);return o?r.Z.toJS(o):void 0}anyStatementMatching(e,t,r,n){let i=this.statementsMatching(e,t,r,n,!0);if(i&&0!==i.length)return i[0]}id(e){return this.rdfFactory.id(e)}statementsMatching(e,t,r,n,i){const o=this.statements.filter((i=>(!e||e.equals(i.subject))&&(!t||t.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))));return i?0===o.length?[]:[o[0]]:o}bottomTypeURIs(e){let t,r,n,i,o,s,a,l;t=[];for(let c in e)if(e.hasOwnProperty(c)){for(l=e[c],a=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(c)),r=!0,i=0,o=a.length;i<o;i++)if(n=a[i],s=n.uri,s in e){r=!1;break}r&&(t[c]=l)}return t}collection(){return new f}each(e,t,r,n){const i=[];let o=this.statementsMatching(e,t,r,n,!1);if(null==e)for(let e=0,t=o.length;e<t;e++)i.push(o[e].subject);else if(null==t)for(let e=0,t=o.length;e<t;e++)i.push(o[e].predicate);else if(null==r)for(let e=0,t=o.length;e<t;e++)i.push(o[e].object);else if(null==n)for(let e=0,t=o.length;e<t;e++)i.push(new l.Z(o[e].graph.value));return i}equals(e){return!!e&&this.hashString()===e.hashString()}findMembersNT(e){let t,r,n,i,o,s,a,l,c,u,h,d,f,p;d={},d[e.toNT()]=!0,i={},s=this.transitiveClosure(d,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0);for(let e in s)if(s.hasOwnProperty(e)){a=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(e));for(let e=0,t=a.length;e<t;e++)f=a[e],i[f.subject.toNT()]=f;l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(e));for(let e=0,r=l.length;e<r;e++)for(o=l[e],c=this.statementsMatching(void 0,o),n=0,t=c.length;n<t;n++)f=c[n],i[f.subject.toNT()]=f;u=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(e));for(let e=0,t=u.length;e<t;e++)for(o=u[e],h=this.statementsMatching(void 0,o),p=0,r=h.length;p<r;p++)f=h[p],i[f.object.toNT()]=f}return i}findMemberURIs(e){return this.NTtoURI(this.findMembersNT(e))}findSubClassesNT(e){let t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}findSuperClassesNT(e){let t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypesNT(e){let t,r,n,i,o,s,a,l,c;n="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",c=[],i=this.statementsMatching(e,void 0,void 0);for(let e=0,t=i.length;e<t;e++)if(l=i[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===l.predicate.uri)c[l.object.toNT()]=l;else{o=this.each(l.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"));for(let e=0,t=o.length;e<t;e++)r=o[e],c[r.toNT()]=l}s=this.statementsMatching(void 0,void 0,e);for(let e=0,r=s.length;e<r;e++){l=s[e],a=this.each(l.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"));for(let e=0,r=a.length;e<r;e++)t=a[e],c[t.toNT()]=l}return this.transitiveClosure(c,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypeURIs(e){return this.NTtoURI(this.findTypesNT(e))}connectedStatements(e,t,r){r=r||[];let n=[e],i={},o={},s=[],a=this,l=function(e){let l=function(e){"BlankNode"!==e.termType||i[e.value]||(i[e.value]=!0,n.push(e))},c=a.statementsMatching(null,null,e,t).concat(a.statementsMatching(e,null,null,t));c=c.filter((function(e){if(r[e.predicate.value])return!1;let t=e.toNT();return!o[t]&&(o[t]=!0,!0)})),c.forEach((function(e){l(e.subject),l(e.object)})),s=s.concat(c)};for(;n.length;)l(n.shift());return s}formula(e){return new Z}fromNT(e){let t,r,n;switch(e[0]){case"<":return this.sym(e.slice(1,-1));case'"':if(n=void 0,t=void 0,r=e.lastIndexOf('"'),r<e.length-1)if("@"===e[r+1])n=e.slice(r+2);else{if("^^"!==e.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+e);t=this.fromNT(e.slice(r+3))}return e=(e=(e=(e=e.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(e,n||t);case"_":return this.rdfFactory.blankNode(e.slice(2));case"?":return new _(e.slice(1))}throw new Error("Can't convert from NT: "+e)}holds(e,t,r,n){let i;if(1===arguments.length){if(!e)return!0;if(e instanceof Array){for(i=0;i<e.length;i++)if(!this.holds(e[i]))return!1;return!0}if((0,c.Yi)(e))return this.holds(e.subject,e.predicate,e.object,e.graph);if(e.statements)return this.holds(e.statements)}return null!=this.anyStatementMatching(e,t,r,n)}holdsStatement(e){return this.holds(e.subject,e.predicate,e.object,e.graph)}list(e,t){if(t.rdfFactory.supports.COLLECTIONS){const r=t.rdfFactory.collection();return e.forEach((function(e){r.append(e)})),r}{const r=t.rdfFactory.blankNode(),n=B(t.rdfFactory,r,e);return t.addAll(n),r}}NTtoURI(e){let t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],"<"===t[0]&&(n[t.slice(1,-1)]=r));return n}serialize(e,t,r,n){return F(r,this,e,t,void 0,n)}substitute(e){let t=this.statements.map((function(t){return t.substitute(e)}));H.log("Formula subs statmnts:"+t);const r=new Z;return r.addAll(t),H.log("indexed-form subs formula:"+r),r}sym(e,t){if(t)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(e)}the(e,t,r,n){let i=this.any(e,t,r,n);return null==i&&E.Z.error("No value found for the() {"+e+" "+t+" "+r+"}."),i}transitiveClosure(e,t,r){let n,i,o,s,a,l,c={};Object.assign(c,e);let u={};for(;;){if(l=function(){for(let e in c)if(c.hasOwnProperty(e))return e}(),null==l)return u;for(a=r?this.each(void 0,t,this.fromNT(l)):this.each(this.fromNT(l),t),i=0,o=a.length;i<o;i++)n=a[i],s=n.toNT(),s in u||s in c||(c[s]=c[l]);u[l]=c[l],delete c[l]}}topTypeURIs(e){let t,r,n,i,o,s,a,l;for(n in a=[],e)if(e.hasOwnProperty(n)){for(l=e[n],o=0,s=this.each(this.rdfFactory.namedNode(n),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf")),t=0,i=s.length;t<i;t++)if(r=s[t],"http://www.w3.org/2000/01/rdf-schema#Resource"!==r.uri){o++;break}o||(a[n]=l)}return a["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete a["http://www.w3.org/2000/01/rdf-schema#Resource"],a["http://www.w3.org/2002/07/owl#Thing"]&&delete a["http://www.w3.org/2002/07/owl#Thing"],a}toString(){return"{"+this.statements.join("\n")+"}"}variable(e){return new _(e)}whether(e,t,r,n){return this.statementsMatching(e,t,r,n,!1).length}}r.Z.fromValue=d;const $=r.Z,z={xsd:O("http://www.w3.org/2001/XMLSchema#")};r.Z.toJS=function(e){return(0,c.uZ)(e)?e.elements.map(r.Z.toJS):(0,c.n_)(e)?e.datatype.equals(z.xsd("boolean"))?"1"===e.value||"true"===e.value:e.datatype.equals(z.xsd("dateTime"))||e.datatype.equals(z.xsd("date"))?new Date(e.value):e.datatype.equals(z.xsd("integer"))||e.datatype.equals(z.xsd("float"))||e.datatype.equals(z.xsd("decimal"))?Number(e.value):e.value:e};var V=n(292);class X{constructor(e,t){this.pat=new K,this.vars=[],this.name=e,this.id=t}}function J(e,t,r,n){function i(e){var t,r="";for(t in e)e.hasOwnProperty(t)&&(r+=" "+t+" -> "+e[t]);return r}function o(e){var t,r="Bindings: ",n=e.length;for(t=0;t<n;t++)r+=i(e[t][0])+";\n\t";return r}function s(e,t,r,n){var i;if(e.length!==t.length)return[];if(!e.length)return[[[],null]];var o=function(e,t,r,n){var i=r[e];if(void 0===i){if(e.isVar){var o=[];return o[e]=t,[[o,null]]}i=e}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[t]&&(t=n.redirections[t]),i.equals(t)||i.uri&&i.uri===g?[[[],null]]:[];if(e instanceof Array)return t instanceof Array?s(e,t,r):[];throw new Error("query.js: oops - code not written yet")}(e[0],t[0],r,n);if(0===o.length)return o;var a,l,c,u,h,d,f,p=[],y=o.length;for(a=0;a<y;a++){for(h in f=[],l=o[a][0])l.hasOwnProperty(h)&&(f[h]=l[h]);for(h in r)r.hasOwnProperty(h)&&(f[h]=r[h]);for(u=(i=s(e.slice(1),t.slice(1),f,n)).length,c=0;c<u;c++){for(h in d=i[c][0],l)l.hasOwnProperty(h)&&(d[h]=l[h]);p.push([d,null])}}return p}function a(e,t){var r,n={};for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function l(e,t){return this.trunkBindings=t,this.originalCallback=e,this.branches=[],this}function c(e,t){return this.count=0,this.success=!1,this.done=!1,this.callback=e,this.onDone=t,this}l.prototype.checkAllDone=function(){var e;for(e=0;e<this.branches.length;e++)if(!this.branches[e].done)return;E.Z.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},l.prototype.doCallBacks=function(e,t){var r;if(e<0)return this.originalCallback(t);for(r=0;r<this.branches[e].results.length;r++)this.doCallBacks(e-1,a(t,this.branches[e].results[r]))},c.prototype.reportMatch=function(e){this.callback(e),this.success=!0},c.prototype.reportDone=function(){this.done=!0,E.Z.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var u=function(e){return this.count=0,this.done=!1,this.results=[],this.junction=e,e.branches.push(this),this};function h(e,t,r){var n,i,o,s,a,l;for(t.nvars=0,t.index=null,n=[t.subject,t.predicate,t.object,t.why],s=[e.subjectIndex,e.predicateIndex,e.objectIndex,e.whyIndex],o=0;o<4;o++){let c=n[o];if(c.uri&&c.uri===g);else if(c.isVar&&void 0===r[c])t.nvars++;else{if(void 0,c=void 0===(l=r[a=n[o]])?a:l,e.redirections[e.id(c)]&&(c=e.redirections[e.id(c)]),!(i=s[o][e.id(c)]))return t.index=[],!1;(null===t.index||t.index.length>i.length)&&(t.index=i)}}return null===t.index&&(t.index=e.statements),!0}function d(e,t){return e.nvars!==t.nvars?e.nvars-t.nvars:e.index.length-t.index.length}u.prototype.reportMatch=function(e){this.results.push(e)},u.prototype.reportDone=function(){E.Z.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),E.Z.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var f=function(e,r,n,o,s,a,c){E.Z.debug("Match begins, Branch count now: "+c.count+" for "+c.pattern_debug);var h,d,p=r.statements;if(0===p.length){if(E.Z.debug("FOUND MATCH WITH BINDINGS:"+i(n)),0===r.optional.length)c.reportMatch(n);else{E.Z.debug("OPTIONAL: "+r.optional);var g,m=new l(t,n),v=[];for(g=0;g<r.optional.length;g++)v[g]=new u(m),v[g].pattern_debug=r.optional[g];for(g=0;g<r.optional.length;g++)v[g].count=v[g].count+1,f(e,r.optional[g],n,"",s,t,v[g])}return c.count--,void E.Z.debug("Match ends -- success , Branch count now: "+c.count+" for "+c.pattern_debug)}var b=p.length;if(s){var w=function(t,i){var l=t.uri.split("#")[0];s.nowOrWhenFetched(l,void 0,(function(i,l,u){i||V.log("Error following link to <"+t.uri+"> in query: "+l),f(e,r,n,o,s,a,c)}))};for(d=0;d<b;d++){if(h=p[d],void 0!==n[h.subject]&&n[h.subject].uri&&s&&"unrequested"===s.getState((0,x.docpart)(n[h.subject].uri)))return void w(n[h.subject]);if(void 0!==n[h.object]&&n[h.object].uri&&s&&"unrequested"===s.getState((0,x.docpart)(n[h.object].uri)))return void w(n[h.object])}}y(e,r,n,o,s,a,c)},p=function(e,t){var r,n,i=!0;for(r in e)e.hasOwnProperty(r)&&t[r]&&(n=t[r].test)&&!n(e[r])&&(i=!1);return i},y=function(e,t,r,n,a,l,c){var u,g,y,m,v,b,w,x=t.statements,_=x.length;for(u=0;u<_;u++)h(e,w=x[u],r);x.sort(d),w=x[0];var j,T=e.formula();T.optional=t.optional,T.constraints=t.constraints,T.statements=x.slice(1),E.Z.debug(n+"match2 searching "+w.index.length+" for "+w+"; bindings so far="+i(r));var N,A,O=w.index.length,S=0;for(j=0;j<O;j++)for(A=w.index[j],N=s([w.subject,w.predicate,w.object,w.why],[A.subject,A.predicate,A.object,A.why],r,e),E.Z.info(n+" From first: "+N.length+": "+o(N)),y=N.length,g=0;g<y;g++)if(v=[],b=N[g][0],p(b,t.constraints)){for(m in b)b.hasOwnProperty(m)&&(v[m]=b[m]);for(m in r)r.hasOwnProperty(m)&&(v[m]=r[m]);c.count++,S++,f(e,T,v,n+" ",a,l,c)}else E.Z.debug("Branch count CS: "+c.count);c.count--,0===S&&E.Z.debug("Match2 fails completely on "+w),E.Z.debug("Match2 ends, Branch count: "+c.count+" for "+c.pattern_debug),0===c.count&&(E.Z.debug("Branch finished."),c.reportDone())},m=this;E.Z.debug("Query on "+this.statements.length);var v=new c(t,n);v.count++,e.sync?f(m,e.pat,e.pat.initBindings,"",r,t,v):setTimeout((function(){f(m,e.pat,e.pat.initBindings,"",r,t,v)}),0)}const G="http://www.w3.org/2002/07/owl#";function W(e,t,r,n){var i=e.any(t,r,void 0);return!!i&&(e.equate(i,n),!0)}function Q(e,t,r,n){var i=e.any(void 0,r,n);return!!i&&(e.equate(i,t),!0)}function Y(e,t,r,n,i){e.typeCallback&&e.typeCallback(e,n,i);var o=e.classActions[e.id(n)],s=!1;if(o)for(var a=0;a<o.length;a++)s=s||o[a](e,t,r,n,i);return s}class K extends Z{constructor(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(void 0,void 0,void 0,void 0,r),(0,e.Z)(this,"updater",void 0),(0,e.Z)(this,"namespaces",void 0),(0,e.Z)(this,"classActions",void 0),(0,e.Z)(this,"propertyActions",void 0),(0,e.Z)(this,"redirections",void 0),(0,e.Z)(this,"aliases",void 0),(0,e.Z)(this,"HTTPRedirects",void 0),(0,e.Z)(this,"subjectIndex",void 0),(0,e.Z)(this,"predicateIndex",void 0),(0,e.Z)(this,"objectIndex",void 0),(0,e.Z)(this,"whyIndex",void 0),(0,e.Z)(this,"index",void 0),(0,e.Z)(this,"features",void 0),(0,e.Z)(this,"_universalVariables",void 0),(0,e.Z)(this,"_existentialVariables",void 0),(0,e.Z)(this,"rdfArrayRemove",void 0),(0,e.Z)(this,"dataCallbacks",void 0),this.propertyActions={},this.classActions={},this.redirections=[],this.aliases=[],this.HTTPRedirects=[],this.subjectIndex=[],this.predicateIndex=[],this.objectIndex=[],this.whyIndex=[],this.index=[this.subjectIndex,this.predicateIndex,this.objectIndex,this.whyIndex],this.namespaces={},this.features=t||[],this.rdfArrayRemove=r.rdfArrayRemove||S.RDFArrayRemove,r.dataCallback&&(this.dataCallbacks=[r.dataCallback]),this.initPropertyActions(this.features)}static get defaultGraphURI(){return g}substitute(e){var t=this.statements.map((function(t){return t.substitute(e)})),r=new K;return r.add(t),r}addDataCallback(e){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(e)}applyPatch(e,t,r){var n,i=this,o=null;function s(s){if(e.delete){n=e.delete,o&&(n=n.substitute(o)),n=n.statements;var a=[],l=n.map((function(e){var r=i.statementsMatching(e.subject,e.predicate,e.object,t);return 0===r.length?(a.push(e),null):r[0]}));if(a.length)return r("Could not find to delete: "+a.join("\n or "));l.map((function(e){i.remove(e)}))}e.insert&&(n=e.insert,o&&(n=n.substitute(o)),(n=n.statements).map((function(e){e.graph=t,i.add(e.subject,e.predicate,e.object,e.graph)}))),s()}if(e.where){var a=new X("patch");a.pat=e.where,a.pat.statements.map((function(e){e.graph=Jt(t.value)})),a.sync=!0;var l=[];i.query(a,(function(e){l.push(e)}),i.fetcher,(function(){return 0===l.length?r("No match found to be patched:"+e.where):l.length>1?r("Patch ambiguous. No patch done."):(o=l[0],void s(r))}))}else s(r)}declareExistential(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}initPropertyActions(e){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[Y],q(e,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${G}sameAs`))]=[function(e,t,r,n,i){return e.equate(t,n),!0}]),q(e,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${G}InverseFunctionalProperty`))]=[function(e,t,r,n,i){return e.newPropertyAction(t,Q)}]),q(e,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${G}FunctionalProperty`))]=[function(e,t,r,n,i){return e.newPropertyAction(t,W)}])}addStatement(e){return this.add(e.subject,e.predicate,e.object,e.graph),this.statements.length}add(e,t,r,n){var i,o,s;if(1===arguments.length){if(e instanceof Array)for(i=0;i<e.length;i++)this.add(e[i]);else(0,c.PY)(e)?this.add(e.subject,e.predicate,e.object,e.graph):(0,c.Pv)(e)&&this.add(e.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof e&&(e=this.rdfFactory.namedNode(e)),t=$.fromValue(t);const a=$.fromValue(r);if(n=$.fromValue(n),!(0,c.f)(e))throw new Error("Subject is not a subject type");if(!(0,c.nq)(t))throw new Error(`Predicate ${t} is not a predicate type`);if(!(0,c.Uc)(a))throw new Error(`Object ${a} is not an object type`);if(!(0,c.NA)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,t,n);var l=this.id(this.canon(t)),u=!1;if(o=this.propertyActions[l])for(i=0;i<o.length;i++)u=u||o[i](this,e,t,a,n);if(this.holds(e,t,a,n))return null;var h=[this.id(this.canon(e)),l,this.id(this.canon(a)),this.id(this.canon(n))];for(s=this.rdfFactory.quad(e,t,a,n),i=0;i<4;i++){var d=this.index[i],f=h[i];d[f]||(d[f]=[]),d[f].push(s)}if(this.statements.push(s),this.dataCallbacks)for(const e of this.dataCallbacks)e(s);return s}canon(e){if(!e)return e;const t=this.redirections[this.id(e)];if(t)return t;switch(e.termType){case o.V1:return new a(e.value);case o.fb:return e;case o.NK:return new y;case o.ls:case o._A:return e;case o.xH:return new h(e.value,e.language,e.datatype);case o.XM:return new l.Z(e.value);case o.UH:return new _(e.value);default:throw new Error(`Term Type not recognized for canonization: ${e.termType}`)}}check(){this.checkStatementList(this.statements);for(var e=0;e<4;e++){var t=this.index[e];for(var r in t)t.hasOwnProperty(r)&&this.checkStatementList(t[r],e)}}checkStatementList(e,t){void 0===t&&(t=0);for(var r,n=" found in "+["subject","predicate","object","why"][t]+" index.",i=0;i<e.length;i++){for(var o=[(r=e[i]).subject,r.predicate,r.object,r.graph],s=function(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.graph))return!0},a=0;a<4;a++){var l=this.canon(o[a]),c=this.id(l);this.index[a][c]&&s(this.index[a][c],r)}if(!s(this.statements,r))throw new Error("Statement list does not statement "+r+"@"+r.graph+n)}}close(){return this}compareTerms(e,r){return Object.prototype.hasOwnProperty.call(e,"compareTerm")?e.compareTerm(r):t.Z[e.termType]<t.Z[r.termType]?-1:t.Z[e.termType]>t.Z[r.termType]?1:e.value<r.value?-1:e.value>r.value?1:0}copyTo(e,t,r){r||(r=[]);var n=this.statementsMatching(e);-1!==q(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,e));for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"NamedNode":this.add(t,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(t,o.predicate,o.object.copy(this))}-1!==q(r,"delete")&&this.remove(o)}}equate(e,t){const r=this.canon(e),n=this.canon(t);var i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}formula(e){return new K(e)}get length(){return this.statements.length}match(e,t,r,n){return this.statementsMatching($.fromValue(e),$.fromValue(t),$.fromValue(r),$.fromValue(n))}mentionsURI(e){var t="<"+e+">";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}newExistential(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}newPropertyAction(e,t){var r=this.id(e);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(t);for(var n=this.statementsMatching(void 0,e,void 0),i=!1,o=0;o<n.length;o++)i=i||t(this,n[o].subject,e,n[o].object);return i}newUniversal(e){var t=this.sym(e);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(t),t}variable(e){return new _(e)}nextSymbol(e){for(var t=0;;t++){var r=e.value+"#n"+t;if(!this.mentionsURI(r))return this.sym(r)}}query(e,t,r,n){return J.call(this,e,t,r,n)}querySync(e){var t=[],r=!1;if(e.sync=!0,J.call(this,e,(function(e){t.push(e)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return t}remove(e){if(e instanceof Array){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}if((0,c.Pv)(e))return this.remove(e.statements);var r=this.statementsMatching(e.subject,e.predicate,e.object,e.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+e);return this.removeStatement(r[0]),this}removeDocument(e){for(var t=this.statementsMatching(void 0,void 0,void 0,e).slice(),r=0;r<t.length;r++)this.removeStatement(t[r]);return this}removeMany(e,t,r,n,i){for(var o=this.statementsMatching(e,t,r,n,!1),s=[],a=0;a<o.length;a++)s.push(o[a]);for(i&&(s=s.slice(0,i)),a=0;a<s.length;a++)this.remove(s[a])}removeMatches(e,t,r,n){return this.removeMany(e,t,r,n),this}removeStatement(e){for(var t=[e.subject,e.predicate,e.object,e.graph],r=0;r<4;r++){var n=this.canon(t[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],e)}return this.rdfArrayRemove(this.statements,e),this}removeStatements(e){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}replaceWith(e,t){for(var r=this.id(e),n=this.id(t),i=function(e){var t=e[r];if(t){var i=e[n];e[n]=i?t.concat(i):t,delete e[r]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[r]=t,e.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(e),this.aliases[r])for(o=0;o<this.aliases[r].length;o++)this.redirections[this.id(this.aliases[r][o])]=t,this.aliases[n].push(this.aliases[r][o]);this.add(t,this.sym("http://www.w3.org/2007/ont/link#uri"),e),this.fetcher&&this.fetcher.nowKnownAs(e,t)}return i(this.classActions),i(this.propertyActions),!0}allAliases(e){var t=this.aliases[this.id(this.canon(e))]||[];return t.push(this.canon(e)),t}sameThings(e,t){if(e.equals(t))return!0;var r=this.canon(e);if(!r)return!1;var n=this.canon(t);return!!n&&r.value===n.value}setPrefixForURI(e,t){if(("tab"!==e||!this.namespaces.tab)&&"ns"!==e.slice(0,2)&&"default"!==e.slice(0,7)){for(let e in this.namespaces)this.namespaces[e]==t&&delete this.namespaces[e];this.namespaces[e]=t}}statementsMatching(e,t,r,n,i){var o,s,a=[e,t,r,n],l=[],c=[],u=[],h=[];for(o=0;o<4;o++)l[o]=this.canon($.fromValue(a[o])),l[o]?(h.push(o),c[o]=this.id(l[o])):u.push(o);if(0===h.length)return this.statements;if(1===h.length)return o=h[0],(s=this.index[o][c[o]])&&i&&s.length>1&&(s=s.slice(0,1)),s||[];var d,f,p=1e10;for(f=0;f<h.length;f++){if(o=h[f],!(s=this.index[o][c[o]]))return[];s.length<p&&(p=s.length,d=f)}for(var g=h[d],y=this.index[g][c[g]],m=h.slice(0,d).concat(h.slice(d+1)),v=[],b=["subject","predicate","object","why"],w=0;w<y.length;w++){var x=y[w];for(f=0;f<m.length;f++)if(o=m[f],!this.canon(x[b[o]]).equals(l[o])){x=null;break}if(null!=x&&(v.push(x),i))break}return v}uris(e){var t=this.canon(e),r=this.aliases[this.id(t)];if(!t.value)return[];var n=[t.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}serialize(e,t,r,n){var i;return F(r,this,e,t,void 0,n={...n||{},namespaces:null!==(i=n)&&void 0!==i&&i.namespaces?{...this.namespaces,...n.namespaces}:{...this.namespaces}})}}(0,e.Z)(K,"handleRDFType",void 0),K.handleRDFType=Y;const ee=O("http://www.w3.org/1999/02/22-rdf-syntax-ns#");function te(e,t){function r(n,i,o){const s=e.statementsMatching(n,ee("rest"),null,t);if(1!==s.length)throw new Error(`Bad list structure: no rest at ${n}`);const a=e.statementsMatching(n,ee("first"),null,t);if(1!==a.length)throw new Error(`Bad list structure: rest but ${a.length} firsts at ${n}`);const l=[a[0].object].concat(i),c=o.concat(s).concat(a),u=e.statementsMatching(null,ee("rest"),n,t);if(0===u.length){const r=new f(l);return e.remove(c),void function(e,t,r,n){for(const i of e.statementsMatching(r,null,null,n)){const r=new w(t,i.predicate,i.object,n);e.remove(i),e.add(r)}for(const i of e.statementsMatching(null,r,null,n))e.remove(i),e.add(new w(i.subject,t,i.object,n));for(const i of e.statementsMatching(null,null,r,n))e.remove(i),e.add(new w(i.subject,i.predicate,t,n))}(e,r,n,t)}if(1!==u.length)throw new Error(`Bad list structure: ${u.length} pres at ${n}`);const h=u[0].subject;if("BlankNode"!==h.termType)throw new Error(`Bad list element node ${h} type: ${h.termType} `);r(h,l,c)}!function(e,t){const r=ee("nil");for(const n of e.statementsMatching(r,null,null,t)){e.remove(n);const r=new f;e.add(new w(r,n.predicate,n.object,t))}for(const n of e.statementsMatching(null,null,r,t))if(!n.predicate.sameTerm(ee("rest"))){e.remove(n);const r=new f;e.add(new w(n.subject,n.predicate,r,t))}}(e,t),e.statementsMatching(null,ee("rest"),ee("nil"),t).forEach((e=>{if("BlankNode"!==e.subject.termType)throw new Error(`Bad list element node ${e.subject} type: ${e.subject.termType} `);r(e.subject,[],[])}))}var re="http://www.w3.org/2000/10/swap/log#",ne=function(e){return e},ie=function(e){return e},oe=function(e){if(e.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},se=function(e){return e.length},ae=function(e,t,r){if(void 0===e.slice)throw"@@ mising.js: No .slice function for "+e+" of type "+typeof e;return void 0===r||null==r?e.slice(t):e.slice(t,r)},le=Error("dummy error stop iteration"),ce=function(e){return this.last=0,this.li=e,this.next=function(){if(this.last==this.li.length)throw le;return this.li[this.last++]},this},ue=function(e,t){return e.indexOf(t)},he=function(e,t){if(!e){if(t)throw"python Assertion failed: "+t;throw"(python) Assertion failed."}};String.prototype.encode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}(this)},String.prototype.decode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return this};var de=function(e,t){return x.join(t,e)},fe="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",pe="http://www.w3.org/2002/07/owl#sameAs",ge="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",ye=ge+":",me=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),ve=new RegExp("^[0-9][0-9][0-9][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]*)?)?)?Z?"),be=new RegExp('[\\\\\\r\\n\\"]',"g"),we=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const xe=function(e,t,r,n,i,o,s,a){return new _e(e,t,r,n,i,o,s,a)};class _e{constructor(e,t,r,n,i,o,s,a){void 0===t&&(t=null),void 0===r&&(r=""),void 0===n&&(n=null),void 0===i&&(i=""),void 0===o&&(o=null),void 0===s&&(s=""),void 0===a&&(a=null),this._bindings=new oe([]),this._flags=s,""!=r&&(he(r.indexOf(":")>=0,"Document URI not absolute: "+r),this._bindings[""]=r+"#"),this._store=e,i&&e.setGenPrefix(i),this._thisDoc=r,this.source=e.sym(r),this.lines=0,this.statementCount=0,this.hasNil=!1,this.startOfLine=0,this.previousLine=0,this._genPrefix=i,this.keywords=new ie(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new oe([]),this._variables=new oe([]),this._parentVariables=new oe([]),this._reason=a,this._reason2=null,this._baseURI=n||r||null,he(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==t?this._thisDoc?this._formula=e.formula(r+"#_formula"):this._formula=e.formula():this._formula=t,this._context=this._formula,this._parentContext=null}here(e){return this._genPrefix+"_L"+this.lines+"C"+(e-this.startOfLine+1)}formula(){return this._formula}loadStream(e){return this.loadBuf(e.read())}loadBuf(e){return this.startDoc(),this.feed(e),this.endDoc()}feed(e){for(var t=e.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(t,r);if(n<0)return;if((r=this.directiveOrStatement(t,n))<0)throw je(this._thisDoc,this.lines,t,n,"expected directive or statement")}}directiveOrStatement(e,t){var r,n=this.skipSpace(e,t);return n<0?n:(r=this.directive(e,n))>=0||(r=this.statement(e,n))>=0?this.checkDot(e,r):r}tok(e,t,r){if("@"==t.slice(r,r+1))r+=1;else if(q(this.keywords,e)<0)return-1;var n=r+se(e);return t.slice(r,n)==e&&ge.indexOf(t.charAt(n))>=0?n:-1}directive(e,t){if((o=this.skipSpace(e,t))<0)return o;var r=new ie([]);if((o=this.tok("bind",e,t))>0)throw je(this._thisDoc,this.lines,e,t,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!1))<0)throw je(this._thisDoc,this.lines,e,t,"'@keywords' needs comma separated list of words");return this.setKeywords(ae(r,null,null)),t}if((o=this.tok("forAll",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!0))<0)throw je(this._thisDoc,this.lines,e,t,"Bad variable list after @forAll");var n=new ce(r);try{for(;;){var i=n.next();(q(this._variables,i)<0||q(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(e){if(e!=le)throw e}return t}if((o=this.tok("forSome",e,t))>0){if((t=this.commaSeparatedList(e,o,r,this.uri_ref2))<0)throw je(this._thisDoc,this.lines,e,t,"Bad variable list after @forSome");n=new ce(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(e){if(e!=le)throw e}return t}if((o=this.tok("prefix",e,t))>=0){var o,s=new ie([]);if((t=this.qname(e,o,s))<0)throw je(this._thisDoc,this.lines,e,o,"expected qname after @prefix");if((o=this.uri_ref2(e,t,s))<0)throw je(this._thisDoc,this.lines,e,t,"expected <uriref> after @prefix _qname_");var a=s[1].uri;return this._baseURI?a=de(this._baseURI,a):he(a.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),he(a.indexOf(":")>=0),this._bindings[s[0][0]]=a,this.bind(s[0][0],function(e){return encodeURI(e)}(a)),o}if((o=this.tok("base",e,t))>=0){if(s=new ie([]),(t=this.uri_ref2(e,o,s))<0)throw je(this._thisDoc,this.lines,e,o,"expected <uri> after @base ");if(a=s[0].uri,!this._baseURI)throw je(this._thisDoc,this.lines,e,o,"With no previous base URI, cannot use relative URI in @base <"+a+">");return a=de(this._baseURI,a),he(a.indexOf(":")>=0),this._baseURI=a,t}return-1}bind(e,t){""==e||this._store.setPrefixForURI(e,t)}setKeywords(e){null==e?this.keywordsSet=0:(this.keywords=e,this.keywordsSet=1)}startDoc(){}endDoc(){return this.hasNil&&this._store.rdfFactory.supports.COLLECTIONS&&te(this._store,this.source),this._formula}makeStatement(e){e[0].add(e[2],e[1],e[3],this.source),(e[2].uri&&e[2].uri===fe||e[3].uri&&e[3].uri===fe)&&(this.hasNil=!0),this.statementCount+=1}statement(e,t){var r=new ie([]);if((t=this.object(e,t,r))<0)return t;var n=this.property_list(e,t,r[0]);if(n<0)throw je(this._thisDoc,this.lines,e,t,"expected propertylist");return n}subject(e,t,r){return this.item(e,t,r)}verb(e,t,r){if((i=this.skipSpace(e,t))<0)return i;var n=new ie([]);if((i=this.tok("has",e,t))>=0){if((t=this.prop(e,i,n))<0)throw je(this._thisDoc,this.lines,e,i,"expected property after 'has'");return r.push(new ne(["->",n[0]])),t}if((i=this.tok("is",e,t))>=0){if((t=this.prop(e,i,n))<0)throw je(this._thisDoc,this.lines,e,i,"expected <property> after 'is'");if((i=this.skipSpace(e,t))<0)throw je(this._thisDoc,this.lines,e,t,"End of file found, expected property after 'is'");var i;if(t=i,(i=this.tok("of",e,t))<0)throw je(this._thisDoc,this.lines,e,t,"expected 'of' after 'is' <prop>");return r.push(new ne(["<-",n[0]])),i}if((i=this.tok("a",e,t))>=0)return r.push(new ne(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==e.slice(t,t+2))return r.push(new ne(["<-",this._store.sym(re+"implies")])),t+2;if("="==e.slice(t,t+1))return">"==e.slice(t+1,t+2)?(r.push(new ne(["->",this._store.sym(re+"implies")])),t+2):(r.push(new ne(["->",this._store.sym(pe)])),t+1);if(":="==e.slice(t,t+2))return r.push(new ne(["->",re+"becomes"])),t+2;if((i=this.prop(e,t,n))>=0)return r.push(new ne(["->",n[0]])),i;if(">-"==e.slice(t,t+2)||"<-"==e.slice(t,t+2))throw je(this._thisDoc,this.lines,e,i,">- ... -> syntax is obsolete.");return-1}prop(e,t,r){return this.item(e,t,r)}item(e,t,r){return this.path(e,t,r)}blankNode(e){return this._context.bnode(e,this._reason2)}path(e,t,r){if((o=this.nodeOrLiteral(e,t,r))<0)return o;for(;"!^.".indexOf(e.slice(o,o+1))>=0;){var n=e.slice(o,o+1);if("."==n){var i=e.slice(o+1,o+2);if(!i||ye.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var o,s=r.pop(),a=this.blankNode(this.here(o));if((o=this.node(e,o+1,r))<0)throw je(this._thisDoc,this.lines,e,o,"EOF found in middle of path syntax");var l=r.pop();"^"==n?this.makeStatement(new ne([this._context,l,a,s])):this.makeStatement(new ne([this._context,l,s,a])),r.push(a)}return o}anonymousNode(e){if(t=this._anonymousNodes[e])return t;var t=this._store.bnode(e);return this._anonymousNodes[e]=t,t}node(e,t,r,n){void 0===n&&(n=null);var i=n;if((u=this.skipSpace(e,t))<0)return u;t=u;var o=e.slice(t,t+1);if("["==o){var s=this.here(t);if((u=this.skipSpace(e,t+1))<0)throw je(this._thisDoc,this.lines,e,t,"EOF after '['");if("="==e.slice(u,u+1)){t=u+1;var a=new ie([]);if(!((u=this.objectList(e,t,a))>=0))throw je(this._thisDoc,this.lines,e,t,"objectList expected after [= ");if(i=a[0],se(a)>1){var l=new ce(a);try{for(;;){var c=l.next();this.makeStatement(new ne([this._context,this._store.sym(pe),i,c]))}}catch(e){if(e!=le)throw e}}if((u=this.skipSpace(e,u))<0)throw je(this._thisDoc,this.lines,e,t,"EOF when objectList expected after [ = ");if(";"==e.slice(u,u+1))var u=u+1}if(null==i&&(i=this.blankNode(s)),(t=this.property_list(e,u,i))<0)throw je(this._thisDoc,this.lines,e,u,"property_list expected");if((u=this.skipSpace(e,t))<0)throw je(this._thisDoc,this.lines,e,t,"EOF when ']' expected after [ <propertyList>");if("]"!=e.slice(u,u+1))throw je(this._thisDoc,this.lines,e,u,"']' expected");return r.push(i),u+1}if("{"==o){if("$"==e.slice(t+1,t+2)){u=(t+=1)+1;for(var h=new ie([]),d=!0;;){if((t=this.skipSpace(e,u))<0)throw je(this._thisDoc,this.lines,e,t,"needed '$}', found end.");if("$}"==e.slice(t,t+2)){u=t+2;break}if(d)d=!1;else{if(","!=e.slice(t,t+1))throw je(this._thisDoc,this.lines,e,t,"expected: ','");t+=1}var f=new ie([]);if((u=this.item(e,t,f))<0)throw je(this._thisDoc,this.lines,e,t,"expected item in set or '$}'");h.push(f[0])}return r.push(this._store.newSet(h,this._context)),u}u=t+1;var p=this._parentContext;this._parentContext=this._context;var g=this._anonymousNodes,y=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new oe([]),this._variables=this._variables.slice();var m=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((t=this.skipSpace(e,u))<0)throw je(this._thisDoc,this.lines,e,t,"needed '}', found end.");if("}"==e.slice(t,t+1)){u=t+1;break}if((u=this.directiveOrStatement(e,t))<0)throw je(this._thisDoc,this.lines,e,t,"expected statement or '}'")}return this._anonymousNodes=g,this._variables=this._parentVariables,this._parentVariables=y,this._context=this._parentContext,this._reason2=m,this._parentContext=p,r.push(i.close()),u}if("("==o){var v=this._store.list;for("$"==e.slice(t+1,t+2)&&(v=this._store.newSet,t+=1),u=t+1,h=new ie([]);;){if((t=this.skipSpace(e,u))<0)throw je(this._thisDoc,this.lines,e,t,"needed ')', found end.");if(")"==e.slice(t,t+1)){u=t+1;break}if(f=new ie([]),(u=this.item(e,t,f))<0)throw je(this._thisDoc,this.lines,e,t,"expected item in list or ')'");h.push(f[0])}return r.push(v(h,this._context)),u}if((u=this.tok("this",e,t))>=0)throw je(this._thisDoc,this.lines,e,t,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(u=this.tok("true",e,t))>=0?(r.push(!0),u):(u=this.tok("false",e,t))>=0?(r.push(!1),u):null==i&&(u=this.uri_ref2(e,t,r))>=0?u:-1}property_list(e,t,r){for(;;){if((u=this.skipSpace(e,t))<0)throw je(this._thisDoc,this.lines,e,t,"EOF found when expected verb in property list");if(":-"!=e.slice(u,u+2)){t=u;var n=new ie([]);if((u=this.verb(e,t,n))<=0)return t;var i=new ie([]);if((t=this.objectList(e,u,i))<0)throw je(this._thisDoc,this.lines,e,u,"objectList expected");var o=new ce(i);try{for(;;){var s=o.next(),a=n[0],l=a[0],c=a[1];"->"==l?this.makeStatement(new ne([this._context,c,r,s])):this.makeStatement(new ne([this._context,c,s,r]))}}catch(e){if(e!=le)throw e}if((u=this.skipSpace(e,t))<0)throw je(this._thisDoc,this.lines,e,u,"EOF found in list of objects");if(";"!=e.slice(t,t+1))return t;t+=1}else{t=u+2;var u,h=new ie([]);if((u=this.node(e,t,h,r))<0)throw je(this._thisDoc,this.lines,e,t,"bad {} or () or [] node after :- ");t=u}}}commaSeparatedList(e,t,r,n){if((i=this.skipSpace(e,t))<0)throw je(this._thisDoc,this.lines,e,i,"EOF found expecting comma sep list");if("."==e.charAt(i))return t;if(n)var i=this.uri_ref2(e,i,r);else i=this.bareWord(e,i,r);if(i<0)return-1;for(;;){if((t=this.skipSpace(e,i))<0)return t;var o=e.slice(t,t+1);if(","!=o)return"."!=o?-1:t;if((i=n?this.uri_ref2(e,t+1,r):this.bareWord(e,t+1,r))<0)throw je(this._thisDoc,this.lines,e,i,"bad list content")}}objectList(e,t,r){if((t=this.object(e,t,r))<0)return-1;for(;;){var n=this.skipSpace(e,t);if(n<0)throw je(this._thisDoc,this.lines,e,n,"EOF found after object");if(","!=e.slice(n,n+1))return n;if((t=this.object(e,n+1,r))<0)return t}}checkDot(e,t){var r=this.skipSpace(e,t);if(r<0)return r;if("."==e.slice(r,r+1))return r+1;if("}"==e.slice(r,r+1))return r;if("]"==e.slice(r,r+1))return r;throw je(this._thisDoc,this.lines,e,r,"expected '.' or '}' or ']' at end of statement")}uri_ref2(e,t,r){var n=new ie([]);if((d=this.qname(e,t,n))>=0){var i=n[0],o=i[0],s=i[1];if(null==o){he(0,"not used?");var a=this._baseURI+"#"}else if(!(a=this._bindings[o])){if("_"==o)return r.push(this.anonymousNode(s)),d;throw je(this._thisDoc,this.lines,e,t,"Prefix "+o+" not bound.")}var l=this._store.sym(a+s);return q(this._variables,l)>=0?r.push(this._variables[l]):r.push(l),d}if((t=this.skipSpace(e,t))<0)return-1;if("?"==e.charAt(t)){var c=new ie([]);return(d=this.variable(e,t,c))>0?(r.push(c[0]),d):-1}if("<"==e.charAt(t)){for(var u=t+=1;t<se(e);){if(">"==e.charAt(t)){var h=e.slice(u,t);return this._baseURI?h=de(this._baseURI,h):he(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==e.slice(t-1,t)&&"#"!=ae(h,-1,null)&&(h+="#"),l=this._store.sym(h),q(this._variables,l)>=0?r.push(this._variables[l]):r.push(l),t+1}t+=1}throw je(this._thisDoc,this.lines,e,d,"unterminated URI reference")}if(this.keywordsSet){var d;if(c=new ie([]),(d=this.bareWord(e,t,c))<0)return-1;if(q(this.keywords,c[0])>=0)throw je(this._thisDoc,this.lines,e,t,'Keyword "'+c[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+c[0])),d}return-1}skipSpace(e,t){for(var r=t||0;r<e.length;r++){var n=e.charAt(r);if(" \n\r\t\f\v \u2028\u2029 ".indexOf(n)<0){if("#"!==e.charAt(r))return r;for(;;r++){if(r===e.length)return-1;if("\n"===e.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===e.charAt(r)&&(this.lines=this.lines+1)}return-1}variable(e,t,r){if((n=this.skipSpace(e,t))<0)return-1;if("?"!=e.slice(n,n+1))return-1;var n;if(t=n+=1,"0123456789-".indexOf(e.charAt(n))>=0)throw je(this._thisDoc,this.lines,e,n,"Varible name can't start with '"+e.charAt(n)+"s'");for(;t<se(e)&&ye.indexOf(e.charAt(t))<0;)t+=1;if(null==this._parentContext)throw je(this._thisDoc,this.lines,e,n,"Can't use ?xxx syntax for variable in outermost level: "+e.slice(n-1,t));return r.push(this._store.variable(e.slice(n,t))),t}bareWord(e,t,r){var n=this.skipSpace(e,t);if(n<0)return-1;var i=e.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(ye.indexOf(i)>=0)return-1;for(t=n;t<se(e)&&ye.indexOf(e.charAt(t))<0;)t+=1;return r.push(e.slice(n,t)),t}qname(e,t,r){if((t=this.skipSpace(e,t))<0)return-1;var n=e.charAt(t);if("0123456789-+".indexOf(n)>=0)return-1;if(ye.indexOf(n)<0){var i=n;for(t+=1;t<se(e)&&(n=e.charAt(t),ye.indexOf(n)<0);)i+=n,t+=1}else i="";if(t<se(e)&&":"==e.charAt(t)){var o=i;for(t+=1,i="";t<se(e)&&(n=e.charAt(t),ye.indexOf(n)<0);)i+=n,t+=1;return r.push(new ne([o,i])),t}return i&&this.keywordsSet&&q(this.keywords,i)<0?(r.push(new ne(["",i])),t):-1}object(e,t,r){if((o=this.subject(e,t,r))>=0)return o;{if((o=this.skipSpace(e,t))<0)return-1;t=o;var n=null;let a=e.charAt(t);if('"'==a||"'"==a){n=e.slice(t,t+3==a+a)?a+a+a:a,t+=se(n);var i=this.strconst(e,t,n),o=i[0],s=i[1];return r.push(this._store.literal(s)),o}return-1}}nodeOrLiteral(e,t,r){if((l=this.node(e,t,r))>=0)return l;if((l=this.skipSpace(e,t))<0)return-1;t=l;var n=e.charAt(t);if("-+0987654321".indexOf(n)>=0){if(ve.lastIndex=0,null!=(h=ve.exec(e.slice(t))))l=t+(i=h[0]).length,i.indexOf("T")>=0?r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var i;if(me.lastIndex=0,null==(h=me.exec(e.slice(t))))throw je(this._thisDoc,this.lines,e,t,"Bad number or date syntax");l=t+me.lastIndex,(i=e.slice(t,l)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):e.slice(t,l).indexOf(".")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):r.push(this._store.literal(parseInt(i),this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return l}if('"'==e.charAt(t)){if('"""'==e.slice(t,t+3))var o='"""';else o='"';t+=se(o);var s=null,a=this.strconst(e,t,o),l=a[0],c=a[1],u=null;if("@"==e.slice(l,l+1)){var h;if(we.lastIndex=0,null==(h=we.exec(e.slice(l+1))))throw je(this._thisDoc,startline,e,t,"Bad language code syntax on string literal, after @");t=we.lastIndex+l+1,u=e.slice(l+1,t),l=t}if("^^"==e.slice(l,l+2)){var d=new ie([]);l=this.uri_ref2(e,l+2,d),s=d[0]}return r.push(this._store.literal(c,u||s)),l}return-1}strconst(e,t,r){for(var n=t,i="",o=this.lines;n<se(e);){if(t=n+se(r),e.slice(n,t)==r)return new ne([t,i]);if('"'!=e.charAt(n)){if(be.lastIndex=0,!be.exec(e.slice(n)))throw je(this._thisDoc,o,e,n,"Closing quote missing in string at ^ in "+e.slice(n-20,n)+"^"+e.slice(n,n+20));if(t=n+be.lastIndex-1,i+=e.slice(n,t),'"'!=(l=e.charAt(t)))if("\r"!=l){if("\n"==l){if('"'==r)throw je(this._thisDoc,o,e,t,"newline found in string literal");this.lines=this.lines+1,i+=l,n=t+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==l){if(n=t+1,!(l=e.slice(n,n+1)))throw je(this._thisDoc,o,e,t,"unterminated string literal (2)");var s=ue('abfrtvn\\"',l);if(s>=0)i+='a\b\f\r\t\v\n\\"'.charAt(s),n+=1;else if("u"==l)n=(a=this.uEscape(e,n+1,o))[0],i+=l=a[1];else{if("U"!=l)throw je(this._thisDoc,this.lines,e,t,"bad escape");var a,l;n=(a=this.UEscape(e,n+1,o))[0],i+=l=a[1]}}}else n=t+1;else n=t}else i=i+'"',n=n+1}throw je(this._thisDoc,this.lines,e,t,"unterminated string literal")}uEscape(e,t,r){for(var n=t,i=0,o=0;i<4;){var s=e.slice(n,n+1).toLowerCase();if(n+=1,""==s)throw je(this._thisDoc,r,e,t,"unterminated string literal(3)");var a=ue("0123456789abcdef",s);if(a<0)throw je(this._thisDoc,r,e,t,"bad string literal hex escape");o=16*o+a,i+=1}var l=String.fromCharCode(o);return new ne([n,l])}UEscape(e,t,r){for(var n=t,i=0,o="\\U";i<8;){var s=e.slice(n,n+1).toLowerCase();if(n+=1,""==s)throw je(this._thisDoc,r,e,t,"unterminated string literal(3)");if(ue("0123456789abcdef",s)<0)throw je(this._thisDoc,r,e,t,"bad string literal hex escape");o+=s,i+=1}var a,l=(a="0x"+ae(o,2,10)-0,String.fromCharCode(a));return new ne([n,l])}}function je(e,t,r,n,i){let o=t+1,s="Line "+o+" of <"+e+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',a=new SyntaxError(s,e,o);return a.lineNo=o,a.characterInFile=n,a.syntaxProblem=i,a}const Te={...A,supports:{[j.collections]:!0,[j.defaultGraphType]:!1,[j.equalsMethod]:!0,[j.identity]:!1,[j.id]:!0,[j.reversibleId]:!1,[j.variableType]:!0},collection:e=>new f(e),id(e){return(0,c.uZ)(e)?`( ${e.elements.map((e=>this.id(e))).join(", ")} )`:(0,c.cG)(e)?_.toString(e):A.id(e)},termToNQ:e=>e.termType===o.fb?f.toNT(e):A.termToNQ(e)},Ne=Te;var Ae=n(730),Ee=n.n(Ae);function Oe(e,t){return"string"==typeof t?e.rdfFactory.literal(t):Object.prototype.hasOwnProperty.call(t,"@list")?!0===e.rdfFactory.supports.COLLECTIONS?function(e,t){if(!Array.isArray(t))throw new TypeError("Object must be an array");return e.rdfFactory.collection(t.map((t=>Oe(e,t))))}(e,t["@list"]):function(e,t){const r=t["@id"]?Ie(e,t):e.rdfFactory.blankNode(),n=t["@list"].map((t=>Oe(e,t))),i=B(e.rdfFactory,r,n);return e.addAll(i),r}(e,t):Object.prototype.hasOwnProperty.call(t,"@id")?Ie(e,t):Object.prototype.hasOwnProperty.call(t,"@language")?e.rdfFactory.literal(t["@value"],t["@language"]):Object.prototype.hasOwnProperty.call(t,"@type")?e.rdfFactory.literal(t["@value"],e.rdfFactory.namedNode(t["@type"])):Object.prototype.hasOwnProperty.call(t,"@value")?e.rdfFactory.literal(t["@value"]):e.rdfFactory.literal(t)}function Se(e,t,r,n){const i=r&&Object.prototype.hasOwnProperty.call(r,"termType")?r.value:r;return Ee().flatten(JSON.parse(e),null,{base:i}).then((e=>e.reduce(((e,n)=>t=Re(t,r,n)),t))).then(n).catch(n)}function Ie(e,t){return t["@id"].startsWith("_:")?e.rdfFactory.blankNode(t["@id"].substring(2)):e.rdfFactory.namedNode(t["@id"])}function Re(e,t,r){const n=r["@id"]?Ie(e,r):e.rdfFactory.blankNode();for(const i of Object.keys(r)){if("@id"===i)continue;if("@graph"==i){const t=n,o=r[i];for(let r=0;r<o.length;r++)e=Re(e,t,o[r])}const o=r[i];if(Array.isArray(o))for(let r=0;r<o.length;r++)e.addStatement(ke(e,n,i,o[r],t));else e.addStatement(ke(e,n,i,o,t))}return e}function ke(e,t,r,n,i){let o,s;return"@type"===r?(o=e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),s=e.rdfFactory.namedNode(n)):(o=e.rdfFactory.namedNode(r),s=Oe(e,n)),e.rdfFactory.quad(t,o,s,e.rdfFactory.namedNode(i))}const Ce="http://www.w3.org/1999/02/22-rdf-syntax-ns#",De="http://www.w3.org/2001/XMLSchema#",Le="http://www.w3.org/2000/10/swap/",Pe={xsd:{decimal:`${De}decimal`,boolean:`${De}boolean`,double:`${De}double`,integer:`${De}integer`,string:`${De}string`},rdf:{type:`${Ce}type`,nil:`${Ce}nil`,first:`${Ce}first`,rest:`${Ce}rest`,langString:`${Ce}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Le}reify#forSome`,forAll:`${Le}reify#forAll`},log:{implies:`${Le}log#implies`}};var Fe=n(5929),Me=n.n(Fe),Ue=n(2486).lW;const{xsd:Be}=Pe,qe=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,He={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Ze=/[\x00-\x20<>\\"\{\}\|\^\`]/,$e={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},ze=/$0^/;class Ve{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]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in $e)&&this[e]instanceof RegExp&&(this[e]=ze)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let e,s;for(;e=this._newline.exec(r);)this._comments&&(s=this._comment.exec(e[0]))&&i("comment",s[1],"",this._line,e[0].length),r=r.substr(e[0].length,r.length),n=r.length,this._line++;if(!e&&(e=this._whitespace.exec(r))&&(r=r.substr(e[0].length,r.length)),this._endOfFile.test(r))return t&&(this._comments&&(s=this._comment.exec(r))&&i("comment",s[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const a=this._line,l=r[0];let c="",u="",h="",d=null,f=0,p=!1;switch(l){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(f=1,c="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){p=!0;break}case"<":if(d=this._unescapedIri.exec(r))c="IRI",u=d[1];else if(d=this._iri.exec(r)){if(u=this._unescape(d[1]),null===u||Ze.test(u))return o(this);c="IRI"}else r.length>1&&"<"===r[1]?(c="<<",f=2):this._n3Mode&&r.length>1&&"="===r[1]&&(c="inverse",f=2,u=">");break;case">":r.length>1&&">"===r[1]&&(c=">>",f=2);break;case"_":((d=this._blank.exec(r))||t&&(d=this._blank.exec(`${r} `)))&&(c="blank",h="_",u=d[1]);break;case'"':if(d=this._simpleQuotedString.exec(r))u=d[1];else if(({value:u,matchLength:f}=this._parseLiteral(r)),null===u)return o(this);null===d&&0===f||(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(d=this._simpleApostropheString.exec(r))u=d[1];else if(({value:u,matchLength:f}=this._parseLiteral(r)),null===u)return o(this);null===d&&0===f||(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(d=this._variable.exec(r))&&(c="var",u=d[0]);break;case"@":"literal"===this._previousMarker&&(d=this._langcode.exec(r))?(c="langcode",u=d[1]):(d=this._keyword.exec(r))&&(c=d[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){c=".",f=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(d=this._number.exec(r)||t&&(d=this._number.exec(`${r} `)))&&(c="literal",u=d[0],h="string"==typeof d[1]?Be.double:"string"==typeof d[2]?Be.decimal:Be.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(d=this._sparqlKeyword.exec(r))?c=d[0].toUpperCase():p=!0;break;case"f":case"t":(d=this._boolean.exec(r))?(c="literal",u=d[0],h=Be.boolean):p=!0;break;case"a":(d=this._shortPredicates.exec(r))?(c="abbreviation",u="a"):p=!0;break;case"=":this._n3Mode&&r.length>1&&(c="abbreviation",">"!==r[1]?(f=1,u="="):(f=2,u=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(f=1,c=l);break;default:p=!0}if(p&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(d=this._prefix.exec(r))?((d=this._prefixed.exec(r))||t&&(d=this._prefixed.exec(`${r} `)))&&(c="prefixed",h=d[1]||"",u=this._unescape(d[2])):(c="prefix",u=d[1]||"")),"^^"===this._previousMarker)switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const g=f||d[0].length,y=i(c,u,h,a,g);this.previousToken=y,this._previousMarker=c,r=r.substr(g,r.length)}function i(t,i,o,s,a){const l=r?n-r.length:n,c={type:t,value:i,prefix:o,line:s,start:l,end:l+a};return e(null,c),c}function o(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(qe,((e,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let e=Number.parseInt(n,16);return e<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in He?He[i]:(t=!0,"")}));return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let n=Math.max(this._literalClosingPos,r);for(;(n=e.indexOf(t,n))>0;){let t=0;for(;"\\"===e[n-t-1];)t++;if(t%2==0){const t=e.substring(r,n),i=t.split(/\r\n|\r|\n/).length-1,o=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((r,n)=>r?t=r:e.push(n)),!0),t)throw t;return e}Me()((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=Ue.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}const{rdf:Xe,xsd:Je}=Pe;let Ge,We=0;const Qe={namedNode:function(e){return new Ke(e)},blankNode:function(e){return new tt(e||"n3-"+We++)},variable:function(e){return new rt(e)},literal:function(e,t){if("string"==typeof t)return new et(`"${e}"@${t.toLowerCase()}`);let r=t?t.value:"";return""===r&&("boolean"==typeof e?r=Je.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?Je.integer:Je.double:(r=Je.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),""===r||r===Je.string?new et(`"${e}"`):new et(`"${e}"^^${r}`)},defaultGraph:function(){return Ge},quad:it,triple:it};class Ye{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Ye?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class Ke extends Ye{get termType(){return"NamedNode"}}class et extends Ye{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new Ke(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return"^"===r?e.substr(t+2):"@"!==r?Je.string:Xe.langString}equals(e){return e instanceof et?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}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class tt extends Ye{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class rt extends Ye{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}Ge=new class extends Ye{constructor(){return super(""),Ge||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class nt extends Ye{constructor(e,t,r,n){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=n||Ge}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function it(e,t,r,n){return new nt(e,t,r,n)}let ot=0;class st{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&<(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),n=/trig/.test(t),i=/triple/.test(t),o=/quad/.test(t),s=this._n3Mode=/n3/.test(t),a=i||o;(this._supportsNamedGraphs=!(r||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||s),this._supportsRDFStar=""===t||/star|\*$/.test(t),a&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Ve({lineMode:a,n3:s}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){ot=0}_setBase(e){if(e){const 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,r,n,i){const o=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:i,graph:t,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(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.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){let r;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);r=this._namedNode(t);break;case"type":case"prefixed":const n=this._prefixes[e.prefix];if(void 0===n)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._namedNode(n+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}_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){const 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"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;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);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const i=this._subject,o=this._contextStack,s=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),n=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("list",e),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),n=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===i?null===s.predicate?s.subject=r:s.object=r:this._emit(i,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 n}_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":const 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}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const 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))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,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){const e=this._predicate,t=this._object;i?this._emit(t,e,n,r):this._emit(n,e,t,r)}return t}_readBlankNodePunctuation(e){let 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);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const 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){let 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:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const 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}_readBackwardPath(e){const t=this._blankNode();let r,n;if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,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("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const 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,r,n){this._callback(null,this._quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=at}_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;const t=e.length;let r="",n=-1,i=-1,o=0,s="/";for(;n<t;){switch(s){case":":if(i<0&&"/"===e[++n]&&"/"===e[++n])for(;(i=n+1)<t&&"/"!==e[i];)n=i;break;case"?":case"#":n=t;break;case"/":if("."===e[n+1])switch(s=e[1+ ++n],s){case"/":r+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+e.substring(o,n)+e.substr(n+1);case".":if(s=e[1+ ++n],void 0===s||"/"===s||"?"===s||"#"===s){if(r+=e.substring(o,n-2),(o=r.lastIndexOf("/"))>=i&&(r=r.substr(0,o)),"/"!==s)return`${r}/${e.substr(n+1)}`;o=n+1}}}s=e[++n]}return r+e.substring(o)}parse(e,t,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${ot++}_`,this._prefixCallback=r||at,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let r;if(this._callback=(e,n)=>{e?r=e:n&&t.push(n)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),r)throw r;return t}this._callback=t,this._lexer.tokenize(e,((e,t)=>{null!==e?(this._callback(e),this._callback=at):this._readCallback&&(this._readCallback=this._readCallback(t))}))}}function at(){}function lt(e,t){const 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(Pe.rdf.first),e.RDF_REST=r(Pe.rdf.rest),e.RDF_NIL=r(Pe.rdf.nil),e.N3_FORALL=r(Pe.r.forAll),e.N3_FORSOME=r(Pe.r.forSome),e.ABBREVIATIONS={a:r(Pe.rdf.type),"=":r(Pe.owl.sameAs),">":r(Pe.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}lt(st.prototype,Qe);var ct=n(292);if(void 0===ut)var ut={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};class ht{constructor(e,t){this.options=t||{},this.kb=e,this.target=t.target||{graph:{subjects:{},prefixes:{},terms:{}}},this.blankNodes=[],this.htmlOptions={selfClosing:"br img input area base basefont col colgroup source wbr isindex link meta param hr"},this.theOne="_:"+(new Date).getTime(),this.language=null,this.vocabulary=null,this.blankCounter=0,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}],this.inXHTMLMode=!1,this.absURIRE=/[\w\_\-]+:\S+/,this.finishedHandlers=[],this.init()}addTriple(e,t,r,n){var i,o,s,a;i=void 0===t?A.namedNode(this.options.base):this.toRDFNodeObject(t),s=this.toRDFNodeObject(r),o=this.toRDFNodeObject(n),a=A.namedNode(this.options.base),this.kb.add(i,s,o,a)}ancestorPath(e){for(var t="";e&&e.nodeType!==ut.DOCUMENT_NODE;)t="/"+e.localName+t,e=e.parentNode;return t}copyMappings(e){var t={};for(var r in e)t[r]=e[r];return t}copyProperties(){}deriveDateTimeType(e){for(var t=0;t<ht.dateTimeTypes.length;t++){var r=ht.dateTimeTypes[t].pattern.exec(e);if(r&&r[0].length===e.length)return ht.dateTimeTypes[t].type}return null}init(){}newBlankNode(){return this.blankCounter++,"_:"+this.blankCounter}newSubjectOrigin(e,t){}parseCURIE(e,t,r){var n,i=e.indexOf(":");if(i>=0){var o=e.substring(0,i);if(""===o)return(n=t[""])?n+e.substring(i+1):null;if("_"===o)return"_:"+e.substring(i+1);if(ht.NCNAME.test(o)&&(n=t[o]))return n+e.substring(i+1)}return null}parseCURIEOrURI(e,t,r){return this.parseCURIE(e,t,r)||this.resolveAndNormalize(r,e)}parsePredicate(e,t,r,n,i,o){if(""===e)return null;var s=this.parseTermOrCURIEOrAbsURI(e,t,o?null:r,n,i);return s&&0===s.indexOf("_:")?null:s}parsePrefixMappings(e,t){for(var r=this.tokenize(e),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(t[n]=this.options.base?x.join(r[i],this.options.base):r[i],n=null)}static parseRDFaDOM(e,t,r){var n=new ht(t,{base:r});e.baseURI||(e.baseURI=r),n.process(e,{baseURI:r})}parseSafeCURIEOrCURIEOrURI(e,t,r){return"["===(e=this.trim(e)).charAt(0)&&"]"===e.charAt(e.length-1)?0===(e=(e=e.substring(1,e.length-1)).trim(e)).length?null:"_:"===e?this.theOne:this.parseCURIE(e,t,r):this.parseCURIEOrURI(e,t,r)}parseTermOrCURIEOrAbsURI(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;if(r){if(t&&!this.absURIRE.exec(e))return t+e;var s=r[e];if(s)return s;if(s=r[e.toLowerCase()])return s}return this.absURIRE.exec(e)?this.resolveAndNormalize(i,e):null}parseTermOrCURIEOrURI(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;var s=r[e];return s||((s=r[e.toLowerCase()])?s:t&&!this.absURIRE.exec(e)?t+e:this.resolveAndNormalize(i,e))}parseURI(e){return e}process(e,t){var r;t=t||{},e.nodeType===ut.DOCUMENT_NODE?(e.baseURI&&!t.baseURI&&(t.baseURI=e.baseURI),r=e.baseURI,(e=e.documentElement).baseURI||(e.baseURI=r),this.setContext(e)):e.parentNode.nodeType===ut.DOCUMENT_NODE&&this.setContext(e);var n=[],i=function(e){if(!e&&t&&t.baseURI)return t.baseURI;var r=e.indexOf("#");return r>=0&&(e=e.substring(0,r)),t&&t.baseURIMap&&(e=t.baseURIMap(e)),e};for(n.push({current:e,context:this.push(null,i(e.baseURI))});n.length>0;){var o=n.shift();if(o.parent){if(o.context.parent&&o.context.parent.listMapping===o.listMapping)continue;for(let e in o.listMapping){var s=o.listMapping[e];if(0!==s.length){var a=[];for(let e=0;e<s.length;e++)a.push(this.newBlankNode());for(let e=0;e<a.length;e++)this.addTriple(o.parent,a[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",s[e]),this.addTriple(o.parent,a[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:ht.objectURI,value:e+1<a.length?a[e+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(o.parent,o.subject,e,{type:ht.objectURI,value:a[0]})}else this.addTriple(o.parent,o.subject,e,{type:ht.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var l=o.current,c=o.context,u=!1,h=null,d=null,f=null,p=c.prefixes,g=!1,y=[],m=c.listMapping,v=!c.parent,b=c.language,w=c.vocabulary;r=this.parseURI(i(l.baseURI)),l.item=null;var _=l.getAttributeNode("vocab");if(_){let e=this.trim(_.value);if(e.length>0){w=e;var j=r.spec;this.addTriple(l,j,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:ht.objectURI,value:w})}else w=this.vocabulary}for(var T=0;T<l.attributes.length;T++){var N=l.attributes[T];if("x"===N.nodeName.charAt(0)&&0===N.nodeName.indexOf("xmlns:")){g||(p=this.copyMappings(p),g=!0);var A=N.nodeName.substring(6),E=ht.trim(N.value);p[A]=this.options.base?x.join(E,this.options.base):E}}var O=l.getAttributeNode("prefix");O&&(g||(p=this.copyMappings(p),g=!0),this.parsePrefixMappings(O.value,p));var S=null;for(let e=0;!S&&e<this.langAttributes.length;e++)S=l.getAttributeNodeNS(this.langAttributes[e].namespaceURI,this.langAttributes[e].localName);if(S){let e=ht.trim(S.value);b=e.length>0?e:null}var I,R,k=l.getAttributeNode("rel"),C=l.getAttributeNode("rev"),D=l.getAttributeNode("typeof"),L=l.getAttributeNode("property"),P=l.getAttributeNode("datatype"),F=this.inHTMLMode?l.getAttributeNode("datetime"):null,M=l.getAttributeNode("content"),U=l.getAttributeNode("about"),B=l.getAttributeNode("src"),q=l.getAttributeNode("resource"),H=l.getAttributeNode("href"),Z=l.getAttributeNode("inlist"),$=[];if(k){R=this.tokenize(k.value);for(let e=0;e<R.length;e++)I=this.parsePredicate(R[e],w,c.terms,p,r,this.inHTMLMode&&null!==L),I&&$.push(I)}var z=[];if(C){R=this.tokenize(C.value);for(let e=0;e<R.length;e++)I=this.parsePredicate(R[e],w,c.terms,p,r,this.inHTMLMode&&L),I&&z.push(I)}if(this.inHTMLMode&&(k||C)&&L&&(0===$.length&&(k=null),0===z.length&&(C=null)),k||C?(U&&(h=this.parseSafeCURIEOrCURIEOrURI(U.value,p,r)),D&&(f=h),h||(l.parentNode.nodeType===ut.DOCUMENT_NODE?h=i(l.baseURI):c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject)),q&&(d=this.parseSafeCURIEOrCURIEOrURI(q.value,p,r)),d||(H?d=this.resolveAndNormalize(r,encodeURI(H.value)):B?d=this.resolveAndNormalize(r,encodeURI(B.value)):!D||U||this.inXHTMLMode&&("head"===l.localName||"body"===l.localName)||(d=this.newBlankNode())),!D||U||!this.inXHTMLMode||"head"!==l.localName&&"body"!==l.localName?D&&!U&&(f=d):f=h):!L||M||P?(U&&(h=this.parseSafeCURIEOrCURIEOrURI(U.value,p,r)),!h&&q&&(h=this.parseSafeCURIEOrCURIEOrURI(q.value,p,r)),!h&&H&&(h=this.resolveAndNormalize(r,encodeURI(H.value))),!h&&B&&(h=this.resolveAndNormalize(r,encodeURI(B.value))),h||(l.parentNode.nodeType===ut.DOCUMENT_NODE?h=i(l.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==l.localName&&"body"!==l.localName?D?h=this.newBlankNode():c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject,L||(u=!0)):h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject),D&&(f=h)):(U&&(h=this.parseSafeCURIEOrCURIEOrURI(U.value,p,r),D&&(f=h)),h||l.parentNode.nodeType!==ut.DOCUMENT_NODE?!h&&c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject):(h=i(l.baseURI),D&&(f=h)),D&&!f&&(q&&(f=this.parseSafeCURIEOrCURIEOrURI(q.value,p,r)),!f&&H&&(f=this.resolveAndNormalize(r,encodeURI(H.value))),!f&&B&&(f=this.resolveAndNormalize(r,encodeURI(B.value))),f||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==l.localName&&"body"!==l.localName||(f=h),f||(f=this.newBlankNode()),d=f)),h&&(U||q||f)){var V=h;D&&!U&&!q&&d&&(V=d),this.newSubjectOrigin(l,V)}if(f){R=this.tokenize(D.value);for(let e=0;e<R.length;e++){var X=this.parseTermOrCURIEOrAbsURI(R[e],w,c.terms,p,r);X&&this.addTriple(l,f,ht.typeURI,{type:ht.objectURI,value:X})}}if(h&&h!==c.parentObject&&(m={},v=!0),d){if(k&&Z)for(let e=0;e<$.length;e++){let t=m[$[e]];t||(t=[],m[$[e]]=t),t.push({type:ht.objectURI,value:d})}else if(k)for(let e=0;e<$.length;e++)this.addTriple(l,h,$[e],{type:ht.objectURI,value:d});if(C)for(let e=0;e<z.length;e++)this.addTriple(l,d,z[e],{type:ht.objectURI,value:h})}else{if(h&&!d&&(k||C)&&(d=this.newBlankNode()),k&&Z)for(let e=0;e<$.length;e++){let t=m[$[e]];t||(t=[],m[I]=t),y.push({predicate:$[e],list:t})}else if(k)for(let e=0;e<$.length;e++)y.push({predicate:$[e],forward:!0});if(C)for(let e=0;e<z.length;e++)y.push({predicate:z[e],forward:!1})}if(L){var J=null,G=null;P?(J=""===P.value?ht.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(P.value,w,c.terms,p,r),G=F&&!M?F.value:J===ht.XMLLiteralURI||J===ht.HTMLLiteralURI?null:M?M.value:l.textContent):M?(J=ht.PlainLiteralURI,G=M.value):F?(G=F.value,(J=ht.deriveDateTimeType(G))||(J=ht.PlainLiteralURI)):k||C||(q&&(G=this.parseSafeCURIEOrCURIEOrURI(q.value,p,r)),!G&&H?G=this.resolveAndNormalize(r,encodeURI(H.value)):!G&&B&&(G=this.resolveAndNormalize(r,encodeURI(B.value))),G&&(J=ht.objectURI)),J||(D&&!U?(J=ht.objectURI,G=f):(G=l.textContent,this.inHTMLMode&&"time"===l.localName&&(J=ht.deriveDateTimeType(G)),J||(J=ht.PlainLiteralURI))),R=this.tokenize(L.value);for(let e=0;e<R.length;e++){let t=this.parsePredicate(R[e],w,c.terms,p,r);if(t)if(Z){let e=m[t];e||(e=[],m[t]=e),e.push(J===ht.XMLLiteralURI||J===ht.HTMLLiteralURI?{type:J,value:l.childNodes}:{type:J||ht.PlainLiteralURI,value:G,language:b})}else J===ht.XMLLiteralURI||J===ht.HTMLLiteralURI?this.addTriple(l,h,t,{type:J,value:l.childNodes}):this.addTriple(l,h,t,{type:J||ht.PlainLiteralURI,value:G,language:b})}}if(h&&!u)for(let e=0;e<c.incomplete.length;e++)c.incomplete[e].list?c.incomplete[e].list.push({type:ht.objectURI,value:h}):c.incomplete[e].forward?this.addTriple(l,c.subject,c.incomplete[e].predicate,{type:ht.objectURI,value:h}):this.addTriple(l,h,c.incomplete[e].predicate,{type:ht.objectURI,value:c.subject});var W=null,Q=h;u?((W=this.push(c,c.subject)).parentObject=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject,W.incomplete=c.incomplete,W.language=b,W.prefixes=p,W.vocabulary=w):((W=this.push(c,h)).parentObject=d||h||c.subject,W.prefixes=p,W.incomplete=y,d&&(Q=d,m={},v=!0),W.listMapping=m,W.language=b,W.vocabulary=w),v&&n.unshift({parent:l,context:c,subject:Q,listMapping:m});for(var Y=l.lastChild;Y;Y=Y.previousSibling)Y.nodeType===ut.ELEMENT_NODE&&n.unshift({current:Y,context:W})}}this.inHTMLMode&&this.copyProperties();for(let t=0;t<this.finishedHandlers.length;t++)this.finishedHandlers[t](e)}push(e,t){return{parent:e,subject:t||(e?e.subject:null),parentObject:null,incomplete:[],listMapping:e?e.listMapping:{},language:e?e.language:this.language,prefixes:e?e.prefixes:this.target.graph.prefixes,terms:e?e.terms:this.target.graph.terms,vocabulary:e?e.vocabulary:this.vocabulary}}resolveAndNormalize(e,t){return x.join(t,e)}setContext(e){"html"===e.localName&&"XHTML+RDFa 1.1"===e.getAttribute("version")?this.setXHTMLContext():"html"===e.localName||"http://www.w3.org/1999/xhtml"===e.namespaceURI?"undefined"!=typeof document&&document.doctype?"-//W3C//DTD XHTML+RDFa 1.0//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"===document.doctype.systemId?(ct.log("WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode."),this.setHTMLContext()):"-//W3C//DTD XHTML+RDFa 1.1//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"===document.doctype.systemId?this.setXHTMLContext():this.setHTMLContext():this.setHTMLContext():this.setXMLContext()}setHTMLContext(){this.setInitialContext(),this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.inXHTMLMode=!1,this.inHTMLMode=!0}setInitialContext(){this.vocabulary=null,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}]}setXHTMLContext(){this.setInitialContext(),this.inXHTMLMode=!0,this.inHTMLMode=!1,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.target.graph.terms.alternate="http://www.w3.org/1999/xhtml/vocab#alternate",this.target.graph.terms.appendix="http://www.w3.org/1999/xhtml/vocab#appendix",this.target.graph.terms.bookmark="http://www.w3.org/1999/xhtml/vocab#bookmark",this.target.graph.terms.cite="http://www.w3.org/1999/xhtml/vocab#cite",this.target.graph.terms.chapter="http://www.w3.org/1999/xhtml/vocab#chapter",this.target.graph.terms.contents="http://www.w3.org/1999/xhtml/vocab#contents",this.target.graph.terms.copyright="http://www.w3.org/1999/xhtml/vocab#copyright",this.target.graph.terms.first="http://www.w3.org/1999/xhtml/vocab#first",this.target.graph.terms.glossary="http://www.w3.org/1999/xhtml/vocab#glossary",this.target.graph.terms.help="http://www.w3.org/1999/xhtml/vocab#help",this.target.graph.terms.icon="http://www.w3.org/1999/xhtml/vocab#icon",this.target.graph.terms.index="http://www.w3.org/1999/xhtml/vocab#index",this.target.graph.terms.last="http://www.w3.org/1999/xhtml/vocab#last",this.target.graph.terms.license="http://www.w3.org/1999/xhtml/vocab#license",this.target.graph.terms.meta="http://www.w3.org/1999/xhtml/vocab#meta",this.target.graph.terms.next="http://www.w3.org/1999/xhtml/vocab#next",this.target.graph.terms.prev="http://www.w3.org/1999/xhtml/vocab#prev",this.target.graph.terms.previous="http://www.w3.org/1999/xhtml/vocab#previous",this.target.graph.terms.section="http://www.w3.org/1999/xhtml/vocab#section",this.target.graph.terms.stylesheet="http://www.w3.org/1999/xhtml/vocab#stylesheet",this.target.graph.terms.subsection="http://www.w3.org/1999/xhtml/vocab#subsection",this.target.graph.terms.start="http://www.w3.org/1999/xhtml/vocab#start",this.target.graph.terms.top="http://www.w3.org/1999/xhtml/vocab#top",this.target.graph.terms.up="http://www.w3.org/1999/xhtml/vocab#up",this.target.graph.terms.p3pv1="http://www.w3.org/1999/xhtml/vocab#p3pv1",this.target.graph.terms.related="http://www.w3.org/1999/xhtml/vocab#related",this.target.graph.terms.role="http://www.w3.org/1999/xhtml/vocab#role",this.target.graph.terms.transformation="http://www.w3.org/1999/xhtml/vocab#transformation"}setXMLContext(){this.setInitialContext(),this.inXHTMLMode=!1,this.inHTMLMode=!1}tokenize(e){return this.trim(e).split(/\s+/)}static tokenize(e){return this.trim(e).split(/\s+/)}toRDFNodeObject(e){if(void 0!==e){if("string"==typeof e)return"_:"===e.substring(0,2)?(void 0===this.blankNodes[e.substring(2)]&&(this.blankNodes[e.substring(2)]=new a(e.substring(2))),this.blankNodes[e.substring(2)]):A.namedNode(e);switch(e.type){case ht.objectURI:return"_:"===e.value.substring(0,2)?(void 0===this.blankNodes[e.value.substring(2)]&&(this.blankNodes[e.value.substring(2)]=new a(e.value.substring(2))),this.blankNodes[e.value.substring(2)]):A.namedNode(e.value);case ht.PlainLiteralURI:return new h(e.value,e.language||"");case ht.XMLLiteralURI:case ht.HTMLLiteralURI:var t="";return Object.keys(e.value).forEach((r=>{t+=S.domToString(e.value[r],this.htmlOptions)})),new h(t,"",new l.Z(e.type));default:return new h(e.value,"",new l.Z(e.type))}}}trim(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}static trim(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}ht.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",ht.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",ht.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",ht.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",ht.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",ht.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",ht.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",ht.NCNAME=new RegExp("^"+ht.nameStartChar+ht.nameChar+"*$"),ht.dateTimeTypes=[{pattern:/-?P(?:[0-9]+Y)?(?:[0-9]+M)?(?:[0-9]+D)?(?:T(?:[0-9]+H)?(?:[0-9]+M)?(?:[0-9]+(?:\.[0-9]+)?S)?)?/,type:"http://www.w3.org/2001/XMLSchema#duration"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9]T(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#dateTime"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9](?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#date"},{pattern:/(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#time"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]/,type:"http://www.w3.org/2001/XMLSchema#gYearMonth"},{pattern:/-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,type:"http://www.w3.org/2001/XMLSchema#gYear"}];const dt=ht.parseRDFaDOM;class ft{constructor(e){this.store=e,this.bnodes={},this.why=null,this.reify=!1}frameFactory(e,t,r){return{NODE:1,ARC:2,parent:t,parser:e,store:e.store,element:r,lastChild:0,base:null,lang:null,node:null,nodeType:null,listIndex:1,rdfid:null,datatype:null,collection:!1,terminateFrame:function(){this.collection&&this.node.close()},addSymbol:function(e,t){t=x.join(t,this.base),this.node=this.store.sym(t),this.nodeType=e},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var e=this.store.sym(x.join("#"+this.parent.rdfid,this.base));this.store.add(e,this.store.sym(ft.ns.RDF+"type"),this.store.sym(ft.ns.RDF+"Statement"),this.parser.why),this.store.add(e,this.store.sym(ft.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(e,this.store.sym(ft.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(e,this.store.sym(ft.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType===this.NODE&&this.parent.nodeType===this.ARC&&this.parent.parent.nodeType===this.NODE},addNode:function(e){this.addSymbol(this.NODE,e),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(e){null!=e?null!=this.parser.bnodes[e]?this.node=this.parser.bnodes[e]:this.node=this.parser.bnodes[e]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(e){e===ft.ns.RDF+"li"&&(e=ft.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,e)},addLiteral:function(e){this.parent.datatype&&this.parent.datatype!==ft.ns.RDF+"langString"?this.node=this.store.literal(e,this.store.sym(this.parent.datatype)):this.node=this.store.literal(e,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}getAttributeNodeNS(e,t,r){var n=null;if(e.getAttributeNodeNS)n=e.getAttributeNodeNS(t,r);else for(var i,o=e.attributes,s=0;s<o.length;++s)if((i=o[s]).namespaceURI===t&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}parse(e,t,r){var n,i=e.childNodes;if(this.cleanParser(),e.nodeType===ft.nodeType.DOCUMENT){for(var o=0;o<i.length;o++)if(i[o].nodeType===ft.nodeType.ELEMENT){n=i[o];break}}else{if(e.nodeType!==ft.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+t+". Halting. ");n=e}this.why=r;var s=this.frameFactory(this);return this.base=t,s.base=t,s.lang=null,this.parseDOM(this.buildFrame(s,n)),!0}parseDOM(e){for(var t,r=function(e){var t="";if(null==e.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+e.localName+" in "+this.base);return e.namespaceURI&&(t+=e.namespaceURI),e.localName?t+=e.localName:e.nodeName&&(e.nodeName.indexOf(":")>=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}.bind(this),n=!0;e.parent;){var i=e.element,o=i.attributes;if(i.nodeType===ft.nodeType.TEXT||i.nodeType===ft.nodeType.CDATA_SECTION)e.parent.nodeType===e.NODE&&(e.addArc(ft.ns.RDF+"value"),e=this.buildFrame(e)),e.addLiteral(i.nodeValue);else if(r(i)!==ft.ns.RDF+"RDF")if(e.parent&&e.parent.collection&&(e.addCollectionArc(),(e=this.buildFrame(e,e.element)).parent.element=null),e.parent&&e.parent.nodeType&&e.parent.nodeType!==e.ARC){e.addArc(r(i)),this.reify&&(t=this.getAttributeNodeNS(i,ft.ns.RDF,"ID"))&&(e.rdfid=t.nodeValue,i.removeAttributeNode(t));var s=this.getAttributeNodeNS(i,ft.ns.RDF,"parseType"),a=this.getAttributeNodeNS(i,ft.ns.RDF,"datatype");if(a&&(e.datatype=a.nodeValue,i.removeAttributeNode(a)),s){var l=s.nodeValue;"Literal"===l?(e.datatype=ft.ns.RDF+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(i.childNodes),n=!1):"Resource"===l?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"===l&&((e=this.buildFrame(e,e.element)).parent.element=null,e.addCollection()),i.removeAttributeNode(s)}if(0!==o.length){var c=this.getAttributeNodeNS(i,ft.ns.RDF,"resource"),u=this.getAttributeNodeNS(i,ft.ns.RDF,"nodeID");e=this.buildFrame(e),c?(e.addNode(c.nodeValue),i.removeAttributeNode(c)):u?(e.addBNode(u.nodeValue),i.removeAttributeNode(u)):e.addBNode();for(var h=o.length-1;h>=0;h--){var d=this.buildFrame(e);d.addArc(r(o[h])),r(o[h])===ft.ns.RDF+"type"?this.buildFrame(d).addNode(o[h].nodeValue):this.buildFrame(d).addLiteral(o[h].nodeValue)}}else 0===i.childNodes.length&&this.buildFrame(e).addLiteral("")}else{var f=this.getAttributeNodeNS(i,ft.ns.RDF,"about");if(t=this.getAttributeNodeNS(i,ft.ns.RDF,"ID"),f&&t)throw new Error("RDFParser: "+i.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!f&&t)e.addNode("#"+t.nodeValue),i.removeAttributeNode(t);else if(null==f&&null==t){var p=this.getAttributeNodeNS(i,ft.ns.RDF,"nodeID");p?(e.addBNode(p.nodeValue),i.removeAttributeNode(p)):e.addBNode()}else e.addNode(f.nodeValue),i.removeAttributeNode(f);var g=this.getAttributeNodeNS(i,ft.ns.RDF,"type");ft.ns.RDF+"Description"!==r(i)&&(g={nodeValue:r(i)}),null!=g&&(this.store.add(e.node,this.store.sym(ft.ns.RDF+"type"),this.store.sym(x.join(g.nodeValue,e.base)),this.why),g.nodeName&&i.removeAttributeNode(g));for(var y=o.length-1;y>=0;y--)this.store.add(e.node,this.store.sym(r(o[y])),this.store.literal(o[y].nodeValue,e.lang),this.why)}for(i=e.element;e.parent;){for(var m=e;null==i;)i=(e=e.parent).element;var v=i.childNodes&&i.childNodes[e.lastChild];if(v&&n){if((v.nodeType===ft.nodeType.ELEMENT||v.nodeType===ft.nodeType.TEXT||v.nodeType===ft.nodeType.CDATA_SECTION)&&(v.nodeType!==ft.nodeType.TEXT&&v.nodeType!==ft.nodeType.CDATA_SECTION||1===i.childNodes.length)){e.lastChild++,e=this.buildFrame(m,i.childNodes[e.lastChild-1]);break}e.lastChild++}else{if(e.terminateFrame(),!(e=e.parent))break;i=e.element,n=!0}}}}cleanParser(){this.bnodes={},this.why=null}buildFrame(e,t){var r=this.frameFactory(this,e,t);if(e&&(r.base=e.base,r.lang=e.lang),!t||t.nodeType===ft.nodeType.TEXT||t.nodeType===ft.nodeType.CDATA_SECTION)return r;var n=t.attributes,i=t.getAttributeNode("xml:base");null!=i&&(r.base=i.nodeValue,t.removeAttribute("xml:base"));var o=t.getAttributeNode("xml:lang");null!=o&&(r.lang=o.nodeValue,t.removeAttribute("xml:lang"));for(var s=n.length-1;s>=0;s--)if("xml"===n[s].nodeName.substr(0,3)){if("xmlns:"===n[s].name.slice(0,6)){var a=n[s].nodeValue;this.base&&(a=x.join(a,this.base)),this.store.setPrefixForURI(n[s].name.slice(6),a)}t.removeAttributeNode(n[s])}return r}}function pt(e,t,r){var n,i,o,s=["INSERT","DELETE","WHERE"],a=O("http://www.w3.org/ns/pim/patch#"),l=xe(t,t,r,r,null,null,"",null),c={},u=function(e,t,r,n,i){return"Line "+(t+1)+" of <"+e+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var h=t.sym(r+"#query");for(c.query=h;;){if((i=l.skipSpace(e,n))<0)return c;if(";"===e[i]){if((n=l.skipSpace(e,i+1))<0)return c;i=n}var d=!1;for(o=0;o<s.length;o++){var f=s[o];if(e.slice(i,i+f.length)===f){if((n=l.skipSpace(e,i+f.length))<0)throw u(l._thisDoc,l.lines,e,i+f.length,"found EOF, needed {...} after "+f);if(("INSERT"===f||"DELETE"===f)&&"DATA"===e.slice(n,n+4)){if((i=l.skipSpace(e,n+4))<0)throw u(l._thisDoc,l.lines,e,n+4,"needed {...} after INSERT DATA "+f);n=i}var p=[];if((i=l.node(e,n,p))<0)throw u(l._thisDoc,l.lines,e,n,"bad syntax or EOF in {...} after "+f);c[f.toLowerCase()]=p[0],t.add(h,a(f.toLowerCase()),p[0]),d=!0,n=i}}if(!d&&"@prefix"===e.slice(i,i+7)){if((n=l.directive(e,i))<0)throw u(l._thisDoc,l.lines,e,n,"bad syntax or EOF after @prefix ");n=l.checkDot(e,n),d=!0}if(!d)throw u(l._thisDoc,l.lines,e,i,"Unknown syntax at start of statememt: '"+e.slice(i).slice(0,20)+"'")}}function gt(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",i=arguments.length>4?arguments[4]:void 0;n=n||o.z8,n=n.split(";")[0];try{if(n===o.qS||n===o.z8){var s=xe(t,t,r,r,null,null,"",null);s.loadBuf(e),c()}else if(n===o.Is){var a=new ft(t);a.parse(S.parseXML(e),r,t.sym(r)),c()}else if(n===o.D7)dt(S.parseXML(e,{contentType:o.D7}),t,r),c();else if(n===o.us)dt(S.parseXML(e,{contentType:o.us}),t,r),c();else if(n===o.oW||n===o.xm)pt(e,t,r),c();else if(n===o.ui)Se(e,t,r,c);else{if(n!==o.b4&&n!==o.lL)throw void 0===n?new Error("contentType is undefined"):new Error("Don't know how to parse "+n+" yet");var l=new st({factory:Ne});h(null,e)}}catch(e){u(e)}function c(){i&&i(null,t)}function u(e){if(n!==o.ui||n!==o.b4||n!==o.lL){if(!i){let t=new Error(e+" while trying to parse <"+r+"> as "+n);throw t.cause=e,t}i(e,t)}}function h(e,r){e&&i(e,t);try{l.parse(r,d)}catch(e){i(e,t)}}function d(e,r){r?t.add(r.subject,r.predicate,r.object,r.graph):i(e,t)}gt.handled={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/sparql-update":!0,"application/sparql-update-single-match":!0,"application/ld+json":!0,"application/nquads":!0,"application/n-quads":!0}}(0,e.Z)(ft,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,e.Z)(ft,"nodeType",{ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12});var yt=n(7297),mt=n.n(yt),vt=n(2598),bt=n(292);const wt={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},xt={rdf:o.Is,owl:o.Is,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},_t=e=>({link:O("http://www.w3.org/2007/ont/link#",e),http:O("http://www.w3.org/2007/ont/http#",e),httph:O("http://www.w3.org/2007/ont/httph#",e),rdf:O("http://www.w3.org/1999/02/22-rdf-syntax-ns#",e),rdfs:O("http://www.w3.org/2000/01/rdf-schema#",e),dc:O("http://purl.org/dc/elements/1.1/",e),ldp:O("http://www.w3.org/ns/ldp#",e)}),jt=_t();class Tt{constructor(t,r){(0,e.Z)(this,"response",void 0),(0,e.Z)(this,"dom",void 0),this.response=t,this.dom=r}}(0,e.Z)(Tt,"pattern",void 0);class Nt extends Tt{static toString(){return"RDFXMLHandler"}static register(e){e.mediatypes[o.Is]={q:.9}}parse(e,t,r){let n=e.store;if(this.dom||(this.dom=S.parseXML(t)),"parsererror"===this.dom.documentElement.nodeName)return e.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");let i=new ft(n);try{i.parse(this.dom,r.original.value,r.original)}catch(t){return e.failFetch(r,"Syntax error parsing RDF/XML! "+t,"parse_error")}return r.noMeta||n.add(r.original,jt.rdf("type"),jt.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}Nt.pattern=new RegExp("application/rdf\\+xml");class At extends Tt{static toString(){return"XHTMLHandler"}static register(e){e.mediatypes[o.D7]={}}parse(e,t,r){let n,i;this.dom||(this.dom=S.parseXML(t));let o=e.store,s=this.dom.getElementsByTagName("title");s.length>0&&o.add(r.resource,jt.dc("title"),o.rdfFactory.literal(s[0].textContent),r.resource);let a=this.dom.getElementsByTagName("link");for(let t=a.length-1;t>=0;t--)n=a[t].getAttribute("rel"),i=!1,n||(n=a[t].getAttribute("rev"),i=!0),n&&e.linkData(r.original,n,a[t].getAttribute("href"),r.resource,i);let l=this.dom.getElementsByTagName("script");for(let e=0;e<l.length;e++){let t=l[e].getAttribute("type");wt[t]&&(gt(l[e].textContent,o,r.original.value,t),gt(l[e].textContent,o,r.original.value,t))}if(r.noMeta||o.add(r.resource,jt.rdf("type"),jt.link("WebPage"),e.appNode),!r.noRDFa&&dt)try{dt(this.dom,o,r.original.value)}catch(t){let n="Error trying to parse "+r.resource+" as RDFa:\n"+t+":\n"+t.stack;return e.failFetch(r,n,"parse_error")}return e.doneFetch(r,this.response)}}At.pattern=new RegExp("application/xhtml");class Et extends Tt{static toString(){return"XMLHandler"}static register(e){e.mediatypes["text/xml"]={q:.5},e.mediatypes["application/xml"]={q:.5}}static isElement(e){return e.nodeType===Node.ELEMENT_NODE}parse(e,t,r){let n=S.parseXML(t);for(let i=0;i<n.childNodes.length;i++){const o=n.childNodes[i];if(Et.isElement(o)){let i=o.namespaceURI;if(i&&i===i.rdf)return e.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new Nt(this.response,n).parse(e,t,r);break}}if(n.doctype&&"html"===n.doctype.name&&n.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&n.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new At(this.response,n).parse(e,t,r);let i=n.getElementsByTagName("html")[0];if(i){let o=i.getAttribute("xmlns");if(o&&o.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return e.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new At(this.response,n).parse(e,t,r)}return e.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+t.slice(0,80),901)}}Et.pattern=new RegExp("(text|application)/(.*)xml");class Ot extends Tt{static toString(){return"HTMLHandler"}static register(e){e.mediatypes["text/html"]={q:.9}}parse(e,t,r){let n=e.store;if(Ct(t))return e.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new At(this.response).parse(e,t,r);if(function(e){const t=e.indexOf("<!DOCTYPE html"),r=e.indexOf(">");return!(-1===t||-1===r||t>r)&&-1!==e.substr(t,r-t).indexOf("XHTML")}(t))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new At(this.response).parse(e,t,r);if(function(e){return!!e.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(t))return e.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new At(this.response).parse(e,t,r);let i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(t);return i&&n.add(r.resource,jt.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,jt.rdf("type"),jt.link("WebPage"),e.appNode),e.addStatus(r.req,"non-XML HTML document, not parsed for data."),e.doneFetch(r,this.response)}}Ot.pattern=new RegExp("text/html");class St extends Tt{static toString(){return"JsonLdHandler"}static register(e){e.mediatypes["application/ld+json"]={q:.9}}parse(e,t,r,n){const i=e.store;return new Promise(((o,s)=>{try{Se(t,i,r.original.value,(()=>{o(e.doneFetch(r,n))}))}catch(t){const i="Error trying to parse "+r.resource+" as JSON-LD:\n"+t;o(e.failFetch(r,i,"parse_error",n))}}))}}St.pattern=/application\/ld\+json/;class It extends Tt{static toString(){return"TextHandler"}static register(e){e.mediatypes["text/plain"]={q:.5}}parse(e,t,r){return Ct(t)?(e.addStatus(r.req,"Warning: "+r.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new Et(this.response).parse(e,t,r)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new Et(this.response).parse(e,t,r)):(e.addStatus(r.req,"Plain text document, no known RDF semantics."),e.doneFetch(r,this.response))}}It.pattern=new RegExp("text/plain");class Rt extends Tt{static toString(){return"N3Handler"}static register(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}parse(e,t,r,n){let i=e.store,o=xe(i,i,r.original.value,r.original.value,null,null,"",null);try{o.loadBuf(t)}catch(t){let i="Error trying to parse "+r.resource+" as Notation3:\n"+t;return e.failFetch(r,i,"parse_error",n)}return e.addStatus(r.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),e.store.add(r.original,jt.rdf("type"),jt.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}Rt.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");const kt={RDFXMLHandler:Nt,XHTMLHandler:At,XMLHandler:Et,HTMLHandler:Ot,TextHandler:It,N3Handler:Rt,JsonLdHandler:St};function Ct(e){return!!e.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}class Dt{constructor(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,e.Z)(this,"store",void 0),(0,e.Z)(this,"timeout",void 0),(0,e.Z)(this,"_fetch",void 0),(0,e.Z)(this,"mediatypes",void 0),(0,e.Z)(this,"appNode",void 0),(0,e.Z)(this,"requested",void 0),(0,e.Z)(this,"timeouts",void 0),(0,e.Z)(this,"redirectedTo",void 0),(0,e.Z)(this,"fetchQueue",void 0),(0,e.Z)(this,"fetchCallbacks",void 0),(0,e.Z)(this,"nonexistent",void 0),(0,e.Z)(this,"lookedUp",void 0),(0,e.Z)(this,"handlers",void 0),(0,e.Z)(this,"ns",void 0),(0,e.Z)(this,"fireCallbacks",void 0),this.store=t||new K,this.ns=_t(this.store.rdfFactory),this.timeout=r.timeout||3e4,this._fetch=r.fetch||void 0!==n.g&&(n.g.solidFetcher||n.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||mt(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.rdfFactory.blankNode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},S.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(r.handlers||kt).map((e=>this.addHandler(kt[e])))}static crossSiteProxy(e){return Dt.crossSiteProxyTemplate?Dt.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):void 0}static offlineOverride(e){let t=e;var r;return"undefined"!=typeof window&&window.panes&&(r=window.panes.UI)&&r.preferences&&r.preferences.get("offlineModeUsingLocalhost")&&"http://"===t.slice(0,7)&&"localhost/"!==t.slice(7,17)&&(t="http://localhost/"+t.slice(7),E.Z.warn("Localhost kludge for offline use: actually getting <"+t+">")),t}static proxyIfNecessary(e){var t;if("undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.isExtension)return e;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){let t=e.split("/").slice(2);const r=(e,t)=>{let n=t[e.shift()];return n?"string"==typeof n?n+e.join("/"):e?r(e,n):null:null},n=r(t,$SolidTestEnvironment.localSiteMap);if(n)return n}return Dt.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===e.slice(0,5)?Dt.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):e}static unsupportedProtocol(e){let t=x.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}static setCredentials(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===t.credentials&&(void 0!==t.withCredentials?t.credentials=t.withCredentials?"include":"omit":t.credentials="include")}load(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=Object.assign({},t),e instanceof Array)return Promise.all(e.map((e=>this.load(e,Object.assign({},t)))));const r=e;let n=(0,vt._)(r);n=n.split("#")[0],t=this.initFetchOptions(n,t);const i=this.initFetchOptions(n,t);return this.pendingFetchPromise(n,i.baseURI,i)}async pendingFetchPromise(e,t,r){let n;return!r.force&&await this.fetchQueue[t]?n=this.fetchQueue[t]:(n=Promise.race([this.setRequestTimeout(e,r),this.fetchUri(e,r)]),this.fetchQueue[t]=n,this.cleanupFetchRequest(t,void 0,this.timeout)),n.then((t=>(e in this.timeouts&&(this.timeouts[e].forEach(clearTimeout),delete this.timeouts[e]),t)))}cleanupFetchRequest(e,t,r){void 0!==t&&bt.warn("_options is deprecated"),this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((()=>{this.isPending(e)||delete this.fetchQueue[e]}),r))}initFetchOptions(e,t){let r=this.store;!t.method||"GET"===t.method.toUpperCase()||(t.force=!0),t.resource=r.rdfFactory.namedNode(e),t.baseURI=t.baseURI||e,t.original=r.rdfFactory.namedNode(t.baseURI),t.req=r.bnode(),t.headers=t.headers||new yt.Headers,t.contentType&&(t.headers["content-type"]=t.contentType),t.force&&(t.cache="no-cache");let n=this.acceptString();t.headers.accept=n;let i=Dt.offlineOverride(e);t.requestedURI=i,Dt.setCredentials(i,t);let o=Dt.proxyIfNecessary(i);return i!==o&&(t.proxyUsed=!0),t.actualProxyURI=o,t}fetchUri(e,t){if(!e)return Promise.reject(new Error("Cannot fetch an empty uri"));if(Dt.unsupportedProtocol(e))return this.failFetch(t,"fetcher: Unsupported protocol","unsupported_protocol");let r=this.getState(e);if(t.force)delete this.nonexistent[e];else{if("fetched"===r)return Promise.resolve(this.doneFetch(t,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===r&&404===this.requested[e]){let r="Previously failed: "+this.requested[e],n={url:e,status:this.requested[e],statusText:r,responseText:r,headers:new yt.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(t,r,this.requested[e],n)}}this.fireCallbacks("request",[e]),this.requested[e]=!0,t.noMeta||this.saveRequestMetadata(e,t);let{actualProxyURI:n}=t;return this._fetch(n,t).then((r=>this.handleResponse(r,e,t)),(r=>{let i={url:n,status:999,statusText:(r.name||"network failure")+": "+(r.errno||r.code||r.type),responseText:r.message,headers:new yt.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return bt.log("Fetcher: <"+n+"> Non-HTTP fetch exception: "+r),this.handleError(i,e,t)}))}nowOrWhenFetched(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,vt._)(e);"function"==typeof t?r=t:void 0===t||((0,c.NX)(t)?n.referringTerm=t:n=t),this.load(i,n).then((e=>{if(r)if(e)if(e.ok)r(!0,"OK",e);else{let t="HTTP error: Status "+e.status+" ("+e.statusText+")";e.responseText&&(t+=" "+e.responseText),bt.log(t+" fetching "+i),r(!1,t,e)}else{let e="@@ nowOrWhenFetched: no response object!";bt.log(e),r(!1,e)}}),(function(e){var t=e.message||e.statusText;t="Failed to load <"+i+"> "+t,bt.log(t),e.response&&e.response.status&&(t+=" status: "+e.response.status),r(!1,t,e.response)}))}addStatus(e,t){let r=new Date;t="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+t;let n=this.store;const i=n.the(e,this.ns.link("status"));(0,c.uZ)(i)?i.append(n.rdfFactory.literal(t)):E.Z.warn("web.js: No list to add to: "+i+","+t)}failFetch(e,t,r,n){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,this.ns.link("error"),this.store.rdfFactory.literal(t));let i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.equals(e.original),this.requested[x.docpart(e.original.value)]=r,this.fireCallbacks("fail",[e.original.value,t]));var o=new Error("Fetcher: "+t);return o.status=r,o.statusText=t,o.response=n,Promise.reject(o)}linkData(e,t,r,n,i){if(!r)return;let o,s=this.store,a=s.rdfFactory.namedNode(x.join(r,e.value));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(a.value===e.value)return;o=this.ns.rdfs("seeAlso")}else o="type"===t?s.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):s.rdfFactory.namedNode(x.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?s.add(a,o,e,n):s.add(e,o,a,n)}parseLinkHeader(e,t,r){if(!e)return;const n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(let e=0;e<i.length;e++){let o=i[e].split(">"),s=o[0].substring(1),a=o[1].match(n);if(null==a)return;for(let e=0;e<a.length;e++){let n=a[e].split("=")[1].replace(/["']/g,"");this.linkData(t,n,s,r)}}}doneFetch(e,t){return this.addStatus(e.req,"Done."),this.requested[e.original.value]="done",this.fireCallbacks("done",[e.original.value]),t.req=e.req,t}nowKnownAs(e,t){this.lookedUp[e.value]?this.lookedUp[t.value]||this.lookUpThing(t,e):this.lookedUp[t.value]&&(this.lookedUp[e.value]||this.lookUpThing(e,t))}putBack(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(0,vt._)(e);let n=new l.Z(r).doc();return t.contentType=t["content-type"]||t["Content-Type"]||t.contentType||o.z8,"application/ld+json"===t.contentType?new Promise(((r,i)=>{F(n,this.store,n.uri,t.contentType,((n,o)=>{n?i(n):(t.data=o,this.webOperation("PUT",e,t).then((e=>r(e))).catch((e=>i(e))))}))})):(t.data=F(n,this.store,n.value,t.contentType),this.webOperation("PUT",r,t))}webCopy(e,t,r){return this.webOperation("GET",e).then((e=>this.webOperation("PUT",t,{data:e.responseText,contentType:r})))}delete(e,t){return this.webOperation("DELETE",e,t).then((t=>(this.requested[e]=404,this.nonexistent[e]=!0,this.unload(this.store.rdfFactory.namedNode(e)),t)))}async createIfNotExists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.z8,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=this;try{var i=await n.load(e)}catch(o){if(404===o.response.status){bt.log("createIfNotExists: doc does NOT exist, will create... "+e);try{i=await n.webOperation("PUT",e.value,{data:r,contentType:t})}catch(t){throw bt.log("createIfNotExists doc FAILED: "+e+": "+t),t}return delete n.requested[e.value],i}throw bt.log("createIfNotExists doc load error NOT 404: "+e+": "+o),o}return i}createContainer(e,t,r){let n={"content-type":o.z8,link:this.ns.ldp("BasicContainer")+'; rel="type"'};t&&(n.slug=t);let i={headers:n};return r&&(i.body=r),this.webOperation("POST",e,i)}invalidateCache(e){const t=(0,vt._)(e),r=this;if(r.fetchQueue&&r.fetchQueue[t]&&(bt.log("Internal error - fetchQueue exists "+t),"resolved"===r.fetchQueue[t].PromiseStatus?delete r.fetchQueue[t]:(delete r.fetchQueue[t],bt.log("*** Fetcher: pending fetchQueue deleted "+t))),r.requested[t]&&"done"!==r.requested[t]&&"failed"!==r.requested[t]&&404!==r.requested[t]){let e=`Rdflib: fetcher: Destructive operation on <${r.requested[t]}> file being fetched! `+t;bt.error(e)}else delete r.requested[t],delete r.nonexistent[t]}webOperation(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,vt._)(t);r.method=e,r.body=r.data||r.body,r.force=!0;const i=this;if(r.body&&!r.contentType)throw new Error("Web operation sending data must have a defined contentType.");return r.contentType&&(r.headers=r.headers||{},r.headers["content-type"]=r.contentType),Dt.setCredentials(n,r),new Promise((function(t,o){i._fetch(n,r).then((r=>{if(r.ok)"PUT"!==e&&"PATCH"!==e&&"POST"!==e&&"DELETE"!==e||i.invalidateCache(n),r.text?r.text().then((e=>{r.responseText=e,t(r)})):t(r);else{let t="Web error: "+r.status;r.statusText&&(t+=" ("+r.statusText+")"),t+=" on "+e+" of <"+n+">",r.responseText&&(t+=": "+r.responseText);let i=new Error(t);i.response=r,o(i)}}),(t=>{o(new Error("Fetch error for "+e+" of <"+n+">:"+t))}))}))}lookUpThing(e,t){let r=this.store.uris(e);return r=r.map((e=>x.docpart(e))),r.forEach((e=>{this.lookedUp[e]=!0})),this.load(r,{referringTerm:t})}getHeader(e,t){const r=this.store,n=e.value,i=r.each(void 0,this.ns.link("requestedURI"),r.rdfFactory.literal(n));for(let e=0;e<i.length;e++){let n=i[e];if(void 0!==n){let e=r.any(n,this.ns.link("response"));if(void 0!==e&&r.anyValue(e,this.ns.http("status"))&&r.anyValue(e,this.ns.http("status")).startsWith("2")){let n=r.each(e,this.ns.httph(t.toLowerCase()));return n.length?n.map((e=>e.value)):[]}}}}saveRequestMetadata(e,t){let r=t.req,n=this.store,i=t.referringTerm;this.addStatus(t.req,"Accept: "+t.headers.accept),(0,c.NX)(i)&&n.add(n.rdfFactory.namedNode(e),this.ns.link("requestedBy"),i,this.appNode),t.original&&t.original.value!==e&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(t.original.value),this.appNode);const o=new Date,s="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(s+" Request for "+e),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(e),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}saveResponseMetadata(e,t){const r=this.store;let n=r.bnode();return r.add(t.req,this.ns.link("response"),n,n),r.add(n,this.ns.http("status"),r.rdfFactory.literal(e.status),n),r.add(n,this.ns.http("statusText"),r.rdfFactory.literal(e.statusText),n),e.headers.forEach(((e,i)=>{r.add(n,this.ns.httph(i),this.store.rdfFactory.literal(e),n),"content-type"===i&&r.add(t.resource,this.ns.rdf("type"),r.rdfFactory.namedNode(S.mediaTypeClass(e).value),n)})),n}objectRefresh(e){let t=this.store.uris(e);if(void 0!==t)for(let e=0;e<t.length;e++)this.refresh(this.store.rdfFactory.namedNode(x.docpart(t[e])))}refresh(e,t){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(e,{force:!0,clearPreviousData:!0},t)}refreshIfExpired(e,t){let r=this.getHeader(e,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(e,t):t(!0,"Not expired",{})}retract(e){this.store.removeMany(void 0,void 0,void 0,e),e.value&&delete this.requested[x.docpart(e.value)],this.fireCallbacks("retract",arguments)}getState(e){return void 0===this.requested[e]?"unrequested":!0===this.requested[e]?"requested":"done"===this.requested[e]?"fetched":"redirected"===this.requested[e]?this.getState(this.redirectedTo[e]):"failed"}isPending(e){return!0===this.requested[e]}unload(e){this.store.removeDocument(e),delete this.requested[e.value]}addHandler(e){this.handlers.push(e),e.register(this)}retryNoCredentials(e,t){bt.log("Fetcher: CORS: RETRYING with NO CREDENTIALS for "+t.resource),t.retriedWithNoCredentials=!0,delete this.requested[e],delete this.fetchQueue[e];let r=Object.assign({},t,{credentials:"omit"});return this.addStatus(t.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(e,r)}isCrossSite(e){if("undefined"==typeof document||!document.location)return!1;const t=x.hostpart,r=""+document.location;return(t(r)&&t(e)&&t(r))!==t(e)}handleError(e,t,r){if(this.isCrossSite(t)){if(r.credentials&&"include"===r.credentials&&!r.retriedWithNoCredentials)return this.retryNoCredentials(t,r);let e=Dt.crossSiteProxy(t);if(e&&!r.proxyUsed)return bt.log("web: Direct failed so trying proxy "+e),this.redirectToProxy(e,r)}var n;return e instanceof Error?n="Fetch error: "+e.message:(n=e.statusText,e.responseText&&(n+=` ${e.responseText}`)),this.failFetch(r,n,e.status||998,e)}addType(e,t,r,n){let i=t;if(n){var o=r.any(i,this.ns.link("requestedURI"));o&&o.value!==n&&r.add(r.rdfFactory.namedNode(n),this.ns.rdf("type"),e,this.appNode)}for(;;){const t=r.any(i,this.ns.link("requestedURI"));if(t&&t.value&&r.add(r.rdfFactory.namedNode(t.value),this.ns.rdf("type"),e,this.appNode),i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i),!i)break;var s=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var a=r.any(s,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!a)break;if("301"!==a&&"302"!==a)break}}handleResponse(e,t,r){const n=this.store,i=e.headers,o=r.req,s=this.saveResponseMetadata(e,r),a=this.normalizedContentType(r,i)||"";let l=i.get("content-location");if(0===e.status)return bt.log("Masked error - status 0 for "+t),this.handleError(e,t,r);if(e.status>=400)return 404===e.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then((()=>{let t=r.resource+" "+e.statusText;return this.failFetch(r,t,e.status,e)}));var c=null,u=null;if(l&&(u=x.join(l,t))!==t&&(c=u),200===e.status){this.addType(this.ns.link("Document"),o,n,t),c&&this.addType(this.ns.link("Document"),o,n,c),r.clearPreviousData&&n.removeDocument(r.resource);let e=a.includes("image/")||a.includes("application/pdf");a&&e&&(this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,n,t),c&&this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,n,c))}if(l){if(!r.force&&c&&"done"===this.requested[u])return this.doneFetch(r,e);this.requested[u]=!0}this.parseLinkHeader(i.get("link"),r.original,o);let h=this.handlerForContentType(a,e);return h?e.text().then((t=>(e.responseText=t,h.parse(this,t,r,e)))):(this.addStatus(o,"Fetch over. No data handled."),this.doneFetch(r,e))}saveErrorResponse(e,t){let r=this.store;return e.text().then((e=>{e.length>10&&r.add(t,this.ns.http("content"),r.rdfFactory.literal(e),t)}))}handlerForContentType(e,t){if(!e)return null;let r=this.handlers.find((t=>e.match(t.pattern)));return r?new r(t):null}guessContentType(e){return xt[e.split(".").pop()]}normalizedContentType(e,t){if(e.forceContentType)return e.forceContentType;let r=t.get("content-type");if(!r||r.includes("application/octet-stream")){let t=this.guessContentType(e.resource.value);if(t)return t}let n=x.protocol(e.resource.value);return!r&&["file","chrome"].includes(n)?"text/xml":r}redirectToProxy(e,t){this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;const r=this.store,n=t.req;t.noMeta||(r.add(n,this.ns.link("redirectedTo"),r.rdfFactory.namedNode(e),n),this.addStatus(n,"redirected to new request")),this.requested[t.resource.value]="redirected",this.redirectedTo[t.resource.value]=e;let i=Object.assign({},t);return i.baseURI=t.resource.value,this.fetchUri(e,i).then((e=>(i.noMeta||r.add(n,this.ns.link("redirectedRequest"),i.req,this.appNode),e)))}setRequestTimeout(e,t){return new Promise((r=>{this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((()=>{!this.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||r(this.failFetch(t,`Request to ${e} timed out`,"timeout"))}),this.timeout))}))}addFetchCallback(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}acceptString(){let e="";for(let t in this.mediatypes){""!==e&&(e+=", "),e+=t;for(let r in this.mediatypes[t])e+=";"+r+"="+this.mediatypes[t][r]}return e}}(0,e.Z)(Dt,"HANDLERS",void 0),(0,e.Z)(Dt,"CONTENT_TYPE_BY_EXT",void 0),(0,e.Z)(Dt,"crossSiteProxyTemplate",void 0),Dt.HANDLERS=kt,Dt.CONTENT_TYPE_BY_EXT=xt;const Lt={parseJSON:function(e,t,r){var n,i,o,s={},a=r.sym(t);for(var l in e){0===l.indexOf("_:")?s[l]?n=s[l]:(n=r.bnode(l),s[l]=n):n=r.sym(l);var c=e[l];for(var u in c){var h=c[u];for(var d in i=r.sym(u),h){var f=h[d];if("uri"===f.type)o=r.sym(f.value),r.add(n,i,o,a);else if("BlankNode"===f.type)s[f.value]?o=s[f.value]:(o=r.bnode(f.value),s[f.value]=o),r.add(n,i,o,a);else{if("Literal"!==f.type)throw new Error("error: unexpected termtype: "+d.type);o=f.datatype?r.literal(f.value,void 0,r.sym(f.datatype)):f.lang?r.literal(f.value,f.lang):r.literal(f.value),r.add(n,i,o,a)}}}}}};function Pt(e){var t=0;function r(e){var t="",r=e.statements;for(var n in r)E.Z.debug("Found statement: "+r),t+=s()+r[n]+"\n";return t}function n(e){var t="";for(var r in e.constraints){var n=e.constraints[r];t+=s()+"FILTER ( "+n.describe(r)+" ) \n"}return t}function i(e){for(var o="",a=0;a<e.optional.length;a++)E.Z.debug("Found optional query"),o+=s()+"OPTIONAL { \n",t++,o+=r(e.optional[a]),o+=n(e.optional[a]),o+=i(e.optional[a]),t--,o+=s()+"}\n";return o}function o(e){var o=s()+"WHERE \n{ \n";return t++,o+=r(e),o+=n(e),o+=i(e),t--,o+"}"}function s(){for(var e="",r=0;r<t;r++)e+=" ";return e}return function(e){return function(e){for(var t=s()+"SELECT ",r=0;r<e.vars.length;r++)t+=e.vars[r]+" ";return t+"\n"}(e)+o(e.pat)}(e)}function Ft(e,t,r){var n=[];function i(e){if(n[e])return n[e];var t=r.variable(e);return n[e]=t,t}function o(e){return"string"==typeof e&&e.match(/[^ \n\t]/)}function s(e){return"string"==typeof e&&e.match(/^[\?\$]/)}function a(e){return"string"==typeof e?e.replace(/^</,"<").replace(/>$/,">"):e}function l(e){return"string"==typeof e&&e.match(/^<[^>]*>$/)}function c(e){return"string"==typeof e&&(e.match(/^_:/)||e.match(/^$/))}function u(e){return"string"==typeof e&&e.match(/:$/)}function h(e){return"string"==typeof e&&e.match(/^:|^[^_][^:]*:/)}function d(e){return e.split(":")[0]}function f(e){return e.split(":")[1]}function p(e){return l(e)?e.slice(1,e.length-1):e}function g(e){var t=-1===e.indexOf("'")?null:e.indexOf("'"),n=-1===e.indexOf('"')?null:e.indexOf('"');if(!t&&!n){var i=new Array(1);return i[0]=e,i}var o,s,a=new Array(2);if(!t||n&&n<t)o='"',s=n;else{if(n&&!(t&&t<n))return E.Z.error("SQARQL QUERY OOPS!"),a;o="'",s=t}a[0]=e.slice(0,s);var l,c=e.slice(s+1).indexOf(o);return-1===c?(E.Z.error("SPARQL parsing error: no matching parentheses in literal "+e),e):(e.slice(c+s+2).match(/^\^\^/)?(l=e.slice(c+s+2).indexOf(" "),a[1]=r.literal(e.slice(s+1,s+1+c),r.sym(p(e.slice(s+4+c,s+2+c+l)))),a=a.concat(g(e.slice(c+s+3+l)))):e.slice(c+s+2).match(/^@/)?(l=e.slice(c+s+2).indexOf(" "),a[1]=r.literal(e.slice(s+1,s+1+c),e.slice(s+3+c,s+2+c+l),null),a=a.concat(g(e.slice(c+s+2+l)))):(a[1]=r.literal(e.slice(s+1,s+1+c)),E.Z.info("Literal found: "+a[1]),a=a.concat(g(e.slice(c+s+2)))),a)}function y(e){e=e.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),E.Z.info("New str into spaceDelimit: \n"+e);var t=[],r=e.split(" ");for(var n in r)o(r[n])&&(t=t.concat(r[n]));return t}function m(e,t){for(var r=0;r<t.length;r++)if("string"==typeof t[r]&&t[r].toLowerCase()===e.toLowerCase())return r;return null}function v(e,t){for(var r=[],n=0;n<t.length;n++)"string"==typeof t[n]&&t[n].toLowerCase()===e.toLowerCase()&&r.push(n);return r}function b(e,t,r){E.Z.info("Looking for a close bracket of type "+r+" in "+e);for(var n=0,i=0;i<e.length;i++)if(e[i]===t&&n++,e[i]===r&&n--,n<0)return i;return E.Z.error("Statement had no close parenthesis in SPARQL query"),0}function w(e){return this.describe=function(t){return t+" = "+e.toNT()},this.test=function(t){return e.equals(t)},this}function x(e){this.describe=function(t){return"REGEXP( '"+e+"' , "+t+" )"},this.test=function(t){var r=new RegExp(e);return!!t.value&&r.test(t.value)}}function _(e,t){3!==e.length||"Variable"!==e[0].termType||"NamedNode"!==e[2].termType&&"Literal"!==e[2].termType?6===e.length&&"string"==typeof e[0]&&"regexp"===e[0].toLowerCase()&&"("===e[1]&&")"===e[5]&&","===e[3]&&"Variable"===e[4].termType&&"Literal"===e[2].termType&&(E.Z.debug("Constraint added: "+e),t.constraints[e[4]]=new x(e[2].value)):"="===e[1]||">"===e[1]||"<"===e[1]?(E.Z.debug("Constraint added: "+e),t.constraints[e[0]]=new w(e[2])):E.Z.warn("I don't know how to handle the constraint: "+e)}function j(e,t){E.Z.debug("Optional query: "+e+" not yet implemented.");var n=r.formula();T(e,n),t.optional.push(n)}function T(e,t){var n,o,u=function(e){for(var t=[],n=0;n<e.length;n++)"string"==typeof e[n]?(e[n]=a(e[n]),s(e[n])?t[n]=i(e[n].slice(1)):c(e[n])?(E.Z.info(e[n]+" was identified as a bnode."),t[n]=r.bnode()):l(e[n])?(E.Z.info(e[n]+" was identified as a symbol."),t[n]=r.sym(p(e[n]))):h(e[n])?(E.Z.info(e[n]+" was identified as a prefixed symbol"),O[d(e[n])]?t[n]=r.sym(e[n]=O[d(e[n])]+f(e[n])):(E.Z.error("SPARQL error: "+e[n]+" with prefix "+d(e[n])+" does not have a correct prefix entry."),t[n]=e[n])):t[n]=e[n]):t[n]=e[n];return t}(e);for(E.Z.debug("WHERE: "+u);m("OPTIONAL",u);)o=m("OPTIONAL",u),E.Z.debug("OPT: "+o+" "+u[o]+" in "+u),"{"!==u[o+1]&&E.Z.warn("Bad optional opening bracket in word "+o),-1===(n=b(u.slice(o+2),"{","}"))?E.Z.error("No matching bracket in word "+o):(j(u.slice(o+2,o+2+n),t),o=m("OPTIONAL",u),n=b(u.slice(o+2),"{","}"),u.splice(o,n+3));for(E.Z.debug("WHERE after optionals: "+u);m("FILTER",u);){var g=m("FILTER",u);"("!==u[g+1]&&E.Z.warn("Bad filter opening bracket in word "+g),-1===(n=b(u.slice(g+2),"(",")"))?E.Z.error("No matching bracket in word "+g):(_(u.slice(g+2,g+2+n),t),g=m("FILTER",u),n=b(u.slice(g+2),"(",")"),u.splice(g,n+3))}E.Z.debug("WHERE after filters and optionals: "+u),function(e,t){var r=new Array(1);r[0]=-1;for(var n=r.concat(v(".",e)),i=[],o=0;o<n.length-1;o++)i[o]=e.slice(n[o]+1,n[o+1]);for(o in i){E.Z.info("s+p+o "+o+" = "+i[o]);var s=i[o][0];i[o].splice(0,1);var a=r.concat(v(";",i[o]));a.push(i[o].length);for(var l=[],c=0;c<a.length-1;c++)l[c]=i[o].slice(a[c]+1,a[c+1]);for(o in l){E.Z.info("p+o "+o+" = "+i[o]);var u=l[o][0];l[o].splice(0,1);var h=r.concat(v(",",l[o]));h.push(l[o].length);var d=[];for(c=0;c<h.length-1;c++)d[c]=l[o].slice(h[c]+1,h[c+1]);for(o in d){var f=d[o][0];E.Z.info("Subj="+s+" Pred="+u+" Obj="+f),t.add(s,u,f)}}}}(u,t)}E.Z.info("SPARQL input: \n"+e);var N=new X,A=function(e){var t=g(e),r=[];for(var n in t)r="string"==typeof t[n]?r.concat(y(t[n])):r.concat(t[n]);return r=function(e){for(var t=e,r=0;r<t.length;r++)if("a"===t[r]&&(t[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===t[r]&&"of"===t[r+2]){t.splice(r,1),t.splice(r+1,1);var n=t[r-1];t[r-1]=t[r+1],t[r+1]=n}return t}(r),E.Z.info("SPARQL Tokens: "+r),r}(e),O=function(e){var t=v("PREFIX",e),r=[];for(var n in t){var i=e[t[n]+1],o=e[t[n]+2];if(u(i))if(l(o)){E.Z.info("Prefix found: "+i+" -> "+o);var s=d(i),a=p(o);r[s]=a}else E.Z.error("Invalid SPARQL symbol: "+o);else E.Z.error("Invalid SPARQL prefix: "+i)}return r}(A);O.rdf||(O.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),O.rdfs||(O.rdfs="http://www.w3.org/2000/01/rdf-schema#");var S=m("SELECT",A),I=m("WHERE",A);if(S<0||I<0||S>I)return E.Z.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(e,t){for(var r in E.Z.info("SPARQL vars: "+e),e)if(s(e[r])){E.Z.info("Added "+e[r]+" to query variables from SPARQL");var n=i(e[r].slice(1));t.vars.push(n),n.label=e[r].slice(1)}else E.Z.warn("Incorrect SPARQL variable in SELECT: "+e[r])}(A.slice(S+1,I),N),T(A.slice(I+2,A.length-1),N.pat),t)return N;for(var R in N.pat.statements){var k=N.pat.statements[R];"NamedNode"===k.subject.termType&&r.fetcher&&r.fetcher.lookUpThing(k.subject,"sparql:"+k.subject),"NamedNode"===k.object.termType&&r.fetcher&&r.fetcher.lookUpThing(k.object,"sparql:"+k.object)}return N}class Mt{constructor(t){if((0,e.Z)(this,"store",void 0),(0,e.Z)(this,"ifps",void 0),(0,e.Z)(this,"fps",void 0),(0,e.Z)(this,"patchControl",void 0),(0,e.Z)(this,"ns",void 0),(t=t||new K).updater)throw new Error("You can't have two UpdateManagers for the same store");t.fetcher||(t.fetcher=new Dt(t)),this.store=t,t.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=O("http://www.w3.org/2007/ont/link#"),this.ns.http=O("http://www.w3.org/2007/ont/http#"),this.ns.httph=O("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=O("http://www.w3.org/ns/ldp#"),this.ns.rdf=O("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=O("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=O("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=O("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}patchControlFor(e){return this.patchControl[e.value]||(this.patchControl[e.value]=[]),this.patchControl[e.value]}isHttpUri(e){return"http"===e.slice(0,4)}editable(e,t){if(!e)return!1;if(t||(t=this.store),e=(0,vt._)(e),!this.isHttpUri(e)&&t.holds(this.store.rdfFactory.namedNode(e),this.store.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.store.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";for(var r,n,i=!1,o=t.each(void 0,this.ns.link("requestedURI"),(0,x.docpart)(e)),s=0;s<o.length;s++)if(void 0!==(r=o[s])){var a=t.any(r,this.ns.link("response"));if(void 0!==r){var l=t.anyValue(a,this.ns.httph("wac-allow"));if(l)for(var c of l.split(",")){var u=c.split("=");if(u[0].includes("user")&&!u[1].includes("write")&&!u[1].includes("append"))return!1}var h=t.each(a,this.ns.httph("accept-patch"));if(h.length)for(let e=0;e<h.length;e++){if((n=h[e].value.trim()).indexOf("application/sparql-update")>=0)return"SPARQL";if(n.indexOf("application/sparql-update-single-match")>=0)return"SPARQL"}var d=t.each(a,this.ns.httph("ms-author-via"));if(d.length)for(let e=0;e<d.length;e++){if((n=d[e].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(n.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(e))return!!l&&"LOCALFILE";var f=t.each(a,this.ns.http("status"));if(f.length)for(let e=0;e<f.length;e++)200!==f[e]&&404!==f[e]||(i=!0)}}if(0===o.length);else if(i)return!1}anonymize(e){return"_:"===e.toNT().substr(0,2)&&this.mentioned(e)?"?"+e.toNT().substr(2):e.toNT()}anonymizeNT(e){return this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" ."}nTriples(e){return`${e.subject.toNT()} ${e.predicate.toNT()} ${e.object.toNT()} .`}statementBnodes(e){return[e.subject,e.predicate,e.object].filter((function(e){return(0,c.B2)(e)}))}statementArrayBnodes(e){var t=[];for(let r=0;r<e.length;r++)t=t.concat(this.statementBnodes(e[r]));t.sort();var r=[];for(let e=0;e<t.length;e++)0!==e&&t[e].equals(t[e-1])||r.push(t[e]);return r}cacheIfps(){this.ifps={};var e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty"));for(let t=0;t<e.length;t++)this.ifps[e[t].value]=!0;this.fps={},e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(let t=0;t<e.length;t++)this.fps[e[t].value]=!0}bnodeContext2(e,t,r){var n,i,o=this.store.statementsMatching(void 0,void 0,e,t);for(let e=0;e<o.length;e++)if(this.fps[o[e].predicate.value]){if(!(n=o[e].subject).isBlank)return[o[e]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[e]])}o=this.store.statementsMatching(e,void 0,void 0,t);for(let e=0;e<o.length;e++)if(this.ifps[o[e].predicate.value]){if(!(n=o[e].object).isBlank)return[o[e]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[e]])}return null}bnodeContext1(e,t){for(var r=0;r<3;r++){var n=this.bnodeContext2(e,t,r);if(null!==n)return n}return this.store.connectedStatements(e,t)}mentioned(e){return 0!==this.store.statementsMatching(e,null,null,null).length||0!==this.store.statementsMatching(null,e).length||0!==this.store.statementsMatching(null,null,e).length}bnodeContext(e,t){var r=[];if(e.length){this.cacheIfps();for(let i=0;i<e.length;i++){var n=e[i];this.mentioned(n)&&(r=r.concat(this.bnodeContext1(n,t)))}}return r}statementContext(e){var t=this.statementBnodes(e);return this.bnodeContext(t,e.graph)}contextWhere(e){var t=this;return e&&0!==e.length?"WHERE { "+e.map((function(e){return t.anonymizeNT(e)})).join("\n")+" }\n":""}fire(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((()=>{if(!e)throw new Error("No URI given for remote editing operation: "+t);return n.noMeta=!0,n.contentType="application/sparql-update",n.body=t,this.store.fetcher.webOperation("PATCH",e,n)})).then((n=>{if(!n.ok){let r="UpdateManager: update failed for <"+e+"> status="+n.status+", "+n.statusText+"\n for query: "+t;throw new Error(r)}r(e,n.ok,n.responseText,n)})).catch((t=>{r(e,!1,t.message,t)}))}update_statement(e){if(!e||e.graph){var t=this,r=this.statementContext(e);return{statement:e?[e.subject,e.predicate,e.object,e.graph]:void 0,statementNT:e?this.anonymizeNT(e):void 0,where:t.contextWhere(r),set_object:function(e,r){var n=this.where;n+="DELETE DATA { "+this.statementNT+" } ;\n",n+="INSERT DATA { "+this.anonymize(this.statement[0])+" "+this.anonymize(this.statement[1])+" "+this.anonymize(e)+" . }\n",t.fire(this.statement[3].value,n,r)}}}}insert_statement(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){var i="";for(let t=0;t<e.length;t++)i+=e[t]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}delete_statement(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){var i="";for(let t=0;t<e.length;t++)i+=e[t]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}requestDownstreamAction(e,t){var r=this.patchControlFor(e);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+t)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=t;else t(e)}clearUpstreamCount(e){this.patchControlFor(e).upstreamCount=0}getUpdatesVia(e){var t=this.store.fetcher.getHeader(e,"updates-via");return t&&t.length?t[0].trim():null}addDownstreamChangeListener(e,t){var r=this.patchControlFor(e);r.downstreamChangeListeners||(r.downstreamChangeListeners=[]),r.downstreamChangeListeners.push(t),this.setRefreshHandler(e,(e=>{this.reloadAndSync(e)}))}reloadAndSync(e){var t=this.patchControlFor(e),r=this;if(t.reloading)t.outOfDate=!0;else{t.reloading=!0;var n=1e3,i=function(){r.reload(r.store,e,(function(e,r,o){if(e){if(t.downstreamChangeListeners)for(let e=0;e<t.downstreamChangeListeners.length;e++)t.downstreamChangeListeners[e]();t.reloading=!1,t.outOfDate&&(t.outOfDate=!1,i())}else t.reloading=!1,0===o.status&&(t.reloading=!0,setTimeout(i,n*=2))}))};i()}}setRefreshHandler(e,t){let r=this.getUpdatesVia(e);var n=t,i=this,o=this,s=1500,a=0;if(!r)return!1;r=(0,x.join)(r,e.value);const l=r.replace(/^http:/,"ws:").replace(/^https:/,"wss:");var c=function(){var t;if("undefined"!=typeof WebSocket)t=new WebSocket(l);else{if("undefined"==typeof window||!window.WebSocket)return;t=window.WebSocket(l)}t.onopen=function(){s=1500,this.send("sub "+e.value),a&&o.requestDownstreamAction(e,n)};var r=i.patchControlFor(e);r.upstreamCount=0,t.onerror=function(e){},t.onclose=function(e){s*=2,a+=1,setTimeout((function(){c()}),s)},t.onmessage=function(t){if(t.data&&"pub"===t.data.slice(0,3)){if("upstreamCount"in r&&(r.upstreamCount-=1,r.upstreamCount>=0))return;r.upstreamCount=0,i.requestDownstreamAction(e,n)}}};return c(),!0}updateMany(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=e.concat(t).map((e=>e.why)),n=this,i=[];r.forEach((e=>{i.find((t=>t.equals(e)))||i.push(e)}));const o=i.map((r=>n.update(e.filter((e=>e.why.equals(r))),t.filter((e=>e.why.equals(r))))));return o.length,Promise.all(o)}update(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!r){var o=this;return new Promise((function(r,s){o.update(e,t,(function(e,t,n){t?r():s(new Error(n))}),n,i)}))}try{var s=this.store,a=e?(0,c.Pv)(e)?e.statements:e instanceof Array?e:[e]:[],l=t?(0,c.Pv)(t)?t.statements:t instanceof Array?t:[t]:[];if(!(a instanceof Array))throw new Error("Type Error "+typeof a+": "+a);if(!(l instanceof Array))throw new Error("Type Error "+typeof l+": "+l);if(0===a.length&&0===l.length)return r(null,!0);var u=a.length?a[0].graph:l[0].graph;if(!u){let e="Error patching: statement does not specify which document to patch:"+a[0]+", "+l[0];throw new Error(e)}var h=this.patchControlFor(u),d=Date.now(),f=["subject","predicate","object","why"],p={delete:a,insert:l};["insert","delete"].map((function(e){p[e].map((function(e){if(!u.equals(e.graph))throw new Error("update: destination "+u+" inconsistent with delete quad "+e.graph);f.map((function(t){if(void 0===e[t])throw new Error("update: undefined "+t+" of statement.")}))}))}));var g=this.editable(u.value,s);if(!1===g)throw new Error("Update: Can't make changes in uneditable "+u);if(void 0===g){if(n)throw new Error("Update: Loaded "+u+"but stil can't figure out what editing protcol it supports.");return void this.store.fetcher.load(u).then((n=>{this.update(e,t,r,!0,i)}),(n=>{if(404!==n.response.status)throw new Error(`Update: Can't get updatability status ${u} before patching: ${n}`);this.update(e,t,r,!0,i)}))}if(g.indexOf("SPARQL")>=0){var y=[];a.length&&(y=this.statementArrayBnodes(a)),l.length&&(y=y.concat(this.statementArrayBnodes(l)));var m=this.bnodeContext(y,u),v=this.contextWhere(m),b="";if(v.length){if(a.length){b+="DELETE { ";for(let e=0;e<a.length;e++)b+=this.anonymizeNT(a[e])+"\n";b+=" }\n"}if(l.length){b+="INSERT { ";for(let e=0;e<l.length;e++)b+=this.anonymizeNT(l[e])+"\n";b+=" }\n"}b+=v}else{if(a.length){b+="DELETE DATA { ";for(let e=0;e<a.length;e++)b+=this.anonymizeNT(a[e])+"\n";b+=" } \n"}if(l.length){a.length&&(b+=" ; "),b+="INSERT DATA { ";for(let e=0;e<l.length;e++)b+=this.nTriples(l[e])+"\n";b+=" }\n"}}h.pendingUpstream=h.pendingUpstream?h.pendingUpstream+1:1,"upstreamCount"in h&&(h.upstreamCount+=1),this.fire(u.value,b,((e,t,n,i)=>{if(i.elapsedTimeMs=Date.now()-d,t){try{s.remove(a)}catch(e){t=!1,n="Remote Ok BUT error deleting "+a.length+" from store!!! "+e}for(let e=0;e<l.length;e++)s.add(l[e].subject,l[e].predicate,l[e].object,u)}if(r(e,t,n,i),h.pendingUpstream-=1,0===h.pendingUpstream&&h.downstreamAction){var o=h.downstreamAction;delete h.downstreamAction,o(u)}}),i)}else if(g.indexOf("DAV")>=0)this.updateDav(u,a,l,r,i);else{if(!(g.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+g+"' for "+u);try{this.updateLocalFile(u,a,l,r,i)}catch(e){r(u.value,!1,"Exception trying to write back file <"+u.value+">\n")}}}catch(e){r(void 0,!1,"Exception in update: "+e+"\n"+S.stackString(e))}}updateDav(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store;var s=o.any(e,this.ns.link("request"));if(!s)throw new Error("No record of our HTTP GET request for document: "+e);var a=o.any(s,this.ns.link("response"));if(!a)return null;var l=o.the(a,this.ns.httph("content-type")).value;let c=o.statementsMatching(void 0,void 0,void 0,e).slice();for(let e=0;e<t.length;e++)S.RDFArrayRemove(c,t[e]);for(let e=0;e<r.length;e++)c.push(r[e]);const u=this.serialize(e.value,c,l);var h,d=o.the(a,this.ns.httph("content-location"));return d&&(h=(0,x.join)(d.value,h)),i.contentType=l,i.noMeta=!0,i.body=u,o.fetcher.webOperation("PUT",h,i).then((i=>{if(!i.ok)throw new Error(i.error);for(let e=0;e<t.length;e++)o.remove(t[e]);for(let t=0;t<r.length;t++)o.add(r[t].subject,r[t].predicate,r[t].object,e);n(e.value,i.ok,i.responseText,i)})).catch((t=>{n(e.value,!1,t.message,t)}))}updateLocalFile(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=this.store;let s=o.statementsMatching(void 0,void 0,void 0,e).slice();for(let e=0;e<t.length;e++)S.RDFArrayRemove(s,t[e]);for(let e=0;e<r.length;e++)s.push(r[e]);var a=e.value.lastIndexOf(".");if(a<1)throw new Error("Rewriting file: No filename extension: "+e.value);var l=e.value.slice(a+1);let c=Dt.CONTENT_TYPE_BY_EXT[l];if(!c)throw new Error("File extension ."+l+" not supported for data write");i.body=this.serialize(e.value,s,c),i.contentType=c,o.fetcher.webOperation("PUT",e.value,i).then((i=>{if(!i.ok)return n(e.value,!1,i.error);for(let e=0;e<t.length;e++)o.remove(t[e]);for(let t=0;t<r.length;t++)o.add(r[t].subject,r[t].predicate,r[t].object,e);n(e.value,!0,"")}))}serialize(e,t,r){const n=this.store;let i;if("string"==typeof t)return t;var o=L(n);switch(o.suggestNamespaces(n.namespaces),o.setBase(e),r){case"text/xml":case"application/rdf+xml":i=o.statementsToXML(t);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":i=o.statementsToN3(t);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return i}put(e,t,r,n){const i=this.store;let o;return Promise.resolve().then((()=>(o=this.serialize(e.value,t,r),i.fetcher.webOperation("PUT",e.value,{contentType:r,body:o})))).then((r=>{if(!r.ok)return n(e.value,r.ok,r.error,r);delete i.fetcher.nonexistent[e.value],delete i.fetcher.requested[e.value],"string"!=typeof t&&t.map((e=>{i.addStatement(e)})),n(e.value,r.ok,"",r)})).catch((t=>{n(e.value,!1,t.message)}))}reload(e,t,r){var n=Date.now();e.fetcher.nowOrWhenFetched(t.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(e,i,o){if(e)if(o.onErrorWasCalled||200!==o.status)r(!1,"Non-HTTP error reloading data: "+i,o);else{var s=Date.now()-n;t.reloadTimeTotal||(t.reloadTimeTotal=0),t.reloadTimeCount||(t.reloadTimeCount=0),t.reloadTimeTotal+=s,t.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,o)}))}}const Ut={...Ne,fetcher:(e,t)=>new Dt(e,t),graph(){return new K(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,(arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)||{rdfFactory:Ne})},lit(e,t,r){return this.literal(""+e,t||r)},st(e,t,r,n){return this.quad(e,t,r,n)}},Bt=Ut;class qt{constructor(e,t){this.parent=e,this.via=t,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(t),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(e){this.onError(e)}}_decode(e){var t,r,n,i,o,s,a;for(r in i={},o=function(){var r,n,i,o;for(o=[],r=0,n=(i=e.split("&")).length;r<n;r++)t=i[r],o.push(t.split("="));return o}())t=o[r],a=(s=[decodeURIComponent(t[0]),decodeURIComponent(t[1])])[1],null==i[n=s[0]]&&(i[n]=[]),i[n].push(a);return i}_send(e,t,r){var n,i;return i=[e,t,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}_subscribe(e){return this._send("sub",e,""),this.subscribed[e]=!0,this.subscribed[e]}onClose(e){var t;for(t in this.connected=!1,this.subscribed)this.pending[t]=!0;return this.subscribed={},this.subscribed}onError(e){throw new Error("onError"+e)}onMessage(e){var t,r;return"ping"===(r=e.data.split(" "))[0]?"function"==typeof(t=this.socket).send?t.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}onOpen(e){var t,r;for(r in this.connected=!0,t=[],this.pending)delete this.pending[r],t.push(this._subscribe(r));return t}subscribe(e){return this.connected?this._subscribe(e):(this.pending[e]=!0,this.pending[e])}}class Ht{constructor(e){this.fetcher=e,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}onHeaders(e){var t,r,n;return null==e.headers||"undefined"==typeof WebSocket||null===WebSocket||(t=e.headers.etag,n=e.headers["updates-via"],r=e.uri,t&&n&&(this.graph[r]={etag:t,via:n},this.register(n,r))),!0}onUpdate(e,t){return this.fetcher.refresh(Bt.namedNode(e))}register(e,t){return null==this.via[e]&&(this.via[e]=new qt(this,e)),this.via[e].subscribe(t)}}const Zt={};for(const e in Bt)"function"==typeof Bt[e]&&(Zt[e]=Bt[e].bind(Bt));const{fetcher:$t,graph:zt,lit:Vt,st:Xt,namedNode:Jt,variable:Gt,blankNode:Wt,defaultGraph:Qt,literal:Yt,quad:Kt,triple:er}=Zt,tr=new Z,rr=e=>tr.fromNT(e),nr=$.fromValue,ir=a.nextId;class or extends K{constructor(t){super(t),(0,e.Z)(this,"fetcher",void 0),this.fetcher=new Dt(this,{})}}class sr extends or{constructor(t){super(t),(0,e.Z)(this,"updater",void 0),this.updater=new Mt(this)}}})(),i})()));
|
|
3
3
|
//# sourceMappingURL=rdflib.min.js.map
|