rdflib 2.3.0 → 2.3.1

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.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see rdflib.min.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("window")):"function"==typeof define&&define.amd?define(["window"],e):"object"==typeof exports?exports.$rdf=e(require("window")):t.$rdf=e(t.window)}(self,(t=>(()=>{var e,r,n,i,s={78:t=>{"use strict";t.exports=Function.prototype.call},182:(t,e,r)=>{"use strict";var n=r(9964),i=r(6357);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}var o,a,c=r(5403).codes,u=c.ERR_AMBIGUOUS_ARGUMENT,l=c.ERR_INVALID_ARG_TYPE,h=c.ERR_INVALID_ARG_VALUE,f=c.ERR_INVALID_RETURN_VALUE,p=c.ERR_MISSING_ARGS,d=r(5416),y=r(7187).inspect,g=r(7187).types,m=g.isPromise,b=g.isRegExp,w=Object.assign?Object.assign:r(6713).assign,v=Object.is?Object.is:r(8527);function x(){var t=r(6781);o=t.isDeepEqual,a=t.isDeepStrictEqual}new Map;var _=!1,A=t.exports=O,T={};function E(t){if(t.message instanceof Error)throw t.message;throw new d(t)}function N(t,e,r,n){if(!r){var i=!1;if(0===e)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var s=new d({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw s.generatedMessage=i,s}}function O(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];N.apply(void 0,[O,e.length].concat(e))}A.fail=function t(e,r,s,o,a){var c,u=arguments.length;if(0===u?c="Failed":1===u?(s=e,e=void 0):(!1===_&&(_=!0,(n.emitWarning?n.emitWarning:i.warn.bind(i))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===u&&(o="!=")),s instanceof Error)throw s;var l={actual:e,expected:r,operator:void 0===o?"fail":o,stackStartFn:a||t};void 0!==s&&(l.message=s);var h=new d(l);throw c&&(h.message=c,h.generatedMessage=!0),h},A.AssertionError=d,A.ok=O,A.equal=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e!=r&&E({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},A.notEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e==r&&E({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},A.deepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===o&&x(),o(e,r)||E({actual:e,expected:r,message:n,operator:"deepEqual",stackStartFn:t})},A.notDeepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===o&&x(),o(e,r)&&E({actual:e,expected:r,message:n,operator:"notDeepEqual",stackStartFn:t})},A.deepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===o&&x(),a(e,r)||E({actual:e,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:t})},A.notDeepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===o&&x(),a(e,r)&&E({actual:e,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:t})},A.strictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");v(e,r)||E({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},A.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");v(e,r)&&E({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var j=function t(e,r,n){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.forEach((function(t){t in e&&(void 0!==n&&"string"==typeof n[t]&&b(e[t])&&e[t].test(n[t])?i[t]=n[t]:i[t]=e[t])}))};function S(t,e,r,n){if("function"!=typeof e){if(b(e))return e.test(t);if(2===arguments.length)throw new l("expected",["Function","RegExp"],e);if("object"!==s(t)||null===t){var i=new d({actual:t,expected:e,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var c=Object.keys(e);if(e instanceof Error)c.push("name","message");else if(0===c.length)throw new h("error",e,"may not be an empty object");return void 0===o&&x(),c.forEach((function(i){"string"==typeof t[i]&&b(e[i])&&e[i].test(t[i])||function(t,e,r,n,i,s){if(!(r in t)||!a(t[r],e[r])){if(!n){var o=new j(t,i),c=new j(e,i,t),u=new d({actual:o,expected:c,operator:"deepStrictEqual",stackStartFn:s});throw u.actual=t,u.expected=e,u.operator=s.name,u}E({actual:t,expected:e,message:n,operator:s.name,stackStartFn:s})}}(t,e,i,r,c,n)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function R(t){if("function"!=typeof t)throw new l("fn","Function",t);try{t()}catch(t){return t}return T}function k(t){return m(t)||null!==t&&"object"===s(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function I(t){return Promise.resolve().then((function(){var e;if("function"==typeof t){if(!k(e=t()))throw new f("instance of Promise","promiseFn",e)}else{if(!k(t))throw new l("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return T})).catch((function(t){return t}))}))}function C(t,e,r,n){if("string"==typeof r){if(4===arguments.length)throw new l("error",["Object","Error","Function","RegExp"],r);if("object"===s(e)&&null!==e){if(e.message===r)throw new u("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===r)throw new u("error/message",'The error "'.concat(e,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==s(r)&&"function"!=typeof r)throw new l("error",["Object","Error","Function","RegExp"],r);if(e===T){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var o="rejects"===t.name?"rejection":"exception";E({actual:void 0,expected:r,operator:t.name,message:"Missing expected ".concat(o).concat(i),stackStartFn:t})}if(r&&!S(e,r,n,t))throw e}function P(t,e,r,n){if(e!==T){if("string"==typeof r&&(n=r,r=void 0),!r||S(e,r)){var i=n?": ".concat(n):".",s="doesNotReject"===t.name?"rejection":"exception";E({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(s).concat(i,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function F(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];N.apply(void 0,[F,e.length].concat(e))}A.throws=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];C.apply(void 0,[t,R(e)].concat(n))},A.rejects=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return I(e).then((function(e){return C.apply(void 0,[t,e].concat(n))}))},A.doesNotThrow=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];P.apply(void 0,[t,R(e)].concat(n))},A.doesNotReject=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return I(e).then((function(e){return P.apply(void 0,[t,e].concat(n))}))},A.ifError=function t(e){if(null!=e){var r="ifError got unwanted exception: ";"object"===s(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?r+=e.constructor.name:r+=e.message:r+=y(e);var n=new d({actual:e,expected:null,operator:"ifError",message:r,stackStartFn:t}),i=e.stack;if("string"==typeof i){var o=i.split("\n");o.shift();for(var a=n.stack.split("\n"),c=0;c<o.length;c++){var u=a.indexOf(o[c]);if(-1!==u){a=a.slice(0,u);break}}n.stack="".concat(a.join("\n"),"\n").concat(o.join("\n"))}throw n}},A.strict=w(F,A,{equal:A.strictEqual,deepEqual:A.deepStrictEqual,notEqual:A.notStrictEqual,notDeepEqual:A.notDeepStrictEqual}),A.strict.strict=A.strict},362:(t,e,r)=>{"use strict";function n(t){return"string"==typeof t?t:t.value}r.d(e,{E:()=>n})},546:(t,e,r)=>{"use strict";r.d(e,{CZ:()=>c,D0:()=>h,DJ:()=>a,DZ:()=>l,GE:()=>b,P3:()=>o,RN:()=>w,SH:()=>i,Y2:()=>d,YC:()=>m,aF:()=>p,c$:()=>f,fY:()=>u,hr:()=>g,jt:()=>y,ok:()=>s});var n=r(6866);function i(t){return"object"==typeof t&&null!==t&&"subject"in t}function s(t){return"object"==typeof t&&null!==t&&"statements"in t}function o(t){return h(t)&&t.termType===n.r0}function a(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===n.Kk||t.termType===n.P2||t.termType===n.$Q||t.termType===n.r0||t.termType===n.QW||t.termType===n.bD)}function c(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===n.Kk||t.termType===n.P2||t.termType===n.$Q||t.termType===n.r0||t.termType===n.QW||t.termType===n.bD)}function u(t){return h(t)&&(t.termType===n.Kk||t.termType===n.$Q||t.termType===n.P2)}function l(t){return h(t)&&t.termType===n.P2}function h(t){return"object"==typeof t&&null!==t&&"termType"in t}function f(t){return t.termType===n.QW}function p(t){return"object"==typeof t&&null!==t&&"subject"in t&&"predicate"in t&&"object"in t}function d(t){return h(t)&&"NamedNode"===t.termType}function y(t){return h(t)&&"termType"in t&&"BlankNode"===t.termType}function g(t){return h(t)&&(t.termType===n.Kk||t.termType===n.P2||t.termType===n.$Q)}function m(t){return h(t)&&(t.termType===n.Kk||t.termType===n.P2)}function b(t){return h(t)&&(t.termType===n.Kk||t.termType===n.P2||t.termType===n.$Q||t.termType===n.QW)}function w(t){return h(t)&&(t.termType===n.Kk||t.termType===n.P2||t.termType===n.$Q||t.termType===n.ic)}},713:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},716:t=>{"use strict";t.exports=Math.abs},821:(t,e,r)=>{"use strict";var n=r(884),i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof i[n[e]]&&(t[t.length]=n[e]);return t}},884:t=>{"use strict";t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},939:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,{A:()=>i})},1147:(t,e,r)=>{var n=r(6357),i="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g,s=function(){function t(){this.fetch=!1,this.DOMException=i.DOMException}return t.prototype=i,new t}();!function(t){!function(e){var i=void 0!==t&&t||"undefined"!=typeof self&&self||void 0!==r.g&&r.g||{},s="URLSearchParams"in i,o="Symbol"in i&&"iterator"in Symbol,a="FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch(t){return!1}}(),c="FormData"in i,u="ArrayBuffer"in i;if(u)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(t){return t&&l.indexOf(Object.prototype.toString.call(t))>-1};function f(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function p(t){return"string"!=typeof t&&(t=String(t)),t}function d(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o&&(e[Symbol.iterator]=function(){return e}),e}function y(t){this.map={},t instanceof y?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function g(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function m(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function b(t){var e=new FileReader,r=m(e);return e.readAsArrayBuffer(t),r}function w(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:a&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:c&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:s&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():u&&a&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=w(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(t)||h(t))?this._bodyArrayBuffer=w(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var t=g(this);if(t)return t;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(){if(this._bodyArrayBuffer)return g(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(a)return this.blob().then(b);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,r,n,i,s=g(this);if(s)return s;if(this._bodyBlob)return t=this._bodyBlob,r=m(e=new FileReader),i=(n=/charset=([A-Za-z0-9_-]+)/.exec(t.type))?n[1]:"utf-8",e.readAsText(t,i),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c&&(this.formData=function(){return this.text().then(A)}),this.json=function(){return this.text().then(JSON.parse)},this}y.prototype.append=function(t,e){t=f(t),e=p(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},y.prototype.delete=function(t){delete this.map[f(t)]},y.prototype.get=function(t){return t=f(t),this.has(t)?this.map[t]:null},y.prototype.has=function(t){return this.map.hasOwnProperty(f(t))},y.prototype.set=function(t,e){this.map[f(t)]=p(e)},y.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},y.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),d(t)},y.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),d(t)},y.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),d(t)},o&&(y.prototype[Symbol.iterator]=y.prototype.entries);var x=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function _(t,e){if(!(this instanceof _))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n,s=(e=e||{}).body;if(t instanceof _){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new y(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,s||null==t._bodyInit||(s=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new y(e.headers)),this.method=(n=(r=e.method||this.method||"GET").toUpperCase(),x.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in i)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function A(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function T(t,e){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new y(e.headers),this.url=e.url||"",this._initBody(t)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},v.call(_.prototype),v.call(T.prototype),T.prototype.clone=function(){return new T(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},T.error=function(){var t=new T(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var E=[301,302,303,307,308];T.redirect=function(t,e){if(-1===E.indexOf(e))throw new RangeError("Invalid status code");return new T(null,{status:e,headers:{location:t}})},e.DOMException=i.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function N(t,r){return new Promise((function(s,o){var c=new _(t,r);if(c.signal&&c.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function h(){l.abort()}if(l.onload=function(){var t,e,r={statusText:l.statusText,headers:(t=l.getAllResponseHeaders()||"",e=new y,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),i=r.shift().trim();if(i){var s=r.join(":").trim();try{e.append(i,s)}catch(t){n.warn("Response "+t.message)}}})),e)};0===c.url.indexOf("file://")&&(l.status<200||l.status>599)?r.status=200:r.status=l.status,r.url="responseURL"in l?l.responseURL:r.headers.get("X-Request-URL");var i="response"in l?l.response:l.responseText;setTimeout((function(){s(new T(i,r))}),0)},l.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},l.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request timed out"))}),0)},l.onabort=function(){setTimeout((function(){o(new e.DOMException("Aborted","AbortError"))}),0)},l.open(c.method,function(t){try{return""===t&&i.location.href?i.location.href:t}catch(e){return t}}(c.url),!0),"include"===c.credentials?l.withCredentials=!0:"omit"===c.credentials&&(l.withCredentials=!1),"responseType"in l&&(a?l.responseType="blob":u&&(l.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof y||i.Headers&&r.headers instanceof i.Headers)){var d=[];Object.getOwnPropertyNames(r.headers).forEach((function(t){d.push(f(t)),l.setRequestHeader(t,p(r.headers[t]))})),c.headers.forEach((function(t,e){-1===d.indexOf(e)&&l.setRequestHeader(e,t)}))}else c.headers.forEach((function(t,e){l.setRequestHeader(e,t)}));c.signal&&(c.signal.addEventListener("abort",h),l.onreadystatechange=function(){4===l.readyState&&c.signal.removeEventListener("abort",h)}),l.send(void 0===c._bodyInit?null:c._bodyInit)}))}N.polyfill=!0,i.fetch||(i.fetch=N,i.Headers=y,i.Request=_,i.Response=T),e.Headers=y,e.Request=_,e.Response=T,e.fetch=N,Object.defineProperty(e,"__esModule",{value:!0})}({})}(s),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var o=i.fetch?i:s;(e=o.fetch).default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e},1201:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},1320:(t,e,r)=>{"use strict";var n=r(2621);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},1605:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(939);class i{constructor(t){(0,n.A)(this,"termType",void 0),(0,n.A)(this,"classOrder",void 0),(0,n.A)(this,"value",void 0),this.value=t}substitute(t){return this}compareTerm(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.value<t.value?-1:this.value>t.value?1:0}equals(t){return!!t&&this.termType===t.termType&&this.value===t.value}hashString(){return this.toCanonical()}sameTerm(t){return this.equals(t)}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.A)(i,"fromValue",void 0),(0,n.A)(i,"toJS",void 0)},1909:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},2312:function(t,e){var r,n;void 0===(n="function"==typeof(r=function(){"use strict";function t(e,r,n,i){this.message=e,this.expected=r,this.found=n,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}return function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(t,Error),t.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e,r="";for(e=0;e<t.parts.length;e++)r+=t.parts[e]instanceof Array?s(t.parts[e][0])+"-"+s(t.parts[e][1]):s(t.parts[e]);return"["+(t.inverted?"^":"")+r+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(t){return t.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(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function s(t){return t.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(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}return"Expected "+function(t){var e,n,i,s=new Array(t.length);for(e=0;e<t.length;e++)s[e]=(i=t[e],r[i.type](i));if(s.sort(),s.length>0){for(e=1,n=1;e<s.length;e++)s[e-1]!==s[e]&&(s[n]=s[e],n++);s.length=n}switch(s.length){case 1:return s[0];case 2:return s[0]+" or "+s[1];default:return s.slice(0,-1).join(", ")+", or "+s[s.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."},{SyntaxError:t,parse:function(e,r){r=void 0!==r?r:{};var n,i={},s={turtleDoc:Qr},o=Qr,a=function(t){var e=Tn.toJSON();return e["@graph"]=[],t.filter((t=>Array.isArray(t))).forEach((t=>{t.forEach((t=>{e["@graph"].push(t)}))})),1===e["@graph"].length&&(Object.assign(e,e["@graph"][0]),delete e["@graph"]),e},c="\ufeff",u=Hr("\ufeff",!1),l=".",h=Hr(".",!1),f=function(t){return t},p="#",d=Hr("#",!1),y=/^[^\n]/,g=zr(["\n"],!0,!1),m="\n",b=Hr("\n",!1),w=function(t){return t.join("")},v="@prefix",x=Hr("@prefix",!1),_=function(t,e){return Tn.addPrefix(""===t?"0":t,e),{}},A="@base",T=Hr("@base",!1),E=function(t){return Tn.addBase(t),{}},N=/^[Bb]/,O=zr(["B","b"],!1,!1),j=/^[Aa]/,S=zr(["A","a"],!1,!1),R=/^[Ss]/,k=zr(["S","s"],!1,!1),I=/^[Ee]/,C=zr(["E","e"],!1,!1),P=/^[Pp]/,F=zr(["P","p"],!1,!1),U=/^[Rr]/,D=zr(["R","r"],!1,!1),M=/^[Ff]/,L=zr(["F","f"],!1,!1),B=/^[Ii]/,q=zr(["I","i"],!1,!1),$=/^[Xx]/,H=zr(["X","x"],!1,!1),z=function(t,e){var r={};return"string"==typeof t&&"[]"!==t?r["@id"]=t:"object"==typeof t&&Object.assign(r,t),e&&Object.assign(r,e),[r]},X=function(t,e){var r={};return t&&Object.assign(r,t),e&&Object.assign(r,e),[r]},V=";",G=Hr(";",!1),Q=function(t,e,r,n){var i={};return i[r]=n,i},W=function(t,e,r){return r},J=function(t,e,r){var n={};return r.unshift(function(t,e){var r={};return r[t]=e,r}(t,e)),r.forEach((t=>{t&&Object.keys(t).forEach((e=>{t[e].forEach((t=>{"@type"===e&&void 0!==t["@id"]&&(t=t["@id"]),void 0===n[e]?n[e]=t:Array.isArray(n[e])?n[e].push(t):n[e]=[n[e],t]}))}))})),n},Y=",",Z=Hr(",",!1),K=function(t,e){return e},tt=function(t,e){return e.unshift(t),e},et="a",rt=Hr("a",!1),nt=function(){return"@type"},it=function(t){return En(t,!0)},st=function(t){return En(t,!1)},ot=function(t){return"[]"===t?{}:{"@id":t}},at=function(t){return{"@id":t}},ct="[",ut=Hr("[",!1),lt="]",ht=Hr("]",!1),ft="(",pt=Hr("(",!1),dt=")",yt=Hr(")",!1),gt=function(t){return{"@list":t}},mt=function(t,e){return{"@value":t,"@language":e}},bt="^^",wt=Hr("^^",!1),vt=function(t,e){if("http://www.w3.org/2001/XMLSchema#boolean"===e&&"true"===t)return!0;if("http://www.w3.org/2001/XMLSchema#boolean"===e&&"false"===t)return!1;if("http://www.w3.org/2001/XMLSchema#integer"===e)return parseInt(t);if("http://www.w3.org/2001/XMLSchema#double"===e)return parseFloat(t);const r=Tn.resolve(e,!0);if(r){const n=e.split(":")[0];if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"true"===t)return Tn.decrement(n),!0;if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"false"===t)return Tn.decrement(n),!1;if("http://www.w3.org/2001/XMLSchema#integer"===r)return Tn.decrement(n),parseInt(t);if("http://www.w3.org/2001/XMLSchema#double"===r)return Tn.decrement(n),parseFloat(t)}return{"@value":t,"@type":e}},xt="true",_t=Hr("true",!1),At=function(){return!0},Tt="false",Et=Hr("false",!1),Nt=function(){return!1},Ot=function(t){return t+":"},jt="<",St=Hr("<",!1),Rt=/^[^\0- <>"{}|\^`\\]/,kt=zr([["\0"," "],"<",">",'"',"{","}","|","^","`","\\"],!0,!1),It=">",Ct=Hr(">",!1),Pt=function(t){const e=t.map((t=>65536<=t.codePointAt(0)&&t.codePointAt(0)<=983039?"a":1===t.length?t:6===t.length?String.fromCharCode("0x"+t.substring(2)):10===t.length?String.fromCodePoint("0x"+t.substring(2)):t)).join("");if(e.match(/^[^\u0000-\u0020<>"{}|^`\\]*$/)){var r=t.join("");try{return Tn.resolve(r)}catch(t){$r("Invalid IRIREF "+r)}}else $r("Invalid IRIREF "+t.join("")+" / "+e)},Ft=":",Ut=Hr(":",!1),Dt=function(t){return t=t||"0",!1===Tn.hasPrefix(t)&&$r("undefined prefix "+t),t},Mt=function(t){return t||""},Lt=function(t,e){return Tn.increment(t),Tn.resolve(t+":"+e)},Bt="_:",qt=Hr("_:",!1),$t=/^[0-9]/,Ht=zr([["0","9"]],!1,!1),zt="@",Xt=Hr("@",!1),Vt=/^[a-zA-Z]/,Gt=zr([["a","z"],["A","Z"]],!1,!1),Qt="-",Wt=Hr("-",!1),Jt=/^[a-zA-Z0-9]/,Yt=zr([["a","z"],["A","Z"],["0","9"]],!1,!1),Zt=function(t,e){return"-"+e.join("")},Kt=function(t,e){return t.join("")+e.join("")},te=/^[+\-]/,ee=zr(["+","-"],!1,!1),re=function(t){return t.match(/^[0+][0-9]+$/)?{"@value":t,"@type":"http://www.w3.org/2001/XMLSchema#integer"}:parseInt(t)},ne=function(t){return{"@value":t,"@type":"http://www.w3.org/2001/XMLSchema#decimal"}},ie=function(t){return{"@value":t,"@type":"http://www.w3.org/2001/XMLSchema#double"}},se=/^[eE]/,oe=zr(["e","E"],!1,!1),ae='"',ce=Hr('"',!1),ue=/^[^"\\\n\r]/,le=zr(['"',"\\","\n","\r"],!0,!1),he="'",fe=Hr("'",!1),pe=/^[^'\\\n\r]/,de=zr(["'","\\","\n","\r"],!0,!1),ye="'''",ge=Hr("'''",!1),me=/^[^'\\]/,be=zr(["'","\\"],!0,!1),we="''",ve=Hr("''",!1),xe=function(t,e){return"''"+e.join("")},_e=function(t,e){return"'"+e.join("")},Ae=function(t,e){return t.join("")+e.join("")},Te='"""',Ee=Hr('"""',!1),Ne=/^[^"\\]/,Oe=zr(['"',"\\"],!0,!1),je='""',Se=Hr('""',!1),Re=function(t,e){return'""'+e.join("")},ke=function(t,e){return'"'+e.join("")},Ie="\\U",Ce=Hr("\\U",!1),Pe=function(t){return String.fromCodePoint(parseInt(t.join(""),16))},Fe="\\u",Ue=Hr("\\u",!1),De=function(t){return String.fromCharCode(parseInt(t.join(""),16))},Me="\\t",Le=Hr("\\t",!1),Be=function(){return"\t"},qe="\\b",$e=Hr("\\b",!1),He=function(){return"\b"},ze="\\n",Xe=Hr("\\n",!1),Ve=function(){return"\n"},Ge="\\r",Qe=Hr("\\r",!1),We=function(){return"\r"},Je="\\f",Ye=Hr("\\f",!1),Ze=function(){return"\f"},Ke='\\"',tr=Hr('\\"',!1),er=function(){return'"'},rr="\\'",nr=Hr("\\'",!1),ir=function(){return"'"},sr="\\\\",or=Hr("\\\\",!1),ar=function(){return"\\"},cr=/^[ \t\r\n]/,ur=zr([" ","\t","\r","\n"],!1,!1),lr=function(){return"[]"},hr=/^[\uD800-\uDBFF]/,fr=zr([["\ud800","\udbff"]],!1,!1),pr=/^[\uDC00-\uDFFF]/,dr=zr([["\udc00","\udfff"]],!1,!1),yr=function(t,e){return t+e},gr=/^[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]/,mr=zr([["A","Z"],["a","z"],["À","Ö"],["Ø","ö"],["ø","˿"],["Ͱ","ͽ"],["Ϳ","῿"],["‌","‍"],["⁰","↏"],["Ⰰ","⿯"],["、","퟿"],["豈","﷏"],["ﷰ","�"]],!1,!1),br="_",wr=Hr("_",!1),vr="·",xr=Hr("·",!1),_r=/^[\u0300-\u036F]/,Ar=zr([["̀","ͯ"]],!1,!1),Tr=/^[\u203F-\u2040]/,Er=zr([["‿","⁀"]],!1,!1),Nr=function(t,e,r,n){return r.join("")+n.join("")},Or=function(t,e,r){return t+e.join("")+r.join("")},jr="%",Sr=Hr("%",!1),Rr=/^[0-9A-Fa-f]/,kr=zr([["0","9"],["A","F"],["a","f"]],!1,!1),Ir="\\",Cr=Hr("\\",!1),Pr=/^[_~.!$&'()*+,;=\/?#@%\-]/,Fr=zr(["_","~",".","!","$","&","'","(",")","*","+",",",";","=","/","?","#","@","%","-"],!1,!1),Ur=0,Dr=0,Mr=[{line:1,column:1}],Lr=0,Br=[],qr=0;if("startRule"in r){if(!(r.startRule in s))throw new Error("Can't start parsing from rule \""+r.startRule+'".');o=s[r.startRule]}function $r(e,r){throw function(e,r){return new t(e,null,null,r)}(e,r=void 0!==r?r:Vr(Dr,Ur))}function Hr(t,e){return{type:"literal",text:t,ignoreCase:e}}function zr(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Xr(t){var r,n=Mr[t];if(n)return n;for(r=t-1;!Mr[r];)r--;for(n={line:(n=Mr[r]).line,column:n.column};r<t;)10===e.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Mr[t]=n,n}function Vr(t,e){var r=Xr(t),n=Xr(e);return{start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function Gr(t){Ur<Lr||(Ur>Lr&&(Lr=Ur,Br=[]),Br.push(t))}function Qr(){var t,e,r,n,s;for(t=Ur,e=[],r=Wr();r!==i;)e.push(r),r=Wr();if(e!==i){for(r=[],n=Jr();n!==i;)r.push(n),n=Jr();if(r!==i){for(n=[],s=Yr();s!==i;)n.push(s),s=Yr();n!==i?(Dr=t,t=e=a(r)):(Ur=t,t=i)}else Ur=t,t=i}else Ur=t,t=i;return t}function Wr(){var t;return 65279===e.charCodeAt(Ur)?(t=c,Ur++):(t=i,0===qr&&Gr(u)),t}function Jr(){var t,r,n,s;if((t=function(){var t;return(t=function(){var t,r,n,s,o,a,c,u,f;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if(e.substr(Ur,7)===v?(n=v,Ur+=7):(n=i,0===qr&&Gr(x)),n!==i){for(s=[],o=Yr();o!==i;)s.push(o),o=Yr();if(s!==i)if((o=ln())!==i){for(a=[],c=Yr();c!==i;)a.push(c),c=Yr();if(a!==i)if((c=cn())!==i){for(u=[],f=Yr();f!==i;)u.push(f),f=Yr();u!==i?(46===e.charCodeAt(Ur)?(f=l,Ur++):(f=i,0===qr&&Gr(h)),f!==i?(Dr=t,t=r=_(o,c)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i}else Ur=t,t=i;else Ur=t,t=i}else Ur=t,t=i;else Ur=t,t=i;return t}())===i&&(t=function(){var t,r,n,s,o,a,c;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if(e.substr(Ur,5)===A?(n=A,Ur+=5):(n=i,0===qr&&Gr(T)),n!==i){for(s=[],o=Yr();o!==i;)s.push(o),o=Yr();if(s!==i)if((o=cn())!==i){for(a=[],c=Yr();c!==i;)a.push(c),c=Yr();a!==i?(46===e.charCodeAt(Ur)?(c=l,Ur++):(c=i,0===qr&&Gr(h)),c!==i?(Dr=t,t=r=E(o)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i}else Ur=t,t=i;else Ur=t,t=i;return t}())===i&&(t=function(){var t,r,n,s,o,a,c,u,l,h,f,p;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if(P.test(e.charAt(Ur))?(n=e.charAt(Ur),Ur++):(n=i,0===qr&&Gr(F)),n!==i)if(U.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(D)),s!==i)if(I.test(e.charAt(Ur))?(o=e.charAt(Ur),Ur++):(o=i,0===qr&&Gr(C)),o!==i)if(M.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(L)),a!==i)if(B.test(e.charAt(Ur))?(c=e.charAt(Ur),Ur++):(c=i,0===qr&&Gr(q)),c!==i)if($.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(H)),u!==i){for(l=[],h=Yr();h!==i;)l.push(h),h=Yr();if(l!==i)if((h=ln())!==i){for(f=[],p=Yr();p!==i;)f.push(p),p=Yr();f!==i&&(p=cn())!==i?(Dr=t,t=r=_(h,p)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i}else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;return t}())===i&&(t=function(){var t,r,n,s,o,a,c,u;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if(N.test(e.charAt(Ur))?(n=e.charAt(Ur),Ur++):(n=i,0===qr&&Gr(O)),n!==i)if(j.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(S)),s!==i)if(R.test(e.charAt(Ur))?(o=e.charAt(Ur),Ur++):(o=i,0===qr&&Gr(k)),o!==i)if(I.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(C)),a!==i){for(c=[],u=Yr();u!==i;)c.push(u),u=Yr();c!==i&&(u=cn())!==i?(Dr=t,t=r=E(u)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;return t}()),t}())===i)if(t=Ur,(r=function(){var t,e,r;return t=Ur,(e=function(){var t,e;return t=Ur,(e=nn())!==i&&(Dr=t,e=it(e)),(t=e)===i&&(t=an())===i&&(t=on()),t}())!==i&&(r=Zr())!==i?(Dr=t,t=e=z(e,r)):(Ur=t,t=i),t===i&&(t=Ur,(e=rn())!==i?((r=Zr())===i&&(r=null),r!==i?(Dr=t,t=e=X(e,r)):(Ur=t,t=i)):(Ur=t,t=i)),t}())!==i){for(n=[],s=Yr();s!==i;)n.push(s),s=Yr();n!==i?(46===e.charCodeAt(Ur)?(s=l,Ur++):(s=i,0===qr&&Gr(h)),s!==i?(Dr=t,t=r=f(r)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;return t}function Yr(){var t;return(t=function(){var t;return cr.test(e.charAt(Ur))?(t=e.charAt(Ur),Ur++):(t=i,0===qr&&Gr(ur)),t}())===i&&(t=function(){var t,r,n,s;if(t=Ur,35===e.charCodeAt(Ur)?(r=p,Ur++):(r=i,0===qr&&Gr(d)),r!==i){for(n=[],y.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(g));s!==i;)n.push(s),y.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(g));n!==i?(10===e.charCodeAt(Ur)?(s=m,Ur++):(s=i,0===qr&&Gr(b)),s!==i?(Dr=t,t=r=w(n)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;return t}()),t}function Zr(){var t,r,n,s,o,a,c,u,l,h;if(t=Ur,(r=tn())!==i)if((n=Kr())!==i){for(s=[],o=Ur,a=[],c=Yr();c!==i;)a.push(c),c=Yr();for(a!==i?(59===e.charCodeAt(Ur)?(c=V,Ur++):(c=i,0===qr&&Gr(G)),c!==i?(u=Ur,(l=tn())!==i&&(h=Kr())!==i?(Dr=u,u=l=Q(r,n,l,h)):(Ur=u,u=i),u===i&&(u=null),u!==i?(Dr=o,o=a=W(r,n,u)):(Ur=o,o=i)):(Ur=o,o=i)):(Ur=o,o=i);o!==i;){for(s.push(o),o=Ur,a=[],c=Yr();c!==i;)a.push(c),c=Yr();a!==i?(59===e.charCodeAt(Ur)?(c=V,Ur++):(c=i,0===qr&&Gr(G)),c!==i?(u=Ur,(l=tn())!==i&&(h=Kr())!==i?(Dr=u,u=l=Q(r,n,l,h)):(Ur=u,u=i),u===i&&(u=null),u!==i?(Dr=o,o=a=W(r,n,u)):(Ur=o,o=i)):(Ur=o,o=i)):(Ur=o,o=i)}s!==i?(Dr=t,t=r=J(r,n,s)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i;return t}function Kr(){var t,r,n,s,o,a,c;if(t=Ur,(r=en())!==i){for(n=[],s=Ur,o=[],a=Yr();a!==i;)o.push(a),a=Yr();for(o!==i?(44===e.charCodeAt(Ur)?(a=Y,Ur++):(a=i,0===qr&&Gr(Z)),a!==i&&(c=en())!==i?(Dr=s,s=o=K(r,c)):(Ur=s,s=i)):(Ur=s,s=i);s!==i;){for(n.push(s),s=Ur,o=[],a=Yr();a!==i;)o.push(a),a=Yr();o!==i?(44===e.charCodeAt(Ur)?(a=Y,Ur++):(a=i,0===qr&&Gr(Z)),a!==i&&(c=en())!==i?(Dr=s,s=o=K(r,c)):(Ur=s,s=i)):(Ur=s,s=i)}n!==i?(Dr=t,t=r=tt(r,n)):(Ur=t,t=i)}else Ur=t,t=i;return t}function tn(){var t,r,n;if(t=Ur,(r=function(){var t,e,r;for(t=Ur,e=[],r=Yr();r!==i;)e.push(r),r=Yr();return e!==i&&(r=on())!==i?(Dr=t,t=e=f(r)):(Ur=t,t=i),t}())!==i&&(Dr=t,r=f(r)),(t=r)===i){for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();r!==i?(97===e.charCodeAt(Ur)?(n=et,Ur++):(n=i,0===qr&&Gr(rt)),n!==i?(Dr=t,t=r=nt()):(Ur=t,t=i)):(Ur=t,t=i)}return t}function en(){var t,r;return(t=function(){var t;return(t=function(){var t,r,n,s,o,a,c;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if((n=sn())!==i){for(s=[],o=Yr();o!==i;)s.push(o),o=Yr();s!==i&&(o=function(){var t,r,n,s,o,a,c,u;if(t=Ur,64===e.charCodeAt(Ur)?(r=zt,Ur++):(r=i,0===qr&&Gr(Xt)),r!==i){if(n=[],Vt.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(Gt)),s!==i)for(;s!==i;)n.push(s),Vt.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(Gt));else n=i;if(n!==i){if(s=[],o=Ur,45===e.charCodeAt(Ur)?(a=Qt,Ur++):(a=i,0===qr&&Gr(Wt)),a!==i){if(c=[],Jt.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Yt)),u!==i)for(;u!==i;)c.push(u),Jt.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Yt));else c=i;c!==i?(Dr=o,o=a=Zt(n,c)):(Ur=o,o=i)}else Ur=o,o=i;for(;o!==i;)if(s.push(o),o=Ur,45===e.charCodeAt(Ur)?(a=Qt,Ur++):(a=i,0===qr&&Gr(Wt)),a!==i){if(c=[],Jt.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Yt)),u!==i)for(;u!==i;)c.push(u),Jt.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Yt));else c=i;c!==i?(Dr=o,o=a=Zt(n,c)):(Ur=o,o=i)}else Ur=o,o=i;s!==i?(Dr=t,t=r=Kt(n,s)):(Ur=t,t=i)}else Ur=t,t=i}else Ur=t,t=i;return t}())!==i?(Dr=t,t=r=mt(n,o)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i;if(t===i){for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if((n=sn())!==i){for(s=[],o=Yr();o!==i;)s.push(o),o=Yr();if(s!==i)if(e.substr(Ur,2)===bt?(o=bt,Ur+=2):(o=i,0===qr&&Gr(wt)),o!==i){for(a=[],c=Yr();c!==i;)a.push(c),c=Yr();a!==i&&(c=on())!==i?(Dr=t,t=r=vt(n,c)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i}else Ur=t,t=i;else Ur=t,t=i;if(t===i){for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();r!==i&&(n=sn())!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i)}}return t}())===i&&(t=function(){var t,r,n;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();return r!==i?((n=function(){var t,r,n,s,o,a,c,u,f;if(t=Ur,r=Ur,n=Ur,te.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(ee)),s===i&&(s=null),s!==i){if(o=Ur,a=[],$t.test(e.charAt(Ur))?(c=e.charAt(Ur),Ur++):(c=i,0===qr&&Gr(Ht)),c!==i)for(;c!==i;)a.push(c),$t.test(e.charAt(Ur))?(c=e.charAt(Ur),Ur++):(c=i,0===qr&&Gr(Ht));else a=i;if(a!==i)if(46===e.charCodeAt(Ur)?(c=l,Ur++):(c=i,0===qr&&Gr(h)),c!==i){for(u=[],$t.test(e.charAt(Ur))?(f=e.charAt(Ur),Ur++):(f=i,0===qr&&Gr(Ht));f!==i;)u.push(f),$t.test(e.charAt(Ur))?(f=e.charAt(Ur),Ur++):(f=i,0===qr&&Gr(Ht));u!==i&&(f=hn())!==i?o=a=[a,c,u,f]:(Ur=o,o=i)}else Ur=o,o=i;else Ur=o,o=i;if(o===i){if(o=Ur,46===e.charCodeAt(Ur)?(a=l,Ur++):(a=i,0===qr&&Gr(h)),a!==i){if(c=[],$t.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Ht)),u!==i)for(;u!==i;)c.push(u),$t.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Ht));else c=i;c!==i&&(u=hn())!==i?o=a=[a,c,u]:(Ur=o,o=i)}else Ur=o,o=i;if(o===i){if(o=Ur,a=[],$t.test(e.charAt(Ur))?(c=e.charAt(Ur),Ur++):(c=i,0===qr&&Gr(Ht)),c!==i)for(;c!==i;)a.push(c),$t.test(e.charAt(Ur))?(c=e.charAt(Ur),Ur++):(c=i,0===qr&&Gr(Ht));else a=i;a!==i&&(c=hn())!==i?o=a=[a,c]:(Ur=o,o=i)}}o!==i?n=s=[s,o]:(Ur=n,n=i)}else Ur=n,n=i;return(r=n!==i?e.substring(r,Ur):n)!==i&&(Dr=t,r=ie(r)),r}())===i&&(n=function(){var t,r,n,s,o,a,c,u;if(t=Ur,r=Ur,n=Ur,te.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(ee)),s===i&&(s=null),s!==i){for(o=[],$t.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(Ht));a!==i;)o.push(a),$t.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(Ht));if(o!==i)if(46===e.charCodeAt(Ur)?(a=l,Ur++):(a=i,0===qr&&Gr(h)),a!==i){if(c=[],$t.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Ht)),u!==i)for(;u!==i;)c.push(u),$t.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Ht));else c=i;c!==i?n=s=[s,o,a,c]:(Ur=n,n=i)}else Ur=n,n=i;else Ur=n,n=i}else Ur=n,n=i;return(r=n!==i?e.substring(r,Ur):n)!==i&&(Dr=t,r=ne(r)),r}())===i&&(n=function(){var t,r,n,s,o,a;if(t=Ur,r=Ur,n=Ur,te.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(ee)),s===i&&(s=null),s!==i){if(o=[],$t.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(Ht)),a!==i)for(;a!==i;)o.push(a),$t.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(Ht));else o=i;o!==i?n=s=[s,o]:(Ur=n,n=i)}else Ur=n,n=i;return(r=n!==i?e.substring(r,Ur):n)!==i&&(Dr=t,r=re(r)),r}()),n!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i)):(Ur=t,t=i),t}())===i&&(t=function(){var t,r,n;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i?(e.substr(Ur,4)===xt?(n=xt,Ur+=4):(n=i,0===qr&&Gr(_t)),n!==i?(Dr=t,t=r=At()):(Ur=t,t=i)):(Ur=t,t=i),t===i){for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();r!==i?(e.substr(Ur,5)===Tt?(n=Tt,Ur+=5):(n=i,0===qr&&Gr(Et)),n!==i?(Dr=t,t=r=Nt()):(Ur=t,t=i)):(Ur=t,t=i)}return t}()),t}())===i&&(t=Ur,(r=nn())!==i&&(Dr=t,r=st(r)),(t=r)===i&&(t=Ur,(r=an())!==i&&(Dr=t,r=ot(r)),(t=r)===i&&(t=Ur,(r=rn())!==i&&(Dr=t,r=f(r)),(t=r)===i&&(t=Ur,(r=on())!==i&&(Dr=t,r=at(r)),t=r)))),t}function rn(){var t,r,n,s,o,a;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if(91===e.charCodeAt(Ur)?(n=ct,Ur++):(n=i,0===qr&&Gr(ut)),n!==i)if((s=Zr())!==i){for(o=[],a=Yr();a!==i;)o.push(a),a=Yr();o!==i?(93===e.charCodeAt(Ur)?(a=lt,Ur++):(a=i,0===qr&&Gr(ht)),a!==i?(Dr=t,t=r=f(s)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;return t}function nn(){var t,r,n,s,o,a;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if(40===e.charCodeAt(Ur)?(n=ft,Ur++):(n=i,0===qr&&Gr(pt)),n!==i){for(s=[],o=en();o!==i;)s.push(o),o=en();if(s!==i){for(o=[],a=Yr();a!==i;)o.push(a),a=Yr();o!==i?(41===e.charCodeAt(Ur)?(a=dt,Ur++):(a=i,0===qr&&Gr(yt)),a!==i?(Dr=t,t=r=gt(s)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i}else Ur=t,t=i;else Ur=t,t=i;return t}function sn(){var t,r,n;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();return r!==i?((n=function(){var t,r,n,s,o,a,c,u;if(t=Ur,e.substr(Ur,3)===ye?(r=ye,Ur+=3):(r=i,0===qr&&Gr(ge)),r!==i){for(n=[],me.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(be)),s===i&&(s=pn())===i&&(s=fn());s!==i;)n.push(s),me.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(be)),s===i&&(s=pn())===i&&(s=fn());if(n!==i){if(s=[],o=Ur,e.substr(Ur,2)===we?(a=we,Ur+=2):(a=i,0===qr&&Gr(ve)),a!==i){if(c=[],me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=xe(n,c)):(Ur=o,o=i)}else Ur=o,o=i;if(o===i)if(o=Ur,39===e.charCodeAt(Ur)?(a=he,Ur++):(a=i,0===qr&&Gr(fe)),a!==i){if(c=[],me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=_e(n,c)):(Ur=o,o=i)}else Ur=o,o=i;for(;o!==i;){if(s.push(o),o=Ur,e.substr(Ur,2)===we?(a=we,Ur+=2):(a=i,0===qr&&Gr(ve)),a!==i){if(c=[],me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=xe(n,c)):(Ur=o,o=i)}else Ur=o,o=i;if(o===i)if(o=Ur,39===e.charCodeAt(Ur)?(a=he,Ur++):(a=i,0===qr&&Gr(fe)),a!==i){if(c=[],me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=_e(n,c)):(Ur=o,o=i)}else Ur=o,o=i}s!==i?(e.substr(Ur,3)===ye?(o=ye,Ur+=3):(o=i,0===qr&&Gr(ge)),o!==i?(Dr=t,t=r=Ae(n,s)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i}else Ur=t,t=i;return t}())===i&&(n=function(){var t,r,n,s,o,a,c,u;if(t=Ur,e.substr(Ur,3)===Te?(r=Te,Ur+=3):(r=i,0===qr&&Gr(Ee)),r!==i){for(n=[],Ne.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(Oe)),s===i&&(s=pn())===i&&(s=fn());s!==i;)n.push(s),Ne.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(Oe)),s===i&&(s=pn())===i&&(s=fn());if(n!==i){if(s=[],o=Ur,e.substr(Ur,2)===je?(a=je,Ur+=2):(a=i,0===qr&&Gr(Se)),a!==i){if(c=[],Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=Re(n,c)):(Ur=o,o=i)}else Ur=o,o=i;if(o===i)if(o=Ur,34===e.charCodeAt(Ur)?(a=ae,Ur++):(a=i,0===qr&&Gr(ce)),a!==i){if(c=[],Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=ke(n,c)):(Ur=o,o=i)}else Ur=o,o=i;for(;o!==i;){if(s.push(o),o=Ur,e.substr(Ur,2)===je?(a=je,Ur+=2):(a=i,0===qr&&Gr(Se)),a!==i){if(c=[],Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=Re(n,c)):(Ur=o,o=i)}else Ur=o,o=i;if(o===i)if(o=Ur,34===e.charCodeAt(Ur)?(a=ae,Ur++):(a=i,0===qr&&Gr(ce)),a!==i){if(c=[],Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=ke(n,c)):(Ur=o,o=i)}else Ur=o,o=i}s!==i?(e.substr(Ur,3)===Te?(o=Te,Ur+=3):(o=i,0===qr&&Gr(Ee)),o!==i?(Dr=t,t=r=Ae(n,s)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i}else Ur=t,t=i;return t}())===i&&(n=function(){var t,r,n,s;if(t=Ur,39===e.charCodeAt(Ur)?(r=he,Ur++):(r=i,0===qr&&Gr(fe)),r!==i){for(n=[],pe.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(de)),s===i&&(s=pn())===i&&(s=fn());s!==i;)n.push(s),pe.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(de)),s===i&&(s=pn())===i&&(s=fn());n!==i?(39===e.charCodeAt(Ur)?(s=he,Ur++):(s=i,0===qr&&Gr(fe)),s!==i?(Dr=t,t=r=w(n)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;return t}())===i&&(n=function(){var t,r,n,s;if(t=Ur,34===e.charCodeAt(Ur)?(r=ae,Ur++):(r=i,0===qr&&Gr(ce)),r!==i){for(n=[],ue.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(le)),s===i&&(s=pn())===i&&(s=fn());s!==i;)n.push(s),ue.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(le)),s===i&&(s=pn())===i&&(s=fn());n!==i?(34===e.charCodeAt(Ur)?(s=ae,Ur++):(s=i,0===qr&&Gr(ce)),s!==i?(Dr=t,t=r=w(n)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;return t}()),n!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i)):(Ur=t,t=i),t}function on(){var t,r,n;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i&&(n=cn())!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i),t===i){for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();r!==i&&(n=function(){var t,r;return(t=function(){var t,r,n;return t=Ur,(r=un())!==i&&(n=function(){var t,r,n,s,o,a,c,u;if(t=Ur,(r=yn())===i&&(58===e.charCodeAt(Ur)?(r=Ft,Ur++):(r=i,0===qr&&Gr(Ut)),r===i&&($t.test(e.charAt(Ur))?(r=e.charAt(Ur),Ur++):(r=i,0===qr&&Gr(Ht)),r===i&&(r=bn()))),r!==i){for(n=[],(s=gn())===i&&(58===e.charCodeAt(Ur)?(s=Ft,Ur++):(s=i,0===qr&&Gr(Ut)),s===i&&(s=bn()));s!==i;)n.push(s),(s=gn())===i&&(58===e.charCodeAt(Ur)?(s=Ft,Ur++):(s=i,0===qr&&Gr(Ut)),s===i&&(s=bn()));if(n!==i){if(s=[],o=Ur,a=[],46===e.charCodeAt(Ur)?(c=l,Ur++):(c=i,0===qr&&Gr(h)),c!==i)for(;c!==i;)a.push(c),46===e.charCodeAt(Ur)?(c=l,Ur++):(c=i,0===qr&&Gr(h));else a=i;if(a!==i){if(c=[],(u=gn())===i&&(58===e.charCodeAt(Ur)?(u=Ft,Ur++):(u=i,0===qr&&Gr(Ut)),u===i&&(u=bn())),u!==i)for(;u!==i;)c.push(u),(u=gn())===i&&(58===e.charCodeAt(Ur)?(u=Ft,Ur++):(u=i,0===qr&&Gr(Ut)),u===i&&(u=bn()));else c=i;c!==i?(Dr=o,o=a=Nr(r,n,a,c)):(Ur=o,o=i)}else Ur=o,o=i;for(;o!==i;){if(s.push(o),o=Ur,a=[],46===e.charCodeAt(Ur)?(c=l,Ur++):(c=i,0===qr&&Gr(h)),c!==i)for(;c!==i;)a.push(c),46===e.charCodeAt(Ur)?(c=l,Ur++):(c=i,0===qr&&Gr(h));else a=i;if(a!==i){if(c=[],(u=gn())===i&&(58===e.charCodeAt(Ur)?(u=Ft,Ur++):(u=i,0===qr&&Gr(Ut)),u===i&&(u=bn())),u!==i)for(;u!==i;)c.push(u),(u=gn())===i&&(58===e.charCodeAt(Ur)?(u=Ft,Ur++):(u=i,0===qr&&Gr(Ut)),u===i&&(u=bn()));else c=i;c!==i?(Dr=o,o=a=Nr(r,n,a,c)):(Ur=o,o=i)}else Ur=o,o=i}s!==i?(Dr=t,t=r=Or(r,n,s)):(Ur=t,t=i)}else Ur=t,t=i}else Ur=t,t=i;return t}())!==i?(Dr=t,t=r=Lt(r,n)):(Ur=t,t=i),t}())===i&&(t=Ur,(r=un())!==i&&(Dr=t,r=Ot(r)),t=r),t}())!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i)}return t}function an(){var t,r,n;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i&&(n=function(){var t,r,n,s,o,a,c,u,f,p;if(t=Ur,r=Ur,e.substr(Ur,2)===Bt?(n=Bt,Ur+=2):(n=i,0===qr&&Gr(qt)),n!==i)if((s=yn())===i&&($t.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(Ht))),s!==i){for(o=[],a=gn();a!==i;)o.push(a),a=gn();if(o!==i){if(a=[],c=Ur,u=[],46===e.charCodeAt(Ur)?(f=l,Ur++):(f=i,0===qr&&Gr(h)),f!==i)for(;f!==i;)u.push(f),46===e.charCodeAt(Ur)?(f=l,Ur++):(f=i,0===qr&&Gr(h));else u=i;if(u!==i){if(f=[],(p=gn())!==i)for(;p!==i;)f.push(p),p=gn();else f=i;f!==i?c=u=[u,f]:(Ur=c,c=i)}else Ur=c,c=i;for(;c!==i;){if(a.push(c),c=Ur,u=[],46===e.charCodeAt(Ur)?(f=l,Ur++):(f=i,0===qr&&Gr(h)),f!==i)for(;f!==i;)u.push(f),46===e.charCodeAt(Ur)?(f=l,Ur++):(f=i,0===qr&&Gr(h));else u=i;if(u!==i){if(f=[],(p=gn())!==i)for(;p!==i;)f.push(p),p=gn();else f=i;f!==i?c=u=[u,f]:(Ur=c,c=i)}else Ur=c,c=i}a!==i?r=n=[n,s,o,a]:(Ur=r,r=i)}else Ur=r,r=i}else Ur=r,r=i;else Ur=r,r=i;return r!==i?e.substring(t,Ur):r}())!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i),t===i){for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();r!==i&&(n=function(){var t,r,n,s;if(t=Ur,91===e.charCodeAt(Ur)?(r=ct,Ur++):(r=i,0===qr&&Gr(ut)),r!==i){for(n=[],s=Yr();s!==i;)n.push(s),s=Yr();n!==i?(93===e.charCodeAt(Ur)?(s=lt,Ur++):(s=i,0===qr&&Gr(ht)),s!==i?(Dr=t,t=r=lr()):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;return t}())!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i)}return t}function cn(){var t,r,n,s;if(t=Ur,60===e.charCodeAt(Ur)?(r=jt,Ur++):(r=i,0===qr&&Gr(St)),r!==i){for(n=[],Rt.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(kt)),s===i&&(s=fn());s!==i;)n.push(s),Rt.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(kt)),s===i&&(s=fn());n!==i?(62===e.charCodeAt(Ur)?(s=It,Ur++):(s=i,0===qr&&Gr(Ct)),s!==i?(Dr=t,t=r=Pt(n)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;return t}function un(){var t,r,n;return t=Ur,(r=mn())===i&&(r=null),r!==i?(58===e.charCodeAt(Ur)?(n=Ft,Ur++):(n=i,0===qr&&Gr(Ut)),n!==i?(Dr=t,t=r=Dt(r)):(Ur=t,t=i)):(Ur=t,t=i),t}function ln(){var t,r,n;return t=Ur,(r=mn())===i&&(r=null),r!==i?(58===e.charCodeAt(Ur)?(n=Ft,Ur++):(n=i,0===qr&&Gr(Ut)),n!==i?(Dr=t,t=r=Mt(r)):(Ur=t,t=i)):(Ur=t,t=i),t}function hn(){var t,r,n,s,o,a;if(t=Ur,r=Ur,se.test(e.charAt(Ur))?(n=e.charAt(Ur),Ur++):(n=i,0===qr&&Gr(oe)),n!==i)if(te.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(ee)),s===i&&(s=null),s!==i){if(o=[],$t.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(Ht)),a!==i)for(;a!==i;)o.push(a),$t.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(Ht));else o=i;o!==i?r=n=[n,s,o]:(Ur=r,r=i)}else Ur=r,r=i;else Ur=r,r=i;return r!==i?e.substring(t,Ur):r}function fn(){var t,r,n,s,o,a,c,u,l,h,f;return t=Ur,e.substr(Ur,2)===Ie?(r=Ie,Ur+=2):(r=i,0===qr&&Gr(Ce)),r!==i?(n=Ur,(s=wn())!==i&&(o=wn())!==i&&(a=wn())!==i&&(c=wn())!==i&&(u=wn())!==i&&(l=wn())!==i&&(h=wn())!==i&&(f=wn())!==i?n=s=[s,o,a,c,u,l,h,f]:(Ur=n,n=i),n!==i?(Dr=t,t=r=Pe(n)):(Ur=t,t=i)):(Ur=t,t=i),t===i&&(t=Ur,e.substr(Ur,2)===Fe?(r=Fe,Ur+=2):(r=i,0===qr&&Gr(Ue)),r!==i?(n=Ur,(s=wn())!==i&&(o=wn())!==i&&(a=wn())!==i&&(c=wn())!==i?n=s=[s,o,a,c]:(Ur=n,n=i),n!==i?(Dr=t,t=r=De(n)):(Ur=t,t=i)):(Ur=t,t=i)),t}function pn(){var t,r;return t=Ur,e.substr(Ur,2)===Me?(r=Me,Ur+=2):(r=i,0===qr&&Gr(Le)),r!==i&&(Dr=t,r=Be()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===qe?(r=qe,Ur+=2):(r=i,0===qr&&Gr($e)),r!==i&&(Dr=t,r=He()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===ze?(r=ze,Ur+=2):(r=i,0===qr&&Gr(Xe)),r!==i&&(Dr=t,r=Ve()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===Ge?(r=Ge,Ur+=2):(r=i,0===qr&&Gr(Qe)),r!==i&&(Dr=t,r=We()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===Je?(r=Je,Ur+=2):(r=i,0===qr&&Gr(Ye)),r!==i&&(Dr=t,r=Ze()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===Ke?(r=Ke,Ur+=2):(r=i,0===qr&&Gr(tr)),r!==i&&(Dr=t,r=er()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===rr?(r=rr,Ur+=2):(r=i,0===qr&&Gr(nr)),r!==i&&(Dr=t,r=ir()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===sr?(r=sr,Ur+=2):(r=i,0===qr&&Gr(or)),r!==i&&(Dr=t,r=ar()),t=r))))))),t}function dn(){var t,r,n;return t=Ur,hr.test(e.charAt(Ur))?(r=e.charAt(Ur),Ur++):(r=i,0===qr&&Gr(fr)),r!==i?(pr.test(e.charAt(Ur))?(n=e.charAt(Ur),Ur++):(n=i,0===qr&&Gr(dr)),n!==i?(Dr=t,t=r=yr(r,n)):(Ur=t,t=i)):(Ur=t,t=i),t===i&&(gr.test(e.charAt(Ur))?(t=e.charAt(Ur),Ur++):(t=i,0===qr&&Gr(mr))),t}function yn(){var t;return(t=dn())===i&&(95===e.charCodeAt(Ur)?(t=br,Ur++):(t=i,0===qr&&Gr(wr))),t}function gn(){var t;return(t=yn())===i&&(45===e.charCodeAt(Ur)?(t=Qt,Ur++):(t=i,0===qr&&Gr(Wt)),t===i&&($t.test(e.charAt(Ur))?(t=e.charAt(Ur),Ur++):(t=i,0===qr&&Gr(Ht)),t===i&&(183===e.charCodeAt(Ur)?(t=vr,Ur++):(t=i,0===qr&&Gr(xr)),t===i&&(_r.test(e.charAt(Ur))?(t=e.charAt(Ur),Ur++):(t=i,0===qr&&Gr(Ar)),t===i&&(Tr.test(e.charAt(Ur))?(t=e.charAt(Ur),Ur++):(t=i,0===qr&&Gr(Er))))))),t}function mn(){var t,r,n,s,o,a,c,u,f;if(t=Ur,r=Ur,(n=dn())!==i){for(s=[],o=gn();o!==i;)s.push(o),o=gn();if(s!==i){if(o=[],a=Ur,c=[],46===e.charCodeAt(Ur)?(u=l,Ur++):(u=i,0===qr&&Gr(h)),u!==i)for(;u!==i;)c.push(u),46===e.charCodeAt(Ur)?(u=l,Ur++):(u=i,0===qr&&Gr(h));else c=i;if(c!==i){if(u=[],(f=gn())!==i)for(;f!==i;)u.push(f),f=gn();else u=i;u!==i?a=c=[c,u]:(Ur=a,a=i)}else Ur=a,a=i;for(;a!==i;){if(o.push(a),a=Ur,c=[],46===e.charCodeAt(Ur)?(u=l,Ur++):(u=i,0===qr&&Gr(h)),u!==i)for(;u!==i;)c.push(u),46===e.charCodeAt(Ur)?(u=l,Ur++):(u=i,0===qr&&Gr(h));else c=i;if(c!==i){if(u=[],(f=gn())!==i)for(;f!==i;)u.push(f),f=gn();else u=i;u!==i?a=c=[c,u]:(Ur=a,a=i)}else Ur=a,a=i}o!==i?r=n=[n,s,o]:(Ur=r,r=i)}else Ur=r,r=i}else Ur=r,r=i;return r!==i?e.substring(t,Ur):r}function bn(){var t;return(t=function(){var t,r,n,s,o;return t=Ur,r=Ur,37===e.charCodeAt(Ur)?(n=jr,Ur++):(n=i,0===qr&&Gr(Sr)),n!==i&&(s=wn())!==i&&(o=wn())!==i?r=n=[n,s,o]:(Ur=r,r=i),r!==i?e.substring(t,Ur):r}())===i&&(t=function(){var t,r,n;return t=Ur,92===e.charCodeAt(Ur)?(r=Ir,Ur++):(r=i,0===qr&&Gr(Cr)),r!==i?(Pr.test(e.charAt(Ur))?(n=e.charAt(Ur),Ur++):(n=i,0===qr&&Gr(Fr)),n!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i)):(Ur=t,t=i),t}()),t}function wn(){var t;return Rr.test(e.charAt(Ur))?(t=e.charAt(Ur),Ur++):(t=i,0===qr&&Gr(kr)),t}var vn,xn,_n,An=function(t){return t.match(/^[a-z](.*?):(.+?)/g)},Tn={base:[],data:{},addBase:function(t){if(0===Tn.base.length)return void Tn.base.push(t);const e=Tn.base[Tn.base.length-1];e!==t&&Tn.base.push(new URL(t,e).toString())},addPrefix:function(t,e){const r=Tn.data[t];void 0===r?Tn.data[t]=[{uri:e,count:0}]:r[r.length-1].uri!==e&&r.push({uri:e,count:0})},hasPrefix:function(t){return void 0!==this.data[t]},resolve:function(t,e){const n=Object.keys(Tn.data).find((e=>0===t.indexOf(e+":")));if(void 0!==n){const r=Tn.data[n];if(1===r.length&&!0!==e&&An(r[0].uri))return t;const i=r[r.length-1].uri;return t.replace(n+":",i)}var i=0===Tn.base.length?r.baseIRI:Tn.base[Tn.base.length-1];return!i||t.match(/^(http:|https:|urn:|file:)/)?t:0===t.indexOf("//")&&i?i.split("//")[0]+t:new URL(t,i).toString()},increment:function(t){const e=Tn.data[t];void 0!==e&&e[e.length-1].count++},decrement:function(t){const e=Tn.data[t];void 0!==e&&e[e.length-1].count--},toJSON:function(){const t={};return Tn.base.length>0&&(void 0===t["@context"]&&(t["@context"]={}),t["@context"]["@base"]=Tn.base[0]),Object.keys(Tn.data).forEach((e=>{const r=Tn.data[e][0];"http://www.w3.org/2001/XMLSchema#"===r.uri&&r.count<1||An(r.uri)&&(void 0===t["@context"]&&(t["@context"]={}),t["@context"][e]=r.uri)})),t}};function En(t,e){if(void 0===t["@list"])return t;if(!e&&!t["@list"].find((t=>void 0!==t["@list"])))return t;if(0===t["@list"].length)return{"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};var r={},n=null;return t["@list"].forEach((t=>{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"]=En(t,!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((n=o())!==i&&Ur===e.length)return n;throw n!==i&&Ur<e.length&&Gr({type:"end"}),vn=Br,xn=Lr<e.length?e.charAt(Lr):null,_n=Lr<e.length?Vr(Lr,Lr+1):Vr(Lr,Lr),new t(t.buildMessage(vn,xn),vn,xn,_n)}}})?r.apply(e,[]):r)||(t.exports=n)},2313:(t,e,r)=>{"use strict";var n=r(6357);const i=r(2504),s=r(9029),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=u,e.IS=50;const a=2147483647;function c(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return l(t,e,r)}function l(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=c(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|y(t.length),r=c(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?c(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return h(t),c(t<0?0:0|y(t))}function p(t){const e=t.length<0?0:0|y(t.length),r=c(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function y(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function g(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(t).length;default:if(i)return n?-1:G(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return S(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return N(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let s,o=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let n=-1;for(s=r;s<a;s++)if(u(t,s)===u(e,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===c)return n*o}else-1!==n&&(s-=s-n),n=-1}else for(r+c>a&&(r=a-c),s=r;s>=0;s--){let r=!0;for(let n=0;n<c;n++)if(u(t,s+n)!==u(e,n)){r=!1;break}if(r)return s}return-1}function x(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const s=e.length;let o;for(n>s/2&&(n=s/2),o=0;o<n;++o){const n=parseInt(e.substr(2*o,2),16);if(Y(n))return o;t[r+o]=n}return o}function _(t,e,r,n){return W(G(e,t.length-r),t,r,n)}function A(t,e,r,n){return W(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function T(t,e,r,n){return W(Q(e),t,r,n)}function E(t,e,r,n){return W(function(t,e){let r,n,i;const s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,s.push(i),s.push(n);return s}(e,t.length-r),t,r,n)}function N(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let s=null,o=e>239?4:e>223?3:e>191?2:1;if(i+o<=r){let r,n,a,c;switch(o){case 1:e<128&&(s=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(s=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return function(t){const e=t.length;if(e<=j)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=j));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return l(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?c(t):void 0!==e?"string"==typeof r?c(t).fill(e,r):c(t).fill(e):c(t)}(t,e,r)},u.allocUnsafe=function(t){return f(t)},u.allocUnsafeSlow=function(t){return f(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).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}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(J(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)b(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?O(this,0,t):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0);const a=Math.min(s,o),c=this.slice(n,i),l=t.slice(e,r);for(let t=0;t<a;++t)if(c[t]!==l[t]){s=c[t],o=l[t];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const j=4096;function S(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function R(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function k(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=Z[t[n]];return i}function I(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,i,s){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function F(t,e,r,n,i){H(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function U(t,e,r,n,i){H(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s>>=8,t[r+6]=s,s>>=8,t[r+5]=s,s>>=8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function D(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return e=+e,r>>>=0,i||D(t,0,r,4),s.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,i){return e=+e,r>>>=0,i||D(t,0,r,8),s.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,s=0;for(;++s<e&&(i*=256);)n+=this[t+s]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=K((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=K((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,s=0;for(;++s<e&&(i*=256);)n+=this[t+s]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,s=this[t+--n];for(;n>0&&(i*=256);)s+=this[t+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*e)),s},u.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=K((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),u.prototype.readBigInt64BE=K((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),s.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),s.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),s.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),s.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,s=0;for(this[e]=255&t;++s<r&&(i*=256);)this[e+s]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=K((function(t,e=0){return F(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=K((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=0,s=1,o=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===o&&0!==this[e+i-1]&&(o=1),this[e+i]=(t/s|0)-o&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/s|0)-o&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=K((function(t,e=0){return F(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=K((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=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&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const s=u.isBuffer(t)?t:u.from(t,n),o=s.length;if(0===o)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%o]}return this};const B={};function q(t,e,r){B[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function $(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function H(t,e,r,n,i,s){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=s>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){z(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||X(e,t.length-(r+1))}(n,i,s)}function z(t,e){if("number"!=typeof t)throw new B.ERR_INVALID_ARG_TYPE(e,"number",t)}function X(t,e,r){if(Math.floor(t)!==t)throw z(t,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function G(t,e){let r;e=e||1/0;const n=t.length;let i=null;const s=[];for(let o=0;o<n;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function Q(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const Z=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function K(t){return"undefined"==typeof BigInt?tt:t}function tt(){throw new Error("BigInt not supported")}},2504:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,s=a(t),o=s[0],c=s[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,c)),l=0,h=c>0?o-4:o;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,s=[],o=16383,a=0,u=n-i;a<u;a+=o)s.push(c(t,a,a+o>u?u:a+o));return 1===i?(e=t[n-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,s,o=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(r[(s=i)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2621:t=>{"use strict";t.exports=function(t){return t!=t}},2719:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var i=0;i<e.length;i+=1)r[i+t.length]=e[i];return r};t.exports=function(t){var i=this;if("function"!=typeof i||"[object Function]"!==e.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var s,o=function(t){for(var e=[],r=1,n=0;r<t.length;r+=1,n+=1)e[n]=t[r];return e}(arguments),a=r(0,i.length-o.length),c=[],u=0;u<a;u++)c[u]="$"+u;if(s=Function("binder","return function ("+function(t){for(var e="",r=0;r<t.length;r+=1)e+=t[r],r+1<t.length&&(e+=",");return e}(c)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof s){var e=i.apply(this,n(o,arguments));return Object(e)===e?e:this}return i.apply(t,n(o,arguments))})),i.prototype){var l=function(){};l.prototype=i.prototype,s.prototype=new l,l.prototype=null}return s}},2774:(t,e,r)=>{"use strict";var n=r(8651),i=r(6688),s=i([n("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&s(t,".prototype.")>-1?i([r]):r}},2843:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var i=Object.getOwnPropertySymbols(t);if(1!==i.length||i[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var s=Object.getOwnPropertyDescriptor(t,e);if(42!==s.value||!0!==s.enumerable)return!1}return!0}},3036:t=>{"use strict";t.exports=Function.prototype.apply},3249:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},3257:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(2843);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},3381:(t,e,r)=>{"use strict";var n=r(8404),i=r(821),s=r(6601),o=r(2774),a=r(8109),c=r(7106),u=o("Object.prototype.toString"),l=r(6626)(),h="undefined"==typeof globalThis?r.g:globalThis,f=i(),p=o("String.prototype.slice"),d=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},y={__proto__:null};n(f,l&&a&&c?function(t){var e=new h[t];if(Symbol.toStringTag in e&&c){var r=c(e),n=a(r,Symbol.toStringTag);if(!n&&r){var i=c(r);n=a(i,Symbol.toStringTag)}y["$"+t]=s(n.get)}}:function(t){var e=new h[t],r=e.slice||e.set;r&&(y["$"+t]=s(r))}),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!l){var e=p(u(t),8,-1);return d(f,e)>-1?e:"Object"===e&&function(t){var e=!1;return n(y,(function(r,n){if(!e)try{r(t),e=p(n,1)}catch(t){}})),e}(t)}return a?function(t){var e=!1;return n(y,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=p(n,1))}catch(t){}})),e}(t):null}},3534:(t,e,r)=>{"use strict";var n=r(9636),i=r(5421);t.exports=function(){var t=n();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},3627:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var n=r(939),i=r(9390),s=r(1605),o=r(6866),a=r(362),c=r(546);class u extends s.A{constructor(t){if(super((0,a.E)(t)),(0,n.A)(this,"termType",o.Kk),(0,n.A)(this,"classOrder",i.A.NamedNode),!this.value)throw new Error("Missing IRI for NamedNode");if(!this.value.includes(":"))throw new Error('NamedNode IRI "'+t+'" must be absolute.');if(this.value.includes(" "))throw new Error('Error: NamedNode IRI "'+t+'" must not contain unencoded spaces.')}dir(){var t=this.value.split("#")[0],e=t.slice(0,-1).lastIndexOf("/"),r=t.indexOf("//");return r>=0&&e<r+2||e<0?null:new u(t.slice(0,e+1))}site(){var t=this.value.split("#")[0],e=t.indexOf("//");if(e<0)throw new Error("This URI does not have a web site part (origin)");var r=t.indexOf("/",e+2);return new u(r<0?t.slice(0)+"/":t.slice(0,r+1))}doc(){return this.value.indexOf("#")<0?this:new u(this.value.split("#")[0])}toString(){return"<"+this.value+">"}id(){return this.value.split("#")[1]}get uri(){return this.value}set uri(t){this.value=t}static fromValue(t){return null==t||(0,c.D0)(t)?t:new u(t)}}},3746:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var s=/^\s*class\b/,o=function(t){try{var e=n.call(t);return s.test(e)}catch(t){return!1}},a=function(t){try{return!o(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;c.call(f)===c.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!o(t)&&a(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return a(t);if(o(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}},3766:(t,e,r)=>{"use strict";var n=r(5846);t.exports=n.getPrototypeOf||null},3774:t=>{"use strict";t.exports=Math.max},3787:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n={debug(t){},warn(t){},info(t){},error(t){},success(t){},msg(t){}}},4055:t=>{"use strict";t.exports=URIError},4221:(t,e,r)=>{"use strict";r.r(e),r.d(e,{docpart:()=>o,document:()=>a,hostpart:()=>c,join:()=>u,protocol:()=>l,refTo:()=>h});var n=r(3627),i=r(6357),s=s||i.log;function o(t){var e;return(e=t.indexOf("#"))<0?t:t.slice(0,e)}function a(t){return new n.A(o(t))}function c(t){var e=/[^\/]*\/\/([^\/]*)\//.exec(t);return e?e[1]:""}function u(t,e){var r,n,i,o,a,c=e.indexOf("#");if(c>0&&(e=e.slice(0,c)),0===t.length)return e;if(0===t.indexOf("#"))return e+t;if(t.indexOf(":")>=0)return t;if(r=e.indexOf(":"),0===e.length)return t;if(r<0)return s("Invalid base: "+e+" in join with given: "+t),t;if(n=e.slice(0,+r+1||9e9),0===t.indexOf("//"))return n+t;if(e.indexOf("//",r)===r+1){if((i=e.indexOf("/",r+3))<0)return e.length-r-3>0?e+"/"+t:n+t}else if((i=e.indexOf("/",r+1))<0)return e.length-r-1>0?e+"/"+t:n+t;if(0===t.indexOf("/"))return e.slice(0,i)+t;if((o=(a=e.slice(i)).lastIndexOf("/"))<0)return n+t;for(o>=0&&o<a.length-1&&(a=a.slice(0,+o+1||9e9)),a+=t;a.match(/[^\/]*\/\.\.\//);)a=a.replace(/[^\/]*\/\.\.\//,"");return a=(a=a.replace(/\.\//g,"")).replace(/\/\.$/,"/"),e.slice(0,i)+a}function l(t){const e=t.indexOf(":");return e<0?null:t.slice(0,e)}function h(t,e){var r,n,i,s,o,a,c,u,l,h,f,p,d=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!t)return e;if(t===e)return"";for(r=c=0,s=e.length;c<s&&e[r]===t[r];r=++c);if(t.slice(0,r).match(d)&&((n=e.indexOf("//"))<0&&(n=-2),i=e.indexOf("/",n+2),"/"!==e[i+1]&&"/"!==t[i+1]&&e.slice(0,i)===t.slice(0,i)))return e.slice(i);if("#"===e[r]&&t.length===r)return e.slice(r);for(;r>0&&"/"!==e[r-1];)r--;if(r<3)return e;if(t.indexOf("//",r-2)>0||e.indexOf("//",r-2)>0)return e;if(t.indexOf(":",r)>0)return e;for(a=0,u=0,o=(h=t.slice(r)).length;u<o;u++)"/"===h[u]&&a++;if(0===a&&r<e.length&&"#"===e[r])return"./"+e.slice(r);if(0===a&&r===e.length)return"./";if(p="",a>0)for(l=1,f=a;f>=1?l<=f:l>=f;f>=1?++l:--l)p+="../";return p+e.slice(r)}},4610:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,s=Function.prototype.toString,o=/^\s*(?:function)?\*/,a=r(6626)(),c=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(o.test(s.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!c)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&c(e)}return c(t)===n}},5049:(t,e,r)=>{"use strict";var n=r(2719);t.exports=Function.prototype.bind||n},5074:(t,e,r)=>{"use strict";var n=r(5421),i=r(1320);t.exports=function(){var t=i();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},5215:(t,e,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,s=r(5049);t.exports=s.call(n,i)},5293:t=>{"use strict";t.exports=Error},5403:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},s(t,e)}var o,a,c={};function u(t,e,r){r||(r=Error);var o=function(r){function o(r,s,a){var c;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),c=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}(this,i(o).call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,s,a))),c.code=t,c}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(o,r),o}(r);c[t]=o}function l(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",(function(t,e,i){var s,a,c,u,h;if(void 0===o&&(o=r(182)),o("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(a="not ",e.substr(0,4)===a)?(s="must not be",e=e.replace(/^not /,"")):s="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-9,r)===e}(t," argument"))c="The ".concat(t," ").concat(s," ").concat(l(e,"type"));else{var f=("number"!=typeof h&&(h=0),h+1>(u=t).length||-1===u.indexOf(".",h)?"argument":"property");c='The "'.concat(t,'" ').concat(f," ").concat(s," ").concat(l(e,"type"))}return c+". Received type ".concat(n(i))}),TypeError),u("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(7187));var i=a.inspect(e);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),u("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];void 0===o&&(o=r(182)),o(e.length>0,"At least one arg needs to be specified");var i="The ",s=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),s){case 1:i+="".concat(e[0]," argument");break;case 2:i+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:i+=e.slice(0,s-1).join(", "),i+=", and ".concat(e[s-1]," arguments")}return"".concat(i," must be specified")}),TypeError),t.exports.codes=c},5416:(t,e,r)=>{"use strict";var n=r(9964);function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?a(t):e}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t){var e="function"==typeof Map?new Map:void 0;return c=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return u(t,arguments,h(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,t)},c(t)}function u(t,e,r){return u=function(){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(t){return!1}}()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&l(i,r.prototype),i},u.apply(null,arguments)}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}var p=r(7187).inspect,d=r(5403).codes.ERR_INVALID_ARG_TYPE;function y(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var g="",m="",b="",w="",v={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 x(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function _(t){return p(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var A=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==f(t)||null===t)throw new d("options","Object",t);var i=t.message,s=t.operator,c=t.stackStartFn,u=t.actual,l=t.expected,p=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=o(this,h(e).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(g="",m="",w="",b=""):(g="",m="",w="",b="")),"object"===f(u)&&null!==u&&"object"===f(l)&&null!==l&&"stack"in u&&u instanceof Error&&"stack"in l&&l instanceof Error&&(u=x(u),l=x(l)),"deepStrictEqual"===s||"strictEqual"===s)r=o(this,h(e).call(this,function(t,e,r){var i="",s="",o=0,a="",c=!1,u=_(t),l=u.split("\n"),h=_(e).split("\n"),p=0,d="";if("strictEqual"===r&&"object"===f(t)&&"object"===f(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===l.length&&1===h.length&&l[0]!==h[0]){var x=l[0].length+h[0].length;if(x<=10){if(!("object"===f(t)&&null!==t||"object"===f(e)&&null!==e||0===t&&0===e))return"".concat(v[r],"\n\n")+"".concat(l[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&x<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][p]===h[0][p];)p++;p>2&&(d="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",p),"^"),p=0)}}for(var A=l[l.length-1],T=h[h.length-1];A===T&&(p++<2?a="\n ".concat(A).concat(a):i=A,l.pop(),h.pop(),0!==l.length&&0!==h.length);)A=l[l.length-1],T=h[h.length-1];var E=Math.max(l.length,h.length);if(0===E){var N=u.split("\n");if(N.length>30)for(N[26]="".concat(g,"...").concat(w);N.length>27;)N.pop();return"".concat(v.notIdentical,"\n\n").concat(N.join("\n"),"\n")}p>3&&(a="\n".concat(g,"...").concat(w).concat(a),c=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var O=0,j=v[r]+"\n".concat(m,"+ actual").concat(w," ").concat(b,"- expected").concat(w),S=" ".concat(g,"...").concat(w," Lines skipped");for(p=0;p<E;p++){var R=p-o;if(l.length<p+1)R>1&&p>2&&(R>4?(s+="\n".concat(g,"...").concat(w),c=!0):R>3&&(s+="\n ".concat(h[p-2]),O++),s+="\n ".concat(h[p-1]),O++),o=p,i+="\n".concat(b,"-").concat(w," ").concat(h[p]),O++;else if(h.length<p+1)R>1&&p>2&&(R>4?(s+="\n".concat(g,"...").concat(w),c=!0):R>3&&(s+="\n ".concat(l[p-2]),O++),s+="\n ".concat(l[p-1]),O++),o=p,s+="\n".concat(m,"+").concat(w," ").concat(l[p]),O++;else{var k=h[p],I=l[p],C=I!==k&&(!y(I,",")||I.slice(0,-1)!==k);C&&y(k,",")&&k.slice(0,-1)===I&&(C=!1,I+=","),C?(R>1&&p>2&&(R>4?(s+="\n".concat(g,"...").concat(w),c=!0):R>3&&(s+="\n ".concat(l[p-2]),O++),s+="\n ".concat(l[p-1]),O++),o=p,s+="\n".concat(m,"+").concat(w," ").concat(I),i+="\n".concat(b,"-").concat(w," ").concat(k),O+=2):(s+=i,i="",1!==R&&0!==p||(s+="\n ".concat(I),O++))}if(O>20&&p<E-2)return"".concat(j).concat(S,"\n").concat(s,"\n").concat(g,"...").concat(w).concat(i,"\n")+"".concat(g,"...").concat(w)}return"".concat(j).concat(c?S:"","\n").concat(s).concat(i).concat(a).concat(d)}(u,l,s)));else if("notDeepStrictEqual"===s||"notStrictEqual"===s){var A=v[s],T=_(u).split("\n");if("notStrictEqual"===s&&"object"===f(u)&&null!==u&&(A=v.notStrictEqualObject),T.length>30)for(T[26]="".concat(g,"...").concat(w);T.length>27;)T.pop();r=1===T.length?o(this,h(e).call(this,"".concat(A," ").concat(T[0]))):o(this,h(e).call(this,"".concat(A,"\n\n").concat(T.join("\n"),"\n")))}else{var E=_(u),N="",O=v[s];"notDeepEqual"===s||"notEqual"===s?(E="".concat(v[s],"\n\n").concat(E)).length>1024&&(E="".concat(E.slice(0,1021),"...")):(N="".concat(_(l)),E.length>512&&(E="".concat(E.slice(0,509),"...")),N.length>512&&(N="".concat(N.slice(0,509),"...")),"deepEqual"===s||"equal"===s?E="".concat(O,"\n\n").concat(E,"\n\nshould equal\n\n"):N=" ".concat(s," ").concat(N)),r=o(this,h(e).call(this,"".concat(E).concat(N)))}return Error.stackTraceLimit=p,r.generatedMessage=!i,Object.defineProperty(a(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=u,r.expected=l,r.operator=s,Error.captureStackTrace&&Error.captureStackTrace(a(r),c),r.stack,r.name="AssertionError",o(r)}var r,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(e,t),r=e,c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(t,e){return p(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){i(t,e,r[e])}))}return t}({},e,{customInspect:!1,depth:0}))}}],c&&s(r.prototype,c),e}(c(Error));t.exports=A},5421:(t,e,r)=>{"use strict";var n=r(5643),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),s=Object.prototype.toString,o=Array.prototype.concat,a=Object.defineProperty,c=r(8890)(),u=a&&c,l=function(t,e,r,n){var i;(!(e in t)||"function"==typeof(i=n)&&"[object Function]"===s.call(i)&&n())&&(u?a(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},h=function(t,e){var r=arguments.length>2?arguments[2]:{},s=n(e);i&&(s=o.call(s,Object.getOwnPropertySymbols(e)));for(var a=0;a<s.length;a+=1)l(t,s[a],e[s[a]],r[s[a]])};h.supportsDescriptors=!!u,t.exports=h},5567:t=>{"use strict";t.exports=Object.getOwnPropertyDescriptor},5582:(t,e,r)=>{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},5643:(t,e,r)=>{"use strict";var n=Array.prototype.slice,i=r(6515),s=Object.keys,o=s?function(t){return s(t)}:r(8461),a=Object.keys;o.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)})}else Object.keys=o;return Object.keys||o},t.exports=o},5846:t=>{"use strict";t.exports=Object},5874:t=>{"use strict";t.exports=Math.pow},6071:(t,e,r)=>{"use strict";var n=r(713);t.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},6094:(t,e,r)=>{"use strict";var n=r(3381);t.exports=function(t){return!!n(t)}},6255:(t,e,r)=>{"use strict";var n=r(8651),i=r(9295),s=r(8890)(),o=r(8109),a=r(6785),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in t&&o){var l=o(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(u=!1)}return(n||u||!r)&&(s?i(t,"length",e,!0,!0):i(t,"length",e)),t}},6357:(t,e,r)=>{var n=r(7187),i=r(182);function s(){return(new Date).getTime()}var o,a=Array.prototype.slice,c={};o=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var u=[[function(){},"log"],[function(){o.log.apply(o,arguments)},"info"],[function(){o.log.apply(o,arguments)},"warn"],[function(){o.warn.apply(o,arguments)},"error"],[function(t){c[t]=s()},"time"],[function(t){var e=c[t];if(!e)throw new Error("No such label: "+t);delete c[t];var r=s()-e;o.log(t+": "+r+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=n.format.apply(null,arguments),o.error(t.stack)},"trace"],[function(t){o.log(n.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=a.call(arguments,1);i.ok(!1,n.format.apply(null,e))}},"assert"]],l=0;l<u.length;l++){var h=u[l],f=h[0],p=h[1];o[p]||(o[p]=f)}t.exports=o},6515:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},6601:(t,e,r)=>{"use strict";var n=r(6255),i=r(6649),s=r(6688),o=r(8619);t.exports=function(t){var e=s(arguments),r=t.length-(arguments.length-1);return n(e,1+(r>0?r:0),!0)},i?i(t.exports,"apply",{value:o}):t.exports.apply=o},6626:(t,e,r)=>{"use strict";var n=r(2843);t.exports=function(){return n()&&!!Symbol.toStringTag}},6649:t=>{"use strict";var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}t.exports=e},6688:(t,e,r)=>{"use strict";var n=r(5049),i=r(6785),s=r(78),o=r(7802);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new i("a function is required");return o(n,s,t)}},6713:t=>{"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var s=Object.keys(Object(i)),o=0,a=s.length;o<a;o++){var c=s[o],u=Object.getOwnPropertyDescriptor(i,c);void 0!==u&&u.enumerable&&(r[c]=i[c])}}return r}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},6781:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,s=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,s=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw s}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var s=void 0!==/a/g.flags,o=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},a=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},c=Object.is?Object.is:r(8527),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r(7051);function h(t){return t.call.bind(t)}var f=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),d=h(Object.prototype.toString),y=r(7187).types,g=y.isAnyArrayBuffer,m=y.isArrayBufferView,b=y.isDate,w=y.isMap,v=y.isRegExp,x=y.isSet,_=y.isNativeError,A=y.isBoxedPrimitive,T=y.isNumberObject,E=y.isStringObject,N=y.isBooleanObject,O=y.isBigIntObject,j=y.isSymbolObject,S=y.isFloat32Array,R=y.isFloat64Array;function k(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function I(t){return Object.keys(t).filter(k).concat(u(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function C(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function P(t,e,r,n){if(t===e)return 0!==t||!r||c(t,e);if(r){if("object"!==i(t))return"number"==typeof t&&l(t)&&l(e);if("object"!==i(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==i(t))return(null===e||"object"!==i(e))&&t==e;if(null===e||"object"!==i(e))return!1}var o,a,u,h,f=d(t);if(f!==d(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var p=I(t),y=I(e);return p.length===y.length&&U(t,e,r,n,1,p)}if("[object Object]"===f&&(!w(t)&&w(e)||!x(t)&&x(e)))return!1;if(b(t)){if(!b(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(v(t)){if(!v(e)||(u=t,h=e,!(s?u.source===h.source&&u.flags===h.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(h))))return!1}else if(_(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(m(t)){if(r||!S(t)&&!R(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===C(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1;var k=I(t),P=I(e);return k.length===P.length&&U(t,e,r,n,0,k)}if(x(t))return!(!x(e)||t.size!==e.size)&&U(t,e,r,n,2);if(w(t))return!(!w(e)||t.size!==e.size)&&U(t,e,r,n,3);if(g(t)){if(a=e,(o=t).byteLength!==a.byteLength||0!==C(new Uint8Array(o),new Uint8Array(a)))return!1}else if(A(t)&&!function(t,e){return T(t)?T(e)&&c(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):E(t)?E(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):N(t)?N(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):O(t)?O(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):j(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return U(t,e,r,n,0)}function F(t,e){return e.filter((function(e){return p(t,e)}))}function U(t,e,r,s,c,l){if(5===arguments.length){l=Object.keys(t);var h=Object.keys(e);if(l.length!==h.length)return!1}for(var d=0;d<l.length;d++)if(!f(e,l[d]))return!1;if(r&&5===arguments.length){var y=u(t);if(0!==y.length){var g=0;for(d=0;d<y.length;d++){var m=y[d];if(p(t,m)){if(!p(e,m))return!1;l.push(m),g++}else if(p(e,m))return!1}var b=u(e);if(y.length!==b.length&&F(e,b).length!==g)return!1}else{var w=u(e);if(0!==w.length&&0!==F(e,w).length)return!1}}if(0===l.length&&(0===c||1===c&&0===t.length||0===t.size))return!0;if(void 0===s)s={val1:new Map,val2:new Map,position:0};else{var v=s.val1.get(t);if(void 0!==v){var x=s.val2.get(e);if(void 0!==x)return v===x}s.position++}s.val1.set(t,s.position),s.val2.set(e,s.position);var _=function(t,e,r,s,c,u){var l=0;if(2===u){if(!function(t,e,r,n){for(var s=null,a=o(t),c=0;c<a.length;c++){var u=a[c];if("object"===i(u)&&null!==u)null===s&&(s=new Set),s.add(u);else if(!e.has(u)){if(r)return!1;if(!L(t,e,u))return!1;null===s&&(s=new Set),s.add(u)}}if(null!==s){for(var l=o(e),h=0;h<l.length;h++){var f=l[h];if("object"===i(f)&&null!==f){if(!D(s,f,r,n))return!1}else if(!r&&!t.has(f)&&!D(s,f,r,n))return!1}return 0===s.size}return!0}(t,e,r,c))return!1}else if(3===u){if(!function(t,e,r,s){for(var o=null,c=a(t),u=0;u<c.length;u++){var l=n(c[u],2),h=l[0],f=l[1];if("object"===i(h)&&null!==h)null===o&&(o=new Set),o.add(h);else{var p=e.get(h);if(void 0===p&&!e.has(h)||!P(f,p,r,s)){if(r)return!1;if(!B(t,e,h,f,s))return!1;null===o&&(o=new Set),o.add(h)}}}if(null!==o){for(var d=a(e),y=0;y<d.length;y++){var g=n(d[y],2),m=(h=g[0],g[1]);if("object"===i(h)&&null!==h){if(!q(o,t,h,m,r,s))return!1}else if(!(r||t.has(h)&&P(t.get(h),m,!1,s)||q(o,t,h,m,!1,s)))return!1}return 0===o.size}return!0}(t,e,r,c))return!1}else if(1===u)for(;l<t.length;l++){if(!f(t,l)){if(f(e,l))return!1;for(var h=Object.keys(t);l<h.length;l++){var p=h[l];if(!f(e,p)||!P(t[p],e[p],r,c))return!1}return h.length===Object.keys(e).length}if(!f(e,l)||!P(t[l],e[l],r,c))return!1}for(l=0;l<s.length;l++){var d=s[l];if(!P(t[d],e[d],r,c))return!1}return!0}(t,e,r,l,s,c);return s.val1.delete(t),s.val2.delete(e),_}function D(t,e,r,n){for(var i=o(t),s=0;s<i.length;s++){var a=i[s];if(P(e,a,r,n))return t.delete(a),!0}return!1}function M(t){switch(i(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(l(t))return!1}return!0}function L(t,e,r){var n=M(r);return null!=n?n:e.has(n)&&!t.has(n)}function B(t,e,r,n,i){var s=M(r);if(null!=s)return s;var o=e.get(s);return!(void 0===o&&!e.has(s)||!P(n,o,!1,i))&&!t.has(s)&&P(n,o,!1,i)}function q(t,e,r,n,i,s){for(var a=o(t),c=0;c<a.length;c++){var u=a[c];if(P(r,u,i,s)&&P(n,e.get(u),i,s))return t.delete(u),!0}return!1}t.exports={isDeepEqual:function(t,e){return P(t,e,!1)},isDeepStrictEqual:function(t,e){return P(t,e,!0)}}},6785:t=>{"use strict";t.exports=TypeError},6822:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},6866:(t,e,r)=>{"use strict";r.d(e,{$Q:()=>i,BR:()=>y,Fn:()=>v,H:()=>A,JG:()=>b,K9:()=>w,Kk:()=>n,MG:()=>d,P2:()=>o,QW:()=>s,S:()=>u,_0:()=>g,bD:()=>l,bM:()=>m,hu:()=>_,i2:()=>f,ic:()=>a,lc:()=>h,ny:()=>p,r0:()=>c,sT:()=>x});const n="NamedNode",i="BlankNode",s="Literal",o="Variable",a="DefaultGraph",c="Collection",u="Empty",l="Graph",h="text/html",f="application/ld+json",p="text/n3",d="application/n3",y="application/nquads",g="application/n-quads",m="application/n-triples",b="application/rdf+xml",w="application/sparql-update",v="application/sparql-update-single-match",x="text/turtle",_="application/x-turtle",A="application/xhtml+xml"},7051:(t,e,r)=>{"use strict";var n=r(6601),i=r(5421),s=r(2621),o=r(1320),a=r(5074),c=n(o(),Number);i(c,{getPolyfill:o,implementation:s,shim:a}),t.exports=c},7106:(t,e,r)=>{"use strict";var n=r(6822),i=r(3766),s=r(9302);t.exports=n?function(t){return n(t)}:i?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return i(t)}:s?function(t){return s(t)}:null},7114:(t,e,r)=>{"use strict";r.r(e),r.d(e,{DOMParserFactory:()=>f,RDFArrayRemove:()=>v,callbackify:()=>h,domToString:()=>p,dtstamp:()=>y,dumpNode:()=>d,heavyCompare:()=>g,heavyCompareSPO:()=>m,linkRelationProperty:()=>l,log:()=>n.A,mediaTypeClass:()=>u,output:()=>b,parseXML:()=>w,stackString:()=>_,string:()=>c,string_startswith:()=>x,uri:()=>i});var n=r(3787),i=r(4221),s=r(3627),o=r(8392);t=r.hmd(t);var a=r(6357);const c={template:function(t,e){for(var r=t.split("%s"),n="",i=0;i<e.length;i++)e[i]+="",n+=r[i]+e[i];return n+r.slice(e.length).join()}};function u(t){return t=t.split(";")[0].trim(),new s.A("http://www.w3.org/ns/iana/media-types/"+t+"#Resource")}function l(t){return new s.A("http://www.w3.org/ns/iana/link-relations/relation#"+t.trim())}function h(t,e){t.callbacks={};for(var r=e.length-1;r>=0;r--)t.callbacks[e[r]]=[];t.addHook=function(e){t.callbacks[e]||(t.callbacks[e]=[])},t.addCallback=function(e,r){t.callbacks[e].push(r)},t.removeCallback=function(e,r){for(var n=0;n<t.callbacks[e].length;n++)if(t.callbacks[e][n].name===r)return t.callbacks[e].splice(n,1),!0;return!1},t.insertCallback=function(e,r){t.callbacks[e].unshift(r)},t.fireCallbacks=function(e,r){var n,i=[],s=[],o=t.callbacks[e].length;let a;for(n=o-1;n>=0;n--)a=t.callbacks[e][n],a&&a.apply(t,r)&&i.push(a);for(n=i.length-1;n>=0;n--)s.push(i[n]);for(n=o;n<t.callbacks[e].length;n++)s.push(t.callbacks[e][n]);t.callbacks[e]=s}}function f(){return window.DOMParser?new o.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function p(t,e){var r=[];(e=e||{})&&e.selfClosing&&e.selfClosing.split(" ").forEach((function(t){r[t]=!0}));var n=[];return e&&e.skipAttributes&&e.skipAttributes.split(" ").forEach((function(t){n[t]=!0})),d(t,e,r,n)}function d(t,e,r,n){var i,s="",o=[!1];if(void 0===t.nodeType)return s;if(1===t.nodeType){if(t.hasAttribute("class")&&e&&e.classWithChildText&&t.matches(e.classWithChildText.class))s+=t.querySelector(e.classWithChildText.element).textContent;else if(!(e&&e.skipNodeWithClass&&t.matches("."+e.skipNodeWithClass))){var c=t.nodeName.toLowerCase();s+="<"+c;var u=[];for(i=t.attributes.length-1;i>=0;i--){var l=t.attributes[i];if(!(n&&n.length>0&&n[l.name]||/^\d+$/.test(l.name))){if("class"===l.name&&e&&e.replaceClassItemWith&&l.value.split(" ").indexOf(e.replaceClassItemWith.source)>-1){var h=new RegExp(e.replaceClassItemWith.source,"g");l.value=l.value.replace(h,e.replaceClassItemWith.target).trim()}"class"===l.name&&e&&e.skipClassWithValue&&e.skipClassWithValue===l.value||u.push(l.name+"='"+l.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&quot;")+"'")}}if(u.length>0&&(e&&e.sortAttributes&&u.sort((function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())})),s+=" "+u.join(" ")),r&&r.ename)s+=" />";else{for(s+=">",s+="html"===c?"\n ":"",o.push("style"===c||"script"===c),i=0;i<t.childNodes.length;i++)s+=d(t.childNodes[i]);o.pop(),s+="body"===c?"</"+c+">\n":"</"+c+">"}}}else if(8===t.nodeType)s+="\x3c!--"+t.nodeValue+"--\x3e";else if(3===t.nodeType||4===t.nodeType){var f=t.nodeValue.replace(/\n+$/,"");s+=o[o.length-1]?f:f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else a.log("Warning; Cannot handle serialising nodes of type: "+t.nodeType),a.log(t);return s}function y(){var t=new Date,e=t.getYear()+1900,r=t.getMonth()+1,n=t.getDate(),i=t.getUTCHours(),s=t.getUTCMinutes(),o=t.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),s<10&&(s="0"+s),o<10&&(o="0"+o),e+"-"+r+"-"+n+"T"+i+":"+s+":"+o+"Z"}function g(t,e,r,n){var i=function(t){return"BlankNode"===t.termType?null:t},s=function(t){var e=r.statementsMatching(t).map((function(t){return i(t.subject)+" "+i(t.predicate)+" "+i(t.object)})).concat(r.statementsMatching(void 0,void 0,t).map((function(t){return i(t.subject)+" "+i(t.predicate)+" "+i(t.object)})));return e.sort(),e.join("\n")};const o=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(t,e):t.compareTerm(e);return"BlankNode"===t.termType&&"BlankNode"===e.termType?0===o?0:s(t)>s(e)?1:s(t)<s(e)?-1:o:n&&t.uri&&e.uri?(n[t.uri]||t.uri).localeCompare(n[e.uri]||e.uri):o}function m(t,e,r,n){return g(t.subject,e.subject,r,n)||g(t.predicate,e.predicate,r,n)||g(t.object,e.object,r,n)}function b(t){var e=document.createElement("div");e.textContent=t,document.body.appendChild(e)}function w(e,r){return r=r||{},t&&t.exports?(new o.DOMParser).parseFromString(e,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new o.DOMParser).parseFromString(e,"application/xml")}function v(t,e){for(var r=0;r<t.length;r++)if(t[r].subject.equals(e.subject)&&t[r].predicate.equals(e.predicate)&&t[r].object.equals(e.object)&&t[r].why.equals(e.why))return void t.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+e+" "+e.why)}function x(t,e){return t.slice(0,e.length)===e}function _(t){var e=t+"\n";if(!t.stack)return e+"No stack available.\n";for(var r=t.stack.toString().split("\n"),n=[],i=0;i<r.length;i++){var s=r[i];if(s.indexOf("ecmaunit.js")>-1)break;"("==s.charAt(0)&&(s="function"+s);var o=s.split("@");n.push(o)}for(i=0;i<n.length;i++)e+=" "+n[i][1]+"\n "+n[i][0];return e}},7187:(t,e,r)=>{var n=r(9964),i=r(6357),s=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},o=/%[sdj%]/g;e.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(l(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(t).replace(o,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r<i;a=n[++r])b(a)||!A(a)?s+=" "+a:s+=" "+l(a);return s},e.deprecate=function(t,r){if(void 0!==n&&!0===n.noDeprecation)return t;if(void 0===n)return function(){return e.deprecate(t,r).apply(this,arguments)};var s=!1;return function(){if(!s){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?i.trace(r):i.error(r),s=!0}return t.apply(this,arguments)}};var a={},c=/^$/;if(n.env.NODE_DEBUG){var u=n.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),c=new RegExp("^"+u+"$","i")}function l(t,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&e._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,t,n.depth)}function h(t,e){var r=l.styles[e];return r?"["+l.colors[r][0]+"m"+t+"["+l.colors[r][1]+"m":t}function f(t,e){return t}function p(t,r,n){if(t.customInspect&&r&&N(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=p(t,i,n)),i}var s=function(t,e){if(x(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return w(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(s)return s;var o=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(r)),E(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return d(r);if(0===o.length){if(N(r)){var c=r.name?": "+r.name:"";return t.stylize("[Function"+c+"]","special")}if(_(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(T(r))return t.stylize(Date.prototype.toString.call(r),"date");if(E(r))return d(r)}var u,l="",h=!1,f=["{","}"];return g(r)&&(h=!0,f=["[","]"]),N(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(l=" "+RegExp.prototype.toString.call(r)),T(r)&&(l=" "+Date.prototype.toUTCString.call(r)),E(r)&&(l=" "+d(r)),0!==o.length||h&&0!=r.length?n<0?_(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),u=h?function(t,e,r,n,i){for(var s=[],o=0,a=e.length;o<a;++o)R(e,String(o))?s.push(y(t,e,r,n,String(o),!0)):s.push("");return i.forEach((function(i){i.match(/^\d+$/)||s.push(y(t,e,r,n,i,!0))})),s}(t,r,n,a,o):o.map((function(e){return y(t,r,n,a,e,h)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(u,l,f)):f[0]+l+f[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function y(t,e,r,n,i,s){var o,a,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),R(n,i)||(o="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(a=b(r)?p(t,c.value,null):p(t,c.value,r-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),x(o)){if(s&&i.match(/^\d+$/))return a;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function g(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function b(t){return null===t}function w(t){return"number"==typeof t}function v(t){return"string"==typeof t}function x(t){return void 0===t}function _(t){return A(t)&&"[object RegExp]"===O(t)}function A(t){return"object"==typeof t&&null!==t}function T(t){return A(t)&&"[object Date]"===O(t)}function E(t){return A(t)&&("[object Error]"===O(t)||t instanceof Error)}function N(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function j(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!a[t])if(c.test(t)){var r=n.pid;a[t]=function(){var n=e.format.apply(e,arguments);i.error("%s %d: %s",t,r,n)}}else a[t]=function(){};return a[t]},e.inspect=l,l.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]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(9490),e.isArray=g,e.isBoolean=m,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=w,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=x,e.isRegExp=_,e.types.isRegExp=_,e.isObject=A,e.isDate=T,e.types.isDate=T,e.isError=E,e.types.isNativeError=E,e.isFunction=N,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(1201);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;i.log("%s - %s",(r=[j((t=new Date).getHours()),j(t.getMinutes()),j(t.getSeconds())].join(":"),[t.getDate(),S[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(9784),e._extend=function(t,e){if(!e||!A(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(k&&t[k]){var e;if("function"!=typeof(e=t[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,k,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),k&&Object.defineProperty(e,k,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,s(t))},e.promisify.custom=k,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var i=e.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var s=this,o=function(){return i.apply(s,arguments)};t.apply(this,e).then((function(t){n.nextTick(o.bind(null,null,t))}),(function(t){n.nextTick(I.bind(null,t,o))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,s(t)),e}},7450:t=>{"use strict";t.exports=Math.floor},7552:t=>{"use strict";t.exports=Math.min},7770:t=>{"use strict";t.exports=SyntaxError},7802:(t,e,r)=>{"use strict";var n=r(5049),i=r(3036),s=r(78),o=r(1909);t.exports=o||n.call(s,i)},7900:t=>{"use strict";t.exports=ReferenceError},7906:(t,e,r)=>{"use strict";var n=r(6626)(),i=r(7913)("Object.prototype.toString"),s=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},o=function(t){return!!s(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return s(arguments)}();s.isLegacyArguments=o,t.exports=a?s:o},7913:(t,e,r)=>{"use strict";var n=r(8651),i=r(6601),s=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&s(t,".prototype.")>-1?i(r):r}},8109:(t,e,r)=>{"use strict";var n=r(5567);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},8392:e=>{"use strict";e.exports=t},8404:(t,e,r)=>{"use strict";var n=r(3746),i=Object.prototype.toString,s=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var o,a;arguments.length>=3&&(o=r),a=t,"[object Array]"===i.call(a)?function(t,e,r){for(var n=0,i=t.length;n<i;n++)s.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,o):"string"==typeof t?function(t,e,r){for(var n=0,i=t.length;n<i;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,o):function(t,e,r){for(var n in t)s.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,o)}},8461:(t,e,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,s=Object.prototype.toString,o=r(6515),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$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 t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===s.call(t),n=o(t),a=e&&"[object String]"===s.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=u&&r;if(a&&t.length>0&&!i.call(t,0))for(var y=0;y<t.length;++y)f.push(String(y));if(n&&t.length>0)for(var g=0;g<t.length;++g)f.push(String(g));else for(var m in t)d&&"prototype"===m||!i.call(t,m)||f.push(String(m));if(c)for(var b=function(t){if("undefined"==typeof window||!p)return h(t);try{return h(t)}catch(t){return!1}}(t),w=0;w<l.length;++w)b&&"constructor"===l[w]||!i.call(t,l[w])||f.push(l[w]);return f}}t.exports=n},8527:(t,e,r)=>{"use strict";var n=r(5421),i=r(6601),s=r(3249),o=r(9636),a=r(3534),c=i(o(),Object);n(c,{getPolyfill:o,implementation:s,shim:a}),t.exports=c},8540:t=>{const e={acl:"http://www.w3.org/ns/auth/acl#",arg:"http://www.w3.org/ns/pim/arg#",as:"https://www.w3.org/ns/activitystreams#",bookmark:"http://www.w3.org/2002/01/bookmark#",cal:"http://www.w3.org/2002/12/cal/ical#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/",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#",gr:"http://purl.org/goodrelations/v1#",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#",pto:"http://www.productontology.org/id/",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#",skos:"http://www.w3.org/2004/02/skos/core#",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#",vann:"http://purl.org/vocab/vann/",vcard:"http://www.w3.org/2006/vcard/ns#",wf:"http://www.w3.org/2005/01/wf/flow#",xsd:"http://www.w3.org/2001/XMLSchema#"};t.exports=function(t={namedNode:t=>t}){const r={};for(const n in e){const i=e[n];r[n]=function(e=""){return t.namedNode(i+e)}}return r}},8619:(t,e,r)=>{"use strict";var n=r(5049),i=r(3036),s=r(7802);t.exports=function(){return s(n,i,arguments)}},8651:(t,e,r)=>{"use strict";var n,i=r(5846),s=r(5293),o=r(9055),a=r(8888),c=r(7900),u=r(7770),l=r(6785),h=r(4055),f=r(716),p=r(7450),d=r(3774),y=r(7552),g=r(5874),m=r(9292),b=r(6071),w=Function,v=function(t){try{return w('"use strict"; return ('+t+").constructor;")()}catch(t){}},x=r(8109),_=r(6649),A=function(){throw new l},T=x?function(){try{return A}catch(t){try{return x(arguments,"callee").get}catch(t){return A}}}():A,E=r(3257)(),N=r(7106),O=r(3766),j=r(6822),S=r(3036),R=r(78),k={},I="undefined"!=typeof Uint8Array&&N?N(Uint8Array):n,C={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":E&&N?N([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":s,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":k,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&N?N(N([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&N?N((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&N?N((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&N?N(""[Symbol.iterator]()):n,"%Symbol%":E?Symbol:n,"%SyntaxError%":u,"%ThrowTypeError%":T,"%TypedArray%":I,"%TypeError%":l,"%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%":h,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":R,"%Function.prototype.apply%":S,"%Object.defineProperty%":_,"%Object.getPrototypeOf%":O,"%Math.abs%":f,"%Math.floor%":p,"%Math.max%":d,"%Math.min%":y,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":b,"%Reflect.getPrototypeOf%":j};if(N)try{null.error}catch(t){var P=N(N(t));C["%Error.prototype%"]=P}var F=function t(e){var r;if("%AsyncFunction%"===e)r=v("async function () {}");else if("%GeneratorFunction%"===e)r=v("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=v("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&N&&(r=N(i.prototype))}return C[e]=r,r},U={__proto__:null,"%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"]},D=r(5049),M=r(5215),L=D.call(R,Array.prototype.concat),B=D.call(S,Array.prototype.splice),q=D.call(R,String.prototype.replace),$=D.call(R,String.prototype.slice),H=D.call(R,RegExp.prototype.exec),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,X=/\\(\\)?/g,V=function(t,e){var r,n=t;if(M(U,n)&&(n="%"+(r=U[n])[0]+"%"),M(C,n)){var i=C[n];if(i===k&&(i=F(n)),void 0===i&&!e)throw new l("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new u("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new l('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=$(t,0,1),r=$(t,-1);if("%"===e&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new u("invalid intrinsic syntax, expected opening `%`");var n=[];return q(t,z,(function(t,e,r,i){n[n.length]=r?q(i,X,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=V("%"+n+"%",e),s=i.name,o=i.value,a=!1,c=i.alias;c&&(n=c[0],B(r,L([0,1],c)));for(var h=1,f=!0;h<r.length;h+=1){var p=r[h],d=$(p,0,1),y=$(p,-1);if(('"'===d||"'"===d||"`"===d||'"'===y||"'"===y||"`"===y)&&d!==y)throw new u("property names with quotes must have matching quotes");if("constructor"!==p&&f||(a=!0),M(C,s="%"+(n+="."+p)+"%"))o=C[s];else if(null!=o){if(!(p in o)){if(!e)throw new l("base intrinsic for "+t+" exists, but the property is not available.");return}if(x&&h+1>=r.length){var g=x(o,p);o=(f=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[p]}else f=M(o,p),o=o[p];f&&!a&&(C[s]=o)}}return o}},8888:t=>{"use strict";t.exports=RangeError},8890:(t,e,r)=>{"use strict";var n=r(6649),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},9029:(t,e)=>{e.read=function(t,e,r,n,i){var s,o,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,s=p&(1<<-l)-1,p>>=-l,l+=a;l>0;s=256*s+t[e+h],h+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+t[e+h],h+=f,l-=8);if(0===s)s=1-u;else{if(s===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),s-=u}return(p?-1:1)*o*Math.pow(2,s-n)},e.write=function(t,e,r,n,i,s){var o,a,c,u=8*s-i-1,l=(1<<u)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(o++,c/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(e*c-1)*Math.pow(2,i),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;t[r+p]=255&o,p+=d,o/=256,u-=8);t[r+p-d]|=128*y}},9055:t=>{"use strict";t.exports=EvalError},9292:t=>{"use strict";t.exports=Math.round},9295:(t,e,r)=>{"use strict";var n=r(6649),i=r(7770),s=r(6785),o=r(8109);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!o&&o(t,e);if(n)n(t,e,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:r,writable:null===c&&h?h.writable:!c});else{if(!l&&(a||c||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},9302:(t,e,r)=>{"use strict";var n,i=r(6688),s=r(8109);try{n=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var o=!!n&&s&&s(Object.prototype,"__proto__"),a=Object,c=a.getPrototypeOf;t.exports=o&&"function"==typeof o.get?i([o.get]):"function"==typeof c&&function(t){return c(null==t?t:a(t))}},9390:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},9490:(t,e,r)=>{"use strict";var n=r(7906),i=r(4610),s=r(3381),o=r(6094);function a(t){return t.call.bind(t)}var c="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,l=a(Object.prototype.toString),h=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(c)var d=a(BigInt.prototype.valueOf);if(u)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function m(t){return"[object Map]"===l(t)}function b(t){return"[object Set]"===l(t)}function w(t){return"[object WeakMap]"===l(t)}function v(t){return"[object WeakSet]"===l(t)}function x(t){return"[object ArrayBuffer]"===l(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(x.working?x(t):t instanceof ArrayBuffer)}function A(t){return"[object DataView]"===l(t)}function T(t){return"undefined"!=typeof DataView&&(A.working?A(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=o,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):o(t)||T(t)},e.isUint8Array=function(t){return"Uint8Array"===s(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===s(t)},e.isUint16Array=function(t){return"Uint16Array"===s(t)},e.isUint32Array=function(t){return"Uint32Array"===s(t)},e.isInt8Array=function(t){return"Int8Array"===s(t)},e.isInt16Array=function(t){return"Int16Array"===s(t)},e.isInt32Array=function(t){return"Int32Array"===s(t)},e.isFloat32Array=function(t){return"Float32Array"===s(t)},e.isFloat64Array=function(t){return"Float64Array"===s(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===s(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===s(t)},m.working="undefined"!=typeof Map&&m(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(m.working?m(t):t instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(b.working?b(t):t instanceof Set)},w.working="undefined"!=typeof WeakMap&&w(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(w.working?w(t):t instanceof WeakMap)},v.working="undefined"!=typeof WeakSet&&v(new WeakSet),e.isWeakSet=function(t){return v(t)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),e.isArrayBuffer=_,A.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&A(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=T;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function N(t){return"[object SharedArrayBuffer]"===l(t)}function O(t){return void 0!==E&&(void 0===N.working&&(N.working=N(new E)),N.working?N(t):t instanceof E)}function j(t){return g(t,h)}function S(t){return g(t,f)}function R(t){return g(t,p)}function k(t){return c&&g(t,d)}function I(t){return u&&g(t,y)}e.isSharedArrayBuffer=O,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=j,e.isStringObject=S,e.isBooleanObject=R,e.isBigIntObject=k,e.isSymbolObject=I,e.isBoxedPrimitive=function(t){return j(t)||S(t)||R(t)||k(t)||I(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||O(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9636:(t,e,r)=>{"use strict";var n=r(3249);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},9784:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},9964:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var a,c=[],u=!1,l=-1;function h(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&f())}function f(){if(!u){var t=o(h);u=!0;for(var e=c.length;e;){for(a=c,c=[];++l<e;)a&&a[l].run();l=-1,e=c.length}a=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new p(t,e)),1!==c.length||u||o(f)},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=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={id:t,loaded:!1,exports:{}};return s[t].call(r.exports,r,r.exports,a),r.loaded=!0,r.exports}a.m=s,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},r=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,a.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var i=Object.create(null);a.r(i);var s={};e=e||[null,r({}),r([]),r(r)];for(var o=2&n&&t;"object"==typeof o&&!~e.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach((e=>s[e]=()=>t[e]));return s.default=()=>t,a.d(i,s),i},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,r)=>(a.f[r](t,e),e)),[])),a.u=t=>t+".rdflib.min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n={},i="$rdf:",a.l=(t,e,r,s)=>{if(n[t])n[t].push(e);else{var o,c;if(void 0!==r)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var h=u[l];if(h.getAttribute("src")==t||h.getAttribute("data-webpack")==i+r){o=h;break}}o||(c=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,a.nc&&o.setAttribute("nonce",a.nc),o.setAttribute("data-webpack",i+r),o.src=t),n[t]=[e];var f=(e,r)=>{o.onerror=o.onload=null,clearTimeout(p);var i=n[t];if(delete n[t],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach((t=>t(r))),e)return e(r)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),c&&document.head.appendChild(o)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),(()=>{var t={792:0};a.f.j=(e,r)=>{var n=a.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,i)=>n=t[e]=[r,i]));r.push(n[2]=i);var s=a.p+a.u(e),o=new Error;a.l(s,(r=>{if(a.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.src;o.message="Loading chunk "+e+" failed.\n("+i+": "+s+")",o.name="ChunkLoadError",o.type=i,o.request=s,n[1](o)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,i,[s,o,c]=r,u=0;if(s.some((e=>0!==t[e]))){for(n in o)a.o(o,n)&&(a.m[n]=o[n]);c&&c(a)}for(e&&e(r);u<s.length;u++)i=s[u],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0},r=self.webpackChunk$rdf=self.webpackChunk$rdf||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var c={};return(()=>{"use strict";a.r(c),a.d(c,{BlankNode:()=>i,Collection:()=>f,ConnectedStore:()=>or,DataFactory:()=>qe,Empty:()=>p,Fetcher:()=>Fe,Formula:()=>B,IndexedFormula:()=>J,Literal:()=>l,LiveStore:()=>ar,N3Parser:()=>bt,NamedNode:()=>s.A,Namespace:()=>N,NextId:()=>sr,Node:()=>q,Query:()=>z,RDFParser:()=>de,RDFaProcessor:()=>fe,SPARQLToQuery:()=>Me,Serializer:()=>C,Statement:()=>b,Store:()=>J,UpdateManager:()=>Le,UpdatesSocket:()=>$e,UpdatesVia:()=>He,Util:()=>O,Variable:()=>v,blankNode:()=>Ye,defaultGraph:()=>Ze,fetcher:()=>Xe,fromNT:()=>nr,graph:()=>Ve,isBlankNode:()=>o.jt,isCollection:()=>o.P3,isGraph:()=>o.RN,isLiteral:()=>o.c$,isNamedNode:()=>o.Y2,isPredicate:()=>o.YC,isQuad:()=>o.aF,isRDFObject:()=>o.GE,isRDFlibObject:()=>o.DJ,isRDFlibPredicate:()=>o.fY,isRDFlibSubject:()=>o.CZ,isStatement:()=>o.SH,isStore:()=>o.ok,isSubject:()=>o.hr,isTerm:()=>o.D0,isVariable:()=>o.DZ,jsonParser:()=>Ue,lit:()=>Ge,literal:()=>Ke,log:()=>E.A,namedNode:()=>We,parse:()=>ge,quad:()=>tr,queryToSPARQL:()=>De,serialize:()=>F,sparqlUpdateParser:()=>ye,st:()=>Qe,sym:()=>We,term:()=>ir,termValue:()=>we.E,triple:()=>er,uri:()=>w,variable:()=>Je});var t=a(939),e=a(9390),r=a(1605),n=a(6866);class i extends r.A{static getId(t){if(t){if("string"!=typeof t)throw new Error("Bad id argument to new blank node: "+t);if(t.includes("#")){let e=t.split("#");return e[e.length-1]}return t}return"n"+i.nextId++}constructor(r){super(i.getId(r)),(0,t.A)(this,"termType",n.$Q),(0,t.A)(this,"classOrder",e.A.BlankNode),(0,t.A)(this,"isBlank",1),(0,t.A)(this,"isVar",1)}get id(){return this.value}set id(t){this.value=t}compareTerm(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.id<t.id?-1:this.id>t.id?1:0}copy(t){var e=new i;return t.copyTo(this,e),e}toCanonical(){return i.NTAnonymousNodePrefix+this.value}toString(){return i.NTAnonymousNodePrefix+this.id}}(0,t.A)(i,"nextId",0),(0,t.A)(i,"NTAnonymousNodePrefix","_:");var s=a(3627),o=a(546);const u={boolean:new s.A("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new s.A("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new s.A("http://www.w3.org/2001/XMLSchema#decimal"),double:new s.A("http://www.w3.org/2001/XMLSchema#double"),integer:new s.A("http://www.w3.org/2001/XMLSchema#integer"),langString:new s.A("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new s.A("http://www.w3.org/2001/XMLSchema#string")};class l extends r.A{constructor(r,i,o){super(r),(0,t.A)(this,"termType",n.QW),(0,t.A)(this,"classOrder",e.A.Literal),(0,t.A)(this,"datatype",u.string),(0,t.A)(this,"isVar",0),(0,t.A)(this,"language",""),i?(this.language=i,this.datatype=u.langString):this.datatype=o?s.A.fromValue(o):u.string}copy(){return new l(this.value,this.lang,this.datatype)}equals(t){return!!t&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&(!this.datatype&&!t.datatype||this.datatype&&this.datatype.equals(t.datatype))}get lang(){return this.language}set lang(t){this.language=t||""}toNT(){return l.toNT(this)}static toNT(t){if("number"==typeof t.value)return""+t.value;if("string"!=typeof t.value)throw new Error("Value of RDF literal is not string or number: "+t.value);var e=t.value;return e='"'+(e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',t.language?e+="@"+t.language:t.datatype.equals(u.string)||(e+="^^"+t.datatype.toCanonical()),e}toString(){return""+this.value}static fromBoolean(t){return new l(t?"1":"0",null,u.boolean)}static fromDate(t){if(!(t instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");let e=function(t){return(""+(100+t)).slice(1,3)},r=t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"Z";return new l(r,null,u.dateTime)}static fromNumber(t){if("number"!=typeof t)throw new TypeError("Invalid argument to Literal.fromNumber()");let e;const r=t.toString();return e=r.indexOf("e")<0&&Math.abs(t)<=Number.MAX_SAFE_INTEGER?Number.isInteger(t)?u.integer:u.decimal:u.double,new l(r,null,e)}static fromValue(t){if((0,o.c$)(t))return t;switch(typeof t){case"object":if(t instanceof Date)return l.fromDate(t);case"boolean":return l.fromBoolean(t);case"number":return l.fromNumber(t);case"string":return new l(t)}throw new Error("Can't make literal from "+t+" of type "+typeof t)}}function h(t){return null==t||(0,o.D0)(t)?t:Array.isArray(t)?new f(t):l.fromValue(t)}class f extends r.A{constructor(r){super((i.nextId++).toString()),(0,t.A)(this,"termType",n.r0),(0,t.A)(this,"classOrder",e.A.Collection),(0,t.A)(this,"closed",!1),(0,t.A)(this,"compareTerm",i.prototype.compareTerm),(0,t.A)(this,"elements",[]),(0,t.A)(this,"isVar",0),r&&r.length>0&&r.forEach((t=>{this.elements.push(h(t))}))}get id(){return this.value}set id(t){this.value=t}append(t){return this.elements.push(t)}close(){return this.closed=!0,this.closed}shift(){return this.elements.shift()}substitute(t){const e=this.elements.map((e=>e.substitute(t)));return new f(e)}toNT(){return f.toNT(this)}static toNT(t){return i.NTAnonymousNodePrefix+t.id}toString(){return"("+this.elements.join(" ")+")"}unshift(t){return this.elements.unshift(t)}}(0,t.A)(f,"termType",n.r0);class p extends r.A{constructor(){super(""),(0,t.A)(this,"termType",n.S)}toString(){return"()"}}const d="chrome:theSession";new s.A(d);class y extends r.A{constructor(){super(""),(0,t.A)(this,"value",""),(0,t.A)(this,"termType",n.ic),(0,t.A)(this,"uri",d)}toCanonical(){return this.value}toString(){return"DefaultGraph"}}function g(t){return!!t&&t.termType===n.ic}const m=new y;class b{constructor(e,n,i,s){(0,t.A)(this,"subject",void 0),(0,t.A)(this,"predicate",void 0),(0,t.A)(this,"object",void 0),(0,t.A)(this,"graph",void 0),this.subject=r.A.fromValue(e),this.predicate=r.A.fromValue(n),this.object=r.A.fromValue(i),this.graph=null==s?m:r.A.fromValue(s)}get why(){return this.graph}set why(t){this.graph=t}equals(t){return t.subject.equals(this.subject)&&t.predicate.equals(this.predicate)&&t.object.equals(this.object)&&t.graph.equals(this.graph)}substitute(t){return new b(this.subject.substitute(t),this.predicate.substitute(t),this.object.substitute(t),g(this.graph)?this.graph:this.graph.substitute(t))}toCanonical(){let t=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==n.ic&&t.push(this.graph.toCanonical()),t.join(" ")+" ."}toNT(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}toNQ(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),g(this.graph)?"":this.graph.toNT()].join(" ")+" ."}toString(){return this.toNT()}}var w=a(4221);class v extends r.A{constructor(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(r),(0,t.A)(this,"termType",n.P2),(0,t.A)(this,"base","varid:"),(0,t.A)(this,"classOrder",e.A.Variable),(0,t.A)(this,"isVar",1),(0,t.A)(this,"uri",void 0),this.base="varid:",this.uri=w.join(r,this.base)}equals(t){return!!t&&this.termType===t.termType&&this.value===t.value}hashString(){return this.toString()}substitute(t){var e;return null!=(e=t[this.toNT()])?e:this}toString(){return v.toString(this)}static toString(t){return t.uri.slice(0,t.base.length)===t.base?`?${t.uri.slice(t.base.length)}`:`?${t.uri}`}}let x=function(t){return t.collections="COLLECTIONS",t.defaultGraphType="DEFAULT_GRAPH_TYPE",t.equalsMethod="EQUALS_METHOD",t.id="ID",t.identity="IDENTITY",t.reversibleId="REVERSIBLE_ID",t.variableType="VARIABLE_TYPE",t}({});const _=new y,A={supports:{[x.collections]:!1,[x.defaultGraphType]:!1,[x.equalsMethod]:!0,[x.identity]:!1,[x.id]:!0,[x.reversibleId]:!1,[x.variableType]:!0},blankNode:t=>new i(t),defaultGraph:()=>_,equals(t,e){return t===e||!t||!e||((0,o.aF)(t)||(0,o.aF)(e)?!(!(0,o.aF)(t)||!(0,o.aF)(e))&&this.equals(t.subject,e.subject)&&this.equals(t.predicate,e.predicate)&&this.equals(t.object,e.object)&&this.equals(t.graph,e.graph):!(!(0,o.D0)(t)||!(0,o.D0)(e))&&this.id(t)===this.id(e))},id(t){if(!t)return"undefined";if((0,o.aF)(t))return this.quadToNQ(t);switch(t.termType){case n.ic:return"defaultGraph";case n.P2:return v.toString(t);default:const e=this.termToNQ(t);if(e)return e;throw new Error(`Can't id term with type '${t.termType}'`)}},isQuad:t=>t instanceof b,literal(t,e){if("string"!=typeof t&&!e)return l.fromValue(t);const r="string"==typeof t?t:""+t;return"string"==typeof e?-1===e.indexOf(":")?new l(r,e):new l(r,null,this.namedNode(e)):new l(r,null,e)},namedNode:t=>new s.A(t),quad:(t,e,r,n)=>new b(t,e,r,n||_),triple(t,e,r,n){return this.quad(t,e,r,n)},quadToNQ(t){return`${this.termToNQ(t.subject)} ${this.termToNQ(t.predicate)} ${this.termToNQ(t.object)} ${this.termToNQ(t.graph)} .`},termToNQ(t){switch(t.termType){case n.$Q:return"_:"+t.value;case n.ic:return"";case n.S:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case n.QW:return l.toNT(t);case n.bD:case n.Kk:return"<"+t.value+">";case n.r0:return"("+t.elements.map((t=>this.termToNQ(t))).join(" ")+")";default:throw new Error(`Can't serialize nonstandard term type (was '${t.termType}')`)}},toNQ(t){return this.isQuad(t)?this.quadToNQ(t):this.termToNQ(t)},variable:t=>new v(t)},T=A;var E=a(3787);function N(t,e){const r=e||{namedNode:t=>new s.A(t)};return function(e){return r.namedNode(t+(e||""))}}var O=a(7114);function j(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T;return{boolean:t.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:t.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:t.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:t.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:t.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:t.namedNode("http://www.w3.org/2001/XMLSchema#string")}}j(T);var S=a(8540),R=a.n(S),k=a(2312),I=a(6357);function C(t){return new P(t)}class P{constructor(e){(0,t.A)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,t.A)(this,"_notNameChars",this._notQNameChars+":"),(0,t.A)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,t.A)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,t.A)(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 t in r){const e=R()()[r[t]](""),n=r[t];this.prefixes[e]=n,this.namespaces[n]=e}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=e,this.rdfFactory=e.rdfFactory||T,this.xsd=j(this.rdfFactory)}setBase(t){return this.base=t,this}setFlags(t){return this.flags=t||"",this}toStr(t){var e=t.toNT();return"Graph"===t.termType&&(this.formulas[e]=t),e}fromStr(t){if("{"===t[0]){var e=this.formulas[t];return e||I.log("No formula object for "+t),e}return this.store.fromNT(t)}setNamespaces(t){for(var e in t)this.setPrefix(e,t[e]);return this}setPrefix(t,e){if("default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e){for(let e in this.prefixes)this.prefixes[e]==t&&delete this.prefixes[e];this.prefixes[e]=t,this.namespaces[t]=e}}suggestPrefix(t,e){"default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e&&(t in this.namespaces||e in this.prefixes||(this.prefixes[e]=t,this.namespaces[t]=e))}suggestNamespaces(t){for(var e in t)this.suggestPrefix(e,t[e]);return this}checkIntegrity(){var t,e;for(t in this.namespaces)if(this.prefixes[this.namespaces[t]]!==t)throw new Error("Serializer integity error 1: "+t+", "+this.namespaces[t]+", "+this.prefixes[this.namespaces[t]]+"!");for(e in this.prefixes)if(this.namespaces[this.prefixes[e]]!==e)throw new Error("Serializer integity error 2: "+e+", "+this.prefixs[e]+", "+this.namespaces[this.prefixes[e]]+"!")}makeUpPrefix(t){var e=t,r=function(e){return!!this.validPrefix.test(e)&&"ns"!==e&&!(e in this.namespaces)&&(this.prefixes[t]=e,this.namespaces[e]=t,e)}.bind(this);"#/".indexOf(e[e.length-1])>=0&&(e=e.slice(0,-1));var n=e.lastIndexOf("/");n>=0&&(e=e.slice(n+1));for(var i=0;i<e.length&&this.prefixchars.indexOf(e[i]);)i++;if((e=e.slice(0,i)).length<6&&r(e))return e;if(r(e.slice(0,3)))return e.slice(0,3);if(r(e.slice(0,2)))return e.slice(0,2);if(r(e.slice(0,4)))return e.slice(0,4);if(r(e.slice(0,1)))return e.slice(0,1);if(r(e.slice(0,5)))return e.slice(0,5);this.validPrefix.test(e)||(e="n");for(var s=0;;s++)if(r(e.slice(0,3)+s))return e.slice(0,3)+s}rootSubjects(t){for(var e={},r={},n={},i=0;i<t.length;i++){var s=t[i],o=function(t){e.hasOwnProperty(t)||(e[t]=[]),e[t].push(s.subject)};[s.subject,s.predicate,s.object].map((function(t){"BlankNode"===t.termType?n[t.toNT()]=!0:"Collection"===t.termType&&t.elements.forEach((function(t){o(t)}))})),o(t[i].object);var a=r[this.toStr(s.subject)];a||(a=[]),a.push(s),r[this.toStr(s.subject)]=a}var c=[];for(var u in r)if(r.hasOwnProperty(u)){var l=this.fromStr(u);"BlankNode"===l.termType&&e[l]&&1===e[l].length||c.push(l)}this.incoming=e;for(var h={},f=0;f<c.length;f++)h[c[f].toNT()]=!0;return{roots:c,subjects:r,rootsHash:h,incoming:e}}toN3(t){return this.statementsToN3(t.statements)}explicitURI(t){var e;return this.flags.indexOf("r")<0&&this.base?t=w.refTo(this.base,t):this.flags.indexOf("u")>=0?t=function(t){for(var e,r="",n=0;n<t.length;n++)r+=(e=t.charCodeAt(n))>65535?"\\U"+("00000000"+e.toString(16)).slice(-8):e>126?"\\u"+("0000"+e.toString(16)).slice(-4):t[n];return r}(t):(e=decodeURI(t),t=encodeURI(e)),"<"+t+">"}statementsToNTriples(t){var e=t.slice();e.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,s=this.store,o=this.rdfFactory,a=function(t){if("Collection"!==t.termType)return i.atomicTermToN3(t);for(var e=t.elements,c=s.sym(n+"nill"),u=e.length-1;u>=0;u--){var l=o.blankNode();r+=a(l)+" "+a(s.sym(n+"first"))+" "+a(e[u])+".\n",r+=a(l)+" "+a(s.sym(n+"rest"))+" "+a(c)+".\n",c=l}return i.atomicTermToN3(c)},c=0;c<e.length;c++){var u=e[c],l="";l+=a(u.subject)+" ",l+=a(u.predicate)+" ",l+=a(u.object)+" ",this.flags.indexOf("q")>=0&&(l+=a(u.why)+" "),r+=l+=".\n"}return r}statementsToN3(t){var e=this.store,r={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};t.sort((function(t,n){return O.heavyCompareSPO(t,n,e,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(t){for(var e="",r=0;r<t;r++)e+=" ";return e},s=function(t){for(var e="",r=0;r<t.length;r++){var n=t[r],i="string"==typeof n?n:s(n);if(0!==r){var o=e.slice(-1)||" ";","===i||";"===i||("."!==i||"0123456789.:".includes(o))&&(e+=" ")}e+=i}return e},o=function(t,e){var r="",n=1e5;void 0===e&&(e=-1);for(var a=0;a<t.length;a++){var c=t[a];if("string"!=typeof c){var u=o(c,e+1);if(u.length<10*(80-4*e)&&u.indexOf('"""')<0){var l=s(c);l.length<80-4*e&&(c=l,u="")}u&&(n=1e4),r+=u}if("string"==typeof c){if(1===c.length&&"\n"===r.slice(-1)&&",.;".indexOf(c)>=0){r=r.slice(0,-1),"."==c&&"0123456789.:".includes(r.charAt(r.length-1))&&(r+=" ",n+=1),r+=c+"\n",n+=1;continue}if(n<4*e+4||n+c.length+1<80&&";.".indexOf(r[r.length-2])<0)r=r.slice(0,-1)+" "+c+"\n",n+=c.length+1;else{let t=i(4*e)+c;r+=t+"\n",n=t.length,e<0&&(r+="\n",n=1e5)}}}return r},a=function(t){for(var e=this.rootSubjects(t),r=e.roots,n=[],i=0;i<r.length;i++){var s=r[i];n.push(c(s,e))}return n}.bind(this);function c(t,e){return"BlankNode"!==t.termType||e.incoming[t]?[h(t,e)].concat([u(t,e)]).concat(["."]):l(t,e,!0).concat(["."])}var u=function(t,e){var r=[],i=null,s=e.subjects[this.toStr(t)]||[];if(void 0===s)throw new Error("Cant find statements for "+t);for(var o=[],a=0;a<s.length;a++){var c=s[a];c.predicate.uri===i?o.push(","):(i&&(r=r.concat([o]).concat([";"]),o=[]),r.push(n[c.predicate.uri]?n[c.predicate.uri]:h(c.predicate,e))),i=c.predicate.uri,o.push(l(c.object,e))}return r.concat([o])}.bind(this),l=function(t,e,r){return"BlankNode"!==t.termType||!r&&void 0!==e.rootsHash[t.toNT()]?h(t,e):e.subjects[this.toStr(t)]?["[",u(t,e),"]"]:"[]"}.bind(this);P.prototype.termToN3=h;var h=function(t,e){var r,n;switch(t.termType){case"Graph":return(n=(n=["{"]).concat(a(t.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<t.elements.length;r++)n.push([l(t.elements[r],e)]);return n.push(")"),n;default:return this.atomicTermToN3(t)}}.bind(this),f=function(){var t="";for(var e in this.flags.indexOf("d")<0&&this.defaultNamespace&&(t+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(e)&&this.namespacesUsed[e]&&(t+="@prefix "+this.prefixes[e]+": "+this.explicitURI(e)+".\n");return t+"\n"}.bind(this),p=a(t);return f()+o(p)}atomicTermToN3(t,e){switch(t.termType){case"BlankNode":case"Variable":return t.toNT();case"Literal":var r=t.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(t.datatype&&this.flags.indexOf("x")<0)switch(t.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 t=r.toLowerCase().indexOf("e")>0;return r.indexOf(".")<0&&!t&&(r+=".0"),t||(r+="e0"),r}case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===t.value?"true":"false"}var n=this.stringToN3(t.value,this.flags);return t.language?n+="@"+t.language:t.datatype.equals(this.xsd.string)||(n+="^^"+this.atomicTermToN3(t.datatype,e)),n;case"NamedNode":return this.symbolToN3(t);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+t+" of termType: "+t.termType)}}stringToN3(t,e){e||(e="e");var r,n,i,s,o,a="";for(t.length>20&&'"'!==t.slice(-1)&&e.indexOf("n")<0&&(t.indexOf("\n")>0||t.indexOf('"')>0)?(s='"""',o=this.forbidden3):(s='"',o=this.forbidden1),r=0;r<t.length&&(o.lastIndex=0,null!=o.exec(t.slice(r)));){n=r+o.lastIndex-1,a+=t.slice(r,n);var c=t[n];'"'===c&&'"""'===s&&'"""'!==t.slice(n,n+3)?a+=c:(i='\b\f\r\t\v\n\\"'.indexOf(c))>=0?a+="\\"+'bfrtvn\\"'[i]:e.indexOf("e")>=0?a+="\\u"+("000"+c.charCodeAt(0).toString(16).toLowerCase()).slice(-4):a+=c,r=n+1}return s+a+t.slice(r)+s}symbolToN3(t){var e=t.uri,r=e.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=e.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===e.indexOf("http")||0===e.indexOf("ws")||0===e.indexOf("file"))){for(var n=!0,i=r+1;i<e.length;i++)if(this._notNameChars.indexOf(e[i])>=0){n=!1;break}if(n){var s=e.slice(r+1),o=e.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===o&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(s)<0?s:":"+s;var a=this.prefixes[o];if(a||(a=this.makeUpPrefix(o)),a)return this.namespacesUsed[o]=!0,a+":"+s}}return this.explicitURI(e)}writeStore(t){var e=this.store,r=e.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var s in i){var o=e.fromNT(s);n&&o.equals(n)||t("\n"+this.atomicTermToN3(o)+" "+this.atomicTermToN3(e.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(e.statementsMatching(void 0,void 0,void 0,o))+" }.\n")}e.statementsMatching(void 0,e.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){t("\n<"+r.object.value+"> log:metadata {\n");var n=e.statementsMatching(void 0,void 0,void 0,r.subject);t(this.statementsToN3(this.statementsToN3(n))),t("}.\n")}));var a=[];n&&a.push(n);var c=[];a.map((function(t){c=c.concat(e.statementsMatching(void 0,void 0,void 0,t))})),t(this.statementsToN3(c))}statementsToXML(t){var e=[];e["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(t){for(var e="",r=0;r<t;r++)e+=" ";return e},i=function(t){for(var e="",r=0;r<t.length;r++){var n=t[r];e+="string"==typeof n?n:i(n)}return e},s=function(t,e){var r,o="",a=1e5;e||(e=0);for(var c=0;c<t.length;c++){var u=t[c];if("string"!=typeof u){var l=s(u,e+1);l.length<10*(80-4*e)&&l.indexOf('"""')<0&&(r=i(u)).length<80-4*e&&(u=" "+r,l=""),l&&(a=1e4),o+=l}"string"==typeof u&&(a<4*e+4?(o=o.slice(0,-1)+" "+u+"\n",a+=u.length+1):(o+=(r=n(4*e)+u)+"\n",a=r.length))}return o},o=function(t){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var e=this.rootSubjects(t),r=e.roots,n=[],i=0;i<r.length;i++){var s=r[i];n.push(u(s,e))}return n}.bind(this);function a(t){return void 0===t?"@@@undefined@@@@":t.replace(/[&<"]/g,(function(t){switch(t[0]){case"&":return"&amp;";case"<":return"&lt;";case'"':return"&quot;"}}))}var c=function(t){return a(this.base?w.refTo(this.base,t.uri):t.uri)}.bind(this),u=function(t,e){var n,i,s,o,p=[],d=e.subjects[this.toStr(t)];if(void 0===d)return h(t,e);d.sort((function(t,e){var n=t.predicate.uri,i=e.predicate.uri;if(n.substring(0,44)===r||i.substring(0,44)===r)return n.localeCompare(i);var s=n.substring(44),o=i.substring(44),a=parseInt(s,10),c=parseInt(o,10);return isNaN(a)||isNaN(c)||a!==s||c!==o?n.localeCompare(i):a-c}));for(var y=0;y<d.length;y++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(s=d[y]).predicate.uri||n||"NamedNode"!==s.object.termType){if((o=s.predicate).uri.substr(0,44)===r){var g=o.uri.substr(44);g===parseInt(g,10).toString()&&(o=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=f(o),s.object.termType){case"BlankNode":p=1===e.incoming[s.object].length?p.concat(["<"+i+' rdf:parseType="Resource">',u(s.object,e),"</"+i+">"]):p.concat(["<"+i+' rdf:nodeID="'+s.object.toNT().slice(2)+'"/>']);break;case"NamedNode":p=p.concat(["<"+i+' rdf:resource="'+c(s.object)+'"/>']);break;case"Literal":p=p.concat(["<"+i+(s.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(s.object.datatype.uri)+'"')+(s.object.language?' xml:lang="'+s.object.language+'"':"")+">"+a(s.object.value)+"</"+i+">"]);break;case"Collection":p=p.concat(["<"+i+' rdf:parseType="Collection">',l(s.object,e),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+s.object.termType+" into XML")}}else n=s.object;var m=n?f(n):"rdf:Description",b="";return"BlankNode"===t.termType?e.incoming[t]&&1===e.incoming[t].length||(b=' rdf:nodeID="'+t.toNT().slice(2)+'"'):b=' rdf:about="'+c(t)+'"',["<"+m+b+">"].concat([p]).concat(["</"+m+">"])}.bind(this);function l(t,e){for(var r=[],n=0;n<t.elements.length;n++)r.push(u(t.elements[n],e));return r}var h=function(t,e){var r=[],n=e.subjects[this.toStr(t)];if(!n)return r;n.sort();for(var i=0;i<n.length;i++){var s=n[i];switch(s.object.termType){case"BlankNode":r=e.rootsHash[s.object.toNT()]?r.concat(["<"+f(s.predicate)+' rdf:nodeID="'+s.object.toNT().slice(2)+'">',"</"+f(s.predicate)+">"]):r.concat(["<"+f(s.predicate)+' rdf:parseType="Resource">',h(s.object,e),"</"+f(s.predicate)+">"]);break;case"NamedNode":r=r.concat(["<"+f(s.predicate)+' rdf:resource="'+c(s.object)+'"/>']);break;case"Literal":r=r.concat(["<"+f(s.predicate)+(s.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(s.object.datatype.value)+'"')+(s.object.language?' xml:lang="'+s.object.language+'"':"")+">"+a(s.object.value)+"</"+f(s.predicate)+">"]);break;case"Collection":r=r.concat(["<"+f(s.predicate)+' rdf:parseType="Collection">',l(s.object,e),"</"+f(s.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+s.object.termType+" into XML")}}return r}.bind(this),f=function(t){var r=t.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 s=r.slice(n+1),o=r.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===o&&this.flags.indexOf("d")<0)return s;var a=this.prefixes[o];return a||(a=this.makeUpPrefix(o)),e[o]=!0,a+":"+s}.bind(this),p=o(t),d="<rdf:RDF";for(var y in this.defaultNamespace&&(d+=' xmlns="'+a(this.defaultNamespace)+'"'),e)if(e.hasOwnProperty(y)){var g=this.base&&this.flags.includes("z")?w.refTo(this.base,y):y;d+="\n xmlns:"+this.prefixes[y]+'="'+a(g)+'"'}return s([d+=">",p,"</rdf:RDF>"],-1)}statementsToJsonld(t){const e=this.statementsToN3(t),r=k.parse(e);return JSON.stringify(r,null,2)}}function F(t,e,r,i,s,o){r=r||t?.value;const a=o||{};i=i||n.sT;try{var c=C(e);a.flags&&c.setFlags(a.flags);var u=e.statementsMatching(void 0,void 0,void 0,t);switch("namespaces"in e&&c.suggestNamespaces(e.namespaces),a.namespaces&&c.setNamespaces(a.namespaces),c.setBase(r),i){case n.JG:return l(null,c.statementsToXML(u));case n.ny:case n.MG:return l(null,c.statementsToN3(u));case n.sT:case n.hu:return c.setFlags("si"),l(null,c.statementsToN3(u));case n.bM:return c.setFlags("deinprstux"),l(null,c.statementsToNTriples(u));case n.i2:return c.setFlags("si dr"),l(null,c.statementsToJsonld(u));case n._0:case n.BR:return c.setFlags("deinprstux q"),l(null,c.statementsToNTriples(u));default:throw new Error("Serialize: Content-type "+i+" not supported for data write.")}}catch(t){if(s)return s(t,void 0);throw t}function l(t,e){return s?void s(t,e):e}}const U=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],D={first:"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",rest:"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",nil:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};function M(t,e,r){const n=[];return r.reduce(((e,r,i,s)=>{let o;return n.push(t.quad(e,t.namedNode(D.first),s[i])),i<s.length-1?(o=t.blankNode(),n.push(t.quad(e,t.namedNode(D.rest),o))):n.push(t.quad(e,t.namedNode(D.rest),t.namedNode(D.nil))),o}),e),n}function L(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;var n=t.length;for(r<0&&(r=n+r);r<n;r++)if(t[r]===e)return r;return-1}class B extends r.A{constructor(){var r;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};super(""),r=this,this.statements=i,this.constraints=s,this.initBindings=o,this.optional=a,(0,t.A)(this,"termType",n.bD),(0,t.A)(this,"classOrder",e.A.Graph),(0,t.A)(this,"fetcher",void 0),(0,t.A)(this,"isVar",0),(0,t.A)(this,"ns",N),(0,t.A)(this,"rdfFactory",void 0),this.rdfFactory=c&&c.rdfFactory||T;for(const t of U)this[t]=function(){return r.rdfFactory[t](...arguments)}}add(t,e,r,n){return 1===arguments.length&&t.forEach((t=>this.add(t.subject,t.predicate,t.object,t.graph))),this.statements.push(this.rdfFactory.quad(t,e,r,n))}addStatement(t){return this.add(t)}bnode(t){return this.rdfFactory.blankNode(t)}addAll(t){t.forEach((t=>{this.add(t.subject,t.predicate,t.object,t.graph)}))}any(t,e,r,n){const i=this.anyStatementMatching(t,e,r,n);return null==i?null:null==t?i.subject:null==e?i.predicate:null==r?i.object:null}anyValue(t,e,r,n){const i=this.any(t,e,r,n);return i?i.value:void 0}anyJS(t,e,n,i){const s=this.any(t,e,n,i);return s?r.A.toJS(s):void 0}anyStatementMatching(t,e,r,n){let i=this.statementsMatching(t,e,r,n,!0);if(i&&0!==i.length)return i[0]}id(t){return this.rdfFactory.id(t)}statementsMatching(t,e,r,n,i){const s=this.statements.filter((i=>(!t||t.equals(i.subject))&&(!e||e.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))));return i?0===s.length?[]:[s[0]]:s}bottomTypeURIs(t){let e,r,n,i,s,o,a,c;e=[];for(let u in t)if(t.hasOwnProperty(u)){for(c=t[u],a=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(u)),r=!0,i=0,s=a.length;i<s;i++)if(n=a[i],o=n.uri,o in t){r=!1;break}r&&(e[u]=c)}return e}collection(){return new f}each(t,e,r,n){const i=[];let o=this.statementsMatching(t,e,r,n,!1);if(null==t)for(let t=0,e=o.length;t<e;t++)i.push(o[t].subject);else if(null==e)for(let t=0,e=o.length;t<e;t++)i.push(o[t].predicate);else if(null==r)for(let t=0,e=o.length;t<e;t++)i.push(o[t].object);else if(null==n)for(let t=0,e=o.length;t<e;t++)i.push(new s.A(o[t].graph.value));return i}equals(t){return!!t&&this.hashString()===t.hashString()}findMembersNT(t){let e,r,n,i,s,o,a,c,u,l,h,f,p,d;f={},f[t.toNT()]=!0,i={},o=this.transitiveClosure(f,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0);for(let t in o)if(o.hasOwnProperty(t)){a=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(t));for(let t=0,e=a.length;t<e;t++)p=a[t],i[p.subject.toNT()]=p;c=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(t));for(let t=0,r=c.length;t<r;t++)for(s=c[t],u=this.statementsMatching(void 0,s),n=0,e=u.length;n<e;n++)p=u[n],i[p.subject.toNT()]=p;l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(t));for(let t=0,e=l.length;t<e;t++)for(s=l[t],h=this.statementsMatching(void 0,s),d=0,r=h.length;d<r;d++)p=h[d],i[p.object.toNT()]=p}return i}findMemberURIs(t){return this.NTtoURI(this.findMembersNT(t))}findSubClassesNT(t){let e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}findSuperClassesNT(t){let e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypesNT(t){let e,r,n,i,s,o,a,c,u;n="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",u=[],i=this.statementsMatching(t,void 0,void 0);for(let t=0,e=i.length;t<e;t++)if(c=i[t],"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===c.predicate.uri)u[c.object.toNT()]=c;else{s=this.each(c.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"));for(let t=0,e=s.length;t<e;t++)r=s[t],u[r.toNT()]=c}o=this.statementsMatching(void 0,void 0,t);for(let t=0,r=o.length;t<r;t++){c=o[t],a=this.each(c.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"));for(let t=0,r=a.length;t<r;t++)e=a[t],u[e.toNT()]=c}return this.transitiveClosure(u,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypeURIs(t){return this.NTtoURI(this.findTypesNT(t))}connectedStatements(t,e,r){r=r||[];let n=[t],i={},s={},o=[],a=this,c=function(t){let c=function(t){"BlankNode"!==t.termType||i[t.value]||(i[t.value]=!0,n.push(t))},u=a.statementsMatching(null,null,t,e).concat(a.statementsMatching(t,null,null,e));u=u.filter((function(t){if(r[t.predicate.value])return!1;let e=t.toNT();return!s[e]&&(s[e]=!0,!0)})),u.forEach((function(t){c(t.subject),c(t.object)})),o=o.concat(u)};for(;n.length;)c(n.shift());return o}formula(t){return new B}fromNT(t){let e,r,n;switch(t[0]){case"<":return this.sym(t.slice(1,-1));case'"':if(n=void 0,e=void 0,r=t.lastIndexOf('"'),r<t.length-1)if("@"===t[r+1])n=t.slice(r+2);else{if("^^"!==t.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+t);e=this.fromNT(t.slice(r+3))}return t=(t=(t=(t=t.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(t,n||e);case"_":return this.rdfFactory.blankNode(t.slice(2));case"?":return new v(t.slice(1))}throw new Error("Can't convert from NT: "+t)}holds(t,e,r,n){let i;if(1===arguments.length){if(!t)return!0;if(t instanceof Array){for(i=0;i<t.length;i++)if(!this.holds(t[i]))return!1;return!0}if((0,o.SH)(t))return this.holds(t.subject,t.predicate,t.object,t.graph);if(t.statements)return this.holds(t.statements)}return null!=this.anyStatementMatching(t,e,r,n)}holdsStatement(t){return this.holds(t.subject,t.predicate,t.object,t.graph)}list(t,e){if(e.rdfFactory.supports.COLLECTIONS){const r=e.rdfFactory.collection();return t.forEach((function(t){r.append(t)})),r}{const r=e.rdfFactory.blankNode(),n=M(e.rdfFactory,r,t);return e.addAll(n),r}}NTtoURI(t){let e,r,n={};for(e in t)t.hasOwnProperty(e)&&(r=t[e],"<"===e[0]&&(n[e.slice(1,-1)]=r));return n}serialize(t,e,r,n){return F(r,this,t,e,void 0,n)}substitute(t){let e=this.statements.map((function(e){return e.substitute(t)}));const r=new B;return r.addAll(e),r}sym(t,e){if(e)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(t)}the(t,e,r,n){let i=this.any(t,e,r,n);return null==i&&E.A.error("No value found for the() {"+t+" "+e+" "+r+"}."),i}transitiveClosure(t,e,r){let n,i,s,o,a,c,u={};Object.assign(u,t);let l={};for(;;){if(c=function(){for(let t in u)if(u.hasOwnProperty(t))return t}(),null==c)return l;for(a=r?this.each(void 0,e,this.fromNT(c)):this.each(this.fromNT(c),e),i=0,s=a.length;i<s;i++)n=a[i],o=n.toNT(),o in l||o in u||(u[o]=u[c]);l[c]=u[c],delete u[c]}}topTypeURIs(t){let e,r,n,i,s,o,a,c;for(n in a=[],t)if(t.hasOwnProperty(n)){for(c=t[n],s=0,o=this.each(this.rdfFactory.namedNode(n),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf")),e=0,i=o.length;e<i;e++)if(r=o[e],"http://www.w3.org/2000/01/rdf-schema#Resource"!==r.uri){s++;break}s||(a[n]=c)}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(t){return new v(t)}whether(t,e,r,n){return this.statementsMatching(t,e,r,n,!1).length}}r.A.fromValue=h;const q=r.A,$={xsd:N("http://www.w3.org/2001/XMLSchema#")};r.A.toJS=function(t){return(0,o.P3)(t)?t.elements.map(r.A.toJS):(0,o.c$)(t)?t.datatype.equals($.xsd("boolean"))?"1"===t.value||"true"===t.value:t.datatype.equals($.xsd("dateTime"))||t.datatype.equals($.xsd("date"))?new Date(t.value):t.datatype.equals($.xsd("integer"))||t.datatype.equals($.xsd("float"))||t.datatype.equals($.xsd("decimal"))?Number(t.value):t.value:t};var H=a(6357);class z{constructor(t,e){this.pat=new J,this.vars=[],this.name=t,this.id=e}}function X(t,e,r,n){function i(t){var e,r="";for(e in t)t.hasOwnProperty(e)&&(r+=" "+e+" -> "+t[e]);return r}function s(t){var e,r="Bindings: ",n=t.length;for(e=0;e<n;e++)r+=i(t[e][0])+";\n\t";return r}function o(t,e,r,n){var i;if(t.length!==e.length)return[];if(!t.length)return[[[],null]];var s=function(t,e,r,n){var i=r[t];if(void 0===i){if(t.isVar){var s=[];return s[t]=e,[[s,null]]}i=t}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[e]&&(e=n.redirections[e]),i.equals(e)||i.uri&&i.uri===d?[[[],null]]:[];if(t instanceof Array)return e instanceof Array?o(t,e,r):[];throw new Error("query.js: oops - code not written yet")}(t[0],e[0],r,n);if(0===s.length)return s;var a,c,u,l,h,f,p,y=[],g=s.length;for(a=0;a<g;a++){for(h in p=[],c=s[a][0])c.hasOwnProperty(h)&&(p[h]=c[h]);for(h in r)r.hasOwnProperty(h)&&(p[h]=r[h]);for(l=(i=o(t.slice(1),e.slice(1),p,n)).length,u=0;u<l;u++){for(h in f=i[u][0],c)c.hasOwnProperty(h)&&(f[h]=c[h]);y.push([f,null])}}return y}function a(t,e){var r,n={};for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n}function c(t,e){return this.trunkBindings=e,this.originalCallback=t,this.branches=[],this}function u(t,e){return this.count=0,this.success=!1,this.done=!1,this.callback=t,this.onDone=e,this}c.prototype.checkAllDone=function(){var t;for(t=0;t<this.branches.length;t++)if(!this.branches[t].done)return;E.A.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},c.prototype.doCallBacks=function(t,e){var r;if(t<0)return this.originalCallback(e);for(r=0;r<this.branches[t].results.length;r++)this.doCallBacks(t-1,a(e,this.branches[t].results[r]))},u.prototype.reportMatch=function(t){this.callback(t),this.success=!0},u.prototype.reportDone=function(){this.done=!0,E.A.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var l=function(t){return this.count=0,this.done=!1,this.results=[],this.junction=t,t.branches.push(this),this};function h(t,e,r){var n,i,s,o,a,c;for(e.nvars=0,e.index=null,n=[e.subject,e.predicate,e.object,e.why],o=[t.subjectIndex,t.predicateIndex,t.objectIndex,t.whyIndex],s=0;s<4;s++){let u=n[s];if(u.uri&&u.uri===d);else if(u.isVar&&void 0===r[u])e.nvars++;else{if(void 0,u=void 0===(c=r[a=n[s]])?a:c,t.redirections[t.id(u)]&&(u=t.redirections[t.id(u)]),!(i=o[s][t.id(u)]))return e.index=[],!1;(null===e.index||e.index.length>i.length)&&(e.index=i)}}return null===e.index&&(e.index=t.statements),!0}function f(t,e){return t.nvars!==e.nvars?t.nvars-e.nvars:t.index.length-e.index.length}l.prototype.reportMatch=function(t){this.results.push(t)},l.prototype.reportDone=function(){E.A.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),E.A.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var p=function(t,r,n,s,o,a,u){E.A.debug("Match begins, Branch count now: "+u.count+" for "+u.pattern_debug);var h,f,d=r.statements;if(0===d.length){if(E.A.debug("FOUND MATCH WITH BINDINGS:"+i(n)),0===r.optional.length)u.reportMatch(n);else{E.A.debug("OPTIONAL: "+r.optional);var y,m=new c(e,n),b=[];for(y=0;y<r.optional.length;y++)b[y]=new l(m),b[y].pattern_debug=r.optional[y];for(y=0;y<r.optional.length;y++)b[y].count=b[y].count+1,p(t,r.optional[y],n,"",o,e,b[y])}return u.count--,void E.A.debug("Match ends -- success , Branch count now: "+u.count+" for "+u.pattern_debug)}var v=d.length;if(o){var x=function(e,i){var c=e.uri.split("#")[0];o.nowOrWhenFetched(c,void 0,(function(i,c,l){i||H.log("Error following link to <"+e.uri+"> in query: "+c),p(t,r,n,s,o,a,u)}))};for(f=0;f<v;f++){if(h=d[f],void 0!==n[h.subject]&&n[h.subject].uri&&o&&"unrequested"===o.getState((0,w.docpart)(n[h.subject].uri)))return void x(n[h.subject]);if(void 0!==n[h.object]&&n[h.object].uri&&o&&"unrequested"===o.getState((0,w.docpart)(n[h.object].uri)))return void x(n[h.object])}}g(t,r,n,s,o,a,u)},y=function(t,e){var r,n,i=!0;for(r in t)t.hasOwnProperty(r)&&e[r]&&(n=e[r].test)&&!n(t[r])&&(i=!1);return i},g=function(t,e,r,n,a,c,u){var l,d,g,m,b,w,v,x=e.statements,_=x.length;for(l=0;l<_;l++)h(t,v=x[l],r);x.sort(f),v=x[0];var A,T=t.formula();T.optional=e.optional,T.constraints=e.constraints,T.statements=x.slice(1),E.A.debug(n+"match2 searching "+v.index.length+" for "+v+"; bindings so far="+i(r));var N,O,j=v.index.length,S=0;for(A=0;A<j;A++)for(O=v.index[A],N=o([v.subject,v.predicate,v.object,v.why],[O.subject,O.predicate,O.object,O.why],r,t),E.A.info(n+" From first: "+N.length+": "+s(N)),g=N.length,d=0;d<g;d++)if(b=[],w=N[d][0],y(w,e.constraints)){for(m in w)w.hasOwnProperty(m)&&(b[m]=w[m]);for(m in r)r.hasOwnProperty(m)&&(b[m]=r[m]);u.count++,S++,p(t,T,b,n+" ",a,c,u)}else E.A.debug("Branch count CS: "+u.count);u.count--,0===S&&E.A.debug("Match2 fails completely on "+v),E.A.debug("Match2 ends, Branch count: "+u.count+" for "+u.pattern_debug),0===u.count&&(E.A.debug("Branch finished."),u.reportDone())},m=this;E.A.debug("Query on "+this.statements.length);var b=new u(e,n);b.count++,t.sync?p(m,t.pat,t.pat.initBindings,"",r,e,b):setTimeout((function(){p(m,t.pat,t.pat.initBindings,"",r,e,b)}),0)}const V="http://www.w3.org/2002/07/owl#";function G(t,e,r,n){var i=t.any(e,r,void 0);return!!i&&(t.equate(i,n),!0)}function Q(t,e,r,n){var i=t.any(void 0,r,n);return!!i&&(t.equate(i,e),!0)}function W(t,e,r,n,i){t.typeCallback&&t.typeCallback(t,n,i);var s=t.classActions[t.id(n)],o=!1;if(s)for(var a=0;a<s.length;a++)o=o||s[a](t,e,r,n,i);return o}class J extends B{constructor(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(void 0,void 0,void 0,void 0,r),(0,t.A)(this,"updater",void 0),(0,t.A)(this,"namespaces",void 0),(0,t.A)(this,"classActions",void 0),(0,t.A)(this,"propertyActions",void 0),(0,t.A)(this,"redirections",void 0),(0,t.A)(this,"aliases",void 0),(0,t.A)(this,"HTTPRedirects",void 0),(0,t.A)(this,"subjectIndex",void 0),(0,t.A)(this,"predicateIndex",void 0),(0,t.A)(this,"objectIndex",void 0),(0,t.A)(this,"whyIndex",void 0),(0,t.A)(this,"index",void 0),(0,t.A)(this,"features",void 0),(0,t.A)(this,"_universalVariables",void 0),(0,t.A)(this,"_existentialVariables",void 0),(0,t.A)(this,"rdfArrayRemove",void 0),(0,t.A)(this,"dataCallbacks",[]),(0,t.A)(this,"dataRemovalCallbacks",[]),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=e||[],this.rdfArrayRemove=r.rdfArrayRemove||O.RDFArrayRemove,r.dataCallback&&(this.dataCallbacks=[r.dataCallback]),r.dataRemovalCallback&&(this.dataRemovalCallbacks=[r.dataRemovalCallback]),this.initPropertyActions(this.features)}static get defaultGraphURI(){return d}substitute(t){var e=this.statements.map((function(e){return e.substitute(t)})),r=new J;return r.add(e),r}addDataCallback(t){this.dataCallbacks.push(t)}addDataRemovalCallback(t){this.dataRemovalCallbacks.push(t)}applyPatch(t,e,r){var n,i=this,s=null;function o(o){if(t.delete){n=t.delete,s&&(n=n.substitute(s)),n=n.statements;var a=[],c=n.map((function(t){var r=i.statementsMatching(t.subject,t.predicate,t.object,e);return 0===r.length?(a.push(t),null):r[0]}));if(a.length)return r("Could not find to delete: "+a.join("\n or "));c.map((function(t){i.remove(t)}))}t.insert&&(n=t.insert,s&&(n=n.substitute(s)),(n=n.statements).map((function(t){t.graph=e,i.add(t.subject,t.predicate,t.object,t.graph)}))),o()}if(t.where){var a=new z("patch");a.pat=t.where,a.pat.statements.map((function(t){t.graph=We(e.value)})),a.sync=!0;var c=[];i.query(a,(function(t){c.push(t)}),i.fetcher,(function(){return 0===c.length?r("No match found to be patched:"+t.where):c.length>1?r("Patch ambiguous. No patch done."):(s=c[0],void o(r))}))}else o(r)}declareExistential(t){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(t),t}initPropertyActions(t){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[W],L(t,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${V}sameAs`))]=[function(t,e,r,n,i){return t.equate(e,n),!0}]),L(t,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${V}InverseFunctionalProperty`))]=[function(t,e,r,n,i){return t.newPropertyAction(e,Q)}]),L(t,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${V}FunctionalProperty`))]=[function(t,e,r,n,i){return t.newPropertyAction(e,G)}])}addStatement(t){return this.add(t.subject,t.predicate,t.object,t.graph),this.statements.length}add(t,e,r,n){var i,s,a;if(1===arguments.length){if(t instanceof Array)for(i=0;i<t.length;i++)this.add(t[i]);else(0,o.aF)(t)?this.add(t.subject,t.predicate,t.object,t.graph):(0,o.ok)(t)&&this.add(t.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof t&&(t=this.rdfFactory.namedNode(t)),e=q.fromValue(e);const c=q.fromValue(r);if(n=q.fromValue(n),!(0,o.CZ)(t))throw new Error("Subject is not a subject type");if(!(0,o.fY)(e))throw new Error(`Predicate ${e} is not a predicate type`);if(!(0,o.DJ)(c))throw new Error(`Object ${c} is not an object type`);if(!(0,o.RN)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,e,n);var u=this.id(this.canon(e)),l=!1;if(s=this.propertyActions[u])for(i=0;i<s.length;i++)l=l||s[i](this,t,e,c,n);if(this.holds(t,e,c,n))return null;var h=[this.id(this.canon(t)),u,this.id(this.canon(c)),this.id(this.canon(n))];for(a=this.rdfFactory.quad(t,e,c,n),i=0;i<4;i++){var f=this.index[i],p=h[i];f[p]||(f[p]=[]),f[p].push(a)}this.statements.push(a);for(const t of this.dataCallbacks)t(a);return a}canon(t){if(!t)return t;const e=this.redirections[this.id(t)];if(e)return e;switch(t.termType){case n.$Q:return new i(t.value);case n.r0:return t;case n.ic:return new y;case n.S:case n.bD:return t;case n.QW:return new l(t.value,t.language,t.datatype);case n.Kk:return new s.A(t.value);case n.P2:return new v(t.value);default:throw new Error(`Term Type not recognized for canonization: ${t.termType}`)}}check(){this.checkStatementList(this.statements);for(var t=0;t<4;t++){var e=this.index[t];for(var r in e)e.hasOwnProperty(r)&&this.checkStatementList(e[r],t)}}checkStatementList(t,e){void 0===e&&(e=0);for(var r,n=" found in "+["subject","predicate","object","why"][e]+" index.",i=0;i<t.length;i++){for(var s=[(r=t[i]).subject,r.predicate,r.object,r.graph],o=function(t,e){for(var r=0;r<t.length;r++)if(t[r].subject.equals(e.subject)&&t[r].predicate.equals(e.predicate)&&t[r].object.equals(e.object)&&t[r].why.equals(e.graph))return!0},a=0;a<4;a++){var c=this.canon(s[a]),u=this.id(c);this.index[a][u]&&o(this.index[a][u],r)}if(!o(this.statements,r))throw new Error("Statement list does not statement "+r+"@"+r.graph+n)}}close(){return this}compareTerms(t,r){return Object.prototype.hasOwnProperty.call(t,"compareTerm")?t.compareTerm(r):e.A[t.termType]<e.A[r.termType]?-1:e.A[t.termType]>e.A[r.termType]?1:t.value<r.value?-1:t.value>r.value?1:0}copyTo(t,e,r){r||(r=[]);var n=this.statementsMatching(t);-1!==L(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,t));for(var i=0;i<n.length;i++){var s=n[i];switch(s.object.termType){case"NamedNode":this.add(e,s.predicate,s.object);break;case"Literal":case"BlankNode":case"Collection":this.add(e,s.predicate,s.object.copy(this))}-1!==L(r,"delete")&&this.remove(s)}}equate(t,e){const r=this.canon(t),n=this.canon(e);var i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}formula(t){return new J(t)}get length(){return this.statements.length}match(t,e,r,n){return this.statementsMatching(q.fromValue(t),q.fromValue(e),q.fromValue(r),q.fromValue(n))}mentionsURI(t){var e="<"+t+">";return!!this.subjectIndex[e]||!!this.objectIndex[e]||!!this.predicateIndex[e]}newExistential(t){if(!t)return this.bnode();var e=this.sym(t);return this.declareExistential(e)}newPropertyAction(t,e){var r=this.id(t);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(e);for(var n=this.statementsMatching(void 0,t,void 0),i=!1,s=0;s<n.length;s++)i=i||e(this,n[s].subject,t,n[s].object);return i}newUniversal(t){var e=this.sym(t);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(e),e}variable(t){return new v(t)}nextSymbol(t){for(var e=0;;e++){var r=t.value+"#n"+e;if(!this.mentionsURI(r))return this.sym(r)}}query(t,e,r,n){return X.call(this,t,e,r,n)}querySync(t){var e=[],r=!1;if(t.sync=!0,X.call(this,t,(function(t){e.push(t)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return e}remove(t){if(t instanceof Array){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}if((0,o.ok)(t))return this.remove(t.statements);var r=this.statementsMatching(t.subject,t.predicate,t.object,t.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+t);return this.removeStatement(r[0]),this}removeDocument(t){this.removeMetadata(t);for(var e=this.statementsMatching(void 0,void 0,void 0,t).slice(),r=0;r<e.length;r++)this.removeStatement(e[r]);return this.removeMatches(t,null,null),this}removeMetadata(t){const e=this.sym("chrome://TheCurrentSession"),r="http://www.w3.org/2007/ont/link#",n=this.statementsMatching(void 0,this.sym(`${r}requestedURI`),this.rdfFactory.literal(t.value),e).map((t=>t.subject));for(var i=0;i<n.length;i++){const t=n[i];if(null!=t){let n;const i=this.any(t,this.sym(`${r}status`),null,e);if(null!=i){n=this.statementsMatching(i,this.sym(`${r}status`),null,e).slice();for(var s=0;s<n.length;s++)this.removeStatement(n[s])}const o=this.any(t,this.sym(`${r}response`),null,e);if(null!=o)for(n=this.statementsMatching(o,null,null,e).slice(),s=0;s<n.length;s++)this.removeStatement(n[s]);for(n=this.statementsMatching(t,null,null,e).slice(),s=0;s<n.length;s++)this.removeStatement(n[s])}}return this.removeMatches(this.sym(t.value),null,null,e),this}removeMany(t,e,r,n,i){for(var s=this.statementsMatching(t,e,r,n,!1),o=[],a=0;a<s.length;a++)o.push(s[a]);for(i&&(o=o.slice(0,i)),a=0;a<o.length;a++)this.remove(o[a])}removeMatches(t,e,r,n){return this.removeMany(t,e,r,n),this}removeStatement(t){for(var e=[t.subject,t.predicate,t.object,t.graph],r=0;r<4;r++){var n=this.canon(e[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],t)}this.rdfArrayRemove(this.statements,t);for(const e of this.dataRemovalCallbacks)e(t);return this}removeStatements(t){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}replaceWith(t,e){for(var r=this.id(t),n=this.id(e),i=function(t){var e=t[r];if(e){var i=t[n];t[n]=i?e.concat(i):e,delete t[r]}},s=0;s<4;s++)i(this.index[s]);if(this.redirections[r]=e,t.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(t),this.aliases[r])for(s=0;s<this.aliases[r].length;s++)this.redirections[this.id(this.aliases[r][s])]=e,this.aliases[n].push(this.aliases[r][s]);this.add(e,this.sym("http://www.w3.org/2007/ont/link#uri"),t),this.fetcher&&this.fetcher.nowKnownAs(t,e)}return i(this.classActions),i(this.propertyActions),!0}allAliases(t){var e=this.aliases[this.id(this.canon(t))]||[];return e.push(this.canon(t)),e}sameThings(t,e){if(t.equals(e))return!0;var r=this.canon(t);if(!r)return!1;var n=this.canon(e);return!!n&&r.value===n.value}setPrefixForURI(t,e){if(("tab"!==t||!this.namespaces.tab)&&"ns"!==t.slice(0,2)&&"default"!==t.slice(0,7)){for(let t in this.namespaces)this.namespaces[t]==e&&delete this.namespaces[t];this.namespaces[t]=e}}statementsMatching(t,e,r,n,i){var s,o,a=[t,e,r,n],c=[],u=[],l=[],h=[];for(s=0;s<4;s++)c[s]=this.canon(q.fromValue(a[s])),c[s]?(h.push(s),u[s]=this.id(c[s])):l.push(s);if(0===h.length)return this.statements;if(1===h.length)return s=h[0],(o=this.index[s][u[s]])&&i&&o.length>1&&(o=o.slice(0,1)),o||[];var f,p,d=1e10;for(p=0;p<h.length;p++){if(s=h[p],!(o=this.index[s][u[s]]))return[];o.length<d&&(d=o.length,f=p)}for(var y=h[f],g=this.index[y][u[y]],m=h.slice(0,f).concat(h.slice(f+1)),b=[],w=["subject","predicate","object","why"],v=0;v<g.length;v++){var x=g[v];for(p=0;p<m.length;p++)if(s=m[p],!this.canon(x[w[s]]).equals(c[s])){x=null;break}if(null!=x&&(b.push(x),i))break}return b}uris(t){var e=this.canon(t),r=this.aliases[this.id(e)];if(!e.value)return[];var n=[e.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}serialize(t,e,r,n){return F(r,this,t,e,void 0,n={...n||{},namespaces:n?.namespaces?{...this.namespaces,...n.namespaces}:{...this.namespaces}})}}(0,t.A)(J,"handleRDFType",void 0),J.handleRDFType=W;const Y=N("http://www.w3.org/1999/02/22-rdf-syntax-ns#");function Z(t,e){function r(n,i,s){const o=t.statementsMatching(n,Y("rest"),null,e);if(1!==o.length)throw new Error(`Bad list structure: no rest at ${n}`);const a=t.statementsMatching(n,Y("first"),null,e);if(1!==a.length)throw new Error(`Bad list structure: rest but ${a.length} firsts at ${n}`);const c=[a[0].object].concat(i),u=s.concat(o).concat(a),l=t.statementsMatching(null,Y("rest"),n,e);if(0===l.length){const r=new f(c);return t.remove(u),void function(t,e,r,n){for(const i of t.statementsMatching(r,null,null,n)){const r=new b(e,i.predicate,i.object,n);t.remove(i),t.add(r)}for(const i of t.statementsMatching(null,r,null,n))t.remove(i),t.add(new b(i.subject,e,i.object,n));for(const i of t.statementsMatching(null,null,r,n))t.remove(i),t.add(new b(i.subject,i.predicate,e,n))}(t,r,n,e)}if(1!==l.length)throw new Error(`Bad list structure: ${l.length} pres at ${n}`);const h=l[0].subject;if("BlankNode"!==h.termType)throw new Error(`Bad list element node ${h} type: ${h.termType} `);r(h,c,u)}!function(t,e){const r=Y("nil");for(const n of t.statementsMatching(r,null,null,e)){t.remove(n);const r=new f;t.add(new b(r,n.predicate,n.object,e))}for(const n of t.statementsMatching(null,null,r,e))if(!n.predicate.sameTerm(Y("rest"))){t.remove(n);const r=new f;t.add(new b(n.subject,n.predicate,r,e))}}(t,e),t.statementsMatching(null,Y("rest"),Y("nil"),e).forEach((t=>{if("BlankNode"!==t.subject.termType)throw new Error(`Bad list element node ${t.subject} type: ${t.subject.termType} `);r(t.subject,[],[])}))}var K="http://www.w3.org/2000/10/swap/log#",tt=function(t){return t},et=function(t){return t},rt=function(t){if(t.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},nt=function(t){return t.length},it=function(t,e,r){if(void 0===t.slice)throw"@@ mising.js: No .slice function for "+t+" of type "+typeof t;return void 0===r||null==r?t.slice(e):t.slice(e,r)},st=Error("dummy error stop iteration"),ot=function(t){return this.last=0,this.li=t,this.next=function(){if(this.last==this.li.length)throw st;return this.li[this.last++]},this},at=function(t,e){return t.indexOf(e)},ct=function(t,e){if(!t){if(e)throw"python Assertion failed: "+e;throw"(python) Assertion failed."}};String.prototype.encode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return function(t){t=t.replace(/\r\n/g,"\n");for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e+=String.fromCharCode(n):n>127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e}(this)},String.prototype.decode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return this};var ut=function(t,e){return w.join(e,t)},lt="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",ht="http://www.w3.org/2002/07/owl#sameAs",ft="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",pt=ft+":",dt=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?([eE][-+]?[0-9]+)?","g"),yt=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?"),gt=new RegExp('[\\\\\\r\\n\\"]',"g"),mt=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const bt=function(t,e,r,n,i,s,o,a){return new wt(t,e,r,n,i,s,o,a)};class wt{constructor(t,e,r,n,i,s,o,a){void 0===e&&(e=null),void 0===r&&(r=""),void 0===n&&(n=null),void 0===i&&(i=""),void 0===s&&(s=null),void 0===o&&(o=""),void 0===a&&(a=null),this._bindings=new rt([]),this._flags=o,""!=r&&(ct(r.indexOf(":")>=0,"Document URI not absolute: "+r),this._bindings[""]=r+"#"),this._store=t,i&&t.setGenPrefix(i),this._thisDoc=r,this.source=t.sym(r),this.lines=0,this.statementCount=0,this.hasNil=!1,this.startOfLine=0,this.previousLine=0,this._genPrefix=i,this.keywords=new et(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new rt([]),this._variables=new rt([]),this._parentVariables=new rt([]),this._reason=a,this._reason2=null,this._baseURI=n||r||null,ct(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==e?this._thisDoc?this._formula=t.formula(r+"#_formula"):this._formula=t.formula():this._formula=e,this._context=this._formula,this._parentContext=null}here(t){return this._genPrefix+"_L"+this.lines+"C"+(t-this.startOfLine+1)}formula(){return this._formula}loadStream(t){return this.loadBuf(t.read())}loadBuf(t){return this.startDoc(),this.feed(t),this.endDoc()}feed(t){for(var e=t.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(e,r);if(n<0)return;if((r=this.directiveOrStatement(e,n))<0)throw vt(this._thisDoc,this.lines,e,n,"expected directive or statement")}}directiveOrStatement(t,e){var r,n=this.skipSpace(t,e);return n<0?n:(r=this.directive(t,n))>=0||(r=this.statement(t,n))>=0?this.checkDot(t,r):r}tok(t,e,r){if("@"==e.slice(r,r+1))r+=1;else if(L(this.keywords,t)<0)return-1;var n=r+nt(t);return e.slice(r,n)==t&&ft.indexOf(e.charAt(n))>=0?n:-1}directive(t,e){if((s=this.skipSpace(t,e))<0)return s;var r=new et([]);if((s=this.tok("bind",t,e))>0)throw vt(this._thisDoc,this.lines,t,e,"keyword bind is obsolete: use @prefix");if((s=this.tok("keywords",t,e))>0){if((e=this.commaSeparatedList(t,s,r,!1))<0)throw vt(this._thisDoc,this.lines,t,e,"'@keywords' needs comma separated list of words");return this.setKeywords(it(r,null,null)),e}if((s=this.tok("forAll",t,e))>0){if((e=this.commaSeparatedList(t,s,r,!0))<0)throw vt(this._thisDoc,this.lines,t,e,"Bad variable list after @forAll");var n=new ot(r);try{for(;;){var i=n.next();(L(this._variables,i)<0||L(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(t){if(t!=st)throw t}return e}if((s=this.tok("forSome",t,e))>0){if((e=this.commaSeparatedList(t,s,r,this.uri_ref2))<0)throw vt(this._thisDoc,this.lines,t,e,"Bad variable list after @forSome");n=new ot(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(t){if(t!=st)throw t}return e}if((s=this.tok("prefix",t,e))>=0){var s,o=new et([]);if((e=this.qname(t,s,o))<0)throw vt(this._thisDoc,this.lines,t,s,"expected qname after @prefix");if((s=this.uri_ref2(t,e,o))<0)throw vt(this._thisDoc,this.lines,t,e,"expected <uriref> after @prefix _qname_");var a=o[1].uri;return this._baseURI?a=ut(this._baseURI,a):ct(a.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),ct(a.indexOf(":")>=0),this._bindings[o[0][0]]=a,this.bind(o[0][0],function(t){return encodeURI(t)}(a)),s}if((s=this.tok("base",t,e))>=0){if(o=new et([]),(e=this.uri_ref2(t,s,o))<0)throw vt(this._thisDoc,this.lines,t,s,"expected <uri> after @base ");if(a=o[0].uri,!this._baseURI)throw vt(this._thisDoc,this.lines,t,s,"With no previous base URI, cannot use relative URI in @base <"+a+">");return a=ut(this._baseURI,a),ct(a.indexOf(":")>=0),this._baseURI=a,e}return-1}bind(t,e){""==t||this._store.setPrefixForURI(t,e)}setKeywords(t){null==t?this.keywordsSet=0:(this.keywords=t,this.keywordsSet=1)}startDoc(){}endDoc(){return this.hasNil&&this._store.rdfFactory.supports.COLLECTIONS&&Z(this._store,this.source),this._formula}makeStatement(t){t[0].add(t[2],t[1],t[3],this.source),(t[2].uri&&t[2].uri===lt||t[3].uri&&t[3].uri===lt)&&(this.hasNil=!0),this.statementCount+=1}statement(t,e){var r=new et([]);if((e=this.object(t,e,r))<0)return e;var n=this.property_list(t,e,r[0]);if(n<0)throw vt(this._thisDoc,this.lines,t,e,"expected propertylist");return n}subject(t,e,r){return this.item(t,e,r)}verb(t,e,r){if((i=this.skipSpace(t,e))<0)return i;var n=new et([]);if((i=this.tok("has",t,e))>=0){if((e=this.prop(t,i,n))<0)throw vt(this._thisDoc,this.lines,t,i,"expected property after 'has'");return r.push(new tt(["->",n[0]])),e}if((i=this.tok("is",t,e))>=0){if((e=this.prop(t,i,n))<0)throw vt(this._thisDoc,this.lines,t,i,"expected <property> after 'is'");if((i=this.skipSpace(t,e))<0)throw vt(this._thisDoc,this.lines,t,e,"End of file found, expected property after 'is'");var i;if(e=i,(i=this.tok("of",t,e))<0)throw vt(this._thisDoc,this.lines,t,e,"expected 'of' after 'is' <prop>");return r.push(new tt(["<-",n[0]])),i}if((i=this.tok("a",t,e))>=0)return r.push(new tt(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==t.slice(e,e+2))return r.push(new tt(["<-",this._store.sym(K+"implies")])),e+2;if("="==t.slice(e,e+1))return">"==t.slice(e+1,e+2)?(r.push(new tt(["->",this._store.sym(K+"implies")])),e+2):(r.push(new tt(["->",this._store.sym(ht)])),e+1);if(":="==t.slice(e,e+2))return r.push(new tt(["->",K+"becomes"])),e+2;if((i=this.prop(t,e,n))>=0)return r.push(new tt(["->",n[0]])),i;if(">-"==t.slice(e,e+2)||"<-"==t.slice(e,e+2))throw vt(this._thisDoc,this.lines,t,i,">- ... -> syntax is obsolete.");return-1}prop(t,e,r){return this.item(t,e,r)}item(t,e,r){return this.path(t,e,r)}blankNode(t){return this._context.bnode(t,this._reason2)}path(t,e,r){if((s=this.nodeOrLiteral(t,e,r))<0)return s;for(;"!^.".indexOf(t.slice(s,s+1))>=0;){var n=t.slice(s,s+1);if("."==n){var i=t.slice(s+1,s+2);if(!i||pt.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var s,o=r.pop(),a=this.blankNode(this.here(s));if((s=this.node(t,s+1,r))<0)throw vt(this._thisDoc,this.lines,t,s,"EOF found in middle of path syntax");var c=r.pop();"^"==n?this.makeStatement(new tt([this._context,c,a,o])):this.makeStatement(new tt([this._context,c,o,a])),r.push(a)}return s}anonymousNode(t){if(e=this._anonymousNodes[t])return e;var e=this._store.bnode(t);return this._anonymousNodes[t]=e,e}node(t,e,r,n){void 0===n&&(n=null);var i=n;if((l=this.skipSpace(t,e))<0)return l;e=l;var s=t.slice(e,e+1);if("["==s){var o=this.here(e);if((l=this.skipSpace(t,e+1))<0)throw vt(this._thisDoc,this.lines,t,e,"EOF after '['");if("="==t.slice(l,l+1)){e=l+1;var a=new et([]);if(!((l=this.objectList(t,e,a))>=0))throw vt(this._thisDoc,this.lines,t,e,"objectList expected after [= ");if(i=a[0],nt(a)>1){var c=new ot(a);try{for(;;){var u=c.next();this.makeStatement(new tt([this._context,this._store.sym(ht),i,u]))}}catch(t){if(t!=st)throw t}}if((l=this.skipSpace(t,l))<0)throw vt(this._thisDoc,this.lines,t,e,"EOF when objectList expected after [ = ");if(";"==t.slice(l,l+1))var l=l+1}if(null==i&&(i=this.blankNode(o)),(e=this.property_list(t,l,i))<0)throw vt(this._thisDoc,this.lines,t,l,"property_list expected");if((l=this.skipSpace(t,e))<0)throw vt(this._thisDoc,this.lines,t,e,"EOF when ']' expected after [ <propertyList>");if("]"!=t.slice(l,l+1))throw vt(this._thisDoc,this.lines,t,l,"']' expected");return r.push(i),l+1}if("{"==s){if("$"==t.slice(e+1,e+2)){l=(e+=1)+1;for(var h=new et([]),f=!0;;){if((e=this.skipSpace(t,l))<0)throw vt(this._thisDoc,this.lines,t,e,"needed '$}', found end.");if("$}"==t.slice(e,e+2)){l=e+2;break}if(f)f=!1;else{if(","!=t.slice(e,e+1))throw vt(this._thisDoc,this.lines,t,e,"expected: ','");e+=1}var p=new et([]);if((l=this.item(t,e,p))<0)throw vt(this._thisDoc,this.lines,t,e,"expected item in set or '$}'");h.push(p[0])}return r.push(this._store.newSet(h,this._context)),l}l=e+1;var d=this._parentContext;this._parentContext=this._context;var y=this._anonymousNodes,g=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new rt([]),this._variables=this._variables.slice();var m=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((e=this.skipSpace(t,l))<0)throw vt(this._thisDoc,this.lines,t,e,"needed '}', found end.");if("}"==t.slice(e,e+1)){l=e+1;break}if((l=this.directiveOrStatement(t,e))<0)throw vt(this._thisDoc,this.lines,t,e,"expected statement or '}'")}return this._anonymousNodes=y,this._variables=this._parentVariables,this._parentVariables=g,this._context=this._parentContext,this._reason2=m,this._parentContext=d,r.push(i.close()),l}if("("==s){var b=this._store.list;for("$"==t.slice(e+1,e+2)&&(b=this._store.newSet,e+=1),l=e+1,h=new et([]);;){if((e=this.skipSpace(t,l))<0)throw vt(this._thisDoc,this.lines,t,e,"needed ')', found end.");if(")"==t.slice(e,e+1)){l=e+1;break}if(p=new et([]),(l=this.item(t,e,p))<0)throw vt(this._thisDoc,this.lines,t,e,"expected item in list or ')'");h.push(p[0])}return r.push(b(h,this._context)),l}if((l=this.tok("this",t,e))>=0)throw vt(this._thisDoc,this.lines,t,e,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(l=this.tok("true",t,e))>=0?(r.push(!0),l):(l=this.tok("false",t,e))>=0?(r.push(!1),l):null==i&&(l=this.uri_ref2(t,e,r))>=0?l:-1}property_list(t,e,r){for(;;){if((l=this.skipSpace(t,e))<0)throw vt(this._thisDoc,this.lines,t,e,"EOF found when expected verb in property list");if(":-"!=t.slice(l,l+2)){e=l;var n=new et([]);if((l=this.verb(t,e,n))<=0)return e;var i=new et([]);if((e=this.objectList(t,l,i))<0)throw vt(this._thisDoc,this.lines,t,l,"objectList expected");var s=new ot(i);try{for(;;){var o=s.next(),a=n[0],c=a[0],u=a[1];"->"==c?this.makeStatement(new tt([this._context,u,r,o])):this.makeStatement(new tt([this._context,u,o,r]))}}catch(t){if(t!=st)throw t}if((l=this.skipSpace(t,e))<0)throw vt(this._thisDoc,this.lines,t,l,"EOF found in list of objects");if(";"!=t.slice(e,e+1))return e;e+=1}else{e=l+2;var l,h=new et([]);if((l=this.node(t,e,h,r))<0)throw vt(this._thisDoc,this.lines,t,e,"bad {} or () or [] node after :- ");e=l}}}commaSeparatedList(t,e,r,n){if((i=this.skipSpace(t,e))<0)throw vt(this._thisDoc,this.lines,t,i,"EOF found expecting comma sep list");if("."==t.charAt(i))return e;if(n)var i=this.uri_ref2(t,i,r);else i=this.bareWord(t,i,r);if(i<0)return-1;for(;;){if((e=this.skipSpace(t,i))<0)return e;var s=t.slice(e,e+1);if(","!=s)return"."!=s?-1:e;if((i=n?this.uri_ref2(t,e+1,r):this.bareWord(t,e+1,r))<0)throw vt(this._thisDoc,this.lines,t,i,"bad list content")}}objectList(t,e,r){if((e=this.object(t,e,r))<0)return-1;for(;;){var n=this.skipSpace(t,e);if(n<0)throw vt(this._thisDoc,this.lines,t,n,"EOF found after object");if(","!=t.slice(n,n+1))return n;if((e=this.object(t,n+1,r))<0)return e}}checkDot(t,e){var r=this.skipSpace(t,e);if(r<0)return r;if("."==t.slice(r,r+1))return r+1;if("}"==t.slice(r,r+1))return r;if("]"==t.slice(r,r+1))return r;throw vt(this._thisDoc,this.lines,t,r,"expected '.' or '}' or ']' at end of statement")}uri_ref2(t,e,r){var n=new et([]);if((f=this.qname(t,e,n))>=0){var i=n[0],s=i[0],o=i[1];if(null==s){ct(0,"not used?");var a=this._baseURI+"#"}else if(!(a=this._bindings[s])){if("_"==s)return r.push(this.anonymousNode(o)),f;throw vt(this._thisDoc,this.lines,t,e,"Prefix "+s+" not bound.")}var c=this._store.sym(a+o);return L(this._variables,c)>=0?r.push(this._variables[c]):r.push(c),f}if((e=this.skipSpace(t,e))<0)return-1;if("?"==t.charAt(e)){var u=new et([]);return(f=this.variable(t,e,u))>0?(r.push(u[0]),f):-1}if("<"==t.charAt(e)){for(var l=e+=1;e<nt(t);){if(">"==t.charAt(e)){var h=t.slice(l,e);return this._baseURI?h=ut(this._baseURI,h):ct(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==t.slice(e-1,e)&&"#"!=it(h,-1,null)&&(h+="#"),c=this._store.sym(h),L(this._variables,c)>=0?r.push(this._variables[c]):r.push(c),e+1}e+=1}throw vt(this._thisDoc,this.lines,t,f,"unterminated URI reference")}if(this.keywordsSet){var f;if(u=new et([]),(f=this.bareWord(t,e,u))<0)return-1;if(L(this.keywords,u[0])>=0)throw vt(this._thisDoc,this.lines,t,e,'Keyword "'+u[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+u[0])),f}return-1}skipSpace(t,e){for(var r=e||0;r<t.length;r++){var n=t.charAt(r);if(" \n\r\t\f\v            ​\u2028\u2029 ".indexOf(n)<0){if("#"!==t.charAt(r))return r;for(;;r++){if(r===t.length)return-1;if("\n"===t.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===t.charAt(r)&&(this.lines=this.lines+1)}return-1}variable(t,e,r){if((n=this.skipSpace(t,e))<0)return-1;if("?"!=t.slice(n,n+1))return-1;var n;if(e=n+=1,"0123456789-".indexOf(t.charAt(n))>=0)throw vt(this._thisDoc,this.lines,t,n,"Varible name can't start with '"+t.charAt(n)+"s'");for(;e<nt(t)&&pt.indexOf(t.charAt(e))<0;)e+=1;if(null==this._parentContext)throw vt(this._thisDoc,this.lines,t,n,"Can't use ?xxx syntax for variable in outermost level: "+t.slice(n-1,e));return r.push(this._store.variable(t.slice(n,e))),e}bareWord(t,e,r){var n=this.skipSpace(t,e);if(n<0)return-1;var i=t.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(pt.indexOf(i)>=0)return-1;for(e=n;e<nt(t)&&pt.indexOf(t.charAt(e))<0;)e+=1;return r.push(t.slice(n,e)),e}qname(t,e,r){if((e=this.skipSpace(t,e))<0)return-1;var n=t.charAt(e);if("0123456789-+".indexOf(n)>=0)return-1;if(pt.indexOf(n)<0){var i=n;for(e+=1;e<nt(t)&&(n=t.charAt(e),pt.indexOf(n)<0);)i+=n,e+=1}else i="";if(e<nt(t)&&":"==t.charAt(e)){var s=i;for(e+=1,i="";e<nt(t)&&(n=t.charAt(e),pt.indexOf(n)<0);)i+=n,e+=1;return r.push(new tt([s,i])),e}return i&&this.keywordsSet&&L(this.keywords,i)<0?(r.push(new tt(["",i])),e):-1}object(t,e,r){if((s=this.subject(t,e,r))>=0)return s;{if((s=this.skipSpace(t,e))<0)return-1;e=s;var n=null;let a=t.charAt(e);if('"'==a||"'"==a){n=t.slice(e,e+3==a+a)?a+a+a:a,e+=nt(n);var i=this.strconst(t,e,n),s=i[0],o=i[1];return r.push(this._store.literal(o)),s}return-1}}nodeOrLiteral(t,e,r){if((c=this.node(t,e,r))>=0)return c;if((c=this.skipSpace(t,e))<0)return-1;e=c;var n=t.charAt(e);if("-+0987654321".indexOf(n)>=0){if(yt.lastIndex=0,null!=(h=yt.exec(t.slice(e))))c=e+(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(dt.lastIndex=0,null==(h=dt.exec(t.slice(e))))throw vt(this._thisDoc,this.lines,t,e,"Bad number or date syntax");c=e+dt.lastIndex,(i=t.slice(e,c)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):t.slice(e,c).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 c}if('"'==t.charAt(e)){if('"""'==t.slice(e,e+3))var s='"""';else s='"';e+=nt(s);var o=null,a=this.strconst(t,e,s),c=a[0],u=a[1],l=null;if("@"==t.slice(c,c+1)){var h;if(mt.lastIndex=0,null==(h=mt.exec(t.slice(c+1))))throw vt(this._thisDoc,startline,t,e,"Bad language code syntax on string literal, after @");e=mt.lastIndex+c+1,l=t.slice(c+1,e),c=e}if("^^"==t.slice(c,c+2)){var f=new et([]);c=this.uri_ref2(t,c+2,f),o=f[0]}return r.push(this._store.literal(u,l||o)),c}return-1}strconst(t,e,r){for(var n=e,i="",s=this.lines;n<nt(t);){if(e=n+nt(r),t.slice(n,e)==r)return new tt([e,i]);if('"'!=t.charAt(n)){if(gt.lastIndex=0,!gt.exec(t.slice(n)))throw vt(this._thisDoc,s,t,n,"Closing quote missing in string at ^ in "+t.slice(n-20,n)+"^"+t.slice(n,n+20));if(e=n+gt.lastIndex-1,i+=t.slice(n,e),'"'!=(c=t.charAt(e)))if("\r"!=c){if("\n"==c){if('"'==r)throw vt(this._thisDoc,s,t,e,"newline found in string literal");this.lines=this.lines+1,i+=c,n=e+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==c){if(n=e+1,!(c=t.slice(n,n+1)))throw vt(this._thisDoc,s,t,e,"unterminated string literal (2)");var o=at('abfrtvn\\"',c);if(o>=0)i+='a\b\f\r\t\v\n\\"'.charAt(o),n+=1;else if("u"==c)n=(a=this.uEscape(t,n+1,s))[0],i+=c=a[1];else{if("U"!=c)throw vt(this._thisDoc,this.lines,t,e,"bad escape");var a,c;n=(a=this.UEscape(t,n+1,s))[0],i+=c=a[1]}}}else n=e+1;else n=e}else i=i+'"',n=n+1}throw vt(this._thisDoc,this.lines,t,e,"unterminated string literal")}uEscape(t,e,r){for(var n=e,i=0,s=0;i<4;){var o=t.slice(n,n+1).toLowerCase();if(n+=1,""==o)throw vt(this._thisDoc,r,t,e,"unterminated string literal(3)");var a=at("0123456789abcdef",o);if(a<0)throw vt(this._thisDoc,r,t,e,"bad string literal hex escape");s=16*s+a,i+=1}var c=String.fromCharCode(s);return new tt([n,c])}UEscape(t,e,r){for(var n=e,i=0,s="\\U";i<8;){var o=t.slice(n,n+1).toLowerCase();if(n+=1,""==o)throw vt(this._thisDoc,r,t,e,"unterminated string literal(3)");if(at("0123456789abcdef",o)<0)throw vt(this._thisDoc,r,t,e,"bad string literal hex escape");s+=o,i+=1}var a,c=(a="0x"+it(s,2,10)-0,String.fromCharCode(a));return new tt([n,c])}}function vt(t,e,r,n,i){let s=e+1,o="Line "+s+" of <"+t+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',a=new SyntaxError(o,t,s);return a.lineNo=s,a.characterInFile=n,a.syntaxProblem=i,a}const xt={...T,supports:{[x.collections]:!0,[x.defaultGraphType]:!1,[x.equalsMethod]:!0,[x.identity]:!1,[x.id]:!0,[x.reversibleId]:!1,[x.variableType]:!0},collection:t=>new f(t),id(t){return(0,o.P3)(t)?`( ${t.elements.map((t=>this.id(t))).join(", ")} )`:(0,o.DZ)(t)?v.toString(t):T.id(t)},termToNQ:t=>t.termType===n.r0?f.toNT(t):T.termToNQ(t)},_t=xt;function At(t,e){return"string"==typeof e?t.rdfFactory.literal(e):Object.prototype.hasOwnProperty.call(e,"@list")?!0===t.rdfFactory.supports.COLLECTIONS?function(t,e){if(!Array.isArray(e))throw new TypeError("Object must be an array");return t.rdfFactory.collection(e.map((e=>At(t,e))))}(t,e["@list"]):function(t,e){const r=e["@id"]?Et(t,e):t.rdfFactory.blankNode(),n=e["@list"].map((e=>At(t,e))),i=M(t.rdfFactory,r,n);return t.addAll(i),r}(t,e):Object.prototype.hasOwnProperty.call(e,"@id")?Et(t,e):Object.prototype.hasOwnProperty.call(e,"@language")?t.rdfFactory.literal(e["@value"],e["@language"]):Object.prototype.hasOwnProperty.call(e,"@type")?t.rdfFactory.literal(e["@value"],t.rdfFactory.namedNode(e["@type"])):Object.prototype.hasOwnProperty.call(e,"@value")?t.rdfFactory.literal(e["@value"]):t.rdfFactory.literal(e)}async function Tt(t,e,r){const n=r&&Object.prototype.hasOwnProperty.call(r,"termType")?r.value:r,i=await Promise.all([a.e(515),a.e(789)]).then(a.t.bind(a,8515,23));return(await i.default.flatten(JSON.parse(t),null,{base:n})).reduce(((t,e)=>Nt(t,r,e)),e)}function Et(t,e){return e["@id"].startsWith("_:")?t.rdfFactory.blankNode(e["@id"].substring(2)):t.rdfFactory.namedNode(e["@id"])}function Nt(t,e,r){const n=r["@id"]?Et(t,r):t.rdfFactory.blankNode();for(const i of Object.keys(r)){if("@id"===i)continue;if("@graph"==i){const e=n,s=r[i];for(let r=0;r<s.length;r++)t=Nt(t,e,s[r])}const s=r[i];if(Array.isArray(s))for(let r=0;r<s.length;r++)t.addStatement(Ot(t,n,i,s[r],e));else t.addStatement(Ot(t,n,i,s,e))}return t}function Ot(t,e,r,n,i){let s,o;return"@type"===r?(s=t.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),o=t.rdfFactory.namedNode(n)):(s=t.rdfFactory.namedNode(r),o=At(t,n)),t.rdfFactory.quad(e,s,o,t.rdfFactory.namedNode(i))}var jt=a(2313),St=a(5582),Rt=a.n(St);const kt="http://www.w3.org/1999/02/22-rdf-syntax-ns#",It="http://www.w3.org/2001/XMLSchema#",Ct="http://www.w3.org/2000/10/swap/",Pt={xsd:{decimal:`${It}decimal`,boolean:`${It}boolean`,double:`${It}double`,integer:`${It}integer`,string:`${It}string`},rdf:{type:`${kt}type`,nil:`${kt}nil`,first:`${kt}first`,rest:`${kt}rest`,langString:`${kt}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Ct}reify#forSome`,forAll:`${Ct}reify#forAll`},log:{implies:`${Ct}log#implies`}},{xsd:Ft}=Pt,Ut=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Dt={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Mt=/[\x00-\x20<>\\"\{\}\|\^\`]/,Lt={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Bt=/$0^/;class qt{constructor(t){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]*)?$/,t=t||{},this._lineMode=!!t.lineMode){this._n3Mode=!1;for(const t in this)!(t in Lt)&&this[t]instanceof RegExp&&(this[t]=Bt)}else this._n3Mode=!1!==t.n3;this.comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let r=this._input,n=r.length;for(;;){let t,o;for(;t=this._newline.exec(r);)this.comments&&(o=this._comment.exec(t[0]))&&i("comment",o[1],"",this._line,t[0].length),r=r.substr(t[0].length,r.length),n=r.length,this._line++;if(!t&&(t=this._whitespace.exec(r))&&(r=r.substr(t[0].length,r.length)),this._endOfFile.test(r))return e&&(this.comments&&(o=this._comment.exec(r))&&i("comment",o[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const a=this._line,c=r[0];let u="",l="",h="",f=null,p=0,d=!1;switch(c){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(p=1,u="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){d=!0;break}case"<":if(f=this._unescapedIri.exec(r))u="IRI",l=f[1];else if(f=this._iri.exec(r)){if(l=this._unescape(f[1]),null===l||Mt.test(l))return s(this);u="IRI"}else r.length>1&&"<"===r[1]?(u="<<",p=2):this._n3Mode&&r.length>1&&"="===r[1]&&(u="inverse",p=2,l=">");break;case">":r.length>1&&">"===r[1]&&(u=">>",p=2);break;case"_":((f=this._blank.exec(r))||e&&(f=this._blank.exec(`${r} `)))&&(u="blank",h="_",l=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(r))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(r)),null===l)return s(this);null===f&&0===p||(u="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(r))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(r)),null===l)return s(this);null===f&&0===p||(u="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(r))&&(u="var",l=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(r))?(u="langcode",l=f[1]):(f=this._keyword.exec(r))&&(u=f[0]);break;case".":if(1===r.length?e:r[1]<"0"||r[1]>"9"){u=".",p=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(r)||e&&(f=this._number.exec(`${r} `)))&&(u="literal",l=f[0],h="string"==typeof f[1]?Ft.double:"string"==typeof f[2]?Ft.decimal:Ft.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(r))?u=f[0].toUpperCase():d=!0;break;case"f":case"t":(f=this._boolean.exec(r))?(u="literal",l=f[0],h=Ft.boolean):d=!0;break;case"a":(f=this._shortPredicates.exec(r))?(u="abbreviation",l="a"):d=!0;break;case"=":this._n3Mode&&r.length>1&&(u="abbreviation",">"!==r[1]?(p=1,l="="):(p=2,l=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(p=1,u=c);break;case"{":!this._lineMode&&r.length>=2&&("|"===r[1]?(u="{|",p=2):(u=c,p=1));break;case"|":r.length>=2&&"}"===r[1]&&(u="|}",p=2);break;default:d=!0}if(d&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(r))?((f=this._prefixed.exec(r))||e&&(f=this._prefixed.exec(`${r} `)))&&(u="prefixed",h=f[1]||"",l=this._unescape(f[2])):(u="prefix",l=f[1]||"")),"^^"===this._previousMarker)switch(u){case"prefixed":u="type";break;case"IRI":u="typeIRI";break;default:u=""}if(!u)return e||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?s(this):this._input=r;const y=p||f[0].length,g=i(u,l,h,a,y);this.previousToken=g,this._previousMarker=u,r=r.substr(y,r.length)}function i(e,i,s,o,a){const c=r?n-r.length:n,u={type:e,value:i,prefix:s,line:o,start:c,end:c+a};return t(null,u),u}function s(e){t(e._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(t){let e=!1;const r=t.replace(Ut,((t,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let t=Number.parseInt(n,16);return t<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}return i in Dt?Dt[i]:(e=!0,"")}));return e?null:r}_parseLiteral(t){if(t.length>=3){const e=t.match(/^(?:"""|"|'''|'|)/)[0],r=e.length;let n=Math.max(this._literalClosingPos,r);for(;(n=t.indexOf(e,n))>0;){let e=0;for(;"\\"===t[n-e-1];)e++;if(e%2==0){const e=t.substring(r,n),i=e.split(/\r\n|\r|\n/).length-1,s=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(e),matchLength:s}}n++}this._literalClosingPos=t.length-r+1}return{value:"",matchLength:0}}_syntaxError(t){this._input=null;const e=new Error(`Unexpected "${t}" on line ${this._line}.`);return e.context={token:void 0,line:this._line,previousToken:this.previousToken},e}_readStartingBom(t){return t.startsWith("\ufeff")?t.substr(1):t}tokenize(t,e){if(this._line=1,"string"==typeof t){if(this._input=this._readStartingBom(t),"function"!=typeof e){const t=[];let e;if(this._tokenizeToEnd(((r,n)=>r?e=r:t.push(n)),!0),e)throw e;return t}Rt()((()=>this._tokenizeToEnd(e,!0)))}else this._pendingBuffer=null,"function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",(t=>{null!==this._input&&0!==t.length&&(this._pendingBuffer&&(t=jt.hp.concat([this._pendingBuffer,t]),this._pendingBuffer=null),128&t[t.length-1]?this._pendingBuffer=t:(void 0===this._input?this._input=this._readStartingBom("string"==typeof t?t:t.toString()):this._input+=t,this._tokenizeToEnd(e,!1)))})),t.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(e,!0)})),t.on("error",e)}}const{rdf:$t,xsd:Ht}=Pt;let zt,Xt=0;const Vt={namedNode:Kt,blankNode:te,variable:re,literal:ee,defaultGraph:function(){return zt},quad:ne,triple:ne,fromTerm:ie,fromQuad:se};class Gt{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof Gt?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class Qt extends Gt{get termType(){return"NamedNode"}}class Wt extends Gt{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let e=t.lastIndexOf('"')+1;return e<t.length&&"@"===t[e++]?t.substr(e).toLowerCase():""}get datatype(){return new Qt(this.datatypeString)}get datatypeString(){const t=this.id,e=t.lastIndexOf('"')+1,r=e<t.length?t[e]:"";return"^"===r?t.substr(e+2):"@"!==r?Ht.string:$t.langString}equals(t){return t instanceof Wt?this.id===t.id:!!t&&!!t.datatype&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&this.datatype.value===t.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class Jt extends Gt{constructor(t){super(`_:${t}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class Yt extends Gt{constructor(t){super(`?${t}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}zt=new class extends Gt{constructor(){return super(""),zt||this}get termType(){return"DefaultGraph"}equals(t){return this===t||!!t&&this.termType===t.termType}};class Zt extends Gt{constructor(t,e,r,n){super(""),this._subject=t,this._predicate=e,this._object=r,this._graph=n||zt}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(t){return!!t&&this._subject.equals(t.subject)&&this._predicate.equals(t.predicate)&&this._object.equals(t.object)&&this._graph.equals(t.graph)}}function Kt(t){return new Qt(t)}function te(t){return new Jt(t||"n3-"+Xt++)}function ee(t,e){if("string"==typeof e)return new Wt(`"${t}"@${e.toLowerCase()}`);let r=e?e.value:"";return""===r&&("boolean"==typeof t?r=Ht.boolean:"number"==typeof t&&(Number.isFinite(t)?r=Number.isInteger(t)?Ht.integer:Ht.double:(r=Ht.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),""===r||r===Ht.string?new Wt(`"${t}"`):new Wt(`"${t}"^^${r}`)}function re(t){return new Yt(t)}function ne(t,e,r,n){return new Zt(t,e,r,n)}function ie(t){if(t instanceof Gt)return t;switch(t.termType){case"NamedNode":return Kt(t.value);case"BlankNode":return te(t.value);case"Variable":return re(t.value);case"DefaultGraph":return zt;case"Literal":return ee(t.value,t.language||t.datatype);case"Quad":return se(t);default:throw new Error(`Unexpected termType: ${t.termType}`)}}function se(t){if(t instanceof Zt)return t;if("Quad"!==t.termType)throw new Error(`Unexpected termType: ${t.termType}`);return ne(ie(t.subject),ie(t.predicate),ie(t.object),ie(t.graph))}let oe=0;class ae{constructor(t){this._contextStack=[],this._graph=null,t=t||{},this._setBase(t.baseIRI),t.factory&&ue(this,t.factory);const e="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(e),n=/trig/.test(e),i=/triple/.test(e),s=/quad/.test(e),o=this._n3Mode=/n3/.test(e),a=i||s;(this._supportsNamedGraphs=!(r||o))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||o),this._supportsRDFStar=""===e||/star|\*$/.test(e),a&&(this._resolveRelativeIRI=t=>null),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new qt({lineMode:a,n3:o}),this._explicitQuantifiers=!!t.explicitQuantifiers}static _resetBlankNodePrefix(){oe=0}_setBase(t){if(t){const e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base="",this._basePath=""}_saveContext(t,e,r,n,i){const s=this._n3Mode;this._contextStack.push({type:t,subject:r,predicate:n,object:i,graph:e,inverse:!!s&&this._inversePredicate,blankPrefix:s?this._prefixes._:"",quantified:s?this._quantified:null}),s&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(t,e){const r=this._contextStack.pop();if(!r||r.type!==t)return this._error(`Unexpected ${e.type}`,e);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(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(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(t)}}_readEntity(t,e){let r;switch(t.type){case"IRI":case"typeIRI":const e=this._resolveIRI(t.value);if(null===e)return this._error("Invalid IRI",t);r=this._factory.namedNode(e);break;case"type":case"prefixed":const n=this._prefixes[t.prefix];if(void 0===n)return this._error(`Undefined prefix "${t.prefix}:"`,t);r=this._factory.namedNode(n+t.value);break;case"blank":r=this._factory.blankNode(this._prefixes[t.prefix]+t.value);break;case"var":r=this._factory.variable(t.value.substr(1));break;default:return this._error(`Expected entity but got ${t.type}`,t)}return!e&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(t){switch(this._predicate=null,t.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.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._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",t);case"}":return this._readPunctuation(t);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',t);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',t);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",t);if(0===t.prefix.length)return this._literalValue=t.value,this._completeSubjectLiteral;this._subject=this._factory.literal(t.value,this._factory.namedNode(t.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",t);default:if(void 0===(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(t){const e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[t.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${e}`,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",t);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",t);default:if(void 0===(this._predicate=this._readEntity(t)))return}return this._readObject}_readObject(t){switch(t.type){case"literal":if(0===t.prefix.length)return this._literalValue=t.value,this._readDataTypeOrLang;this._object=this._factory.literal(t.value,this._factory.namedNode(t.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.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._factory.blankNode()),this._readSubject):this._error("Unexpected graph",t);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",t);default:if(void 0===(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)}_readGraph(t){return"{"!==t.type?this._error(`Expected graph but got ${t.type}`,t):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))}_readBlankNodeTail(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const e=null===this._predicate;return this._restoreContext("blank",t),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(t){switch(t.type){case".":case"}":return this._subject=null,this._readPunctuation(t);default:return this._readPredicate(t)}}_readListItem(t){let e=null,r=null,n=this._readListItem;const i=this._subject,s=this._contextStack,o=s[s.length-1];switch(t.type){case"[":this._saveContext("blank",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this._subject=e=this._factory.blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",t),0!==s.length&&"list"===s[s.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===t.prefix.length?(this._literalValue=t.value,n=this._readListItemDataTypeOrLang):(e=this._factory.literal(t.value,this._factory.namedNode(t.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",t);default:if(void 0===(e=this._readEntity(t)))return}if(null===r&&(this._subject=r=this._factory.blankNode()),null===i?null===o.predicate?o.subject=r:o.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,e,this._graph)}return n}_readDataTypeOrLang(t){return this._completeObjectLiteral(t,!1)}_readListItemDataTypeOrLang(t){return this._completeObjectLiteral(t,!0)}_completeLiteral(t){let e=this._factory.literal(this._literalValue);switch(t.type){case"type":case"typeIRI":const r=this._readEntity(t);if(void 0===r)return;e=this._factory.literal(this._literalValue,r),t=null;break;case"langcode":e=this._factory.literal(this._literalValue,t.value),t=null}return{token:t,literal:e}}_completeSubjectLiteral(t){return this._subject=this._completeLiteral(t).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(t,e){const r=this._completeLiteral(t);if(r)return this._object=r.literal,e&&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(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",t),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(t){let e,r=this._graph;const n=this._subject,i=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",t);const s=this._predicate,o=this._object;this._subject=this._factory.quad(n,s,o,this.DEFAULTGRAPH),e=this._readPredicate;break;case"|}":if("Quad"!==this._subject.termType)return this._error("Unexpected asserted triple closing",t);this._subject=null,e=this._readPunctuation;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}if(null!==n){const t=this._predicate,e=this._object;i?this._emit(e,t,n,r):this._emit(n,t,e,r)}return e}_readBlankNodePunctuation(t){let e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}return this._emit(this._subject,this._predicate,this._object,this._graph),e}_readQuadPunctuation(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext}_readPrefix(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)}_readPrefixIRI(t){if("IRI"!==t.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,t);const e=this._readEntity(t);return this._prefixes[this._prefix]=e.value,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation}_readBaseIRI(t){const e="IRI"===t.type&&this._resolveIRI(t.value);return e?(this._setBase(e),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",t)}_readNamedGraphLabel(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}}_readNamedGraphBlankLabel(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext}_readQuantifierList(t){let e;switch(t.type){case"IRI":case"prefixed":if(void 0!==(e=this._readEntity(t,!0)))break;default:return this._error(`Unexpected ${t.type}`,t)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,e,this.QUANTIFIERS_GRAPH)):this._quantified[e.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(t){return","===t.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(t))}_getPathReader(t){return this._afterPath=t,this._readPath}_readPath(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const e=this._contextStack,r=e.length&&e[e.length-1];if(r&&"item"===r.type){const e=this._subject;this._restoreContext("item",t),this._emit(this._subject,this.RDF_FIRST,e,this._graph)}return this._afterPath(t)}}_readForwardPath(t){let e,r;const n=this._factory.blankNode();if(void 0!==(r=this._readEntity(t)))return null===this._predicate?(e=this._subject,this._subject=n):(e=this._object,this._object=n),this._emit(e,r,n,this._graph),this._readPath}_readBackwardPath(t){const e=this._factory.blankNode();let r,n;if(void 0!==(r=this._readEntity(t)))return null===this._predicate?(n=this._subject,this._subject=e):(n=this._object,this._object=e),this._emit(e,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(t){return">>"!==t.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(t))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,t):this._readRDFStarTail(t)}_readRDFStarTail(t){if(">>"!==t.type)return this._error(`Expected >> but got ${t.type}`,t);const e=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",t),null===this._subject?(this._subject=e,this._readPredicate):(this._object=e,this._getContextEndReader())}_getContextEndReader(){const t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(t,e,r,n){this._callback(null,this._factory.quad(t,e,r,n||this.DEFAULTGRAPH))}_error(t,e){const r=new Error(`${t} on line ${e.line}.`);r.context={token:e,line:e.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=ce}_resolveIRI(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)?t:this._resolveRelativeIRI(t)}_resolveRelativeIRI(t){if(!t.length)return this._base;switch(t[0]){case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return/^[^/:]*:/.test(t)?null:this._removeDotSegments(this._basePath+t)}}_removeDotSegments(t){if(!/(^|\/)\.\.?($|[/#?])/.test(t))return t;const e=t.length;let r="",n=-1,i=-1,s=0,o="/";for(;n<e;){switch(o){case":":if(i<0&&"/"===t[++n]&&"/"===t[++n])for(;(i=n+1)<e&&"/"!==t[i];)n=i;break;case"?":case"#":n=e;break;case"/":if("."===t[n+1])switch(o=t[1+ ++n],o){case"/":r+=t.substring(s,n-1),s=n+1;break;case void 0:case"?":case"#":return r+t.substring(s,n)+t.substr(n+1);case".":if(o=t[1+ ++n],void 0===o||"/"===o||"?"===o||"#"===o){if(r+=t.substring(s,n-2),(s=r.lastIndexOf("/"))>=i&&(r=r.substr(0,s)),"/"!==o)return`${r}/${t.substr(n+1)}`;s=n+1}}}o=t[++n]}return r+t.substring(s)}parse(t,e,r){let n,i,s;if(e&&(e.onQuad||e.onPrefix||e.onComment)?(n=e.onQuad,i=e.onPrefix,s=e.onComment):(n=e,i=r),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${oe++}_`,this._prefixCallback=i||ce,this._inversePredicate=!1,this._quantified=Object.create(null),!n){const e=[];let r;if(this._callback=(t,n)=>{t?r=t:n&&e.push(n)},this._lexer.tokenize(t).every((t=>this._readCallback=this._readCallback(t))),r)throw r;return e}let o=(t,e)=>{null!==t?(this._callback(t),this._callback=ce):this._readCallback&&(this._readCallback=this._readCallback(e))};s&&(this._lexer.comments=!0,o=(t,e)=>{null!==t?(this._callback(t),this._callback=ce):this._readCallback&&("comment"===e.type?s(e.value):this._readCallback=this._readCallback(e))}),this._callback=n,this._lexer.tokenize(t,o)}}function ce(){}function ue(t,e){t._factory=e,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=e.namedNode(Pt.rdf.first),t.RDF_REST=e.namedNode(Pt.rdf.rest),t.RDF_NIL=e.namedNode(Pt.rdf.nil),t.N3_FORALL=e.namedNode(Pt.r.forAll),t.N3_FORSOME=e.namedNode(Pt.r.forSome),t.ABBREVIATIONS={a:e.namedNode(Pt.rdf.type),"=":e.namedNode(Pt.owl.sameAs),">":e.namedNode(Pt.log.implies)},t.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}ue(ae.prototype,Vt);var le=a(6357);if(void 0===he)var he={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 fe{constructor(t,e){this.options=e||{},this.kb=t,this.target=e.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(t,e,r,n){var i,s,o,a;i=void 0===e?T.namedNode(this.options.base):this.toRDFNodeObject(e),o=this.toRDFNodeObject(r),s=this.toRDFNodeObject(n),a=T.namedNode(this.options.base),this.kb.add(i,o,s,a)}ancestorPath(t){for(var e="";t&&t.nodeType!==he.DOCUMENT_NODE;)e="/"+t.localName+e,t=t.parentNode;return e}copyMappings(t){var e={};for(var r in t)e[r]=t[r];return e}copyProperties(){}deriveDateTimeType(t){for(var e=0;e<fe.dateTimeTypes.length;e++){var r=fe.dateTimeTypes[e].pattern.exec(t);if(r&&r[0].length===t.length)return fe.dateTimeTypes[e].type}return null}init(){}newBlankNode(){return this.blankCounter++,"_:"+this.blankCounter}newSubjectOrigin(t,e){}parseCURIE(t,e,r){var n,i=t.indexOf(":");if(i>=0){var s=t.substring(0,i);if(""===s)return(n=e[""])?n+t.substring(i+1):null;if("_"===s)return"_:"+t.substring(i+1);if(fe.NCNAME.test(s)&&(n=e[s]))return n+t.substring(i+1)}return null}parseCURIEOrURI(t,e,r){return this.parseCURIE(t,e,r)||this.resolveAndNormalize(r,t)}parsePredicate(t,e,r,n,i,s){if(""===t)return null;var o=this.parseTermOrCURIEOrAbsURI(t,e,s?null:r,n,i);return o&&0===o.indexOf("_:")?null:o}parsePrefixMappings(t,e){for(var r=this.tokenize(t),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(e[n]=this.options.base?w.join(r[i],this.options.base):r[i],n=null)}static parseRDFaDOM(t,e,r){var n=new fe(e,{base:r});t.baseURI||(t.baseURI=r),n.process(t,{baseURI:r})}parseSafeCURIEOrCURIEOrURI(t,e,r){return"["===(t=this.trim(t)).charAt(0)&&"]"===t.charAt(t.length-1)?0===(t=(t=t.substring(1,t.length-1)).trim(t)).length?null:"_:"===t?this.theOne:this.parseCURIE(t,e,r):this.parseCURIEOrURI(t,e,r)}parseTermOrCURIEOrAbsURI(t,e,r,n,i){t=this.trim(t);var s=this.parseCURIE(t,n,i);if(s)return s;if(r){if(e&&!this.absURIRE.exec(t))return e+t;var o=r[t];if(o)return o;if(o=r[t.toLowerCase()])return o}return this.absURIRE.exec(t)?this.resolveAndNormalize(i,t):null}parseTermOrCURIEOrURI(t,e,r,n,i){t=this.trim(t);var s=this.parseCURIE(t,n,i);if(s)return s;var o=r[t];return o||((o=r[t.toLowerCase()])?o:e&&!this.absURIRE.exec(t)?e+t:this.resolveAndNormalize(i,t))}parseURI(t){return t}process(t,e){var r;e=e||{},t.nodeType===he.DOCUMENT_NODE?(t.baseURI&&!e.baseURI&&(e.baseURI=t.baseURI),r=t.baseURI,(t=t.documentElement).baseURI||(t.baseURI=r),this.setContext(t)):t.parentNode.nodeType===he.DOCUMENT_NODE&&this.setContext(t);var n=[],i=function(t){if(!t&&e&&e.baseURI)return e.baseURI;var r=t.indexOf("#");return r>=0&&(t=t.substring(0,r)),e&&e.baseURIMap&&(t=e.baseURIMap(t)),t};for(n.push({current:t,context:this.push(null,i(t.baseURI))});n.length>0;){var s=n.shift();if(s.parent){if(s.context.parent&&s.context.parent.listMapping===s.listMapping)continue;for(let t in s.listMapping){var o=s.listMapping[t];if(0!==o.length){var a=[];for(let t=0;t<o.length;t++)a.push(this.newBlankNode());for(let t=0;t<a.length;t++)this.addTriple(s.parent,a[t],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",o[t]),this.addTriple(s.parent,a[t],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:fe.objectURI,value:t+1<a.length?a[t+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(s.parent,s.subject,t,{type:fe.objectURI,value:a[0]})}else this.addTriple(s.parent,s.subject,t,{type:fe.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var c=s.current,u=s.context,l=!1,h=null,f=null,p=null,d=u.prefixes,y=!1,g=[],m=u.listMapping,b=!u.parent,v=u.language,x=u.vocabulary;r=this.parseURI(i(c.baseURI)),c.item=null;var _=c.getAttributeNode("vocab");if(_){let t=this.trim(_.value);if(t.length>0){x=t;var A=r.spec;this.addTriple(c,A,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:fe.objectURI,value:x})}else x=this.vocabulary}for(var T=0;T<c.attributes.length;T++){var E=c.attributes[T];if("x"===E.nodeName.charAt(0)&&0===E.nodeName.indexOf("xmlns:")){y||(d=this.copyMappings(d),y=!0);var N=E.nodeName.substring(6),O=fe.trim(E.value);d[N]=this.options.base?w.join(O,this.options.base):O}}var j=c.getAttributeNode("prefix");j&&(y||(d=this.copyMappings(d),y=!0),this.parsePrefixMappings(j.value,d));var S=null;for(let t=0;!S&&t<this.langAttributes.length;t++)S=c.getAttributeNodeNS(this.langAttributes[t].namespaceURI,this.langAttributes[t].localName);if(S){let t=fe.trim(S.value);v=t.length>0?t:null}var R,k,I=c.getAttributeNode("rel"),C=c.getAttributeNode("rev"),P=c.getAttributeNode("typeof"),F=c.getAttributeNode("property"),U=c.getAttributeNode("datatype"),D=this.inHTMLMode?c.getAttributeNode("datetime"):null,M=c.getAttributeNode("content"),L=c.getAttributeNode("about"),B=c.getAttributeNode("src"),q=c.getAttributeNode("resource"),$=c.getAttributeNode("href"),H=c.getAttributeNode("inlist"),z=[];if(I){k=this.tokenize(I.value);for(let t=0;t<k.length;t++)(R=this.parsePredicate(k[t],x,u.terms,d,r,this.inHTMLMode&&null!==F))&&z.push(R)}var X=[];if(C){k=this.tokenize(C.value);for(let t=0;t<k.length;t++)(R=this.parsePredicate(k[t],x,u.terms,d,r,this.inHTMLMode&&F))&&X.push(R)}if(this.inHTMLMode&&(I||C)&&F&&(0===z.length&&(I=null),0===X.length&&(C=null)),I||C?(L&&(h=this.parseSafeCURIEOrCURIEOrURI(L.value,d,r)),P&&(p=h),h||(c.parentNode.nodeType===he.DOCUMENT_NODE?h=i(c.baseURI):u.parentObject&&(h=i(c.parentNode.baseURI)===u.parentObject?i(c.baseURI):u.parentObject)),q&&(f=this.parseSafeCURIEOrCURIEOrURI(q.value,d,r)),f||($?f=this.resolveAndNormalize(r,encodeURI($.value)):B?f=this.resolveAndNormalize(r,encodeURI(B.value)):!P||L||this.inXHTMLMode&&("head"===c.localName||"body"===c.localName)||(f=this.newBlankNode())),!P||L||!this.inXHTMLMode||"head"!==c.localName&&"body"!==c.localName?P&&!L&&(p=f):p=h):!F||M||U?(L&&(h=this.parseSafeCURIEOrCURIEOrURI(L.value,d,r)),!h&&q&&(h=this.parseSafeCURIEOrCURIEOrURI(q.value,d,r)),!h&&$&&(h=this.resolveAndNormalize(r,encodeURI($.value))),!h&&B&&(h=this.resolveAndNormalize(r,encodeURI(B.value))),h||(c.parentNode.nodeType===he.DOCUMENT_NODE?h=i(c.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==c.localName&&"body"!==c.localName?P?h=this.newBlankNode():u.parentObject&&(h=i(c.parentNode.baseURI)===u.parentObject?i(c.baseURI):u.parentObject,F||(l=!0)):h=i(c.parentNode.baseURI)===u.parentObject?i(c.baseURI):u.parentObject),P&&(p=h)):(L&&(h=this.parseSafeCURIEOrCURIEOrURI(L.value,d,r),P&&(p=h)),h||c.parentNode.nodeType!==he.DOCUMENT_NODE?!h&&u.parentObject&&(h=i(c.parentNode.baseURI)===u.parentObject?i(c.baseURI):u.parentObject):(h=i(c.baseURI),P&&(p=h)),P&&!p&&(q&&(p=this.parseSafeCURIEOrCURIEOrURI(q.value,d,r)),!p&&$&&(p=this.resolveAndNormalize(r,encodeURI($.value))),!p&&B&&(p=this.resolveAndNormalize(r,encodeURI(B.value))),p||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==c.localName&&"body"!==c.localName||(p=h),p||(p=this.newBlankNode()),f=p)),h&&(L||q||p)){var V=h;P&&!L&&!q&&f&&(V=f),this.newSubjectOrigin(c,V)}if(p){k=this.tokenize(P.value);for(let t=0;t<k.length;t++){var G=this.parseTermOrCURIEOrAbsURI(k[t],x,u.terms,d,r);G&&this.addTriple(c,p,fe.typeURI,{type:fe.objectURI,value:G})}}if(h&&h!==u.parentObject&&(m={},b=!0),f){if(I&&H)for(let t=0;t<z.length;t++){let e=m[z[t]];e||(e=[],m[z[t]]=e),e.push({type:fe.objectURI,value:f})}else if(I)for(let t=0;t<z.length;t++)this.addTriple(c,h,z[t],{type:fe.objectURI,value:f});if(C)for(let t=0;t<X.length;t++)this.addTriple(c,f,X[t],{type:fe.objectURI,value:h})}else{if(h&&!f&&(I||C)&&(f=this.newBlankNode()),I&&H)for(let t=0;t<z.length;t++){let e=m[z[t]];e||(e=[],m[R]=e),g.push({predicate:z[t],list:e})}else if(I)for(let t=0;t<z.length;t++)g.push({predicate:z[t],forward:!0});if(C)for(let t=0;t<X.length;t++)g.push({predicate:X[t],forward:!1})}if(F){var Q=null,W=null;U?(Q=""===U.value?fe.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(U.value,x,u.terms,d,r),W=D&&!M?D.value:Q===fe.XMLLiteralURI||Q===fe.HTMLLiteralURI?null:M?M.value:c.textContent):M?(Q=fe.PlainLiteralURI,W=M.value):D?(W=D.value,(Q=fe.deriveDateTimeType(W))||(Q=fe.PlainLiteralURI)):I||C||(q&&(W=this.parseSafeCURIEOrCURIEOrURI(q.value,d,r)),!W&&$?W=this.resolveAndNormalize(r,encodeURI($.value)):!W&&B&&(W=this.resolveAndNormalize(r,encodeURI(B.value))),W&&(Q=fe.objectURI)),Q||(P&&!L?(Q=fe.objectURI,W=p):(W=c.textContent,this.inHTMLMode&&"time"===c.localName&&(Q=fe.deriveDateTimeType(W)),Q||(Q=fe.PlainLiteralURI))),k=this.tokenize(F.value);for(let t=0;t<k.length;t++){let e=this.parsePredicate(k[t],x,u.terms,d,r);if(e)if(H){let t=m[e];t||(t=[],m[e]=t),t.push(Q===fe.XMLLiteralURI||Q===fe.HTMLLiteralURI?{type:Q,value:c.childNodes}:{type:Q||fe.PlainLiteralURI,value:W,language:v})}else Q===fe.XMLLiteralURI||Q===fe.HTMLLiteralURI?this.addTriple(c,h,e,{type:Q,value:c.childNodes}):this.addTriple(c,h,e,{type:Q||fe.PlainLiteralURI,value:W,language:v})}}if(h&&!l)for(let t=0;t<u.incomplete.length;t++)u.incomplete[t].list?u.incomplete[t].list.push({type:fe.objectURI,value:h}):u.incomplete[t].forward?this.addTriple(c,u.subject,u.incomplete[t].predicate,{type:fe.objectURI,value:h}):this.addTriple(c,h,u.incomplete[t].predicate,{type:fe.objectURI,value:u.subject});var J=null,Y=h;l?((J=this.push(u,u.subject)).parentObject=i(c.parentNode.baseURI)===u.parentObject?i(c.baseURI):u.parentObject,J.incomplete=u.incomplete,J.language=v,J.prefixes=d,J.vocabulary=x):((J=this.push(u,h)).parentObject=f||h||u.subject,J.prefixes=d,J.incomplete=g,f&&(Y=f,m={},b=!0),J.listMapping=m,J.language=v,J.vocabulary=x),b&&n.unshift({parent:c,context:u,subject:Y,listMapping:m});for(var Z=c.lastChild;Z;Z=Z.previousSibling)Z.nodeType===he.ELEMENT_NODE&&n.unshift({current:Z,context:J})}}this.inHTMLMode&&this.copyProperties();for(let e=0;e<this.finishedHandlers.length;e++)this.finishedHandlers[e](t)}push(t,e){return{parent:t,subject:e||(t?t.subject:null),parentObject:null,incomplete:[],listMapping:t?t.listMapping:{},language:t?t.language:this.language,prefixes:t?t.prefixes:this.target.graph.prefixes,terms:t?t.terms:this.target.graph.terms,vocabulary:t?t.vocabulary:this.vocabulary}}resolveAndNormalize(t,e){return w.join(e,t)}setContext(t){"html"===t.localName&&"XHTML+RDFa 1.1"===t.getAttribute("version")?this.setXHTMLContext():"html"===t.localName||"http://www.w3.org/1999/xhtml"===t.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?(le.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(t){return this.trim(t).split(/\s+/)}static tokenize(t){return this.trim(t).split(/\s+/)}toRDFNodeObject(t){if(void 0!==t){if("string"==typeof t)return"_:"===t.substring(0,2)?(void 0===this.blankNodes[t.substring(2)]&&(this.blankNodes[t.substring(2)]=new i(t.substring(2))),this.blankNodes[t.substring(2)]):T.namedNode(t);switch(t.type){case fe.objectURI:return"_:"===t.value.substring(0,2)?(void 0===this.blankNodes[t.value.substring(2)]&&(this.blankNodes[t.value.substring(2)]=new i(t.value.substring(2))),this.blankNodes[t.value.substring(2)]):T.namedNode(t.value);case fe.PlainLiteralURI:return new l(t.value,t.language||"");case fe.XMLLiteralURI:case fe.HTMLLiteralURI:var e="";return Object.keys(t.value).forEach((r=>{e+=O.domToString(t.value[r],this.htmlOptions)})),new l(e,"",new s.A(t.type));default:return new l(t.value,"",new s.A(t.type))}}}trim(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}static trim(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}fe.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",fe.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",fe.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",fe.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",fe.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",fe.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",fe.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",fe.NCNAME=new RegExp("^"+fe.nameStartChar+fe.nameChar+"*$"),fe.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 pe=fe.parseRDFaDOM;class de{constructor(t){this.store=t,this.bnodes={},this.why=null,this.reify=!1}frameFactory(t,e,r){return{NODE:1,ARC:2,parent:e,parser:t,store:t.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(t,e){e=w.join(e,this.base),this.node=this.store.sym(e),this.nodeType=t},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 t=this.store.sym(w.join("#"+this.parent.rdfid,this.base));this.store.add(t,this.store.sym(de.ns.RDF+"type"),this.store.sym(de.ns.RDF+"Statement"),this.parser.why),this.store.add(t,this.store.sym(de.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(t,this.store.sym(de.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(t,this.store.sym(de.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(t){this.addSymbol(this.NODE,t),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(t){null!=t?null!=this.parser.bnodes[t]?this.node=this.parser.bnodes[t]:this.node=this.parser.bnodes[t]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(t){t===de.ns.RDF+"li"&&(t=de.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,t)},addLiteral:function(t){this.parent.datatype&&this.parent.datatype!==de.ns.RDF+"langString"?this.node=this.store.literal(t,this.store.sym(this.parent.datatype)):this.node=this.store.literal(t,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}getAttributeNodeNS(t,e,r){var n=null;if(t.getAttributeNodeNS)n=t.getAttributeNodeNS(e,r);else for(var i,s=t.attributes,o=0;o<s.length;++o)if((i=s[o]).namespaceURI===e&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}parse(t,e,r){var n,i=t.childNodes;if(this.cleanParser(),t.nodeType===de.nodeType.DOCUMENT){for(var s=0;s<i.length;s++)if(i[s].nodeType===de.nodeType.ELEMENT){n=i[s];break}}else{if(t.nodeType!==de.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+e+". Halting. ");n=t}this.why=r;var o=this.frameFactory(this);return this.base=e,o.base=e,o.lang=null,this.parseDOM(this.buildFrame(o,n)),!0}parseDOM(t){for(var e,r=function(t){var e="";if(null==t.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+t.localName+" in "+this.base);return t.namespaceURI&&(e+=t.namespaceURI),t.localName?e+=t.localName:t.nodeName&&(t.nodeName.indexOf(":")>=0?e+=t.nodeName.split(":")[1]:e+=t.nodeName),e}.bind(this),n=!0;t.parent;){var i=t.element,s=i.attributes;if(i.nodeType===de.nodeType.TEXT||i.nodeType===de.nodeType.CDATA_SECTION)t.parent.nodeType===t.NODE&&(t.addArc(de.ns.RDF+"value"),t=this.buildFrame(t)),t.addLiteral(i.nodeValue);else if(r(i)!==de.ns.RDF+"RDF")if(t.parent&&t.parent.collection&&(t.addCollectionArc(),(t=this.buildFrame(t,t.element)).parent.element=null),t.parent&&t.parent.nodeType&&t.parent.nodeType!==t.ARC){t.addArc(r(i)),this.reify&&(e=this.getAttributeNodeNS(i,de.ns.RDF,"ID"))&&(t.rdfid=e.nodeValue,i.removeAttributeNode(e));var o=this.getAttributeNodeNS(i,de.ns.RDF,"parseType"),a=this.getAttributeNodeNS(i,de.ns.RDF,"datatype");if(a&&(t.datatype=a.nodeValue,i.removeAttributeNode(a)),o){var c=o.nodeValue;"Literal"===c?(t.datatype=de.ns.RDF+"XMLLiteral",(t=this.buildFrame(t)).addLiteral(i.innerHTML||i.childNodes),n=!1):"Resource"===c?((t=this.buildFrame(t,t.element)).parent.element=null,t.addBNode()):"Collection"===c&&((t=this.buildFrame(t,t.element)).parent.element=null,t.addCollection()),i.removeAttributeNode(o)}if(0!==s.length){var u=this.getAttributeNodeNS(i,de.ns.RDF,"resource"),l=this.getAttributeNodeNS(i,de.ns.RDF,"nodeID");t=this.buildFrame(t),u?(t.addNode(u.nodeValue),i.removeAttributeNode(u)):l?(t.addBNode(l.nodeValue),i.removeAttributeNode(l)):t.addBNode();for(var h=s.length-1;h>=0;h--){var f=this.buildFrame(t);f.addArc(r(s[h])),r(s[h])===de.ns.RDF+"type"?this.buildFrame(f).addNode(s[h].nodeValue):this.buildFrame(f).addLiteral(s[h].nodeValue)}}else 0===i.childNodes.length&&this.buildFrame(t).addLiteral("")}else{var p=this.getAttributeNodeNS(i,de.ns.RDF,"about");if(e=this.getAttributeNodeNS(i,de.ns.RDF,"ID"),p&&e)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&&e)t.addNode("#"+e.nodeValue),i.removeAttributeNode(e);else if(null==p&&null==e){var d=this.getAttributeNodeNS(i,de.ns.RDF,"nodeID");d?(t.addBNode(d.nodeValue),i.removeAttributeNode(d)):t.addBNode()}else t.addNode(p.nodeValue),i.removeAttributeNode(p);var y=this.getAttributeNodeNS(i,de.ns.RDF,"type");de.ns.RDF+"Description"!==r(i)&&(y={nodeValue:r(i)}),null!=y&&(this.store.add(t.node,this.store.sym(de.ns.RDF+"type"),this.store.sym(w.join(y.nodeValue,t.base)),this.why),y.nodeName&&i.removeAttributeNode(y));for(var g=s.length-1;g>=0;g--)this.store.add(t.node,this.store.sym(r(s[g])),this.store.literal(s[g].nodeValue,t.lang),this.why)}for(i=t.element;t.parent;){for(var m=t;null==i;)i=(t=t.parent).element;var b=i.childNodes&&i.childNodes[t.lastChild];if(b&&n){if((b.nodeType===de.nodeType.ELEMENT||b.nodeType===de.nodeType.TEXT||b.nodeType===de.nodeType.CDATA_SECTION)&&(b.nodeType!==de.nodeType.TEXT&&b.nodeType!==de.nodeType.CDATA_SECTION||1===i.childNodes.length)){t.lastChild++,t=this.buildFrame(m,i.childNodes[t.lastChild-1]);break}t.lastChild++}else{if(t.terminateFrame(),!(t=t.parent))break;i=t.element,n=!0}}}}cleanParser(){this.bnodes={},this.why=null}buildFrame(t,e){var r=this.frameFactory(this,t,e);if(t&&(r.base=t.base,r.lang=t.lang),!e||e.nodeType===de.nodeType.TEXT||e.nodeType===de.nodeType.CDATA_SECTION)return r;var n=e.attributes,i=e.getAttributeNode("xml:base");null!=i&&(r.base=i.nodeValue,e.removeAttribute("xml:base"));var s=e.getAttributeNode("xml:lang");null!=s&&(r.lang=s.nodeValue,e.removeAttribute("xml:lang"));for(var o=n.length-1;o>=0;o--)if("xml"===n[o].nodeName.substr(0,3)){if("xmlns:"===n[o].name.slice(0,6)){var a=n[o].nodeValue;this.base&&(a=w.join(a,this.base)),this.store.setPrefixForURI(n[o].name.slice(6),a)}e.removeAttributeNode(n[o])}return r}}function ye(t,e,r){var n,i,s,o=["INSERT","DELETE","WHERE"],a=N("http://www.w3.org/ns/pim/patch#"),c=bt(e,e,r,r,null,null,"",null),u={},l=function(t,e,r,n,i){return"Line "+(e+1)+" of <"+t+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var h=e.sym(r+"#query");for(u.query=h;;){if((i=c.skipSpace(t,n))<0)return u;if(";"===t[i]){if((n=c.skipSpace(t,i+1))<0)return u;i=n}var f=!1;for(s=0;s<o.length;s++){var p=o[s];if(t.slice(i,i+p.length)===p){if((n=c.skipSpace(t,i+p.length))<0)throw l(c._thisDoc,c.lines,t,i+p.length,"found EOF, needed {...} after "+p);if(("INSERT"===p||"DELETE"===p)&&"DATA"===t.slice(n,n+4)){if((i=c.skipSpace(t,n+4))<0)throw l(c._thisDoc,c.lines,t,n+4,"needed {...} after INSERT DATA "+p);n=i}var d=[];if((i=c.node(t,n,d))<0)throw l(c._thisDoc,c.lines,t,n,"bad syntax or EOF in {...} after "+p);u[p.toLowerCase()]=d[0],e.add(h,a(p.toLowerCase()),d[0]),f=!0,n=i}}if(!f&&"@prefix"===t.slice(i,i+7)){if((n=c.directive(t,i))<0)throw l(c._thisDoc,c.lines,t,n,"bad syntax or EOF after @prefix ");n=c.checkDot(t,n),f=!0}if(!f)throw l(c._thisDoc,c.lines,t,i,"Unknown syntax at start of statememt: '"+t.slice(i).slice(0,20)+"'")}}function ge(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",s=arguments.length>4?arguments[4]:void 0;i=i||n.sT,i=i.split(";")[0];try{if(i===n.ny||i===n.sT)bt(e,e,r,r,null,null,"",null).loadBuf(t),a();else if(i===n.JG)new de(e).parse(O.parseXML(t),r,e.sym(r)),a();else if(i===n.H)pe(O.parseXML(t,{contentType:n.H}),e,r),a();else if(i===n.lc)pe(O.parseXML(t,{contentType:n.lc}),e,r),a();else if(i===n.K9||i===n.Fn)ye(t,e,r),a();else if(i===n.i2)Tt(t,e,r).then(a).catch(c);else{if(i!==n._0&&i!==n.BR)throw void 0===i?new Error("contentType is undefined"):new Error("Don't know how to parse "+i+" yet");var o=new ae({factory:_t});!function(t,r){try{o.parse(r,u)}catch(t){s(t,e)}}(null,t)}}catch(t){c(t)}function a(){s&&s(null,e)}function c(t){if(i!==n.i2||i!==n._0||i!==n.BR){if(!s){let e=new Error(t+" while trying to parse <"+r+"> as "+i);throw e.cause=t,e}s(t,e)}}function u(t,r){r?e.add(r.subject,r.predicate,r.object,r.graph):s(t,e)}ge.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,t.A)(de,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,t.A)(de,"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 me=a(1147),be=a.n(me),we=a(362),ve=a(6357);const xe={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},_e={rdf:n.JG,owl:n.JG,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},Ae=t=>({link:N("http://www.w3.org/2007/ont/link#",t),http:N("http://www.w3.org/2007/ont/http#",t),httph:N("http://www.w3.org/2007/ont/httph#",t),rdf:N("http://www.w3.org/1999/02/22-rdf-syntax-ns#",t),rdfs:N("http://www.w3.org/2000/01/rdf-schema#",t),dc:N("http://purl.org/dc/elements/1.1/",t),ldp:N("http://www.w3.org/ns/ldp#",t)}),Te=Ae();class Ee{constructor(e,r){(0,t.A)(this,"response",void 0),(0,t.A)(this,"dom",void 0),this.response=e,this.dom=r}}(0,t.A)(Ee,"pattern",void 0);class Ne extends Ee{static toString(){return"RDFXMLHandler"}static register(t){t.mediatypes[n.JG]={q:.9}}parse(t,e,r){let n=t.store;if(this.dom||(this.dom=O.parseXML(e)),"parsererror"===this.dom.documentElement.nodeName)return t.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");let i=new de(n);try{i.parse(this.dom,r.original.value,r.original)}catch(e){return t.failFetch(r,"Syntax error parsing RDF/XML! "+e,"parse_error")}return r.noMeta||n.add(r.original,Te.rdf("type"),Te.link("RDFDocument"),t.appNode),t.doneFetch(r,this.response)}}Ne.pattern=new RegExp("application/rdf\\+xml");class Oe extends Ee{static toString(){return"XHTMLHandler"}static register(t){t.mediatypes[n.H]={q:.8}}parse(t,e,r){let n,i;this.dom||(this.dom=O.parseXML(e));let s=t.store,o=this.dom.getElementsByTagName("title");o.length>0&&s.add(r.resource,Te.dc("title"),s.rdfFactory.literal(o[0].textContent),r.resource);let a=this.dom.getElementsByTagName("link");for(let e=a.length-1;e>=0;e--)n=a[e].getAttribute("rel"),i=!1,n||(n=a[e].getAttribute("rev"),i=!0),n&&t.linkData(r.original,n,a[e].getAttribute("href"),r.resource,i);let c=this.dom.getElementsByTagName("script");for(let t=0;t<c.length;t++){let e=c[t].getAttribute("type");xe[e]&&(ge(c[t].textContent,s,r.original.value,e),ge(c[t].textContent,s,r.original.value,e))}if(r.noMeta||s.add(r.resource,Te.rdf("type"),Te.link("WebPage"),t.appNode),!r.noRDFa&&pe)try{pe(this.dom,s,r.original.value)}catch(e){let n="Error trying to parse "+r.resource+" as RDFa:\n"+e+":\n"+e.stack;return t.failFetch(r,n,"parse_error")}return t.doneFetch(r,this.response)}}Oe.pattern=new RegExp("application/xhtml");class je extends Ee{static toString(){return"XMLHandler"}static register(t){t.mediatypes["text/xml"]={q:.5},t.mediatypes["application/xml"]={q:.5}}static isElement(t){return t.nodeType===Node.ELEMENT_NODE}parse(t,e,r){let n=O.parseXML(e);for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(je.isElement(s)){let i=s.namespaceURI;if(i&&i===i.rdf)return t.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new Ne(this.response,n).parse(t,e,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 t.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new Oe(this.response,n).parse(t,e,r);let i=n.getElementsByTagName("html")[0];if(i){let s=i.getAttribute("xmlns");if(s&&s.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return t.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new Oe(this.response,n).parse(t,e,r)}return t.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+e.slice(0,80),901)}}je.pattern=new RegExp("(text|application)/(.*)xml");class Se extends Ee{static toString(){return"HTMLHandler"}static register(t){t.mediatypes["text/html"]={q:.8}}parse(t,e,r){let n=t.store;if(Pe(e))return t.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new Oe(this.response).parse(t,e,r);if(function(t){const e=t.indexOf("<!DOCTYPE html"),r=t.indexOf(">");return!(-1===e||-1===r||e>r)&&-1!==t.substr(e,r-e).indexOf("XHTML")}(e))return t.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new Oe(this.response).parse(t,e,r);if(function(t){return!!t.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(e))return t.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new Oe(this.response).parse(t,e,r);let i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(e);return i&&n.add(r.resource,Te.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,Te.rdf("type"),Te.link("WebPage"),t.appNode),t.addStatus(r.req,"non-XML HTML document, not parsed for data."),t.doneFetch(r,this.response)}}Se.pattern=new RegExp("text/html");class Re extends Ee{static toString(){return"JsonLdHandler"}static register(t){t.mediatypes["application/ld+json"]={q:.9}}async parse(t,e,r,n){const i=t.store;try{return await Tt(e,i,r.original.value),t.store.add(r.original,Te.rdf("type"),Te.link("RDFDocument"),t.appNode),t.doneFetch(r,n)}catch(e){const i="Error trying to parse "+r.resource+" as JSON-LD:\n"+e;return t.failFetch(r,i,"parse_error",n)}}}Re.pattern=/application\/(ld\+json|activity\+json)/;class ke extends Ee{static toString(){return"TextHandler"}static register(t){t.mediatypes["text/plain"]={q:.5}}parse(t,e,r){return Pe(e)?(t.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 je(this.response).parse(t,e,r)):e.slice(0,500).match(/xmlns:/)?(t.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new je(this.response).parse(t,e,r)):(t.addStatus(r.req,"Plain text document, no known RDF semantics."),t.doneFetch(r,this.response))}}ke.pattern=new RegExp("text/plain");class Ie extends Ee{static toString(){return"N3Handler"}static register(t){t.mediatypes["text/n3"]={},t.mediatypes["text/turtle"]={}}parse(t,e,r,n){let i=t.store,s=bt(i,i,r.original.value,r.original.value,null,null,"",null);try{s.loadBuf(e)}catch(e){let i="Error trying to parse "+r.resource+" as Notation3:\n"+e;return t.failFetch(r,i,"parse_error",n)}return t.addStatus(r.req,"N3 parsed: "+s.statementCount+" triples in "+s.lines+" lines."),t.store.add(r.original,Te.rdf("type"),Te.link("RDFDocument"),t.appNode),t.doneFetch(r,this.response)}}Ie.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");const Ce={RDFXMLHandler:Ne,XHTMLHandler:Oe,XMLHandler:je,HTMLHandler:Se,TextHandler:ke,N3Handler:Ie,JsonLdHandler:Re};function Pe(t){return!!t.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}class Fe{constructor(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,t.A)(this,"store",void 0),(0,t.A)(this,"timeout",void 0),(0,t.A)(this,"_fetch",void 0),(0,t.A)(this,"mediatypes",void 0),(0,t.A)(this,"appNode",void 0),(0,t.A)(this,"requested",void 0),(0,t.A)(this,"timeouts",void 0),(0,t.A)(this,"redirectedTo",void 0),(0,t.A)(this,"fetchQueue",void 0),(0,t.A)(this,"fetchCallbacks",void 0),(0,t.A)(this,"nonexistent",void 0),(0,t.A)(this,"lookedUp",void 0),(0,t.A)(this,"handlers",void 0),(0,t.A)(this,"ns",void 0),(0,t.A)(this,"fireCallbacks",void 0),this.store=e||new J,this.ns=Ae(this.store.rdfFactory),this.timeout=r.timeout||3e4,this._fetch=r.fetch||void 0!==a.g&&(a.g.solidFetcher||a.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||be(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.sym("chrome://TheCurrentSession"),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}},O.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(r.handlers||Ce).map((t=>this.addHandler(Ce[t])))}static crossSiteProxy(t){return Fe.crossSiteProxyTemplate?Fe.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):void 0}static offlineOverride(t){let e=t;var r;return"undefined"!=typeof window&&window.panes&&(r=window.panes.UI)&&r.preferences&&r.preferences.get("offlineModeUsingLocalhost")&&"http://"===e.slice(0,7)&&"localhost/"!==e.slice(7,17)&&(e="http://localhost/"+e.slice(7),E.A.warn("Localhost kludge for offline use: actually getting <"+e+">")),e}static proxyIfNecessary(t){var e;if("undefined"!=typeof window&&window.panes&&(e=window.panes.UI)&&e.isExtension)return t;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){let e=t.split("/").slice(2);const r=(t,e)=>{let n=e[t.shift()];return n?"string"==typeof n?n+t.join("/"):t?r(t,n):null:null},n=r(e,$SolidTestEnvironment.localSiteMap);if(n)return n}return Fe.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===t.slice(0,5)?Fe.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):t}static unsupportedProtocol(t){let e=w.protocol(t);return"tel"===e||"mailto"===e||"urn"===e}static setCredentials(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===e.credentials&&(void 0!==e.withCredentials?e.credentials=e.withCredentials?"include":"omit":e.credentials="include")}load(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=Object.assign({},e),t instanceof Array)return Promise.all(t.map((t=>this.load(t,Object.assign({},e)))));const r=t;let n=(0,we.E)(r);n=n.split("#")[0],e=this.initFetchOptions(n,e);const i=this.appNode,s=this.store,o=s.statementsMatching(void 0,this.ns.link("requestedURI"),s.sym(n),i).map((t=>t.subject));for(const t of o){const r=s.any(t,this.ns.link("response"),null,i);if(null!=r){const t=s.statementsMatching(r,this.ns.link("outOfDate"),!0,i);s.remove(t),e.force=!0,e.clearPreviousData=!0}}const a=this.initFetchOptions(n,e);return this.pendingFetchPromise(n,a.baseURI,a)}async pendingFetchPromise(t,e,r){let n;return!r.force&&await this.fetchQueue[e]?n=this.fetchQueue[e]:(n=Promise.race([this.setRequestTimeout(t,r),this.fetchUri(t,r)]),this.fetchQueue[e]=n,this.cleanupFetchRequest(e,void 0,this.timeout)),n.then((e=>(t in this.timeouts&&(this.timeouts[t].forEach(clearTimeout),delete this.timeouts[t]),e)))}cleanupFetchRequest(t,e,r){void 0!==e&&ve.warn("_options is deprecated"),this.timeouts[t]=(this.timeouts[t]||[]).concat(setTimeout((()=>{this.isPending(t)||delete this.fetchQueue[t]}),r))}initFetchOptions(t,e){let r=this.store;!e.method||"GET"===e.method.toUpperCase()||(e.force=!0),e.resource=r.rdfFactory.namedNode(t),e.baseURI=e.baseURI||t,e.original=r.rdfFactory.namedNode(e.baseURI),e.req=r.bnode(),e.headers=e.headers||{},e.contentType&&(e.headers["content-type"]=e.contentType),e.force&&(e.cache="no-cache");let n=this.acceptString();e.headers.accept=n;let i=Fe.offlineOverride(t);e.requestedURI=i,Fe.setCredentials(i,e);let s=Fe.proxyIfNecessary(i);return i!==s&&(e.proxyUsed=!0),e.actualProxyURI=s,e}fetchUri(t,e){if(!t)return Promise.reject(new Error("Cannot fetch an empty uri"));if(Fe.unsupportedProtocol(t))return this.failFetch(e,"fetcher: Unsupported protocol","unsupported_protocol");let r=this.getState(t);if(e.force)delete this.nonexistent[t];else{if("fetched"===r)return Promise.resolve(this.doneFetch(e,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===r&&404===this.requested[t]){let r="Previously failed: "+this.requested[t],n={url:t,status:this.requested[t],statusText:r,responseText:r,headers:new me.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(e,r,this.requested[t],n)}}this.fireCallbacks("request",[t]),this.requested[t]=!0,e.noMeta||this.saveRequestMetadata(t,e);let{actualProxyURI:n}=e;return this._fetch(n,e).then((r=>this.handleResponse(r,t,e)),(r=>{let i={url:n,status:999,statusText:(r.name||"network failure")+": "+(r.errno||r.code||r.type),responseText:r.message,headers:new me.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.handleError(i,t,e)}))}nowOrWhenFetched(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,we.E)(t);"function"==typeof e?r=e:void 0===e||((0,o.Y2)(e)?n.referringTerm=e:n=e),this.load(i,n).then((t=>{if(r)if(t)if(t.ok)r(!0,"OK",t);else{let e="HTTP error: Status "+t.status+" ("+t.statusText+")";t.responseText&&(e+=" "+t.responseText),r(!1,e,t)}else r(!1,"@@ nowOrWhenFetched: no response object!")}),(function(t){var e=t.message||t.statusText;e="Failed to load <"+i+"> "+e,t.response&&t.response.status&&(e+=" status: "+t.response.status),r(!1,e,t.response)}))}addStatus(t,e){let r=new Date;e="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+e;let n=this.store;const i=n.the(t,this.ns.link("status"));(0,o.P3)(i)?i.append(n.rdfFactory.literal(e)):E.A.warn("web.js: No list to add to: "+i+","+e)}failFetch(t,e,r,n){this.addStatus(t.req,e),t.noMeta||this.store.add(t.original,this.ns.link("error"),this.store.rdfFactory.literal(e));let i=(t.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(t.resource.equals(t.original),this.requested[w.docpart(t.original.value)]=r,this.fireCallbacks("fail",[t.original.value,e]));var s=new Error("Fetcher: "+e);return s.status=r,s.statusText=e,s.response=n,Promise.reject(s)}linkData(t,e,r,n,i){if(!r)return;let s,o=this.store,a=o.rdfFactory.namedNode(w.join(r,t.value));if("alternate"===e||"seeAlso"===e||"meta"===e||"describedby"===e){if(a.value===t.value)return;s=this.ns.rdfs("seeAlso")}else s="type"===e?o.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):o.rdfFactory.namedNode(w.join(encodeURIComponent(e),"http://www.iana.org/assignments/link-relations/"));i?o.add(a,s,t,n):o.add(t,s,a,n)}parseLinkHeader(t,e,r){if(!t)return;const n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=t.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(let t=0;t<i.length;t++){let s=i[t].split(">"),o=s[0].substring(1),a=s[1].match(n);if(null==a)return;for(let t=0;t<a.length;t++){let n=a[t].split("=")[1].replace(/["']/g,"");this.linkData(e,n,o,r)}}}doneFetch(t,e){return this.addStatus(t.req,"Done."),this.requested[t.original.value]="done",this.fireCallbacks("done",[t.original.value]),e.req=t.req,e}nowKnownAs(t,e){this.lookedUp[t.value]?this.lookedUp[e.value]||this.lookUpThing(e,t):this.lookedUp[e.value]&&(this.lookedUp[t.value]||this.lookUpThing(t,e))}putBack(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(0,we.E)(t);let i=new s.A(r).doc();return e.contentType=e["content-type"]||e["Content-Type"]||e.contentType||n.sT,"application/ld+json"===e.contentType?new Promise(((r,n)=>{F(i,this.store,i.uri,e.contentType,((i,s)=>{i?n(i):(e.data=s,this.webOperation("PUT",t,e).then((t=>r(t))).catch((t=>n(t))))}))})):(e.data=F(i,this.store,i.value,e.contentType),this.webOperation("PUT",r,e))}webCopy(t,e,r){return this.webOperation("GET",t).then((t=>this.webOperation("PUT",e,{data:t.responseText,contentType:r})))}delete(t,e){return this.webOperation("DELETE",t,e).then((e=>(this.requested[t]=404,this.nonexistent[t]=!0,this.unload(this.store.rdfFactory.namedNode(t)),e)))}async createIfNotExists(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.sT,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const i=this;try{var s=await i.load(t)}catch(n){if(404===n.response.status){try{s=await i.webOperation("PUT",t.value,{data:r,contentType:e})}catch(t){throw t}return delete i.requested[t.value],s}throw n}return s}createContainer(t,e,r){let i={"content-type":n.sT,link:this.ns.ldp("BasicContainer")+'; rel="type"'};e&&(i.slug=e);let s={headers:i};return r&&(s.body=r),this.webOperation("POST",t,s)}invalidateCache(t){const e=(0,we.E)(t),r=this;if(r.fetchQueue&&r.fetchQueue[e]&&(r.fetchQueue[e].PromiseStatus,delete r.fetchQueue[e]),r.requested[e]&&"done"!==r.requested[e]&&"failed"!==r.requested[e]&&404!==r.requested[e]){let t=`Rdflib: fetcher: Destructive operation on <${r.requested[e]}> file being fetched! `+e;ve.error(t)}else delete r.requested[e],delete r.nonexistent[e]}webOperation(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,we.E)(e);r.method=t,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),Fe.setCredentials(n,r),new Promise((function(e,s){i._fetch(n,r).then((r=>{if(r.ok)"PUT"!==t&&"PATCH"!==t&&"POST"!==t&&"DELETE"!==t||i.invalidateCache(n),r.text?r.text().then((t=>{r.responseText=t,e(r)})):e(r);else{let e="Web error: "+r.status;r.statusText&&(e+=" ("+r.statusText+")"),e+=" on "+t+" of <"+n+">",r.responseText&&(e+=": "+r.responseText);let i=new Error(e);i.response=r,s(i)}}),(e=>{s(new Error("Fetch error for "+t+" of <"+n+">:"+e))}))}))}lookUpThing(t,e){let r=this.store.uris(t);return r=r.map((t=>w.docpart(t))),r.forEach((t=>{this.lookedUp[t]=!0})),this.load(r,{referringTerm:e})}getHeader(t,e){const r=this.store,n=t.value,i=r.each(void 0,this.ns.link("requestedURI"),r.rdfFactory.literal(n));for(let t=0;t<i.length;t++){let n=i[t];if(void 0!==n){let t=r.any(n,this.ns.link("response"));if(void 0!==t&&r.anyValue(t,this.ns.http("status"))&&r.anyValue(t,this.ns.http("status")).startsWith("2")){let n=r.each(t,this.ns.httph(e.toLowerCase()));return n.length?n.map((t=>t.value)):[]}}}}saveRequestMetadata(t,e){let r=e.req,n=this.store,i=e.referringTerm;this.addStatus(e.req,"Accept: "+e.headers.accept),(0,o.Y2)(i)&&n.add(n.rdfFactory.namedNode(t),this.ns.link("requestedBy"),i,this.appNode),e.original&&e.original.value!==t&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(e.original.value),this.appNode);const s=new Date,a="["+s.getHours()+":"+s.getMinutes()+":"+s.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(a+" Request for "+t),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(t),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}saveResponseMetadata(t,e){const r=this.store;let n=r.bnode();return r.add(e.req,this.ns.link("response"),n,this.appNode),r.add(n,this.ns.http("status"),r.rdfFactory.literal(t.status),this.appNode),r.add(n,this.ns.http("statusText"),r.rdfFactory.literal(t.statusText),this.appNode),t.headers.forEach(((t,i)=>{r.add(n,this.ns.httph(i),this.store.rdfFactory.literal(t),this.appNode),"content-type"===i&&r.add(e.resource,this.ns.rdf("type"),r.rdfFactory.namedNode(O.mediaTypeClass(t).value),this.appNode)})),n}objectRefresh(t){let e=this.store.uris(t);if(void 0!==e)for(let t=0;t<e.length;t++)this.refresh(this.store.rdfFactory.namedNode(w.docpart(e[t])))}refresh(t,e){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(t,{force:!0,clearPreviousData:!0},e)}refreshIfExpired(t,e){let r=this.getHeader(t,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(t,e):e(!0,"Not expired",{})}retract(t){this.store.removeMany(void 0,void 0,void 0,t),t.value&&delete this.requested[w.docpart(t.value)],this.fireCallbacks("retract",arguments)}getState(t){return void 0===this.requested[t]?"unrequested":!0===this.requested[t]?"requested":"done"===this.requested[t]?"fetched":"redirected"===this.requested[t]?this.getState(this.redirectedTo[t]):"failed"}isPending(t){return!0===this.requested[t]}unload(t){this.store.removeDocument(t),delete this.requested[t.value]}addHandler(t){this.handlers.push(t),t.register(this)}retryNoCredentials(t,e){e.retriedWithNoCredentials=!0,delete this.requested[t],delete this.fetchQueue[t];let r=Object.assign({},e,{credentials:"omit"});return this.addStatus(e.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(t,r)}isCrossSite(t){if("undefined"==typeof document||!document.location)return!1;const e=w.hostpart,r=""+document.location;return(e(r)&&e(t)&&e(r))!==e(t)}handleError(t,e,r){if(this.isCrossSite(e)){if(r.credentials&&"include"===r.credentials&&!r.retriedWithNoCredentials)return this.retryNoCredentials(e,r);let t=Fe.crossSiteProxy(e);if(t&&!r.proxyUsed)return this.redirectToProxy(t,r)}var n;return t instanceof Error?n="Fetch error: "+t.message:(n=t.statusText,t.responseText&&(n+=` ${t.responseText}`)),this.failFetch(r,n,t.status||998,t)}addType(t,e,r,n){let i=e;if(n){var s=r.any(i,this.ns.link("requestedURI"));s&&s.value!==n&&r.add(r.rdfFactory.namedNode(n),this.ns.rdf("type"),t,this.appNode)}for(;;){const e=r.any(i,this.ns.link("requestedURI"));if(e&&e.value&&r.add(r.rdfFactory.namedNode(e.value),this.ns.rdf("type"),t,this.appNode),i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i),!i)break;var o=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!o)break;var a=r.any(o,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!a)break;if("301"!==a&&"302"!==a)break}}handleResponse(t,e,r){const n=this.store,i=t.headers,s=r.req,o=this.saveResponseMetadata(t,r),a=this.normalizedContentType(r,i)||"";let c=i.get("content-location");if(0===t.status)return this.handleError(t,e,r);if(t.status>=400)return 404===t.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[e]=!0),this.saveErrorResponse(t,o).then((()=>{let e=r.resource+" "+t.statusText;return this.failFetch(r,e,t.status,t)}));var u=null,l=null;if(c&&(l=w.join(c,e))!==e&&(u=l),200===t.status){if(this.addType(this.ns.link("Document"),s,n,e),u&&this.addType(this.ns.link("Document"),s,n,u),r.clearPreviousData){const t=n.statementsMatching(void 0,void 0,void 0,r.resource).slice();for(let e=0;e<t.length;e++)n.removeStatement(t[e])}let t=a.includes("image/")||a.includes("application/pdf");a&&t&&(this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),s,n,e),u&&this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),s,n,u))}if(c){if(!r.force&&u&&"done"===this.requested[l])return this.doneFetch(r,t);this.requested[l]=!0}this.parseLinkHeader(i.get("link"),r.original,s);let h=this.handlerForContentType(a,t);return h?t.text().then((e=>(t.responseText=e,h.parse(this,e,r,t)))):(this.addStatus(s,"Fetch over. No data handled."),this.doneFetch(r,t))}saveErrorResponse(t,e){let r=this.store;return t.text().then((t=>{t.length>10&&r.add(e,this.ns.http("content"),r.rdfFactory.literal(t),e)}))}handlerForContentType(t,e){if(!t)return null;let r=this.handlers.find((e=>t.match(e.pattern)));return r?new r(e):null}guessContentType(t){return _e[t.split(".").pop()]}normalizedContentType(t,e){if(t.forceContentType)return t.forceContentType;let r=e.get("content-type");if(!r||r.includes("application/octet-stream")){let e=this.guessContentType(t.resource.value);if(e)return e}let n=w.protocol(t.resource.value);return!r&&["file","chrome"].includes(n)?"text/xml":r}redirectToProxy(t,e){this.addStatus(e.req,"BLOCKED -> Cross-site Proxy to <"+t+">"),e.proxyUsed=!0;const r=this.store,n=e.req;e.noMeta||(r.add(n,this.ns.link("redirectedTo"),r.rdfFactory.namedNode(t),n),this.addStatus(n,"redirected to new request")),this.requested[e.resource.value]="redirected",this.redirectedTo[e.resource.value]=t;let i=Object.assign({},e);return i.baseURI=e.resource.value,this.fetchUri(t,i).then((t=>(i.noMeta||r.add(n,this.ns.link("redirectedRequest"),i.req,this.appNode),t)))}setRequestTimeout(t,e){return new Promise((r=>{this.timeouts[t]=(this.timeouts[t]||[]).concat(setTimeout((()=>{!this.isPending(t)||e.retriedWithNoCredentials||e.proxyUsed||r(this.failFetch(e,`Request to ${t} timed out`,"timeout"))}),this.timeout))}))}addFetchCallback(t,e){this.fetchCallbacks[t]?this.fetchCallbacks[t].push(e):this.fetchCallbacks[t]=[e]}acceptString(){let t="";for(let e in this.mediatypes){""!==t&&(t+=", "),t+=e;for(let r in this.mediatypes[e])t+=";"+r+"="+this.mediatypes[e][r]}return t}}(0,t.A)(Fe,"HANDLERS",void 0),(0,t.A)(Fe,"CONTENT_TYPE_BY_EXT",void 0),(0,t.A)(Fe,"crossSiteProxyTemplate",void 0),Fe.HANDLERS=Ce,Fe.CONTENT_TYPE_BY_EXT=_e;const Ue={parseJSON:function(t,e,r){var n,i,s,o={},a=r.sym(e);for(var c in t){0===c.indexOf("_:")?o[c]?n=o[c]:(n=r.bnode(c),o[c]=n):n=r.sym(c);var u=t[c];for(var l in u){var h=u[l];for(var f in i=r.sym(l),h){var p=h[f];if("uri"===p.type)s=r.sym(p.value),r.add(n,i,s,a);else if("BlankNode"===p.type)o[p.value]?s=o[p.value]:(s=r.bnode(p.value),o[p.value]=s),r.add(n,i,s,a);else{if("Literal"!==p.type)throw new Error("error: unexpected termtype: "+f.type);s=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,s,a)}}}}}};function De(t){var e=0;function r(t){var e="",r=t.statements;for(var n in r)E.A.debug("Found statement: "+r),e+=o()+r[n]+"\n";return e}function n(t){var e="";for(var r in t.constraints){var n=t.constraints[r];e+=o()+"FILTER ( "+n.describe(r)+" ) \n"}return e}function i(t){for(var s="",a=0;a<t.optional.length;a++)E.A.debug("Found optional query"),s+=o()+"OPTIONAL { \n",e++,s+=r(t.optional[a]),s+=n(t.optional[a]),s+=i(t.optional[a]),e--,s+=o()+"}\n";return s}function s(t){var s=o()+"WHERE \n{ \n";return e++,s+=r(t),s+=n(t),s+=i(t),e--,s+"}"}function o(){for(var t="",r=0;r<e;r++)t+=" ";return t}return function(t){return function(t){for(var e=o()+"SELECT ",r=0;r<t.vars.length;r++)e+=t.vars[r]+" ";return e+"\n"}(t)+s(t.pat)}(t)}function Me(t,e,r){var n=[];function i(t){if(n[t])return n[t];var e=r.variable(t);return n[t]=e,e}function s(t){return"string"==typeof t&&t.match(/[^ \n\t]/)}function o(t){return"string"==typeof t&&t.match(/^[\?\$]/)}function a(t){return"string"==typeof t?t.replace(/^&lt;/,"<").replace(/&gt;$/,">"):t}function c(t){return"string"==typeof t&&t.match(/^<[^>]*>$/)}function u(t){return"string"==typeof t&&(t.match(/^_:/)||t.match(/^$/))}function l(t){return"string"==typeof t&&t.match(/:$/)}function h(t){return"string"==typeof t&&t.match(/^:|^[^_][^:]*:/)}function f(t){return t.split(":")[0]}function p(t){return t.split(":")[1]}function d(t){return c(t)?t.slice(1,t.length-1):t}function y(t){var e=-1===t.indexOf("'")?null:t.indexOf("'"),n=-1===t.indexOf('"')?null:t.indexOf('"');if(!e&&!n){var i=new Array(1);return i[0]=t,i}var s,o,a=new Array(2);if(!e||n&&n<e)s='"',o=n;else{if(n&&!(e&&e<n))return E.A.error("SQARQL QUERY OOPS!"),a;s="'",o=e}a[0]=t.slice(0,o);var c,u=t.slice(o+1).indexOf(s);return-1===u?(E.A.error("SPARQL parsing error: no matching parentheses in literal "+t),t):(t.slice(u+o+2).match(/^\^\^/)?(c=t.slice(u+o+2).indexOf(" "),a[1]=r.literal(t.slice(o+1,o+1+u),r.sym(d(t.slice(o+4+u,o+2+u+c)))),a=a.concat(y(t.slice(u+o+3+c)))):t.slice(u+o+2).match(/^@/)?(c=t.slice(u+o+2).indexOf(" "),a[1]=r.literal(t.slice(o+1,o+1+u),t.slice(o+3+u,o+2+u+c),null),a=a.concat(y(t.slice(u+o+2+c)))):(a[1]=r.literal(t.slice(o+1,o+1+u)),E.A.info("Literal found: "+a[1]),a=a.concat(y(t.slice(u+o+2)))),a)}function g(t){t=t.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),E.A.info("New str into spaceDelimit: \n"+t);var e=[],r=t.split(" ");for(var n in r)s(r[n])&&(e=e.concat(r[n]));return e}function m(t,e){for(var r=0;r<e.length;r++)if("string"==typeof e[r]&&e[r].toLowerCase()===t.toLowerCase())return r;return null}function b(t,e){for(var r=[],n=0;n<e.length;n++)"string"==typeof e[n]&&e[n].toLowerCase()===t.toLowerCase()&&r.push(n);return r}function w(t,e,r){E.A.info("Looking for a close bracket of type "+r+" in "+t);for(var n=0,i=0;i<t.length;i++)if(t[i]===e&&n++,t[i]===r&&n--,n<0)return i;return E.A.error("Statement had no close parenthesis in SPARQL query"),0}function v(t){return this.describe=function(e){return e+" = "+t.toNT()},this.test=function(e){return t.equals(e)},this}function x(t){this.describe=function(e){return"REGEXP( '"+t+"' , "+e+" )"},this.test=function(e){var r=new RegExp(t);return!!e.value&&r.test(e.value)}}function _(t,e){3!==t.length||"Variable"!==t[0].termType||"NamedNode"!==t[2].termType&&"Literal"!==t[2].termType?6===t.length&&"string"==typeof t[0]&&"regexp"===t[0].toLowerCase()&&"("===t[1]&&")"===t[5]&&","===t[3]&&"Variable"===t[4].termType&&"Literal"===t[2].termType&&(E.A.debug("Constraint added: "+t),e.constraints[t[4]]=new x(t[2].value)):"="===t[1]||">"===t[1]||"<"===t[1]?(E.A.debug("Constraint added: "+t),e.constraints[t[0]]=new v(t[2])):E.A.warn("I don't know how to handle the constraint: "+t)}function A(t,e){E.A.debug("Optional query: "+t+" not yet implemented.");var n=r.formula();T(t,n),e.optional.push(n)}function T(t,e){var n,s,l=function(t){for(var e=[],n=0;n<t.length;n++)"string"==typeof t[n]?(t[n]=a(t[n]),o(t[n])?e[n]=i(t[n].slice(1)):u(t[n])?(E.A.info(t[n]+" was identified as a bnode."),e[n]=r.bnode()):c(t[n])?(E.A.info(t[n]+" was identified as a symbol."),e[n]=r.sym(d(t[n]))):h(t[n])?(E.A.info(t[n]+" was identified as a prefixed symbol"),j[f(t[n])]?e[n]=r.sym(t[n]=j[f(t[n])]+p(t[n])):(E.A.error("SPARQL error: "+t[n]+" with prefix "+f(t[n])+" does not have a correct prefix entry."),e[n]=t[n])):e[n]=t[n]):e[n]=t[n];return e}(t);for(E.A.debug("WHERE: "+l);m("OPTIONAL",l);)s=m("OPTIONAL",l),E.A.debug("OPT: "+s+" "+l[s]+" in "+l),"{"!==l[s+1]&&E.A.warn("Bad optional opening bracket in word "+s),-1===(n=w(l.slice(s+2),"{","}"))?E.A.error("No matching bracket in word "+s):(A(l.slice(s+2,s+2+n),e),s=m("OPTIONAL",l),n=w(l.slice(s+2),"{","}"),l.splice(s,n+3));for(E.A.debug("WHERE after optionals: "+l);m("FILTER",l);){var y=m("FILTER",l);"("!==l[y+1]&&E.A.warn("Bad filter opening bracket in word "+y),-1===(n=w(l.slice(y+2),"(",")"))?E.A.error("No matching bracket in word "+y):(_(l.slice(y+2,y+2+n),e),y=m("FILTER",l),n=w(l.slice(y+2),"(",")"),l.splice(y,n+3))}E.A.debug("WHERE after filters and optionals: "+l),function(t,e){var r=new Array(1);r[0]=-1;for(var n=r.concat(b(".",t)),i=[],s=0;s<n.length-1;s++)i[s]=t.slice(n[s]+1,n[s+1]);for(s in i){E.A.info("s+p+o "+s+" = "+i[s]);var o=i[s][0];i[s].splice(0,1);var a=r.concat(b(";",i[s]));a.push(i[s].length);for(var c=[],u=0;u<a.length-1;u++)c[u]=i[s].slice(a[u]+1,a[u+1]);for(s in c){E.A.info("p+o "+s+" = "+i[s]);var l=c[s][0];c[s].splice(0,1);var h=r.concat(b(",",c[s]));h.push(c[s].length);var f=[];for(u=0;u<h.length-1;u++)f[u]=c[s].slice(h[u]+1,h[u+1]);for(s in f){var p=f[s][0];E.A.info("Subj="+o+" Pred="+l+" Obj="+p),e.add(o,l,p)}}}}(l,e)}E.A.info("SPARQL input: \n"+t);var N=new z,O=function(t){var e=y(t),r=[];for(var n in e)r="string"==typeof e[n]?r.concat(g(e[n])):r.concat(e[n]);return r=function(t){for(var e=t,r=0;r<e.length;r++)if("a"===e[r]&&(e[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===e[r]&&"of"===e[r+2]){e.splice(r,1),e.splice(r+1,1);var n=e[r-1];e[r-1]=e[r+1],e[r+1]=n}return e}(r),E.A.info("SPARQL Tokens: "+r),r}(t),j=function(t){var e=b("PREFIX",t),r=[];for(var n in e){var i=t[e[n]+1],s=t[e[n]+2];if(l(i))if(c(s)){E.A.info("Prefix found: "+i+" -> "+s);var o=f(i),a=d(s);r[o]=a}else E.A.error("Invalid SPARQL symbol: "+s);else E.A.error("Invalid SPARQL prefix: "+i)}return r}(O);j.rdf||(j.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),j.rdfs||(j.rdfs="http://www.w3.org/2000/01/rdf-schema#");var S=m("SELECT",O),R=m("WHERE",O);if(S<0||R<0||S>R)return E.A.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(t,e){for(var r in E.A.info("SPARQL vars: "+t),t)if(o(t[r])){E.A.info("Added "+t[r]+" to query variables from SPARQL");var n=i(t[r].slice(1));e.vars.push(n),n.label=t[r].slice(1)}else E.A.warn("Incorrect SPARQL variable in SELECT: "+t[r])}(O.slice(S+1,R),N),T(O.slice(R+2,O.length-1),N.pat),e)return N;for(var k in N.pat.statements){var I=N.pat.statements[k];"NamedNode"===I.subject.termType&&r.fetcher&&r.fetcher.lookUpThing(I.subject,"sparql:"+I.subject),"NamedNode"===I.object.termType&&r.fetcher&&r.fetcher.lookUpThing(I.object,"sparql:"+I.object)}return N}class Le{constructor(e){if((0,t.A)(this,"store",void 0),(0,t.A)(this,"ifps",void 0),(0,t.A)(this,"fps",void 0),(0,t.A)(this,"patchControl",void 0),(0,t.A)(this,"ns",void 0),(e=e||new J).updater)throw new Error("You can't have two UpdateManagers for the same store");e.fetcher||(e.fetcher=new Fe(e)),this.store=e,e.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=N("http://www.w3.org/2007/ont/link#"),this.ns.http=N("http://www.w3.org/2007/ont/http#"),this.ns.httph=N("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=N("http://www.w3.org/ns/ldp#"),this.ns.rdf=N("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=N("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=N("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=N("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}patchControlFor(t){return this.patchControl[t.value]||(this.patchControl[t.value]=[]),this.patchControl[t.value]}isHttpUri(t){return"http"===t.slice(0,4)}flagAuthorizationMetadata(t){t||(t=this.store);const e=t.fetcher?.appNode,r=t.statementsMatching(void 0,this.ns.link("requestedURI"),void 0,e).map((t=>t.subject));for(const n of r){const r=t.any(n,this.ns.link("response"),null,e);null!=r&&t.add(r,this.ns.link("outOfDate"),!0,e)}}async checkEditable(t,e){if(!t)return!1;e||(e=this.store);const r=this.editable(t,e);return void 0!==r?r:(await(e.fetcher?.load(t)),this.editable(t,e))}editable(t,e){if(!t)return!1;if(e||(e=this.store),t=(0,we.E)(t),!this.isHttpUri(t)&&e.holds(e.rdfFactory.namedNode(t),e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),e.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";var r,n=!1;const i=e.fetcher?.appNode;for(var s,o=e.each(void 0,this.ns.link("requestedURI"),(0,w.docpart)(t),i),a=0;a<o.length;a++)if(void 0!==(r=o[a])){const o=e.any(r,this.ns.link("response"),null,i);if(void 0!==o){if(e.anyJS(o,this.ns.link("outOfDate"),null,i))continue;var c=e.anyValue(o,this.ns.httph("wac-allow"));if(c)for(var u of c.split(",")){var l=u.split("=");if(l[0].includes("user")&&!l[1].includes("write")&&!l[1].includes("append"))return!1}var h=e.each(o,this.ns.httph("accept-patch"));if(h.length)for(let t=0;t<h.length;t++){if((s=h[t].value.trim()).indexOf("application/sparql-update")>=0)return"SPARQL";if(s.indexOf("application/sparql-update-single-match")>=0)return"SPARQL";if(s.indexOf("text/n3")>=0)return"N3PATCH"}var f=e.each(o,this.ns.httph("ms-author-via"));if(f.length)for(let t=0;t<f.length;t++){if((s=f[t].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(s.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(t))return!!c&&"LOCALFILE";var p=e.each(o,this.ns.http("status"));if(p.length)for(let t=0;t<p.length;t++)200!==p[t]&&404!==p[t]||(n=!0)}}if(0===o.length);else if(n)return!1}anonymize(t){return"_:"===t.toNT().substr(0,2)&&this.mentioned(t)?"?"+t.toNT().substr(2):t.toNT()}anonymizeNT(t){return this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" ."}nTriples(t){return`${t.subject.toNT()} ${t.predicate.toNT()} ${t.object.toNT()} .`}statementBnodes(t){return[t.subject,t.predicate,t.object].filter((function(t){return(0,o.jt)(t)}))}statementArrayBnodes(t){var e=[];for(let r=0;r<t.length;r++)e=e.concat(this.statementBnodes(t[r]));e.sort();var r=[];for(let t=0;t<e.length;t++)0!==t&&e[t].equals(e[t-1])||r.push(e[t]);return r}cacheIfps(){this.ifps={};var t=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty"));for(let e=0;e<t.length;e++)this.ifps[t[e].value]=!0;this.fps={},t=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(let e=0;e<t.length;e++)this.fps[t[e].value]=!0}bnodeContext2(t,e,r){var n,i,s=this.store.statementsMatching(void 0,void 0,t,e);for(let t=0;t<s.length;t++)if(this.fps[s[t].predicate.value]){if(!(n=s[t].subject).isBlank)return[s[t]];if(r&&(i=this.bnodeContext2(n,e,r-1)))return i.concat([s[t]])}s=this.store.statementsMatching(t,void 0,void 0,e);for(let t=0;t<s.length;t++)if(this.ifps[s[t].predicate.value]){if(!(n=s[t].object).isBlank)return[s[t]];if(r&&(i=this.bnodeContext2(n,e,r-1)))return i.concat([s[t]])}return null}bnodeContext1(t,e){for(var r=0;r<3;r++){var n=this.bnodeContext2(t,e,r);if(null!==n)return n}return this.store.connectedStatements(t,e)}mentioned(t){return 0!==this.store.statementsMatching(t,null,null,null).length||0!==this.store.statementsMatching(null,t).length||0!==this.store.statementsMatching(null,null,t).length}bnodeContext(t,e){var r=[];if(t.length){this.cacheIfps();for(let i=0;i<t.length;i++){var n=t[i];this.mentioned(n)&&(r=r.concat(this.bnodeContext1(n,e)))}}return r}statementContext(t){var e=this.statementBnodes(t);return this.bnodeContext(e,t.graph)}contextWhere(t){var e=this;return t&&0!==t.length?"WHERE { "+t.map((function(t){return e.anonymizeNT(t)})).join("\n")+" }\n":""}fire(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((()=>{if(!t)throw new Error("No URI given for remote editing operation: "+e);return n.noMeta=!0,n.contentType=n.contentType||"application/sparql-update",n.body=e,this.store.fetcher.webOperation("PATCH",t,n)})).then((n=>{if(!n.ok){let r="UpdateManager: update failed for <"+t+"> status="+n.status+", "+n.statusText+"\n for query: "+e;throw new Error(r)}r(t,n.ok,n.responseText,n)})).catch((e=>{r(t,!1,e.message,e)}))}update_statement(t){if(!t||t.graph){var e=this,r=this.statementContext(t);return{statement:t?[t.subject,t.predicate,t.object,t.graph]:void 0,statementNT:t?this.anonymizeNT(t):void 0,where:e.contextWhere(r),set_object:function(t,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(t)+" . }\n",e.fire(this.statement[3].value,n,r)}}}}insert_statement(t,e){var r=t instanceof Array?t[0]:t,n=this.contextWhere(this.statementContext(r));if(t instanceof Array){var i="";for(let e=0;e<t.length;e++)i+=t[e]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" . }\n";this.fire(r.graph.value,n,e)}delete_statement(t,e){var r=t instanceof Array?t[0]:t,n=this.contextWhere(this.statementContext(r));if(t instanceof Array){var i="";for(let e=0;e<t.length;e++)i+=t[e]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" . }\n";this.fire(r.graph.value,n,e)}requestDownstreamAction(t,e){var r=this.patchControlFor(t);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+e)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=e;else e(t)}clearUpstreamCount(t){this.patchControlFor(t).upstreamCount=0}getUpdatesVia(t){var e=this.store.fetcher.getHeader(t,"updates-via");return e&&e.length?e[0].trim():null}addDownstreamChangeListener(t,e){var r=this.patchControlFor(t);r.downstreamChangeListeners||(r.downstreamChangeListeners=[]),r.downstreamChangeListeners.push(e),this.setRefreshHandler(t,(t=>{this.reloadAndSync(t)}))}reloadAndSync(t){var e=this.patchControlFor(t),r=this;if(e.reloading)e.outOfDate=!0;else{e.reloading=!0;var n=1e3,i=function(){r.reload(r.store,t,(function(t,r,s){if(t){if(e.downstreamChangeListeners)for(let t=0;t<e.downstreamChangeListeners.length;t++)e.downstreamChangeListeners[t]();e.reloading=!1,e.outOfDate&&(e.outOfDate=!1,i())}else e.reloading=!1,s&&0===s.status&&(e.reloading=!0,setTimeout(i,n*=2))}))};i()}}setRefreshHandler(t,e){let r=this.getUpdatesVia(t);var n=e,i=this,s=this,o=1500,a=0;if(!r)return!1;r=(0,w.join)(r,t.value);const c=r.replace(/^http:/,"ws:").replace(/^https:/,"wss:");var u=function(){var e;if("undefined"!=typeof WebSocket)e=new WebSocket(c);else{if("undefined"==typeof window||!window.WebSocket)return;e=window.WebSocket(c)}e.onopen=function(){o=1500,this.send("sub "+t.value),a&&s.requestDownstreamAction(t,n)};var r=i.patchControlFor(t);r.upstreamCount=0,e.onerror=function(t){},e.onclose=function(t){o*=2,a+=1,setTimeout((function(){u()}),o)},e.onmessage=function(e){if(e.data&&"pub"===e.data.slice(0,3)){if("upstreamCount"in r&&(r.upstreamCount-=1,r.upstreamCount>=0))return;r.upstreamCount=0,i.requestDownstreamAction(t,n)}}};return u(),!0}updateMany(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=t.concat(e).map((t=>t.why)),n=this,i=[];r.forEach((t=>{i.find((e=>e.equals(t)))||i.push(t)}));const s=i.map((r=>n.update(t.filter((t=>t.why.equals(r))),e.filter((t=>t.why.equals(r))))));return s.length,Promise.all(s)}constructSparqlUpdateQuery(t,e,r){var n=this.contextWhere(r),i="";if(n.length){if(t.length){i+="DELETE { ";for(let e=0;e<t.length;e++)i+=this.anonymizeNT(t[e])+"\n";i+=" }\n"}if(e.length){i+="INSERT { ";for(let t=0;t<e.length;t++)i+=this.anonymizeNT(e[t])+"\n";i+=" }\n"}i+=n}else{if(t.length){i+="DELETE DATA { ";for(let e=0;e<t.length;e++)i+=this.anonymizeNT(t[e])+"\n";i+=" } \n"}if(e.length){t.length&&(i+=" ; "),i+="INSERT DATA { ";for(let t=0;t<e.length;t++)i+=this.nTriples(e[t])+"\n";i+=" }\n"}}return i}constructN3PatchQuery(t,e,r){var n="\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix ex: <http://www.example.org/terms#>.\n\n_:patch\n";return r&&r.length>0&&(n+=`\n solid:where {\n ${r.map((t=>this.anonymizeNT(t))).join("\n ")}\n };`),t.length>0&&(n+=`\n solid:deletes {\n ${t.map((t=>this.anonymizeNT(t))).join("\n ")}\n };`),e.length>0&&(n+=`\n solid:inserts {\n ${e.map((t=>this.anonymizeNT(t))).join("\n ")}\n };`),n+" a solid:InsertDeletePatch .\n"}update(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!r){var s=this;return new Promise((function(r,o){s.update(t,e,(function(t,e,n){e?r():o(new Error(n))}),n,i)}))}try{var a=this.store,c=t?(0,o.ok)(t)?t.statements:t instanceof Array?t:[t]:[],u=e?(0,o.ok)(e)?e.statements:e instanceof Array?e:[e]:[];if(!(c instanceof Array))throw new Error("Type Error "+typeof c+": "+c);if(!(u instanceof Array))throw new Error("Type Error "+typeof u+": "+u);if(0===c.length&&0===u.length)return r(null,!0);var l=c.length?c[0].graph:u[0].graph;if(!l){let t="Error patching: statement does not specify which document to patch:"+c[0]+", "+u[0];throw new Error(t)}if("NamedNode"!==l.termType){let t="Error patching: document not a NamedNode:"+c[0]+", "+u[0];throw new Error(t)}var h=this.patchControlFor(l),f=Date.now(),p=["subject","predicate","object","why"],d={delete:c,insert:u};["insert","delete"].map((function(t){d[t].map((function(t){if(!l.equals(t.graph))throw new Error("update: destination "+l+" inconsistent with delete quad "+t.graph);p.map((function(e){if(void 0===t[e])throw new Error("update: undefined "+e+" of statement.")}))}))}));var y=this.editable(l.value,a);if(!1===y)throw new Error("Update: Can't make changes in uneditable "+l);if(void 0===y){if(n)throw new Error("Update: Loaded "+l+"but still can't figure out what editing protocol it supports.");return void this.store.fetcher.load(l).then((n=>{this.update(t,e,r,!0,i)}),(n=>{if(404!==n.response.status)throw new Error(`Update: Can't get updatability status ${l} before patching: ${n}`);this.update(t,e,r,!0,i)}))}if(y.indexOf("SPARQL")>=0||y.indexOf("N3PATCH")>=0){var g=y.indexOf("SPARQL")>=0,m=[];c.length&&(m=this.statementArrayBnodes(c)),u.length&&(m=m.concat(this.statementArrayBnodes(u)));var b=this.bnodeContext(m,l),w=g?this.constructSparqlUpdateQuery(c,u,b):this.constructN3PatchQuery(c,u,b);i.contentType=g?"application/sparql-update":"text/n3",h.pendingUpstream=h.pendingUpstream?h.pendingUpstream+1:1,"upstreamCount"in h&&(h.upstreamCount+=1),this.fire(l.value,w,((t,e,n,i)=>{if(i.elapsedTimeMs=Date.now()-f,e){try{a.remove(c)}catch(t){e=!1,n="Remote Ok BUT error deleting "+c.length+" from store!!! "+t}for(let t=0;t<u.length;t++)a.add(u[t].subject,u[t].predicate,u[t].object,l)}if(r(t,e,n,i),h.pendingUpstream-=1,0===h.pendingUpstream&&h.downstreamAction){var s=h.downstreamAction;delete h.downstreamAction,s(l)}}),i)}else if(y.indexOf("DAV")>=0)this.updateDav(l,c,u,r,i);else{if(!(y.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+y+"' for "+l);try{this.updateLocalFile(l,c,u,r,i)}catch(t){r(l.value,!1,"Exception trying to write back file <"+l.value+">\n")}}}catch(t){r(void 0,!1,"Exception in update: "+t+"\n"+O.stackString(t))}}updateDav(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=this.store;var o=s.any(t,this.ns.link("request"));if(!o)throw new Error("No record of our HTTP GET request for document: "+t);var a=s.any(o,this.ns.link("response"));if(!a)return null;var c=s.the(a,this.ns.httph("content-type")).value;let u=s.statementsMatching(void 0,void 0,void 0,t).slice();for(let t=0;t<e.length;t++)O.RDFArrayRemove(u,e[t]);for(let t=0;t<r.length;t++)u.push(r[t]);const l=this.serialize(t.value,u,c);var h,f=s.the(a,this.ns.httph("content-location"));return f&&(h=(0,w.join)(f.value,h)),i.contentType=c,i.noMeta=!0,i.body=l,s.fetcher.webOperation("PUT",h,i).then((i=>{if(!i.ok)throw new Error(i.error);for(let t=0;t<e.length;t++)s.remove(e[t]);for(let e=0;e<r.length;e++)s.add(r[e].subject,r[e].predicate,r[e].object,t);n(t.value,i.ok,i.responseText,i)})).catch((e=>{n(t.value,!1,e.message,e)}))}updateLocalFile(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const s=this.store;let o=s.statementsMatching(void 0,void 0,void 0,t).slice();for(let t=0;t<e.length;t++)O.RDFArrayRemove(o,e[t]);for(let t=0;t<r.length;t++)o.push(r[t]);var a=t.value.lastIndexOf(".");if(a<1)throw new Error("Rewriting file: No filename extension: "+t.value);var c=t.value.slice(a+1);let u=Fe.CONTENT_TYPE_BY_EXT[c];if(!u)throw new Error("File extension ."+c+" not supported for data write");i.body=this.serialize(t.value,o,u),i.contentType=u,s.fetcher.webOperation("PUT",t.value,i).then((i=>{if(!i.ok)return n(t.value,!1,i.error);for(let t=0;t<e.length;t++)s.remove(e[t]);for(let e=0;e<r.length;e++)s.add(r[e].subject,r[e].predicate,r[e].object,t);n(t.value,!0,"")}))}serialize(t,e,r){const n=this.store;let i;if("string"==typeof e)return e;var s=C(n);switch(s.suggestNamespaces(n.namespaces),s.setBase(t),r){case"text/xml":case"application/rdf+xml":i=s.statementsToXML(e);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":i=s.statementsToN3(e);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return i}put(t,e,r,n){const i=this.store;let s;return Promise.resolve().then((()=>(s=this.serialize(t.value,e,r),i.fetcher.webOperation("PUT",t.value,{contentType:r,body:s})))).then((r=>{if(!r.ok)return n(t.value,r.ok,r.error,r);delete i.fetcher.nonexistent[t.value],delete i.fetcher.requested[t.value],"string"!=typeof e&&e.map((t=>{i.addStatement(t)})),n(t.value,r.ok,"",r)})).catch((e=>{n(t.value,!1,e.message)}))}reload(t,e,r){var n=Date.now();t.fetcher.nowOrWhenFetched(e.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(t,i,s){if(t)if(s.onErrorWasCalled||200!==s.status)r(!1,"Non-HTTP error reloading data: "+i,s);else{var o=Date.now()-n;e.reloadTimeTotal||(e.reloadTimeTotal=0),e.reloadTimeCount||(e.reloadTimeCount=0),e.reloadTimeTotal+=o,e.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,s)}))}}const Be={..._t,fetcher:(t,e)=>new Fe(t,e),graph(){return new J(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,(arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)||{rdfFactory:_t})},lit(t,e,r){return this.literal(""+t,e||r)},st(t,e,r,n){return this.quad(t,e,r,n)}},qe=Be;class $e{constructor(t,e){this.parent=t,this.via=e,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(e),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(t){this.onError(t)}}_decode(t){var e,r,n,i,s,o,a;for(r in i={},s=function(){var r,n,i,s;for(s=[],r=0,n=(i=t.split("&")).length;r<n;r++)e=i[r],s.push(e.split("="));return s}())e=s[r],a=(o=[decodeURIComponent(e[0]),decodeURIComponent(e[1])])[1],null==i[n=o[0]]&&(i[n]=[]),i[n].push(a);return i}_send(t,e,r){var n,i;return i=[t,e,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}_subscribe(t){return this._send("sub",t,""),this.subscribed[t]=!0,this.subscribed[t]}onClose(t){var e;for(e in this.connected=!1,this.subscribed)this.pending[e]=!0;return this.subscribed={},this.subscribed}onError(t){throw new Error("onError"+t)}onMessage(t){var e,r;return"ping"===(r=t.data.split(" "))[0]?"function"==typeof(e=this.socket).send?e.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}onOpen(t){var e,r;for(r in this.connected=!0,e=[],this.pending)delete this.pending[r],e.push(this._subscribe(r));return e}subscribe(t){return this.connected?this._subscribe(t):(this.pending[t]=!0,this.pending[t])}}class He{constructor(t){this.fetcher=t,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}onHeaders(t){var e,r,n;return null==t.headers||"undefined"==typeof WebSocket||null===WebSocket||(e=t.headers.etag,n=t.headers["updates-via"],r=t.uri,e&&n&&(this.graph[r]={etag:e,via:n},this.register(n,r))),!0}onUpdate(t,e){return this.fetcher.refresh(qe.namedNode(t))}register(t,e){return null==this.via[t]&&(this.via[t]=new $e(this,t)),this.via[t].subscribe(e)}}const ze={};for(const t in qe)"function"==typeof qe[t]&&(ze[t]=qe[t].bind(qe));const{fetcher:Xe,graph:Ve,lit:Ge,st:Qe,namedNode:We,variable:Je,blankNode:Ye,defaultGraph:Ze,literal:Ke,quad:tr,triple:er}=ze,rr=new B,nr=t=>rr.fromNT(t),ir=q.fromValue,sr=i.nextId;class or extends J{constructor(e){super(e),(0,t.A)(this,"fetcher",void 0),this.fetcher=new Fe(this,{})}}class ar extends or{constructor(e){super(e),(0,t.A)(this,"updater",void 0),this.updater=new Le(this)}}})(),c})()));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("window")):"function"==typeof define&&define.amd?define(["window"],e):"object"==typeof exports?exports.$rdf=e(require("window")):t.$rdf=e(t.window)}(self,(t=>(()=>{var e,r,n,i,s={78:t=>{"use strict";t.exports=Function.prototype.call},182:(t,e,r)=>{"use strict";var n=r(9964),i=r(6357);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}var o,a,c=r(5403).codes,u=c.ERR_AMBIGUOUS_ARGUMENT,l=c.ERR_INVALID_ARG_TYPE,h=c.ERR_INVALID_ARG_VALUE,f=c.ERR_INVALID_RETURN_VALUE,p=c.ERR_MISSING_ARGS,d=r(5416),y=r(7187).inspect,g=r(7187).types,m=g.isPromise,b=g.isRegExp,w=Object.assign?Object.assign:r(6713).assign,v=Object.is?Object.is:r(8527);function x(){var t=r(6781);o=t.isDeepEqual,a=t.isDeepStrictEqual}new Map;var _=!1,A=t.exports=O,T={};function E(t){if(t.message instanceof Error)throw t.message;throw new d(t)}function N(t,e,r,n){if(!r){var i=!1;if(0===e)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var s=new d({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw s.generatedMessage=i,s}}function O(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];N.apply(void 0,[O,e.length].concat(e))}A.fail=function t(e,r,s,o,a){var c,u=arguments.length;if(0===u?c="Failed":1===u?(s=e,e=void 0):(!1===_&&(_=!0,(n.emitWarning?n.emitWarning:i.warn.bind(i))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===u&&(o="!=")),s instanceof Error)throw s;var l={actual:e,expected:r,operator:void 0===o?"fail":o,stackStartFn:a||t};void 0!==s&&(l.message=s);var h=new d(l);throw c&&(h.message=c,h.generatedMessage=!0),h},A.AssertionError=d,A.ok=O,A.equal=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e!=r&&E({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},A.notEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e==r&&E({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},A.deepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===o&&x(),o(e,r)||E({actual:e,expected:r,message:n,operator:"deepEqual",stackStartFn:t})},A.notDeepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===o&&x(),o(e,r)&&E({actual:e,expected:r,message:n,operator:"notDeepEqual",stackStartFn:t})},A.deepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===o&&x(),a(e,r)||E({actual:e,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:t})},A.notDeepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===o&&x(),a(e,r)&&E({actual:e,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:t})},A.strictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");v(e,r)||E({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},A.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");v(e,r)&&E({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var j=function t(e,r,n){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.forEach((function(t){t in e&&(void 0!==n&&"string"==typeof n[t]&&b(e[t])&&e[t].test(n[t])?i[t]=n[t]:i[t]=e[t])}))};function S(t,e,r,n){if("function"!=typeof e){if(b(e))return e.test(t);if(2===arguments.length)throw new l("expected",["Function","RegExp"],e);if("object"!==s(t)||null===t){var i=new d({actual:t,expected:e,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var c=Object.keys(e);if(e instanceof Error)c.push("name","message");else if(0===c.length)throw new h("error",e,"may not be an empty object");return void 0===o&&x(),c.forEach((function(i){"string"==typeof t[i]&&b(e[i])&&e[i].test(t[i])||function(t,e,r,n,i,s){if(!(r in t)||!a(t[r],e[r])){if(!n){var o=new j(t,i),c=new j(e,i,t),u=new d({actual:o,expected:c,operator:"deepStrictEqual",stackStartFn:s});throw u.actual=t,u.expected=e,u.operator=s.name,u}E({actual:t,expected:e,message:n,operator:s.name,stackStartFn:s})}}(t,e,i,r,c,n)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function R(t){if("function"!=typeof t)throw new l("fn","Function",t);try{t()}catch(t){return t}return T}function k(t){return m(t)||null!==t&&"object"===s(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function I(t){return Promise.resolve().then((function(){var e;if("function"==typeof t){if(!k(e=t()))throw new f("instance of Promise","promiseFn",e)}else{if(!k(t))throw new l("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return T})).catch((function(t){return t}))}))}function C(t,e,r,n){if("string"==typeof r){if(4===arguments.length)throw new l("error",["Object","Error","Function","RegExp"],r);if("object"===s(e)&&null!==e){if(e.message===r)throw new u("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===r)throw new u("error/message",'The error "'.concat(e,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==s(r)&&"function"!=typeof r)throw new l("error",["Object","Error","Function","RegExp"],r);if(e===T){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var o="rejects"===t.name?"rejection":"exception";E({actual:void 0,expected:r,operator:t.name,message:"Missing expected ".concat(o).concat(i),stackStartFn:t})}if(r&&!S(e,r,n,t))throw e}function P(t,e,r,n){if(e!==T){if("string"==typeof r&&(n=r,r=void 0),!r||S(e,r)){var i=n?": ".concat(n):".",s="doesNotReject"===t.name?"rejection":"exception";E({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(s).concat(i,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function F(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];N.apply(void 0,[F,e.length].concat(e))}A.throws=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];C.apply(void 0,[t,R(e)].concat(n))},A.rejects=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return I(e).then((function(e){return C.apply(void 0,[t,e].concat(n))}))},A.doesNotThrow=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];P.apply(void 0,[t,R(e)].concat(n))},A.doesNotReject=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return I(e).then((function(e){return P.apply(void 0,[t,e].concat(n))}))},A.ifError=function t(e){if(null!=e){var r="ifError got unwanted exception: ";"object"===s(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?r+=e.constructor.name:r+=e.message:r+=y(e);var n=new d({actual:e,expected:null,operator:"ifError",message:r,stackStartFn:t}),i=e.stack;if("string"==typeof i){var o=i.split("\n");o.shift();for(var a=n.stack.split("\n"),c=0;c<o.length;c++){var u=a.indexOf(o[c]);if(-1!==u){a=a.slice(0,u);break}}n.stack="".concat(a.join("\n"),"\n").concat(o.join("\n"))}throw n}},A.strict=w(F,A,{equal:A.strictEqual,deepEqual:A.deepStrictEqual,notEqual:A.notStrictEqual,notDeepEqual:A.notDeepStrictEqual}),A.strict.strict=A.strict},362:(t,e,r)=>{"use strict";function n(t){return"string"==typeof t?t:t.value}r.d(e,{E:()=>n})},546:(t,e,r)=>{"use strict";r.d(e,{CZ:()=>c,D0:()=>h,DJ:()=>a,DZ:()=>l,GE:()=>b,P3:()=>o,RN:()=>w,SH:()=>i,Y2:()=>d,YC:()=>m,aF:()=>p,c$:()=>f,fY:()=>u,hr:()=>g,jt:()=>y,ok:()=>s});var n=r(6866);function i(t){return"object"==typeof t&&null!==t&&"subject"in t}function s(t){return"object"==typeof t&&null!==t&&"statements"in t}function o(t){return h(t)&&t.termType===n.r0}function a(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===n.Kk||t.termType===n.P2||t.termType===n.$Q||t.termType===n.r0||t.termType===n.QW||t.termType===n.bD)}function c(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===n.Kk||t.termType===n.P2||t.termType===n.$Q||t.termType===n.r0||t.termType===n.QW||t.termType===n.bD)}function u(t){return h(t)&&(t.termType===n.Kk||t.termType===n.$Q||t.termType===n.P2)}function l(t){return h(t)&&t.termType===n.P2}function h(t){return"object"==typeof t&&null!==t&&"termType"in t}function f(t){return t.termType===n.QW}function p(t){return"object"==typeof t&&null!==t&&"subject"in t&&"predicate"in t&&"object"in t}function d(t){return h(t)&&"NamedNode"===t.termType}function y(t){return h(t)&&"termType"in t&&"BlankNode"===t.termType}function g(t){return h(t)&&(t.termType===n.Kk||t.termType===n.P2||t.termType===n.$Q)}function m(t){return h(t)&&(t.termType===n.Kk||t.termType===n.P2)}function b(t){return h(t)&&(t.termType===n.Kk||t.termType===n.P2||t.termType===n.$Q||t.termType===n.QW)}function w(t){return h(t)&&(t.termType===n.Kk||t.termType===n.P2||t.termType===n.$Q||t.termType===n.ic)}},713:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},716:t=>{"use strict";t.exports=Math.abs},821:(t,e,r)=>{"use strict";var n=r(884),i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof i[n[e]]&&(t[t.length]=n[e]);return t}},884:t=>{"use strict";t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},939:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,{A:()=>i})},1147:(t,e,r)=>{var n=r(6357),i="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g,s=function(){function t(){this.fetch=!1,this.DOMException=i.DOMException}return t.prototype=i,new t}();!function(t){!function(e){var i=void 0!==t&&t||"undefined"!=typeof self&&self||void 0!==r.g&&r.g||{},s="URLSearchParams"in i,o="Symbol"in i&&"iterator"in Symbol,a="FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch(t){return!1}}(),c="FormData"in i,u="ArrayBuffer"in i;if(u)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(t){return t&&l.indexOf(Object.prototype.toString.call(t))>-1};function f(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function p(t){return"string"!=typeof t&&(t=String(t)),t}function d(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o&&(e[Symbol.iterator]=function(){return e}),e}function y(t){this.map={},t instanceof y?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function g(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function m(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function b(t){var e=new FileReader,r=m(e);return e.readAsArrayBuffer(t),r}function w(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:a&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:c&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:s&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():u&&a&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=w(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(t)||h(t))?this._bodyArrayBuffer=w(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var t=g(this);if(t)return t;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(){if(this._bodyArrayBuffer)return g(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(a)return this.blob().then(b);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,r,n,i,s=g(this);if(s)return s;if(this._bodyBlob)return t=this._bodyBlob,r=m(e=new FileReader),i=(n=/charset=([A-Za-z0-9_-]+)/.exec(t.type))?n[1]:"utf-8",e.readAsText(t,i),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c&&(this.formData=function(){return this.text().then(A)}),this.json=function(){return this.text().then(JSON.parse)},this}y.prototype.append=function(t,e){t=f(t),e=p(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},y.prototype.delete=function(t){delete this.map[f(t)]},y.prototype.get=function(t){return t=f(t),this.has(t)?this.map[t]:null},y.prototype.has=function(t){return this.map.hasOwnProperty(f(t))},y.prototype.set=function(t,e){this.map[f(t)]=p(e)},y.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},y.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),d(t)},y.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),d(t)},y.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),d(t)},o&&(y.prototype[Symbol.iterator]=y.prototype.entries);var x=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function _(t,e){if(!(this instanceof _))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n,s=(e=e||{}).body;if(t instanceof _){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new y(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,s||null==t._bodyInit||(s=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new y(e.headers)),this.method=(n=(r=e.method||this.method||"GET").toUpperCase(),x.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in i)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function A(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function T(t,e){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new y(e.headers),this.url=e.url||"",this._initBody(t)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},v.call(_.prototype),v.call(T.prototype),T.prototype.clone=function(){return new T(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},T.error=function(){var t=new T(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var E=[301,302,303,307,308];T.redirect=function(t,e){if(-1===E.indexOf(e))throw new RangeError("Invalid status code");return new T(null,{status:e,headers:{location:t}})},e.DOMException=i.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function N(t,r){return new Promise((function(s,o){var c=new _(t,r);if(c.signal&&c.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function h(){l.abort()}if(l.onload=function(){var t,e,r={statusText:l.statusText,headers:(t=l.getAllResponseHeaders()||"",e=new y,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),i=r.shift().trim();if(i){var s=r.join(":").trim();try{e.append(i,s)}catch(t){n.warn("Response "+t.message)}}})),e)};0===c.url.indexOf("file://")&&(l.status<200||l.status>599)?r.status=200:r.status=l.status,r.url="responseURL"in l?l.responseURL:r.headers.get("X-Request-URL");var i="response"in l?l.response:l.responseText;setTimeout((function(){s(new T(i,r))}),0)},l.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},l.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request timed out"))}),0)},l.onabort=function(){setTimeout((function(){o(new e.DOMException("Aborted","AbortError"))}),0)},l.open(c.method,function(t){try{return""===t&&i.location.href?i.location.href:t}catch(e){return t}}(c.url),!0),"include"===c.credentials?l.withCredentials=!0:"omit"===c.credentials&&(l.withCredentials=!1),"responseType"in l&&(a?l.responseType="blob":u&&(l.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof y||i.Headers&&r.headers instanceof i.Headers)){var d=[];Object.getOwnPropertyNames(r.headers).forEach((function(t){d.push(f(t)),l.setRequestHeader(t,p(r.headers[t]))})),c.headers.forEach((function(t,e){-1===d.indexOf(e)&&l.setRequestHeader(e,t)}))}else c.headers.forEach((function(t,e){l.setRequestHeader(e,t)}));c.signal&&(c.signal.addEventListener("abort",h),l.onreadystatechange=function(){4===l.readyState&&c.signal.removeEventListener("abort",h)}),l.send(void 0===c._bodyInit?null:c._bodyInit)}))}N.polyfill=!0,i.fetch||(i.fetch=N,i.Headers=y,i.Request=_,i.Response=T),e.Headers=y,e.Request=_,e.Response=T,e.fetch=N,Object.defineProperty(e,"__esModule",{value:!0})}({})}(s),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var o=i.fetch?i:s;(e=o.fetch).default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e},1201:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},1320:(t,e,r)=>{"use strict";var n=r(2621);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},1605:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(939);class i{constructor(t){(0,n.A)(this,"termType",void 0),(0,n.A)(this,"classOrder",void 0),(0,n.A)(this,"value",void 0),this.value=t}substitute(t){return this}compareTerm(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.value<t.value?-1:this.value>t.value?1:0}equals(t){return!!t&&this.termType===t.termType&&this.value===t.value}hashString(){return this.toCanonical()}sameTerm(t){return this.equals(t)}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.A)(i,"fromValue",void 0),(0,n.A)(i,"toJS",void 0)},1909:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},2312:function(t,e){var r,n;void 0===(n="function"==typeof(r=function(){"use strict";function t(e,r,n,i){this.message=e,this.expected=r,this.found=n,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}return function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(t,Error),t.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e,r="";for(e=0;e<t.parts.length;e++)r+=t.parts[e]instanceof Array?s(t.parts[e][0])+"-"+s(t.parts[e][1]):s(t.parts[e]);return"["+(t.inverted?"^":"")+r+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(t){return t.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(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function s(t){return t.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(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}return"Expected "+function(t){var e,n,i,s=new Array(t.length);for(e=0;e<t.length;e++)s[e]=(i=t[e],r[i.type](i));if(s.sort(),s.length>0){for(e=1,n=1;e<s.length;e++)s[e-1]!==s[e]&&(s[n]=s[e],n++);s.length=n}switch(s.length){case 1:return s[0];case 2:return s[0]+" or "+s[1];default:return s.slice(0,-1).join(", ")+", or "+s[s.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."},{SyntaxError:t,parse:function(e,r){r=void 0!==r?r:{};var n,i={},s={turtleDoc:Qr},o=Qr,a=function(t){var e=Tn.toJSON();return e["@graph"]=[],t.filter((t=>Array.isArray(t))).forEach((t=>{t.forEach((t=>{e["@graph"].push(t)}))})),1===e["@graph"].length&&(Object.assign(e,e["@graph"][0]),delete e["@graph"]),e},c="\ufeff",u=Hr("\ufeff",!1),l=".",h=Hr(".",!1),f=function(t){return t},p="#",d=Hr("#",!1),y=/^[^\n]/,g=zr(["\n"],!0,!1),m="\n",b=Hr("\n",!1),w=function(t){return t.join("")},v="@prefix",x=Hr("@prefix",!1),_=function(t,e){return Tn.addPrefix(""===t?"0":t,e),{}},A="@base",T=Hr("@base",!1),E=function(t){return Tn.addBase(t),{}},N=/^[Bb]/,O=zr(["B","b"],!1,!1),j=/^[Aa]/,S=zr(["A","a"],!1,!1),R=/^[Ss]/,k=zr(["S","s"],!1,!1),I=/^[Ee]/,C=zr(["E","e"],!1,!1),P=/^[Pp]/,F=zr(["P","p"],!1,!1),U=/^[Rr]/,D=zr(["R","r"],!1,!1),M=/^[Ff]/,L=zr(["F","f"],!1,!1),B=/^[Ii]/,q=zr(["I","i"],!1,!1),$=/^[Xx]/,H=zr(["X","x"],!1,!1),z=function(t,e){var r={};return"string"==typeof t&&"[]"!==t?r["@id"]=t:"object"==typeof t&&Object.assign(r,t),e&&Object.assign(r,e),[r]},X=function(t,e){var r={};return t&&Object.assign(r,t),e&&Object.assign(r,e),[r]},V=";",G=Hr(";",!1),Q=function(t,e,r,n){var i={};return i[r]=n,i},W=function(t,e,r){return r},J=function(t,e,r){var n={};return r.unshift(function(t,e){var r={};return r[t]=e,r}(t,e)),r.forEach((t=>{t&&Object.keys(t).forEach((e=>{t[e].forEach((t=>{"@type"===e&&void 0!==t["@id"]&&(t=t["@id"]),void 0===n[e]?n[e]=t:Array.isArray(n[e])?n[e].push(t):n[e]=[n[e],t]}))}))})),n},Y=",",Z=Hr(",",!1),K=function(t,e){return e},tt=function(t,e){return e.unshift(t),e},et="a",rt=Hr("a",!1),nt=function(){return"@type"},it=function(t){return En(t,!0)},st=function(t){return En(t,!1)},ot=function(t){return"[]"===t?{}:{"@id":t}},at=function(t){return{"@id":t}},ct="[",ut=Hr("[",!1),lt="]",ht=Hr("]",!1),ft="(",pt=Hr("(",!1),dt=")",yt=Hr(")",!1),gt=function(t){return{"@list":t}},mt=function(t,e){return{"@value":t,"@language":e}},bt="^^",wt=Hr("^^",!1),vt=function(t,e){if("http://www.w3.org/2001/XMLSchema#boolean"===e&&"true"===t)return!0;if("http://www.w3.org/2001/XMLSchema#boolean"===e&&"false"===t)return!1;if("http://www.w3.org/2001/XMLSchema#integer"===e)return parseInt(t);if("http://www.w3.org/2001/XMLSchema#double"===e)return parseFloat(t);const r=Tn.resolve(e,!0);if(r){const n=e.split(":")[0];if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"true"===t)return Tn.decrement(n),!0;if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"false"===t)return Tn.decrement(n),!1;if("http://www.w3.org/2001/XMLSchema#integer"===r)return Tn.decrement(n),parseInt(t);if("http://www.w3.org/2001/XMLSchema#double"===r)return Tn.decrement(n),parseFloat(t)}return{"@value":t,"@type":e}},xt="true",_t=Hr("true",!1),At=function(){return!0},Tt="false",Et=Hr("false",!1),Nt=function(){return!1},Ot=function(t){return t+":"},jt="<",St=Hr("<",!1),Rt=/^[^\0- <>"{}|\^`\\]/,kt=zr([["\0"," "],"<",">",'"',"{","}","|","^","`","\\"],!0,!1),It=">",Ct=Hr(">",!1),Pt=function(t){const e=t.map((t=>65536<=t.codePointAt(0)&&t.codePointAt(0)<=983039?"a":1===t.length?t:6===t.length?String.fromCharCode("0x"+t.substring(2)):10===t.length?String.fromCodePoint("0x"+t.substring(2)):t)).join("");if(e.match(/^[^\u0000-\u0020<>"{}|^`\\]*$/)){var r=t.join("");try{return Tn.resolve(r)}catch(t){$r("Invalid IRIREF "+r)}}else $r("Invalid IRIREF "+t.join("")+" / "+e)},Ft=":",Ut=Hr(":",!1),Dt=function(t){return t=t||"0",!1===Tn.hasPrefix(t)&&$r("undefined prefix "+t),t},Mt=function(t){return t||""},Lt=function(t,e){return Tn.increment(t),Tn.resolve(t+":"+e)},Bt="_:",qt=Hr("_:",!1),$t=/^[0-9]/,Ht=zr([["0","9"]],!1,!1),zt="@",Xt=Hr("@",!1),Vt=/^[a-zA-Z]/,Gt=zr([["a","z"],["A","Z"]],!1,!1),Qt="-",Wt=Hr("-",!1),Jt=/^[a-zA-Z0-9]/,Yt=zr([["a","z"],["A","Z"],["0","9"]],!1,!1),Zt=function(t,e){return"-"+e.join("")},Kt=function(t,e){return t.join("")+e.join("")},te=/^[+\-]/,ee=zr(["+","-"],!1,!1),re=function(t){return t.match(/^[0+][0-9]+$/)?{"@value":t,"@type":"http://www.w3.org/2001/XMLSchema#integer"}:parseInt(t)},ne=function(t){return{"@value":t,"@type":"http://www.w3.org/2001/XMLSchema#decimal"}},ie=function(t){return{"@value":t,"@type":"http://www.w3.org/2001/XMLSchema#double"}},se=/^[eE]/,oe=zr(["e","E"],!1,!1),ae='"',ce=Hr('"',!1),ue=/^[^"\\\n\r]/,le=zr(['"',"\\","\n","\r"],!0,!1),he="'",fe=Hr("'",!1),pe=/^[^'\\\n\r]/,de=zr(["'","\\","\n","\r"],!0,!1),ye="'''",ge=Hr("'''",!1),me=/^[^'\\]/,be=zr(["'","\\"],!0,!1),we="''",ve=Hr("''",!1),xe=function(t,e){return"''"+e.join("")},_e=function(t,e){return"'"+e.join("")},Ae=function(t,e){return t.join("")+e.join("")},Te='"""',Ee=Hr('"""',!1),Ne=/^[^"\\]/,Oe=zr(['"',"\\"],!0,!1),je='""',Se=Hr('""',!1),Re=function(t,e){return'""'+e.join("")},ke=function(t,e){return'"'+e.join("")},Ie="\\U",Ce=Hr("\\U",!1),Pe=function(t){return String.fromCodePoint(parseInt(t.join(""),16))},Fe="\\u",Ue=Hr("\\u",!1),De=function(t){return String.fromCharCode(parseInt(t.join(""),16))},Me="\\t",Le=Hr("\\t",!1),Be=function(){return"\t"},qe="\\b",$e=Hr("\\b",!1),He=function(){return"\b"},ze="\\n",Xe=Hr("\\n",!1),Ve=function(){return"\n"},Ge="\\r",Qe=Hr("\\r",!1),We=function(){return"\r"},Je="\\f",Ye=Hr("\\f",!1),Ze=function(){return"\f"},Ke='\\"',tr=Hr('\\"',!1),er=function(){return'"'},rr="\\'",nr=Hr("\\'",!1),ir=function(){return"'"},sr="\\\\",or=Hr("\\\\",!1),ar=function(){return"\\"},cr=/^[ \t\r\n]/,ur=zr([" ","\t","\r","\n"],!1,!1),lr=function(){return"[]"},hr=/^[\uD800-\uDBFF]/,fr=zr([["\ud800","\udbff"]],!1,!1),pr=/^[\uDC00-\uDFFF]/,dr=zr([["\udc00","\udfff"]],!1,!1),yr=function(t,e){return t+e},gr=/^[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]/,mr=zr([["A","Z"],["a","z"],["À","Ö"],["Ø","ö"],["ø","˿"],["Ͱ","ͽ"],["Ϳ","῿"],["‌","‍"],["⁰","↏"],["Ⰰ","⿯"],["、","퟿"],["豈","﷏"],["ﷰ","�"]],!1,!1),br="_",wr=Hr("_",!1),vr="·",xr=Hr("·",!1),_r=/^[\u0300-\u036F]/,Ar=zr([["̀","ͯ"]],!1,!1),Tr=/^[\u203F-\u2040]/,Er=zr([["‿","⁀"]],!1,!1),Nr=function(t,e,r,n){return r.join("")+n.join("")},Or=function(t,e,r){return t+e.join("")+r.join("")},jr="%",Sr=Hr("%",!1),Rr=/^[0-9A-Fa-f]/,kr=zr([["0","9"],["A","F"],["a","f"]],!1,!1),Ir="\\",Cr=Hr("\\",!1),Pr=/^[_~.!$&'()*+,;=\/?#@%\-]/,Fr=zr(["_","~",".","!","$","&","'","(",")","*","+",",",";","=","/","?","#","@","%","-"],!1,!1),Ur=0,Dr=0,Mr=[{line:1,column:1}],Lr=0,Br=[],qr=0;if("startRule"in r){if(!(r.startRule in s))throw new Error("Can't start parsing from rule \""+r.startRule+'".');o=s[r.startRule]}function $r(e,r){throw function(e,r){return new t(e,null,null,r)}(e,r=void 0!==r?r:Vr(Dr,Ur))}function Hr(t,e){return{type:"literal",text:t,ignoreCase:e}}function zr(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Xr(t){var r,n=Mr[t];if(n)return n;for(r=t-1;!Mr[r];)r--;for(n={line:(n=Mr[r]).line,column:n.column};r<t;)10===e.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Mr[t]=n,n}function Vr(t,e){var r=Xr(t),n=Xr(e);return{start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function Gr(t){Ur<Lr||(Ur>Lr&&(Lr=Ur,Br=[]),Br.push(t))}function Qr(){var t,e,r,n,s;for(t=Ur,e=[],r=Wr();r!==i;)e.push(r),r=Wr();if(e!==i){for(r=[],n=Jr();n!==i;)r.push(n),n=Jr();if(r!==i){for(n=[],s=Yr();s!==i;)n.push(s),s=Yr();n!==i?(Dr=t,t=e=a(r)):(Ur=t,t=i)}else Ur=t,t=i}else Ur=t,t=i;return t}function Wr(){var t;return 65279===e.charCodeAt(Ur)?(t=c,Ur++):(t=i,0===qr&&Gr(u)),t}function Jr(){var t,r,n,s;if((t=function(){var t;return(t=function(){var t,r,n,s,o,a,c,u,f;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if(e.substr(Ur,7)===v?(n=v,Ur+=7):(n=i,0===qr&&Gr(x)),n!==i){for(s=[],o=Yr();o!==i;)s.push(o),o=Yr();if(s!==i)if((o=ln())!==i){for(a=[],c=Yr();c!==i;)a.push(c),c=Yr();if(a!==i)if((c=cn())!==i){for(u=[],f=Yr();f!==i;)u.push(f),f=Yr();u!==i?(46===e.charCodeAt(Ur)?(f=l,Ur++):(f=i,0===qr&&Gr(h)),f!==i?(Dr=t,t=r=_(o,c)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i}else Ur=t,t=i;else Ur=t,t=i}else Ur=t,t=i;else Ur=t,t=i;return t}())===i&&(t=function(){var t,r,n,s,o,a,c;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if(e.substr(Ur,5)===A?(n=A,Ur+=5):(n=i,0===qr&&Gr(T)),n!==i){for(s=[],o=Yr();o!==i;)s.push(o),o=Yr();if(s!==i)if((o=cn())!==i){for(a=[],c=Yr();c!==i;)a.push(c),c=Yr();a!==i?(46===e.charCodeAt(Ur)?(c=l,Ur++):(c=i,0===qr&&Gr(h)),c!==i?(Dr=t,t=r=E(o)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i}else Ur=t,t=i;else Ur=t,t=i;return t}())===i&&(t=function(){var t,r,n,s,o,a,c,u,l,h,f,p;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if(P.test(e.charAt(Ur))?(n=e.charAt(Ur),Ur++):(n=i,0===qr&&Gr(F)),n!==i)if(U.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(D)),s!==i)if(I.test(e.charAt(Ur))?(o=e.charAt(Ur),Ur++):(o=i,0===qr&&Gr(C)),o!==i)if(M.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(L)),a!==i)if(B.test(e.charAt(Ur))?(c=e.charAt(Ur),Ur++):(c=i,0===qr&&Gr(q)),c!==i)if($.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(H)),u!==i){for(l=[],h=Yr();h!==i;)l.push(h),h=Yr();if(l!==i)if((h=ln())!==i){for(f=[],p=Yr();p!==i;)f.push(p),p=Yr();f!==i&&(p=cn())!==i?(Dr=t,t=r=_(h,p)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i}else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;return t}())===i&&(t=function(){var t,r,n,s,o,a,c,u;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if(N.test(e.charAt(Ur))?(n=e.charAt(Ur),Ur++):(n=i,0===qr&&Gr(O)),n!==i)if(j.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(S)),s!==i)if(R.test(e.charAt(Ur))?(o=e.charAt(Ur),Ur++):(o=i,0===qr&&Gr(k)),o!==i)if(I.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(C)),a!==i){for(c=[],u=Yr();u!==i;)c.push(u),u=Yr();c!==i&&(u=cn())!==i?(Dr=t,t=r=E(u)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;return t}()),t}())===i)if(t=Ur,(r=function(){var t,e,r;return t=Ur,(e=function(){var t,e;return t=Ur,(e=nn())!==i&&(Dr=t,e=it(e)),(t=e)===i&&(t=an())===i&&(t=on()),t}())!==i&&(r=Zr())!==i?(Dr=t,t=e=z(e,r)):(Ur=t,t=i),t===i&&(t=Ur,(e=rn())!==i?((r=Zr())===i&&(r=null),r!==i?(Dr=t,t=e=X(e,r)):(Ur=t,t=i)):(Ur=t,t=i)),t}())!==i){for(n=[],s=Yr();s!==i;)n.push(s),s=Yr();n!==i?(46===e.charCodeAt(Ur)?(s=l,Ur++):(s=i,0===qr&&Gr(h)),s!==i?(Dr=t,t=r=f(r)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;return t}function Yr(){var t;return(t=function(){var t;return cr.test(e.charAt(Ur))?(t=e.charAt(Ur),Ur++):(t=i,0===qr&&Gr(ur)),t}())===i&&(t=function(){var t,r,n,s;if(t=Ur,35===e.charCodeAt(Ur)?(r=p,Ur++):(r=i,0===qr&&Gr(d)),r!==i){for(n=[],y.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(g));s!==i;)n.push(s),y.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(g));n!==i?(10===e.charCodeAt(Ur)?(s=m,Ur++):(s=i,0===qr&&Gr(b)),s!==i?(Dr=t,t=r=w(n)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;return t}()),t}function Zr(){var t,r,n,s,o,a,c,u,l,h;if(t=Ur,(r=tn())!==i)if((n=Kr())!==i){for(s=[],o=Ur,a=[],c=Yr();c!==i;)a.push(c),c=Yr();for(a!==i?(59===e.charCodeAt(Ur)?(c=V,Ur++):(c=i,0===qr&&Gr(G)),c!==i?(u=Ur,(l=tn())!==i&&(h=Kr())!==i?(Dr=u,u=l=Q(r,n,l,h)):(Ur=u,u=i),u===i&&(u=null),u!==i?(Dr=o,o=a=W(r,n,u)):(Ur=o,o=i)):(Ur=o,o=i)):(Ur=o,o=i);o!==i;){for(s.push(o),o=Ur,a=[],c=Yr();c!==i;)a.push(c),c=Yr();a!==i?(59===e.charCodeAt(Ur)?(c=V,Ur++):(c=i,0===qr&&Gr(G)),c!==i?(u=Ur,(l=tn())!==i&&(h=Kr())!==i?(Dr=u,u=l=Q(r,n,l,h)):(Ur=u,u=i),u===i&&(u=null),u!==i?(Dr=o,o=a=W(r,n,u)):(Ur=o,o=i)):(Ur=o,o=i)):(Ur=o,o=i)}s!==i?(Dr=t,t=r=J(r,n,s)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i;return t}function Kr(){var t,r,n,s,o,a,c;if(t=Ur,(r=en())!==i){for(n=[],s=Ur,o=[],a=Yr();a!==i;)o.push(a),a=Yr();for(o!==i?(44===e.charCodeAt(Ur)?(a=Y,Ur++):(a=i,0===qr&&Gr(Z)),a!==i&&(c=en())!==i?(Dr=s,s=o=K(r,c)):(Ur=s,s=i)):(Ur=s,s=i);s!==i;){for(n.push(s),s=Ur,o=[],a=Yr();a!==i;)o.push(a),a=Yr();o!==i?(44===e.charCodeAt(Ur)?(a=Y,Ur++):(a=i,0===qr&&Gr(Z)),a!==i&&(c=en())!==i?(Dr=s,s=o=K(r,c)):(Ur=s,s=i)):(Ur=s,s=i)}n!==i?(Dr=t,t=r=tt(r,n)):(Ur=t,t=i)}else Ur=t,t=i;return t}function tn(){var t,r,n;if(t=Ur,(r=function(){var t,e,r;for(t=Ur,e=[],r=Yr();r!==i;)e.push(r),r=Yr();return e!==i&&(r=on())!==i?(Dr=t,t=e=f(r)):(Ur=t,t=i),t}())!==i&&(Dr=t,r=f(r)),(t=r)===i){for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();r!==i?(97===e.charCodeAt(Ur)?(n=et,Ur++):(n=i,0===qr&&Gr(rt)),n!==i?(Dr=t,t=r=nt()):(Ur=t,t=i)):(Ur=t,t=i)}return t}function en(){var t,r;return(t=function(){var t;return(t=function(){var t,r,n,s,o,a,c;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if((n=sn())!==i){for(s=[],o=Yr();o!==i;)s.push(o),o=Yr();s!==i&&(o=function(){var t,r,n,s,o,a,c,u;if(t=Ur,64===e.charCodeAt(Ur)?(r=zt,Ur++):(r=i,0===qr&&Gr(Xt)),r!==i){if(n=[],Vt.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(Gt)),s!==i)for(;s!==i;)n.push(s),Vt.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(Gt));else n=i;if(n!==i){if(s=[],o=Ur,45===e.charCodeAt(Ur)?(a=Qt,Ur++):(a=i,0===qr&&Gr(Wt)),a!==i){if(c=[],Jt.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Yt)),u!==i)for(;u!==i;)c.push(u),Jt.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Yt));else c=i;c!==i?(Dr=o,o=a=Zt(n,c)):(Ur=o,o=i)}else Ur=o,o=i;for(;o!==i;)if(s.push(o),o=Ur,45===e.charCodeAt(Ur)?(a=Qt,Ur++):(a=i,0===qr&&Gr(Wt)),a!==i){if(c=[],Jt.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Yt)),u!==i)for(;u!==i;)c.push(u),Jt.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Yt));else c=i;c!==i?(Dr=o,o=a=Zt(n,c)):(Ur=o,o=i)}else Ur=o,o=i;s!==i?(Dr=t,t=r=Kt(n,s)):(Ur=t,t=i)}else Ur=t,t=i}else Ur=t,t=i;return t}())!==i?(Dr=t,t=r=mt(n,o)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i;if(t===i){for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if((n=sn())!==i){for(s=[],o=Yr();o!==i;)s.push(o),o=Yr();if(s!==i)if(e.substr(Ur,2)===bt?(o=bt,Ur+=2):(o=i,0===qr&&Gr(wt)),o!==i){for(a=[],c=Yr();c!==i;)a.push(c),c=Yr();a!==i&&(c=on())!==i?(Dr=t,t=r=vt(n,c)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i}else Ur=t,t=i;else Ur=t,t=i;if(t===i){for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();r!==i&&(n=sn())!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i)}}return t}())===i&&(t=function(){var t,r,n;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();return r!==i?((n=function(){var t,r,n,s,o,a,c,u,f;if(t=Ur,r=Ur,n=Ur,te.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(ee)),s===i&&(s=null),s!==i){if(o=Ur,a=[],$t.test(e.charAt(Ur))?(c=e.charAt(Ur),Ur++):(c=i,0===qr&&Gr(Ht)),c!==i)for(;c!==i;)a.push(c),$t.test(e.charAt(Ur))?(c=e.charAt(Ur),Ur++):(c=i,0===qr&&Gr(Ht));else a=i;if(a!==i)if(46===e.charCodeAt(Ur)?(c=l,Ur++):(c=i,0===qr&&Gr(h)),c!==i){for(u=[],$t.test(e.charAt(Ur))?(f=e.charAt(Ur),Ur++):(f=i,0===qr&&Gr(Ht));f!==i;)u.push(f),$t.test(e.charAt(Ur))?(f=e.charAt(Ur),Ur++):(f=i,0===qr&&Gr(Ht));u!==i&&(f=hn())!==i?o=a=[a,c,u,f]:(Ur=o,o=i)}else Ur=o,o=i;else Ur=o,o=i;if(o===i){if(o=Ur,46===e.charCodeAt(Ur)?(a=l,Ur++):(a=i,0===qr&&Gr(h)),a!==i){if(c=[],$t.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Ht)),u!==i)for(;u!==i;)c.push(u),$t.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Ht));else c=i;c!==i&&(u=hn())!==i?o=a=[a,c,u]:(Ur=o,o=i)}else Ur=o,o=i;if(o===i){if(o=Ur,a=[],$t.test(e.charAt(Ur))?(c=e.charAt(Ur),Ur++):(c=i,0===qr&&Gr(Ht)),c!==i)for(;c!==i;)a.push(c),$t.test(e.charAt(Ur))?(c=e.charAt(Ur),Ur++):(c=i,0===qr&&Gr(Ht));else a=i;a!==i&&(c=hn())!==i?o=a=[a,c]:(Ur=o,o=i)}}o!==i?n=s=[s,o]:(Ur=n,n=i)}else Ur=n,n=i;return(r=n!==i?e.substring(r,Ur):n)!==i&&(Dr=t,r=ie(r)),r}())===i&&(n=function(){var t,r,n,s,o,a,c,u;if(t=Ur,r=Ur,n=Ur,te.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(ee)),s===i&&(s=null),s!==i){for(o=[],$t.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(Ht));a!==i;)o.push(a),$t.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(Ht));if(o!==i)if(46===e.charCodeAt(Ur)?(a=l,Ur++):(a=i,0===qr&&Gr(h)),a!==i){if(c=[],$t.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Ht)),u!==i)for(;u!==i;)c.push(u),$t.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Ht));else c=i;c!==i?n=s=[s,o,a,c]:(Ur=n,n=i)}else Ur=n,n=i;else Ur=n,n=i}else Ur=n,n=i;return(r=n!==i?e.substring(r,Ur):n)!==i&&(Dr=t,r=ne(r)),r}())===i&&(n=function(){var t,r,n,s,o,a;if(t=Ur,r=Ur,n=Ur,te.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(ee)),s===i&&(s=null),s!==i){if(o=[],$t.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(Ht)),a!==i)for(;a!==i;)o.push(a),$t.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(Ht));else o=i;o!==i?n=s=[s,o]:(Ur=n,n=i)}else Ur=n,n=i;return(r=n!==i?e.substring(r,Ur):n)!==i&&(Dr=t,r=re(r)),r}()),n!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i)):(Ur=t,t=i),t}())===i&&(t=function(){var t,r,n;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i?(e.substr(Ur,4)===xt?(n=xt,Ur+=4):(n=i,0===qr&&Gr(_t)),n!==i?(Dr=t,t=r=At()):(Ur=t,t=i)):(Ur=t,t=i),t===i){for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();r!==i?(e.substr(Ur,5)===Tt?(n=Tt,Ur+=5):(n=i,0===qr&&Gr(Et)),n!==i?(Dr=t,t=r=Nt()):(Ur=t,t=i)):(Ur=t,t=i)}return t}()),t}())===i&&(t=Ur,(r=nn())!==i&&(Dr=t,r=st(r)),(t=r)===i&&(t=Ur,(r=an())!==i&&(Dr=t,r=ot(r)),(t=r)===i&&(t=Ur,(r=rn())!==i&&(Dr=t,r=f(r)),(t=r)===i&&(t=Ur,(r=on())!==i&&(Dr=t,r=at(r)),t=r)))),t}function rn(){var t,r,n,s,o,a;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if(91===e.charCodeAt(Ur)?(n=ct,Ur++):(n=i,0===qr&&Gr(ut)),n!==i)if((s=Zr())!==i){for(o=[],a=Yr();a!==i;)o.push(a),a=Yr();o!==i?(93===e.charCodeAt(Ur)?(a=lt,Ur++):(a=i,0===qr&&Gr(ht)),a!==i?(Dr=t,t=r=f(s)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;else Ur=t,t=i;else Ur=t,t=i;return t}function nn(){var t,r,n,s,o,a;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i)if(40===e.charCodeAt(Ur)?(n=ft,Ur++):(n=i,0===qr&&Gr(pt)),n!==i){for(s=[],o=en();o!==i;)s.push(o),o=en();if(s!==i){for(o=[],a=Yr();a!==i;)o.push(a),a=Yr();o!==i?(41===e.charCodeAt(Ur)?(a=dt,Ur++):(a=i,0===qr&&Gr(yt)),a!==i?(Dr=t,t=r=gt(s)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i}else Ur=t,t=i;else Ur=t,t=i;return t}function sn(){var t,r,n;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();return r!==i?((n=function(){var t,r,n,s,o,a,c,u;if(t=Ur,e.substr(Ur,3)===ye?(r=ye,Ur+=3):(r=i,0===qr&&Gr(ge)),r!==i){for(n=[],me.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(be)),s===i&&(s=pn())===i&&(s=fn());s!==i;)n.push(s),me.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(be)),s===i&&(s=pn())===i&&(s=fn());if(n!==i){if(s=[],o=Ur,e.substr(Ur,2)===we?(a=we,Ur+=2):(a=i,0===qr&&Gr(ve)),a!==i){if(c=[],me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=xe(n,c)):(Ur=o,o=i)}else Ur=o,o=i;if(o===i)if(o=Ur,39===e.charCodeAt(Ur)?(a=he,Ur++):(a=i,0===qr&&Gr(fe)),a!==i){if(c=[],me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=_e(n,c)):(Ur=o,o=i)}else Ur=o,o=i;for(;o!==i;){if(s.push(o),o=Ur,e.substr(Ur,2)===we?(a=we,Ur+=2):(a=i,0===qr&&Gr(ve)),a!==i){if(c=[],me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=xe(n,c)):(Ur=o,o=i)}else Ur=o,o=i;if(o===i)if(o=Ur,39===e.charCodeAt(Ur)?(a=he,Ur++):(a=i,0===qr&&Gr(fe)),a!==i){if(c=[],me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),me.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(be)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=_e(n,c)):(Ur=o,o=i)}else Ur=o,o=i}s!==i?(e.substr(Ur,3)===ye?(o=ye,Ur+=3):(o=i,0===qr&&Gr(ge)),o!==i?(Dr=t,t=r=Ae(n,s)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i}else Ur=t,t=i;return t}())===i&&(n=function(){var t,r,n,s,o,a,c,u;if(t=Ur,e.substr(Ur,3)===Te?(r=Te,Ur+=3):(r=i,0===qr&&Gr(Ee)),r!==i){for(n=[],Ne.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(Oe)),s===i&&(s=pn())===i&&(s=fn());s!==i;)n.push(s),Ne.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(Oe)),s===i&&(s=pn())===i&&(s=fn());if(n!==i){if(s=[],o=Ur,e.substr(Ur,2)===je?(a=je,Ur+=2):(a=i,0===qr&&Gr(Se)),a!==i){if(c=[],Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=Re(n,c)):(Ur=o,o=i)}else Ur=o,o=i;if(o===i)if(o=Ur,34===e.charCodeAt(Ur)?(a=ae,Ur++):(a=i,0===qr&&Gr(ce)),a!==i){if(c=[],Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=ke(n,c)):(Ur=o,o=i)}else Ur=o,o=i;for(;o!==i;){if(s.push(o),o=Ur,e.substr(Ur,2)===je?(a=je,Ur+=2):(a=i,0===qr&&Gr(Se)),a!==i){if(c=[],Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=Re(n,c)):(Ur=o,o=i)}else Ur=o,o=i;if(o===i)if(o=Ur,34===e.charCodeAt(Ur)?(a=ae,Ur++):(a=i,0===qr&&Gr(ce)),a!==i){if(c=[],Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn()),u!==i)for(;u!==i;)c.push(u),Ne.test(e.charAt(Ur))?(u=e.charAt(Ur),Ur++):(u=i,0===qr&&Gr(Oe)),u===i&&(u=pn())===i&&(u=fn());else c=i;c!==i?(Dr=o,o=a=ke(n,c)):(Ur=o,o=i)}else Ur=o,o=i}s!==i?(e.substr(Ur,3)===Te?(o=Te,Ur+=3):(o=i,0===qr&&Gr(Ee)),o!==i?(Dr=t,t=r=Ae(n,s)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i}else Ur=t,t=i;return t}())===i&&(n=function(){var t,r,n,s;if(t=Ur,39===e.charCodeAt(Ur)?(r=he,Ur++):(r=i,0===qr&&Gr(fe)),r!==i){for(n=[],pe.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(de)),s===i&&(s=pn())===i&&(s=fn());s!==i;)n.push(s),pe.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(de)),s===i&&(s=pn())===i&&(s=fn());n!==i?(39===e.charCodeAt(Ur)?(s=he,Ur++):(s=i,0===qr&&Gr(fe)),s!==i?(Dr=t,t=r=w(n)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;return t}())===i&&(n=function(){var t,r,n,s;if(t=Ur,34===e.charCodeAt(Ur)?(r=ae,Ur++):(r=i,0===qr&&Gr(ce)),r!==i){for(n=[],ue.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(le)),s===i&&(s=pn())===i&&(s=fn());s!==i;)n.push(s),ue.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(le)),s===i&&(s=pn())===i&&(s=fn());n!==i?(34===e.charCodeAt(Ur)?(s=ae,Ur++):(s=i,0===qr&&Gr(ce)),s!==i?(Dr=t,t=r=w(n)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;return t}()),n!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i)):(Ur=t,t=i),t}function on(){var t,r,n;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i&&(n=cn())!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i),t===i){for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();r!==i&&(n=function(){var t,r;return(t=function(){var t,r,n;return t=Ur,(r=un())!==i&&(n=function(){var t,r,n,s,o,a,c,u;if(t=Ur,(r=yn())===i&&(58===e.charCodeAt(Ur)?(r=Ft,Ur++):(r=i,0===qr&&Gr(Ut)),r===i&&($t.test(e.charAt(Ur))?(r=e.charAt(Ur),Ur++):(r=i,0===qr&&Gr(Ht)),r===i&&(r=bn()))),r!==i){for(n=[],(s=gn())===i&&(58===e.charCodeAt(Ur)?(s=Ft,Ur++):(s=i,0===qr&&Gr(Ut)),s===i&&(s=bn()));s!==i;)n.push(s),(s=gn())===i&&(58===e.charCodeAt(Ur)?(s=Ft,Ur++):(s=i,0===qr&&Gr(Ut)),s===i&&(s=bn()));if(n!==i){if(s=[],o=Ur,a=[],46===e.charCodeAt(Ur)?(c=l,Ur++):(c=i,0===qr&&Gr(h)),c!==i)for(;c!==i;)a.push(c),46===e.charCodeAt(Ur)?(c=l,Ur++):(c=i,0===qr&&Gr(h));else a=i;if(a!==i){if(c=[],(u=gn())===i&&(58===e.charCodeAt(Ur)?(u=Ft,Ur++):(u=i,0===qr&&Gr(Ut)),u===i&&(u=bn())),u!==i)for(;u!==i;)c.push(u),(u=gn())===i&&(58===e.charCodeAt(Ur)?(u=Ft,Ur++):(u=i,0===qr&&Gr(Ut)),u===i&&(u=bn()));else c=i;c!==i?(Dr=o,o=a=Nr(r,n,a,c)):(Ur=o,o=i)}else Ur=o,o=i;for(;o!==i;){if(s.push(o),o=Ur,a=[],46===e.charCodeAt(Ur)?(c=l,Ur++):(c=i,0===qr&&Gr(h)),c!==i)for(;c!==i;)a.push(c),46===e.charCodeAt(Ur)?(c=l,Ur++):(c=i,0===qr&&Gr(h));else a=i;if(a!==i){if(c=[],(u=gn())===i&&(58===e.charCodeAt(Ur)?(u=Ft,Ur++):(u=i,0===qr&&Gr(Ut)),u===i&&(u=bn())),u!==i)for(;u!==i;)c.push(u),(u=gn())===i&&(58===e.charCodeAt(Ur)?(u=Ft,Ur++):(u=i,0===qr&&Gr(Ut)),u===i&&(u=bn()));else c=i;c!==i?(Dr=o,o=a=Nr(r,n,a,c)):(Ur=o,o=i)}else Ur=o,o=i}s!==i?(Dr=t,t=r=Or(r,n,s)):(Ur=t,t=i)}else Ur=t,t=i}else Ur=t,t=i;return t}())!==i?(Dr=t,t=r=Lt(r,n)):(Ur=t,t=i),t}())===i&&(t=Ur,(r=un())!==i&&(Dr=t,r=Ot(r)),t=r),t}())!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i)}return t}function an(){var t,r,n;for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();if(r!==i&&(n=function(){var t,r,n,s,o,a,c,u,f,p;if(t=Ur,r=Ur,e.substr(Ur,2)===Bt?(n=Bt,Ur+=2):(n=i,0===qr&&Gr(qt)),n!==i)if((s=yn())===i&&($t.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(Ht))),s!==i){for(o=[],a=gn();a!==i;)o.push(a),a=gn();if(o!==i){if(a=[],c=Ur,u=[],46===e.charCodeAt(Ur)?(f=l,Ur++):(f=i,0===qr&&Gr(h)),f!==i)for(;f!==i;)u.push(f),46===e.charCodeAt(Ur)?(f=l,Ur++):(f=i,0===qr&&Gr(h));else u=i;if(u!==i){if(f=[],(p=gn())!==i)for(;p!==i;)f.push(p),p=gn();else f=i;f!==i?c=u=[u,f]:(Ur=c,c=i)}else Ur=c,c=i;for(;c!==i;){if(a.push(c),c=Ur,u=[],46===e.charCodeAt(Ur)?(f=l,Ur++):(f=i,0===qr&&Gr(h)),f!==i)for(;f!==i;)u.push(f),46===e.charCodeAt(Ur)?(f=l,Ur++):(f=i,0===qr&&Gr(h));else u=i;if(u!==i){if(f=[],(p=gn())!==i)for(;p!==i;)f.push(p),p=gn();else f=i;f!==i?c=u=[u,f]:(Ur=c,c=i)}else Ur=c,c=i}a!==i?r=n=[n,s,o,a]:(Ur=r,r=i)}else Ur=r,r=i}else Ur=r,r=i;else Ur=r,r=i;return r!==i?e.substring(t,Ur):r}())!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i),t===i){for(t=Ur,r=[],n=Yr();n!==i;)r.push(n),n=Yr();r!==i&&(n=function(){var t,r,n,s;if(t=Ur,91===e.charCodeAt(Ur)?(r=ct,Ur++):(r=i,0===qr&&Gr(ut)),r!==i){for(n=[],s=Yr();s!==i;)n.push(s),s=Yr();n!==i?(93===e.charCodeAt(Ur)?(s=lt,Ur++):(s=i,0===qr&&Gr(ht)),s!==i?(Dr=t,t=r=lr()):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;return t}())!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i)}return t}function cn(){var t,r,n,s;if(t=Ur,60===e.charCodeAt(Ur)?(r=jt,Ur++):(r=i,0===qr&&Gr(St)),r!==i){for(n=[],Rt.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(kt)),s===i&&(s=fn());s!==i;)n.push(s),Rt.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(kt)),s===i&&(s=fn());n!==i?(62===e.charCodeAt(Ur)?(s=It,Ur++):(s=i,0===qr&&Gr(Ct)),s!==i?(Dr=t,t=r=Pt(n)):(Ur=t,t=i)):(Ur=t,t=i)}else Ur=t,t=i;return t}function un(){var t,r,n;return t=Ur,(r=mn())===i&&(r=null),r!==i?(58===e.charCodeAt(Ur)?(n=Ft,Ur++):(n=i,0===qr&&Gr(Ut)),n!==i?(Dr=t,t=r=Dt(r)):(Ur=t,t=i)):(Ur=t,t=i),t}function ln(){var t,r,n;return t=Ur,(r=mn())===i&&(r=null),r!==i?(58===e.charCodeAt(Ur)?(n=Ft,Ur++):(n=i,0===qr&&Gr(Ut)),n!==i?(Dr=t,t=r=Mt(r)):(Ur=t,t=i)):(Ur=t,t=i),t}function hn(){var t,r,n,s,o,a;if(t=Ur,r=Ur,se.test(e.charAt(Ur))?(n=e.charAt(Ur),Ur++):(n=i,0===qr&&Gr(oe)),n!==i)if(te.test(e.charAt(Ur))?(s=e.charAt(Ur),Ur++):(s=i,0===qr&&Gr(ee)),s===i&&(s=null),s!==i){if(o=[],$t.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(Ht)),a!==i)for(;a!==i;)o.push(a),$t.test(e.charAt(Ur))?(a=e.charAt(Ur),Ur++):(a=i,0===qr&&Gr(Ht));else o=i;o!==i?r=n=[n,s,o]:(Ur=r,r=i)}else Ur=r,r=i;else Ur=r,r=i;return r!==i?e.substring(t,Ur):r}function fn(){var t,r,n,s,o,a,c,u,l,h,f;return t=Ur,e.substr(Ur,2)===Ie?(r=Ie,Ur+=2):(r=i,0===qr&&Gr(Ce)),r!==i?(n=Ur,(s=wn())!==i&&(o=wn())!==i&&(a=wn())!==i&&(c=wn())!==i&&(u=wn())!==i&&(l=wn())!==i&&(h=wn())!==i&&(f=wn())!==i?n=s=[s,o,a,c,u,l,h,f]:(Ur=n,n=i),n!==i?(Dr=t,t=r=Pe(n)):(Ur=t,t=i)):(Ur=t,t=i),t===i&&(t=Ur,e.substr(Ur,2)===Fe?(r=Fe,Ur+=2):(r=i,0===qr&&Gr(Ue)),r!==i?(n=Ur,(s=wn())!==i&&(o=wn())!==i&&(a=wn())!==i&&(c=wn())!==i?n=s=[s,o,a,c]:(Ur=n,n=i),n!==i?(Dr=t,t=r=De(n)):(Ur=t,t=i)):(Ur=t,t=i)),t}function pn(){var t,r;return t=Ur,e.substr(Ur,2)===Me?(r=Me,Ur+=2):(r=i,0===qr&&Gr(Le)),r!==i&&(Dr=t,r=Be()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===qe?(r=qe,Ur+=2):(r=i,0===qr&&Gr($e)),r!==i&&(Dr=t,r=He()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===ze?(r=ze,Ur+=2):(r=i,0===qr&&Gr(Xe)),r!==i&&(Dr=t,r=Ve()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===Ge?(r=Ge,Ur+=2):(r=i,0===qr&&Gr(Qe)),r!==i&&(Dr=t,r=We()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===Je?(r=Je,Ur+=2):(r=i,0===qr&&Gr(Ye)),r!==i&&(Dr=t,r=Ze()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===Ke?(r=Ke,Ur+=2):(r=i,0===qr&&Gr(tr)),r!==i&&(Dr=t,r=er()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===rr?(r=rr,Ur+=2):(r=i,0===qr&&Gr(nr)),r!==i&&(Dr=t,r=ir()),(t=r)===i&&(t=Ur,e.substr(Ur,2)===sr?(r=sr,Ur+=2):(r=i,0===qr&&Gr(or)),r!==i&&(Dr=t,r=ar()),t=r))))))),t}function dn(){var t,r,n;return t=Ur,hr.test(e.charAt(Ur))?(r=e.charAt(Ur),Ur++):(r=i,0===qr&&Gr(fr)),r!==i?(pr.test(e.charAt(Ur))?(n=e.charAt(Ur),Ur++):(n=i,0===qr&&Gr(dr)),n!==i?(Dr=t,t=r=yr(r,n)):(Ur=t,t=i)):(Ur=t,t=i),t===i&&(gr.test(e.charAt(Ur))?(t=e.charAt(Ur),Ur++):(t=i,0===qr&&Gr(mr))),t}function yn(){var t;return(t=dn())===i&&(95===e.charCodeAt(Ur)?(t=br,Ur++):(t=i,0===qr&&Gr(wr))),t}function gn(){var t;return(t=yn())===i&&(45===e.charCodeAt(Ur)?(t=Qt,Ur++):(t=i,0===qr&&Gr(Wt)),t===i&&($t.test(e.charAt(Ur))?(t=e.charAt(Ur),Ur++):(t=i,0===qr&&Gr(Ht)),t===i&&(183===e.charCodeAt(Ur)?(t=vr,Ur++):(t=i,0===qr&&Gr(xr)),t===i&&(_r.test(e.charAt(Ur))?(t=e.charAt(Ur),Ur++):(t=i,0===qr&&Gr(Ar)),t===i&&(Tr.test(e.charAt(Ur))?(t=e.charAt(Ur),Ur++):(t=i,0===qr&&Gr(Er))))))),t}function mn(){var t,r,n,s,o,a,c,u,f;if(t=Ur,r=Ur,(n=dn())!==i){for(s=[],o=gn();o!==i;)s.push(o),o=gn();if(s!==i){if(o=[],a=Ur,c=[],46===e.charCodeAt(Ur)?(u=l,Ur++):(u=i,0===qr&&Gr(h)),u!==i)for(;u!==i;)c.push(u),46===e.charCodeAt(Ur)?(u=l,Ur++):(u=i,0===qr&&Gr(h));else c=i;if(c!==i){if(u=[],(f=gn())!==i)for(;f!==i;)u.push(f),f=gn();else u=i;u!==i?a=c=[c,u]:(Ur=a,a=i)}else Ur=a,a=i;for(;a!==i;){if(o.push(a),a=Ur,c=[],46===e.charCodeAt(Ur)?(u=l,Ur++):(u=i,0===qr&&Gr(h)),u!==i)for(;u!==i;)c.push(u),46===e.charCodeAt(Ur)?(u=l,Ur++):(u=i,0===qr&&Gr(h));else c=i;if(c!==i){if(u=[],(f=gn())!==i)for(;f!==i;)u.push(f),f=gn();else u=i;u!==i?a=c=[c,u]:(Ur=a,a=i)}else Ur=a,a=i}o!==i?r=n=[n,s,o]:(Ur=r,r=i)}else Ur=r,r=i}else Ur=r,r=i;return r!==i?e.substring(t,Ur):r}function bn(){var t;return(t=function(){var t,r,n,s,o;return t=Ur,r=Ur,37===e.charCodeAt(Ur)?(n=jr,Ur++):(n=i,0===qr&&Gr(Sr)),n!==i&&(s=wn())!==i&&(o=wn())!==i?r=n=[n,s,o]:(Ur=r,r=i),r!==i?e.substring(t,Ur):r}())===i&&(t=function(){var t,r,n;return t=Ur,92===e.charCodeAt(Ur)?(r=Ir,Ur++):(r=i,0===qr&&Gr(Cr)),r!==i?(Pr.test(e.charAt(Ur))?(n=e.charAt(Ur),Ur++):(n=i,0===qr&&Gr(Fr)),n!==i?(Dr=t,t=r=f(n)):(Ur=t,t=i)):(Ur=t,t=i),t}()),t}function wn(){var t;return Rr.test(e.charAt(Ur))?(t=e.charAt(Ur),Ur++):(t=i,0===qr&&Gr(kr)),t}var vn,xn,_n,An=function(t){return t.match(/^[a-z](.*?):(.+?)/g)},Tn={base:[],data:{},addBase:function(t){if(0===Tn.base.length)return void Tn.base.push(t);const e=Tn.base[Tn.base.length-1];e!==t&&Tn.base.push(new URL(t,e).toString())},addPrefix:function(t,e){const r=Tn.data[t];void 0===r?Tn.data[t]=[{uri:e,count:0}]:r[r.length-1].uri!==e&&r.push({uri:e,count:0})},hasPrefix:function(t){return void 0!==this.data[t]},resolve:function(t,e){const n=Object.keys(Tn.data).find((e=>0===t.indexOf(e+":")));if(void 0!==n){const r=Tn.data[n];if(1===r.length&&!0!==e&&An(r[0].uri))return t;const i=r[r.length-1].uri;return t.replace(n+":",i)}var i=0===Tn.base.length?r.baseIRI:Tn.base[Tn.base.length-1];return!i||t.match(/^(http:|https:|urn:|file:)/)?t:0===t.indexOf("//")&&i?i.split("//")[0]+t:new URL(t,i).toString()},increment:function(t){const e=Tn.data[t];void 0!==e&&e[e.length-1].count++},decrement:function(t){const e=Tn.data[t];void 0!==e&&e[e.length-1].count--},toJSON:function(){const t={};return Tn.base.length>0&&(void 0===t["@context"]&&(t["@context"]={}),t["@context"]["@base"]=Tn.base[0]),Object.keys(Tn.data).forEach((e=>{const r=Tn.data[e][0];"http://www.w3.org/2001/XMLSchema#"===r.uri&&r.count<1||An(r.uri)&&(void 0===t["@context"]&&(t["@context"]={}),t["@context"][e]=r.uri)})),t}};function En(t,e){if(void 0===t["@list"])return t;if(!e&&!t["@list"].find((t=>void 0!==t["@list"])))return t;if(0===t["@list"].length)return{"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};var r={},n=null;return t["@list"].forEach((t=>{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"]=En(t,!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((n=o())!==i&&Ur===e.length)return n;throw n!==i&&Ur<e.length&&Gr({type:"end"}),vn=Br,xn=Lr<e.length?e.charAt(Lr):null,_n=Lr<e.length?Vr(Lr,Lr+1):Vr(Lr,Lr),new t(t.buildMessage(vn,xn),vn,xn,_n)}}})?r.apply(e,[]):r)||(t.exports=n)},2313:(t,e,r)=>{"use strict";var n=r(6357);const i=r(2504),s=r(9029),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=u,e.IS=50;const a=2147483647;function c(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return l(t,e,r)}function l(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=c(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|y(t.length),r=c(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?c(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return h(t),c(t<0?0:0|y(t))}function p(t){const e=t.length<0?0:0|y(t.length),r=c(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function y(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function g(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(t).length;default:if(i)return n?-1:G(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return S(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return N(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let s,o=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let n=-1;for(s=r;s<a;s++)if(u(t,s)===u(e,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===c)return n*o}else-1!==n&&(s-=s-n),n=-1}else for(r+c>a&&(r=a-c),s=r;s>=0;s--){let r=!0;for(let n=0;n<c;n++)if(u(t,s+n)!==u(e,n)){r=!1;break}if(r)return s}return-1}function x(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const s=e.length;let o;for(n>s/2&&(n=s/2),o=0;o<n;++o){const n=parseInt(e.substr(2*o,2),16);if(Y(n))return o;t[r+o]=n}return o}function _(t,e,r,n){return W(G(e,t.length-r),t,r,n)}function A(t,e,r,n){return W(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function T(t,e,r,n){return W(Q(e),t,r,n)}function E(t,e,r,n){return W(function(t,e){let r,n,i;const s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,s.push(i),s.push(n);return s}(e,t.length-r),t,r,n)}function N(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let s=null,o=e>239?4:e>223?3:e>191?2:1;if(i+o<=r){let r,n,a,c;switch(o){case 1:e<128&&(s=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(s=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return function(t){const e=t.length;if(e<=j)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=j));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return l(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?c(t):void 0!==e?"string"==typeof r?c(t).fill(e,r):c(t).fill(e):c(t)}(t,e,r)},u.allocUnsafe=function(t){return f(t)},u.allocUnsafeSlow=function(t){return f(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),J(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).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}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(J(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)b(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?O(this,0,t):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0);const a=Math.min(s,o),c=this.slice(n,i),l=t.slice(e,r);for(let t=0;t<a;++t)if(c[t]!==l[t]){s=c[t],o=l[t];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const j=4096;function S(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function R(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function k(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=Z[t[n]];return i}function I(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,i,s){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function F(t,e,r,n,i){H(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function U(t,e,r,n,i){H(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s>>=8,t[r+6]=s,s>>=8,t[r+5]=s,s>>=8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function D(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return e=+e,r>>>=0,i||D(t,0,r,4),s.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,i){return e=+e,r>>>=0,i||D(t,0,r,8),s.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,s=0;for(;++s<e&&(i*=256);)n+=this[t+s]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=K((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=K((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,s=0;for(;++s<e&&(i*=256);)n+=this[t+s]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,s=this[t+--n];for(;n>0&&(i*=256);)s+=this[t+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*e)),s},u.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=K((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),u.prototype.readBigInt64BE=K((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),s.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),s.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),s.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),s.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,s=0;for(this[e]=255&t;++s<r&&(i*=256);)this[e+s]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=K((function(t,e=0){return F(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=K((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=0,s=1,o=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===o&&0!==this[e+i-1]&&(o=1),this[e+i]=(t/s|0)-o&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/s|0)-o&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=K((function(t,e=0){return F(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=K((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=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&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const s=u.isBuffer(t)?t:u.from(t,n),o=s.length;if(0===o)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%o]}return this};const B={};function q(t,e,r){B[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function $(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function H(t,e,r,n,i,s){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=s>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){z(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||X(e,t.length-(r+1))}(n,i,s)}function z(t,e){if("number"!=typeof t)throw new B.ERR_INVALID_ARG_TYPE(e,"number",t)}function X(t,e,r){if(Math.floor(t)!==t)throw z(t,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function G(t,e){let r;e=e||1/0;const n=t.length;let i=null;const s=[];for(let o=0;o<n;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function Q(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const Z=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function K(t){return"undefined"==typeof BigInt?tt:t}function tt(){throw new Error("BigInt not supported")}},2504:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,s=a(t),o=s[0],c=s[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,c)),l=0,h=c>0?o-4:o;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,s=[],o=16383,a=0,u=n-i;a<u;a+=o)s.push(c(t,a,a+o>u?u:a+o));return 1===i?(e=t[n-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,s,o=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(r[(s=i)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2621:t=>{"use strict";t.exports=function(t){return t!=t}},2719:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var i=0;i<e.length;i+=1)r[i+t.length]=e[i];return r};t.exports=function(t){var i=this;if("function"!=typeof i||"[object Function]"!==e.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var s,o=function(t){for(var e=[],r=1,n=0;r<t.length;r+=1,n+=1)e[n]=t[r];return e}(arguments),a=r(0,i.length-o.length),c=[],u=0;u<a;u++)c[u]="$"+u;if(s=Function("binder","return function ("+function(t){for(var e="",r=0;r<t.length;r+=1)e+=t[r],r+1<t.length&&(e+=",");return e}(c)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof s){var e=i.apply(this,n(o,arguments));return Object(e)===e?e:this}return i.apply(t,n(o,arguments))})),i.prototype){var l=function(){};l.prototype=i.prototype,s.prototype=new l,l.prototype=null}return s}},2774:(t,e,r)=>{"use strict";var n=r(8651),i=r(6688),s=i([n("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&s(t,".prototype.")>-1?i([r]):r}},2843:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var i=Object.getOwnPropertySymbols(t);if(1!==i.length||i[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var s=Object.getOwnPropertyDescriptor(t,e);if(42!==s.value||!0!==s.enumerable)return!1}return!0}},3036:t=>{"use strict";t.exports=Function.prototype.apply},3249:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},3257:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(2843);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},3381:(t,e,r)=>{"use strict";var n=r(8404),i=r(821),s=r(6601),o=r(2774),a=r(8109),c=r(7106),u=o("Object.prototype.toString"),l=r(6626)(),h="undefined"==typeof globalThis?r.g:globalThis,f=i(),p=o("String.prototype.slice"),d=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},y={__proto__:null};n(f,l&&a&&c?function(t){var e=new h[t];if(Symbol.toStringTag in e&&c){var r=c(e),n=a(r,Symbol.toStringTag);if(!n&&r){var i=c(r);n=a(i,Symbol.toStringTag)}y["$"+t]=s(n.get)}}:function(t){var e=new h[t],r=e.slice||e.set;r&&(y["$"+t]=s(r))}),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!l){var e=p(u(t),8,-1);return d(f,e)>-1?e:"Object"===e&&function(t){var e=!1;return n(y,(function(r,n){if(!e)try{r(t),e=p(n,1)}catch(t){}})),e}(t)}return a?function(t){var e=!1;return n(y,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=p(n,1))}catch(t){}})),e}(t):null}},3534:(t,e,r)=>{"use strict";var n=r(9636),i=r(5421);t.exports=function(){var t=n();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},3627:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var n=r(939),i=r(9390),s=r(1605),o=r(6866),a=r(362),c=r(546);class u extends s.A{constructor(t){if(super((0,a.E)(t)),(0,n.A)(this,"termType",o.Kk),(0,n.A)(this,"classOrder",i.A.NamedNode),!this.value)throw new Error("Missing IRI for NamedNode");if(!this.value.includes(":"))throw new Error('NamedNode IRI "'+t+'" must be absolute.');if(this.value.includes(" "))throw new Error('Error: NamedNode IRI "'+t+'" must not contain unencoded spaces.')}dir(){var t=this.value.split("#")[0],e=t.slice(0,-1).lastIndexOf("/"),r=t.indexOf("//");return r>=0&&e<r+2||e<0?null:new u(t.slice(0,e+1))}site(){var t=this.value.split("#")[0],e=t.indexOf("//");if(e<0)throw new Error("This URI does not have a web site part (origin)");var r=t.indexOf("/",e+2);return new u(r<0?t.slice(0)+"/":t.slice(0,r+1))}doc(){return this.value.indexOf("#")<0?this:new u(this.value.split("#")[0])}toString(){return"<"+this.value+">"}id(){return this.value.split("#")[1]}get uri(){return this.value}set uri(t){this.value=t}static fromValue(t){return null==t||(0,c.D0)(t)?t:new u(t)}}},3746:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var s=/^\s*class\b/,o=function(t){try{var e=n.call(t);return s.test(e)}catch(t){return!1}},a=function(t){try{return!o(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;c.call(f)===c.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!o(t)&&a(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return a(t);if(o(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}},3766:(t,e,r)=>{"use strict";var n=r(5846);t.exports=n.getPrototypeOf||null},3774:t=>{"use strict";t.exports=Math.max},3787:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n={debug(t){},warn(t){},info(t){},error(t){},success(t){},msg(t){}}},4055:t=>{"use strict";t.exports=URIError},4221:(t,e,r)=>{"use strict";r.r(e),r.d(e,{docpart:()=>o,document:()=>a,hostpart:()=>c,join:()=>u,protocol:()=>l,refTo:()=>h});var n=r(3627),i=r(6357),s=s||i.log;function o(t){var e;return(e=t.indexOf("#"))<0?t:t.slice(0,e)}function a(t){return new n.A(o(t))}function c(t){var e=/[^\/]*\/\/([^\/]*)\//.exec(t);return e?e[1]:""}function u(t,e){var r,n,i,o,a,c=e.indexOf("#");if(c>0&&(e=e.slice(0,c)),0===t.length)return e;if(0===t.indexOf("#"))return e+t;if(t.indexOf(":")>=0)return t;if(r=e.indexOf(":"),0===e.length)return t;if(r<0)return s("Invalid base: "+e+" in join with given: "+t),t;if(n=e.slice(0,+r+1||9e9),0===t.indexOf("//"))return n+t;if(e.indexOf("//",r)===r+1){if((i=e.indexOf("/",r+3))<0)return e.length-r-3>0?e+"/"+t:n+t}else if((i=e.indexOf("/",r+1))<0)return e.length-r-1>0?e+"/"+t:n+t;if(0===t.indexOf("/"))return e.slice(0,i)+t;if((o=(a=e.slice(i)).lastIndexOf("/"))<0)return n+t;for(o>=0&&o<a.length-1&&(a=a.slice(0,+o+1||9e9)),a+=t;a.match(/[^\/]*\/\.\.\//);)a=a.replace(/[^\/]*\/\.\.\//,"");return a=(a=a.replace(/\.\//g,"")).replace(/\/\.$/,"/"),e.slice(0,i)+a}function l(t){const e=t.indexOf(":");return e<0?null:t.slice(0,e)}function h(t,e){var r,n,i,s,o,a,c,u,l,h,f,p,d=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!t)return e;if(t===e)return"";for(r=c=0,s=e.length;c<s&&e[r]===t[r];r=++c);if(t.slice(0,r).match(d)&&((n=e.indexOf("//"))<0&&(n=-2),i=e.indexOf("/",n+2),"/"!==e[i+1]&&"/"!==t[i+1]&&e.slice(0,i)===t.slice(0,i)))return e.slice(i);if("#"===e[r]&&t.length===r)return e.slice(r);for(;r>0&&"/"!==e[r-1];)r--;if(r<3)return e;if(t.indexOf("//",r-2)>0||e.indexOf("//",r-2)>0)return e;if(t.indexOf(":",r)>0)return e;for(a=0,u=0,o=(h=t.slice(r)).length;u<o;u++)"/"===h[u]&&a++;if(0===a&&r<e.length&&"#"===e[r])return"./"+e.slice(r);if(0===a&&r===e.length)return"./";if(p="",a>0)for(l=1,f=a;f>=1?l<=f:l>=f;f>=1?++l:--l)p+="../";return p+e.slice(r)}},4610:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,s=Function.prototype.toString,o=/^\s*(?:function)?\*/,a=r(6626)(),c=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(o.test(s.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!c)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&c(e)}return c(t)===n}},5049:(t,e,r)=>{"use strict";var n=r(2719);t.exports=Function.prototype.bind||n},5074:(t,e,r)=>{"use strict";var n=r(5421),i=r(1320);t.exports=function(){var t=i();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},5215:(t,e,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,s=r(5049);t.exports=s.call(n,i)},5293:t=>{"use strict";t.exports=Error},5403:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function s(t,e){return s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},s(t,e)}var o,a,c={};function u(t,e,r){r||(r=Error);var o=function(r){function o(r,s,a){var c;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),c=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}(this,i(o).call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,s,a))),c.code=t,c}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(o,r),o}(r);c[t]=o}function l(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",(function(t,e,i){var s,a,c,u,h;if(void 0===o&&(o=r(182)),o("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(a="not ",e.substr(0,4)===a)?(s="must not be",e=e.replace(/^not /,"")):s="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-9,r)===e}(t," argument"))c="The ".concat(t," ").concat(s," ").concat(l(e,"type"));else{var f=("number"!=typeof h&&(h=0),h+1>(u=t).length||-1===u.indexOf(".",h)?"argument":"property");c='The "'.concat(t,'" ').concat(f," ").concat(s," ").concat(l(e,"type"))}return c+". Received type ".concat(n(i))}),TypeError),u("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(7187));var i=a.inspect(e);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),u("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];void 0===o&&(o=r(182)),o(e.length>0,"At least one arg needs to be specified");var i="The ",s=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),s){case 1:i+="".concat(e[0]," argument");break;case 2:i+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:i+=e.slice(0,s-1).join(", "),i+=", and ".concat(e[s-1]," arguments")}return"".concat(i," must be specified")}),TypeError),t.exports.codes=c},5416:(t,e,r)=>{"use strict";var n=r(9964);function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?a(t):e}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t){var e="function"==typeof Map?new Map:void 0;return c=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return u(t,arguments,h(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,t)},c(t)}function u(t,e,r){return u=function(){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(t){return!1}}()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&l(i,r.prototype),i},u.apply(null,arguments)}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}var p=r(7187).inspect,d=r(5403).codes.ERR_INVALID_ARG_TYPE;function y(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var g="",m="",b="",w="",v={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 x(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function _(t){return p(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var A=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==f(t)||null===t)throw new d("options","Object",t);var i=t.message,s=t.operator,c=t.stackStartFn,u=t.actual,l=t.expected,p=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=o(this,h(e).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(g="",m="",w="",b=""):(g="",m="",w="",b="")),"object"===f(u)&&null!==u&&"object"===f(l)&&null!==l&&"stack"in u&&u instanceof Error&&"stack"in l&&l instanceof Error&&(u=x(u),l=x(l)),"deepStrictEqual"===s||"strictEqual"===s)r=o(this,h(e).call(this,function(t,e,r){var i="",s="",o=0,a="",c=!1,u=_(t),l=u.split("\n"),h=_(e).split("\n"),p=0,d="";if("strictEqual"===r&&"object"===f(t)&&"object"===f(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===l.length&&1===h.length&&l[0]!==h[0]){var x=l[0].length+h[0].length;if(x<=10){if(!("object"===f(t)&&null!==t||"object"===f(e)&&null!==e||0===t&&0===e))return"".concat(v[r],"\n\n")+"".concat(l[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&x<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][p]===h[0][p];)p++;p>2&&(d="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",p),"^"),p=0)}}for(var A=l[l.length-1],T=h[h.length-1];A===T&&(p++<2?a="\n ".concat(A).concat(a):i=A,l.pop(),h.pop(),0!==l.length&&0!==h.length);)A=l[l.length-1],T=h[h.length-1];var E=Math.max(l.length,h.length);if(0===E){var N=u.split("\n");if(N.length>30)for(N[26]="".concat(g,"...").concat(w);N.length>27;)N.pop();return"".concat(v.notIdentical,"\n\n").concat(N.join("\n"),"\n")}p>3&&(a="\n".concat(g,"...").concat(w).concat(a),c=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var O=0,j=v[r]+"\n".concat(m,"+ actual").concat(w," ").concat(b,"- expected").concat(w),S=" ".concat(g,"...").concat(w," Lines skipped");for(p=0;p<E;p++){var R=p-o;if(l.length<p+1)R>1&&p>2&&(R>4?(s+="\n".concat(g,"...").concat(w),c=!0):R>3&&(s+="\n ".concat(h[p-2]),O++),s+="\n ".concat(h[p-1]),O++),o=p,i+="\n".concat(b,"-").concat(w," ").concat(h[p]),O++;else if(h.length<p+1)R>1&&p>2&&(R>4?(s+="\n".concat(g,"...").concat(w),c=!0):R>3&&(s+="\n ".concat(l[p-2]),O++),s+="\n ".concat(l[p-1]),O++),o=p,s+="\n".concat(m,"+").concat(w," ").concat(l[p]),O++;else{var k=h[p],I=l[p],C=I!==k&&(!y(I,",")||I.slice(0,-1)!==k);C&&y(k,",")&&k.slice(0,-1)===I&&(C=!1,I+=","),C?(R>1&&p>2&&(R>4?(s+="\n".concat(g,"...").concat(w),c=!0):R>3&&(s+="\n ".concat(l[p-2]),O++),s+="\n ".concat(l[p-1]),O++),o=p,s+="\n".concat(m,"+").concat(w," ").concat(I),i+="\n".concat(b,"-").concat(w," ").concat(k),O+=2):(s+=i,i="",1!==R&&0!==p||(s+="\n ".concat(I),O++))}if(O>20&&p<E-2)return"".concat(j).concat(S,"\n").concat(s,"\n").concat(g,"...").concat(w).concat(i,"\n")+"".concat(g,"...").concat(w)}return"".concat(j).concat(c?S:"","\n").concat(s).concat(i).concat(a).concat(d)}(u,l,s)));else if("notDeepStrictEqual"===s||"notStrictEqual"===s){var A=v[s],T=_(u).split("\n");if("notStrictEqual"===s&&"object"===f(u)&&null!==u&&(A=v.notStrictEqualObject),T.length>30)for(T[26]="".concat(g,"...").concat(w);T.length>27;)T.pop();r=1===T.length?o(this,h(e).call(this,"".concat(A," ").concat(T[0]))):o(this,h(e).call(this,"".concat(A,"\n\n").concat(T.join("\n"),"\n")))}else{var E=_(u),N="",O=v[s];"notDeepEqual"===s||"notEqual"===s?(E="".concat(v[s],"\n\n").concat(E)).length>1024&&(E="".concat(E.slice(0,1021),"...")):(N="".concat(_(l)),E.length>512&&(E="".concat(E.slice(0,509),"...")),N.length>512&&(N="".concat(N.slice(0,509),"...")),"deepEqual"===s||"equal"===s?E="".concat(O,"\n\n").concat(E,"\n\nshould equal\n\n"):N=" ".concat(s," ").concat(N)),r=o(this,h(e).call(this,"".concat(E).concat(N)))}return Error.stackTraceLimit=p,r.generatedMessage=!i,Object.defineProperty(a(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=u,r.expected=l,r.operator=s,Error.captureStackTrace&&Error.captureStackTrace(a(r),c),r.stack,r.name="AssertionError",o(r)}var r,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(e,t),r=e,c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(t,e){return p(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){i(t,e,r[e])}))}return t}({},e,{customInspect:!1,depth:0}))}}],c&&s(r.prototype,c),e}(c(Error));t.exports=A},5421:(t,e,r)=>{"use strict";var n=r(5643),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),s=Object.prototype.toString,o=Array.prototype.concat,a=Object.defineProperty,c=r(8890)(),u=a&&c,l=function(t,e,r,n){var i;(!(e in t)||"function"==typeof(i=n)&&"[object Function]"===s.call(i)&&n())&&(u?a(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},h=function(t,e){var r=arguments.length>2?arguments[2]:{},s=n(e);i&&(s=o.call(s,Object.getOwnPropertySymbols(e)));for(var a=0;a<s.length;a+=1)l(t,s[a],e[s[a]],r[s[a]])};h.supportsDescriptors=!!u,t.exports=h},5567:t=>{"use strict";t.exports=Object.getOwnPropertyDescriptor},5582:(t,e,r)=>{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},5643:(t,e,r)=>{"use strict";var n=Array.prototype.slice,i=r(6515),s=Object.keys,o=s?function(t){return s(t)}:r(8461),a=Object.keys;o.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)})}else Object.keys=o;return Object.keys||o},t.exports=o},5846:t=>{"use strict";t.exports=Object},5874:t=>{"use strict";t.exports=Math.pow},6071:(t,e,r)=>{"use strict";var n=r(713);t.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},6094:(t,e,r)=>{"use strict";var n=r(3381);t.exports=function(t){return!!n(t)}},6255:(t,e,r)=>{"use strict";var n=r(8651),i=r(9295),s=r(8890)(),o=r(8109),a=r(6785),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in t&&o){var l=o(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(u=!1)}return(n||u||!r)&&(s?i(t,"length",e,!0,!0):i(t,"length",e)),t}},6357:(t,e,r)=>{var n=r(7187),i=r(182);function s(){return(new Date).getTime()}var o,a=Array.prototype.slice,c={};o=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var u=[[function(){},"log"],[function(){o.log.apply(o,arguments)},"info"],[function(){o.log.apply(o,arguments)},"warn"],[function(){o.warn.apply(o,arguments)},"error"],[function(t){c[t]=s()},"time"],[function(t){var e=c[t];if(!e)throw new Error("No such label: "+t);delete c[t];var r=s()-e;o.log(t+": "+r+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=n.format.apply(null,arguments),o.error(t.stack)},"trace"],[function(t){o.log(n.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=a.call(arguments,1);i.ok(!1,n.format.apply(null,e))}},"assert"]],l=0;l<u.length;l++){var h=u[l],f=h[0],p=h[1];o[p]||(o[p]=f)}t.exports=o},6515:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},6601:(t,e,r)=>{"use strict";var n=r(6255),i=r(6649),s=r(6688),o=r(8619);t.exports=function(t){var e=s(arguments),r=t.length-(arguments.length-1);return n(e,1+(r>0?r:0),!0)},i?i(t.exports,"apply",{value:o}):t.exports.apply=o},6626:(t,e,r)=>{"use strict";var n=r(2843);t.exports=function(){return n()&&!!Symbol.toStringTag}},6649:t=>{"use strict";var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}t.exports=e},6688:(t,e,r)=>{"use strict";var n=r(5049),i=r(6785),s=r(78),o=r(7802);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new i("a function is required");return o(n,s,t)}},6713:t=>{"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var s=Object.keys(Object(i)),o=0,a=s.length;o<a;o++){var c=s[o],u=Object.getOwnPropertyDescriptor(i,c);void 0!==u&&u.enumerable&&(r[c]=i[c])}}return r}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},6781:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,s=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,s=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw s}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var s=void 0!==/a/g.flags,o=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},a=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},c=Object.is?Object.is:r(8527),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r(7051);function h(t){return t.call.bind(t)}var f=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),d=h(Object.prototype.toString),y=r(7187).types,g=y.isAnyArrayBuffer,m=y.isArrayBufferView,b=y.isDate,w=y.isMap,v=y.isRegExp,x=y.isSet,_=y.isNativeError,A=y.isBoxedPrimitive,T=y.isNumberObject,E=y.isStringObject,N=y.isBooleanObject,O=y.isBigIntObject,j=y.isSymbolObject,S=y.isFloat32Array,R=y.isFloat64Array;function k(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function I(t){return Object.keys(t).filter(k).concat(u(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function C(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function P(t,e,r,n){if(t===e)return 0!==t||!r||c(t,e);if(r){if("object"!==i(t))return"number"==typeof t&&l(t)&&l(e);if("object"!==i(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==i(t))return(null===e||"object"!==i(e))&&t==e;if(null===e||"object"!==i(e))return!1}var o,a,u,h,f=d(t);if(f!==d(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var p=I(t),y=I(e);return p.length===y.length&&U(t,e,r,n,1,p)}if("[object Object]"===f&&(!w(t)&&w(e)||!x(t)&&x(e)))return!1;if(b(t)){if(!b(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(v(t)){if(!v(e)||(u=t,h=e,!(s?u.source===h.source&&u.flags===h.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(h))))return!1}else if(_(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(m(t)){if(r||!S(t)&&!R(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===C(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1;var k=I(t),P=I(e);return k.length===P.length&&U(t,e,r,n,0,k)}if(x(t))return!(!x(e)||t.size!==e.size)&&U(t,e,r,n,2);if(w(t))return!(!w(e)||t.size!==e.size)&&U(t,e,r,n,3);if(g(t)){if(a=e,(o=t).byteLength!==a.byteLength||0!==C(new Uint8Array(o),new Uint8Array(a)))return!1}else if(A(t)&&!function(t,e){return T(t)?T(e)&&c(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):E(t)?E(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):N(t)?N(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):O(t)?O(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):j(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return U(t,e,r,n,0)}function F(t,e){return e.filter((function(e){return p(t,e)}))}function U(t,e,r,s,c,l){if(5===arguments.length){l=Object.keys(t);var h=Object.keys(e);if(l.length!==h.length)return!1}for(var d=0;d<l.length;d++)if(!f(e,l[d]))return!1;if(r&&5===arguments.length){var y=u(t);if(0!==y.length){var g=0;for(d=0;d<y.length;d++){var m=y[d];if(p(t,m)){if(!p(e,m))return!1;l.push(m),g++}else if(p(e,m))return!1}var b=u(e);if(y.length!==b.length&&F(e,b).length!==g)return!1}else{var w=u(e);if(0!==w.length&&0!==F(e,w).length)return!1}}if(0===l.length&&(0===c||1===c&&0===t.length||0===t.size))return!0;if(void 0===s)s={val1:new Map,val2:new Map,position:0};else{var v=s.val1.get(t);if(void 0!==v){var x=s.val2.get(e);if(void 0!==x)return v===x}s.position++}s.val1.set(t,s.position),s.val2.set(e,s.position);var _=function(t,e,r,s,c,u){var l=0;if(2===u){if(!function(t,e,r,n){for(var s=null,a=o(t),c=0;c<a.length;c++){var u=a[c];if("object"===i(u)&&null!==u)null===s&&(s=new Set),s.add(u);else if(!e.has(u)){if(r)return!1;if(!L(t,e,u))return!1;null===s&&(s=new Set),s.add(u)}}if(null!==s){for(var l=o(e),h=0;h<l.length;h++){var f=l[h];if("object"===i(f)&&null!==f){if(!D(s,f,r,n))return!1}else if(!r&&!t.has(f)&&!D(s,f,r,n))return!1}return 0===s.size}return!0}(t,e,r,c))return!1}else if(3===u){if(!function(t,e,r,s){for(var o=null,c=a(t),u=0;u<c.length;u++){var l=n(c[u],2),h=l[0],f=l[1];if("object"===i(h)&&null!==h)null===o&&(o=new Set),o.add(h);else{var p=e.get(h);if(void 0===p&&!e.has(h)||!P(f,p,r,s)){if(r)return!1;if(!B(t,e,h,f,s))return!1;null===o&&(o=new Set),o.add(h)}}}if(null!==o){for(var d=a(e),y=0;y<d.length;y++){var g=n(d[y],2),m=(h=g[0],g[1]);if("object"===i(h)&&null!==h){if(!q(o,t,h,m,r,s))return!1}else if(!(r||t.has(h)&&P(t.get(h),m,!1,s)||q(o,t,h,m,!1,s)))return!1}return 0===o.size}return!0}(t,e,r,c))return!1}else if(1===u)for(;l<t.length;l++){if(!f(t,l)){if(f(e,l))return!1;for(var h=Object.keys(t);l<h.length;l++){var p=h[l];if(!f(e,p)||!P(t[p],e[p],r,c))return!1}return h.length===Object.keys(e).length}if(!f(e,l)||!P(t[l],e[l],r,c))return!1}for(l=0;l<s.length;l++){var d=s[l];if(!P(t[d],e[d],r,c))return!1}return!0}(t,e,r,l,s,c);return s.val1.delete(t),s.val2.delete(e),_}function D(t,e,r,n){for(var i=o(t),s=0;s<i.length;s++){var a=i[s];if(P(e,a,r,n))return t.delete(a),!0}return!1}function M(t){switch(i(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(l(t))return!1}return!0}function L(t,e,r){var n=M(r);return null!=n?n:e.has(n)&&!t.has(n)}function B(t,e,r,n,i){var s=M(r);if(null!=s)return s;var o=e.get(s);return!(void 0===o&&!e.has(s)||!P(n,o,!1,i))&&!t.has(s)&&P(n,o,!1,i)}function q(t,e,r,n,i,s){for(var a=o(t),c=0;c<a.length;c++){var u=a[c];if(P(r,u,i,s)&&P(n,e.get(u),i,s))return t.delete(u),!0}return!1}t.exports={isDeepEqual:function(t,e){return P(t,e,!1)},isDeepStrictEqual:function(t,e){return P(t,e,!0)}}},6785:t=>{"use strict";t.exports=TypeError},6822:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},6866:(t,e,r)=>{"use strict";r.d(e,{$Q:()=>i,BR:()=>y,Fn:()=>v,H:()=>A,JG:()=>b,K9:()=>w,Kk:()=>n,MG:()=>d,P2:()=>o,QW:()=>s,S:()=>u,_0:()=>g,bD:()=>l,bM:()=>m,hu:()=>_,i2:()=>f,ic:()=>a,lc:()=>h,ny:()=>p,r0:()=>c,sT:()=>x});const n="NamedNode",i="BlankNode",s="Literal",o="Variable",a="DefaultGraph",c="Collection",u="Empty",l="Graph",h="text/html",f="application/ld+json",p="text/n3",d="application/n3",y="application/nquads",g="application/n-quads",m="application/n-triples",b="application/rdf+xml",w="application/sparql-update",v="application/sparql-update-single-match",x="text/turtle",_="application/x-turtle",A="application/xhtml+xml"},7051:(t,e,r)=>{"use strict";var n=r(6601),i=r(5421),s=r(2621),o=r(1320),a=r(5074),c=n(o(),Number);i(c,{getPolyfill:o,implementation:s,shim:a}),t.exports=c},7106:(t,e,r)=>{"use strict";var n=r(6822),i=r(3766),s=r(9302);t.exports=n?function(t){return n(t)}:i?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return i(t)}:s?function(t){return s(t)}:null},7114:(t,e,r)=>{"use strict";r.r(e),r.d(e,{DOMParserFactory:()=>f,RDFArrayRemove:()=>v,callbackify:()=>h,domToString:()=>p,dtstamp:()=>y,dumpNode:()=>d,heavyCompare:()=>g,heavyCompareSPO:()=>m,linkRelationProperty:()=>l,log:()=>n.A,mediaTypeClass:()=>u,output:()=>b,parseXML:()=>w,stackString:()=>_,string:()=>c,string_startswith:()=>x,uri:()=>i});var n=r(3787),i=r(4221),s=r(3627),o=r(8392);t=r.hmd(t);var a=r(6357);const c={template:function(t,e){for(var r=t.split("%s"),n="",i=0;i<e.length;i++)e[i]+="",n+=r[i]+e[i];return n+r.slice(e.length).join()}};function u(t){return t=t.split(";")[0].trim(),new s.A("http://www.w3.org/ns/iana/media-types/"+t+"#Resource")}function l(t){return new s.A("http://www.w3.org/ns/iana/link-relations/relation#"+t.trim())}function h(t,e){t.callbacks={};for(var r=e.length-1;r>=0;r--)t.callbacks[e[r]]=[];t.addHook=function(e){t.callbacks[e]||(t.callbacks[e]=[])},t.addCallback=function(e,r){t.callbacks[e].push(r)},t.removeCallback=function(e,r){for(var n=0;n<t.callbacks[e].length;n++)if(t.callbacks[e][n].name===r)return t.callbacks[e].splice(n,1),!0;return!1},t.insertCallback=function(e,r){t.callbacks[e].unshift(r)},t.fireCallbacks=function(e,r){var n,i=[],s=[],o=t.callbacks[e].length;let a;for(n=o-1;n>=0;n--)a=t.callbacks[e][n],a&&a.apply(t,r)&&i.push(a);for(n=i.length-1;n>=0;n--)s.push(i[n]);for(n=o;n<t.callbacks[e].length;n++)s.push(t.callbacks[e][n]);t.callbacks[e]=s}}function f(){return window.DOMParser?new o.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function p(t,e){var r=[];(e=e||{})&&e.selfClosing&&e.selfClosing.split(" ").forEach((function(t){r[t]=!0}));var n=[];return e&&e.skipAttributes&&e.skipAttributes.split(" ").forEach((function(t){n[t]=!0})),d(t,e,r,n)}function d(t,e,r,n){var i,s="",o=[!1];if(void 0===t.nodeType)return s;if(1===t.nodeType){if(t.hasAttribute("class")&&e&&e.classWithChildText&&t.matches(e.classWithChildText.class))s+=t.querySelector(e.classWithChildText.element).textContent;else if(!(e&&e.skipNodeWithClass&&t.matches("."+e.skipNodeWithClass))){var c=t.nodeName.toLowerCase();s+="<"+c;var u=[];for(i=t.attributes.length-1;i>=0;i--){var l=t.attributes[i];if(!(n&&n.length>0&&n[l.name]||/^\d+$/.test(l.name))){if("class"===l.name&&e&&e.replaceClassItemWith&&l.value.split(" ").indexOf(e.replaceClassItemWith.source)>-1){var h=new RegExp(e.replaceClassItemWith.source,"g");l.value=l.value.replace(h,e.replaceClassItemWith.target).trim()}"class"===l.name&&e&&e.skipClassWithValue&&e.skipClassWithValue===l.value||u.push(l.name+"='"+l.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&quot;")+"'")}}if(u.length>0&&(e&&e.sortAttributes&&u.sort((function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())})),s+=" "+u.join(" ")),r&&r.ename)s+=" />";else{for(s+=">",s+="html"===c?"\n ":"",o.push("style"===c||"script"===c),i=0;i<t.childNodes.length;i++)s+=d(t.childNodes[i]);o.pop(),s+="body"===c?"</"+c+">\n":"</"+c+">"}}}else if(8===t.nodeType)s+="\x3c!--"+t.nodeValue+"--\x3e";else if(3===t.nodeType||4===t.nodeType){var f=t.nodeValue.replace(/\n+$/,"");s+=o[o.length-1]?f:f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else a.log("Warning; Cannot handle serialising nodes of type: "+t.nodeType),a.log(t);return s}function y(){var t=new Date,e=t.getYear()+1900,r=t.getMonth()+1,n=t.getDate(),i=t.getUTCHours(),s=t.getUTCMinutes(),o=t.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),s<10&&(s="0"+s),o<10&&(o="0"+o),e+"-"+r+"-"+n+"T"+i+":"+s+":"+o+"Z"}function g(t,e,r,n){var i=function(t){return"BlankNode"===t.termType?null:t},s=function(t){var e=r.statementsMatching(t).map((function(t){return i(t.subject)+" "+i(t.predicate)+" "+i(t.object)})).concat(r.statementsMatching(void 0,void 0,t).map((function(t){return i(t.subject)+" "+i(t.predicate)+" "+i(t.object)})));return e.sort(),e.join("\n")};const o=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(t,e):t.compareTerm(e);return"BlankNode"===t.termType&&"BlankNode"===e.termType?0===o?0:s(t)>s(e)?1:s(t)<s(e)?-1:o:n&&t.uri&&e.uri?(n[t.uri]||t.uri).localeCompare(n[e.uri]||e.uri):o}function m(t,e,r,n){return g(t.subject,e.subject,r,n)||g(t.predicate,e.predicate,r,n)||g(t.object,e.object,r,n)}function b(t){var e=document.createElement("div");e.textContent=t,document.body.appendChild(e)}function w(e,r){return r=r||{},t&&t.exports?(new o.DOMParser).parseFromString(e,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new o.DOMParser).parseFromString(e,"application/xml")}function v(t,e){for(var r=0;r<t.length;r++)if(t[r].subject.equals(e.subject)&&t[r].predicate.equals(e.predicate)&&t[r].object.equals(e.object)&&t[r].why.equals(e.why))return void t.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+e+" "+e.why)}function x(t,e){return t.slice(0,e.length)===e}function _(t){var e=t+"\n";if(!t.stack)return e+"No stack available.\n";for(var r=t.stack.toString().split("\n"),n=[],i=0;i<r.length;i++){var s=r[i];if(s.indexOf("ecmaunit.js")>-1)break;"("==s.charAt(0)&&(s="function"+s);var o=s.split("@");n.push(o)}for(i=0;i<n.length;i++)e+=" "+n[i][1]+"\n "+n[i][0];return e}},7187:(t,e,r)=>{var n=r(9964),i=r(6357),s=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},o=/%[sdj%]/g;e.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(l(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(t).replace(o,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r<i;a=n[++r])b(a)||!A(a)?s+=" "+a:s+=" "+l(a);return s},e.deprecate=function(t,r){if(void 0!==n&&!0===n.noDeprecation)return t;if(void 0===n)return function(){return e.deprecate(t,r).apply(this,arguments)};var s=!1;return function(){if(!s){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?i.trace(r):i.error(r),s=!0}return t.apply(this,arguments)}};var a={},c=/^$/;if(n.env.NODE_DEBUG){var u=n.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),c=new RegExp("^"+u+"$","i")}function l(t,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&e._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,t,n.depth)}function h(t,e){var r=l.styles[e];return r?"["+l.colors[r][0]+"m"+t+"["+l.colors[r][1]+"m":t}function f(t,e){return t}function p(t,r,n){if(t.customInspect&&r&&N(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=p(t,i,n)),i}var s=function(t,e){if(x(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return w(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(s)return s;var o=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(r)),E(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return d(r);if(0===o.length){if(N(r)){var c=r.name?": "+r.name:"";return t.stylize("[Function"+c+"]","special")}if(_(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(T(r))return t.stylize(Date.prototype.toString.call(r),"date");if(E(r))return d(r)}var u,l="",h=!1,f=["{","}"];return g(r)&&(h=!0,f=["[","]"]),N(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(l=" "+RegExp.prototype.toString.call(r)),T(r)&&(l=" "+Date.prototype.toUTCString.call(r)),E(r)&&(l=" "+d(r)),0!==o.length||h&&0!=r.length?n<0?_(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),u=h?function(t,e,r,n,i){for(var s=[],o=0,a=e.length;o<a;++o)R(e,String(o))?s.push(y(t,e,r,n,String(o),!0)):s.push("");return i.forEach((function(i){i.match(/^\d+$/)||s.push(y(t,e,r,n,i,!0))})),s}(t,r,n,a,o):o.map((function(e){return y(t,r,n,a,e,h)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(u,l,f)):f[0]+l+f[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function y(t,e,r,n,i,s){var o,a,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),R(n,i)||(o="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(a=b(r)?p(t,c.value,null):p(t,c.value,r-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),x(o)){if(s&&i.match(/^\d+$/))return a;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function g(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function b(t){return null===t}function w(t){return"number"==typeof t}function v(t){return"string"==typeof t}function x(t){return void 0===t}function _(t){return A(t)&&"[object RegExp]"===O(t)}function A(t){return"object"==typeof t&&null!==t}function T(t){return A(t)&&"[object Date]"===O(t)}function E(t){return A(t)&&("[object Error]"===O(t)||t instanceof Error)}function N(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function j(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!a[t])if(c.test(t)){var r=n.pid;a[t]=function(){var n=e.format.apply(e,arguments);i.error("%s %d: %s",t,r,n)}}else a[t]=function(){};return a[t]},e.inspect=l,l.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]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(9490),e.isArray=g,e.isBoolean=m,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=w,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=x,e.isRegExp=_,e.types.isRegExp=_,e.isObject=A,e.isDate=T,e.types.isDate=T,e.isError=E,e.types.isNativeError=E,e.isFunction=N,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(1201);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;i.log("%s - %s",(r=[j((t=new Date).getHours()),j(t.getMinutes()),j(t.getSeconds())].join(":"),[t.getDate(),S[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(9784),e._extend=function(t,e){if(!e||!A(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(k&&t[k]){var e;if("function"!=typeof(e=t[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,k,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),k&&Object.defineProperty(e,k,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,s(t))},e.promisify.custom=k,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var i=e.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var s=this,o=function(){return i.apply(s,arguments)};t.apply(this,e).then((function(t){n.nextTick(o.bind(null,null,t))}),(function(t){n.nextTick(I.bind(null,t,o))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,s(t)),e}},7450:t=>{"use strict";t.exports=Math.floor},7552:t=>{"use strict";t.exports=Math.min},7770:t=>{"use strict";t.exports=SyntaxError},7802:(t,e,r)=>{"use strict";var n=r(5049),i=r(3036),s=r(78),o=r(1909);t.exports=o||n.call(s,i)},7900:t=>{"use strict";t.exports=ReferenceError},7906:(t,e,r)=>{"use strict";var n=r(6626)(),i=r(7913)("Object.prototype.toString"),s=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},o=function(t){return!!s(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return s(arguments)}();s.isLegacyArguments=o,t.exports=a?s:o},7913:(t,e,r)=>{"use strict";var n=r(8651),i=r(6601),s=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&s(t,".prototype.")>-1?i(r):r}},8109:(t,e,r)=>{"use strict";var n=r(5567);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},8392:e=>{"use strict";e.exports=t},8404:(t,e,r)=>{"use strict";var n=r(3746),i=Object.prototype.toString,s=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var o,a;arguments.length>=3&&(o=r),a=t,"[object Array]"===i.call(a)?function(t,e,r){for(var n=0,i=t.length;n<i;n++)s.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,o):"string"==typeof t?function(t,e,r){for(var n=0,i=t.length;n<i;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,o):function(t,e,r){for(var n in t)s.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,o)}},8461:(t,e,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,s=Object.prototype.toString,o=r(6515),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$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 t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===s.call(t),n=o(t),a=e&&"[object String]"===s.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=u&&r;if(a&&t.length>0&&!i.call(t,0))for(var y=0;y<t.length;++y)f.push(String(y));if(n&&t.length>0)for(var g=0;g<t.length;++g)f.push(String(g));else for(var m in t)d&&"prototype"===m||!i.call(t,m)||f.push(String(m));if(c)for(var b=function(t){if("undefined"==typeof window||!p)return h(t);try{return h(t)}catch(t){return!1}}(t),w=0;w<l.length;++w)b&&"constructor"===l[w]||!i.call(t,l[w])||f.push(l[w]);return f}}t.exports=n},8527:(t,e,r)=>{"use strict";var n=r(5421),i=r(6601),s=r(3249),o=r(9636),a=r(3534),c=i(o(),Object);n(c,{getPolyfill:o,implementation:s,shim:a}),t.exports=c},8540:t=>{const e={acl:"http://www.w3.org/ns/auth/acl#",arg:"http://www.w3.org/ns/pim/arg#",as:"https://www.w3.org/ns/activitystreams#",bookmark:"http://www.w3.org/2002/01/bookmark#",cal:"http://www.w3.org/2002/12/cal/ical#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/",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#",gr:"http://purl.org/goodrelations/v1#",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#",pto:"http://www.productontology.org/id/",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#",skos:"http://www.w3.org/2004/02/skos/core#",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#",vann:"http://purl.org/vocab/vann/",vcard:"http://www.w3.org/2006/vcard/ns#",wf:"http://www.w3.org/2005/01/wf/flow#",xsd:"http://www.w3.org/2001/XMLSchema#"};t.exports=function(t={namedNode:t=>t}){const r={};for(const n in e){const i=e[n];r[n]=function(e=""){return t.namedNode(i+e)}}return r}},8619:(t,e,r)=>{"use strict";var n=r(5049),i=r(3036),s=r(7802);t.exports=function(){return s(n,i,arguments)}},8651:(t,e,r)=>{"use strict";var n,i=r(5846),s=r(5293),o=r(9055),a=r(8888),c=r(7900),u=r(7770),l=r(6785),h=r(4055),f=r(716),p=r(7450),d=r(3774),y=r(7552),g=r(5874),m=r(9292),b=r(6071),w=Function,v=function(t){try{return w('"use strict"; return ('+t+").constructor;")()}catch(t){}},x=r(8109),_=r(6649),A=function(){throw new l},T=x?function(){try{return A}catch(t){try{return x(arguments,"callee").get}catch(t){return A}}}():A,E=r(3257)(),N=r(7106),O=r(3766),j=r(6822),S=r(3036),R=r(78),k={},I="undefined"!=typeof Uint8Array&&N?N(Uint8Array):n,C={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":E&&N?N([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":s,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":k,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&N?N(N([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&N?N((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&N?N((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&N?N(""[Symbol.iterator]()):n,"%Symbol%":E?Symbol:n,"%SyntaxError%":u,"%ThrowTypeError%":T,"%TypedArray%":I,"%TypeError%":l,"%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%":h,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":R,"%Function.prototype.apply%":S,"%Object.defineProperty%":_,"%Object.getPrototypeOf%":O,"%Math.abs%":f,"%Math.floor%":p,"%Math.max%":d,"%Math.min%":y,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":b,"%Reflect.getPrototypeOf%":j};if(N)try{null.error}catch(t){var P=N(N(t));C["%Error.prototype%"]=P}var F=function t(e){var r;if("%AsyncFunction%"===e)r=v("async function () {}");else if("%GeneratorFunction%"===e)r=v("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=v("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&N&&(r=N(i.prototype))}return C[e]=r,r},U={__proto__:null,"%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"]},D=r(5049),M=r(5215),L=D.call(R,Array.prototype.concat),B=D.call(S,Array.prototype.splice),q=D.call(R,String.prototype.replace),$=D.call(R,String.prototype.slice),H=D.call(R,RegExp.prototype.exec),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,X=/\\(\\)?/g,V=function(t,e){var r,n=t;if(M(U,n)&&(n="%"+(r=U[n])[0]+"%"),M(C,n)){var i=C[n];if(i===k&&(i=F(n)),void 0===i&&!e)throw new l("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new u("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new l('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=$(t,0,1),r=$(t,-1);if("%"===e&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new u("invalid intrinsic syntax, expected opening `%`");var n=[];return q(t,z,(function(t,e,r,i){n[n.length]=r?q(i,X,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=V("%"+n+"%",e),s=i.name,o=i.value,a=!1,c=i.alias;c&&(n=c[0],B(r,L([0,1],c)));for(var h=1,f=!0;h<r.length;h+=1){var p=r[h],d=$(p,0,1),y=$(p,-1);if(('"'===d||"'"===d||"`"===d||'"'===y||"'"===y||"`"===y)&&d!==y)throw new u("property names with quotes must have matching quotes");if("constructor"!==p&&f||(a=!0),M(C,s="%"+(n+="."+p)+"%"))o=C[s];else if(null!=o){if(!(p in o)){if(!e)throw new l("base intrinsic for "+t+" exists, but the property is not available.");return}if(x&&h+1>=r.length){var g=x(o,p);o=(f=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[p]}else f=M(o,p),o=o[p];f&&!a&&(C[s]=o)}}return o}},8888:t=>{"use strict";t.exports=RangeError},8890:(t,e,r)=>{"use strict";var n=r(6649),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},9029:(t,e)=>{e.read=function(t,e,r,n,i){var s,o,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,s=p&(1<<-l)-1,p>>=-l,l+=a;l>0;s=256*s+t[e+h],h+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+t[e+h],h+=f,l-=8);if(0===s)s=1-u;else{if(s===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),s-=u}return(p?-1:1)*o*Math.pow(2,s-n)},e.write=function(t,e,r,n,i,s){var o,a,c,u=8*s-i-1,l=(1<<u)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(o++,c/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(e*c-1)*Math.pow(2,i),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;t[r+p]=255&o,p+=d,o/=256,u-=8);t[r+p-d]|=128*y}},9055:t=>{"use strict";t.exports=EvalError},9292:t=>{"use strict";t.exports=Math.round},9295:(t,e,r)=>{"use strict";var n=r(6649),i=r(7770),s=r(6785),o=r(8109);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!o&&o(t,e);if(n)n(t,e,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:r,writable:null===c&&h?h.writable:!c});else{if(!l&&(a||c||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},9302:(t,e,r)=>{"use strict";var n,i=r(6688),s=r(8109);try{n=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var o=!!n&&s&&s(Object.prototype,"__proto__"),a=Object,c=a.getPrototypeOf;t.exports=o&&"function"==typeof o.get?i([o.get]):"function"==typeof c&&function(t){return c(null==t?t:a(t))}},9390:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},9490:(t,e,r)=>{"use strict";var n=r(7906),i=r(4610),s=r(3381),o=r(6094);function a(t){return t.call.bind(t)}var c="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,l=a(Object.prototype.toString),h=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(c)var d=a(BigInt.prototype.valueOf);if(u)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function m(t){return"[object Map]"===l(t)}function b(t){return"[object Set]"===l(t)}function w(t){return"[object WeakMap]"===l(t)}function v(t){return"[object WeakSet]"===l(t)}function x(t){return"[object ArrayBuffer]"===l(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(x.working?x(t):t instanceof ArrayBuffer)}function A(t){return"[object DataView]"===l(t)}function T(t){return"undefined"!=typeof DataView&&(A.working?A(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=o,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):o(t)||T(t)},e.isUint8Array=function(t){return"Uint8Array"===s(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===s(t)},e.isUint16Array=function(t){return"Uint16Array"===s(t)},e.isUint32Array=function(t){return"Uint32Array"===s(t)},e.isInt8Array=function(t){return"Int8Array"===s(t)},e.isInt16Array=function(t){return"Int16Array"===s(t)},e.isInt32Array=function(t){return"Int32Array"===s(t)},e.isFloat32Array=function(t){return"Float32Array"===s(t)},e.isFloat64Array=function(t){return"Float64Array"===s(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===s(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===s(t)},m.working="undefined"!=typeof Map&&m(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(m.working?m(t):t instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(b.working?b(t):t instanceof Set)},w.working="undefined"!=typeof WeakMap&&w(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(w.working?w(t):t instanceof WeakMap)},v.working="undefined"!=typeof WeakSet&&v(new WeakSet),e.isWeakSet=function(t){return v(t)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),e.isArrayBuffer=_,A.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&A(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=T;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function N(t){return"[object SharedArrayBuffer]"===l(t)}function O(t){return void 0!==E&&(void 0===N.working&&(N.working=N(new E)),N.working?N(t):t instanceof E)}function j(t){return g(t,h)}function S(t){return g(t,f)}function R(t){return g(t,p)}function k(t){return c&&g(t,d)}function I(t){return u&&g(t,y)}e.isSharedArrayBuffer=O,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=j,e.isStringObject=S,e.isBooleanObject=R,e.isBigIntObject=k,e.isSymbolObject=I,e.isBoxedPrimitive=function(t){return j(t)||S(t)||R(t)||k(t)||I(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||O(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9636:(t,e,r)=>{"use strict";var n=r(3249);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},9784:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},9964:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var a,c=[],u=!1,l=-1;function h(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&f())}function f(){if(!u){var t=o(h);u=!0;for(var e=c.length;e;){for(a=c,c=[];++l<e;)a&&a[l].run();l=-1,e=c.length}a=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new p(t,e)),1!==c.length||u||o(f)},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=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={id:t,loaded:!1,exports:{}};return s[t].call(r.exports,r,r.exports,a),r.loaded=!0,r.exports}a.m=s,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},r=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,a.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var i=Object.create(null);a.r(i);var s={};e=e||[null,r({}),r([]),r(r)];for(var o=2&n&&t;"object"==typeof o&&!~e.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach((e=>s[e]=()=>t[e]));return s.default=()=>t,a.d(i,s),i},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,r)=>(a.f[r](t,e),e)),[])),a.u=t=>t+".rdflib.min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n={},i="$rdf:",a.l=(t,e,r,s)=>{if(n[t])n[t].push(e);else{var o,c;if(void 0!==r)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var h=u[l];if(h.getAttribute("src")==t||h.getAttribute("data-webpack")==i+r){o=h;break}}o||(c=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,a.nc&&o.setAttribute("nonce",a.nc),o.setAttribute("data-webpack",i+r),o.src=t),n[t]=[e];var f=(e,r)=>{o.onerror=o.onload=null,clearTimeout(p);var i=n[t];if(delete n[t],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach((t=>t(r))),e)return e(r)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),c&&document.head.appendChild(o)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),(()=>{var t={792:0};a.f.j=(e,r)=>{var n=a.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,i)=>n=t[e]=[r,i]));r.push(n[2]=i);var s=a.p+a.u(e),o=new Error;a.l(s,(r=>{if(a.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.src;o.message="Loading chunk "+e+" failed.\n("+i+": "+s+")",o.name="ChunkLoadError",o.type=i,o.request=s,n[1](o)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,i,[s,o,c]=r,u=0;if(s.some((e=>0!==t[e]))){for(n in o)a.o(o,n)&&(a.m[n]=o[n]);c&&c(a)}for(e&&e(r);u<s.length;u++)i=s[u],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0},r=self.webpackChunk$rdf=self.webpackChunk$rdf||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var c={};return(()=>{"use strict";a.r(c),a.d(c,{BlankNode:()=>i,Collection:()=>f,ConnectedStore:()=>cr,DataFactory:()=>He,Empty:()=>p,Fetcher:()=>De,Formula:()=>B,IndexedFormula:()=>J,Literal:()=>l,LiveStore:()=>ur,N3Parser:()=>vt,NamedNode:()=>s.A,Namespace:()=>N,NextId:()=>ar,Node:()=>q,Query:()=>z,RDFParser:()=>ge,RDFaProcessor:()=>de,SPARQLToQuery:()=>Be,Serializer:()=>C,Statement:()=>b,Store:()=>J,UpdateManager:()=>qe,UpdatesSocket:()=>ze,UpdatesVia:()=>Xe,Util:()=>O,Variable:()=>v,blankNode:()=>Ke,defaultGraph:()=>tr,fetcher:()=>Ge,fromNT:()=>sr,graph:()=>Qe,isBlankNode:()=>o.jt,isCollection:()=>o.P3,isGraph:()=>o.RN,isLiteral:()=>o.c$,isNamedNode:()=>o.Y2,isPredicate:()=>o.YC,isQuad:()=>o.aF,isRDFObject:()=>o.GE,isRDFlibObject:()=>o.DJ,isRDFlibPredicate:()=>o.fY,isRDFlibSubject:()=>o.CZ,isStatement:()=>o.SH,isStore:()=>o.ok,isSubject:()=>o.hr,isTerm:()=>o.D0,isVariable:()=>o.DZ,jsonParser:()=>Me,lit:()=>We,literal:()=>er,log:()=>E.A,namedNode:()=>Ye,parse:()=>be,quad:()=>rr,queryToSPARQL:()=>Le,serialize:()=>F,sparqlUpdateParser:()=>me,st:()=>Je,sym:()=>Ye,term:()=>or,termValue:()=>xe.E,triple:()=>nr,uri:()=>w,variable:()=>Ze});var t=a(939),e=a(9390),r=a(1605),n=a(6866);class i extends r.A{static getId(t){if(t){if("string"!=typeof t)throw new Error("Bad id argument to new blank node: "+t);if(t.includes("#")){let e=t.split("#");return e[e.length-1]}return t}return"n"+i.nextId++}constructor(r){super(i.getId(r)),(0,t.A)(this,"termType",n.$Q),(0,t.A)(this,"classOrder",e.A.BlankNode),(0,t.A)(this,"isBlank",1),(0,t.A)(this,"isVar",1)}get id(){return this.value}set id(t){this.value=t}compareTerm(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.id<t.id?-1:this.id>t.id?1:0}copy(t){var e=new i;return t.copyTo(this,e),e}toCanonical(){return i.NTAnonymousNodePrefix+this.value}toString(){return i.NTAnonymousNodePrefix+this.id}}(0,t.A)(i,"nextId",0),(0,t.A)(i,"NTAnonymousNodePrefix","_:");var s=a(3627),o=a(546);const u={boolean:new s.A("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new s.A("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new s.A("http://www.w3.org/2001/XMLSchema#decimal"),double:new s.A("http://www.w3.org/2001/XMLSchema#double"),integer:new s.A("http://www.w3.org/2001/XMLSchema#integer"),langString:new s.A("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new s.A("http://www.w3.org/2001/XMLSchema#string")};class l extends r.A{constructor(r,i,o){super(r),(0,t.A)(this,"termType",n.QW),(0,t.A)(this,"classOrder",e.A.Literal),(0,t.A)(this,"datatype",u.string),(0,t.A)(this,"isVar",0),(0,t.A)(this,"language",""),i?(this.language=i,this.datatype=u.langString):this.datatype=o?s.A.fromValue(o):u.string}copy(){return new l(this.value,this.lang,this.datatype)}equals(t){return!!t&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&(!this.datatype&&!t.datatype||this.datatype&&this.datatype.equals(t.datatype))}get lang(){return this.language}set lang(t){this.language=t||""}toNT(){return l.toNT(this)}static toNT(t){if("number"==typeof t.value)return""+t.value;if("string"!=typeof t.value)throw new Error("Value of RDF literal is not string or number: "+t.value);var e=t.value;return e='"'+(e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',t.language?e+="@"+t.language:t.datatype.equals(u.string)||(e+="^^"+t.datatype.toCanonical()),e}toString(){return""+this.value}static fromBoolean(t){return new l(t?"1":"0",null,u.boolean)}static fromDate(t){if(!(t instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");let e=function(t){return(""+(100+t)).slice(1,3)},r=t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"Z";return new l(r,null,u.dateTime)}static fromNumber(t){if("number"!=typeof t)throw new TypeError("Invalid argument to Literal.fromNumber()");let e;const r=t.toString();return e=r.indexOf("e")<0&&Math.abs(t)<=Number.MAX_SAFE_INTEGER?Number.isInteger(t)?u.integer:u.decimal:u.double,new l(r,null,e)}static fromValue(t){if((0,o.c$)(t))return t;switch(typeof t){case"object":if(t instanceof Date)return l.fromDate(t);case"boolean":return l.fromBoolean(t);case"number":return l.fromNumber(t);case"string":return new l(t)}throw new Error("Can't make literal from "+t+" of type "+typeof t)}}function h(t){return null==t||(0,o.D0)(t)?t:Array.isArray(t)?new f(t):l.fromValue(t)}class f extends r.A{constructor(r){super((i.nextId++).toString()),(0,t.A)(this,"termType",n.r0),(0,t.A)(this,"classOrder",e.A.Collection),(0,t.A)(this,"closed",!1),(0,t.A)(this,"compareTerm",i.prototype.compareTerm),(0,t.A)(this,"elements",[]),(0,t.A)(this,"isVar",0),r&&r.length>0&&r.forEach((t=>{this.elements.push(h(t))}))}get id(){return this.value}set id(t){this.value=t}append(t){return this.elements.push(t)}close(){return this.closed=!0,this.closed}shift(){return this.elements.shift()}substitute(t){const e=this.elements.map((e=>e.substitute(t)));return new f(e)}toNT(){return f.toNT(this)}static toNT(t){return i.NTAnonymousNodePrefix+t.id}toString(){return"("+this.elements.join(" ")+")"}unshift(t){return this.elements.unshift(t)}}(0,t.A)(f,"termType",n.r0);class p extends r.A{constructor(){super(""),(0,t.A)(this,"termType",n.S)}toString(){return"()"}}const d="chrome:theSession";new s.A(d);class y extends r.A{constructor(){super(""),(0,t.A)(this,"value",""),(0,t.A)(this,"termType",n.ic),(0,t.A)(this,"uri",d)}toCanonical(){return this.value}toString(){return"DefaultGraph"}}function g(t){return!!t&&t.termType===n.ic}const m=new y;class b{constructor(e,n,i,s){(0,t.A)(this,"subject",void 0),(0,t.A)(this,"predicate",void 0),(0,t.A)(this,"object",void 0),(0,t.A)(this,"graph",void 0),this.subject=r.A.fromValue(e),this.predicate=r.A.fromValue(n),this.object=r.A.fromValue(i),this.graph=null==s?m:r.A.fromValue(s)}get why(){return this.graph}set why(t){this.graph=t}equals(t){return t.subject.equals(this.subject)&&t.predicate.equals(this.predicate)&&t.object.equals(this.object)&&t.graph.equals(this.graph)}substitute(t){return new b(this.subject.substitute(t),this.predicate.substitute(t),this.object.substitute(t),g(this.graph)?this.graph:this.graph.substitute(t))}toCanonical(){let t=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==n.ic&&t.push(this.graph.toCanonical()),t.join(" ")+" ."}toNT(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}toNQ(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),g(this.graph)?"":this.graph.toNT()].join(" ")+" ."}toString(){return this.toNT()}}var w=a(4221);class v extends r.A{constructor(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(r),(0,t.A)(this,"termType",n.P2),(0,t.A)(this,"base","varid:"),(0,t.A)(this,"classOrder",e.A.Variable),(0,t.A)(this,"isVar",1),(0,t.A)(this,"uri",void 0),this.base="varid:",this.uri=w.join(r,this.base)}equals(t){return!!t&&this.termType===t.termType&&this.value===t.value}hashString(){return this.toString()}substitute(t){var e;return null!=(e=t[this.toNT()])?e:this}toString(){return v.toString(this)}static toString(t){return t.uri.slice(0,t.base.length)===t.base?`?${t.uri.slice(t.base.length)}`:`?${t.uri}`}}let x=function(t){return t.collections="COLLECTIONS",t.defaultGraphType="DEFAULT_GRAPH_TYPE",t.equalsMethod="EQUALS_METHOD",t.id="ID",t.identity="IDENTITY",t.reversibleId="REVERSIBLE_ID",t.variableType="VARIABLE_TYPE",t}({});const _=new y,A={supports:{[x.collections]:!1,[x.defaultGraphType]:!1,[x.equalsMethod]:!0,[x.identity]:!1,[x.id]:!0,[x.reversibleId]:!1,[x.variableType]:!0},blankNode:t=>new i(t),defaultGraph:()=>_,equals(t,e){return t===e||!t||!e||((0,o.aF)(t)||(0,o.aF)(e)?!(!(0,o.aF)(t)||!(0,o.aF)(e))&&this.equals(t.subject,e.subject)&&this.equals(t.predicate,e.predicate)&&this.equals(t.object,e.object)&&this.equals(t.graph,e.graph):!(!(0,o.D0)(t)||!(0,o.D0)(e))&&this.id(t)===this.id(e))},id(t){if(!t)return"undefined";if((0,o.aF)(t))return this.quadToNQ(t);switch(t.termType){case n.ic:return"defaultGraph";case n.P2:return v.toString(t);default:const e=this.termToNQ(t);if(e)return e;throw new Error(`Can't id term with type '${t.termType}'`)}},isQuad:t=>t instanceof b,literal(t,e){if("string"!=typeof t&&!e)return l.fromValue(t);const r="string"==typeof t?t:""+t;return"string"==typeof e?-1===e.indexOf(":")?new l(r,e):new l(r,null,this.namedNode(e)):new l(r,null,e)},namedNode:t=>new s.A(t),quad:(t,e,r,n)=>new b(t,e,r,n||_),triple(t,e,r,n){return this.quad(t,e,r,n)},quadToNQ(t){return`${this.termToNQ(t.subject)} ${this.termToNQ(t.predicate)} ${this.termToNQ(t.object)} ${this.termToNQ(t.graph)} .`},termToNQ(t){switch(t.termType){case n.$Q:return"_:"+t.value;case n.ic:return"";case n.S:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case n.QW:return l.toNT(t);case n.bD:case n.Kk:return"<"+t.value+">";case n.r0:return"("+t.elements.map((t=>this.termToNQ(t))).join(" ")+")";default:throw new Error(`Can't serialize nonstandard term type (was '${t.termType}')`)}},toNQ(t){return this.isQuad(t)?this.quadToNQ(t):this.termToNQ(t)},variable:t=>new v(t)},T=A;var E=a(3787);function N(t,e){const r=e||{namedNode:t=>new s.A(t)};return function(e){return r.namedNode(t+(e||""))}}var O=a(7114);function j(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T;return{boolean:t.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:t.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:t.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:t.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:t.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:t.namedNode("http://www.w3.org/2001/XMLSchema#string")}}j(T);var S=a(8540),R=a.n(S),k=a(2312),I=a(6357);function C(t){return new P(t)}class P{constructor(e){(0,t.A)(this,"_notQNameChars","\t\r\n !\"#$%&'()*,+/;<=>?@[\\]^`{|}~"),(0,t.A)(this,"_notNameChars",this._notQNameChars+":"),(0,t.A)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,t.A)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,t.A)(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 t in r){const e=R()()[r[t]](""),n=r[t];this.prefixes[e]=n,this.namespaces[n]=e}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=e,this.rdfFactory=e.rdfFactory||T,this.xsd=j(this.rdfFactory)}setBase(t){return this.base=t,this}setFlags(t){return this.flags=t||"",this}toStr(t){var e=t.toNT();return"Graph"===t.termType&&(this.formulas[e]=t),e}fromStr(t){if("{"===t[0]){var e=this.formulas[t];return e||I.log("No formula object for "+t),e}return this.store.fromNT(t)}setNamespaces(t){for(var e in t)this.setPrefix(e,t[e]);return this}setPrefix(t,e){if("default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e){for(let e in this.prefixes)this.prefixes[e]==t&&delete this.prefixes[e];this.prefixes[e]=t,this.namespaces[t]=e}}suggestPrefix(t,e){"default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e&&(t in this.namespaces||e in this.prefixes||(this.prefixes[e]=t,this.namespaces[t]=e))}suggestNamespaces(t){for(var e in t)this.suggestPrefix(e,t[e]);return this}checkIntegrity(){var t,e;for(t in this.namespaces)if(this.prefixes[this.namespaces[t]]!==t)throw new Error("Serializer integity error 1: "+t+", "+this.namespaces[t]+", "+this.prefixes[this.namespaces[t]]+"!");for(e in this.prefixes)if(this.namespaces[this.prefixes[e]]!==e)throw new Error("Serializer integity error 2: "+e+", "+this.prefixs[e]+", "+this.namespaces[this.prefixes[e]]+"!")}makeUpPrefix(t){var e=t,r=function(e){return!!this.validPrefix.test(e)&&"ns"!==e&&!(e in this.namespaces)&&(this.prefixes[t]=e,this.namespaces[e]=t,e)}.bind(this);"#/".indexOf(e[e.length-1])>=0&&(e=e.slice(0,-1));var n=e.lastIndexOf("/");n>=0&&(e=e.slice(n+1));for(var i=0;i<e.length&&this.prefixchars.indexOf(e[i]);)i++;if((e=e.slice(0,i)).length<6&&r(e))return e;if(r(e.slice(0,3)))return e.slice(0,3);if(r(e.slice(0,2)))return e.slice(0,2);if(r(e.slice(0,4)))return e.slice(0,4);if(r(e.slice(0,1)))return e.slice(0,1);if(r(e.slice(0,5)))return e.slice(0,5);this.validPrefix.test(e)||(e="n");for(var s=0;;s++)if(r(e.slice(0,3)+s))return e.slice(0,3)+s}rootSubjects(t){for(var e={},r={},n={},i=0;i<t.length;i++){var s=t[i],o=function(t){e.hasOwnProperty(t)||(e[t]=[]),e[t].push(s.subject)};[s.subject,s.predicate,s.object].map((function(t){"BlankNode"===t.termType?n[t.toNT()]=!0:"Collection"===t.termType&&t.elements.forEach((function(t){o(t)}))})),o(t[i].object);var a=r[this.toStr(s.subject)];a||(a=[]),a.push(s),r[this.toStr(s.subject)]=a}var c=[];for(var u in r)if(r.hasOwnProperty(u)){var l=this.fromStr(u);"BlankNode"===l.termType&&e[l]&&1===e[l].length||c.push(l)}this.incoming=e;for(var h={},f=0;f<c.length;f++)h[c[f].toNT()]=!0;return{roots:c,subjects:r,rootsHash:h,incoming:e}}toN3(t){return this.statementsToN3(t.statements)}isValidPNLocal(t){if(0===t.length)return!0;if("."===t[t.length-1])return!1;for(var e=0;e<t.length;e++){var r=t[e];if("."!==r&&this._notNameChars.indexOf(r)>=0)return!1}return!0}explicitURI(t){var e;return this.flags.indexOf("r")<0&&this.base?t=w.refTo(this.base,t):this.flags.indexOf("u")>=0?t=function(t){for(var e,r="",n=0;n<t.length;n++)r+=(e=t.charCodeAt(n))>65535?"\\U"+("00000000"+e.toString(16)).slice(-8):e>126?"\\u"+("0000"+e.toString(16)).slice(-4):t[n];return r}(t):(e=decodeURI(t),t=encodeURI(e)),"<"+t+">"}statementsToNTriples(t){var e=t.slice();e.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,s=this.store,o=this.rdfFactory,a=function(t){if("Collection"!==t.termType)return i.atomicTermToN3(t);for(var e=t.elements,c=s.sym(n+"nill"),u=e.length-1;u>=0;u--){var l=o.blankNode();r+=a(l)+" "+a(s.sym(n+"first"))+" "+a(e[u])+".\n",r+=a(l)+" "+a(s.sym(n+"rest"))+" "+a(c)+".\n",c=l}return i.atomicTermToN3(c)},c=0;c<e.length;c++){var u=e[c],l="";l+=a(u.subject)+" ",l+=a(u.predicate)+" ",l+=a(u.object)+" ",this.flags.indexOf("q")>=0&&(l+=a(u.why)+" "),r+=l+=".\n"}return r}statementsToN3(t){var e=this.store,r={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};t.sort((function(t,n){return O.heavyCompareSPO(t,n,e,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(t){for(var e="",r=0;r<t;r++)e+=" ";return e},s=function(t){for(var e="",r=0;r<t.length;r++){var n=t[r],i="string"==typeof n?n:s(n);if(0!==r){var o=e.slice(-1)||" ";","===i||";"===i||("."!==i||"0123456789.:".includes(o))&&(e+=" ")}e+=i}return e},o=function(t,e){var r="",n=1e5;void 0===e&&(e=-1);for(var a=0;a<t.length;a++){var c=t[a];if("string"!=typeof c){var u=o(c,e+1);if(u.length<10*(80-4*e)&&u.indexOf('"""')<0){var l=s(c);l.length<80-4*e&&(c=l,u="")}u&&(n=1e4),r+=u}if("string"==typeof c){if(1===c.length&&"\n"===r.slice(-1)&&",.;".indexOf(c)>=0){r=r.slice(0,-1),"."==c&&"0123456789.:".includes(r.charAt(r.length-1))&&(r+=" ",n+=1),r+=c+"\n",n+=1;continue}if(n<4*e+4||n+c.length+1<80&&";.".indexOf(r[r.length-2])<0)r=r.slice(0,-1)+" "+c+"\n",n+=c.length+1;else{let t=i(4*e)+c;r+=t+"\n",n=t.length,e<0&&(r+="\n",n=1e5)}}}return r},a=function(t){for(var e=this.rootSubjects(t),r=e.roots,n=[],i=0;i<r.length;i++){var s=r[i];n.push(c(s,e))}return n}.bind(this);function c(t,e){return"BlankNode"!==t.termType||e.incoming[t]?[h(t,e)].concat([u(t,e)]).concat(["."]):l(t,e,!0).concat(["."])}var u=function(t,e){var r=[],i=null,s=e.subjects[this.toStr(t)]||[];if(void 0===s)throw new Error("Cant find statements for "+t);for(var o=[],a=0;a<s.length;a++){var c=s[a];c.predicate.uri===i?o.push(","):(i&&(r=r.concat([o]).concat([";"]),o=[]),r.push(n[c.predicate.uri]?n[c.predicate.uri]:h(c.predicate,e))),i=c.predicate.uri,o.push(l(c.object,e))}return r.concat([o])}.bind(this),l=function(t,e,r){return"BlankNode"!==t.termType||!r&&void 0!==e.rootsHash[t.toNT()]?h(t,e):e.subjects[this.toStr(t)]?["[",u(t,e),"]"]:"[]"}.bind(this);P.prototype.termToN3=h;var h=function(t,e){var r,n;switch(t.termType){case"Graph":return(n=(n=["{"]).concat(a(t.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<t.elements.length;r++)n.push([l(t.elements[r],e)]);return n.push(")"),n;default:return this.atomicTermToN3(t)}}.bind(this),f=function(){var t="";for(var e in this.flags.indexOf("d")<0&&this.defaultNamespace&&(t+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(e)&&this.namespacesUsed[e]&&(t+="@prefix "+this.prefixes[e]+": "+this.explicitURI(e)+".\n");return t+"\n"}.bind(this),p=a(t);return f()+o(p)}atomicTermToN3(t,e){switch(t.termType){case"BlankNode":case"Variable":return t.toNT();case"Literal":var r=t.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(t.datatype&&this.flags.indexOf("x")<0)switch(t.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 t=r.toLowerCase().indexOf("e")>0;return r.indexOf(".")<0&&!t&&(r+=".0"),t||(r+="e0"),r}case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===t.value?"true":"false"}var n=this.stringToN3(t.value,this.flags);return t.language?n+="@"+t.language:t.datatype.equals(this.xsd.string)||(n+="^^"+this.atomicTermToN3(t.datatype,e)),n;case"NamedNode":return this.symbolToN3(t);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+t+" of termType: "+t.termType)}}stringToN3(t,e){e||(e="e");var r,n,i,s,o,a="";for(t.length>20&&'"'!==t.slice(-1)&&e.indexOf("n")<0&&(t.indexOf("\n")>0||t.indexOf('"')>0)?(s='"""',o=this.forbidden3):(s='"',o=this.forbidden1),r=0;r<t.length&&(o.lastIndex=0,null!=o.exec(t.slice(r)));){n=r+o.lastIndex-1,a+=t.slice(r,n);var c=t[n];'"'===c&&'"""'===s&&'"""'!==t.slice(n,n+3)?a+=c:(i='\b\f\r\t\v\n\\"'.indexOf(c))>=0?a+="\\"+'bfrtvn\\"'[i]:e.indexOf("e")>=0?a+="\\u"+("000"+c.charCodeAt(0).toString(16).toLowerCase()).slice(-4):a+=c,r=n+1}return s+a+t.slice(r)+s}symbolToN3(t){var e=t.uri,r=e.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=e.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===e.indexOf("http")||0===e.indexOf("ws")||0===e.indexOf("file"))){var n=e.slice(r+1),i=e.slice(0,r+1),s=e.indexOf("://")+4,o=this.base?this.base.slice(0,Math.max(this.base.lastIndexOf("/"),this.base.lastIndexOf("#"))+1):null,a=o&&i===o,c=this.flags.indexOf("o")>=0&&n.indexOf(".")>=0;if(!a&&!c&&i.length>s&&this.isValidPNLocal(n)){if(this.defaultNamespace&&this.defaultNamespace===i&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(n)<0?n:":"+n;var u=this.prefixes[i];if(u||(u=this.makeUpPrefix(i)),u)return this.namespacesUsed[i]=!0,u+":"+n}}return this.explicitURI(e)}writeStore(t){var e=this.store,r=e.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var s in i){var o=e.fromNT(s);n&&o.equals(n)||t("\n"+this.atomicTermToN3(o)+" "+this.atomicTermToN3(e.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(e.statementsMatching(void 0,void 0,void 0,o))+" }.\n")}e.statementsMatching(void 0,e.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){t("\n<"+r.object.value+"> log:metadata {\n");var n=e.statementsMatching(void 0,void 0,void 0,r.subject);t(this.statementsToN3(this.statementsToN3(n))),t("}.\n")}));var a=[];n&&a.push(n);var c=[];a.map((function(t){c=c.concat(e.statementsMatching(void 0,void 0,void 0,t))})),t(this.statementsToN3(c))}statementsToXML(t){var e=[];e["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(t){for(var e="",r=0;r<t;r++)e+=" ";return e},i=function(t){for(var e="",r=0;r<t.length;r++){var n=t[r];e+="string"==typeof n?n:i(n)}return e},s=function(t,e){var r,o="",a=1e5;e||(e=0);for(var c=0;c<t.length;c++){var u=t[c];if("string"!=typeof u){var l=s(u,e+1);l.length<10*(80-4*e)&&l.indexOf('"""')<0&&(r=i(u)).length<80-4*e&&(u=" "+r,l=""),l&&(a=1e4),o+=l}"string"==typeof u&&(a<4*e+4?(o=o.slice(0,-1)+" "+u+"\n",a+=u.length+1):(o+=(r=n(4*e)+u)+"\n",a=r.length))}return o},o=function(t){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var e=this.rootSubjects(t),r=e.roots,n=[],i=0;i<r.length;i++){var s=r[i];n.push(u(s,e))}return n}.bind(this);function a(t){return void 0===t?"@@@undefined@@@@":t.replace(/[&<"]/g,(function(t){switch(t[0]){case"&":return"&amp;";case"<":return"&lt;";case'"':return"&quot;"}}))}var c=function(t){return a(this.base?w.refTo(this.base,t.uri):t.uri)}.bind(this),u=function(t,e){var n,i,s,o,p=[],d=e.subjects[this.toStr(t)];if(void 0===d)return h(t,e);d.sort((function(t,e){var n=t.predicate.uri,i=e.predicate.uri;if(n.substring(0,44)===r||i.substring(0,44)===r)return n.localeCompare(i);var s=n.substring(44),o=i.substring(44),a=parseInt(s,10),c=parseInt(o,10);return isNaN(a)||isNaN(c)||a!==s||c!==o?n.localeCompare(i):a-c}));for(var y=0;y<d.length;y++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(s=d[y]).predicate.uri||n||"NamedNode"!==s.object.termType){if((o=s.predicate).uri.substr(0,44)===r){var g=o.uri.substr(44);g===parseInt(g,10).toString()&&(o=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=f(o),s.object.termType){case"BlankNode":p=1===e.incoming[s.object].length?p.concat(["<"+i+' rdf:parseType="Resource">',u(s.object,e),"</"+i+">"]):p.concat(["<"+i+' rdf:nodeID="'+s.object.toNT().slice(2)+'"/>']);break;case"NamedNode":p=p.concat(["<"+i+' rdf:resource="'+c(s.object)+'"/>']);break;case"Literal":p=p.concat(["<"+i+(s.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(s.object.datatype.uri)+'"')+(s.object.language?' xml:lang="'+s.object.language+'"':"")+">"+a(s.object.value)+"</"+i+">"]);break;case"Collection":p=p.concat(["<"+i+' rdf:parseType="Collection">',l(s.object,e),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+s.object.termType+" into XML")}}else n=s.object;var m=n?f(n):"rdf:Description",b="";return"BlankNode"===t.termType?e.incoming[t]&&1===e.incoming[t].length||(b=' rdf:nodeID="'+t.toNT().slice(2)+'"'):b=' rdf:about="'+c(t)+'"',["<"+m+b+">"].concat([p]).concat(["</"+m+">"])}.bind(this);function l(t,e){for(var r=[],n=0;n<t.elements.length;n++)r.push(u(t.elements[n],e));return r}var h=function(t,e){var r=[],n=e.subjects[this.toStr(t)];if(!n)return r;n.sort();for(var i=0;i<n.length;i++){var s=n[i];switch(s.object.termType){case"BlankNode":r=e.rootsHash[s.object.toNT()]?r.concat(["<"+f(s.predicate)+' rdf:nodeID="'+s.object.toNT().slice(2)+'">',"</"+f(s.predicate)+">"]):r.concat(["<"+f(s.predicate)+' rdf:parseType="Resource">',h(s.object,e),"</"+f(s.predicate)+">"]);break;case"NamedNode":r=r.concat(["<"+f(s.predicate)+' rdf:resource="'+c(s.object)+'"/>']);break;case"Literal":r=r.concat(["<"+f(s.predicate)+(s.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(s.object.datatype.value)+'"')+(s.object.language?' xml:lang="'+s.object.language+'"':"")+">"+a(s.object.value)+"</"+f(s.predicate)+">"]);break;case"Collection":r=r.concat(["<"+f(s.predicate)+' rdf:parseType="Collection">',l(s.object,e),"</"+f(s.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+s.object.termType+" into XML")}}return r}.bind(this),f=function(t){var r=t.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 s=r.slice(n+1),o=r.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===o&&this.flags.indexOf("d")<0)return s;var a=this.prefixes[o];return a||(a=this.makeUpPrefix(o)),e[o]=!0,a+":"+s}.bind(this),p=o(t),d="<rdf:RDF";for(var y in this.defaultNamespace&&(d+=' xmlns="'+a(this.defaultNamespace)+'"'),e)if(e.hasOwnProperty(y)){var g=this.base&&this.flags.includes("z")?w.refTo(this.base,y):y;d+="\n xmlns:"+this.prefixes[y]+'="'+a(g)+'"'}return s([d+=">",p,"</rdf:RDF>"],-1)}statementsToJsonld(t){const e=this.statementsToN3(t),r=k.parse(e);return JSON.stringify(r,null,2)}}function F(t,e,r,i,s,o){r=r||t?.value;const a=o||{};i=i||n.sT;try{var c=C(e);a.flags&&c.setFlags(a.flags);var u=e.statementsMatching(void 0,void 0,void 0,t);switch("namespaces"in e&&c.suggestNamespaces(e.namespaces),a.namespaces&&c.setNamespaces(a.namespaces),c.setBase(r),i){case n.JG:return l(null,c.statementsToXML(u));case n.ny:case n.MG:return l(null,c.statementsToN3(u));case n.sT:case n.hu:return c.setFlags("si"+(a.flags?" "+a.flags:"")),l(null,c.statementsToN3(u));case n.bM:return c.setFlags("deinprstux"),l(null,c.statementsToNTriples(u));case n.i2:return c.setFlags("si dr"+(a.flags?" "+a.flags:"")),l(null,c.statementsToJsonld(u));case n._0:case n.BR:return c.setFlags("deinprstux q"),l(null,c.statementsToNTriples(u));default:throw new Error("Serialize: Content-type "+i+" not supported for data write.")}}catch(t){if(s)return s(t,void 0);throw t}function l(t,e){return s?void s(t,e):e}}const U=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],D={first:"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",rest:"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",nil:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};function M(t,e,r){const n=[];return r.reduce(((e,r,i,s)=>{let o;return n.push(t.quad(e,t.namedNode(D.first),s[i])),i<s.length-1?(o=t.blankNode(),n.push(t.quad(e,t.namedNode(D.rest),o))):n.push(t.quad(e,t.namedNode(D.rest),t.namedNode(D.nil))),o}),e),n}function L(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;var n=t.length;for(r<0&&(r=n+r);r<n;r++)if(t[r]===e)return r;return-1}class B extends r.A{constructor(){var r;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};super(""),r=this,this.statements=i,this.constraints=s,this.initBindings=o,this.optional=a,(0,t.A)(this,"termType",n.bD),(0,t.A)(this,"classOrder",e.A.Graph),(0,t.A)(this,"fetcher",void 0),(0,t.A)(this,"isVar",0),(0,t.A)(this,"ns",N),(0,t.A)(this,"rdfFactory",void 0),this.rdfFactory=c&&c.rdfFactory||T;for(const t of U)this[t]=function(){return r.rdfFactory[t](...arguments)}}add(t,e,r,n){return 1===arguments.length&&t.forEach((t=>this.add(t.subject,t.predicate,t.object,t.graph))),this.statements.push(this.rdfFactory.quad(t,e,r,n))}addStatement(t){return this.add(t)}bnode(t){return this.rdfFactory.blankNode(t)}addAll(t){t.forEach((t=>{this.add(t.subject,t.predicate,t.object,t.graph)}))}any(t,e,r,n){const i=this.anyStatementMatching(t,e,r,n);return null==i?null:null==t?i.subject:null==e?i.predicate:null==r?i.object:null}anyValue(t,e,r,n){const i=this.any(t,e,r,n);return i?i.value:void 0}anyJS(t,e,n,i){const s=this.any(t,e,n,i);return s?r.A.toJS(s):void 0}anyStatementMatching(t,e,r,n){let i=this.statementsMatching(t,e,r,n,!0);if(i&&0!==i.length)return i[0]}id(t){return this.rdfFactory.id(t)}statementsMatching(t,e,r,n,i){const s=this.statements.filter((i=>(!t||t.equals(i.subject))&&(!e||e.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))));return i?0===s.length?[]:[s[0]]:s}bottomTypeURIs(t){let e,r,n,i,s,o,a,c;e=[];for(let u in t)if(t.hasOwnProperty(u)){for(c=t[u],a=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(u)),r=!0,i=0,s=a.length;i<s;i++)if(n=a[i],o=n.uri,o in t){r=!1;break}r&&(e[u]=c)}return e}collection(){return new f}each(t,e,r,n){const i=[];let o=this.statementsMatching(t,e,r,n,!1);if(null==t)for(let t=0,e=o.length;t<e;t++)i.push(o[t].subject);else if(null==e)for(let t=0,e=o.length;t<e;t++)i.push(o[t].predicate);else if(null==r)for(let t=0,e=o.length;t<e;t++)i.push(o[t].object);else if(null==n)for(let t=0,e=o.length;t<e;t++)i.push(new s.A(o[t].graph.value));return i}equals(t){return!!t&&this.hashString()===t.hashString()}findMembersNT(t){let e,r,n,i,s,o,a,c,u,l,h,f,p,d;f={},f[t.toNT()]=!0,i={},o=this.transitiveClosure(f,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0);for(let t in o)if(o.hasOwnProperty(t)){a=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(t));for(let t=0,e=a.length;t<e;t++)p=a[t],i[p.subject.toNT()]=p;c=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(t));for(let t=0,r=c.length;t<r;t++)for(s=c[t],u=this.statementsMatching(void 0,s),n=0,e=u.length;n<e;n++)p=u[n],i[p.subject.toNT()]=p;l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(t));for(let t=0,e=l.length;t<e;t++)for(s=l[t],h=this.statementsMatching(void 0,s),d=0,r=h.length;d<r;d++)p=h[d],i[p.object.toNT()]=p}return i}findMemberURIs(t){return this.NTtoURI(this.findMembersNT(t))}findSubClassesNT(t){let e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}findSuperClassesNT(t){let e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypesNT(t){let e,r,n,i,s,o,a,c,u;n="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",u=[],i=this.statementsMatching(t,void 0,void 0);for(let t=0,e=i.length;t<e;t++)if(c=i[t],"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===c.predicate.uri)u[c.object.toNT()]=c;else{s=this.each(c.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"));for(let t=0,e=s.length;t<e;t++)r=s[t],u[r.toNT()]=c}o=this.statementsMatching(void 0,void 0,t);for(let t=0,r=o.length;t<r;t++){c=o[t],a=this.each(c.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"));for(let t=0,r=a.length;t<r;t++)e=a[t],u[e.toNT()]=c}return this.transitiveClosure(u,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypeURIs(t){return this.NTtoURI(this.findTypesNT(t))}connectedStatements(t,e,r){r=r||[];let n=[t],i={},s={},o=[],a=this,c=function(t){let c=function(t){"BlankNode"!==t.termType||i[t.value]||(i[t.value]=!0,n.push(t))},u=a.statementsMatching(null,null,t,e).concat(a.statementsMatching(t,null,null,e));u=u.filter((function(t){if(r[t.predicate.value])return!1;let e=t.toNT();return!s[e]&&(s[e]=!0,!0)})),u.forEach((function(t){c(t.subject),c(t.object)})),o=o.concat(u)};for(;n.length;)c(n.shift());return o}formula(t){return new B}fromNT(t){let e,r,n;switch(t[0]){case"<":return this.sym(t.slice(1,-1));case'"':if(n=void 0,e=void 0,r=t.lastIndexOf('"'),r<t.length-1)if("@"===t[r+1])n=t.slice(r+2);else{if("^^"!==t.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+t);e=this.fromNT(t.slice(r+3))}return t=(t=(t=(t=t.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(t,n||e);case"_":return this.rdfFactory.blankNode(t.slice(2));case"?":return new v(t.slice(1))}throw new Error("Can't convert from NT: "+t)}holds(t,e,r,n){let i;if(1===arguments.length){if(!t)return!0;if(t instanceof Array){for(i=0;i<t.length;i++)if(!this.holds(t[i]))return!1;return!0}if((0,o.SH)(t))return this.holds(t.subject,t.predicate,t.object,t.graph);if(t.statements)return this.holds(t.statements)}return null!=this.anyStatementMatching(t,e,r,n)}holdsStatement(t){return this.holds(t.subject,t.predicate,t.object,t.graph)}list(t,e){if(e.rdfFactory.supports.COLLECTIONS){const r=e.rdfFactory.collection();return t.forEach((function(t){r.append(t)})),r}{const r=e.rdfFactory.blankNode(),n=M(e.rdfFactory,r,t);return e.addAll(n),r}}NTtoURI(t){let e,r,n={};for(e in t)t.hasOwnProperty(e)&&(r=t[e],"<"===e[0]&&(n[e.slice(1,-1)]=r));return n}serialize(t,e,r,n){return F(r,this,t,e,void 0,n)}substitute(t){let e=this.statements.map((function(e){return e.substitute(t)}));const r=new B;return r.addAll(e),r}sym(t,e){if(e)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(t)}the(t,e,r,n){let i=this.any(t,e,r,n);return null==i&&E.A.error("No value found for the() {"+t+" "+e+" "+r+"}."),i}transitiveClosure(t,e,r){let n,i,s,o,a,c,u={};Object.assign(u,t);let l={};for(;;){if(c=function(){for(let t in u)if(u.hasOwnProperty(t))return t}(),null==c)return l;for(a=r?this.each(void 0,e,this.fromNT(c)):this.each(this.fromNT(c),e),i=0,s=a.length;i<s;i++)n=a[i],o=n.toNT(),o in l||o in u||(u[o]=u[c]);l[c]=u[c],delete u[c]}}topTypeURIs(t){let e,r,n,i,s,o,a,c;for(n in a=[],t)if(t.hasOwnProperty(n)){for(c=t[n],s=0,o=this.each(this.rdfFactory.namedNode(n),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf")),e=0,i=o.length;e<i;e++)if(r=o[e],"http://www.w3.org/2000/01/rdf-schema#Resource"!==r.uri){s++;break}s||(a[n]=c)}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(t){return new v(t)}whether(t,e,r,n){return this.statementsMatching(t,e,r,n,!1).length}}r.A.fromValue=h;const q=r.A,$={xsd:N("http://www.w3.org/2001/XMLSchema#")};r.A.toJS=function(t){return(0,o.P3)(t)?t.elements.map(r.A.toJS):(0,o.c$)(t)?t.datatype.equals($.xsd("boolean"))?"1"===t.value||"true"===t.value:t.datatype.equals($.xsd("dateTime"))||t.datatype.equals($.xsd("date"))?new Date(t.value):t.datatype.equals($.xsd("integer"))||t.datatype.equals($.xsd("float"))||t.datatype.equals($.xsd("decimal"))?Number(t.value):t.value:t};var H=a(6357);class z{constructor(t,e){this.pat=new J,this.vars=[],this.name=t,this.id=e}}function X(t,e,r,n){function i(t){var e,r="";for(e in t)t.hasOwnProperty(e)&&(r+=" "+e+" -> "+t[e]);return r}function s(t){var e,r="Bindings: ",n=t.length;for(e=0;e<n;e++)r+=i(t[e][0])+";\n\t";return r}function o(t,e,r,n){var i;if(t.length!==e.length)return[];if(!t.length)return[[[],null]];var s=function(t,e,r,n){var i=r[t];if(void 0===i){if(t.isVar){var s=[];return s[t]=e,[[s,null]]}i=t}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[e]&&(e=n.redirections[e]),i.equals(e)||i.uri&&i.uri===d?[[[],null]]:[];if(t instanceof Array)return e instanceof Array?o(t,e,r):[];throw new Error("query.js: oops - code not written yet")}(t[0],e[0],r,n);if(0===s.length)return s;var a,c,u,l,h,f,p,y=[],g=s.length;for(a=0;a<g;a++){for(h in p=[],c=s[a][0])c.hasOwnProperty(h)&&(p[h]=c[h]);for(h in r)r.hasOwnProperty(h)&&(p[h]=r[h]);for(l=(i=o(t.slice(1),e.slice(1),p,n)).length,u=0;u<l;u++){for(h in f=i[u][0],c)c.hasOwnProperty(h)&&(f[h]=c[h]);y.push([f,null])}}return y}function a(t,e){var r,n={};for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n}function c(t,e){return this.trunkBindings=e,this.originalCallback=t,this.branches=[],this}function u(t,e){return this.count=0,this.success=!1,this.done=!1,this.callback=t,this.onDone=e,this}c.prototype.checkAllDone=function(){var t;for(t=0;t<this.branches.length;t++)if(!this.branches[t].done)return;E.A.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},c.prototype.doCallBacks=function(t,e){var r;if(t<0)return this.originalCallback(e);for(r=0;r<this.branches[t].results.length;r++)this.doCallBacks(t-1,a(e,this.branches[t].results[r]))},u.prototype.reportMatch=function(t){this.callback(t),this.success=!0},u.prototype.reportDone=function(){this.done=!0,E.A.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var l=function(t){return this.count=0,this.done=!1,this.results=[],this.junction=t,t.branches.push(this),this};function h(t,e,r){var n,i,s,o,a,c;for(e.nvars=0,e.index=null,n=[e.subject,e.predicate,e.object,e.why],o=[t.subjectIndex,t.predicateIndex,t.objectIndex,t.whyIndex],s=0;s<4;s++){let u=n[s];if(u.uri&&u.uri===d);else if(u.isVar&&void 0===r[u])e.nvars++;else{if(void 0,u=void 0===(c=r[a=n[s]])?a:c,t.redirections[t.id(u)]&&(u=t.redirections[t.id(u)]),!(i=o[s][t.id(u)]))return e.index=[],!1;(null===e.index||e.index.length>i.length)&&(e.index=i)}}return null===e.index&&(e.index=t.statements),!0}function f(t,e){return t.nvars!==e.nvars?t.nvars-e.nvars:t.index.length-e.index.length}l.prototype.reportMatch=function(t){this.results.push(t)},l.prototype.reportDone=function(){E.A.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),E.A.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var p=function(t,r,n,s,o,a,u){E.A.debug("Match begins, Branch count now: "+u.count+" for "+u.pattern_debug);var h,f,d=r.statements;if(0===d.length){if(E.A.debug("FOUND MATCH WITH BINDINGS:"+i(n)),0===r.optional.length)u.reportMatch(n);else{E.A.debug("OPTIONAL: "+r.optional);var y,m=new c(e,n),b=[];for(y=0;y<r.optional.length;y++)b[y]=new l(m),b[y].pattern_debug=r.optional[y];for(y=0;y<r.optional.length;y++)b[y].count=b[y].count+1,p(t,r.optional[y],n,"",o,e,b[y])}return u.count--,void E.A.debug("Match ends -- success , Branch count now: "+u.count+" for "+u.pattern_debug)}var v=d.length;if(o){var x=function(e,i){var c=e.uri.split("#")[0];o.nowOrWhenFetched(c,void 0,(function(i,c,l){i||H.log("Error following link to <"+e.uri+"> in query: "+c),p(t,r,n,s,o,a,u)}))};for(f=0;f<v;f++){if(h=d[f],void 0!==n[h.subject]&&n[h.subject].uri&&o&&"unrequested"===o.getState((0,w.docpart)(n[h.subject].uri)))return void x(n[h.subject]);if(void 0!==n[h.object]&&n[h.object].uri&&o&&"unrequested"===o.getState((0,w.docpart)(n[h.object].uri)))return void x(n[h.object])}}g(t,r,n,s,o,a,u)},y=function(t,e){var r,n,i=!0;for(r in t)t.hasOwnProperty(r)&&e[r]&&(n=e[r].test)&&!n(t[r])&&(i=!1);return i},g=function(t,e,r,n,a,c,u){var l,d,g,m,b,w,v,x=e.statements,_=x.length;for(l=0;l<_;l++)h(t,v=x[l],r);x.sort(f),v=x[0];var A,T=t.formula();T.optional=e.optional,T.constraints=e.constraints,T.statements=x.slice(1),E.A.debug(n+"match2 searching "+v.index.length+" for "+v+"; bindings so far="+i(r));var N,O,j=v.index.length,S=0;for(A=0;A<j;A++)for(O=v.index[A],N=o([v.subject,v.predicate,v.object,v.why],[O.subject,O.predicate,O.object,O.why],r,t),E.A.info(n+" From first: "+N.length+": "+s(N)),g=N.length,d=0;d<g;d++)if(b=[],w=N[d][0],y(w,e.constraints)){for(m in w)w.hasOwnProperty(m)&&(b[m]=w[m]);for(m in r)r.hasOwnProperty(m)&&(b[m]=r[m]);u.count++,S++,p(t,T,b,n+" ",a,c,u)}else E.A.debug("Branch count CS: "+u.count);u.count--,0===S&&E.A.debug("Match2 fails completely on "+v),E.A.debug("Match2 ends, Branch count: "+u.count+" for "+u.pattern_debug),0===u.count&&(E.A.debug("Branch finished."),u.reportDone())},m=this;E.A.debug("Query on "+this.statements.length);var b=new u(e,n);b.count++,t.sync?p(m,t.pat,t.pat.initBindings,"",r,e,b):setTimeout((function(){p(m,t.pat,t.pat.initBindings,"",r,e,b)}),0)}const V="http://www.w3.org/2002/07/owl#";function G(t,e,r,n){var i=t.any(e,r,void 0);return!!i&&(t.equate(i,n),!0)}function Q(t,e,r,n){var i=t.any(void 0,r,n);return!!i&&(t.equate(i,e),!0)}function W(t,e,r,n,i){t.typeCallback&&t.typeCallback(t,n,i);var s=t.classActions[t.id(n)],o=!1;if(s)for(var a=0;a<s.length;a++)o=o||s[a](t,e,r,n,i);return o}class J extends B{constructor(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(void 0,void 0,void 0,void 0,r),(0,t.A)(this,"updater",void 0),(0,t.A)(this,"namespaces",void 0),(0,t.A)(this,"classActions",void 0),(0,t.A)(this,"propertyActions",void 0),(0,t.A)(this,"redirections",void 0),(0,t.A)(this,"aliases",void 0),(0,t.A)(this,"HTTPRedirects",void 0),(0,t.A)(this,"subjectIndex",void 0),(0,t.A)(this,"predicateIndex",void 0),(0,t.A)(this,"objectIndex",void 0),(0,t.A)(this,"whyIndex",void 0),(0,t.A)(this,"index",void 0),(0,t.A)(this,"features",void 0),(0,t.A)(this,"_universalVariables",void 0),(0,t.A)(this,"_existentialVariables",void 0),(0,t.A)(this,"rdfArrayRemove",void 0),(0,t.A)(this,"dataCallbacks",[]),(0,t.A)(this,"dataRemovalCallbacks",[]),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=e||[],this.rdfArrayRemove=r.rdfArrayRemove||O.RDFArrayRemove,r.dataCallback&&(this.dataCallbacks=[r.dataCallback]),r.dataRemovalCallback&&(this.dataRemovalCallbacks=[r.dataRemovalCallback]),this.initPropertyActions(this.features)}static get defaultGraphURI(){return d}substitute(t){var e=this.statements.map((function(e){return e.substitute(t)})),r=new J;return r.add(e),r}addDataCallback(t){this.dataCallbacks.push(t)}addDataRemovalCallback(t){this.dataRemovalCallbacks.push(t)}applyPatch(t,e,r){var n,i=this,s=null;function o(o){if(t.delete){n=t.delete,s&&(n=n.substitute(s)),n=n.statements;var a=[],c=n.map((function(t){var r=i.statementsMatching(t.subject,t.predicate,t.object,e);return 0===r.length?(a.push(t),null):r[0]}));if(a.length)return r("Could not find to delete: "+a.join("\n or "));c.map((function(t){i.remove(t)}))}t.insert&&(n=t.insert,s&&(n=n.substitute(s)),(n=n.statements).map((function(t){t.graph=e,i.add(t.subject,t.predicate,t.object,t.graph)}))),o()}if(t.where){var a=new z("patch");a.pat=t.where,a.pat.statements.map((function(t){t.graph=Ye(e.value)})),a.sync=!0;var c=[];i.query(a,(function(t){c.push(t)}),i.fetcher,(function(){return 0===c.length?r("No match found to be patched:"+t.where):c.length>1?r("Patch ambiguous. No patch done."):(s=c[0],void o(r))}))}else o(r)}declareExistential(t){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(t),t}initPropertyActions(t){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[W],L(t,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${V}sameAs`))]=[function(t,e,r,n,i){return t.equate(e,n),!0}]),L(t,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${V}InverseFunctionalProperty`))]=[function(t,e,r,n,i){return t.newPropertyAction(e,Q)}]),L(t,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${V}FunctionalProperty`))]=[function(t,e,r,n,i){return t.newPropertyAction(e,G)}])}addStatement(t){return this.add(t.subject,t.predicate,t.object,t.graph),this.statements.length}add(t,e,r,n){var i,s,a;if(1===arguments.length){if(t instanceof Array)for(i=0;i<t.length;i++)this.add(t[i]);else(0,o.aF)(t)?this.add(t.subject,t.predicate,t.object,t.graph):(0,o.ok)(t)&&this.add(t.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof t&&(t=this.rdfFactory.namedNode(t)),e=q.fromValue(e);const c=q.fromValue(r);if(n=q.fromValue(n),!(0,o.CZ)(t))throw new Error("Subject is not a subject type");if(!(0,o.fY)(e))throw new Error(`Predicate ${e} is not a predicate type`);if(!(0,o.DJ)(c))throw new Error(`Object ${c} is not an object type`);if(!(0,o.RN)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,e,n);var u=this.id(this.canon(e)),l=!1;if(s=this.propertyActions[u])for(i=0;i<s.length;i++)l=l||s[i](this,t,e,c,n);if(this.holds(t,e,c,n))return null;var h=[this.id(this.canon(t)),u,this.id(this.canon(c)),this.id(this.canon(n))];for(a=this.rdfFactory.quad(t,e,c,n),i=0;i<4;i++){var f=this.index[i],p=h[i];f[p]||(f[p]=[]),f[p].push(a)}this.statements.push(a);for(const t of this.dataCallbacks)t(a);return a}canon(t){if(!t)return t;const e=this.redirections[this.id(t)];if(e)return e;switch(t.termType){case n.$Q:return new i(t.value);case n.r0:return t;case n.ic:return new y;case n.S:case n.bD:return t;case n.QW:return new l(t.value,t.language,t.datatype);case n.Kk:return new s.A(t.value);case n.P2:return new v(t.value);default:throw new Error(`Term Type not recognized for canonization: ${t.termType}`)}}check(){this.checkStatementList(this.statements);for(var t=0;t<4;t++){var e=this.index[t];for(var r in e)e.hasOwnProperty(r)&&this.checkStatementList(e[r],t)}}checkStatementList(t,e){void 0===e&&(e=0);for(var r,n=" found in "+["subject","predicate","object","why"][e]+" index.",i=0;i<t.length;i++){for(var s=[(r=t[i]).subject,r.predicate,r.object,r.graph],o=function(t,e){for(var r=0;r<t.length;r++)if(t[r].subject.equals(e.subject)&&t[r].predicate.equals(e.predicate)&&t[r].object.equals(e.object)&&t[r].why.equals(e.graph))return!0},a=0;a<4;a++){var c=this.canon(s[a]),u=this.id(c);this.index[a][u]&&o(this.index[a][u],r)}if(!o(this.statements,r))throw new Error("Statement list does not statement "+r+"@"+r.graph+n)}}close(){return this}compareTerms(t,r){return Object.prototype.hasOwnProperty.call(t,"compareTerm")?t.compareTerm(r):e.A[t.termType]<e.A[r.termType]?-1:e.A[t.termType]>e.A[r.termType]?1:t.value<r.value?-1:t.value>r.value?1:0}copyTo(t,e,r){r||(r=[]);var n=this.statementsMatching(t);-1!==L(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,t));for(var i=0;i<n.length;i++){var s=n[i];switch(s.object.termType){case"NamedNode":this.add(e,s.predicate,s.object);break;case"Literal":case"BlankNode":case"Collection":this.add(e,s.predicate,s.object.copy(this))}-1!==L(r,"delete")&&this.remove(s)}}equate(t,e){const r=this.canon(t),n=this.canon(e);var i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}formula(t){return new J(t)}get length(){return this.statements.length}match(t,e,r,n){return this.statementsMatching(q.fromValue(t),q.fromValue(e),q.fromValue(r),q.fromValue(n))}mentionsURI(t){var e="<"+t+">";return!!this.subjectIndex[e]||!!this.objectIndex[e]||!!this.predicateIndex[e]}newExistential(t){if(!t)return this.bnode();var e=this.sym(t);return this.declareExistential(e)}newPropertyAction(t,e){var r=this.id(t);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(e);for(var n=this.statementsMatching(void 0,t,void 0),i=!1,s=0;s<n.length;s++)i=i||e(this,n[s].subject,t,n[s].object);return i}newUniversal(t){var e=this.sym(t);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(e),e}variable(t){return new v(t)}nextSymbol(t){for(var e=0;;e++){var r=t.value+"#n"+e;if(!this.mentionsURI(r))return this.sym(r)}}query(t,e,r,n){return X.call(this,t,e,r,n)}querySync(t){var e=[],r=!1;if(t.sync=!0,X.call(this,t,(function(t){e.push(t)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return e}remove(t){if(t instanceof Array){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}if((0,o.ok)(t))return this.remove(t.statements);var r=this.statementsMatching(t.subject,t.predicate,t.object,t.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+t);return this.removeStatement(r[0]),this}removeDocument(t){this.removeMetadata(t);for(var e=this.statementsMatching(void 0,void 0,void 0,t).slice(),r=0;r<e.length;r++)this.removeStatement(e[r]);return this.removeMatches(t,null,null),this}removeMetadata(t){const e=this.sym("chrome://TheCurrentSession"),r="http://www.w3.org/2007/ont/link#",n=this.statementsMatching(void 0,this.sym(`${r}requestedURI`),this.rdfFactory.literal(t.value),e).map((t=>t.subject));for(var i=0;i<n.length;i++){const t=n[i];if(null!=t){let n;const i=this.any(t,this.sym(`${r}status`),null,e);if(null!=i){n=this.statementsMatching(i,this.sym(`${r}status`),null,e).slice();for(var s=0;s<n.length;s++)this.removeStatement(n[s])}const o=this.any(t,this.sym(`${r}response`),null,e);if(null!=o)for(n=this.statementsMatching(o,null,null,e).slice(),s=0;s<n.length;s++)this.removeStatement(n[s]);for(n=this.statementsMatching(t,null,null,e).slice(),s=0;s<n.length;s++)this.removeStatement(n[s])}}return this.removeMatches(this.sym(t.value),null,null,e),this}removeMany(t,e,r,n,i){for(var s=this.statementsMatching(t,e,r,n,!1),o=[],a=0;a<s.length;a++)o.push(s[a]);for(i&&(o=o.slice(0,i)),a=0;a<o.length;a++)this.remove(o[a])}removeMatches(t,e,r,n){return this.removeMany(t,e,r,n),this}removeStatement(t){for(var e=[t.subject,t.predicate,t.object,t.graph],r=0;r<4;r++){var n=this.canon(e[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],t)}this.rdfArrayRemove(this.statements,t);for(const e of this.dataRemovalCallbacks)e(t);return this}removeStatements(t){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}replaceWith(t,e){for(var r=this.id(t),n=this.id(e),i=function(t){var e=t[r];if(e){var i=t[n];t[n]=i?e.concat(i):e,delete t[r]}},s=0;s<4;s++)i(this.index[s]);if(this.redirections[r]=e,t.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(t),this.aliases[r])for(s=0;s<this.aliases[r].length;s++)this.redirections[this.id(this.aliases[r][s])]=e,this.aliases[n].push(this.aliases[r][s]);this.add(e,this.sym("http://www.w3.org/2007/ont/link#uri"),t),this.fetcher&&this.fetcher.nowKnownAs(t,e)}return i(this.classActions),i(this.propertyActions),!0}allAliases(t){var e=this.aliases[this.id(this.canon(t))]||[];return e.push(this.canon(t)),e}sameThings(t,e){if(t.equals(e))return!0;var r=this.canon(t);if(!r)return!1;var n=this.canon(e);return!!n&&r.value===n.value}setPrefixForURI(t,e){if(("tab"!==t||!this.namespaces.tab)&&"ns"!==t.slice(0,2)&&"default"!==t.slice(0,7)){for(let t in this.namespaces)this.namespaces[t]==e&&delete this.namespaces[t];this.namespaces[t]=e}}statementsMatching(t,e,r,n,i){var s,o,a=[t,e,r,n],c=[],u=[],l=[],h=[];for(s=0;s<4;s++)c[s]=this.canon(q.fromValue(a[s])),c[s]?(h.push(s),u[s]=this.id(c[s])):l.push(s);if(0===h.length)return this.statements;if(1===h.length)return s=h[0],(o=this.index[s][u[s]])&&i&&o.length>1&&(o=o.slice(0,1)),o||[];var f,p,d=1e10;for(p=0;p<h.length;p++){if(s=h[p],!(o=this.index[s][u[s]]))return[];o.length<d&&(d=o.length,f=p)}for(var y=h[f],g=this.index[y][u[y]],m=h.slice(0,f).concat(h.slice(f+1)),b=[],w=["subject","predicate","object","why"],v=0;v<g.length;v++){var x=g[v];for(p=0;p<m.length;p++)if(s=m[p],!this.canon(x[w[s]]).equals(c[s])){x=null;break}if(null!=x&&(b.push(x),i))break}return b}uris(t){var e=this.canon(t),r=this.aliases[this.id(e)];if(!e.value)return[];var n=[e.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}serialize(t,e,r,n){return F(r,this,t,e,void 0,n={...n||{},namespaces:n?.namespaces?{...this.namespaces,...n.namespaces}:{...this.namespaces}})}}(0,t.A)(J,"handleRDFType",void 0),J.handleRDFType=W;const Y=N("http://www.w3.org/1999/02/22-rdf-syntax-ns#");function Z(t,e){function r(n,i,s){const o=t.statementsMatching(n,Y("rest"),null,e);if(1!==o.length)throw new Error(`Bad list structure: no rest at ${n}`);const a=t.statementsMatching(n,Y("first"),null,e);if(1!==a.length)throw new Error(`Bad list structure: rest but ${a.length} firsts at ${n}`);const c=[a[0].object].concat(i),u=s.concat(o).concat(a),l=t.statementsMatching(null,Y("rest"),n,e);if(0===l.length){const r=new f(c);return t.remove(u),void function(t,e,r,n){for(const i of t.statementsMatching(r,null,null,n)){const r=new b(e,i.predicate,i.object,n);t.remove(i),t.add(r)}for(const i of t.statementsMatching(null,r,null,n))t.remove(i),t.add(new b(i.subject,e,i.object,n));for(const i of t.statementsMatching(null,null,r,n))t.remove(i),t.add(new b(i.subject,i.predicate,e,n))}(t,r,n,e)}if(1!==l.length)throw new Error(`Bad list structure: ${l.length} pres at ${n}`);const h=l[0].subject;if("BlankNode"!==h.termType)throw new Error(`Bad list element node ${h} type: ${h.termType} `);r(h,c,u)}!function(t,e){const r=Y("nil");for(const n of t.statementsMatching(r,null,null,e)){t.remove(n);const r=new f;t.add(new b(r,n.predicate,n.object,e))}for(const n of t.statementsMatching(null,null,r,e))if(!n.predicate.sameTerm(Y("rest"))){t.remove(n);const r=new f;t.add(new b(n.subject,n.predicate,r,e))}}(t,e),t.statementsMatching(null,Y("rest"),Y("nil"),e).forEach((t=>{if("BlankNode"!==t.subject.termType)throw new Error(`Bad list element node ${t.subject} type: ${t.subject.termType} `);r(t.subject,[],[])}))}var K="http://www.w3.org/2000/10/swap/log#",tt=function(t){return t},et=function(t){return t},rt=function(t){if(t.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},nt=function(t){return t.length},it=function(t,e,r){if(void 0===t.slice)throw"@@ mising.js: No .slice function for "+t+" of type "+typeof t;return void 0===r||null==r?t.slice(e):t.slice(e,r)},st=Error("dummy error stop iteration"),ot=function(t){return this.last=0,this.li=t,this.next=function(){if(this.last==this.li.length)throw st;return this.li[this.last++]},this},at=function(t,e){return t.indexOf(e)},ct=function(t,e){if(!t){if(e)throw"python Assertion failed: "+e;throw"(python) Assertion failed."}};String.prototype.encode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return function(t){t=t.replace(/\r\n/g,"\n");for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e+=String.fromCharCode(n):n>127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e}(this)},String.prototype.decode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return this};var ut=function(t,e){return w.join(e,t)},lt="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",ht="http://www.w3.org/2002/07/owl#sameAs",ft="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",pt=ft+":",dt=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?([eE][-+]?[0-9]+)?","g"),yt=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?"),gt=new RegExp("[\\s#]"),mt=new RegExp('[\\\\\\r\\n\\"]',"g"),bt=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");function wt(t,e){var r=t.charAt(e+1);return""===r||gt.test(r)}const vt=function(t,e,r,n,i,s,o,a){return new xt(t,e,r,n,i,s,o,a)};class xt{constructor(t,e,r,n,i,s,o,a){void 0===e&&(e=null),void 0===r&&(r=""),void 0===n&&(n=null),void 0===i&&(i=""),void 0===s&&(s=null),void 0===o&&(o=""),void 0===a&&(a=null),this._bindings=new rt([]),this._flags=o,""!=r&&(ct(r.indexOf(":")>=0,"Document URI not absolute: "+r),this._bindings[""]=r+"#"),this._store=t,i&&t.setGenPrefix(i),this._thisDoc=r,this.source=t.sym(r),this.lines=0,this.statementCount=0,this.hasNil=!1,this.startOfLine=0,this.previousLine=0,this._genPrefix=i,this.keywords=new et(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new rt([]),this._variables=new rt([]),this._parentVariables=new rt([]),this._reason=a,this._reason2=null,this._baseURI=n||r||null,ct(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==e?this._thisDoc?this._formula=t.formula(r+"#_formula"):this._formula=t.formula():this._formula=e,this._context=this._formula,this._parentContext=null}here(t){return this._genPrefix+"_L"+this.lines+"C"+(t-this.startOfLine+1)}formula(){return this._formula}loadStream(t){return this.loadBuf(t.read())}loadBuf(t){return this.startDoc(),this.feed(t),this.endDoc()}feed(t){for(var e=t.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(e,r);if(n<0)return;if((r=this.directiveOrStatement(e,n))<0)throw _t(this._thisDoc,this.lines,e,n,"expected directive or statement")}}directiveOrStatement(t,e){var r,n=this.skipSpace(t,e);return n<0?n:(r=this.directive(t,n))>=0||(r=this.statement(t,n))>=0?this.checkDot(t,r):r}tok(t,e,r){if("@"==e.slice(r,r+1))r+=1;else if(L(this.keywords,t)<0)return-1;var n=r+nt(t);return e.slice(r,n)==t&&ft.indexOf(e.charAt(n))>=0?n:-1}directive(t,e){if((s=this.skipSpace(t,e))<0)return s;var r=new et([]);if((s=this.tok("bind",t,e))>0)throw _t(this._thisDoc,this.lines,t,e,"keyword bind is obsolete: use @prefix");if((s=this.tok("keywords",t,e))>0){if((e=this.commaSeparatedList(t,s,r,!1))<0)throw _t(this._thisDoc,this.lines,t,e,"'@keywords' needs comma separated list of words");return this.setKeywords(it(r,null,null)),e}if((s=this.tok("forAll",t,e))>0){if((e=this.commaSeparatedList(t,s,r,!0))<0)throw _t(this._thisDoc,this.lines,t,e,"Bad variable list after @forAll");var n=new ot(r);try{for(;;){var i=n.next();(L(this._variables,i)<0||L(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(t){if(t!=st)throw t}return e}if((s=this.tok("forSome",t,e))>0){if((e=this.commaSeparatedList(t,s,r,this.uri_ref2))<0)throw _t(this._thisDoc,this.lines,t,e,"Bad variable list after @forSome");n=new ot(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(t){if(t!=st)throw t}return e}if((s=this.tok("prefix",t,e))>=0){var s,o=new et([]);if((e=this.qname(t,s,o))<0)throw _t(this._thisDoc,this.lines,t,s,"expected qname after @prefix");if((s=this.uri_ref2(t,e,o))<0)throw _t(this._thisDoc,this.lines,t,e,"expected <uriref> after @prefix _qname_");var a=o[1].uri;return this._baseURI?a=ut(this._baseURI,a):ct(a.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),ct(a.indexOf(":")>=0),this._bindings[o[0][0]]=a,this.bind(o[0][0],function(t){return encodeURI(t)}(a)),s}if((s=this.tok("base",t,e))>=0){if(o=new et([]),(e=this.uri_ref2(t,s,o))<0)throw _t(this._thisDoc,this.lines,t,s,"expected <uri> after @base ");if(a=o[0].uri,!this._baseURI)throw _t(this._thisDoc,this.lines,t,s,"With no previous base URI, cannot use relative URI in @base <"+a+">");return a=ut(this._baseURI,a),ct(a.indexOf(":")>=0),this._baseURI=a,e}return-1}bind(t,e){""==t||this._store.setPrefixForURI(t,e)}setKeywords(t){null==t?this.keywordsSet=0:(this.keywords=t,this.keywordsSet=1)}startDoc(){}endDoc(){return this.hasNil&&this._store.rdfFactory.supports.COLLECTIONS&&Z(this._store,this.source),this._formula}makeStatement(t){t[0].add(t[2],t[1],t[3],this.source),(t[2].uri&&t[2].uri===lt||t[3].uri&&t[3].uri===lt)&&(this.hasNil=!0),this.statementCount+=1}statement(t,e){var r=new et([]);if((e=this.object(t,e,r))<0)return e;var n=this.property_list(t,e,r[0]);if(n<0)throw _t(this._thisDoc,this.lines,t,e,"expected propertylist");return n}subject(t,e,r){return this.item(t,e,r)}verb(t,e,r){if((i=this.skipSpace(t,e))<0)return i;var n=new et([]);if((i=this.tok("has",t,e))>=0){if((e=this.prop(t,i,n))<0)throw _t(this._thisDoc,this.lines,t,i,"expected property after 'has'");return r.push(new tt(["->",n[0]])),e}if((i=this.tok("is",t,e))>=0){if((e=this.prop(t,i,n))<0)throw _t(this._thisDoc,this.lines,t,i,"expected <property> after 'is'");if((i=this.skipSpace(t,e))<0)throw _t(this._thisDoc,this.lines,t,e,"End of file found, expected property after 'is'");var i;if(e=i,(i=this.tok("of",t,e))<0)throw _t(this._thisDoc,this.lines,t,e,"expected 'of' after 'is' <prop>");return r.push(new tt(["<-",n[0]])),i}if((i=this.tok("a",t,e))>=0)return r.push(new tt(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==t.slice(e,e+2))return r.push(new tt(["<-",this._store.sym(K+"implies")])),e+2;if("="==t.slice(e,e+1))return">"==t.slice(e+1,e+2)?(r.push(new tt(["->",this._store.sym(K+"implies")])),e+2):(r.push(new tt(["->",this._store.sym(ht)])),e+1);if(":="==t.slice(e,e+2))return r.push(new tt(["->",K+"becomes"])),e+2;if((i=this.prop(t,e,n))>=0)return r.push(new tt(["->",n[0]])),i;if(">-"==t.slice(e,e+2)||"<-"==t.slice(e,e+2))throw _t(this._thisDoc,this.lines,t,i,">- ... -> syntax is obsolete.");return-1}prop(t,e,r){return this.item(t,e,r)}item(t,e,r){return this.path(t,e,r)}blankNode(t){return this._context.bnode(t,this._reason2)}path(t,e,r){if((s=this.nodeOrLiteral(t,e,r))<0)return s;for(;"!^.".indexOf(t.slice(s,s+1))>=0;){var n=t.slice(s,s+1);if("."==n){var i=t.slice(s+1,s+2);if(!i||pt.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var s,o=r.pop(),a=this.blankNode(this.here(s));if((s=this.node(t,s+1,r))<0)throw _t(this._thisDoc,this.lines,t,s,"EOF found in middle of path syntax");var c=r.pop();"^"==n?this.makeStatement(new tt([this._context,c,a,o])):this.makeStatement(new tt([this._context,c,o,a])),r.push(a)}return s}anonymousNode(t){if(e=this._anonymousNodes[t])return e;var e=this._store.bnode(t);return this._anonymousNodes[t]=e,e}node(t,e,r,n){void 0===n&&(n=null);var i=n;if((l=this.skipSpace(t,e))<0)return l;e=l;var s=t.slice(e,e+1);if("["==s){var o=this.here(e);if((l=this.skipSpace(t,e+1))<0)throw _t(this._thisDoc,this.lines,t,e,"EOF after '['");if("="==t.slice(l,l+1)){e=l+1;var a=new et([]);if(!((l=this.objectList(t,e,a))>=0))throw _t(this._thisDoc,this.lines,t,e,"objectList expected after [= ");if(i=a[0],nt(a)>1){var c=new ot(a);try{for(;;){var u=c.next();this.makeStatement(new tt([this._context,this._store.sym(ht),i,u]))}}catch(t){if(t!=st)throw t}}if((l=this.skipSpace(t,l))<0)throw _t(this._thisDoc,this.lines,t,e,"EOF when objectList expected after [ = ");if(";"==t.slice(l,l+1))var l=l+1}if(null==i&&(i=this.blankNode(o)),(e=this.property_list(t,l,i))<0)throw _t(this._thisDoc,this.lines,t,l,"property_list expected");if((l=this.skipSpace(t,e))<0)throw _t(this._thisDoc,this.lines,t,e,"EOF when ']' expected after [ <propertyList>");if("."==t.slice(l,l+1))return r.push(i),l;if("]"!=t.slice(l,l+1))throw _t(this._thisDoc,this.lines,t,l,"']' expected");return r.push(i),l+1}if("{"==s){if("$"==t.slice(e+1,e+2)){l=(e+=1)+1;for(var h=new et([]),f=!0;;){if((e=this.skipSpace(t,l))<0)throw _t(this._thisDoc,this.lines,t,e,"needed '$}', found end.");if("$}"==t.slice(e,e+2)){l=e+2;break}if(f)f=!1;else{if(","!=t.slice(e,e+1))throw _t(this._thisDoc,this.lines,t,e,"expected: ','");e+=1}var p=new et([]);if((l=this.item(t,e,p))<0)throw _t(this._thisDoc,this.lines,t,e,"expected item in set or '$}'");h.push(p[0])}return r.push(this._store.newSet(h,this._context)),l}l=e+1;var d=this._parentContext;this._parentContext=this._context;var y=this._anonymousNodes,g=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new rt([]),this._variables=this._variables.slice();var m=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((e=this.skipSpace(t,l))<0)throw _t(this._thisDoc,this.lines,t,e,"needed '}', found end.");if("}"==t.slice(e,e+1)){l=e+1;break}if((l=this.directiveOrStatement(t,e))<0)throw _t(this._thisDoc,this.lines,t,e,"expected statement or '}'")}return this._anonymousNodes=y,this._variables=this._parentVariables,this._parentVariables=g,this._context=this._parentContext,this._reason2=m,this._parentContext=d,r.push(i.close()),l}if("("==s){var b=this._store.list;for("$"==t.slice(e+1,e+2)&&(b=this._store.newSet,e+=1),l=e+1,h=new et([]);;){if((e=this.skipSpace(t,l))<0)throw _t(this._thisDoc,this.lines,t,e,"needed ')', found end.");if(")"==t.slice(e,e+1)){l=e+1;break}if(p=new et([]),(l=this.item(t,e,p))<0)throw _t(this._thisDoc,this.lines,t,e,"expected item in list or ')'");h.push(p[0])}return r.push(b(h,this._context)),l}if((l=this.tok("this",t,e))>=0)throw _t(this._thisDoc,this.lines,t,e,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(l=this.tok("true",t,e))>=0?(r.push(!0),l):(l=this.tok("false",t,e))>=0?(r.push(!1),l):null==i&&(l=this.uri_ref2(t,e,r))>=0?l:-1}property_list(t,e,r){for(;;){if((l=this.skipSpace(t,e))<0)throw _t(this._thisDoc,this.lines,t,e,"EOF found when expected verb in property list");if(":-"!=t.slice(l,l+2)){e=l;var n=new et([]);if((l=this.verb(t,e,n))<=0)return e;var i=new et([]);if((e=this.objectList(t,l,i))<0)throw _t(this._thisDoc,this.lines,t,l,"objectList expected");var s=new ot(i);try{for(;;){var o=s.next(),a=n[0],c=a[0],u=a[1];"->"==c?this.makeStatement(new tt([this._context,u,r,o])):this.makeStatement(new tt([this._context,u,o,r]))}}catch(t){if(t!=st)throw t}if((l=this.skipSpace(t,e))<0)throw _t(this._thisDoc,this.lines,t,l,"EOF found in list of objects");if(";"!=t.slice(e,e+1))return e;e+=1}else{e=l+2;var l,h=new et([]);if((l=this.node(t,e,h,r))<0)throw _t(this._thisDoc,this.lines,t,e,"bad {} or () or [] node after :- ");e=l}}}commaSeparatedList(t,e,r,n){if((i=this.skipSpace(t,e))<0)throw _t(this._thisDoc,this.lines,t,i,"EOF found expecting comma sep list");if("."==t.charAt(i))return e;if(n)var i=this.uri_ref2(t,i,r);else i=this.bareWord(t,i,r);if(i<0)return-1;for(;;){if((e=this.skipSpace(t,i))<0)return e;var s=t.slice(e,e+1);if(","!=s)return"."!=s?-1:e;if((i=n?this.uri_ref2(t,e+1,r):this.bareWord(t,e+1,r))<0)throw _t(this._thisDoc,this.lines,t,i,"bad list content")}}objectList(t,e,r){if((e=this.object(t,e,r))<0)return-1;for(;;){var n=this.skipSpace(t,e);if(n<0)throw _t(this._thisDoc,this.lines,t,n,"EOF found after object");if(","!=t.slice(n,n+1))return n;if((e=this.object(t,n+1,r))<0)return e}}checkDot(t,e){var r=this.skipSpace(t,e);if(r<0)return r;if("."==t.slice(r,r+1))return r+1;if("}"==t.slice(r,r+1))return r;if("]"==t.slice(r,r+1))return r;throw _t(this._thisDoc,this.lines,t,r,"expected '.' or '}' or ']' at end of statement")}uri_ref2(t,e,r){var n=new et([]);if((f=this.qname(t,e,n))>=0){var i=n[0],s=i[0],o=i[1];if(null==s){ct(0,"not used?");var a=this._baseURI+"#"}else if(!(a=this._bindings[s])){if("_"==s)return r.push(this.anonymousNode(o)),f;throw _t(this._thisDoc,this.lines,t,e,"Prefix "+s+" not bound.")}var c=this._store.sym(a+o);return L(this._variables,c)>=0?r.push(this._variables[c]):r.push(c),f}if((e=this.skipSpace(t,e))<0)return-1;if("?"==t.charAt(e)){var u=new et([]);return(f=this.variable(t,e,u))>0?(r.push(u[0]),f):-1}if("<"==t.charAt(e)){for(var l=e+=1;e<nt(t);){if(">"==t.charAt(e)){var h=t.slice(l,e);return this._baseURI?h=ut(this._baseURI,h):ct(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==t.slice(e-1,e)&&"#"!=it(h,-1,null)&&(h+="#"),c=this._store.sym(h),L(this._variables,c)>=0?r.push(this._variables[c]):r.push(c),e+1}e+=1}throw _t(this._thisDoc,this.lines,t,f,"unterminated URI reference")}if(this.keywordsSet){var f;if(u=new et([]),(f=this.bareWord(t,e,u))<0)return-1;if(L(this.keywords,u[0])>=0)throw _t(this._thisDoc,this.lines,t,e,'Keyword "'+u[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+u[0])),f}return-1}skipSpace(t,e){for(var r=e||0;r<t.length;r++){var n=t.charAt(r);if(" \n\r\t\f\v            ​\u2028\u2029 ".indexOf(n)<0){if("#"!==t.charAt(r))return r;for(;;r++){if(r===t.length)return-1;if("\n"===t.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===t.charAt(r)&&(this.lines=this.lines+1)}return-1}variable(t,e,r){if((n=this.skipSpace(t,e))<0)return-1;if("?"!=t.slice(n,n+1))return-1;var n;if(e=n+=1,"0123456789-".indexOf(t.charAt(n))>=0)throw _t(this._thisDoc,this.lines,t,n,"Varible name can't start with '"+t.charAt(n)+"s'");for(;e<nt(t)&&pt.indexOf(t.charAt(e))<0;)e+=1;if(null==this._parentContext)throw _t(this._thisDoc,this.lines,t,n,"Can't use ?xxx syntax for variable in outermost level: "+t.slice(n-1,e));return r.push(this._store.variable(t.slice(n,e))),e}bareWord(t,e,r){var n=this.skipSpace(t,e);if(n<0)return-1;var i=t.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(pt.indexOf(i)>=0)return-1;for(e=n;e<nt(t);){var s=t.charAt(e);if("."===s){if(wt(t,e))break}else if(pt.indexOf(s)>=0)break;e+=1}return r.push(t.slice(n,e)),e}qname(t,e,r){if((e=this.skipSpace(t,e))<0)return-1;var n=t.charAt(e);if("0123456789-+".indexOf(n)>=0)return-1;if(pt.indexOf(n)<0){var i=n;for(e+=1;e<nt(t);){if("."===(n=t.charAt(e))){if(wt(t,e))break}else if(pt.indexOf(n)>=0)break;i+=n,e+=1}}else i="";if(e<nt(t)&&":"==t.charAt(e)){var s=i;for(e+=1,i="";e<nt(t);){if("."===(n=t.charAt(e))){if(wt(t,e))break}else if(pt.indexOf(n)>=0)break;i+=n,e+=1}return r.push(new tt([s,i])),e}return i&&this.keywordsSet&&L(this.keywords,i)<0?(r.push(new tt(["",i])),e):-1}object(t,e,r){if((s=this.subject(t,e,r))>=0)return s;{if((s=this.skipSpace(t,e))<0)return-1;e=s;var n=null;let a=t.charAt(e);if('"'==a||"'"==a){n=t.slice(e,e+3==a+a)?a+a+a:a,e+=nt(n);var i=this.strconst(t,e,n),s=i[0],o=i[1];return r.push(this._store.literal(o)),s}return-1}}nodeOrLiteral(t,e,r){if((c=this.node(t,e,r))>=0)return c;if((c=this.skipSpace(t,e))<0)return-1;e=c;var n=t.charAt(e);if("-+0987654321".indexOf(n)>=0){if(yt.lastIndex=0,null!=(h=yt.exec(t.slice(e))))c=e+(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(dt.lastIndex=0,null==(h=dt.exec(t.slice(e))))throw _t(this._thisDoc,this.lines,t,e,"Bad number or date syntax");c=e+dt.lastIndex,(i=t.slice(e,c)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):t.slice(e,c).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 c}if('"'==t.charAt(e)){if('"""'==t.slice(e,e+3))var s='"""';else s='"';e+=nt(s);var o=null,a=this.strconst(t,e,s),c=a[0],u=a[1],l=null;if("@"==t.slice(c,c+1)){var h;if(bt.lastIndex=0,null==(h=bt.exec(t.slice(c+1))))throw _t(this._thisDoc,startline,t,e,"Bad language code syntax on string literal, after @");e=bt.lastIndex+c+1,l=t.slice(c+1,e),c=e}if("^^"==t.slice(c,c+2)){var f=new et([]);c=this.uri_ref2(t,c+2,f),o=f[0]}return r.push(this._store.literal(u,l||o)),c}return-1}strconst(t,e,r){for(var n=e,i="",s=this.lines;n<nt(t);){if(e=n+nt(r),t.slice(n,e)==r)return new tt([e,i]);if('"'!=t.charAt(n)){if(mt.lastIndex=0,!mt.exec(t.slice(n)))throw _t(this._thisDoc,s,t,n,"Closing quote missing in string at ^ in "+t.slice(n-20,n)+"^"+t.slice(n,n+20));if(e=n+mt.lastIndex-1,i+=t.slice(n,e),'"'!=(c=t.charAt(e)))if("\r"!=c){if("\n"==c){if('"'==r)throw _t(this._thisDoc,s,t,e,"newline found in string literal");this.lines=this.lines+1,i+=c,n=e+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==c){if(n=e+1,!(c=t.slice(n,n+1)))throw _t(this._thisDoc,s,t,e,"unterminated string literal (2)");var o=at('abfrtvn\\"',c);if(o>=0)i+='a\b\f\r\t\v\n\\"'.charAt(o),n+=1;else if("u"==c)n=(a=this.uEscape(t,n+1,s))[0],i+=c=a[1];else{if("U"!=c)throw _t(this._thisDoc,this.lines,t,e,"bad escape");var a,c;n=(a=this.UEscape(t,n+1,s))[0],i+=c=a[1]}}}else n=e+1;else n=e}else i=i+'"',n=n+1}throw _t(this._thisDoc,this.lines,t,e,"unterminated string literal")}uEscape(t,e,r){for(var n=e,i=0,s=0;i<4;){var o=t.slice(n,n+1).toLowerCase();if(n+=1,""==o)throw _t(this._thisDoc,r,t,e,"unterminated string literal(3)");var a=at("0123456789abcdef",o);if(a<0)throw _t(this._thisDoc,r,t,e,"bad string literal hex escape");s=16*s+a,i+=1}var c=String.fromCharCode(s);return new tt([n,c])}UEscape(t,e,r){for(var n=e,i=0,s="\\U";i<8;){var o=t.slice(n,n+1).toLowerCase();if(n+=1,""==o)throw _t(this._thisDoc,r,t,e,"unterminated string literal(3)");if(at("0123456789abcdef",o)<0)throw _t(this._thisDoc,r,t,e,"bad string literal hex escape");s+=o,i+=1}var a,c=(a="0x"+it(s,2,10)-0,String.fromCharCode(a));return new tt([n,c])}}function _t(t,e,r,n,i){let s=e+1,o="Line "+s+" of <"+t+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',a=new SyntaxError(o,t,s);return a.lineNo=s,a.characterInFile=n,a.syntaxProblem=i,a}const At={...T,supports:{[x.collections]:!0,[x.defaultGraphType]:!1,[x.equalsMethod]:!0,[x.identity]:!1,[x.id]:!0,[x.reversibleId]:!1,[x.variableType]:!0},collection:t=>new f(t),id(t){return(0,o.P3)(t)?`( ${t.elements.map((t=>this.id(t))).join(", ")} )`:(0,o.DZ)(t)?v.toString(t):T.id(t)},termToNQ:t=>t.termType===n.r0?f.toNT(t):T.termToNQ(t)},Tt=At;function Et(t,e){return"string"==typeof e?t.rdfFactory.literal(e):Object.prototype.hasOwnProperty.call(e,"@list")?!0===t.rdfFactory.supports.COLLECTIONS?function(t,e){if(!Array.isArray(e))throw new TypeError("Object must be an array");return t.rdfFactory.collection(e.map((e=>Et(t,e))))}(t,e["@list"]):function(t,e){const r=e["@id"]?Ot(t,e):t.rdfFactory.blankNode(),n=e["@list"].map((e=>Et(t,e))),i=M(t.rdfFactory,r,n);return t.addAll(i),r}(t,e):Object.prototype.hasOwnProperty.call(e,"@id")?Ot(t,e):Object.prototype.hasOwnProperty.call(e,"@language")?t.rdfFactory.literal(e["@value"],e["@language"]):Object.prototype.hasOwnProperty.call(e,"@type")?t.rdfFactory.literal(e["@value"],t.rdfFactory.namedNode(e["@type"])):Object.prototype.hasOwnProperty.call(e,"@value")?t.rdfFactory.literal(e["@value"]):t.rdfFactory.literal(e)}async function Nt(t,e,r){const n=r&&Object.prototype.hasOwnProperty.call(r,"termType")?r.value:r,i=await Promise.all([a.e(515),a.e(789)]).then(a.t.bind(a,8515,23));return(await i.default.flatten(JSON.parse(t),null,{base:n})).reduce(((t,e)=>jt(t,r,e)),e)}function Ot(t,e){return e["@id"].startsWith("_:")?t.rdfFactory.blankNode(e["@id"].substring(2)):t.rdfFactory.namedNode(e["@id"])}function jt(t,e,r){const n=r["@id"]?Ot(t,r):t.rdfFactory.blankNode();for(const i of Object.keys(r)){if("@id"===i)continue;if("@graph"==i){const e=n,s=r[i];for(let r=0;r<s.length;r++)t=jt(t,e,s[r])}const s=r[i];if(Array.isArray(s))for(let r=0;r<s.length;r++)t.addStatement(St(t,n,i,s[r],e));else t.addStatement(St(t,n,i,s,e))}return t}function St(t,e,r,n,i){let s,o;return"@type"===r?(s=t.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),o=t.rdfFactory.namedNode(n)):(s=t.rdfFactory.namedNode(r),o=Et(t,n)),t.rdfFactory.quad(e,s,o,t.rdfFactory.namedNode(i))}var Rt=a(2313),kt=a(5582),It=a.n(kt);const Ct="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Pt="http://www.w3.org/2001/XMLSchema#",Ft="http://www.w3.org/2000/10/swap/",Ut={xsd:{decimal:`${Pt}decimal`,boolean:`${Pt}boolean`,double:`${Pt}double`,integer:`${Pt}integer`,string:`${Pt}string`},rdf:{type:`${Ct}type`,nil:`${Ct}nil`,first:`${Ct}first`,rest:`${Ct}rest`,langString:`${Ct}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Ft}reify#forSome`,forAll:`${Ft}reify#forAll`},log:{implies:`${Ft}log#implies`}},{xsd:Dt}=Ut,Mt=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Lt={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Bt=/[\x00-\x20<>\\"\{\}\|\^\`]/,qt={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},$t=/$0^/;class Ht{constructor(t){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]*)?$/,t=t||{},this._lineMode=!!t.lineMode){this._n3Mode=!1;for(const t in this)!(t in qt)&&this[t]instanceof RegExp&&(this[t]=$t)}else this._n3Mode=!1!==t.n3;this.comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let r=this._input,n=r.length;for(;;){let t,o;for(;t=this._newline.exec(r);)this.comments&&(o=this._comment.exec(t[0]))&&i("comment",o[1],"",this._line,t[0].length),r=r.substr(t[0].length,r.length),n=r.length,this._line++;if(!t&&(t=this._whitespace.exec(r))&&(r=r.substr(t[0].length,r.length)),this._endOfFile.test(r))return e&&(this.comments&&(o=this._comment.exec(r))&&i("comment",o[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const a=this._line,c=r[0];let u="",l="",h="",f=null,p=0,d=!1;switch(c){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(p=1,u="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){d=!0;break}case"<":if(f=this._unescapedIri.exec(r))u="IRI",l=f[1];else if(f=this._iri.exec(r)){if(l=this._unescape(f[1]),null===l||Bt.test(l))return s(this);u="IRI"}else r.length>1&&"<"===r[1]?(u="<<",p=2):this._n3Mode&&r.length>1&&"="===r[1]&&(u="inverse",p=2,l=">");break;case">":r.length>1&&">"===r[1]&&(u=">>",p=2);break;case"_":((f=this._blank.exec(r))||e&&(f=this._blank.exec(`${r} `)))&&(u="blank",h="_",l=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(r))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(r)),null===l)return s(this);null===f&&0===p||(u="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(r))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(r)),null===l)return s(this);null===f&&0===p||(u="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(r))&&(u="var",l=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(r))?(u="langcode",l=f[1]):(f=this._keyword.exec(r))&&(u=f[0]);break;case".":if(1===r.length?e:r[1]<"0"||r[1]>"9"){u=".",p=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(r)||e&&(f=this._number.exec(`${r} `)))&&(u="literal",l=f[0],h="string"==typeof f[1]?Dt.double:"string"==typeof f[2]?Dt.decimal:Dt.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(r))?u=f[0].toUpperCase():d=!0;break;case"f":case"t":(f=this._boolean.exec(r))?(u="literal",l=f[0],h=Dt.boolean):d=!0;break;case"a":(f=this._shortPredicates.exec(r))?(u="abbreviation",l="a"):d=!0;break;case"=":this._n3Mode&&r.length>1&&(u="abbreviation",">"!==r[1]?(p=1,l="="):(p=2,l=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(p=1,u=c);break;case"{":!this._lineMode&&r.length>=2&&("|"===r[1]?(u="{|",p=2):(u=c,p=1));break;case"|":r.length>=2&&"}"===r[1]&&(u="|}",p=2);break;default:d=!0}if(d&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(r))?((f=this._prefixed.exec(r))||e&&(f=this._prefixed.exec(`${r} `)))&&(u="prefixed",h=f[1]||"",l=this._unescape(f[2])):(u="prefix",l=f[1]||"")),"^^"===this._previousMarker)switch(u){case"prefixed":u="type";break;case"IRI":u="typeIRI";break;default:u=""}if(!u)return e||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?s(this):this._input=r;const y=p||f[0].length,g=i(u,l,h,a,y);this.previousToken=g,this._previousMarker=u,r=r.substr(y,r.length)}function i(e,i,s,o,a){const c=r?n-r.length:n,u={type:e,value:i,prefix:s,line:o,start:c,end:c+a};return t(null,u),u}function s(e){t(e._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(t){let e=!1;const r=t.replace(Mt,((t,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let t=Number.parseInt(n,16);return t<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}return i in Lt?Lt[i]:(e=!0,"")}));return e?null:r}_parseLiteral(t){if(t.length>=3){const e=t.match(/^(?:"""|"|'''|'|)/)[0],r=e.length;let n=Math.max(this._literalClosingPos,r);for(;(n=t.indexOf(e,n))>0;){let e=0;for(;"\\"===t[n-e-1];)e++;if(e%2==0){const e=t.substring(r,n),i=e.split(/\r\n|\r|\n/).length-1,s=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(e),matchLength:s}}n++}this._literalClosingPos=t.length-r+1}return{value:"",matchLength:0}}_syntaxError(t){this._input=null;const e=new Error(`Unexpected "${t}" on line ${this._line}.`);return e.context={token:void 0,line:this._line,previousToken:this.previousToken},e}_readStartingBom(t){return t.startsWith("\ufeff")?t.substr(1):t}tokenize(t,e){if(this._line=1,"string"==typeof t){if(this._input=this._readStartingBom(t),"function"!=typeof e){const t=[];let e;if(this._tokenizeToEnd(((r,n)=>r?e=r:t.push(n)),!0),e)throw e;return t}It()((()=>this._tokenizeToEnd(e,!0)))}else this._pendingBuffer=null,"function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",(t=>{null!==this._input&&0!==t.length&&(this._pendingBuffer&&(t=Rt.hp.concat([this._pendingBuffer,t]),this._pendingBuffer=null),128&t[t.length-1]?this._pendingBuffer=t:(void 0===this._input?this._input=this._readStartingBom("string"==typeof t?t:t.toString()):this._input+=t,this._tokenizeToEnd(e,!1)))})),t.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(e,!0)})),t.on("error",e)}}const{rdf:zt,xsd:Xt}=Ut;let Vt,Gt=0;const Qt={namedNode:ee,blankNode:re,variable:ie,literal:ne,defaultGraph:function(){return Vt},quad:se,triple:se,fromTerm:oe,fromQuad:ae};class Wt{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof Wt?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class Jt extends Wt{get termType(){return"NamedNode"}}class Yt extends Wt{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let e=t.lastIndexOf('"')+1;return e<t.length&&"@"===t[e++]?t.substr(e).toLowerCase():""}get datatype(){return new Jt(this.datatypeString)}get datatypeString(){const t=this.id,e=t.lastIndexOf('"')+1,r=e<t.length?t[e]:"";return"^"===r?t.substr(e+2):"@"!==r?Xt.string:zt.langString}equals(t){return t instanceof Yt?this.id===t.id:!!t&&!!t.datatype&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&this.datatype.value===t.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class Zt extends Wt{constructor(t){super(`_:${t}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class Kt extends Wt{constructor(t){super(`?${t}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}Vt=new class extends Wt{constructor(){return super(""),Vt||this}get termType(){return"DefaultGraph"}equals(t){return this===t||!!t&&this.termType===t.termType}};class te extends Wt{constructor(t,e,r,n){super(""),this._subject=t,this._predicate=e,this._object=r,this._graph=n||Vt}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(t){return!!t&&this._subject.equals(t.subject)&&this._predicate.equals(t.predicate)&&this._object.equals(t.object)&&this._graph.equals(t.graph)}}function ee(t){return new Jt(t)}function re(t){return new Zt(t||"n3-"+Gt++)}function ne(t,e){if("string"==typeof e)return new Yt(`"${t}"@${e.toLowerCase()}`);let r=e?e.value:"";return""===r&&("boolean"==typeof t?r=Xt.boolean:"number"==typeof t&&(Number.isFinite(t)?r=Number.isInteger(t)?Xt.integer:Xt.double:(r=Xt.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),""===r||r===Xt.string?new Yt(`"${t}"`):new Yt(`"${t}"^^${r}`)}function ie(t){return new Kt(t)}function se(t,e,r,n){return new te(t,e,r,n)}function oe(t){if(t instanceof Wt)return t;switch(t.termType){case"NamedNode":return ee(t.value);case"BlankNode":return re(t.value);case"Variable":return ie(t.value);case"DefaultGraph":return Vt;case"Literal":return ne(t.value,t.language||t.datatype);case"Quad":return ae(t);default:throw new Error(`Unexpected termType: ${t.termType}`)}}function ae(t){if(t instanceof te)return t;if("Quad"!==t.termType)throw new Error(`Unexpected termType: ${t.termType}`);return se(oe(t.subject),oe(t.predicate),oe(t.object),oe(t.graph))}let ce=0;class ue{constructor(t){this._contextStack=[],this._graph=null,t=t||{},this._setBase(t.baseIRI),t.factory&&he(this,t.factory);const e="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(e),n=/trig/.test(e),i=/triple/.test(e),s=/quad/.test(e),o=this._n3Mode=/n3/.test(e),a=i||s;(this._supportsNamedGraphs=!(r||o))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||o),this._supportsRDFStar=""===e||/star|\*$/.test(e),a&&(this._resolveRelativeIRI=t=>null),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new Ht({lineMode:a,n3:o}),this._explicitQuantifiers=!!t.explicitQuantifiers}static _resetBlankNodePrefix(){ce=0}_setBase(t){if(t){const e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base="",this._basePath=""}_saveContext(t,e,r,n,i){const s=this._n3Mode;this._contextStack.push({type:t,subject:r,predicate:n,object:i,graph:e,inverse:!!s&&this._inversePredicate,blankPrefix:s?this._prefixes._:"",quantified:s?this._quantified:null}),s&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(t,e){const r=this._contextStack.pop();if(!r||r.type!==t)return this._error(`Unexpected ${e.type}`,e);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(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(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(t)}}_readEntity(t,e){let r;switch(t.type){case"IRI":case"typeIRI":const e=this._resolveIRI(t.value);if(null===e)return this._error("Invalid IRI",t);r=this._factory.namedNode(e);break;case"type":case"prefixed":const n=this._prefixes[t.prefix];if(void 0===n)return this._error(`Undefined prefix "${t.prefix}:"`,t);r=this._factory.namedNode(n+t.value);break;case"blank":r=this._factory.blankNode(this._prefixes[t.prefix]+t.value);break;case"var":r=this._factory.variable(t.value.substr(1));break;default:return this._error(`Expected entity but got ${t.type}`,t)}return!e&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(t){switch(this._predicate=null,t.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.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._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",t);case"}":return this._readPunctuation(t);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',t);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',t);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",t);if(0===t.prefix.length)return this._literalValue=t.value,this._completeSubjectLiteral;this._subject=this._factory.literal(t.value,this._factory.namedNode(t.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",t);default:if(void 0===(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(t){const e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[t.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${e}`,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",t);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",t);default:if(void 0===(this._predicate=this._readEntity(t)))return}return this._readObject}_readObject(t){switch(t.type){case"literal":if(0===t.prefix.length)return this._literalValue=t.value,this._readDataTypeOrLang;this._object=this._factory.literal(t.value,this._factory.namedNode(t.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.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._factory.blankNode()),this._readSubject):this._error("Unexpected graph",t);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",t);default:if(void 0===(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)}_readGraph(t){return"{"!==t.type?this._error(`Expected graph but got ${t.type}`,t):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))}_readBlankNodeTail(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const e=null===this._predicate;return this._restoreContext("blank",t),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(t){switch(t.type){case".":case"}":return this._subject=null,this._readPunctuation(t);default:return this._readPredicate(t)}}_readListItem(t){let e=null,r=null,n=this._readListItem;const i=this._subject,s=this._contextStack,o=s[s.length-1];switch(t.type){case"[":this._saveContext("blank",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this._subject=e=this._factory.blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",t),0!==s.length&&"list"===s[s.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===t.prefix.length?(this._literalValue=t.value,n=this._readListItemDataTypeOrLang):(e=this._factory.literal(t.value,this._factory.namedNode(t.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",t);default:if(void 0===(e=this._readEntity(t)))return}if(null===r&&(this._subject=r=this._factory.blankNode()),null===i?null===o.predicate?o.subject=r:o.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,e,this._graph)}return n}_readDataTypeOrLang(t){return this._completeObjectLiteral(t,!1)}_readListItemDataTypeOrLang(t){return this._completeObjectLiteral(t,!0)}_completeLiteral(t){let e=this._factory.literal(this._literalValue);switch(t.type){case"type":case"typeIRI":const r=this._readEntity(t);if(void 0===r)return;e=this._factory.literal(this._literalValue,r),t=null;break;case"langcode":e=this._factory.literal(this._literalValue,t.value),t=null}return{token:t,literal:e}}_completeSubjectLiteral(t){return this._subject=this._completeLiteral(t).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(t,e){const r=this._completeLiteral(t);if(r)return this._object=r.literal,e&&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(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",t),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(t){let e,r=this._graph;const n=this._subject,i=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",t);const s=this._predicate,o=this._object;this._subject=this._factory.quad(n,s,o,this.DEFAULTGRAPH),e=this._readPredicate;break;case"|}":if("Quad"!==this._subject.termType)return this._error("Unexpected asserted triple closing",t);this._subject=null,e=this._readPunctuation;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}if(null!==n){const t=this._predicate,e=this._object;i?this._emit(e,t,n,r):this._emit(n,t,e,r)}return e}_readBlankNodePunctuation(t){let e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}return this._emit(this._subject,this._predicate,this._object,this._graph),e}_readQuadPunctuation(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext}_readPrefix(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)}_readPrefixIRI(t){if("IRI"!==t.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,t);const e=this._readEntity(t);return this._prefixes[this._prefix]=e.value,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation}_readBaseIRI(t){const e="IRI"===t.type&&this._resolveIRI(t.value);return e?(this._setBase(e),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",t)}_readNamedGraphLabel(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}}_readNamedGraphBlankLabel(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext}_readQuantifierList(t){let e;switch(t.type){case"IRI":case"prefixed":if(void 0!==(e=this._readEntity(t,!0)))break;default:return this._error(`Unexpected ${t.type}`,t)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,e,this.QUANTIFIERS_GRAPH)):this._quantified[e.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(t){return","===t.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(t))}_getPathReader(t){return this._afterPath=t,this._readPath}_readPath(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const e=this._contextStack,r=e.length&&e[e.length-1];if(r&&"item"===r.type){const e=this._subject;this._restoreContext("item",t),this._emit(this._subject,this.RDF_FIRST,e,this._graph)}return this._afterPath(t)}}_readForwardPath(t){let e,r;const n=this._factory.blankNode();if(void 0!==(r=this._readEntity(t)))return null===this._predicate?(e=this._subject,this._subject=n):(e=this._object,this._object=n),this._emit(e,r,n,this._graph),this._readPath}_readBackwardPath(t){const e=this._factory.blankNode();let r,n;if(void 0!==(r=this._readEntity(t)))return null===this._predicate?(n=this._subject,this._subject=e):(n=this._object,this._object=e),this._emit(e,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(t){return">>"!==t.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(t))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,t):this._readRDFStarTail(t)}_readRDFStarTail(t){if(">>"!==t.type)return this._error(`Expected >> but got ${t.type}`,t);const e=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",t),null===this._subject?(this._subject=e,this._readPredicate):(this._object=e,this._getContextEndReader())}_getContextEndReader(){const t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(t,e,r,n){this._callback(null,this._factory.quad(t,e,r,n||this.DEFAULTGRAPH))}_error(t,e){const r=new Error(`${t} on line ${e.line}.`);r.context={token:e,line:e.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=le}_resolveIRI(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)?t:this._resolveRelativeIRI(t)}_resolveRelativeIRI(t){if(!t.length)return this._base;switch(t[0]){case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return/^[^/:]*:/.test(t)?null:this._removeDotSegments(this._basePath+t)}}_removeDotSegments(t){if(!/(^|\/)\.\.?($|[/#?])/.test(t))return t;const e=t.length;let r="",n=-1,i=-1,s=0,o="/";for(;n<e;){switch(o){case":":if(i<0&&"/"===t[++n]&&"/"===t[++n])for(;(i=n+1)<e&&"/"!==t[i];)n=i;break;case"?":case"#":n=e;break;case"/":if("."===t[n+1])switch(o=t[1+ ++n],o){case"/":r+=t.substring(s,n-1),s=n+1;break;case void 0:case"?":case"#":return r+t.substring(s,n)+t.substr(n+1);case".":if(o=t[1+ ++n],void 0===o||"/"===o||"?"===o||"#"===o){if(r+=t.substring(s,n-2),(s=r.lastIndexOf("/"))>=i&&(r=r.substr(0,s)),"/"!==o)return`${r}/${t.substr(n+1)}`;s=n+1}}}o=t[++n]}return r+t.substring(s)}parse(t,e,r){let n,i,s;if(e&&(e.onQuad||e.onPrefix||e.onComment)?(n=e.onQuad,i=e.onPrefix,s=e.onComment):(n=e,i=r),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${ce++}_`,this._prefixCallback=i||le,this._inversePredicate=!1,this._quantified=Object.create(null),!n){const e=[];let r;if(this._callback=(t,n)=>{t?r=t:n&&e.push(n)},this._lexer.tokenize(t).every((t=>this._readCallback=this._readCallback(t))),r)throw r;return e}let o=(t,e)=>{null!==t?(this._callback(t),this._callback=le):this._readCallback&&(this._readCallback=this._readCallback(e))};s&&(this._lexer.comments=!0,o=(t,e)=>{null!==t?(this._callback(t),this._callback=le):this._readCallback&&("comment"===e.type?s(e.value):this._readCallback=this._readCallback(e))}),this._callback=n,this._lexer.tokenize(t,o)}}function le(){}function he(t,e){t._factory=e,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=e.namedNode(Ut.rdf.first),t.RDF_REST=e.namedNode(Ut.rdf.rest),t.RDF_NIL=e.namedNode(Ut.rdf.nil),t.N3_FORALL=e.namedNode(Ut.r.forAll),t.N3_FORSOME=e.namedNode(Ut.r.forSome),t.ABBREVIATIONS={a:e.namedNode(Ut.rdf.type),"=":e.namedNode(Ut.owl.sameAs),">":e.namedNode(Ut.log.implies)},t.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}he(ue.prototype,Qt);var fe=a(6357);if(void 0===pe)var pe={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 de{constructor(t,e){this.options=e||{},this.kb=t,this.target=e.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(t,e,r,n){var i,s,o,a;i=void 0===e?T.namedNode(this.options.base):this.toRDFNodeObject(e),o=this.toRDFNodeObject(r),s=this.toRDFNodeObject(n),a=T.namedNode(this.options.base),this.kb.add(i,o,s,a)}ancestorPath(t){for(var e="";t&&t.nodeType!==pe.DOCUMENT_NODE;)e="/"+t.localName+e,t=t.parentNode;return e}copyMappings(t){var e={};for(var r in t)e[r]=t[r];return e}copyProperties(){}deriveDateTimeType(t){for(var e=0;e<de.dateTimeTypes.length;e++){var r=de.dateTimeTypes[e].pattern.exec(t);if(r&&r[0].length===t.length)return de.dateTimeTypes[e].type}return null}init(){}newBlankNode(){return this.blankCounter++,"_:"+this.blankCounter}newSubjectOrigin(t,e){}parseCURIE(t,e,r){var n,i=t.indexOf(":");if(i>=0){var s=t.substring(0,i);if(""===s)return(n=e[""])?n+t.substring(i+1):null;if("_"===s)return"_:"+t.substring(i+1);if(de.NCNAME.test(s)&&(n=e[s]))return n+t.substring(i+1)}return null}parseCURIEOrURI(t,e,r){return this.parseCURIE(t,e,r)||this.resolveAndNormalize(r,t)}parsePredicate(t,e,r,n,i,s){if(""===t)return null;var o=this.parseTermOrCURIEOrAbsURI(t,e,s?null:r,n,i);return o&&0===o.indexOf("_:")?null:o}parsePrefixMappings(t,e){for(var r=this.tokenize(t),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(e[n]=this.options.base?w.join(r[i],this.options.base):r[i],n=null)}static parseRDFaDOM(t,e,r){var n=new de(e,{base:r});t.baseURI||(t.baseURI=r),n.process(t,{baseURI:r})}parseSafeCURIEOrCURIEOrURI(t,e,r){return"["===(t=this.trim(t)).charAt(0)&&"]"===t.charAt(t.length-1)?0===(t=(t=t.substring(1,t.length-1)).trim(t)).length?null:"_:"===t?this.theOne:this.parseCURIE(t,e,r):this.parseCURIEOrURI(t,e,r)}parseTermOrCURIEOrAbsURI(t,e,r,n,i){t=this.trim(t);var s=this.parseCURIE(t,n,i);if(s)return s;if(r){if(e&&!this.absURIRE.exec(t))return e+t;var o=r[t];if(o)return o;if(o=r[t.toLowerCase()])return o}return this.absURIRE.exec(t)?this.resolveAndNormalize(i,t):null}parseTermOrCURIEOrURI(t,e,r,n,i){t=this.trim(t);var s=this.parseCURIE(t,n,i);if(s)return s;var o=r[t];return o||((o=r[t.toLowerCase()])?o:e&&!this.absURIRE.exec(t)?e+t:this.resolveAndNormalize(i,t))}parseURI(t){return t}process(t,e){var r;e=e||{},t.nodeType===pe.DOCUMENT_NODE?(t.baseURI&&!e.baseURI&&(e.baseURI=t.baseURI),r=t.baseURI,(t=t.documentElement).baseURI||(t.baseURI=r),this.setContext(t)):t.parentNode.nodeType===pe.DOCUMENT_NODE&&this.setContext(t);var n=[],i=function(t){if(!t&&e&&e.baseURI)return e.baseURI;var r=t.indexOf("#");return r>=0&&(t=t.substring(0,r)),e&&e.baseURIMap&&(t=e.baseURIMap(t)),t};for(n.push({current:t,context:this.push(null,i(t.baseURI))});n.length>0;){var s=n.shift();if(s.parent){if(s.context.parent&&s.context.parent.listMapping===s.listMapping)continue;for(let t in s.listMapping){var o=s.listMapping[t];if(0!==o.length){var a=[];for(let t=0;t<o.length;t++)a.push(this.newBlankNode());for(let t=0;t<a.length;t++)this.addTriple(s.parent,a[t],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",o[t]),this.addTriple(s.parent,a[t],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:de.objectURI,value:t+1<a.length?a[t+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(s.parent,s.subject,t,{type:de.objectURI,value:a[0]})}else this.addTriple(s.parent,s.subject,t,{type:de.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var c=s.current,u=s.context,l=!1,h=null,f=null,p=null,d=u.prefixes,y=!1,g=[],m=u.listMapping,b=!u.parent,v=u.language,x=u.vocabulary;r=this.parseURI(i(c.baseURI)),c.item=null;var _=c.getAttributeNode("vocab");if(_){let t=this.trim(_.value);if(t.length>0){x=t;var A=r.spec;this.addTriple(c,A,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:de.objectURI,value:x})}else x=this.vocabulary}for(var T=0;T<c.attributes.length;T++){var E=c.attributes[T];if("x"===E.nodeName.charAt(0)&&0===E.nodeName.indexOf("xmlns:")){y||(d=this.copyMappings(d),y=!0);var N=E.nodeName.substring(6),O=de.trim(E.value);d[N]=this.options.base?w.join(O,this.options.base):O}}var j=c.getAttributeNode("prefix");j&&(y||(d=this.copyMappings(d),y=!0),this.parsePrefixMappings(j.value,d));var S=null;for(let t=0;!S&&t<this.langAttributes.length;t++)S=c.getAttributeNodeNS(this.langAttributes[t].namespaceURI,this.langAttributes[t].localName);if(S){let t=de.trim(S.value);v=t.length>0?t:null}var R,k,I=c.getAttributeNode("rel"),C=c.getAttributeNode("rev"),P=c.getAttributeNode("typeof"),F=c.getAttributeNode("property"),U=c.getAttributeNode("datatype"),D=this.inHTMLMode?c.getAttributeNode("datetime"):null,M=c.getAttributeNode("content"),L=c.getAttributeNode("about"),B=c.getAttributeNode("src"),q=c.getAttributeNode("resource"),$=c.getAttributeNode("href"),H=c.getAttributeNode("inlist"),z=[];if(I){k=this.tokenize(I.value);for(let t=0;t<k.length;t++)(R=this.parsePredicate(k[t],x,u.terms,d,r,this.inHTMLMode&&null!==F))&&z.push(R)}var X=[];if(C){k=this.tokenize(C.value);for(let t=0;t<k.length;t++)(R=this.parsePredicate(k[t],x,u.terms,d,r,this.inHTMLMode&&F))&&X.push(R)}if(this.inHTMLMode&&(I||C)&&F&&(0===z.length&&(I=null),0===X.length&&(C=null)),I||C?(L&&(h=this.parseSafeCURIEOrCURIEOrURI(L.value,d,r)),P&&(p=h),h||(c.parentNode.nodeType===pe.DOCUMENT_NODE?h=i(c.baseURI):u.parentObject&&(h=i(c.parentNode.baseURI)===u.parentObject?i(c.baseURI):u.parentObject)),q&&(f=this.parseSafeCURIEOrCURIEOrURI(q.value,d,r)),f||($?f=this.resolveAndNormalize(r,encodeURI($.value)):B?f=this.resolveAndNormalize(r,encodeURI(B.value)):!P||L||this.inXHTMLMode&&("head"===c.localName||"body"===c.localName)||(f=this.newBlankNode())),!P||L||!this.inXHTMLMode||"head"!==c.localName&&"body"!==c.localName?P&&!L&&(p=f):p=h):!F||M||U?(L&&(h=this.parseSafeCURIEOrCURIEOrURI(L.value,d,r)),!h&&q&&(h=this.parseSafeCURIEOrCURIEOrURI(q.value,d,r)),!h&&$&&(h=this.resolveAndNormalize(r,encodeURI($.value))),!h&&B&&(h=this.resolveAndNormalize(r,encodeURI(B.value))),h||(c.parentNode.nodeType===pe.DOCUMENT_NODE?h=i(c.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==c.localName&&"body"!==c.localName?P?h=this.newBlankNode():u.parentObject&&(h=i(c.parentNode.baseURI)===u.parentObject?i(c.baseURI):u.parentObject,F||(l=!0)):h=i(c.parentNode.baseURI)===u.parentObject?i(c.baseURI):u.parentObject),P&&(p=h)):(L&&(h=this.parseSafeCURIEOrCURIEOrURI(L.value,d,r),P&&(p=h)),h||c.parentNode.nodeType!==pe.DOCUMENT_NODE?!h&&u.parentObject&&(h=i(c.parentNode.baseURI)===u.parentObject?i(c.baseURI):u.parentObject):(h=i(c.baseURI),P&&(p=h)),P&&!p&&(q&&(p=this.parseSafeCURIEOrCURIEOrURI(q.value,d,r)),!p&&$&&(p=this.resolveAndNormalize(r,encodeURI($.value))),!p&&B&&(p=this.resolveAndNormalize(r,encodeURI(B.value))),p||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==c.localName&&"body"!==c.localName||(p=h),p||(p=this.newBlankNode()),f=p)),h&&(L||q||p)){var V=h;P&&!L&&!q&&f&&(V=f),this.newSubjectOrigin(c,V)}if(p){k=this.tokenize(P.value);for(let t=0;t<k.length;t++){var G=this.parseTermOrCURIEOrAbsURI(k[t],x,u.terms,d,r);G&&this.addTriple(c,p,de.typeURI,{type:de.objectURI,value:G})}}if(h&&h!==u.parentObject&&(m={},b=!0),f){if(I&&H)for(let t=0;t<z.length;t++){let e=m[z[t]];e||(e=[],m[z[t]]=e),e.push({type:de.objectURI,value:f})}else if(I)for(let t=0;t<z.length;t++)this.addTriple(c,h,z[t],{type:de.objectURI,value:f});if(C)for(let t=0;t<X.length;t++)this.addTriple(c,f,X[t],{type:de.objectURI,value:h})}else{if(h&&!f&&(I||C)&&(f=this.newBlankNode()),I&&H)for(let t=0;t<z.length;t++){let e=m[z[t]];e||(e=[],m[R]=e),g.push({predicate:z[t],list:e})}else if(I)for(let t=0;t<z.length;t++)g.push({predicate:z[t],forward:!0});if(C)for(let t=0;t<X.length;t++)g.push({predicate:X[t],forward:!1})}if(F){var Q=null,W=null;U?(Q=""===U.value?de.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(U.value,x,u.terms,d,r),W=D&&!M?D.value:Q===de.XMLLiteralURI||Q===de.HTMLLiteralURI?null:M?M.value:c.textContent):M?(Q=de.PlainLiteralURI,W=M.value):D?(W=D.value,(Q=de.deriveDateTimeType(W))||(Q=de.PlainLiteralURI)):I||C||(q&&(W=this.parseSafeCURIEOrCURIEOrURI(q.value,d,r)),!W&&$?W=this.resolveAndNormalize(r,encodeURI($.value)):!W&&B&&(W=this.resolveAndNormalize(r,encodeURI(B.value))),W&&(Q=de.objectURI)),Q||(P&&!L?(Q=de.objectURI,W=p):(W=c.textContent,this.inHTMLMode&&"time"===c.localName&&(Q=de.deriveDateTimeType(W)),Q||(Q=de.PlainLiteralURI))),k=this.tokenize(F.value);for(let t=0;t<k.length;t++){let e=this.parsePredicate(k[t],x,u.terms,d,r);if(e)if(H){let t=m[e];t||(t=[],m[e]=t),t.push(Q===de.XMLLiteralURI||Q===de.HTMLLiteralURI?{type:Q,value:c.childNodes}:{type:Q||de.PlainLiteralURI,value:W,language:v})}else Q===de.XMLLiteralURI||Q===de.HTMLLiteralURI?this.addTriple(c,h,e,{type:Q,value:c.childNodes}):this.addTriple(c,h,e,{type:Q||de.PlainLiteralURI,value:W,language:v})}}if(h&&!l)for(let t=0;t<u.incomplete.length;t++)u.incomplete[t].list?u.incomplete[t].list.push({type:de.objectURI,value:h}):u.incomplete[t].forward?this.addTriple(c,u.subject,u.incomplete[t].predicate,{type:de.objectURI,value:h}):this.addTriple(c,h,u.incomplete[t].predicate,{type:de.objectURI,value:u.subject});var J=null,Y=h;l?((J=this.push(u,u.subject)).parentObject=i(c.parentNode.baseURI)===u.parentObject?i(c.baseURI):u.parentObject,J.incomplete=u.incomplete,J.language=v,J.prefixes=d,J.vocabulary=x):((J=this.push(u,h)).parentObject=f||h||u.subject,J.prefixes=d,J.incomplete=g,f&&(Y=f,m={},b=!0),J.listMapping=m,J.language=v,J.vocabulary=x),b&&n.unshift({parent:c,context:u,subject:Y,listMapping:m});for(var Z=c.lastChild;Z;Z=Z.previousSibling)Z.nodeType===pe.ELEMENT_NODE&&n.unshift({current:Z,context:J})}}this.inHTMLMode&&this.copyProperties();for(let e=0;e<this.finishedHandlers.length;e++)this.finishedHandlers[e](t)}push(t,e){return{parent:t,subject:e||(t?t.subject:null),parentObject:null,incomplete:[],listMapping:t?t.listMapping:{},language:t?t.language:this.language,prefixes:t?t.prefixes:this.target.graph.prefixes,terms:t?t.terms:this.target.graph.terms,vocabulary:t?t.vocabulary:this.vocabulary}}resolveAndNormalize(t,e){return w.join(e,t)}setContext(t){"html"===t.localName&&"XHTML+RDFa 1.1"===t.getAttribute("version")?this.setXHTMLContext():"html"===t.localName||"http://www.w3.org/1999/xhtml"===t.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?(fe.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(t){return this.trim(t).split(/\s+/)}static tokenize(t){return this.trim(t).split(/\s+/)}toRDFNodeObject(t){if(void 0!==t){if("string"==typeof t)return"_:"===t.substring(0,2)?(void 0===this.blankNodes[t.substring(2)]&&(this.blankNodes[t.substring(2)]=new i(t.substring(2))),this.blankNodes[t.substring(2)]):T.namedNode(t);switch(t.type){case de.objectURI:return"_:"===t.value.substring(0,2)?(void 0===this.blankNodes[t.value.substring(2)]&&(this.blankNodes[t.value.substring(2)]=new i(t.value.substring(2))),this.blankNodes[t.value.substring(2)]):T.namedNode(t.value);case de.PlainLiteralURI:return new l(t.value,t.language||"");case de.XMLLiteralURI:case de.HTMLLiteralURI:var e="";return Object.keys(t.value).forEach((r=>{e+=O.domToString(t.value[r],this.htmlOptions)})),new l(e,"",new s.A(t.type));default:return new l(t.value,"",new s.A(t.type))}}}trim(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}static trim(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}de.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",de.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",de.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",de.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",de.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",de.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",de.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",de.NCNAME=new RegExp("^"+de.nameStartChar+de.nameChar+"*$"),de.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 ye=de.parseRDFaDOM;class ge{constructor(t){this.store=t,this.bnodes={},this.why=null,this.reify=!1}frameFactory(t,e,r){return{NODE:1,ARC:2,parent:e,parser:t,store:t.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(t,e){e=w.join(e,this.base),this.node=this.store.sym(e),this.nodeType=t},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 t=this.store.sym(w.join("#"+this.parent.rdfid,this.base));this.store.add(t,this.store.sym(ge.ns.RDF+"type"),this.store.sym(ge.ns.RDF+"Statement"),this.parser.why),this.store.add(t,this.store.sym(ge.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(t,this.store.sym(ge.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(t,this.store.sym(ge.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(t){this.addSymbol(this.NODE,t),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(t){null!=t?null!=this.parser.bnodes[t]?this.node=this.parser.bnodes[t]:this.node=this.parser.bnodes[t]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(t){t===ge.ns.RDF+"li"&&(t=ge.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,t)},addLiteral:function(t){this.parent.datatype&&this.parent.datatype!==ge.ns.RDF+"langString"?this.node=this.store.literal(t,this.store.sym(this.parent.datatype)):this.node=this.store.literal(t,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}getAttributeNodeNS(t,e,r){var n=null;if(t.getAttributeNodeNS)n=t.getAttributeNodeNS(e,r);else for(var i,s=t.attributes,o=0;o<s.length;++o)if((i=s[o]).namespaceURI===e&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}parse(t,e,r){var n,i=t.childNodes;if(this.cleanParser(),t.nodeType===ge.nodeType.DOCUMENT){for(var s=0;s<i.length;s++)if(i[s].nodeType===ge.nodeType.ELEMENT){n=i[s];break}}else{if(t.nodeType!==ge.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+e+". Halting. ");n=t}this.why=r;var o=this.frameFactory(this);return this.base=e,o.base=e,o.lang=null,this.parseDOM(this.buildFrame(o,n)),!0}parseDOM(t){for(var e,r=function(t){var e="";if(null==t.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+t.localName+" in "+this.base);return t.namespaceURI&&(e+=t.namespaceURI),t.localName?e+=t.localName:t.nodeName&&(t.nodeName.indexOf(":")>=0?e+=t.nodeName.split(":")[1]:e+=t.nodeName),e}.bind(this),n=!0;t.parent;){var i=t.element,s=i.attributes;if(i.nodeType===ge.nodeType.TEXT||i.nodeType===ge.nodeType.CDATA_SECTION)t.parent.nodeType===t.NODE&&(t.addArc(ge.ns.RDF+"value"),t=this.buildFrame(t)),t.addLiteral(i.nodeValue);else if(r(i)!==ge.ns.RDF+"RDF")if(t.parent&&t.parent.collection&&(t.addCollectionArc(),(t=this.buildFrame(t,t.element)).parent.element=null),t.parent&&t.parent.nodeType&&t.parent.nodeType!==t.ARC){t.addArc(r(i)),this.reify&&(e=this.getAttributeNodeNS(i,ge.ns.RDF,"ID"))&&(t.rdfid=e.nodeValue,i.removeAttributeNode(e));var o=this.getAttributeNodeNS(i,ge.ns.RDF,"parseType"),a=this.getAttributeNodeNS(i,ge.ns.RDF,"datatype");if(a&&(t.datatype=a.nodeValue,i.removeAttributeNode(a)),o){var c=o.nodeValue;"Literal"===c?(t.datatype=ge.ns.RDF+"XMLLiteral",(t=this.buildFrame(t)).addLiteral(i.innerHTML||i.childNodes),n=!1):"Resource"===c?((t=this.buildFrame(t,t.element)).parent.element=null,t.addBNode()):"Collection"===c&&((t=this.buildFrame(t,t.element)).parent.element=null,t.addCollection()),i.removeAttributeNode(o)}if(0!==s.length){var u=this.getAttributeNodeNS(i,ge.ns.RDF,"resource"),l=this.getAttributeNodeNS(i,ge.ns.RDF,"nodeID");t=this.buildFrame(t),u?(t.addNode(u.nodeValue),i.removeAttributeNode(u)):l?(t.addBNode(l.nodeValue),i.removeAttributeNode(l)):t.addBNode();for(var h=s.length-1;h>=0;h--){var f=this.buildFrame(t);f.addArc(r(s[h])),r(s[h])===ge.ns.RDF+"type"?this.buildFrame(f).addNode(s[h].nodeValue):this.buildFrame(f).addLiteral(s[h].nodeValue)}}else 0===i.childNodes.length&&this.buildFrame(t).addLiteral("")}else{var p=this.getAttributeNodeNS(i,ge.ns.RDF,"about");if(e=this.getAttributeNodeNS(i,ge.ns.RDF,"ID"),p&&e)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&&e)t.addNode("#"+e.nodeValue),i.removeAttributeNode(e);else if(null==p&&null==e){var d=this.getAttributeNodeNS(i,ge.ns.RDF,"nodeID");d?(t.addBNode(d.nodeValue),i.removeAttributeNode(d)):t.addBNode()}else t.addNode(p.nodeValue),i.removeAttributeNode(p);var y=this.getAttributeNodeNS(i,ge.ns.RDF,"type");ge.ns.RDF+"Description"!==r(i)&&(y={nodeValue:r(i)}),null!=y&&(this.store.add(t.node,this.store.sym(ge.ns.RDF+"type"),this.store.sym(w.join(y.nodeValue,t.base)),this.why),y.nodeName&&i.removeAttributeNode(y));for(var g=s.length-1;g>=0;g--)this.store.add(t.node,this.store.sym(r(s[g])),this.store.literal(s[g].nodeValue,t.lang),this.why)}for(i=t.element;t.parent;){for(var m=t;null==i;)i=(t=t.parent).element;var b=i.childNodes&&i.childNodes[t.lastChild];if(b&&n){if((b.nodeType===ge.nodeType.ELEMENT||b.nodeType===ge.nodeType.TEXT||b.nodeType===ge.nodeType.CDATA_SECTION)&&(b.nodeType!==ge.nodeType.TEXT&&b.nodeType!==ge.nodeType.CDATA_SECTION||1===i.childNodes.length)){t.lastChild++,t=this.buildFrame(m,i.childNodes[t.lastChild-1]);break}t.lastChild++}else{if(t.terminateFrame(),!(t=t.parent))break;i=t.element,n=!0}}}}cleanParser(){this.bnodes={},this.why=null}buildFrame(t,e){var r=this.frameFactory(this,t,e);if(t&&(r.base=t.base,r.lang=t.lang),!e||e.nodeType===ge.nodeType.TEXT||e.nodeType===ge.nodeType.CDATA_SECTION)return r;var n=e.attributes,i=e.getAttributeNode("xml:base");null!=i&&(r.base=i.nodeValue,e.removeAttribute("xml:base"));var s=e.getAttributeNode("xml:lang");null!=s&&(r.lang=s.nodeValue,e.removeAttribute("xml:lang"));for(var o=n.length-1;o>=0;o--)if("xml"===n[o].nodeName.substr(0,3)){if("xmlns:"===n[o].name.slice(0,6)){var a=n[o].nodeValue;this.base&&(a=w.join(a,this.base)),this.store.setPrefixForURI(n[o].name.slice(6),a)}e.removeAttributeNode(n[o])}return r}}function me(t,e,r){var n,i,s,o=["INSERT","DELETE","WHERE"],a=N("http://www.w3.org/ns/pim/patch#"),c=vt(e,e,r,r,null,null,"",null),u={},l=function(t,e,r,n,i){return"Line "+(e+1)+" of <"+t+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var h=e.sym(r+"#query");for(u.query=h;;){if((i=c.skipSpace(t,n))<0)return u;if(";"===t[i]){if((n=c.skipSpace(t,i+1))<0)return u;i=n}var f=!1;for(s=0;s<o.length;s++){var p=o[s];if(t.slice(i,i+p.length)===p){if((n=c.skipSpace(t,i+p.length))<0)throw l(c._thisDoc,c.lines,t,i+p.length,"found EOF, needed {...} after "+p);if(("INSERT"===p||"DELETE"===p)&&"DATA"===t.slice(n,n+4)){if((i=c.skipSpace(t,n+4))<0)throw l(c._thisDoc,c.lines,t,n+4,"needed {...} after INSERT DATA "+p);n=i}var d=[];if((i=c.node(t,n,d))<0)throw l(c._thisDoc,c.lines,t,n,"bad syntax or EOF in {...} after "+p);u[p.toLowerCase()]=d[0],e.add(h,a(p.toLowerCase()),d[0]),f=!0,n=i}}if(!f&&"@prefix"===t.slice(i,i+7)){if((n=c.directive(t,i))<0)throw l(c._thisDoc,c.lines,t,n,"bad syntax or EOF after @prefix ");n=c.checkDot(t,n),f=!0}if(!f)throw l(c._thisDoc,c.lines,t,i,"Unknown syntax at start of statememt: '"+t.slice(i).slice(0,20)+"'")}}function be(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",s=arguments.length>4?arguments[4]:void 0;i=i||n.sT,i=i.split(";")[0];try{if(i===n.ny||i===n.sT)vt(e,e,r,r,null,null,"",null).loadBuf(t),a();else if(i===n.JG)new ge(e).parse(O.parseXML(t),r,e.sym(r)),a();else if(i===n.H)ye(O.parseXML(t,{contentType:n.H}),e,r),a();else if(i===n.lc)ye(O.parseXML(t,{contentType:n.lc}),e,r),a();else if(i===n.K9||i===n.Fn)me(t,e,r),a();else if(i===n.i2)Nt(t,e,r).then(a).catch(c);else{if(i!==n._0&&i!==n.BR)throw void 0===i?new Error("contentType is undefined"):new Error("Don't know how to parse "+i+" yet");var o=new ue({factory:Tt});!function(t,r){try{o.parse(r,u)}catch(t){s(t,e)}}(null,t)}}catch(t){c(t)}function a(){s&&s(null,e)}function c(t){if(i!==n.i2||i!==n._0||i!==n.BR){if(!s){let e=new Error(t+" while trying to parse <"+r+"> as "+i);throw e.cause=t,e}s(t,e)}}function u(t,r){r?e.add(r.subject,r.predicate,r.object,r.graph):s(t,e)}be.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,t.A)(ge,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,t.A)(ge,"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 we=a(1147),ve=a.n(we),xe=a(362),_e=a(6357);const Ae={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},Te={rdf:n.JG,owl:n.JG,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},Ee=t=>({link:N("http://www.w3.org/2007/ont/link#",t),http:N("http://www.w3.org/2007/ont/http#",t),httph:N("http://www.w3.org/2007/ont/httph#",t),rdf:N("http://www.w3.org/1999/02/22-rdf-syntax-ns#",t),rdfs:N("http://www.w3.org/2000/01/rdf-schema#",t),dc:N("http://purl.org/dc/elements/1.1/",t),ldp:N("http://www.w3.org/ns/ldp#",t)}),Ne=Ee();class Oe{constructor(e,r){(0,t.A)(this,"response",void 0),(0,t.A)(this,"dom",void 0),this.response=e,this.dom=r}}(0,t.A)(Oe,"pattern",void 0);class je extends Oe{static toString(){return"RDFXMLHandler"}static register(t){t.mediatypes[n.JG]={q:.9}}parse(t,e,r){let n=t.store;if(this.dom||(this.dom=O.parseXML(e)),"parsererror"===this.dom.documentElement.nodeName)return t.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");let i=new ge(n);try{i.parse(this.dom,r.original.value,r.original)}catch(e){return t.failFetch(r,"Syntax error parsing RDF/XML! "+e,"parse_error")}return r.noMeta||n.add(r.original,Ne.rdf("type"),Ne.link("RDFDocument"),t.appNode),t.doneFetch(r,this.response)}}je.pattern=new RegExp("application/rdf\\+xml");class Se extends Oe{static toString(){return"XHTMLHandler"}static register(t){t.mediatypes[n.H]={q:.8}}parse(t,e,r){let n,i;this.dom||(this.dom=O.parseXML(e));let s=t.store,o=this.dom.getElementsByTagName("title");o.length>0&&s.add(r.resource,Ne.dc("title"),s.rdfFactory.literal(o[0].textContent),r.resource);let a=this.dom.getElementsByTagName("link");for(let e=a.length-1;e>=0;e--)n=a[e].getAttribute("rel"),i=!1,n||(n=a[e].getAttribute("rev"),i=!0),n&&t.linkData(r.original,n,a[e].getAttribute("href"),r.resource,i);let c=this.dom.getElementsByTagName("script");for(let t=0;t<c.length;t++){let e=c[t].getAttribute("type");Ae[e]&&(be(c[t].textContent,s,r.original.value,e),be(c[t].textContent,s,r.original.value,e))}if(r.noMeta||s.add(r.resource,Ne.rdf("type"),Ne.link("WebPage"),t.appNode),!r.noRDFa&&ye)try{ye(this.dom,s,r.original.value)}catch(e){let n="Error trying to parse "+r.resource+" as RDFa:\n"+e+":\n"+e.stack;return t.failFetch(r,n,"parse_error")}return t.doneFetch(r,this.response)}}Se.pattern=new RegExp("application/xhtml");class Re extends Oe{static toString(){return"XMLHandler"}static register(t){t.mediatypes["text/xml"]={q:.5},t.mediatypes["application/xml"]={q:.5}}static isElement(t){return t.nodeType===Node.ELEMENT_NODE}parse(t,e,r){let n=O.parseXML(e);for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(Re.isElement(s)){let i=s.namespaceURI;if(i&&i===i.rdf)return t.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new je(this.response,n).parse(t,e,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 t.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new Se(this.response,n).parse(t,e,r);let i=n.getElementsByTagName("html")[0];if(i){let s=i.getAttribute("xmlns");if(s&&s.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return t.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new Se(this.response,n).parse(t,e,r)}return t.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+e.slice(0,80),901)}}Re.pattern=new RegExp("(text|application)/(.*)xml");class ke extends Oe{static toString(){return"HTMLHandler"}static register(t){t.mediatypes["text/html"]={q:.8}}parse(t,e,r){let n=t.store;if(Ue(e))return t.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new Se(this.response).parse(t,e,r);if(function(t){const e=t.indexOf("<!DOCTYPE html"),r=t.indexOf(">");return!(-1===e||-1===r||e>r)&&-1!==t.substr(e,r-e).indexOf("XHTML")}(e))return t.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new Se(this.response).parse(t,e,r);if(function(t){return!!t.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(e))return t.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new Se(this.response).parse(t,e,r);let i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(e);return i&&n.add(r.resource,Ne.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,Ne.rdf("type"),Ne.link("WebPage"),t.appNode),t.addStatus(r.req,"non-XML HTML document, not parsed for data."),t.doneFetch(r,this.response)}}ke.pattern=new RegExp("text/html");class Ie extends Oe{static toString(){return"JsonLdHandler"}static register(t){t.mediatypes["application/ld+json"]={q:.9}}async parse(t,e,r,n){const i=t.store;try{return await Nt(e,i,r.original.value),t.store.add(r.original,Ne.rdf("type"),Ne.link("RDFDocument"),t.appNode),t.doneFetch(r,n)}catch(e){const i="Error trying to parse "+r.resource+" as JSON-LD:\n"+e;return t.failFetch(r,i,"parse_error",n)}}}Ie.pattern=/application\/(ld\+json|activity\+json)/;class Ce extends Oe{static toString(){return"TextHandler"}static register(t){t.mediatypes["text/plain"]={q:.5}}parse(t,e,r){return Ue(e)?(t.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 Re(this.response).parse(t,e,r)):e.slice(0,500).match(/xmlns:/)?(t.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new Re(this.response).parse(t,e,r)):(t.addStatus(r.req,"Plain text document, no known RDF semantics."),t.doneFetch(r,this.response))}}Ce.pattern=new RegExp("text/plain");class Pe extends Oe{static toString(){return"N3Handler"}static register(t){t.mediatypes["text/n3"]={},t.mediatypes["text/turtle"]={}}parse(t,e,r,n){let i=t.store,s=vt(i,i,r.original.value,r.original.value,null,null,"",null);try{s.loadBuf(e)}catch(e){let i="Error trying to parse "+r.resource+" as Notation3:\n"+e;return t.failFetch(r,i,"parse_error",n)}return t.addStatus(r.req,"N3 parsed: "+s.statementCount+" triples in "+s.lines+" lines."),t.store.add(r.original,Ne.rdf("type"),Ne.link("RDFDocument"),t.appNode),t.doneFetch(r,this.response)}}Pe.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");const Fe={RDFXMLHandler:je,XHTMLHandler:Se,XMLHandler:Re,HTMLHandler:ke,TextHandler:Ce,N3Handler:Pe,JsonLdHandler:Ie};function Ue(t){return!!t.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}class De{constructor(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,t.A)(this,"store",void 0),(0,t.A)(this,"timeout",void 0),(0,t.A)(this,"_fetch",void 0),(0,t.A)(this,"mediatypes",void 0),(0,t.A)(this,"appNode",void 0),(0,t.A)(this,"requested",void 0),(0,t.A)(this,"timeouts",void 0),(0,t.A)(this,"redirectedTo",void 0),(0,t.A)(this,"fetchQueue",void 0),(0,t.A)(this,"fetchCallbacks",void 0),(0,t.A)(this,"nonexistent",void 0),(0,t.A)(this,"lookedUp",void 0),(0,t.A)(this,"handlers",void 0),(0,t.A)(this,"ns",void 0),(0,t.A)(this,"fireCallbacks",void 0),this.store=e||new J,this.ns=Ee(this.store.rdfFactory),this.timeout=r.timeout||3e4,this._fetch=r.fetch||void 0!==a.g&&(a.g.solidFetcher||a.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||ve(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.sym("chrome://TheCurrentSession"),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}},O.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(r.handlers||Fe).map((t=>this.addHandler(Fe[t])))}static crossSiteProxy(t){return De.crossSiteProxyTemplate?De.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):void 0}static offlineOverride(t){let e=t;var r;return"undefined"!=typeof window&&window.panes&&(r=window.panes.UI)&&r.preferences&&r.preferences.get("offlineModeUsingLocalhost")&&"http://"===e.slice(0,7)&&"localhost/"!==e.slice(7,17)&&(e="http://localhost/"+e.slice(7),E.A.warn("Localhost kludge for offline use: actually getting <"+e+">")),e}static proxyIfNecessary(t){var e;if("undefined"!=typeof window&&window.panes&&(e=window.panes.UI)&&e.isExtension)return t;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){let e=t.split("/").slice(2);const r=(t,e)=>{let n=e[t.shift()];return n?"string"==typeof n?n+t.join("/"):t?r(t,n):null:null},n=r(e,$SolidTestEnvironment.localSiteMap);if(n)return n}return De.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===t.slice(0,5)?De.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):t}static unsupportedProtocol(t){let e=w.protocol(t);return"tel"===e||"mailto"===e||"urn"===e}static setCredentials(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===e.credentials&&(void 0!==e.withCredentials?e.credentials=e.withCredentials?"include":"omit":e.credentials="include")}load(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=Object.assign({},e),t instanceof Array)return Promise.all(t.map((t=>this.load(t,Object.assign({},e)))));const r=t;let n=(0,xe.E)(r);n=n.split("#")[0],e=this.initFetchOptions(n,e);const i=this.appNode,s=this.store,o=s.statementsMatching(void 0,this.ns.link("requestedURI"),s.sym(n),i).map((t=>t.subject));for(const t of o){const r=s.any(t,this.ns.link("response"),null,i);if(null!=r){const t=s.statementsMatching(r,this.ns.link("outOfDate"),!0,i);s.remove(t),e.force=!0,e.clearPreviousData=!0}}const a=this.initFetchOptions(n,e);return this.pendingFetchPromise(n,a.baseURI,a)}async pendingFetchPromise(t,e,r){let n;return!r.force&&await this.fetchQueue[e]?n=this.fetchQueue[e]:(n=Promise.race([this.setRequestTimeout(t,r),this.fetchUri(t,r)]),this.fetchQueue[e]=n,this.cleanupFetchRequest(e,void 0,this.timeout)),n.then((e=>(t in this.timeouts&&(this.timeouts[t].forEach(clearTimeout),delete this.timeouts[t]),e)))}cleanupFetchRequest(t,e,r){void 0!==e&&_e.warn("_options is deprecated"),this.timeouts[t]=(this.timeouts[t]||[]).concat(setTimeout((()=>{this.isPending(t)||delete this.fetchQueue[t]}),r))}initFetchOptions(t,e){let r=this.store;!e.method||"GET"===e.method.toUpperCase()||(e.force=!0),e.resource=r.rdfFactory.namedNode(t),e.baseURI=e.baseURI||t,e.original=r.rdfFactory.namedNode(e.baseURI),e.req=r.bnode(),e.headers=e.headers||{},e.contentType&&(e.headers["content-type"]=e.contentType),e.force&&(e.cache="no-cache");let n=this.acceptString();e.headers.accept=n;let i=De.offlineOverride(t);e.requestedURI=i,De.setCredentials(i,e);let s=De.proxyIfNecessary(i);return i!==s&&(e.proxyUsed=!0),e.actualProxyURI=s,e}fetchUri(t,e){if(!t)return Promise.reject(new Error("Cannot fetch an empty uri"));if(De.unsupportedProtocol(t))return this.failFetch(e,"fetcher: Unsupported protocol","unsupported_protocol");let r=this.getState(t);if(e.force)delete this.nonexistent[t];else{if("fetched"===r)return Promise.resolve(this.doneFetch(e,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===r&&404===this.requested[t]){let r="Previously failed: "+this.requested[t],n={url:t,status:this.requested[t],statusText:r,responseText:r,headers:new we.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(e,r,this.requested[t],n)}}this.fireCallbacks("request",[t]),this.requested[t]=!0,e.noMeta||this.saveRequestMetadata(t,e);let{actualProxyURI:n}=e;return this._fetch(n,e).then((r=>this.handleResponse(r,t,e)),(r=>{let i={url:n,status:999,statusText:(r.name||"network failure")+": "+(r.errno||r.code||r.type),responseText:r.message,headers:new we.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.handleError(i,t,e)}))}nowOrWhenFetched(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,xe.E)(t);"function"==typeof e?r=e:void 0===e||((0,o.Y2)(e)?n.referringTerm=e:n=e),this.load(i,n).then((t=>{if(r)if(t)if(t.ok)r(!0,"OK",t);else{let e="HTTP error: Status "+t.status+" ("+t.statusText+")";t.responseText&&(e+=" "+t.responseText),r(!1,e,t)}else r(!1,"@@ nowOrWhenFetched: no response object!")}),(function(t){var e=t.message||t.statusText;e="Failed to load <"+i+"> "+e,t.response&&t.response.status&&(e+=" status: "+t.response.status),r(!1,e,t.response)}))}addStatus(t,e){let r=new Date;e="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+e;let n=this.store;const i=n.the(t,this.ns.link("status"));(0,o.P3)(i)?i.append(n.rdfFactory.literal(e)):E.A.warn("web.js: No list to add to: "+i+","+e)}failFetch(t,e,r,n){this.addStatus(t.req,e),t.noMeta||this.store.add(t.original,this.ns.link("error"),this.store.rdfFactory.literal(e));let i=(t.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(t.resource.equals(t.original),this.requested[w.docpart(t.original.value)]=r,this.fireCallbacks("fail",[t.original.value,e]));var s=new Error("Fetcher: "+e);return s.status=r,s.statusText=e,s.response=n,Promise.reject(s)}linkData(t,e,r,n,i){if(!r)return;let s,o=this.store,a=o.rdfFactory.namedNode(w.join(r,t.value));if("alternate"===e||"seeAlso"===e||"meta"===e||"describedby"===e){if(a.value===t.value)return;s=this.ns.rdfs("seeAlso")}else s="type"===e?o.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):o.rdfFactory.namedNode(w.join(encodeURIComponent(e),"http://www.iana.org/assignments/link-relations/"));i?o.add(a,s,t,n):o.add(t,s,a,n)}parseLinkHeader(t,e,r){if(!t)return;const n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=t.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(let t=0;t<i.length;t++){let s=i[t].split(">"),o=s[0].substring(1),a=s[1].match(n);if(null==a)return;for(let t=0;t<a.length;t++){let n=a[t].split("=")[1].replace(/["']/g,"");this.linkData(e,n,o,r)}}}doneFetch(t,e){return this.addStatus(t.req,"Done."),this.requested[t.original.value]="done",this.fireCallbacks("done",[t.original.value]),e.req=t.req,e}nowKnownAs(t,e){this.lookedUp[t.value]?this.lookedUp[e.value]||this.lookUpThing(e,t):this.lookedUp[e.value]&&(this.lookedUp[t.value]||this.lookUpThing(t,e))}putBack(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(0,xe.E)(t);let i=new s.A(r).doc();return e.contentType=e["content-type"]||e["Content-Type"]||e.contentType||n.sT,"application/ld+json"===e.contentType?new Promise(((r,n)=>{F(i,this.store,i.uri,e.contentType,((i,s)=>{i?n(i):(e.data=s,this.webOperation("PUT",t,e).then((t=>r(t))).catch((t=>n(t))))}))})):(e.data=F(i,this.store,i.value,e.contentType),this.webOperation("PUT",r,e))}webCopy(t,e,r){return this.webOperation("GET",t).then((t=>this.webOperation("PUT",e,{data:t.responseText,contentType:r})))}delete(t,e){return this.webOperation("DELETE",t,e).then((e=>(this.requested[t]=404,this.nonexistent[t]=!0,this.unload(this.store.rdfFactory.namedNode(t)),e)))}async createIfNotExists(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.sT,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const i=this;try{var s=await i.load(t)}catch(n){if(404===n.response.status){try{s=await i.webOperation("PUT",t.value,{data:r,contentType:e})}catch(t){throw t}return delete i.requested[t.value],s}throw n}return s}createContainer(t,e,r){let i={"content-type":n.sT,link:this.ns.ldp("BasicContainer")+'; rel="type"'};e&&(i.slug=e);let s={headers:i};return r&&(s.body=r),this.webOperation("POST",t,s)}invalidateCache(t){const e=(0,xe.E)(t),r=this;if(r.fetchQueue&&r.fetchQueue[e]&&(r.fetchQueue[e].PromiseStatus,delete r.fetchQueue[e]),r.requested[e]&&"done"!==r.requested[e]&&"failed"!==r.requested[e]&&404!==r.requested[e]){let t=`Rdflib: fetcher: Destructive operation on <${r.requested[e]}> file being fetched! `+e;_e.error(t)}else delete r.requested[e],delete r.nonexistent[e]}webOperation(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,xe.E)(e);r.method=t,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),De.setCredentials(n,r),new Promise((function(e,s){i._fetch(n,r).then((r=>{if(r.ok)"PUT"!==t&&"PATCH"!==t&&"POST"!==t&&"DELETE"!==t||i.invalidateCache(n),r.text?r.text().then((t=>{r.responseText=t,e(r)})):e(r);else{let e="Web error: "+r.status;r.statusText&&(e+=" ("+r.statusText+")"),e+=" on "+t+" of <"+n+">",r.responseText&&(e+=": "+r.responseText);let i=new Error(e);i.response=r,s(i)}}),(e=>{s(new Error("Fetch error for "+t+" of <"+n+">:"+e))}))}))}lookUpThing(t,e){let r=this.store.uris(t);return r=r.map((t=>w.docpart(t))),r.forEach((t=>{this.lookedUp[t]=!0})),this.load(r,{referringTerm:e})}getHeader(t,e){const r=this.store,n=t.value,i=r.each(void 0,this.ns.link("requestedURI"),r.rdfFactory.literal(n));for(let t=0;t<i.length;t++){let n=i[t];if(void 0!==n){let t=r.any(n,this.ns.link("response"));if(void 0!==t&&r.anyValue(t,this.ns.http("status"))&&r.anyValue(t,this.ns.http("status")).startsWith("2")){let n=r.each(t,this.ns.httph(e.toLowerCase()));return n.length?n.map((t=>t.value)):[]}}}}saveRequestMetadata(t,e){let r=e.req,n=this.store,i=e.referringTerm;this.addStatus(e.req,"Accept: "+e.headers.accept),(0,o.Y2)(i)&&n.add(n.rdfFactory.namedNode(t),this.ns.link("requestedBy"),i,this.appNode),e.original&&e.original.value!==t&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(e.original.value),this.appNode);const s=new Date,a="["+s.getHours()+":"+s.getMinutes()+":"+s.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(a+" Request for "+t),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(t),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}saveResponseMetadata(t,e){const r=this.store;let n=r.bnode();return r.add(e.req,this.ns.link("response"),n,this.appNode),r.add(n,this.ns.http("status"),r.rdfFactory.literal(t.status),this.appNode),r.add(n,this.ns.http("statusText"),r.rdfFactory.literal(t.statusText),this.appNode),t.headers.forEach(((t,i)=>{r.add(n,this.ns.httph(i),this.store.rdfFactory.literal(t),this.appNode),"content-type"===i&&r.add(e.resource,this.ns.rdf("type"),r.rdfFactory.namedNode(O.mediaTypeClass(t).value),this.appNode)})),n}objectRefresh(t){let e=this.store.uris(t);if(void 0!==e)for(let t=0;t<e.length;t++)this.refresh(this.store.rdfFactory.namedNode(w.docpart(e[t])))}refresh(t,e){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(t,{force:!0,clearPreviousData:!0},e)}refreshIfExpired(t,e){let r=this.getHeader(t,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(t,e):e(!0,"Not expired",{})}retract(t){this.store.removeMany(void 0,void 0,void 0,t),t.value&&delete this.requested[w.docpart(t.value)],this.fireCallbacks("retract",arguments)}getState(t){return void 0===this.requested[t]?"unrequested":!0===this.requested[t]?"requested":"done"===this.requested[t]?"fetched":"redirected"===this.requested[t]?this.getState(this.redirectedTo[t]):"failed"}isPending(t){return!0===this.requested[t]}unload(t){this.store.removeDocument(t),delete this.requested[t.value]}addHandler(t){this.handlers.push(t),t.register(this)}retryNoCredentials(t,e){e.retriedWithNoCredentials=!0,delete this.requested[t],delete this.fetchQueue[t];let r=Object.assign({},e,{credentials:"omit"});return this.addStatus(e.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(t,r)}isCrossSite(t){if("undefined"==typeof document||!document.location)return!1;const e=w.hostpart,r=""+document.location;return(e(r)&&e(t)&&e(r))!==e(t)}handleError(t,e,r){if(this.isCrossSite(e)){if(r.credentials&&"include"===r.credentials&&!r.retriedWithNoCredentials)return this.retryNoCredentials(e,r);let t=De.crossSiteProxy(e);if(t&&!r.proxyUsed)return this.redirectToProxy(t,r)}var n;return t instanceof Error?n="Fetch error: "+t.message:(n=t.statusText,t.responseText&&(n+=` ${t.responseText}`)),this.failFetch(r,n,t.status||998,t)}addType(t,e,r,n){let i=e;if(n){var s=r.any(i,this.ns.link("requestedURI"));s&&s.value!==n&&r.add(r.rdfFactory.namedNode(n),this.ns.rdf("type"),t,this.appNode)}for(;;){const e=r.any(i,this.ns.link("requestedURI"));if(e&&e.value&&r.add(r.rdfFactory.namedNode(e.value),this.ns.rdf("type"),t,this.appNode),i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i),!i)break;var o=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!o)break;var a=r.any(o,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!a)break;if("301"!==a&&"302"!==a)break}}handleResponse(t,e,r){const n=this.store,i=t.headers,s=r.req,o=this.saveResponseMetadata(t,r),a=this.normalizedContentType(r,i)||"";let c=i.get("content-location");if(0===t.status)return this.handleError(t,e,r);if(t.status>=400)return 404===t.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[e]=!0),this.saveErrorResponse(t,o).then((()=>{let e=r.resource+" "+t.statusText;return this.failFetch(r,e,t.status,t)}));var u=null,l=null;if(c&&(l=w.join(c,e))!==e&&(u=l),200===t.status){if(this.addType(this.ns.link("Document"),s,n,e),u&&this.addType(this.ns.link("Document"),s,n,u),r.clearPreviousData){const t=n.statementsMatching(void 0,void 0,void 0,r.resource).slice();for(let e=0;e<t.length;e++)n.removeStatement(t[e])}let t=a.includes("image/")||a.includes("application/pdf");a&&t&&(this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),s,n,e),u&&this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),s,n,u))}if(c){if(!r.force&&u&&"done"===this.requested[l])return this.doneFetch(r,t);this.requested[l]=!0}this.parseLinkHeader(i.get("link"),r.original,s);let h=this.handlerForContentType(a,t);return h?t.text().then((e=>(t.responseText=e,h.parse(this,e,r,t)))):(this.addStatus(s,"Fetch over. No data handled."),this.doneFetch(r,t))}saveErrorResponse(t,e){let r=this.store;return t.text().then((t=>{t.length>10&&r.add(e,this.ns.http("content"),r.rdfFactory.literal(t),e)}))}handlerForContentType(t,e){if(!t)return null;let r=this.handlers.find((e=>t.match(e.pattern)));return r?new r(e):null}guessContentType(t){return Te[t.split(".").pop()]}normalizedContentType(t,e){if(t.forceContentType)return t.forceContentType;let r=e.get("content-type");if(!r||r.includes("application/octet-stream")){let e=this.guessContentType(t.resource.value);if(e)return e}let n=w.protocol(t.resource.value);return!r&&["file","chrome"].includes(n)?"text/xml":r}redirectToProxy(t,e){this.addStatus(e.req,"BLOCKED -> Cross-site Proxy to <"+t+">"),e.proxyUsed=!0;const r=this.store,n=e.req;e.noMeta||(r.add(n,this.ns.link("redirectedTo"),r.rdfFactory.namedNode(t),n),this.addStatus(n,"redirected to new request")),this.requested[e.resource.value]="redirected",this.redirectedTo[e.resource.value]=t;let i=Object.assign({},e);return i.baseURI=e.resource.value,this.fetchUri(t,i).then((t=>(i.noMeta||r.add(n,this.ns.link("redirectedRequest"),i.req,this.appNode),t)))}setRequestTimeout(t,e){return new Promise((r=>{this.timeouts[t]=(this.timeouts[t]||[]).concat(setTimeout((()=>{!this.isPending(t)||e.retriedWithNoCredentials||e.proxyUsed||r(this.failFetch(e,`Request to ${t} timed out`,"timeout"))}),this.timeout))}))}addFetchCallback(t,e){this.fetchCallbacks[t]?this.fetchCallbacks[t].push(e):this.fetchCallbacks[t]=[e]}acceptString(){let t="";for(let e in this.mediatypes){""!==t&&(t+=", "),t+=e;for(let r in this.mediatypes[e])t+=";"+r+"="+this.mediatypes[e][r]}return t}}(0,t.A)(De,"HANDLERS",void 0),(0,t.A)(De,"CONTENT_TYPE_BY_EXT",void 0),(0,t.A)(De,"crossSiteProxyTemplate",void 0),De.HANDLERS=Fe,De.CONTENT_TYPE_BY_EXT=Te;const Me={parseJSON:function(t,e,r){var n,i,s,o={},a=r.sym(e);for(var c in t){0===c.indexOf("_:")?o[c]?n=o[c]:(n=r.bnode(c),o[c]=n):n=r.sym(c);var u=t[c];for(var l in u){var h=u[l];for(var f in i=r.sym(l),h){var p=h[f];if("uri"===p.type)s=r.sym(p.value),r.add(n,i,s,a);else if("BlankNode"===p.type)o[p.value]?s=o[p.value]:(s=r.bnode(p.value),o[p.value]=s),r.add(n,i,s,a);else{if("Literal"!==p.type)throw new Error("error: unexpected termtype: "+f.type);s=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,s,a)}}}}}};function Le(t){var e=0;function r(t){var e="",r=t.statements;for(var n in r)E.A.debug("Found statement: "+r),e+=o()+r[n]+"\n";return e}function n(t){var e="";for(var r in t.constraints){var n=t.constraints[r];e+=o()+"FILTER ( "+n.describe(r)+" ) \n"}return e}function i(t){for(var s="",a=0;a<t.optional.length;a++)E.A.debug("Found optional query"),s+=o()+"OPTIONAL { \n",e++,s+=r(t.optional[a]),s+=n(t.optional[a]),s+=i(t.optional[a]),e--,s+=o()+"}\n";return s}function s(t){var s=o()+"WHERE \n{ \n";return e++,s+=r(t),s+=n(t),s+=i(t),e--,s+"}"}function o(){for(var t="",r=0;r<e;r++)t+=" ";return t}return function(t){return function(t){for(var e=o()+"SELECT ",r=0;r<t.vars.length;r++)e+=t.vars[r]+" ";return e+"\n"}(t)+s(t.pat)}(t)}function Be(t,e,r){var n=[];function i(t){if(n[t])return n[t];var e=r.variable(t);return n[t]=e,e}function s(t){return"string"==typeof t&&t.match(/[^ \n\t]/)}function o(t){return"string"==typeof t&&t.match(/^[\?\$]/)}function a(t){return"string"==typeof t?t.replace(/^&lt;/,"<").replace(/&gt;$/,">"):t}function c(t){return"string"==typeof t&&t.match(/^<[^>]*>$/)}function u(t){return"string"==typeof t&&(t.match(/^_:/)||t.match(/^$/))}function l(t){return"string"==typeof t&&t.match(/:$/)}function h(t){return"string"==typeof t&&t.match(/^:|^[^_][^:]*:/)}function f(t){return t.split(":")[0]}function p(t){return t.split(":")[1]}function d(t){return c(t)?t.slice(1,t.length-1):t}function y(t){var e=-1===t.indexOf("'")?null:t.indexOf("'"),n=-1===t.indexOf('"')?null:t.indexOf('"');if(!e&&!n){var i=new Array(1);return i[0]=t,i}var s,o,a=new Array(2);if(!e||n&&n<e)s='"',o=n;else{if(n&&!(e&&e<n))return E.A.error("SQARQL QUERY OOPS!"),a;s="'",o=e}a[0]=t.slice(0,o);var c,u=t.slice(o+1).indexOf(s);return-1===u?(E.A.error("SPARQL parsing error: no matching parentheses in literal "+t),t):(t.slice(u+o+2).match(/^\^\^/)?(c=t.slice(u+o+2).indexOf(" "),a[1]=r.literal(t.slice(o+1,o+1+u),r.sym(d(t.slice(o+4+u,o+2+u+c)))),a=a.concat(y(t.slice(u+o+3+c)))):t.slice(u+o+2).match(/^@/)?(c=t.slice(u+o+2).indexOf(" "),a[1]=r.literal(t.slice(o+1,o+1+u),t.slice(o+3+u,o+2+u+c),null),a=a.concat(y(t.slice(u+o+2+c)))):(a[1]=r.literal(t.slice(o+1,o+1+u)),E.A.info("Literal found: "+a[1]),a=a.concat(y(t.slice(u+o+2)))),a)}function g(t){t=t.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),E.A.info("New str into spaceDelimit: \n"+t);var e=[],r=t.split(" ");for(var n in r)s(r[n])&&(e=e.concat(r[n]));return e}function m(t,e){for(var r=0;r<e.length;r++)if("string"==typeof e[r]&&e[r].toLowerCase()===t.toLowerCase())return r;return null}function b(t,e){for(var r=[],n=0;n<e.length;n++)"string"==typeof e[n]&&e[n].toLowerCase()===t.toLowerCase()&&r.push(n);return r}function w(t,e,r){E.A.info("Looking for a close bracket of type "+r+" in "+t);for(var n=0,i=0;i<t.length;i++)if(t[i]===e&&n++,t[i]===r&&n--,n<0)return i;return E.A.error("Statement had no close parenthesis in SPARQL query"),0}function v(t){return this.describe=function(e){return e+" = "+t.toNT()},this.test=function(e){return t.equals(e)},this}function x(t){this.describe=function(e){return"REGEXP( '"+t+"' , "+e+" )"},this.test=function(e){var r=new RegExp(t);return!!e.value&&r.test(e.value)}}function _(t,e){3!==t.length||"Variable"!==t[0].termType||"NamedNode"!==t[2].termType&&"Literal"!==t[2].termType?6===t.length&&"string"==typeof t[0]&&"regexp"===t[0].toLowerCase()&&"("===t[1]&&")"===t[5]&&","===t[3]&&"Variable"===t[4].termType&&"Literal"===t[2].termType&&(E.A.debug("Constraint added: "+t),e.constraints[t[4]]=new x(t[2].value)):"="===t[1]||">"===t[1]||"<"===t[1]?(E.A.debug("Constraint added: "+t),e.constraints[t[0]]=new v(t[2])):E.A.warn("I don't know how to handle the constraint: "+t)}function A(t,e){E.A.debug("Optional query: "+t+" not yet implemented.");var n=r.formula();T(t,n),e.optional.push(n)}function T(t,e){var n,s,l=function(t){for(var e=[],n=0;n<t.length;n++)"string"==typeof t[n]?(t[n]=a(t[n]),o(t[n])?e[n]=i(t[n].slice(1)):u(t[n])?(E.A.info(t[n]+" was identified as a bnode."),e[n]=r.bnode()):c(t[n])?(E.A.info(t[n]+" was identified as a symbol."),e[n]=r.sym(d(t[n]))):h(t[n])?(E.A.info(t[n]+" was identified as a prefixed symbol"),j[f(t[n])]?e[n]=r.sym(t[n]=j[f(t[n])]+p(t[n])):(E.A.error("SPARQL error: "+t[n]+" with prefix "+f(t[n])+" does not have a correct prefix entry."),e[n]=t[n])):e[n]=t[n]):e[n]=t[n];return e}(t);for(E.A.debug("WHERE: "+l);m("OPTIONAL",l);)s=m("OPTIONAL",l),E.A.debug("OPT: "+s+" "+l[s]+" in "+l),"{"!==l[s+1]&&E.A.warn("Bad optional opening bracket in word "+s),-1===(n=w(l.slice(s+2),"{","}"))?E.A.error("No matching bracket in word "+s):(A(l.slice(s+2,s+2+n),e),s=m("OPTIONAL",l),n=w(l.slice(s+2),"{","}"),l.splice(s,n+3));for(E.A.debug("WHERE after optionals: "+l);m("FILTER",l);){var y=m("FILTER",l);"("!==l[y+1]&&E.A.warn("Bad filter opening bracket in word "+y),-1===(n=w(l.slice(y+2),"(",")"))?E.A.error("No matching bracket in word "+y):(_(l.slice(y+2,y+2+n),e),y=m("FILTER",l),n=w(l.slice(y+2),"(",")"),l.splice(y,n+3))}E.A.debug("WHERE after filters and optionals: "+l),function(t,e){var r=new Array(1);r[0]=-1;for(var n=r.concat(b(".",t)),i=[],s=0;s<n.length-1;s++)i[s]=t.slice(n[s]+1,n[s+1]);for(s in i){E.A.info("s+p+o "+s+" = "+i[s]);var o=i[s][0];i[s].splice(0,1);var a=r.concat(b(";",i[s]));a.push(i[s].length);for(var c=[],u=0;u<a.length-1;u++)c[u]=i[s].slice(a[u]+1,a[u+1]);for(s in c){E.A.info("p+o "+s+" = "+i[s]);var l=c[s][0];c[s].splice(0,1);var h=r.concat(b(",",c[s]));h.push(c[s].length);var f=[];for(u=0;u<h.length-1;u++)f[u]=c[s].slice(h[u]+1,h[u+1]);for(s in f){var p=f[s][0];E.A.info("Subj="+o+" Pred="+l+" Obj="+p),e.add(o,l,p)}}}}(l,e)}E.A.info("SPARQL input: \n"+t);var N=new z,O=function(t){var e=y(t),r=[];for(var n in e)r="string"==typeof e[n]?r.concat(g(e[n])):r.concat(e[n]);return r=function(t){for(var e=t,r=0;r<e.length;r++)if("a"===e[r]&&(e[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===e[r]&&"of"===e[r+2]){e.splice(r,1),e.splice(r+1,1);var n=e[r-1];e[r-1]=e[r+1],e[r+1]=n}return e}(r),E.A.info("SPARQL Tokens: "+r),r}(t),j=function(t){var e=b("PREFIX",t),r=[];for(var n in e){var i=t[e[n]+1],s=t[e[n]+2];if(l(i))if(c(s)){E.A.info("Prefix found: "+i+" -> "+s);var o=f(i),a=d(s);r[o]=a}else E.A.error("Invalid SPARQL symbol: "+s);else E.A.error("Invalid SPARQL prefix: "+i)}return r}(O);j.rdf||(j.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),j.rdfs||(j.rdfs="http://www.w3.org/2000/01/rdf-schema#");var S=m("SELECT",O),R=m("WHERE",O);if(S<0||R<0||S>R)return E.A.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(t,e){for(var r in E.A.info("SPARQL vars: "+t),t)if(o(t[r])){E.A.info("Added "+t[r]+" to query variables from SPARQL");var n=i(t[r].slice(1));e.vars.push(n),n.label=t[r].slice(1)}else E.A.warn("Incorrect SPARQL variable in SELECT: "+t[r])}(O.slice(S+1,R),N),T(O.slice(R+2,O.length-1),N.pat),e)return N;for(var k in N.pat.statements){var I=N.pat.statements[k];"NamedNode"===I.subject.termType&&r.fetcher&&r.fetcher.lookUpThing(I.subject,"sparql:"+I.subject),"NamedNode"===I.object.termType&&r.fetcher&&r.fetcher.lookUpThing(I.object,"sparql:"+I.object)}return N}class qe{constructor(e){if((0,t.A)(this,"store",void 0),(0,t.A)(this,"ifps",void 0),(0,t.A)(this,"fps",void 0),(0,t.A)(this,"patchControl",void 0),(0,t.A)(this,"ns",void 0),(e=e||new J).updater)throw new Error("You can't have two UpdateManagers for the same store");e.fetcher||(e.fetcher=new De(e)),this.store=e,e.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=N("http://www.w3.org/2007/ont/link#"),this.ns.http=N("http://www.w3.org/2007/ont/http#"),this.ns.httph=N("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=N("http://www.w3.org/ns/ldp#"),this.ns.rdf=N("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=N("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=N("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=N("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}patchControlFor(t){return this.patchControl[t.value]||(this.patchControl[t.value]=[]),this.patchControl[t.value]}isHttpUri(t){return"http"===t.slice(0,4)}flagAuthorizationMetadata(t){t||(t=this.store);const e=t.fetcher?.appNode,r=t.statementsMatching(void 0,this.ns.link("requestedURI"),void 0,e).map((t=>t.subject));for(const n of r){const r=t.any(n,this.ns.link("response"),null,e);null!=r&&t.add(r,this.ns.link("outOfDate"),!0,e)}}async checkEditable(t,e){if(!t)return!1;e||(e=this.store);const r=this.editable(t,e);return void 0!==r?r:(await(e.fetcher?.load(t)),this.editable(t,e))}editable(t,e){if(!t)return!1;if(e||(e=this.store),t=(0,xe.E)(t),!this.isHttpUri(t)&&e.holds(e.rdfFactory.namedNode(t),e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),e.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";var r,n=!1;const i=e.fetcher?.appNode;for(var s,o=e.each(void 0,this.ns.link("requestedURI"),(0,w.docpart)(t),i),a=0;a<o.length;a++)if(void 0!==(r=o[a])){const o=e.any(r,this.ns.link("response"),null,i);if(void 0!==o){if(e.anyJS(o,this.ns.link("outOfDate"),null,i))continue;var c=e.anyValue(o,this.ns.httph("wac-allow"));if(c)for(var u of c.split(",")){var l=u.split("=");if(l[0].includes("user")&&!l[1].includes("write")&&!l[1].includes("append"))return!1}var h=e.each(o,this.ns.httph("accept-patch"));if(h.length)for(let t=0;t<h.length;t++){if((s=h[t].value.trim()).indexOf("application/sparql-update")>=0)return"SPARQL";if(s.indexOf("application/sparql-update-single-match")>=0)return"SPARQL";if(s.indexOf("text/n3")>=0)return"N3PATCH"}var f=e.each(o,this.ns.httph("ms-author-via"));if(f.length)for(let t=0;t<f.length;t++){if((s=f[t].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(s.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(t))return!!c&&"LOCALFILE";var p=e.each(o,this.ns.http("status"));if(p.length)for(let t=0;t<p.length;t++)200!==p[t]&&404!==p[t]||(n=!0)}}if(0===o.length);else if(n)return!1}anonymize(t){return"_:"===t.toNT().substr(0,2)&&this.mentioned(t)?"?"+t.toNT().substr(2):t.toNT()}anonymizeNT(t){return this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" ."}nTriples(t){return`${t.subject.toNT()} ${t.predicate.toNT()} ${t.object.toNT()} .`}statementBnodes(t){return[t.subject,t.predicate,t.object].filter((function(t){return(0,o.jt)(t)}))}statementArrayBnodes(t){var e=[];for(let r=0;r<t.length;r++)e=e.concat(this.statementBnodes(t[r]));e.sort();var r=[];for(let t=0;t<e.length;t++)0!==t&&e[t].equals(e[t-1])||r.push(e[t]);return r}cacheIfps(){this.ifps={};var t=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty"));for(let e=0;e<t.length;e++)this.ifps[t[e].value]=!0;this.fps={},t=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(let e=0;e<t.length;e++)this.fps[t[e].value]=!0}bnodeContext2(t,e,r){var n,i,s=this.store.statementsMatching(void 0,void 0,t,e);for(let t=0;t<s.length;t++)if(this.fps[s[t].predicate.value]){if(!(n=s[t].subject).isBlank)return[s[t]];if(r&&(i=this.bnodeContext2(n,e,r-1)))return i.concat([s[t]])}s=this.store.statementsMatching(t,void 0,void 0,e);for(let t=0;t<s.length;t++)if(this.ifps[s[t].predicate.value]){if(!(n=s[t].object).isBlank)return[s[t]];if(r&&(i=this.bnodeContext2(n,e,r-1)))return i.concat([s[t]])}return null}bnodeContext1(t,e){for(var r=0;r<3;r++){var n=this.bnodeContext2(t,e,r);if(null!==n)return n}return this.store.connectedStatements(t,e)}mentioned(t){return 0!==this.store.statementsMatching(t,null,null,null).length||0!==this.store.statementsMatching(null,t).length||0!==this.store.statementsMatching(null,null,t).length}bnodeContext(t,e){var r=[];if(t.length){this.cacheIfps();for(let i=0;i<t.length;i++){var n=t[i];this.mentioned(n)&&(r=r.concat(this.bnodeContext1(n,e)))}}return r}statementContext(t){var e=this.statementBnodes(t);return this.bnodeContext(e,t.graph)}contextWhere(t){var e=this;return t&&0!==t.length?"WHERE { "+t.map((function(t){return e.anonymizeNT(t)})).join("\n")+" }\n":""}fire(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((()=>{if(!t)throw new Error("No URI given for remote editing operation: "+e);return n.noMeta=!0,n.contentType=n.contentType||"application/sparql-update",n.body=e,this.store.fetcher.webOperation("PATCH",t,n)})).then((n=>{if(!n.ok){let r="UpdateManager: update failed for <"+t+"> status="+n.status+", "+n.statusText+"\n for query: "+e;throw new Error(r)}r(t,n.ok,n.responseText,n)})).catch((e=>{r(t,!1,e.message,e)}))}update_statement(t){if(!t||t.graph){var e=this,r=this.statementContext(t);return{statement:t?[t.subject,t.predicate,t.object,t.graph]:void 0,statementNT:t?this.anonymizeNT(t):void 0,where:e.contextWhere(r),set_object:function(t,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(t)+" . }\n",e.fire(this.statement[3].value,n,r)}}}}insert_statement(t,e){var r=t instanceof Array?t[0]:t,n=this.contextWhere(this.statementContext(r));if(t instanceof Array){var i="";for(let e=0;e<t.length;e++)i+=t[e]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" . }\n";this.fire(r.graph.value,n,e)}delete_statement(t,e){var r=t instanceof Array?t[0]:t,n=this.contextWhere(this.statementContext(r));if(t instanceof Array){var i="";for(let e=0;e<t.length;e++)i+=t[e]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" . }\n";this.fire(r.graph.value,n,e)}requestDownstreamAction(t,e){var r=this.patchControlFor(t);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+e)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=e;else e(t)}clearUpstreamCount(t){this.patchControlFor(t).upstreamCount=0}getUpdatesVia(t){var e=this.store.fetcher.getHeader(t,"updates-via");return e&&e.length?e[0].trim():null}addDownstreamChangeListener(t,e){var r=this.patchControlFor(t);r.downstreamChangeListeners||(r.downstreamChangeListeners=[]),r.downstreamChangeListeners.push(e),this.setRefreshHandler(t,(t=>{this.reloadAndSync(t)}))}reloadAndSync(t){var e=this.patchControlFor(t),r=this;if(e.reloading)e.outOfDate=!0;else{e.reloading=!0;var n=1e3,i=function(){r.reload(r.store,t,(function(t,r,s){if(t){if(e.downstreamChangeListeners)for(let t=0;t<e.downstreamChangeListeners.length;t++)e.downstreamChangeListeners[t]();e.reloading=!1,e.outOfDate&&(e.outOfDate=!1,i())}else e.reloading=!1,s&&0===s.status&&(e.reloading=!0,setTimeout(i,n*=2))}))};i()}}setRefreshHandler(t,e){let r=this.getUpdatesVia(t);var n=e,i=this,s=this,o=1500,a=0;if(!r)return!1;r=(0,w.join)(r,t.value);const c=r.replace(/^http:/,"ws:").replace(/^https:/,"wss:");var u=function(){var e;if("undefined"!=typeof WebSocket)e=new WebSocket(c);else{if("undefined"==typeof window||!window.WebSocket)return;e=window.WebSocket(c)}e.onopen=function(){o=1500,this.send("sub "+t.value),a&&s.requestDownstreamAction(t,n)};var r=i.patchControlFor(t);r.upstreamCount=0,e.onerror=function(t){},e.onclose=function(t){o*=2,a+=1,setTimeout((function(){u()}),o)},e.onmessage=function(e){if(e.data&&"pub"===e.data.slice(0,3)){if("upstreamCount"in r&&(r.upstreamCount-=1,r.upstreamCount>=0))return;r.upstreamCount=0,i.requestDownstreamAction(t,n)}}};return u(),!0}updateMany(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=t.concat(e).map((t=>t.why)),n=this,i=[];r.forEach((t=>{i.find((e=>e.equals(t)))||i.push(t)}));const s=i.map((r=>n.update(t.filter((t=>t.why.equals(r))),e.filter((t=>t.why.equals(r))))));return s.length,Promise.all(s)}constructSparqlUpdateQuery(t,e,r){var n=this.contextWhere(r),i="";if(n.length){if(t.length){i+="DELETE { ";for(let e=0;e<t.length;e++)i+=this.anonymizeNT(t[e])+"\n";i+=" }\n"}if(e.length){i+="INSERT { ";for(let t=0;t<e.length;t++)i+=this.anonymizeNT(e[t])+"\n";i+=" }\n"}i+=n}else{if(t.length){i+="DELETE DATA { ";for(let e=0;e<t.length;e++)i+=this.anonymizeNT(t[e])+"\n";i+=" } \n"}if(e.length){t.length&&(i+=" ; "),i+="INSERT DATA { ";for(let t=0;t<e.length;t++)i+=this.nTriples(e[t])+"\n";i+=" }\n"}}return i}constructN3PatchQuery(t,e,r){var n="\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix ex: <http://www.example.org/terms#>.\n\n_:patch\n";return r&&r.length>0&&(n+=`\n solid:where {\n ${r.map((t=>this.anonymizeNT(t))).join("\n ")}\n };`),t.length>0&&(n+=`\n solid:deletes {\n ${t.map((t=>this.anonymizeNT(t))).join("\n ")}\n };`),e.length>0&&(n+=`\n solid:inserts {\n ${e.map((t=>this.anonymizeNT(t))).join("\n ")}\n };`),n+" a solid:InsertDeletePatch .\n"}update(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!r){var s=this;return new Promise((function(r,o){s.update(t,e,(function(t,e,n){e?r():o(new Error(n))}),n,i)}))}try{var a=this.store,c=t?(0,o.ok)(t)?t.statements:t instanceof Array?t:[t]:[],u=e?(0,o.ok)(e)?e.statements:e instanceof Array?e:[e]:[];if(!(c instanceof Array))throw new Error("Type Error "+typeof c+": "+c);if(!(u instanceof Array))throw new Error("Type Error "+typeof u+": "+u);if(0===c.length&&0===u.length)return r(null,!0);var l=c.length?c[0].graph:u[0].graph;if(!l){let t="Error patching: statement does not specify which document to patch:"+c[0]+", "+u[0];throw new Error(t)}if("NamedNode"!==l.termType){let t="Error patching: document not a NamedNode:"+c[0]+", "+u[0];throw new Error(t)}var h=this.patchControlFor(l),f=Date.now(),p=["subject","predicate","object","why"],d={delete:c,insert:u};["insert","delete"].map((function(t){d[t].map((function(t){if(!l.equals(t.graph))throw new Error("update: destination "+l+" inconsistent with delete quad "+t.graph);p.map((function(e){if(void 0===t[e])throw new Error("update: undefined "+e+" of statement.")}))}))}));var y=this.editable(l.value,a);if(!1===y)throw new Error("Update: Can't make changes in uneditable "+l);if(void 0===y){if(n)throw new Error("Update: Loaded "+l+"but still can't figure out what editing protocol it supports.");return void this.store.fetcher.load(l).then((n=>{this.update(t,e,r,!0,i)}),(n=>{if(404!==n.response.status)throw new Error(`Update: Can't get updatability status ${l} before patching: ${n}`);this.update(t,e,r,!0,i)}))}if(y.indexOf("SPARQL")>=0||y.indexOf("N3PATCH")>=0){var g=y.indexOf("SPARQL")>=0,m=[];c.length&&(m=this.statementArrayBnodes(c)),u.length&&(m=m.concat(this.statementArrayBnodes(u)));var b=this.bnodeContext(m,l),w=g?this.constructSparqlUpdateQuery(c,u,b):this.constructN3PatchQuery(c,u,b);i.contentType=g?"application/sparql-update":"text/n3",h.pendingUpstream=h.pendingUpstream?h.pendingUpstream+1:1,"upstreamCount"in h&&(h.upstreamCount+=1),this.fire(l.value,w,((t,e,n,i)=>{if(i.elapsedTimeMs=Date.now()-f,e){try{a.remove(c)}catch(t){e=!1,n="Remote Ok BUT error deleting "+c.length+" from store!!! "+t}for(let t=0;t<u.length;t++)a.add(u[t].subject,u[t].predicate,u[t].object,l)}if(r(t,e,n,i),h.pendingUpstream-=1,0===h.pendingUpstream&&h.downstreamAction){var s=h.downstreamAction;delete h.downstreamAction,s(l)}}),i)}else if(y.indexOf("DAV")>=0)this.updateDav(l,c,u,r,i);else{if(!(y.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+y+"' for "+l);try{this.updateLocalFile(l,c,u,r,i)}catch(t){r(l.value,!1,"Exception trying to write back file <"+l.value+">\n")}}}catch(t){r(void 0,!1,"Exception in update: "+t+"\n"+O.stackString(t))}}updateDav(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=this.store;var o=s.any(t,this.ns.link("request"));if(!o)throw new Error("No record of our HTTP GET request for document: "+t);var a=s.any(o,this.ns.link("response"));if(!a)return null;var c=s.the(a,this.ns.httph("content-type")).value;let u=s.statementsMatching(void 0,void 0,void 0,t).slice();for(let t=0;t<e.length;t++)O.RDFArrayRemove(u,e[t]);for(let t=0;t<r.length;t++)u.push(r[t]);const l=this.serialize(t.value,u,c);var h,f=s.the(a,this.ns.httph("content-location"));return f&&(h=(0,w.join)(f.value,h)),i.contentType=c,i.noMeta=!0,i.body=l,s.fetcher.webOperation("PUT",h,i).then((i=>{if(!i.ok)throw new Error(i.error);for(let t=0;t<e.length;t++)s.remove(e[t]);for(let e=0;e<r.length;e++)s.add(r[e].subject,r[e].predicate,r[e].object,t);n(t.value,i.ok,i.responseText,i)})).catch((e=>{n(t.value,!1,e.message,e)}))}updateLocalFile(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const s=this.store;let o=s.statementsMatching(void 0,void 0,void 0,t).slice();for(let t=0;t<e.length;t++)O.RDFArrayRemove(o,e[t]);for(let t=0;t<r.length;t++)o.push(r[t]);var a=t.value.lastIndexOf(".");if(a<1)throw new Error("Rewriting file: No filename extension: "+t.value);var c=t.value.slice(a+1);let u=De.CONTENT_TYPE_BY_EXT[c];if(!u)throw new Error("File extension ."+c+" not supported for data write");i.body=this.serialize(t.value,o,u),i.contentType=u,s.fetcher.webOperation("PUT",t.value,i).then((i=>{if(!i.ok)return n(t.value,!1,i.error);for(let t=0;t<e.length;t++)s.remove(e[t]);for(let e=0;e<r.length;e++)s.add(r[e].subject,r[e].predicate,r[e].object,t);n(t.value,!0,"")}))}serialize(t,e,r){const n=this.store;let i;if("string"==typeof e)return e;var s=C(n);switch(s.suggestNamespaces(n.namespaces),s.setBase(t),r){case"text/xml":case"application/rdf+xml":i=s.statementsToXML(e);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":i=s.statementsToN3(e);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return i}put(t,e,r,n){const i=this.store;let s;return Promise.resolve().then((()=>(s=this.serialize(t.value,e,r),i.fetcher.webOperation("PUT",t.value,{contentType:r,body:s})))).then((r=>{if(!r.ok)return n(t.value,r.ok,r.error,r);delete i.fetcher.nonexistent[t.value],delete i.fetcher.requested[t.value],"string"!=typeof e&&e.map((t=>{i.addStatement(t)})),n(t.value,r.ok,"",r)})).catch((e=>{n(t.value,!1,e.message)}))}reload(t,e,r){var n=Date.now();t.fetcher.nowOrWhenFetched(e.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(t,i,s){if(t)if(s.onErrorWasCalled||200!==s.status)r(!1,"Non-HTTP error reloading data: "+i,s);else{var o=Date.now()-n;e.reloadTimeTotal||(e.reloadTimeTotal=0),e.reloadTimeCount||(e.reloadTimeCount=0),e.reloadTimeTotal+=o,e.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,s)}))}}const $e={...Tt,fetcher:(t,e)=>new De(t,e),graph(){return new J(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,(arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)||{rdfFactory:Tt})},lit(t,e,r){return this.literal(""+t,e||r)},st(t,e,r,n){return this.quad(t,e,r,n)}},He=$e;class ze{constructor(t,e){this.parent=t,this.via=e,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(e),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(t){this.onError(t)}}_decode(t){var e,r,n,i,s,o,a;for(r in i={},s=function(){var r,n,i,s;for(s=[],r=0,n=(i=t.split("&")).length;r<n;r++)e=i[r],s.push(e.split("="));return s}())e=s[r],a=(o=[decodeURIComponent(e[0]),decodeURIComponent(e[1])])[1],null==i[n=o[0]]&&(i[n]=[]),i[n].push(a);return i}_send(t,e,r){var n,i;return i=[t,e,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}_subscribe(t){return this._send("sub",t,""),this.subscribed[t]=!0,this.subscribed[t]}onClose(t){var e;for(e in this.connected=!1,this.subscribed)this.pending[e]=!0;return this.subscribed={},this.subscribed}onError(t){throw new Error("onError"+t)}onMessage(t){var e,r;return"ping"===(r=t.data.split(" "))[0]?"function"==typeof(e=this.socket).send?e.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}onOpen(t){var e,r;for(r in this.connected=!0,e=[],this.pending)delete this.pending[r],e.push(this._subscribe(r));return e}subscribe(t){return this.connected?this._subscribe(t):(this.pending[t]=!0,this.pending[t])}}class Xe{constructor(t){this.fetcher=t,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}onHeaders(t){var e,r,n;return null==t.headers||"undefined"==typeof WebSocket||null===WebSocket||(e=t.headers.etag,n=t.headers["updates-via"],r=t.uri,e&&n&&(this.graph[r]={etag:e,via:n},this.register(n,r))),!0}onUpdate(t,e){return this.fetcher.refresh(He.namedNode(t))}register(t,e){return null==this.via[t]&&(this.via[t]=new ze(this,t)),this.via[t].subscribe(e)}}const Ve={};for(const t in He)"function"==typeof He[t]&&(Ve[t]=He[t].bind(He));const{fetcher:Ge,graph:Qe,lit:We,st:Je,namedNode:Ye,variable:Ze,blankNode:Ke,defaultGraph:tr,literal:er,quad:rr,triple:nr}=Ve,ir=new B,sr=t=>ir.fromNT(t),or=q.fromValue,ar=i.nextId;class cr extends J{constructor(e){super(e),(0,t.A)(this,"fetcher",void 0),this.fetcher=new De(this,{})}}class ur extends cr{constructor(e){super(e),(0,t.A)(this,"updater",void 0),this.updater=new qe(this)}}})(),c})()));
3
3
  //# sourceMappingURL=rdflib.min.js.map