rdflib 2.2.13 → 2.2.15-ce17c86d

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,6 +1,6 @@
1
1
  !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("window")):"function"==typeof define&&define.amd?define(["window"],t):"object"==typeof exports?exports.$rdf=t(require("window")):e.$rdf=t(e.window)}(window,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=75)}([function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"n",(function(){return r})),n.d(t,"a",(function(){return i})),n.d(t,"h",(function(){return a})),n.d(t,"t",(function(){return o})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return h})),n.d(t,"g",(function(){return d})),n.d(t,"i",(function(){return f})),n.d(t,"j",(function(){return p})),n.d(t,"k",(function(){return v})),n.d(t,"l",(function(){return y})),n.d(t,"m",(function(){return g})),n.d(t,"o",(function(){return m})),n.d(t,"p",(function(){return b})),n.d(t,"q",(function(){return w})),n.d(t,"r",(function(){return x})),n.d(t,"s",(function(){return _})),n.d(t,"u",(function(){return k}));var r="NamedNode",i="BlankNode",a="Literal",o="Variable",s="DefaultGraph",u="Collection",c="Empty",l="Graph",h="text/html",d="application/ld+json",f="text/n3",p="application/n3",v="application/nquads",y="application/n-quads",g="application/n-triples",m="application/rdf+xml",b="application/sparql-update",w="application/sparql-update-single-match",x="text/turtle",_="application/x-turtle",k="application/xhtml+xml"},function(e,t,n){"use strict";t.a={debug:function(e){},warn:function(e){},info:function(e){},error:function(e){},success:function(e){},msg:function(e){}}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.r(t),n.d(t,"docpart",(function(){return a})),n.d(t,"document",(function(){return o})),n.d(t,"hostpart",(function(){return s})),n.d(t,"join",(function(){return u})),n.d(t,"protocol",(function(){return c})),n.d(t,"refTo",(function(){return l}));var r=n(8),i=i||console.log;function a(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}function o(e){return new r.a(a(e))}function s(e){var t=/[^\/]*\/\/([^\/]*)\//.exec(e);return t?t[1]:""}function u(e,t){var n,r,a,o,s,u=t.indexOf("#");if(u>0&&(t=t.slice(0,u)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(e.indexOf(":")>=0)return e;if(n=t.indexOf(":"),0===t.length)return e;if(n<0)return i("Invalid base: "+t+" in join with given: "+e),e;if(r=t.slice(0,+n+1||9e9),0===e.indexOf("//"))return r+e;if(t.indexOf("//",n)===n+1){if((a=t.indexOf("/",n+3))<0)return t.length-n-3>0?t+"/"+e:r+e}else if((a=t.indexOf("/",n+1))<0)return t.length-n-1>0?t+"/"+e:r+e;if(0===e.indexOf("/"))return t.slice(0,a)+e;if((o=(s=t.slice(a)).lastIndexOf("/"))<0)return r+e;for(o>=0&&o<s.length-1&&(s=s.slice(0,+o+1||9e9)),s+=e;s.match(/[^\/]*\/\.\.\//);)s=s.replace(/[^\/]*\/\.\.\//,"");return s=(s=s.replace(/\.\//g,"")).replace(/\/\.$/,"/"),t.slice(0,a)+s}function c(e){var t=e.indexOf(":");return t<0?null:e.slice(0,t)}function l(e,t){var n,r,i,a,o,s,u,c,l,h,d,f,p=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!e)return t;if(e===t)return"";for(n=u=0,a=t.length;u<a;n=++u){if(t[n]!==e[n])break}if(e.slice(0,n).match(p)&&((r=t.indexOf("//"))<0&&(r=-2),i=t.indexOf("/",r+2),"/"!==t[i+1]&&"/"!==e[i+1]&&t.slice(0,i)===e.slice(0,i)))return t.slice(i);if("#"===t[n]&&e.length===n)return t.slice(n);for(;n>0&&"/"!==t[n-1];)n--;if(n<3)return t;if(e.indexOf("//",n-2)>0||t.indexOf("//",n-2)>0)return t;if(e.indexOf(":",n)>0)return t;for(s=0,c=0,o=(h=e.slice(n)).length;c<o;c++)"/"===h[c]&&s++;if(0===s&&n<t.length&&"#"===t[n])return"./"+t.slice(n);if(0===s&&n===t.length)return"./";if(f="",s>0)for(l=1,d=s;d>=1?l<=d:l>=d;d>=1?++l:--l)f+="../";return f+t.slice(n)}},function(e,t,n){"use strict";n.d(t,"j",(function(){return o})),n.d(t,"k",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"i",(function(){return c})),n.d(t,"n",(function(){return l})),n.d(t,"m",(function(){return h})),n.d(t,"d",(function(){return d})),n.d(t,"g",(function(){return f})),n.d(t,"e",(function(){return p})),n.d(t,"a",(function(){return v})),n.d(t,"l",(function(){return y})),n.d(t,"f",(function(){return g})),n.d(t,"h",(function(){return m})),n.d(t,"c",(function(){return b}));var r=n(22),i=n.n(r),a=n(1);function o(e){return"object"===i()(e)&&null!==e&&"subject"in e}function s(e){return"object"===i()(e)&&null!==e&&"statements"in e}function u(e){return h(e)&&e.termType===a.b}function c(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===a.n||e.termType===a.t||e.termType===a.a||e.termType===a.b||e.termType===a.h||e.termType===a.e)}function l(e){return h(e)&&e.termType===a.t}function h(e){return"object"===i()(e)&&null!==e&&"termType"in e}function d(e){return e.termType===a.h}function f(e){return"object"===i()(e)&&null!==e&&"subject"in e&&"predicate"in e&&"object"in e}function p(e){return h(e)&&"NamedNode"===e.termType}function v(e){return h(e)&&"termType"in e&&"BlankNode"===e.termType}function y(e){return h(e)&&(e.termType===a.n||e.termType===a.t||e.termType===a.a)}function g(e){return h(e)&&(e.termType===a.n||e.termType===a.t)}function m(e){return h(e)&&(e.termType===a.n||e.termType===a.t||e.termType===a.a||e.termType===a.h)}function b(e){return h(e)&&(e.termType===a.n||e.termType===a.t||e.termType===a.a||e.termType===a.c)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(3),u=n.n(s),c=n(12),l=n.n(c),h=n(14),d=n.n(h),f=n(9),p=n.n(f),v=n(0),y=n.n(v),g=n(16),m=n(11),b=n(1),w=n(25),x=n(7);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var k=function(e){l()(n,e);var t=_(n);function n(e){var r;if(i()(this,n),r=t.call(this,Object(w.a)(e)),y()(u()(r),"termType",b.n),y()(u()(r),"classOrder",g.a.NamedNode),!r.value)throw new Error("Missing IRI for NamedNode");if(!r.value.includes(":"))throw new Error('NamedNode IRI "'+e+'" must be absolute.');if(r.value.includes(" "))throw new Error('Error: NamedNode IRI "'+e+'" must not contain unencoded spaces.');return r}return o()(n,[{key:"dir",value:function(){var e=this.value.split("#")[0],t=e.slice(0,-1).lastIndexOf("/"),r=e.indexOf("//");return r>=0&&t<r+2||t<0?null:new n(e.slice(0,t+1))}},{key:"site",value:function(){var e=this.value.split("#")[0],t=e.indexOf("//");if(t<0)throw new Error("This URI does not have a web site part (origin)");var r=e.indexOf("/",t+2);return new n(r<0?e.slice(0)+"/":e.slice(0,r+1))}},{key:"doc",value:function(){return this.value.indexOf("#")<0?this:new n(this.value.split("#")[0])}},{key:"toString",value:function(){return"<"+this.value+">"}},{key:"id",value:function(){return this.value.split("#")[1]}},{key:"uri",get:function(){return this.value},set:function(e){this.value=e}}],[{key:"fromValue",value:function(e){return null==e||Object(x.m)(e)?e:new n(e)}}]),n}(m.a)},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"string",(function(){return s})),n.d(t,"mediaTypeClass",(function(){return u})),n.d(t,"linkRelationProperty",(function(){return c})),n.d(t,"callbackify",(function(){return l})),n.d(t,"DOMParserFactory",(function(){return h})),n.d(t,"domToString",(function(){return d})),n.d(t,"dumpNode",(function(){return f})),n.d(t,"dtstamp",(function(){return p})),n.d(t,"heavyCompare",(function(){return v})),n.d(t,"heavyCompareSPO",(function(){return y})),n.d(t,"output",(function(){return g})),n.d(t,"parseXML",(function(){return m})),n.d(t,"RDFArrayRemove",(function(){return b})),n.d(t,"string_startswith",(function(){return w})),n.d(t,"stackString",(function(){return x}));var r=n(2);n.d(t,"log",(function(){return r.a}));var i=n(6);n.d(t,"uri",(function(){return i}));var a=n(8),o=n(56),s={template:function(e,t){for(var n=e.split("%s"),r="",i=0;i<t.length;i++)t[i]+="",r+=n[i]+t[i];return r+n.slice(t.length).join()}};function u(e){return e=e.split(";")[0].trim(),new a.a("http://www.w3.org/ns/iana/media-types/"+e+"#Resource")}function c(e){return new a.a("http://www.w3.org/ns/iana/link-relations/relation#"+e.trim())}function l(e,t){e.callbacks={};for(var n=t.length-1;n>=0;n--)e.callbacks[t[n]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,n){e.callbacks[t].push(n)},e.removeCallback=function(t,n){for(var r=0;r<e.callbacks[t].length;r++)if(e.callbacks[t][r].name===n)return e.callbacks[t].splice(r,1),!0;return!1},e.insertCallback=function(t,n){e.callbacks[t].unshift(n)},e.fireCallbacks=function(t,n){var r,i,a=[],o=[],s=e.callbacks[t].length;for(r=s-1;r>=0;r--)(i=e.callbacks[t][r])&&i.apply(e,n)&&a.push(i);for(r=a.length-1;r>=0;r--)o.push(a[r]);for(r=s;r<e.callbacks[t].length;r++)o.push(e.callbacks[t][r]);e.callbacks[t]=o}}function h(){return window.DOMParser?new o.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function d(e,t){var n=[];(t=t||{})&&t.selfClosing&&t.selfClosing.split(" ").forEach((function(e){n[e]=!0}));var r=[];return t&&t.skipAttributes&&t.skipAttributes.split(" ").forEach((function(e){r[e]=!0})),f(e,t,n,r)}function f(e,t,n,r){var i,a="",o=[!1];if(void 0===e.nodeType)return a;if(1===e.nodeType){if(e.hasAttribute("class")&&t&&t.classWithChildText&&e.matches(t.classWithChildText.class))a+=e.querySelector(t.classWithChildText.element).textContent;else if(!(t&&t.skipNodeWithClass&&e.matches("."+t.skipNodeWithClass))){var s=e.nodeName.toLowerCase();a+="<"+s;var u=[];for(i=e.attributes.length-1;i>=0;i--){var c=e.attributes[i];if(!(r&&r.length>0&&r[c.name])&&!/^\d+$/.test(c.name)){if("class"===c.name&&t&&t.replaceClassItemWith&&c.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var l=new RegExp(t.replaceClassItemWith.source,"g");c.value=c.value.replace(l,t.replaceClassItemWith.target).trim()}"class"===c.name&&t&&t.skipClassWithValue&&t.skipClassWithValue===c.value||u.push(c.name+"='"+c.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&quot;")+"'")}}if(u.length>0&&(t&&t.sortAttributes&&u.sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),a+=" "+u.join(" ")),n&&n.ename)a+=" />";else{for(a+=">",a+="html"===s?"\n ":"",o.push("style"===s||"script"===s),i=0;i<e.childNodes.length;i++)a+=f(e.childNodes[i]);o.pop(),a+="body"===s?"</"+s+">\n":"</"+s+">"}}}else if(8===e.nodeType)a+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var h=e.nodeValue.replace(/\n+$/,"");a+=o[o.length-1]?h:h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else console.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),console.log(e);return a}function p(){var e=new Date,t=e.getYear()+1900,n=e.getMonth()+1,r=e.getDate(),i=e.getUTCHours(),a=e.getUTCMinutes(),o=e.getSeconds();return n<10&&(n="0"+n),r<10&&(r="0"+r),i<10&&(i="0"+i),a<10&&(a="0"+a),o<10&&(o="0"+o),t+"-"+n+"-"+r+"T"+i+":"+a+":"+o+"Z"}function v(e,t,n,r){var i=function(e){return"BlankNode"===e.termType?null:e},a=function(e){var t=n.statementsMatching(e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})).concat(n.statementsMatching(void 0,void 0,e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})));return t.sort(),t.join("\n")},o=Object.prototype.hasOwnProperty.call(n,"compareTerms")?n.compareTerms(e,t):e.compareTerm(t);return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===o?0:a(e)>a(t)?1:a(e)<a(t)?-1:o:r&&e.uri&&t.uri?(r[e.uri]||e.uri).localeCompare(r[t.uri]||t.uri):o}function y(e,t,n,r){return v(e.subject,t.subject,n,r)||v(e.predicate,t.predicate,n,r)||v(e.object,t.object,n,r)}function g(e){var t=document.createElement("div");t.textContent=e,document.body.appendChild(t)}function m(t,n){return n=n||{},e&&e.exports?(new o.DOMParser).parseFromString(t,n.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new o.DOMParser).parseFromString(t,"application/xml")}function b(e,t){for(var n=0;n<e.length;n++)if(e[n].subject.equals(t.subject)&&e[n].predicate.equals(t.predicate)&&e[n].object.equals(t.object)&&e[n].why.equals(t.why))return void e.splice(n,1);throw new Error("RDFArrayRemove: Array did not contain "+t+" "+t.why)}function w(e,t){return e.slice(0,t.length)===t}function x(e){var t=e+"\n";if(!e.stack)return t+"No stack available.\n";for(var n=e.stack.toString().split("\n"),r=[],i=0;i<n.length;i++){var a=n[i];if(a.indexOf("ecmaunit.js")>-1)break;"("==a.charAt(0)&&(a="function"+a);var o=a.split("@");r.push(o)}for(i=0;i<r.length;i++)t+=" "+r[i][1]+"\n "+r[i][0];return t}}.call(this,n(78)(e))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(0),u=n.n(s),c=function(){function e(t){i()(this,e),u()(this,"termType",void 0),u()(this,"classOrder",void 0),u()(this,"value",void 0),this.value=t}return o()(e,[{key:"substitute",value:function(e){return console.log("@@@ node substitute"+this),this}},{key:"compareTerm",value:function(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.value<e.value?-1:this.value>e.value?1:0}},{key:"equals",value:function(e){return!!e&&(this.termType===e.termType&&this.value===e.value)}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(e){return this.equals(e)}},{key:"toCanonical",value:function(){return this.toNT()}},{key:"toNT",value:function(){return this.toString()}},{key:"toNQ",value:function(){return this.toNT()}},{key:"toString",value:function(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}]),e}();u()(c,"fromValue",void 0),u()(c,"toJS",void 0)},function(e,t,n){var r=n(76);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(8);function i(e,t){var n=t||{namedNode:function(e){return new r.a(e)}};return function(t){return n.namedNode(e+(t||""))}}},function(e,t,n){var r=n(22).default,i=n(3);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return u}));n(2),n(6),n(10);var r=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],i="http://www.w3.org/1999/02/22-rdf-syntax-ns#first",a="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",o="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil";function s(e,t,n){var r=[];return n.reduce((function(t,n,s,u){var c;return r.push(e.quad(t,e.namedNode(i),u[s])),s<u.length-1?(c=e.blankNode(),r.push(e.quad(t,e.namedNode(a),c))):r.push(e.quad(t,e.namedNode(a),e.namedNode(o))),c}),t),r}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=e.length;for(n<0&&(n=r+n);n<r;n++)if(e[n]===t)return n;return-1}},function(e,t,n){"use strict";t.a={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},function(e,t,n){"use strict";var r,i=n(0),a=n.n(i),o=n(20),s=n(18),u=n(8),c=n(45),l=n(23),h=n(1),d=n(37),f=n(19),p=n(7),v=new d.a,y={supports:(r={},a()(r,f.a.collections,!1),a()(r,f.a.defaultGraphType,!1),a()(r,f.a.equalsMethod,!0),a()(r,f.a.identity,!1),a()(r,f.a.id,!0),a()(r,f.a.reversibleId,!1),a()(r,f.a.variableType,!0),r),blankNode:function(e){return new o.a(e)},defaultGraph:function(){return v},equals:function(e,t){return e===t||!e||!t||(Object(p.g)(e)||Object(p.g)(t)?!(!Object(p.g)(e)||!Object(p.g)(t))&&(this.equals(e.subject,t.subject)&&this.equals(e.predicate,t.predicate)&&this.equals(e.object,t.object)&&this.equals(e.graph,t.graph)):!(!Object(p.m)(e)||!Object(p.m)(t))&&this.id(e)===this.id(t))},id:function(e){if(!e)return"undefined";if(Object(p.g)(e))return this.quadToNQ(e);switch(e.termType){case h.c:return"defaultGraph";case h.t:return l.a.toString(e);default:var t=this.termToNQ(e);if(t)return t;throw new Error("Can't id term with type '".concat(e.termType,"'"))}},isQuad:function(e){return e instanceof c.a},literal:function(e,t){if("string"!=typeof e&&!t)return s.a.fromValue(e);var n="string"==typeof e?e:""+e;return"string"==typeof t?-1===t.indexOf(":")?new s.a(n,t):new s.a(n,null,this.namedNode(t)):new s.a(n,null,t)},namedNode:function(e){return new u.a(e)},quad:function(e,t,n,r){return new c.a(e,t,n,r||v)},triple:function(e,t,n,r){return this.quad(e,t,n,r)},quadToNQ:function(e){return"".concat(this.termToNQ(e.subject)," ").concat(this.termToNQ(e.predicate)," ").concat(this.termToNQ(e.object)," ").concat(this.termToNQ(e.graph)," .")},termToNQ:function(e){var t=this;switch(e.termType){case h.a:return"_:"+e.value;case h.c:return"";case h.d:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case h.h:return s.a.toNT(e);case h.e:case h.n:return"<"+e.value+">";case h.b:return"("+e.elements.map((function(e){return t.termToNQ(e)})).join(" ")+")";default:throw new Error("Can't serialize nonstandard term type (was '".concat(e.termType,"')"))}},toNQ:function(e){return this.isQuad(e)?this.quadToNQ(e):this.termToNQ(e)},variable:function(e){return new l.a(e)}};t.a=y},function(e,t,n){"use strict";n.d(t,"a",(function(){return j}));var r=n(22),i=n.n(r),a=n(4),o=n.n(a),s=n(5),u=n.n(s),c=n(3),l=n.n(c),h=n(12),d=n.n(h),f=n(14),p=n.n(f),v=n(9),y=n.n(v),g=n(0),m=n.n(g),b=n(16),w=n(8),x=n(11),_=n(1),k=n(7),T={boolean:new w.a("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new w.a("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new w.a("http://www.w3.org/2001/XMLSchema#decimal"),double:new w.a("http://www.w3.org/2001/XMLSchema#double"),integer:new w.a("http://www.w3.org/2001/XMLSchema#integer"),langString:new w.a("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new w.a("http://www.w3.org/2001/XMLSchema#string")};function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var i=y()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p()(this,n)}}var j=function(e){d()(n,e);var t=N(n);function n(e,r,i){var a;return o()(this,n),a=t.call(this,e),m()(l()(a),"termType",_.h),m()(l()(a),"classOrder",b.a.Literal),m()(l()(a),"datatype",T.string),m()(l()(a),"isVar",0),m()(l()(a),"language",""),r?(a.language=r,a.datatype=T.langString):a.datatype=i?w.a.fromValue(i):T.string,a}return u()(n,[{key:"copy",value:function(){return new n(this.value,this.lang,this.datatype)}},{key:"equals",value:function(e){return!!e&&(this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(!this.datatype&&!e.datatype||this.datatype&&this.datatype.equals(e.datatype)))}},{key:"lang",get:function(){return this.language},set:function(e){this.language=e||""}},{key:"toNT",value:function(){return n.toNT(this)}},{key:"toString",value:function(){return""+this.value}}],[{key:"toNT",value:function(e){if("number"==typeof e.value)return""+e.value;if("string"!=typeof e.value)throw new Error("Value of RDF literal is not string or number: "+e.value);var t=e.value;return t='"'+(t=(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',e.language?t+="@"+e.language:e.datatype.equals(T.string)||(t+="^^"+e.datatype.toCanonical()),t}},{key:"fromBoolean",value:function(e){return new n(e?"1":"0",null,T.boolean)}},{key:"fromDate",value:function(e){if(!(e instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");var t=function(e){return(""+(100+e)).slice(1,3)};return new n(e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"Z",null,T.dateTime)}},{key:"fromNumber",value:function(e){if("number"!=typeof e)throw new TypeError("Invalid argument to Literal.fromNumber()");var t,r=e.toString();return t=r.indexOf("e")<0&&Math.abs(e)<=Number.MAX_SAFE_INTEGER?Number.isInteger(e)?T.integer:T.decimal:T.double,new n(r,null,t)}},{key:"fromValue",value:function(e){if(Object(k.d)(e))return e;switch(i()(e)){case"object":if(e instanceof Date)return n.fromDate(e);case"boolean":return n.fromBoolean(e);case"number":return n.fromNumber(e);case"string":return new n(e)}throw new Error("Can't make literal from "+e+" of type "+i()(e))}}]),n}(x.a)},function(e,t,n){"use strict";var r;n.d(t,"a",(function(){return r})),function(e){e.collections="COLLECTIONS",e.defaultGraphType="DEFAULT_GRAPH_TYPE",e.equalsMethod="EQUALS_METHOD",e.id="ID",e.identity="IDENTITY",e.reversibleId="REVERSIBLE_ID",e.variableType="VARIABLE_TYPE"}(r||(r={}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(3),u=n.n(s),c=n(12),l=n.n(c),h=n(14),d=n.n(h),f=n(9),p=n.n(f),v=n(0),y=n.n(v),g=n(16),m=n(11),b=n(1);function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var x=function(e){l()(n,e);var t=w(n);function n(e){var r;return i()(this,n),r=t.call(this,n.getId(e)),y()(u()(r),"termType",b.a),y()(u()(r),"classOrder",g.a.BlankNode),y()(u()(r),"isBlank",1),y()(u()(r),"isVar",1),r}return o()(n,[{key:"id",get:function(){return this.value},set:function(e){this.value=e}},{key:"compareTerm",value:function(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.id<e.id?-1:this.id>e.id?1:0}},{key:"copy",value:function(e){var t=new n;return e.copyTo(this,t),t}},{key:"toCanonical",value:function(){return n.NTAnonymousNodePrefix+this.value}},{key:"toString",value:function(){return n.NTAnonymousNodePrefix+this.id}}],[{key:"getId",value:function(e){if(e){if("string"!=typeof e)throw console.log("Bad blank id:",e),new Error("Bad id argument to new blank node: "+e);if(e.includes("#")){var t=e.split("#");return t[t.length-1]}return e}return"n"+n.nextId++}}]),n}(m.a);y()(x,"nextId",0),y()(x,"NTAnonymousNodePrefix","_:")},function(e,t,n){"use strict";const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",a="http://www.w3.org/2000/10/swap/";t.a={xsd:{decimal:i+"decimal",boolean:i+"boolean",double:i+"double",integer:i+"integer",string:i+"string"},rdf:{type:r+"type",nil:r+"nil",first:r+"first",rest:r+"rest",langString:r+"langString"},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:a+"reify#forSome",forAll:a+"reify#forAll"},log:{implies:a+"log#implies"}}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(3),u=n.n(s),c=n(12),l=n.n(c),h=n(14),d=n.n(h),f=n(9),p=n.n(f),v=n(0),y=n.n(v),g=n(16),m=n(11),b=n(1),w=n(6);function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var _=function(e){l()(n,e);var t=x(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return i()(this,n),e=t.call(this,r),y()(u()(e),"termType",b.t),y()(u()(e),"base","varid:"),y()(u()(e),"classOrder",g.a.Variable),y()(u()(e),"isVar",1),y()(u()(e),"uri",void 0),e.base="varid:",e.uri=w.join(r,e.base),e}return o()(n,[{key:"equals",value:function(e){return!!e&&(this.termType===e.termType&&this.value===e.value)}},{key:"hashString",value:function(){return this.toString()}},{key:"substitute",value:function(e){var t;return null!=(t=e[this.toNT()])?t:this}},{key:"toString",value:function(){return n.toString(this)}}],[{key:"toString",value:function(e){return e.uri.slice(0,e.base.length)===e.base?"?".concat(e.uri.slice(e.base.length)):"?".concat(e.uri)}}]),n}(m.a)},function(e,t,n){"use strict";const r={};e.exports=r,r.isArray=Array.isArray,r.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),r.isDouble=e=>r.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),r.isEmptyObject=e=>r.isObject(e)&&0===Object.keys(e).length,r.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),r.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),r.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),r.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),r.isUndefined=e=>void 0===e},function(e,t,n){"use strict";function r(e){return"string"==typeof e?e:e.value}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(32),i=n(11),a=n(13),o=n(7);i.a.fromValue=r.b,t.a=i.a;var s={xsd:Object(a.a)("http://www.w3.org/2001/XMLSchema#")};i.a.toJS=function(e){return Object(o.b)(e)?e.elements.map(i.a.toJS):Object(o.d)(e)?e.datatype.equals(s.xsd("boolean"))?"1"===e.value||"true"===e.value:e.datatype.equals(s.xsd("dateTime"))||e.datatype.equals(s.xsd("date"))?new Date(e.value):e.datatype.equals(s.xsd("integer"))||e.datatype.equals(s.xsd("float"))||e.datatype.equals(s.xsd("decimal"))?Number(e.value):e.value:e}},function(e,t,n){"use strict";const r=n(30),i=n(24),a=n(57).IdentifierIssuer,o=n(29),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,u=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l={accept:"application/ld+json, application/json"},h={};e.exports=h,h.IdentifierIssuer=a,h.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let n=0;n<e.length;++n)t[n]=h.clone(e[n])}else if(e instanceof Map){t=new Map;for(const[n,r]of e)t.set(n,h.clone(r))}else if(e instanceof Set){t=new Set;for(const n of e)t.add(h.clone(n))}else if(i.isObject(e)){t={};for(const n in e)t[n]=h.clone(e[n])}else t=e.toString();return t}return e},h.asArray=function(e){return Array.isArray(e)?e:[e]},h.buildHeaders=(e={})=>{if(Object.keys(e).some(e=>"accept"===e.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+l.accept+'" is supported.');return Object.assign({Accept:l.accept},e)},h.parseLinkHeader=e=>{const t={},n=e.match(s);for(let e=0;e<n.length;++e){let r=n[e].match(u);if(!r)continue;const i={target:r[1]},a=r[2];for(;r=c.exec(a);)i[r[1]]=void 0===r[2]?r[3]:r[2];const o=i.rel||"";Array.isArray(t[o])?t[o].push(i):t.hasOwnProperty(o)?t[o]=[t[o],i]:t[o]=i}return t},h.validateTypeValue=(e,t)=>{if(!(i.isString(e)||i.isArray(e)&&e.every(e=>i.isString(e)))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&h.asArray(e["@default"]).every(e=>i.isString(e)))return}throw new o('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},h.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!i.isArray(n)||n.length>0}return!1},h.hasValue=(e,t,n)=>{if(h.hasProperty(e,t)){let a=e[t];const o=r.isList(a);if(i.isArray(a)||o){o&&(a=a["@list"]);for(let e=0;e<a.length;++e)if(h.compareValues(n,a[e]))return!0}else if(!i.isArray(n))return h.compareValues(n,a)}return!1},h.addValue=(e,t,n,r)=>{if("propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1),"valueIsArray"in r||(r.valueIsArray=!1),"allowDuplicate"in r||(r.allowDuplicate=!0),"prependValue"in r||(r.prependValue=!1),r.valueIsArray)e[t]=n;else if(i.isArray(n)){0===n.length&&r.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),r.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let i=0;i<n.length;++i)h.addValue(e,t,n[i],r)}else if(e.hasOwnProperty(t)){const a=!r.allowDuplicate&&h.hasValue(e,t,n);i.isArray(e[t])||a&&!r.propertyIsArray||(e[t]=[e[t]]),a||(r.prependValue?e[t].unshift(n):e[t].push(n))}else e[t]=r.propertyIsArray?[n]:n},h.getValues=(e,t)=>[].concat(e[t]||[]),h.removeProperty=(e,t)=>{delete e[t]},h.removeValue=(e,t,n,r)=>{"propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1);const i=h.getValues(e,t).filter(e=>!h.compareValues(e,n));0===i.length?h.removeProperty(e,t):1!==i.length||r.propertyIsArray?e[t]=i:e[t]=i[0]},h.relabelBlankNodes=(e,t)=>function e(t,n){if(i.isArray(n))for(let r=0;r<n.length;++r)n[r]=e(t,n[r]);else if(r.isList(n))n["@list"]=e(t,n["@list"]);else if(i.isObject(n)){r.isBlankNode(n)&&(n["@id"]=t.getId(n["@id"]));const i=Object.keys(n).sort();for(let r=0;r<i.length;++r){const a=i[r];"@id"!==a&&(n[a]=e(t,n[a]))}}return n}((t=t||{}).issuer||new a("_:b"),e),h.compareValues=(e,t)=>e===t||(!(!r.isValue(e)||!r.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"]),h.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},function(e,t,n){"use strict";n.d(t,"a",(function(){return U}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(3),u=n.n(s),c=n(12),l=n.n(c),h=n(14),d=n.n(h),f=n(9),p=n.n(f),v=n(0),y=n.n(v),g=n(16),m=n(31),b=n(47),w=n(15),x=n(10),_=n(7),k=n(26),T=n(23),N=n(36),j=n(1),O=n(8),I=n(61),S=n(20),E=n(37),R=n(18);function A(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var D="http://www.w3.org/2002/07/owl#";function P(e,t,n,r){var i=e.any(t,n,void 0);return!!i&&(e.equate(i,r),!0)}function M(e,t,n,r){var i=e.any(void 0,n,r);return!!i&&(e.equate(i,t),!0)}function F(e,t,n,r,i){e.typeCallback&&e.typeCallback(e,r,i);var a=e.classActions[e.id(r)],o=!1;if(a)for(var s=0;s<a.length;s++)o=o||a[s](e,t,n,r,i);return o}var U=function(e){l()(n,e);var t=L(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i()(this,n),r=t.call(this,void 0,void 0,void 0,void 0,a),y()(u()(r),"updater",void 0),y()(u()(r),"namespaces",void 0),y()(u()(r),"classActions",void 0),y()(u()(r),"propertyActions",void 0),y()(u()(r),"redirections",void 0),y()(u()(r),"aliases",void 0),y()(u()(r),"HTTPRedirects",void 0),y()(u()(r),"subjectIndex",void 0),y()(u()(r),"predicateIndex",void 0),y()(u()(r),"objectIndex",void 0),y()(u()(r),"whyIndex",void 0),y()(u()(r),"index",void 0),y()(u()(r),"features",void 0),y()(u()(r),"_universalVariables",void 0),y()(u()(r),"_existentialVariables",void 0),y()(u()(r),"rdfArrayRemove",void 0),y()(u()(r),"dataCallbacks",void 0),r.propertyActions={},r.classActions={},r.redirections=[],r.aliases=[],r.HTTPRedirects=[],r.subjectIndex=[],r.predicateIndex=[],r.objectIndex=[],r.whyIndex=[],r.index=[r.subjectIndex,r.predicateIndex,r.objectIndex,r.whyIndex],r.namespaces={},r.features=e||[],r.rdfArrayRemove=a.rdfArrayRemove||x.RDFArrayRemove,a.dataCallback&&(r.dataCallbacks=[a.dataCallback]),r.initPropertyActions(r.features),r}return o()(n,[{key:"substitute",value:function(e){var t=this.statements.map((function(t){return t.substitute(e)})),r=new n;return r.add(t),r}},{key:"addDataCallback",value:function(e){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(e)}},{key:"applyPatch",value:function(e,t,n){var r,i=this,a=null;function o(o){if(e.delete){r=e.delete,a&&(r=r.substitute(a)),r=r.statements;var s=[],u=r.map((function(e){var n=i.statementsMatching(e.subject,e.predicate,e.object,t);return 0===n.length?(s.push(e),null):n[0]}));if(s.length)return n("Could not find to delete: "+s.join("\n or "));u.map((function(e){i.remove(e)}))}e.insert&&(r=e.insert,a&&(r=r.substitute(a)),(r=r.statements).map((function(e){e.graph=t,i.add(e.subject,e.predicate,e.object,e.graph)}))),o()}if(e.where){var s=new N.a("patch");s.pat=e.where,s.pat.statements.map((function(e){e.graph=Object(I.namedNode)(t.value)})),s.sync=!0;var u=[];i.query(s,(function(e){u.push(e)}),i.fetcher,(function(){return 0===u.length?n("No match found to be patched:"+e.where):u.length>1?n("Patch ambiguous. No patch done."):(a=u[0],void o(n))}))}else o(n)}},{key:"declareExistential",value:function(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}},{key:"initPropertyActions",value:function(e){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[F],Object(w.a)(e,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(D,"sameAs")))]=[function(e,t,n,r,i){return e.equate(t,r),!0}]),Object(w.a)(e,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(D,"InverseFunctionalProperty")))]=[function(e,t,n,r,i){return e.newPropertyAction(t,M)}]),Object(w.a)(e,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(D,"FunctionalProperty")))]=[function(e,t,n,r,i){return e.newPropertyAction(t,P)}])}},{key:"addStatement",value:function(e){return this.add(e.subject,e.predicate,e.object,e.graph),this.statements.length}},{key:"add",value:function(e,t,n,r){var i,a,o;if(1===arguments.length){if(e instanceof Array)for(i=0;i<e.length;i++)this.add(e[i]);else Object(_.g)(e)?this.add(e.subject,e.predicate,e.object,e.graph):Object(_.k)(e)&&this.add(e.statements);return this}r||(r=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof e&&(e=this.rdfFactory.namedNode(e)),t=k.a.fromValue(t);var s=k.a.fromValue(n);if(r=k.a.fromValue(r),!Object(_.l)(e))throw new Error("Subject is not a subject type");if(!Object(_.f)(t))throw new Error("Predicate ".concat(t," is not a predicate type"));if(!Object(_.i)(s))throw new Error("Object ".concat(s," is not an object type"));if(!Object(_.c)(r))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,t,r);var u=this.id(this.canon(t)),c=!1;if(a=this.propertyActions[u])for(i=0;i<a.length;i++)c=c||a[i](this,e,t,s,r);if(this.holds(e,t,s,r))return null;var l=[this.id(this.canon(e)),u,this.id(this.canon(s)),this.id(this.canon(r))];for(o=this.rdfFactory.quad(e,t,s,r),i=0;i<4;i++){var h=this.index[i],d=l[i];h[d]||(h[d]=[]),h[d].push(o)}if(this.statements.push(o),this.dataCallbacks){var f,p=A(this.dataCallbacks);try{for(p.s();!(f=p.n()).done;){var v=f.value;v(o)}}catch(e){p.e(e)}finally{p.f()}}return o}},{key:"canon",value:function(e){if(!e)return e;var t=this.redirections[this.id(e)];if(t)return t;switch(e.termType){case j.a:return new S.a(e.value);case j.b:return e;case j.c:return new E.a;case j.d:case j.e:return e;case j.h:return new R.a(e.value,e.language,e.datatype);case j.n:return new O.a(e.value);case j.t:return new T.a(e.value);default:throw new Error("Term Type not recognized for canonization: ".concat(e.termType))}}},{key:"check",value:function(){this.checkStatementList(this.statements);for(var e=0;e<4;e++){var t=this.index[e];for(var n in t)t.hasOwnProperty(n)&&this.checkStatementList(t[n],e)}}},{key:"checkStatementList",value:function(e,t){void 0===t&&(t=0);for(var n,r=" found in "+["subject","predicate","object","why"][t]+" index.",i=0;i<e.length;i++){for(var a=[(n=e[i]).subject,n.predicate,n.object,n.graph],o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].subject.equals(t.subject)&&e[n].predicate.equals(t.predicate)&&e[n].object.equals(t.object)&&e[n].why.equals(t.graph))return!0},s=0;s<4;s++){var u=this.canon(a[s]),c=this.id(u);this.index[s][c]&&o(this.index[s][c],n)}if(!o(this.statements,n))throw new Error("Statement list does not statement "+n+"@"+n.graph+r)}}},{key:"close",value:function(){return this}},{key:"compareTerms",value:function(e,t){return Object.prototype.hasOwnProperty.call(e,"compareTerm")?e.compareTerm(t):g.a[e.termType]<g.a[t.termType]?-1:g.a[e.termType]>g.a[t.termType]?1:e.value<t.value?-1:e.value>t.value?1:0}},{key:"copyTo",value:function(e,t,n){n||(n=[]);var r=this.statementsMatching(e);-1!==Object(w.a)(n,"two-direction")&&r.concat(this.statementsMatching(void 0,void 0,e));for(var i=0;i<r.length;i++){var a=r[i];switch(a.object.termType){case"NamedNode":this.add(t,a.predicate,a.object);break;case"Literal":case"BlankNode":case"Collection":this.add(t,a.predicate,a.object.copy(this))}-1!==Object(w.a)(n,"delete")&&this.remove(a)}}},{key:"equate",value:function(e,t){var n=this.canon(e),r=this.canon(t),i=this.compareTerms(n,r);return!i||(i<0?this.replaceWith(r,n):this.replaceWith(n,r))}},{key:"formula",value:function(e){return new n(e)}},{key:"length",get:function(){return this.statements.length}},{key:"match",value:function(e,t,n,r){return this.statementsMatching(k.a.fromValue(e),k.a.fromValue(t),k.a.fromValue(n),k.a.fromValue(r))}},{key:"mentionsURI",value:function(e){var t="<"+e+">";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}},{key:"newExistential",value:function(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}},{key:"newPropertyAction",value:function(e,t){var n=this.id(e);this.propertyActions[n]||(this.propertyActions[n]=[]),this.propertyActions[n].push(t);for(var r=this.statementsMatching(void 0,e,void 0),i=!1,a=0;a<r.length;a++)i=i||t(this,r[a].subject,e,r[a].object);return i}},{key:"newUniversal",value:function(e){var t=this.sym(e);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(t),t}},{key:"variable",value:function(e){return new T.a(e)}},{key:"nextSymbol",value:function(e){for(var t=0;;t++){var n=e.value+"#n"+t;if(!this.mentionsURI(n))return this.sym(n)}}},{key:"query",value:function(e,t,n,r){return N.b.call(this,e,t,n,r)}},{key:"querySync",value:function(e){var t=[];var n=!1;if(e.sync=!0,N.b.call(this,e,(function(e){t.push(e)}),null,(function(){n=!0})),!n)throw new Error("Sync query should have called done function");return t}},{key:"remove",value:function(e){if(e instanceof Array){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}if(Object(_.k)(e))return this.remove(e.statements);var n=this.statementsMatching(e.subject,e.predicate,e.object,e.graph);if(!n.length)throw new Error("Statement to be removed is not on store: "+e);return this.removeStatement(n[0]),this}},{key:"removeDocument",value:function(e){for(var t=this.statementsMatching(void 0,void 0,void 0,e).slice(),n=0;n<t.length;n++)this.removeStatement(t[n]);return this}},{key:"removeMany",value:function(e,t,n,r,i){for(var a=this.statementsMatching(e,t,n,r,!1),o=[],s=0;s<a.length;s++)o.push(a[s]);for(i&&(o=o.slice(0,i)),s=0;s<o.length;s++)this.remove(o[s])}},{key:"removeMatches",value:function(e,t,n,r){return this.removeStatements(this.statementsMatching(e,t,n,r)),this}},{key:"removeStatement",value:function(e){for(var t=[e.subject,e.predicate,e.object,e.graph],n=0;n<4;n++){var r=this.canon(t[n]),i=this.id(r);this.index[n][i]&&this.rdfArrayRemove(this.index[n][i],e)}return this.rdfArrayRemove(this.statements,e),this}},{key:"removeStatements",value:function(e){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}},{key:"replaceWith",value:function(e,t){for(var n=this.id(e),r=this.id(t),i=function(e){var t=e[n];if(t){var i=e[r];e[r]=i?t.concat(i):t,delete e[n]}},a=0;a<4;a++)i(this.index[a]);if(this.redirections[n]=t,e.value){if(this.aliases[r]||(this.aliases[r]=[]),this.aliases[r].push(e),this.aliases[n])for(a=0;a<this.aliases[n].length;a++)this.redirections[this.id(this.aliases[n][a])]=t,this.aliases[r].push(this.aliases[n][a]);this.add(t,this.sym("http://www.w3.org/2007/ont/link#uri"),e),this.fetcher&&this.fetcher.nowKnownAs(e,t)}return i(this.classActions),i(this.propertyActions),!0}},{key:"allAliases",value:function(e){var t=this.aliases[this.id(this.canon(e))]||[];return t.push(this.canon(e)),t}},{key:"sameThings",value:function(e,t){if(e.equals(t))return!0;var n=this.canon(e);if(!n)return!1;var r=this.canon(t);return!!r&&n.value===r.value}},{key:"setPrefixForURI",value:function(e,t){"tab"===e&&this.namespaces.tab||"ns"!==e.slice(0,2)&&"default"!==e.slice(0,7)&&(this.namespaces[e]=t)}},{key:"statementsMatching",value:function(e,t,n,r,i){var a,o,s=[e,t,n,r],u=[],c=[],l=[],h=[];for(a=0;a<4;a++)u[a]=this.canon(k.a.fromValue(s[a])),u[a]?(h.push(a),c[a]=this.id(u[a])):l.push(a);if(0===h.length)return this.statements;if(1===h.length)return a=h[0],(o=this.index[a][c[a]])&&i&&o.length>1&&(o=o.slice(0,1)),o=o||[];var d,f,p=1e10;for(f=0;f<h.length;f++){if(a=h[f],!(o=this.index[a][c[a]]))return[];o.length<p&&(p=o.length,d=f)}for(var v=h[d],y=this.index[v][c[v]],g=h.slice(0,d).concat(h.slice(d+1)),m=[],b=["subject","predicate","object","why"],w=0;w<y.length;w++){var x=y[w];for(f=0;f<g.length;f++)if(a=g[f],!this.canon(x[b[a]]).equals(u[a])){x=null;break}if(null!=x&&(m.push(x),i))break}return m}},{key:"uris",value:function(e){var t=this.canon(e),n=this.aliases[this.id(t)];if(!t.value)return[];var r=[t.value];if(n)for(var i=0;i<n.length;i++)r.push(n[i].uri);return r}}],[{key:"defaultGraphURI",get:function(){return m.a}}]),n}(b.a);y()(U,"handleRDFType",void 0),U.handleRDFType=F},function(e,t,n){"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",n={}){super(e),this.name=t,this.message=e,this.details=n}}},function(e,t,n){"use strict";const r=n(24),i={};e.exports=i,i.isSubject=e=>{if(r.isObject(e)&&!("@value"in e||"@set"in e||"@list"in e)){return Object.keys(e).length>1||!("@id"in e)}return!1},i.isSubjectReference=e=>r.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>r.isObject(e)&&"@value"in e,i.isList=e=>r.isObject(e)&&"@list"in e,i.isGraph=e=>r.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(e=>"@id"!==e&&"@index"!==e).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>!!r.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(8),i="chrome:theSession";new r.a(i)},function(e,t,n){"use strict";n.d(t,"b",(function(){return T})),n.d(t,"a",(function(){return N}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(3),u=n.n(s),c=n(12),l=n.n(c),h=n(14),d=n.n(h),f=n(9),p=n.n(f),v=n(0),y=n.n(v),g=n(20),m=n(16),b=n(18),w=n(11),x=n(1),_=n(7);function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}function T(e){return null==e||Object(_.m)(e)?e:Array.isArray(e)?new N(e):b.a.fromValue(e)}var N=function(e){l()(n,e);var t=k(n);function n(e){var r;return i()(this,n),r=t.call(this,(g.a.nextId++).toString()),y()(u()(r),"termType",x.b),y()(u()(r),"classOrder",m.a.Collection),y()(u()(r),"closed",!1),y()(u()(r),"compareTerm",g.a.prototype.compareTerm),y()(u()(r),"elements",[]),y()(u()(r),"isVar",0),e&&e.length>0&&e.forEach((function(e){r.elements.push(T(e))})),r}return o()(n,[{key:"id",get:function(){return this.value},set:function(e){this.value=e}},{key:"append",value:function(e){return this.elements.push(e)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(e){return new n(this.elements.map((function(t){return t.substitute(e)})))}},{key:"toNT",value:function(){return n.toNT(this)}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(e){return this.elements.unshift(e)}}],[{key:"toNT",value:function(e){return g.a.NTAnonymousNodePrefix+e.id}}]),n}(w.a);y()(N,"termType",x.b)},function(e,t,n){"use strict";const r=n(24),i={};e.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const n={},r=i.parsers[t||"full"],a=r.regex.exec(e);let o=r.keys.length;for(;o--;)n[r.keys[o]]=void 0===a[o]?null:a[o];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!r.isString(e)||(e=i.parse(e||""));const n=i.parse(t),a={protocol:e.protocol||""};if(null!==n.authority)a.authority=n.authority,a.path=n.path,a.query=n.query;else if(a.authority=e.authority,""===n.path)a.path=e.path,null!==n.query?a.query=n.query:a.query=e.query;else{if(0===n.path.indexOf("/"))a.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,a.path=t}a.query=n.query}""!==n.path&&(a.path=i.removeDotSegments(a.path));let o=a.protocol;return null!==a.authority&&(o+="//"+a.authority),o+=a.path,null!==a.query&&(o+="?"+a.query),null!==n.fragment&&(o+="#"+n.fragment),""===o&&(o="./"),o},i.removeBase=(e,t)=>{if(null===e)return t;e&&!r.isString(e)||(e=i.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const a=i.parse(t.substr(n.length)),o=e.normalizedPath.split("/"),s=a.normalizedPath.split("/"),u=a.fragment||a.query?0:1;for(;o.length>0&&s.length>u&&o[0]===s[0];)o.shift(),s.shift();let c="";if(o.length>0){o.pop();for(let e=0;e<o.length;++e)c+="../"}return c+=s.join("/"),null!==a.query&&(c+="?"+a.query),null!==a.fragment&&(c+="#"+a.fragment),""===c&&(c="./"),c},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),r=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),r&&n.push("")):r&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const a=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>r.isString(e)&&a.test(e),i.isRelative=e=>r.isString(e)},function(e,t,n){"use strict";var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(22),u=n.n(s),c=n(6),l=n(15);var h=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=String.fromCharCode(r):r>127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t},d="http://www.w3.org/2000/10/swap/log#",f=function(e){return e},p=function(e){return e},v=function(e){if(e.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},y=function(e){return e.length},g=function(e,t,n){if(void 0===e.slice)throw"@@ mising.js: No .slice function for "+e+" of type "+u()(e);return void 0===n||null==n?e.slice(t):e.slice(t,n)},m=Error("dummy error stop iteration"),b=function(e){return this.last=0,this.li=e,this.next=function(){if(this.last==this.li.length)throw m;return this.li[this.last++]},this},w=function(e,t){return e.indexOf(t)},x=function(e,t){if(!e){if(t)throw"python Assertion failed: "+t;throw"(python) Assertion failed."}};String.prototype.encode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return h(this)},String.prototype.decode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return this};var _=function(e,t){return c.join(t,e)};var k="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~:",T=(new RegExp("^[ \\t]*(#[^\\n]*)?\\r?\\n","g"),new RegExp("^[ \\t]*(#[^\\n]*)?$","g"),new RegExp("^[ \\t]*","g"),new RegExp("^[-+]?[0-9]+","g"),new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g")),N=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?"),j=(new RegExp("^[0-9]+","g"),new RegExp('[\\\\\\r\\n\\"]',"g")),O=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");t.a=function(e,t,n,r,i,a,o,s){return new I(e,t,n,r,i,a,o,s)};var I=function(){function e(t,n,r,a,o,s,u,c){i()(this,e),void 0===n&&(n=null),void 0===r&&(r=""),void 0===a&&(a=null),void 0===o&&(o=""),void 0===s&&(s=null),void 0===u&&(u=""),void 0===c&&(c=null),this._bindings=new v([]),this._flags=u,""!=r&&(x(r.indexOf(":")>=0,"Document URI not absolute: "+r),this._bindings[""]=r+"#"),this._store=t,o&&t.setGenPrefix(o),this._thisDoc=r,this.source=t.sym(r),this.lines=0,this.statementCount=0,this.startOfLine=0,this.previousLine=0,this._genPrefix=o,this.keywords=new p(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new v([]),this._variables=new v([]),this._parentVariables=new v([]),this._reason=c,this._reason2=null,this._baseURI=a||(r||null),x(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==n?this._thisDoc?this._formula=t.formula(r+"#_formula"):this._formula=t.formula():this._formula=n,this._context=this._formula,this._parentContext=null}return o()(e,[{key:"here",value:function(e){return this._genPrefix+"_L"+this.lines+"C"+(e-this.startOfLine+1)}},{key:"formula",value:function(){return this._formula}},{key:"loadStream",value:function(e){return this.loadBuf(e.read())}},{key:"loadBuf",value:function(e){return this.startDoc(),this.feed(e),this.endDoc()}},{key:"feed",value:function(e){for(var t=e.decode("utf-8"),n=0;n>=0;){var r=this.skipSpace(t,n);if(r<0)return;if((n=this.directiveOrStatement(t,r))<0)throw E(this._thisDoc,this.lines,t,r,"expected directive or statement")}}},{key:"directiveOrStatement",value:function(e,t){var n,r=this.skipSpace(e,t);return r<0?r:(n=this.directive(e,r))>=0||(n=this.statement(e,r))>=0?this.checkDot(e,n):n}},{key:"tok",value:function(e,t,n){if("@"==t.slice(n,n+1))n=n+1;else if(Object(l.a)(this.keywords,e)<0)return-1;var r=n+y(e);return t.slice(n,r)==e&&"\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~".indexOf(t.charAt(r))>=0?r:-1}},{key:"directive",value:function(e,t){if((a=this.skipSpace(e,t))<0)return a;var n=new p([]);if((a=this.tok("bind",e,t))>0)throw E(this._thisDoc,this.lines,e,t,"keyword bind is obsolete: use @prefix");if((a=this.tok("keywords",e,t))>0){if((t=this.commaSeparatedList(e,a,n,!1))<0)throw E(this._thisDoc,this.lines,e,t,"'@keywords' needs comma separated list of words");return this.setKeywords(g(n,null,null)),t}if((a=this.tok("forAll",e,t))>0){if((t=this.commaSeparatedList(e,a,n,!0))<0)throw E(this._thisDoc,this.lines,e,t,"Bad variable list after @forAll");var r=new b(n);try{for(;;){var i=r.next();(Object(l.a)(this._variables,i)<0||Object(l.a)(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(e){if(e!=m)throw e}return t}if((a=this.tok("forSome",e,t))>0){if((t=this.commaSeparatedList(e,a,n,this.uri_ref2))<0)throw E(this._thisDoc,this.lines,e,t,"Bad variable list after @forSome");r=new b(n);try{for(;;){i=r.next();this._context.declareExistential(i)}}catch(e){if(e!=m)throw e}return t}if((a=this.tok("prefix",e,t))>=0){var a,o=new p([]);if((t=this.qname(e,a,o))<0)throw E(this._thisDoc,this.lines,e,a,"expected qname after @prefix");if((a=this.uri_ref2(e,t,o))<0)throw E(this._thisDoc,this.lines,e,t,"expected <uriref> after @prefix _qname_");var s=o[1].uri;if(this._baseURI)s=_(this._baseURI,s);else x(s.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS");return x(s.indexOf(":")>=0),this._bindings[o[0][0]]=s,this.bind(o[0][0],function(e){return encodeURI(e)}(s)),a}if((a=this.tok("base",e,t))>=0){o=new p([]);if((t=this.uri_ref2(e,a,o))<0)throw E(this._thisDoc,this.lines,e,a,"expected <uri> after @base ");s=o[0].uri;if(!this._baseURI)throw E(this._thisDoc,this.lines,e,a,"With no previous base URI, cannot use relative URI in @base <"+s+">");s=_(this._baseURI,s);return x(s.indexOf(":")>=0),this._baseURI=s,t}return-1}},{key:"bind",value:function(e,t){""==e||this._store.setPrefixForURI(e,t)}},{key:"setKeywords",value:function(e){null==e?this.keywordsSet=0:(this.keywords=e,this.keywordsSet=1)}},{key:"startDoc",value:function(){}},{key:"endDoc",value:function(){return this._formula}},{key:"makeStatement",value:function(e){e[0].add(e[2],e[1],e[3],this.source),this.statementCount+=1}},{key:"statement",value:function(e,t){var n=new p([]);if((t=this.object(e,t,n))<0)return t;var r=this.property_list(e,t,n[0]);if(r<0)throw E(this._thisDoc,this.lines,e,t,"expected propertylist");return r}},{key:"subject",value:function(e,t,n){return this.item(e,t,n)}},{key:"verb",value:function(e,t,n){if((i=this.skipSpace(e,t))<0)return i;var r=new p([]);if((i=this.tok("has",e,t))>=0){if((t=this.prop(e,i,r))<0)throw E(this._thisDoc,this.lines,e,i,"expected property after 'has'");return n.push(new f(["->",r[0]])),t}if((i=this.tok("is",e,t))>=0){if((t=this.prop(e,i,r))<0)throw E(this._thisDoc,this.lines,e,i,"expected <property> after 'is'");if((i=this.skipSpace(e,t))<0)throw E(this._thisDoc,this.lines,e,t,"End of file found, expected property after 'is'");var i;t=i;if((i=this.tok("of",e,t))<0)throw E(this._thisDoc,this.lines,e,t,"expected 'of' after 'is' <prop>");return n.push(new f(["<-",r[0]])),i}if((i=this.tok("a",e,t))>=0)return n.push(new f(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==e.slice(t,t+2))return n.push(new f(["<-",this._store.sym(d+"implies")])),t+2;if("="==e.slice(t,t+1))return">"==e.slice(t+1,t+2)?(n.push(new f(["->",this._store.sym(d+"implies")])),t+2):(n.push(new f(["->",this._store.sym("http://www.w3.org/2002/07/owl#sameAs")])),t+1);if(":="==e.slice(t,t+2))return n.push(new f(["->",d+"becomes"])),t+2;if((i=this.prop(e,t,r))>=0)return n.push(new f(["->",r[0]])),i;if(">-"==e.slice(t,t+2)||"<-"==e.slice(t,t+2))throw E(this._thisDoc,this.lines,e,i,">- ... -> syntax is obsolete.");return-1}},{key:"prop",value:function(e,t,n){return this.item(e,t,n)}},{key:"item",value:function(e,t,n){return this.path(e,t,n)}},{key:"blankNode",value:function(e){return this._context.bnode(e,this._reason2)}},{key:"path",value:function(e,t,n){if((a=this.nodeOrLiteral(e,t,n))<0)return a;for(;"!^.".indexOf(e.slice(a,a+1))>=0;){var r=e.slice(a,a+1);if("."==r){var i=e.slice(a+1,a+2);if(!i||k.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var a,o=n.pop(),s=this.blankNode(this.here(a));if((a=this.node(e,a+1,n))<0)throw E(this._thisDoc,this.lines,e,a,"EOF found in middle of path syntax");var u=n.pop();"^"==r?this.makeStatement(new f([this._context,u,s,o])):this.makeStatement(new f([this._context,u,o,s])),n.push(s)}return a}},{key:"anonymousNode",value:function(e){if(t=this._anonymousNodes[e])return t;var t=this._store.bnode(e);return this._anonymousNodes[e]=t,t}},{key:"node",value:function(e,t,n,r){void 0===r&&(r=null);var i=r;if((l=this.skipSpace(e,t))<0)return l;t=l;var a=e.slice(t,t+1);if("["==a){var o=this.here(t);if((l=this.skipSpace(e,t+1))<0)throw E(this._thisDoc,this.lines,e,t,"EOF after '['");if("="==e.slice(l,l+1)){var t=l+1,s=new p([]);if(!((l=this.objectList(e,t,s))>=0))throw E(this._thisDoc,this.lines,e,t,"objectList expected after [= ");i=s[0];if(y(s)>1){var u=new b(s);try{for(;;){var c=u.next();this.makeStatement(new f([this._context,this._store.sym("http://www.w3.org/2002/07/owl#sameAs"),i,c]))}}catch(e){if(e!=m)throw e}}if((l=this.skipSpace(e,l))<0)throw E(this._thisDoc,this.lines,e,t,"EOF when objectList expected after [ = ");if(";"==e.slice(l,l+1))var l=l+1}if(null==i)i=this.blankNode(o);if((t=this.property_list(e,l,i))<0)throw E(this._thisDoc,this.lines,e,l,"property_list expected");if((l=this.skipSpace(e,t))<0)throw E(this._thisDoc,this.lines,e,t,"EOF when ']' expected after [ <propertyList>");if("]"!=e.slice(l,l+1))throw E(this._thisDoc,this.lines,e,l,"']' expected");return n.push(i),l+1}if("{"==a){if("$"==e.slice(t+1,t+2)){for(var l=(t+=1)+1,h=new p([]),d=!0;;){if((t=this.skipSpace(e,l))<0)throw E(this._thisDoc,this.lines,e,t,"needed '$}', found end.");if("$}"==e.slice(t,t+2)){var l=t+2;break}if(d)d=!1;else{if(","!=e.slice(t,t+1))throw E(this._thisDoc,this.lines,e,t,"expected: ','");t+=1}var g=new p([]);if((l=this.item(e,t,g))<0)throw E(this._thisDoc,this.lines,e,t,"expected item in set or '$}'");h.push(g[0])}return n.push(this._store.newSet(h,this._context)),l}var l=t+1,w=this._parentContext;this._parentContext=this._context;var x=this._anonymousNodes,_=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new v([]),this._variables=this._variables.slice();var k=this._reason2;if(this._reason2=null,null==i)i=this._store.formula();for(this._context=i;;){if((t=this.skipSpace(e,l))<0)throw E(this._thisDoc,this.lines,e,t,"needed '}', found end.");if("}"==e.slice(t,t+1)){var l=t+1;break}if((l=this.directiveOrStatement(e,t))<0)throw E(this._thisDoc,this.lines,e,t,"expected statement or '}'")}return this._anonymousNodes=x,this._variables=this._parentVariables,this._parentVariables=_,this._context=this._parentContext,this._reason2=k,this._parentContext=w,n.push(i.close()),l}if("("==a){var T=this._store.list;if("$"==e.slice(t+1,t+2)){T=this._store.newSet;t+=1}for(l=t+1,h=new p([]);;){if((t=this.skipSpace(e,l))<0)throw E(this._thisDoc,this.lines,e,t,"needed ')', found end.");if(")"==e.slice(t,t+1)){l=t+1;break}g=new p([]);if((l=this.item(e,t,g))<0)throw E(this._thisDoc,this.lines,e,t,"expected item in list or ')'");h.push(g[0])}return n.push(T(h,this._context)),l}if((l=this.tok("this",e,t))>=0)throw E(this._thisDoc,this.lines,e,t,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");if((l=this.tok("true",e,t))>=0)return n.push(!0),l;if((l=this.tok("false",e,t))>=0)return n.push(!1),l;if(null==i&&(l=this.uri_ref2(e,t,n))>=0)return l;return-1}},{key:"property_list",value:function(e,t,n){for(;;){if((l=this.skipSpace(e,t))<0)throw E(this._thisDoc,this.lines,e,t,"EOF found when expected verb in property list");if(":-"!=e.slice(l,l+2)){t=l;var r=new p([]);if((l=this.verb(e,t,r))<=0)return t;var i=new p([]);if((t=this.objectList(e,l,i))<0)throw E(this._thisDoc,this.lines,e,l,"objectList expected");var a=new b(i);try{for(;;){var o=a.next(),s=r[0],u=s[0],c=s[1];"->"==u?this.makeStatement(new f([this._context,c,n,o])):this.makeStatement(new f([this._context,c,o,n]))}}catch(e){if(e!=m)throw e}if((l=this.skipSpace(e,t))<0)throw E(this._thisDoc,this.lines,e,l,"EOF found in list of objects");if(";"!=e.slice(t,t+1))return t;t=t+1}else{var l,t=l+2,h=new p([]);if((l=this.node(e,t,h,n))<0)throw E(this._thisDoc,this.lines,e,t,"bad {} or () or [] node after :- ");var t=l}}}},{key:"commaSeparatedList",value:function(e,t,n,r){if((i=this.skipSpace(e,t))<0)throw E(this._thisDoc,this.lines,e,i,"EOF found expecting comma sep list");if("."==e.charAt(i))return t;if(r)var i=this.uri_ref2(e,i,n);else i=this.bareWord(e,i,n);if(i<0)return-1;for(;;){if((t=this.skipSpace(e,i))<0)return t;var a=e.slice(t,t+1);if(","!=a)return"."!=a?-1:t;if(r)i=this.uri_ref2(e,t+1,n);else i=this.bareWord(e,t+1,n);if(i<0)throw E(this._thisDoc,this.lines,e,i,"bad list content")}}},{key:"objectList",value:function(e,t,n){if((t=this.object(e,t,n))<0)return-1;for(;;){var r=this.skipSpace(e,t);if(r<0)throw E(this._thisDoc,this.lines,e,r,"EOF found after object");if(","!=e.slice(r,r+1))return r;if((t=this.object(e,r+1,n))<0)return t}}},{key:"checkDot",value:function(e,t){var n=this.skipSpace(e,t);if(n<0)return n;if("."==e.slice(n,n+1))return n+1;if("}"==e.slice(n,n+1))return n;if("]"==e.slice(n,n+1))return n;throw E(this._thisDoc,this.lines,e,n,"expected '.' or '}' or ']' at end of statement")}},{key:"uri_ref2",value:function(e,t,n){var r=new p([]);if((f=this.qname(e,t,r))>=0){var i=r[0],a=i[0],o=i[1];if(null==a){x(0,"not used?");var s=this._baseURI+"#"}else{if(!(s=this._bindings[a])){if("_"==a)return n.push(this.anonymousNode(o)),f;throw E(this._thisDoc,this.lines,e,t,"Prefix "+a+" not bound.")}}var u=this._store.sym(s+o);return Object(l.a)(this._variables,u)>=0?n.push(this._variables[u]):n.push(u),f}if((t=this.skipSpace(e,t))<0)return-1;if("?"==e.charAt(t)){var c=new p([]);return(f=this.variable(e,t,c))>0?(n.push(c[0]),f):-1}if("<"==e.charAt(t)){for(var h=t=t+1;t<y(e);){if(">"==e.charAt(t)){var d=e.slice(h,t);if(this._baseURI)d=_(this._baseURI,d);else x(d.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs");if("#"==e.slice(t-1,t)&&"#"!=g(d,-1,null))d=d+"#";u=this._store.sym(d);return Object(l.a)(this._variables,u)>=0?n.push(this._variables[u]):n.push(u),t+1}t=t+1}throw E(this._thisDoc,this.lines,e,f,"unterminated URI reference")}if(this.keywordsSet){var f;c=new p([]);if((f=this.bareWord(e,t,c))<0)return-1;if(Object(l.a)(this.keywords,c[0])>=0)throw E(this._thisDoc,this.lines,e,t,'Keyword "'+c[0]+'" not allowed here.');return n.push(this._store.sym(this._bindings[""]+c[0])),f}return-1}},{key:"skipSpace",value:function(e,t){for(var n=t||0;n<e.length;n++){var r=e.charAt(n);if(" \n\r\t\f\v            ​\u2028\u2029 ".indexOf(r)<0){if("#"!==e.charAt(n))return n;for(;;n++){if(n===e.length)return-1;if("\n"===e.charAt(n)){this.lines=this.lines+1;break}}}else"\n"===e.charAt(n)&&(this.lines=this.lines+1)}return-1}},{key:"variable",value:function(e,t,n){if((r=this.skipSpace(e,t))<0)return-1;if("?"!=e.slice(r,r+1))return-1;var r;t=r+=1;if("0123456789-".indexOf(e.charAt(r))>=0)throw E(this._thisDoc,this.lines,e,r,"Varible name can't start with '"+e.charAt(r)+"s'");for(;t<y(e)&&k.indexOf(e.charAt(t))<0;)t=t+1;if(null==this._parentContext)throw E(this._thisDoc,this.lines,e,r,"Can't use ?xxx syntax for variable in outermost level: "+e.slice(r-1,t));return n.push(this._store.variable(e.slice(r,t))),t}},{key:"bareWord",value:function(e,t,n){var r=this.skipSpace(e,t);if(r<0)return-1;var i=e.charAt(r);if("0123456789-".indexOf(i)>=0)return-1;if(k.indexOf(i)>=0)return-1;for(t=r;t<y(e)&&k.indexOf(e.charAt(t))<0;)t=t+1;return n.push(e.slice(r,t)),t}},{key:"qname",value:function(e,t,n){if((t=this.skipSpace(e,t))<0)return-1;var r=e.charAt(t);if("0123456789-+".indexOf(r)>=0)return-1;if(k.indexOf(r)<0){var i=r;for(t=t+1;t<y(e);){r=e.charAt(t);if(!(k.indexOf(r)<0))break;i=i+r,t=t+1}}else i="";if(t<y(e)&&":"==e.charAt(t)){var a=i;for(t=t+1,i="";t<y(e);){r=e.charAt(t);if(!(k.indexOf(r)<0))break;i=i+r,t=t+1}return n.push(new f([a,i])),t}return i&&this.keywordsSet&&Object(l.a)(this.keywords,i)<0?(n.push(new f(["",i])),t):-1}},{key:"object",value:function(e,t,n){if((o=this.subject(e,t,n))>=0)return o;if((o=this.skipSpace(e,t))<0)return-1;t=o;var r=null,i=e.charAt(t);if('"'==i||"'"==i){r=e.slice(t,t+3==i+i)?i+i+i:i;t=t+y(r);var a=this.strconst(e,t,r),o=a[0],s=a[1];return n.push(this._store.literal(s)),o}return-1}},{key:"nodeOrLiteral",value:function(e,t,n){if((u=this.node(e,t,n))>=0)return u;if((u=this.skipSpace(e,t))<0)return-1;t=u;var r=e.charAt(t);if("-+0987654321".indexOf(r)>=0){if(N.lastIndex=0,null!=(h=N.exec(e.slice(t)))){u=t+(i=h[0]).length,i.indexOf("T")>=0?n.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):n.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#date")))}else{var i;if(T.lastIndex=0,null==(h=T.exec(e.slice(t))))throw E(this._thisDoc,this.lines,e,t,"Bad number or date syntax");u=t+T.lastIndex,(i=e.slice(t,u)).indexOf("e")>=0?n.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):e.slice(t,u).indexOf(".")>=0?n.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):n.push(this._store.literal(parseInt(i),this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return u}if('"'==e.charAt(t)){if('"""'==e.slice(t,t+3))var a='"""';else a='"';t=t+y(a);var o=null,s=this.strconst(e,t,a),u=s[0],c=s[1],l=null;if("@"==e.slice(u,u+1)){var h;if(O.lastIndex=0,null==(h=O.exec(e.slice(u+1))))throw E(this._thisDoc,startline,e,t,"Bad language code syntax on string literal, after @");t=O.lastIndex+u+1,l=e.slice(u+1,t),u=t}if("^^"==e.slice(u,u+2)){var d=new p([]);u=this.uri_ref2(e,u+2,d),o=d[0]}return n.push(this._store.literal(c,l||o)),u}return-1}},{key:"strconst",value:function(e,t,n){for(var r=t,i="",a=this.lines;r<y(e);){t=r+y(n);if(e.slice(r,t)==n)return new f([t,i]);if('"'!=e.charAt(r)){if(j.lastIndex=0,!j.exec(e.slice(r)))throw E(this._thisDoc,a,e,r,"Closing quote missing in string at ^ in "+e.slice(r-20,r)+"^"+e.slice(r,r+20));t=r+j.lastIndex-1,i=i+e.slice(r,t);if('"'!=(u=e.charAt(t)))if("\r"!=u){if("\n"==u){if('"'==n)throw E(this._thisDoc,a,e,t,"newline found in string literal");this.lines=this.lines+1;i=i+u,r=t+1;this.previousLine=this.startOfLine,this.startOfLine=r}else if("\\"==u){r=t+1;if(!(u=e.slice(r,r+1)))throw E(this._thisDoc,a,e,t,"unterminated string literal (2)");var o=w('abfrtvn\\"',u);if(o>=0)i=i+'a\b\f\r\t\v\n\\"'.charAt(o),r=r+1;else if("u"==u)r=(s=this.uEscape(e,r+1,a))[0],i=i+(u=s[1]);else{if("U"!=u)throw E(this._thisDoc,this.lines,e,t,"bad escape");var s,u;r=(s=this.UEscape(e,r+1,a))[0],i=i+(u=s[1])}}}else var r=t+1;else var r=t}else var i=i+'"',r=r+1}throw E(this._thisDoc,this.lines,e,t,"unterminated string literal")}},{key:"uEscape",value:function(e,t,n){for(var r=t,i=0,a=0;i<4;){var o=e.slice(r,r+1).toLowerCase();r=r+1;if(""==o)throw E(this._thisDoc,n,e,t,"unterminated string literal(3)");var s=w("0123456789abcdef",o);if(s<0)throw E(this._thisDoc,n,e,t,"bad string literal hex escape");a=16*a+s,i=i+1}var u=String.fromCharCode(a);return new f([r,u])}},{key:"UEscape",value:function(e,t,n){for(var r=t,i=0,a="\\U";i<8;){var o=e.slice(r,r+1).toLowerCase();r=r+1;if(""==o)throw E(this._thisDoc,n,e,t,"unterminated string literal(3)");if(w("0123456789abcdef",o)<0)throw E(this._thisDoc,n,e,t,"bad string literal hex escape");a=a+o,i=i+1}var s,u=(s="0x"+g(a,2,10)-0,String.fromCharCode(s));return new f([r,u])}}]),e}();function S(e,t,n,r,i){this._str=n.encode("utf-8"),this._str=n,this._i=r,this._why=i,this.lines=t,this._uri=e}function E(e,t,n,r,i){var a=t+1,o="Line "+a+" of <"+e+">: Bad syntax: "+i+'\nat: "'+n.slice(r,r+30)+'"',s=new SyntaxError(o,e,a);return s.lineNo=a,s.characterInFile=r,s.syntaxProblem=i,s}S.prototype.toString=function(){var e=this._str,t=this._i,n=0;if(t>60){var r="...";n=t-60}else r="";if(y(e)-t>60)var i="...";else i="";return'Line %i of <%s>: Bad syntax (%s) at ^ in:\n"%s%s^%s%s"'%new f([this.lines+1,this._uri,this._why,r,e.slice(n,t),e.slice(t,t+60),i])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return v}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(20),u=n(18),c=n(8),l=n(6),h=n(10),d=n(17);if(void 0===f)var f={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};var p=function(){function e(t,n){i()(this,e),this.options=n||{},this.kb=t,this.target=n.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()}return o()(e,[{key:"addTriple",value:function(e,t,n,r){var i,a,o,s;i=void 0===t?d.a.namedNode(this.options.base):this.toRDFNodeObject(t),o=this.toRDFNodeObject(n),a=this.toRDFNodeObject(r),s=d.a.namedNode(this.options.base),this.kb.add(i,o,a,s)}},{key:"ancestorPath",value:function(e){for(var t="";e&&e.nodeType!==f.DOCUMENT_NODE;)t="/"+e.localName+t,e=e.parentNode;return t}},{key:"copyMappings",value:function(e){var t={};for(var n in e)t[n]=e[n];return t}},{key:"copyProperties",value:function(){}},{key:"deriveDateTimeType",value:function(t){for(var n=0;n<e.dateTimeTypes.length;n++){var r=e.dateTimeTypes[n].pattern.exec(t);if(r&&r[0].length===t.length)return e.dateTimeTypes[n].type}return null}},{key:"init",value:function(){}},{key:"newBlankNode",value:function(){return this.blankCounter++,"_:"+this.blankCounter}},{key:"newSubjectOrigin",value:function(e,t){}},{key:"parseCURIE",value:function(t,n,r){var i,a=t.indexOf(":");if(a>=0){var o=t.substring(0,a);if(""===o)return(i=n[""])?i+t.substring(a+1):null;if("_"===o)return"_:"+t.substring(a+1);if(e.NCNAME.test(o)&&(i=n[o]))return i+t.substring(a+1)}return null}},{key:"parseCURIEOrURI",value:function(e,t,n){var r=this.parseCURIE(e,t,n);return r||this.resolveAndNormalize(n,e)}},{key:"parsePredicate",value:function(e,t,n,r,i,a){if(""===e)return null;var o=this.parseTermOrCURIEOrAbsURI(e,t,a?null:n,r,i);return o&&0===o.indexOf("_:")?null:o}},{key:"parsePrefixMappings",value:function(e,t){for(var n=this.tokenize(e),r=null,i=0;i<n.length;i++)":"===n[i][n[i].length-1]?r=n[i].substring(0,n[i].length-1):r&&(t[r]=this.options.base?l.join(n[i],this.options.base):n[i],r=null)}},{key:"parseSafeCURIEOrCURIEOrURI",value:function(e,t,n){return"["===(e=this.trim(e)).charAt(0)&&"]"===e.charAt(e.length-1)?0===(e=(e=e.substring(1,e.length-1)).trim(e)).length?null:"_:"===e?this.theOne:this.parseCURIE(e,t,n):this.parseCURIEOrURI(e,t,n)}},{key:"parseTermOrCURIEOrAbsURI",value:function(e,t,n,r,i){e=this.trim(e);var a=this.parseCURIE(e,r,i);if(a)return a;if(n){if(t&&!this.absURIRE.exec(e))return t+e;var o=n[e];if(o)return o;if(o=n[e.toLowerCase()])return o}return this.absURIRE.exec(e)?this.resolveAndNormalize(i,e):null}},{key:"parseTermOrCURIEOrURI",value:function(e,t,n,r,i){e=this.trim(e);var a=this.parseCURIE(e,r,i);if(a)return a;var o=n[e];return o||((o=n[e.toLowerCase()])?o:t&&!this.absURIRE.exec(e)?t+e:this.resolveAndNormalize(i,e))}},{key:"parseURI",value:function(e){return e}},{key:"process",value:function(t,n){var r;n=n||{},t.nodeType===f.DOCUMENT_NODE?(t.baseURI&&!n.baseURI&&(n.baseURI=t.baseURI),r=t.baseURI,(t=t.documentElement).baseURI||(t.baseURI=r),this.setContext(t)):t.parentNode.nodeType===f.DOCUMENT_NODE&&this.setContext(t);var i=[],a=function(e){if(!e&&n&&n.baseURI)return n.baseURI;var t=e.indexOf("#");return t>=0&&(e=e.substring(0,t)),n&&n.baseURIMap&&(e=n.baseURIMap(e)),e};for(i.push({current:t,context:this.push(null,a(t.baseURI))});i.length>0;){var o=i.shift();if(o.parent){if(o.context.parent&&o.context.parent.listMapping===o.listMapping)continue;for(var s in o.listMapping){var u=o.listMapping[s];if(0!==u.length){for(var c=[],h=0;h<u.length;h++)c.push(this.newBlankNode());for(var d=0;d<c.length;d++)this.addTriple(o.parent,c[d],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",u[d]),this.addTriple(o.parent,c[d],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:e.objectURI,value:d+1<c.length?c[d+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(o.parent,o.subject,s,{type:e.objectURI,value:c[0]})}else this.addTriple(o.parent,o.subject,s,{type:e.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var p=o.current,v=o.context,y=!1,g=null,m=null,b=null,w=v.prefixes,x=!1,_=[],k=v.listMapping,T=!v.parent,N=v.language,j=v.vocabulary;r=this.parseURI(a(p.baseURI)),p.item=null;var O=p.getAttributeNode("vocab");if(O){var I=this.trim(O.value);if(I.length>0){j=I;var S=r.spec;this.addTriple(p,S,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:e.objectURI,value:j})}else j=this.vocabulary}for(var E=0;E<p.attributes.length;E++){var R=p.attributes[E];if("x"===R.nodeName.charAt(0)&&0===R.nodeName.indexOf("xmlns:")){x||(w=this.copyMappings(w),x=!0);var A=R.nodeName.substring(6),C=e.trim(R.value);w[A]=this.options.base?l.join(C,this.options.base):C}}var L=p.getAttributeNode("prefix");L&&(x||(w=this.copyMappings(w),x=!0),this.parsePrefixMappings(L.value,w));for(var D=null,P=0;!D&&P<this.langAttributes.length;P++)D=p.getAttributeNodeNS(this.langAttributes[P].namespaceURI,this.langAttributes[P].localName);if(D){var M=e.trim(D.value);N=M.length>0?M:null}var F,U,q=p.getAttributeNode("rel"),B=p.getAttributeNode("rev"),H=p.getAttributeNode("typeof"),V=p.getAttributeNode("property"),z=p.getAttributeNode("datatype"),X=this.inHTMLMode?p.getAttributeNode("datetime"):null,Q=p.getAttributeNode("content"),$=p.getAttributeNode("about"),G=p.getAttributeNode("src"),J=p.getAttributeNode("resource"),W=p.getAttributeNode("href"),Y=p.getAttributeNode("inlist"),Z=[];if(q){U=this.tokenize(q.value);for(var K=0;K<U.length;K++)(F=this.parsePredicate(U[K],j,v.terms,w,r,this.inHTMLMode&&null!==V))&&Z.push(F)}var ee=[];if(B){U=this.tokenize(B.value);for(var te=0;te<U.length;te++)(F=this.parsePredicate(U[te],j,v.terms,w,r,this.inHTMLMode&&V))&&ee.push(F)}if(this.inHTMLMode&&(q||B)&&V&&(0===Z.length&&(q=null),0===ee.length&&(B=null)),q||B?($&&(g=this.parseSafeCURIEOrCURIEOrURI($.value,w,r)),H&&(b=g),g||(p.parentNode.nodeType===f.DOCUMENT_NODE?g=a(p.baseURI):v.parentObject&&(g=a(p.parentNode.baseURI)===v.parentObject?a(p.baseURI):v.parentObject)),J&&(m=this.parseSafeCURIEOrCURIEOrURI(J.value,w,r)),m||(W?m=this.resolveAndNormalize(r,encodeURI(W.value)):G?m=this.resolveAndNormalize(r,encodeURI(G.value)):!H||$||this.inXHTMLMode&&("head"===p.localName||"body"===p.localName)||(m=this.newBlankNode())),!H||$||!this.inXHTMLMode||"head"!==p.localName&&"body"!==p.localName?H&&!$&&(b=m):b=g):!V||Q||z?($&&(g=this.parseSafeCURIEOrCURIEOrURI($.value,w,r)),!g&&J&&(g=this.parseSafeCURIEOrCURIEOrURI(J.value,w,r)),!g&&W&&(g=this.resolveAndNormalize(r,encodeURI(W.value))),!g&&G&&(g=this.resolveAndNormalize(r,encodeURI(G.value))),g||(p.parentNode.nodeType===f.DOCUMENT_NODE?g=a(p.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==p.localName&&"body"!==p.localName?H?g=this.newBlankNode():v.parentObject&&(g=a(p.parentNode.baseURI)===v.parentObject?a(p.baseURI):v.parentObject,V||(y=!0)):g=a(p.parentNode.baseURI)===v.parentObject?a(p.baseURI):v.parentObject),H&&(b=g)):($&&(g=this.parseSafeCURIEOrCURIEOrURI($.value,w,r),H&&(b=g)),g||p.parentNode.nodeType!==f.DOCUMENT_NODE?!g&&v.parentObject&&(g=a(p.parentNode.baseURI)===v.parentObject?a(p.baseURI):v.parentObject):(g=a(p.baseURI),H&&(b=g)),H&&!b&&(J&&(b=this.parseSafeCURIEOrCURIEOrURI(J.value,w,r)),!b&&W&&(b=this.resolveAndNormalize(r,encodeURI(W.value))),!b&&G&&(b=this.resolveAndNormalize(r,encodeURI(G.value))),b||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==p.localName&&"body"!==p.localName||(b=g),b||(b=this.newBlankNode()),m=b)),g&&($||J||b)){var ne=g;H&&!$&&!J&&m&&(ne=m),this.newSubjectOrigin(p,ne)}if(b){U=this.tokenize(H.value);for(var re=0;re<U.length;re++){var ie=this.parseTermOrCURIEOrAbsURI(U[re],j,v.terms,w,r);ie&&this.addTriple(p,b,e.typeURI,{type:e.objectURI,value:ie})}}if(g&&g!==v.parentObject&&(k={},T=!0),m){if(q&&Y)for(var ae=0;ae<Z.length;ae++){var oe=k[Z[ae]];oe||(oe=[],k[Z[ae]]=oe),oe.push({type:e.objectURI,value:m})}else if(q)for(var se=0;se<Z.length;se++)this.addTriple(p,g,Z[se],{type:e.objectURI,value:m});if(B)for(var ue=0;ue<ee.length;ue++)this.addTriple(p,m,ee[ue],{type:e.objectURI,value:g})}else{if(g&&!m&&(q||B)&&(m=this.newBlankNode()),q&&Y)for(var ce=0;ce<Z.length;ce++){var le=k[Z[ce]];le||(le=[],k[F]=le),_.push({predicate:Z[ce],list:le})}else if(q)for(var he=0;he<Z.length;he++)_.push({predicate:Z[he],forward:!0});if(B)for(var de=0;de<ee.length;de++)_.push({predicate:ee[de],forward:!1})}if(V){var fe=null,pe=null;z?(fe=""===z.value?e.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(z.value,j,v.terms,w,r),pe=X&&!Q?X.value:fe===e.XMLLiteralURI||fe===e.HTMLLiteralURI?null:Q?Q.value:p.textContent):Q?(fe=e.PlainLiteralURI,pe=Q.value):X?(pe=X.value,(fe=e.deriveDateTimeType(pe))||(fe=e.PlainLiteralURI)):q||B||(J&&(pe=this.parseSafeCURIEOrCURIEOrURI(J.value,w,r)),!pe&&W?pe=this.resolveAndNormalize(r,encodeURI(W.value)):!pe&&G&&(pe=this.resolveAndNormalize(r,encodeURI(G.value))),pe&&(fe=e.objectURI)),fe||(H&&!$?(fe=e.objectURI,pe=b):(pe=p.textContent,this.inHTMLMode&&"time"===p.localName&&(fe=e.deriveDateTimeType(pe)),fe||(fe=e.PlainLiteralURI))),U=this.tokenize(V.value);for(var ve=0;ve<U.length;ve++){var ye=this.parsePredicate(U[ve],j,v.terms,w,r);if(ye)if(Y){var ge=k[ye];ge||(ge=[],k[ye]=ge),ge.push(fe===e.XMLLiteralURI||fe===e.HTMLLiteralURI?{type:fe,value:p.childNodes}:{type:fe||e.PlainLiteralURI,value:pe,language:N})}else fe===e.XMLLiteralURI||fe===e.HTMLLiteralURI?this.addTriple(p,g,ye,{type:fe,value:p.childNodes}):this.addTriple(p,g,ye,{type:fe||e.PlainLiteralURI,value:pe,language:N})}}if(g&&!y)for(var me=0;me<v.incomplete.length;me++)v.incomplete[me].list?v.incomplete[me].list.push({type:e.objectURI,value:g}):v.incomplete[me].forward?this.addTriple(p,v.subject,v.incomplete[me].predicate,{type:e.objectURI,value:g}):this.addTriple(p,g,v.incomplete[me].predicate,{type:e.objectURI,value:v.subject});var be=null,we=g;y?((be=this.push(v,v.subject)).parentObject=a(p.parentNode.baseURI)===v.parentObject?a(p.baseURI):v.parentObject,be.incomplete=v.incomplete,be.language=N,be.prefixes=w,be.vocabulary=j):((be=this.push(v,g)).parentObject=m||g||v.subject,be.prefixes=w,be.incomplete=_,m&&(we=m,k={},T=!0),be.listMapping=k,be.language=N,be.vocabulary=j),T&&i.unshift({parent:p,context:v,subject:we,listMapping:k});for(var xe=p.lastChild;xe;xe=xe.previousSibling)xe.nodeType===f.ELEMENT_NODE&&i.unshift({current:xe,context:be})}}this.inHTMLMode&&this.copyProperties();for(var _e=0;_e<this.finishedHandlers.length;_e++)this.finishedHandlers[_e](t)}},{key:"push",value:function(e,t){return{parent:e,subject:t||(e?e.subject:null),parentObject:null,incomplete:[],listMapping:e?e.listMapping:{},language:e?e.language:this.language,prefixes:e?e.prefixes:this.target.graph.prefixes,terms:e?e.terms:this.target.graph.terms,vocabulary:e?e.vocabulary:this.vocabulary}}},{key:"resolveAndNormalize",value:function(e,t){return l.join(t,e)}},{key:"setContext",value:function(e){"html"===e.localName&&"XHTML+RDFa 1.1"===e.getAttribute("version")?this.setXHTMLContext():"html"===e.localName||"http://www.w3.org/1999/xhtml"===e.namespaceURI?"undefined"!=typeof document&&document.doctype?"-//W3C//DTD XHTML+RDFa 1.0//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"===document.doctype.systemId?(console.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()}},{key:"setHTMLContext",value:function(){this.setInitialContext(),this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.inXHTMLMode=!1,this.inHTMLMode=!0}},{key:"setInitialContext",value:function(){this.vocabulary=null,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}]}},{key:"setXHTMLContext",value:function(){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"}},{key:"setXMLContext",value:function(){this.setInitialContext(),this.inXHTMLMode=!1,this.inHTMLMode=!1}},{key:"tokenize",value:function(e){return this.trim(e).split(/\s+/)}},{key:"toRDFNodeObject",value:function(t){var n=this;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 s.a(t.substring(2))),this.blankNodes[t.substring(2)]):d.a.namedNode(t);switch(t.type){case e.objectURI:return"_:"===t.value.substring(0,2)?(void 0===this.blankNodes[t.value.substring(2)]&&(this.blankNodes[t.value.substring(2)]=new s.a(t.value.substring(2))),this.blankNodes[t.value.substring(2)]):d.a.namedNode(t.value);case e.PlainLiteralURI:return new u.a(t.value,t.language||"");case e.XMLLiteralURI:case e.HTMLLiteralURI:var r="";return Object.keys(t.value).forEach((function(e){r+=h.domToString(t.value[e],n.htmlOptions)})),new u.a(r,"",new c.a(t.type));default:return new u.a(t.value,"",new c.a(t.type))}}}},{key:"trim",value:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}],[{key:"parseRDFaDOM",value:function(t,n,r){var i=new e(n,{base:r});t.baseURI||(t.baseURI=r),i.process(t,{baseURI:r})}},{key:"tokenize",value:function(e){return this.trim(e).split(/\s+/)}},{key:"trim",value:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}]),e}();p.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",p.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",p.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",p.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",p.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",p.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",p.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",p.NCNAME=new RegExp("^"+p.nameStartChar+p.nameChar+"*$"),p.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"}];var v=p.parseRDFaDOM},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return l}));var r=n(4),i=n.n(r),a=n(28),o=n(31),s=n(2),u=n(6),c=function e(t,n){i()(this,e),this.pat=new a.a,this.vars=[],this.name=t,this.id=n};function l(e,t,n,r){function i(e){var t,n="";for(t in e)e.hasOwnProperty(t)&&(n+=" "+t+" -> "+e[t]);return n}function a(e){var t,n="Bindings: ",r=e.length;for(t=0;t<r;t++)n+=i(e[t][0])+";\n\t";return n}function c(e,t,n,r){var i;if(e.length!==t.length)return[];if(!e.length)return[[[],null]];var a=function(e,t,n,r){var i=n[e];if(void 0===i){if(e.isVar){var a=[];return a[e]=t,[[a,null]]}i=e}if(!i.complexType)return r.redirections[i]&&(i=r.redirections[i]),r.redirections[t]&&(t=r.redirections[t]),i.equals(t)||i.uri&&i.uri===o.a?[[[],null]]:[];if(e instanceof Array)return t instanceof Array?c(e,t,n):[];throw new Error("query.js: oops - code not written yet")}(e[0],t[0],n,r);if(0===a.length)return a;var s,u,l,h,d,f,p,v=[],y=a.length;for(s=0;s<y;s++){for(d in p=[],u=a[s][0])u.hasOwnProperty(d)&&(p[d]=u[d]);for(d in n)n.hasOwnProperty(d)&&(p[d]=n[d]);for(h=(i=c(e.slice(1),t.slice(1),p,r)).length,l=0;l<h;l++){for(d in f=i[l][0],u)u.hasOwnProperty(d)&&(f[d]=u[d]);v.push([f,null])}}return v}function l(e,t){var n,r={};for(n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}function h(e,t){return this.trunkBindings=t,this.originalCallback=e,this.branches=[],this}function d(e,t){return this.count=0,this.success=!1,this.done=!1,this.callback=e,this.onDone=t,this}h.prototype.checkAllDone=function(){var e;for(e=0;e<this.branches.length;e++)if(!this.branches[e].done)return;s.a.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},h.prototype.doCallBacks=function(e,t){var n;if(e<0)return this.originalCallback(t);for(n=0;n<this.branches[e].results.length;n++)this.doCallBacks(e-1,l(t,this.branches[e].results[n]))},d.prototype.reportMatch=function(e){this.callback(e),this.success=!0},d.prototype.reportDone=function(){this.done=!0,s.a.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var f=function(e){return this.count=0,this.done=!1,this.results=[],this.junction=e,e.branches.push(this),this};function p(e,t,n){var r,i,a,s,u,c;for(t.nvars=0,t.index=null,r=[t.subject,t.predicate,t.object,t.why],s=[e.subjectIndex,e.predicateIndex,e.objectIndex,e.whyIndex],a=0;a<4;a++){var l=r[a];if(l.uri&&l.uri===o.a);else if(l.isVar&&void 0===n[l])t.nvars++;else{if(c=void 0,l=void 0===(c=n[u=r[a]])?u:c,e.redirections[e.id(l)]&&(l=e.redirections[e.id(l)]),!(i=s[a][e.id(l)]))return t.index=[],!1;(null===t.index||t.index.length>i.length)&&(t.index=i)}}return null===t.index&&(t.index=e.statements),!0}function v(e,t){return e.nvars!==t.nvars?e.nvars-t.nvars:e.index.length-t.index.length}f.prototype.reportMatch=function(e){this.results.push(e)},f.prototype.reportDone=function(){s.a.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),s.a.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var y=function e(n,r,a,o,c,l,d){s.a.debug("Match begins, Branch count now: "+d.count+" for "+d.pattern_debug);var p,v,y=r.statements;if(0===y.length){if(s.a.debug("FOUND MATCH WITH BINDINGS:"+i(a)),0===r.optional.length)d.reportMatch(a);else{s.a.debug("OPTIONAL: "+r.optional);var g,b=new h(t,a),w=[];for(g=0;g<r.optional.length;g++)w[g]=new f(b),w[g].pattern_debug=r.optional[g];for(g=0;g<r.optional.length;g++)w[g].count=w[g].count+1,e(n,r.optional[g],a,"",c,t,w[g])}return d.count--,void s.a.debug("Match ends -- success , Branch count now: "+d.count+" for "+d.pattern_debug)}var x=y.length;if(c){0;var _=function(t,i){var s=t.uri.split("#")[0];c.nowOrWhenFetched(s,void 0,(function(i,s,u){i||console.log("Error following link to <"+t.uri+"> in query: "+s),e(n,r,a,o,c,l,d)}))};for(v=0;v<x;v++){if(p=y[v],void 0!==a[p.subject]&&a[p.subject].uri&&c&&"unrequested"===c.getState(Object(u.docpart)(a[p.subject].uri)))return void _(a[p.subject]);if(void 0!==a[p.object]&&a[p.object].uri&&c&&"unrequested"===c.getState(Object(u.docpart)(a[p.object].uri)))return void _(a[p.object])}}m(n,r,a,o,c,l,d)},g=function(e,t){var n,r,i=!0;for(n in e)e.hasOwnProperty(n)&&t[n]&&(r=t[n].test)&&!r(e[n])&&(i=!1);return i},m=function(e,t,n,r,o,u,l){var h,d,f,m,b,w,x,_=t.statements,k=_.length;for(h=0;h<k;h++)p(e,x=_[h],n);_.sort(v),x=_[0];var T,N=e.formula();N.optional=t.optional,N.constraints=t.constraints,N.statements=_.slice(1),s.a.debug(r+"match2 searching "+x.index.length+" for "+x+"; bindings so far="+i(n));var j,O,I=x.index.length,S=0;for(T=0;T<I;T++)for(O=x.index[T],j=c([x.subject,x.predicate,x.object,x.why],[O.subject,O.predicate,O.object,O.why],n,e),s.a.info(r+" From first: "+j.length+": "+a(j)),f=j.length,d=0;d<f;d++)if(b=[],w=j[d][0],g(w,t.constraints)){for(m in w)w.hasOwnProperty(m)&&(b[m]=w[m]);for(m in n)n.hasOwnProperty(m)&&(b[m]=n[m]);l.count++,S++,y(e,N,b,r+" ",o,u,l)}else s.a.debug("Branch count CS: "+l.count);l.count--,0===S&&s.a.debug("Match2 fails completely on "+x),s.a.debug("Match2 ends, Branch count: "+l.count+" for "+l.pattern_debug),0===l.count&&(s.a.debug("Branch finished."),l.reportDone())},b=this;s.a.debug("Query on "+this.statements.length);var w=new d(t,r);w.count++,e.sync?y(b,e.pat,e.pat.initBindings,"",n,t,w):setTimeout((function(){y(b,e.pat,e.pat.initBindings,"",n,t,w)}),0)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return x})),n.d(t,"b",(function(){return _}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(3),u=n.n(s),c=n(12),l=n.n(c),h=n(14),d=n.n(h),f=n(9),p=n.n(f),v=n(0),y=n.n(v),g=n(11),m=n(1),b=n(31);function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var x=function(e){l()(n,e);var t=w(n);function n(){var e;return i()(this,n),e=t.call(this,""),y()(u()(e),"value",""),y()(u()(e),"termType",m.c),y()(u()(e),"uri",b.a),e}return o()(n,[{key:"toCanonical",value:function(){return this.value}},{key:"toString",value:function(){return"DefaultGraph"}}]),n}(g.a);function _(e){return!!e&&e.termType===m.c}},function(e,t,n){"use strict";const r=n(27),i=n(29),{isArray:a,isObject:o,isString:s,isUndefined:u}=n(24),{isAbsolute:c,isRelative:l,prependBase:h}=n(33),{asArray:d,compareShortestLeast:f}=n(27),p=new Map,v=/^@[a-zA-Z]+$/,y={};function g(e,t,n,r,i,a){if(null===t||!s(t)||y.isKeyword(t))return t;if(t.match(v))return null;if(r&&r.hasOwnProperty(t)&&!0!==i.get(t)&&y.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:a}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(o(n)&&"@id"in n)return n["@id"]}const u=t.indexOf(":");if(u>0){const n=t.substr(0,u),o=t.substr(u+1);if("_"===n||0===o.indexOf("//"))return t;r&&r.hasOwnProperty(n)&&y.createTermDefinition({activeCtx:e,localCtx:r,term:n,defined:i,options:a});const s=e.mappings.get(n);if(s&&s._prefix)return s["@id"]+o;if(c(t))return t}if(n.vocab&&"@vocab"in e)return e["@vocab"]+t;if(n.base&&"@base"in e){if(e["@base"])return h(h(a.base,e["@base"]),t)}else if(n.base)return h(a.base,t);return t}e.exports=y,y.process=async({activeCtx:e,localCtx:t,options:n,propagate:u=!0,overrideProtected:f=!1,cycles:p=new Set})=>{o(t)&&"@context"in t&&a(t["@context"])&&(t=t["@context"]);if(0===d(t).length)return e;const v=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});o(v[0].document)&&"boolean"==typeof v[0].document["@propagate"]&&(u=v[0].document["@propagate"]);let m=e;u||m.previousContext||(m=m.clone(),m.previousContext=e);for(const a of v){let{document:u}=a;if(e=m,null===u){if(!f&&0!==Object.keys(e.protected).length){const o=n&&n.protectedMode||"error";if("error"===o)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});if("warn"===o){console.warn("WARNING: invalid context nullification");const t=a.getProcessed(e);if(t){m=e=t;continue}const i=e;m=e=y.getInitialContext(n).clone();for(const[t,n]of Object.entries(i.protected))n&&(e.mappings[t]=r.clone(i.mappings[t]));e.protected=r.clone(i.protected),a.setProcessed(i,m);continue}throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,protectedMode:o})}m=e=y.getInitialContext(n).clone();continue}const d=a.getProcessed(e);if(d){m=e=d;continue}if(o(u)&&"@context"in u&&(u=u["@context"]),!o(u))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:u});m=m.clone();const v=new Map;if("@version"in u){if(1.1!==u["@version"])throw new i("Unsupported JSON-LD version: "+u["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:u});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+u["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:u});m.processingMode="json-ld-1.1",m["@version"]=u["@version"],v.set("@version",!0)}if(m.processingMode=m.processingMode||e.processingMode,"@base"in u){let e=u["@base"];if(null===e||c(e));else{if(!l(e))throw new i('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:u});e=h(m["@base"],e)}m["@base"]=e,v.set("@base",!0)}if("@vocab"in u){const e=u["@vocab"];if(null===e)delete m["@vocab"];else{if(!s(e))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});if(!c(e)&&y.processingMode(m,1))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});m["@vocab"]=g(m,e,{vocab:!0,base:!0},void 0,void 0,n)}v.set("@vocab",!0)}if("@language"in u){const e=u["@language"];if(null===e)delete m["@language"];else{if(!s(e))throw new i('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:u});m["@language"]=e.toLowerCase()}v.set("@language",!0)}if("@direction"in u){const t=u["@direction"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:u});if(null===t)delete m["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new i('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:u});m["@direction"]=t}v.set("@direction",!0)}if("@propagate"in u){const n=u["@propagate"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:u});if("boolean"!=typeof n)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});v.set("@propagate",!0)}if("@import"in u){const r=u["@import"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:u});if(!s(r))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const a=await n.contextResolver.resolve({activeCtx:e,context:r,documentLoader:n.documentLoader,base:n.base});if(1!==a.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const o=a[0].getProcessed(e);if(o)u=o;else{const n=a[0].document;if("@import"in n)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in n)u.hasOwnProperty(e)||(u[e]=n[e]);a[0].setProcessed(e,u)}v.set("@import",!0)}v.set("@protected",u["@protected"]||!1);for(const e in u)if(y.createTermDefinition({activeCtx:m,localCtx:u,term:e,defined:v,options:n,overrideProtected:f}),o(u[e])&&"@context"in u[e]){const t=u[e]["@context"];let r=!0;if(s(t)){const e=h(n.base,t);p.has(e)?r=!1:p.add(e)}if(r)try{await y.process({activeCtx:m.clone(),localCtx:u[e]["@context"],overrideProtected:!0,options:n,cycles:p})}catch(t){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:u[e]["@context"],term:e})}}a.setProcessed(e,m)}return m},y.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:r,options:u,overrideProtected:l=!1})=>{if(r.has(n)){if(r.get(n))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let h;if(r.set(n,!1),t.hasOwnProperty(n)&&(h=t[n]),"@type"===n&&o(h)&&"@set"===(h["@container"]||"@set")&&y.processingMode(e,1.1)){const e=["@container","@id","@protected"],r=Object.keys(h);if(0===r.length||r.some(t=>!e.includes(t)))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(y.isKeyword(n))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(v))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:n});if(""===n)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const d=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let f=!1;if((s(h)||null===h)&&(f=!0,h={"@id":h}),!o(h))throw new i("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const p={};e.mappings.set(n,p),p.reverse=!1;const m=["@container","@id","@language","@reverse","@type"];y.processingMode(e,1.1)&&m.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in h)if(!m.includes(e))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const b=n.indexOf(":");if(p._termHasColon=b>0,"@reverse"in h){if("@id"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const a=h["@reverse"];if(!s(a))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(!y.isKeyword(a)&&a.match(v))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:a}),void(d?e.mappings.set(n,d):e.mappings.delete(n));const o=g(e,a,{vocab:!0,base:!1},t,r,u);if(!c(o))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});p["@id"]=o,p.reverse=!0}else if("@id"in h){let a=h["@id"];if(a&&!s(a))throw new i("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===a)p["@id"]=null;else{if(!y.isKeyword(a)&&a.match(v))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:a}),void(d?e.mappings.set(n,d):e.mappings.delete(n));if(a!==n){if(a=g(e,a,{vocab:!0,base:!1},t,r,u),!c(a)&&!y.isKeyword(a))throw new i("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)){if(g(e,n,{vocab:!0,base:!1},t,new Map(r).set(n,!0),u)!==a)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t})}p["@id"]=a,p._prefix=f&&!p._termHasColon&&a.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in p))if(p._termHasColon){const i=n.substr(0,b);if(t.hasOwnProperty(i)&&y.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:r,options:u}),e.mappings.has(i)){const t=n.substr(b+1);p["@id"]=e.mappings.get(i)["@id"]+t}else p["@id"]=n}else if("@type"===n)p["@id"]=n;else{if(!("@vocab"in e))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});p["@id"]=e["@vocab"]+n}if((!0===h["@protected"]||!0===r.get("@protected")&&!1!==h["@protected"])&&(e.protected[n]=!0,p.protected=!0),r.set(n,!0),"@type"in h){let n=h["@type"];if(!s(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(y.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=g(e,n,{vocab:!0,base:!1},t,r,u),!c(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new i("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}p["@type"]=n}if("@container"in h){const n=s(h["@container"])?[h["@container"]]:h["@container"]||[],r=["@list","@set","@index","@language"];let o=!0;const u=n.includes("@set");if(y.processingMode(e,1.1)){if(r.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(n.includes("@graph")){if(n.some(e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e))throw new i("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else o&=n.length<=(u?2:1);if(n.includes("@type")&&(p["@type"]=p["@type"]||"@id",!["@id","@vocab"].includes(p["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else o&=!a(h["@container"]),o&=n.length<=1;if(o&=n.every(e=>r.includes(e)),o&=!(u&&n.includes("@list")),!o)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+r.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(p.reverse&&!n.every(e=>["@index","@set"].includes(e)))throw new i("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});p["@container"]=n}if("@index"in h){if(!("@container"in h)||!p["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!s(h["@index"])||0===h["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});p["@index"]=h["@index"]}if("@context"in h&&(p["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let e=h["@language"];if(null!==e&&!s(e))throw new i("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),p["@language"]=e}if("@prefix"in h){if(n.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(y.isKeyword(p["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof h["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});p._prefix=!0===h["@prefix"]}if("@direction"in h){const e=h["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});p["@direction"]=e}if("@nest"in h){const e=h["@nest"];if(!s(e)||"@nest"!==e&&0===e.indexOf("@"))throw new i("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});p["@nest"]=e}
2
2
  // disallow aliasing @context and @preserve
3
- const w=p["@id"];if("@context"===w||"@preserve"===w)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(d&&d.protected&&!l&&(e.protected[n]=!0,p.protected=!0,!function e(t,n){if(!t||"object"!=typeof t||!n||"object"!=typeof n)return t===n;const r=Array.isArray(t);if(r!==Array.isArray(n))return!1;if(r){if(t.length!==n.length)return!1;for(let r=0;r<t.length;++r)if(!e(t[r],n[r]))return!1;return!0}const i=Object.keys(t),a=Object.keys(n);if(i.length!==a.length)return!1;for(const r in t){let i=t[r],a=n[r];if("@container"===r&&Array.isArray(i)&&Array.isArray(a)&&(i=i.slice().sort(),a=a.slice().sort()),!e(i,a))return!1}return!0}(d,p))){const e=u&&u.protectedMode||"error";if("error"===e)throw new i(`Invalid JSON-LD syntax; tried to redefine "${n}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n});if("warn"===e)return void console.warn("WARNING: protected term redefinition",{term:n});throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,term:n,protectedMode:e})}},y.expandIri=(e,t,n,r)=>g(e,t,n,void 0,void 0,r),y.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=p.get(t);if(n)return n;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},n=e.fastCurieMap={},r={},i=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],u=e.mappings,c=[...u.keys()].sort(f);for(const e of c){const a=u.get(e);if(null===a)continue;let c=a["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===a["@id"])continue;const l=d(a["@id"]);for(const u of l){let l=t[u];const h=y.isKeyword(u);if(l)h||a._termHasColon||r[u].push(e);else if(t[u]=l={},!h&&!a._termHasColon){r[u]=[e];const t={iri:u,terms:r[u]};u[0]in n?n[u[0]].push(t):n[u[0]]=[t]}if(l[c]||(l[c]={"@language":{},"@type":{},"@any":{}}),l=l[c],o(e,l["@any"],"@none"),a.reverse)o(e,l["@type"],"@reverse");else if("@none"===a["@type"])o(e,l["@any"],"@none"),o(e,l["@language"],"@none"),o(e,l["@type"],"@none");else if("@type"in a)o(e,l["@type"],a["@type"]);else if("@language"in a&&"@direction"in a){const t=a["@language"],n=a["@direction"];o(e,l["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?"_"+n:"@null")}else"@language"in a?o(e,l["@language"],(a["@language"]||"@null").toLowerCase()):"@direction"in a?a["@direction"]?o(e,l["@language"],"_"+a["@direction"]):o(e,l["@language"],"@none"):s?(o(e,l["@language"],"_"+s),o(e,l["@language"],"@none"),o(e,l["@type"],"@none")):(o(e,l["@language"],i),o(e,l["@language"],"@none"),o(e,l["@type"],"@none"))}}for(const e in n)a(n,e,1);return t},clone:function(){const e={};e.mappings=r.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=r.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone());e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]);"@language"in this&&(e["@language"]=this["@language"]);"@vocab"in this&&(e["@vocab"]=this["@vocab"]);return e},revertToPreviousContext:function(){if(!this.previousContext)return this;return this.previousContext.clone()},protected:{}};return 1e4===p.size&&p.clear(),p.set(t,i),i;function a(e,t,n){const r=e[t],i=e[t]={};let o,s;for(const e of r)o=e.iri,s=n>=o.length?"":o[n],s in i?i[s].push(e):i[s]=[e];for(const e in i)""!==e&&a(i,e,n+1)}function o(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},y.getContextValue=(e,t,n)=>{if(null===t){if("@context"===n)return;return null}if(e.mappings.has(t)){const r=e.mappings.get(t);if(u(n))return r;if(r.hasOwnProperty(n))return r[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},y.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,y.isKeyword=e=>{if(!s(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Y}));var r=n(71),i=n.n(r),a=n(5),o=n.n(a),s=n(12),u=n.n(s),c=n(14),l=n.n(c),h=n(9),d=n.n(h),f=n(4),p=n.n(f),v=n(0),y=n.n(v),g=n(62),m=n.n(g),b=n(28),w=n(2),x=n(34),_=n(8),k=n(13),T=n(46),N=n(35),j=n(42),O=n(6),I=n(7),S=n(10),E=n(40),R=n(49),A=n.n(R),C=n(1),L=n(25),D=n(53);function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}var M={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},F={rdf:C.o,owl:C.o,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},U=function(e){return{link:Object(k.a)("http://www.w3.org/2007/ont/link#",e),http:Object(k.a)("http://www.w3.org/2007/ont/http#",e),httph:Object(k.a)("http://www.w3.org/2007/ont/httph#",e),rdf:Object(k.a)("http://www.w3.org/1999/02/22-rdf-syntax-ns#",e),rdfs:Object(k.a)("http://www.w3.org/2000/01/rdf-schema#",e),dc:Object(k.a)("http://purl.org/dc/elements/1.1/",e),ldp:Object(k.a)("http://www.w3.org/ns/ldp#",e)}},q=U(),B=function e(t,n){p()(this,e),y()(this,"response",void 0),y()(this,"dom",void 0),this.response=t,this.dom=n};y()(B,"pattern",void 0);var H=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n){var r=e.store;if(this.dom||(this.dom=S.parseXML(t)),"parsererror"===this.dom.documentElement.nodeName)return e.failFetch(n,"Badly formed XML in "+n.resource.value,"parse_error");var i=new j.a(r);try{i.parse(this.dom,n.original.value,n.original)}catch(t){return e.failFetch(n,"Syntax error parsing RDF/XML! "+t,"parse_error")}return n.noMeta||r.add(n.original,q.rdf("type"),q.link("RDFDocument"),e.appNode),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"RDFXMLHandler"}},{key:"register",value:function(e){e.mediatypes[C.o]={q:.9}}}]),n}(B);H.pattern=new RegExp("application/rdf\\+xml");var V=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n){var r,i;this.dom||(this.dom=S.parseXML(t));var a=e.store,o=this.dom.getElementsByTagName("title");o.length>0&&a.add(n.resource,q.dc("title"),a.rdfFactory.literal(o[0].textContent),n.resource);for(var s=this.dom.getElementsByTagName("link"),u=s.length-1;u>=0;u--)i=!1,(r=s[u].getAttribute("rel"))||(r=s[u].getAttribute("rev"),i=!0),r&&e.linkData(n.original,r,s[u].getAttribute("href"),n.resource,i);for(var c=this.dom.getElementsByTagName("script"),l=0;l<c.length;l++){var h=c[l].getAttribute("type");M[h]&&(Object(T.a)(c[l].textContent,a,n.original.value,h),Object(T.a)(c[l].textContent,a,n.original.value,h))}if(n.noMeta||a.add(n.resource,q.rdf("type"),q.link("WebPage"),e.appNode),!n.noRDFa&&N.b)try{Object(N.b)(this.dom,a,n.original.value)}catch(t){var d="Error trying to parse "+n.resource+" as RDFa:\n"+t+":\n"+t.stack;return e.failFetch(n,d,"parse_error")}return e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"XHTMLHandler"}},{key:"register",value:function(e){e.mediatypes[C.u]={}}}]),n}(B);V.pattern=new RegExp("application/xhtml");var z=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n){for(var r=S.parseXML(t),i=0;i<r.childNodes.length;i++)if(1===r.childNodes[i].nodeType){var a=r.childNodes[i].namespaceURI;if(a&&a===a.rdf)return e.addStatus(n.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new H(this.response,r).parse(e,t,n);break}if(r.doctype&&("html"===r.doctype.name&&r.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&r.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/)))return e.addStatus(n.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new V(this.response,r).parse(e,t,n);var o=r.getElementsByTagName("html")[0];if(o){var s=o.getAttribute("xmlns");if(s&&s.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return e.addStatus(n.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new V(this.response,r).parse(e,t,n)}return e.failFetch(n,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+t.slice(0,80),901)}}],[{key:"toString",value:function(){return"XMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/xml"]={q:.5},e.mediatypes["application/xml"]={q:.5}}}]),n}(B);z.pattern=new RegExp("(text|application)/(.*)xml");var X=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n){var r=e.store;if(W(t))return e.addStatus(n.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new V(this.response).parse(e,t,n);if(function(e){var t=e.indexOf("<!DOCTYPE html"),n=e.indexOf(">");if(-1===t||-1===n||t>n)return!1;return-1!==e.substr(t,n-t).indexOf("XHTML")}(t))return e.addStatus(n.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new V(this.response).parse(e,t,n);if(function(e){return!!e.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(t))return e.addStatus(n.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new V(this.response).parse(e,t,n);var i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(t);return i&&r.add(n.resource,q.dc("title"),r.rdfFactory.literal(i[1]),n.resource),r.add(n.resource,q.rdf("type"),q.link("WebPage"),e.appNode),e.addStatus(n.req,"non-XML HTML document, not parsed for data."),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/html"]={q:.9}}}]),n}(B);X.pattern=new RegExp("text/html");var Q=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n,r){var i=e.store;return new Promise((function(a,o){try{Object(D.a)(t,i,n.original.value,(function(){a(e.doneFetch(n,r))}))}catch(t){var s="Error trying to parse "+n.resource+" as JSON-LD:\n"+t;a(e.failFetch(n,s,"parse_error",r))}}))}}],[{key:"toString",value:function(){return"JsonLdHandler"}},{key:"register",value:function(e){e.mediatypes["application/ld+json"]={q:.9}}}]),n}(B);Q.pattern=/application\/ld\+json/;var $=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n){return W(t)?(e.addStatus(n.req,"Warning: "+n.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new z(this.response).parse(e,t,n)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(n.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new z(this.response).parse(e,t,n)):(e.addStatus(n.req,"Plain text document, no known RDF semantics."),e.doneFetch(n,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(e){e.mediatypes["text/plain"]={q:.5}}}]),n}(B);$.pattern=new RegExp("text/plain");var G=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n,r){var i=e.store,a=Object(x.a)(i,i,n.original.value,n.original.value,null,null,"",null);try{a.loadBuf(t)}catch(t){var o="Error trying to parse "+n.resource+" as Notation3:\n"+t;return e.failFetch(n,o,"parse_error",r)}return e.addStatus(n.req,"N3 parsed: "+a.statementCount+" triples in "+a.lines+" lines."),e.store.add(n.original,q.rdf("type"),q.link("RDFDocument"),e.appNode),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}}]),n}(B);G.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var J={RDFXMLHandler:H,XHTMLHandler:V,XMLHandler:z,HTMLHandler:X,TextHandler:$,N3Handler:G,JsonLdHandler:Q};function W(e){return!!e.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}var Y=function(){function t(n){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(p()(this,t),y()(this,"store",void 0),y()(this,"timeout",void 0),y()(this,"_fetch",void 0),y()(this,"mediatypes",void 0),y()(this,"appNode",void 0),y()(this,"requested",void 0),y()(this,"timeouts",void 0),y()(this,"redirectedTo",void 0),y()(this,"fetchQueue",void 0),y()(this,"fetchCallbacks",void 0),y()(this,"nonexistent",void 0),y()(this,"lookedUp",void 0),y()(this,"handlers",void 0),y()(this,"ns",void 0),y()(this,"fireCallbacks",void 0),this.store=n||new b.a,this.ns=U(this.store.rdfFactory),this.timeout=i.timeout||3e4,this._fetch=i.fetch||void 0!==e&&(e.solidFetcher||e.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||A.a,!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.rdfFactory.blankNode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},S.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(i.handlers||J).map((function(e){return r.addHandler(J[e])}))}var n;return o()(t,[{key:"load",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n=Object.assign({},n),e instanceof Array)return Promise.all(e.map((function(e){return t.load(e,Object.assign({},n))})));var r=e,i=Object(L.a)(r);i=i.split("#")[0],n=this.initFetchOptions(i,n);var a=this.initFetchOptions(i,n);return this.pendingFetchPromise(i,a.baseURI,a)}},{key:"pendingFetchPromise",value:function(e,t,n){var r,i=this;return!n.force&&this.fetchQueue[t]?r=this.fetchQueue[t]:(r=Promise.race([this.setRequestTimeout(e,n),this.fetchUri(e,n)]),this.fetchQueue[t]=r,this.cleanupFetchRequest(t,void 0,this.timeout)),r.then((function(t){return e in i.timeouts&&(i.timeouts[e].forEach(clearTimeout),delete i.timeouts[e]),t}))}},{key:"cleanupFetchRequest",value:function(e,t,n){var r=this;void 0!==t&&console.warn("_options is deprecated"),this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((function(){r.isPending(e)||delete r.fetchQueue[e]}),n))}},{key:"initFetchOptions",value:function(e,n){var r=this.store;!n.method||"GET"===n.method.toUpperCase()||(n.force=!0),n.resource=r.rdfFactory.namedNode(e),n.baseURI=n.baseURI||e,n.original=r.rdfFactory.namedNode(n.baseURI),n.req=r.bnode(),n.headers=n.headers||new R.Headers,n.contentType&&(n.headers["content-type"]=n.contentType),n.force&&(n.cache="no-cache");var i=this.acceptString();n.headers.accept=i;var a=t.offlineOverride(e);n.requestedURI=a,t.setCredentials(a,n);var o=t.proxyIfNecessary(a);return a!==o&&(n.proxyUsed=!0),n.actualProxyURI=o,n}},{key:"fetchUri",value:function(e,n){var r=this;if(!e)return Promise.reject(new Error("Cannot fetch an empty uri"));if(t.unsupportedProtocol(e))return this.failFetch(n,"fetcher: Unsupported protocol","unsupported_protocol");var i=this.getState(e);if(n.force)delete this.nonexistent[e];else{if("fetched"===i)return Promise.resolve(this.doneFetch(n,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===i&&404===this.requested[e]){var a="Previously failed: "+this.requested[e],o={url:e,status:this.requested[e],statusText:a,responseText:a,headers:new R.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(n,a,this.requested[e],o)}}this.fireCallbacks("request",[e]),this.requested[e]=!0,n.noMeta||this.saveRequestMetadata(e,n);var s=n.actualProxyURI;return this._fetch(s,n).then((function(t){return r.handleResponse(t,e,n)}),(function(t){var i={url:s,status:999,statusText:(t.name||"network failure")+": "+(t.errno||t.code||t.type),responseText:t.message,headers:new R.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return console.log("Fetcher: <"+s+"> Non-HTTP fetch exception: "+t),r.handleError(i,e,n)}))}},{key:"nowOrWhenFetched",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Object(L.a)(e);"function"==typeof t?n=t:void 0===t||(Object(I.e)(t)?r.referringTerm=t:r=t),this.load(i,r).then((function(e){if(n)if(e)if(e.ok)n(!0,"OK",e);else{var t="HTTP error: Status "+e.status+" ("+e.statusText+")";e.responseText&&(t+=" "+e.responseText),console.log(t+" fetching "+i),n(!1,t,e)}else{var r="@@ nowOrWhenFetched: no response object!";console.log(r),n(!1,r)}}),(function(e){var t=e.message||e.statusText;t="Failed to load <"+i+"> "+t,console.log(t),e.response&&e.response.status&&(t+=" status: "+e.response.status),n(!1,t,e.response)}))}},{key:"addStatus",value:function(e,t){var n=new Date;t="["+n.getHours()+":"+n.getMinutes()+":"+n.getSeconds()+"."+n.getMilliseconds()+"] "+t;var r=this.store,i=r.the(e,this.ns.link("status"));Object(I.b)(i)?i.append(r.rdfFactory.literal(t)):w.a.warn("web.js: No list to add to: "+i+","+t)}},{key:"failFetch",value:function(e,t,n,r){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,this.ns.link("error"),this.store.rdfFactory.literal(t));var i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.equals(e.original),this.requested[O.docpart(e.original.value)]=n,this.fireCallbacks("fail",[e.original.value,t]));var a=new Error("Fetcher: "+t);return a.status=n,a.statusText=t,a.response=r,Promise.reject(a)}},{key:"linkData",value:function(e,t,n,r,i){if(n){var a,o=this.store,s=o.rdfFactory.namedNode(O.join(n,e.value));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(s.value===e.value)return;a=this.ns.rdfs("seeAlso")}else a="type"===t?o.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):o.rdfFactory.namedNode(O.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?o.add(s,a,e,r):o.add(e,a,s,r)}}},{key:"parseLinkHeader",value:function(e,t,n){if(e){var r=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(var a=0;a<i.length;a++){var o=i[a].split(">"),s=o[0].substring(1),u=o[1].match(r);if(null==u)return;for(var c=0;c<u.length;c++){var l=u[c].split("=")[1].replace(/["']/g,"");this.linkData(t,l,s,n)}}}}},{key:"doneFetch",value:function(e,t){return this.addStatus(e.req,"Done."),this.requested[e.original.value]="done",this.fireCallbacks("done",[e.original.value]),t.req=e.req,t}},{key:"nowKnownAs",value:function(e,t){this.lookedUp[e.value]?this.lookedUp[t.value]||this.lookUpThing(t,e):this.lookedUp[t.value]&&(this.lookedUp[e.value]||this.lookUpThing(e,t))}},{key:"putBack",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(L.a)(e),i=new _.a(r).doc();return n.contentType=n["content-type"]||n["Content-Type"]||n.contentType||C.r,"application/ld+json"===n.contentType?new Promise((function(r,a){Object(E.a)(i,t.store,i.uri,n.contentType,(function(i,o){i?a(i):(n.data=o,t.webOperation("PUT",e,n).then((function(e){return r(e)})).catch((function(e){return a(e)})))}))})):(n.data=Object(E.a)(i,this.store,i.value,n.contentType),this.webOperation("PUT",r,n))}},{key:"webCopy",value:function(e,t,n){var r=this;return this.webOperation("GET",e).then((function(e){return r.webOperation("PUT",t,{data:e.responseText,contentType:n})}))}},{key:"delete",value:function(e,t){var n=this;return this.webOperation("DELETE",e,t).then((function(t){return n.requested[e]=404,n.nonexistent[e]=!0,n.unload(n.store.rdfFactory.namedNode(e)),t}))}},{key:"createIfNotExists",value:(n=i()(m.a.mark((function e(t){var n,r,i,a,o=arguments;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:C.r,r=o.length>2&&void 0!==o[2]?o[2]:"",i=this,e.prev=3,e.next=6,i.load(t);case 6:a=e.sent,e.next=29;break;case 9:if(e.prev=9,e.t0=e.catch(3),404!==e.t0.response.status){e.next=27;break}return console.log("createIfNotExists: doc does NOT exist, will create... "+t),e.prev=13,e.next=16,i.webOperation("PUT",t.value,{data:r,contentType:n});case 16:a=e.sent,e.next=23;break;case 19:throw e.prev=19,e.t1=e.catch(13),console.log("createIfNotExists doc FAILED: "+t+": "+e.t1),e.t1;case 23:return delete i.requested[t.value],e.abrupt("return",a);case 27:throw console.log("createIfNotExists doc load error NOT 404: "+t+": "+e.t0),e.t0;case 29:return e.abrupt("return",a);case 30:case"end":return e.stop()}}),e,this,[[3,9],[13,19]])}))),function(e){return n.apply(this,arguments)})},{key:"createContainer",value:function(e,t,n){var r={"content-type":C.r,link:this.ns.ldp("BasicContainer")+'; rel="type"'};t&&(r.slug=t);var i={headers:r};return n&&(i.body=n),this.webOperation("POST",e,i)}},{key:"invalidateCache",value:function(e){var t=Object(L.a)(e);this.fetchQueue&&this.fetchQueue[t]&&(console.log("Internal error - fetchQueue exists "+t),"resolved"===this.fetchQueue[t].PromiseStatus?delete this.fetchQueue[t]:(delete this.fetchQueue[t],console.log("*** Fetcher: pending fetchQueue deleted "+t)));if(this.requested[t]&&"done"!==this.requested[t]&&"failed"!==this.requested[t]&&404!==this.requested[t]){var n="Rdflib: fetcher: Destructive operation on <".concat(this.requested[t],"> file being fetched! ")+t;console.error(n)}else delete this.requested[t],delete this.nonexistent[t]}},{key:"webOperation",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object(L.a)(n);r.method=e,r.body=r.data||r.body,r.force=!0;var a=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),t.setCredentials(i,r),new Promise((function(t,n){a._fetch(i,r).then((function(r){if(r.ok)"PUT"!==e&&"PATCH"!==e&&"POST"!==e&&"DELETE"!==e||a.invalidateCache(i),r.text?r.text().then((function(e){r.responseText=e,t(r)})):t(r);else{var o="Web error: "+r.status;r.statusText&&(o+=" ("+r.statusText+")"),o+=" on "+e+" of <"+i+">",r.responseText&&(o+=": "+r.responseText);var s=new Error(o);s.response=r,n(s)}}),(function(t){n(new Error("Fetch error for "+e+" of <"+i+">:"+t))}))}))}},{key:"lookUpThing",value:function(e,t){var n=this,r=this.store.uris(e);return(r=r.map((function(e){return O.docpart(e)}))).forEach((function(e){n.lookedUp[e]=!0})),this.load(r,{referringTerm:t})}},{key:"getHeader",value:function(e,t){for(var n=this.store,r=e.value,i=n.each(void 0,this.ns.link("requestedURI"),n.rdfFactory.literal(r)),a=0;a<i.length;a++){var o=i[a];if(void 0!==o){var s=n.any(o,this.ns.link("response"));if(void 0!==s&&n.anyValue(s,this.ns.http("status"))&&n.anyValue(s,this.ns.http("status")).startsWith("2")){var u=n.each(s,this.ns.httph(t.toLowerCase()));return u.length?u.map((function(e){return e.value})):[]}}}}},{key:"saveRequestMetadata",value:function(e,t){var n=t.req,r=this.store,i=t.referringTerm;this.addStatus(t.req,"Accept: "+t.headers.accept),Object(I.e)(i)&&r.add(r.rdfFactory.namedNode(e),this.ns.link("requestedBy"),i,this.appNode),t.original&&t.original.value!==e&&r.add(n,this.ns.link("orginalURI"),r.rdfFactory.literal(t.original.value),this.appNode);var a=new Date,o="["+a.getHours()+":"+a.getMinutes()+":"+a.getSeconds()+"] ";r.add(n,this.ns.rdfs("label"),r.rdfFactory.literal(o+" Request for "+e),this.appNode),r.add(n,this.ns.link("requestedURI"),r.rdfFactory.literal(e),this.appNode),r.add(n,this.ns.link("status"),r.collection(),this.appNode)}},{key:"saveResponseMetadata",value:function(e,t){var n=this,r=this.store,i=r.bnode();return r.add(t.req,this.ns.link("response"),i,i),r.add(i,this.ns.http("status"),r.rdfFactory.literal(e.status),i),r.add(i,this.ns.http("statusText"),r.rdfFactory.literal(e.statusText),i),e.headers.forEach((function(e,a){r.add(i,n.ns.httph(a),n.store.rdfFactory.literal(e),i),"content-type"===a&&r.add(t.resource,n.ns.rdf("type"),r.rdfFactory.namedNode(S.mediaTypeClass(e).value),i)})),i}},{key:"objectRefresh",value:function(e){var t=this.store.uris(e);if(void 0!==t)for(var n=0;n<t.length;n++)this.refresh(this.store.rdfFactory.namedNode(O.docpart(t[n])))}},{key:"refresh",value:function(e,t){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(e,{force:!0,clearPreviousData:!0},t)}},{key:"refreshIfExpired",value:function(e,t){var n=this.getHeader(e,"Expires");!n||new Date(n[0]).getTime()<=(new Date).getTime()?this.refresh(e,t):t(!0,"Not expired",{})}},{key:"retract",value:function(e){this.store.removeMany(void 0,void 0,void 0,e),e.value&&delete this.requested[O.docpart(e.value)],this.fireCallbacks("retract",arguments)}},{key:"getState",value:function(e){return void 0===this.requested[e]?"unrequested":!0===this.requested[e]?"requested":"done"===this.requested[e]?"fetched":"redirected"===this.requested[e]?this.getState(this.redirectedTo[e]):"failed"}},{key:"isPending",value:function(e){return!0===this.requested[e]}},{key:"unload",value:function(e){this.store.removeDocument(e),delete this.requested[e.value]}},{key:"addHandler",value:function(e){this.handlers.push(e),e.register(this)}},{key:"retryNoCredentials",value:function(e,t){console.log("Fetcher: CORS: RETRYING with NO CREDENTIALS for "+t.resource),t.retriedWithNoCredentials=!0,delete this.requested[e],delete this.fetchQueue[e];var n=Object.assign({},t,{credentials:"omit"});return this.addStatus(t.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(e,n)}},{key:"isCrossSite",value:function(e){if("undefined"==typeof document||!document.location)return!1;var t=O.hostpart,n=""+document.location;return(t(n)&&t(e)&&t(n))!==t(e)}},{key:"handleError",value:function(e,n,r){if(this.isCrossSite(n)){if(r.credentials&&"include"===r.credentials&&!r.retriedWithNoCredentials)return this.retryNoCredentials(n,r);var i=t.crossSiteProxy(n);if(i&&!r.proxyUsed)return console.log("web: Direct failed so trying proxy "+i),this.redirectToProxy(i,r)}var a;return e instanceof Error?a="Fetch error: "+e.message:(a=e.statusText,e.responseText&&(a+=" ".concat(e.responseText))),this.failFetch(r,a,e.status||998,e)}},{key:"addType",value:function(e,t,n,r){var i=t;if(r){var a=n.any(i,this.ns.link("requestedURI"));a&&a.value!==r&&n.add(n.rdfFactory.namedNode(r),this.ns.rdf("type"),e,this.appNode)}for(;;){var o=n.any(i,this.ns.link("requestedURI"));if(o&&o.value&&n.add(n.rdfFactory.namedNode(o.value),this.ns.rdf("type"),e,this.appNode),!(i=n.any(void 0,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i)))break;var s=n.any(i,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var u=n.any(s,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!u)break;if("301"!==u&&"302"!==u)break}}},{key:"handleResponse",value:function(e,t,n){var r=this,i=this.store,a=e.headers,o=n.req,s=this.saveResponseMetadata(e,n),u=this.normalizedContentType(n,a)||"",c=a.get("content-location");if(0===e.status)return console.log("Masked error - status 0 for "+t),this.handleError(e,t,n);if(e.status>=400)return 404===e.status&&(this.nonexistent[n.original.value]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then((function(){var t=n.resource+" "+e.statusText;return r.failFetch(n,t,e.status,e)}));var l=null,h=null;if(c&&(h=O.join(c,t))!==t&&(l=h),200===e.status){this.addType(this.ns.link("Document"),o,i,t),l&&this.addType(this.ns.link("Document"),o,i,l),n.clearPreviousData&&i.removeDocument(n.resource);var d=u.includes("image/")||u.includes("application/pdf");u&&d&&(this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,i,t),l&&this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,i,l))}if(c){if(!n.force&&l&&"done"===this.requested[h])return this.doneFetch(n,e);this.requested[h]=!0}this.parseLinkHeader(a.get("link"),n.original,o);var f=this.handlerForContentType(u,e);return f?e.text().then((function(t){return e.responseText=t,f.parse(r,t,n,e)})):(this.addStatus(o,"Fetch over. No data handled."),this.doneFetch(n,e))}},{key:"saveErrorResponse",value:function(e,t){var n=this,r=this.store;return e.text().then((function(e){e.length>10&&r.add(t,n.ns.http("content"),r.rdfFactory.literal(e),t)}))}},{key:"handlerForContentType",value:function(e,t){if(!e)return null;var n=this.handlers.find((function(t){return e.match(t.pattern)}));return n?new n(t):null}},{key:"guessContentType",value:function(e){return F[e.split(".").pop()]}},{key:"normalizedContentType",value:function(e,t){if(e.forceContentType)return e.forceContentType;var n=t.get("content-type");if(!n||n.includes("application/octet-stream")){var r=this.guessContentType(e.resource.value);if(r)return r}var i=O.protocol(e.resource.value);return!n&&["file","chrome"].includes(i)?"text/xml":n}},{key:"redirectToProxy",value:function(e,t){var n=this;this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;var r=this.store,i=t.req;t.noMeta||(r.add(i,this.ns.link("redirectedTo"),r.rdfFactory.namedNode(e),i),this.addStatus(i,"redirected to new request")),this.requested[t.resource.value]="redirected",this.redirectedTo[t.resource.value]=e;var a=Object.assign({},t);return a.baseURI=t.resource.value,this.fetchUri(e,a).then((function(e){return a.noMeta||r.add(i,n.ns.link("redirectedRequest"),a.req,n.appNode),e}))}},{key:"setRequestTimeout",value:function(e,t){var n=this;return new Promise((function(r){n.timeouts[e]=(n.timeouts[e]||[]).concat(setTimeout((function(){!n.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||r(n.failFetch(t,"Request to ".concat(e," timed out"),"timeout"))}),n.timeout))}))}},{key:"addFetchCallback",value:function(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}},{key:"acceptString",value:function(){var e="";for(var t in this.mediatypes)for(var n in""!==e&&(e+=", "),e+=t,this.mediatypes[t])e+=";"+n+"="+this.mediatypes[t][n];return e}}],[{key:"crossSiteProxy",value:function(e){return t.crossSiteProxyTemplate?t.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):void 0}},{key:"offlineOverride",value:function(e){var t,n=e;return"undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.preferences&&t.preferences.get("offlineModeUsingLocalhost")&&"http://"===n.slice(0,7)&&"localhost/"!==n.slice(7,17)&&(n="http://localhost/"+n.slice(7),w.a.warn("Localhost kludge for offline use: actually getting <"+n+">")),n}},{key:"proxyIfNecessary",value:function(e){var n;if("undefined"!=typeof window&&window.panes&&(n=window.panes.UI)&&n.isExtension)return e;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var r=function e(t,n){var r=n[t.shift()];return r?"string"==typeof r?r+t.join("/"):t?e(t,r):null:null}(e.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(r)return r}return t.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===e.slice(0,5)?t.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):e}},{key:"unsupportedProtocol",value:function(e){var t=O.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}},{key:"setCredentials",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===t.credentials&&(void 0!==t.withCredentials?t.credentials=t.withCredentials?"include":"omit":t.credentials="include")}}]),t}();y()(Y,"HANDLERS",void 0),y()(Y,"CONTENT_TYPE_BY_EXT",void 0),y()(Y,"crossSiteProxyTemplate",void 0),Y.HANDLERS=J,Y.CONTENT_TYPE_BY_EXT=F}).call(this,n(44))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(52),i=n(43),a=n(1);function o(e,t,n,o,s,u){n=n||e.value;var c=u||{};o=o||a.r;try{var l=Object(i.a)(t);c.flags&&l.setFlags(c.flags);var h,d=t.statementsMatching(void 0,void 0,void 0,e);switch(l.suggestNamespaces(t.namespaces),l.setBase(n),o){case a.o:return f(null,l.statementsToXML(d));case a.i:case a.j:return f(null,l.statementsToN3(d));case a.r:case a.s:return l.setFlags("si"),f(null,l.statementsToN3(d));case a.m:return l.setFlags("deinprstux"),f(null,l.statementsToNTriples(d));case a.g:l.setFlags("deinprstux"),h=l.statementsToNTriples(d),r.convertToJson(h,s);break;case a.l:case a.k:return l.setFlags("deinprstux q"),f(null,l.statementsToNTriples(d));default:throw new Error("Serialize: Content-type "+o+" not supported for data write.")}}catch(e){if(s)return s(e,void 0);throw e}function f(e,t){return s?void s(e,t):t}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(21);n(55);const{rdf:i,xsd:a}=r.a;let o,s=0;const u={namedNode:function(e){return new l(e)},blankNode:function(e){return new d(e||"n3-"+s++)},variable:function(e){return new f(e)},literal:function(e,t){if("string"==typeof t)return new h(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:"";""===n&&("boolean"==typeof e?n=a.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?a.integer:a.double:(n=a.double,Number.isNaN(e)||(e=e>0?"INF":"-INF"))));return""===n||n===a.string?new h(`"${e}"`):new h(`"${e}"^^${n}`)},defaultGraph:function(){return o},quad:v,triple:v};t.b=u;class c{constructor(e){this.id=e}get value(){return this.id}get hashCode(){return 0}equals(e){return e instanceof c?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}toJSON(){return{termType:this.termType,value:this.value}}}class l extends c{get termType(){return"NamedNode"}}class h extends c{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new l(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,n=t<e.length?e[t]:"";return"^"===n?e.substr(t+2):"@"!==n?a.string:i.langString}equals(e){return e instanceof h?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class d extends c{constructor(e){super("_:"+e)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class f extends c{constructor(e){super("?"+e)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}o=new class extends c{constructor(){return super(""),o||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class p extends c{constructor(e,t,n,r){super(""),this._subject=e,this._predicate=t,this._object=n,this._graph=r||o}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function v(e,t,n,r){return new p(e,t,n,r)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(0),u=n.n(s),c=n(6),l=function(){function e(t){i()(this,e),this.store=t,this.bnodes={},this.why=null,this.reify=!1}return o()(e,[{key:"frameFactory",value:function(t,n,r){return{NODE:1,ARC:2,parent:n,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(e,t){t=c.join(t,this.base),this.node=this.store.sym(t),this.nodeType=e},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var t=this.store.sym(c.join("#"+this.parent.rdfid,this.base));this.store.add(t,this.store.sym(e.ns.RDF+"type"),this.store.sym(e.ns.RDF+"Statement"),this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType===this.NODE&&this.parent.nodeType===this.ARC&&this.parent.parent.nodeType===this.NODE},addNode:function(e){this.addSymbol(this.NODE,e),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(e){null!=e?null!=this.parser.bnodes[e]?this.node=this.parser.bnodes[e]:this.node=this.parser.bnodes[e]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(t){t===e.ns.RDF+"li"&&(t=e.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,t)},addLiteral:function(t){this.parent.datatype&&this.parent.datatype!==e.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()}}}},{key:"getAttributeNodeNS",value:function(e,t,n){var r=null;if(e.getAttributeNodeNS)r=e.getAttributeNodeNS(t,n);else for(var i,a=e.attributes,o=0;o<a.length;++o)if((i=a[o]).namespaceURI===t&&(i.prefix?i.prefix+":"+n:n)===i.nodeName){r=i;break}return r}},{key:"parse",value:function(t,n,r){var i,a=t.childNodes;if(this.cleanParser(),t.nodeType===e.nodeType.DOCUMENT){for(var o=0;o<a.length;o++)if(a[o].nodeType===e.nodeType.ELEMENT){i=a[o];break}}else{if(t.nodeType!==e.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+n+". Halting. ");i=t}this.why=r;var s=this.frameFactory(this);return this.base=n,s.base=n,s.lang=null,this.parseDOM(this.buildFrame(s,i)),!0}},{key:"parseDOM",value:function(t){for(var n,r=function(e){var t="";if(null==e.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+e.localName+" in "+this.base);return e.namespaceURI&&(t+=e.namespaceURI),e.localName?t+=e.localName:e.nodeName&&(e.nodeName.indexOf(":")>=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}.bind(this),i=!0;t.parent;){var a=t.element,o=a.attributes;if(a.nodeType===e.nodeType.TEXT||a.nodeType===e.nodeType.CDATA_SECTION)t.parent.nodeType===t.NODE&&(t.addArc(e.ns.RDF+"value"),t=this.buildFrame(t)),t.addLiteral(a.nodeValue);else if(r(a)!==e.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(a)),this.reify&&(n=this.getAttributeNodeNS(a,e.ns.RDF,"ID"))&&(t.rdfid=n.nodeValue,a.removeAttributeNode(n));var s=this.getAttributeNodeNS(a,e.ns.RDF,"parseType"),u=this.getAttributeNodeNS(a,e.ns.RDF,"datatype");if(u&&(t.datatype=u.nodeValue,a.removeAttributeNode(u)),s){var l=s.nodeValue;"Literal"===l?(t.datatype=e.ns.RDF+"XMLLiteral",(t=this.buildFrame(t)).addLiteral(a.childNodes),i=!1):"Resource"===l?((t=this.buildFrame(t,t.element)).parent.element=null,t.addBNode()):"Collection"===l&&((t=this.buildFrame(t,t.element)).parent.element=null,t.addCollection()),a.removeAttributeNode(s)}if(0!==o.length){var h=this.getAttributeNodeNS(a,e.ns.RDF,"resource"),d=this.getAttributeNodeNS(a,e.ns.RDF,"nodeID");t=this.buildFrame(t),h?(t.addNode(h.nodeValue),a.removeAttributeNode(h)):d?(t.addBNode(d.nodeValue),a.removeAttributeNode(d)):t.addBNode();for(var f=o.length-1;f>=0;f--){var p=this.buildFrame(t);p.addArc(r(o[f])),r(o[f])===e.ns.RDF+"type"?this.buildFrame(p).addNode(o[f].nodeValue):this.buildFrame(p).addLiteral(o[f].nodeValue)}}else 0===a.childNodes.length&&this.buildFrame(t).addLiteral("")}else{var v=this.getAttributeNodeNS(a,e.ns.RDF,"about");if(n=this.getAttributeNodeNS(a,e.ns.RDF,"ID"),v&&n)throw new Error("RDFParser: "+a.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!v&&n)t.addNode("#"+n.nodeValue),a.removeAttributeNode(n);else if(null==v&&null==n){var y=this.getAttributeNodeNS(a,e.ns.RDF,"nodeID");y?(t.addBNode(y.nodeValue),a.removeAttributeNode(y)):t.addBNode()}else t.addNode(v.nodeValue),a.removeAttributeNode(v);var g=this.getAttributeNodeNS(a,e.ns.RDF,"type");e.ns.RDF+"Description"!==r(a)&&(g={nodeValue:r(a)}),null!=g&&(this.store.add(t.node,this.store.sym(e.ns.RDF+"type"),this.store.sym(c.join(g.nodeValue,t.base)),this.why),g.nodeName&&a.removeAttributeNode(g));for(var m=o.length-1;m>=0;m--)this.store.add(t.node,this.store.sym(r(o[m])),this.store.literal(o[m].nodeValue,t.lang),this.why)}for(a=t.element;t.parent;){for(var b=t;null==a;)a=(t=t.parent).element;var w=a.childNodes&&a.childNodes[t.lastChild];if(w&&i){if((w.nodeType===e.nodeType.ELEMENT||w.nodeType===e.nodeType.TEXT||w.nodeType===e.nodeType.CDATA_SECTION)&&(w.nodeType!==e.nodeType.TEXT&&w.nodeType!==e.nodeType.CDATA_SECTION||1===a.childNodes.length)){t.lastChild++,t=this.buildFrame(b,a.childNodes[t.lastChild-1]);break}t.lastChild++}else{if(t.terminateFrame(),!(t=t.parent))break;a=t.element,i=!0}}}}},{key:"cleanParser",value:function(){this.bnodes={},this.why=null}},{key:"buildFrame",value:function(t,n){var r=this.frameFactory(this,t,n);if(t&&(r.base=t.base,r.lang=t.lang),!n||n.nodeType===e.nodeType.TEXT||n.nodeType===e.nodeType.CDATA_SECTION)return r;var i=n.attributes,a=n.getAttributeNode("xml:base");null!=a&&(r.base=a.nodeValue,n.removeAttribute("xml:base"));var o=n.getAttributeNode("xml:lang");null!=o&&(r.lang=o.nodeValue,n.removeAttribute("xml:lang"));for(var s=i.length-1;s>=0;s--)if("xml"===i[s].nodeName.substr(0,3)){if("xmlns:"===i[s].name.slice(0,6)){var u=i[s].nodeValue;this.base&&(u=c.join(u,this.base)),this.store.setPrefixForURI(i[s].name.slice(6),u)}n.removeAttributeNode(i[s])}return r}}]),e}();u()(l,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),u()(l,"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})},function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(0),u=n.n(s),c=n(6),l=n(10),h=n(17);function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.a;return{boolean:e.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:e.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:e.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:e.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:e.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:e.namedNode("http://www.w3.org/2001/XMLSchema#string")}}d(h.a);var f=n(63),p=n.n(f);function v(e){return new y(e)}var y=function(){function e(t){i()(this,e),u()(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),u()(this,"_notNameChars",this._notQNameChars+":"),u()(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),u()(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),u()(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];var n=Object.keys(p()());for(var r in n){var a=p()()[n[r]](""),o=n[r];this.prefixes[a]=o,this.namespaces[o]=a}this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=t,this.rdfFactory=t.rdfFactory||h.a,this.xsd=d(this.rdfFactory)}return o()(e,[{key:"setBase",value:function(e){return this.base=e,this}},{key:"setFlags",value:function(e){return this.flags=e||"",this}},{key:"toStr",value:function(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t}},{key:"fromStr",value:function(e){if("{"===e[0]){var t=this.formulas[e];return t||console.log("No formula object for "+e),t}return this.store.fromNT(e)}},{key:"suggestPrefix",value:function(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))}},{key:"suggestNamespaces",value:function(e){for(var t in e)this.suggestPrefix(t,e[t]);return this}},{key:"checkIntegrity",value:function(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")}},{key:"makeUpPrefix",value:function(e){var t=e;var n=function(t){return!!this.validPrefix.test(t)&&("ns"!==t&&(!(t in this.namespaces)&&(this.prefixes[e]=t,this.namespaces[t]=e,t)))}.bind(this);"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var r=t.lastIndexOf("/");r>=0&&(t=t.slice(r+1));for(var i=0;i<t.length&&this.prefixchars.indexOf(t[i]);)i++;if((t=t.slice(0,i)).length<6&&n(t))return t;if(n(t.slice(0,3)))return t.slice(0,3);if(n(t.slice(0,2)))return t.slice(0,2);if(n(t.slice(0,4)))return t.slice(0,4);if(n(t.slice(0,1)))return t.slice(0,1);if(n(t.slice(0,5)))return t.slice(0,5);this.validPrefix.test(t)||(t="n");for(var a=0;;a++)if(n(t.slice(0,3)+a))return t.slice(0,3)+a}},{key:"rootSubjects",value:function(e){for(var t={},n={},r={},i=0;i<e.length;i++){var a=e[i],o=function(e){t.hasOwnProperty(e)||(t[e]=[]),t[e].push(a.subject)};[a.subject,a.predicate,a.object].map((function(e){"BlankNode"===e.termType?r[e.toNT()]=!0:"Collection"===e.termType&&e.elements.forEach((function(e){o(e)}))})),o(e[i].object);var s=n[this.toStr(a.subject)];s||(s=[]),s.push(a),n[this.toStr(a.subject)]=s}var u=[];for(var c in n)if(n.hasOwnProperty(c)){var l=this.fromStr(c);"BlankNode"===l.termType&&t[l]&&1===t[l].length||u.push(l)}this.incoming=t;for(var h={},d=0;d<u.length;d++)h[u[d].toNT()]=!0;return{roots:u,subjects:n,rootsHash:h,incoming:t}}},{key:"toN3",value:function(e){return this.statementsToN3(e.statements)}},{key:"explicitURI",value:function(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?c.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,n="",r=0;r<e.length;r++)t=e.charCodeAt(r),n+=t>65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[r];return n}(e):encodeURI(e))+">"}},{key:"statementsToNTriples",value:function(e){var t=e.slice();t.sort();for(var n="",r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,a=this.store,o=this.rdfFactory,s=function e(t){if("Collection"!==t.termType)return i.atomicTermToN3(t);for(var s=t.elements,u=a.sym(r+"nill"),c=s.length-1;c>=0;c--){var l=o.blankNode();n+=e(l)+" "+e(a.sym(r+"first"))+" "+e(s[c])+".\n",n+=e(l)+" "+e(a.sym(r+"rest"))+" "+e(u)+".\n",u=l}return i.atomicTermToN3(u)},u=0;u<t.length;u++){var c=t[u],l="";l+=s(c.subject)+" ",l+=s(c.predicate)+" ",l+=s(c.object)+" ",this.flags.indexOf("q")>=0&&(l+=s(c.why)+" "),n+=l+=".\n"}return n}},{key:"statementsToN3",value:function(t){var n=this.store,r={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};t.sort((function(e,t){return l.heavyCompareSPO(e,t,n,r)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var i={};this.flags.indexOf("s")<0&&(i["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(i["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(i["http://www.w3.org/2000/10/swap/log#implies"]="=>");var a=function(e){for(var t="",n=0;n<e;n++)t+=" ";return t},o=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r],a="string"==typeof i?i:e(i);if(0!==r){var o=n.slice(-1)||" ";","===a||";"===a||("."!==a||"0123456789.".includes(o))&&(n+=" ")}n+=a}return n};var s=function(e){for(var t=this.rootSubjects(e),n=t.roots,r=[],i=0;i<n.length;i++){var a=n[i];r.push(u(a,t))}return r}.bind(this);function u(e,t){return"BlankNode"!==e.termType||t.incoming[e]?[d(e,t)].concat([c(e,t)]).concat(["."]):h(e,t,!0).concat(["."])}var c=function(e,t){var n=[],r=null,a=t.subjects[this.toStr(e)]||[];if(void 0===a)throw new Error("Cant find statements for "+e);for(var o=[],s=0;s<a.length;s++){var u=a[s];u.predicate.uri===r?o.push(","):(r&&(n=n.concat([o]).concat([";"]),o=[]),n.push(i[u.predicate.uri]?i[u.predicate.uri]:d(u.predicate,t))),r=u.predicate.uri,o.push(h(u.object,t))}return n=n.concat([o])}.bind(this);var h=function(e,t,n){return"BlankNode"!==e.termType||!n&&void 0!==t.rootsHash[e.toNT()]?d(e,t):t.subjects[this.toStr(e)]?["[",c(e,t),"]"]:"[]"}.bind(this);e.prototype.termToN3=d;var d=function(e,t){var n,r;switch(e.termType){case"Graph":return(r=(r=["{"]).concat(s(e.statements))).concat(["}"]);case"Collection":for(r=["("],n=0;n<e.elements.length;n++)r.push([h(e.elements[n],t)]);return r.push(")"),r;default:return this.atomicTermToN3(e)}}.bind(this);var f=function(){var e="";for(var t in this.defaultNamespace&&(e+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(t)&&this.namespacesUsed[t]&&(e+="@prefix "+this.prefixes[t]+": "+this.explicitURI(t)+".\n");return e+"\n"}.bind(this),p=s(t);return f()+function e(t,n){var r="",i=1e5;void 0===n&&(n=-1);for(var s=0;s<t.length;s++){var u=t[s];if("string"!=typeof u){var c=e(u,n+1);if(c.length<10*(80-4*n)&&c.indexOf('"""')<0){var l=o(u);l.length<80-4*n&&(u=l,c="")}c&&(i=1e4),r+=c}if("string"==typeof u){if(1===u.length&&"\n"===r.slice(-1)&&",.;".indexOf(u)>=0){r=r.slice(0,-1)+u+"\n",i+=1;continue}if(i<4*n+4||i+u.length+1<80&&";.".indexOf(r[r.length-2])<0)r=r.slice(0,-1)+" "+u+"\n",i+=u.length+1;else{var h=a(4*n)+u;r+=h+"\n",i=h.length,n<0&&(r+="\n",i=1e5)}}}return r}(p)}},{key:"atomicTermToN3",value:function(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var n=e.value;if("string"!=typeof n)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return n;case"http://www.w3.org/2001/XMLSchema#decimal":return n.indexOf(".")<0&&(n+=".0"),n;case"http://www.w3.org/2001/XMLSchema#double":var r=n.toLowerCase().indexOf("e")>0;return n.indexOf(".")<0&&!r&&(n+=".0"),r||(n+="e0"),n;case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===e.value?"true":"false"}var i=this.stringToN3(e.value);return e.language?i+="@"+e.language:e.datatype.equals(this.xsd.string)||(i+="^^"+this.atomicTermToN3(e.datatype,t)),i;case"NamedNode":return this.symbolToN3(e);default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}}},{key:"stringToN3",value:function(e,t){t||(t="e");var n,r,i,a,o,s="";for(e.length>20&&'"'!==e.slice(-1)&&t.indexOf("n")<0&&(e.indexOf("\n")>0||e.indexOf('"')>0)?(a='"""',o=this.forbidden3):(a='"',o=this.forbidden1),n=0;n<e.length;){if(o.lastIndex=0,null==o.exec(e.slice(n)))break;r=n+o.lastIndex-1,s+=e.slice(n,r);var u=e[r];'"'===u&&'"""'===a&&'"""'!==e.slice(r,r+3)?s+=u:(i='\b\f\r\t\v\n\\"'.indexOf(u))>=0?s+="\\"+'bfrtvn\\"'[i]:t.indexOf("e")>=0?s+="\\u"+("000"+u.charCodeAt(0).toString(16).toLowerCase()).slice(-4):s+=u,n=r+1}return a+s+e.slice(n)+a}},{key:"symbolToN3",value:function(e){var t=e.uri,n=t.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=t.lastIndexOf("/")),n>=0&&this.flags.indexOf("p")<0&&(0===t.indexOf("http")||0===t.indexOf("ws")||0===t.indexOf("file"))){for(var r=!0,i=n+1;i<t.length;i++)if(this._notNameChars.indexOf(t[i])>=0){r=!1;break}if(r){var a=t.slice(n+1),o=t.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===o&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(a)<0?a:":"+a;var s=this.prefixes[o];if(s||(s=this.makeUpPrefix(o)),s)return this.namespacesUsed[o]=!0,s+":"+a}}return this.explicitURI(t)}},{key:"writeStore",value:function(e){var t=this.store,n=t.fetcher,r=n&&n.appNode,i=this.store.index[3];for(var a in i){var o=t.fromNT(a);r&&o.equals(r)||e("\n"+this.atomicTermToN3(o)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,o))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(n){e("\n<"+n.object.value+"> log:metadata {\n");var r=t.statementsMatching(void 0,void 0,void 0,n.subject);e(this.statementsToN3(this.statementsToN3(r))),e("}.\n")}));var s=[];r&&s.push(r);var u=[];s.map((function(e){u=u.concat(t.statementsMatching(void 0,void 0,void 0,e))})),e(this.statementsToN3(u))}},{key:"statementsToXML",value:function(e){var t=[];t["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var n="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",r=function(e){for(var t="",n=0;n<e;n++)t+=" ";return t},i=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r];n+="string"==typeof i?i:e(i)}return n};var a=function(e){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var t=this.rootSubjects(e),n=t.roots,r=[],i=0;i<n.length;i++){var a=n[i];r.push(u(a,t))}return r}.bind(this);function o(e){return void 0===e?"@@@undefined@@@@":e.replace(/[&<"]/g,(function(e){switch(e[0]){case"&":return"&amp;";case"<":return"&lt;";case'"':return"&quot;"}}))}var s=function(e){return o(this.base?l.uri.refTo(this.base,e.uri):e.uri)}.bind(this);var u=function(e,t){var r,i,a,l,f=[],p=t.subjects[this.toStr(e)];if(void 0===p)return h(e,t);p.sort((function(e,t){var r=e.predicate.uri,i=t.predicate.uri;if(r.substring(0,n.length)===n||i.substring(0,n.length)===n)return r.localeCompare(i);var a=r.substring(n.length),o=i.substring(n.length),s=parseInt(a,10),u=parseInt(o,10);return isNaN(s)||isNaN(u)||s!==a||u!==o?r.localeCompare(i):s-u}));for(var v=0;v<p.length;v++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(a=p[v]).predicate.uri||r||"NamedNode"!==a.object.termType){if((l=a.predicate).uri.substr(0,n.length)===n){var y=l.uri.substr(n.length);y===parseInt(y,10).toString()&&(l=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=d(l),a.object.termType){case"BlankNode":f=1===t.incoming[a.object].length?f.concat(["<"+i+' rdf:parseType="Resource">',u(a.object,t),"</"+i+">"]):f.concat(["<"+i+' rdf:nodeID="'+a.object.toNT().slice(2)+'"/>']);break;case"NamedNode":f=f.concat(["<"+i+' rdf:resource="'+s(a.object)+'"/>']);break;case"Literal":f=f.concat(["<"+i+(a.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+o(a.object.datatype.uri)+'"')+(a.object.language?' xml:lang="'+a.object.language+'"':"")+">"+o(a.object.value)+"</"+i+">"]);break;case"Collection":f=f.concat(["<"+i+' rdf:parseType="Collection">',c(a.object,t),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+a.object.termType+" into XML")}}else r=a.object;var g=r?d(r):"rdf:Description",m="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(m=' rdf:nodeID="'+e.toNT().slice(2)+'"'):m=' rdf:about="'+s(e)+'"',["<"+g+m+">"].concat([f]).concat(["</"+g+">"])}.bind(this);function c(e,t){for(var n=[],r=0;r<e.elements.length;r++)n.push(u(e.elements[r],t));return n}var h=function(e,t){var n=[],r=t.subjects[this.toStr(e)];if(!r)return n;r.sort();for(var i=0;i<r.length;i++){var a=r[i];switch(a.object.termType){case"BlankNode":n=t.rootsHash[a.object.toNT()]?n.concat(["<"+d(a.predicate)+' rdf:nodeID="'+a.object.toNT().slice(2)+'">',"</"+d(a.predicate)+">"]):n.concat(["<"+d(a.predicate)+' rdf:parseType="Resource">',h(a.object,t),"</"+d(a.predicate)+">"]);break;case"NamedNode":n=n.concat(["<"+d(a.predicate)+' rdf:resource="'+s(a.object)+'"/>']);break;case"Literal":n=n.concat(["<"+d(a.predicate)+(a.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+o(a.object.datatype.value)+'"')+(a.object.language?' xml:lang="'+a.object.language+'"':"")+">"+o(a.object.value)+"</"+d(a.predicate)+">"]);break;case"Collection":n=n.concat(["<"+d(a.predicate)+' rdf:parseType="Collection">',c(a.object,t),"</"+d(a.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+a.object.termType+" into XML")}}return n}.bind(this);var d=function(e){var n=e.uri,r=n.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=n.lastIndexOf("/")),r<0)throw new Error("Cannot make qname out of <"+n+">");for(var i=r+1;i<n.length;i++)if(this._notNameChars.indexOf(n[i])>=0)throw new Error('Invalid character "'+n[i]+'" cannot be in XML qname for URI: '+n);var a=n.slice(r+1),o=n.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===o&&this.flags.indexOf("d")<0)return a;var s=this.prefixes[o];return s||(s=this.makeUpPrefix(o)),t[o]=!0,s+":"+a}.bind(this),f=a(e),p="<rdf:RDF";for(var v in this.defaultNamespace&&(p+=' xmlns="'+o(this.defaultNamespace)+'"'),t)if(t.hasOwnProperty(v)){var y=this.base&&this.flags.includes("z")?l.uri.refTo(this.base,v):v;p+="\n xmlns:"+this.prefixes[v]+'="'+o(y)+'"'}return function e(t,n){var a,o="",s=1e5;n||(n=0);for(var u=0;u<t.length;u++){var c=t[u];if("string"!=typeof c){var l=e(c,n+1);l.length<10*(80-4*n)&&l.indexOf('"""')<0&&(a=i(c)).length<80-4*n&&(c=" "+a,l=""),l&&(s=1e4),o+=l}"string"==typeof c&&(s<4*n+4?(o=o.slice(0,-1)+" "+c+"\n",s+=c.length+1):(o+=(a=r(4*n)+c)+"\n",s=a.length))}return o}([p+=">",f,"</rdf:RDF>"],-1)}}]),e}()},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(0),u=n.n(s),c=n(11),l=n(1),h=n(37),d=new h.a,f=function(){function e(t,n,r,a){i()(this,e),u()(this,"subject",void 0),u()(this,"predicate",void 0),u()(this,"object",void 0),u()(this,"graph",void 0),this.subject=c.a.fromValue(t),this.predicate=c.a.fromValue(n),this.object=c.a.fromValue(r),this.graph=null==a?d:c.a.fromValue(a)}return o()(e,[{key:"why",get:function(){return this.graph},set:function(e){this.graph=e}},{key:"equals",value:function(e){return e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}},{key:"substitute",value:function(t){var n=new e(this.subject.substitute(t),this.predicate.substitute(t),this.object.substitute(t),Object(h.b)(this.graph)?this.graph:this.graph.substitute(t));return console.log("@@@ statement substitute:"+n),n}},{key:"toCanonical",value:function(){var e=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==l.c&&e.push(this.graph.toCanonical()),e.join(" ")+" ."}},{key:"toNT",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}},{key:"toNQ",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),Object(h.b)(this.graph)?"":this.graph.toNT()].join(" ")+" ."}},{key:"toString",value:function(){return this.toNT()}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(48),i=n(53),a=n(104),o=n(34),s=n(35),u=n(42),c=n(51),l=n(10),h=n(1);function d(e,t,n){var f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",p=arguments.length>4?arguments[4]:void 0;f=(f=f||h.r).split(";")[0];try{if(f===h.i||f===h.r){var v=Object(o.a)(t,t,n,n,null,null,"",null);v.loadBuf(e),m()}else if(f===h.o){var y=new u.a(t);y.parse(l.parseXML(e),n,t.sym(n)),m()}else if(f===h.u)Object(s.b)(l.parseXML(e,{contentType:h.u}),t,n),m();else if(f===h.f)Object(s.b)(l.parseXML(e,{contentType:h.f}),t,n),m();else if(f===h.p||f===h.q)Object(c.a)(e,t,n),m();else if(f===h.g)Object(i.a)(e,t,n,m);else{if(f!==h.l&&f!==h.k)throw void 0===f?new Error("contentType is undefined"):new Error("Don't know how to parse "+f+" yet");var g=new a.a({factory:r.a});w(null,e)}}catch(e){b(e)}function m(){p&&p(null,t)}function b(e){if(f!==h.g||f!==h.l||f!==h.k){if(!p){var r=new Error(e+" while trying to parse <"+n+"> as "+f);throw r.cause=e,r}p(e,t)}}function w(e,n){e&&p(e,t);try{g.parse(n,x)}catch(e){p(e,t)}}function x(e,n){n?t.add(n.subject,n.predicate,n.object,n.graph):p(e,t)}d.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}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return A}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(3),u=n.n(s),c=n(12),l=n.n(c),h=n(14),d=n.n(h),f=n(9),p=n.n(f),v=n(0),y=n.n(v),g=n(16),m=n(32),b=n(17),w=n(2),x=n(13),_=n(11),k=n(40),T=n(1),N=n(7),j=n(23),O=n(15),I=n(8);function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var A=function(e){l()(n,e);var t=R(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};i()(this,n),(e=t.call(this,"")).statements=r,e.constraints=a,e.initBindings=o,e.optional=s,y()(u()(e),"termType",T.e),y()(u()(e),"classOrder",g.a.Graph),y()(u()(e),"fetcher",void 0),y()(u()(e),"isVar",0),y()(u()(e),"ns",x.a),y()(u()(e),"rdfFactory",void 0),e.rdfFactory=c&&c.rdfFactory||b.a;var l,h=S(O.b);try{var d=function(){var t=l.value;e[t]=function(){var n;return(n=e.rdfFactory)[t].apply(n,arguments)}};for(h.s();!(l=h.n()).done;)d()}catch(e){h.e(e)}finally{h.f()}return e}return o()(n,[{key:"add",value:function(e,t,n,r){var i=this;return 1===arguments.length&&e.forEach((function(e){return i.add(e.subject,e.predicate,e.object,e.graph)})),this.statements.push(this.rdfFactory.quad(e,t,n,r))}},{key:"addStatement",value:function(e){return this.add(e)}},{key:"bnode",value:function(e){return this.rdfFactory.blankNode(e)}},{key:"addAll",value:function(e){var t=this;e.forEach((function(e){t.add(e.subject,e.predicate,e.object,e.graph)}))}},{key:"any",value:function(e,t,n,r){var i=this.anyStatementMatching(e,t,n,r);return null==i?null:null==e?i.subject:null==t?i.predicate:null==n?i.object:null}},{key:"anyValue",value:function(e,t,n,r){var i=this.any(e,t,n,r);return i?i.value:void 0}},{key:"anyJS",value:function(e,t,n,r){var i=this.any(e,t,n,r);return i?_.a.toJS(i):void 0}},{key:"anyStatementMatching",value:function(e,t,n,r){var i=this.statementsMatching(e,t,n,r,!0);if(i&&0!==i.length)return i[0]}},{key:"id",value:function(e){return this.rdfFactory.id(e)}},{key:"statementsMatching",value:function(e,t,n,r,i){var a=this.statements.filter((function(i){return(!e||e.equals(i.subject))&&(!t||t.equals(i.predicate))&&(!n||n.equals(i.object))&&(!r||r.equals(i.graph))}));return i?0===a.length?[]:[a[0]]:a}},{key:"bottomTypeURIs",value:function(e){var t,n,r,i,a,o;for(var s in t=[],e)if(e.hasOwnProperty(s)){for(o=e[s],n=!0,r=0,i=(a=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(s))).length;r<i;r++)if(a[r].uri in e){n=!1;break}n&&(t[s]=o)}return t}},{key:"collection",value:function(){return new m.a}},{key:"each",value:function(e,t,n,r){var i=[],a=this.statementsMatching(e,t,n,r,!1);if(null==e)for(var o=0,s=a.length;o<s;o++)i.push(a[o].subject);else if(null==t)for(var u=0,c=a.length;u<c;u++)i.push(a[u].predicate);else if(null==n)for(var l=0,h=a.length;l<h;l++)i.push(a[l].object);else if(null==r)for(var d=0,f=a.length;d<f;d++)i.push(new I.a(a[d].graph.value));return i}},{key:"equals",value:function(e){return!!e&&this.hashString()===e.hashString()}},{key:"findMembersNT",value:function(e){var t,n,r,i,a,o,s,u,c,l,h,d,f,p;for(var v in(d={})[e.toNT()]=!0,i={},o=this.transitiveClosure(d,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0))if(o.hasOwnProperty(v)){for(var y=0,g=(s=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(v))).length;y<g;y++)i[(f=s[y]).subject.toNT()]=f;for(var m=0,b=(u=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(v))).length;m<b;m++)for(a=u[m],r=0,t=(c=this.statementsMatching(void 0,a)).length;r<t;r++)i[(f=c[r]).subject.toNT()]=f;for(var w=0,x=(l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(v))).length;w<x;w++)for(a=l[w],p=0,n=(h=this.statementsMatching(void 0,a)).length;p<n;p++)i[(f=h[p]).object.toNT()]=f}return i}},{key:"findMemberURIs",value:function(e){return this.NTtoURI(this.findMembersNT(e))}},{key:"findSubClassesNT",value:function(e){var t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}},{key:"findSuperClassesNT",value:function(e){var t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypesNT",value:function(e){var t,n,r,i,a,o;o=[];for(var s=0,u=(t=this.statementsMatching(e,void 0,void 0)).length;s<u;s++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===(a=t[s]).predicate.uri)o[a.object.toNT()]=a;else for(var c=0,l=(n=this.each(a.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"))).length;c<l;c++)o[n[c].toNT()]=a;for(var h=0,d=(r=this.statementsMatching(void 0,void 0,e)).length;h<d;h++){a=r[h];for(var f=0,p=(i=this.each(a.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"))).length;f<p;f++)o[i[f].toNT()]=a}return this.transitiveClosure(o,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypeURIs",value:function(e){return this.NTtoURI(this.findTypesNT(e))}},{key:"connectedStatements",value:function(e,t,n){n=n||[];for(var r=[e],i={},a={},o=[],s=this,u=function(e){var u=function(e){"BlankNode"!==e.termType||i[e.value]||(i[e.value]=!0,r.push(e))},c=s.statementsMatching(null,null,e,t).concat(s.statementsMatching(e,null,null,t));(c=c.filter((function(e){if(n[e.predicate.value])return!1;var t=e.toNT();return!a[t]&&(a[t]=!0,!0)}))).forEach((function(e){u(e.subject),u(e.object)})),o=o.concat(c)};r.length;)u(r.shift());return o}},{key:"formula",value:function(e){return new n}},{key:"fromNT",value:function(e){var t,n,r;switch(e[0]){case"<":return this.sym(e.slice(1,-1));case'"':if(r=void 0,t=void 0,(n=e.lastIndexOf('"'))<e.length-1)if("@"===e[n+1])r=e.slice(n+2);else{if("^^"!==e.slice(n+1,n+3))throw new Error("Can't convert string from NT: "+e);t=this.fromNT(e.slice(n+3))}return e=(e=(e=(e=e.slice(1,n)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(e,r||t);case"_":return this.rdfFactory.blankNode(e.slice(2));case"?":return new j.a(e.slice(1))}throw new Error("Can't convert from NT: "+e)}},{key:"holds",value:function(e,t,n,r){var i;if(1===arguments.length){if(!e)return!0;if(e instanceof Array){for(i=0;i<e.length;i++)if(!this.holds(e[i]))return!1;return!0}if(Object(N.j)(e))return this.holds(e.subject,e.predicate,e.object,e.graph);if(e.statements)return this.holds(e.statements)}var a=this.anyStatementMatching(e,t,n,r);return null!=a}},{key:"holdsStatement",value:function(e){return this.holds(e.subject,e.predicate,e.object,e.graph)}},{key:"list",value:function(e,t){if(t.rdfFactory.supports.COLLECTIONS){var n=t.rdfFactory.collection();return e.forEach((function(e){n.append(e)})),n}var r=t.rdfFactory.blankNode(),i=Object(O.c)(t.rdfFactory,r,e);return t.addAll(i),r}},{key:"NTtoURI",value:function(e){var t,n,r={};for(t in e)e.hasOwnProperty(t)&&(n=e[t],"<"===t[0]&&(r[t.slice(1,-1)]=n));return r}},{key:"serialize",value:function(e,t,n){var r,i,a;switch((a=Object(k.a)(this)).suggestNamespaces(this.ns),a.setBase(e),i=n?this.statementsMatching(void 0,void 0,void 0,n):this.statements,null!=t?t:"text/n3"){case"application/rdf+xml":r=a.statementsToXML(i);break;case"text/n3":case"text/turtle":r=a.statementsToN3(i);break;default:throw new Error("serialize: Content-type "+t+" not supported.")}return r}},{key:"substitute",value:function(e){var t=this.statements.map((function(t){return t.substitute(e)}));console.log("Formula subs statmnts:"+t);var r=new n;return r.addAll(t),console.log("indexed-form subs formula:"+r),r}},{key:"sym",value:function(e,t){if(t)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(e)}},{key:"the",value:function(e,t,n,r){var i=this.any(e,t,n,r);return null==i&&w.a.error("No value found for the() {"+e+" "+t+" "+n+"}."),i}},{key:"transitiveClosure",value:function(e,t,n){var r,i,a,o,s,u={};Object.assign(u,e);for(var c={};;){if(null==(s=function(){for(var e in u)if(u.hasOwnProperty(e))return e}()))return c;for(r=0,i=(o=n?this.each(void 0,t,this.fromNT(s)):this.each(this.fromNT(s),t)).length;r<i;r++)(a=o[r].toNT())in c||a in u||(u[a]=u[s]);c[s]=u[s],delete u[s]}}},{key:"topTypeURIs",value:function(e){var t,n,r,i,a,o,s;for(n in o=[],e)if(e.hasOwnProperty(n)){for(s=e[n],i=0,t=0,r=(a=this.each(this.rdfFactory.namedNode(n),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"))).length;t<r;t++)if("http://www.w3.org/2000/01/rdf-schema#Resource"!==a[t].uri){i++;break}i||(o[n]=s)}return o["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete o["http://www.w3.org/2000/01/rdf-schema#Resource"],o["http://www.w3.org/2002/07/owl#Thing"]&&delete o["http://www.w3.org/2002/07/owl#Thing"],o}},{key:"toString",value:function(){return"{"+this.statements.join("\n")+"}"}},{key:"variable",value:function(e){return new j.a(e)}},{key:"whether",value:function(e,t,n,r){return this.statementsMatching(e,t,n,r,!1).length}}]),n}(_.a)},function(e,t,n){"use strict";var r,i=n(0),a=n.n(i),o=n(32),s=n(17),u=n(1),c=n(19),l=n(7),h=n(23);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=f(f({},s.a),{},{supports:(r={},a()(r,c.a.collections,!0),a()(r,c.a.defaultGraphType,!1),a()(r,c.a.equalsMethod,!0),a()(r,c.a.identity,!1),a()(r,c.a.id,!0),a()(r,c.a.reversibleId,!1),a()(r,c.a.variableType,!0),r),collection:function(e){return new o.a(e)},id:function(e){var t=this;return Object(l.b)(e)?"( ".concat(e.elements.map((function(e){return t.id(e)})).join(", ")," )"):Object(l.n)(e)?h.a.toString(e):s.a.id(e)},termToNQ:function(e){return e.termType===u.b?o.a.toNT(e):s.a.termToNQ(e)}});t.a=p},function(e,t){var n="undefined"!=typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in e,o="ArrayBuffer"in e;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function v(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e,t,n,r=f(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=p(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=l(t)},d.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),h(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),h(e)},r&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var n,r,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),m.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];x.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function k(e,n){return new Promise((function(r,a){var o=new b(e,n);if(o.signal&&o.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new x(i,n))},s.onerror=function(){a(new TypeError("Network request failed"))},s.ontimeout=function(){a(new TypeError("Network request failed"))},s.onabort=function(){a(new t.DOMException("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),o.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",u)}),s.send(void 0===o._bodyInit?null:o._bodyInit)}))}k.polyfill=!0,e.fetch||(e.fetch=k,e.Headers=d,e.Request=b,e.Response=x),t.Headers=d,t.Request=b,t.Response=x,t.fetch=k,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},function(e,t,n){"use strict";const{isKeyword:r}=n(38),i=n(30),a=n(24),o=n(27),s=n(29),u={};e.exports=u,u.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new o.IdentifierIssuer("_:b"),r={"@default":{}};return u.createNodeMap(e,r,"@default",n),u.mergeNodeMaps(r)},u.createNodeMap=(e,t,n,c,l,h)=>{if(a.isArray(e)){for(const r of e)u.createNodeMap(r,t,n,c,void 0,h);return}if(!a.isObject(e))return void(h&&h.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(h&&h.push(e))}if(h&&i.isList(e)){const r=[];return u.createNodeMap(e["@list"],t,n,c,l,r),void h.push({"@list":r})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}a.isUndefined(l)&&(l=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),h&&h.push({"@id":l});const d=t[n],f=d[l]=d[l]||{};f["@id"]=l;const p=Object.keys(e).sort();for(let a of p){if("@id"===a)continue;if("@reverse"===a){const r={"@id":l},a=e["@reverse"];for(const e in a){const s=a[e];for(const a of s){let s=a["@id"];i.isBlankNode(a)&&(s=c.getId(s)),u.createNodeMap(a,t,n,c,s),o.addValue(d[s],e,r,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===a){l in t||(t[l]={}),u.createNodeMap(e[a],t,l,c);continue}if("@included"===a){u.createNodeMap(e[a],t,n,c);continue}if("@type"!==a&&r(a)){if("@index"===a&&a in f&&(e[a]!==f[a]||e[a]["@id"]!==f[a]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:f});f[a]=e[a];continue}const h=e[a];if(0===a.indexOf("_:")&&(a=c.getId(a)),0!==h.length)for(let e of h)if("@type"===a&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const r=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];o.addValue(f,a,{"@id":r},{propertyIsArray:!0,allowDuplicate:!1}),u.createNodeMap(e,t,n,c,r)}else if(i.isValue(e))o.addValue(f,a,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const r=[];u.createNodeMap(e["@list"],t,n,c,l,r),e={"@list":r},o.addValue(f,a,e,{propertyIsArray:!0,allowDuplicate:!1})}else u.createNodeMap(e,t,n,c,l),o.addValue(f,a,e,{propertyIsArray:!0,allowDuplicate:!1});else o.addValue(f,a,[],{propertyIsArray:!0})}},u.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const i of Object.keys(e[n]).sort()){const a=e[n][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(a).sort())if(r(e)&&"@type"!==e)s[e]=o.clone(a[e]);else for(const t of a[e])o.addValue(s,e,o.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},u.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const r of n){if("@default"===r)continue;const n=e[r];let a=t[r];a?"@graph"in a||(a["@graph"]=[]):t[r]=a={"@id":r,"@graph":[]};const o=a["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];i.isSubjectReference(t)||o.push(t)}}return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(34),i=n(13);function a(e,t,n){var a,o,s,u=["INSERT","DELETE","WHERE"],c=Object(i.a)("http://www.w3.org/ns/pim/patch#"),l=Object(r.a)(t,t,n,n,null,null,"",null),h={},d=function(e,t,n,r,i){return"Line "+(t+1)+" of <"+e+">: Bad syntax:\n "+i+'\n at: "'+n.slice(r,r+30)+'"'};a=0;var f=t.sym(n+"#query");for(h.query=f;;){if((o=l.skipSpace(e,a))<0)return h;if(";"===e[o]){if((a=l.skipSpace(e,o+1))<0)return h;o=a}var p=!1;for(s=0;s<u.length;s++){var v=u[s];if(e.slice(o,o+v.length)===v){if((a=l.skipSpace(e,o+v.length))<0)throw d(l._thisDoc,l.lines,e,o+v.length,"found EOF, needed {...} after "+v);if(("INSERT"===v||"DELETE"===v)&&"DATA"===e.slice(a,a+4)){if((o=l.skipSpace(e,a+4))<0)throw d(l._thisDoc,l.lines,e,a+4,"needed {...} after INSERT DATA "+v);a=o}var y=[];if((o=l.node(e,a,y))<0)throw d(l._thisDoc,l.lines,e,a,"bad syntax or EOF in {...} after "+v);h[v.toLowerCase()]=y[0],t.add(f,c(v.toLowerCase()),y[0]),p=!0,a=o}}if(!p&&"@prefix"===e.slice(o,o+7)){if((a=l.directive(e,o))<0)throw d(l._thisDoc,l.lines,e,a,"bad syntax or EOF after @prefix ");a=l.checkDot(e,a),p=!0}if(!p)throw d(l._thisDoc,l.lines,e,o,"Unknown syntax at start of statememt: '"+e.slice(o).slice(0,20)+"'")}}},function(e,t,n){"use strict";function r(e){return function(...t){var n=t.pop();return e.call(this,t,n)}}n.r(t),n.d(t,"convertToJson",(function(){return ct})),n.d(t,"convertToNQuads",(function(){return lt}));var i="function"==typeof queueMicrotask&&queueMicrotask,a="function"==typeof setImmediate&&setImmediate,o="object"==typeof process&&"function"==typeof process.nextTick;function s(e){setTimeout(e,0)}function u(e){return(t,...n)=>e(()=>t(...n))}var c=u(i?queueMicrotask:a?setImmediate:o?process.nextTick:s);function l(e){return f(e)?function(...t){const n=t.pop();return h(e.apply(this,t),n)}:r((function(t,n){var r;try{r=e.apply(this,t)}catch(e){return n(e)}if(r&&"function"==typeof r.then)return h(r,n);n(null,r)}))}function h(e,t){return e.then(e=>{d(t,null,e)},e=>{d(t,e&&e.message?e:new Error(e))})}function d(e,t,n){try{e(t,n)}catch(e){c(e=>{throw e},e)}}function f(e){return"AsyncFunction"===e[Symbol.toStringTag]}function p(e){if("function"!=typeof e)throw new Error("expected a function");return f(e)?l(e):e}function v(e,t=e.length){if(!t)throw new Error("arity is undefined");return function(...n){return"function"==typeof n[t-1]?e.apply(this,n):new Promise((r,i)=>{n[t-1]=(e,...t)=>{if(e)return i(e);r(t.length>1?t:t[0])},e.apply(this,n)})}}function y(e){return function(t,...n){return v((function(r){var i=this;return e(t,(e,t)=>{p(e).apply(i,n.concat(t))},r)}))}}function g(e,t,n,r){t=t||[];var i=[],a=0,o=p(n);return e(t,(e,t,n)=>{var r=a++;o(e,(e,t)=>{i[r]=t,n(e)})},e=>{r(e,i)})}function m(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0}const b={};function w(e){function t(...t){if(null!==e){var n=e;e=null,n.apply(this,t)}}return Object.assign(t,e),t}function x(e){if(m(e))return function(e){var t=-1,n=e.length;return function(){return++t<n?{value:e[t],key:t}:null}}(e);var t,n,r,i,a=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}(e);return a?function(e){var t=-1;return function(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}(a):(n=(t=e)?Object.keys(t):[],r=-1,i=n.length,function e(){var a=n[++r];return"__proto__"===a?e():r<i?{value:t[a],key:a}:null})}function _(e){return function(...t){if(null===e)throw new Error("Callback was already called.");var n=e;e=null,n.apply(this,t)}}function k(e,t,n,r){let i=!1,a=!1,o=!1,s=0,u=0;function c(){s>=t||o||i||(o=!0,e.next().then(({value:e,done:t})=>{if(!a&&!i){if(o=!1,t)return i=!0,void(s<=0&&r(null));s++,n(e,u,l),u++,c()}}).catch(h))}function l(e,t){if(s-=1,!a)return e?h(e):!1===e?(i=!0,void(a=!0)):t===b||i&&s<=0?(i=!0,r(null)):void c()}function h(e){a||(o=!1,i=!0,r(e))}c()}var T=e=>(t,n,r)=>{if(r=w(r),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return r(null);if("AsyncGenerator"===t[Symbol.toStringTag])return k(t,e,n,r);if(function(e){return"function"==typeof e[Symbol.asyncIterator]}(t))return k(t[Symbol.asyncIterator](),e,n,r);var i=x(t),a=!1,o=!1,s=0,u=!1;function c(e,t){if(!o)if(s-=1,e)a=!0,r(e);else if(!1===e)a=!0,o=!0;else{if(t===b||a&&s<=0)return a=!0,r(null);u||l()}}function l(){for(u=!0;s<e&&!a;){var t=i();if(null===t)return a=!0,void(s<=0&&r(null));s+=1,n(t.value,t.key,_(c))}u=!1}l()};var N=v((function(e,t,n,r){return T(t)(e,p(n),r)}),4);function j(e,t,n){n=w(n);var r=0,i=0,{length:a}=e,o=!1;function s(e,t){!1===e&&(o=!0),!0!==o&&(e?n(e):++i!==a&&t!==b||n(null))}for(0===a&&n(null);r<a;r++)t(e[r],r,_(s))}function O(e,t,n){return N(e,1/0,t,n)}var I=v((function(e,t,n){return(m(e)?j:O)(e,p(t),n)}),3);var S=v((function(e,t,n){return g(I,e,t,n)}),3),E=y(S);var R=v((function(e,t,n){return N(e,1,t,n)}),3);var A=v((function(e,t,n){return g(R,e,t,n)}),3),C=y(A);const L=Symbol("promiseCallback");function D(){let e,t;function n(n,...r){if(n)return t(n);e(r.length>1?r:r[0])}return n[L]=new Promise((n,r)=>{e=n,t=r}),n}function P(e,t,n){"number"!=typeof t&&(n=t,t=null),n=w(n||D());var r=Object.keys(e).length;if(!r)return n(null);t||(t=r);var i={},a=0,o=!1,s=!1,u=Object.create(null),c=[],l=[],h={};function d(e,t){c.push(()=>function(e,t){if(s)return;var r=_((t,...r)=>{if(a--,!1!==t)if(r.length<2&&([r]=r),t){var c={};if(Object.keys(i).forEach(e=>{c[e]=i[e]}),c[e]=r,s=!0,u=Object.create(null),o)return;n(t,c)}else i[e]=r,(u[e]||[]).forEach(e=>e()),f();else o=!0});a++;var c=p(t[t.length-1]);t.length>1?c(i,r):c(r)}(e,t))}function f(){if(!o){if(0===c.length&&0===a)return n(null,i);for(;c.length&&a<t;){c.shift()()}}}function v(t){var n=[];return Object.keys(e).forEach(r=>{const i=e[r];Array.isArray(i)&&i.indexOf(t)>=0&&n.push(r)}),n}return Object.keys(e).forEach(t=>{var n=e[t];if(!Array.isArray(n))return d(t,[n]),void l.push(t);var r=n.slice(0,n.length-1),i=r.length;if(0===i)return d(t,n),void l.push(t);h[t]=i,r.forEach(a=>{if(!e[a])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+a+"` in "+r.join(", "));!function(e,t){var n=u[e];n||(n=u[e]=[]);n.push(t)}(a,()=>{0===--i&&d(t,n)})})}),function(){var e,t=0;for(;l.length;)e=l.pop(),t++,v(e).forEach(e=>{0==--h[e]&&l.push(e)});if(t!==r)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),f(),n[L]}var M=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,F=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,U=/,/,q=/(=.+)?(\s*)$/,B=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;class H{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):V(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):V(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:n}=t;e(t)&&this.removeLink(t),t=n}return this}}function V(e,t){e.length=1,e.head=e.tail=t}function z(e,t,n){if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var r=p(e),i=0,a=[];const o={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function s(e,t){return e?t?void(o[e]=o[e].filter(e=>e!==t)):o[e]=[]:Object.keys(o).forEach(e=>o[e]=[])}function u(e,...t){o[e].forEach(e=>e(...t))}var l=!1;function h(e,t,n,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");var i,a;function o(e,...t){return e?n?a(e):i():t.length<=1?i(t[0]):void i(t)}g.started=!0;var s={data:e,callback:n?o:r||o};if(t?g._tasks.unshift(s):g._tasks.push(s),l||(l=!0,c(()=>{l=!1,g.process()})),n||!r)return new Promise((e,t)=>{i=e,a=t})}function d(e){return function(t,...n){i-=1;for(var r=0,o=e.length;r<o;r++){var s=e[r],c=a.indexOf(s);0===c?a.shift():c>0&&a.splice(c,1),s.callback(t,...n),null!=t&&u("error",t,s.data)}i<=g.concurrency-g.buffer&&u("unsaturated"),g.idle()&&u("drain"),g.process()}}function f(e){return!(0!==e.length||!g.idle())&&(c(()=>u("drain")),!0)}const v=e=>t=>{if(!t)return new Promise((t,n)=>{!function(e,t){const n=(...r)=>{s(e,n),t(...r)};o[e].push(n)}(e,(e,r)=>{if(e)return n(e);t(r)})});s(e),function(e,t){o[e].push(t)}(e,t)};var y=!1,g={_tasks:new H,*[Symbol.iterator](){yield*g._tasks[Symbol.iterator]()},concurrency:t,payload:n,buffer:t/4,started:!1,paused:!1,push(e,t){if(Array.isArray(e)){if(f(e))return;return e.map(e=>h(e,!1,!1,t))}return h(e,!1,!1,t)},pushAsync(e,t){if(Array.isArray(e)){if(f(e))return;return e.map(e=>h(e,!1,!0,t))}return h(e,!1,!0,t)},kill(){s(),g._tasks.empty()},unshift(e,t){if(Array.isArray(e)){if(f(e))return;return e.map(e=>h(e,!0,!1,t))}return h(e,!0,!1,t)},unshiftAsync(e,t){if(Array.isArray(e)){if(f(e))return;return e.map(e=>h(e,!0,!0,t))}return h(e,!0,!0,t)},remove(e){g._tasks.remove(e)},process(){if(!y){for(y=!0;!g.paused&&i<g.concurrency&&g._tasks.length;){var e=[],t=[],n=g._tasks.length;g.payload&&(n=Math.min(n,g.payload));for(var o=0;o<n;o++){var s=g._tasks.shift();e.push(s),a.push(s),t.push(s.data)}i+=1,0===g._tasks.length&&u("empty"),i===g.concurrency&&u("saturated");var c=_(d(e));r(t,c)}y=!1}},length:()=>g._tasks.length,running:()=>i,workersList:()=>a,idle:()=>g._tasks.length+i===0,pause(){g.paused=!0},resume(){!1!==g.paused&&(g.paused=!1,c(g.process))}};return Object.defineProperties(g,{saturated:{writable:!1,value:v("saturated")},unsaturated:{writable:!1,value:v("unsaturated")},empty:{writable:!1,value:v("empty")},drain:{writable:!1,value:v("drain")},error:{writable:!1,value:v("error")}}),g}var X=v((function(e,t,n,r){r=w(r);var i=p(n);return R(e,(e,n,r)=>{i(t,e,(e,n)=>{t=n,r(e)})},e=>r(e,t))}),4);function Q(...e){var t=e.map(p);return function(...e){var n=this,r=e[e.length-1];return"function"==typeof r?e.pop():r=D(),X(t,e,(e,t,r)=>{t.apply(n,e.concat((e,...t)=>{r(e,t)}))},(e,t)=>r(e,...t)),r[L]}}var $=v((function(e,t,n,r){return g(T(t),e,n,r)}),4);var G=v((function(e,t,n,r){var i=p(n);return $(e,t,(e,t)=>{i(e,(e,...n)=>e?t(e):t(e,n))},(e,t)=>{for(var n=[],i=0;i<t.length;i++)t[i]&&(n=n.concat(...t[i]));return r(e,n)})}),4);var J=v((function(e,t,n){return G(e,1/0,t,n)}),3);var W=v((function(e,t,n){return G(e,1,t,n)}),3);function Y(e,t){return(n,r,i,a)=>{var o,s=!1;const u=p(i);n(r,(n,r,i)=>{u(n,(r,a)=>r||!1===r?i(r):e(a)&&!o?(s=!0,o=t(!0,n),i(null,b)):void i())},e=>{if(e)return a(e);a(null,s?o:t(!1))})}}var Z=v((function(e,t,n){return Y(e=>e,(e,t)=>t)(I,e,t,n)}),3);var K=v((function(e,t,n,r){return Y(e=>e,(e,t)=>t)(T(t),e,n,r)}),4);var ee=v((function(e,t,n){return Y(e=>e,(e,t)=>t)(T(1),e,t,n)}),3);function te(e){return(t,...n)=>p(t)(...n,(t,...n)=>{"object"==typeof console&&(t?console.error&&console.error(t):console[e]&&n.forEach(t=>console[e](t)))})}var ne=te("dir");var re=v((function(e,t,n){n=_(n);var r,i=p(e),a=p(t);function o(e,...t){if(e)return n(e);!1!==e&&(r=t,a(...t,s))}function s(e,t){return e?n(e):!1!==e?t?void i(o):n(null,...r):void 0}return s(null,!0)}),3);function ie(e){return(t,n,r)=>e(t,r)}var ae=v((function(e,t,n){return I(e,ie(p(t)),n)}),3);var oe=v((function(e,t,n,r){return T(t)(e,ie(p(n)),r)}),4);var se=v((function(e,t,n){return oe(e,1,t,n)}),3);function ue(e){return f(e)?e:function(...t){var n=t.pop(),r=!0;t.push((...e)=>{r?c(()=>n(...e)):n(...e)}),e.apply(this,t),r=!1}}var ce=v((function(e,t,n){return Y(e=>!e,e=>!e)(I,e,t,n)}),3);var le=v((function(e,t,n,r){return Y(e=>!e,e=>!e)(T(t),e,n,r)}),4);var he=v((function(e,t,n){return Y(e=>!e,e=>!e)(R,e,t,n)}),3);function de(e,t,n,r){var i=new Array(t.length);e(t,(e,t,r)=>{n(e,(e,n)=>{i[t]=!!n,r(e)})},e=>{if(e)return r(e);for(var n=[],a=0;a<t.length;a++)i[a]&&n.push(t[a]);r(null,n)})}function fe(e,t,n,r){var i=[];e(t,(e,t,r)=>{n(e,(n,a)=>{if(n)return r(n);a&&i.push({index:t,value:e}),r(n)})},e=>{if(e)return r(e);r(null,i.sort((e,t)=>e.index-t.index).map(e=>e.value))})}function pe(e,t,n,r){return(m(t)?de:fe)(e,t,p(n),r)}var ve=v((function(e,t,n){return pe(I,e,t,n)}),3);var ye=v((function(e,t,n,r){return pe(T(t),e,n,r)}),4);var ge=v((function(e,t,n){return pe(R,e,t,n)}),3);var me=v((function(e,t){var n=_(t),r=p(ue(e));return function e(t){if(t)return n(t);!1!==t&&r(e)}()}),2);var be=v((function(e,t,n,r){var i=p(n);return $(e,t,(e,t)=>{i(e,(n,r)=>n?t(n):t(n,{key:r,val:e}))},(e,t)=>{for(var n={},{hasOwnProperty:i}=Object.prototype,a=0;a<t.length;a++)if(t[a]){var{key:o}=t[a],{val:s}=t[a];i.call(n,o)?n[o].push(s):n[o]=[s]}return r(e,n)})}),4);var we=te("log");var xe=v((function(e,t,n,r){r=w(r);var i={},a=p(n);return T(t)(e,(e,t,n)=>{a(e,t,(e,r)=>{if(e)return n(e);i[t]=r,n(e)})},e=>r(e,i))}),4);var _e=u(o?process.nextTick:a?setImmediate:s),ke=v((e,t,n)=>{var r=m(t)?[]:{};e(t,(e,t,n)=>{p(e)((e,...i)=>{i.length<2&&([i]=i),r[t]=i,n(e)})},e=>n(e,r))},3);function Te(e,t){var n=p(e);return z((e,t)=>{n(e[0],t)},t,1)}class Ne{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){let t;for(;e>0&&Oe(this.heap[e],this.heap[t=je(e)]);){let n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n,e=t}}percDown(e){let t;for(;(t=1+(e<<1))<this.heap.length&&(t+1<this.heap.length&&Oe(this.heap[t+1],this.heap[t])&&(t+=1),!Oe(this.heap[e],this.heap[t]));){let n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n,e=t}}push(e){e.pushCount=++this.pushCount,this.heap.push(e),this.percUp(this.heap.length-1)}unshift(e){return this.heap.push(e)}shift(){let[e]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),e}toArray(){return[...this]}*[Symbol.iterator](){for(let e=0;e<this.heap.length;e++)yield this.heap[e].data}remove(e){let t=0;for(let n=0;n<this.heap.length;n++)e(this.heap[n])||(this.heap[t]=this.heap[n],t++);this.heap.splice(t);for(let e=je(this.heap.length-1);e>=0;e--)this.percDown(e);return this}}function je(e){return(e+1>>1)-1}function Oe(e,t){return e.priority!==t.priority?e.priority<t.priority:e.pushCount<t.pushCount}var Ie=v((function(e,t){if(t=w(t),!Array.isArray(e))return t(new TypeError("First argument to race must be an array of functions"));if(!e.length)return t();for(var n=0,r=e.length;n<r;n++)p(e[n])(t)}),2);function Se(e,t,n,r){var i=[...e].reverse();return X(i,t,n,r)}function Ee(e){var t=p(e);return r((function(e,n){return e.push((e,...t)=>{let r={};if(e&&(r.error=e),t.length>0){var i=t;t.length<=1&&([i]=t),r.value=i}n(null,r)}),t.apply(this,e)}))}function Re(e,t,n,r){const i=p(n);return pe(e,t,(e,t)=>{i(e,(e,n)=>{t(e,!n)})},r)}var Ae=v((function(e,t,n){return Re(I,e,t,n)}),3);var Ce=v((function(e,t,n,r){return Re(T(t),e,n,r)}),4);var Le=v((function(e,t,n){return Re(R,e,t,n)}),3);function De(e){return function(){return e}}function Pe(e,t,n){var r={times:5,intervalFunc:De(0)};if(arguments.length<3&&"function"==typeof e?(n=t||D(),t=e):(Me(r,e),n=n||D()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var i=p(t),a=1;function o(){i((e,...t)=>{!1!==e&&(e&&a++<r.times&&("function"!=typeof r.errorFilter||r.errorFilter(e))?setTimeout(o,r.intervalFunc(a-1)):n(e,...t))})}return o(),n[L]}function Me(e,t){if("object"==typeof t)e.times=+t.times||5,e.intervalFunc="function"==typeof t.interval?t.interval:De(+t.interval||0),e.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");e.times=+t||5}}var Fe=v((function(e,t,n){return Y(Boolean,e=>e)(I,e,t,n)}),3);var Ue=v((function(e,t,n,r){return Y(Boolean,e=>e)(T(t),e,n,r)}),4);var qe=v((function(e,t,n){return Y(Boolean,e=>e)(R,e,t,n)}),3);var Be=v((function(e,t,n){var r=p(t);return S(e,(e,t)=>{r(e,(n,r)=>{if(n)return t(n);t(n,{value:e,criteria:r})})},(e,t)=>{if(e)return n(e);n(null,t.sort(i).map(e=>e.value))});function i(e,t){var n=e.criteria,r=t.criteria;return n<r?-1:n>r?1:0}}),3);function He(e,t,n,r){var i=p(n);return $(function(e){for(var t=Array(e);e--;)t[e]=e;return t}(e),t,i,r)}var Ve=v((function(e,t){var n,r=null;return se(e,(e,t)=>{p(e)((e,...i)=>{if(!1===e)return t(e);i.length<2?[n]=i:n=i,r=e,t(e?null:{})})},()=>t(r,n))}));var ze=v((function(e,t,n){n=_(n);var r=p(t),i=p(e),a=[];function o(e,...t){if(e)return n(e);a=t,!1!==e&&i(s)}function s(e,t){return e?n(e):!1!==e?t?void r(o):n(null,...a):void 0}return i(s)}),3);var Xe=v((function(e,t){if(t=w(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var n=0;function r(t){p(e[n++])(...t,_(i))}function i(i,...a){if(!1!==i)return i||n===e.length?t(i,...a):void r(a)}r([])})),Qe={apply:function(e,...t){return(...n)=>e(...t,...n)},applyEach:E,applyEachSeries:C,asyncify:l,auto:P,autoInject:function(e,t){var n={};return Object.keys(e).forEach(t=>{var r,i=e[t],a=f(i),o=!a&&1===i.length||a&&0===i.length;if(Array.isArray(i))r=[...i],i=r.pop(),n[t]=r.concat(r.length>0?s:i);else if(o)n[t]=i;else{if(r=function(e){const t=e.toString().replace(B,"");let n=t.match(M);if(n||(n=t.match(F)),!n)throw new Error("could not parse args in autoInject\nSource:\n"+t);let[,r]=n;return r.replace(/\s/g,"").split(U).map(e=>e.replace(q,"").trim())}(i),0===i.length&&!a&&0===r.length)throw new Error("autoInject task functions require explicit parameters.");a||r.pop(),n[t]=r.concat(s)}function s(e,t){var n=r.map(t=>e[t]);n.push(t),p(i)(...n)}}),P(n,t)},cargo:function(e,t){return z(e,1,t)},cargoQueue:function(e,t,n){return z(e,t,n)},compose:function(...e){return Q(...e.reverse())},concat:J,concatLimit:G,concatSeries:W,constant:function(...e){return function(...t){return t.pop()(null,...e)}},detect:Z,detectLimit:K,detectSeries:ee,dir:ne,doUntil:function(e,t,n){const r=p(t);return re(e,(...e)=>{const t=e.pop();r(...e,(e,n)=>t(e,!n))},n)},doWhilst:re,each:ae,eachLimit:oe,eachOf:I,eachOfLimit:N,eachOfSeries:R,eachSeries:se,ensureAsync:ue,every:ce,everyLimit:le,everySeries:he,filter:ve,filterLimit:ye,filterSeries:ge,forever:me,groupBy:function(e,t,n){return be(e,1/0,t,n)},groupByLimit:be,groupBySeries:function(e,t,n){return be(e,1,t,n)},log:we,map:S,mapLimit:$,mapSeries:A,mapValues:function(e,t,n){return xe(e,1/0,t,n)},mapValuesLimit:xe,mapValuesSeries:function(e,t,n){return xe(e,1,t,n)},memoize:function(e,t=(e=>e)){var n=Object.create(null),i=Object.create(null),a=p(e),o=r((e,r)=>{var o=t(...e);o in n?c(()=>r(null,...n[o])):o in i?i[o].push(r):(i[o]=[r],a(...e,(e,...t)=>{e||(n[o]=t);var r=i[o];delete i[o];for(var a=0,s=r.length;a<s;a++)r[a](e,...t)}))});return o.memo=n,o.unmemoized=e,o},nextTick:_e,parallel:function(e,t){return ke(I,e,t)},parallelLimit:function(e,t,n){return ke(T(t),e,n)},priorityQueue:function(e,t){var n=Te(e,t),r=!1;return n._tasks=new Ne,n.push=function(e,t=0,i=(()=>{})){if("function"!=typeof i)throw new Error("task callback must be a function");if(n.started=!0,Array.isArray(e)||(e=[e]),0===e.length&&n.idle())return c(()=>n.drain());for(var a=0,o=e.length;a<o;a++){var s={data:e[a],priority:t,callback:i};n._tasks.push(s)}r||(r=!0,c(()=>{r=!1,n.process()}))},delete n.unshift,n},queue:Te,race:Ie,reduce:X,reduceRight:Se,reflect:Ee,reflectAll:function(e){var t;return Array.isArray(e)?t=e.map(Ee):(t={},Object.keys(e).forEach(n=>{t[n]=Ee.call(this,e[n])})),t},reject:Ae,rejectLimit:Ce,rejectSeries:Le,retry:Pe,retryable:function(e,t){t||(t=e,e=null);let n=e&&e.arity||t.length;f(t)&&(n+=1);var i=p(t);return r((t,r)=>{function a(e){i(...t,e)}return(t.length<n-1||null==r)&&(t.push(r),r=D()),e?Pe(e,a,r):Pe(a,r),r[L]})},seq:Q,series:function(e,t){return ke(R,e,t)},setImmediate:c,some:Fe,someLimit:Ue,someSeries:qe,sortBy:Be,timeout:function(e,t,n){var i=p(e);return r((r,a)=>{var o,s=!1;r.push((...e)=>{s||(a(...e),clearTimeout(o))}),o=setTimeout((function(){var t=e.name||"anonymous",r=new Error('Callback function "'+t+'" timed out.');r.code="ETIMEDOUT",n&&(r.info=n),s=!0,a(r)}),t),i(...r)})},times:function(e,t,n){return He(e,1/0,t,n)},timesLimit:He,timesSeries:function(e,t,n){return He(e,1,t,n)},transform:function(e,t,n,r){arguments.length<=3&&"function"==typeof t&&(r=n,n=t,t=Array.isArray(e)?[]:{}),r=w(r||D());var i=p(n);return I(e,(e,n,r)=>{i(t,e,n,r)},e=>r(e,t)),r[L]},tryEach:Ve,unmemoize:function(e){return(...t)=>(e.unmemoized||e)(...t)},until:function(e,t,n){const r=p(e);return ze(e=>r((t,n)=>e(t,!n)),t,n)},waterfall:Xe,whilst:ze,all:ce,allLimit:le,allSeries:he,any:Fe,anyLimit:Ue,anySeries:qe,find:Z,findLimit:K,findSeries:ee,flatMap:J,flatMapLimit:G,flatMapSeries:W,forEach:ae,forEachSeries:se,forEachLimit:oe,forEachOf:I,forEachOfSeries:R,forEachOfLimit:N,inject:X,foldl:X,foldr:Se,select:ve,selectLimit:ye,selectSeries:ge,wrapSync:l,during:ze,doDuring:re},$e=n(54),Ge=n.n($e),Je=n(104),We=n(21),Ye=n(41),Ze=n(55);const Ke=Ye.b.defaultGraph(),{rdf:et,xsd:tt}=We.a,nt=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,rt=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,it={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class at extends Ye.a{equals(){return!1}}class ot{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,n,r){e+=t,r&&r()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Ke,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${ut(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return Ke.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,n,r,i){try{r.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(Ke.equals(r)?"":this._encodeIriOrBlank(r)+" {\n")),this._graph=r,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(", "+this._encodeObject(n),i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i)}catch(e){i&&i(e)}}_writeQuadLine(e,t,n,r,i){delete this._prefixMatch,this._write(this.quadToString(e,t,n,r),i)}quadToString(e,t,n,r){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(n)}${r&&r.value?` ${this._encodeIriOrBlank(r)} .\n`:" .\n"}`}quadsToString(e){return e.map(e=>this.quadToString(e.subject,e.predicate,e.object,e.graph)).join("")}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:"_:"+e.value;let t=e.value;this._baseMatcher&&this._baseMatcher.test(t)&&(t=t.substr(this._baseLength)),nt.test(t)&&(t=t.replace(rt,st));const n=this._prefixRegex.exec(t);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(nt.test(t)&&(t=t.replace(rt,st)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===tt.string)return`"${t}"`}else switch(e.datatype.value){case tt.string:return`"${t}"`;case tt.boolean:if("true"===t||"false"===t)return t;break;case tt.integer:if(/^[+-]?\d+$/.test(t))return t;break;case tt.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case tt.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===et.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:n,graph:r}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(n)}${Object(Ze.a)(r)?"":" "+this._encodeIriOrBlank(r)}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,n,r,i){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof r?this._writeQuad(e,t,n,Ke,r):this._writeQuad(e,t,n,r||Ke,i)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,n){const r={};r[e]=t,this.addPrefixes(r,n)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let n=!1;for(let t in e){let r=e[t];"string"!=typeof r&&(r=r.value),n=!0,null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null,this._graph=""),this._prefixIRIs[r]=t+=":",this._write(`@prefix ${t} <${r}>.\n`)}if(n){let e="",t="";for(const n in this._prefixIRIs)e+=e?"|"+n:n,t+=(t?"|":"")+this._prefixIRIs[n];e=ut(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",t)}blank(e,t){let n,r,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return new at("[]");case 1:if(n=i[0],!(n.object instanceof at))return new at(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let t="[";for(let a=0;a<r;a++)n=i[a],n.predicate.equals(e)?t+=", "+this._encodeObject(n.object):(t+=`${(a?";\n ":"\n ")+this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)}`,e=n.predicate);return new at(t+"\n]")}}list(e){const t=e&&e.length||0,n=new Array(t);for(let r=0;r<t;r++)n[r]=this._encodeObject(e[r]);return new at(`(${n.join(" ")})`)}end(e){null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null),this._write=this._blockedWrite;let t=e&&((n,r)=>{t=null,e(n,r)});if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}}function st(e){let t=it[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function ut(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}function ct(e,t){var n,r=new Je.a,i=new ot({format:"N-Quads"});Qe.waterfall([function(t){r.parse(e,(function(e,n,r){e?t(e):null!==n?i.addQuad(n):i.end(t)}))},function(e,t){try{Ge.a.fromRDF(e,{format:"application/nquads"}).then((function(e){t(null,e)}))}catch(e){t(e)}},function(e,r){n=JSON.stringify(e),t(null,n)}],(function(e,r){t(e,n)}))}function lt(e,t){var n,r=new Je.a,i=new ot({format:"N-Quads"});Qe.waterfall([function(t){r.parse(e,(function(e,n,r){e?t(e):null!==quad?i.addQuad(quad):i.end(t)}))},function(e,r){t(null,n=e)}],(function(e,r){t(e,n)}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(54),i=n.n(r),a=n(15);function o(e,t){return"string"==typeof t?e.rdfFactory.literal(t):Object.prototype.hasOwnProperty.call(t,"@list")?!0===e.rdfFactory.supports.COLLECTIONS?function(e,t){if(!Array.isArray(t))throw new TypeError("Object must be an array");return e.rdfFactory.collection(t.map((function(t){return o(e,t)})))}(e,t["@list"]):function(e,t){var n=t["@id"]?e.rdfFactory.namedNode(t["@id"]):e.rdfFactory.blankNode(),r=t["@list"].map((function(t){return o(e,t)})),i=Object(a.c)(e.rdfFactory,n,r);return e.addAll(i),n}(e,t):Object.prototype.hasOwnProperty.call(t,"@id")?e.rdfFactory.namedNode(t["@id"]):Object.prototype.hasOwnProperty.call(t,"@language")?e.rdfFactory.literal(t["@value"],t["@language"]):Object.prototype.hasOwnProperty.call(t,"@type")?e.rdfFactory.literal(t["@value"],e.rdfFactory.namedNode(t["@type"])):Object.prototype.hasOwnProperty.call(t,"@value")?e.rdfFactory.literal(t["@value"]):e.rdfFactory.literal(t)}function s(e,t,n,r){var a=n&&Object.prototype.hasOwnProperty.call(n,"termType")?n.value:n;return i.a.flatten(JSON.parse(e),null,{base:a}).then((function(e){return e.reduce((function(e,r){for(var i=r["@id"]?t.rdfFactory.namedNode(r["@id"]):t.rdfFactory.blankNode(),a=0,o=Object.keys(r);a<o.length;a++){var s=o[a];if("@id"!==s){var c=r[s];if(Array.isArray(c))for(var l=0;l<c.length;l++)t.addStatement(u(t,i,s,c[l],n));else t.addStatement(u(t,i,s,c,n))}}return t}),t)})).then(r).catch(r)}function u(e,t,n,r,i){var a,s;return"@type"===n?(a=e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),s=e.rdfFactory.namedNode(r)):(a=e.rdfFactory.namedNode(n),s=o(e,r)),e.rdfFactory.quad(t,a,s,e.rdfFactory.namedNode(i))}},function(e,t,n){
3
+ const w=p["@id"];if("@context"===w||"@preserve"===w)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(d&&d.protected&&!l&&(e.protected[n]=!0,p.protected=!0,!function e(t,n){if(!t||"object"!=typeof t||!n||"object"!=typeof n)return t===n;const r=Array.isArray(t);if(r!==Array.isArray(n))return!1;if(r){if(t.length!==n.length)return!1;for(let r=0;r<t.length;++r)if(!e(t[r],n[r]))return!1;return!0}const i=Object.keys(t),a=Object.keys(n);if(i.length!==a.length)return!1;for(const r in t){let i=t[r],a=n[r];if("@container"===r&&Array.isArray(i)&&Array.isArray(a)&&(i=i.slice().sort(),a=a.slice().sort()),!e(i,a))return!1}return!0}(d,p))){const e=u&&u.protectedMode||"error";if("error"===e)throw new i(`Invalid JSON-LD syntax; tried to redefine "${n}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n});if("warn"===e)return void console.warn("WARNING: protected term redefinition",{term:n});throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,term:n,protectedMode:e})}},y.expandIri=(e,t,n,r)=>g(e,t,n,void 0,void 0,r),y.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=p.get(t);if(n)return n;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},n=e.fastCurieMap={},r={},i=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],u=e.mappings,c=[...u.keys()].sort(f);for(const e of c){const a=u.get(e);if(null===a)continue;let c=a["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===a["@id"])continue;const l=d(a["@id"]);for(const u of l){let l=t[u];const h=y.isKeyword(u);if(l)h||a._termHasColon||r[u].push(e);else if(t[u]=l={},!h&&!a._termHasColon){r[u]=[e];const t={iri:u,terms:r[u]};u[0]in n?n[u[0]].push(t):n[u[0]]=[t]}if(l[c]||(l[c]={"@language":{},"@type":{},"@any":{}}),l=l[c],o(e,l["@any"],"@none"),a.reverse)o(e,l["@type"],"@reverse");else if("@none"===a["@type"])o(e,l["@any"],"@none"),o(e,l["@language"],"@none"),o(e,l["@type"],"@none");else if("@type"in a)o(e,l["@type"],a["@type"]);else if("@language"in a&&"@direction"in a){const t=a["@language"],n=a["@direction"];o(e,l["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?"_"+n:"@null")}else"@language"in a?o(e,l["@language"],(a["@language"]||"@null").toLowerCase()):"@direction"in a?a["@direction"]?o(e,l["@language"],"_"+a["@direction"]):o(e,l["@language"],"@none"):s?(o(e,l["@language"],"_"+s),o(e,l["@language"],"@none"),o(e,l["@type"],"@none")):(o(e,l["@language"],i),o(e,l["@language"],"@none"),o(e,l["@type"],"@none"))}}for(const e in n)a(n,e,1);return t},clone:function(){const e={};e.mappings=r.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=r.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone());e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]);"@language"in this&&(e["@language"]=this["@language"]);"@vocab"in this&&(e["@vocab"]=this["@vocab"]);return e},revertToPreviousContext:function(){if(!this.previousContext)return this;return this.previousContext.clone()},protected:{}};return 1e4===p.size&&p.clear(),p.set(t,i),i;function a(e,t,n){const r=e[t],i=e[t]={};let o,s;for(const e of r)o=e.iri,s=n>=o.length?"":o[n],s in i?i[s].push(e):i[s]=[e];for(const e in i)""!==e&&a(i,e,n+1)}function o(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},y.getContextValue=(e,t,n)=>{if(null===t){if("@context"===n)return;return null}if(e.mappings.has(t)){const r=e.mappings.get(t);if(u(n))return r;if(r.hasOwnProperty(n))return r[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},y.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,y.isKeyword=e=>{if(!s(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Y}));var r=n(71),i=n.n(r),a=n(5),o=n.n(a),s=n(12),u=n.n(s),c=n(14),l=n.n(c),h=n(9),d=n.n(h),f=n(4),p=n.n(f),v=n(0),y=n.n(v),g=n(62),m=n.n(g),b=n(28),w=n(2),x=n(34),_=n(8),k=n(13),T=n(46),N=n(35),j=n(42),O=n(6),I=n(7),S=n(10),E=n(40),R=n(49),A=n.n(R),C=n(1),L=n(25),D=n(53);function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}var M={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},F={rdf:C.o,owl:C.o,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},U=function(e){return{link:Object(k.a)("http://www.w3.org/2007/ont/link#",e),http:Object(k.a)("http://www.w3.org/2007/ont/http#",e),httph:Object(k.a)("http://www.w3.org/2007/ont/httph#",e),rdf:Object(k.a)("http://www.w3.org/1999/02/22-rdf-syntax-ns#",e),rdfs:Object(k.a)("http://www.w3.org/2000/01/rdf-schema#",e),dc:Object(k.a)("http://purl.org/dc/elements/1.1/",e),ldp:Object(k.a)("http://www.w3.org/ns/ldp#",e)}},q=U(),B=function e(t,n){p()(this,e),y()(this,"response",void 0),y()(this,"dom",void 0),this.response=t,this.dom=n};y()(B,"pattern",void 0);var H=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n){var r=e.store;if(this.dom||(this.dom=S.parseXML(t)),"parsererror"===this.dom.documentElement.nodeName)return e.failFetch(n,"Badly formed XML in "+n.resource.value,"parse_error");var i=new j.a(r);try{i.parse(this.dom,n.original.value,n.original)}catch(t){return e.failFetch(n,"Syntax error parsing RDF/XML! "+t,"parse_error")}return n.noMeta||r.add(n.original,q.rdf("type"),q.link("RDFDocument"),e.appNode),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"RDFXMLHandler"}},{key:"register",value:function(e){e.mediatypes[C.o]={q:.9}}}]),n}(B);H.pattern=new RegExp("application/rdf\\+xml");var V=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n){var r,i;this.dom||(this.dom=S.parseXML(t));var a=e.store,o=this.dom.getElementsByTagName("title");o.length>0&&a.add(n.resource,q.dc("title"),a.rdfFactory.literal(o[0].textContent),n.resource);for(var s=this.dom.getElementsByTagName("link"),u=s.length-1;u>=0;u--)i=!1,(r=s[u].getAttribute("rel"))||(r=s[u].getAttribute("rev"),i=!0),r&&e.linkData(n.original,r,s[u].getAttribute("href"),n.resource,i);for(var c=this.dom.getElementsByTagName("script"),l=0;l<c.length;l++){var h=c[l].getAttribute("type");M[h]&&(Object(T.a)(c[l].textContent,a,n.original.value,h),Object(T.a)(c[l].textContent,a,n.original.value,h))}if(n.noMeta||a.add(n.resource,q.rdf("type"),q.link("WebPage"),e.appNode),!n.noRDFa&&N.b)try{Object(N.b)(this.dom,a,n.original.value)}catch(t){var d="Error trying to parse "+n.resource+" as RDFa:\n"+t+":\n"+t.stack;return e.failFetch(n,d,"parse_error")}return e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"XHTMLHandler"}},{key:"register",value:function(e){e.mediatypes[C.u]={}}}]),n}(B);V.pattern=new RegExp("application/xhtml");var z=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,r){for(var i=S.parseXML(t),a=0;a<i.childNodes.length;a++){var o=i.childNodes[a];if(n.isElement(o)){var s=o.namespaceURI;if(s&&s===s.rdf)return e.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new H(this.response,i).parse(e,t,r);break}}if(i.doctype&&("html"===i.doctype.name&&i.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&i.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/)))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new V(this.response,i).parse(e,t,r);var u=i.getElementsByTagName("html")[0];if(u){var c=u.getAttribute("xmlns");if(c&&c.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return e.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new V(this.response,i).parse(e,t,r)}return e.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+t.slice(0,80),901)}}],[{key:"toString",value:function(){return"XMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/xml"]={q:.5},e.mediatypes["application/xml"]={q:.5}}},{key:"isElement",value:function(e){return e.nodeType===Node.ELEMENT_NODE}}]),n}(B);z.pattern=new RegExp("(text|application)/(.*)xml");var X=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n){var r=e.store;if(W(t))return e.addStatus(n.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new V(this.response).parse(e,t,n);if(function(e){var t=e.indexOf("<!DOCTYPE html"),n=e.indexOf(">");if(-1===t||-1===n||t>n)return!1;return-1!==e.substr(t,n-t).indexOf("XHTML")}(t))return e.addStatus(n.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new V(this.response).parse(e,t,n);if(function(e){return!!e.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(t))return e.addStatus(n.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new V(this.response).parse(e,t,n);var i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(t);return i&&r.add(n.resource,q.dc("title"),r.rdfFactory.literal(i[1]),n.resource),r.add(n.resource,q.rdf("type"),q.link("WebPage"),e.appNode),e.addStatus(n.req,"non-XML HTML document, not parsed for data."),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/html"]={q:.9}}}]),n}(B);X.pattern=new RegExp("text/html");var Q=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n,r){var i=e.store;return new Promise((function(a,o){try{Object(D.a)(t,i,n.original.value,(function(){a(e.doneFetch(n,r))}))}catch(t){var s="Error trying to parse "+n.resource+" as JSON-LD:\n"+t;a(e.failFetch(n,s,"parse_error",r))}}))}}],[{key:"toString",value:function(){return"JsonLdHandler"}},{key:"register",value:function(e){e.mediatypes["application/ld+json"]={q:.9}}}]),n}(B);Q.pattern=/application\/ld\+json/;var $=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n){return W(t)?(e.addStatus(n.req,"Warning: "+n.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new z(this.response).parse(e,t,n)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(n.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new z(this.response).parse(e,t,n)):(e.addStatus(n.req,"Plain text document, no known RDF semantics."),e.doneFetch(n,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(e){e.mediatypes["text/plain"]={q:.5}}}]),n}(B);$.pattern=new RegExp("text/plain");var G=function(e){u()(n,e);var t=P(n);function n(){return p()(this,n),t.apply(this,arguments)}return o()(n,[{key:"parse",value:function(e,t,n,r){var i=e.store,a=Object(x.a)(i,i,n.original.value,n.original.value,null,null,"",null);try{a.loadBuf(t)}catch(t){var o="Error trying to parse "+n.resource+" as Notation3:\n"+t;return e.failFetch(n,o,"parse_error",r)}return e.addStatus(n.req,"N3 parsed: "+a.statementCount+" triples in "+a.lines+" lines."),e.store.add(n.original,q.rdf("type"),q.link("RDFDocument"),e.appNode),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}}]),n}(B);G.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var J={RDFXMLHandler:H,XHTMLHandler:V,XMLHandler:z,HTMLHandler:X,TextHandler:$,N3Handler:G,JsonLdHandler:Q};function W(e){return!!e.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}var Y=function(){function t(n){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(p()(this,t),y()(this,"store",void 0),y()(this,"timeout",void 0),y()(this,"_fetch",void 0),y()(this,"mediatypes",void 0),y()(this,"appNode",void 0),y()(this,"requested",void 0),y()(this,"timeouts",void 0),y()(this,"redirectedTo",void 0),y()(this,"fetchQueue",void 0),y()(this,"fetchCallbacks",void 0),y()(this,"nonexistent",void 0),y()(this,"lookedUp",void 0),y()(this,"handlers",void 0),y()(this,"ns",void 0),y()(this,"fireCallbacks",void 0),this.store=n||new b.a,this.ns=U(this.store.rdfFactory),this.timeout=i.timeout||3e4,this._fetch=i.fetch||void 0!==e&&(e.solidFetcher||e.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||A.a,!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.rdfFactory.blankNode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},S.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(i.handlers||J).map((function(e){return r.addHandler(J[e])}))}var n;return o()(t,[{key:"load",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n=Object.assign({},n),e instanceof Array)return Promise.all(e.map((function(e){return t.load(e,Object.assign({},n))})));var r=e,i=Object(L.a)(r);i=i.split("#")[0],n=this.initFetchOptions(i,n);var a=this.initFetchOptions(i,n);return this.pendingFetchPromise(i,a.baseURI,a)}},{key:"pendingFetchPromise",value:function(e,t,n){var r,i=this;return!n.force&&this.fetchQueue[t]?r=this.fetchQueue[t]:(r=Promise.race([this.setRequestTimeout(e,n),this.fetchUri(e,n)]),this.fetchQueue[t]=r,this.cleanupFetchRequest(t,void 0,this.timeout)),r.then((function(t){return e in i.timeouts&&(i.timeouts[e].forEach(clearTimeout),delete i.timeouts[e]),t}))}},{key:"cleanupFetchRequest",value:function(e,t,n){var r=this;void 0!==t&&console.warn("_options is deprecated"),this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((function(){r.isPending(e)||delete r.fetchQueue[e]}),n))}},{key:"initFetchOptions",value:function(e,n){var r=this.store;!n.method||"GET"===n.method.toUpperCase()||(n.force=!0),n.resource=r.rdfFactory.namedNode(e),n.baseURI=n.baseURI||e,n.original=r.rdfFactory.namedNode(n.baseURI),n.req=r.bnode(),n.headers=n.headers||new R.Headers,n.contentType&&(n.headers["content-type"]=n.contentType),n.force&&(n.cache="no-cache");var i=this.acceptString();n.headers.accept=i;var a=t.offlineOverride(e);n.requestedURI=a,t.setCredentials(a,n);var o=t.proxyIfNecessary(a);return a!==o&&(n.proxyUsed=!0),n.actualProxyURI=o,n}},{key:"fetchUri",value:function(e,n){var r=this;if(!e)return Promise.reject(new Error("Cannot fetch an empty uri"));if(t.unsupportedProtocol(e))return this.failFetch(n,"fetcher: Unsupported protocol","unsupported_protocol");var i=this.getState(e);if(n.force)delete this.nonexistent[e];else{if("fetched"===i)return Promise.resolve(this.doneFetch(n,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===i&&404===this.requested[e]){var a="Previously failed: "+this.requested[e],o={url:e,status:this.requested[e],statusText:a,responseText:a,headers:new R.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(n,a,this.requested[e],o)}}this.fireCallbacks("request",[e]),this.requested[e]=!0,n.noMeta||this.saveRequestMetadata(e,n);var s=n.actualProxyURI;return this._fetch(s,n).then((function(t){return r.handleResponse(t,e,n)}),(function(t){var i={url:s,status:999,statusText:(t.name||"network failure")+": "+(t.errno||t.code||t.type),responseText:t.message,headers:new R.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return console.log("Fetcher: <"+s+"> Non-HTTP fetch exception: "+t),r.handleError(i,e,n)}))}},{key:"nowOrWhenFetched",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Object(L.a)(e);"function"==typeof t?n=t:void 0===t||(Object(I.e)(t)?r.referringTerm=t:r=t),this.load(i,r).then((function(e){if(n)if(e)if(e.ok)n(!0,"OK",e);else{var t="HTTP error: Status "+e.status+" ("+e.statusText+")";e.responseText&&(t+=" "+e.responseText),console.log(t+" fetching "+i),n(!1,t,e)}else{var r="@@ nowOrWhenFetched: no response object!";console.log(r),n(!1,r)}}),(function(e){var t=e.message||e.statusText;t="Failed to load <"+i+"> "+t,console.log(t),e.response&&e.response.status&&(t+=" status: "+e.response.status),n(!1,t,e.response)}))}},{key:"addStatus",value:function(e,t){var n=new Date;t="["+n.getHours()+":"+n.getMinutes()+":"+n.getSeconds()+"."+n.getMilliseconds()+"] "+t;var r=this.store,i=r.the(e,this.ns.link("status"));Object(I.b)(i)?i.append(r.rdfFactory.literal(t)):w.a.warn("web.js: No list to add to: "+i+","+t)}},{key:"failFetch",value:function(e,t,n,r){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,this.ns.link("error"),this.store.rdfFactory.literal(t));var i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.equals(e.original),this.requested[O.docpart(e.original.value)]=n,this.fireCallbacks("fail",[e.original.value,t]));var a=new Error("Fetcher: "+t);return a.status=n,a.statusText=t,a.response=r,Promise.reject(a)}},{key:"linkData",value:function(e,t,n,r,i){if(n){var a,o=this.store,s=o.rdfFactory.namedNode(O.join(n,e.value));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(s.value===e.value)return;a=this.ns.rdfs("seeAlso")}else a="type"===t?o.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):o.rdfFactory.namedNode(O.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?o.add(s,a,e,r):o.add(e,a,s,r)}}},{key:"parseLinkHeader",value:function(e,t,n){if(e){var r=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(var a=0;a<i.length;a++){var o=i[a].split(">"),s=o[0].substring(1),u=o[1].match(r);if(null==u)return;for(var c=0;c<u.length;c++){var l=u[c].split("=")[1].replace(/["']/g,"");this.linkData(t,l,s,n)}}}}},{key:"doneFetch",value:function(e,t){return this.addStatus(e.req,"Done."),this.requested[e.original.value]="done",this.fireCallbacks("done",[e.original.value]),t.req=e.req,t}},{key:"nowKnownAs",value:function(e,t){this.lookedUp[e.value]?this.lookedUp[t.value]||this.lookUpThing(t,e):this.lookedUp[t.value]&&(this.lookedUp[e.value]||this.lookUpThing(e,t))}},{key:"putBack",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(L.a)(e),i=new _.a(r).doc();return n.contentType=n["content-type"]||n["Content-Type"]||n.contentType||C.r,"application/ld+json"===n.contentType?new Promise((function(r,a){Object(E.a)(i,t.store,i.uri,n.contentType,(function(i,o){i?a(i):(n.data=o,t.webOperation("PUT",e,n).then((function(e){return r(e)})).catch((function(e){return a(e)})))}))})):(n.data=Object(E.a)(i,this.store,i.value,n.contentType),this.webOperation("PUT",r,n))}},{key:"webCopy",value:function(e,t,n){var r=this;return this.webOperation("GET",e).then((function(e){return r.webOperation("PUT",t,{data:e.responseText,contentType:n})}))}},{key:"delete",value:function(e,t){var n=this;return this.webOperation("DELETE",e,t).then((function(t){return n.requested[e]=404,n.nonexistent[e]=!0,n.unload(n.store.rdfFactory.namedNode(e)),t}))}},{key:"createIfNotExists",value:(n=i()(m.a.mark((function e(t){var n,r,i,a,o=arguments;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:C.r,r=o.length>2&&void 0!==o[2]?o[2]:"",i=this,e.prev=3,e.next=6,i.load(t);case 6:a=e.sent,e.next=29;break;case 9:if(e.prev=9,e.t0=e.catch(3),404!==e.t0.response.status){e.next=27;break}return console.log("createIfNotExists: doc does NOT exist, will create... "+t),e.prev=13,e.next=16,i.webOperation("PUT",t.value,{data:r,contentType:n});case 16:a=e.sent,e.next=23;break;case 19:throw e.prev=19,e.t1=e.catch(13),console.log("createIfNotExists doc FAILED: "+t+": "+e.t1),e.t1;case 23:return delete i.requested[t.value],e.abrupt("return",a);case 27:throw console.log("createIfNotExists doc load error NOT 404: "+t+": "+e.t0),e.t0;case 29:return e.abrupt("return",a);case 30:case"end":return e.stop()}}),e,this,[[3,9],[13,19]])}))),function(e){return n.apply(this,arguments)})},{key:"createContainer",value:function(e,t,n){var r={"content-type":C.r,link:this.ns.ldp("BasicContainer")+'; rel="type"'};t&&(r.slug=t);var i={headers:r};return n&&(i.body=n),this.webOperation("POST",e,i)}},{key:"invalidateCache",value:function(e){var t=Object(L.a)(e);this.fetchQueue&&this.fetchQueue[t]&&(console.log("Internal error - fetchQueue exists "+t),"resolved"===this.fetchQueue[t].PromiseStatus?delete this.fetchQueue[t]:(delete this.fetchQueue[t],console.log("*** Fetcher: pending fetchQueue deleted "+t)));if(this.requested[t]&&"done"!==this.requested[t]&&"failed"!==this.requested[t]&&404!==this.requested[t]){var n="Rdflib: fetcher: Destructive operation on <".concat(this.requested[t],"> file being fetched! ")+t;console.error(n)}else delete this.requested[t],delete this.nonexistent[t]}},{key:"webOperation",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object(L.a)(n);r.method=e,r.body=r.data||r.body,r.force=!0;var a=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),t.setCredentials(i,r),new Promise((function(t,n){a._fetch(i,r).then((function(r){if(r.ok)"PUT"!==e&&"PATCH"!==e&&"POST"!==e&&"DELETE"!==e||a.invalidateCache(i),r.text?r.text().then((function(e){r.responseText=e,t(r)})):t(r);else{var o="Web error: "+r.status;r.statusText&&(o+=" ("+r.statusText+")"),o+=" on "+e+" of <"+i+">",r.responseText&&(o+=": "+r.responseText);var s=new Error(o);s.response=r,n(s)}}),(function(t){n(new Error("Fetch error for "+e+" of <"+i+">:"+t))}))}))}},{key:"lookUpThing",value:function(e,t){var n=this,r=this.store.uris(e);return(r=r.map((function(e){return O.docpart(e)}))).forEach((function(e){n.lookedUp[e]=!0})),this.load(r,{referringTerm:t})}},{key:"getHeader",value:function(e,t){for(var n=this.store,r=e.value,i=n.each(void 0,this.ns.link("requestedURI"),n.rdfFactory.literal(r)),a=0;a<i.length;a++){var o=i[a];if(void 0!==o){var s=n.any(o,this.ns.link("response"));if(void 0!==s&&n.anyValue(s,this.ns.http("status"))&&n.anyValue(s,this.ns.http("status")).startsWith("2")){var u=n.each(s,this.ns.httph(t.toLowerCase()));return u.length?u.map((function(e){return e.value})):[]}}}}},{key:"saveRequestMetadata",value:function(e,t){var n=t.req,r=this.store,i=t.referringTerm;this.addStatus(t.req,"Accept: "+t.headers.accept),Object(I.e)(i)&&r.add(r.rdfFactory.namedNode(e),this.ns.link("requestedBy"),i,this.appNode),t.original&&t.original.value!==e&&r.add(n,this.ns.link("orginalURI"),r.rdfFactory.literal(t.original.value),this.appNode);var a=new Date,o="["+a.getHours()+":"+a.getMinutes()+":"+a.getSeconds()+"] ";r.add(n,this.ns.rdfs("label"),r.rdfFactory.literal(o+" Request for "+e),this.appNode),r.add(n,this.ns.link("requestedURI"),r.rdfFactory.literal(e),this.appNode),r.add(n,this.ns.link("status"),r.collection(),this.appNode)}},{key:"saveResponseMetadata",value:function(e,t){var n=this,r=this.store,i=r.bnode();return r.add(t.req,this.ns.link("response"),i,i),r.add(i,this.ns.http("status"),r.rdfFactory.literal(e.status),i),r.add(i,this.ns.http("statusText"),r.rdfFactory.literal(e.statusText),i),e.headers.forEach((function(e,a){r.add(i,n.ns.httph(a),n.store.rdfFactory.literal(e),i),"content-type"===a&&r.add(t.resource,n.ns.rdf("type"),r.rdfFactory.namedNode(S.mediaTypeClass(e).value),i)})),i}},{key:"objectRefresh",value:function(e){var t=this.store.uris(e);if(void 0!==t)for(var n=0;n<t.length;n++)this.refresh(this.store.rdfFactory.namedNode(O.docpart(t[n])))}},{key:"refresh",value:function(e,t){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(e,{force:!0,clearPreviousData:!0},t)}},{key:"refreshIfExpired",value:function(e,t){var n=this.getHeader(e,"Expires");!n||new Date(n[0]).getTime()<=(new Date).getTime()?this.refresh(e,t):t(!0,"Not expired",{})}},{key:"retract",value:function(e){this.store.removeMany(void 0,void 0,void 0,e),e.value&&delete this.requested[O.docpart(e.value)],this.fireCallbacks("retract",arguments)}},{key:"getState",value:function(e){return void 0===this.requested[e]?"unrequested":!0===this.requested[e]?"requested":"done"===this.requested[e]?"fetched":"redirected"===this.requested[e]?this.getState(this.redirectedTo[e]):"failed"}},{key:"isPending",value:function(e){return!0===this.requested[e]}},{key:"unload",value:function(e){this.store.removeDocument(e),delete this.requested[e.value]}},{key:"addHandler",value:function(e){this.handlers.push(e),e.register(this)}},{key:"retryNoCredentials",value:function(e,t){console.log("Fetcher: CORS: RETRYING with NO CREDENTIALS for "+t.resource),t.retriedWithNoCredentials=!0,delete this.requested[e],delete this.fetchQueue[e];var n=Object.assign({},t,{credentials:"omit"});return this.addStatus(t.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(e,n)}},{key:"isCrossSite",value:function(e){if("undefined"==typeof document||!document.location)return!1;var t=O.hostpart,n=""+document.location;return(t(n)&&t(e)&&t(n))!==t(e)}},{key:"handleError",value:function(e,n,r){if(this.isCrossSite(n)){if(r.credentials&&"include"===r.credentials&&!r.retriedWithNoCredentials)return this.retryNoCredentials(n,r);var i=t.crossSiteProxy(n);if(i&&!r.proxyUsed)return console.log("web: Direct failed so trying proxy "+i),this.redirectToProxy(i,r)}var a;return e instanceof Error?a="Fetch error: "+e.message:(a=e.statusText,e.responseText&&(a+=" ".concat(e.responseText))),this.failFetch(r,a,e.status||998,e)}},{key:"addType",value:function(e,t,n,r){var i=t;if(r){var a=n.any(i,this.ns.link("requestedURI"));a&&a.value!==r&&n.add(n.rdfFactory.namedNode(r),this.ns.rdf("type"),e,this.appNode)}for(;;){var o=n.any(i,this.ns.link("requestedURI"));if(o&&o.value&&n.add(n.rdfFactory.namedNode(o.value),this.ns.rdf("type"),e,this.appNode),!(i=n.any(void 0,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i)))break;var s=n.any(i,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var u=n.any(s,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!u)break;if("301"!==u&&"302"!==u)break}}},{key:"handleResponse",value:function(e,t,n){var r=this,i=this.store,a=e.headers,o=n.req,s=this.saveResponseMetadata(e,n),u=this.normalizedContentType(n,a)||"",c=a.get("content-location");if(0===e.status)return console.log("Masked error - status 0 for "+t),this.handleError(e,t,n);if(e.status>=400)return 404===e.status&&(this.nonexistent[n.original.value]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then((function(){var t=n.resource+" "+e.statusText;return r.failFetch(n,t,e.status,e)}));var l=null,h=null;if(c&&(h=O.join(c,t))!==t&&(l=h),200===e.status){this.addType(this.ns.link("Document"),o,i,t),l&&this.addType(this.ns.link("Document"),o,i,l),n.clearPreviousData&&i.removeDocument(n.resource);var d=u.includes("image/")||u.includes("application/pdf");u&&d&&(this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,i,t),l&&this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,i,l))}if(c){if(!n.force&&l&&"done"===this.requested[h])return this.doneFetch(n,e);this.requested[h]=!0}this.parseLinkHeader(a.get("link"),n.original,o);var f=this.handlerForContentType(u,e);return f?e.text().then((function(t){return e.responseText=t,f.parse(r,t,n,e)})):(this.addStatus(o,"Fetch over. No data handled."),this.doneFetch(n,e))}},{key:"saveErrorResponse",value:function(e,t){var n=this,r=this.store;return e.text().then((function(e){e.length>10&&r.add(t,n.ns.http("content"),r.rdfFactory.literal(e),t)}))}},{key:"handlerForContentType",value:function(e,t){if(!e)return null;var n=this.handlers.find((function(t){return e.match(t.pattern)}));return n?new n(t):null}},{key:"guessContentType",value:function(e){return F[e.split(".").pop()]}},{key:"normalizedContentType",value:function(e,t){if(e.forceContentType)return e.forceContentType;var n=t.get("content-type");if(!n||n.includes("application/octet-stream")){var r=this.guessContentType(e.resource.value);if(r)return r}var i=O.protocol(e.resource.value);return!n&&["file","chrome"].includes(i)?"text/xml":n}},{key:"redirectToProxy",value:function(e,t){var n=this;this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;var r=this.store,i=t.req;t.noMeta||(r.add(i,this.ns.link("redirectedTo"),r.rdfFactory.namedNode(e),i),this.addStatus(i,"redirected to new request")),this.requested[t.resource.value]="redirected",this.redirectedTo[t.resource.value]=e;var a=Object.assign({},t);return a.baseURI=t.resource.value,this.fetchUri(e,a).then((function(e){return a.noMeta||r.add(i,n.ns.link("redirectedRequest"),a.req,n.appNode),e}))}},{key:"setRequestTimeout",value:function(e,t){var n=this;return new Promise((function(r){n.timeouts[e]=(n.timeouts[e]||[]).concat(setTimeout((function(){!n.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||r(n.failFetch(t,"Request to ".concat(e," timed out"),"timeout"))}),n.timeout))}))}},{key:"addFetchCallback",value:function(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}},{key:"acceptString",value:function(){var e="";for(var t in this.mediatypes)for(var n in""!==e&&(e+=", "),e+=t,this.mediatypes[t])e+=";"+n+"="+this.mediatypes[t][n];return e}}],[{key:"crossSiteProxy",value:function(e){return t.crossSiteProxyTemplate?t.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):void 0}},{key:"offlineOverride",value:function(e){var t,n=e;return"undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.preferences&&t.preferences.get("offlineModeUsingLocalhost")&&"http://"===n.slice(0,7)&&"localhost/"!==n.slice(7,17)&&(n="http://localhost/"+n.slice(7),w.a.warn("Localhost kludge for offline use: actually getting <"+n+">")),n}},{key:"proxyIfNecessary",value:function(e){var n;if("undefined"!=typeof window&&window.panes&&(n=window.panes.UI)&&n.isExtension)return e;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var r=function e(t,n){var r=n[t.shift()];return r?"string"==typeof r?r+t.join("/"):t?e(t,r):null:null}(e.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(r)return r}return t.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===e.slice(0,5)?t.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):e}},{key:"unsupportedProtocol",value:function(e){var t=O.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}},{key:"setCredentials",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===t.credentials&&(void 0!==t.withCredentials?t.credentials=t.withCredentials?"include":"omit":t.credentials="include")}}]),t}();y()(Y,"HANDLERS",void 0),y()(Y,"CONTENT_TYPE_BY_EXT",void 0),y()(Y,"crossSiteProxyTemplate",void 0),Y.HANDLERS=J,Y.CONTENT_TYPE_BY_EXT=F}).call(this,n(44))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(52),i=n(43),a=n(1);function o(e,t,n,o,s,u){n=n||e.value;var c=u||{};o=o||a.r;try{var l=Object(i.a)(t);c.flags&&l.setFlags(c.flags);var h,d=t.statementsMatching(void 0,void 0,void 0,e);switch(l.suggestNamespaces(t.namespaces),l.setBase(n),o){case a.o:return f(null,l.statementsToXML(d));case a.i:case a.j:return f(null,l.statementsToN3(d));case a.r:case a.s:return l.setFlags("si"),f(null,l.statementsToN3(d));case a.m:return l.setFlags("deinprstux"),f(null,l.statementsToNTriples(d));case a.g:l.setFlags("deinprstux"),h=l.statementsToNTriples(d),r.convertToJson(h,s);break;case a.l:case a.k:return l.setFlags("deinprstux q"),f(null,l.statementsToNTriples(d));default:throw new Error("Serialize: Content-type "+o+" not supported for data write.")}}catch(e){if(s)return s(e,void 0);throw e}function f(e,t){return s?void s(e,t):t}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(21);n(55);const{rdf:i,xsd:a}=r.a;let o,s=0;const u={namedNode:function(e){return new l(e)},blankNode:function(e){return new d(e||"n3-"+s++)},variable:function(e){return new f(e)},literal:function(e,t){if("string"==typeof t)return new h(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:"";""===n&&("boolean"==typeof e?n=a.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?a.integer:a.double:(n=a.double,Number.isNaN(e)||(e=e>0?"INF":"-INF"))));return""===n||n===a.string?new h(`"${e}"`):new h(`"${e}"^^${n}`)},defaultGraph:function(){return o},quad:v,triple:v};t.b=u;class c{constructor(e){this.id=e}get value(){return this.id}get hashCode(){return 0}equals(e){return e instanceof c?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}toJSON(){return{termType:this.termType,value:this.value}}}class l extends c{get termType(){return"NamedNode"}}class h extends c{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new l(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,n=t<e.length?e[t]:"";return"^"===n?e.substr(t+2):"@"!==n?a.string:i.langString}equals(e){return e instanceof h?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class d extends c{constructor(e){super("_:"+e)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class f extends c{constructor(e){super("?"+e)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}o=new class extends c{constructor(){return super(""),o||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class p extends c{constructor(e,t,n,r){super(""),this._subject=e,this._predicate=t,this._object=n,this._graph=r||o}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function v(e,t,n,r){return new p(e,t,n,r)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(0),u=n.n(s),c=n(6),l=function(){function e(t){i()(this,e),this.store=t,this.bnodes={},this.why=null,this.reify=!1}return o()(e,[{key:"frameFactory",value:function(t,n,r){return{NODE:1,ARC:2,parent:n,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(e,t){t=c.join(t,this.base),this.node=this.store.sym(t),this.nodeType=e},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var t=this.store.sym(c.join("#"+this.parent.rdfid,this.base));this.store.add(t,this.store.sym(e.ns.RDF+"type"),this.store.sym(e.ns.RDF+"Statement"),this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType===this.NODE&&this.parent.nodeType===this.ARC&&this.parent.parent.nodeType===this.NODE},addNode:function(e){this.addSymbol(this.NODE,e),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(e){null!=e?null!=this.parser.bnodes[e]?this.node=this.parser.bnodes[e]:this.node=this.parser.bnodes[e]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(t){t===e.ns.RDF+"li"&&(t=e.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,t)},addLiteral:function(t){this.parent.datatype&&this.parent.datatype!==e.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()}}}},{key:"getAttributeNodeNS",value:function(e,t,n){var r=null;if(e.getAttributeNodeNS)r=e.getAttributeNodeNS(t,n);else for(var i,a=e.attributes,o=0;o<a.length;++o)if((i=a[o]).namespaceURI===t&&(i.prefix?i.prefix+":"+n:n)===i.nodeName){r=i;break}return r}},{key:"parse",value:function(t,n,r){var i,a=t.childNodes;if(this.cleanParser(),t.nodeType===e.nodeType.DOCUMENT){for(var o=0;o<a.length;o++)if(a[o].nodeType===e.nodeType.ELEMENT){i=a[o];break}}else{if(t.nodeType!==e.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+n+". Halting. ");i=t}this.why=r;var s=this.frameFactory(this);return this.base=n,s.base=n,s.lang=null,this.parseDOM(this.buildFrame(s,i)),!0}},{key:"parseDOM",value:function(t){for(var n,r=function(e){var t="";if(null==e.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+e.localName+" in "+this.base);return e.namespaceURI&&(t+=e.namespaceURI),e.localName?t+=e.localName:e.nodeName&&(e.nodeName.indexOf(":")>=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}.bind(this),i=!0;t.parent;){var a=t.element,o=a.attributes;if(a.nodeType===e.nodeType.TEXT||a.nodeType===e.nodeType.CDATA_SECTION)t.parent.nodeType===t.NODE&&(t.addArc(e.ns.RDF+"value"),t=this.buildFrame(t)),t.addLiteral(a.nodeValue);else if(r(a)!==e.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(a)),this.reify&&(n=this.getAttributeNodeNS(a,e.ns.RDF,"ID"))&&(t.rdfid=n.nodeValue,a.removeAttributeNode(n));var s=this.getAttributeNodeNS(a,e.ns.RDF,"parseType"),u=this.getAttributeNodeNS(a,e.ns.RDF,"datatype");if(u&&(t.datatype=u.nodeValue,a.removeAttributeNode(u)),s){var l=s.nodeValue;"Literal"===l?(t.datatype=e.ns.RDF+"XMLLiteral",(t=this.buildFrame(t)).addLiteral(a.childNodes),i=!1):"Resource"===l?((t=this.buildFrame(t,t.element)).parent.element=null,t.addBNode()):"Collection"===l&&((t=this.buildFrame(t,t.element)).parent.element=null,t.addCollection()),a.removeAttributeNode(s)}if(0!==o.length){var h=this.getAttributeNodeNS(a,e.ns.RDF,"resource"),d=this.getAttributeNodeNS(a,e.ns.RDF,"nodeID");t=this.buildFrame(t),h?(t.addNode(h.nodeValue),a.removeAttributeNode(h)):d?(t.addBNode(d.nodeValue),a.removeAttributeNode(d)):t.addBNode();for(var f=o.length-1;f>=0;f--){var p=this.buildFrame(t);p.addArc(r(o[f])),r(o[f])===e.ns.RDF+"type"?this.buildFrame(p).addNode(o[f].nodeValue):this.buildFrame(p).addLiteral(o[f].nodeValue)}}else 0===a.childNodes.length&&this.buildFrame(t).addLiteral("")}else{var v=this.getAttributeNodeNS(a,e.ns.RDF,"about");if(n=this.getAttributeNodeNS(a,e.ns.RDF,"ID"),v&&n)throw new Error("RDFParser: "+a.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!v&&n)t.addNode("#"+n.nodeValue),a.removeAttributeNode(n);else if(null==v&&null==n){var y=this.getAttributeNodeNS(a,e.ns.RDF,"nodeID");y?(t.addBNode(y.nodeValue),a.removeAttributeNode(y)):t.addBNode()}else t.addNode(v.nodeValue),a.removeAttributeNode(v);var g=this.getAttributeNodeNS(a,e.ns.RDF,"type");e.ns.RDF+"Description"!==r(a)&&(g={nodeValue:r(a)}),null!=g&&(this.store.add(t.node,this.store.sym(e.ns.RDF+"type"),this.store.sym(c.join(g.nodeValue,t.base)),this.why),g.nodeName&&a.removeAttributeNode(g));for(var m=o.length-1;m>=0;m--)this.store.add(t.node,this.store.sym(r(o[m])),this.store.literal(o[m].nodeValue,t.lang),this.why)}for(a=t.element;t.parent;){for(var b=t;null==a;)a=(t=t.parent).element;var w=a.childNodes&&a.childNodes[t.lastChild];if(w&&i){if((w.nodeType===e.nodeType.ELEMENT||w.nodeType===e.nodeType.TEXT||w.nodeType===e.nodeType.CDATA_SECTION)&&(w.nodeType!==e.nodeType.TEXT&&w.nodeType!==e.nodeType.CDATA_SECTION||1===a.childNodes.length)){t.lastChild++,t=this.buildFrame(b,a.childNodes[t.lastChild-1]);break}t.lastChild++}else{if(t.terminateFrame(),!(t=t.parent))break;a=t.element,i=!0}}}}},{key:"cleanParser",value:function(){this.bnodes={},this.why=null}},{key:"buildFrame",value:function(t,n){var r=this.frameFactory(this,t,n);if(t&&(r.base=t.base,r.lang=t.lang),!n||n.nodeType===e.nodeType.TEXT||n.nodeType===e.nodeType.CDATA_SECTION)return r;var i=n.attributes,a=n.getAttributeNode("xml:base");null!=a&&(r.base=a.nodeValue,n.removeAttribute("xml:base"));var o=n.getAttributeNode("xml:lang");null!=o&&(r.lang=o.nodeValue,n.removeAttribute("xml:lang"));for(var s=i.length-1;s>=0;s--)if("xml"===i[s].nodeName.substr(0,3)){if("xmlns:"===i[s].name.slice(0,6)){var u=i[s].nodeValue;this.base&&(u=c.join(u,this.base)),this.store.setPrefixForURI(i[s].name.slice(6),u)}n.removeAttributeNode(i[s])}return r}}]),e}();u()(l,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),u()(l,"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})},function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(0),u=n.n(s),c=n(6),l=n(10),h=n(17);function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.a;return{boolean:e.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:e.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:e.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:e.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:e.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:e.namedNode("http://www.w3.org/2001/XMLSchema#string")}}d(h.a);var f=n(63),p=n.n(f);function v(e){return new y(e)}var y=function(){function e(t){i()(this,e),u()(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),u()(this,"_notNameChars",this._notQNameChars+":"),u()(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),u()(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),u()(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];var n=Object.keys(p()());for(var r in n){var a=p()()[n[r]](""),o=n[r];this.prefixes[a]=o,this.namespaces[o]=a}this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=t,this.rdfFactory=t.rdfFactory||h.a,this.xsd=d(this.rdfFactory)}return o()(e,[{key:"setBase",value:function(e){return this.base=e,this}},{key:"setFlags",value:function(e){return this.flags=e||"",this}},{key:"toStr",value:function(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t}},{key:"fromStr",value:function(e){if("{"===e[0]){var t=this.formulas[e];return t||console.log("No formula object for "+e),t}return this.store.fromNT(e)}},{key:"suggestPrefix",value:function(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))}},{key:"suggestNamespaces",value:function(e){for(var t in e)this.suggestPrefix(t,e[t]);return this}},{key:"checkIntegrity",value:function(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")}},{key:"makeUpPrefix",value:function(e){var t=e;var n=function(t){return!!this.validPrefix.test(t)&&("ns"!==t&&(!(t in this.namespaces)&&(this.prefixes[e]=t,this.namespaces[t]=e,t)))}.bind(this);"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var r=t.lastIndexOf("/");r>=0&&(t=t.slice(r+1));for(var i=0;i<t.length&&this.prefixchars.indexOf(t[i]);)i++;if((t=t.slice(0,i)).length<6&&n(t))return t;if(n(t.slice(0,3)))return t.slice(0,3);if(n(t.slice(0,2)))return t.slice(0,2);if(n(t.slice(0,4)))return t.slice(0,4);if(n(t.slice(0,1)))return t.slice(0,1);if(n(t.slice(0,5)))return t.slice(0,5);this.validPrefix.test(t)||(t="n");for(var a=0;;a++)if(n(t.slice(0,3)+a))return t.slice(0,3)+a}},{key:"rootSubjects",value:function(e){for(var t={},n={},r={},i=0;i<e.length;i++){var a=e[i],o=function(e){t.hasOwnProperty(e)||(t[e]=[]),t[e].push(a.subject)};[a.subject,a.predicate,a.object].map((function(e){"BlankNode"===e.termType?r[e.toNT()]=!0:"Collection"===e.termType&&e.elements.forEach((function(e){o(e)}))})),o(e[i].object);var s=n[this.toStr(a.subject)];s||(s=[]),s.push(a),n[this.toStr(a.subject)]=s}var u=[];for(var c in n)if(n.hasOwnProperty(c)){var l=this.fromStr(c);"BlankNode"===l.termType&&t[l]&&1===t[l].length||u.push(l)}this.incoming=t;for(var h={},d=0;d<u.length;d++)h[u[d].toNT()]=!0;return{roots:u,subjects:n,rootsHash:h,incoming:t}}},{key:"toN3",value:function(e){return this.statementsToN3(e.statements)}},{key:"explicitURI",value:function(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?c.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,n="",r=0;r<e.length;r++)t=e.charCodeAt(r),n+=t>65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[r];return n}(e):encodeURI(e))+">"}},{key:"statementsToNTriples",value:function(e){var t=e.slice();t.sort();for(var n="",r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,a=this.store,o=this.rdfFactory,s=function e(t){if("Collection"!==t.termType)return i.atomicTermToN3(t);for(var s=t.elements,u=a.sym(r+"nill"),c=s.length-1;c>=0;c--){var l=o.blankNode();n+=e(l)+" "+e(a.sym(r+"first"))+" "+e(s[c])+".\n",n+=e(l)+" "+e(a.sym(r+"rest"))+" "+e(u)+".\n",u=l}return i.atomicTermToN3(u)},u=0;u<t.length;u++){var c=t[u],l="";l+=s(c.subject)+" ",l+=s(c.predicate)+" ",l+=s(c.object)+" ",this.flags.indexOf("q")>=0&&(l+=s(c.why)+" "),n+=l+=".\n"}return n}},{key:"statementsToN3",value:function(t){var n=this.store,r={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};t.sort((function(e,t){return l.heavyCompareSPO(e,t,n,r)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var i={};this.flags.indexOf("s")<0&&(i["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(i["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(i["http://www.w3.org/2000/10/swap/log#implies"]="=>");var a=function(e){for(var t="",n=0;n<e;n++)t+=" ";return t},o=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r],a="string"==typeof i?i:e(i);if(0!==r){var o=n.slice(-1)||" ";","===a||";"===a||("."!==a||"0123456789.".includes(o))&&(n+=" ")}n+=a}return n};var s=function(e){for(var t=this.rootSubjects(e),n=t.roots,r=[],i=0;i<n.length;i++){var a=n[i];r.push(u(a,t))}return r}.bind(this);function u(e,t){return"BlankNode"!==e.termType||t.incoming[e]?[d(e,t)].concat([c(e,t)]).concat(["."]):h(e,t,!0).concat(["."])}var c=function(e,t){var n=[],r=null,a=t.subjects[this.toStr(e)]||[];if(void 0===a)throw new Error("Cant find statements for "+e);for(var o=[],s=0;s<a.length;s++){var u=a[s];u.predicate.uri===r?o.push(","):(r&&(n=n.concat([o]).concat([";"]),o=[]),n.push(i[u.predicate.uri]?i[u.predicate.uri]:d(u.predicate,t))),r=u.predicate.uri,o.push(h(u.object,t))}return n=n.concat([o])}.bind(this);var h=function(e,t,n){return"BlankNode"!==e.termType||!n&&void 0!==t.rootsHash[e.toNT()]?d(e,t):t.subjects[this.toStr(e)]?["[",c(e,t),"]"]:"[]"}.bind(this);e.prototype.termToN3=d;var d=function(e,t){var n,r;switch(e.termType){case"Graph":return(r=(r=["{"]).concat(s(e.statements))).concat(["}"]);case"Collection":for(r=["("],n=0;n<e.elements.length;n++)r.push([h(e.elements[n],t)]);return r.push(")"),r;default:return this.atomicTermToN3(e)}}.bind(this);var f=function(){var e="";for(var t in this.defaultNamespace&&(e+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(t)&&this.namespacesUsed[t]&&(e+="@prefix "+this.prefixes[t]+": "+this.explicitURI(t)+".\n");return e+"\n"}.bind(this),p=s(t);return f()+function e(t,n){var r="",i=1e5;void 0===n&&(n=-1);for(var s=0;s<t.length;s++){var u=t[s];if("string"!=typeof u){var c=e(u,n+1);if(c.length<10*(80-4*n)&&c.indexOf('"""')<0){var l=o(u);l.length<80-4*n&&(u=l,c="")}c&&(i=1e4),r+=c}if("string"==typeof u){if(1===u.length&&"\n"===r.slice(-1)&&",.;".indexOf(u)>=0){r=r.slice(0,-1)+u+"\n",i+=1;continue}if(i<4*n+4||i+u.length+1<80&&";.".indexOf(r[r.length-2])<0)r=r.slice(0,-1)+" "+u+"\n",i+=u.length+1;else{var h=a(4*n)+u;r+=h+"\n",i=h.length,n<0&&(r+="\n",i=1e5)}}}return r}(p)}},{key:"atomicTermToN3",value:function(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var n=e.value;if("string"!=typeof n)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return n;case"http://www.w3.org/2001/XMLSchema#decimal":return n.indexOf(".")<0&&(n+=".0"),n;case"http://www.w3.org/2001/XMLSchema#double":var r=n.toLowerCase().indexOf("e")>0;return n.indexOf(".")<0&&!r&&(n+=".0"),r||(n+="e0"),n;case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===e.value?"true":"false"}var i=this.stringToN3(e.value);return e.language?i+="@"+e.language:e.datatype.equals(this.xsd.string)||(i+="^^"+this.atomicTermToN3(e.datatype,t)),i;case"NamedNode":return this.symbolToN3(e);default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}}},{key:"stringToN3",value:function(e,t){t||(t="e");var n,r,i,a,o,s="";for(e.length>20&&'"'!==e.slice(-1)&&t.indexOf("n")<0&&(e.indexOf("\n")>0||e.indexOf('"')>0)?(a='"""',o=this.forbidden3):(a='"',o=this.forbidden1),n=0;n<e.length;){if(o.lastIndex=0,null==o.exec(e.slice(n)))break;r=n+o.lastIndex-1,s+=e.slice(n,r);var u=e[r];'"'===u&&'"""'===a&&'"""'!==e.slice(r,r+3)?s+=u:(i='\b\f\r\t\v\n\\"'.indexOf(u))>=0?s+="\\"+'bfrtvn\\"'[i]:t.indexOf("e")>=0?s+="\\u"+("000"+u.charCodeAt(0).toString(16).toLowerCase()).slice(-4):s+=u,n=r+1}return a+s+e.slice(n)+a}},{key:"symbolToN3",value:function(e){var t=e.uri,n=t.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=t.lastIndexOf("/")),n>=0&&this.flags.indexOf("p")<0&&(0===t.indexOf("http")||0===t.indexOf("ws")||0===t.indexOf("file"))){for(var r=!0,i=n+1;i<t.length;i++)if(this._notNameChars.indexOf(t[i])>=0){r=!1;break}if(r){var a=t.slice(n+1),o=t.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===o&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(a)<0?a:":"+a;var s=this.prefixes[o];if(s||(s=this.makeUpPrefix(o)),s)return this.namespacesUsed[o]=!0,s+":"+a}}return this.explicitURI(t)}},{key:"writeStore",value:function(e){var t=this.store,n=t.fetcher,r=n&&n.appNode,i=this.store.index[3];for(var a in i){var o=t.fromNT(a);r&&o.equals(r)||e("\n"+this.atomicTermToN3(o)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,o))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(n){e("\n<"+n.object.value+"> log:metadata {\n");var r=t.statementsMatching(void 0,void 0,void 0,n.subject);e(this.statementsToN3(this.statementsToN3(r))),e("}.\n")}));var s=[];r&&s.push(r);var u=[];s.map((function(e){u=u.concat(t.statementsMatching(void 0,void 0,void 0,e))})),e(this.statementsToN3(u))}},{key:"statementsToXML",value:function(e){var t=[];t["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var n="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",r=function(e){for(var t="",n=0;n<e;n++)t+=" ";return t},i=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r];n+="string"==typeof i?i:e(i)}return n};var a=function(e){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var t=this.rootSubjects(e),n=t.roots,r=[],i=0;i<n.length;i++){var a=n[i];r.push(u(a,t))}return r}.bind(this);function o(e){return void 0===e?"@@@undefined@@@@":e.replace(/[&<"]/g,(function(e){switch(e[0]){case"&":return"&amp;";case"<":return"&lt;";case'"':return"&quot;"}}))}var s=function(e){return o(this.base?l.uri.refTo(this.base,e.uri):e.uri)}.bind(this);var u=function(e,t){var r,i,a,l,f=[],p=t.subjects[this.toStr(e)];if(void 0===p)return h(e,t);p.sort((function(e,t){var r=e.predicate.uri,i=t.predicate.uri;if(r.substring(0,n.length)===n||i.substring(0,n.length)===n)return r.localeCompare(i);var a=r.substring(n.length),o=i.substring(n.length),s=parseInt(a,10),u=parseInt(o,10);return isNaN(s)||isNaN(u)||s!==a||u!==o?r.localeCompare(i):s-u}));for(var v=0;v<p.length;v++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(a=p[v]).predicate.uri||r||"NamedNode"!==a.object.termType){if((l=a.predicate).uri.substr(0,n.length)===n){var y=l.uri.substr(n.length);y===parseInt(y,10).toString()&&(l=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=d(l),a.object.termType){case"BlankNode":f=1===t.incoming[a.object].length?f.concat(["<"+i+' rdf:parseType="Resource">',u(a.object,t),"</"+i+">"]):f.concat(["<"+i+' rdf:nodeID="'+a.object.toNT().slice(2)+'"/>']);break;case"NamedNode":f=f.concat(["<"+i+' rdf:resource="'+s(a.object)+'"/>']);break;case"Literal":f=f.concat(["<"+i+(a.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+o(a.object.datatype.uri)+'"')+(a.object.language?' xml:lang="'+a.object.language+'"':"")+">"+o(a.object.value)+"</"+i+">"]);break;case"Collection":f=f.concat(["<"+i+' rdf:parseType="Collection">',c(a.object,t),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+a.object.termType+" into XML")}}else r=a.object;var g=r?d(r):"rdf:Description",m="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(m=' rdf:nodeID="'+e.toNT().slice(2)+'"'):m=' rdf:about="'+s(e)+'"',["<"+g+m+">"].concat([f]).concat(["</"+g+">"])}.bind(this);function c(e,t){for(var n=[],r=0;r<e.elements.length;r++)n.push(u(e.elements[r],t));return n}var h=function(e,t){var n=[],r=t.subjects[this.toStr(e)];if(!r)return n;r.sort();for(var i=0;i<r.length;i++){var a=r[i];switch(a.object.termType){case"BlankNode":n=t.rootsHash[a.object.toNT()]?n.concat(["<"+d(a.predicate)+' rdf:nodeID="'+a.object.toNT().slice(2)+'">',"</"+d(a.predicate)+">"]):n.concat(["<"+d(a.predicate)+' rdf:parseType="Resource">',h(a.object,t),"</"+d(a.predicate)+">"]);break;case"NamedNode":n=n.concat(["<"+d(a.predicate)+' rdf:resource="'+s(a.object)+'"/>']);break;case"Literal":n=n.concat(["<"+d(a.predicate)+(a.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+o(a.object.datatype.value)+'"')+(a.object.language?' xml:lang="'+a.object.language+'"':"")+">"+o(a.object.value)+"</"+d(a.predicate)+">"]);break;case"Collection":n=n.concat(["<"+d(a.predicate)+' rdf:parseType="Collection">',c(a.object,t),"</"+d(a.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+a.object.termType+" into XML")}}return n}.bind(this);var d=function(e){var n=e.uri,r=n.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=n.lastIndexOf("/")),r<0)throw new Error("Cannot make qname out of <"+n+">");for(var i=r+1;i<n.length;i++)if(this._notNameChars.indexOf(n[i])>=0)throw new Error('Invalid character "'+n[i]+'" cannot be in XML qname for URI: '+n);var a=n.slice(r+1),o=n.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===o&&this.flags.indexOf("d")<0)return a;var s=this.prefixes[o];return s||(s=this.makeUpPrefix(o)),t[o]=!0,s+":"+a}.bind(this),f=a(e),p="<rdf:RDF";for(var v in this.defaultNamespace&&(p+=' xmlns="'+o(this.defaultNamespace)+'"'),t)if(t.hasOwnProperty(v)){var y=this.base&&this.flags.includes("z")?l.uri.refTo(this.base,v):v;p+="\n xmlns:"+this.prefixes[v]+'="'+o(y)+'"'}return function e(t,n){var a,o="",s=1e5;n||(n=0);for(var u=0;u<t.length;u++){var c=t[u];if("string"!=typeof c){var l=e(c,n+1);l.length<10*(80-4*n)&&l.indexOf('"""')<0&&(a=i(c)).length<80-4*n&&(c=" "+a,l=""),l&&(s=1e4),o+=l}"string"==typeof c&&(s<4*n+4?(o=o.slice(0,-1)+" "+c+"\n",s+=c.length+1):(o+=(a=r(4*n)+c)+"\n",s=a.length))}return o}([p+=">",f,"</rdf:RDF>"],-1)}}]),e}()},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(0),u=n.n(s),c=n(11),l=n(1),h=n(37),d=new h.a,f=function(){function e(t,n,r,a){i()(this,e),u()(this,"subject",void 0),u()(this,"predicate",void 0),u()(this,"object",void 0),u()(this,"graph",void 0),this.subject=c.a.fromValue(t),this.predicate=c.a.fromValue(n),this.object=c.a.fromValue(r),this.graph=null==a?d:c.a.fromValue(a)}return o()(e,[{key:"why",get:function(){return this.graph},set:function(e){this.graph=e}},{key:"equals",value:function(e){return e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}},{key:"substitute",value:function(t){var n=new e(this.subject.substitute(t),this.predicate.substitute(t),this.object.substitute(t),Object(h.b)(this.graph)?this.graph:this.graph.substitute(t));return console.log("@@@ statement substitute:"+n),n}},{key:"toCanonical",value:function(){var e=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==l.c&&e.push(this.graph.toCanonical()),e.join(" ")+" ."}},{key:"toNT",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}},{key:"toNQ",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),Object(h.b)(this.graph)?"":this.graph.toNT()].join(" ")+" ."}},{key:"toString",value:function(){return this.toNT()}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(48),i=n(53),a=n(104),o=n(34),s=n(35),u=n(42),c=n(51),l=n(10),h=n(1);function d(e,t,n){var f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",p=arguments.length>4?arguments[4]:void 0;f=(f=f||h.r).split(";")[0];try{if(f===h.i||f===h.r){var v=Object(o.a)(t,t,n,n,null,null,"",null);v.loadBuf(e),m()}else if(f===h.o){var y=new u.a(t);y.parse(l.parseXML(e),n,t.sym(n)),m()}else if(f===h.u)Object(s.b)(l.parseXML(e,{contentType:h.u}),t,n),m();else if(f===h.f)Object(s.b)(l.parseXML(e,{contentType:h.f}),t,n),m();else if(f===h.p||f===h.q)Object(c.a)(e,t,n),m();else if(f===h.g)Object(i.a)(e,t,n,m);else{if(f!==h.l&&f!==h.k)throw void 0===f?new Error("contentType is undefined"):new Error("Don't know how to parse "+f+" yet");var g=new a.a({factory:r.a});w(null,e)}}catch(e){b(e)}function m(){p&&p(null,t)}function b(e){if(f!==h.g||f!==h.l||f!==h.k){if(!p){var r=new Error(e+" while trying to parse <"+n+"> as "+f);throw r.cause=e,r}p(e,t)}}function w(e,n){e&&p(e,t);try{g.parse(n,x)}catch(e){p(e,t)}}function x(e,n){n?t.add(n.subject,n.predicate,n.object,n.graph):p(e,t)}d.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}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return A}));var r=n(4),i=n.n(r),a=n(5),o=n.n(a),s=n(3),u=n.n(s),c=n(12),l=n.n(c),h=n(14),d=n.n(h),f=n(9),p=n.n(f),v=n(0),y=n.n(v),g=n(16),m=n(32),b=n(17),w=n(2),x=n(13),_=n(11),k=n(40),T=n(1),N=n(7),j=n(23),O=n(15),I=n(8);function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var A=function(e){l()(n,e);var t=R(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};i()(this,n),(e=t.call(this,"")).statements=r,e.constraints=a,e.initBindings=o,e.optional=s,y()(u()(e),"termType",T.e),y()(u()(e),"classOrder",g.a.Graph),y()(u()(e),"fetcher",void 0),y()(u()(e),"isVar",0),y()(u()(e),"ns",x.a),y()(u()(e),"rdfFactory",void 0),e.rdfFactory=c&&c.rdfFactory||b.a;var l,h=S(O.b);try{var d=function(){var t=l.value;e[t]=function(){var n;return(n=e.rdfFactory)[t].apply(n,arguments)}};for(h.s();!(l=h.n()).done;)d()}catch(e){h.e(e)}finally{h.f()}return e}return o()(n,[{key:"add",value:function(e,t,n,r){var i=this;return 1===arguments.length&&e.forEach((function(e){return i.add(e.subject,e.predicate,e.object,e.graph)})),this.statements.push(this.rdfFactory.quad(e,t,n,r))}},{key:"addStatement",value:function(e){return this.add(e)}},{key:"bnode",value:function(e){return this.rdfFactory.blankNode(e)}},{key:"addAll",value:function(e){var t=this;e.forEach((function(e){t.add(e.subject,e.predicate,e.object,e.graph)}))}},{key:"any",value:function(e,t,n,r){var i=this.anyStatementMatching(e,t,n,r);return null==i?null:null==e?i.subject:null==t?i.predicate:null==n?i.object:null}},{key:"anyValue",value:function(e,t,n,r){var i=this.any(e,t,n,r);return i?i.value:void 0}},{key:"anyJS",value:function(e,t,n,r){var i=this.any(e,t,n,r);return i?_.a.toJS(i):void 0}},{key:"anyStatementMatching",value:function(e,t,n,r){var i=this.statementsMatching(e,t,n,r,!0);if(i&&0!==i.length)return i[0]}},{key:"id",value:function(e){return this.rdfFactory.id(e)}},{key:"statementsMatching",value:function(e,t,n,r,i){var a=this.statements.filter((function(i){return(!e||e.equals(i.subject))&&(!t||t.equals(i.predicate))&&(!n||n.equals(i.object))&&(!r||r.equals(i.graph))}));return i?0===a.length?[]:[a[0]]:a}},{key:"bottomTypeURIs",value:function(e){var t,n,r,i,a,o;for(var s in t=[],e)if(e.hasOwnProperty(s)){for(o=e[s],n=!0,r=0,i=(a=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(s))).length;r<i;r++)if(a[r].uri in e){n=!1;break}n&&(t[s]=o)}return t}},{key:"collection",value:function(){return new m.a}},{key:"each",value:function(e,t,n,r){var i=[],a=this.statementsMatching(e,t,n,r,!1);if(null==e)for(var o=0,s=a.length;o<s;o++)i.push(a[o].subject);else if(null==t)for(var u=0,c=a.length;u<c;u++)i.push(a[u].predicate);else if(null==n)for(var l=0,h=a.length;l<h;l++)i.push(a[l].object);else if(null==r)for(var d=0,f=a.length;d<f;d++)i.push(new I.a(a[d].graph.value));return i}},{key:"equals",value:function(e){return!!e&&this.hashString()===e.hashString()}},{key:"findMembersNT",value:function(e){var t,n,r,i,a,o,s,u,c,l,h,d,f,p;for(var v in(d={})[e.toNT()]=!0,i={},o=this.transitiveClosure(d,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0))if(o.hasOwnProperty(v)){for(var y=0,g=(s=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(v))).length;y<g;y++)i[(f=s[y]).subject.toNT()]=f;for(var m=0,b=(u=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(v))).length;m<b;m++)for(a=u[m],r=0,t=(c=this.statementsMatching(void 0,a)).length;r<t;r++)i[(f=c[r]).subject.toNT()]=f;for(var w=0,x=(l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(v))).length;w<x;w++)for(a=l[w],p=0,n=(h=this.statementsMatching(void 0,a)).length;p<n;p++)i[(f=h[p]).object.toNT()]=f}return i}},{key:"findMemberURIs",value:function(e){return this.NTtoURI(this.findMembersNT(e))}},{key:"findSubClassesNT",value:function(e){var t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}},{key:"findSuperClassesNT",value:function(e){var t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypesNT",value:function(e){var t,n,r,i,a,o;o=[];for(var s=0,u=(t=this.statementsMatching(e,void 0,void 0)).length;s<u;s++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===(a=t[s]).predicate.uri)o[a.object.toNT()]=a;else for(var c=0,l=(n=this.each(a.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"))).length;c<l;c++)o[n[c].toNT()]=a;for(var h=0,d=(r=this.statementsMatching(void 0,void 0,e)).length;h<d;h++){a=r[h];for(var f=0,p=(i=this.each(a.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"))).length;f<p;f++)o[i[f].toNT()]=a}return this.transitiveClosure(o,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypeURIs",value:function(e){return this.NTtoURI(this.findTypesNT(e))}},{key:"connectedStatements",value:function(e,t,n){n=n||[];for(var r=[e],i={},a={},o=[],s=this,u=function(e){var u=function(e){"BlankNode"!==e.termType||i[e.value]||(i[e.value]=!0,r.push(e))},c=s.statementsMatching(null,null,e,t).concat(s.statementsMatching(e,null,null,t));(c=c.filter((function(e){if(n[e.predicate.value])return!1;var t=e.toNT();return!a[t]&&(a[t]=!0,!0)}))).forEach((function(e){u(e.subject),u(e.object)})),o=o.concat(c)};r.length;)u(r.shift());return o}},{key:"formula",value:function(e){return new n}},{key:"fromNT",value:function(e){var t,n,r;switch(e[0]){case"<":return this.sym(e.slice(1,-1));case'"':if(r=void 0,t=void 0,(n=e.lastIndexOf('"'))<e.length-1)if("@"===e[n+1])r=e.slice(n+2);else{if("^^"!==e.slice(n+1,n+3))throw new Error("Can't convert string from NT: "+e);t=this.fromNT(e.slice(n+3))}return e=(e=(e=(e=e.slice(1,n)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(e,r||t);case"_":return this.rdfFactory.blankNode(e.slice(2));case"?":return new j.a(e.slice(1))}throw new Error("Can't convert from NT: "+e)}},{key:"holds",value:function(e,t,n,r){var i;if(1===arguments.length){if(!e)return!0;if(e instanceof Array){for(i=0;i<e.length;i++)if(!this.holds(e[i]))return!1;return!0}if(Object(N.j)(e))return this.holds(e.subject,e.predicate,e.object,e.graph);if(e.statements)return this.holds(e.statements)}var a=this.anyStatementMatching(e,t,n,r);return null!=a}},{key:"holdsStatement",value:function(e){return this.holds(e.subject,e.predicate,e.object,e.graph)}},{key:"list",value:function(e,t){if(t.rdfFactory.supports.COLLECTIONS){var n=t.rdfFactory.collection();return e.forEach((function(e){n.append(e)})),n}var r=t.rdfFactory.blankNode(),i=Object(O.c)(t.rdfFactory,r,e);return t.addAll(i),r}},{key:"NTtoURI",value:function(e){var t,n,r={};for(t in e)e.hasOwnProperty(t)&&(n=e[t],"<"===t[0]&&(r[t.slice(1,-1)]=n));return r}},{key:"serialize",value:function(e,t,n){var r,i,a;switch((a=Object(k.a)(this)).suggestNamespaces(this.ns),a.setBase(e),i=n?this.statementsMatching(void 0,void 0,void 0,n):this.statements,null!=t?t:"text/n3"){case"application/rdf+xml":r=a.statementsToXML(i);break;case"text/n3":case"text/turtle":r=a.statementsToN3(i);break;default:throw new Error("serialize: Content-type "+t+" not supported.")}return r}},{key:"substitute",value:function(e){var t=this.statements.map((function(t){return t.substitute(e)}));console.log("Formula subs statmnts:"+t);var r=new n;return r.addAll(t),console.log("indexed-form subs formula:"+r),r}},{key:"sym",value:function(e,t){if(t)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(e)}},{key:"the",value:function(e,t,n,r){var i=this.any(e,t,n,r);return null==i&&w.a.error("No value found for the() {"+e+" "+t+" "+n+"}."),i}},{key:"transitiveClosure",value:function(e,t,n){var r,i,a,o,s,u={};Object.assign(u,e);for(var c={};;){if(null==(s=function(){for(var e in u)if(u.hasOwnProperty(e))return e}()))return c;for(r=0,i=(o=n?this.each(void 0,t,this.fromNT(s)):this.each(this.fromNT(s),t)).length;r<i;r++)(a=o[r].toNT())in c||a in u||(u[a]=u[s]);c[s]=u[s],delete u[s]}}},{key:"topTypeURIs",value:function(e){var t,n,r,i,a,o,s;for(n in o=[],e)if(e.hasOwnProperty(n)){for(s=e[n],i=0,t=0,r=(a=this.each(this.rdfFactory.namedNode(n),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"))).length;t<r;t++)if("http://www.w3.org/2000/01/rdf-schema#Resource"!==a[t].uri){i++;break}i||(o[n]=s)}return o["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete o["http://www.w3.org/2000/01/rdf-schema#Resource"],o["http://www.w3.org/2002/07/owl#Thing"]&&delete o["http://www.w3.org/2002/07/owl#Thing"],o}},{key:"toString",value:function(){return"{"+this.statements.join("\n")+"}"}},{key:"variable",value:function(e){return new j.a(e)}},{key:"whether",value:function(e,t,n,r){return this.statementsMatching(e,t,n,r,!1).length}}]),n}(_.a)},function(e,t,n){"use strict";var r,i=n(0),a=n.n(i),o=n(32),s=n(17),u=n(1),c=n(19),l=n(7),h=n(23);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=f(f({},s.a),{},{supports:(r={},a()(r,c.a.collections,!0),a()(r,c.a.defaultGraphType,!1),a()(r,c.a.equalsMethod,!0),a()(r,c.a.identity,!1),a()(r,c.a.id,!0),a()(r,c.a.reversibleId,!1),a()(r,c.a.variableType,!0),r),collection:function(e){return new o.a(e)},id:function(e){var t=this;return Object(l.b)(e)?"( ".concat(e.elements.map((function(e){return t.id(e)})).join(", ")," )"):Object(l.n)(e)?h.a.toString(e):s.a.id(e)},termToNQ:function(e){return e.termType===u.b?o.a.toNT(e):s.a.termToNQ(e)}});t.a=p},function(e,t){var n="undefined"!=typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in e,o="ArrayBuffer"in e;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function v(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e,t,n,r=f(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=p(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=l(t)},d.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),h(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),h(e)},r&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var n,r,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),m.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];x.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function k(e,n){return new Promise((function(r,a){var o=new b(e,n);if(o.signal&&o.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new x(i,n))},s.onerror=function(){a(new TypeError("Network request failed"))},s.ontimeout=function(){a(new TypeError("Network request failed"))},s.onabort=function(){a(new t.DOMException("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),o.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",u)}),s.send(void 0===o._bodyInit?null:o._bodyInit)}))}k.polyfill=!0,e.fetch||(e.fetch=k,e.Headers=d,e.Request=b,e.Response=x),t.Headers=d,t.Request=b,t.Response=x,t.fetch=k,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},function(e,t,n){"use strict";const{isKeyword:r}=n(38),i=n(30),a=n(24),o=n(27),s=n(29),u={};e.exports=u,u.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new o.IdentifierIssuer("_:b"),r={"@default":{}};return u.createNodeMap(e,r,"@default",n),u.mergeNodeMaps(r)},u.createNodeMap=(e,t,n,c,l,h)=>{if(a.isArray(e)){for(const r of e)u.createNodeMap(r,t,n,c,void 0,h);return}if(!a.isObject(e))return void(h&&h.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(h&&h.push(e))}if(h&&i.isList(e)){const r=[];return u.createNodeMap(e["@list"],t,n,c,l,r),void h.push({"@list":r})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}a.isUndefined(l)&&(l=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),h&&h.push({"@id":l});const d=t[n],f=d[l]=d[l]||{};f["@id"]=l;const p=Object.keys(e).sort();for(let a of p){if("@id"===a)continue;if("@reverse"===a){const r={"@id":l},a=e["@reverse"];for(const e in a){const s=a[e];for(const a of s){let s=a["@id"];i.isBlankNode(a)&&(s=c.getId(s)),u.createNodeMap(a,t,n,c,s),o.addValue(d[s],e,r,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===a){l in t||(t[l]={}),u.createNodeMap(e[a],t,l,c);continue}if("@included"===a){u.createNodeMap(e[a],t,n,c);continue}if("@type"!==a&&r(a)){if("@index"===a&&a in f&&(e[a]!==f[a]||e[a]["@id"]!==f[a]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:f});f[a]=e[a];continue}const h=e[a];if(0===a.indexOf("_:")&&(a=c.getId(a)),0!==h.length)for(let e of h)if("@type"===a&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const r=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];o.addValue(f,a,{"@id":r},{propertyIsArray:!0,allowDuplicate:!1}),u.createNodeMap(e,t,n,c,r)}else if(i.isValue(e))o.addValue(f,a,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const r=[];u.createNodeMap(e["@list"],t,n,c,l,r),e={"@list":r},o.addValue(f,a,e,{propertyIsArray:!0,allowDuplicate:!1})}else u.createNodeMap(e,t,n,c,l),o.addValue(f,a,e,{propertyIsArray:!0,allowDuplicate:!1});else o.addValue(f,a,[],{propertyIsArray:!0})}},u.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const i of Object.keys(e[n]).sort()){const a=e[n][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(a).sort())if(r(e)&&"@type"!==e)s[e]=o.clone(a[e]);else for(const t of a[e])o.addValue(s,e,o.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},u.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const r of n){if("@default"===r)continue;const n=e[r];let a=t[r];a?"@graph"in a||(a["@graph"]=[]):t[r]=a={"@id":r,"@graph":[]};const o=a["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];i.isSubjectReference(t)||o.push(t)}}return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(34),i=n(13);function a(e,t,n){var a,o,s,u=["INSERT","DELETE","WHERE"],c=Object(i.a)("http://www.w3.org/ns/pim/patch#"),l=Object(r.a)(t,t,n,n,null,null,"",null),h={},d=function(e,t,n,r,i){return"Line "+(t+1)+" of <"+e+">: Bad syntax:\n "+i+'\n at: "'+n.slice(r,r+30)+'"'};a=0;var f=t.sym(n+"#query");for(h.query=f;;){if((o=l.skipSpace(e,a))<0)return h;if(";"===e[o]){if((a=l.skipSpace(e,o+1))<0)return h;o=a}var p=!1;for(s=0;s<u.length;s++){var v=u[s];if(e.slice(o,o+v.length)===v){if((a=l.skipSpace(e,o+v.length))<0)throw d(l._thisDoc,l.lines,e,o+v.length,"found EOF, needed {...} after "+v);if(("INSERT"===v||"DELETE"===v)&&"DATA"===e.slice(a,a+4)){if((o=l.skipSpace(e,a+4))<0)throw d(l._thisDoc,l.lines,e,a+4,"needed {...} after INSERT DATA "+v);a=o}var y=[];if((o=l.node(e,a,y))<0)throw d(l._thisDoc,l.lines,e,a,"bad syntax or EOF in {...} after "+v);h[v.toLowerCase()]=y[0],t.add(f,c(v.toLowerCase()),y[0]),p=!0,a=o}}if(!p&&"@prefix"===e.slice(o,o+7)){if((a=l.directive(e,o))<0)throw d(l._thisDoc,l.lines,e,a,"bad syntax or EOF after @prefix ");a=l.checkDot(e,a),p=!0}if(!p)throw d(l._thisDoc,l.lines,e,o,"Unknown syntax at start of statememt: '"+e.slice(o).slice(0,20)+"'")}}},function(e,t,n){"use strict";function r(e){return function(...t){var n=t.pop();return e.call(this,t,n)}}n.r(t),n.d(t,"convertToJson",(function(){return ct})),n.d(t,"convertToNQuads",(function(){return lt}));var i="function"==typeof queueMicrotask&&queueMicrotask,a="function"==typeof setImmediate&&setImmediate,o="object"==typeof process&&"function"==typeof process.nextTick;function s(e){setTimeout(e,0)}function u(e){return(t,...n)=>e(()=>t(...n))}var c=u(i?queueMicrotask:a?setImmediate:o?process.nextTick:s);function l(e){return f(e)?function(...t){const n=t.pop();return h(e.apply(this,t),n)}:r((function(t,n){var r;try{r=e.apply(this,t)}catch(e){return n(e)}if(r&&"function"==typeof r.then)return h(r,n);n(null,r)}))}function h(e,t){return e.then(e=>{d(t,null,e)},e=>{d(t,e&&e.message?e:new Error(e))})}function d(e,t,n){try{e(t,n)}catch(e){c(e=>{throw e},e)}}function f(e){return"AsyncFunction"===e[Symbol.toStringTag]}function p(e){if("function"!=typeof e)throw new Error("expected a function");return f(e)?l(e):e}function v(e,t=e.length){if(!t)throw new Error("arity is undefined");return function(...n){return"function"==typeof n[t-1]?e.apply(this,n):new Promise((r,i)=>{n[t-1]=(e,...t)=>{if(e)return i(e);r(t.length>1?t:t[0])},e.apply(this,n)})}}function y(e){return function(t,...n){return v((function(r){var i=this;return e(t,(e,t)=>{p(e).apply(i,n.concat(t))},r)}))}}function g(e,t,n,r){t=t||[];var i=[],a=0,o=p(n);return e(t,(e,t,n)=>{var r=a++;o(e,(e,t)=>{i[r]=t,n(e)})},e=>{r(e,i)})}function m(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0}const b={};function w(e){function t(...t){if(null!==e){var n=e;e=null,n.apply(this,t)}}return Object.assign(t,e),t}function x(e){if(m(e))return function(e){var t=-1,n=e.length;return function(){return++t<n?{value:e[t],key:t}:null}}(e);var t,n,r,i,a=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}(e);return a?function(e){var t=-1;return function(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}(a):(n=(t=e)?Object.keys(t):[],r=-1,i=n.length,function e(){var a=n[++r];return"__proto__"===a?e():r<i?{value:t[a],key:a}:null})}function _(e){return function(...t){if(null===e)throw new Error("Callback was already called.");var n=e;e=null,n.apply(this,t)}}function k(e,t,n,r){let i=!1,a=!1,o=!1,s=0,u=0;function c(){s>=t||o||i||(o=!0,e.next().then(({value:e,done:t})=>{if(!a&&!i){if(o=!1,t)return i=!0,void(s<=0&&r(null));s++,n(e,u,l),u++,c()}}).catch(h))}function l(e,t){if(s-=1,!a)return e?h(e):!1===e?(i=!0,void(a=!0)):t===b||i&&s<=0?(i=!0,r(null)):void c()}function h(e){a||(o=!1,i=!0,r(e))}c()}var T=e=>(t,n,r)=>{if(r=w(r),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return r(null);if("AsyncGenerator"===t[Symbol.toStringTag])return k(t,e,n,r);if(function(e){return"function"==typeof e[Symbol.asyncIterator]}(t))return k(t[Symbol.asyncIterator](),e,n,r);var i=x(t),a=!1,o=!1,s=0,u=!1;function c(e,t){if(!o)if(s-=1,e)a=!0,r(e);else if(!1===e)a=!0,o=!0;else{if(t===b||a&&s<=0)return a=!0,r(null);u||l()}}function l(){for(u=!0;s<e&&!a;){var t=i();if(null===t)return a=!0,void(s<=0&&r(null));s+=1,n(t.value,t.key,_(c))}u=!1}l()};var N=v((function(e,t,n,r){return T(t)(e,p(n),r)}),4);function j(e,t,n){n=w(n);var r=0,i=0,{length:a}=e,o=!1;function s(e,t){!1===e&&(o=!0),!0!==o&&(e?n(e):++i!==a&&t!==b||n(null))}for(0===a&&n(null);r<a;r++)t(e[r],r,_(s))}function O(e,t,n){return N(e,1/0,t,n)}var I=v((function(e,t,n){return(m(e)?j:O)(e,p(t),n)}),3);var S=v((function(e,t,n){return g(I,e,t,n)}),3),E=y(S);var R=v((function(e,t,n){return N(e,1,t,n)}),3);var A=v((function(e,t,n){return g(R,e,t,n)}),3),C=y(A);const L=Symbol("promiseCallback");function D(){let e,t;function n(n,...r){if(n)return t(n);e(r.length>1?r:r[0])}return n[L]=new Promise((n,r)=>{e=n,t=r}),n}function P(e,t,n){"number"!=typeof t&&(n=t,t=null),n=w(n||D());var r=Object.keys(e).length;if(!r)return n(null);t||(t=r);var i={},a=0,o=!1,s=!1,u=Object.create(null),c=[],l=[],h={};function d(e,t){c.push(()=>function(e,t){if(s)return;var r=_((t,...r)=>{if(a--,!1!==t)if(r.length<2&&([r]=r),t){var c={};if(Object.keys(i).forEach(e=>{c[e]=i[e]}),c[e]=r,s=!0,u=Object.create(null),o)return;n(t,c)}else i[e]=r,(u[e]||[]).forEach(e=>e()),f();else o=!0});a++;var c=p(t[t.length-1]);t.length>1?c(i,r):c(r)}(e,t))}function f(){if(!o){if(0===c.length&&0===a)return n(null,i);for(;c.length&&a<t;){c.shift()()}}}function v(t){var n=[];return Object.keys(e).forEach(r=>{const i=e[r];Array.isArray(i)&&i.indexOf(t)>=0&&n.push(r)}),n}return Object.keys(e).forEach(t=>{var n=e[t];if(!Array.isArray(n))return d(t,[n]),void l.push(t);var r=n.slice(0,n.length-1),i=r.length;if(0===i)return d(t,n),void l.push(t);h[t]=i,r.forEach(a=>{if(!e[a])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+a+"` in "+r.join(", "));!function(e,t){var n=u[e];n||(n=u[e]=[]);n.push(t)}(a,()=>{0===--i&&d(t,n)})})}),function(){var e,t=0;for(;l.length;)e=l.pop(),t++,v(e).forEach(e=>{0==--h[e]&&l.push(e)});if(t!==r)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),f(),n[L]}var M=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,F=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,U=/,/,q=/(=.+)?(\s*)$/,B=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;class H{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):V(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):V(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:n}=t;e(t)&&this.removeLink(t),t=n}return this}}function V(e,t){e.length=1,e.head=e.tail=t}function z(e,t,n){if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var r=p(e),i=0,a=[];const o={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function s(e,t){return e?t?void(o[e]=o[e].filter(e=>e!==t)):o[e]=[]:Object.keys(o).forEach(e=>o[e]=[])}function u(e,...t){o[e].forEach(e=>e(...t))}var l=!1;function h(e,t,n,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");var i,a;function o(e,...t){return e?n?a(e):i():t.length<=1?i(t[0]):void i(t)}g.started=!0;var s={data:e,callback:n?o:r||o};if(t?g._tasks.unshift(s):g._tasks.push(s),l||(l=!0,c(()=>{l=!1,g.process()})),n||!r)return new Promise((e,t)=>{i=e,a=t})}function d(e){return function(t,...n){i-=1;for(var r=0,o=e.length;r<o;r++){var s=e[r],c=a.indexOf(s);0===c?a.shift():c>0&&a.splice(c,1),s.callback(t,...n),null!=t&&u("error",t,s.data)}i<=g.concurrency-g.buffer&&u("unsaturated"),g.idle()&&u("drain"),g.process()}}function f(e){return!(0!==e.length||!g.idle())&&(c(()=>u("drain")),!0)}const v=e=>t=>{if(!t)return new Promise((t,n)=>{!function(e,t){const n=(...r)=>{s(e,n),t(...r)};o[e].push(n)}(e,(e,r)=>{if(e)return n(e);t(r)})});s(e),function(e,t){o[e].push(t)}(e,t)};var y=!1,g={_tasks:new H,*[Symbol.iterator](){yield*g._tasks[Symbol.iterator]()},concurrency:t,payload:n,buffer:t/4,started:!1,paused:!1,push(e,t){if(Array.isArray(e)){if(f(e))return;return e.map(e=>h(e,!1,!1,t))}return h(e,!1,!1,t)},pushAsync(e,t){if(Array.isArray(e)){if(f(e))return;return e.map(e=>h(e,!1,!0,t))}return h(e,!1,!0,t)},kill(){s(),g._tasks.empty()},unshift(e,t){if(Array.isArray(e)){if(f(e))return;return e.map(e=>h(e,!0,!1,t))}return h(e,!0,!1,t)},unshiftAsync(e,t){if(Array.isArray(e)){if(f(e))return;return e.map(e=>h(e,!0,!0,t))}return h(e,!0,!0,t)},remove(e){g._tasks.remove(e)},process(){if(!y){for(y=!0;!g.paused&&i<g.concurrency&&g._tasks.length;){var e=[],t=[],n=g._tasks.length;g.payload&&(n=Math.min(n,g.payload));for(var o=0;o<n;o++){var s=g._tasks.shift();e.push(s),a.push(s),t.push(s.data)}i+=1,0===g._tasks.length&&u("empty"),i===g.concurrency&&u("saturated");var c=_(d(e));r(t,c)}y=!1}},length:()=>g._tasks.length,running:()=>i,workersList:()=>a,idle:()=>g._tasks.length+i===0,pause(){g.paused=!0},resume(){!1!==g.paused&&(g.paused=!1,c(g.process))}};return Object.defineProperties(g,{saturated:{writable:!1,value:v("saturated")},unsaturated:{writable:!1,value:v("unsaturated")},empty:{writable:!1,value:v("empty")},drain:{writable:!1,value:v("drain")},error:{writable:!1,value:v("error")}}),g}var X=v((function(e,t,n,r){r=w(r);var i=p(n);return R(e,(e,n,r)=>{i(t,e,(e,n)=>{t=n,r(e)})},e=>r(e,t))}),4);function Q(...e){var t=e.map(p);return function(...e){var n=this,r=e[e.length-1];return"function"==typeof r?e.pop():r=D(),X(t,e,(e,t,r)=>{t.apply(n,e.concat((e,...t)=>{r(e,t)}))},(e,t)=>r(e,...t)),r[L]}}var $=v((function(e,t,n,r){return g(T(t),e,n,r)}),4);var G=v((function(e,t,n,r){var i=p(n);return $(e,t,(e,t)=>{i(e,(e,...n)=>e?t(e):t(e,n))},(e,t)=>{for(var n=[],i=0;i<t.length;i++)t[i]&&(n=n.concat(...t[i]));return r(e,n)})}),4);var J=v((function(e,t,n){return G(e,1/0,t,n)}),3);var W=v((function(e,t,n){return G(e,1,t,n)}),3);function Y(e,t){return(n,r,i,a)=>{var o,s=!1;const u=p(i);n(r,(n,r,i)=>{u(n,(r,a)=>r||!1===r?i(r):e(a)&&!o?(s=!0,o=t(!0,n),i(null,b)):void i())},e=>{if(e)return a(e);a(null,s?o:t(!1))})}}var Z=v((function(e,t,n){return Y(e=>e,(e,t)=>t)(I,e,t,n)}),3);var K=v((function(e,t,n,r){return Y(e=>e,(e,t)=>t)(T(t),e,n,r)}),4);var ee=v((function(e,t,n){return Y(e=>e,(e,t)=>t)(T(1),e,t,n)}),3);function te(e){return(t,...n)=>p(t)(...n,(t,...n)=>{"object"==typeof console&&(t?console.error&&console.error(t):console[e]&&n.forEach(t=>console[e](t)))})}var ne=te("dir");var re=v((function(e,t,n){n=_(n);var r,i=p(e),a=p(t);function o(e,...t){if(e)return n(e);!1!==e&&(r=t,a(...t,s))}function s(e,t){return e?n(e):!1!==e?t?void i(o):n(null,...r):void 0}return s(null,!0)}),3);function ie(e){return(t,n,r)=>e(t,r)}var ae=v((function(e,t,n){return I(e,ie(p(t)),n)}),3);var oe=v((function(e,t,n,r){return T(t)(e,ie(p(n)),r)}),4);var se=v((function(e,t,n){return oe(e,1,t,n)}),3);function ue(e){return f(e)?e:function(...t){var n=t.pop(),r=!0;t.push((...e)=>{r?c(()=>n(...e)):n(...e)}),e.apply(this,t),r=!1}}var ce=v((function(e,t,n){return Y(e=>!e,e=>!e)(I,e,t,n)}),3);var le=v((function(e,t,n,r){return Y(e=>!e,e=>!e)(T(t),e,n,r)}),4);var he=v((function(e,t,n){return Y(e=>!e,e=>!e)(R,e,t,n)}),3);function de(e,t,n,r){var i=new Array(t.length);e(t,(e,t,r)=>{n(e,(e,n)=>{i[t]=!!n,r(e)})},e=>{if(e)return r(e);for(var n=[],a=0;a<t.length;a++)i[a]&&n.push(t[a]);r(null,n)})}function fe(e,t,n,r){var i=[];e(t,(e,t,r)=>{n(e,(n,a)=>{if(n)return r(n);a&&i.push({index:t,value:e}),r(n)})},e=>{if(e)return r(e);r(null,i.sort((e,t)=>e.index-t.index).map(e=>e.value))})}function pe(e,t,n,r){return(m(t)?de:fe)(e,t,p(n),r)}var ve=v((function(e,t,n){return pe(I,e,t,n)}),3);var ye=v((function(e,t,n,r){return pe(T(t),e,n,r)}),4);var ge=v((function(e,t,n){return pe(R,e,t,n)}),3);var me=v((function(e,t){var n=_(t),r=p(ue(e));return function e(t){if(t)return n(t);!1!==t&&r(e)}()}),2);var be=v((function(e,t,n,r){var i=p(n);return $(e,t,(e,t)=>{i(e,(n,r)=>n?t(n):t(n,{key:r,val:e}))},(e,t)=>{for(var n={},{hasOwnProperty:i}=Object.prototype,a=0;a<t.length;a++)if(t[a]){var{key:o}=t[a],{val:s}=t[a];i.call(n,o)?n[o].push(s):n[o]=[s]}return r(e,n)})}),4);var we=te("log");var xe=v((function(e,t,n,r){r=w(r);var i={},a=p(n);return T(t)(e,(e,t,n)=>{a(e,t,(e,r)=>{if(e)return n(e);i[t]=r,n(e)})},e=>r(e,i))}),4);var _e=u(o?process.nextTick:a?setImmediate:s),ke=v((e,t,n)=>{var r=m(t)?[]:{};e(t,(e,t,n)=>{p(e)((e,...i)=>{i.length<2&&([i]=i),r[t]=i,n(e)})},e=>n(e,r))},3);function Te(e,t){var n=p(e);return z((e,t)=>{n(e[0],t)},t,1)}class Ne{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){let t;for(;e>0&&Oe(this.heap[e],this.heap[t=je(e)]);){let n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n,e=t}}percDown(e){let t;for(;(t=1+(e<<1))<this.heap.length&&(t+1<this.heap.length&&Oe(this.heap[t+1],this.heap[t])&&(t+=1),!Oe(this.heap[e],this.heap[t]));){let n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n,e=t}}push(e){e.pushCount=++this.pushCount,this.heap.push(e),this.percUp(this.heap.length-1)}unshift(e){return this.heap.push(e)}shift(){let[e]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),e}toArray(){return[...this]}*[Symbol.iterator](){for(let e=0;e<this.heap.length;e++)yield this.heap[e].data}remove(e){let t=0;for(let n=0;n<this.heap.length;n++)e(this.heap[n])||(this.heap[t]=this.heap[n],t++);this.heap.splice(t);for(let e=je(this.heap.length-1);e>=0;e--)this.percDown(e);return this}}function je(e){return(e+1>>1)-1}function Oe(e,t){return e.priority!==t.priority?e.priority<t.priority:e.pushCount<t.pushCount}var Ie=v((function(e,t){if(t=w(t),!Array.isArray(e))return t(new TypeError("First argument to race must be an array of functions"));if(!e.length)return t();for(var n=0,r=e.length;n<r;n++)p(e[n])(t)}),2);function Se(e,t,n,r){var i=[...e].reverse();return X(i,t,n,r)}function Ee(e){var t=p(e);return r((function(e,n){return e.push((e,...t)=>{let r={};if(e&&(r.error=e),t.length>0){var i=t;t.length<=1&&([i]=t),r.value=i}n(null,r)}),t.apply(this,e)}))}function Re(e,t,n,r){const i=p(n);return pe(e,t,(e,t)=>{i(e,(e,n)=>{t(e,!n)})},r)}var Ae=v((function(e,t,n){return Re(I,e,t,n)}),3);var Ce=v((function(e,t,n,r){return Re(T(t),e,n,r)}),4);var Le=v((function(e,t,n){return Re(R,e,t,n)}),3);function De(e){return function(){return e}}function Pe(e,t,n){var r={times:5,intervalFunc:De(0)};if(arguments.length<3&&"function"==typeof e?(n=t||D(),t=e):(Me(r,e),n=n||D()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var i=p(t),a=1;function o(){i((e,...t)=>{!1!==e&&(e&&a++<r.times&&("function"!=typeof r.errorFilter||r.errorFilter(e))?setTimeout(o,r.intervalFunc(a-1)):n(e,...t))})}return o(),n[L]}function Me(e,t){if("object"==typeof t)e.times=+t.times||5,e.intervalFunc="function"==typeof t.interval?t.interval:De(+t.interval||0),e.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");e.times=+t||5}}var Fe=v((function(e,t,n){return Y(Boolean,e=>e)(I,e,t,n)}),3);var Ue=v((function(e,t,n,r){return Y(Boolean,e=>e)(T(t),e,n,r)}),4);var qe=v((function(e,t,n){return Y(Boolean,e=>e)(R,e,t,n)}),3);var Be=v((function(e,t,n){var r=p(t);return S(e,(e,t)=>{r(e,(n,r)=>{if(n)return t(n);t(n,{value:e,criteria:r})})},(e,t)=>{if(e)return n(e);n(null,t.sort(i).map(e=>e.value))});function i(e,t){var n=e.criteria,r=t.criteria;return n<r?-1:n>r?1:0}}),3);function He(e,t,n,r){var i=p(n);return $(function(e){for(var t=Array(e);e--;)t[e]=e;return t}(e),t,i,r)}var Ve=v((function(e,t){var n,r=null;return se(e,(e,t)=>{p(e)((e,...i)=>{if(!1===e)return t(e);i.length<2?[n]=i:n=i,r=e,t(e?null:{})})},()=>t(r,n))}));var ze=v((function(e,t,n){n=_(n);var r=p(t),i=p(e),a=[];function o(e,...t){if(e)return n(e);a=t,!1!==e&&i(s)}function s(e,t){return e?n(e):!1!==e?t?void r(o):n(null,...a):void 0}return i(s)}),3);var Xe=v((function(e,t){if(t=w(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var n=0;function r(t){p(e[n++])(...t,_(i))}function i(i,...a){if(!1!==i)return i||n===e.length?t(i,...a):void r(a)}r([])})),Qe={apply:function(e,...t){return(...n)=>e(...t,...n)},applyEach:E,applyEachSeries:C,asyncify:l,auto:P,autoInject:function(e,t){var n={};return Object.keys(e).forEach(t=>{var r,i=e[t],a=f(i),o=!a&&1===i.length||a&&0===i.length;if(Array.isArray(i))r=[...i],i=r.pop(),n[t]=r.concat(r.length>0?s:i);else if(o)n[t]=i;else{if(r=function(e){const t=e.toString().replace(B,"");let n=t.match(M);if(n||(n=t.match(F)),!n)throw new Error("could not parse args in autoInject\nSource:\n"+t);let[,r]=n;return r.replace(/\s/g,"").split(U).map(e=>e.replace(q,"").trim())}(i),0===i.length&&!a&&0===r.length)throw new Error("autoInject task functions require explicit parameters.");a||r.pop(),n[t]=r.concat(s)}function s(e,t){var n=r.map(t=>e[t]);n.push(t),p(i)(...n)}}),P(n,t)},cargo:function(e,t){return z(e,1,t)},cargoQueue:function(e,t,n){return z(e,t,n)},compose:function(...e){return Q(...e.reverse())},concat:J,concatLimit:G,concatSeries:W,constant:function(...e){return function(...t){return t.pop()(null,...e)}},detect:Z,detectLimit:K,detectSeries:ee,dir:ne,doUntil:function(e,t,n){const r=p(t);return re(e,(...e)=>{const t=e.pop();r(...e,(e,n)=>t(e,!n))},n)},doWhilst:re,each:ae,eachLimit:oe,eachOf:I,eachOfLimit:N,eachOfSeries:R,eachSeries:se,ensureAsync:ue,every:ce,everyLimit:le,everySeries:he,filter:ve,filterLimit:ye,filterSeries:ge,forever:me,groupBy:function(e,t,n){return be(e,1/0,t,n)},groupByLimit:be,groupBySeries:function(e,t,n){return be(e,1,t,n)},log:we,map:S,mapLimit:$,mapSeries:A,mapValues:function(e,t,n){return xe(e,1/0,t,n)},mapValuesLimit:xe,mapValuesSeries:function(e,t,n){return xe(e,1,t,n)},memoize:function(e,t=(e=>e)){var n=Object.create(null),i=Object.create(null),a=p(e),o=r((e,r)=>{var o=t(...e);o in n?c(()=>r(null,...n[o])):o in i?i[o].push(r):(i[o]=[r],a(...e,(e,...t)=>{e||(n[o]=t);var r=i[o];delete i[o];for(var a=0,s=r.length;a<s;a++)r[a](e,...t)}))});return o.memo=n,o.unmemoized=e,o},nextTick:_e,parallel:function(e,t){return ke(I,e,t)},parallelLimit:function(e,t,n){return ke(T(t),e,n)},priorityQueue:function(e,t){var n=Te(e,t),r=!1;return n._tasks=new Ne,n.push=function(e,t=0,i=(()=>{})){if("function"!=typeof i)throw new Error("task callback must be a function");if(n.started=!0,Array.isArray(e)||(e=[e]),0===e.length&&n.idle())return c(()=>n.drain());for(var a=0,o=e.length;a<o;a++){var s={data:e[a],priority:t,callback:i};n._tasks.push(s)}r||(r=!0,c(()=>{r=!1,n.process()}))},delete n.unshift,n},queue:Te,race:Ie,reduce:X,reduceRight:Se,reflect:Ee,reflectAll:function(e){var t;return Array.isArray(e)?t=e.map(Ee):(t={},Object.keys(e).forEach(n=>{t[n]=Ee.call(this,e[n])})),t},reject:Ae,rejectLimit:Ce,rejectSeries:Le,retry:Pe,retryable:function(e,t){t||(t=e,e=null);let n=e&&e.arity||t.length;f(t)&&(n+=1);var i=p(t);return r((t,r)=>{function a(e){i(...t,e)}return(t.length<n-1||null==r)&&(t.push(r),r=D()),e?Pe(e,a,r):Pe(a,r),r[L]})},seq:Q,series:function(e,t){return ke(R,e,t)},setImmediate:c,some:Fe,someLimit:Ue,someSeries:qe,sortBy:Be,timeout:function(e,t,n){var i=p(e);return r((r,a)=>{var o,s=!1;r.push((...e)=>{s||(a(...e),clearTimeout(o))}),o=setTimeout((function(){var t=e.name||"anonymous",r=new Error('Callback function "'+t+'" timed out.');r.code="ETIMEDOUT",n&&(r.info=n),s=!0,a(r)}),t),i(...r)})},times:function(e,t,n){return He(e,1/0,t,n)},timesLimit:He,timesSeries:function(e,t,n){return He(e,1,t,n)},transform:function(e,t,n,r){arguments.length<=3&&"function"==typeof t&&(r=n,n=t,t=Array.isArray(e)?[]:{}),r=w(r||D());var i=p(n);return I(e,(e,n,r)=>{i(t,e,n,r)},e=>r(e,t)),r[L]},tryEach:Ve,unmemoize:function(e){return(...t)=>(e.unmemoized||e)(...t)},until:function(e,t,n){const r=p(e);return ze(e=>r((t,n)=>e(t,!n)),t,n)},waterfall:Xe,whilst:ze,all:ce,allLimit:le,allSeries:he,any:Fe,anyLimit:Ue,anySeries:qe,find:Z,findLimit:K,findSeries:ee,flatMap:J,flatMapLimit:G,flatMapSeries:W,forEach:ae,forEachSeries:se,forEachLimit:oe,forEachOf:I,forEachOfSeries:R,forEachOfLimit:N,inject:X,foldl:X,foldr:Se,select:ve,selectLimit:ye,selectSeries:ge,wrapSync:l,during:ze,doDuring:re},$e=n(54),Ge=n.n($e),Je=n(104),We=n(21),Ye=n(41),Ze=n(55);const Ke=Ye.b.defaultGraph(),{rdf:et,xsd:tt}=We.a,nt=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,rt=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,it={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class at extends Ye.a{equals(){return!1}}class ot{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,n,r){e+=t,r&&r()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Ke,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${ut(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return Ke.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,n,r,i){try{r.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(Ke.equals(r)?"":this._encodeIriOrBlank(r)+" {\n")),this._graph=r,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(", "+this._encodeObject(n),i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i)}catch(e){i&&i(e)}}_writeQuadLine(e,t,n,r,i){delete this._prefixMatch,this._write(this.quadToString(e,t,n,r),i)}quadToString(e,t,n,r){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(n)}${r&&r.value?` ${this._encodeIriOrBlank(r)} .\n`:" .\n"}`}quadsToString(e){return e.map(e=>this.quadToString(e.subject,e.predicate,e.object,e.graph)).join("")}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:"_:"+e.value;let t=e.value;this._baseMatcher&&this._baseMatcher.test(t)&&(t=t.substr(this._baseLength)),nt.test(t)&&(t=t.replace(rt,st));const n=this._prefixRegex.exec(t);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(nt.test(t)&&(t=t.replace(rt,st)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===tt.string)return`"${t}"`}else switch(e.datatype.value){case tt.string:return`"${t}"`;case tt.boolean:if("true"===t||"false"===t)return t;break;case tt.integer:if(/^[+-]?\d+$/.test(t))return t;break;case tt.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case tt.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===et.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:n,graph:r}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(n)}${Object(Ze.a)(r)?"":" "+this._encodeIriOrBlank(r)}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,n,r,i){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof r?this._writeQuad(e,t,n,Ke,r):this._writeQuad(e,t,n,r||Ke,i)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,n){const r={};r[e]=t,this.addPrefixes(r,n)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let n=!1;for(let t in e){let r=e[t];"string"!=typeof r&&(r=r.value),n=!0,null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null,this._graph=""),this._prefixIRIs[r]=t+=":",this._write(`@prefix ${t} <${r}>.\n`)}if(n){let e="",t="";for(const n in this._prefixIRIs)e+=e?"|"+n:n,t+=(t?"|":"")+this._prefixIRIs[n];e=ut(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",t)}blank(e,t){let n,r,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return new at("[]");case 1:if(n=i[0],!(n.object instanceof at))return new at(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let t="[";for(let a=0;a<r;a++)n=i[a],n.predicate.equals(e)?t+=", "+this._encodeObject(n.object):(t+=`${(a?";\n ":"\n ")+this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)}`,e=n.predicate);return new at(t+"\n]")}}list(e){const t=e&&e.length||0,n=new Array(t);for(let r=0;r<t;r++)n[r]=this._encodeObject(e[r]);return new at(`(${n.join(" ")})`)}end(e){null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null),this._write=this._blockedWrite;let t=e&&((n,r)=>{t=null,e(n,r)});if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}}function st(e){let t=it[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function ut(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}function ct(e,t){var n,r=new Je.a,i=new ot({format:"N-Quads"});Qe.waterfall([function(t){r.parse(e,(function(e,n,r){e?t(e):null!==n?i.addQuad(n):i.end(t)}))},function(e,t){try{Ge.a.fromRDF(e,{format:"application/nquads"}).then((function(e){t(null,e)}))}catch(e){t(e)}},function(e,r){n=JSON.stringify(e),t(null,n)}],(function(e,r){t(e,n)}))}function lt(e,t){var n,r=new Je.a,i=new ot({format:"N-Quads"});Qe.waterfall([function(t){r.parse(e,(function(e,n,r){e?t(e):null!==quad?i.addQuad(quad):i.end(t)}))},function(e,r){t(null,n=e)}],(function(e,r){t(e,n)}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(54),i=n.n(r),a=n(15);function o(e,t){return"string"==typeof t?e.rdfFactory.literal(t):Object.prototype.hasOwnProperty.call(t,"@list")?!0===e.rdfFactory.supports.COLLECTIONS?function(e,t){if(!Array.isArray(t))throw new TypeError("Object must be an array");return e.rdfFactory.collection(t.map((function(t){return o(e,t)})))}(e,t["@list"]):function(e,t){var n=t["@id"]?e.rdfFactory.namedNode(t["@id"]):e.rdfFactory.blankNode(),r=t["@list"].map((function(t){return o(e,t)})),i=Object(a.c)(e.rdfFactory,n,r);return e.addAll(i),n}(e,t):Object.prototype.hasOwnProperty.call(t,"@id")?e.rdfFactory.namedNode(t["@id"]):Object.prototype.hasOwnProperty.call(t,"@language")?e.rdfFactory.literal(t["@value"],t["@language"]):Object.prototype.hasOwnProperty.call(t,"@type")?e.rdfFactory.literal(t["@value"],e.rdfFactory.namedNode(t["@type"])):Object.prototype.hasOwnProperty.call(t,"@value")?e.rdfFactory.literal(t["@value"]):e.rdfFactory.literal(t)}function s(e,t,n,r){var a=n&&Object.prototype.hasOwnProperty.call(n,"termType")?n.value:n;return i.a.flatten(JSON.parse(e),null,{base:a}).then((function(e){return e.reduce((function(e,r){for(var i=r["@id"]?t.rdfFactory.namedNode(r["@id"]):t.rdfFactory.blankNode(),a=0,o=Object.keys(r);a<o.length;a++){var s=o[a];if("@id"!==s){var c=r[s];if(Array.isArray(c))for(var l=0;l<c.length;l++)t.addStatement(u(t,i,s,c[l],n));else t.addStatement(u(t,i,s,c,n))}}return t}),t)})).then(r).catch(r)}function u(e,t,n,r,i){var a,s;return"@type"===n?(a=e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),s=e.rdfFactory.namedNode(r)):(a=e.rdfFactory.namedNode(n),s=o(e,r)),e.rdfFactory.quad(t,a,s,e.rdfFactory.namedNode(i))}},function(e,t,n){
4
4
  /**
5
5
  * A JavaScript implementation of the JSON-LD API.
6
6
  *