@ulb-darmstadt/shacl-form 1.7.4 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +20 -7
  2. package/dist/config.d.ts +4 -5
  3. package/dist/constants.d.ts +13 -13
  4. package/dist/constraints.d.ts +2 -2
  5. package/dist/exports.d.ts +2 -1
  6. package/dist/form-bootstrap.d.ts +1 -1
  7. package/dist/form-bootstrap.js +361 -2
  8. package/dist/form-default.d.ts +1 -1
  9. package/dist/form-default.js +350 -2
  10. package/dist/form-material.d.ts +1 -1
  11. package/dist/form-material.js +670 -2
  12. package/dist/form.d.ts +3 -2
  13. package/dist/node.d.ts +2 -1
  14. package/dist/plugins/leaflet.d.ts +2 -4
  15. package/dist/plugins/leaflet.js +720 -2
  16. package/dist/plugins/mapbox.d.ts +2 -2
  17. package/dist/plugins/mapbox.js +2764 -2
  18. package/dist/property-template.d.ts +1 -1
  19. package/dist/property.d.ts +6 -2
  20. package/dist/theme.d.ts +3 -3
  21. package/dist/themes/default.d.ts +3 -3
  22. package/dist/themes/material.d.ts +2 -3
  23. package/dist/util.d.ts +2 -2
  24. package/package.json +26 -12
  25. package/src/config.ts +11 -10
  26. package/src/constants.ts +3 -3
  27. package/src/constraints.ts +15 -18
  28. package/src/exports.ts +2 -1
  29. package/src/form.ts +32 -17
  30. package/src/group.ts +1 -1
  31. package/src/loader.ts +12 -13
  32. package/src/node.ts +40 -38
  33. package/src/plugins/leaflet.ts +2 -2
  34. package/src/plugins/mapbox.ts +4 -4
  35. package/src/property-template.ts +4 -5
  36. package/src/property.ts +154 -56
  37. package/src/serialize.ts +14 -1
  38. package/src/styles.css +8 -10
  39. package/src/theme.ts +6 -6
  40. package/src/themes/bootstrap.ts +1 -1
  41. package/src/themes/default.css +2 -2
  42. package/src/themes/default.ts +38 -30
  43. package/src/themes/material.ts +37 -34
  44. package/src/util.ts +26 -20
  45. package/dist/form-bootstrap.js.LICENSE.txt +0 -69
  46. package/dist/form-default.js.LICENSE.txt +0 -69
  47. package/dist/form-material.js.LICENSE.txt +0 -69
  48. package/dist/plugins/file-upload.js +0 -1
  49. package/dist/plugins/fixed-list.js +0 -1
  50. package/dist/plugins/leaflet.js.LICENSE.txt +0 -4
  51. package/dist/plugins/mapbox.js.LICENSE.txt +0 -10
@@ -1,2 +1,350 @@
1
- /*! For license information please see form-default.js.LICENSE.txt */
2
- var e={92:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerBoolean=void 0;const r=n(103);class i{fromRdf(e,t){switch(e.value){case"true":case"1":return!0;case"false":case"0":return!1}return t&&r.Translator.incorrectRdfDataType(e),!1}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e?"true":"false",t||n.namedNode(i.TYPE))}}t.TypeHandlerBoolean=i,i.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},103:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=void 0,t.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(e){throw new Error(`Invalid RDF ${e.datatype.value} value: '${e.value}'`)}registerHandler(e,t,n){for(const n of t)this.supportedRdfDatatypes.push(n),this.fromRdfHandlers[n.value]=e;for(const t of n){let n=this.toRdfHandlers[t];n||(this.toRdfHandlers[t]=n=[]),n.push(e)}}fromRdf(e,t){const n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}toRdf(e,t){const n=this.toRdfHandlers[typeof e];if(n)for(const r of n){const n=r.toRdf(e,t);if(n)return n}throw new Error(`Invalid JavaScript value: '${e}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},251:(e,t)=>{t.read=function(e,t,n,r,i){var s,o,a=8*i-r-1,l=(1<<a)-1,c=l>>1,u=-7,d=n?i-1:0,h=n?-1:1,f=e[t+d];for(d+=h,s=f&(1<<-u)-1,f>>=-u,u+=a;u>0;s=256*s+e[t+d],d+=h,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=r;u>0;o=256*o+e[t+d],d+=h,u-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),s-=c}return(f?-1:1)*o*Math.pow(2,s-r)},t.write=function(e,t,n,r,i,s){var o,a,l,c=8*s-i-1,u=(1<<c)-1,d=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(o++,l/=2),o+d>=u?(a=0,o=u):o+d>=1?(a=(t*l-1)*Math.pow(2,i),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+f]=255&a,f+=p,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[n+f]=255&o,f+=p,o/=256,c-=8);e[n+f-p]|=128*g}},259:e=>{e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},277:(e,t,n)=>{const{ArrayIsArray:r,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:s,ArrayPrototypeMap:o,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:u,NumberParseInt:d,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:f,String:p,StringPrototypeToUpperCase:g,StringPrototypeTrim:y}=n(4134),{hideStackFrames:m,codes:{ERR_SOCKET_BAD_PORT:b,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:x}}=n(6371),{normalizeEncoding:S}=n(7760),{isAsyncFunction:j,isArrayBufferView:I}=n(7760).types,E={},N=/^[0-7]+$/,T=m(((e,t,n=u,r=c)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new _(t,"an integer",e);if(e<n||e>r)throw new _(t,`>= ${n} && <= ${r}`,e)})),R=m(((e,t,n=-2147483648,r=2147483647)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new _(t,"an integer",e);if(e<n||e>r)throw new _(t,`>= ${n} && <= ${r}`,e)})),O=m(((e,t,n=!1)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new _(t,"an integer",e);const r=n?1:0,i=4294967295;if(e<r||e>i)throw new _(t,`>= ${r} && <= ${i}`,e)}));function k(e,t){if("string"!=typeof e)throw new v(t,"string",e)}const L=m(((e,t,n)=>{if(!i(n,e)){const r=s(o(n,(e=>"string"==typeof e?`'${e}'`:p(e))),", ");throw new w(t,e,"must be one of: "+r)}}));function A(e,t){if("boolean"!=typeof e)throw new v(t,"boolean",e)}function C(e,t,n){return null!=e&&h(e,t)?e[t]:n}const D=m(((e,t,n=null)=>{const i=C(n,"allowArray",!1),s=C(n,"allowFunction",!1);if(!C(n,"nullable",!1)&&null===e||!i&&r(e)||"object"!=typeof e&&(!s||"function"!=typeof e))throw new v(t,"Object",e)})),M=m(((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new v(t,"a dictionary",e)})),P=m(((e,t,n=0)=>{if(!r(e))throw new v(t,"Array",e);if(e.length<n)throw new w(t,e,`must be longer than ${n}`)})),$=m(((e,t="buffer")=>{if(!I(e))throw new v(t,["Buffer","TypedArray","DataView"],e)})),B=m(((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new v(t,"AbortSignal",e)})),F=m(((e,t)=>{if("function"!=typeof e)throw new v(t,"Function",e)})),q=m(((e,t)=>{if("function"!=typeof e||j(e))throw new v(t,"Function",e)})),U=m(((e,t)=>{if(void 0!==e)throw new v(t,"undefined",e)})),G=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function H(e,t){if(void 0===e||!f(G,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,n){if(void 0===e&&(e=n),"string"==typeof e){if(null===f(N,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=d(e,8)}return O(e,t),e},validateArray:P,validateStringArray:function(e,t){P(e,t);for(let n=0;n<e.length;n++)k(e[n],`${t}[${n}]`)},validateBooleanArray:function(e,t){P(e,t);for(let n=0;n<e.length;n++)A(e[n],`${t}[${n}]`)},validateAbortSignalArray:function(e,t){P(e,t);for(let n=0;n<e.length;n++){const r=e[n],i=`${t}[${n}]`;if(null==r)throw new v(i,"AbortSignal",r);B(r,i)}},validateBoolean:A,validateBuffer:$,validateDictionary:M,validateEncoding:function(e,t){const n=S(t),r=e.length;if("hex"===n&&r%2!=0)throw new w("encoding",t,`is invalid for data of length ${r}`)},validateFunction:F,validateInt32:R,validateInteger:T,validateNumber:function(e,t,n=void 0,r){if("number"!=typeof e)throw new v(t,"number",e);if(null!=n&&e<n||null!=r&&e>r||(null!=n||null!=r)&&l(e))throw new _(t,`${null!=n?`>= ${n}`:""}${null!=n&&null!=r?" && ":""}${null!=r?`<= ${r}`:""}`,e)},validateObject:D,validateOneOf:L,validatePlainFunction:q,validatePort:function(e,t="Port",n=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===y(e).length||+e!==+e>>>0||e>65535||0===e&&!n)throw new b(t,e,n);return 0|e},validateSignalName:function(e,t="signal"){if(k(e,t),void 0===E[e]){if(void 0!==E[g(e)])throw new x(e+" (signals must use all capital letters)");throw new x(e)}},validateString:k,validateUint32:O,validateUndefined:U,validateUnion:function(e,t,n){if(!i(n,e))throw new v(t,`('${s(n,"|")}')`,e)},validateAbortSignal:B,validateLinkHeaderValue:function(e){if("string"==typeof e)return H(e,"hints"),e;if(r(e)){const t=e.length;let n="";if(0===t)return n;for(let r=0;r<t;r++){const i=e[r];H(i,"hints"),n+=i,r!==t-1&&(n+=", ")}return n}throw new w("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},345:(e,t,n)=>{const{StringPrototypeSlice:r,SymbolIterator:i,TypedArrayPrototypeSet:s,Uint8Array:o}=n(4134),{Buffer:a}=n(8287),{inspect:l}=n(7760);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,n=""+t.data;for(;null!==(t=t.next);)n+=e+t.data;return n}concat(e){if(0===this.length)return a.alloc(0);const t=a.allocUnsafe(e>>>0);let n=this.head,r=0;for(;n;)s(t,n.data,r),r+=n.data.length,n=n.next;return t}consume(e,t){const n=this.head.data;if(e<n.length){const t=n.slice(0,e);return this.head.data=n.slice(e),t}return e===n.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[i](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,i=0;do{const s=n.data;if(!(e>s.length)){e===s.length?(t+=s,++i,n.next?this.head=n.next:this.head=this.tail=null):(t+=r(s,0,e),this.head=n,n.data=r(s,e));break}t+=s,e-=s.length,++i}while(null!==(n=n.next));return this.length-=i,t}_getBuffer(e){const t=a.allocUnsafe(e),n=e;let r=this.head,i=0;do{const a=r.data;if(!(e>a.length)){e===a.length?(s(t,a,n-e),++i,r.next?this.head=r.next:this.head=this.tail=null):(s(t,new o(a.buffer,a.byteOffset,e),n-e),this.head=r,r.data=a.slice(e));break}s(t,a,n-e),e-=a.length,++i}while(null!==(r=r.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},378:(e,t,n)=>{const r=n(3751),i=n(2438);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const i of r){let r,s;if("BlankNode"===i.subject.termType&&i.subject.value!==e)s=i.subject.value,r="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;s=i.object.value,r="r"}const o=this.hashRelatedBlankNode(s,i,t,r),a=n.get(o);a?a.push(s):n.set(o,[s])}return n}}},458:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;const r=n(3476);class i{constructor(e,t){this.termType="Literal",this.value=e,"string"==typeof t?(this.language=t,this.datatype=i.RDF_LANGUAGE_STRING,this.direction=""):t?"termType"in t?(this.language="",this.datatype=t,this.direction=""):(this.language=t.language,this.datatype=t.direction?i.RDF_DIRECTIONAL_LANGUAGE_STRING:i.RDF_LANGUAGE_STRING,this.direction=t.direction||""):(this.language="",this.datatype=i.XSD_STRING,this.direction="")}equals(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&(e.direction===this.direction||!e.direction&&""===this.direction)&&this.datatype.equals(e.datatype)}}t.Literal=i,i.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.RDF_DIRECTIONAL_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),i.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},470:(e,t,n)=>{const r=n(7382),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:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const n={},r=i.parsers[t||"full"],s=r.regex.exec(e);let o=r.keys.length;for(;o--;)n[r.keys[o]]=void 0===s[o]?null:s[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),s={protocol:e.protocol||""};if(null!==n.authority)s.authority=n.authority,s.path=n.path,s.query=n.query;else if(s.authority=e.authority,""===n.path)s.path=e.path,null!==n.query?s.query=n.query:s.query=e.query;else{if(0===n.path.indexOf("/"))s.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,s.path=t}s.query=n.query}""!==n.path&&(s.path=i.removeDotSegments(s.path));let o=s.protocol;return null!==s.authority&&(o+="//"+s.authority),o+=s.path,null!==s.query&&(o+="?"+s.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 s=i.parse(t.substr(n.length)),o=e.normalizedPath.split("/"),a=s.normalizedPath.split("/"),l=s.fragment||s.query?0:1;for(;o.length>0&&a.length>l&&o[0]===a[0];)o.shift(),a.shift();let c="";if(o.length>0){o.pop();for(let e=0;e<o.length;++e)c+="../"}return c+=a.join("/"),null!==s.query&&(c+="?"+s.query),null!==s.fragment&&(c+="#"+s.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 s=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>r.isString(e)&&s.test(e),i.isRelative=e=>r.isString(e)},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,s=i.hasOwnProperty,o=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=s.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=o.call(e);return r&&(t?e[a]=n:delete e[a]),i}},701:(e,t,n)=>{const r=n(6957),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=r,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},823:(e,t,n)=>{const r=globalThis.AbortController||n(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:s,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:a},AbortError:l}=n(6371),{validateAbortSignal:c,validateInteger:u,validateObject:d}=n(277),h=n(4134).Symbol("kWeak"),f=n(4134).Symbol("kResistStopPropagation"),{finished:p}=n(6238),g=n(7830),{addAbortSignalNoValidate:y}=n(4147),{isWritable:m,isNodeStream:b}=n(6115),{deprecate:v}=n(7760),{ArrayPrototypePush:w,Boolean:_,MathFloor:x,Number:S,NumberIsNaN:j,Promise:I,PromiseReject:E,PromiseResolve:N,PromisePrototypeThen:T,Symbol:R}=n(4134),O=R("kEmpty"),k=R("kEof");function L(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let r=1;null!=(null==t?void 0:t.concurrency)&&(r=x(t.concurrency));let i=r-1;return null!=(null==t?void 0:t.highWaterMark)&&(i=x(t.highWaterMark)),u(r,"options.concurrency",1),u(i,"options.highWaterMark",0),i+=r,async function*(){const s=n(7760).AbortSignalAny([null==t?void 0:t.signal].filter(_)),o=this,a=[],c={signal:s};let u,d,h=!1,f=0;function p(){h=!0,g()}function g(){f-=1,y()}function y(){d&&!h&&f<r&&a.length<i&&(d(),d=null)}!async function(){try{for await(let t of o){if(h)return;if(s.aborted)throw new l;try{if(t=e(t,c),t===O)continue;t=N(t)}catch(e){t=E(e)}f+=1,T(t,g,p),a.push(t),u&&(u(),u=null),!h&&(a.length>=i||f>=r)&&await new I((e=>{d=e}))}a.push(k)}catch(e){const t=E(e);T(t,g,p),a.push(t)}finally{h=!0,u&&(u(),u=null)}}();try{for(;;){for(;a.length>0;){const e=await a[0];if(e===k)return;if(s.aborted)throw new l;e!==O&&(yield e),a.shift(),y()}await new I((e=>{u=e}))}}finally{h=!0,d&&(d(),d=null)}}.call(this)}async function A(e,t=void 0){for await(const n of C.call(this,e,t))return!0;return!1}function C(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);return L.call(this,(async function(t,n){return await e(t,n)?t:O}),t)}class D extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function M(e){if(e=S(e),j(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:v((function(e=void 0){return null!=e&&d(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const r of this){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l({cause:e.signal.reason});yield[t++,r]}}.call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;e--<=0&&(yield n)}}.call(this)},filter:C,flatMap:function(e,t){const n=L.call(this,e,t);return async function*(){for await(const e of n)yield*e}.call(this)},map:L,take:function(e,t=void 0){return null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;if(e-- >0&&(yield n),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),b(e)&&!m(e))throw new i("stream",e,"must be writable");const n=g(this,e);return null!=t&&t.signal&&y(t.signal,n),n}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);return!await A.call(this,(async(...t)=>!await e(...t)),t)},forEach:async function(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);for await(const n of L.call(this,(async function(t,n){return await e(t,n),O}),t));},reduce:async function(e,t,n){var i;if("function"!=typeof e)throw new s("reducer",["Function","AsyncFunction"],e);null!=n&&d(n,"options"),null!=(null==n?void 0:n.signal)&&c(n.signal,"options.signal");let o=arguments.length>1;if(null!=n&&null!==(i=n.signal)&&void 0!==i&&i.aborted){const e=new l(void 0,{cause:n.signal.reason});throw this.once("error",(()=>{})),await p(this.destroy(e)),e}const a=new r,u=a.signal;if(null!=n&&n.signal){const e={once:!0,[h]:this,[f]:!0};n.signal.addEventListener("abort",(()=>a.abort()),e)}let g=!1;try{for await(const r of this){var y;if(g=!0,null!=n&&null!==(y=n.signal)&&void 0!==y&&y.aborted)throw new l;o?t=await e(t,r,{signal:u}):(t=r,o=!0)}if(!g&&!o)throw new D}finally{a.abort()}return t},toArray:async function(e){null!=e&&d(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const r of this){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,r)}return t},some:A,find:async function(e,t){for await(const n of C.call(this,e,t))return n}}},989:(e,t,n)=>{e.exports=n(4005)},1058:(e,t,n)=>{const r=n(2207),{isArray:i,isObject:s,isString:o,isUndefined:a}=n(7382),{isList:l,isValue:c,isGraph:u,isSimpleGraph:d,isSubjectReference:h}=n(3978),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:m}=n(1972),{removeBase:b,prependBase:v}=n(470),{REGEX_KEYWORD:w,addValue:_,asArray:x,compareShortestLeast:S}=n(9263),j={};function I(e,t,n){if("@nest"!==f(e,t,{vocab:!0},n))throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=j,j.compact=async({activeCtx:e,activeProperty:t=null,element:n,options:f={}})=>{if(i(n)){let r=[];for(let i=0;i<n.length;++i){const s=await j.compact({activeCtx:e,activeProperty:t,element:n[i],options:f});null!==s&&r.push(s)}return f.compactArrays&&1===r.length&&0===(p(e,t,"@container")||[]).length&&(r=r[0]),r}const b=p(e,t,"@context");if(a(b)||(e=await y({activeCtx:e,localCtx:b,propagate:!0,overrideProtected:!0,options:f})),s(n)){if(f.link&&"@id"in n&&f.link.hasOwnProperty(n["@id"])){const e=f.link[n["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===n)return e[t].compacted}if(c(n)||h(n)){const r=j.compactValue({activeCtx:e,activeProperty:t,value:n,options:f});return f.link&&h(n)&&(f.link.hasOwnProperty(n["@id"])||(f.link[n["@id"]]=[]),f.link[n["@id"]].push({expanded:n,compacted:r})),r}if(l(n)&&(p(e,t,"@container")||[]).includes("@list"))return j.compact({activeCtx:e,activeProperty:t,element:n["@list"],options:f});const b="@reverse"===t,v={},w=e;c(n)||h(n)||(e=e.revertToPreviousContext());const S=p(w,t,"@context");a(S)||(e=await y({activeCtx:e,localCtx:S,propagate:!0,overrideProtected:!0,options:f})),f.link&&"@id"in n&&(f.link.hasOwnProperty(n["@id"])||(f.link[n["@id"]]=[]),f.link[n["@id"]].push({expanded:n,compacted:v}));let E=n["@type"]||[];E.length>1&&(E=Array.from(E).sort());const N=e;for(const t of E){const n=j.compactIri({activeCtx:N,iri:t,relativeTo:{vocab:!0}}),r=p(w,n,"@context");a(r)||(e=await y({activeCtx:e,localCtx:r,options:f,propagate:!1}))}const T=Object.keys(n).sort();for(const a of T){const h=n[a];if("@id"!==a)if("@type"!==a)if("@reverse"!==a)if("@preserve"!==a)if("@index"!==a)if("@graph"!==a&&"@list"!==a&&"@included"!==a&&g(a)){const t=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});_(v,t,h)}else{if(!i(h))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===h.length){const t=j.compactIri({activeCtx:e,iri:a,value:h,relativeTo:{vocab:!0},reverse:b}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let r=v;n&&(I(e,n,f),s(v[n])||(v[n]={}),r=v[n]),_(r,t,h,{propertyIsArray:!0})}for(const t of h){const n=j.compactIri({activeCtx:e,iri:a,value:t,relativeTo:{vocab:!0},reverse:b}),r=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let h=v;r&&(I(e,r,f),s(v[r])||(v[r]={}),h=v[r]);const g=p(e,n,"@container")||[],y=u(t),m=l(t);let w;m?w=t["@list"]:y&&(w=t["@graph"]);let S=await j.compact({activeCtx:e,activeProperty:n,element:m||y?w:t,options:f});if(m){if(i(S)||(S=[S]),g.includes("@list")){_(h,n,S,{valueIsArray:!0,allowDuplicate:!0});continue}S={[j.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:S},"@index"in t&&(S[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(y)if(g.includes("@graph")&&(g.includes("@id")||g.includes("@index")&&d(t))){let r;h.hasOwnProperty(n)?r=h[n]:h[n]=r={};const i=(g.includes("@id")?t["@id"]:t["@index"])||j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});_(r,i,S,{propertyIsArray:!f.compactArrays||g.includes("@set")})}else g.includes("@graph")&&d(t)?(i(S)&&S.length>1&&(S={"@included":S}),_(h,n,S,{propertyIsArray:!f.compactArrays||g.includes("@set")})):(i(S)&&1===S.length&&f.compactArrays&&(S=S[0]),S={[j.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:S},"@id"in t&&(S[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(S[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),_(h,n,S,{propertyIsArray:!f.compactArrays||g.includes("@set")}));else if(g.includes("@language")||g.includes("@index")||g.includes("@id")||g.includes("@type")){let r,i;if(h.hasOwnProperty(n)?r=h[n]:h[n]=r={},g.includes("@language"))c(S)&&(S=S["@value"]),i=t["@language"];else if(g.includes("@index")){const r=p(e,n,"@index")||"@index",s=j.compactIri({activeCtx:e,iri:r,relativeTo:{vocab:!0}});if("@index"===r)i=t["@index"],delete S[s];else{let e;if([i,...e]=x(S[r]||[]),o(i))switch(e.length){case 0:delete S[r];break;case 1:S[r]=e[0];break;default:S[r]=e}else i=null}}else if(g.includes("@id")){const t=j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=S[t],delete S[t]}else if(g.includes("@type")){const r=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let s;switch([i,...s]=x(S[r]||[]),s.length){case 0:delete S[r];break;case 1:S[r]=s[0];break;default:S[r]=s}1===Object.keys(S).length&&"@id"in t&&(S=await j.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:f}))}i||(i=j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),_(r,i,S,{propertyIsArray:g.includes("@set")})}else{const e=!f.compactArrays||g.includes("@set")||g.includes("@list")||i(S)&&0===S.length||"@list"===a||"@graph"===a;_(h,n,S,{propertyIsArray:e})}}}else{if((p(e,t,"@container")||[]).includes("@index"))continue;const n=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});_(v,n,h)}else{const n=await j.compact({activeCtx:e,activeProperty:t,element:h,options:f});i(n)&&0===n.length||_(v,a,n)}else{const t=await j.compact({activeCtx:e,activeProperty:"@reverse",element:h,options:f});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const r=t[n],i=(p(e,n,"@container")||[]).includes("@set")||!f.compactArrays;_(v,n,r,{propertyIsArray:i}),delete t[n]}if(Object.keys(t).length>0){const n=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});_(v,n,t)}}else{let t=x(h).map((e=>j.compactIri({activeCtx:w,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const n=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),r=(p(e,n,"@container")||[]).includes("@set")&&m(e,1.1)||i(t)&&0===h.length;_(v,n,t,{propertyIsArray:r})}else{let t=x(h).map((t=>j.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:f.base})));1===t.length&&(t=t[0]),v[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return v}return n},j.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:i={vocab:!1},reverse:o=!1,base:a=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const d=e.getInverse();if(g(t)&&t in d&&"@none"in d[t]&&"@type"in d[t]["@none"]&&"@none"in d[t]["@none"]["@type"])return d[t]["@none"]["@type"]["@none"];if(i.vocab&&t in d){const r=e["@language"]||"@none",i=[];s(n)&&"@index"in n&&!("@graph"in n)&&i.push("@index","@index@set"),s(n)&&"@preserve"in n&&(n=n["@preserve"][0]),u(n)?("@index"in n&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in n||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||i.push("@graph@id","@graph@id@set")):s(n)&&!c(n)&&i.push("@id","@id@set","@type","@set@type");let a="@language",d="@null";if(o)a="@type",d="@reverse",i.push("@set");else if(l(n)){"@index"in n||i.push("@list");const e=n["@list"];if(0===e.length)a="@any",d="@none";else{let t=0===e.length?r:null,n=null;for(let r=0;r<e.length;++r){const i=e[r];let s="@none",o="@none";if(c(i)?"@direction"in i?s=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`:"@language"in i?s=i["@language"].toLowerCase():"@type"in i?o=i["@type"]:s="@null":o="@id",null===t?t=s:s!==t&&c(i)&&(t="@none"),null===n?n=o:o!==n&&(n="@none"),"@none"===t&&"@none"===n)break}t=t||"@none",n=n||"@none","@none"!==n?(a="@type",d=n):d=t}}else{if(c(n))if("@language"in n&&!("@index"in n)){i.push("@language","@language@set"),d=n["@language"];const e=n["@direction"];e&&(d=`${d}_${e}`)}else"@direction"in n&&!("@index"in n)?d=`_${n["@direction"]}`:"@type"in n&&(a="@type",d=n["@type"]);else a="@type",d="@id";i.push("@set")}i.push("@none"),s(n)&&!("@index"in n)&&i.push("@index","@index@set"),c(n)&&1===Object.keys(n).length&&i.push("@language","@language@set");const h=function(e,t,n,r,i,o){null===o&&(o="@null");const a=[];if(("@id"===o||"@reverse"===o)&&s(n)&&"@id"in n){"@reverse"===o&&a.push("@reverse");const t=j.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===n["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}else{a.push(o);const e=a.find((e=>e.includes("_")));e&&a.push(e.replace(/^[^_]+_/,"_"))}a.push("@none");const l=e.inverse[t];for(const e of r){if(!(e in l))continue;const t=l[e][i];for(const e of a)if(e in t)return t[e]}return null}(e,t,n,i,a,d);if(null!==h)return h}if(i.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const r=t.substr(n.length);if(!e.mappings.has(r))return r}}let h=null;const f=[];let p=e.fastCurieMap;const y=t.length-1;for(let e=0;e<y&&t[e]in p;++e)p=p[t[e]],""in p&&f.push(p[""][0]);for(let r=f.length-1;r>=0;--r){const i=f[r],s=i.terms;for(const r of s){const s=r+":"+t.substr(i.iri.length);e.mappings.get(r)._prefix&&(!e.mappings.has(s)||null===n&&e.mappings.get(s)["@id"]===t)&&(null===h||S(s,h)<0)&&(h=s)}}if(null!==h)return h;for(const[n,i]of e.mappings)if(i&&i._prefix&&t.startsWith(n+":"))throw new r(`Absolute IRI "${t}" confused with prefix "${n}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!i.vocab){if("@base"in e){if(e["@base"]){const n=b(v(a,e["@base"]),t);return w.test(n)?`./${n}`:n}return t}return b(a,t)}return t},j.compactValue=({activeCtx:e,activeProperty:t,value:n,options:r})=>{if(c(n)){const r=p(e,t,"@type"),i=p(e,t,"@language"),s=p(e,t,"@direction"),a=p(e,t,"@container")||[],l="@index"in n&&!a.includes("@index");if(!l&&"@none"!==r){if(n["@type"]===r)return n["@value"];if("@language"in n&&n["@language"]===i&&"@direction"in n&&n["@direction"]===s)return n["@value"];if("@language"in n&&n["@language"]===i)return n["@value"];if("@direction"in n&&n["@direction"]===s)return n["@value"]}const c=Object.keys(n).length,u=1===c||2===c&&"@index"in n&&!l,d="@language"in e,h=o(n["@value"]),f=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(u&&"@none"!==r&&(!d||!h||f))return n["@value"];const g={};return l&&(g[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?g[j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=j.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(g[j.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(g[j.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),g[j.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],g}const i=f(e,t,{vocab:!0},r),s=p(e,t,"@type"),a=j.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===s},base:r.base});return"@id"===s||"@vocab"===s||"@graph"===i?a:{[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:a}}},1227:e=>{const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",n="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",i="BlankNode",s="Literal",o="DefaultGraph",a={};(()=>{const e="(?:<([^:]+:[^>]*)>)",t="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",n=t+"0-9-·̀-ͯ‿-⁀",r="(_:(?:["+t+"0-9])(?:(?:["+n+".])*(?:["+n+"]))?)",i="[ \\t]+",s="[ \\t]*",o="(?:"+e+"|"+r+")"+i,l=e+i,c="(?:"+e+"|"+r+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+e+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+s,u="(?:\\.|(?:(?:"+e+"|"+r+")"+s+"\\.))";a.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,a.empty=new RegExp("^"+s+"$"),a.quad=new RegExp("^"+s+o+l+c+u+s+"$")})(),e.exports=class e{static parse(e){const l=[],u={},d=e.split(a.eoln);let h=0;for(const e of d){if(h++,a.empty.test(e))continue;const d=e.match(a.quad);if(null===d)throw new Error("N-Quads parse error on line "+h+".");const g={subject:null,predicate:null,object:null,graph:null};if(void 0!==d[1]?g.subject={termType:r,value:d[1]}:g.subject={termType:i,value:d[2]},g.predicate={termType:r,value:d[3]},void 0!==d[4]?g.object={termType:r,value:d[4]}:void 0!==d[5]?g.object={termType:i,value:d[5]}:(g.object={termType:s,value:void 0,datatype:{termType:r}},void 0!==d[7]?g.object.datatype.value=d[7]:void 0!==d[8]?(g.object.datatype.value=t,g.object.language=d[8]):g.object.datatype.value=n,g.object.value=d[6].replace(c,(function(e,t,n,r){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(r)throw new Error("Unsupported U escape")}))),void 0!==d[9]?g.graph={termType:r,value:d[9]}:void 0!==d[10]?g.graph={termType:i,value:d[10]}:g.graph={termType:o,value:""},g.graph.value in u){let e=!0;const t=u[g.graph.value];for(const n of t)if(p=g,(f=n).subject.termType===p.subject.termType&&f.object.termType===p.object.termType&&f.subject.value===p.subject.value&&f.predicate.value===p.predicate.value&&f.object.value===p.object.value&&(f.object.termType!==s||f.object.datatype.termType===p.object.datatype.termType&&f.object.language===p.object.language&&f.object.datatype.value===p.object.datatype.value)){e=!1;break}e&&(t.push(g),l.push(g))}else u[g.graph.value]=[g],l.push(g)}var f,p;return l}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const n=[];for(const r of t)n.push(e.serializeQuad(r));return n.sort().join("")}static serializeQuadComponents(e,s,o,a){let c="";return e.termType===r?c+=`<${e.value}>`:c+=`${e.value}`,c+=` <${s.value}> `,o.termType===r?c+=`<${o.value}>`:o.termType===i?c+=o.value:(c+=`"${function(e){return e.replace(l,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(o.value)}"`,o.datatype.value===t?o.language&&(c+=`@${o.language}`):o.datatype.value!==n&&(c+=`^^<${o.datatype.value}>`)),a.termType===r?c+=` <${a.value}>`:a.termType===i&&(c+=` ${a.value}`),c+=" .\n",c}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const a=[],l={"blank node":i,IRI:r,literal:s};for(const c in e)e[c].forEach((e=>{const u={};for(const i in e){const o=e[i],a={termType:l[o.type],value:o.value};a.termType===s&&(a.datatype={termType:r},"datatype"in o&&(a.datatype.value=o.datatype),"language"in o?("datatype"in o||(a.datatype.value=t),a.language=o.language):"datatype"in o||(a.datatype.value=n)),u[i]=a}u.graph="@default"===c?{termType:o,value:""}:{termType:c.startsWith("_:")?i:r,value:c},a.push(u)}));return a}};const l=/["\\\n\r]/g,c=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},1972:(e,t,n)=>{const r=n(9263),i=n(2207),{isArray:s,isObject:o,isString:a,isUndefined:l}=n(7382),{isAbsolute:c,isRelative:u,prependBase:d}=n(470),{handleEvent:h}=n(2246),{REGEX_BCP47:f,REGEX_KEYWORD:p,asArray:g,compareShortestLeast:y}=n(9263),m=new Map,b={};function v(e,t,n,r,i,s){if(null===t||!a(t)||b.isKeyword(t))return t;if(t.match(p))return null;if(r&&r.hasOwnProperty(t)&&!0!==i.get(t)&&b.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:s}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(o(n)&&"@id"in n)return n["@id"]}const l=t.indexOf(":");if(l>0){const n=t.substr(0,l),o=t.substr(l+1);if("_"===n||0===o.indexOf("//"))return t;r&&r.hasOwnProperty(n)&&b.createTermDefinition({activeCtx:e,localCtx:r,term:n,defined:i,options:s});const a=e.mappings.get(n);if(a&&a._prefix)return a["@id"]+o;if(c(t))return t}if(n.vocab&&"@vocab"in e)t=e["@vocab"]+t;else if(n.base){let n,r;"@base"in e?e["@base"]?(r=d(s.base,e["@base"]),n=d(r,t)):(r=e["@base"],n=t):(r=s.base,n=d(s.base,t)),t=n}return t}function w(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!w(e[n],t[n]))return!1;return!0}const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(const n in e){let r=e[n],i=t[n];if("@container"===n&&Array.isArray(r)&&Array.isArray(i)&&(r=r.slice().sort(),i=i.slice().sort()),!w(r,i))return!1}return!0}e.exports=b,b.process=async({activeCtx:e,localCtx:t,options:n,propagate:r=!0,overrideProtected:l=!1,cycles:p=new Set})=>{if(o(t)&&"@context"in t&&s(t["@context"])&&(t=t["@context"]),0===g(t).length)return e;const y=[],m=[({event:e,next:t})=>{y.push(e),t()}];n.eventHandler&&m.push(n.eventHandler);const w=n;n={...n,eventHandler:m};const _=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});o(_[0].document)&&"boolean"==typeof _[0].document["@propagate"]&&(r=_[0].document["@propagate"]);let x=e;r||x.previousContext||(x=x.clone(),x.previousContext=e);for(const r of _){let{document:s}=r;if(e=x,null===s){if(!l&&0!==Object.keys(e.protected).length)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});x=e=b.getInitialContext(n).clone();continue}const g=r.getProcessed(e);if(g){if(w.eventHandler)for(const e of g.events)h({event:e,options:w});x=e=g.context;continue}if(o(s)&&"@context"in s&&(s=s["@context"]),!o(s))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:s});x=x.clone();const m=new Map;if("@version"in s){if(1.1!==s["@version"])throw new i("Unsupported JSON-LD version: "+s["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:s});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+s["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:s});x.processingMode="json-ld-1.1",x["@version"]=s["@version"],m.set("@version",!0)}if(x.processingMode=x.processingMode||e.processingMode,"@base"in s){let e=s["@base"];if(null===e||c(e));else{if(!u(e))throw new i('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:s});e=d(x["@base"],e)}x["@base"]=e,m.set("@base",!0)}if("@vocab"in s){const e=s["@vocab"];if(null===e)delete x["@vocab"];else{if(!a(e))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:s});if(!c(e)&&b.processingMode(x,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:s});{const t=v(x,e,{vocab:!0,base:!0},void 0,void 0,n);c(t)||n.eventHandler&&h({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:n}),x["@vocab"]=t}}m.set("@vocab",!0)}if("@language"in s){const e=s["@language"];if(null===e)delete x["@language"];else{if(!a(e))throw new i('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:s});e.match(f)||n.eventHandler&&h({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:n}),x["@language"]=e.toLowerCase()}m.set("@language",!0)}if("@direction"in s){const t=s["@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:s});if(null===t)delete x["@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:s});x["@direction"]=t}m.set("@direction",!0)}if("@propagate"in s){const n=s["@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:s});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});m.set("@propagate",!0)}if("@import"in s){const r=s["@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:s});if(!a(r))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const o=await n.contextResolver.resolve({activeCtx:e,context:r,documentLoader:n.documentLoader,base:n.base});if(1!==o.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const l=o[0].getProcessed(e);if(l)s=l;else{const n=o[0].document;if("@import"in n)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in n)s.hasOwnProperty(e)||(s[e]=n[e]);o[0].setProcessed(e,s)}m.set("@import",!0)}m.set("@protected",s["@protected"]||!1);for(const e in s)if(b.createTermDefinition({activeCtx:x,localCtx:s,term:e,defined:m,options:n,overrideProtected:l}),o(s[e])&&"@context"in s[e]){const t=s[e]["@context"];let r=!0;if(a(t)){const e=d(n.base,t);p.has(e)?r=!1:p.add(e)}if(r)try{await b.process({activeCtx:x.clone(),localCtx:s[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:s[e]["@context"],term:e})}}r.setProcessed(e,{context:x,events:y})}return x},b.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:r,options:l,overrideProtected:u=!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 d;if(r.set(n,!1),t.hasOwnProperty(n)&&(d=t[n]),"@type"===n&&o(d)&&"@set"===(d["@container"]||"@set")&&b.processingMode(e,1.1)){const e=["@container","@id","@protected"],r=Object.keys(d);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(b.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(p))return void(l.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:n}},options:l}));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 f=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let g=!1;if((a(d)||null===d)&&(g=!0,d={"@id":d}),!o(d))throw new i("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const y={};e.mappings.set(n,y),y.reverse=!1;const m=["@container","@id","@language","@reverse","@type"];b.processingMode(e,1.1)&&m.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in d)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 _=n.indexOf(":");if(y._termHasColon=_>0,"@reverse"in d){if("@id"in d)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 d)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const s=d["@reverse"];if(!a(s))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(s.match(p))return l.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:s}},options:l}),void(f?e.mappings.set(n,f):e.mappings.delete(n));const o=v(e,s,{vocab:!0,base:!1},t,r,l);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});y["@id"]=o,y.reverse=!0}else if("@id"in d){let s=d["@id"];if(s&&!a(s))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===s)y["@id"]=null;else{if(!b.isKeyword(s)&&s.match(p))return l.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:s}},options:l}),void(f?e.mappings.set(n,f):e.mappings.delete(n));if(s!==n){if(s=v(e,s,{vocab:!0,base:!1},t,r,l),!c(s)&&!b.isKeyword(s))throw new i("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)&&v(e,n,{vocab:!0,base:!1},t,new Map(r).set(n,!0),l)!==s)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});y["@id"]=s,y._prefix=g&&!y._termHasColon&&null!==s.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in y))if(y._termHasColon){const i=n.substr(0,_);if(t.hasOwnProperty(i)&&b.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:r,options:l}),e.mappings.has(i)){const t=n.substr(_+1);y["@id"]=e.mappings.get(i)["@id"]+t}else y["@id"]=n}else if("@type"===n)y["@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});y["@id"]=e["@vocab"]+n}if((!0===d["@protected"]||!0===r.get("@protected")&&!1!==d["@protected"])&&(e.protected[n]=!0,y.protected=!0),r.set(n,!0),"@type"in d){let n=d["@type"];if(!a(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(b.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=v(e,n,{vocab:!0,base:!1},t,r,l),!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})}y["@type"]=n}if("@container"in d){const n=a(d["@container"])?[d["@container"]]:d["@container"]||[],r=["@list","@set","@index","@language"];let o=!0;const l=n.includes("@set");if(b.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<=(l?2:1);if(n.includes("@type")&&(y["@type"]=y["@type"]||"@id",!["@id","@vocab"].includes(y["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else o&=!s(d["@container"]),o&=n.length<=1;if(o&=n.every((e=>r.includes(e))),o&=!(l&&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(y.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});y["@container"]=n}if("@index"in d){if(!("@container"in d)||!y["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${d["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!a(d["@index"])||0===d["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${d["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});y["@index"]=d["@index"]}if("@context"in d&&(y["@context"]=d["@context"]),"@language"in d&&!("@type"in d)){let e=d["@language"];if(null!==e&&!a(e))throw new i("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),y["@language"]=e}if("@prefix"in d){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(b.isKeyword(y["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof d["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});y._prefix=!0===d["@prefix"]}if("@direction"in d){const e=d["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});y["@direction"]=e}if("@nest"in d){const e=d["@nest"];if(!a(e)||"@nest"!==e&&0===e.indexOf("@"))throw new i("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});y["@nest"]=e}const x=y["@id"];if("@context"===x||"@preserve"===x)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(f&&f.protected&&!u&&(e.protected[n]=!0,y.protected=!0,!w(f,y)))throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n})},b.expandIri=(e,t,n,r)=>v(e,t,n,void 0,void 0,r),b.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=m.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(),a=e["@direction"],l=e.mappings,c=[...l.keys()].sort(y);for(const e of c){const s=l.get(e);if(null===s)continue;let c=s["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===s["@id"])continue;const u=g(s["@id"]);for(const l of u){let u=t[l];const d=b.isKeyword(l);if(u)d||s._termHasColon||r[l].push(e);else if(t[l]=u={},!d&&!s._termHasColon){r[l]=[e];const t={iri:l,terms:r[l]};l[0]in n?n[l[0]].push(t):n[l[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],o(e,u["@any"],"@none"),s.reverse)o(e,u["@type"],"@reverse");else if("@none"===s["@type"])o(e,u["@any"],"@none"),o(e,u["@language"],"@none"),o(e,u["@type"],"@none");else if("@type"in s)o(e,u["@type"],s["@type"]);else if("@language"in s&&"@direction"in s){const t=s["@language"],n=s["@direction"];o(e,u["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?`_${n}`:"@null")}else"@language"in s?o(e,u["@language"],(s["@language"]||"@null").toLowerCase()):"@direction"in s?s["@direction"]?o(e,u["@language"],`_${s["@direction"]}`):o(e,u["@language"],"@none"):a?(o(e,u["@language"],`_${a}`),o(e,u["@language"],"@none"),o(e,u["@type"],"@none")):(o(e,u["@language"],i),o(e,u["@language"],"@none"),o(e,u["@type"],"@none"))}}for(const e in n)s(n,e,1);return t},clone:function(){const e={};return e.mappings=r.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=r.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===m.size&&m.clear(),m.set(t,i),i;function s(e,t,n){const r=e[t],i=e[t]={};let o,a;for(const e of r)o=e.iri,a=n>=o.length?"":o[n],a in i?i[a].push(e):i[a]=[e];for(const e in i)""!==e&&s(i,e,n+1)}function o(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},b.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(l(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},b.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,b.isKeyword=e=>{if(!a(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},2177:(e,t,n)=>{var r=n(1489);e.exports=function(e,t){var n;if("function"!=typeof t)throw new TypeError("Expected a function");return e=r(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}},2207:e=>{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}}},2246:(e,t,n)=>{const r=n(2207),{isArray:i}=n(7382),{asArray:s}=n(9263),o={};function a({event:e,handlers:t}){let n=!0;for(let s=0;n&&s<t.length;++s){n=!1;const o=t[s];if(i(o))n=a({event:e,handlers:o});else if("function"==typeof o)o({event:e,next:()=>{n=!0}});else{if("object"!=typeof o)throw new r("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in o?o[e.code]({event:e,next:()=>{n=!0}}):n=!0}}return n}e.exports=o,o.defaultEventHandler=null,o.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?o.safeEventHandler:[],e.eventHandler?s(e.eventHandler):[],o.defaultEventHandler?o.defaultEventHandler:[]);return 0===t.length?null:t},o.handleEvent=({event:e,options:t})=>{a({event:e,handlers:t.eventHandler})};const l=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);o.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&l.has(e.code))throw new r("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},o.logEventHandler=function({event:e,next:t}){console.log(`EVENT: ${e.message}`,{event:e}),t()},o.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&console.warn(`WARNING: ${e.message}`,{event:e}),t()},o.unhandledEventHandler=function({event:e}){throw new r("No handler for event.","jsonld.UnhandledEvent",{event:e})},o.setDefaultEventHandler=function({eventHandler:e}={}){o.defaultEventHandler=e?s(e):null}},2341:e=>{e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,n,r)=>t+(0===r?"":",")+e(void 0===n||"symbol"==typeof n?null:n)),"")+"]":"{"+Object.keys(t).sort().reduce(((n,r,i)=>void 0===t[r]||"symbol"==typeof t[r]?n:n+(0===n.length?"":",")+e(r)+":"+e(t[r])),"")+"}"}},2406:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberDouble=void 0;const r=n(103);class i{fromRdf(e,t){const n=parseFloat(e.value);return t&&isNaN(n)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return t=t||n.namedNode(i.TYPES[0]),isNaN(e)?n.literal("NaN",t):isFinite(e)?e%1==0?null:n.literal(e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),t):n.literal(e>0?"INF":"-INF",t)}}t.TypeHandlerNumberDouble=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},2438:(e,t,n)=>{const r=n(2985),i=n(3751),s=n(9925),o=n(1227);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=()=>new i("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const e of n)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),s=[];for(const e of i){const n=t.get(e);if(n.length>1){s.push(n);continue}const r=n[0];this.canonicalIssuer.getId(r)}for(const e of s){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new r("_:b");e.getId(n);const i=this.hashNDegreeQuads(n,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=o.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(const n of r){const r={subject:null,predicate:n.predicate,object:null,graph:null};r.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),r.object=this.modifyFirstDegreeComponent(e,n.object,"object"),r.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(o.serializeQuad(r))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return n.hash=i.digest(),n.hash}hashRelatedBlankNode(e,t,n,r){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const s=this.createMessageDigest();return s.update(r),"g"!==r&&s.update(this.getRelatedPredicate(t)),s.update(i),s.digest()}hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const r=this.createMessageDigest(),i=this.createHashToRelated(e,t),o=[...i.keys()].sort();for(const e of o){r.update(e);let n,o="";const a=new s(i.get(e));for(;a.hasNext();){const e=a.next();let r=t.clone(),i="";const s=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(r.hasId(t)||s.push(t),i+=r.getId(t)),0!==o.length&&i>o){l=!0;break}if(!l){for(const e of s){const t=this.hashNDegreeQuads(e,r);if(i+=r.getId(e),i+=`<${t.hash}>`,r=t.issuer,0!==o.length&&i>o){l=!0;break}}l||(0===o.length||i<o)&&(o=i,n=r)}}r.update(o),t=n}return{hash:r.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const i of r)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:r,issuer:i,hashToRelated:s}){if("BlankNode"!==t.termType||t.value===r)return;const o=t.value,a=this.hashRelatedBlankNode(o,e,i,n),l=s.get(a);l?l.push(o):s.set(a,[o])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},2552:(e,t,n)=>{var r=n(1873),i=n(659),s=n(9350),o=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):s(e)}},2791:function(e,t,n){!function(e){if(!e.setImmediate){var t,n,r,i,s,o=1,a={},l=!1,c=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?t=function(e){process.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(i="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&h(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),t=function(t){e.postMessage(i+t,"*")}):e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){h(e.data)},t=function(e){r.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(n=c.documentElement,t=function(e){var t=c.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):t=function(e){setTimeout(h,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var n=new Array(arguments.length-1),r=0;r<n.length;r++)n[r]=arguments[r+1];var i={callback:e,args:n};return a[o]=i,t(o),o++},u.clearImmediate=d}function d(e){delete a[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=a[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===n.g?this:n.g:self)},2946:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0,t.Quad=class{constructor(e,t,n,r){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}},2985:e=>{e.exports=class e{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:t,_existing:n,counter:r}=this;return new e(t,new Map(n),r)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},3067:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0,t.BlankNode=class{constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},3095:(e,t,n)=>{const{ArrayPrototypePop:r,Promise:i}=n(4134),{isIterable:s,isNodeStream:o,isWebStream:a}=n(6115),{pipelineImpl:l}=n(7758),{finished:c}=n(6238);n(5506),e.exports={finished:c,pipeline:function(...e){return new i(((t,n)=>{let i,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!o(u)&&!s(u)&&!a(u)){const t=r(e);i=t.signal,c=t.end}l(e,((e,r)=>{e?n(e):t(r)}),{signal:i,end:c})}))}}},3141:(e,t,n)=>{var r=n(5003).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=d,t=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function u(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=o(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=o(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},3370:(e,t,n)=>{const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:s,ObjectSetPrototypeOf:o}=n(4134);e.exports=c;const a=n(7576),l=n(8584);o(c.prototype,a.prototype),o(c,a);{const e=s(l.prototype);for(let t=0;t<e.length;t++){const n=e[t];c.prototype[n]||(c.prototype[n]=l.prototype[n])}}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),l.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let u,d;function h(){return void 0===u&&(u={}),u}r(c.prototype,{writable:{__proto__:null,...i(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(l.prototype,"writableLength")},writableFinished:{__proto__:null,...i(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},c.from=function(e){return d||(d=n(6706)),d(e,"body")}},3476:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0,t.NamedNode=class{constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}},3513:(e,t,n)=>{const r=n(2985),i=n(3751),s=n(9925),o=n(1227);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=()=>new i("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];let i=0;for(const e of n)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const s=[...t.keys()].sort(),l=[];for(const e of s){const n=t.get(e);if(n.length>1){l.push(n);continue}const r=n[0];this.canonicalIssuer.getId(r)}for(const e of l){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new r("_:b");e.getId(n);const i=await this.hashNDegreeQuads(n,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=o.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join("")}async hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(const n of r){const r={subject:null,predicate:n.predicate,object:null,graph:null};r.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),r.object=this.modifyFirstDegreeComponent(e,n.object,"object"),r.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(o.serializeQuad(r))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return n.hash=await i.digest(),n.hash}async hashRelatedBlankNode(e,t,n,r){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const s=this.createMessageDigest();return s.update(r),"g"!==r&&s.update(this.getRelatedPredicate(t)),s.update(i),s.digest()}async hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const r=this.createMessageDigest(),i=await this.createHashToRelated(e,t),o=[...i.keys()].sort();for(const e of o){r.update(e);let n,o="";const a=new s(i.get(e));let l=0;for(;a.hasNext();){const e=a.next();++l%3==0&&await this._yield();let r=t.clone(),i="";const s=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(r.hasId(t)||s.push(t),i+=r.getId(t)),0!==o.length&&i>o){c=!0;break}if(!c){for(const e of s){const t=await this.hashNDegreeQuads(e,r);if(i+=r.getId(e),i+=`<${t.hash}>`,r=t.issuer,0!==o.length&&i>o){c=!0;break}}c||(0===o.length||i<o)&&(o=i,n=r)}}r.update(o),t=n}return{hash:await r.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;let i=0;for(const s of r)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:s,component:s.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:s,component:s.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:s,component:s.graph,position:"g",id:e,issuer:t,hashToRelated:n})]);return n}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=await this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:n,id:r,issuer:i,hashToRelated:s}){if("BlankNode"!==t.termType||t.value===r)return;const o=t.value,a=await this.hashRelatedBlankNode(o,e,i,n),l=s.get(a);l?l.push(o):s.set(a,[o])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},3617:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3067),t),i(n(8339),t),i(n(4878),t),i(n(458),t),i(n(3476),t),i(n(2946),t),i(n(7265),t)},3743:e=>{e.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}},3751:(e,t,n)=>{n(2791);const r=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!r||!r.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await r.subtle.digest(this.algorithm,e));let n="";for(let e=0;e<t.length;++e)n+=t[e].toString(16).padStart(2,"0");return n}}},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},3845:(e,t,n)=>{const r=n(3751),i=n(3513);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;let i=0;for(const s of r){let r,o;if("BlankNode"===s.subject.termType&&s.subject.value!==e)o=s.subject.value,r="p";else{if("BlankNode"!==s.object.termType||s.object.value===e)continue;o=s.object.value,r="r"}++i%100==0&&await this._yield();const a=await this.hashRelatedBlankNode(o,s,t,r),l=n.get(a);l?l.push(o):n.set(a,[o])}return n}}},3947:(e,t,n)=>{const r=n(2207),i=n(3978),s=n(7382),{REGEX_BCP47:o,addValue:a}=n(9263),{handleEvent:l}=n(2246),{RDF_LIST:c,RDF_FIRST:u,RDF_REST:d,RDF_NIL:h,RDF_TYPE:f,RDF_JSON_LITERAL:p,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:m,XSD_STRING:b}=n(9378),v={};function w(e,t,n,i){if(e.termType.endsWith("Node"))return{"@id":e.value};const a={"@value":e.value};if(e.language)e.language.match(o)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:i}),a["@language"]=e.language;else{let c=e.datatype.value;if(c||(c=b),c===p){c="@json";try{a["@value"]=JSON.parse(a["@value"])}catch(e){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:a["@value"],cause:e})}}if(t){if(c===g)"true"===a["@value"]?a["@value"]=!0:"false"===a["@value"]&&(a["@value"]=!1);else if(s.isNumeric(a["@value"]))if(c===m){const e=parseInt(a["@value"],10);e.toFixed(0)===a["@value"]&&(a["@value"]=e)}else c===y&&(a["@value"]=parseFloat(a["@value"]));[g,m,y,b].includes(c)||(a["@type"]=c)}else if("i18n-datatype"===n&&c.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=c.split(/[#_]/);e.length>0&&(a["@language"]=e,e.match(o)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:i})),a["@direction"]=t}else c!==b&&(a["@type"]=c)}return a}e.exports=v,v.fromRDF=async(e,t)=>{const{useRdfType:n=!1,useNativeTypes:o=!1,rdfDirection:l=null}=t,p={},g={"@default":p},y={};if(l){if("compound-literal"===l)throw new r("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:l});if("i18n-datatype"!==l)throw new r("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:l})}for(const r of e){const e="DefaultGraph"===r.graph.termType?"@default":r.graph.value;e in g||(g[e]={}),"@default"===e||e in p||(p[e]={"@id":e});const i=g[e],s=r.subject.value,c=r.predicate.value,u=r.object;s in i||(i[s]={"@id":s});const d=i[s],m=u.termType.endsWith("Node");if(m&&!(u.value in i)&&(i[u.value]={"@id":u.value}),c===f&&!n&&m){a(d,"@type",u.value,{propertyIsArray:!0});continue}const b=w(u,o,l,t);if(a(d,c,b,{propertyIsArray:!0}),m)if(u.value===h){const e=i[u.value];"usages"in e||(e.usages=[]),e.usages.push({node:d,property:c,value:b})}else u.value in y?y[u.value]=!1:y[u.value]={node:d,property:c,value:b}}for(const e in g){const t=g[e];if(!(h in t))continue;const n=t[h];if(n.usages){for(let e of n.usages){let n=e.node,r=e.property,o=e.value;const a=[],l=[];let h=Object.keys(n).length;for(;r===d&&s.isObject(y[n["@id"]])&&s.isArray(n[u])&&1===n[u].length&&s.isArray(n[d])&&1===n[d].length&&(3===h||4===h&&s.isArray(n["@type"])&&1===n["@type"].length&&n["@type"][0]===c)&&(a.push(n[u][0]),l.push(n["@id"]),e=y[n["@id"]],n=e.node,r=e.property,o=e.value,h=Object.keys(n).length,i.isBlankNode(n)););delete o["@id"],o["@list"]=a.reverse();for(const e of l)delete t[e]}delete n.usages}}const m=[],b=Object.keys(p).sort();for(const e of b){const t=p[e];if(e in g){const n=t["@graph"]=[],r=g[e],s=Object.keys(r).sort();for(const e of s){const t=r[e];i.isSubjectReference(t)||n.push(t)}}i.isSubjectReference(t)||m.push(t)}return m}},3978:(e,t,n)=>{const r=n(7382),i={};e.exports=i,i.isSubject=e=>!(!r.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>r.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>r.isObject(e)&&"@value"in e,i.isList=e=>r.isObject(e)&&"@list"in e,i.isGraph=e=>r.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>{if(r.isObject(e)){if("@id"in e){const t=e["@id"];return!r.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1}},4005:(e,t,n)=>{const r=n(3513),i=n(3845),s=n(2438),o=n(378);let a;try{a=n(7789)}catch(e){}function l(e){return Array.isArray(e)?e:t.NQuads.legacyDatasetToQuads(e)}t.NQuads=n(1227),t.IdentifierIssuer=n(2985),t._rdfCanonizeNative=function(e){return e&&(a=e),a},t.canonize=async function(e,t){const n=l(e);if(t.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((e,r)=>a.canonize(n,t,((t,n)=>t?r(t):e(n)))))}if("URDNA2015"===t.algorithm)return new r(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)},t._canonizeSync=function(e,t){const n=l(e);if(t.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return a.canonizeSync(n,t)}if("URDNA2015"===t.algorithm)return new s(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new o(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}},4019:(e,t,n)=>{const r=n(2207),{isArray:i,isObject:s,isEmptyObject:o,isString:a,isUndefined:l}=n(7382),{isList:c,isValue:u,isGraph:d,isSubject:h}=n(3978),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:m}=n(1972),{isAbsolute:b}=n(470),{REGEX_BCP47:v,REGEX_KEYWORD:w,addValue:_,asArray:x,getValues:S,validateTypeValue:j}=n(9263),{handleEvent:I}=n(2246),E={};function N({value:e,count:t,options:n}){if(0===t||"@value"in e||"@list"in e||1===t&&"@id"in e){if(n.eventHandler){let r,i;0===t?(r="empty object",i="Dropping empty object."):"@value"in e?(r="object with only @value",i="Dropping object with only @value."):"@list"in e?(r="object with only @list",i="Dropping object with only @list."):1===t&&"@id"in e&&(r="object with only @id",i="Dropping object with only @id."),I({event:{type:["JsonLdEvent"],code:r,level:"warning",message:i,details:{value:e}},options:n})}return null}return e}async function T({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:d,expandedParent:w,options:S={},insideList:R,typeKey:L,typeScopedContext:A}){const C=Object.keys(d).sort(),D=[];let M;const P=d[L]&&"@json"===f(e,i(d[L])?d[L][0]:d[L],{vocab:!0},{...S,typeExpansion:!0});for(const T of C){let R,L=d[T];if("@context"===T)continue;const C=f(e,T,{vocab:!0},S);if(null===C||!b(C)&&!g(C)){S.eventHandler&&I({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:T,expandedProperty:C}},options:S});continue}if(g(C)){if("@reverse"===n)throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:L});if(C in w&&"@included"!==C&&"@type"!==C)throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:C})}if("@id"===C){if(!a(L)){if(!S.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(s(L)){if(!o(L))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L})}else{if(!i(L))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(!L.every((e=>a(e))))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L})}}_(w,"@id",x(L).map((t=>{if(a(t)){const n=f(e,t,{base:!0},S);return S.eventHandler&&(null===n?I(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:S}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:S}):b(n)||I({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:n}},options:S})),n}return t})),{propertyIsArray:S.isFrame});continue}if("@type"===C){s(L)&&(L=Object.fromEntries(Object.entries(L).map((([e,t])=>[f(A,e,{vocab:!0}),x(t).map((e=>f(A,e,{base:!0,vocab:!0},{...S,typeExpansion:!0})))])))),j(L,S.isFrame),_(w,"@type",x(L).map((e=>{if(a(e)){const t=f(A,e,{base:!0,vocab:!0},{...S,typeExpansion:!0});return"@json"===t||b(t)||S.eventHandler&&I({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:S}),t}return e})),{propertyIsArray:!!S.isFrame});continue}if("@included"===C&&m(e,1.1)){const n=x(await E.expand({activeCtx:e,activeProperty:t,element:L,options:S}));if(!n.every((e=>h(e))))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:L});_(w,"@included",n,{propertyIsArray:!0});continue}if("@graph"===C&&!s(L)&&!i(L))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:L});if("@value"===C){M=L,P&&m(e,1.1)?w["@value"]=L:_(w,"@value",L,{propertyIsArray:S.isFrame});continue}if("@language"===C){if(null===L)continue;if(!a(L)&&!S.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:L});L=x(L).map((e=>a(e)?e.toLowerCase():e));for(const e of L)a(e)&&!e.match(v)&&S.eventHandler&&I({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:S});_(w,"@language",L,{propertyIsArray:S.isFrame});continue}if("@direction"===C){if(!a(L)&&!S.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:L});L=x(L);for(const e of L)if(a(e)&&"ltr"!==e&&"rtl"!==e)throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:L});_(w,"@direction",L,{propertyIsArray:S.isFrame});continue}if("@index"===C){if(!a(L))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:L});_(w,"@index",L);continue}if("@reverse"===C){if(!s(L))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:L});if(R=await E.expand({activeCtx:e,activeProperty:"@reverse",element:L,options:S}),"@reverse"in R)for(const e in R["@reverse"])_(w,e,R["@reverse"][e],{propertyIsArray:!0});let t=w["@reverse"]||null;for(const e in R){if("@reverse"===e)continue;null===t&&(t=w["@reverse"]={}),_(t,e,[],{propertyIsArray:!0});const n=R[e];for(let i=0;i<n.length;++i){const s=n[i];if(u(s)||c(s))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:R});_(t,e,s,{propertyIsArray:!0})}}continue}if("@nest"===C){D.push(T);continue}let $=e;const B=p(e,T,"@context");l(B)||($=await y({activeCtx:e,localCtx:B,propagate:!0,overrideProtected:!0,options:S}));const F=p(e,T,"@container")||[];if(F.includes("@language")&&s(L))R=O($,L,p($,T,"@direction"),S);else if(F.includes("@index")&&s(L)){const t=F.includes("@graph"),n=p($,T,"@index")||"@index",r="@index"!==n&&f(e,n,{vocab:!0},S);R=await k({activeCtx:$,options:S,activeProperty:T,value:L,asGraph:t,indexKey:n,propertyIndex:r})}else if(F.includes("@id")&&s(L)){const e=F.includes("@graph");R=await k({activeCtx:$,options:S,activeProperty:T,value:L,asGraph:e,indexKey:"@id"})}else if(F.includes("@type")&&s(L))R=await k({activeCtx:$.revertToPreviousContext(),options:S,activeProperty:T,value:L,asGraph:!1,indexKey:"@type"});else{const r="@list"===C;if(r||"@set"===C){let e=t;r&&"@graph"===n&&(e=null),R=await E.expand({activeCtx:$,activeProperty:e,element:L,options:S,insideList:r})}else R="@json"===p(e,T,"@type")?{"@type":"@json","@value":L}:await E.expand({activeCtx:$,activeProperty:T,element:L,options:S,insideList:!1})}if(null!==R||"@value"===C){if("@list"!==C&&!c(R)&&F.includes("@list")&&(R={"@list":x(R)}),F.includes("@graph")&&!F.some((e=>"@id"===e||"@index"===e))){if(R=x(R),S.isFrame||(R=R.filter((e=>null!==N({value:e,count:Object.keys(e).length,options:S})))),0===R.length)continue;R=R.map((e=>({"@graph":x(e)})))}if($.mappings.has(T)&&$.mappings.get(T).reverse){const e=w["@reverse"]=w["@reverse"]||{};R=x(R);for(let t=0;t<R.length;++t){const n=R[t];if(u(n)||c(n))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:R});_(e,C,n,{propertyIsArray:!0})}}else _(w,C,R,{propertyIsArray:!0})}}if("@value"in w)if("@json"===w["@type"]&&m(e,1.1));else if((s(M)||i(M))&&!S.isFrame)throw new r('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:M});for(const o of D){const a=i(d[o])?d[o]:[d[o]];for(const i of a){if(!s(i)||Object.keys(i).some((t=>"@value"===f(e,t,{vocab:!0},S))))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await T({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:i,expandedParent:w,options:S,insideList:R,typeScopedContext:A,typeKey:L})}}}function R({activeCtx:e,activeProperty:t,value:n,options:r}){if(null==n)return null;const i=f(e,t,{vocab:!0},r);if("@id"===i)return f(e,n,{base:!0},r);if("@type"===i)return f(e,n,{vocab:!0,base:!0},{...r,typeExpansion:!0});const s=p(e,t,"@type");if(("@id"===s||"@graph"===i)&&a(n)){const i=f(e,n,{base:!0},r);return null===i&&n.match(w)&&r.eventHandler&&I({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:r}),{"@id":i}}if("@vocab"===s&&a(n))return{"@id":f(e,n,{vocab:!0,base:!0},r)};if(g(i))return n;const o={};if(s&&!["@id","@vocab","@none"].includes(s))o["@type"]=s;else if(a(n)){const n=p(e,t,"@language");null!==n&&(o["@language"]=n);const r=p(e,t,"@direction");null!==r&&(o["@direction"]=r)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),o["@value"]=n,o}function O(e,t,n,s){const o=[],l=Object.keys(t).sort();for(const c of l){const l=f(e,c,{vocab:!0},s);let u=t[c];i(u)||(u=[u]);for(const e of u){if(null===e)continue;if(!a(e))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const i={"@value":e};"@none"!==l&&(c.match(v)||s.eventHandler&&I({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:c}},options:s}),i["@language"]=c.toLowerCase()),n&&(i["@direction"]=n),o.push(i)}}return o}async function k({activeCtx:e,options:t,activeProperty:n,value:s,asGraph:o,indexKey:a,propertyIndex:c}){const h=[],g=Object.keys(s).sort(),m="@type"===a;for(let b of g){if(m){const n=p(e,b,"@context");l(n)||(e=await y({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let g,v=s[b];i(v)||(v=[v]),v=await E.expand({activeCtx:e,activeProperty:n,element:v,options:t,insideList:!1,insideIndex:!0}),g=c?"@none"===b?"@none":R({activeCtx:e,activeProperty:a,value:b,options:t}):f(e,b,{vocab:!0},t),"@id"===a?b=f(e,b,{base:!0},t):m&&(b=g);for(let e of v){if(o&&!d(e)&&(e={"@graph":[e]}),"@type"===a)"@none"===g||(e["@type"]?e["@type"]=[b].concat(e["@type"]):e["@type"]=[b]);else{if(u(e)&&!["@language","@type","@index"].includes(a))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${a}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});c?"@none"!==g&&_(e,c,g,{propertyIsArray:!0,prependValue:!0}):"@none"===g||a in e||(e[a]=b)}h.push(e)}}return h}e.exports=E,E.expand=async({activeCtx:e,activeProperty:t=null,element:n,options:c={},insideList:u=!1,insideIndex:d=!1,typeScopedContext:h=null})=>{if(null==n)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!i(n)&&!s(n))return u||null!==t&&"@graph"!==f(e,t,{vocab:!0},c)?R({activeCtx:e,activeProperty:t,value:n,options:c}):(c.eventHandler&&I({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:n}},options:c}),null);if(i(n)){let r=[];const s=p(e,t,"@container")||[];u=u||s.includes("@list");for(let s=0;s<n.length;++s){let o=await E.expand({activeCtx:e,activeProperty:t,element:n[s],options:c,insideIndex:d,typeScopedContext:h});u&&i(o)&&(o={"@list":o}),null!==o&&(i(o)?r=r.concat(o):r.push(o))}return r}const g=f(e,t,{vocab:!0},c),v=p(e,t,"@context");h=h||(e.previousContext?e:null);let w=Object.keys(n).sort(),_=!d;if(_&&h&&w.length<=2&&!w.includes("@context"))for(const t of w){const n=f(h,t,{vocab:!0},c);if("@value"===n){_=!1,e=h;break}if("@id"===n&&1===w.length){_=!1;break}}_&&(e=e.revertToPreviousContext()),l(v)||(e=await y({activeCtx:e,localCtx:v,propagate:!0,overrideProtected:!0,options:c})),"@context"in n&&(e=await y({activeCtx:e,localCtx:n["@context"],options:c})),h=e;let j=null;for(const t of w)if("@type"===f(e,t,{vocab:!0},c)){j=j||t;const r=n[t],i=Array.isArray(r)?r.length>1?r.slice().sort():r:[r];for(const t of i){const n=p(h,t,"@context");l(n)||(e=await y({activeCtx:e,localCtx:n,options:c,propagate:!1}))}}let O={};await T({activeCtx:e,activeProperty:t,expandedActiveProperty:g,element:n,expandedParent:O,options:c,insideList:u,typeKey:j,typeScopedContext:h}),w=Object.keys(O);let k=w.length;if("@value"in O){if("@type"in O&&("@language"in O||"@direction"in O))throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:O});let t=k-1;if("@type"in O&&(t-=1),"@index"in O&&(t-=1),"@language"in O&&(t-=1),"@direction"in O&&(t-=1),0!==t)throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:O});const n=null===O["@value"]?[]:x(O["@value"]),i=S(O,"@type");if(m(e,1.1)&&i.includes("@json")&&1===i.length);else if(0===n.length)c.eventHandler&&I({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:O}},options:c}),O=null;else{if(!n.every((e=>a(e)||o(e)))&&"@language"in O)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:O});if(!i.every((e=>b(e)&&!(a(e)&&0===e.indexOf("_:"))||o(e))))throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:O})}}else if("@type"in O&&!i(O["@type"]))O["@type"]=[O["@type"]];else if("@set"in O||"@list"in O){if(k>1&&(2!==k||!("@index"in O)))throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:O});"@set"in O&&(O=O["@set"],w=Object.keys(O),k=w.length)}else 1===k&&"@language"in O&&(c.eventHandler&&I({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:O}},options:c}),O=null);return!s(O)||c.keepFreeFloatingNodes||u||null!==t&&"@graph"!==g&&!(p(e,t,"@container")||[]).includes("@graph")||(O=N({value:O,count:k,options:c})),O}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},4134:e=>{e.exports={ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,n)=>e.slice(t,n),Error,FunctionPrototypeCall:(e,t,...n)=>e.call(t,...n),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,n)=>Object.defineProperty(e,t,n),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,n)=>e.then(t,n),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,n)=>e.slice(t,n),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,n)=>e.set(t,n),Boolean,Uint8Array}},4147:(e,t,n)=>{const{SymbolDispose:r}=n(4134),{AbortError:i,codes:s}=n(6371),{isNodeStream:o,isWebStream:a,kControllerErrorFunction:l}=n(6115),c=n(6238),{ERR_INVALID_ARG_TYPE:u}=s;let d;e.exports.addAbortSignal=function(t,n){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!o(n)&&!a(n))throw new u("stream",["ReadableStream","WritableStream","Stream"],n);return e.exports.addAbortSignalNoValidate(t,n)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const s=o(t)?()=>{t.destroy(new i(void 0,{cause:e.reason}))}:()=>{t[l](new i(void 0,{cause:e.reason}))};if(e.aborted)s();else{d=d||n(7760).addAbortListener;const i=d(e,s);c(t,i[r])}return t}},4191:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerString=void 0;class n{fromRdf(e){return e.value}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e,t)}}t.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},4259:(e,t,n)=>{const{ArrayIsArray:r,ObjectSetPrototypeOf:i}=n(4134),{EventEmitter:s}=n(7007);function o(e){s.call(this,e)}function a(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}i(o.prototype,s.prototype),i(o,s),o.prototype.pipe=function(e,t){const n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",l),n.on("close",c));let o=!1;function l(){o||(o=!0,e.end())}function c(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){d(),0===s.listenerCount(this,"error")&&this.emit("error",e)}function d(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",l),n.removeListener("close",c),n.removeListener("error",u),e.removeListener("error",u),n.removeListener("end",d),n.removeListener("close",d),e.removeListener("close",d)}return a(n,"error",u),a(e,"error",u),n.on("end",d),n.on("close",d),e.on("close",d),e.emit("pipe",n),e},e.exports={Stream:o,prependListener:a}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},4802:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(92),t),i(n(7258),t),i(n(2406),t),i(n(6925),t),i(n(4191),t)},4840:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},4841:(e,t,n)=>{const r=n(989),i=n(701),s=n(9263),o=n(7034),a=s.IdentifierIssuer,l=n(2207),c=n(9749),u=n(8229),{expand:d}=n(4019),{flatten:h}=n(5229),{fromRDF:f}=n(3947),{toRDF:p}=n(9180),{frameMergedOrDefault:g,cleanupNull:y}=n(7946),{isArray:m,isObject:b,isString:v}=n(7382),{isSubjectReference:w}=n(3978),{expandIri:_,getInitialContext:x,process:S,processingMode:j}=n(1972),{compact:I,compactIri:E}=n(1058),{createNodeMap:N,createMergedNodeMap:T,mergeNodeMaps:R}=n(9233),{logEventHandler:O,logWarningEventHandler:k,safeEventHandler:L,setDefaultEventHandler:A,setupEventHandler:C,strictEventHandler:D,unhandledEventHandler:M}=n(2246),P=function(e){const t={},P=new c({max:100});function $(t,{documentLoader:n=e.documentLoader,...r}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:n},r,t,{eventHandler:C({options:t})})}return e.compact=async function(t,n,r){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(r=$(r,{base:v(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new a("_:b"),contextResolver:new o({sharedCache:P})})).link&&(r.skipExpansion=!0),r.compactToRelative||delete r.base,i=r.skipExpansion?t:await e.expand(t,r);const c=await e.processContext(x(r),n,r);let u=await I({activeCtx:c,element:i,options:r});r.compactArrays&&!r.graph&&m(u)?1===u.length?u=u[0]:0===u.length&&(u={}):r.graph&&b(u)&&(u=[u]),b(n)&&"@context"in n&&(n=n["@context"]),n=s.clone(n),m(n)||(n=[n]);const d=n;n=[];for(let e=0;e<d.length;++e)(!b(d[e])||Object.keys(d[e]).length>0)&&n.push(d[e]);const h=n.length>0;if(1===n.length&&(n=n[0]),m(u)){const e=E({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=u;u={},h&&(u["@context"]=n),u[e]=t}else if(b(u)&&h){const e=u;u={"@context":n};for(const t in e)u[t]=e[t]}return u},e.expand=async function(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const r={},i=[];if("expandContext"in(n=$(n,{keepFreeFloatingNodes:!1,contextResolver:new o({sharedCache:P})}))){const e=s.clone(n.expandContext);b(e)&&"@context"in e?r.expandContext=e:r.expandContext={"@context":e},i.push(r.expandContext)}let a;if(v(t)){const s=await e.get(t,n);a=s.documentUrl,r.input=s.document,s.contextUrl&&(r.remoteContext={"@context":s.contextUrl},i.push(r.remoteContext))}else r.input=s.clone(t);"base"in n||(n.base=a||"");let l=x(n);for(const e of i)l=await S({activeCtx:l,localCtx:e,options:n});let c=await d({activeCtx:l,element:r.input,options:n});return b(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),m(c)||(c=[c]),c},e.flatten=async function(t,n,r){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,r=$(r,{base:v(t)?t:"",contextResolver:new o({sharedCache:P})});const i=await e.expand(t,r),s=h(i);return null===n?s:(r.graph=!0,r.skipExpansion=!0,await e.compact(s,n,r))},e.frame=async function(t,n,r){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(r=$(r,{base:v(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new o({sharedCache:P})}),v(n)){const t=await e.get(n,r);if(n=t.document,t.contextUrl){let e=n["@context"];e?m(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const i=n&&n["@context"]||{},s=await e.processContext(x(r),i,r);r.hasOwnProperty("omitGraph")||(r.omitGraph=j(s,1.1)),r.hasOwnProperty("pruneBlankNodeIdentifiers")||(r.pruneBlankNodeIdentifiers=j(s,1.1));const a=await e.expand(t,r),l={...r};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(n,l),u=Object.keys(n).map((e=>_(s,e,{vocab:!0})));l.merged=!u.includes("@graph"),l.is11=j(s,1.1);const d=g(a,c,l);l.graph=!r.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let h=await e.compact(d,i,l);return l.link={},h=y(h,l),h},e.link=async function(t,n,r){const i={};return n&&(i["@context"]=n),i["@embed"]="@link",e.frame(t,i,r)},e.normalize=e.canonize=async function(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=$(n,{base:v(t)?t:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new o({sharedCache:P})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=u.parse(t);return r.canonize(e,n)}const i={...n};delete i.format,i.produceGeneralizedRdf=!1;const s=await e.toRDF(t,i);return r.canonize(s,n)},e.fromRDF=async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=$(n,{format:v(e)?"application/n-quads":void 0});const{format:r}=n;let{rdfParser:i}=n;if(r){if(i=i||t[r],!i)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:r})}else i=()=>e;const s=await i(e);return f(s,n)},e.toRDF=async function(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let r;r=(n=$(n,{base:v(t)?t:"",skipExpansion:!1,contextResolver:new o({sharedCache:P})})).skipExpansion?t:await e.expand(t,n);const i=p(r,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return u.serialize(i);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return i},e.createNodeMap=async function(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=$(n,{base:v(t)?t:"",contextResolver:new o({sharedCache:P})});const r=await e.expand(t,n);return T(r,n)},e.merge=async function(t,n,r){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!m(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,r=$(r,{contextResolver:new o({sharedCache:P})});const i=await Promise.all(t.map((t=>{const n={...r};return e.expand(t,n)})));let l=!0;"mergeNodes"in r&&(l=r.mergeNodes);const c=r.issuer||new a("_:b"),u={"@default":{}};for(let e=0;e<i.length;++e){const t=s.relabelBlankNodes(i[e],{issuer:new a("_:b"+e+"-")}),n=l||0===e?u:{"@default":{}};if(N(t,n,"@default",c),n!==u)for(const e in n){const t=n[e];if(!(e in u)){u[e]=t;continue}const r=u[e];for(const e in t)e in r||(r[e]=t[e])}}const d=R(u),h=[],f=Object.keys(d).sort();for(let e=0;e<f.length;++e){const t=d[f[e]];w(t)||h.push(t)}return null===n?h:(r.graph=!0,r.skipExpansion=!0,await e.compact(h,n,r))},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,n){let r;r="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const i=await r(t);try{if(!i.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");v(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new l("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,n){return n=$(n,{base:"",contextResolver:new o({sharedCache:P})}),null===t?x(n):(t=s.clone(t),b(t)&&"@context"in t||(t={"@context":t}),S({activeCtx:e,localCtx:t,options:n}))},e.getContextValue=n(1972).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,n){t[e]=n},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",u.parse),e.registerRDFParser("application/nquads",u.parse),e.url=n(470),e.logEventHandler=O,e.logWarningEventHandler=k,e.safeEventHandler=L,e.setDefaultEventHandler=A,e.strictEventHandler=D,e.unhandledEventHandler=M,e.util=s,Object.assign(e,s),e.promises=e,e.RequestQueue=n(3743),e.JsonLdProcessor=n(5445)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},$=function(){return P((function(){return $()}))};P($),e.exports=$},4878:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;class n{constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&"DefaultGraph"===e.termType}}t.DefaultGraph=n,n.INSTANCE=new n},5001:(e,t,n)=>{const{ObjectSetPrototypeOf:r,Symbol:i}=n(4134);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:s}=n(6371).codes,o=n(3370),{getHighWaterMark:a}=n(5291);r(c.prototype,o.prototype),r(c,o);const l=i("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),o.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush(((t,n)=>{t?e?e(t):this.destroy(t):(null!=n&&this.push(n),this.push(null),e&&e())}))}function d(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,n){throw new s("_transform()")},c.prototype._write=function(e,t,n){const r=this._readableState,i=this._writableState,s=r.length;this._transform(e,t,((e,t)=>{e?n(e):(null!=t&&this.push(t),i.ended||s===r.length||r.length<r.highWaterMark?n():this[l]=n)}))},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},5003:(e,t,n)=>{var r=n(8287),i=r.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},5229:(e,t,n)=>{const{isSubjectReference:r}=n(3978),{createMergedNodeMap:i}=n(9233),s={};e.exports=s,s.flatten=e=>{const t=i(e),n=[],s=Object.keys(t).sort();for(let e=0;e<s.length;++e){const i=t[s[e]];r(i)||n.push(i)}return n}},5291:(e,t,n)=>{const{MathFloor:r,NumberIsInteger:i}=n(4134),{validateInteger:s}=n(277),{ERR_INVALID_ARG_VALUE:o}=n(6371).codes;let a=16384,l=16;function c(e){return e?l:a}e.exports={getHighWaterMark:function(e,t,n,s){const a=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,s,n);if(null!=a){if(!i(a)||a<0)throw new o(s?`options.${n}`:"options.highWaterMark",a);return r(a)}return c(e.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(e,t){s(t,"value",0),e?l=t:a=t}}},5445:e=>{e.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},5448:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5506:(e,t,n)=>{const{Buffer:r}=n(8287),{ObjectDefineProperty:i,ObjectKeys:s,ReflectApply:o}=n(4134),{promisify:{custom:a}}=n(7760),{streamReturningOperators:l,promiseReturningOperators:c}=n(823),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=n(6371),d=n(7830),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:f}=n(5291),{pipeline:p}=n(7758),{destroyer:g}=n(5896),y=n(6238),m=n(3095),b=n(6115),v=e.exports=n(4259).Stream;v.isDestroyed=b.isDestroyed,v.isDisturbed=b.isDisturbed,v.isErrored=b.isErrored,v.isReadable=b.isReadable,v.isWritable=b.isWritable,v.Readable=n(7576);for(const _ of s(l)){const x=l[_];function S(...e){if(new.target)throw u();return v.Readable.from(o(x,this,e))}i(S,"name",{__proto__:null,value:x.name}),i(S,"length",{__proto__:null,value:x.length}),i(v.Readable.prototype,_,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}for(const j of s(c)){const I=c[j];function E(...e){if(new.target)throw u();return o(I,this,e)}i(E,"name",{__proto__:null,value:I.name}),i(E,"length",{__proto__:null,value:I.length}),i(v.Readable.prototype,j,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}v.Writable=n(8584),v.Duplex=n(3370),v.Transform=n(5001),v.PassThrough=n(6524),v.pipeline=p;const{addAbortSignal:w}=n(4147);v.addAbortSignal=w,v.finished=y,v.destroy=g,v.compose=d,v.setDefaultHighWaterMark=h,v.getDefaultHighWaterMark=f,i(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>m}),i(p,a,{__proto__:null,enumerable:!0,get:()=>m.pipeline}),i(y,a,{__proto__:null,enumerable:!0,get:()=>m.finished}),v.Stream=v,v._isUint8Array=function(e){return e instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}},5568:e=>{const{AbortController:t,AbortSignal:n}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=n,e.exports.default=t},5606:e=>{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,l=[],c=!1,u=-1;function d(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=o(d);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||c||o(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},5896:(e,t,n)=>{const r=n(5606),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:s},AbortError:o}=n(6371),{Symbol:a}=n(4134),{kIsDestroyed:l,isDestroyed:c,isFinished:u,isServerRequest:d}=n(6115),h=a("kDestroy"),f=a("kConstruct");function p(e,t,n){e&&(e.stack,t&&!t.errored&&(t.errored=e),n&&!n.errored&&(n.errored=e))}function g(e,t,n){let i=!1;function s(t){if(i)return;i=!0;const s=e._readableState,o=e._writableState;p(t,o,s),o&&(o.closed=!0),s&&(s.closed=!0),"function"==typeof n&&n(t),t?r.nextTick(y,e,t):r.nextTick(m,e)}try{e._destroy(t||null,s)}catch(t){s(t)}}function y(e,t){b(e,t),m(e)}function m(e){const t=e._readableState,n=e._writableState;n&&(n.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=n&&n.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function b(e,t){const n=e._readableState,r=e._writableState;null!=r&&r.errorEmitted||null!=n&&n.errorEmitted||(r&&(r.errorEmitted=!0),n&&(n.errorEmitted=!0),e.emit("error",t))}function v(e,t,n){const i=e._readableState,s=e._writableState;if(null!=s&&s.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=s&&s.autoDestroy?e.destroy(t):t&&(t.stack,s&&!s.errored&&(s.errored=t),i&&!i.errored&&(i.errored=t),n?r.nextTick(b,e,t):b(e,t))}function w(e){let t=!1;function n(n){if(t)return void v(e,null!=n?n:new s);t=!0;const i=e._readableState,o=e._writableState,a=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),a.destroyed?e.emit(h,n):n?v(e,n,!0):r.nextTick(_,e)}try{e._construct((e=>{r.nextTick(n,e)}))}catch(e){r.nextTick(n,e)}}function _(e){e.emit(f)}function x(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function S(e){e.emit("close")}function j(e,t){e.emit("error",t),r.nextTick(S,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const n=e._readableState,i=e._writableState;n&&(n.constructed=!1),i&&(i.constructed=!1),e.once(f,t),e.listenerCount(f)>1||r.nextTick(w,e)},destroyer:function(e,t){e&&!c(e)&&(t||u(e)||(t=new o),d(e)?(e.socket=null,e.destroy(t)):x(e)?e.abort():x(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?r.nextTick(j,e,t):r.nextTick(S,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const n=this._readableState,r=this._writableState,s=r||n;return null!=r&&r.destroyed||null!=n&&n.destroyed?("function"==typeof t&&t(),this):(p(e,r,n),r&&(r.destroyed=!0),n&&(n.destroyed=!0),s.constructed?g(this,e,t):this.once(h,(function(n){g(this,i(n,e),t)})),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:v}},6115:(e,t,n)=>{const{SymbolAsyncIterator:r,SymbolIterator:i,SymbolFor:s}=n(4134),o=s("nodejs.stream.destroyed"),a=s("nodejs.stream.errored"),l=s("nodejs.stream.readable"),c=s("nodejs.stream.writable"),u=s("nodejs.stream.disturbed"),d=s("nodejs.webstream.isClosedPromise"),h=s("nodejs.webstream.controllerErrorFunction");function f(e,t=!1){var n;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(n=e._readableState)||void 0===n?void 0:n.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function g(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function y(e){return!(!e||g(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function m(e){return!(!e||g(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function b(e){return!(!e||g(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function v(e){if(!g(e))return null;const t=e._writableState,n=e._readableState,r=t||n;return!!(e.destroyed||e[o]||null!=r&&r.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function _(e,t){if(!f(e))return null;const n=e._readableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.endEmitted)?null:!!(n.endEmitted||!1===t&&!0===n.ended&&0===n.length))}function x(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!v(e)&&f(e)&&e.readable&&!_(e)}function S(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!v(e)&&p(e)&&e.writable&&!w(e)}function j(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function I(e){return"boolean"==typeof e._sent100&&j(e)}e.exports={isDestroyed:v,kIsDestroyed:o,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,n,r,i,s,o,l,c,u,d;return!(!e||!(null!==(t=null!==(n=null!==(r=null!==(i=null!==(s=null!==(o=e[a])&&void 0!==o?o:e.readableErrored)&&void 0!==s?s:e.writableErrored)&&void 0!==i?i:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==r?r:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==n?n:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(d=e._writableState)||void 0===d?void 0:d.errored))},kIsErrored:a,isReadable:x,kIsReadable:l,kIsClosedPromise:d,kControllerErrorFunction:h,kIsWritable:c,isClosed:function(e){if(!g(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,n=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==n?void 0:n.closed)?(null==t?void 0:t.closed)||(null==n?void 0:n.closed):"boolean"==typeof e._closed&&j(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return g(e)?!(!v(e)&&(!1!==(null==t?void 0:t.readable)&&x(e)||!1!==(null==t?void 0:t.writable)&&S(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[r]:!1===t?"function"==typeof e[i]:"function"==typeof e[r]||"function"==typeof e[i])},isReadableNodeStream:f,isReadableStream:y,isReadableEnded:function(e){if(!f(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:_,isReadableErrored:function(e){var t,n;return g(e)?e.readableErrored?e.readableErrored:null!==(t=null===(n=e._readableState)||void 0===n?void 0:n.errored)&&void 0!==t?t:null:null},isNodeStream:g,isWebStream:function(e){return y(e)||m(e)||b(e)},isWritable:S,isWritableNodeStream:p,isWritableStream:m,isWritableEnded:w,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;const n=e._writableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.finished)?null:!!(n.finished||!1===t&&!0===n.ended&&0===n.length))},isWritableErrored:function(e){var t,n;return g(e)?e.writableErrored?e.writableErrored:null!==(t=null===(n=e._writableState)||void 0===n?void 0:n.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:I,willEmitClose:function(e){if(!g(e))return null;const t=e._writableState,n=e._readableState,r=t||n;return!r&&I(e)||!!(r&&r.autoDestroy&&r.emitClose&&!1===r.closed)},isTransformStream:b}},6238:(e,t,n)=>{const r=n(5606),{AbortError:i,codes:s}=n(6371),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:a}=s,{kEmptyObject:l,once:c}=n(7760),{validateAbortSignal:u,validateFunction:d,validateObject:h,validateBoolean:f}=n(277),{Promise:p,PromisePrototypeThen:g,SymbolDispose:y}=n(4134),{isClosed:m,isReadable:b,isReadableNodeStream:v,isReadableStream:w,isReadableFinished:_,isReadableErrored:x,isWritable:S,isWritableNodeStream:j,isWritableStream:I,isWritableFinished:E,isWritableErrored:N,isNodeStream:T,willEmitClose:R,kIsClosedPromise:O}=n(6115);let k;const L=()=>{};function A(e,t,s){var f,p;if(2===arguments.length?(s=t,t=l):null==t?t=l:h(t,"options"),d(s,"callback"),u(t.signal,"options.signal"),s=c(s),w(e)||I(e))return function(e,t,s){let o=!1,a=L;if(t.signal)if(a=()=>{o=!0,s.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)r.nextTick(a);else{k=k||n(7760).addAbortListener;const r=k(t.signal,a),i=s;s=c(((...t)=>{r[y](),i.apply(e,t)}))}const l=(...t)=>{o||r.nextTick((()=>s.apply(e,t)))};return g(e[O].promise,l,l),L}(e,t,s);if(!T(e))throw new o("stream",["ReadableStream","WritableStream","Stream"],e);const A=null!==(f=t.readable)&&void 0!==f?f:v(e),C=null!==(p=t.writable)&&void 0!==p?p:j(e),D=e._writableState,M=e._readableState,P=()=>{e.writable||F()};let $=R(e)&&v(e)===A&&j(e)===C,B=E(e,!1);const F=()=>{B=!0,e.destroyed&&($=!1),(!$||e.readable&&!A)&&(A&&!q||s.call(e))};let q=_(e,!1);const U=()=>{q=!0,e.destroyed&&($=!1),(!$||e.writable&&!C)&&(C&&!B||s.call(e))},G=t=>{s.call(e,t)};let H=m(e);const V=()=>{H=!0;const t=N(e)||x(e);return t&&"boolean"!=typeof t?s.call(e,t):A&&!q&&v(e,!0)&&!_(e,!1)?s.call(e,new a):!C||B||E(e,!1)?void s.call(e):s.call(e,new a)},z=()=>{H=!0;const t=N(e)||x(e);if(t&&"boolean"!=typeof t)return s.call(e,t);s.call(e)},W=()=>{e.req.on("finish",F)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?C&&!D&&(e.on("end",P),e.on("close",P)):(e.on("complete",F),$||e.on("abort",V),e.req?W():e.on("request",W)),$||"boolean"!=typeof e.aborted||e.on("aborted",V),e.on("end",U),e.on("finish",F),!1!==t.error&&e.on("error",G),e.on("close",V),H?r.nextTick(V):null!=D&&D.errorEmitted||null!=M&&M.errorEmitted?$||r.nextTick(z):(A||$&&!b(e)||!B&&!1!==S(e))&&(C||$&&!S(e)||!q&&!1!==b(e))?M&&e.req&&e.aborted&&r.nextTick(z):r.nextTick(z);const J=()=>{s=L,e.removeListener("aborted",V),e.removeListener("complete",F),e.removeListener("abort",V),e.removeListener("request",W),e.req&&e.req.removeListener("finish",F),e.removeListener("end",P),e.removeListener("close",P),e.removeListener("finish",F),e.removeListener("end",U),e.removeListener("error",G),e.removeListener("close",V)};if(t.signal&&!H){const o=()=>{const n=s;J(),n.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)r.nextTick(o);else{k=k||n(7760).addAbortListener;const r=k(t.signal,o),i=s;s=c(((...t)=>{r[y](),i.apply(e,t)}))}}return J}e.exports=A,e.exports.finished=function(e,t){var n;let r=!1;return null===t&&(t=l),null!==(n=t)&&void 0!==n&&n.cleanup&&(f(t.cleanup,"cleanup"),r=t.cleanup),new p(((n,i)=>{const s=A(e,t,(e=>{r&&s(),e?i(e):n()}))}))}},6371:(e,t,n)=>{const{format:r,inspect:i,AggregateError:s}=n(7760),o=globalThis.AggregateError||s,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,u={};function d(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function f(e,t,n){n||(n=Error);class i extends n{constructor(...n){super(function(e,t,n){if("function"==typeof t)return d(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);const i=(t.match(/%[dfijoOs]/g)||[]).length;return d(i===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${i}).`),0===n.length?t:r(t,...n)}(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[a]=!0,u[e]=i}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class g extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}f("ERR_ASSERTION","%s",Error),f("ERR_INVALID_ARG_TYPE",((e,t,n)=>{d("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let r="The ";e.endsWith(" argument")?r+=`${e} `:r+=`"${e}" ${e.includes(".")?"property":"argument"} `,r+="must be ";const s=[],o=[],a=[];for(const e of t)d("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?s.push(e.toLowerCase()):c.test(e)?o.push(e):(d("object"!==e,'The value "object" should be written as "Object"'),a.push(e));if(o.length>0){const e=s.indexOf("object");-1!==e&&(s.splice(s,e,1),o.push("Object"))}if(s.length>0){switch(s.length){case 1:r+=`of type ${s[0]}`;break;case 2:r+=`one of type ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();r+=`one of type ${s.join(", ")}, or ${e}`}}(o.length>0||a.length>0)&&(r+=" or ")}if(o.length>0){switch(o.length){case 1:r+=`an instance of ${o[0]}`;break;case 2:r+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();r+=`an instance of ${o.join(", ")}, or ${e}`}}a.length>0&&(r+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(r+="an "),r+=`${a[0]}`;break;case 2:r+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();r+=`one of ${a.join(", ")}, or ${e}`}}if(null==n)r+=`. Received ${n}`;else if("function"==typeof n&&n.name)r+=`. Received function ${n.name}`;else if("object"==typeof n){var u;null!==(u=n.constructor)&&void 0!==u&&u.name?r+=`. Received an instance of ${n.constructor.name}`:r+=`. Received ${i(n,{depth:-1})}`}else{let e=i(n,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),r+=`. Received type ${typeof n} (${e})`}return r}),TypeError),f("ERR_INVALID_ARG_VALUE",((e,t,n="is invalid")=>{let r=i(t);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${n}. Received ${r}`}),TypeError),f("ERR_INVALID_RETURN_VALUE",((e,t,n)=>{var r;return`Expected ${e} to be returned from the "${t}" function but got ${null!=n&&null!==(r=n.constructor)&&void 0!==r&&r.name?`instance of ${n.constructor.name}`:"type "+typeof n}.`}),TypeError),f("ERR_MISSING_ARGS",((...e)=>{let t;d(e.length>0,"At least one arg needs to be specified");const n=e.length;switch(e=(Array.isArray(e)?e:[e]).map((e=>`"${e}"`)).join(" or "),n){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}}return`${t} must be specified`}),TypeError),f("ERR_OUT_OF_RANGE",((e,t,n)=>{let r;return d(t,'Missing "range" argument'),Number.isInteger(n)&&Math.abs(n)>2**32?r=h(String(n)):"bigint"==typeof n?(r=String(n),(n>2n**32n||n<-(2n**32n))&&(r=h(r)),r+="n"):r=i(n),`The value of "${e}" is out of range. It must be ${t}. Received ${r}`}),RangeError),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),f("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),f("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),f("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),f("ERR_STREAM_WRITE_AFTER_END","write after end",Error),f("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:g,aggregateTwoErrors:p((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const n=new o([t,e],t.message);return n.code=t.code,n}return e||t})),hideStackFrames:p,codes:u}},6524:(e,t,n)=>{const{ObjectSetPrototypeOf:r}=n(4134);e.exports=s;const i=n(5001);function s(e){if(!(this instanceof s))return new s(e);i.call(this,e)}r(s.prototype,i.prototype),r(s,i),s.prototype._transform=function(e,t,n){n(null,e)}},6532:(e,t,n)=>{const r=n(5606),{PromisePrototypeThen:i,SymbolAsyncIterator:s,SymbolIterator:o}=n(4134),{Buffer:a}=n(8287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:c}=n(6371).codes;e.exports=function(e,t,n){let u,d;if("string"==typeof t||t instanceof a)return new e({objectMode:!0,...n,read(){this.push(t),this.push(null)}});if(t&&t[s])d=!0,u=t[s]();else{if(!t||!t[o])throw new l("iterable",["Iterable"],t);d=!1,u=t[o]()}const h=new e({objectMode:!0,highWaterMark:1,...n});let f=!1;return h._read=function(){f||(f=!0,async function(){for(;;){try{const{value:e,done:t}=d?await u.next():u.next();if(t)h.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw f=!1,new c;if(h.push(t))continue;f=!1}}catch(e){h.destroy(e)}break}}())},h._destroy=function(e,t){i(async function(e){const t=null!=e,n="function"==typeof u.throw;if(t&&n){const{value:t,done:n}=await u.throw(e);if(await t,n)return}if("function"==typeof u.return){const{value:e}=await u.return();await e}}(e),(()=>r.nextTick(t,e)),(n=>r.nextTick(t,n||e)))},h}},6706:(e,t,n)=>{const r=n(5606),i=n(8287),{isReadable:s,isWritable:o,isIterable:a,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:d,isReadableStream:h,isWritableStream:f}=n(6115),p=n(6238),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:m}}=n(6371),{destroyer:b}=n(5896),v=n(3370),w=n(7576),_=n(8584),{createDeferredPromise:x}=n(7760),S=n(6532),j=globalThis.Blob||i.Blob,I=void 0!==j?function(e){return e instanceof j}:function(e){return!1},E=globalThis.AbortController||n(5568).AbortController,{FunctionPrototypeCall:N}=n(4134);class T extends v{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function R(e){const t=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,n=e.writable;let r,i,a,l,c,u=!!s(t),d=!!o(n);function h(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new T({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==n||!n.writableObjectMode),readable:u,writable:d}),d&&(p(n,(e=>{d=!1,e&&b(t,e),h(e)})),c._write=function(e,t,i){n.write(e,t)?i():r=i},c._final=function(e){n.end(),i=e},n.on("drain",(function(){if(r){const e=r;r=null,e()}})),n.on("finish",(function(){if(i){const e=i;i=null,e()}}))),u&&(p(t,(e=>{u=!1,e&&b(t,e),h(e)})),t.on("readable",(function(){if(a){const e=a;a=null,e()}})),t.on("end",(function(){c.push(null)})),c._read=function(){for(;;){const e=t.read();if(null===e)return void(a=c._read);if(!c.push(e))return}}),c._destroy=function(e,s){e||null===l||(e=new g),a=null,r=null,i=null,null===l?s(e):(l=s,b(n,e),b(t,e))},c}e.exports=function e(t,n){if(d(t))return t;if(c(t))return R({readable:t});if(u(t))return R({writable:t});if(l(t))return R({writable:!1,readable:!1});if(h(t))return R({readable:w.fromWeb(t)});if(f(t))return R({writable:_.fromWeb(t)});if("function"==typeof t){const{value:e,write:i,final:s,destroy:o}=function(e){let{promise:t,resolve:n}=x();const i=new E,s=i.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:i,done:o,cb:a}=await e;if(r.nextTick(a),o)return;if(s.aborted)throw new g(void 0,{cause:s.reason});({promise:t,resolve:n}=x()),yield i}}(),{signal:s}),write(e,t,r){const i=n;n=null,i({chunk:e,done:!1,cb:r})},final(e){const t=n;n=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(a(e))return S(T,e,{objectMode:!0,write:i,final:s,destroy:o});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const n=N(l,e,(e=>{if(null!=e)throw new m("nully","body",e)}),(e=>{b(t,e)}));return t=new T({objectMode:!0,readable:!1,write:i,final(e){s((async()=>{try{await n,r.nextTick(e,null)}catch(t){r.nextTick(e,t)}}))},destroy:o})}throw new m("Iterable, AsyncIterable or AsyncFunction",n,e)}if(I(t))return e(t.arrayBuffer());if(a(t))return S(T,t,{objectMode:!0,writable:!1});if(h(null==t?void 0:t.readable)&&f(null==t?void 0:t.writable))return T.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return R({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const i=null==t?void 0:t.then;if("function"==typeof i){let e;return N(i,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{b(e,t)})),e=new T({objectMode:!0,writable:!1,read(){}})}throw new y(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},6925:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberInteger=void 0;const r=n(103);class i{fromRdf(e,t){const n=parseInt(e.value,10);return t&&(isNaN(n)||e.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(String(e),t||(e<=i.MAX_INT&&e>=i.MIN_INT?n.namedNode(i.TYPES[0]):n.namedNode(i.TYPES[1])))}}t.TypeHandlerNumberInteger=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648},6957:(e,t,n)=>{const{parseLinkHeader:r,buildHeaders:i}=n(9263),{LINK_HEADER_CONTEXT:s}=n(9378),o=n(2207),a=n(3743),{prependBase:l}=n(470),c=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:n}={headers:{}})=>(t=i(t),(new a).wrapLoader((async function i(a){if(0!==a.indexOf("http:")&&0!==a.indexOf("https:"))throw new o('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:a});if(e&&0!==a.indexOf("https"))throw new o('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:a});let u;try{u=await function(e,t,n){const r=new(e=e||XMLHttpRequest);return new Promise(((e,i)=>{r.onload=()=>e(r),r.onerror=e=>i(e),r.open("GET",t,!0);for(const e in n)r.setRequestHeader(e,n[e]);r.send()}))}(n,a,t)}catch(e){throw new o("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:a,cause:e})}if(u.status>=400)throw new o("URL could not be dereferenced: "+u.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:a,httpStatusCode:u.status});let d={contextUrl:null,documentUrl:a,document:u.response},h=null;const f=u.getResponseHeader("Content-Type");let p;if(c.test(u.getAllResponseHeaders())&&(p=u.getResponseHeader("Link")),p&&"application/ld+json"!==f){const e=r(p),t=e[s];if(Array.isArray(t))throw new o("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:a});t&&(d.contextUrl=t.target),h=e.alternate,h&&"application/ld+json"==h.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(d=await i(l(a,h.target)))}return d})))},7007:e=>{var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,s,o,c;if(a(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=l(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(s){r.once&&e.removeEventListener(t,i),n(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var c=l.length,u=p(l,c);for(n=0;n<c;++n)r(u[n],this,t)}return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,s,o;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7034:(e,t,n)=>{const{isArray:r,isObject:i,isString:s}=n(7382),{asArray:o}=n(9263),{prependBase:a}=n(470),l=n(2207),c=n(7532);function u(e){throw new l("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function d({context:e,base:t}){if(!e)return;const n=e["@context"];if(s(n))e["@context"]=a(t,n);else if(r(n))for(let e=0;e<n.length;++e){const r=n[e];s(r)?n[e]=a(t,r):i(r)&&d({context:{"@context":r},base:t})}else if(i(n))for(const e in n)d({context:n[e],base:t})}e.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:n,base:a,cycles:l=new Set}){t&&i(t)&&t["@context"]&&(t=t["@context"]),t=o(t);const d=[];for(const o of t){if(s(o)){let t=this._get(o);t||(t=await this._resolveRemoteContext({activeCtx:e,url:o,documentLoader:n,base:a,cycles:l})),r(t)?d.push(...t):d.push(t);continue}if(null===o){d.push(new c({document:null}));continue}i(o)||u(t);const h=JSON.stringify(o);let f=this._get(h);f||(f=new c({document:o}),this._cacheResolvedContext({key:h,resolved:f,tag:"static"})),d.push(f)}return d}_get(e){let t=this.perOpCache.get(e);if(!t){const n=this.sharedCache.get(e);n&&(t=n.get("static"),t&&this.perOpCache.set(e,t))}return t}_cacheResolvedContext({key:e,resolved:t,tag:n}){if(this.perOpCache.set(e,t),void 0!==n){let r=this.sharedCache.get(e);r||(r=new Map,this.sharedCache.set(e,r)),r.set(n,t)}return t}async _resolveRemoteContext({activeCtx:e,url:t,documentLoader:n,base:r,cycles:i}){t=a(r,t);const{context:s,remoteDoc:o}=await this._fetchContext({activeCtx:e,url:t,documentLoader:n,cycles:i});d({context:s,base:r=o.documentUrl||t});const l=await this.resolve({activeCtx:e,context:s,documentLoader:n,base:r,cycles:i});return this._cacheResolvedContext({key:t,resolved:l,tag:o.tag}),l}async _fetchContext({activeCtx:e,url:t,documentLoader:n,cycles:o}){if(o.size>10)throw new l("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(o.has(t))throw new l("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let a,c;o.add(t);try{c=await n(t),a=c.document||null,s(a)&&(a=JSON.parse(a))}catch(e){throw new l(`Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context. URL: "${t}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:e})}if(!i(a))throw new l(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${t}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:t});return a="@context"in a?{"@context":a["@context"]}:{"@context":{}},c.contextUrl&&(r(a["@context"])||(a["@context"]=[a["@context"]]),a["@context"].push(c.contextUrl)),{context:a,remoteDoc:c}}}},7258:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerDate=void 0;const r=n(103);class i{fromRdf(e,t){switch(t&&!e.value.match(i.VALIDATORS[e.datatype.value.substr(33,e.datatype.value.length)])&&r.Translator.incorrectRdfDataType(e),e.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(e.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const t=e.value.split("-");return new Date(0,parseInt(t[0],10)-1,parseInt(t[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(e.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(e.value+"-01");default:return new Date(e.value)}}toRdf(e,{datatype:t,dataFactory:n}){if(t=t||n.namedNode(i.TYPES[0]),!(e instanceof Date))return null;const r=e;let s;switch(t.value){case"http://www.w3.org/2001/XMLSchema#gDay":s=String(r.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":s=r.getUTCMonth()+1+"-"+r.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":s=String(r.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":s=r.getUTCFullYear()+"-"+(r.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":s=r.toISOString().replace(/T.*$/,"");break;default:s=r.toISOString()}return n.literal(s,t)}}t.TypeHandlerDate=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],i.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/}},7265:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0,t.Variable=class{constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}},7382:e=>{const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},7526:(e,t)=>{t.byteLength=function(e){var t=a(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,s=a(e),o=s[0],l=s[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,o,l)),u=0,d=l>0?o-4:o;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,s=[],o=16383,a=0,c=r-i;a<c;a+=o)s.push(l(e,a,a+o>c?c:a+o));return 1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),s.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=s[o],r[s.charCodeAt(o)]=o;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,r){for(var i,s,o=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},7532:(e,t,n)=>{const r=n(9749);e.exports=class{constructor({document:e}){this.document=e,this.cache=new r({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},7576:(e,t,n)=>{const r=n(5606),{ArrayPrototypeIndexOf:i,NumberIsInteger:s,NumberIsNaN:o,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:u,Promise:d,SafeSet:h,SymbolAsyncDispose:f,SymbolAsyncIterator:p,Symbol:g}=n(4134);e.exports=W,W.ReadableState=z;const{EventEmitter:y}=n(7007),{Stream:m,prependListener:b}=n(4259),{Buffer:v}=n(8287),{addAbortSignal:w}=n(4147),_=n(6238);let x=n(7760).debuglog("stream",(e=>{x=e}));const S=n(345),j=n(5896),{getHighWaterMark:I,getDefaultHighWaterMark:E}=n(5291),{aggregateTwoErrors:N,codes:{ERR_INVALID_ARG_TYPE:T,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_OUT_OF_RANGE:O,ERR_STREAM_PUSH_AFTER_EOF:k,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:L},AbortError:A}=n(6371),{validateObject:C}=n(277),D=g("kPaused"),{StringDecoder:M}=n(3141),P=n(6532);u(W.prototype,m.prototype),u(W,m);const $=()=>{},{errorOrDestroy:B}=j,F=1,q=16,U=32,G=2048,H=4096;function V(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function z(e,t,r){"boolean"!=typeof r&&(r=t instanceof n(3370)),this.state=G|H|q|U,e&&e.objectMode&&(this.state|=F),r&&e&&e.readableObjectMode&&(this.state|=F),this.highWaterMark=e?I(this,e,"readableHighWaterMark",r):E(!1),this.buffer=new S,this.length=0,this.pipes=[],this.flowing=null,this[D]=null,e&&!1===e.emitClose&&(this.state&=~G),e&&!1===e.autoDestroy&&(this.state&=~H),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new M(e.encoding),this.encoding=e.encoding)}function W(e){if(!(this instanceof W))return new W(e);const t=this instanceof n(3370);this._readableState=new z(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&w(e.signal,this)),m.call(this,e),j.construct(this,(()=>{this._readableState.needReadable&&Z(this,this._readableState)}))}function J(e,t,n,r){x("readableAddChunk",t);const i=e._readableState;let s;if(0===(i.state&F)&&("string"==typeof t?(n=n||i.defaultEncoding,i.encoding!==n&&(r&&i.encoding?t=v.from(t,n).toString(i.encoding):(t=v.from(t,n),n=""))):t instanceof v?n="":m._isUint8Array(t)?(t=m._uint8ArrayToBuffer(t),n=""):null!=t&&(s=new T("chunk",["string","Buffer","Uint8Array"],t))),s)B(e,s);else if(null===t)i.state&=-9,function(e,t){if(x("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?K(e):(t.needReadable=!1,t.emittedReadable=!0,Y(e))}}(e,i);else if(0!==(i.state&F)||t&&t.length>0)if(r)if(4&i.state)B(e,new L);else{if(i.destroyed||i.errored)return!1;Q(e,i,t,!0)}else if(i.ended)B(e,new k);else{if(i.destroyed||i.errored)return!1;i.state&=-9,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||0!==t.length?Q(e,i,t,!1):Z(e,i)):Q(e,i,t,!1)}else r||(i.state&=-9,Z(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function Q(e,t,n,r){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(65536&t.state?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),64&t.state&&K(e)),Z(e,t)}function X(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&F)?1:o(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function K(e){const t=e._readableState;x("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(x("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(Y,e))}function Y(e){const t=e._readableState;x("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ie(e)}function Z(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,r.nextTick(ee,e,t))}function ee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const n=t.length;if(x("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function te(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[D]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function ne(e){x("readable nexttick read 0"),e.read(0)}function re(e,t){x("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ie(e),t.flowing&&!t.reading&&e.read(0)}function ie(e){const t=e._readableState;for(x("flow",t.flowing);t.flowing&&null!==e.read(););}function se(e,t){"function"!=typeof e.read&&(e=W.wrap(e,{objectMode:!0}));const n=async function*(e,t){let n,r=$;function i(t){this===e?(r(),r=$):r=t}e.on("readable",i);const s=_(e,{writable:!1},(e=>{n=e?N(n,e):null,r(),r=$}));try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(n)throw n;if(null===n)return;await new d(i)}}}catch(e){throw n=N(n,e),n}finally{!n&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==n&&!e._readableState.autoDestroy?(e.off("readable",i),s()):j.destroyer(e,null)}}(e,t);return n.stream=e,n}function oe(e,t){if(0===t.length)return null;let n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function ae(e){const t=e._readableState;x("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(le,t,e))}function le(e,t){if(x("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)r.nextTick(ce,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ce(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ue;function de(){return void 0===ue&&(ue={}),ue}l(z.prototype,{objectMode:V(F),ended:V(2),endEmitted:V(4),reading:V(8),constructed:V(q),sync:V(U),needReadable:V(64),emittedReadable:V(128),readableListening:V(256),resumeScheduled:V(512),errorEmitted:V(1024),emitClose:V(G),autoDestroy:V(H),destroyed:V(8192),closed:V(16384),closeEmitted:V(32768),multiAwaitDrain:V(65536),readingMore:V(1<<17),dataEmitted:V(1<<18)}),W.prototype.destroy=j.destroy,W.prototype._undestroy=j.undestroy,W.prototype._destroy=function(e,t){t(e)},W.prototype[y.captureRejectionSymbol]=function(e){this.destroy(e)},W.prototype[f]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new A,this.destroy(e)),new d(((t,n)=>_(this,(r=>r&&r!==e?n(r):t(null)))))},W.prototype.push=function(e,t){return J(this,e,t,!1)},W.prototype.unshift=function(e,t){return J(this,e,t,!0)},W.prototype.isPaused=function(){const e=this._readableState;return!0===e[D]||!1===e.flowing},W.prototype.setEncoding=function(e){const t=new M(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const n=this._readableState.buffer;let r="";for(const e of n)r+=t.write(e);return n.clear(),""!==r&&n.push(r),this._readableState.length=r.length,this},W.prototype.read=function(e){x("read",e),void 0===e?e=NaN:s(e)||(e=a(e,10));const t=this._readableState,n=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new O("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return x("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ae(this):K(this),null;if(0===(e=X(e,t))&&t.ended)return 0===t.length&&ae(this),null;let r,i=!!(64&t.state);if(x("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,x("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,x("reading, ended or constructing",i);else if(i){x("do read"),t.state|=8|U,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){B(this,e)}t.state&=~U,t.reading||(e=X(n,t))}return r=e>0?oe(e,t):null,null===r?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&ae(this)),null===r||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",r)),r},W.prototype._read=function(e){throw new R("_read()")},W.prototype.pipe=function(e,t){const n=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new h(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),x("pipe count=%d opts=%j",i.pipes.length,t);const s=t&&!1===t.end||e===r.stdout||e===r.stderr?g:o;function o(){x("onend"),e.end()}let a;i.endEmitted?r.nextTick(s):n.once("end",s),e.on("unpipe",(function t(r,s){x("onunpipe"),r===n&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,x("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",d),e.removeListener("unpipe",t),n.removeListener("end",o),n.removeListener("end",g),n.removeListener("data",u),l=!0,a&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())}));let l=!1;function c(){l||(1===i.pipes.length&&i.pipes[0]===e?(x("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(x("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),n.pause()),a||(a=function(e,t){return function(){const n=e._readableState;n.awaitDrainWriters===t?(x("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(x("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),n.awaitDrainWriters&&0!==n.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(n,e),e.on("drain",a))}function u(t){x("ondata");const n=e.write(t);x("dest.write",n),!1===n&&c()}function d(t){if(x("onerror",t),g(),e.removeListener("error",d),0===e.listenerCount("error")){const n=e._writableState||e._readableState;n&&!n.errorEmitted?B(e,t):e.emit("error",t)}}function f(){e.removeListener("finish",p),g()}function p(){x("onfinish"),e.removeListener("close",f),g()}function g(){x("unpipe"),n.unpipe(e)}return n.on("data",u),b(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",n),!0===e.writableNeedDrain?c():i.flowing||(x("pipe resume"),n.resume()),e},W.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const n=i(t.pipes,e);return-1===n||(t.pipes.splice(n,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},W.prototype.on=function(e,t){const n=m.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,x("on readable",i.length,i.reading),i.length?K(this):i.reading||r.nextTick(ne,this))),n},W.prototype.addListener=W.prototype.on,W.prototype.removeListener=function(e,t){const n=m.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(te,this),n},W.prototype.off=W.prototype.removeListener,W.prototype.removeAllListeners=function(e){const t=m.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(te,this),t},W.prototype.resume=function(){const e=this._readableState;return e.flowing||(x("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(re,e,t))}(this,e)),e[D]=!1,this},W.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[D]=!0,this},W.prototype.wrap=function(e){let t=!1;e.on("data",(n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())})),e.on("end",(()=>{this.push(null)})),e.on("error",(e=>{B(this,e)})),e.on("close",(()=>{this.destroy()})),e.on("destroy",(()=>{this.destroy()})),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const n=c(e);for(let t=1;t<n.length;t++){const r=n[t];void 0===this[r]&&"function"==typeof e[r]&&(this[r]=e[r].bind(e))}return this},W.prototype[p]=function(){return se(this)},W.prototype.iterator=function(e){return void 0!==e&&C(e,"options"),se(this,e)},l(W.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(z.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[D]},set(e){this[D]=!!e}}}),W._fromList=oe,W.from=function(e,t){return P(W,e,t)},W.fromWeb=function(e,t){return de().newStreamReadableFromReadableStream(e,t)},W.toWeb=function(e,t){return de().newReadableStreamFromStreamReadable(e,t)},W.wrap=function(e,t){var n,r;return new W({objectMode:null===(n=null!==(r=e.readableObjectMode)&&void 0!==r?r:e.objectMode)||void 0===n||n,...t,destroy(t,n){j.destroyer(e,t),n(t)}}).wrap(e)}},7758:(e,t,n)=>{const r=n(5606),{ArrayIsArray:i,Promise:s,SymbolAsyncIterator:o,SymbolDispose:a}=n(4134),l=n(6238),{once:c}=n(7760),u=n(5896),d=n(3370),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:g,ERR_STREAM_DESTROYED:y,ERR_STREAM_PREMATURE_CLOSE:m},AbortError:b}=n(6371),{validateFunction:v,validateAbortSignal:w}=n(277),{isIterable:_,isReadable:x,isReadableNodeStream:S,isNodeStream:j,isTransformStream:I,isWebStream:E,isReadableStream:N,isReadableFinished:T}=n(6115),R=globalThis.AbortController||n(5568).AbortController;let O,k,L;function A(e,t,n){let r=!1;return e.on("close",(()=>{r=!0})),{destroy:t=>{r||(r=!0,u.destroyer(e,t||new y("pipe")))},cleanup:l(e,{readable:t,writable:n},(e=>{r=!e}))}}function C(e){if(_(e))return e;if(S(e))return async function*(e){k||(k=n(7576)),yield*k.prototype[o].call(e)}(e);throw new f("val",["Readable","Iterable","AsyncIterable"],e)}async function D(e,t,n,{end:r}){let i,o=null;const a=e=>{if(e&&(i=e),o){const e=o;o=null,e()}},c=()=>new s(((e,t)=>{i?t(i):o=()=>{i?t(i):e()}}));t.on("drain",a);const u=l(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(const n of e)t.write(n)||await c();r&&(t.end(),await c()),n()}catch(e){n(i!==e?h(i,e):e)}finally{u(),t.off("drain",a)}}async function M(e,t,n,{end:r}){I(t)&&(t=t.writable);const i=t.getWriter();try{for await(const t of e)await i.ready,i.write(t).catch((()=>{}));await i.ready,r&&await i.close(),n()}catch(e){try{await i.abort(e),n(e)}catch(e){n(e)}}}function P(e,t,s){if(1===e.length&&i(e[0])&&(e=e[0]),e.length<2)throw new g("streams");const o=new R,l=o.signal,c=null==s?void 0:s.signal,u=[];function h(){F(new b)}let y,m,v;w(c,"options.signal"),L=L||n(7760).addAbortListener,c&&(y=L(c,h));const T=[];let k,P=0;function B(e){F(e,0===--P)}function F(e,n){var i;if(!e||m&&"ERR_STREAM_PREMATURE_CLOSE"!==m.code||(m=e),m||n){for(;T.length;)T.shift()(m);null===(i=y)||void 0===i||i[a](),o.abort(),n&&(m||u.forEach((e=>e())),r.nextTick(t,m,v))}}for(let G=0;G<e.length;G++){const H=e[G],V=G<e.length-1,z=G>0,W=V||!1!==(null==s?void 0:s.end),J=G===e.length-1;if(j(H)){if(W){const{destroy:X,cleanup:K}=A(H,V,z);T.push(X),x(H)&&J&&u.push(K)}function Q(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&B(e)}H.on("error",Q),x(H)&&J&&u.push((()=>{H.removeListener("error",Q)}))}if(0===G)if("function"==typeof H){if(k=H({signal:l}),!_(k))throw new p("Iterable, AsyncIterable or Stream","source",k)}else k=_(H)||S(H)||I(H)?H:d.from(H);else if("function"==typeof H){var q;if(k=I(k)?C(null===(q=k)||void 0===q?void 0:q.readable):C(k),k=H(k,{signal:l}),V){if(!_(k,!0))throw new p("AsyncIterable",`transform[${G-1}]`,k)}else{var U;O||(O=n(6524));const Y=new O({objectMode:!0}),Z=null===(U=k)||void 0===U?void 0:U.then;if("function"==typeof Z)P++,Z.call(k,(e=>{v=e,null!=e&&Y.write(e),W&&Y.end(),r.nextTick(B)}),(e=>{Y.destroy(e),r.nextTick(B,e)}));else if(_(k,!0))P++,D(k,Y,B,{end:W});else{if(!N(k)&&!I(k))throw new p("AsyncIterable or Promise","destination",k);{const ne=k.readable||k;P++,D(ne,Y,B,{end:W})}}k=Y;const{destroy:ee,cleanup:te}=A(k,!1,!0);T.push(ee),J&&u.push(te)}}else if(j(H)){if(S(k)){P+=2;const re=$(k,H,B,{end:W});x(H)&&J&&u.push(re)}else if(I(k)||N(k)){const ie=k.readable||k;P++,D(ie,H,B,{end:W})}else{if(!_(k))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],k);P++,D(k,H,B,{end:W})}k=H}else if(E(H)){if(S(k))P++,M(C(k),H,B,{end:W});else if(N(k)||_(k))P++,M(k,H,B,{end:W});else{if(!I(k))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],k);P++,M(k.readable,H,B,{end:W})}k=H}else k=d.from(H)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&r.nextTick(h),k}function $(e,t,n,{end:i}){let s=!1;if(t.on("close",(()=>{s||n(new m)})),e.pipe(t,{end:!1}),i){function o(){s=!0,t.end()}T(e)?r.nextTick(o):e.once("end",o)}else n();return l(e,{readable:!0,writable:!1},(t=>{const r=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&r&&r.ended&&!r.errored&&!r.errorEmitted?e.once("end",n).once("error",n):n(t)})),l(t,{readable:!1,writable:!0},n)}e.exports={pipelineImpl:P,pipeline:function(...e){return P(e,c(function(e){return v(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},7760:(e,t,n)=>{const r=n(8287),{kResistStopPropagation:i,SymbolDispose:s}=n(4134),o=globalThis.AbortSignal||n(5568).AbortSignal,a=globalThis.AbortController||n(5568).AbortController,l=Object.getPrototypeOf((async function(){})).constructor,c=globalThis.Blob||r.Blob,u=void 0!==c?function(e){return e instanceof c}:function(e){return!1},d=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)};class h extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let n=0;n<e.length;n++)t+=` ${e[n].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:h,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...n){t||(t=!0,e.apply(this,n))}},createDeferredPromise:function(){let e,t;return{promise:new Promise(((n,r)=>{e=n,t=r})),resolve:e,reject:t}},promisify:e=>new Promise(((t,n)=>{e(((e,...r)=>e?n(e):t(...r)))})),debuglog:()=>function(){},format:(e,...t)=>e.replace(/%([sdifj])/g,(function(...[e,n]){const r=t.shift();return"f"===n?r.toFixed(6):"j"===n?JSON.stringify(r):"s"===n&&"object"==typeof r?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction:e=>e instanceof l,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:u,deprecate:(e,t)=>e,addAbortListener:n(7007).addAbortListener||function(e,t){if(void 0===e)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);let n;return d(e,"signal"),(e=>{if("function"!=typeof e)throw new ERR_INVALID_ARG_TYPE("listener","Function",e)})(t),e.aborted?queueMicrotask((()=>t())):(e.addEventListener("abort",t,{__proto__:null,once:!0,[i]:!0}),n=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[s](){var e;null===(e=n)||void 0===e||e()}}},AbortSignalAny:o.any||function(e){if(1===e.length)return e[0];const t=new a,n=()=>t.abort();return e.forEach((e=>{d(e,"signals"),e.addEventListener("abort",n,{once:!0})})),t.signal.addEventListener("abort",(()=>{e.forEach((e=>e.removeEventListener("abort",n)))}),{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},7789:()=>{},7830:(e,t,n)=>{const{pipeline:r}=n(7758),i=n(3370),{destroyer:s}=n(5896),{isNodeStream:o,isReadable:a,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:d,isReadableStream:h}=n(6115),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:g}}=n(6371),y=n(6238);e.exports=function(...e){if(0===e.length)throw new g("streams");if(1===e.length)return i.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=i.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=i.from(e[t])}for(let n=0;n<e.length;++n)if(o(e[n])||c(e[n])){if(n<e.length-1&&!(a(e[n])||h(e[n])||u(e[n])))throw new p(`streams[${n}]`,t[n],"must be readable");if(n>0&&!(l(e[n])||d(e[n])||u(e[n])))throw new p(`streams[${n}]`,t[n],"must be writable")}let n,m,b,v,w;const _=e[0],x=r(e,(function(e){const t=v;v=null,t?t(e):e?w.destroy(e):j||S||w.destroy()})),S=!!(l(_)||d(_)||u(_)),j=!!(a(x)||h(x)||u(x));if(w=new i({writableObjectMode:!(null==_||!_.writableObjectMode),readableObjectMode:!(null==x||!x.readableObjectMode),writable:S,readable:j}),S){if(o(_))w._write=function(e,t,r){_.write(e,t)?r():n=r},w._final=function(e){_.end(),m=e},_.on("drain",(function(){if(n){const e=n;n=null,e()}}));else if(c(_)){const e=(u(_)?_.writable:_).getWriter();w._write=async function(t,n,r){try{await e.ready,e.write(t).catch((()=>{})),r()}catch(e){r(e)}},w._final=async function(t){try{await e.ready,e.close().catch((()=>{})),m=t}catch(e){t(e)}}}const e=u(x)?x.readable:x;y(e,(()=>{if(m){const e=m;m=null,e()}}))}if(j)if(o(x))x.on("readable",(function(){if(b){const e=b;b=null,e()}})),x.on("end",(function(){w.push(null)})),w._read=function(){for(;;){const e=x.read();if(null===e)return void(b=w._read);if(!w.push(e))return}};else if(c(x)){const e=(u(x)?x.readable:x).getReader();w._read=async function(){for(;;)try{const{value:t,done:n}=await e.read();if(!w.push(t))return;if(n)return void w.push(null)}catch{return}}}return w._destroy=function(e,t){e||null===v||(e=new f),b=null,n=null,m=null,null===v?t(e):(v=t,o(x)&&s(x,e))},w}},7946:(e,t,n)=>{const{isKeyword:r}=n(1972),i=n(3978),s=n(7382),o=n(9263),a=n(470),l=n(2207),{createNodeMap:c,mergeNodeMapGraphs:u}=n(9233),d={};function h(e){const t={};for(const n in e)void 0!==e[n]&&(t["@"+n]=[e[n]]);return[t]}function f(e,t,n){for(let r=n.length-1;r>=0;--r){const i=n[r];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function p(e,t,n){const r="@"+n;let i=r in e?e[r][0]:t[n];if("embed"===n)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function g(e){if(!s.isArray(e)||1!==e.length||!s.isObject(e[0]))throw new l("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of o.asArray(e[0]["@id"]))if(!s.isObject(t)&&!a.isAbsolute(t)||s.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of o.asArray(e[0]["@type"]))if(!s.isObject(t)&&!a.isAbsolute(t)&&"@json"!==t||s.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function y(e,t,n,a){let l=!0,c=!1;for(const u in n){let d=!1;const h=o.getValues(t,u),f=0===o.getValues(n,u).length;if("@id"===u){if(s.isEmptyObject(n["@id"][0]||{})?d=!0:n["@id"].length>=0&&(d=n["@id"].includes(h[0])),!a.requireAll)return d}else if("@type"===u){if(l=!1,f){if(h.length>0)return!1;d=!0}else if(1===n["@type"].length&&s.isEmptyObject(n["@type"][0]))d=h.length>0;else for(const e of n["@type"])d=!(!s.isObject(e)||!("@default"in e))||d||h.some((t=>t===e));if(!a.requireAll)return d}else{if(r(u))continue;{const t=o.getValues(n,u)[0];let r=!1;if(t&&(g([t]),r="@default"in t),l=!1,0===h.length&&r)continue;if(h.length>0&&f)return!1;if(void 0===t){if(h.length>0)return!1;d=!0}else if(i.isList(t)){const n=t["@list"][0];if(i.isList(h[0])){const t=h[0]["@list"];i.isValue(n)?d=t.some((e=>_(n,e))):(i.isSubject(n)||i.isSubjectReference(n))&&(d=t.some((t=>w(e,n,t,a))))}}else d=i.isValue(t)?h.some((e=>_(t,e))):i.isSubjectReference(t)?h.some((n=>w(e,t,n,a))):!!s.isObject(t)&&h.length>0}}if(!d&&a.requireAll)return!1;c=c||d}return l||c}function m(e,t){const n=e.uniqueEmbeds[e.graph],r=n[t],i=r.parent,a=r.property,l={"@id":t};if(s.isArray(i)){for(let e=0;e<i.length;++e)if(o.compareValues(i[e],l)){i[e]=l;break}}else{const e=s.isArray(i[a]);o.removeValue(i,a,l,{propertyIsArray:e}),o.addValue(i,a,l,{propertyIsArray:e})}const c=e=>{const t=Object.keys(n);for(const r of t)r in n&&s.isObject(n[r].parent)&&n[r].parent["@id"]===e&&(delete n[r],c(r))};c(t)}function b(e,t){if(s.isArray(e))return e.map((e=>b(e,t)));if(s.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=b(e["@list"],t),e;if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)"@id"===n&&t.bnodesToClear.includes(e[n])?delete e["@id"]:e[n]=b(e[n],t)}return e}function v(e,t,n){s.isObject(e)?o.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function w(e,t,n,r){if(!("@id"in n))return!1;const i=e.subjects[n["@id"]];return i&&y(e,i,t,r)}function _(e,t){const n=t["@value"],r=t["@type"],i=t["@language"],o=e["@value"]?s.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],a=e["@type"]?s.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],l=e["@language"]?s.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===o.length&&0===a.length&&0===l.length||!(!o.includes(n)&&!s.isEmptyObject(o[0]))&&!!(!r&&0===a.length||a.includes(r)||r&&s.isEmptyObject(a[0]))&&!!(!i&&0===l.length||l.includes(i)||i&&s.isEmptyObject(l[0]))}e.exports=d,d.frameMergedOrDefault=(e,t,n)=>{const r={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new o.IdentifierIssuer("_:b");c(e,r.graphMap,"@default",i),n.merged&&(r.graphMap["@merged"]=u(r.graphMap),r.graph="@merged"),r.subjects=r.graphMap[r.graph];const s=[];return d.frame(r,Object.keys(r.subjects).sort(),t,s),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(r.bnodeMap).filter((e=>1===r.bnodeMap[e].length))),n.link={},b(s,n)},d.frame=(e,t,n,a,c=null)=>{g(n),n=n[0];const u=e.options,b={embed:p(n,u,"embed"),explicit:p(n,u,"explicit"),requireAll:p(n,u,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const w=e.link[e.graph],x=function(e,t,n,r){const i={};for(const s of t){const t=e.graphMap[e.graph][s];y(e,t,n,r)&&(i[s]=t)}return i}(e,t,n,b),S=Object.keys(x).sort();for(const g of S){const y=x[g];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===b.embed&&g in w){v(a,c,w[g]);continue}const S={"@id":g};if(0===g.indexOf("_:")&&o.addValue(e.bnodeMap,g,S,{propertyIsArray:!0}),w[g]=S,("@first"===b.embed||"@last"===b.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(g))if(!e.embedded||"@never"!==b.embed&&!f(y,e.graph,e.subjectStack))if(!e.embedded||"@first"!=b.embed&&"@once"!=b.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(g)){if("@last"===b.embed&&g in e.uniqueEmbeds[e.graph]&&m(e,g),e.uniqueEmbeds[e.graph][g]={parent:a,property:c},e.subjectStack.push({subject:y,graph:e.graph}),g in e.graphMap){let t=!1,r=null;"@graph"in n?(r=n["@graph"][0],t=!("@merged"===g||"@default"===g),s.isObject(r)||(r={})):(t="@merged"!==e.graph,r={}),t&&d.frame({...e,graph:g,embedded:!1},Object.keys(e.graphMap[g]).sort(),[r],S,"@graph")}"@included"in n&&d.frame({...e,embedded:!1},t,n["@included"],S,"@included");for(const t of Object.keys(y).sort())if(r(t)){if(S[t]=o.clone(y[t]),"@type"===t)for(const t of y["@type"])0===t.indexOf("_:")&&o.addValue(e.bnodeMap,t,S,{propertyIsArray:!0})}else if(!b.explicit||t in n)for(const r of y[t]){const s=t in n?n[t]:h(b);if(i.isList(r)){const s=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:h(b),a={"@list":[]};v(S,t,a);const l=r["@list"];for(const t of l)i.isSubjectReference(t)?d.frame({...e,embedded:!0},[t["@id"]],s,a,"@list"):v(a,"@list",o.clone(t))}else i.isSubjectReference(r)?d.frame({...e,embedded:!0},[r["@id"]],s,S,t):_(s[0],r)&&v(S,t,o.clone(r))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!s.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(r(e))continue;const t=n[e][0]||{};if(!p(t,u,"omitDefault")&&!(e in S)){let n="@null";"@default"in t&&(n=o.clone(t["@default"])),s.isArray(n)||(n=[n]),S[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const r=n["@reverse"][t];for(const n of Object.keys(e.subjects))o.getValues(e.subjects[n],t).some((e=>e["@id"]===g))&&(S["@reverse"]=S["@reverse"]||{},o.addValue(S["@reverse"],t,[],{propertyIsArray:!0}),d.frame({...e,embedded:!0},[n],r,S["@reverse"][t],c))}v(a,c,S),e.subjectStack.pop()}else v(a,c,S);else v(a,c,S)}},d.cleanupNull=(e,t)=>{if(s.isArray(e))return e.map((e=>d.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(s.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=d.cleanupNull(e[n],t)}return e}},8059:(e,t,n)=>{var r=n(2177);e.exports=function(e){return r(2,e)}},8229:(e,t,n)=>{e.exports=n(989).NQuads},8287:(e,t,n)=>{const r=n(7526),i=n(251),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=a(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return f(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return f(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);const i=function(e){if(l.isBuffer(e)){const t=0|p(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||X(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return u(e),a(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),n=a(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function f(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,l.prototype),r}function p(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(i)return r?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return R(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){let s,o=1,a=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let r=-1;for(s=n;s<a;s++)if(c(e,s)===c(t,-1===r?0:s-r)){if(-1===r&&(r=s),s-r+1===l)return r*o}else-1!==r&&(s-=s-r),r=-1}else for(n+l>a&&(n=a-l),s=n;s>=0;s--){let n=!0;for(let r=0;r<l;r++)if(c(e,s+r)!==c(t,r)){n=!1;break}if(n)return s}return-1}function w(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const s=t.length;let o;for(r>s/2&&(r=s/2),o=0;o<r;++o){const r=parseInt(t.substr(2*o,2),16);if(X(r))return o;e[n+o]=r}return o}function _(e,t,n,r){return J(z(t,e.length-n),e,n,r)}function x(e,t,n,r){return J(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return J(W(t),e,n,r)}function j(e,t,n,r){return J(function(e,t){let n,r,i;const s=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,s.push(i),s.push(r);return s}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let s=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,a,l;switch(o){case 1:t<128&&(s=t);break;case 2:n=e[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(s=l));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:n=e[i+1],r=e[i+2],a=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&a,l>65535&&l<1114112&&(s=l))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=o}return function(e){const t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=N));return n}(r)}t.kMaxLength=o,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return function(e,t,n){return u(e),e<=0?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)}(e,t,n)},l.allocUnsafe=function(e){return d(e)},l.allocUnsafeSlow=function(e){return d(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,s=Math.min(n,r);i<s;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=l.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(Q(t,Uint8Array))i+t.length>r.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):y.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},s&&(l.prototype[s]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,i){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let s=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0);const a=Math.min(s,o),c=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<a;++e)if(c[e]!==u[e]){s=c[e],o=u[e];break}return s<o?-1:o<s?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return b(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return b(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":case"latin1":case"binary":return x(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function T(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function R(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function O(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=K[e[r]];return i}function k(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function L(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,n,r,i,s){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function C(e,t,n,r,i){U(t,r,i,e,n,7);let s=Number(t&BigInt(4294967295));e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function D(e,t,n,r,i){U(t,r,i,e,n,7);let s=Number(t&BigInt(4294967295));e[n+7]=s,s>>=8,e[n+6]=s,s>>=8,e[n+5]=s,s>>=8,e[n+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}function M(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(e,t,n,r,s){return t=+t,n>>>=0,s||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function $(e,t,n,r,s){return t=+t,n>>>=0,s||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,s=0;for(;++s<t&&(i*=256);)r+=this[e+s]*i;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Y((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),l.prototype.readBigUInt64BE=Y((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,s=0;for(;++s<t&&(i*=256);)r+=this[e+s]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=t,i=1,s=this[e+--r];for(;r>0&&(i*=256);)s+=this[e+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},l.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Y((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=Y((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,s=0;for(this[t]=255&e;++s<n&&(i*=256);)this[t+s]=e/i&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Y((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=Y((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);A(this,e,t,n,r-1,-r)}let i=0,s=1,o=0;for(this[t]=255&e;++i<n&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);A(this,e,t,n,r-1,-r)}let i=n-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Y((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=Y((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return $(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return $(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const s=l.isBuffer(e)?e:l.from(e,r),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=s[i%o]}return this};const B={};function F(e,t,n){B[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function U(e,t,n,r,i,s){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=s>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(s+1)}${r}`:`>= -(2${r} ** ${8*(s+1)-1}${r}) and < 2 ** ${8*(s+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||H(t,e.length-(n+1))}(r,i,s)}function G(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,n){if(Math.floor(e)!==e)throw G(e,n),new B.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=q(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function z(e,t){let n;t=t||1/0;const r=e.length;let i=null;const s=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function W(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const K=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Y(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},8339:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;const r=n(3067),i=n(4878),s=n(458),o=n(3476),a=n(2946),l=n(7265);let c=0;t.DataFactory=class{constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${c++}_`}namedNode(e){return new o.NamedNode(e)}blankNode(e){return new r.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new s.Literal(e,t)}variable(e){return new l.Variable(e)}defaultGraph(){return i.DefaultGraph.INSTANCE}quad(e,t,n,r){return new a.Quad(e,t,n,r||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(s.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},8584:(e,t,n)=>{const r=n(5606),{ArrayPrototypeSlice:i,Error:s,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:d,SymbolHasInstance:h}=n(4134);e.exports=C,C.WritableState=L;const{EventEmitter:f}=n(7007),p=n(4259).Stream,{Buffer:g}=n(8287),y=n(5896),{addAbortSignal:m}=n(4147),{getHighWaterMark:b,getDefaultHighWaterMark:v}=n(5291),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:x,ERR_STREAM_CANNOT_PIPE:S,ERR_STREAM_DESTROYED:j,ERR_STREAM_ALREADY_FINISHED:I,ERR_STREAM_NULL_VALUES:E,ERR_STREAM_WRITE_AFTER_END:N,ERR_UNKNOWN_ENCODING:T}=n(6371).codes,{errorOrDestroy:R}=y;function O(){}c(C.prototype,p.prototype),c(C,p);const k=d("kOnFinished");function L(e,t,r){"boolean"!=typeof r&&(r=t instanceof n(3370)),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?b(this,e,"writableHighWaterMark",r):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const i=!(!e||!1!==e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=$.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,A(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[k]=[]}function A(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function C(e){const t=this instanceof n(3370);if(!t&&!o(C,this))return new C(e);this._writableState=new L(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&m(e.signal,this)),p.call(this,e),y.construct(this,(()=>{const e=this._writableState;e.writing||U(this,e),H(this,e)}))}function D(e,t,n,i){const s=e._writableState;if("function"==typeof n)i=n,n=s.defaultEncoding;else{if(n){if("buffer"!==n&&!g.isEncoding(n))throw new T(n)}else n=s.defaultEncoding;"function"!=typeof i&&(i=O)}if(null===t)throw new E;if(!s.objectMode)if("string"==typeof t)!1!==s.decodeStrings&&(t=g.from(t,n),n="buffer");else if(t instanceof g)n="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),n="buffer"}let o;return s.ending?o=new N:s.destroyed&&(o=new j("write")),o?(r.nextTick(i,o),R(e,o,!0),o):(s.pendingcb++,function(e,t,n,r,i){const s=t.objectMode?1:n.length;t.length+=s;const o=t.length<t.highWaterMark;return o||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:n,encoding:r,callback:i}),t.allBuffers&&"buffer"!==r&&(t.allBuffers=!1),t.allNoop&&i!==O&&(t.allNoop=!1)):(t.writelen=s,t.writecb=i,t.writing=!0,t.sync=!0,e._write(n,r,t.onwrite),t.sync=!1),o&&!t.errored&&!t.destroyed}(e,s,t,n,i))}function M(e,t,n,r,i,s,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new j("write")):n?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function P(e,t,n,r){--t.pendingcb,r(n),q(t),R(e,n)}function $(e,t){const n=e._writableState,i=n.sync,s=n.writecb;"function"==typeof s?(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t?(t.stack,n.errored||(n.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?r.nextTick(P,e,n,t,s):P(e,n,t,s)):(n.buffered.length>n.bufferedIndex&&U(e,n),i?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===s?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:s,stream:e,state:n},r.nextTick(B,n.afterWriteTickInfo)):F(e,n,1,s))):R(e,new x)}function B({stream:e,state:t,count:n,cb:r}){return t.afterWriteTickInfo=null,F(e,t,n,r)}function F(e,t,n,r){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));n-- >0;)t.pendingcb--,r();t.destroyed&&q(t),H(e,t)}function q(e){if(e.writing)return;for(let n=e.bufferedIndex;n<e.buffered.length;++n){var t;const{chunk:r,callback:i}=e.buffered[n],s=e.objectMode?1:r.length;e.length-=s,i(null!==(t=e.errored)&&void 0!==t?t:new j("write"))}const n=e[k].splice(0);for(let t=0;t<n.length;t++){var r;n[t](null!==(r=e.errored)&&void 0!==r?r:new j("end"))}A(e)}function U(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:n,bufferedIndex:r,objectMode:s}=t,o=n.length-r;if(!o)return;let a=r;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;const r=t.allNoop?O:e=>{for(let t=a;t<n.length;++t)n[t].callback(e)},s=t.allNoop&&0===a?n:i(n,a);s.allBuffers=t.allBuffers,M(e,t,!0,t.length,s,"",r),A(t)}else{do{const{chunk:r,encoding:i,callback:o}=n[a];n[a++]=null,M(e,t,!1,s?1:r.length,r,i,o)}while(a<n.length&&!t.writing);a===n.length?A(t):a>256?(n.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function G(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function H(e,t,n){G(t)&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let n=!1;function i(i){if(n)R(e,null!=i?i:x());else if(n=!0,t.pendingcb--,i){const n=t[k].splice(0);for(let e=0;e<n.length;e++)n[e](i);R(e,i,t.sync)}else G(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,r.nextTick(V,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(n?(t.pendingcb++,r.nextTick(((e,t)=>{G(t)?V(e,t):t.pendingcb--}),e,t)):G(t)&&(t.pendingcb++,V(e,t))))}function V(e,t){t.pendingcb--,t.finished=!0;const n=t[k].splice(0);for(let e=0;e<n.length;e++)n[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}L.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},a(L.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(C,h,{__proto__:null,value:function(e){return!!o(this,e)||this===C&&e&&e._writableState instanceof L}}),C.prototype.pipe=function(){R(this,new S)},C.prototype.write=function(e,t,n){return!0===D(this,e,t,n)},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||U(this,e))},C.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!g.isEncoding(e))throw new T(e);return this._writableState.defaultEncoding=e,this},C.prototype._write=function(e,t,n){if(!this._writev)throw new _("_write()");this._writev([{chunk:e,encoding:t}],n)},C.prototype._writev=null,C.prototype.end=function(e,t,n){const i=this._writableState;let o;if("function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e){const n=D(this,e,t);n instanceof s&&(o=n)}return i.corked&&(i.corked=1,this.uncork()),o||(i.errored||i.ending?i.finished?o=new I("end"):i.destroyed&&(o=new j("end")):(i.ending=!0,H(this,i,!0),i.ended=!0)),"function"==typeof n&&(o||i.finished?r.nextTick(n,o):i[k].push(n)),this},l(C.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const z=y.destroy;let W;function J(){return void 0===W&&(W={}),W}C.prototype.destroy=function(e,t){const n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[k].length)&&r.nextTick(q,n),z.call(this,e,t),this},C.prototype._undestroy=y.undestroy,C.prototype._destroy=function(e,t){t(e)},C.prototype[f.captureRejectionSymbol]=function(e){this.destroy(e)},C.fromWeb=function(e,t){return J().newStreamWritableFromWritableStream(e,t)},C.toWeb=function(e){return J().newWritableStreamFromStreamWritable(e)}},8799:(e,t,n)=>{function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}function i(e,t,n){var r=t===e.head?new a(n,null,t,e):new a(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function s(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function o(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,n,r){if(!(this instanceof a))return new a(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=r,r.Node=a,r.create=r,r.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},r.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},r.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},r.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},r.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},r.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},r.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},r.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},r.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},r.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},r.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},r.prototype.map=function(e,t){t=t||this;for(var n=new r,i=this.head;null!==i;)n.push(e.call(t,i.value,this)),i=i.next;return n},r.prototype.mapReverse=function(e,t){t=t||this;for(var n=new r,i=this.tail;null!==i;)n.push(e.call(t,i.value,this)),i=i.prev;return n},r.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,s=this.head;null!==s&&i<e;i++)s=s.next;for(;null!==s&&i<t;i++,s=s.next)n.push(s.value);return n},r.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,s=this.tail;null!==s&&i>t;i--)s=s.prev;for(;null!==s&&i>e;i--,s=s.prev)n.push(s.value);return n},r.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,s=this.head;null!==s&&r<e;r++)s=s.next;var o=[];for(r=0;s&&r<t;r++)o.push(s.value),s=this.removeNode(s);for(null===s&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev),r=0;r<n.length;r++)s=i(this,s,n[r]);return o},r.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{n(259)(r)}catch(e){}},9180:(e,t,n)=>{const{createNodeMap:r}=n(9233),{isKeyword:i}=n(1972),s=n(3978),o=n(2341),a=n(2207),l=n(7382),c=n(9263),{handleEvent:u}=n(2246),{RDF_FIRST:d,RDF_REST:h,RDF_NIL:f,RDF_TYPE:p,RDF_JSON_LITERAL:g,RDF_LANGSTRING:y,XSD_BOOLEAN:m,XSD_DOUBLE:b,XSD_INTEGER:v,XSD_STRING:w}=n(9378),{isAbsolute:_}=n(470),x={};function S(e,t,n,r,s){const o=Object.keys(t).sort();for(const a of o){const o=t[a],l=Object.keys(o).sort();for(let t of l){const l=o[t];if("@type"===t)t=p;else if(i(t))continue;for(const i of l){const o={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!_(a)){s.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:a}},options:s});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!_(t)){s.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:s});continue}if("BlankNode"===l.termType&&!s.produceGeneralizedRdf){s.eventHandler&&u({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:r.getOldIds().find((e=>r.getId(e)===t))}},options:s});continue}const c=j(i,r,e,n,s.rdfDirection,s);c&&e.push({subject:o,predicate:l,object:c,graph:n})}}}}function j(e,t,n,r,i,c){const p={};if(s.isValue(e)){p.termType="Literal",p.value=void 0,p.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;if("@json"===n)p.value=o(t),p.datatype.value=g;else if(l.isBoolean(t))p.value=t.toString(),p.datatype.value=n||m;else if(l.isDouble(t)||n===b)l.isDouble(t)||(t=parseFloat(t)),p.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),p.datatype.value=n||b;else if(l.isNumber(t))p.value=t.toFixed(0),p.datatype.value=n||v;else if("@direction"in e&&"i18n-datatype"===i){const n=`https://www.w3.org/ns/i18n#${(e["@language"]||"").toLowerCase()}_${e["@direction"]}`;p.datatype.value=n,p.value=t}else{if("@direction"in e&&"compound-literal"===i)throw new a("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:i});if("@direction"in e&&i)throw new a("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:i});"@language"in e?("@direction"in e&&!i&&c.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:p.value}},options:c}),p.value=t,p.datatype.value=n||y,p.language=e["@language"]):("@direction"in e&&!i&&c.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:p.value}},options:c}),p.value=t,p.datatype.value=n||w)}}else if(s.isList(e)){const s=function(e,t,n,r,i,s){const o={termType:"NamedNode",value:d},a={termType:"NamedNode",value:h},l={termType:"NamedNode",value:f},c=e.pop(),u=c?{termType:"BlankNode",value:t.getId()}:l;let p=u;for(const l of e){const e=j(l,t,n,r,i,s),c={termType:"BlankNode",value:t.getId()};n.push({subject:p,predicate:o,object:e,graph:r}),n.push({subject:p,predicate:a,object:c,graph:r}),p=c}if(c){const e=j(c,t,n,r,i,s);n.push({subject:p,predicate:o,object:e,graph:r}),n.push({subject:p,predicate:a,object:l,graph:r})}return u}(e["@list"],t,n,r,i,c);p.termType=s.termType,p.value=s.value}else{const t=l.isObject(e)?e["@id"]:e;p.termType=t.startsWith("_:")?"BlankNode":"NamedNode",p.value=t}return"NamedNode"!==p.termType||_(p.value)?p:(c.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:p.value}},options:c}),null)}e.exports=x,x.toRDF=(e,t)=>{const n=new c.IdentifierIssuer("_:b"),i={"@default":{}};r(e,i,"@default",n);const s=[],o=Object.keys(i).sort();for(const e of o){let r;if("@default"===e)r={termType:"DefaultGraph",value:""};else{if(!_(e)){t.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}r=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},r.value=e}S(s,i[e],r,n,t)}return s}},9198:(e,t,n)=>{const r=n(5506),i=n(3095),s=r.Readable.destroy;e.exports=r.Readable,e.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,e.exports._isUint8Array=r._isUint8Array,e.exports.isDisturbed=r.isDisturbed,e.exports.isErrored=r.isErrored,e.exports.isReadable=r.isReadable,e.exports.Readable=r.Readable,e.exports.Writable=r.Writable,e.exports.Duplex=r.Duplex,e.exports.Transform=r.Transform,e.exports.PassThrough=r.PassThrough,e.exports.addAbortSignal=r.addAbortSignal,e.exports.finished=r.finished,e.exports.destroy=r.destroy,e.exports.destroy=s,e.exports.pipeline=r.pipeline,e.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>i}),e.exports.Stream=r.Stream,e.exports.default=e.exports},9233:(e,t,n)=>{const{isKeyword:r}=n(1972),i=n(3978),s=n(7382),o=n(9263),a=n(2207),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new o.IdentifierIssuer("_:b"),r={"@default":{}};return l.createNodeMap(e,r,"@default",n),l.mergeNodeMaps(r)},l.createNodeMap=(e,t,n,c,u,d)=>{if(s.isArray(e)){for(const r of e)l.createNodeMap(r,t,n,c,void 0,d);return}if(!s.isObject(e))return void(d&&d.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(d&&d.push(e))}if(d&&i.isList(e)){const r=[];return l.createNodeMap(e["@list"],t,n,c,u,r),void d.push({"@list":r})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}s.isUndefined(u)&&(u=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),d&&d.push({"@id":u});const h=t[n],f=h[u]=h[u]||{};f["@id"]=u;const p=Object.keys(e).sort();for(let s of p){if("@id"===s)continue;if("@reverse"===s){const r={"@id":u},s=e["@reverse"];for(const e in s){const a=s[e];for(const s of a){let a=s["@id"];i.isBlankNode(s)&&(a=c.getId(a)),l.createNodeMap(s,t,n,c,a),o.addValue(h[a],e,r,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===s){u in t||(t[u]={}),l.createNodeMap(e[s],t,u,c);continue}if("@included"===s){l.createNodeMap(e[s],t,n,c);continue}if("@type"!==s&&r(s)){if("@index"===s&&s in f&&(e[s]!==f[s]||e[s]["@id"]!==f[s]["@id"]))throw new a("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:f});f[s]=e[s];continue}const d=e[s];if(0===s.indexOf("_:")&&(s=c.getId(s)),0!==d.length)for(let e of d)if("@type"===s&&(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,s,{"@id":r},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,n,c,r)}else if(i.isValue(e))o.addValue(f,s,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const r=[];l.createNodeMap(e["@list"],t,n,c,u,r),e={"@list":r},o.addValue(f,s,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,n,c,u),o.addValue(f,s,e,{propertyIsArray:!0,allowDuplicate:!1});else o.addValue(f,s,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const i of Object.keys(e[n]).sort()){const s=e[n][i];i in t||(t[i]={"@id":i});const a=t[i];for(const e of Object.keys(s).sort())if(r(e)&&"@type"!==e)a[e]=o.clone(s[e]);else for(const t of s[e])o.addValue(a,e,o.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.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 s=t[r];s?"@graph"in s||(s["@graph"]=[]):t[r]=s={"@id":r,"@graph":[]};const o=s["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];i.isSubjectReference(t)||o.push(t)}}return t}},9263:(e,t,n)=>{const r=n(3978),i=n(7382),s=n(989).IdentifierIssuer,o=n(2207),a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u="application/ld+json, application/json",d={};function h(e,t){if(i.isArray(t))for(let n=0;n<t.length;++n)t[n]=h(e,t[n]);else if(r.isList(t))t["@list"]=h(e,t["@list"]);else if(i.isObject(t)){r.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const n=Object.keys(t).sort();for(let r=0;r<n.length;++r){const i=n[r];"@id"!==i&&(t[i]=h(e,t[i]))}}return t}e.exports=d,d.IdentifierIssuer=s,d.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,d.REGEX_KEYWORD=/^@[a-zA-Z]+$/,d.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]=d.clone(e[n])}else if(e instanceof Map){t=new Map;for(const[n,r]of e)t.set(n,d.clone(r))}else if(e instanceof Set){t=new Set;for(const n of e)t.add(d.clone(n))}else if(i.isObject(e)){t={};for(const n in e)t[n]=d.clone(e[n])}else t=e.toString();return t}return e},d.asArray=function(e){return Array.isArray(e)?e:[e]},d.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+u+'" is supported.');return Object.assign({Accept:u},e)},d.parseLinkHeader=e=>{const t={},n=e.match(a);for(let e=0;e<n.length;++e){let r=n[e].match(l);if(!r)continue;const i={target:r[1]},s=r[2];for(;r=c.exec(s);)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},d.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&&d.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})}},d.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!i.isArray(n)||n.length>0}return!1},d.hasValue=(e,t,n)=>{if(d.hasProperty(e,t)){let s=e[t];const o=r.isList(s);if(i.isArray(s)||o){o&&(s=s["@list"]);for(let e=0;e<s.length;++e)if(d.compareValues(n,s[e]))return!0}else if(!i.isArray(n))return d.compareValues(n,s)}return!1},d.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)d.addValue(e,t,n[i],r)}else if(e.hasOwnProperty(t)){const s=!r.allowDuplicate&&d.hasValue(e,t,n);i.isArray(e[t])||s&&!r.propertyIsArray||(e[t]=[e[t]]),s||(r.prependValue?e[t].unshift(n):e[t].push(n))}else e[t]=r.propertyIsArray?[n]:n},d.getValues=(e,t)=>[].concat(e[t]||[]),d.removeProperty=(e,t)=>{delete e[t]},d.removeValue=(e,t,n,r)=>{"propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1);const i=d.getValues(e,t).filter((e=>!d.compareValues(e,n)));0===i.length?d.removeProperty(e,t):1!==i.length||r.propertyIsArray?e[t]=i:e[t]=i[0]},d.relabelBlankNodes=(e,t)=>h((t=t||{}).issuer||new s("_:b"),e),d.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"],d.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},9325:(e,t,n)=>{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,s=r||i||Function("return this")();e.exports=s},9349:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.fromRdf=u,t.toRdf=function(e,t){return t&&"namedNode"in t&&(t={dataFactory:t}),(t=t||{})&&!t.dataFactory&&(t.dataFactory=l),c.toRdf(e,t)},t.getTermRaw=function(e,t){return"Literal"===e.termType?u(e,t):e.value},t.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},t.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()};const s=n(3617),o=n(4802),a=n(103);i(n(4802),t),i(n(5448),t),i(n(103),t);const l=new s.DataFactory,c=new a.Translator;function u(e,t){return c.fromRdf(e,t)}c.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map((e=>l.namedNode(e))),["string"]),c.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map((e=>l.namedNode(e))),["boolean"]),c.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map((e=>l.namedNode(e))),["number"]),c.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map((e=>l.namedNode(e))),["number"]),c.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map((e=>l.namedNode(e))),["object"])},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),s=n(4394),o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(s(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):o.test(e)?NaN:+e}},9378:e=>{const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",n="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:n,XSD_BOOLEAN:n+"boolean",XSD_DOUBLE:n+"double",XSD_INTEGER:n+"integer",XSD_STRING:n+"string"}},9749:(e,t,n)=>{const r=n(8799),i=Symbol("max"),s=Symbol("length"),o=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),f=Symbol("updateAgeOnGet"),p=()=>1,g=(e,t,n)=>{const r=e[h].get(t);if(r){const t=r.value;if(y(e,t)){if(b(e,r),!e[a])return}else n&&(e[f]&&(r.value.now=Date.now()),e[d].unshiftNode(r));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},m=e=>{if(e[s]>e[i])for(let t=e[d].tail;e[s]>e[i]&&null!==t;){const n=t.prev;b(e,t),t=n}},b=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[s]-=n.length,e[h].delete(n.key),e[d].removeNode(t)}};class v{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const w=(e,t,n,r)=>{let i=n.value;y(e,i)&&(b(e,n),e[a]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||p;if(this[o]="function"!=typeof t?p:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,m(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,m(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[o]&&(this[o]=e,this[s]=0,this[d].forEach((e=>{e.length=this[o](e.value,e.key),this[s]+=e.length}))),m(this)}get lengthCalculator(){return this[o]}get length(){return this[s]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let n=this[d].tail;null!==n;){const r=n.prev;w(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[d].head;null!==n;){const r=n.next;w(this,e,n,t),n=r}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach((e=>this[c](e.key,e.value))),this[h]=new Map,this[d]=new r,this[s]=0}dump(){return this[d].map((e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,a=this[o](t,e);if(this[h].has(e)){if(a>this[i])return b(this,this[h].get(e)),!1;const o=this[h].get(e).value;return this[c]&&(this[u]||this[c](e,o.value)),o.now=r,o.maxAge=n,o.value=t,this[s]+=a-o.length,o.length=a,this.get(e),m(this),!0}const f=new v(e,t,a,r,n);return f.length>this[i]?(this[c]&&this[c](e,t),!1):(this[s]+=f.length,this[d].unshift(f),this[h].set(e,this[d].head),m(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[d].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[h].forEach(((e,t)=>g(this,t,!1)))}}},9925:e=>{e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,n=e.slice();let r=null,i=0;const s=e.length;for(let n=0;n<s;++n){const o=e[n],a=t.get(o);(null===r||o>r)&&(a&&n>0&&o>e[n-1]||!a&&n<s-1&&o>e[n+1])&&(r=o,i=n)}if(null===r)this.done=!0;else{const n=t.get(r)?i-1:i+1;e[i]=e[n],e[n]=r;for(const n of e)n>r&&t.set(n,!t.get(n))}return n}}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{anyAtomicType:()=>Un,anySimpleType:()=>qn,anyURI:()=>cr,base64Binary:()=>lr,boolean:()=>Jn,byte:()=>wr,date:()=>tr,dateTime:()=>Zn,dateTimeStamp:()=>Rr,dayTimeDuration:()=>Tr,decimal:()=>Qn,double:()=>Kn,duration:()=>Yn,float:()=>Xn,gDay:()=>sr,gMonth:()=>or,gMonthDay:()=>ir,gYear:()=>rr,gYearMonth:()=>nr,hexBinary:()=>ar,int:()=>br,integer:()=>pr,language:()=>fr,long:()=>mr,negativeInteger:()=>yr,nonNegativeInteger:()=>_r,nonPositiveInteger:()=>gr,normalizedString:()=>dr,positiveInteger:()=>Er,short:()=>vr,string:()=>Wn,time:()=>er,token:()=>hr,unsignedByte:()=>Ir,unsignedInt:()=>Sr,unsignedLong:()=>xr,unsignedShort:()=>jr,yearMonthDuration:()=>Nr});const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",s="http://www.w3.org/2001/XMLSchema#",o="http://www.w3.org/2000/10/swap/",a={xsd:{decimal:`${s}decimal`,boolean:`${s}boolean`,double:`${s}double`,integer:`${s}integer`,string:`${s}string`},rdf:{type:`${i}type`,nil:`${i}nil`,first:`${i}first`,rest:`${i}rest`,langString:`${i}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${o}reify#forSome`,forAll:`${o}reify#forAll`},log:{implies:`${o}log#implies`,isImpliedBy:`${o}log#isImpliedBy`}},{rdf:l,xsd:c}=a;let u,d=0;const h={namedNode:x,blankNode:S,variable:I,literal:j,defaultGraph:function(){return u},quad:E,triple:E,fromTerm:N,fromQuad:T},f=h;class p{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof p?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class g extends p{get termType(){return"NamedNode"}}class y extends p{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 g(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?c.string:l.langString}equals(e){return e instanceof y?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 m extends p{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class b extends p{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}function v(e,t,n){if(t=t||h,!e)return t.defaultGraph();switch(e[0]){case"?":return t.variable(e.substr(1));case"_":return t.blankNode(e.substr(2));case'"':if(t===h)return new y(e);if('"'===e[e.length-1])return t.literal(e.substr(1,e.length-2));const r=e.lastIndexOf('"',e.length-1);return t.literal(e.substr(1,r-1),"@"===e[r+1]?e.substr(r+2):t.namedNode(e.substr(r+3)));case"[":e=JSON.parse(e);break;default:if(!n||!Array.isArray(e))return t.namedNode(e)}return t.quad(v(e[0],t,!0),v(e[1],t,!0),v(e[2],t,!0),e[3]&&v(e[3],t,!0))}function w(e,t){if("string"==typeof e)return e;if(e instanceof p&&"Quad"!==e.termType)return e.id;if(!e)return u.id;switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return`_:${e.value}`;case"Variable":return`?${e.value}`;case"DefaultGraph":return"";case"Literal":return`"${e.value}"${e.language?`@${e.language}`:e.datatype&&e.datatype.value!==c.string?`^^${e.datatype.value}`:""}`;case"Quad":const n=[w(e.subject,!0),w(e.predicate,!0),w(e.object,!0)];return e.graph&&"DefaultGraph"!==e.graph.termType&&n.push(w(e.graph,!0)),t?n:JSON.stringify(n);default:throw new Error(`Unexpected termType: ${e.termType}`)}}u=new class extends p{constructor(){return super(""),u||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class _ extends p{constructor(e,t,n,r){super(""),this._subject=e,this._predicate=t,this._object=n,this._graph=r||u}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 x(e){return new g(e)}function S(e){return new m(e||"n3-"+d++)}function j(e,t){if("string"==typeof t)return new y(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:"";return""===n&&("boolean"==typeof e?n=c.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?c.integer:c.double:(n=c.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),""===n||n===c.string?new y(`"${e}"`):new y(`"${e}"^^${n}`)}function I(e){return new b(e)}function E(e,t,n,r){return new _(e,t,n,r)}function N(e){if(e instanceof p)return e;switch(e.termType){case"NamedNode":return x(e.value);case"BlankNode":return S(e.value);case"Variable":return I(e.value);case"DefaultGraph":return u;case"Literal":return j(e.value,e.language||e.datatype);case"Quad":return T(e);default:throw new Error(`Unexpected termType: ${e.termType}`)}}function T(e){if(e instanceof _)return e;if("Quad"!==e.termType)throw new Error(`Unexpected termType: ${e.termType}`);return E(N(e.subject),N(e.predicate),N(e.object),N(e.graph))}const R="http://www.w3.org/ns/shacl#",O="http://datashapes.org/dash#",k="http://www.w3.org/2001/XMLSchema#",L="http://www.w3.org/1999/02/22-rdf-syntax-ns#",A="http://www.w3.org/2000/01/rdf-schema#",C="http://www.w3.org/2004/02/skos/core#",D="http://www.w3.org/2002/07/owl#",M=f.namedNode("shapes"),P=f.namedNode(L+"type"),$=f.namedNode("http://purl.org/dc/terms/conformsTo"),B=f.namedNode(A+"subClassOf"),F=f.namedNode(C+"broader"),q=f.namedNode(D+"imports"),U=f.namedNode(D+"NamedIndividual"),G=f.namedNode(R+"NodeShape"),H=f.namedNode(R+"IRI"),V=f.namedNode(R+"property"),z=f.namedNode(R+"class"),W=f.namedNode(R+"targetClass"),J=f.namedNode(R+"nodeKind");function Q(e,t,n=R,r){let i="";const s=function(e,t,n=R,r){let i;const s=n+t;if(null==r?void 0:r.length){for(const t of r)for(const n of e)if(n.predicate.value===s){if(n.object.id.endsWith(`@${t}`))return n.object;n.object.id.indexOf("@")<0?i=n.object:i||(i=n.object)}}else for(const t of e)if(t.predicate.value===s)return t.object;return i}(e,t,n,r);return s&&(i=s.value),i}function X(e,t){return Q(e,"prefLabel",C,t)||Q(e,"label",A,t)}function K(e,t,n,r){const i=[];for(const s of e)i.push({value:s,label:X(t.getQuads(s,null,null,null),n),indent:r});return i}function Y(e,t){for(const n in t)e=e.replace(t[n],"");return e}function Z(e,t,n,r,i=new Set){for(const s of t.owlImports)i.has(s.id)||(i.add(s.id),r.push(...n.getSubjects(P,e,s)));t.parent&&Z(e,t.parent,n,r,i)}function ee(e,t,n=0){let r;if(t.shaclIn){const e=t.config.lists[t.shaclIn];r=(null==e?void 0:e.length)?e:[]}else r=t.config.shapesGraph.getSubjects(P,e,M),r.push(...t.config.dataGraph.getSubjects(P,e,null)),Z(e,t,t.config.shapesGraph,r);const i=K(r,t.config.shapesGraph,t.config.languages,n);if(void 0===t.shaclIn){for(const r of t.config.shapesGraph.getSubjects(B,e,null))i.push(...ee(r,t,n+1));if(t.config.shapesGraph.getQuads(e,P,U,null).length>0){i.push(...K([e],t.config.shapesGraph,t.config.languages,n));for(const r of t.config.shapesGraph.getSubjects(F,e,null))i.push(...ee(r,t,n+1))}}return i}function te(e){let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}function ne(e,t,n){if(void 0===t)return n;if(void 0===n)return t;const r=e.indexOf(t.language);if(r<0)return n;const i=e.indexOf(n.language);return i<0||i>r?t:n}function re(e,t,n){const r=document.createElement("div");r.classList.add("shacl-or-constraint");const i=[];if(i.push({label:"--- please choose ---",value:""}),t instanceof Ae){const s=[];let o=!1;e.length&&(o=n.shapesGraph.getObjects(e[0],V,null).length>0);for(let r=0;r<e.length;r++)if(o){const o=n.shapesGraph.getObjects(e[r],V,null),a=[];let l="";for(const e of o){const r=new Ie(e,t,n);a.push(r),l+=(l.length>1?" / ":"")+r.template.label}s.push(a),i.push({label:l,value:r.toString()})}else{const o=new Ie(e[r],t,n);s.push([o]),i.push({label:o.template.label,value:r.toString()})}const a=n.theme.createListEditor("Please choose",null,!1,i),l=a.querySelector(".editor");l.onchange=()=>{if(l.value){const e=s[parseInt(l.value)];let t;e.length&&(t=e[0],r.replaceWith(e[0]));for(let n=1;n<e.length;n++)t.after(e[1]),t=e[1]}},r.appendChild(a)}else{const s=[];for(let t=0;t<e.length;t++){const r=n.shapesGraph.getQuads(e[t],null,null,null);r.length&&(s.push(r),i.push({label:X(r,n.languages)||Y(r[0].predicate.value,n.prefixes)+" = "+Y(r[0].object.value,n.prefixes),value:t.toString()}))}const o=n.theme.createListEditor(t.template.label+"?",null,!1,i,t.template),a=o.querySelector(".editor");a.onchange=()=>{a.value&&r.replaceWith(Ee(t.template.clone().merge(s[parseInt(a.value)]),void 0,!0))},r.appendChild(o)}return r}const ie={[`${R}name`]:(e,t)=>{const n=t;e.name=ne(e.config.languages,e.name,n)},[`${R}description`]:(e,t)=>{const n=t;e.description=ne(e.config.languages,e.description,n)},[`${R}path`]:(e,t)=>{e.path=t.value},[`${R}node`]:(e,t)=>{e.node=t},[`${R}datatype`]:(e,t)=>{e.datatype=t},[`${R}nodeKind`]:(e,t)=>{e.nodeKind=t},[`${R}minCount`]:(e,t)=>{e.minCount=parseInt(t.value)},[`${R}maxCount`]:(e,t)=>{e.maxCount=parseInt(t.value)},[`${R}minLength`]:(e,t)=>{e.minLength=parseInt(t.value)},[`${R}maxLength`]:(e,t)=>{e.maxLength=parseInt(t.value)},[`${R}minInclusive`]:(e,t)=>{e.minInclusive=parseInt(t.value)},[`${R}maxInclusive`]:(e,t)=>{e.maxInclusive=parseInt(t.value)},[`${R}minExclusive`]:(e,t)=>{e.minExclusive=parseInt(t.value)},[`${R}maxExclusive`]:(e,t)=>{e.maxExclusive=parseInt(t.value)},[`${R}pattern`]:(e,t)=>{e.pattern=t.value},[`${R}order`]:(e,t)=>{e.order=parseInt(t.value)},[`${O}singleLine`]:(e,t)=>{e.singleLine="true"===t.value},[`${O}readonly`]:(e,t)=>{e.readonly="true"===t.value},"http://www.w3.org/ns/oa#styleClass":(e,t)=>{e.cssClass=t.value},[`${R}and`]:(e,t)=>{e.shaclAnd=t.value},[`${R}in`]:(e,t)=>{e.shaclIn=t.value},[`${R}languageIn`]:(e,t)=>{e.languageIn=e.config.lists[t.value],e.datatype=f.namedNode(L+"langString")},[`${R}defaultValue`]:(e,t)=>{e.defaultValue=t},[`${R}hasValue`]:(e,t)=>{e.hasValue=t},[`${R}qualifiedValueShape`]:(e,t)=>{e.qualifiedValueShape=t},[`${R}qualifiedMinCount`]:(e,t)=>{e.minCount=parseInt(t.value)},[`${R}qualifiedMaxCount`]:(e,t)=>{e.maxCount=parseInt(t.value)},[q.id]:(e,t)=>{e.owlImports.push(t)},[z.id]:(e,t)=>{e.class=t;const n=e.config.shapesGraph.getSubjects(W,t,null);n.length>0&&(e.node=n[0])},[`${R}or`]:(e,t)=>{const n=e.config.lists[t.value];(null==n?void 0:n.length)?e.shaclOr=n:console.error("list for sh:or not found:",t.value,"existing lists:",e.config.lists)},[`${R}xone`]:(e,t)=>{const n=e.config.lists[t.value];(null==n?void 0:n.length)?e.shaclXone=n:console.error("list for sh:xone not found:",t.value,"existing lists:",e.config.lists)}};class se{constructor(e,t,n){this.label="",this.owlImports=[],this.parent=t,this.config=n,this.merge(e),this.qualifiedValueShape&&this.merge(n.shapesGraph.getQuads(this.qualifiedValueShape,null,null,null))}merge(e){var t,n;for(const n of e)null===(t=ie[n.predicate.id])||void 0===t||t.call(this,this,n.object);if(this.label=(null===(n=this.name)||void 0===n?void 0:n.value)||X(e,this.config.languages),this.label||this.shaclAnd||(this.label=this.path?Y(this.path,this.config.prefixes):"unknown"),(this.node||this.shaclAnd)&&(this.extendedShapes=[],this.node&&this.extendedShapes.push(this.node),this.shaclAnd)){const e=this.config.lists[this.shaclAnd];if(null==e?void 0:e.length)for(const t of e)this.extendedShapes.push(t)}return this}clone(){const e=Object.assign({},this);return e.owlImports=[...this.owlImports],this.languageIn&&(e.languageIn=[...this.languageIn]),this.shaclOr&&(e.shaclOr=[...this.shaclOr]),this.shaclXone&&(e.shaclXone=[...this.shaclXone]),e.merge=this.merge.bind(e),e.clone=this.clone.bind(e),e}}class oe{constructor(e){let t="form { box-sizing: border-box; display:block; --label-width: 8em; --caret-size: 10px; }\nform.mode-edit { padding-left: 1em; }\nform *, form ::after, form ::before { box-sizing: inherit; }\nshacl-node, .shacl-group { display: flex; flex-direction: column; width: 100%; position: relative; }\nshacl-node .control-button { text-decoration: none; cursor: pointer; border: 1px solid transparent; border-radius: 4px; padding: 2px 4px; }\nshacl-node .control-button:hover { border-color: inherit; }\nshacl-node .remove-button { margin-left: 4px; }\nshacl-node .add-button { font-size: 0.8rem; color: #555; margin: 4px 24px 0 0; }\nshacl-node .add-button:before { content: '+'; margin-right: 0.2em; }\nshacl-node .add-button:hover { color: inherit; }\nshacl-node h1 { font-size: 1.1rem; border-bottom: 1px solid; margin-top: 4px; color: #555; }\nshacl-property { display: flex; flex-direction: column; align-items: end; position: relative; }\nshacl-property:not(.may-add) > .add-button { display: none; }\nshacl-property:not(.may-remove) > .property-instance > .remove-button:not(.persistent) { visibility: hidden; }\nshacl-property:not(.may-remove) > .shacl-or-constraint > .remove-button:not(.persistent) { visibility: hidden; }\n.shacl-group { margin-bottom: 1em; padding-bottom: 1em; }\n.mode-view .shacl-group:not(:has(shacl-property)) { display: none; }\n.property-instance, .shacl-or-constraint { display: flex; align-items: flex-start; padding: 4px 0; width: 100%; position: relative; }\n.shacl-or-constraint label { display: inline-block; word-break: break-word; width: var(--label-width); line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; }\n.property-instance label[title] { cursor: help; text-decoration: underline dashed #AAA; }\n.mode-edit .property-instance label.required::before { color: red; content: '\\2736'; font-size: 0.6rem; position: absolute; left: -1.4em; top: 0.15rem; }\n.property-instance.valid::before { position: absolute; left: calc(var(--label-width) - 1em); top: 6px; color: green; content: '\\2713'; }\n.editor:not([type='checkbox']), .shacl-or-constraint select { flex-grow: 1; }\n.shacl-or-constraint select { border: 1px solid #DDD; padding: 2px 4px; }\nselect { overflow: hidden; text-overflow: ellipsis; }\ntextarea.editor { resize: vertical; }\n.lang-chooser { position: absolute; top: 5px; right: 24px; border: 0; background-color: #e9e9ed; padding: 2px 4px; max-width: 40px; width: 40px; box-sizing: content-box; }\n.lang-chooser+.editor { padding-right: 55px; }\n.validation-error { position: absolute; left: calc(var(--label-width) - 1em); top: 6px; color: red; cursor: help; }\n.validation-error::before { content: '\\26a0' }\n.validation-error.node { left: -1em; }\n.invalid > .editor { border-color: red !important; }\n.ml-0 { margin-left: 0 !important; }\n.pr-0 { padding-right: 0 !important; }\n.mode-view .property-instance:not(:first-child) > label { visibility: hidden; }\n.mode-view .property-instance label { width: var(--label-width); }\n\n.d-flex { display: flex; }\n.lang { opacity: 0.65; font-size: 0.6em; }\na, a:visited { color: inherit; }\n\n.fadeIn, .fadeOut { animation: fadeIn 0.2s ease-out; }\n.fadeOut { animation-direction: reverse; animation-timing-function: ease-out;}\n@keyframes fadeIn {\n 0% { opacity: 0; transform: scaleY(0.8); }\n 100% { opacity: 1; transform: scaleY(1); }\n}\n \n.collapsible > .activator { display: flex; justify-content: space-between; align-items: center; cursor: pointer; width: 100%; border: 0; padding: 8px 0; transition: 0.2s; }\n.collapsible > .activator:hover, .collapsible.open > .activator { background-color: #F5F5F5; }\n.collapsible > .activator::after { content:''; width: var(--caret-size); height: var(--caret-size); border-style: none solid solid none; border-width: calc(0.3 * var(--caret-size)); transform: rotate(45deg); transition: transform .15s ease-out; margin-right: calc(0.5 * var(--caret-size)); }\n.collapsible.open > .activator::after { transform: rotate(225deg); }\n.collapsible > *:not(.activator) { transition: all 0.2s ease-out; opacity: 1; }\n.collapsible:not(.open) > *:not(.activator) { max-height: 0; padding: 0; opacity: 0; overflow: hidden; }\n.collapsible > .property-instance > shacl-node > h1 { display: none; }\n.collapsible.open > .property-instance:nth-child(odd) { background-color: #F5F5F5; }\n.ref-link { cursor: pointer; }\n.ref-link:hover { text-decoration: underline; }\n.node-id-display { color: #999; font-size: 11px; }";e&&(t+="\n"+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t)}apply(e){}createViewer(e,t,n){const r=document.createElement("div"),i=document.createElement("label");i.innerHTML=e+":",n.description&&i.setAttribute("title",n.description.value),r.appendChild(i);let s,o=t.value,a=null;if(t instanceof g){const e=n.config.shapesGraph.getQuads(o,null,null,null);if(e.length){const t=X(e,n.config.languages);t&&(o=t)}}else t instanceof y&&(t.language?(a=document.createElement("span"),a.classList.add("lang"),a.innerText=`@${t.language}`):t.datatype.value===`${k}date`?o=new Date(Date.parse(t.value)).toDateString():t.datatype.value===`${k}dateTime`&&(o=new Date(Date.parse(t.value)).toLocaleString()));return te(t.value)?(s=document.createElement("a"),s.setAttribute("href",t.value)):s=document.createElement("div"),s.classList.add("d-flex"),s.innerText=o,a&&s.appendChild(a),r.appendChild(s),r}}function ae(e){return!!e&&"DefaultGraph"===e.termType}function le(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const ce=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,ue=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/;class de{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!ce.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!de.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",le(e)],n=[],r=[],i=/[^/?#]*([/?#])/y;let s,o=0,a=0,l=i.lastIndex=e.length;for(;!o&&!a&&(s=i.exec(this.base));)"#"===s[1]?a=i.lastIndex-1:(t.push(le(s[0]),"(?:"),n.push(")?"),"?"!==s[1]?r.push(l=i.lastIndex):(o=l=i.lastIndex,a=this.base.indexOf("#",o),this._pathReplacements[o]="?"));for(let e=0;e<r.length;e++)this._pathReplacements[r[e]]="../".repeat(r.length-e-1);return this._pathReplacements[r[r.length-1]]="./",this._baseLength=a>0?a:this.base.length,t.push(le(this.base.substring(l,this._baseLength)),o?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...t,...n].join(""))}toRelative(e){const t=this._getBaseMatcher().exec(e);if(!t)return e;const n=t[0].length;if(n===this._baseLength&&n===e.length)return"";const r=this._pathReplacements[n];if(r){const t=e.substring(n);return"?"===r||ue.test(t)?"./"===r&&/^[^?#]/.test(t)?t:r+t:e}return e.substring(n-1)}}const he=f.defaultGraph(),{rdf:fe,xsd:pe}=a,ge=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,ye=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,me={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class be extends p{equals(e){return e===this}}class ve{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=he,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new de(t.baseIRI)))}get _inDefaultGraph(){return he.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")+(he.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){let t="";for(const n of e)t+=this.quadToString(n.subject,n.predicate,n.object,n.graph);return t}_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._baseIri&&(t=this._baseIri.toRelative(t)),ge.test(t)&&(t=t.replace(ye,we));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(ge.test(t)&&(t=t.replace(ye,we)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===pe.string)return`"${t}"`}else switch(e.datatype.value){case pe.string:return`"${t}"`;case pe.boolean:if("true"===t||"false"===t)return t;break;case pe.integer:if(/^[+-]?\d+$/.test(t))return t;break;case pe.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case pe.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===fe.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)}${ae(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,he,r):this._writeQuad(e,t,n,r||he,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=le(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([_a-zA-Z0-9][\\-_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 be("[]");case 1:if(n=i[0],!(n.object instanceof be))return new be(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let t="[";for(let s=0;s<r;s++)n=i[s],n.predicate.equals(e)?t+=`, ${this._encodeObject(n.object)}`:(t+=`${(s?";\n ":"\n ")+this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)}`,e=n.predicate);return new be(`${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 be(`(${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 we(e){let t=me[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 _e(e){let t=e.shaclDatatype,n=e.value;return n?e.dataset.class||e.dataset.nodeKind===R+"IRI"?f.namedNode(n):(e.dataset.lang?t=e.dataset.lang:"number"===e.type?n=parseFloat(n):"file"===e.type&&e.binaryData?n=e.binaryData:"datetime-local"===e.type&&(n=new Date(n).toISOString().slice(0,19)),f.literal(n,t)):"checkbox"!==e.type&&"checkbox"!==e.getAttribute("type")||!(e.checked||parseInt(e.dataset.minCount||"0")>0)?void 0:f.literal(e.checked?"true":"false",t)}const xe={};function Se(e){void 0===e.predicate&&void 0===e.datatype?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',e):xe[`${e.predicate}^${e.datatype}`]=e}class je{constructor(e,t){this.predicate=e.predicate,this.datatype=e.datatype,t&&(this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t))}createViewer(e,t){return e.config.theme.createViewer(e.label,t,e)}}class Ie extends HTMLElement{constructor(e,t,n,r){var i;if(super(),this.template=new se(n.shapesGraph.getQuads(e,null,null,null),t,n),void 0!==this.template.order&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),n.editMode&&(this.addButton=document.createElement("a"),this.addButton.innerText=this.template.label,this.addButton.title="Add "+this.template.label,this.addButton.classList.add("control-button","add-button"),this.addButton.addEventListener("click",(e=>{const t=this.addPropertyInstance();t.classList.add("fadeIn"),this.updateControls(),function(e){var t;null===(t=e.querySelector("input,select,textarea"))||void 0===t||t.focus()}(t),setTimeout((()=>{t.classList.remove("fadeIn")}),200)})),this.appendChild(this.addButton)),this.template.path){const e=r?n.dataGraph.getQuads(r,this.template.path,null,null):[];let t=!1;for(const r of e){if(this.template.node){const e=n.shapesGraph.getObjects(this.template.node,W,null);if(e.length>0){let t=!1;for(let i=0;i<e.length&&!t;i++)n.dataGraph.getQuads(r.object,P,e[i],null).length>0&&(t=!0);if(!t)continue}}this.addPropertyInstance(r.object),this.template.hasValue&&r.object.equals(this.template.hasValue)&&(t=!0)}n.editMode&&this.template.hasValue&&!t&&this.addPropertyInstance(this.template.hasValue)}if(n.editMode&&(this.addEventListener("change",(()=>{this.updateControls()})),this.updateControls()),(null===(i=this.template.extendedShapes)||void 0===i?void 0:i.length)&&null!==this.template.config.attributes.collapse&&(!this.template.maxCount||this.template.maxCount>1)&&(n.editMode||this.childElementCount>0)){const e=this;e.classList.add("collapsible"),"open"===this.template.config.attributes.collapse&&e.classList.add("open");const t=document.createElement("h1");t.classList.add("activator"),t.innerText=this.template.label,t.addEventListener("click",(()=>{e.classList.toggle("open")})),this.prepend(t)}}addPropertyInstance(e){var t,n,r;let i;if((null===(t=this.template.shaclOr)||void 0===t?void 0:t.length)||(null===(n=this.template.shaclXone)||void 0===n?void 0:n.length)){const t=(null===(r=this.template.shaclOr)||void 0===r?void 0:r.length)?this.template.shaclOr:this.template.shaclXone;let n=!1;if(e){const r=function(e,t,n){if(t instanceof y){const r=t.datatype;for(const t of e){const e=n.shapesGraph.getQuads(t,null,null,null);for(const t of e)if(t.predicate.value===`${R}datatype`&&t.object.equals(r))return e}}else{const r=n.dataGraph.getObjects(t,P,null);r.push(...n.shapesGraph.getObjects(t,P,null));for(const t of e){const e=n.shapesGraph.getQuads(t,null,null,null);for(const t of e)if(r.length>0){if(t.predicate.value===`${R}node`)for(const i of r)if(n.shapesGraph.getQuads(t.object,W,i,null).length>0)return e;if(t.predicate.equals(z))for(const n of r)if(t.object.equals(n))return e}else if(t.predicate.equals(J)&&t.object.equals(H))return e}}return console.error("couldn't resolve sh:or/sh:xone on property for value",t),[]}(t,e,this.template.config);r.length&&(i=Ee(this.template.clone().merge(r),e,!0),n=!0)}n||(i=re(t,this,this.template.config),Ne(i,""))}else i=Ee(this.template,e);return this.template.config.editMode?this.insertBefore(i,this.addButton):this.appendChild(i),i}updateControls(){var e;let t,n=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length;0===n&&(!(null===(e=this.template.extendedShapes)||void 0===e?void 0:e.length)||void 0!==this.template.minCount&&this.template.minCount>0)&&(this.addPropertyInstance(),n=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length),t=void 0!==this.template.minCount?n>this.template.minCount:this.template.extendedShapes&&this.template.extendedShapes.length>0||n>1;const r=void 0===this.template.maxCount||n<this.template.maxCount;this.classList.toggle("may-remove",t),this.classList.toggle("may-add",r)}toRDF(e,t){for(const n of this.querySelectorAll(":scope > .property-instance")){const r=f.namedNode(n.dataset.path);if(n.firstChild instanceof Ae){const i=n.firstChild.toRDF(e);e.addQuad(t,r,i,this.template.config.valuesGraph)}else for(const i of n.querySelectorAll(":scope > .editor")){const n=_e(i);n&&e.addQuad(t,r,n,this.template.config.valuesGraph)}}}}function Ee(e,t,n=!1){var r,i;let s;if(null===(r=e.extendedShapes)||void 0===r?void 0:r.length){s=document.createElement("div"),s.classList.add("property-instance");for(const n of e.extendedShapes)s.appendChild(new Ae(n,e.config,t,e.parent,e.nodeKind,e.label))}else{const n=function(e,t){let n=xe[`${e}^${t}`];return n||(n=xe[`${e}^undefined`],n||xe[`undefined^${t}`])}(e.path,null===(i=e.datatype)||void 0===i?void 0:i.value);s=n?e.config.editMode?n.createEditor(e,t):n.createViewer(e,t):function(e,t){var n,r,i;if(e.config.editMode){const s=void 0!==e.minCount&&e.minCount>0;if(e.class)return e.config.theme.createListEditor(e.label,t,s,ee(e.class,e),e);if(e.shaclIn){const n=e.config.lists[e.shaclIn];if(null==n?void 0:n.length){const r=K(n,e.config.shapesGraph,e.config.languages);return e.config.theme.createListEditor(e.label,t,s,r,e)}console.error("list not found:",e.shaclIn,"existing lists:",e.config.lists)}if((null===(n=e.datatype)||void 0===n?void 0:n.value)===`${L}langString`||(null===(r=e.languageIn)||void 0===r?void 0:r.length))return e.config.theme.createLangStringEditor(e.label,t,s,e);switch(null===(i=e.datatype)||void 0===i?void 0:i.value.replace(k,"")){case"integer":case"float":case"double":case"decimal":return e.config.theme.createNumberEditor(e.label,t,s,e);case"date":case"dateTime":return e.config.theme.createDateEditor(e.label,t,s,e);case"boolean":return e.config.theme.createBooleanEditor(e.label,t,s,e);case"base64Binary":return e.config.theme.createFileEditor(e.label,t,s,e)}return e.config.theme.createTextEditor(e.label,t,s,e)}{if(t)return e.config.theme.createViewer(e.label,t,e);const n=document.createElement("div");return n.innerHTML="No value",n}}(e,t||null),s.classList.add("property-instance")}return e.config.editMode&&Ne(s,e.label,n),s.dataset.path=e.path,s}function Ne(e,t,n=!1){const r=document.createElement("a");r.innerText="×",r.classList.add("control-button","btn","remove-button"),r.title="Remove "+t,r.addEventListener("click",(t=>{e.classList.remove("fadeIn"),e.classList.add("fadeOut"),setTimeout((()=>{const t=e.parentElement;e.remove(),null==t||t.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}),200)})),n&&r.classList.add("persistent"),e.appendChild(r)}window.customElements.define("shacl-property",Ie);const Te={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Re;const Oe=new Uint8Array(16),ke=[];for(let e=0;e<256;++e)ke.push((e+256).toString(16).slice(1));const Le=function(e,t,n){if(Te.randomUUID&&!t&&!e)return Te.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!Re){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Re=crypto.getRandomValues.bind(crypto)}return Re(Oe)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){if((n=n||0)<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(ke[e[t+0]]+ke[e[t+1]]+ke[e[t+2]]+ke[e[t+3]]+"-"+ke[e[t+4]]+ke[e[t+5]]+"-"+ke[e[t+6]]+ke[e[t+7]]+"-"+ke[e[t+8]]+ke[e[t+9]]+"-"+ke[e[t+10]]+ke[e[t+11]]+ke[e[t+12]]+ke[e[t+13]]+ke[e[t+14]]+ke[e[t+15]]).toLowerCase()}(r)};class Ae extends HTMLElement{constructor(e,t,n,r,i,s){super(),this.owlImports=[],this.parent=r,this.config=t,this.shaclSubject=e;let o=n;if(!o){if(!i){const n=t.shapesGraph.getObjects(e,`${R}nodeKind`,null);n.length&&(i=n[0])}o=void 0===i&&t.attributes.valuesNamespace||(null==i?void 0:i.id)===`${R}IRI`?f.namedNode(t.attributes.valuesNamespace+Le()):f.blankNode(Le())}this.nodeId=o;const a=JSON.stringify([e,n]);if(n&&t.renderedNodes.has(a)){if(s&&null===t.attributes.collapse){const e=document.createElement("label");e.innerText=s,this.appendChild(e)}const e=document.createElement("a");e.innerText=n.id,e.classList.add("ref-link"),e.onclick=()=>{var e;null===(e=this.config.form.querySelector(`shacl-node[data-node-id='${this.nodeId.id}']`))||void 0===e||e.scrollIntoView()},this.appendChild(e),this.style.flexDirection="row"}else{n&&t.renderedNodes.add(a),this.dataset.nodeId=this.nodeId.id;const r=t.shapesGraph.getQuads(e,null,null,null);let i;if(null!==this.config.attributes.showNodeIds){const e=document.createElement("div");e.innerText=`id: ${this.nodeId.id}`,e.classList.add("node-id-display"),this.appendChild(e)}for(const e of r)switch(e.predicate.id){case V.id:this.addPropertyInstance(e.object,t,n);break;case`${R}and`:if(i=t.lists[e.object.value],null==i?void 0:i.length)for(const e of i)this.prepend(new Ae(e,t,n,this));else console.error("list not found:",e.object.value,"existing lists:",t.lists);break;case`${R}node`:this.prepend(new Ae(e.object,t,n,this));break;case`${R}targetClass`:this.targetClass=e.object;break;case q.id:this.owlImports.push(e.object);break;case`${R}or`:case`${R}xone`:this.tryResolve(e.object,n,t)}if(s){const e=document.createElement("h1");e.innerText=s,this.prepend(e)}}}toRDF(e,t){t||(t=this.nodeId);for(const n of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))n.toRDF(e,t);return this.targetClass&&e.addQuad(t,P,this.targetClass,this.config.valuesGraph),this.config.attributes.generateNodeShapeReference&&!this.parent&&e.addQuad(t,f.namedNode(this.config.attributes.generateNodeShapeReference),this.shaclSubject,this.config.valuesGraph),t}addPropertyInstance(e,t,n){let r=this;const i=t.shapesGraph.getQuads(e,`${R}group`,null,null);if(i.length>0){const e=i[0].object.value;if(t.groups.indexOf(e)>-1){let n=this.querySelector(`:scope > .shacl-group[data-subject='${e}']`);n||(n=function(e,t){const n=document.createElement("div");n.dataset.subject=e,n.classList.add("shacl-group");let r=e;const i=t.shapesGraph.getQuads(e,null,null,null),s=Q(i,"label",A,t.languages);s&&(r=s);const o=Q(i,"order");o&&(n.style.order=o);const a=document.createElement("h1");return a.innerText=r,n.appendChild(a),null!==t.attributes.collapse&&(n.classList.add("collapsible"),"open"===t.attributes.collapse&&n.classList.add("open"),a.classList.add("activator"),a.addEventListener("click",(()=>{n.classList.toggle("open")}))),n}(e,t),this.appendChild(n)),r=n}else console.warn("ignoring unknown group reference",i[0],"existing groups:",t.groups)}setTimeout((()=>{const i=new Ie(e,this,t,n);i.childElementCount>0&&r.appendChild(i)}))}tryResolve(e,t,n){const r=n.lists[e.value];if(null==r?void 0:r.length){let e=!1;if(t){const i=function(e,t,n){for(const r of e){let e=!0;const i=n.shapesGraph.getObjects(r,V,null);for(const r of i){const i=n.shapesGraph.getObjects(r,`${R}path`,null);for(const r of i){const i=n.dataGraph.getObjects(t,r,null);if(i.push(...n.shapesGraph.getObjects(t,r,null)),!i.length){e=!1;break}}}if(e)return i}return console.error("couldn't resolve sh:or/sh:xone on node for value",t),[]}(r,t,n);if(i.length){for(const e of i)this.addPropertyInstance(e,n,t);e=!0}}e||this.appendChild(re(r,this,n))}else console.error("list for sh:or/sh:xone not found:",e,"existing lists:",n.lists)}}window.customElements.define("shacl-node",Ae);var Ce=n(9198);const De=Symbol("iter");function Me(e,t,n=4){if(0===n)return Object.assign(e,t);for(const r in t)e[r]=Me(e[r]||Object.create(null),t[r],n-1);return e}function Pe(e,t,n=4){let r=!1;for(const i in e)if(i in t){const s=0===n?null:Pe(e[i],t[i],n-1);if(!1!==s)r=r||Object.create(null),r[i]=s;else if(3===n)return!1}return r}function $e(e,t,n=4){let r=!1;for(const i in e)if(i in t){if(0!==n){const s=$e(e[i],t[i],n-1);if(!1!==s)r=r||Object.create(null),r[i]=s;else if(3===n)return!1}}else r=r||Object.create(null),r[i]=0===n?null:Me({},e[i],n-1);return r}class Be{constructor(e={}){this._id=1,this._ids=Object.create(null),this._ids[""]=1,this._entities=Object.create(null),this._entities[1]="",this._blankNodeIndex=0,this._factory=e.factory||f}_termFromId(e){if("."===e[0]){const t=this._entities,n=e.split(".");return this._factory.quad(this._termFromId(t[n[1]]),this._termFromId(t[n[2]]),this._termFromId(t[n[3]]),n[4]&&this._termFromId(t[n[4]]))}return v(e,this._factory)}_termToNumericId(e){if("Quad"===e.termType){const t=this._termToNumericId(e.subject),n=this._termToNumericId(e.predicate),r=this._termToNumericId(e.object);let i;return t&&n&&r&&(ae(e.graph)||(i=this._termToNumericId(e.graph)))&&this._ids[i?`.${t}.${n}.${r}.${i}`:`.${t}.${n}.${r}`]}return this._ids[w(e)]}_termToNewNumericId(e){const t=e&&"Quad"===e.termType?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${ae(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:w(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,n;if(e)for(t=e=`_:${e}`,n=1;this._ids[t];)t=e+n++;else do{t="_:b"+this._blankNodeIndex++}while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}}class Fe{constructor(e,t){this._size=0,this._graphs=Object.create(null),t||!e||e[0]||"function"==typeof e.match||(t=e,e=null),t=t||{},this._factory=t.factory||f,this._entityIndex=t.entityIndex||new Be({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let n,r;for(const i in t)for(const s in n=t[i].subjects)for(const t in r=n[s])e+=Object.keys(r[t]).length;return this._size=e}_addToIndex(e,t,n,r){const i=e[t]||(e[t]={}),s=i[n]||(i[n]={}),o=r in s;return o||(s[r]=null),!o}_removeFromIndex(e,t,n,r){const i=e[t],s=i[n];delete s[r];for(const e in s)return;delete i[n];for(const e in i)return;delete e[t]}*_findInIndex(e,t,n,r,i,s,o,a){let l,c,u;const d=this._entities,h=this._termFromId(d[a]),f={subject:null,predicate:null,object:null};t&&((l=e,e={})[t]=l[t]);for(const t in e)if(c=e[t]){f[i]=this._termFromId(d[t]),n&&((l=c,c={})[n]=l[n]);for(const e in c)if(u=c[e]){f[s]=this._termFromId(d[e]);const t=r?r in u?[r]:[]:Object.keys(u);for(let e=0;e<t.length;e++)f[o]=this._termFromId(d[t[e]]),yield this._factory.quad(f.subject,f.predicate,f.object,h)}}}_loop(e,t){for(const n in e)t(n)}_loopByKey0(e,t,n){let r,i;if(r=e[t])for(i in r)n(i)}_loopByKey1(e,t,n){let r,i;for(r in e)i=e[r],i[t]&&n(r)}_loopBy2Keys(e,t,n,r){let i,s,o;if((i=e[t])&&(s=i[n]))for(o in s)r(o)}_countInIndex(e,t,n,r){let i,s,o,a=0;t&&((i=e,e={})[t]=i[t]);for(const t in e)if(s=e[t]){n&&((i=s,s={})[n]=i[n]);for(const e in s)(o=s[e])&&(r?r in o&&a++:a+=Object.keys(o).length)}return a}_getGraphs(e){return"number"!=typeof(e=""===e?1:e&&(this._termToNumericId(e)||-1))?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){const t=Object.create(null);return n=>{n in t||(t[n]=!0,e(this._termFromId(this._entities[n],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,n,r){t||(r=e.graph,n=e.object,t=e.predicate,e=e.subject),r=r?this._termToNewNumericId(r):1;let i=this._graphs[r];return i||(i=this._graphs[r]={subjects:{},predicates:{},objects:{}},Object.freeze(i)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),n=this._termToNewNumericId(n),!!this._addToIndex(i.subjects,e,t,n)&&(this._addToIndex(i.predicates,t,n,e),this._addToIndex(i.objects,n,e,t),this._size=null,!0)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}delete(e){return this.removeQuad(e),this}has(e,t,n,r){return e&&e.subject&&({subject:e,predicate:t,object:n,graph:r}=e),!this.readQuads(e,t,n,r).next().done}import(e){return e.on("data",(e=>{this.addQuad(e)})),e}removeQuad(e,t,n,r){t||({subject:e,predicate:t,object:n,graph:r}=e),r=r?this._termToNumericId(r):1;const i=this._graphs;let s,o,a;if(!((e=e&&this._termToNumericId(e))&&(t=t&&this._termToNumericId(t))&&(n=n&&this._termToNumericId(n))&&(s=i[r])&&(o=s.subjects[e])&&(a=o[t])&&n in a))return!1;for(e in this._removeFromIndex(s.subjects,e,t,n),this._removeFromIndex(s.predicates,t,n,e),this._removeFromIndex(s.objects,n,e,t),null!==this._size&&this._size--,s.subjects)return!0;return delete i[r],!0}removeQuads(e){for(let t=0;t<e.length;t++)this.removeQuad(e[t])}remove(e){return e.on("data",(e=>{this.removeQuad(e)})),e}removeMatches(e,t,n,r){const i=new Ce.Readable({objectMode:!0}),s=this.readQuads(e,t,n,r);return i._read=e=>{for(;--e>=0;){const{done:e,value:t}=s.next();if(e)return void i.push(null);i.push(t)}},this.remove(i)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,n,r){return[...this.readQuads(e,t,n,r)]}*readQuads(e,t,n,r){const i=this._getGraphs(r);let s,o,a,l;if(!(e&&!(o=this._termToNumericId(e))||t&&!(a=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n))))for(const e in i)(s=i[e])&&(o?l?yield*this._findInIndex(s.objects,l,o,a,"object","subject","predicate",e):yield*this._findInIndex(s.subjects,o,a,null,"subject","predicate","object",e):a?yield*this._findInIndex(s.predicates,a,l,null,"predicate","object","subject",e):l?yield*this._findInIndex(s.objects,l,null,null,"object","subject","predicate",e):yield*this._findInIndex(s.subjects,null,null,null,"subject","predicate","object",e))}match(e,t,n,r){return new Ue(this,e,t,n,r,{entityIndex:this._entityIndex})}countQuads(e,t,n,r){const i=this._getGraphs(r);let s,o,a,l,c=0;if(e&&!(o=this._termToNumericId(e))||t&&!(a=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n)))return 0;for(const r in i)(s=i[r])&&(c+=e?n?this._countInIndex(s.objects,l,o,a):this._countInIndex(s.subjects,o,a,l):t?this._countInIndex(s.predicates,a,l,o):this._countInIndex(s.objects,l,o,a));return c}forEach(e,t,n,r,i){this.some((t=>(e(t,this),!1)),t,n,r,i)}every(e,t,n,r,i){return!this.some((t=>!e(t,this)),t,n,r,i)}some(e,t,n,r,i){for(const s of this.readQuads(t,n,r,i))if(e(s,this))return!0;return!1}getSubjects(e,t,n){const r=[];return this.forSubjects((e=>{r.push(e)}),e,t,n),r}forSubjects(e,t,n,r){const i=this._getGraphs(r);let s,o,a;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(a=this._termToNumericId(n))))for(r in i)(s=i[r])&&(o?a?this._loopBy2Keys(s.predicates,o,a,e):this._loopByKey1(s.subjects,o,e):a?this._loopByKey0(s.objects,a,e):this._loop(s.subjects,e))}getPredicates(e,t,n){const r=[];return this.forPredicates((e=>{r.push(e)}),e,t,n),r}forPredicates(e,t,n,r){const i=this._getGraphs(r);let s,o,a;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(a=this._termToNumericId(n))))for(r in i)(s=i[r])&&(o?a?this._loopBy2Keys(s.objects,a,o,e):this._loopByKey0(s.subjects,o,e):a?this._loopByKey1(s.predicates,a,e):this._loop(s.predicates,e))}getObjects(e,t,n){const r=[];return this.forObjects((e=>{r.push(e)}),e,t,n),r}forObjects(e,t,n,r){const i=this._getGraphs(r);let s,o,a;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(a=this._termToNumericId(n))))for(r in i)(s=i[r])&&(o?a?this._loopBy2Keys(s.subjects,o,a,e):this._loopByKey1(s.objects,o,e):a?this._loopByKey0(s.predicates,a,e):this._loop(s.objects,e))}getGraphs(e,t,n){const r=[];return this.forGraphs((e=>{r.push(e)}),e,t,n),r}forGraphs(e,t,n,r){for(const i in this._graphs)this.some((t=>(e(t.graph),!0)),t,n,r,this._termFromId(this._entities[i]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const n={},r=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},i=this.getQuads(null,a.rdf.rest,a.rdf.nil,null),s=e?[...i]:[];return i.forEach((t=>{const i=[];let o,l,c=!1;const u=t.graph;let d=t.subject;for(;d&&!c;){const e=this.getQuads(null,null,d,null),t=this.getQuads(d,null,null,null);let n,h=null,f=null,p=null;for(let i=0;i<t.length&&!c;i++)n=t[i],n.graph.equals(u)?o?c=r(d,"has non-list arcs out"):n.predicate.value===a.rdf.first?h?c=r(d,"has multiple rdf:first arcs"):s.push(h=n):n.predicate.value===a.rdf.rest?f?c=r(d,"has multiple rdf:rest arcs"):s.push(f=n):e.length?c=r(d,"can't be subject and object"):(o=n,l="subject"):c=r(d,"not confined to single graph");for(let t=0;t<e.length&&!c;++t)n=e[t],o?c=r(d,"can't have coreferences"):n.predicate.value===a.rdf.rest?p?c=r(d,"has incoming rdf:rest arcs"):p=n:(o=n,l="object");h?i.unshift(h.object):c=r(d,"has no list head"),d=p&&p.subject}c?e=!1:o&&(n[o[l].value]=i)})),e&&this.removeQuads(s),n}addAll(e){if(e instanceof Ue&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof Fe&&e._entityIndex===this._entityIndex)0!==e._size&&(this._graphs=Me(this._graphs,e._graphs),this._size=null);else for(const t of e)this.add(t);return this}contains(e){if(e instanceof Ue&&(e=e.filtered),e===this)return!0;if(!(e instanceof Fe)||this._entityIndex!==e._entityIndex)return e.every((e=>this.has(e)));const t=this._graphs,n=e._graphs;let r,i,s,o,a;for(const e in n){if(!(r=t[e]))return!1;r=r.subjects;for(const t in i=n[e].subjects){if(!(s=r[t]))return!1;for(const e in o=i[t]){if(!(a=s[e]))return!1;for(const t in o[e])if(!(t in a))return!1}}}return!0}deleteMatches(e,t,n,r){for(const i of this.match(e,t,n,r))this.removeQuad(i);return this}difference(e){if(e&&e instanceof Ue&&(e=e.filtered),e===this)return new Fe({entityIndex:this._entityIndex});if(e instanceof Fe&&e._entityIndex===this._entityIndex){const t=new Fe({entityIndex:this._entityIndex}),n=$e(this._graphs,e._graphs);return n&&(t._graphs=n,t._size=null),t}return this.filter((t=>!e.has(t)))}equals(e){return e instanceof Ue&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new Fe({entityIndex:this._entityIndex});for(const n of this)e(n,this)&&t.add(n);return t}intersection(e){if(e instanceof Ue&&(e=e.filtered),e===this){const e=new Fe({entityIndex:this._entityIndex});return e._graphs=Me(Object.create(null),this._graphs),e._size=this._size,e}if(e instanceof Fe&&this._entityIndex===e._entityIndex){const t=new Fe({entityIndex:this._entityIndex}),n=Pe(e._graphs,this._graphs);return n&&(t._graphs=n,t._size=null),t}return this.filter((t=>e.has(t)))}map(e){const t=new Fe({entityIndex:this._entityIndex});for(const n of this)t.add(e(n,this));return t}reduce(e,t){const n=this.readQuads();let r=void 0===t?n.next().value:t;for(const t of n)r=e(r,t,this);return r}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return(new ve).quadsToString(this)}union(e){const t=new Fe({entityIndex:this._entityIndex});return t._graphs=Me(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function qe(e,t,n=0){const r=t[n];if(r&&!(r in e))return!1;let i=!1;for(const s in r?{[r]:e[r]}:e){const r=2===n?null:qe(e[s],t,n+1);!1!==r&&(i=i||Object.create(null),i[s]=r)}return i}class Ue extends Ce.Readable{constructor(e,t,n,r,i,s){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:n,object:r,graph:i,options:s})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:n,predicate:r,subject:i}=this,s=this._filtered=new Fe({factory:e._factory,entityIndex:this.options.entityIndex});let o,a,l;if(i&&!(o=s._termToNumericId(i))||r&&!(a=s._termToNumericId(r))||n&&!(l=s._termToNumericId(n)))return s;const c=e._getGraphs(t);for(const e in c){let t,n,r,i;(i=c[e])&&(!o&&a?(n=qe(i.predicates,[a,l,o]))&&(t=qe(i.subjects,[o,a,l]),r=qe(i.objects,[l,o,a])):l?(r=qe(i.objects,[l,o,a]))&&(t=qe(i.subjects,[o,a,l]),n=qe(i.predicates,[a,l,o])):(t=qe(i.subjects,[o,a,l]))&&(n=qe(i.predicates,[a,l,o]),r=qe(i.objects,[l,o,a])),t&&(s._graphs[e]={subjects:t,predicates:n,objects:r}))}s._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[De]&&(this[De]=this[Symbol.iterator]());const t=this[De];for(;--e>=0;){const{done:e,value:n}=t.next();if(e)return void this.push(null);this.push(n)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,t,n,r){return this.filtered.deleteMatches(e,t,n,r)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,n,r,i){return this.filtered.every(e,t,n,r,i)}filter(e){return this.filtered.filter(e)}forEach(e,t,n,r,i){return this.filtered.forEach(e,t,n,r,i)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,n,r,i){return this.filtered.some(e,t,n,r,i)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return(new ve).quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,n,r){return new Ue(this.filtered,e,t,n,r,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}var Ge=n(8287);const{xsd:He}=a,Ve=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,ze={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},We=/[\x00-\x20<>\\"\{\}\|\^\`]/,Je={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Qe=/$0^/;class Xe{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in Je)&&this[e]instanceof RegExp&&(this[e]=Qe)}else this._n3Mode=!1!==e.n3;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let n=this._input,r=n.length;for(;;){let e,o;for(;e=this._newline.exec(n);)this.comments&&(o=this._comment.exec(e[0]))&&i("comment",o[1],"",this._line,e[0].length),n=n.substr(e[0].length,n.length),r=n.length,this._line++;if(!e&&(e=this._whitespace.exec(n))&&(n=n.substr(e[0].length,n.length)),this._endOfFile.test(n))return t&&(this.comments&&(o=this._comment.exec(n))&&i("comment",o[1],"",this._line,n.length),n=null,i("eof","","",this._line,0)),this._input=n;const a=this._line,l=n[0];let c="",u="",d="",h=null,f=0,p=!1;switch(l){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(f=1,c="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){p=!0;break}case"<":if(h=this._unescapedIri.exec(n))c="IRI",u=h[1];else if(h=this._iri.exec(n)){if(u=this._unescape(h[1]),null===u||We.test(u))return s(this);c="IRI"}else n.length>1&&"<"===n[1]?(c="<<",f=2):this._n3Mode&&n.length>1&&"="===n[1]&&(f=2,this._isImpliedBy?(c="abbreviation",u="<"):(c="inverse",u=">"));break;case">":n.length>1&&">"===n[1]&&(c=">>",f=2);break;case"_":((h=this._blank.exec(n))||t&&(h=this._blank.exec(`${n} `)))&&(c="blank",d="_",u=h[1]);break;case'"':if(h=this._simpleQuotedString.exec(n))u=h[1];else if(({value:u,matchLength:f}=this._parseLiteral(n)),null===u)return s(this);null===h&&0===f||(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(h=this._simpleApostropheString.exec(n))u=h[1];else if(({value:u,matchLength:f}=this._parseLiteral(n)),null===u)return s(this);null===h&&0===f||(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(h=this._variable.exec(n))&&(c="var",u=h[0]);break;case"@":"literal"===this._previousMarker&&(h=this._langcode.exec(n))?(c="langcode",u=h[1]):(h=this._keyword.exec(n))&&(c=h[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){c=".",f=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(h=this._number.exec(n)||t&&(h=this._number.exec(`${n} `)))&&(c="literal",u=h[0],d="string"==typeof h[1]?He.double:"string"==typeof h[2]?He.decimal:He.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(h=this._sparqlKeyword.exec(n))?c=h[0].toUpperCase():p=!0;break;case"f":case"t":(h=this._boolean.exec(n))?(c="literal",u=h[0],d=He.boolean):p=!0;break;case"a":(h=this._shortPredicates.exec(n))?(c="abbreviation",u="a"):p=!0;break;case"=":this._n3Mode&&n.length>1&&(c="abbreviation",">"!==n[1]?(f=1,u="="):(f=2,u=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(f=1,c=l);break;case"{":!this._lineMode&&n.length>=2&&("|"===n[1]?(c="{|",f=2):(c=l,f=1));break;case"|":n.length>=2&&"}"===n[1]&&(c="|}",f=2);break;default:p=!0}if(p&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(h=this._prefix.exec(n))?((h=this._prefixed.exec(n))||t&&(h=this._prefixed.exec(`${n} `)))&&(c="prefixed",d=h[1]||"",u=this._unescape(h[2])):(c="prefix",u=h[1]||"")),"^^"===this._previousMarker)switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?s(this):this._input=n;const g=f||h[0].length,y=i(c,u,d,a,g);this.previousToken=y,this._previousMarker=c,n=n.substr(g,n.length)}function i(t,i,s,o,a){const l=n?r-n.length:r,c={type:t,value:i,prefix:s,line:o,start:l,end:l+a};return e(null,c),c}function s(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1;const n=e.replace(Ve,((e,n,r,i)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof r){let e=Number.parseInt(r,16);return e<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in ze?ze[i]:(t=!0,"")}));return t?null:n}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length;let r=Math.max(this._literalClosingPos,n);for(;(r=e.indexOf(t,r))>0;){let t=0;for(;"\\"===e[r-t-1];)t++;if(t%2==0){const t=e.substring(n,r),i=t.split(/\r\n|\r|\n/).length-1,s=r+n;if(1===n&&0!==i||3===n&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:s}}r++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((n,r)=>n?t=n:e.push(r)),!0),t)throw t;return e}queueMicrotask((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=Ge.Buffer.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}let Ke=0;class Ye{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&et(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(t),r=/trig/.test(t),i=/triple/.test(t),s=/quad/.test(t),o=this._n3Mode=/n3/.test(t),a=i||s;(this._supportsNamedGraphs=!(n||o))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||r||i||o),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=""===t||/star|\*$/.test(t),a&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Xe({lineMode:a,n3:o,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Ke=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,n,r,i){const s=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:r,object:i,graph:t,inverse:!!s&&this._inversePredicate,blankPrefix:s?this._prefixes._:"",quantified:s?this._quantified:null}),s&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let n;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);n=this._factory.namedNode(t);break;case"type":case"prefixed":const r=this._prefixes[e.prefix];if(void 0===r)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._factory.namedNode(r+e.value);break;case"blank":n=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,n=null,r=this._readListItem;const i=this._subject,s=this._contextStack,o=s[s.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),r=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),0!==s.length&&"list"===s[s.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(r=this._readPredicate,this._subject===this.RDF_NIL)return r}else if(r=this._getContextEndReader(),this._object===this.RDF_NIL)return r;n=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,r=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),r=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._factory.blankNode()),null===i?null===o.predicate?o.subject=n:o.object=n:this._emit(i,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return r}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const n=this._readEntity(e);if(void 0===n)return;t=this._factory.literal(this._literalValue,n),e=null;break;case"langcode":t=this._factory.literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,n=this._graph;const r=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const s=this._predicate,o=this._object;this._subject=this._factory.quad(r,s,o,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if("Quad"!==this._subject.termType)return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==r){const e=this._predicate,t=this._object;i?this._emit(t,e,r,n):this._emit(r,e,t,n)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,n;const r=this._factory.blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}_readBackwardPath(e){const t=this._factory.blankNode();let n,r;if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(r=this._subject,this._subject=t):(r=this._object,this._object=t),this._emit(t,n,r,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,n,r){this._callback(null,this._factory.quad(e,t,n,r||this.DEFAULTGRAPH))}_error(e,t){const n=new Error(`${e} on line ${t.line}.`);n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=Ze}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let n="",r=-1,i=-1,s=0,o="/";for(;r<t;){switch(o){case":":if(i<0&&"/"===e[++r]&&"/"===e[++r])for(;(i=r+1)<t&&"/"!==e[i];)r=i;break;case"?":case"#":r=t;break;case"/":if("."===e[r+1])switch(o=e[1+ ++r],o){case"/":n+=e.substring(s,r-1),s=r+1;break;case void 0:case"?":case"#":return n+e.substring(s,r)+e.substr(r+1);case".":if(o=e[1+ ++r],void 0===o||"/"===o||"?"===o||"#"===o){if(n+=e.substring(s,r-2),(s=n.lastIndexOf("/"))>=i&&(n=n.substr(0,s)),"/"!==o)return`${n}/${e.substr(r+1)}`;s=r+1}}}o=e[++r]}return n+e.substring(s)}parse(e,t,n){let r,i,s;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(r=t.onQuad,i=t.onPrefix,s=t.onComment):(r=t,i=n),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Ke++}_`,this._prefixCallback=i||Ze,this._inversePredicate=!1,this._quantified=Object.create(null),!r){const t=[];let n;if(this._callback=(e,r)=>{e?n=e:r&&t.push(r)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),n)throw n;return t}let o=(e,t)=>{null!==e?(this._callback(e),this._callback=Ze):this._readCallback&&(this._readCallback=this._readCallback(t))};s&&(this._lexer.comments=!0,o=(e,t)=>{null!==e?(this._callback(e),this._callback=Ze):this._readCallback&&("comment"===t.type?s(t.value):this._readCallback=this._readCallback(t))}),this._callback=r,this._lexer.tokenize(e,o)}}function Ze(){}function et(e,t){e._factory=t,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=t.namedNode(a.rdf.first),e.RDF_REST=t.namedNode(a.rdf.rest),e.RDF_NIL=t.namedNode(a.rdf.nil),e.N3_FORALL=t.namedNode(a.r.forAll),e.N3_FORSOME=t.namedNode(a.r.forSome),e.ABBREVIATIONS={a:t.namedNode(a.rdf.type),"=":t.namedNode(a.owl.sameAs),">":t.namedNode(a.log.implies),"<":t.namedNode(a.log.isImpliedBy)},e.QUANTIFIERS_GRAPH=t.namedNode("urn:n3:quantifiers")}et(Ye.prototype,f);var tt=n(4841),nt=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};const rt={},it={};let st;class ot{constructor(e){this.loadedExternalUrls=[],this.loadedClasses=[],this.config=e}loadGraphs(){return nt(this,void 0,void 0,(function*(){this.loadedExternalUrls=[],this.loadedClasses=[];let e=st;const t=new Fe;this.config.prefixes={};const n=[this.importRDF(this.config.attributes.values?this.config.attributes.values:this.config.attributes.valuesUrl?this.fetchRDF(this.config.attributes.valuesUrl):"",t,void 0,new Ye({blankNodePrefix:""}))];if(e||(e=new Fe,n.push(this.importRDF(this.config.attributes.shapes?this.config.attributes.shapes:this.config.attributes.shapesUrl?this.fetchRDF(this.config.attributes.shapesUrl):"",e,M))),yield Promise.all(n),!st&&0==(null==e?void 0:e.size)&&this.config.attributes.valuesSubject){const n=[...t.getObjects(this.config.attributes.valuesSubject,P,null),...t.getObjects(this.config.attributes.valuesSubject,$,null)],r=[];for(const t of n){const n=this.toURL(t.value);n&&this.loadedExternalUrls.indexOf(n)<0&&(this.loadedExternalUrls.push(n),r.push(this.importRDF(this.fetchRDF(n),e,M)))}try{yield Promise.allSettled(r)}catch(e){console.warn(e)}}this.config.shapesGraph=e,this.config.dataGraph=t}))}importRDF(e,t,n,r){return nt(this,void 0,void 0,(function*(){const i=r||new Ye,s=e=>nt(this,void 0,void 0,(function*(){const s=[];yield new Promise(((o,a)=>{i.parse(e,((e,i,l)=>{if(e)return console.warn("failed parsing graph",n,e.message),a(e);if(i){if(t.add(new _(i.subject,i.predicate,i.object,n)),null===this.config.attributes.ignoreOwlImports&&q.equals(i.predicate)){const e=this.toURL(i.object.value);e&&this.loadedExternalUrls.indexOf(e)<0&&(this.loadedExternalUrls.push(e),s.push(this.importRDF(this.fetchRDF(e),t,f.namedNode(e),r)))}if(this.config.classInstanceProvider&&z.equals(i.predicate)){const e=i.object.value;if(this.loadedClasses.indexOf(e)<0){let i;e in it?i=it[e]:(i=this.config.classInstanceProvider(e),it[e]=i),this.loadedClasses.push(e),s.push(this.importRDF(i,t,n,r))}}}else l&&this.config.registerPrefixes(l),o(null)}))}));try{yield Promise.allSettled(s)}catch(e){console.warn(e)}}));if(e instanceof Promise&&(e=yield e),e){try{e=yield(0,tt.toRDF)(JSON.parse(e),{format:"application/n-quads"})}catch(e){}yield s(e)}}))}fetchRDF(e){return nt(this,void 0,void 0,(function*(){if(e in rt)return rt[e];const t=fetch(e,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then((e=>e.text()));return rt[e]=t,t}))}toURL(e){if(te(e))return e;if(this.config.prefixes){const t=e.split(":");if(2===t.length){const n=this.config.prefixes[t[0]];if(n&&te(e=e.replace(`${t[0]}:`,n)))return e}}return null}}function at(e){st=e}class lt{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.valuesGraph=null,this.view=null,this.language=null,this.loading="Loading…",this.ignoreOwlImports=null,this.collapse=null,this.submitButton=null,this.generateNodeShapeReference=null,this.showNodeIds=null}}class ct{constructor(e,t){this.attributes=new lt,this.loader=new ot(this),this.prefixes={},this.editMode=!0,this.dataGraph=new Fe,this.lists={},this.groups=[],this.renderedNodes=new Set,this._shapesGraph=new Fe,this.theme=e,this.form=t,this.languages=[...new Set(navigator.languages.flatMap((e=>e.length>2?[e.toLocaleLowerCase(),e.substring(0,2)]:e))),""]}updateAttributes(e){const t=new lt;if(Object.keys(t).forEach((n=>{const r=e.dataset[n];void 0!==r&&(t[n]=r)})),this.editMode=null===t.view,this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){const e=this.languages.indexOf(t.language);e>-1&&this.languages.splice(e,1),this.languages.unshift(t.language)}this.valuesGraph=t.valuesGraph?f.namedNode(t.valuesGraph):void 0}static dataAttributes(){const e=new lt;return Object.keys(e).map((e=>"data-"+e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))))}get shapesGraph(){return this._shapesGraph}set shapesGraph(e){this._shapesGraph=e,this.lists=e.extractLists(),this.groups=[],e.forSubjects((e=>{this.groups.push(e.id)}),P,`${R}PropertyGroup`,null)}registerPrefixes(e){for(const t in e)t&&(this.prefixes[t]=e[t])}}const ut=function(e){return"<"+e.value+">"},dt=/["\\\\\n\r]/,ht=/["\\\\\n\r]/g,ft={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function pt(e){return ft[e]}const gt=function e(t){if(!t)return null;if("BlankNode"===t.termType)return function(e){return"_:"+e.value}(t);if("DefaultGraph"===t.termType)return"";if("Literal"===t.termType)return function(e){const t=(n=e.value,dt.test(n)?n.replace(ht,pt):n);var n;return"http://www.w3.org/2001/XMLSchema#string"===e.datatype.value?'"'+t+'"':"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"===e.datatype.value?'"'+t+'"@'+e.language:'"'+t+'"^^'+ut(e.datatype)}(t);if("NamedNode"===t.termType)return ut(t);if("Quad"===t.termType||t.subject&&t.predicate&&t.object&&t.graph)return function(e,t){const n=t(e.subject),r=t(e.predicate),i=t(e.object),s=t(e.graph);return`${n} ${r} ${i} ${s?s+" ":""}.`}(t,e);if("Variable"===t.termType)return function(e){return"?"+e.value}(t);if(t[Symbol.iterator])return function(e,t){return[...e].map((e=>t(e))).join("\n")+"\n"}(t,e);throw new Error(`unknown termType ${t.termType}`)};class yt{constructor(e){if(this.index=new Map,e)for(const[t,n]of e)this.set(t,n)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(gt(e))}*entries(){for(const[,{term:e,value:t}]of this.index)yield[e,t]}forEach(e,t){for(const n of this.entries())e.call(t,n[1],n[0],this)}get(e){const t=this.index.get(gt(e));return t&&t.value}has(e){return this.index.has(gt(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,t){const n=gt(e);return this.index.set(n,{term:e,value:t}),this}*values(){for(const[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}const mt=yt;function bt(e){try{return gt(e)}catch(e){return null}}class vt{constructor(e){if(this.index=new Map,e)for(const t of e)this.add(t)}get size(){return this.index.size}add(e){const t=gt(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return!!e&&this.index.delete(bt(e))}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return!!e&&this.index.has(bt(e))}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}const wt=vt,_t=class{constructor({dataset:e,end:t,quad:n,start:r}){this.dataset=e,this.end=t,this.quad=n,this.start=r}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}};class xt{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}xt.prototype.termType="BlankNode";const St=xt;class jt{equals(e){return!!e&&e.termType===this.termType}}jt.prototype.termType="DefaultGraph",jt.prototype.value="";const It=jt,Et=function(e,t){if(!t)return null;if("BlankNode"===t.termType)return e.blankNode(t.value);if("DefaultGraph"===t.termType)return e.defaultGraph();if("Literal"===t.termType)return e.literal(t.value,t.language||e.namedNode(t.datatype.value));if("NamedNode"===t.termType)return e.namedNode(t.value);if("Quad"===t.termType){const n=e.fromTerm(t.subject),r=e.fromTerm(t.predicate),i=e.fromTerm(t.object),s=e.fromTerm(t.graph);return e.quad(n,r,i,s)}if("Variable"===t.termType)return e.variable(t.value);throw new Error(`unknown termType ${t.termType}`)};class Nt{constructor(e,t,n){this.value=e,this.language=t,this.datatype=n}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}Nt.prototype.termType="Literal";const Tt=Nt;class Rt{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Rt.prototype.termType="NamedNode";const Ot=Rt;class kt{constructor(e,t,n,r){this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}kt.prototype.termType="Quad",kt.prototype.value="";const Lt=kt;class At{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}At.prototype.termType="Variable";const Ct=At,Dt=new Ot("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),Mt=new Ot("http://www.w3.org/2001/XMLSchema#string");class Pt{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new It}}namedNode(e){return new Ot(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new St(e)}literal(e,t){return"string"==typeof t?new Tt(e,t,Dt):new Tt(e,"",t||Mt)}variable(e){return new Ct(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,n,r=this.defaultGraph()){return new Lt(e,t,n,r)}fromTerm(e){return Et(this,e)}fromQuad(e){return Et(this,e)}}Pt.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const $t=new Pt,Bt={apply:(e,t,n)=>e(n[0]),get:(e,t)=>e(t)},Ft=function(e,{factory:t=$t}={}){const n=(n="")=>t.namedNode(`${e}${n.raw||n}`);return"undefined"==typeof Proxy?n:new Proxy(n,Bt)},qt=(Ft("http://www.w3.org/2001/XMLSchema#"),Ft("http://www.w3.org/1999/02/22-rdf-syntax-ns#"));Ft("http://www.w3.org/2000/01/rdf-schema#");class Ut{static add({ptr:e,start:t,end:n,subjects:r=[null],predicates:i=[null],objects:s=[null],graphs:o,callback:a}={}){if(!e.factory)throw new Error("add operation requires a factory");let l=()=>{};a&&(l=r=>{a(new _t({dataset:e.dataset,start:t,end:n,quad:r}))});for(const n of r)for(const r of i)for(const i of s)for(const s of o){const o={subject:n,predicate:r,object:i,graph:s};o[t]=e.term;const a=e.factory.quad(o.subject,o.predicate,o.object,o.graph);e.dataset.add(a),l(a)}return e}static addList({ptr:e,predicates:t,items:n,graphs:r}){if(e.isAny())throw new Error("can't attach a list to an any ptr");for(const i of t)for(const t of r){const r=n.map((()=>e.factory.blankNode()));e.dataset.add(e.factory.quad(e.term,i,r[0]||qt.nil,t));for(let i=0;i<r.length;i++)e.dataset.add(e.factory.quad(r[i],qt.first,n[i],t)),e.dataset.add(e.factory.quad(r[i],qt.rest,r[i+1]||qt.nil,t))}return e}static delete({ptr:e,start:t,subjects:n=[null],predicates:r=[null],objects:i=[null]}){for(const s of n)for(const n of r)for(const r of i){const i={subject:s,predicate:n,object:r};i[t]=e.term;const o=e.dataset.match(i.subject,i.predicate,i.object);for(const t of o)e.dataset.delete(t)}return e}static deleteList({ptr:e,predicates:t}){const n=[];for(const r of t)for(const t of e.dataset.match(e.term,r)){let r=t.object;for(n.push(t);!qt.nil.equals(r);){r=n[n.length-1].object;const t=e.dataset.match(r);if(0===t.size)break;for(const e of t)n.push(e)}}for(const t of n)e.dataset.delete(t);return e}static execute({ptr:e,operation:t="traverse",quantifier:n,start:r,end:i,subjects:s,predicates:o,objects:a,graphs:l,items:c,callback:u}={}){if("add"===t)return Ut.add({ptr:e,start:r,end:i,subjects:s,predicates:o,objects:a,graphs:l,callback:u});if("addList"===t)return Ut.addList({ptr:e,predicates:o,items:c,graphs:l});if("delete"===t)return Ut.delete({ptr:e,start:r,subjects:s,predicates:o,objects:a});if("deleteList"===t)return Ut.deleteList({ptr:e,predicates:o});if("isList"===t)return Ut.isList({ptr:e});if("list"===t)return Ut.list({ptr:e});if("traverse"===t)return Ut.traverse({ptr:e,quantifier:n,start:r,end:i,subjects:s,predicates:o,objects:a,graphs:l});throw new Error(`unknown operation ${t}`)}static isList({ptr:e}){return!e.isAny()&&(!!qt.nil.equals(e.term)||1===Ut.traverse({ptr:e,predicates:[qt.first]}).length)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(qt.nil);){const t=e.out([qt.first]);if(1!==t.length)throw new Error(`Invalid list: rdf:first count not equals one on ${e.value}`);const n=e.out([qt.rest]);if(1!==n.length)throw new Error(`Invalid list: rdf:rest count not equals one on ${e.value}`);yield t[0],e=n[0]}}}}static traverse({ptr:e,quantifier:t="one",start:n="subject",end:r="object",subjects:i=[null],predicates:s=[null],objects:o=[null],graphs:a=[null],callback:l}){if("one"===t)return Ut.traverseOne({ptr:e,start:n,end:r,subjects:i,predicates:s,objects:o,graphs:a,callback:l});if("oneOrMore"===t){const t=Ut.traverse({ptr:e,end:r,start:n,subjects:i,predicates:s,objects:o,graphs:a,callback:l});return Ut.traverseMore({ptrs:t,end:r,start:n,subjects:i,predicates:s,objects:o,graphs:a,callback:l})}if("zeroOrMore"===t)return Ut.traverseMore({ptrs:[e],end:r,start:n,subjects:i,predicates:s,objects:o,graphs:a,callback:l});if("zeroOrOne"===t)return[e,...Ut.traverse({ptr:e,end:r,start:n,subjects:i,predicates:s,objects:o,graphs:a,callback:l})];throw new Error(`unknown quantifier ${t}`)}static traverseMore({ptrs:e,end:t,start:n,subjects:r,predicates:i,objects:s,graphs:o,callback:a}={}){let l,c,u=[...e];do{l=[];for(const c of e)l=[...l,...Ut.traverseOne({ptr:c,end:t,start:n,subjects:r,predicates:i,objects:s,graphs:o,callback:a})];c&&(l=l.filter((e=>!c.has(e.term)))),e=l,u=[...u,...l],c=new wt(u.map((e=>e.term)))}while(l.length>0);return u}static traverseOne({ptr:e,start:t,end:n,subjects:r,predicates:i,objects:s,graphs:o,callback:a=(e,t)=>t.extend(e)}={}){const l=[];for(const c of r)for(const r of i)for(const i of s)for(const s of o){const o={subject:c,predicate:r,object:i,graph:s};o[t]=e.term;for(const r of e.dataset.match(o.subject,o.predicate,o.object,o.graph))l.push(a(new _t({dataset:e.dataset,end:n,quad:r,start:t}),e))}return l}}const Gt=Ut;function Ht(e,t){return t?n=>t(e.extend(n)):()=>{}}const Vt=class{constructor({dataset:e,edges:t=[],factory:n,graph:r,term:i}){if(!e&&0===t.length)throw new Error("dataset or edges is required");if(0===t.length&&void 0===i)throw new Error("edges or term must be given");if(t.length>0&&i)throw new Error("edges or term must be given");this.dataset=e||t[t.length-1].dataset,this.edges=t,this.factory=n,this._graph=r,0===t.length&&(this._term=i)}get edge(){return this.edges[this.edges.length-1]}get graph(){return"object"==typeof this._graph?this._graph:this.edge&&this.edge.graph}get length(){return void 0!==this._term?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return void 0!==this._term?this._term:this.edge.term}get value(){const e=this.term;return null===e?void 0:e.value}addIn(e,t,n){return Gt.add({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:Ht(this,n)})}addList(e,t){return Gt.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:t})}addOut(e,t,n){return Gt.add({ptr:this,start:"subject",end:"object",predicates:e,objects:t,graphs:[this.graph||this.factory.defaultGraph()],callback:Ht(this,n)})}deleteIn(e,t){return Gt.delete({ptr:this,start:"object",subjects:t,predicates:e})}deleteList(e){return Gt.deleteList({ptr:this,predicates:e})}deleteOut(e,t){return Gt.delete({ptr:this,start:"subject",predicates:e,objects:t})}execute({operation:e,quantifier:t,start:n,end:r,subjects:i,predicates:s,objects:o,graphs:a,items:l,callback:c}){return Gt.execute({ptr:this,operation:e,quantifier:t,start:n,end:r,subjects:i,predicates:s,objects:o,graphs:a,items:l,callback:c})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,t){return Gt.traverse({ptr:this,start:"object",end:"object",subjects:t,predicates:e,graphs:[this.graph]})}hasOut(e,t){return Gt.traverse({ptr:this,start:"subject",end:"subject",predicates:e,objects:t,graphs:[this.graph]})}in(e,t){return Gt.traverse({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return Gt.isList({ptr:this})}list(){return Gt.list({ptr:this})}nodes(){const e=this,t=e=>void 0!==this._term?{dataset:this.dataset,term:this._term}:this.edges.length>e?{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e?{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term}:void 0;return{*[Symbol.iterator](){for(let n=0;n<e.length;n++)yield t(n)}}}out(e,t){return Gt.traverse({ptr:this,predicates:e,objects:t,graphs:[this.graph]})}quads(){const e=this;return{*[Symbol.iterator](){for(const t of e.edges)yield t.quad}}}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}},zt=function(e,t){return e?e.equals(t):e===t};function Wt(e,t){return t?n=>t(new e.constructor({factory:e.factory,ptrs:[n]})):()=>{}}class Jt{constructor({dataset:e,factory:t,ptrs:n,terms:r,graphs:i}){if(this.factory=t,n)this.ptrs=[...n];else{this.ptrs=[];for(const n of r||[null])for(const r of i||[null])this.ptrs.push(new Vt({dataset:e,factory:t,graph:r,term:n}))}}get dataset(){const e=new Set(this.datasets);return 1!==e.size?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map((e=>e.dataset))}get term(){const e=new wt(this.terms);if(1===e.size)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map((e=>e.term))}get value(){const e=this.term;return null==e?void 0:e.value}get values(){return this.ptrs.map((e=>e.value))}addIn(e,t,n){const r=Wt(this,n);for(const n of this.ptrs)n.addIn(e,t,r);return this}addList(e,t){if(this.isAny())throw new Error("can't attach a list to an any ptr");for(const n of this.ptrs)n.addList(e,t);return this}addOut(e,t,n){const r=Wt(this,n);for(const n of this.ptrs)n.addOut(e,t,r);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,t){for(const n of this.ptrs)n.deleteIn(e,t);return this}deleteList(e){for(const t of this.ptrs)t.deleteList(e);return this}deleteOut(e,t){for(const n of this.ptrs)n.deleteOut(e,t);return this}distinct(){const e=this.ptrs.reduce(((e,t)=>(e.some((e=>{return r=t,(n=e).dataset===r.dataset&&!!zt(n.graph,r.graph)&&!!zt(n.term,r.term);var n,r}))||e.push(t.trim()),e)),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap((t=>t.execute(e)))})}executeAll(e){let t=this;for(const n of e)t=t.execute(n);return t}filter(e){return this.clone({ptrs:[...this].filter(e).map((e=>e.ptrs[0]))})}hasIn(e,t){return this.clone({ptrs:this.ptrs.flatMap((n=>n.hasIn(e,t)))})}hasOut(e,t){return this.clone({ptrs:this.ptrs.flatMap((n=>n.hasOut(e,t)))})}in(e,t){return this.clone({ptrs:this.ptrs.flatMap((n=>n.in(e,t)))})}isAny(){return this.ptrs.length>0&&this.ptrs.some((e=>e.isAny()))}isList(){return 1===this.ptrs.length&&this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list()[Symbol.iterator](),t=()=>{const{done:t,value:n}=e.next();return t?{done:!0}:{done:!1,value:this.clone({ptrs:[n]})}};return{[Symbol.iterator]:()=>({next:t})}}map(e){return[...this].map(e)}node(e){const t=this.dataset,n=[...e].map((e=>new Vt({dataset:t,factory:this.factory,term:e})));return this.clone({ptrs:n})}out(e,t){return this.clone({ptrs:this.ptrs.flatMap((n=>n.out(e,t)))})}quads(){const e=this;return{*[Symbol.iterator](){for(const t of e.ptrs)for(const e of t.edges)yield e.quad}}}trim(){return this.clone({ptrs:this.ptrs.map((e=>e.trim()))})}*[Symbol.iterator](){for(const e of this.ptrs)yield this.clone({ptrs:[e]})}}const Qt=Jt;Ft("http://www.w3.org/2002/07/owl#");const Xt=Ft("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),Kt=Ft("http://www.w3.org/2000/01/rdf-schema#"),Yt=Ft("http://www.w3.org/ns/shacl#"),Zt=Ft("https://schemas.link/shacl-next#"),en=Ft("http://www.w3.org/2001/XMLSchema#");var tn=n(8059);const nn=class{constructor({details:e,factory:t,options:n,results:r=[]}={}){this.details=e,this.factory=t,this.options=n,this.results=r,this._conforms=tn((()=>!this.results.some((e=>e.severity.equals(Yt.Info)||e.severity.equals(Yt.Violation)||e.severity.equals(Yt.Warning))))),this._ptr=tn((()=>this.build()))}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){const e=new Qt({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([Xt.type],[Yt.ValidationReport]).addOut([Yt.conforms],[this.factory.literal(this.conforms.toString(),en.boolean)]);for(const t of this.results)e.addOut([Yt.result],[this.factory.blankNode()],(e=>{t.build(e,this.options)}));return e}coverage(){return this.results.flatMap((e=>e.coverage()))}},rn=class{constructor({args:e={},constraintComponent:t,factory:n,focusNode:r,message:i=[],path:s,results:o=[],severity:a,shape:l,source:c=[],value:u,valuePaths:d=[]}={}){this.args=e,this.constraintComponent=t,this.factory=n,this.focusNode=r,this.path=s||l.path,this.results=o,this.severity=a,this.shape=l,this.source=c,this.value=u,this.valuePaths=d,this._message=tn((()=>(this.shape.message.length>0&&(i=this.shape.message),0===i.length&&(i=this.shape.ptr.node([this.constraintComponent]).out([Yt.message]).terms),i.map((t=>n.literal(function(e,t){return Object.entries(t).reduce(((e,[t,n])=>(n&&n.termType&&(n=gt(n)),e.replace(`{$${t}}`,n).replace(`{?${t}}`,n))),e)}(t.value,e),t.language||null))))))}get message(){return this._message()}build(e,{details:t}={}){e.addOut([Xt.type],[Yt.ValidationResult]).addOut([Yt.focusNode],this.focusNode.terms).addOut([Yt.resultSeverity],[this.severity]).addOut([Yt.sourceConstraint],this.source).addOut([Yt.sourceConstraintComponent],[this.constraintComponent]).addOut([Yt.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([Yt.resultMessage],this.message);const n=t=>"one"===t.quantifier?t.predicates.length>1?e.node([this.factory.blankNode()]).addList([Yt.alternativePath],t.predicates):"object"===t.start?e.node([this.factory.blankNode()]).addOut([Yt.inversePath],[t.predicates[0]]):e.node([t.predicates[0]]):"oneOrMore"===t.quantifier?e.node([this.factory.blankNode()]).addOut([Yt.oneOrMorePath],[t.predicates[0]]):"zeroOrMore"===t.quantifier?e.node([this.factory.blankNode()]).addOut([Yt.zeroOrMorePath],[t.predicates[0]]):"zeroOrOne"===t.quantifier?e.node([this.factory.blankNode()]).addOut([Yt.zeroOrOnePath],[t.predicates[0]]):void 0;if(this.path&&(1===this.path.length?e.addOut([Yt.resultPath],n(this.path[0]).terms):e.addList([Yt.resultPath],this.path.map((e=>n(e).term)))),void 0!==this.value&&e.addOut([Yt.value],this.value.terms),t)for(const n of this.results)e.addOut([Yt.detail],[this.factory.blankNode()],(e=>{n.build(e,{details:t})}))}coverage(){return[...this.valuePaths.flatMap((e=>[...e.quads()])),...this.results.flatMap((e=>e.coverage()))]}};class sn{constructor({factory:e,focusNode:t,options:n={debug:!1,details:!1},processed:r=new Set,report:i=new nn({factory:e,options:n}),results:s=new Map,shape:o,value:a,valueOrNode:l,valuePaths:c,values:u}={}){this.factory=e,this.focusNode=t,this.options=n,this.processed=r,this.report=i,this.results=s,this.shape=o,this.value=a,this.valuePaths=c,this.valueOrNode=l,this.values=u}create({child:e,focusNode:t=this.focusNode,shape:n=this.shape,value:r=this.value,valueOrNode:i=this.valueOrNode,valuePaths:s=this.valuePaths,values:o=this.values}={}){return new sn({factory:this.factory,focusNode:t,options:this.options,processed:this.processed,report:e?new nn({factory:this.factory,options:this.options}):this.report,results:this.results,shape:n,value:r,valueOrNode:i,valuePaths:s,values:o})}id({shape:e=this.shape}={}){return`${gt(e.ptr.term)} - ${gt(this.focusNode.term)} - ${t=this.valuePaths,t?`{${t.map((e=>function(e){return e?`{${[...e.quads()].map((e=>gt(e))).join(" ")}}`:"{}"}(e))).join(" ")}}`:"{}"}`;var t}result(e){const t=new rn({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),n=this.id();this.results.has(n)?this.results.get(n).add(t):this.results.set(n,new Set([t])),this.report.results.push(t)}debug(e,t){this.options.debug&&this.result({severity:Zt.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:Zt.Trace,constraintComponent:e,...t})}test(e,t,n){e?this.debug(t,n):this.violation(t,n)}violation(e,t){this.result({constraintComponent:e,severity:this.shape.severity||Yt.Violation,...t})}}const on=sn;function an(){return{generic:e=>{e.trace(Zt.TraversalConstraintComponent,{args:{},message:[e.factory.literal("Traversal")],value:e.valueOrNode})}}}const ln=class{constructor(e){this.validations=new mt(e)}compile(e){const t=e.validator.options.coverage;if(e.deactivated)return[];let n=!1;const r=new Set;for(const t of e.ptr.execute({start:"subject",end:"predicate"})){const e=this.validations.get(t.term);e&&(r.add(e),t.term.equals(Yt.property)&&(n=!0))}return t&&e.isPropertyShape&&!n&&r.add(an),[...r].map((t=>t(e))).filter(Boolean)}};var cn=n(9349);function un(e){if("BlankNode"!==e.term.termType)return{quantifier:"one",start:"subject",end:"object",predicates:[e.term]};const t=e.out([Yt.alternativePath]);if(1===t.ptrs.length&&t.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...t.list()].map((e=>e.term))};const n=e.out([Yt.inversePath]);if(n.term)return{quantifier:"one",start:"object",end:"subject",predicates:[n.term]};const r=e.out([Yt.oneOrMorePath]);if(r.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[r.term]};const i=e.out([Yt.zeroOrMorePath]);if(i.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[i.term]};const s=e.out([Yt.zeroOrOnePath]);return s.term?{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[s.term]}:void 0}const dn=class{constructor(e){this.shape=e,this._compiled=tn((()=>this.shape.validator.registry.compile(e)))}get compiled(){return this._compiled()}async validate(e){return 0===e.focusNode.dataset.size||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){const t=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(const e of this.compiled)e.node&&await e.node(t),e.generic&&await e.generic(t)}async validateProperty(e){let t;t=this.shape.isSparqlShape?e.focusNode:e.focusNode.executeAll(this.shape.path);const n=t.node(new wt(t.terms)),r=[...t].reduce(((e,n)=>{const r=n.term,i=t.node([r]);return e.has(r)||e.set(r,{value:i,valuePaths:[]}),e.get(r).valuePaths.push(n),e}),new mt).values(),i=e.create({shape:this.shape,values:n});for(const e of this.compiled)e.property&&await e.property(i);for(const{value:t,valuePaths:n}of r){const r=e.create({shape:this.shape,value:t,valueOrNode:t,valuePaths:n});for(const e of this.compiled)e.generic&&await e.generic(r)}}},hn=function(e){const t=new wt,n=new Qt({dataset:e.dataset,terms:e.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[Kt.subClassOf]});for(const e of n.ptrs)for(const{term:n}of e.nodes())t.add(n);return t},fn=class{constructor(e){this.targetClass=new wt([...hn(e.hasOut([Xt.type],[Yt.NodeShape])),...hn(e.out([Yt.targetClass]))]),this.targetNode=e.out([Yt.targetNode]).terms,this.targetObjectsOf=e.out([Yt.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([Yt.targetSubjectsOf]).terms}resolve(e){const t=e.focusNode.node([null]),n=[...e.focusNode.hasOut([Xt.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...t.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...t.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs],r=e.focusNode.clone({ptrs:n});return r.node([...new wt(r.terms)])}},pn=class{constructor(e,{validator:t}){this.ptr=e,this.validator=t,this._deactivated=tn((()=>{const e=this.ptr.out([Yt.deactivated]).term;return e&&(0,cn.fromRdf)(e)})),this._message=tn((()=>this.ptr.out([Yt.message]).terms)),this._path=tn((()=>function(e){return 0===e.terms.length?null:e.ptrs[0].isList()?[...e.list()].map((e=>un(e))):[un(e)]}(this.ptr.out([Yt.path])))),this._severity=tn((()=>this.ptr.out([Yt.severity]).term)),this._shapeValidator=tn((()=>new dn(this))),this._sparql=tn((()=>this.ptr.out([Yt.sparql]))),this._targetResolver=tn((()=>new fn(this.ptr)))}get deactivated(){return this._deactivated()}get isPropertyShape(){return Boolean(this.path)}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){const t=e.id({shape:this});if(e.processed.has(t)){if(e.results.has(t))for(const n of e.results.get(t))e.report.results.push(n);return e}return e.processed.add(t),this.shapeValidator.validate(e)}};async function gn(e,t){return Promise.all(e.map(t))}function yn(e){return t=>{t.test(e.equals(t.valueOrNode.term),Yt.HasValueConstraintComponent,{args:{hasValue:e},message:[t.factory.literal("Value must be {$hasValue}")]})}}function mn(e){return t=>{const n=[...t.values].some((t=>e.equals(t.term)));t.test(n,Yt.HasValueConstraintComponent,{args:{hasValue:e},message:[t.factory.literal("Missing expected value {$hasValue}")]})}}function bn(e){return en.dateTime.equals(e.datatype)&&/^.*(((\+|-)\d{2}:\d{2})|Z)$/.test(e.value)}const vn=function(e,t){if(!e||"Literal"!==e.termType)return null;if(!t||"Literal"!==t.termType)return null;if(bn(e)!==bn(t))return null;const n=(0,cn.fromRdf)(e),r=(0,cn.fromRdf)(t);return typeof n!=typeof r?null:"string"==typeof n?n.localeCompare(r):n-r};function wn(e){return t=>{const n=t.focusNode.out([e]),r=n.filter((e=>!e.term.equals(t.focusNode.term))),i=0!==n.terms.length&&0===r.terms.length;t.test(i,Yt.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal("Must have same values as {$equals}")],value:r.terms[0]&&t.focusNode.node([r.terms[0]])||t.focusNode})}}function _n(e){return t=>{const n=new wt(t.focusNode.out([e]).terms),r=new wt(t.values.terms),i=[...[...r].filter((e=>!n.has(e))),...[...n].filter((e=>!r.has(e)))];for(const n of i)t.violation(Yt.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal("Must have same values as {$equals}")],value:t.focusNode.node([n])});0===i.length&&t.debug(Yt.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal("Must have same values as {$equals}")]})}}function xn(e,t,n,r){return async i=>{const s=[];let o=[];t&&(o=new Set(i.shape.ptr.in([Yt.property]).out([Yt.property]).out([Yt.qualifiedValueShape]).filter((t=>!t.term.equals(e.ptr.term))).map((e=>i.shape.validator.shape(e)))));const a=(await async function(t){return(await Promise.all(t.map((t=>(async t=>{const n=(await e.validate(i.create({child:!0,focusNode:t}))).report;if(s.push(n.results),!n.conforms)return!1;if(0===o.length)return!0;if(i.options.debug||i.options.details){const e=await gn([...o],(async e=>(await e.validate(i.create({child:!0,focusNode:t}))).report));return s.push(e.flatMap((e=>e.results))),!e.every((e=>e.conforms))}return!await async function(e,t){for(const n of e)if(!await t(n))return!1;return!0}([...o],(async e=>(await e.validate(i.create({child:!0,focusNode:t}))).report.conforms))})(t))))).filter(Boolean)}(i.values)).length;null!==n&&i.test(a<=n,Yt.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:n,qualifiedValueShape:e.ptr.term,qualifiedValueShapesDisjoint:t},message:[i.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:s.flat()}),null!==r&&i.test(a>=r,Yt.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:r,qualifiedValueShape:e.ptr.term,qualifiedValueShapesDisjoint:t},message:[i.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:s.flat()})}}function Sn(e,t,n){return r=>{r.test(n.test(r.valueOrNode.term.value),Yt.PatternConstraintComponent,{args:{flags:t,pattern:e},message:[r.factory.literal('Value does not match pattern "{$pattern}"')],value:r.valueOrNode})}}const jn=Ft("http://www.w3.org/ns/shacl#"),In=Ft("https://schemas.link/shacl-next#"),En=class{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some((e=>e.severity.equals(jn.Info)||e.severity.equals(jn.Violation)||e.severity.equals(jn.Warning)))}},Nn=class{constructor({args:e={},factory:t,message:n=[],severity:r=jn.Violation}={}){this.severity=r,this.message=n.map((n=>t.literal(function(e,t){return Object.entries(t).reduce(((e,[t,n])=>(n&&n.termType&&(n=gt(n)),e.replace(`{$${t}}`,n).replace(`{?${t}}`,n))),e)}(n.value,e),n.language||null)))}};class Tn{constructor({factory:e=$t}={}){this.factory=e}clone({factory:e}={}){return new Tn({factory:e||this.factory})}validate(){return new En}validateSimple(){return!0}}const Rn=Tn;class On extends Rn{constructor({datatypes:e,factory:t}={}){super({factory:t}),this.datatypes=[];for(const t of Array.isArray(e)?e:[e])t&&this.datatypes.push(this.factory.fromTerm(t))}clone({factory:e}={}){return new On({datatypes:this.datatypes,factory:e||this.factory})}}const kn=On,Ln=class{constructor({factory:e=$t,validations:t}={}){if(this.factory=e,this.validations=new mt,t)for(const e of Object.values(t)){const t=e.clone({factory:this.factory});for(const e of t.datatypes)this.validations.set(e,t)}}validate(e){const t=this.validations.get(e.datatype);return t?t.validate(e):new En}validateSimple(e){const t=this.validations.get(e.datatype);return!t||t.validateSimple(e)}};class An extends kn{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.message=[this.factory.literal("term value {$this} matches pattern {$pattern}")],this.patterns=Array.isArray(e)?e:[e]}clone({factory:e}={}){return new An(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const t=this.patterns.map((t=>{let n;t.test(e.value)&&(n=In.Debug);const r={pattern:this.factory.literal(t.toString()),this:e};return new Nn({args:r,factory:this.factory,message:this.message,severity:n})}));return new En({results:t})}validateSimple(e){return this.patterns.every((t=>t.test(e.value)))}}const Cn=An,Dn=/^([-+]?[0-9]+)$/;class Mn extends Cn{constructor(e=null,t=null,n,{factory:r}={}){super(Dn,n,{factory:r}),this.maxInclusive=null,this.minInclusive=null,"string"==typeof t&&(this.maxInclusive=BigInt(t)),"string"==typeof e&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){return new Mn(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const t=super.validate(e).results;if(!In.Debug.equals(t[0].severity))return new En({results:t});const n=BigInt(e.value);if(null!==this.minInclusive&&n<this.minInclusive){const n=`term value "${e.value}" is less than "${this.minInclusive.toString()}"`,r=[this.factory.literal(n)];t.push(new Nn({factory:this.factory,message:r}))}if(null!==this.maxInclusive&&n>this.maxInclusive){const n=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,r=[this.factory.literal(n)];t.push(new Nn({factory:this.factory,message:r}))}return new En({results:t})}validateSimple(e){if(!super.validateSimple(e))return!1;const t=BigInt(e.value);return!(null!==this.minInclusive&&t<this.minInclusive||null!==this.maxInclusive&&t>this.maxInclusive)}}const Pn=Mn;class $n extends kn{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.values=new Set(e)}clone({factory:e}={}){return new $n(this.values,this.datatypes,{factory:e||this.factory})}validate(e){const t=[];if(!this.values.has(e.value)){const n=`term value "${e.value}" is not included in the list: ${[...this.values].join(",")}`,r=[this.factory.literal(n)];t.push(new Nn({factory:this.factory,message:r}))}return new En({results:t})}validateSimple(e){return this.values.has(e.value)}}const Bn=$n,Fn={xsd:Ft("http://www.w3.org/2001/XMLSchema#")},qn=new kn({datatypes:Fn.xsd.anySimpleType}),Un=new kn({datatypes:Fn.xsd.anyAtomicType}),Gn=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,Hn=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,Vn=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,zn=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Wn=new Cn(Gn,Fn.xsd.string),Jn=new Bn(["1","true","0","false"],Fn.xsd.boolean),Qn=new Cn(/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,Fn.xsd.decimal),Xn=new Cn(Hn,Fn.xsd.float),Kn=new Cn(Hn,Fn.xsd.double),Yn=new Cn(Vn,Fn.xsd.duration),Zn=new Cn(zn,Fn.xsd.dateTime),er=new Cn(/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.time),tr=new Cn(/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.date),nr=new Cn(/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.gYearMonth),rr=new Cn(/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.gYear),ir=new Cn(/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.gMonthDay),sr=new Cn(/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.gDay),or=new Cn(/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.gMonth),ar=new Cn(/^(([0-9a-fA-F]{2})*)$/,Fn.xsd.hexBinary),lr=new Cn(/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,Fn.xsd.base64Binary),cr=new Cn(Gn,Fn.xsd.anyURI),ur=/^([^\u000d\u000a\u0009]*)$/,dr=new Cn([Gn,ur],Fn.xsd.normalizedString),hr=new Cn([Gn,ur,/^([^ ]+( [^ ]+)*)*$/],Fn.xsd.token),fr=new Cn(/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,Fn.xsd.language),pr=new Pn(null,null,Fn.xsd.integer),gr=new Pn(null,"0",Fn.xsd.nonPositiveInteger),yr=new Pn(null,"-1",Fn.xsd.negativeInteger),mr=new Pn("-9223372036854775808","9223372036854775807",Fn.xsd.long),br=new Pn("-2147483648","2147483647",Fn.xsd.int),vr=new Pn("-32768","32767",Fn.xsd.short),wr=new Pn("-128","127",Fn.xsd.byte),_r=new Pn("0",null,Fn.xsd.nonNegativeInteger),xr=new Pn("0","18446744073709551615",Fn.xsd.unsignedLong),Sr=new Pn("0","4294967295",Fn.xsd.unsignedInt),jr=new Pn("0","65535",Fn.xsd.unsignedShort),Ir=new Pn("0","255",Fn.xsd.unsignedByte),Er=new Pn("1",null,Fn.xsd.positiveInteger),Nr=new Cn([Vn,/^([^DT]*)$/],Fn.xsd.yearMonthDuration),Tr=new Cn([Vn,/^([^YM]*[DT].*)$/],Fn.xsd.dayTimeDuration),Rr=new Cn([zn,/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/],Fn.xsd.dateTimeStamp),Or=class extends Ln{constructor({factory:e}={}){super({factory:e,validations:{...r}})}},kr=new mt([[Yt.BlankNode,new Set(["BlankNode"])],[Yt.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[Yt.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[Yt.IRI,new Set(["NamedNode"])],[Yt.IRIOrLiteral,new Set(["NamedNode","Literal"])],[Yt.Literal,new Set(["Literal"])]]);function Lr(e,t){return n=>{n.test(t.has(n.valueOrNode.term.termType),Yt.NodeKindConstraintComponent,{args:{nodeKind:e},message:[n.factory.literal("Value does not have node kind {$nodeKind}")],value:n.valueOrNode})}}const Ar=new mt([[Yt.maxCount,function(e){return{property:(t=parseInt(e.ptr.out([Yt.maxCount]).value),e=>{e.test(e.values.terms.length<=t,Yt.MaxCountConstraintComponent,{args:{maxCount:t},message:[e.factory.literal("More than {$maxCount} values")]})})};var t}],[Yt.minCount,function(e){return{property:(t=parseInt(e.ptr.out([Yt.minCount]).value),e=>{e.test(e.values.terms.length>=t,Yt.MinCountConstraintComponent,{args:{minCount:t},message:[e.factory.literal("Less than {$minCount} values")]})})};var t}],[Yt.and,function(e){return{generic:(t=[...e.ptr.out([Yt.and])].flatMap((e=>[...e.list()])).map((t=>e.validator.shape(t))),async e=>{const n=await gn(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report)),r=n.every((e=>e.conforms));e.test(r,Yt.AndConstraintComponent,{results:n.flatMap((e=>e.results)),value:e.valueOrNode})})};var t}],[Yt.not,function(e){return{generic:(t=e.validator.shape(e.ptr.out([Yt.not])),async e=>{const n=(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report,r=!n.conforms;e.test(r,Yt.NotConstraintComponent,{args:{not:t.ptr.term},message:[e.factory.literal("Value does have shape {$not}")],results:n.results,value:e.valueOrNode})})};var t}],[Yt.or,function(e){return{generic:(t=[...e.ptr.out([Yt.or])].flatMap((e=>[...e.list()])).map((t=>e.validator.shape(t))),async e=>{let n,r=[];if(e.options.debug||e.options.details){const i=await gn(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report));r=i.flatMap((e=>e.results)),n=i.some((e=>e.conforms))}else n=await async function(e,t){for(const n of e)if(await t(n))return!0;return!1}(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report.conforms));e.test(n,Yt.OrConstraintComponent,{results:r,value:e.valueOrNode})})};var t}],[Yt.xone,function(e){return{generic:(t=[...e.ptr.out([Yt.xone])].flatMap((e=>[...e.list()])).map((t=>e.validator.shape(t))),async e=>{const n=await gn(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report)),r=1===n.filter((e=>e.conforms)).length;e.test(r,Yt.XoneConstraintComponent,{results:n.flatMap((e=>e.results)),value:e.valueOrNode})})};var t}],[Yt.closed,function(e){if(!(0,cn.fromRdf)(e.ptr.out([Yt.closed]).term))return null;const t=e.ptr.out([Yt.property]).map((t=>e.validator.shape(t)));return{node:(n=new wt(t.filter((e=>!e.deactivated)).map((e=>e.path[0].predicates[0]))),r=new wt([...e.ptr.out([Yt.ignoredProperties]).list()||[]].map((e=>e.term))),e=>{const t=e.focusNode.execute({start:"subject",end:"predicate"}).filter((e=>!r.has(e.term)&&!n.has(e.term)));if(t.ptrs.length>0)for(const n of t)e.violation(Yt.ClosedConstraintComponent,{message:[e.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[n.term]}],value:e.focusNode.node([[...n.quads()][0].object])});else e.debug(Yt.ClosedConstraintComponent)})};var n,r}],[Yt.hasValue,function(e){const t=e.ptr.out([Yt.hasValue]).term;return{node:yn(t),property:mn(t)}}],[Yt.in,function(e){return{generic:(t=new wt([...e.ptr.out([Yt.in]).list()].map((e=>e.term))),e=>{e.test(t.has(e.valueOrNode.term),Yt.InConstraintComponent,{args:{in:[...t].map((e=>e.value)).join(", ")},message:[e.factory.literal("Value is not in {$in}")],value:e.valueOrNode})})};var t}],[Yt.disjoint,function(e){return{generic:(t=e.ptr.out([Yt.disjoint]).term,e=>{const n=e.focusNode.dataset.match(e.focusNode.term,t,e.valueOrNode.term);e.test(0===n.size,Yt.DisjointConstraintComponent,{args:{disjoint:t},message:[e.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:e.valueOrNode})})};var t}],[Yt.equals,function(e){const t=e.ptr.out([Yt.equals]).term;return{node:wn(t),property:_n(t)}}],[Yt.lessThan,function(e){return{property:(t=e.ptr.out([Yt.lessThan]).term,e=>{const n=e.focusNode.out([t]).terms;for(const r of e.values)for(const i of n){const n=vn(r.term,i);null===n||n>=0?e.violation(Yt.LessThanConstraintComponent,{args:{lessThan:t},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r}):e.debug(Yt.LessThanConstraintComponent,{args:{lessThan:t},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r})}})};var t}],[Yt.lessThanOrEquals,function(e){return{property:(t=e.ptr.out([Yt.lessThanOrEquals]).term,e=>{const n=e.focusNode.out([t]).terms;for(const r of e.values)for(const i of n){const n=vn(r.term,i);null===n||n>0?e.violation(Yt.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:t},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r}):e.debug(Yt.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:t},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r})}})};var t}],[Yt.maxExclusive,function(e){return{generic:(t=e.ptr.out([Yt.maxExclusive]).term,e=>{const n=vn(e.valueOrNode.term,t);e.test(null!==n&&n<0,Yt.MaxExclusiveConstraintComponent,{args:{maxExclusive:t},message:[e.factory.literal("Value is not less than {$maxExclusive}")],value:e.valueOrNode})})};var t}],[Yt.maxInclusive,function(e){return{generic:(t=e.ptr.out([Yt.maxInclusive]).term,e=>{const n=vn(e.valueOrNode.term,t);e.test(null!==n&&n<=0,Yt.MaxInclusiveConstraintComponent,{args:{maxInclusive:t},message:[e.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:e.valueOrNode})})};var t}],[Yt.minExclusive,function(e){return{generic:(t=e.ptr.out([Yt.minExclusive]).term,e=>{const n=vn(e.valueOrNode.term,t);e.test(null!==n&&n>0,Yt.MinExclusiveConstraintComponent,{args:{minExclusive:t},message:[e.factory.literal("Value is not greater than {$minExclusive}")],value:e.valueOrNode})})};var t}],[Yt.minInclusive,function(e){return{generic:(t=e.ptr.out([Yt.minInclusive]).term,e=>{const n=vn(e.valueOrNode.term,t);e.test(null!==n&&n>=0,Yt.MinInclusiveConstraintComponent,{args:{minInclusive:t},message:[e.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:e.valueOrNode})})};var t}],[Yt.node,function(e){return{generic:(t=[...e.ptr.out([Yt.node])].map((t=>e.validator.shape(t))),async e=>{for(const n of t){const t=await n.validate(e.create({child:!0,focusNode:e.valueOrNode}));e.test(t.report.conforms,Yt.NodeConstraintComponent,{args:{node:n.ptr.term},message:[e.factory.literal("Value does not have shape {$node}")],results:t.report.results,value:e.valueOrNode})}})};var t}],[Yt.property,function(e){return{generic:(t=[...e.ptr.out([Yt.property])].map((t=>e.validator.shape(t))),async e=>{const n=e.create({focusNode:e.valueOrNode});for(const e of t)await e.validate(n)})};var t}],[Yt.qualifiedValueShape,function(e){const t=e.validator.shape(e.ptr.out([Yt.qualifiedValueShape])),n=e.ptr.out([Yt.qualifiedValueShapesDisjoint]).term,r=!!n&&(0,cn.fromRdf)(n),i=e.ptr.out([Yt.qualifiedMaxCount]).term,s=i?parseInt(i.value):null,o=e.ptr.out([Yt.qualifiedMinCount]).term;return{property:xn(t,r,s,o?parseInt(o.value):null)}}],[Yt.languageIn,function(e){return{generic:(t=[...new Set([...e.ptr.out([Yt.languageIn]).list()].map((e=>e.value)))],e=>{const n=t.some((t=>function(e,t){return!!t&&t.slice(0,e.length)===e}(t,e.valueOrNode.term.language)));e.test(n,Yt.LanguageInConstraintComponent,{args:{languageIn:t.join(", ")},message:[e.factory.literal("Language does not match any of {$languageIn}")],value:e.valueOrNode})})};var t}],[Yt.maxLength,function(e){return{generic:(t=parseInt(e.ptr.out([Yt.maxLength]).value),e=>{const n="BlankNode"!==e.valueOrNode.term.termType&&e.valueOrNode.value.length<=t;e.test(n,Yt.MaxLengthConstraintComponent,{args:{maxLength:t},message:[e.factory.literal("Value has more than {$maxLength} characters")],value:e.valueOrNode})})};var t}],[Yt.minLength,function(e){return{generic:(t=parseInt(e.ptr.out([Yt.minLength]).value),e=>{const n="BlankNode"!==e.valueOrNode.term.termType&&e.valueOrNode.value.length>=t;e.test(n,Yt.MinLengthConstraintComponent,{args:{minLength:t},message:[e.factory.literal("Value has less than {$minLength} characters")],value:e.valueOrNode})})};var t}],[Yt.pattern,function(e){const t=e.ptr.out([Yt.pattern]).value,n=e.ptr.out([Yt.flags]).value;return{generic:Sn(t,n,new RegExp(t,n))}}],[Yt.uniqueLang,function(e){const t=e.ptr.out([Yt.uniqueLang]).term;return"true"===t.value&&en.boolean.equals(t.datatype)?{property:e=>{const t=Object.entries(e.values.terms.reduce(((e,t)=>(t.language&&(e[t.language]=(e[t.language]||0)+1),e)),{})),n=t.filter((([,e])=>e>1));for(const[t]of n)e.violation(Yt.UniqueLangConstraintComponent,{args:{lang:t},message:[e.factory.literal('Language "{?lang}" used more than once')]});0===n.length&&e.debug(Yt.UniqueLangConstraintComponent)}}:null}],[Yt.class,function(e){return{generic:(t=e.ptr.out([Yt.class]).map((e=>hn(e))),e=>{const n=new wt(e.valueOrNode.out([Xt.type]).terms);for(const r of t){const t=[...n].some((e=>r.has(e)));e.test(t,Yt.ClassConstraintComponent,{value:e.valueOrNode})}})};var t}],[Yt.datatype,function(e){return{generic:(t=e.ptr.out([Yt.datatype]).term,n=new Or,e=>{const r=t.equals(e.valueOrNode.term.datatype)&&n.validateSimple(e.valueOrNode.term);e.test(r,Yt.DatatypeConstraintComponent,{args:{datatype:t},message:[e.factory.literal("Value does not have datatype {$datatype}")],value:e.valueOrNode})})};var t,n}],[Yt.nodeKind,function(e){const t=e.ptr.out([Yt.nodeKind]).term;return{generic:Lr(t,kr.get(t))}}]]),Cr=class{constructor(e,{factory:t,...n}){if(this.factory=t,this.options=n,this.registry=new ln(Ar),this.shapesPtr=new Qt({dataset:e,factory:t}),this.shapes=new mt,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[e,t]of this.options.validations)this.registry.validations.set(e,t);const r=[...this.shapesPtr.hasOut([Yt.targetClass]),...this.shapesPtr.hasOut([Yt.targetNode]),...this.shapesPtr.hasOut([Yt.targetObjectsOf]),...this.shapesPtr.hasOut([Yt.targetSubjectsOf]),...this.shapesPtr.hasOut([Xt.type],[Yt.NodeShape]),...this.shapesPtr.hasOut([Xt.type],[Yt.PropertyShape])];for(const e of r)this.shape(e)}shape(e){if(!e.term)return null;let t=this.shapes.get(e.term);return t||(t=new pn(e,{validator:this}),this.shapes.set(e.term,t)),t}async validate(e,t){const n=new Qt({...e,factory:this.factory}),r=new on({factory:this.factory,focusNode:n,options:this.options,validator:this});t=t?t.map((e=>this.shape(this.shapesPtr.node(e.terms)))):this.shapes.values();for(const e of t){const t=r.create({shape:e});let i;i=n.isAny()?e.resolveTargets(t):n;for(const n of i)await e.validate(t.create({focusNode:n}))}return r.report}};var Dr=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};class Mr extends HTMLElement{static get observedAttributes(){return ct.dataAttributes()}constructor(e){super(),this.shape=null,this.attachShadow({mode:"open"}),this.form=document.createElement("form"),this.config=new ct(e,this.form),this.form.addEventListener("change",(e=>{e.stopPropagation(),this.config.editMode&&this.validate(!0).then((e=>{this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,composed:!0,detail:{valid:e.conforms,report:e}}))})).catch((e=>{console.warn(e)}))}))}connectedCallback(){this.shadowRoot.prepend(this.form)}attributeChangedCallback(){this.config.updateAttributes(this),this.initialize()}initialize(){clearTimeout(this.initDebounceTimeout),this.initDebounceTimeout=setTimeout((()=>Dr(this,void 0,void 0,(function*(){this.form.replaceChildren(document.createTextNode(this.config.attributes.loading));try{yield this.config.loader.loadGraphs(),this.form.replaceChildren(),this.config.renderedNodes.clear();const e=this.findRootShaclShapeSubject();if(e){this.form.classList.forEach((e=>{this.form.classList.remove(e)})),this.form.classList.toggle("mode-edit",this.config.editMode),this.form.classList.toggle("mode-view",!this.config.editMode),this.config.theme.apply(this.form);const t=[this.config.theme.stylesheet];for(const e of Object.entries(xe).map((e=>e[1])))e.stylesheet&&t.push(e.stylesheet);if(this.shadowRoot.adoptedStyleSheets=t,this.shape=new Ae(e,this.config,this.config.attributes.valuesSubject?f.namedNode(this.config.attributes.valuesSubject):void 0),this.form.appendChild(this.shape),this.config.editMode){if(null!==this.config.attributes.submitButton){const e=this.config.theme.createButton(this.config.attributes.submitButton||"Submit",!0);e.addEventListener("click",(e=>{e.preventDefault(),this.form.reportValidity()&&this.validate().then((e=>{var t;(null==e?void 0:e.conforms)?this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0})):null===(t=this.form.querySelector(":scope .invalid > .editor"))||void 0===t||t.focus()}))})),this.form.appendChild(e)}yield this.validate(!0)}}else if(this.config.shapesGraph.size>0)throw new Error("shacl root node shape not found")}catch(e){console.error(e);const t=document.createElement("div");t.innerText=String(e),this.form.replaceChildren(t)}}))),200)}serialize(e="text/turtle",t=this.toRDF()){return function(e,t,n){if("application/ld+json"===t)return function(e){const t=[];for(const n of e){const e={"@id":n.subject.id};if(n.predicate===P)e["@type"]=n.object.id;else{let t=n.object.value;n.object instanceof y?n.object.language?t={"@language":n.object.language,"@value":n.object.value}:n.object.datatype&&n.object.datatype.value!==`${k}#string`&&(t={"@type":n.object.datatype.value,"@value":n.object.value}):t={"@id":n.object.id},e[n.predicate.value]=t}t.push(e)}return JSON.stringify(t)}(e);{const r=new ve({format:t,prefixes:n});r.addQuads(e);let i="";return r.end(((e,t)=>{e&&console.error(e),i=t})),i}}(t.getQuads(null,null,null,null),e,this.config.prefixes)}toRDF(e=new Fe){var t;return null===(t=this.shape)||void 0===t||t.toRDF(e),e}registerPlugin(e){Se(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setSharedShapesGraph(e){at(e),this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}validate(){return Dr(this,arguments,void 0,(function*(e=!1){var t,n,r,i,s,o;for(const e of this.form.querySelectorAll(":scope .validation-error"))e.remove();for(const e of this.form.querySelectorAll(":scope .property-instance"))e.classList.remove("invalid"),(null===(t=e.querySelector(":scope > .editor"))||void 0===t?void 0:t.value)?e.classList.add("valid"):e.classList.remove("valid");this.config.shapesGraph.deleteGraph(""),null===(n=this.shape)||void 0===n||n.toRDF(this.config.shapesGraph),this.shape&&this.config.shapesGraph.add(new _(this.shape.shaclSubject,f.namedNode(R+"targetNode"),this.shape.nodeId,void 0));try{const t=this.config.shapesGraph,n=yield new Cr(t,{details:!0,factory:f}).validate({dataset:t});for(const t of n.results)if(null===(i=null===(r=t.focusNode)||void 0===r?void 0:r.ptrs)||void 0===i?void 0:i.length)for(const n of t.focusNode.ptrs){const r=n._term;if(null===(s=t.path)||void 0===s?void 0:s.length){const n=t.path[0].predicates[0];let i=this.form.querySelectorAll(`:scope [data-node-id='${r.id}'] [data-path='${n.id}'] > .editor`);0===i.length&&(i=this.form.querySelectorAll(`:scope [data-node-id='${r.id}'] [data-path='${n.id}']`));for(const n of i)if(n.classList.contains("editor")){if(!e||n.value){let e=n.parentElement;e.classList.add("invalid"),e.classList.remove("valid"),e.appendChild(this.createValidationErrorDisplay(t));do{e.classList.contains("collapsible")&&e.classList.add("open"),e=e.parentElement}while(e)}}else e||(n.classList.add("invalid"),n.classList.remove("valid"),n.appendChild(this.createValidationErrorDisplay(t,"node")))}else e||null===(o=this.form.querySelector(`:scope [data-node-id='${r.id}']`))||void 0===o||o.prepend(this.createValidationErrorDisplay(t,"node"))}return n}catch(e){return console.error(e),!1}}))}createValidationErrorDisplay(e,t){var n,r;const i=document.createElement("span");if(i.classList.add("validation-error"),t&&i.classList.add(t),e)if((null===(n=e.message)||void 0===n?void 0:n.length)>0)for(const t of e.message)i.title+=t.value+"\n";else i.title=null===(r=e.sourceConstraintComponent)||void 0===r?void 0:r.value;return i}findRootShaclShapeSubject(){let e=null;if(this.config.attributes.shapeSubject){if(e=f.namedNode(this.config.attributes.shapeSubject),0===this.config.shapesGraph.getQuads(e,P,G,null).length)return void console.warn(`shapes graph does not contain requested root shape ${this.config.attributes.shapeSubject}`)}else if(this.config.attributes.valuesSubject&&this.config.dataGraph.size>0){const t=f.namedNode(this.config.attributes.valuesSubject),n=[...this.config.dataGraph.getQuads(t,P,null,null),...this.config.dataGraph.getQuads(t,$,null,null)];if(0===n.length)return void console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${P.id} nor ${$.id} statement`);for(const t of n)if(this.config.shapesGraph.getQuads(t.object,P,G,null).length>0){e=t.object;break}if(!e){const t=this.config.shapesGraph.getQuads(null,W,n[0].object,null);if(0===t.length)return void console.error(`value subject '${this.config.attributes.valuesSubject}' has no shacl shape definition in the shapes graph`);if(t.length>1&&console.warn(`value subject '${this.config.attributes.valuesSubject}' has multiple shacl shape definitions in the shapes graph, choosing the first found (${t[0].subject})`),0===this.config.shapesGraph.getQuads(t[0].subject,P,G,null).length)return void console.error(`value subject '${this.config.attributes.valuesSubject}' references a shape which is not a NodeShape (${t[0].subject})`);e=t[0].subject}}else{const t=this.config.shapesGraph.getQuads(null,P,G,null);if(0==t.length)return void console.warn("shapes graph does not contain any root shapes");t.length>1&&(console.warn("shapes graph contains",t.length,"root shapes. choosing first found which is",t[0].subject.value),console.info('hint: set the shape to use with attribute "data-shape-subject"')),e=t[0].subject}return e}}class Pr extends oe{constructor(e){super(e||".editor:not([type='checkbox']) { border: 1px solid #DDD; padding: 2px 4px; }\n.property-instance label { display: inline-block; word-break: break-word; line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; }\n.property-instance:not(:first-child) > label { visibility: hidden; max-height: 0; }\n.mode-edit .property-instance label { width: var(--label-width); }\n"),this.idCtr=0}createDefaultTemplate(e,t,n,r,i){var s;r.id="e"+this.idCtr++,r.classList.add("editor"),(null==i?void 0:i.datatype)&&(r.shaclDatatype=i.datatype),void 0!==(null==i?void 0:i.minCount)&&(r.dataset.minCount=String(i.minCount)),(null==i?void 0:i.class)&&(r.dataset.class=i.class.value),(null==i?void 0:i.nodeKind)&&(r.dataset.nodeKind=i.nodeKind.value),((null==i?void 0:i.hasValue)||(null==i?void 0:i.readonly))&&(r.disabled=!0),r.value=(null==t?void 0:t.value)||(null===(s=null==i?void 0:i.defaultValue)||void 0===s?void 0:s.value)||"";const o=document.createElement("label");o.htmlFor=r.id,o.innerText=e,(null==i?void 0:i.description)&&o.setAttribute("title",i.description.value);const a=(null==i?void 0:i.description)?i.description.value:(null==i?void 0:i.pattern)?i.pattern:null;a&&r.setAttribute("placeholder",a),n&&(r.setAttribute("required","true"),o.classList.add("required"));const l=document.createElement("div");return l.appendChild(o),l.appendChild(r),l}createDateEditor(e,t,n,r){var i,s;const o=document.createElement("input");(null===(i=r.datatype)||void 0===i?void 0:i.value)===k+"dateTime"?(o.type="datetime-local",o.setAttribute("step","1")):o.type="date",o.classList.add("pr-0");const a=this.createDefaultTemplate(e,null,n,o,r);if(t)try{let e=new Date(t.value).toISOString();e=(null===(s=r.datatype)||void 0===s?void 0:s.value)===k+"dateTime"?e.slice(0,19):e.slice(0,10),o.value=e}catch(e){console.error(e,t)}return a}createTextEditor(e,t,n,r){let i;return!1===r.singleLine?(i=document.createElement("textarea"),i.rows=5):(i=document.createElement("input"),i.type="text",r.pattern&&(i.pattern=r.pattern)),r.minLength&&(i.minLength=r.minLength),r.maxLength&&(i.maxLength=r.maxLength),this.createDefaultTemplate(e,t,n,i,r)}createLangStringEditor(e,t,n,r){var i;const s=this.createTextEditor(e,t,n,r),o=s.querySelector(":scope .editor");let a;if(null===(i=r.languageIn)||void 0===i?void 0:i.length){a=document.createElement("select");for(const e of r.languageIn){const t=document.createElement("option");t.innerText=e.value,a.appendChild(t)}}else a=document.createElement("input"),a.maxLength=5,a.placeholder="lang?";return a.title="Language of the text",a.classList.add("lang-chooser"),a.addEventListener("change",(e=>{e.stopPropagation(),o&&(o.dataset.lang=a.value,o.dispatchEvent(new Event("change",{bubbles:!0})))})),t instanceof y&&(a.value=t.language),o.dataset.lang=a.value,o.after(a),s}createBooleanEditor(e,t,n,r){var i;const s=document.createElement("input");s.type="checkbox",s.classList.add("ml-0");const o=this.createDefaultTemplate(e,null,n,s,r);return s.removeAttribute("required"),null===(i=o.querySelector(":scope label"))||void 0===i||i.classList.remove("required"),t instanceof y&&(s.checked="true"===t.value),o}createFileEditor(e,t,n,r){const i=document.createElement("input");return i.type="file",i.addEventListener("change",(e=>{var t;if(null===(t=i.files)||void 0===t?void 0:t.length){e.stopPropagation();const t=new FileReader;t.readAsDataURL(i.files[0]),t.onload=()=>{var e;i.binaryData=btoa(t.result),null===(e=i.parentElement)||void 0===e||e.dispatchEvent(new Event("change",{bubbles:!0}))}}else i.binaryData=void 0})),this.createDefaultTemplate(e,t,n,i,r)}createNumberEditor(e,t,n,r){var i;const s=document.createElement("input");s.type="number",s.classList.add("pr-0");const o=void 0!==r.minInclusive?r.minInclusive:void 0!==r.minExclusive?r.minExclusive+1:void 0,a=void 0!==r.maxInclusive?r.maxInclusive:void 0!==r.maxExclusive?r.maxExclusive-1:void 0;return void 0!==o&&(s.min=String(o)),void 0!==a&&(s.max=String(a)),(null===(i=r.datatype)||void 0===i?void 0:i.value)!==k+"integer"&&(s.step="0.1"),this.createDefaultTemplate(e,t,n,s,r)}createListEditor(e,t,n,r,i){const s=document.createElement("select"),o=this.createDefaultTemplate(e,null,n,s,i);let a=!0;for(const e of r){const n=document.createElement("option"),r="string"==typeof e.value?e.value:e.value.value;if(n.innerHTML=e.label?e.label:r,n.value=r,e.indent)for(let t=0;t<e.indent;t++)n.innerHTML="&#160;&#160;"+n.innerHTML;t&&t.value===r&&(n.selected=!0),""===r&&(a=!1),s.appendChild(n)}if(a){const e=document.createElement("option");e.value="",t||(e.selected=!0),s.prepend(e)}return t&&(s.value=t.value),o}createButton(e,t){const n=document.createElement("button");return n.type="button",n.innerHTML=e,n}}class $r extends Mr{constructor(){super(new Pr)}}window.customElements.define("shacl-form",$r);export{ct as Config,ot as Loader,je as Plugin,$r as ShaclForm,se as ShaclPropertyTemplate,oe as Theme,X as findLabel,Se as registerPlugin,at as setSharedShapesGraph};
1
+ var Kt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function vc(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var Vn={},fr={},Ea;function _c(){if(Ea)return fr;Ea=1,fr.byteLength=o,fr.toByteArray=d,fr.fromByteArray=w;for(var r=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=n.length;i<s;++i)r[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function a(g){var y=g.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var _=g.indexOf("=");_===-1&&(_=y);var x=_===y?0:4-_%4;return[_,x]}function o(g){var y=a(g),_=y[0],x=y[1];return(_+x)*3/4-x}function l(g,y,_){return(y+_)*3/4-_}function d(g){var y,_=a(g),x=_[0],S=_[1],I=new t(l(g,x,S)),b=0,c=S>0?x-4:x,p;for(p=0;p<c;p+=4)y=e[g.charCodeAt(p)]<<18|e[g.charCodeAt(p+1)]<<12|e[g.charCodeAt(p+2)]<<6|e[g.charCodeAt(p+3)],I[b++]=y>>16&255,I[b++]=y>>8&255,I[b++]=y&255;return S===2&&(y=e[g.charCodeAt(p)]<<2|e[g.charCodeAt(p+1)]>>4,I[b++]=y&255),S===1&&(y=e[g.charCodeAt(p)]<<10|e[g.charCodeAt(p+1)]<<4|e[g.charCodeAt(p+2)]>>2,I[b++]=y>>8&255,I[b++]=y&255),I}function h(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function m(g,y,_){for(var x,S=[],I=y;I<_;I+=3)x=(g[I]<<16&16711680)+(g[I+1]<<8&65280)+(g[I+2]&255),S.push(h(x));return S.join("")}function w(g){for(var y,_=g.length,x=_%3,S=[],I=16383,b=0,c=_-x;b<c;b+=I)S.push(m(g,b,b+I>c?c:b+I));return x===1?(y=g[_-1],S.push(r[y>>2]+r[y<<4&63]+"==")):x===2&&(y=(g[_-2]<<8)+g[_-1],S.push(r[y>>10]+r[y>>4&63]+r[y<<2&63]+"=")),S.join("")}return fr}var Yr={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Ia;function xc(){return Ia||(Ia=1,Yr.read=function(r,e,t,n,i){var s,a,o=i*8-n-1,l=(1<<o)-1,d=l>>1,h=-7,m=t?i-1:0,w=t?-1:1,g=r[e+m];for(m+=w,s=g&(1<<-h)-1,g>>=-h,h+=o;h>0;s=s*256+r[e+m],m+=w,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=n;h>0;a=a*256+r[e+m],m+=w,h-=8);if(s===0)s=1-d;else{if(s===l)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),s=s-d}return(g?-1:1)*a*Math.pow(2,s-n)},Yr.write=function(r,e,t,n,i,s){var a,o,l,d=s*8-i-1,h=(1<<d)-1,m=h>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-1,y=n?1:-1,_=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+m>=1?e+=w/l:e+=w*Math.pow(2,1-m),e*l>=2&&(a++,l/=2),a+m>=h?(o=0,a=h):a+m>=1?(o=(e*l-1)*Math.pow(2,i),a=a+m):(o=e*Math.pow(2,m-1)*Math.pow(2,i),a=0));i>=8;r[t+g]=o&255,g+=y,o/=256,i-=8);for(a=a<<i|o,d+=i;d>0;r[t+g]=a&255,g+=y,a/=256,d-=8);r[t+g-y]|=_*128}),Yr}/*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ */var Ra;function bt(){return Ra||(Ra=1,function(r){const e=_c(),t=xc(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=o,r.SlowBuffer=I,r.INSPECT_MAX_BYTES=50;const i=2147483647;r.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=s(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const E=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(E,u),E.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function a(E){if(E>i)throw new RangeError('The value "'+E+'" is invalid for option "size"');const u=new Uint8Array(E);return Object.setPrototypeOf(u,o.prototype),u}function o(E,u,f){if(typeof E=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(E)}return l(E,u,f)}o.poolSize=8192;function l(E,u,f){if(typeof E=="string")return w(E,u);if(ArrayBuffer.isView(E))return y(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(se(E,ArrayBuffer)||E&&se(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(se(E,SharedArrayBuffer)||E&&se(E.buffer,SharedArrayBuffer)))return _(E,u,f);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const k=E.valueOf&&E.valueOf();if(k!=null&&k!==E)return o.from(k,u,f);const J=x(E);if(J)return J;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return o.from(E[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}o.from=function(E,u,f){return l(E,u,f)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function d(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function h(E,u,f){return d(E),E<=0?a(E):u!==void 0?typeof f=="string"?a(E).fill(u,f):a(E).fill(u):a(E)}o.alloc=function(E,u,f){return h(E,u,f)};function m(E){return d(E),a(E<0?0:S(E)|0)}o.allocUnsafe=function(E){return m(E)},o.allocUnsafeSlow=function(E){return m(E)};function w(E,u){if((typeof u!="string"||u==="")&&(u="utf8"),!o.isEncoding(u))throw new TypeError("Unknown encoding: "+u);const f=b(E,u)|0;let k=a(f);const J=k.write(E,u);return J!==f&&(k=k.slice(0,J)),k}function g(E){const u=E.length<0?0:S(E.length)|0,f=a(u);for(let k=0;k<u;k+=1)f[k]=E[k]&255;return f}function y(E){if(se(E,Uint8Array)){const u=new Uint8Array(E);return _(u.buffer,u.byteOffset,u.byteLength)}return g(E)}function _(E,u,f){if(u<0||E.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');let k;return u===void 0&&f===void 0?k=new Uint8Array(E):f===void 0?k=new Uint8Array(E,u):k=new Uint8Array(E,u,f),Object.setPrototypeOf(k,o.prototype),k}function x(E){if(o.isBuffer(E)){const u=S(E.length)|0,f=a(u);return f.length===0||E.copy(f,0,0,u),f}if(E.length!==void 0)return typeof E.length!="number"||Se(E.length)?a(0):g(E);if(E.type==="Buffer"&&Array.isArray(E.data))return g(E.data)}function S(E){if(E>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return E|0}function I(E){return+E!=E&&(E=0),o.alloc(+E)}o.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==o.prototype},o.compare=function(u,f){if(se(u,Uint8Array)&&(u=o.from(u,u.offset,u.byteLength)),se(f,Uint8Array)&&(f=o.from(f,f.offset,f.byteLength)),!o.isBuffer(u)||!o.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===f)return 0;let k=u.length,J=f.length;for(let ie=0,oe=Math.min(k,J);ie<oe;++ie)if(u[ie]!==f[ie]){k=u[ie],J=f[ie];break}return k<J?-1:J<k?1:0},o.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(u,f){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return o.alloc(0);let k;if(f===void 0)for(f=0,k=0;k<u.length;++k)f+=u[k].length;const J=o.allocUnsafe(f);let ie=0;for(k=0;k<u.length;++k){let oe=u[k];if(se(oe,Uint8Array))ie+oe.length>J.length?(o.isBuffer(oe)||(oe=o.from(oe)),oe.copy(J,ie)):Uint8Array.prototype.set.call(J,oe,ie);else if(o.isBuffer(oe))oe.copy(J,ie);else throw new TypeError('"list" argument must be an Array of Buffers');ie+=oe.length}return J};function b(E,u){if(o.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||se(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const f=E.length,k=arguments.length>2&&arguments[2]===!0;if(!k&&f===0)return 0;let J=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return de(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return le(E).length;default:if(J)return k?-1:de(E).length;u=(""+u).toLowerCase(),J=!0}}o.byteLength=b;function c(E,u,f){let k=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,u>>>=0,f<=u))return"";for(E||(E="utf8");;)switch(E){case"hex":return K(this,u,f);case"utf8":case"utf-8":return j(this,u,f);case"ascii":return ee(this,u,f);case"latin1":case"binary":return C(this,u,f);case"base64":return A(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,u,f);default:if(k)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),k=!0}}o.prototype._isBuffer=!0;function p(E,u,f){const k=E[u];E[u]=E[f],E[f]=k}o.prototype.swap16=function(){const u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<u;f+=2)p(this,f,f+1);return this},o.prototype.swap32=function(){const u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<u;f+=4)p(this,f,f+3),p(this,f+1,f+2);return this},o.prototype.swap64=function(){const u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<u;f+=8)p(this,f,f+7),p(this,f+1,f+6),p(this,f+2,f+5),p(this,f+3,f+4);return this},o.prototype.toString=function(){const u=this.length;return u===0?"":arguments.length===0?j(this,0,u):c.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(u){if(!o.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:o.compare(this,u)===0},o.prototype.inspect=function(){let u="";const f=r.INSPECT_MAX_BYTES;return u=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(u+=" ... "),"<Buffer "+u+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(u,f,k,J,ie){if(se(u,Uint8Array)&&(u=o.from(u,u.offset,u.byteLength)),!o.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(f===void 0&&(f=0),k===void 0&&(k=u?u.length:0),J===void 0&&(J=0),ie===void 0&&(ie=this.length),f<0||k>u.length||J<0||ie>this.length)throw new RangeError("out of range index");if(J>=ie&&f>=k)return 0;if(J>=ie)return-1;if(f>=k)return 1;if(f>>>=0,k>>>=0,J>>>=0,ie>>>=0,this===u)return 0;let oe=ie-J,we=k-f;const Le=Math.min(oe,we),Te=this.slice(J,ie),je=u.slice(f,k);for(let Ie=0;Ie<Le;++Ie)if(Te[Ie]!==je[Ie]){oe=Te[Ie],we=je[Ie];break}return oe<we?-1:we<oe?1:0};function N(E,u,f,k,J){if(E.length===0)return-1;if(typeof f=="string"?(k=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Se(f)&&(f=J?0:E.length-1),f<0&&(f=E.length+f),f>=E.length){if(J)return-1;f=E.length-1}else if(f<0)if(J)f=0;else return-1;if(typeof u=="string"&&(u=o.from(u,k)),o.isBuffer(u))return u.length===0?-1:D(E,u,f,k,J);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?J?Uint8Array.prototype.indexOf.call(E,u,f):Uint8Array.prototype.lastIndexOf.call(E,u,f):D(E,[u],f,k,J);throw new TypeError("val must be string, number or Buffer")}function D(E,u,f,k,J){let ie=1,oe=E.length,we=u.length;if(k!==void 0&&(k=String(k).toLowerCase(),k==="ucs2"||k==="ucs-2"||k==="utf16le"||k==="utf-16le")){if(E.length<2||u.length<2)return-1;ie=2,oe/=2,we/=2,f/=2}function Le(je,Ie){return ie===1?je[Ie]:je.readUInt16BE(Ie*ie)}let Te;if(J){let je=-1;for(Te=f;Te<oe;Te++)if(Le(E,Te)===Le(u,je===-1?0:Te-je)){if(je===-1&&(je=Te),Te-je+1===we)return je*ie}else je!==-1&&(Te-=Te-je),je=-1}else for(f+we>oe&&(f=oe-we),Te=f;Te>=0;Te--){let je=!0;for(let Ie=0;Ie<we;Ie++)if(Le(E,Te+Ie)!==Le(u,Ie)){je=!1;break}if(je)return Te}return-1}o.prototype.includes=function(u,f,k){return this.indexOf(u,f,k)!==-1},o.prototype.indexOf=function(u,f,k){return N(this,u,f,k,!0)},o.prototype.lastIndexOf=function(u,f,k){return N(this,u,f,k,!1)};function T(E,u,f,k){f=Number(f)||0;const J=E.length-f;k?(k=Number(k),k>J&&(k=J)):k=J;const ie=u.length;k>ie/2&&(k=ie/2);let oe;for(oe=0;oe<k;++oe){const we=parseInt(u.substr(oe*2,2),16);if(Se(we))return oe;E[f+oe]=we}return oe}function q(E,u,f,k){return he(de(u,E.length-f),E,f,k)}function R(E,u,f,k){return he(pe(u),E,f,k)}function M(E,u,f,k){return he(le(u),E,f,k)}function B(E,u,f,k){return he(X(u,E.length-f),E,f,k)}o.prototype.write=function(u,f,k,J){if(f===void 0)J="utf8",k=this.length,f=0;else if(k===void 0&&typeof f=="string")J=f,k=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(k)?(k=k>>>0,J===void 0&&(J="utf8")):(J=k,k=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ie=this.length-f;if((k===void 0||k>ie)&&(k=ie),u.length>0&&(k<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");J||(J="utf8");let oe=!1;for(;;)switch(J){case"hex":return T(this,u,f,k);case"utf8":case"utf-8":return q(this,u,f,k);case"ascii":case"latin1":case"binary":return R(this,u,f,k);case"base64":return M(this,u,f,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,u,f,k);default:if(oe)throw new TypeError("Unknown encoding: "+J);J=(""+J).toLowerCase(),oe=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(E,u,f){return u===0&&f===E.length?e.fromByteArray(E):e.fromByteArray(E.slice(u,f))}function j(E,u,f){f=Math.min(E.length,f);const k=[];let J=u;for(;J<f;){const ie=E[J];let oe=null,we=ie>239?4:ie>223?3:ie>191?2:1;if(J+we<=f){let Le,Te,je,Ie;switch(we){case 1:ie<128&&(oe=ie);break;case 2:Le=E[J+1],(Le&192)===128&&(Ie=(ie&31)<<6|Le&63,Ie>127&&(oe=Ie));break;case 3:Le=E[J+1],Te=E[J+2],(Le&192)===128&&(Te&192)===128&&(Ie=(ie&15)<<12|(Le&63)<<6|Te&63,Ie>2047&&(Ie<55296||Ie>57343)&&(oe=Ie));break;case 4:Le=E[J+1],Te=E[J+2],je=E[J+3],(Le&192)===128&&(Te&192)===128&&(je&192)===128&&(Ie=(ie&15)<<18|(Le&63)<<12|(Te&63)<<6|je&63,Ie>65535&&Ie<1114112&&(oe=Ie))}}oe===null?(oe=65533,we=1):oe>65535&&(oe-=65536,k.push(oe>>>10&1023|55296),oe=56320|oe&1023),k.push(oe),J+=we}return L(k)}const Y=4096;function L(E){const u=E.length;if(u<=Y)return String.fromCharCode.apply(String,E);let f="",k=0;for(;k<u;)f+=String.fromCharCode.apply(String,E.slice(k,k+=Y));return f}function ee(E,u,f){let k="";f=Math.min(E.length,f);for(let J=u;J<f;++J)k+=String.fromCharCode(E[J]&127);return k}function C(E,u,f){let k="";f=Math.min(E.length,f);for(let J=u;J<f;++J)k+=String.fromCharCode(E[J]);return k}function K(E,u,f){const k=E.length;(!u||u<0)&&(u=0),(!f||f<0||f>k)&&(f=k);let J="";for(let ie=u;ie<f;++ie)J+=Be[E[ie]];return J}function v(E,u,f){const k=E.slice(u,f);let J="";for(let ie=0;ie<k.length-1;ie+=2)J+=String.fromCharCode(k[ie]+k[ie+1]*256);return J}o.prototype.slice=function(u,f){const k=this.length;u=~~u,f=f===void 0?k:~~f,u<0?(u+=k,u<0&&(u=0)):u>k&&(u=k),f<0?(f+=k,f<0&&(f=0)):f>k&&(f=k),f<u&&(f=u);const J=this.subarray(u,f);return Object.setPrototypeOf(J,o.prototype),J};function U(E,u,f){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+u>f)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(u,f,k){u=u>>>0,f=f>>>0,k||U(u,f,this.length);let J=this[u],ie=1,oe=0;for(;++oe<f&&(ie*=256);)J+=this[u+oe]*ie;return J},o.prototype.readUintBE=o.prototype.readUIntBE=function(u,f,k){u=u>>>0,f=f>>>0,k||U(u,f,this.length);let J=this[u+--f],ie=1;for(;f>0&&(ie*=256);)J+=this[u+--f]*ie;return J},o.prototype.readUint8=o.prototype.readUInt8=function(u,f){return u=u>>>0,f||U(u,1,this.length),this[u]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(u,f){return u=u>>>0,f||U(u,2,this.length),this[u]|this[u+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(u,f){return u=u>>>0,f||U(u,2,this.length),this[u]<<8|this[u+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(u,f){return u=u>>>0,f||U(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(u,f){return u=u>>>0,f||U(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},o.prototype.readBigUInt64LE=ve(function(u){u=u>>>0,O(u,"offset");const f=this[u],k=this[u+7];(f===void 0||k===void 0)&&G(u,this.length-8);const J=f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,ie=this[++u]+this[++u]*2**8+this[++u]*2**16+k*2**24;return BigInt(J)+(BigInt(ie)<<BigInt(32))}),o.prototype.readBigUInt64BE=ve(function(u){u=u>>>0,O(u,"offset");const f=this[u],k=this[u+7];(f===void 0||k===void 0)&&G(u,this.length-8);const J=f*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],ie=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+k;return(BigInt(J)<<BigInt(32))+BigInt(ie)}),o.prototype.readIntLE=function(u,f,k){u=u>>>0,f=f>>>0,k||U(u,f,this.length);let J=this[u],ie=1,oe=0;for(;++oe<f&&(ie*=256);)J+=this[u+oe]*ie;return ie*=128,J>=ie&&(J-=Math.pow(2,8*f)),J},o.prototype.readIntBE=function(u,f,k){u=u>>>0,f=f>>>0,k||U(u,f,this.length);let J=f,ie=1,oe=this[u+--J];for(;J>0&&(ie*=256);)oe+=this[u+--J]*ie;return ie*=128,oe>=ie&&(oe-=Math.pow(2,8*f)),oe},o.prototype.readInt8=function(u,f){return u=u>>>0,f||U(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},o.prototype.readInt16LE=function(u,f){u=u>>>0,f||U(u,2,this.length);const k=this[u]|this[u+1]<<8;return k&32768?k|4294901760:k},o.prototype.readInt16BE=function(u,f){u=u>>>0,f||U(u,2,this.length);const k=this[u+1]|this[u]<<8;return k&32768?k|4294901760:k},o.prototype.readInt32LE=function(u,f){return u=u>>>0,f||U(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},o.prototype.readInt32BE=function(u,f){return u=u>>>0,f||U(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},o.prototype.readBigInt64LE=ve(function(u){u=u>>>0,O(u,"offset");const f=this[u],k=this[u+7];(f===void 0||k===void 0)&&G(u,this.length-8);const J=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(k<<24);return(BigInt(J)<<BigInt(32))+BigInt(f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),o.prototype.readBigInt64BE=ve(function(u){u=u>>>0,O(u,"offset");const f=this[u],k=this[u+7];(f===void 0||k===void 0)&&G(u,this.length-8);const J=(f<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(J)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+k)}),o.prototype.readFloatLE=function(u,f){return u=u>>>0,f||U(u,4,this.length),t.read(this,u,!0,23,4)},o.prototype.readFloatBE=function(u,f){return u=u>>>0,f||U(u,4,this.length),t.read(this,u,!1,23,4)},o.prototype.readDoubleLE=function(u,f){return u=u>>>0,f||U(u,8,this.length),t.read(this,u,!0,52,8)},o.prototype.readDoubleBE=function(u,f){return u=u>>>0,f||U(u,8,this.length),t.read(this,u,!1,52,8)};function Q(E,u,f,k,J,ie){if(!o.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>J||u<ie)throw new RangeError('"value" argument is out of bounds');if(f+k>E.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(u,f,k,J){if(u=+u,f=f>>>0,k=k>>>0,!J){const we=Math.pow(2,8*k)-1;Q(this,u,f,k,we,0)}let ie=1,oe=0;for(this[f]=u&255;++oe<k&&(ie*=256);)this[f+oe]=u/ie&255;return f+k},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(u,f,k,J){if(u=+u,f=f>>>0,k=k>>>0,!J){const we=Math.pow(2,8*k)-1;Q(this,u,f,k,we,0)}let ie=k-1,oe=1;for(this[f+ie]=u&255;--ie>=0&&(oe*=256);)this[f+ie]=u/oe&255;return f+k},o.prototype.writeUint8=o.prototype.writeUInt8=function(u,f,k){return u=+u,f=f>>>0,k||Q(this,u,f,1,255,0),this[f]=u&255,f+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(u,f,k){return u=+u,f=f>>>0,k||Q(this,u,f,2,65535,0),this[f]=u&255,this[f+1]=u>>>8,f+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(u,f,k){return u=+u,f=f>>>0,k||Q(this,u,f,2,65535,0),this[f]=u>>>8,this[f+1]=u&255,f+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(u,f,k){return u=+u,f=f>>>0,k||Q(this,u,f,4,4294967295,0),this[f+3]=u>>>24,this[f+2]=u>>>16,this[f+1]=u>>>8,this[f]=u&255,f+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(u,f,k){return u=+u,f=f>>>0,k||Q(this,u,f,4,4294967295,0),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4};function z(E,u,f,k,J){fe(u,k,J,E,f,7);let ie=Number(u&BigInt(4294967295));E[f++]=ie,ie=ie>>8,E[f++]=ie,ie=ie>>8,E[f++]=ie,ie=ie>>8,E[f++]=ie;let oe=Number(u>>BigInt(32)&BigInt(4294967295));return E[f++]=oe,oe=oe>>8,E[f++]=oe,oe=oe>>8,E[f++]=oe,oe=oe>>8,E[f++]=oe,f}function ae(E,u,f,k,J){fe(u,k,J,E,f,7);let ie=Number(u&BigInt(4294967295));E[f+7]=ie,ie=ie>>8,E[f+6]=ie,ie=ie>>8,E[f+5]=ie,ie=ie>>8,E[f+4]=ie;let oe=Number(u>>BigInt(32)&BigInt(4294967295));return E[f+3]=oe,oe=oe>>8,E[f+2]=oe,oe=oe>>8,E[f+1]=oe,oe=oe>>8,E[f]=oe,f+8}o.prototype.writeBigUInt64LE=ve(function(u,f=0){return z(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=ve(function(u,f=0){return ae(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(u,f,k,J){if(u=+u,f=f>>>0,!J){const Le=Math.pow(2,8*k-1);Q(this,u,f,k,Le-1,-Le)}let ie=0,oe=1,we=0;for(this[f]=u&255;++ie<k&&(oe*=256);)u<0&&we===0&&this[f+ie-1]!==0&&(we=1),this[f+ie]=(u/oe>>0)-we&255;return f+k},o.prototype.writeIntBE=function(u,f,k,J){if(u=+u,f=f>>>0,!J){const Le=Math.pow(2,8*k-1);Q(this,u,f,k,Le-1,-Le)}let ie=k-1,oe=1,we=0;for(this[f+ie]=u&255;--ie>=0&&(oe*=256);)u<0&&we===0&&this[f+ie+1]!==0&&(we=1),this[f+ie]=(u/oe>>0)-we&255;return f+k},o.prototype.writeInt8=function(u,f,k){return u=+u,f=f>>>0,k||Q(this,u,f,1,127,-128),u<0&&(u=255+u+1),this[f]=u&255,f+1},o.prototype.writeInt16LE=function(u,f,k){return u=+u,f=f>>>0,k||Q(this,u,f,2,32767,-32768),this[f]=u&255,this[f+1]=u>>>8,f+2},o.prototype.writeInt16BE=function(u,f,k){return u=+u,f=f>>>0,k||Q(this,u,f,2,32767,-32768),this[f]=u>>>8,this[f+1]=u&255,f+2},o.prototype.writeInt32LE=function(u,f,k){return u=+u,f=f>>>0,k||Q(this,u,f,4,2147483647,-2147483648),this[f]=u&255,this[f+1]=u>>>8,this[f+2]=u>>>16,this[f+3]=u>>>24,f+4},o.prototype.writeInt32BE=function(u,f,k){return u=+u,f=f>>>0,k||Q(this,u,f,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4},o.prototype.writeBigInt64LE=ve(function(u,f=0){return z(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=ve(function(u,f=0){return ae(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(E,u,f,k,J,ie){if(f+k>E.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function V(E,u,f,k,J){return u=+u,f=f>>>0,J||H(E,u,f,4),t.write(E,u,f,k,23,4),f+4}o.prototype.writeFloatLE=function(u,f,k){return V(this,u,f,!0,k)},o.prototype.writeFloatBE=function(u,f,k){return V(this,u,f,!1,k)};function W(E,u,f,k,J){return u=+u,f=f>>>0,J||H(E,u,f,8),t.write(E,u,f,k,52,8),f+8}o.prototype.writeDoubleLE=function(u,f,k){return W(this,u,f,!0,k)},o.prototype.writeDoubleBE=function(u,f,k){return W(this,u,f,!1,k)},o.prototype.copy=function(u,f,k,J){if(!o.isBuffer(u))throw new TypeError("argument should be a Buffer");if(k||(k=0),!J&&J!==0&&(J=this.length),f>=u.length&&(f=u.length),f||(f=0),J>0&&J<k&&(J=k),J===k||u.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(k<0||k>=this.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("sourceEnd out of bounds");J>this.length&&(J=this.length),u.length-f<J-k&&(J=u.length-f+k);const ie=J-k;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,k,J):Uint8Array.prototype.set.call(u,this.subarray(k,J),f),ie},o.prototype.fill=function(u,f,k,J){if(typeof u=="string"){if(typeof f=="string"?(J=f,f=0,k=this.length):typeof k=="string"&&(J=k,k=this.length),J!==void 0&&typeof J!="string")throw new TypeError("encoding must be a string");if(typeof J=="string"&&!o.isEncoding(J))throw new TypeError("Unknown encoding: "+J);if(u.length===1){const oe=u.charCodeAt(0);(J==="utf8"&&oe<128||J==="latin1")&&(u=oe)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(f<0||this.length<f||this.length<k)throw new RangeError("Out of range index");if(k<=f)return this;f=f>>>0,k=k===void 0?this.length:k>>>0,u||(u=0);let ie;if(typeof u=="number")for(ie=f;ie<k;++ie)this[ie]=u;else{const oe=o.isBuffer(u)?u:o.from(u,J),we=oe.length;if(we===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(ie=0;ie<k-f;++ie)this[ie+f]=oe[ie%we]}return this};const F={};function Z(E,u,f){F[E]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(J){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:J,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(E,u){return`The "${E}" argument must be of type number. Received type ${typeof u}`},TypeError),Z("ERR_OUT_OF_RANGE",function(E,u,f){let k=`The value of "${E}" is out of range.`,J=f;return Number.isInteger(f)&&Math.abs(f)>2**32?J=te(String(f)):typeof f=="bigint"&&(J=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(J=te(J)),J+="n"),k+=` It must be ${u}. Received ${J}`,k},RangeError);function te(E){let u="",f=E.length;const k=E[0]==="-"?1:0;for(;f>=k+4;f-=3)u=`_${E.slice(f-3,f)}${u}`;return`${E.slice(0,f)}${u}`}function ce(E,u,f){O(u,"offset"),(E[u]===void 0||E[u+f]===void 0)&&G(u,E.length-(f+1))}function fe(E,u,f,k,J,ie){if(E>f||E<u){const oe=typeof u=="bigint"?"n":"";let we;throw u===0||u===BigInt(0)?we=`>= 0${oe} and < 2${oe} ** ${(ie+1)*8}${oe}`:we=`>= -(2${oe} ** ${(ie+1)*8-1}${oe}) and < 2 ** ${(ie+1)*8-1}${oe}`,new F.ERR_OUT_OF_RANGE("value",we,E)}ce(k,J,ie)}function O(E,u){if(typeof E!="number")throw new F.ERR_INVALID_ARG_TYPE(u,"number",E)}function G(E,u,f){throw Math.floor(E)!==E?(O(E,f),new F.ERR_OUT_OF_RANGE("offset","an integer",E)):u<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${u}`,E)}const re=/[^+/0-9A-Za-z-_]/g;function ue(E){if(E=E.split("=")[0],E=E.trim().replace(re,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function de(E,u){u=u||1/0;let f;const k=E.length;let J=null;const ie=[];for(let oe=0;oe<k;++oe){if(f=E.charCodeAt(oe),f>55295&&f<57344){if(!J){if(f>56319){(u-=3)>-1&&ie.push(239,191,189);continue}else if(oe+1===k){(u-=3)>-1&&ie.push(239,191,189);continue}J=f;continue}if(f<56320){(u-=3)>-1&&ie.push(239,191,189),J=f;continue}f=(J-55296<<10|f-56320)+65536}else J&&(u-=3)>-1&&ie.push(239,191,189);if(J=null,f<128){if((u-=1)<0)break;ie.push(f)}else if(f<2048){if((u-=2)<0)break;ie.push(f>>6|192,f&63|128)}else if(f<65536){if((u-=3)<0)break;ie.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((u-=4)<0)break;ie.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return ie}function pe(E){const u=[];for(let f=0;f<E.length;++f)u.push(E.charCodeAt(f)&255);return u}function X(E,u){let f,k,J;const ie=[];for(let oe=0;oe<E.length&&!((u-=2)<0);++oe)f=E.charCodeAt(oe),k=f>>8,J=f%256,ie.push(J),ie.push(k);return ie}function le(E){return e.toByteArray(ue(E))}function he(E,u,f,k){let J;for(J=0;J<k&&!(J+f>=u.length||J>=E.length);++J)u[J+f]=E[J];return J}function se(E,u){return E instanceof u||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===u.name}function Se(E){return E!==E}const Be=function(){const E="0123456789abcdef",u=new Array(256);for(let f=0;f<16;++f){const k=f*16;for(let J=0;J<16;++J)u[k+J]=E[f]+E[J]}return u}();function ve(E){return typeof BigInt>"u"?He:E}function He(){throw new Error("BigInt not supported")}}(Vn)),Vn}var Sc=bt();const hr="http://www.w3.org/1999/02/22-rdf-syntax-ns#",pr="http://www.w3.org/2001/XMLSchema#",Zr="http://www.w3.org/2000/10/swap/",Pe={xsd:{decimal:`${pr}decimal`,boolean:`${pr}boolean`,double:`${pr}double`,integer:`${pr}integer`,string:`${pr}string`},rdf:{type:`${hr}type`,nil:`${hr}nil`,first:`${hr}first`,rest:`${hr}rest`,langString:`${hr}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Zr}reify#forSome`,forAll:`${Zr}reify#forAll`},log:{implies:`${Zr}log#implies`,isImpliedBy:`${Zr}log#isImpliedBy`}},{xsd:en}=Pe,Ec=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Na={"\\":"\\","'":"'",'"':'"',n:`
7
+ `,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Ic=/[\x00-\x20<>\\"\{\}\|\^\`]/,Rc={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Nc=/$0^/;class Tc{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const t in this)!(t in Rc)&&this[t]instanceof RegExp&&(this[t]=Nc)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let n=this._input,i=n.length;for(;;){let o,l;for(;o=this._newline.exec(n);)this.comments&&(l=this._comment.exec(o[0]))&&s("comment",l[1],"",this._line,o[0].length),n=n.substr(o[0].length,n.length),i=n.length,this._line++;if(!o&&(o=this._whitespace.exec(n))&&(n=n.substr(o[0].length,n.length)),this._endOfFile.test(n))return t&&(this.comments&&(l=this._comment.exec(n))&&s("comment",l[1],"",this._line,n.length),n=null,s("eof","","",this._line,0)),this._input=n;const d=this._line,h=n[0];let m="",w="",g="",y=null,_=0,x=!1;switch(h){case"^":if(n.length<3)break;if(n[1]==="^"){if(this._previousMarker="^^",n=n.substr(2),n[0]!=="<"){x=!0;break}}else{this._n3Mode&&(_=1,m="^");break}case"<":if(y=this._unescapedIri.exec(n))m="IRI",w=y[1];else if(y=this._iri.exec(n)){if(w=this._unescape(y[1]),w===null||Ic.test(w))return a(this);m="IRI"}else n.length>1&&n[1]==="<"?(m="<<",_=2):this._n3Mode&&n.length>1&&n[1]==="="&&(_=2,this._isImpliedBy?(m="abbreviation",w="<"):(m="inverse",w=">"));break;case">":n.length>1&&n[1]===">"&&(m=">>",_=2);break;case"_":((y=this._blank.exec(n))||t&&(y=this._blank.exec(`${n} `)))&&(m="blank",g="_",w=y[1]);break;case'"':if(y=this._simpleQuotedString.exec(n))w=y[1];else if({value:w,matchLength:_}=this._parseLiteral(n),w===null)return a(this);(y!==null||_!==0)&&(m="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(y=this._simpleApostropheString.exec(n))w=y[1];else if({value:w,matchLength:_}=this._parseLiteral(n),w===null)return a(this);(y!==null||_!==0)&&(m="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(y=this._variable.exec(n))&&(m="var",w=y[0]);break;case"@":this._previousMarker==="literal"&&(y=this._langcode.exec(n))?(m="langcode",w=y[1]):(y=this._keyword.exec(n))&&(m=y[0]);break;case".":if(n.length===1?t:n[1]<"0"||n[1]>"9"){m=".",_=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(y=this._number.exec(n)||t&&(y=this._number.exec(`${n} `)))&&(m="literal",w=y[0],g=typeof y[1]=="string"?en.double:typeof y[2]=="string"?en.decimal:en.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(y=this._sparqlKeyword.exec(n))?m=y[0].toUpperCase():x=!0;break;case"f":case"t":(y=this._boolean.exec(n))?(m="literal",w=y[0],g=en.boolean):x=!0;break;case"a":(y=this._shortPredicates.exec(n))?(m="abbreviation",w="a"):x=!0;break;case"=":this._n3Mode&&n.length>1&&(m="abbreviation",n[1]!==">"?(_=1,w="="):(_=2,w=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(_=1,m=h);break;case"{":!this._lineMode&&n.length>=2&&(n[1]==="|"?(m="{|",_=2):(m=h,_=1));break;case"|":n.length>=2&&n[1]==="}"&&(m="|}",_=2);break;default:x=!0}if(x&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(y=this._prefix.exec(n))?(m="prefix",w=y[1]||""):((y=this._prefixed.exec(n))||t&&(y=this._prefixed.exec(`${n} `)))&&(m="prefixed",g=y[1]||"",w=this._unescape(y[2]))),this._previousMarker==="^^")switch(m){case"prefixed":m="type";break;case"IRI":m="typeIRI";break;default:m=""}if(!m)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?a(this):this._input=n;const S=_||y[0].length,I=s(m,w,g,d,S);this.previousToken=I,this._previousMarker=m,n=n.substr(S,n.length)}function s(o,l,d,h,m){const w=n?i-n.length:i,g=w+m,y={type:o,value:l,prefix:d,line:h,start:w,end:g};return e(null,y),y}function a(o){e(o._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1;const n=e.replace(Ec,(i,s,a,o)=>{if(typeof s=="string")return String.fromCharCode(Number.parseInt(s,16));if(typeof a=="string"){let l=Number.parseInt(a,16);return l<=65535?String.fromCharCode(Number.parseInt(a,16)):String.fromCharCode(55296+((l-=65536)>>10),56320+(l&1023))}return o in Na?Na[o]:(t=!0,"")});return t?null:n}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length;let i=Math.max(this._literalClosingPos,n);for(;(i=e.indexOf(t,i))>0;){let s=0;for(;e[i-s-1]==="\\";)s++;if(s%2===0){const a=e.substring(n,i),o=a.split(/\r\n|\r|\n/).length-1,l=i+n;if(n===1&&o!==0||n===3&&this._lineMode)break;return this._line+=o,{value:this._unescape(a),matchLength:l}}i++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,t){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof t=="function")queueMicrotask(()=>this._tokenizeToEnd(t,!0));else{const n=[];let i;if(this._tokenizeToEnd((s,a)=>s?i=s:n.push(a),!0),i)throw i;return n}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",n=>{this._input!==null&&n.length!==0&&(this._pendingBuffer&&(n=Sc.Buffer.concat([this._pendingBuffer,n]),this._pendingBuffer=null),n[n.length-1]&128?this._pendingBuffer=n:(typeof this._input>"u"?this._input=this._readStartingBom(typeof n=="string"?n:n.toString()):this._input+=n,this._tokenizeToEnd(t,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(t,!0)}),e.on("error",t)}}const{rdf:Ac,xsd:Dt}=Pe;let ar,Lc=0;const Ee={namedNode:cu,blankNode:du,variable:hu,literal:fu,defaultGraph:kc,quad:Is,triple:Is,fromTerm:kr,fromQuad:pu};class st{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof st?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}let In=class extends st{get termType(){return"NamedNode"}},it=class uu extends st{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 In(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!=="@"?Dt.string:Ac.langString}equals(e){return e instanceof uu?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}}}},jc=class extends st{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},Oc=class extends st{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},$c=class extends st{constructor(){return super(""),ar||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};ar=new $c;function $r(r,e,t){if(e=e||Ee,!r)return e.defaultGraph();switch(r[0]){case"?":return e.variable(r.substr(1));case"_":return e.blankNode(r.substr(2));case'"':if(e===Ee)return new it(r);if(r[r.length-1]==='"')return e.literal(r.substr(1,r.length-2));const n=r.lastIndexOf('"',r.length-1);return e.literal(r.substr(1,n-1),r[n+1]==="@"?r.substr(n+2):e.namedNode(r.substr(n+3)));case"[":r=JSON.parse(r);break;default:if(!t||!Array.isArray(r))return e.namedNode(r)}return e.quad($r(r[0],e,!0),$r(r[1],e,!0),$r(r[2],e,!0),r[3]&&$r(r[3],e,!0))}function Yt(r,e){if(typeof r=="string")return r;if(r instanceof st&&r.termType!=="Quad")return r.id;if(!r)return ar.id;switch(r.termType){case"NamedNode":return r.value;case"BlankNode":return`_:${r.value}`;case"Variable":return`?${r.value}`;case"DefaultGraph":return"";case"Literal":return`"${r.value}"${r.language?`@${r.language}`:r.datatype&&r.datatype.value!==Dt.string?`^^${r.datatype.value}`:""}`;case"Quad":const t=[Yt(r.subject,!0),Yt(r.predicate,!0),Yt(r.object,!0)];return r.graph&&r.graph.termType!=="DefaultGraph"&&t.push(Yt(r.graph,!0)),e?t:JSON.stringify(t);default:throw new Error(`Unexpected termType: ${r.termType}`)}}let Rn=class extends st{constructor(e,t,n,i){super(""),this._subject=e,this._predicate=t,this._object=n,this._graph=i||ar}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 cu(r){return new In(r)}function du(r){return new jc(r||`n3-${Lc++}`)}function fu(r,e){if(typeof e=="string")return new it(`"${r}"@${e.toLowerCase()}`);let t=e?e.value:"";return t===""&&(typeof r=="boolean"?t=Dt.boolean:typeof r=="number"&&(Number.isFinite(r)?t=Number.isInteger(r)?Dt.integer:Dt.double:(t=Dt.double,Number.isNaN(r)||(r=r>0?"INF":"-INF")))),t===""||t===Dt.string?new it(`"${r}"`):new it(`"${r}"^^${t}`)}function hu(r){return new Oc(r)}function kc(){return ar}function Is(r,e,t,n){return new Rn(r,e,t,n)}function kr(r){if(r instanceof st)return r;switch(r.termType){case"NamedNode":return cu(r.value);case"BlankNode":return du(r.value);case"Variable":return hu(r.value);case"DefaultGraph":return ar;case"Literal":return fu(r.value,r.language||r.datatype);case"Quad":return pu(r);default:throw new Error(`Unexpected termType: ${r.termType}`)}}function pu(r){if(r instanceof Rn)return r;if(r.termType!=="Quad")throw new Error(`Unexpected termType: ${r.termType}`);return Is(kr(r.subject),kr(r.predicate),kr(r.object),kr(r.graph))}let Ta=0;class Rs{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&gu(this,e.factory);const t=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(t),i=/trig/.test(t),s=/triple/.test(t),a=/quad/.test(t),o=this._n3Mode=/n3/.test(t),l=s||a;(this._supportsNamedGraphs=!(n||o))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||s||o),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=t===""||/star|\*$/.test(t),l&&(this._resolveRelativeIRI=d=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Tc({lineMode:l,n3:o,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Ta=0}_setBase(e){if(!e)this._base="",this._basePath="";else{const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,t,n,i,s){const a=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:i,object:s,graph:t,inverse:a?this._inversePredicate:!1,blankPrefix:a?this._prefixes._:"",quantified:a?this._quantified:null}),a&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let n;switch(e.type){case"IRI":case"typeIRI":const i=this._resolveIRI(e.value);if(i===null)return this._error("Invalid IRI",e);n=this._factory.namedNode(i);break;case"type":case"prefixed":const s=this._prefixes[e.prefix];if(s===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._factory.namedNode(s+e.value);break;case"blank":n=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${t}`,e):(this._subject=null,t==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,n=null,i=this._readListItem;const s=this._subject,a=this._contextStack,o=a[a.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),a.length!==0&&a[a.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,i=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if((t=this._readEntity(e))===void 0)return}if(n===null&&(this._subject=n=this._factory.blankNode()),s===null?o.predicate===null?o.subject=n:o.object=n:this._emit(s,this.RDF_REST,n,this._graph),t!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return i}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const n=this._readEntity(e);if(n===void 0)return;t=this._factory.literal(this._literalValue,n),e=null;break;case"langcode":t=this._factory.literal(this._literalValue,e.value),e=null;break}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),n.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,n=this._graph;const i=this._subject,s=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,s&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const a=this._predicate,o=this._object;this._subject=this._factory.quad(i,a,o,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(n=this._readEntity(e))!==void 0){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(i!==null){const a=this._predicate,o=this._object;s?this._emit(o,a,i,n):this._emit(i,a,o,n)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t=e.type==="IRI"&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if((t=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,n=t.length&&t[t.length-1];if(n&&n.type==="item"){const i=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,i,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,n;const i=this._factory.blankNode();if((n=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=i):(t=this._object,this._object=i),this._emit(t,n,i,this._graph),this._readPath}_readBackwardPath(e){const t=this._factory.blankNode();let n,i;if((n=this._readEntity(e))!==void 0)return this._predicate===null?(i=this._subject,this._subject=t):(i=this._object,this._object=t),this._emit(t,n,i,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,n,i){this._callback(null,this._factory.quad(e,t,n,i||this.DEFAULTGRAPH))}_error(e,t){const n=new Error(`${e} on line ${t.line}.`);n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=tn}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let n="",i=-1,s=-1,a=0,o="/";for(;i<t;){switch(o){case":":if(s<0&&e[++i]==="/"&&e[++i]==="/")for(;(s=i+1)<t&&e[s]!=="/";)i=s;break;case"?":case"#":i=t;break;case"/":if(e[i+1]===".")switch(o=e[++i+1],o){case"/":n+=e.substring(a,i-1),a=i+1;break;case void 0:case"?":case"#":return n+e.substring(a,i)+e.substr(i+1);case".":if(o=e[++i+1],o===void 0||o==="/"||o==="?"||o==="#"){if(n+=e.substring(a,i-2),(a=n.lastIndexOf("/"))>=s&&(n=n.substr(0,a)),o!=="/")return`${n}/${e.substr(i+1)}`;a=i+1}}}o=e[++i]}return n+e.substring(a)}parse(e,t,n){let i,s,a;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(i=t.onQuad,s=t.onPrefix,a=t.onComment):(i=t,s=n),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Ta++}_`,this._prefixCallback=s||tn,this._inversePredicate=!1,this._quantified=Object.create(null),!i){const l=[];let d;if(this._callback=(h,m)=>{h?d=h:m&&l.push(m)},this._lexer.tokenize(e).every(h=>this._readCallback=this._readCallback(h)),d)throw d;return l}let o=(l,d)=>{l!==null?(this._callback(l),this._callback=tn):this._readCallback&&(this._readCallback=this._readCallback(d))};a&&(this._lexer.comments=!0,o=(l,d)=>{l!==null?(this._callback(l),this._callback=tn):this._readCallback&&(d.type==="comment"?a(d.value):this._readCallback=this._readCallback(d))}),this._callback=i,this._lexer.tokenize(e,o)}}function tn(){}function gu(r,e){r._factory=e,r.DEFAULTGRAPH=e.defaultGraph(),r.RDF_FIRST=e.namedNode(Pe.rdf.first),r.RDF_REST=e.namedNode(Pe.rdf.rest),r.RDF_NIL=e.namedNode(Pe.rdf.nil),r.N3_FORALL=e.namedNode(Pe.r.forAll),r.N3_FORSOME=e.namedNode(Pe.r.forSome),r.ABBREVIATIONS={a:e.namedNode(Pe.rdf.type),"=":e.namedNode(Pe.owl.sameAs),">":e.namedNode(Pe.log.implies),"<":e.namedNode(Pe.log.isImpliedBy)},r.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}gu(Rs.prototype,Ee);function Ns(r){return!!r&&r.termType==="DefaultGraph"}function cn(r){return r.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const Dc=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,Mc=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,Aa="./",Cc="../",Gn="?",La="#";class qs{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!Dc.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!qs.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",cn(e)],n=[],i=[],s=/[^/?#]*([/?#])/y;let a,o=0,l=0,d=s.lastIndex=e.length;for(;!o&&!l&&(a=s.exec(this.base));)a[1]===La?l=s.lastIndex-1:(t.push(cn(a[0]),"(?:"),n.push(")?"),a[1]!==Gn?i.push(d=s.lastIndex):(o=d=s.lastIndex,l=this.base.indexOf(La,o),this._pathReplacements[o]=Gn));for(let h=0;h<i.length;h++)this._pathReplacements[i[h]]=Cc.repeat(i.length-h-1);return this._pathReplacements[i[i.length-1]]=Aa,this._baseLength=l>0?l:this.base.length,t.push(cn(this.base.substring(d,this._baseLength)),o?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...t,...n].join(""))}toRelative(e){const t=this._getBaseMatcher().exec(e);if(!t)return e;const n=t[0].length;if(n===this._baseLength&&n===e.length)return"";const i=this._pathReplacements[n];if(i){const s=e.substring(n);return i!==Gn&&!Mc.test(s)?e:i===Aa&&/^[^?#]/.test(s)?s:i+s}return e.substring(n-1)}}const gr=Ee.defaultGraph(),{rdf:Pc,xsd:zt}=Pe,ja=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Oa=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,qc={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class yr extends st{equals(e){return e===this}}class Bs{constructor(e,t){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=t.end===void 0?!0:!!t.end;else{let n="";this._outputStream={write(i,s,a){n+=i,a&&a()},end:i=>{i&&i(null,n)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=gr,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new qs(t.baseIRI)))}get _inDefaultGraph(){return gr.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,n,i,s){try{i.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`.
8
+ `:`
9
+ }
10
+ `)+(gr.equals(i)?"":`${this._encodeIriOrBlank(i)} {
11
+ `)),this._graph=i,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,s):this._write(`;
12
+ ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,s):this._write(`${(this._subject===null?"":`.
13
+ `)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,s)}catch(a){s&&s(a)}}_writeQuadLine(e,t,n,i,s){delete this._prefixMatch,this._write(this.quadToString(e,t,n,i),s)}quadToString(e,t,n,i){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(n)}${i&&i.value?` ${this._encodeIriOrBlank(i)} .
14
+ `:` .
15
+ `}`}quadsToString(e){let t="";for(const n of e)t+=this.quadToString(n.subject,n.predicate,n.object,n.graph);return t}_encodeSubject(e){return e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")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._baseIri&&(t=this._baseIri.toRelative(t)),ja.test(t)&&(t=t.replace(Oa,$a));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(ja.test(t)&&(t=t.replace(Oa,$a)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===zt.string)return`"${t}"`}else switch(e.datatype.value){case zt.string:return`"${t}"`;case zt.boolean:if(t==="true"||t==="false")return t;break;case zt.integer:if(/^[+-]?\d+$/.test(t))return t;break;case zt.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case zt.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t;break}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===Pc.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:i}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(n)}${Ns(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,n,i,s){n===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):typeof i=="function"?this._writeQuad(e,t,n,gr,i):this._writeQuad(e,t,n,i||gr,s)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,n){const i={};i[e]=t,this.addPrefixes(i,n)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let n=!1;for(let i in e){let s=e[i];typeof s!="string"&&(s=s.value),n=!0,this._subject!==null&&(this._write(this._inDefaultGraph?`.
16
+ `:`
17
+ }
18
+ `),this._subject=null,this._graph=""),this._prefixIRIs[s]=i+=":",this._write(`@prefix ${i} <${s}>.
19
+ `)}if(n){let i="",s="";for(const a in this._prefixIRIs)i+=i?`|${a}`:a,s+=(s?"|":"")+this._prefixIRIs[a];i=cn(i),this._prefixRegex=new RegExp(`^(?:${s})[^/]*$|^(${i})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(n?`
20
+ `:"",t)}blank(e,t){let n=e,i,s;switch(e===void 0?n=[]:e.termType?n=[{predicate:e,object:t}]:"length"in e||(n=[e]),s=n.length){case 0:return new yr("[]");case 1:if(i=n[0],!(i.object instanceof yr))return new yr(`[ ${this._encodePredicate(i.predicate)} ${this._encodeObject(i.object)} ]`);default:let a="[";for(let o=0;o<s;o++)i=n[o],i.predicate.equals(e)?a+=`, ${this._encodeObject(i.object)}`:(a+=`${(o?`;
21
+ `:`
22
+ `)+this._encodePredicate(i.predicate)} ${this._encodeObject(i.object)}`,e=i.predicate);return new yr(`${a}
23
+ ]`)}}list(e){const t=e&&e.length||0,n=new Array(t);for(let i=0;i<t;i++)n[i]=this._encodeObject(e[i]);return new yr(`(${n.join(" ")})`)}end(e){this._subject!==null&&(this._write(this._inDefaultGraph?`.
24
+ `:`
25
+ }
26
+ `),this._subject=null),this._write=this._blockedWrite;let t=e&&((n,i)=>{t=null,e(n,i)});if(this._endStream)try{return this._outputStream.end(t)}catch{}t&&t()}}function $a(r){let e=qc[r];return e===void 0&&(r.length===1?(e=r.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}var Wn={exports:{}},zn={exports:{}},Jn,ka;function $e(){if(ka)return Jn;ka=1;class r extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let n="";for(let i=0;i<t.length;i++)n+=` ${t[i].stack}
27
+ `;super(n),this.name="AggregateError",this.errors=t}}return Jn={AggregateError:r,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,n){return e.slice(t,n)},Error,FunctionPrototypeCall(e,t,...n){return e.call(t,...n)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,n){return Object.defineProperty(e,t,n)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,n){return e.then(t,n)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,n){return e.slice(t,n)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,n){return e.set(t,n)},Boolean,Uint8Array},Jn}var Qn={exports:{}},Xn,Da;function yu(){return Da||(Da=1,Xn={format(r,...e){return r.replace(/%([sdifj])/g,function(...[t,n]){const i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'"))if(r.includes('"')){if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}else return`"${r}"`;return`'${r}'`;case"number":return isNaN(r)?"NaN":Object.is(r,-0)?String(r):r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}}}),Xn}var Kn,Ma;function Ve(){if(Ma)return Kn;Ma=1;const{format:r,inspect:e}=yu(),{AggregateError:t}=$e(),n=globalThis.AggregateError||t,i=Symbol("kIsNodeError"),s=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,o="__node_internal_",l={};function d(x,S){if(!x)throw new l.ERR_INTERNAL_ASSERTION(S)}function h(x){let S="",I=x.length;const b=x[0]==="-"?1:0;for(;I>=b+4;I-=3)S=`_${x.slice(I-3,I)}${S}`;return`${x.slice(0,I)}${S}`}function m(x,S,I){if(typeof S=="function")return d(S.length<=I.length,`Code: ${x}; The provided arguments length (${I.length}) does not match the required ones (${S.length}).`),S(...I);const b=(S.match(/%[dfijoOs]/g)||[]).length;return d(b===I.length,`Code: ${x}; The provided arguments length (${I.length}) does not match the required ones (${b}).`),I.length===0?S:r(S,...I)}function w(x,S,I){I||(I=Error);class b extends I{constructor(...p){super(m(x,S,p))}toString(){return`${this.name} [${x}]: ${this.message}`}}Object.defineProperties(b.prototype,{name:{value:I.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${x}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),b.prototype.code=x,b.prototype[i]=!0,l[x]=b}function g(x){const S=o+x.name;return Object.defineProperty(x,"name",{value:S}),x}function y(x,S){if(x&&S&&x!==S){if(Array.isArray(S.errors))return S.errors.push(x),S;const I=new n([S,x],S.message);return I.code=S.code,I}return x||S}class _ extends Error{constructor(S="The operation was aborted",I=void 0){if(I!==void 0&&typeof I!="object")throw new l.ERR_INVALID_ARG_TYPE("options","Object",I);super(S,I),this.code="ABORT_ERR",this.name="AbortError"}}return w("ERR_ASSERTION","%s",Error),w("ERR_INVALID_ARG_TYPE",(x,S,I)=>{d(typeof x=="string","'name' must be a string"),Array.isArray(S)||(S=[S]);let b="The ";x.endsWith(" argument")?b+=`${x} `:b+=`"${x}" ${x.includes(".")?"property":"argument"} `,b+="must be ";const c=[],p=[],N=[];for(const T of S)d(typeof T=="string","All expected entries have to be of type string"),s.includes(T)?c.push(T.toLowerCase()):a.test(T)?p.push(T):(d(T!=="object",'The value "object" should be written as "Object"'),N.push(T));if(p.length>0){const T=c.indexOf("object");T!==-1&&(c.splice(c,T,1),p.push("Object"))}if(c.length>0){switch(c.length){case 1:b+=`of type ${c[0]}`;break;case 2:b+=`one of type ${c[0]} or ${c[1]}`;break;default:{const T=c.pop();b+=`one of type ${c.join(", ")}, or ${T}`}}(p.length>0||N.length>0)&&(b+=" or ")}if(p.length>0){switch(p.length){case 1:b+=`an instance of ${p[0]}`;break;case 2:b+=`an instance of ${p[0]} or ${p[1]}`;break;default:{const T=p.pop();b+=`an instance of ${p.join(", ")}, or ${T}`}}N.length>0&&(b+=" or ")}switch(N.length){case 0:break;case 1:N[0].toLowerCase()!==N[0]&&(b+="an "),b+=`${N[0]}`;break;case 2:b+=`one of ${N[0]} or ${N[1]}`;break;default:{const T=N.pop();b+=`one of ${N.join(", ")}, or ${T}`}}if(I==null)b+=`. Received ${I}`;else if(typeof I=="function"&&I.name)b+=`. Received function ${I.name}`;else if(typeof I=="object"){var D;if((D=I.constructor)!==null&&D!==void 0&&D.name)b+=`. Received an instance of ${I.constructor.name}`;else{const T=e(I,{depth:-1});b+=`. Received ${T}`}}else{let T=e(I,{colors:!1});T.length>25&&(T=`${T.slice(0,25)}...`),b+=`. Received type ${typeof I} (${T})`}return b},TypeError),w("ERR_INVALID_ARG_VALUE",(x,S,I="is invalid")=>{let b=e(S);return b.length>128&&(b=b.slice(0,128)+"..."),`The ${x.includes(".")?"property":"argument"} '${x}' ${I}. Received ${b}`},TypeError),w("ERR_INVALID_RETURN_VALUE",(x,S,I)=>{var b;const c=I!=null&&(b=I.constructor)!==null&&b!==void 0&&b.name?`instance of ${I.constructor.name}`:`type ${typeof I}`;return`Expected ${x} to be returned from the "${S}" function but got ${c}.`},TypeError),w("ERR_MISSING_ARGS",(...x)=>{d(x.length>0,"At least one arg needs to be specified");let S;const I=x.length;switch(x=(Array.isArray(x)?x:[x]).map(b=>`"${b}"`).join(" or "),I){case 1:S+=`The ${x[0]} argument`;break;case 2:S+=`The ${x[0]} and ${x[1]} arguments`;break;default:{const b=x.pop();S+=`The ${x.join(", ")}, and ${b} arguments`}break}return`${S} must be specified`},TypeError),w("ERR_OUT_OF_RANGE",(x,S,I)=>{d(S,'Missing "range" argument');let b;if(Number.isInteger(I)&&Math.abs(I)>2**32)b=h(String(I));else if(typeof I=="bigint"){b=String(I);const c=BigInt(2)**BigInt(32);(I>c||I<-c)&&(b=h(b)),b+="n"}else b=e(I);return`The value of "${x}" is out of range. It must be ${S}. Received ${b}`},RangeError),w("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),w("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),w("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),w("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),w("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),w("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),w("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),w("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),w("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),w("ERR_STREAM_WRITE_AFTER_END","write after end",Error),w("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Kn={AbortError:_,aggregateTwoErrors:g(y),hideStackFrames:g,codes:l},Kn}var mr={exports:{}},Ca;function Hr(){if(Ca)return mr.exports;Ca=1;const{AbortController:r,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return mr.exports=r,mr.exports.AbortSignal=e,mr.exports.default=r,mr.exports}var rn={exports:{}},Pa;function Nn(){if(Pa)return rn.exports;Pa=1;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(p,N,D){return Function.prototype.apply.call(p,N,D)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(p){return Object.getOwnPropertyNames(p).concat(Object.getOwnPropertySymbols(p))}:t=function(p){return Object.getOwnPropertyNames(p)};function n(c){console&&console.warn&&console.warn(c)}var i=Number.isNaN||function(p){return p!==p};function s(){s.init.call(this)}rn.exports=s,rn.exports.once=S,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(c){if(typeof c!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof c)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(c){if(typeof c!="number"||c<0||i(c))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+c+".");a=c}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(p){if(typeof p!="number"||p<0||i(p))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+p+".");return this._maxListeners=p,this};function l(c){return c._maxListeners===void 0?s.defaultMaxListeners:c._maxListeners}s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(p){for(var N=[],D=1;D<arguments.length;D++)N.push(arguments[D]);var T=p==="error",q=this._events;if(q!==void 0)T=T&&q.error===void 0;else if(!T)return!1;if(T){var R;if(N.length>0&&(R=N[0]),R instanceof Error)throw R;var M=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw M.context=R,M}var B=q[p];if(B===void 0)return!1;if(typeof B=="function")e(B,this,N);else for(var A=B.length,j=y(B,A),D=0;D<A;++D)e(j[D],this,N);return!0};function d(c,p,N,D){var T,q,R;if(o(N),q=c._events,q===void 0?(q=c._events=Object.create(null),c._eventsCount=0):(q.newListener!==void 0&&(c.emit("newListener",p,N.listener?N.listener:N),q=c._events),R=q[p]),R===void 0)R=q[p]=N,++c._eventsCount;else if(typeof R=="function"?R=q[p]=D?[N,R]:[R,N]:D?R.unshift(N):R.push(N),T=l(c),T>0&&R.length>T&&!R.warned){R.warned=!0;var M=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(p)+" listeners added. Use emitter.setMaxListeners() to increase limit");M.name="MaxListenersExceededWarning",M.emitter=c,M.type=p,M.count=R.length,n(M)}return c}s.prototype.addListener=function(p,N){return d(this,p,N,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(p,N){return d(this,p,N,!0)};function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(c,p,N){var D={fired:!1,wrapFn:void 0,target:c,type:p,listener:N},T=h.bind(D);return T.listener=N,D.wrapFn=T,T}s.prototype.once=function(p,N){return o(N),this.on(p,m(this,p,N)),this},s.prototype.prependOnceListener=function(p,N){return o(N),this.prependListener(p,m(this,p,N)),this},s.prototype.removeListener=function(p,N){var D,T,q,R,M;if(o(N),T=this._events,T===void 0)return this;if(D=T[p],D===void 0)return this;if(D===N||D.listener===N)--this._eventsCount===0?this._events=Object.create(null):(delete T[p],T.removeListener&&this.emit("removeListener",p,D.listener||N));else if(typeof D!="function"){for(q=-1,R=D.length-1;R>=0;R--)if(D[R]===N||D[R].listener===N){M=D[R].listener,q=R;break}if(q<0)return this;q===0?D.shift():_(D,q),D.length===1&&(T[p]=D[0]),T.removeListener!==void 0&&this.emit("removeListener",p,M||N)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(p){var N,D,T;if(D=this._events,D===void 0)return this;if(D.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):D[p]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete D[p]),this;if(arguments.length===0){var q=Object.keys(D),R;for(T=0;T<q.length;++T)R=q[T],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(N=D[p],typeof N=="function")this.removeListener(p,N);else if(N!==void 0)for(T=N.length-1;T>=0;T--)this.removeListener(p,N[T]);return this};function w(c,p,N){var D=c._events;if(D===void 0)return[];var T=D[p];return T===void 0?[]:typeof T=="function"?N?[T.listener||T]:[T]:N?x(T):y(T,T.length)}s.prototype.listeners=function(p){return w(this,p,!0)},s.prototype.rawListeners=function(p){return w(this,p,!1)},s.listenerCount=function(c,p){return typeof c.listenerCount=="function"?c.listenerCount(p):g.call(c,p)},s.prototype.listenerCount=g;function g(c){var p=this._events;if(p!==void 0){var N=p[c];if(typeof N=="function")return 1;if(N!==void 0)return N.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function y(c,p){for(var N=new Array(p),D=0;D<p;++D)N[D]=c[D];return N}function _(c,p){for(;p+1<c.length;p++)c[p]=c[p+1];c.pop()}function x(c){for(var p=new Array(c.length),N=0;N<p.length;++N)p[N]=c[N].listener||c[N];return p}function S(c,p){return new Promise(function(N,D){function T(R){c.removeListener(p,q),D(R)}function q(){typeof c.removeListener=="function"&&c.removeListener("error",T),N([].slice.call(arguments))}b(c,p,q,{once:!0}),p!=="error"&&I(c,T,{once:!0})})}function I(c,p,N){typeof c.on=="function"&&b(c,"error",p,N)}function b(c,p,N,D){if(typeof c.on=="function")D.once?c.once(p,N):c.on(p,N);else if(typeof c.addEventListener=="function")c.addEventListener(p,function T(q){D.once&&c.removeEventListener(p,T),N(q)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof c)}return rn.exports}var qa;function ze(){return qa||(qa=1,function(r){const e=bt(),{format:t,inspect:n}=yu(),{codes:{ERR_INVALID_ARG_TYPE:i}}=Ve(),{kResistStopPropagation:s,AggregateError:a,SymbolDispose:o}=$e(),l=globalThis.AbortSignal||Hr().AbortSignal,d=globalThis.AbortController||Hr().AbortController,h=Object.getPrototypeOf(async function(){}).constructor,m=globalThis.Blob||e.Blob,w=typeof m<"u"?function(x){return x instanceof m}:function(x){return!1},g=(_,x)=>{if(_!==void 0&&(_===null||typeof _!="object"||!("aborted"in _)))throw new i(x,"AbortSignal",_)},y=(_,x)=>{if(typeof _!="function")throw new i(x,"Function",_)};r.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(_){let x=!1;return function(...S){x||(x=!0,_.apply(this,S))}},createDeferredPromise:function(){let _,x;return{promise:new Promise((I,b)=>{_=I,x=b}),resolve:_,reject:x}},promisify(_){return new Promise((x,S)=>{_((I,...b)=>I?S(I):x(...b))})},debuglog(){return function(){}},format:t,inspect:n,types:{isAsyncFunction(_){return _ instanceof h},isArrayBufferView(_){return ArrayBuffer.isView(_)}},isBlob:w,deprecate(_,x){return _},addAbortListener:Nn().addAbortListener||function(x,S){if(x===void 0)throw new i("signal","AbortSignal",x);g(x,"signal"),y(S,"listener");let I;return x.aborted?queueMicrotask(()=>S()):(x.addEventListener("abort",S,{__proto__:null,once:!0,[s]:!0}),I=()=>{x.removeEventListener("abort",S)}),{__proto__:null,[o](){var b;(b=I)===null||b===void 0||b()}}},AbortSignalAny:l.any||function(x){if(x.length===1)return x[0];const S=new d,I=()=>S.abort();return x.forEach(b=>{g(b,"signals"),b.addEventListener("abort",I,{once:!0})}),S.signal.addEventListener("abort",()=>{x.forEach(b=>b.removeEventListener("abort",I))},{once:!0}),S.signal}},r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}(Qn)),Qn.exports}var nn={},Yn,Ba;function Qr(){if(Ba)return Yn;Ba=1;const{ArrayIsArray:r,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:o,NumberParseInt:l,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:h,String:m,StringPrototypeToUpperCase:w,StringPrototypeTrim:g}=$e(),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:x,ERR_INVALID_ARG_VALUE:S,ERR_OUT_OF_RANGE:I,ERR_UNKNOWN_SIGNAL:b}}=Ve(),{normalizeEncoding:c}=ze(),{isAsyncFunction:p,isArrayBufferView:N}=ze().types,D={};function T(X){return X===(X|0)}function q(X){return X===X>>>0}const R=/^[0-7]+$/,M="must be a 32-bit unsigned integer or an octal string";function B(X,le,he){if(typeof X>"u"&&(X=he),typeof X=="string"){if(h(R,X)===null)throw new S(le,X,M);X=l(X,8)}return Y(X,le),X}const A=y((X,le,he=o,se=a)=>{if(typeof X!="number")throw new x(le,"number",X);if(!i(X))throw new I(le,"an integer",X);if(X<he||X>se)throw new I(le,`>= ${he} && <= ${se}`,X)}),j=y((X,le,he=-2147483648,se=2147483647)=>{if(typeof X!="number")throw new x(le,"number",X);if(!i(X))throw new I(le,"an integer",X);if(X<he||X>se)throw new I(le,`>= ${he} && <= ${se}`,X)}),Y=y((X,le,he=!1)=>{if(typeof X!="number")throw new x(le,"number",X);if(!i(X))throw new I(le,"an integer",X);const se=he?1:0,Se=4294967295;if(X<se||X>Se)throw new I(le,`>= ${se} && <= ${Se}`,X)});function L(X,le){if(typeof X!="string")throw new x(le,"string",X)}function ee(X,le,he=void 0,se){if(typeof X!="number")throw new x(le,"number",X);if(he!=null&&X<he||se!=null&&X>se||(he!=null||se!=null)&&s(X))throw new I(le,`${he!=null?`>= ${he}`:""}${he!=null&&se!=null?" && ":""}${se!=null?`<= ${se}`:""}`,X)}const C=y((X,le,he)=>{if(!e(he,X)){const Se="must be one of: "+t(n(he,Be=>typeof Be=="string"?`'${Be}'`:m(Be)),", ");throw new S(le,X,Se)}});function K(X,le){if(typeof X!="boolean")throw new x(le,"boolean",X)}function v(X,le,he){return X==null||!d(X,le)?he:X[le]}const U=y((X,le,he=null)=>{const se=v(he,"allowArray",!1),Se=v(he,"allowFunction",!1);if(!v(he,"nullable",!1)&&X===null||!se&&r(X)||typeof X!="object"&&(!Se||typeof X!="function"))throw new x(le,"Object",X)}),Q=y((X,le)=>{if(X!=null&&typeof X!="object"&&typeof X!="function")throw new x(le,"a dictionary",X)}),z=y((X,le,he=0)=>{if(!r(X))throw new x(le,"Array",X);if(X.length<he){const se=`must be longer than ${he}`;throw new S(le,X,se)}});function ae(X,le){z(X,le);for(let he=0;he<X.length;he++)L(X[he],`${le}[${he}]`)}function H(X,le){z(X,le);for(let he=0;he<X.length;he++)K(X[he],`${le}[${he}]`)}function V(X,le){z(X,le);for(let he=0;he<X.length;he++){const se=X[he],Se=`${le}[${he}]`;if(se==null)throw new x(Se,"AbortSignal",se);ce(se,Se)}}function W(X,le="signal"){if(L(X,le),D[X]===void 0)throw D[w(X)]!==void 0?new b(X+" (signals must use all capital letters)"):new b(X)}const F=y((X,le="buffer")=>{if(!N(X))throw new x(le,["Buffer","TypedArray","DataView"],X)});function Z(X,le){const he=c(le),se=X.length;if(he==="hex"&&se%2!==0)throw new S("encoding",le,`is invalid for data of length ${se}`)}function te(X,le="Port",he=!0){if(typeof X!="number"&&typeof X!="string"||typeof X=="string"&&g(X).length===0||+X!==+X>>>0||X>65535||X===0&&!he)throw new _(le,X,he);return X|0}const ce=y((X,le)=>{if(X!==void 0&&(X===null||typeof X!="object"||!("aborted"in X)))throw new x(le,"AbortSignal",X)}),fe=y((X,le)=>{if(typeof X!="function")throw new x(le,"Function",X)}),O=y((X,le)=>{if(typeof X!="function"||p(X))throw new x(le,"Function",X)}),G=y((X,le)=>{if(X!==void 0)throw new x(le,"undefined",X)});function re(X,le,he){if(!e(he,X))throw new x(le,`('${t(he,"|")}')`,X)}const ue=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function de(X,le){if(typeof X>"u"||!h(ue,X))throw new S(le,X,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function pe(X){if(typeof X=="string")return de(X,"hints"),X;if(r(X)){const le=X.length;let he="";if(le===0)return he;for(let se=0;se<le;se++){const Se=X[se];de(Se,"hints"),he+=Se,se!==le-1&&(he+=", ")}return he}throw new S("hints",X,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return Yn={isInt32:T,isUint32:q,parseFileMode:B,validateArray:z,validateStringArray:ae,validateBooleanArray:H,validateAbortSignalArray:V,validateBoolean:K,validateBuffer:F,validateDictionary:Q,validateEncoding:Z,validateFunction:fe,validateInt32:j,validateInteger:A,validateNumber:ee,validateObject:U,validateOneOf:C,validatePlainFunction:O,validatePort:te,validateSignalName:W,validateString:L,validateUint32:Y,validateUndefined:G,validateUnion:re,validateAbortSignal:ce,validateLinkHeaderValue:pe},Yn}var sn={exports:{}},Zn={exports:{}},Fa;function Ut(){if(Fa)return Zn.exports;Fa=1;var r=Zn.exports={},e,t;function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=n}catch{e=n}try{typeof clearTimeout=="function"?t=clearTimeout:t=i}catch{t=i}})();function s(_){if(e===setTimeout)return setTimeout(_,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(_,0);try{return e(_,0)}catch{try{return e.call(null,_,0)}catch{return e.call(this,_,0)}}}function a(_){if(t===clearTimeout)return clearTimeout(_);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(_);try{return t(_)}catch{try{return t.call(null,_)}catch{return t.call(this,_)}}}var o=[],l=!1,d,h=-1;function m(){!l||!d||(l=!1,d.length?o=d.concat(o):h=-1,o.length&&w())}function w(){if(!l){var _=s(m);l=!0;for(var x=o.length;x;){for(d=o,o=[];++h<x;)d&&d[h].run();h=-1,x=o.length}d=null,l=!1,a(_)}}r.nextTick=function(_){var x=new Array(arguments.length-1);if(arguments.length>1)for(var S=1;S<arguments.length;S++)x[S-1]=arguments[S];o.push(new g(_,x)),o.length===1&&!l&&s(w)};function g(_,x){this.fun=_,this.array=x}g.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function y(){}return r.on=y,r.addListener=y,r.once=y,r.off=y,r.removeListener=y,r.removeAllListeners=y,r.emit=y,r.prependListener=y,r.prependOnceListener=y,r.listeners=function(_){return[]},r.binding=function(_){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(_){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},Zn.exports}var ei,Ua;function wt(){if(Ua)return ei;Ua=1;const{SymbolAsyncIterator:r,SymbolIterator:e,SymbolFor:t}=$e(),n=t("nodejs.stream.destroyed"),i=t("nodejs.stream.errored"),s=t("nodejs.stream.readable"),a=t("nodejs.stream.writable"),o=t("nodejs.stream.disturbed"),l=t("nodejs.webstream.isClosedPromise"),d=t("nodejs.webstream.controllerErrorFunction");function h(v,U=!1){var Q;return!!(v&&typeof v.pipe=="function"&&typeof v.on=="function"&&(!U||typeof v.pause=="function"&&typeof v.resume=="function")&&(!v._writableState||((Q=v._readableState)===null||Q===void 0?void 0:Q.readable)!==!1)&&(!v._writableState||v._readableState))}function m(v){var U;return!!(v&&typeof v.write=="function"&&typeof v.on=="function"&&(!v._readableState||((U=v._writableState)===null||U===void 0?void 0:U.writable)!==!1))}function w(v){return!!(v&&typeof v.pipe=="function"&&v._readableState&&typeof v.on=="function"&&typeof v.write=="function")}function g(v){return v&&(v._readableState||v._writableState||typeof v.write=="function"&&typeof v.on=="function"||typeof v.pipe=="function"&&typeof v.on=="function")}function y(v){return!!(v&&!g(v)&&typeof v.pipeThrough=="function"&&typeof v.getReader=="function"&&typeof v.cancel=="function")}function _(v){return!!(v&&!g(v)&&typeof v.getWriter=="function"&&typeof v.abort=="function")}function x(v){return!!(v&&!g(v)&&typeof v.readable=="object"&&typeof v.writable=="object")}function S(v){return y(v)||_(v)||x(v)}function I(v,U){return v==null?!1:U===!0?typeof v[r]=="function":U===!1?typeof v[e]=="function":typeof v[r]=="function"||typeof v[e]=="function"}function b(v){if(!g(v))return null;const U=v._writableState,Q=v._readableState,z=U||Q;return!!(v.destroyed||v[n]||z!=null&&z.destroyed)}function c(v){if(!m(v))return null;if(v.writableEnded===!0)return!0;const U=v._writableState;return U!=null&&U.errored?!1:typeof U?.ended!="boolean"?null:U.ended}function p(v,U){if(!m(v))return null;if(v.writableFinished===!0)return!0;const Q=v._writableState;return Q!=null&&Q.errored?!1:typeof Q?.finished!="boolean"?null:!!(Q.finished||U===!1&&Q.ended===!0&&Q.length===0)}function N(v){if(!h(v))return null;if(v.readableEnded===!0)return!0;const U=v._readableState;return!U||U.errored?!1:typeof U?.ended!="boolean"?null:U.ended}function D(v,U){if(!h(v))return null;const Q=v._readableState;return Q!=null&&Q.errored?!1:typeof Q?.endEmitted!="boolean"?null:!!(Q.endEmitted||U===!1&&Q.ended===!0&&Q.length===0)}function T(v){return v&&v[s]!=null?v[s]:typeof v?.readable!="boolean"?null:b(v)?!1:h(v)&&v.readable&&!D(v)}function q(v){return v&&v[a]!=null?v[a]:typeof v?.writable!="boolean"?null:b(v)?!1:m(v)&&v.writable&&!c(v)}function R(v,U){return g(v)?b(v)?!0:!(U?.readable!==!1&&T(v)||U?.writable!==!1&&q(v)):null}function M(v){var U,Q;return g(v)?v.writableErrored?v.writableErrored:(U=(Q=v._writableState)===null||Q===void 0?void 0:Q.errored)!==null&&U!==void 0?U:null:null}function B(v){var U,Q;return g(v)?v.readableErrored?v.readableErrored:(U=(Q=v._readableState)===null||Q===void 0?void 0:Q.errored)!==null&&U!==void 0?U:null:null}function A(v){if(!g(v))return null;if(typeof v.closed=="boolean")return v.closed;const U=v._writableState,Q=v._readableState;return typeof U?.closed=="boolean"||typeof Q?.closed=="boolean"?U?.closed||Q?.closed:typeof v._closed=="boolean"&&j(v)?v._closed:null}function j(v){return typeof v._closed=="boolean"&&typeof v._defaultKeepAlive=="boolean"&&typeof v._removedConnection=="boolean"&&typeof v._removedContLen=="boolean"}function Y(v){return typeof v._sent100=="boolean"&&j(v)}function L(v){var U;return typeof v._consuming=="boolean"&&typeof v._dumped=="boolean"&&((U=v.req)===null||U===void 0?void 0:U.upgradeOrConnect)===void 0}function ee(v){if(!g(v))return null;const U=v._writableState,Q=v._readableState,z=U||Q;return!z&&Y(v)||!!(z&&z.autoDestroy&&z.emitClose&&z.closed===!1)}function C(v){var U;return!!(v&&((U=v[o])!==null&&U!==void 0?U:v.readableDidRead||v.readableAborted))}function K(v){var U,Q,z,ae,H,V,W,F,Z,te;return!!(v&&((U=(Q=(z=(ae=(H=(V=v[i])!==null&&V!==void 0?V:v.readableErrored)!==null&&H!==void 0?H:v.writableErrored)!==null&&ae!==void 0?ae:(W=v._readableState)===null||W===void 0?void 0:W.errorEmitted)!==null&&z!==void 0?z:(F=v._writableState)===null||F===void 0?void 0:F.errorEmitted)!==null&&Q!==void 0?Q:(Z=v._readableState)===null||Z===void 0?void 0:Z.errored)!==null&&U!==void 0?U:!((te=v._writableState)===null||te===void 0)&&te.errored))}return ei={isDestroyed:b,kIsDestroyed:n,isDisturbed:C,kIsDisturbed:o,isErrored:K,kIsErrored:i,isReadable:T,kIsReadable:s,kIsClosedPromise:l,kControllerErrorFunction:d,kIsWritable:a,isClosed:A,isDuplexNodeStream:w,isFinished:R,isIterable:I,isReadableNodeStream:h,isReadableStream:y,isReadableEnded:N,isReadableFinished:D,isReadableErrored:B,isNodeStream:g,isWebStream:S,isWritable:q,isWritableNodeStream:m,isWritableStream:_,isWritableEnded:c,isWritableFinished:p,isWritableErrored:M,isServerRequest:L,isServerResponse:Y,willEmitClose:ee,isTransformStream:x},ei}var Ha;function Nt(){if(Ha)return sn.exports;Ha=1;const r=Ut(),{AbortError:e,codes:t}=Ve(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=t,{kEmptyObject:s,once:a}=ze(),{validateAbortSignal:o,validateFunction:l,validateObject:d,validateBoolean:h}=Qr(),{Promise:m,PromisePrototypeThen:w,SymbolDispose:g}=$e(),{isClosed:y,isReadable:_,isReadableNodeStream:x,isReadableStream:S,isReadableFinished:I,isReadableErrored:b,isWritable:c,isWritableNodeStream:p,isWritableStream:N,isWritableFinished:D,isWritableErrored:T,isNodeStream:q,willEmitClose:R,kIsClosedPromise:M}=wt();let B;function A(C){return C.setHeader&&typeof C.abort=="function"}const j=()=>{};function Y(C,K,v){var U,Q;if(arguments.length===2?(v=K,K=s):K==null?K=s:d(K,"options"),l(v,"callback"),o(K.signal,"options.signal"),v=a(v),S(C)||N(C))return L(C,K,v);if(!q(C))throw new n("stream",["ReadableStream","WritableStream","Stream"],C);const z=(U=K.readable)!==null&&U!==void 0?U:x(C),ae=(Q=K.writable)!==null&&Q!==void 0?Q:p(C),H=C._writableState,V=C._readableState,W=()=>{C.writable||te()};let F=R(C)&&x(C)===z&&p(C)===ae,Z=D(C,!1);const te=()=>{Z=!0,C.destroyed&&(F=!1),!(F&&(!C.readable||z))&&(!z||ce)&&v.call(C)};let ce=I(C,!1);const fe=()=>{ce=!0,C.destroyed&&(F=!1),!(F&&(!C.writable||ae))&&(!ae||Z)&&v.call(C)},O=X=>{v.call(C,X)};let G=y(C);const re=()=>{G=!0;const X=T(C)||b(C);if(X&&typeof X!="boolean")return v.call(C,X);if(z&&!ce&&x(C,!0)&&!I(C,!1))return v.call(C,new i);if(ae&&!Z&&!D(C,!1))return v.call(C,new i);v.call(C)},ue=()=>{G=!0;const X=T(C)||b(C);if(X&&typeof X!="boolean")return v.call(C,X);v.call(C)},de=()=>{C.req.on("finish",te)};A(C)?(C.on("complete",te),F||C.on("abort",re),C.req?de():C.on("request",de)):ae&&!H&&(C.on("end",W),C.on("close",W)),!F&&typeof C.aborted=="boolean"&&C.on("aborted",re),C.on("end",fe),C.on("finish",te),K.error!==!1&&C.on("error",O),C.on("close",re),G?r.nextTick(re):H!=null&&H.errorEmitted||V!=null&&V.errorEmitted?F||r.nextTick(ue):(!z&&(!F||_(C))&&(Z||c(C)===!1)||!ae&&(!F||c(C))&&(ce||_(C)===!1)||V&&C.req&&C.aborted)&&r.nextTick(ue);const pe=()=>{v=j,C.removeListener("aborted",re),C.removeListener("complete",te),C.removeListener("abort",re),C.removeListener("request",de),C.req&&C.req.removeListener("finish",te),C.removeListener("end",W),C.removeListener("close",W),C.removeListener("finish",te),C.removeListener("end",fe),C.removeListener("error",O),C.removeListener("close",re)};if(K.signal&&!G){const X=()=>{const le=v;pe(),le.call(C,new e(void 0,{cause:K.signal.reason}))};if(K.signal.aborted)r.nextTick(X);else{B=B||ze().addAbortListener;const le=B(K.signal,X),he=v;v=a((...se)=>{le[g](),he.apply(C,se)})}}return pe}function L(C,K,v){let U=!1,Q=j;if(K.signal)if(Q=()=>{U=!0,v.call(C,new e(void 0,{cause:K.signal.reason}))},K.signal.aborted)r.nextTick(Q);else{B=B||ze().addAbortListener;const ae=B(K.signal,Q),H=v;v=a((...V)=>{ae[g](),H.apply(C,V)})}const z=(...ae)=>{U||r.nextTick(()=>v.apply(C,ae))};return w(C[M].promise,z,z),j}function ee(C,K){var v;let U=!1;return K===null&&(K=s),(v=K)!==null&&v!==void 0&&v.cleanup&&(h(K.cleanup,"cleanup"),U=K.cleanup),new m((Q,z)=>{const ae=Y(C,K,H=>{U&&ae(),H?z(H):Q()})})}return sn.exports=Y,sn.exports.finished=ee,sn.exports}var ti,Va;function or(){if(Va)return ti;Va=1;const r=Ut(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:n}=Ve(),{Symbol:i}=$e(),{kIsDestroyed:s,isDestroyed:a,isFinished:o,isServerRequest:l}=wt(),d=i("kDestroy"),h=i("kConstruct");function m(R,M,B){R&&(R.stack,M&&!M.errored&&(M.errored=R),B&&!B.errored&&(B.errored=R))}function w(R,M){const B=this._readableState,A=this._writableState,j=A||B;return A!=null&&A.destroyed||B!=null&&B.destroyed?(typeof M=="function"&&M(),this):(m(R,A,B),A&&(A.destroyed=!0),B&&(B.destroyed=!0),j.constructed?g(this,R,M):this.once(d,function(Y){g(this,e(Y,R),M)}),this)}function g(R,M,B){let A=!1;function j(Y){if(A)return;A=!0;const L=R._readableState,ee=R._writableState;m(Y,ee,L),ee&&(ee.closed=!0),L&&(L.closed=!0),typeof B=="function"&&B(Y),Y?r.nextTick(y,R,Y):r.nextTick(_,R)}try{R._destroy(M||null,j)}catch(Y){j(Y)}}function y(R,M){x(R,M),_(R)}function _(R){const M=R._readableState,B=R._writableState;B&&(B.closeEmitted=!0),M&&(M.closeEmitted=!0),(B!=null&&B.emitClose||M!=null&&M.emitClose)&&R.emit("close")}function x(R,M){const B=R._readableState,A=R._writableState;A!=null&&A.errorEmitted||B!=null&&B.errorEmitted||(A&&(A.errorEmitted=!0),B&&(B.errorEmitted=!0),R.emit("error",M))}function S(){const R=this._readableState,M=this._writableState;R&&(R.constructed=!0,R.closed=!1,R.closeEmitted=!1,R.destroyed=!1,R.errored=null,R.errorEmitted=!1,R.reading=!1,R.ended=R.readable===!1,R.endEmitted=R.readable===!1),M&&(M.constructed=!0,M.destroyed=!1,M.closed=!1,M.closeEmitted=!1,M.errored=null,M.errorEmitted=!1,M.finalCalled=!1,M.prefinished=!1,M.ended=M.writable===!1,M.ending=M.writable===!1,M.finished=M.writable===!1)}function I(R,M,B){const A=R._readableState,j=R._writableState;if(j!=null&&j.destroyed||A!=null&&A.destroyed)return this;A!=null&&A.autoDestroy||j!=null&&j.autoDestroy?R.destroy(M):M&&(M.stack,j&&!j.errored&&(j.errored=M),A&&!A.errored&&(A.errored=M),B?r.nextTick(x,R,M):x(R,M))}function b(R,M){if(typeof R._construct!="function")return;const B=R._readableState,A=R._writableState;B&&(B.constructed=!1),A&&(A.constructed=!1),R.once(h,M),!(R.listenerCount(h)>1)&&r.nextTick(c,R)}function c(R){let M=!1;function B(A){if(M){I(R,A??new t);return}M=!0;const j=R._readableState,Y=R._writableState,L=Y||j;j&&(j.constructed=!0),Y&&(Y.constructed=!0),L.destroyed?R.emit(d,A):A?I(R,A,!0):r.nextTick(p,R)}try{R._construct(A=>{r.nextTick(B,A)})}catch(A){r.nextTick(B,A)}}function p(R){R.emit(h)}function N(R){return R?.setHeader&&typeof R.abort=="function"}function D(R){R.emit("close")}function T(R,M){R.emit("error",M),r.nextTick(D,R)}function q(R,M){!R||a(R)||(!M&&!o(R)&&(M=new n),l(R)?(R.socket=null,R.destroy(M)):N(R)?R.abort():N(R.req)?R.req.abort():typeof R.destroy=="function"?R.destroy(M):typeof R.close=="function"?R.close():M?r.nextTick(T,R,M):r.nextTick(D,R),R.destroyed||(R[s]=!0))}return ti={construct:b,destroyer:q,destroy:w,undestroy:S,errorOrDestroy:I},ti}var ri,Ga;function Fs(){if(Ga)return ri;Ga=1;const{ArrayIsArray:r,ObjectSetPrototypeOf:e}=$e(),{EventEmitter:t}=Nn();function n(s){t.call(this,s)}e(n.prototype,t.prototype),e(n,t),n.prototype.pipe=function(s,a){const o=this;function l(_){s.writable&&s.write(_)===!1&&o.pause&&o.pause()}o.on("data",l);function d(){o.readable&&o.resume&&o.resume()}s.on("drain",d),!s._isStdio&&(!a||a.end!==!1)&&(o.on("end",m),o.on("close",w));let h=!1;function m(){h||(h=!0,s.end())}function w(){h||(h=!0,typeof s.destroy=="function"&&s.destroy())}function g(_){y(),t.listenerCount(this,"error")===0&&this.emit("error",_)}i(o,"error",g),i(s,"error",g);function y(){o.removeListener("data",l),s.removeListener("drain",d),o.removeListener("end",m),o.removeListener("close",w),o.removeListener("error",g),s.removeListener("error",g),o.removeListener("end",y),o.removeListener("close",y),s.removeListener("close",y)}return o.on("end",y),o.on("close",y),s.on("close",y),s.emit("pipe",o),s};function i(s,a,o){if(typeof s.prependListener=="function")return s.prependListener(a,o);!s._events||!s._events[a]?s.on(a,o):r(s._events[a])?s._events[a].unshift(o):s._events[a]=[o,s._events[a]]}return ri={Stream:n,prependListener:i},ri}var ni={exports:{}},Wa;function Tn(){return Wa||(Wa=1,function(r){const{SymbolDispose:e}=$e(),{AbortError:t,codes:n}=Ve(),{isNodeStream:i,isWebStream:s,kControllerErrorFunction:a}=wt(),o=Nt(),{ERR_INVALID_ARG_TYPE:l}=n;let d;const h=(m,w)=>{if(typeof m!="object"||!("aborted"in m))throw new l(w,"AbortSignal",m)};r.exports.addAbortSignal=function(w,g){if(h(w,"signal"),!i(g)&&!s(g))throw new l("stream",["ReadableStream","WritableStream","Stream"],g);return r.exports.addAbortSignalNoValidate(w,g)},r.exports.addAbortSignalNoValidate=function(m,w){if(typeof m!="object"||!("aborted"in m))return w;const g=i(w)?()=>{w.destroy(new t(void 0,{cause:m.reason}))}:()=>{w[a](new t(void 0,{cause:m.reason}))};if(m.aborted)g();else{d=d||ze().addAbortListener;const y=d(m,g);o(w,y[e])}return w}}(ni)),ni.exports}var ii,za;function Bc(){if(za)return ii;za=1;const{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:n}=$e(),{Buffer:i}=bt(),{inspect:s}=ze();return ii=class{constructor(){this.head=null,this.tail=null,this.length=0}push(o){const l={data:o,next:null};this.length>0?this.tail.next=l:this.head=l,this.tail=l,++this.length}unshift(o){const l={data:o,next:this.head};this.length===0&&(this.tail=l),this.head=l,++this.length}shift(){if(this.length===0)return;const o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}clear(){this.head=this.tail=null,this.length=0}join(o){if(this.length===0)return"";let l=this.head,d=""+l.data;for(;(l=l.next)!==null;)d+=o+l.data;return d}concat(o){if(this.length===0)return i.alloc(0);const l=i.allocUnsafe(o>>>0);let d=this.head,h=0;for(;d;)t(l,d.data,h),h+=d.data.length,d=d.next;return l}consume(o,l){const d=this.head.data;if(o<d.length){const h=d.slice(0,o);return this.head.data=d.slice(o),h}return o===d.length?this.shift():l?this._getString(o):this._getBuffer(o)}first(){return this.head.data}*[e](){for(let o=this.head;o;o=o.next)yield o.data}_getString(o){let l="",d=this.head,h=0;do{const m=d.data;if(o>m.length)l+=m,o-=m.length;else{o===m.length?(l+=m,++h,d.next?this.head=d.next:this.head=this.tail=null):(l+=r(m,0,o),this.head=d,d.data=r(m,o));break}++h}while((d=d.next)!==null);return this.length-=h,l}_getBuffer(o){const l=i.allocUnsafe(o),d=o;let h=this.head,m=0;do{const w=h.data;if(o>w.length)t(l,w,d-o),o-=w.length;else{o===w.length?(t(l,w,d-o),++m,h.next?this.head=h.next:this.head=this.tail=null):(t(l,new n(w.buffer,w.byteOffset,o),d-o),this.head=h,h.data=w.slice(o));break}++m}while((h=h.next)!==null);return this.length-=m,l}[Symbol.for("nodejs.util.inspect.custom")](o,l){return s(this,{...l,depth:0,customInspect:!1})}},ii}var si,Ja;function An(){if(Ja)return si;Ja=1;const{MathFloor:r,NumberIsInteger:e}=$e(),{validateInteger:t}=Qr(),{ERR_INVALID_ARG_VALUE:n}=Ve().codes;let i=16*1024,s=16;function a(h,m,w){return h.highWaterMark!=null?h.highWaterMark:m?h[w]:null}function o(h){return h?s:i}function l(h,m){t(m,"value",0),h?s=m:i=m}function d(h,m,w,g){const y=a(m,g,w);if(y!=null){if(!e(y)||y<0){const _=g?`options.${w}`:"options.highWaterMark";throw new n(_,y)}return r(y)}return o(h.objectMode)}return si={getHighWaterMark:d,getDefaultHighWaterMark:o,setDefaultHighWaterMark:l},si}var ai={},an={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Qa;function Fc(){return Qa||(Qa=1,function(r,e){var t=bt(),n=t.Buffer;function i(a,o){for(var l in a)o[l]=a[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?r.exports=t:(i(t,e),e.Buffer=s);function s(a,o,l){return n(a,o,l)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(a,o,l){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,o,l)},s.alloc=function(a,o,l){if(typeof a!="number")throw new TypeError("Argument must be a number");var d=n(a);return o!==void 0?typeof l=="string"?d.fill(o,l):d.fill(o):d.fill(0),d},s.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},s.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(a)}}(an,an.exports)),an.exports}var Xa;function Uc(){if(Xa)return ai;Xa=1;var r=Fc().Buffer,e=r.isEncoding||function(S){switch(S=""+S,S&&S.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(S){if(!S)return"utf8";for(var I;;)switch(S){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return S;default:if(I)return;S=(""+S).toLowerCase(),I=!0}}function n(S){var I=t(S);if(typeof I!="string"&&(r.isEncoding===e||!e(S)))throw new Error("Unknown encoding: "+S);return I||S}ai.StringDecoder=i;function i(S){this.encoding=n(S);var I;switch(this.encoding){case"utf16le":this.text=m,this.end=w,I=4;break;case"utf8":this.fillLast=l,I=4;break;case"base64":this.text=g,this.end=y,I=3;break;default:this.write=_,this.end=x;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(I)}i.prototype.write=function(S){if(S.length===0)return"";var I,b;if(this.lastNeed){if(I=this.fillLast(S),I===void 0)return"";b=this.lastNeed,this.lastNeed=0}else b=0;return b<S.length?I?I+this.text(S,b):this.text(S,b):I||""},i.prototype.end=h,i.prototype.text=d,i.prototype.fillLast=function(S){if(this.lastNeed<=S.length)return S.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);S.copy(this.lastChar,this.lastTotal-this.lastNeed,0,S.length),this.lastNeed-=S.length};function s(S){return S<=127?0:S>>5===6?2:S>>4===14?3:S>>3===30?4:S>>6===2?-1:-2}function a(S,I,b){var c=I.length-1;if(c<b)return 0;var p=s(I[c]);return p>=0?(p>0&&(S.lastNeed=p-1),p):--c<b||p===-2?0:(p=s(I[c]),p>=0?(p>0&&(S.lastNeed=p-2),p):--c<b||p===-2?0:(p=s(I[c]),p>=0?(p>0&&(p===2?p=0:S.lastNeed=p-3),p):0))}function o(S,I,b){if((I[0]&192)!==128)return S.lastNeed=0,"�";if(S.lastNeed>1&&I.length>1){if((I[1]&192)!==128)return S.lastNeed=1,"�";if(S.lastNeed>2&&I.length>2&&(I[2]&192)!==128)return S.lastNeed=2,"�"}}function l(S){var I=this.lastTotal-this.lastNeed,b=o(this,S);if(b!==void 0)return b;if(this.lastNeed<=S.length)return S.copy(this.lastChar,I,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);S.copy(this.lastChar,I,0,S.length),this.lastNeed-=S.length}function d(S,I){var b=a(this,S,I);if(!this.lastNeed)return S.toString("utf8",I);this.lastTotal=b;var c=S.length-(b-this.lastNeed);return S.copy(this.lastChar,0,c),S.toString("utf8",I,c)}function h(S){var I=S&&S.length?this.write(S):"";return this.lastNeed?I+"�":I}function m(S,I){if((S.length-I)%2===0){var b=S.toString("utf16le",I);if(b){var c=b.charCodeAt(b.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1],b.slice(0,-1)}return b}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=S[S.length-1],S.toString("utf16le",I,S.length-1)}function w(S){var I=S&&S.length?this.write(S):"";if(this.lastNeed){var b=this.lastTotal-this.lastNeed;return I+this.lastChar.toString("utf16le",0,b)}return I}function g(S,I){var b=(S.length-I)%3;return b===0?S.toString("base64",I):(this.lastNeed=3-b,this.lastTotal=3,b===1?this.lastChar[0]=S[S.length-1]:(this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1]),S.toString("base64",I,S.length-b))}function y(S){var I=S&&S.length?this.write(S):"";return this.lastNeed?I+this.lastChar.toString("base64",0,3-this.lastNeed):I}function _(S){return S.toString(this.encoding)}function x(S){return S&&S.length?this.write(S):""}return ai}var oi,Ka;function mu(){if(Ka)return oi;Ka=1;const r=Ut(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:n}=$e(),{Buffer:i}=bt(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:a}=Ve().codes;function o(l,d,h){let m;if(typeof d=="string"||d instanceof i)return new l({objectMode:!0,...h,read(){this.push(d),this.push(null)}});let w;if(d&&d[t])w=!0,m=d[t]();else if(d&&d[n])w=!1,m=d[n]();else throw new s("iterable",["Iterable"],d);const g=new l({objectMode:!0,highWaterMark:1,...h});let y=!1;g._read=function(){y||(y=!0,x())},g._destroy=function(S,I){e(_(S),()=>r.nextTick(I,S),b=>r.nextTick(I,b||S))};async function _(S){const I=S!=null,b=typeof m.throw=="function";if(I&&b){const{value:c,done:p}=await m.throw(S);if(await c,p)return}if(typeof m.return=="function"){const{value:c}=await m.return();await c}}async function x(){for(;;){try{const{value:S,done:I}=w?await m.next():m.next();if(I)g.push(null);else{const b=S&&typeof S.then=="function"?await S:S;if(b===null)throw y=!1,new a;if(g.push(b))continue;y=!1}}catch(S){g.destroy(S)}break}}return g}return oi=o,oi}var li,Ya;function Ln(){if(Ya)return li;Ya=1;const r=Ut(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:s,ObjectKeys:a,ObjectSetPrototypeOf:o,Promise:l,SafeSet:d,SymbolAsyncDispose:h,SymbolAsyncIterator:m,Symbol:w}=$e();li=se,se.ReadableState=he;const{EventEmitter:g}=Nn(),{Stream:y,prependListener:_}=Fs(),{Buffer:x}=bt(),{addAbortSignal:S}=Tn(),I=Nt();let b=ze().debuglog("stream",$=>{b=$});const c=Bc(),p=or(),{getHighWaterMark:N,getDefaultHighWaterMark:D}=An(),{aggregateTwoErrors:T,codes:{ERR_INVALID_ARG_TYPE:q,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_OUT_OF_RANGE:M,ERR_STREAM_PUSH_AFTER_EOF:B,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:A},AbortError:j}=Ve(),{validateObject:Y}=Qr(),L=w("kPaused"),{StringDecoder:ee}=Uc(),C=mu();o(se.prototype,y.prototype),o(se,y);const K=()=>{},{errorOrDestroy:v}=p,U=1,Q=2,z=4,ae=8,H=16,V=32,W=64,F=128,Z=256,te=512,ce=1024,fe=2048,O=4096,G=8192,re=16384,ue=32768,de=65536,pe=1<<17,X=1<<18;function le($){return{enumerable:!1,get(){return(this.state&$)!==0},set(P){P?this.state|=$:this.state&=~$}}}s(he.prototype,{objectMode:le(U),ended:le(Q),endEmitted:le(z),reading:le(ae),constructed:le(H),sync:le(V),needReadable:le(W),emittedReadable:le(F),readableListening:le(Z),resumeScheduled:le(te),errorEmitted:le(ce),emitClose:le(fe),autoDestroy:le(O),destroyed:le(G),closed:le(re),closeEmitted:le(ue),multiAwaitDrain:le(de),readingMore:le(pe),dataEmitted:le(X)});function he($,P,ge){typeof ge!="boolean"&&(ge=P instanceof gt()),this.state=fe|O|H|V,$&&$.objectMode&&(this.state|=U),ge&&$&&$.readableObjectMode&&(this.state|=U),this.highWaterMark=$?N(this,$,"readableHighWaterMark",ge):D(!1),this.buffer=new c,this.length=0,this.pipes=[],this.flowing=null,this[L]=null,$&&$.emitClose===!1&&(this.state&=~fe),$&&$.autoDestroy===!1&&(this.state&=~O),this.errored=null,this.defaultEncoding=$&&$.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,$&&$.encoding&&(this.decoder=new ee($.encoding),this.encoding=$.encoding)}function se($){if(!(this instanceof se))return new se($);const P=this instanceof gt();this._readableState=new he($,this,P),$&&(typeof $.read=="function"&&(this._read=$.read),typeof $.destroy=="function"&&(this._destroy=$.destroy),typeof $.construct=="function"&&(this._construct=$.construct),$.signal&&!P&&S($.signal,this)),y.call(this,$),p.construct(this,()=>{this._readableState.needReadable&&J(this,this._readableState)})}se.prototype.destroy=p.destroy,se.prototype._undestroy=p.undestroy,se.prototype._destroy=function($,P){P($)},se.prototype[g.captureRejectionSymbol]=function($){this.destroy($)},se.prototype[h]=function(){let $;return this.destroyed||($=this.readableEnded?null:new j,this.destroy($)),new l((P,ge)=>I(this,ye=>ye&&ye!==$?ge(ye):P(null)))},se.prototype.push=function($,P){return Se(this,$,P,!1)},se.prototype.unshift=function($,P){return Se(this,$,P,!0)};function Se($,P,ge,ye){b("readableAddChunk",P);const me=$._readableState;let Fe;if((me.state&U)===0&&(typeof P=="string"?(ge=ge||me.defaultEncoding,me.encoding!==ge&&(ye&&me.encoding?P=x.from(P,ge).toString(me.encoding):(P=x.from(P,ge),ge=""))):P instanceof x?ge="":y._isUint8Array(P)?(P=y._uint8ArrayToBuffer(P),ge=""):P!=null&&(Fe=new q("chunk",["string","Buffer","Uint8Array"],P))),Fe)v($,Fe);else if(P===null)me.state&=~ae,u($,me);else if((me.state&U)!==0||P&&P.length>0)if(ye)if((me.state&z)!==0)v($,new A);else{if(me.destroyed||me.errored)return!1;Be($,me,P,!0)}else if(me.ended)v($,new B);else{if(me.destroyed||me.errored)return!1;me.state&=~ae,me.decoder&&!ge?(P=me.decoder.write(P),me.objectMode||P.length!==0?Be($,me,P,!1):J($,me)):Be($,me,P,!1)}else ye||(me.state&=~ae,J($,me));return!me.ended&&(me.length<me.highWaterMark||me.length===0)}function Be($,P,ge,ye){P.flowing&&P.length===0&&!P.sync&&$.listenerCount("data")>0?((P.state&de)!==0?P.awaitDrainWriters.clear():P.awaitDrainWriters=null,P.dataEmitted=!0,$.emit("data",ge)):(P.length+=P.objectMode?1:ge.length,ye?P.buffer.unshift(ge):P.buffer.push(ge),(P.state&W)!==0&&f($)),J($,P)}se.prototype.isPaused=function(){const $=this._readableState;return $[L]===!0||$.flowing===!1},se.prototype.setEncoding=function($){const P=new ee($);this._readableState.decoder=P,this._readableState.encoding=this._readableState.decoder.encoding;const ge=this._readableState.buffer;let ye="";for(const me of ge)ye+=P.write(me);return ge.clear(),ye!==""&&ge.push(ye),this._readableState.length=ye.length,this};const ve=1073741824;function He($){if($>ve)throw new M("size","<= 1GiB",$);return $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++,$}function E($,P){return $<=0||P.length===0&&P.ended?0:(P.state&U)!==0?1:n($)?P.flowing&&P.length?P.buffer.first().length:P.length:$<=P.length?$:P.ended?P.length:0}se.prototype.read=function($){b("read",$),$===void 0?$=NaN:t($)||($=i($,10));const P=this._readableState,ge=$;if($>P.highWaterMark&&(P.highWaterMark=He($)),$!==0&&(P.state&=~F),$===0&&P.needReadable&&((P.highWaterMark!==0?P.length>=P.highWaterMark:P.length>0)||P.ended))return b("read: emitReadable",P.length,P.ended),P.length===0&&P.ended?qn(this):f(this),null;if($=E($,P),$===0&&P.ended)return P.length===0&&qn(this),null;let ye=(P.state&W)!==0;if(b("need readable",ye),(P.length===0||P.length-$<P.highWaterMark)&&(ye=!0,b("length less than watermark",ye)),P.ended||P.reading||P.destroyed||P.errored||!P.constructed)ye=!1,b("reading, ended or constructing",ye);else if(ye){b("do read"),P.state|=ae|V,P.length===0&&(P.state|=W);try{this._read(P.highWaterMark)}catch(Fe){v(this,Fe)}P.state&=~V,P.reading||($=E(ge,P))}let me;return $>0?me=ba($,P):me=null,me===null?(P.needReadable=P.length<=P.highWaterMark,$=0):(P.length-=$,P.multiAwaitDrain?P.awaitDrainWriters.clear():P.awaitDrainWriters=null),P.length===0&&(P.ended||(P.needReadable=!0),ge!==$&&P.ended&&qn(this)),me!==null&&!P.errorEmitted&&!P.closeEmitted&&(P.dataEmitted=!0,this.emit("data",me)),me};function u($,P){if(b("onEofChunk"),!P.ended){if(P.decoder){const ge=P.decoder.end();ge&&ge.length&&(P.buffer.push(ge),P.length+=P.objectMode?1:ge.length)}P.ended=!0,P.sync?f($):(P.needReadable=!1,P.emittedReadable=!0,k($))}}function f($){const P=$._readableState;b("emitReadable",P.needReadable,P.emittedReadable),P.needReadable=!1,P.emittedReadable||(b("emitReadable",P.flowing),P.emittedReadable=!0,r.nextTick(k,$))}function k($){const P=$._readableState;b("emitReadable_",P.destroyed,P.length,P.ended),!P.destroyed&&!P.errored&&(P.length||P.ended)&&($.emit("readable"),P.emittedReadable=!1),P.needReadable=!P.flowing&&!P.ended&&P.length<=P.highWaterMark,Ie($)}function J($,P){!P.readingMore&&P.constructed&&(P.readingMore=!0,r.nextTick(ie,$,P))}function ie($,P){for(;!P.reading&&!P.ended&&(P.length<P.highWaterMark||P.flowing&&P.length===0);){const ge=P.length;if(b("maybeReadMore read 0"),$.read(0),ge===P.length)break}P.readingMore=!1}se.prototype._read=function($){throw new R("_read()")},se.prototype.pipe=function($,P){const ge=this,ye=this._readableState;ye.pipes.length===1&&(ye.multiAwaitDrain||(ye.multiAwaitDrain=!0,ye.awaitDrainWriters=new d(ye.awaitDrainWriters?[ye.awaitDrainWriters]:[]))),ye.pipes.push($),b("pipe count=%d opts=%j",ye.pipes.length,P);const Fe=(!P||P.end!==!1)&&$!==r.stdout&&$!==r.stderr?va:dr;ye.endEmitted?r.nextTick(Fe):ge.once("end",Fe),$.on("unpipe",Ke);function Ke(Lt,ht){b("onunpipe"),Lt===ge&&ht&&ht.hasUnpiped===!1&&(ht.hasUnpiped=!0,bc())}function va(){b("onend"),$.end()}let At,_a=!1;function bc(){b("cleanup"),$.removeListener("close",Un),$.removeListener("finish",Hn),At&&$.removeListener("drain",At),$.removeListener("error",Fn),$.removeListener("unpipe",Ke),ge.removeListener("end",va),ge.removeListener("end",dr),ge.removeListener("data",Sa),_a=!0,At&&ye.awaitDrainWriters&&(!$._writableState||$._writableState.needDrain)&&At()}function xa(){_a||(ye.pipes.length===1&&ye.pipes[0]===$?(b("false write response, pause",0),ye.awaitDrainWriters=$,ye.multiAwaitDrain=!1):ye.pipes.length>1&&ye.pipes.includes($)&&(b("false write response, pause",ye.awaitDrainWriters.size),ye.awaitDrainWriters.add($)),ge.pause()),At||(At=oe(ge,$),$.on("drain",At))}ge.on("data",Sa);function Sa(Lt){b("ondata");const ht=$.write(Lt);b("dest.write",ht),ht===!1&&xa()}function Fn(Lt){if(b("onerror",Lt),dr(),$.removeListener("error",Fn),$.listenerCount("error")===0){const ht=$._writableState||$._readableState;ht&&!ht.errorEmitted?v($,Lt):$.emit("error",Lt)}}_($,"error",Fn);function Un(){$.removeListener("finish",Hn),dr()}$.once("close",Un);function Hn(){b("onfinish"),$.removeListener("close",Un),dr()}$.once("finish",Hn);function dr(){b("unpipe"),ge.unpipe($)}return $.emit("pipe",ge),$.writableNeedDrain===!0?xa():ye.flowing||(b("pipe resume"),ge.resume()),$};function oe($,P){return function(){const ye=$._readableState;ye.awaitDrainWriters===P?(b("pipeOnDrain",1),ye.awaitDrainWriters=null):ye.multiAwaitDrain&&(b("pipeOnDrain",ye.awaitDrainWriters.size),ye.awaitDrainWriters.delete(P)),(!ye.awaitDrainWriters||ye.awaitDrainWriters.size===0)&&$.listenerCount("data")&&$.resume()}}se.prototype.unpipe=function($){const P=this._readableState,ge={hasUnpiped:!1};if(P.pipes.length===0)return this;if(!$){const me=P.pipes;P.pipes=[],this.pause();for(let Fe=0;Fe<me.length;Fe++)me[Fe].emit("unpipe",this,{hasUnpiped:!1});return this}const ye=e(P.pipes,$);return ye===-1?this:(P.pipes.splice(ye,1),P.pipes.length===0&&this.pause(),$.emit("unpipe",this,ge),this)},se.prototype.on=function($,P){const ge=y.prototype.on.call(this,$,P),ye=this._readableState;return $==="data"?(ye.readableListening=this.listenerCount("readable")>0,ye.flowing!==!1&&this.resume()):$==="readable"&&!ye.endEmitted&&!ye.readableListening&&(ye.readableListening=ye.needReadable=!0,ye.flowing=!1,ye.emittedReadable=!1,b("on readable",ye.length,ye.reading),ye.length?f(this):ye.reading||r.nextTick(Le,this)),ge},se.prototype.addListener=se.prototype.on,se.prototype.removeListener=function($,P){const ge=y.prototype.removeListener.call(this,$,P);return $==="readable"&&r.nextTick(we,this),ge},se.prototype.off=se.prototype.removeListener,se.prototype.removeAllListeners=function($){const P=y.prototype.removeAllListeners.apply(this,arguments);return($==="readable"||$===void 0)&&r.nextTick(we,this),P};function we($){const P=$._readableState;P.readableListening=$.listenerCount("readable")>0,P.resumeScheduled&&P[L]===!1?P.flowing=!0:$.listenerCount("data")>0?$.resume():P.readableListening||(P.flowing=null)}function Le($){b("readable nexttick read 0"),$.read(0)}se.prototype.resume=function(){const $=this._readableState;return $.flowing||(b("resume"),$.flowing=!$.readableListening,Te(this,$)),$[L]=!1,this};function Te($,P){P.resumeScheduled||(P.resumeScheduled=!0,r.nextTick(je,$,P))}function je($,P){b("resume",P.reading),P.reading||$.read(0),P.resumeScheduled=!1,$.emit("resume"),Ie($),P.flowing&&!P.reading&&$.read(0)}se.prototype.pause=function(){return b("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(b("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[L]=!0,this};function Ie($){const P=$._readableState;for(b("flow",P.flowing);P.flowing&&$.read()!==null;);}se.prototype.wrap=function($){let P=!1;$.on("data",ye=>{!this.push(ye)&&$.pause&&(P=!0,$.pause())}),$.on("end",()=>{this.push(null)}),$.on("error",ye=>{v(this,ye)}),$.on("close",()=>{this.destroy()}),$.on("destroy",()=>{this.destroy()}),this._read=()=>{P&&$.resume&&(P=!1,$.resume())};const ge=a($);for(let ye=1;ye<ge.length;ye++){const me=ge[ye];this[me]===void 0&&typeof $[me]=="function"&&(this[me]=$[me].bind($))}return this},se.prototype[m]=function(){return ma(this)},se.prototype.iterator=function($){return $!==void 0&&Y($,"options"),ma(this,$)};function ma($,P){typeof $.read!="function"&&($=se.wrap($,{objectMode:!0}));const ge=gc($,P);return ge.stream=$,ge}async function*gc($,P){let ge=K;function ye(Ke){this===$?(ge(),ge=K):ge=Ke}$.on("readable",ye);let me;const Fe=I($,{writable:!1},Ke=>{me=Ke?T(me,Ke):null,ge(),ge=K});try{for(;;){const Ke=$.destroyed?null:$.read();if(Ke!==null)yield Ke;else{if(me)throw me;if(me===null)return;await new l(ye)}}}catch(Ke){throw me=T(me,Ke),me}finally{(me||P?.destroyOnReturn!==!1)&&(me===void 0||$._readableState.autoDestroy)?p.destroyer($,null):($.off("readable",ye),Fe())}}s(se.prototype,{readable:{__proto__:null,get(){const $=this._readableState;return!!$&&$.readable!==!1&&!$.destroyed&&!$.errorEmitted&&!$.endEmitted},set($){this._readableState&&(this._readableState.readable=!!$)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function($){this._readableState&&(this._readableState.flowing=$)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set($){this._readableState&&(this._readableState.destroyed=$)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(he.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[L]!==!1},set($){this[L]=!!$}}}),se._fromList=ba;function ba($,P){if(P.length===0)return null;let ge;return P.objectMode?ge=P.buffer.shift():!$||$>=P.length?(P.decoder?ge=P.buffer.join(""):P.buffer.length===1?ge=P.buffer.first():ge=P.buffer.concat(P.length),P.buffer.clear()):ge=P.buffer.consume($,P.decoder),ge}function qn($){const P=$._readableState;b("endReadable",P.endEmitted),P.endEmitted||(P.ended=!0,r.nextTick(yc,P,$))}function yc($,P){if(b("endReadableNT",$.endEmitted,$.length),!$.errored&&!$.closeEmitted&&!$.endEmitted&&$.length===0){if($.endEmitted=!0,P.emit("end"),P.writable&&P.allowHalfOpen===!1)r.nextTick(mc,P);else if($.autoDestroy){const ge=P._writableState;(!ge||ge.autoDestroy&&(ge.finished||ge.writable===!1))&&P.destroy()}}}function mc($){$.writable&&!$.writableEnded&&!$.destroyed&&$.end()}se.from=function($,P){return C(se,$,P)};let Bn;function wa(){return Bn===void 0&&(Bn={}),Bn}return se.fromWeb=function($,P){return wa().newStreamReadableFromReadableStream($,P)},se.toWeb=function($,P){return wa().newReadableStreamFromStreamReadable($,P)},se.wrap=function($,P){var ge,ye;return new se({objectMode:(ge=(ye=$.readableObjectMode)!==null&&ye!==void 0?ye:$.objectMode)!==null&&ge!==void 0?ge:!0,...P,destroy(me,Fe){p.destroyer($,me),Fe(me)}}).wrap($)},li}var ui,Za;function Us(){if(Za)return ui;Za=1;const r=Ut(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:s,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:o,Symbol:l,SymbolHasInstance:d}=$e();ui=Y,Y.WritableState=A;const{EventEmitter:h}=Nn(),m=Fs().Stream,{Buffer:w}=bt(),g=or(),{addAbortSignal:y}=Tn(),{getHighWaterMark:_,getDefaultHighWaterMark:x}=An(),{ERR_INVALID_ARG_TYPE:S,ERR_METHOD_NOT_IMPLEMENTED:I,ERR_MULTIPLE_CALLBACK:b,ERR_STREAM_CANNOT_PIPE:c,ERR_STREAM_DESTROYED:p,ERR_STREAM_ALREADY_FINISHED:N,ERR_STREAM_NULL_VALUES:D,ERR_STREAM_WRITE_AFTER_END:T,ERR_UNKNOWN_ENCODING:q}=Ve().codes,{errorOrDestroy:R}=g;a(Y.prototype,m.prototype),a(Y,m);function M(){}const B=l("kOnFinished");function A(O,G,re){typeof re!="boolean"&&(re=G instanceof gt()),this.objectMode=!!(O&&O.objectMode),re&&(this.objectMode=this.objectMode||!!(O&&O.writableObjectMode)),this.highWaterMark=O?_(this,O,"writableHighWaterMark",re):x(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ue=!!(O&&O.decodeStrings===!1);this.decodeStrings=!ue,this.defaultEncoding=O&&O.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=v.bind(void 0,G),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,j(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!O||O.emitClose!==!1,this.autoDestroy=!O||O.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[B]=[]}function j(O){O.buffered=[],O.bufferedIndex=0,O.allBuffers=!0,O.allNoop=!0}A.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},i(A.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Y(O){const G=this instanceof gt();if(!G&&!n(Y,this))return new Y(O);this._writableState=new A(O,this,G),O&&(typeof O.write=="function"&&(this._write=O.write),typeof O.writev=="function"&&(this._writev=O.writev),typeof O.destroy=="function"&&(this._destroy=O.destroy),typeof O.final=="function"&&(this._final=O.final),typeof O.construct=="function"&&(this._construct=O.construct),O.signal&&y(O.signal,this)),m.call(this,O),g.construct(this,()=>{const re=this._writableState;re.writing||ae(this,re),F(this,re)})}i(Y,d,{__proto__:null,value:function(O){return n(this,O)?!0:this!==Y?!1:O&&O._writableState instanceof A}}),Y.prototype.pipe=function(){R(this,new c)};function L(O,G,re,ue){const de=O._writableState;if(typeof re=="function")ue=re,re=de.defaultEncoding;else{if(!re)re=de.defaultEncoding;else if(re!=="buffer"&&!w.isEncoding(re))throw new q(re);typeof ue!="function"&&(ue=M)}if(G===null)throw new D;if(!de.objectMode)if(typeof G=="string")de.decodeStrings!==!1&&(G=w.from(G,re),re="buffer");else if(G instanceof w)re="buffer";else if(m._isUint8Array(G))G=m._uint8ArrayToBuffer(G),re="buffer";else throw new S("chunk",["string","Buffer","Uint8Array"],G);let pe;return de.ending?pe=new T:de.destroyed&&(pe=new p("write")),pe?(r.nextTick(ue,pe),R(O,pe,!0),pe):(de.pendingcb++,ee(O,de,G,re,ue))}Y.prototype.write=function(O,G,re){return L(this,O,G,re)===!0},Y.prototype.cork=function(){this._writableState.corked++},Y.prototype.uncork=function(){const O=this._writableState;O.corked&&(O.corked--,O.writing||ae(this,O))},Y.prototype.setDefaultEncoding=function(G){if(typeof G=="string"&&(G=o(G)),!w.isEncoding(G))throw new q(G);return this._writableState.defaultEncoding=G,this};function ee(O,G,re,ue,de){const pe=G.objectMode?1:re.length;G.length+=pe;const X=G.length<G.highWaterMark;return X||(G.needDrain=!0),G.writing||G.corked||G.errored||!G.constructed?(G.buffered.push({chunk:re,encoding:ue,callback:de}),G.allBuffers&&ue!=="buffer"&&(G.allBuffers=!1),G.allNoop&&de!==M&&(G.allNoop=!1)):(G.writelen=pe,G.writecb=de,G.writing=!0,G.sync=!0,O._write(re,ue,G.onwrite),G.sync=!1),X&&!G.errored&&!G.destroyed}function C(O,G,re,ue,de,pe,X){G.writelen=ue,G.writecb=X,G.writing=!0,G.sync=!0,G.destroyed?G.onwrite(new p("write")):re?O._writev(de,G.onwrite):O._write(de,pe,G.onwrite),G.sync=!1}function K(O,G,re,ue){--G.pendingcb,ue(re),z(G),R(O,re)}function v(O,G){const re=O._writableState,ue=re.sync,de=re.writecb;if(typeof de!="function"){R(O,new b);return}re.writing=!1,re.writecb=null,re.length-=re.writelen,re.writelen=0,G?(G.stack,re.errored||(re.errored=G),O._readableState&&!O._readableState.errored&&(O._readableState.errored=G),ue?r.nextTick(K,O,re,G,de):K(O,re,G,de)):(re.buffered.length>re.bufferedIndex&&ae(O,re),ue?re.afterWriteTickInfo!==null&&re.afterWriteTickInfo.cb===de?re.afterWriteTickInfo.count++:(re.afterWriteTickInfo={count:1,cb:de,stream:O,state:re},r.nextTick(U,re.afterWriteTickInfo)):Q(O,re,1,de))}function U({stream:O,state:G,count:re,cb:ue}){return G.afterWriteTickInfo=null,Q(O,G,re,ue)}function Q(O,G,re,ue){for(!G.ending&&!O.destroyed&&G.length===0&&G.needDrain&&(G.needDrain=!1,O.emit("drain"));re-- >0;)G.pendingcb--,ue();G.destroyed&&z(G),F(O,G)}function z(O){if(O.writing)return;for(let de=O.bufferedIndex;de<O.buffered.length;++de){var G;const{chunk:pe,callback:X}=O.buffered[de],le=O.objectMode?1:pe.length;O.length-=le,X((G=O.errored)!==null&&G!==void 0?G:new p("write"))}const re=O[B].splice(0);for(let de=0;de<re.length;de++){var ue;re[de]((ue=O.errored)!==null&&ue!==void 0?ue:new p("end"))}j(O)}function ae(O,G){if(G.corked||G.bufferProcessing||G.destroyed||!G.constructed)return;const{buffered:re,bufferedIndex:ue,objectMode:de}=G,pe=re.length-ue;if(!pe)return;let X=ue;if(G.bufferProcessing=!0,pe>1&&O._writev){G.pendingcb-=pe-1;const le=G.allNoop?M:se=>{for(let Se=X;Se<re.length;++Se)re[Se].callback(se)},he=G.allNoop&&X===0?re:e(re,X);he.allBuffers=G.allBuffers,C(O,G,!0,G.length,he,"",le),j(G)}else{do{const{chunk:le,encoding:he,callback:se}=re[X];re[X++]=null;const Se=de?1:le.length;C(O,G,!1,Se,le,he,se)}while(X<re.length&&!G.writing);X===re.length?j(G):X>256?(re.splice(0,X),G.bufferedIndex=0):G.bufferedIndex=X}G.bufferProcessing=!1}Y.prototype._write=function(O,G,re){if(this._writev)this._writev([{chunk:O,encoding:G}],re);else throw new I("_write()")},Y.prototype._writev=null,Y.prototype.end=function(O,G,re){const ue=this._writableState;typeof O=="function"?(re=O,O=null,G=null):typeof G=="function"&&(re=G,G=null);let de;if(O!=null){const pe=L(this,O,G);pe instanceof t&&(de=pe)}return ue.corked&&(ue.corked=1,this.uncork()),de||(!ue.errored&&!ue.ending?(ue.ending=!0,F(this,ue,!0),ue.ended=!0):ue.finished?de=new N("end"):ue.destroyed&&(de=new p("end"))),typeof re=="function"&&(de||ue.finished?r.nextTick(re,de):ue[B].push(re)),this};function H(O){return O.ending&&!O.destroyed&&O.constructed&&O.length===0&&!O.errored&&O.buffered.length===0&&!O.finished&&!O.writing&&!O.errorEmitted&&!O.closeEmitted}function V(O,G){let re=!1;function ue(de){if(re){R(O,de??b());return}if(re=!0,G.pendingcb--,de){const pe=G[B].splice(0);for(let X=0;X<pe.length;X++)pe[X](de);R(O,de,G.sync)}else H(G)&&(G.prefinished=!0,O.emit("prefinish"),G.pendingcb++,r.nextTick(Z,O,G))}G.sync=!0,G.pendingcb++;try{O._final(ue)}catch(de){ue(de)}G.sync=!1}function W(O,G){!G.prefinished&&!G.finalCalled&&(typeof O._final=="function"&&!G.destroyed?(G.finalCalled=!0,V(O,G)):(G.prefinished=!0,O.emit("prefinish")))}function F(O,G,re){H(G)&&(W(O,G),G.pendingcb===0&&(re?(G.pendingcb++,r.nextTick((ue,de)=>{H(de)?Z(ue,de):de.pendingcb--},O,G)):H(G)&&(G.pendingcb++,Z(O,G))))}function Z(O,G){G.pendingcb--,G.finished=!0;const re=G[B].splice(0);for(let ue=0;ue<re.length;ue++)re[ue]();if(O.emit("finish"),G.autoDestroy){const ue=O._readableState;(!ue||ue.autoDestroy&&(ue.endEmitted||ue.readable===!1))&&O.destroy()}}s(Y.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(O){this._writableState&&(this._writableState.destroyed=O)}},writable:{__proto__:null,get(){const O=this._writableState;return!!O&&O.writable!==!1&&!O.destroyed&&!O.errored&&!O.ending&&!O.ended},set(O){this._writableState&&(this._writableState.writable=!!O)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const O=this._writableState;return O?!O.destroyed&&!O.ending&&O.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const te=g.destroy;Y.prototype.destroy=function(O,G){const re=this._writableState;return!re.destroyed&&(re.bufferedIndex<re.buffered.length||re[B].length)&&r.nextTick(z,re),te.call(this,O,G),this},Y.prototype._undestroy=g.undestroy,Y.prototype._destroy=function(O,G){G(O)},Y.prototype[h.captureRejectionSymbol]=function(O){this.destroy(O)};let ce;function fe(){return ce===void 0&&(ce={}),ce}return Y.fromWeb=function(O,G){return fe().newStreamWritableFromWritableStream(O,G)},Y.toWeb=function(O){return fe().newWritableStreamFromStreamWritable(O)},ui}var ci,eo;function Hc(){if(eo)return ci;eo=1;const r=Ut(),e=bt(),{isReadable:t,isWritable:n,isIterable:i,isNodeStream:s,isReadableNodeStream:a,isWritableNodeStream:o,isDuplexNodeStream:l,isReadableStream:d,isWritableStream:h}=wt(),m=Nt(),{AbortError:w,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:y}}=Ve(),{destroyer:_}=or(),x=gt(),S=Ln(),I=Us(),{createDeferredPromise:b}=ze(),c=mu(),p=globalThis.Blob||e.Blob,N=typeof p<"u"?function(A){return A instanceof p}:function(A){return!1},D=globalThis.AbortController||Hr().AbortController,{FunctionPrototypeCall:T}=$e();class q extends x{constructor(A){super(A),A?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),A?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}ci=function B(A,j){if(l(A))return A;if(a(A))return M({readable:A});if(o(A))return M({writable:A});if(s(A))return M({writable:!1,readable:!1});if(d(A))return M({readable:S.fromWeb(A)});if(h(A))return M({writable:I.fromWeb(A)});if(typeof A=="function"){const{value:L,write:ee,final:C,destroy:K}=R(A);if(i(L))return c(q,L,{objectMode:!0,write:ee,final:C,destroy:K});const v=L?.then;if(typeof v=="function"){let U;const Q=T(v,L,z=>{if(z!=null)throw new y("nully","body",z)},z=>{_(U,z)});return U=new q({objectMode:!0,readable:!1,write:ee,final(z){C(async()=>{try{await Q,r.nextTick(z,null)}catch(ae){r.nextTick(z,ae)}})},destroy:K})}throw new y("Iterable, AsyncIterable or AsyncFunction",j,L)}if(N(A))return B(A.arrayBuffer());if(i(A))return c(q,A,{objectMode:!0,writable:!1});if(d(A?.readable)&&h(A?.writable))return q.fromWeb(A);if(typeof A?.writable=="object"||typeof A?.readable=="object"){const L=A!=null&&A.readable?a(A?.readable)?A?.readable:B(A.readable):void 0,ee=A!=null&&A.writable?o(A?.writable)?A?.writable:B(A.writable):void 0;return M({readable:L,writable:ee})}const Y=A?.then;if(typeof Y=="function"){let L;return T(Y,A,ee=>{ee!=null&&L.push(ee),L.push(null)},ee=>{_(L,ee)}),L=new q({objectMode:!0,writable:!1,read(){}})}throw new g(j,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],A)};function R(B){let{promise:A,resolve:j}=b();const Y=new D,L=Y.signal;return{value:B(async function*(){for(;;){const C=A;A=null;const{chunk:K,done:v,cb:U}=await C;if(r.nextTick(U),v)return;if(L.aborted)throw new w(void 0,{cause:L.reason});({promise:A,resolve:j}=b()),yield K}}(),{signal:L}),write(C,K,v){const U=j;j=null,U({chunk:C,done:!1,cb:v})},final(C){const K=j;j=null,K({done:!0,cb:C})},destroy(C,K){Y.abort(),K(C)}}}function M(B){const A=B.readable&&typeof B.readable.read!="function"?S.wrap(B.readable):B.readable,j=B.writable;let Y=!!t(A),L=!!n(j),ee,C,K,v,U;function Q(z){const ae=v;v=null,ae?ae(z):z&&U.destroy(z)}return U=new q({readableObjectMode:!!(A!=null&&A.readableObjectMode),writableObjectMode:!!(j!=null&&j.writableObjectMode),readable:Y,writable:L}),L&&(m(j,z=>{L=!1,z&&_(A,z),Q(z)}),U._write=function(z,ae,H){j.write(z,ae)?H():ee=H},U._final=function(z){j.end(),C=z},j.on("drain",function(){if(ee){const z=ee;ee=null,z()}}),j.on("finish",function(){if(C){const z=C;C=null,z()}})),Y&&(m(A,z=>{Y=!1,z&&_(A,z),Q(z)}),A.on("readable",function(){if(K){const z=K;K=null,z()}}),A.on("end",function(){U.push(null)}),U._read=function(){for(;;){const z=A.read();if(z===null){K=U._read;return}if(!U.push(z))return}}),U._destroy=function(z,ae){!z&&v!==null&&(z=new w),K=null,ee=null,C=null,v===null?ae(z):(v=ae,_(j,z),_(A,z))},U}return ci}var di,to;function gt(){if(to)return di;to=1;const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:n}=$e();di=a;const i=Ln(),s=Us();n(a.prototype,i.prototype),n(a,i);{const h=t(s.prototype);for(let m=0;m<h.length;m++){const w=h[m];a.prototype[w]||(a.prototype[w]=s.prototype[w])}}function a(h){if(!(this instanceof a))return new a(h);i.call(this,h),s.call(this,h),h?(this.allowHalfOpen=h.allowHalfOpen!==!1,h.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),h.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(a.prototype,{writable:{__proto__:null,...e(s.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(s.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(s.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(s.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(s.prototype,"writableLength")},writableFinished:{__proto__:null,...e(s.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(s.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(s.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(s.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(h){this._readableState&&this._writableState&&(this._readableState.destroyed=h,this._writableState.destroyed=h)}}});let o;function l(){return o===void 0&&(o={}),o}a.fromWeb=function(h,m){return l().newStreamDuplexFromReadableWritablePair(h,m)},a.toWeb=function(h){return l().newReadableWritablePairFromDuplex(h)};let d;return a.from=function(h){return d||(d=Hc()),d(h,"body")},di}var fi,ro;function bu(){if(ro)return fi;ro=1;const{ObjectSetPrototypeOf:r,Symbol:e}=$e();fi=a;const{ERR_METHOD_NOT_IMPLEMENTED:t}=Ve().codes,n=gt(),{getHighWaterMark:i}=An();r(a.prototype,n.prototype),r(a,n);const s=e("kCallback");function a(d){if(!(this instanceof a))return new a(d);const h=d?i(this,d,"readableHighWaterMark",!0):null;h===0&&(d={...d,highWaterMark:null,readableHighWaterMark:h,writableHighWaterMark:d.writableHighWaterMark||0}),n.call(this,d),this._readableState.sync=!1,this[s]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",l)}function o(d){typeof this._flush=="function"&&!this.destroyed?this._flush((h,m)=>{if(h){d?d(h):this.destroy(h);return}m!=null&&this.push(m),this.push(null),d&&d()}):(this.push(null),d&&d())}function l(){this._final!==o&&o.call(this)}return a.prototype._final=o,a.prototype._transform=function(d,h,m){throw new t("_transform()")},a.prototype._write=function(d,h,m){const w=this._readableState,g=this._writableState,y=w.length;this._transform(d,h,(_,x)=>{if(_){m(_);return}x!=null&&this.push(x),g.ended||y===w.length||w.length<w.highWaterMark?m():this[s]=m})},a.prototype._read=function(){if(this[s]){const d=this[s];this[s]=null,d()}},fi}var hi,no;function wu(){if(no)return hi;no=1;const{ObjectSetPrototypeOf:r}=$e();hi=t;const e=bu();r(t.prototype,e.prototype),r(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,i,s){s(null,n)},hi}var pi,io;function Hs(){if(io)return pi;io=1;const r=Ut(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:n,SymbolDispose:i}=$e(),s=Nt(),{once:a}=ze(),o=or(),l=gt(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:m,ERR_MISSING_ARGS:w,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:_}=Ve(),{validateFunction:x,validateAbortSignal:S}=Qr(),{isIterable:I,isReadable:b,isReadableNodeStream:c,isNodeStream:p,isTransformStream:N,isWebStream:D,isReadableStream:T,isReadableFinished:q}=wt(),R=globalThis.AbortController||Hr().AbortController;let M,B,A;function j(z,ae,H){let V=!1;z.on("close",()=>{V=!0});const W=s(z,{readable:ae,writable:H},F=>{V=!F});return{destroy:F=>{V||(V=!0,o.destroyer(z,F||new g("pipe")))},cleanup:W}}function Y(z){return x(z[z.length-1],"streams[stream.length - 1]"),z.pop()}function L(z){if(I(z))return z;if(c(z))return ee(z);throw new h("val",["Readable","Iterable","AsyncIterable"],z)}async function*ee(z){B||(B=Ln()),yield*B.prototype[n].call(z)}async function C(z,ae,H,{end:V}){let W,F=null;const Z=fe=>{if(fe&&(W=fe),F){const O=F;F=null,O()}},te=()=>new t((fe,O)=>{W?O(W):F=()=>{W?O(W):fe()}});ae.on("drain",Z);const ce=s(ae,{readable:!1},Z);try{ae.writableNeedDrain&&await te();for await(const fe of z)ae.write(fe)||await te();V&&(ae.end(),await te()),H()}catch(fe){H(W!==fe?d(W,fe):fe)}finally{ce(),ae.off("drain",Z)}}async function K(z,ae,H,{end:V}){N(ae)&&(ae=ae.writable);const W=ae.getWriter();try{for await(const F of z)await W.ready,W.write(F).catch(()=>{});await W.ready,V&&await W.close(),H()}catch(F){try{await W.abort(F),H(F)}catch(Z){H(Z)}}}function v(...z){return U(z,a(Y(z)))}function U(z,ae,H){if(z.length===1&&e(z[0])&&(z=z[0]),z.length<2)throw new w("streams");const V=new R,W=V.signal,F=H?.signal,Z=[];S(F,"options.signal");function te(){de(new _)}A=A||ze().addAbortListener;let ce;F&&(ce=A(F,te));let fe,O;const G=[];let re=0;function ue(he){de(he,--re===0)}function de(he,se){var Se;if(he&&(!fe||fe.code==="ERR_STREAM_PREMATURE_CLOSE")&&(fe=he),!(!fe&&!se)){for(;G.length;)G.shift()(fe);(Se=ce)===null||Se===void 0||Se[i](),V.abort(),se&&(fe||Z.forEach(Be=>Be()),r.nextTick(ae,fe,O))}}let pe;for(let he=0;he<z.length;he++){const se=z[he],Se=he<z.length-1,Be=he>0,ve=Se||H?.end!==!1,He=he===z.length-1;if(p(se)){let E=function(u){u&&u.name!=="AbortError"&&u.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ue(u)};if(ve){const{destroy:u,cleanup:f}=j(se,Se,Be);G.push(u),b(se)&&He&&Z.push(f)}se.on("error",E),b(se)&&He&&Z.push(()=>{se.removeListener("error",E)})}if(he===0)if(typeof se=="function"){if(pe=se({signal:W}),!I(pe))throw new m("Iterable, AsyncIterable or Stream","source",pe)}else I(se)||c(se)||N(se)?pe=se:pe=l.from(se);else if(typeof se=="function"){if(N(pe)){var X;pe=L((X=pe)===null||X===void 0?void 0:X.readable)}else pe=L(pe);if(pe=se(pe,{signal:W}),Se){if(!I(pe,!0))throw new m("AsyncIterable",`transform[${he-1}]`,pe)}else{var le;M||(M=wu());const E=new M({objectMode:!0}),u=(le=pe)===null||le===void 0?void 0:le.then;if(typeof u=="function")re++,u.call(pe,J=>{O=J,J!=null&&E.write(J),ve&&E.end(),r.nextTick(ue)},J=>{E.destroy(J),r.nextTick(ue,J)});else if(I(pe,!0))re++,C(pe,E,ue,{end:ve});else if(T(pe)||N(pe)){const J=pe.readable||pe;re++,C(J,E,ue,{end:ve})}else throw new m("AsyncIterable or Promise","destination",pe);pe=E;const{destroy:f,cleanup:k}=j(pe,!1,!0);G.push(f),He&&Z.push(k)}}else if(p(se)){if(c(pe)){re+=2;const E=Q(pe,se,ue,{end:ve});b(se)&&He&&Z.push(E)}else if(N(pe)||T(pe)){const E=pe.readable||pe;re++,C(E,se,ue,{end:ve})}else if(I(pe))re++,C(pe,se,ue,{end:ve});else throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],pe);pe=se}else if(D(se)){if(c(pe))re++,K(L(pe),se,ue,{end:ve});else if(T(pe)||I(pe))re++,K(pe,se,ue,{end:ve});else if(N(pe))re++,K(pe.readable,se,ue,{end:ve});else throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],pe);pe=se}else pe=l.from(se)}return(W!=null&&W.aborted||F!=null&&F.aborted)&&r.nextTick(te),pe}function Q(z,ae,H,{end:V}){let W=!1;if(ae.on("close",()=>{W||H(new y)}),z.pipe(ae,{end:!1}),V){let F=function(){W=!0,ae.end()};q(z)?r.nextTick(F):z.once("end",F)}else H();return s(z,{readable:!0,writable:!1},F=>{const Z=z._readableState;F&&F.code==="ERR_STREAM_PREMATURE_CLOSE"&&Z&&Z.ended&&!Z.errored&&!Z.errorEmitted?z.once("end",H).once("error",H):H(F)}),s(ae,{readable:!1,writable:!0},H)}return pi={pipelineImpl:U,pipeline:v},pi}var gi,so;function vu(){if(so)return gi;so=1;const{pipeline:r}=Hs(),e=gt(),{destroyer:t}=or(),{isNodeStream:n,isReadable:i,isWritable:s,isWebStream:a,isTransformStream:o,isWritableStream:l,isReadableStream:d}=wt(),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:m,ERR_MISSING_ARGS:w}}=Ve(),g=Nt();return gi=function(..._){if(_.length===0)throw new w("streams");if(_.length===1)return e.from(_[0]);const x=[..._];if(typeof _[0]=="function"&&(_[0]=e.from(_[0])),typeof _[_.length-1]=="function"){const M=_.length-1;_[M]=e.from(_[M])}for(let M=0;M<_.length;++M)if(!(!n(_[M])&&!a(_[M]))){if(M<_.length-1&&!(i(_[M])||d(_[M])||o(_[M])))throw new m(`streams[${M}]`,x[M],"must be readable");if(M>0&&!(s(_[M])||l(_[M])||o(_[M])))throw new m(`streams[${M}]`,x[M],"must be writable")}let S,I,b,c,p;function N(M){const B=c;c=null,B?B(M):M?p.destroy(M):!R&&!q&&p.destroy()}const D=_[0],T=r(_,N),q=!!(s(D)||l(D)||o(D)),R=!!(i(T)||d(T)||o(T));if(p=new e({writableObjectMode:!!(D!=null&&D.writableObjectMode),readableObjectMode:!!(T!=null&&T.readableObjectMode),writable:q,readable:R}),q){if(n(D))p._write=function(B,A,j){D.write(B,A)?j():S=j},p._final=function(B){D.end(),I=B},D.on("drain",function(){if(S){const B=S;S=null,B()}});else if(a(D)){const A=(o(D)?D.writable:D).getWriter();p._write=async function(j,Y,L){try{await A.ready,A.write(j).catch(()=>{}),L()}catch(ee){L(ee)}},p._final=async function(j){try{await A.ready,A.close().catch(()=>{}),I=j}catch(Y){j(Y)}}}const M=o(T)?T.readable:T;g(M,()=>{if(I){const B=I;I=null,B()}})}if(R){if(n(T))T.on("readable",function(){if(b){const M=b;b=null,M()}}),T.on("end",function(){p.push(null)}),p._read=function(){for(;;){const M=T.read();if(M===null){b=p._read;return}if(!p.push(M))return}};else if(a(T)){const B=(o(T)?T.readable:T).getReader();p._read=async function(){for(;;)try{const{value:A,done:j}=await B.read();if(!p.push(A))return;if(j){p.push(null);return}}catch{return}}}}return p._destroy=function(M,B){!M&&c!==null&&(M=new h),b=null,S=null,I=null,c===null?B(M):(c=B,n(T)&&t(T,M))},p},gi}var ao;function Vc(){if(ao)return nn;ao=1;const r=globalThis.AbortController||Hr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:s}=Ve(),{validateAbortSignal:a,validateInteger:o,validateObject:l}=Qr(),d=$e().Symbol("kWeak"),h=$e().Symbol("kResistStopPropagation"),{finished:m}=Nt(),w=vu(),{addAbortSignalNoValidate:g}=Tn(),{isWritable:y,isNodeStream:_}=wt(),{deprecate:x}=ze(),{ArrayPrototypePush:S,Boolean:I,MathFloor:b,Number:c,NumberIsNaN:p,Promise:N,PromiseReject:D,PromiseResolve:T,PromisePrototypeThen:q,Symbol:R}=$e(),M=R("kEmpty"),B=R("kEof");function A(F,Z){if(Z!=null&&l(Z,"options"),Z?.signal!=null&&a(Z.signal,"options.signal"),_(F)&&!y(F))throw new e("stream",F,"must be writable");const te=w(this,F);return Z!=null&&Z.signal&&g(Z.signal,te),te}function j(F,Z){if(typeof F!="function")throw new t("fn",["Function","AsyncFunction"],F);Z!=null&&l(Z,"options"),Z?.signal!=null&&a(Z.signal,"options.signal");let te=1;Z?.concurrency!=null&&(te=b(Z.concurrency));let ce=te-1;return Z?.highWaterMark!=null&&(ce=b(Z.highWaterMark)),o(te,"options.concurrency",1),o(ce,"options.highWaterMark",0),ce+=te,(async function*(){const O=ze().AbortSignalAny([Z?.signal].filter(I)),G=this,re=[],ue={signal:O};let de,pe,X=!1,le=0;function he(){X=!0,se()}function se(){le-=1,Se()}function Se(){pe&&!X&&le<te&&re.length<ce&&(pe(),pe=null)}async function Be(){try{for await(let ve of G){if(X)return;if(O.aborted)throw new s;try{if(ve=F(ve,ue),ve===M)continue;ve=T(ve)}catch(He){ve=D(He)}le+=1,q(ve,se,he),re.push(ve),de&&(de(),de=null),!X&&(re.length>=ce||le>=te)&&await new N(He=>{pe=He})}re.push(B)}catch(ve){const He=D(ve);q(He,se,he),re.push(He)}finally{X=!0,de&&(de(),de=null)}}Be();try{for(;;){for(;re.length>0;){const ve=await re[0];if(ve===B)return;if(O.aborted)throw new s;ve!==M&&(yield ve),re.shift(),Se()}await new N(ve=>{de=ve})}}finally{X=!0,pe&&(pe(),pe=null)}}).call(this)}function Y(F=void 0){return F!=null&&l(F,"options"),F?.signal!=null&&a(F.signal,"options.signal"),(async function*(){let te=0;for await(const fe of this){var ce;if(F!=null&&(ce=F.signal)!==null&&ce!==void 0&&ce.aborted)throw new s({cause:F.signal.reason});yield[te++,fe]}}).call(this)}async function L(F,Z=void 0){for await(const te of v.call(this,F,Z))return!0;return!1}async function ee(F,Z=void 0){if(typeof F!="function")throw new t("fn",["Function","AsyncFunction"],F);return!await L.call(this,async(...te)=>!await F(...te),Z)}async function C(F,Z){for await(const te of v.call(this,F,Z))return te}async function K(F,Z){if(typeof F!="function")throw new t("fn",["Function","AsyncFunction"],F);async function te(ce,fe){return await F(ce,fe),M}for await(const ce of j.call(this,te,Z));}function v(F,Z){if(typeof F!="function")throw new t("fn",["Function","AsyncFunction"],F);async function te(ce,fe){return await F(ce,fe)?ce:M}return j.call(this,te,Z)}class U extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function Q(F,Z,te){var ce;if(typeof F!="function")throw new t("reducer",["Function","AsyncFunction"],F);te!=null&&l(te,"options"),te?.signal!=null&&a(te.signal,"options.signal");let fe=arguments.length>1;if(te!=null&&(ce=te.signal)!==null&&ce!==void 0&&ce.aborted){const de=new s(void 0,{cause:te.signal.reason});throw this.once("error",()=>{}),await m(this.destroy(de)),de}const O=new r,G=O.signal;if(te!=null&&te.signal){const de={once:!0,[d]:this,[h]:!0};te.signal.addEventListener("abort",()=>O.abort(),de)}let re=!1;try{for await(const de of this){var ue;if(re=!0,te!=null&&(ue=te.signal)!==null&&ue!==void 0&&ue.aborted)throw new s;fe?Z=await F(Z,de,{signal:G}):(Z=de,fe=!0)}if(!re&&!fe)throw new U}finally{O.abort()}return Z}async function z(F){F!=null&&l(F,"options"),F?.signal!=null&&a(F.signal,"options.signal");const Z=[];for await(const ce of this){var te;if(F!=null&&(te=F.signal)!==null&&te!==void 0&&te.aborted)throw new s(void 0,{cause:F.signal.reason});S(Z,ce)}return Z}function ae(F,Z){const te=j.call(this,F,Z);return(async function*(){for await(const fe of te)yield*fe}).call(this)}function H(F){if(F=c(F),p(F))return 0;if(F<0)throw new i("number",">= 0",F);return F}function V(F,Z=void 0){return Z!=null&&l(Z,"options"),Z?.signal!=null&&a(Z.signal,"options.signal"),F=H(F),(async function*(){var ce;if(Z!=null&&(ce=Z.signal)!==null&&ce!==void 0&&ce.aborted)throw new s;for await(const O of this){var fe;if(Z!=null&&(fe=Z.signal)!==null&&fe!==void 0&&fe.aborted)throw new s;F--<=0&&(yield O)}}).call(this)}function W(F,Z=void 0){return Z!=null&&l(Z,"options"),Z?.signal!=null&&a(Z.signal,"options.signal"),F=H(F),(async function*(){var ce;if(Z!=null&&(ce=Z.signal)!==null&&ce!==void 0&&ce.aborted)throw new s;for await(const O of this){var fe;if(Z!=null&&(fe=Z.signal)!==null&&fe!==void 0&&fe.aborted)throw new s;if(F-- >0&&(yield O),F<=0)return}}).call(this)}return nn.streamReturningOperators={asIndexedPairs:x(Y,"readable.asIndexedPairs will be removed in a future version."),drop:V,filter:v,flatMap:ae,map:j,take:W,compose:A},nn.promiseReturningOperators={every:ee,forEach:K,reduce:Q,toArray:z,some:L,find:C},nn}var yi,oo;function _u(){if(oo)return yi;oo=1;const{ArrayPrototypePop:r,Promise:e}=$e(),{isIterable:t,isNodeStream:n,isWebStream:i}=wt(),{pipelineImpl:s}=Hs(),{finished:a}=Nt();xu();function o(...l){return new e((d,h)=>{let m,w;const g=l[l.length-1];if(g&&typeof g=="object"&&!n(g)&&!t(g)&&!i(g)){const y=r(l);m=y.signal,w=y.end}s(l,(y,_)=>{y?h(y):d(_)},{signal:m,end:w})})}return yi={finished:a,pipeline:o},yi}var lo;function xu(){if(lo)return zn.exports;lo=1;const{Buffer:r}=bt(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:n}=$e(),{promisify:{custom:i}}=ze(),{streamReturningOperators:s,promiseReturningOperators:a}=Vc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:o}}=Ve(),l=vu(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:h}=An(),{pipeline:m}=Hs(),{destroyer:w}=or(),g=Nt(),y=_u(),_=wt(),x=zn.exports=Fs().Stream;x.isDestroyed=_.isDestroyed,x.isDisturbed=_.isDisturbed,x.isErrored=_.isErrored,x.isReadable=_.isReadable,x.isWritable=_.isWritable,x.Readable=Ln();for(const I of t(s)){let c=function(...p){if(new.target)throw o();return x.Readable.from(n(b,this,p))};const b=s[I];e(c,"name",{__proto__:null,value:b.name}),e(c,"length",{__proto__:null,value:b.length}),e(x.Readable.prototype,I,{__proto__:null,value:c,enumerable:!1,configurable:!0,writable:!0})}for(const I of t(a)){let c=function(...p){if(new.target)throw o();return n(b,this,p)};const b=a[I];e(c,"name",{__proto__:null,value:b.name}),e(c,"length",{__proto__:null,value:b.length}),e(x.Readable.prototype,I,{__proto__:null,value:c,enumerable:!1,configurable:!0,writable:!0})}x.Writable=Us(),x.Duplex=gt(),x.Transform=bu(),x.PassThrough=wu(),x.pipeline=m;const{addAbortSignal:S}=Tn();return x.addAbortSignal=S,x.finished=g,x.destroy=w,x.compose=l,x.setDefaultHighWaterMark=d,x.getDefaultHighWaterMark=h,e(x,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return y}}),e(m,i,{__proto__:null,enumerable:!0,get(){return y.pipeline}}),e(g,i,{__proto__:null,enumerable:!0,get(){return y.finished}}),x.Stream=x,x._isUint8Array=function(b){return b instanceof Uint8Array},x._uint8ArrayToBuffer=function(b){return r.from(b.buffer,b.byteOffset,b.byteLength)},zn.exports}var uo;function Gc(){return uo||(uo=1,function(r){const e=xu(),t=_u(),n=e.Readable.destroy;r.exports=e.Readable,r.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,r.exports._isUint8Array=e._isUint8Array,r.exports.isDisturbed=e.isDisturbed,r.exports.isErrored=e.isErrored,r.exports.isReadable=e.isReadable,r.exports.Readable=e.Readable,r.exports.Writable=e.Writable,r.exports.Duplex=e.Duplex,r.exports.Transform=e.Transform,r.exports.PassThrough=e.PassThrough,r.exports.addAbortSignal=e.addAbortSignal,r.exports.finished=e.finished,r.exports.destroy=e.destroy,r.exports.destroy=n,r.exports.pipeline=e.pipeline,r.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),r.exports.Stream=e.Stream,r.exports.default=r.exports}(Wn)),Wn.exports}var Su=Gc();const mi=Symbol("iter");function Pr(r,e,t=4){if(t===0)return Object.assign(r,e);for(const n in e)r[n]=Pr(r[n]||Object.create(null),e[n],t-1);return r}function Eu(r,e,t=4){let n=!1;for(const i in r)if(i in e){const s=t===0?null:Eu(r[i],e[i],t-1);if(s!==!1)n=n||Object.create(null),n[i]=s;else if(t===3)return!1}return n}function Iu(r,e,t=4){let n=!1;for(const i in r)if(!(i in e))n=n||Object.create(null),n[i]=t===0?null:Pr({},r[i],t-1);else if(t!==0){const s=Iu(r[i],e[i],t-1);if(s!==!1)n=n||Object.create(null),n[i]=s;else if(t===3)return!1}return n}class Wc{constructor(e={}){this._id=1,this._ids=Object.create(null),this._ids[""]=1,this._entities=Object.create(null),this._entities[1]="",this._blankNodeIndex=0,this._factory=e.factory||Ee}_termFromId(e){if(e[0]==="."){const t=this._entities,n=e.split(".");return this._factory.quad(this._termFromId(t[n[1]]),this._termFromId(t[n[2]]),this._termFromId(t[n[3]]),n[4]&&this._termFromId(t[n[4]]))}return $r(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){const t=this._termToNumericId(e.subject),n=this._termToNumericId(e.predicate),i=this._termToNumericId(e.object);let s;return t&&n&&i&&(Ns(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${t}.${n}.${i}.${s}`:`.${t}.${n}.${i}`]}return this._ids[Yt(e)]}_termToNewNumericId(e){const t=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${Ns(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:Yt(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,n;if(e)for(t=e=`_:${e}`,n=1;this._ids[t];)t=e+n++;else do t=`_:b${this._blankNodeIndex++}`;while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}}class Ue{constructor(e,t){this._size=0,this._graphs=Object.create(null),!t&&e&&!e[0]&&typeof e.match!="function"&&(t=e,e=null),t=t||{},this._factory=t.factory||Ee,this._entityIndex=t.entityIndex||new Wc({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(e!==null)return e;e=0;const t=this._graphs;let n,i;for(const s in t)for(const a in n=t[s].subjects)for(const o in i=n[a])e+=Object.keys(i[o]).length;return this._size=e}_addToIndex(e,t,n,i){const s=e[t]||(e[t]={}),a=s[n]||(s[n]={}),o=i in a;return o||(a[i]=null),!o}_removeFromIndex(e,t,n,i){const s=e[t],a=s[n];delete a[i];for(const o in a)return;delete s[n];for(const o in s)return;delete e[t]}*_findInIndex(e,t,n,i,s,a,o,l){let d,h,m;const w=this._entities,g=this._termFromId(w[l]),y={subject:null,predicate:null,object:null};t&&((d=e,e={})[t]=d[t]);for(const _ in e)if(h=e[_]){y[s]=this._termFromId(w[_]),n&&((d=h,h={})[n]=d[n]);for(const x in h)if(m=h[x]){y[a]=this._termFromId(w[x]);const S=i?i in m?[i]:[]:Object.keys(m);for(let I=0;I<S.length;I++)y[o]=this._termFromId(w[S[I]]),yield this._factory.quad(y.subject,y.predicate,y.object,g)}}}_loop(e,t){for(const n in e)t(n)}_loopByKey0(e,t,n){let i,s;if(i=e[t])for(s in i)n(s)}_loopByKey1(e,t,n){let i,s;for(i in e)s=e[i],s[t]&&n(i)}_loopBy2Keys(e,t,n,i){let s,a,o;if((s=e[t])&&(a=s[n]))for(o in a)i(o)}_countInIndex(e,t,n,i){let s=0,a,o,l;t&&((a=e,e={})[t]=a[t]);for(const d in e)if(o=e[d]){n&&((a=o,o={})[n]=a[n]);for(const h in o)(l=o[h])&&(i?i in l&&s++:s+=Object.keys(l).length)}return s}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){const t=Object.create(null);return n=>{n in t||(t[n]=!0,e(this._termFromId(this._entities[n],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,n,i){t||(i=e.graph,n=e.object,t=e.predicate,e=e.subject),i=i?this._termToNewNumericId(i):1;let s=this._graphs[i];return s||(s=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(s)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),n=this._termToNewNumericId(n),this._addToIndex(s.subjects,e,t,n)?(this._addToIndex(s.predicates,t,n,e),this._addToIndex(s.objects,n,e,t),this._size=null,!0):!1}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}delete(e){return this.removeQuad(e),this}has(e,t,n,i){return e&&e.subject&&({subject:e,predicate:t,object:n,graph:i}=e),!this.readQuads(e,t,n,i).next().done}import(e){return e.on("data",t=>{this.addQuad(t)}),e}removeQuad(e,t,n,i){t||({subject:e,predicate:t,object:n,graph:i}=e),i=i?this._termToNumericId(i):1;const s=this._graphs;let a,o,l;if(!(e=e&&this._termToNumericId(e))||!(t=t&&this._termToNumericId(t))||!(n=n&&this._termToNumericId(n))||!(a=s[i])||!(o=a.subjects[e])||!(l=o[t])||!(n in l))return!1;this._removeFromIndex(a.subjects,e,t,n),this._removeFromIndex(a.predicates,t,n,e),this._removeFromIndex(a.objects,n,e,t),this._size!==null&&this._size--;for(e in a.subjects)return!0;return delete s[i],!0}removeQuads(e){for(let t=0;t<e.length;t++)this.removeQuad(e[t])}remove(e){return e.on("data",t=>{this.removeQuad(t)}),e}removeMatches(e,t,n,i){const s=new Su.Readable({objectMode:!0}),a=this.readQuads(e,t,n,i);return s._read=o=>{for(;--o>=0;){const{done:l,value:d}=a.next();if(l){s.push(null);return}s.push(d)}},this.remove(s)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,n,i){return[...this.readQuads(e,t,n,i)]}*readQuads(e,t,n,i){const s=this._getGraphs(i);let a,o,l,d;if(!(e&&!(o=this._termToNumericId(e))||t&&!(l=this._termToNumericId(t))||n&&!(d=this._termToNumericId(n))))for(const h in s)(a=s[h])&&(o?d?yield*this._findInIndex(a.objects,d,o,l,"object","subject","predicate",h):yield*this._findInIndex(a.subjects,o,l,null,"subject","predicate","object",h):l?yield*this._findInIndex(a.predicates,l,d,null,"predicate","object","subject",h):d?yield*this._findInIndex(a.objects,d,null,null,"object","subject","predicate",h):yield*this._findInIndex(a.subjects,null,null,null,"subject","predicate","object",h))}match(e,t,n,i){return new St(this,e,t,n,i,{entityIndex:this._entityIndex})}countQuads(e,t,n,i){const s=this._getGraphs(i);let a=0,o,l,d,h;if(e&&!(l=this._termToNumericId(e))||t&&!(d=this._termToNumericId(t))||n&&!(h=this._termToNumericId(n)))return 0;for(const m in s)(o=s[m])&&(e?n?a+=this._countInIndex(o.objects,h,l,d):a+=this._countInIndex(o.subjects,l,d,h):t?a+=this._countInIndex(o.predicates,d,h,l):a+=this._countInIndex(o.objects,h,l,d));return a}forEach(e,t,n,i,s){this.some(a=>(e(a,this),!1),t,n,i,s)}every(e,t,n,i,s){return!this.some(a=>!e(a,this),t,n,i,s)}some(e,t,n,i,s){for(const a of this.readQuads(t,n,i,s))if(e(a,this))return!0;return!1}getSubjects(e,t,n){const i=[];return this.forSubjects(s=>{i.push(s)},e,t,n),i}forSubjects(e,t,n,i){const s=this._getGraphs(i);let a,o,l;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n))))for(i in s)(a=s[i])&&(o?l?this._loopBy2Keys(a.predicates,o,l,e):this._loopByKey1(a.subjects,o,e):l?this._loopByKey0(a.objects,l,e):this._loop(a.subjects,e))}getPredicates(e,t,n){const i=[];return this.forPredicates(s=>{i.push(s)},e,t,n),i}forPredicates(e,t,n,i){const s=this._getGraphs(i);let a,o,l;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n))))for(i in s)(a=s[i])&&(o?l?this._loopBy2Keys(a.objects,l,o,e):this._loopByKey0(a.subjects,o,e):l?this._loopByKey1(a.predicates,l,e):this._loop(a.predicates,e))}getObjects(e,t,n){const i=[];return this.forObjects(s=>{i.push(s)},e,t,n),i}forObjects(e,t,n,i){const s=this._getGraphs(i);let a,o,l;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n))))for(i in s)(a=s[i])&&(o?l?this._loopBy2Keys(a.subjects,o,l,e):this._loopByKey1(a.objects,o,e):l?this._loopByKey0(a.predicates,l,e):this._loop(a.objects,e))}getGraphs(e,t,n){const i=[];return this.forGraphs(s=>{i.push(s)},e,t,n),i}forGraphs(e,t,n,i){for(const s in this._graphs)this.some(a=>(e(a.graph),!0),t,n,i,this._termFromId(this._entities[s]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const n={},i=t?()=>!0:(o,l)=>{throw new Error(`${o.value} ${l}`)},s=this.getQuads(null,Pe.rdf.rest,Pe.rdf.nil,null),a=e?[...s]:[];return s.forEach(o=>{const l=[];let d=!1,h,m;const w=o.graph;let g=o.subject;for(;g&&!d;){const y=this.getQuads(null,null,g,null),_=this.getQuads(g,null,null,null);let x,S=null,I=null,b=null;for(let c=0;c<_.length&&!d;c++)x=_[c],x.graph.equals(w)?h?d=i(g,"has non-list arcs out"):x.predicate.value===Pe.rdf.first?S?d=i(g,"has multiple rdf:first arcs"):a.push(S=x):x.predicate.value===Pe.rdf.rest?I?d=i(g,"has multiple rdf:rest arcs"):a.push(I=x):y.length?d=i(g,"can't be subject and object"):(h=x,m="subject"):d=i(g,"not confined to single graph");for(let c=0;c<y.length&&!d;++c)x=y[c],h?d=i(g,"can't have coreferences"):x.predicate.value===Pe.rdf.rest?b?d=i(g,"has incoming rdf:rest arcs"):b=x:(h=x,m="object");S?l.unshift(S.object):d=i(g,"has no list head"),g=b&&b.subject}d?e=!1:h&&(n[h[m].value]=l)}),e&&this.removeQuads(a),n}addAll(e){if(e instanceof St&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof Ue&&e._entityIndex===this._entityIndex)e._size!==0&&(this._graphs=Pr(this._graphs,e._graphs),this._size=null);else for(const t of e)this.add(t);return this}contains(e){if(e instanceof St&&(e=e.filtered),e===this)return!0;if(!(e instanceof Ue)||this._entityIndex!==e._entityIndex)return e.every(d=>this.has(d));const t=this._graphs,n=e._graphs;let i,s,a,o,l;for(const d in n){if(!(i=t[d]))return!1;i=i.subjects;for(const h in s=n[d].subjects){if(!(a=i[h]))return!1;for(const m in o=s[h]){if(!(l=a[m]))return!1;for(const w in o[m])if(!(w in l))return!1}}}return!0}deleteMatches(e,t,n,i){for(const s of this.match(e,t,n,i))this.removeQuad(s);return this}difference(e){if(e&&e instanceof St&&(e=e.filtered),e===this)return new Ue({entityIndex:this._entityIndex});if(e instanceof Ue&&e._entityIndex===this._entityIndex){const t=new Ue({entityIndex:this._entityIndex}),n=Iu(this._graphs,e._graphs);return n&&(t._graphs=n,t._size=null),t}return this.filter(t=>!e.has(t))}equals(e){return e instanceof St&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new Ue({entityIndex:this._entityIndex});for(const n of this)e(n,this)&&t.add(n);return t}intersection(e){if(e instanceof St&&(e=e.filtered),e===this){const t=new Ue({entityIndex:this._entityIndex});return t._graphs=Pr(Object.create(null),this._graphs),t._size=this._size,t}else if(e instanceof Ue&&this._entityIndex===e._entityIndex){const t=new Ue({entityIndex:this._entityIndex}),n=Eu(e._graphs,this._graphs);return n&&(t._graphs=n,t._size=null),t}return this.filter(t=>e.has(t))}map(e){const t=new Ue({entityIndex:this._entityIndex});for(const n of this)t.add(e(n,this));return t}reduce(e,t){const n=this.readQuads();let i=t===void 0?n.next().value:t;for(const s of n)i=e(i,s,this);return i}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new Bs().quadsToString(this)}union(e){const t=new Ue({entityIndex:this._entityIndex});return t._graphs=Pr(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function ot(r,e,t=0){const n=e[t];if(n&&!(n in r))return!1;let i=!1;for(const s in n?{[n]:r[n]}:r){const a=t===2?null:ot(r[s],e,t+1);a!==!1&&(i=i||Object.create(null),i[s]=a)}return i}class St extends Su.Readable{constructor(e,t,n,i,s,a){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:n,object:i,graph:s,options:a})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:n,predicate:i,subject:s}=this,a=this._filtered=new Ue({factory:e._factory,entityIndex:this.options.entityIndex});let o,l,d;if(s&&!(o=a._termToNumericId(s))||i&&!(l=a._termToNumericId(i))||n&&!(d=a._termToNumericId(n)))return a;const h=e._getGraphs(t);for(const m in h){let w,g,y,_;(_=h[m])&&(!o&&l?(g=ot(_.predicates,[l,d,o]))&&(w=ot(_.subjects,[o,l,d]),y=ot(_.objects,[d,o,l])):d?(y=ot(_.objects,[d,o,l]))&&(w=ot(_.subjects,[o,l,d]),g=ot(_.predicates,[l,d,o])):(w=ot(_.subjects,[o,l,d]))&&(g=ot(_.predicates,[l,d,o]),y=ot(_.objects,[d,o,l])),w&&(a._graphs[m]={subjects:w,predicates:g,objects:y}))}a._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[mi]&&(this[mi]=this[Symbol.iterator]());const t=this[mi];for(;--e>=0;){const{done:n,value:i}=t.next();if(n){this.push(null);return}this.push(i)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,t,n,i){return this.filtered.deleteMatches(e,t,n,i)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,n,i,s){return this.filtered.every(e,t,n,i,s)}filter(e){return this.filtered.filter(e)}forEach(e,t,n,i,s){return this.filtered.forEach(e,t,n,i,s)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,n,i,s){return this.filtered.some(e,t,n,i,s)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return new Bs().quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,n,i){return new St(this.filtered,e,t,n,i,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}const be="http://www.w3.org/ns/shacl#",co="http://datashapes.org/dash#",Ct="http://www.w3.org/2001/XMLSchema#",Vs="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Gs="http://www.w3.org/2000/01/rdf-schema#",zc="http://www.w3.org/2004/02/skos/core#",Jc="http://www.w3.org/2002/07/owl#",Qc="http://www.w3.org/ns/oa#",Xc="http://purl.org/dc/terms/",Kc="http://xmlns.com/foaf/0.1/",bn=Ee.namedNode("loaded-shapes"),lt=Ee.namedNode("loaded-data"),qe=Ee.namedNode(Vs+"type"),Ts=Ee.namedNode(Xc+"conformsTo"),Yc=Ee.namedNode(Gs+"subClassOf"),Ws=Ee.namedNode(Jc+"imports"),on=Ee.namedNode(be+"NodeShape"),Zc=Ee.namedNode(be+"IRI"),wn=Ee.namedNode(be+"property"),zs=Ee.namedNode(be+"class"),Vr=Ee.namedNode(be+"targetClass"),ed=Ee.namedNode(be+"nodeKind");function qr(r,e,t=be,n){let i="";const s=td(r,e,t,n);return s&&(i=s.value),i}function td(r,e,t=be,n){let i;const s=t+e;if(n?.length){for(const a of n)for(const o of r)if(o.predicate.value===s){if(o.object.id.endsWith(`@${a}`))return o.object;o.object.id.indexOf("@")<0?i=o.object:i||(i=o.object)}}else for(const a of r)if(a.predicate.value===s)return a.object;return i}function rd(r){r.querySelector("input,select,textarea")?.focus()}function jn(r,e){return qr(r,"prefLabel",zc,e)||qr(r,"label",Gs,e)||qr(r,"name",Kc,e)}function Ru(r,e,t){const n=[];for(const i of r)n.push({value:i,label:jn(e.getQuads(i,null,null,null),t),children:[]});return n}function As(r,e){for(const t in e)r=r.replace(e[t],"");return r}function Nu(r,e,t,n,i=new Set){for(const s of e.owlImports)i.has(s.id)||(i.add(s.id),n.push(...t.getSubjects(qe,r,s)));e.parent&&Nu(r,e.parent,t,n,i)}function Js(r,e){let t;if(e.shaclIn){const i=e.config.lists[e.shaclIn];t=i?.length?i:[]}else t=e.config.store.getSubjects(qe,r,bn),t.push(...e.config.store.getSubjects(qe,r,lt)),Nu(r,e,e.config.store,t);const n=Ru(t,e.config.store,e.config.languages);if(e.shaclIn===void 0)for(const i of e.config.store.getSubjects(Yc,r,null)){const s=Js(i,e);for(const a of s){let o=!1;for(const l of n)e.config.store.countQuads(a.value,qe,l.value,null)>0&&(l.children.push(a),o=!0);o||n.push(a)}}return n}function Ls(r){let e;try{e=new URL(r)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function fo(r,e,t){if(e===void 0)return t;if(t===void 0)return e;const n=r.indexOf(e.language);if(n<0)return t;const i=r.indexOf(t.language);return i<0||i>n?e:t}function Tu(r,e,t){const n=document.createElement("div");n.classList.add("shacl-or-constraint");const i=[];if(i.push({label:"--- please choose ---",value:""}),e instanceof Rt){const s=[];let a=!1;r.length&&(a=t.store.countQuads(r[0],wn,null,null)>0);for(let d=0;d<r.length;d++)if(a){const h=t.store.getObjects(r[d],wn,null),m=[];let w="";for(const g of h){const y=new xn(g,e,t);m.push(y),w+=(w.length>1?" / ":"")+y.template.label}s.push(m),i.push({label:w,value:d.toString()})}else{const h=new xn(r[d],e,t);s.push([h]),i.push({label:h.template.label,value:d.toString()})}const o=t.theme.createListEditor("Please choose",null,!1,i),l=o.querySelector(".editor");l.onchange=()=>{if(l.value){const d=s[parseInt(l.value)];let h;d.length&&(h=d[0],n.replaceWith(d[0]));for(let m=1;m<d.length;m++)h.after(d[m]),h=d[m]}},n.appendChild(o)}else{const s=[];for(let l=0;l<r.length;l++){const d=t.store.getQuads(r[l],null,null,null);d.length&&(s.push(d),i.push({label:jn(d,t.languages)||As(d[0].predicate.value,t.prefixes)+" = "+As(d[0].object.value,t.prefixes),value:l.toString()}))}const a=t.theme.createListEditor(e.template.label+"?",null,!1,i,e.template),o=a.querySelector(".editor");o.onchange=()=>{o.value&&n.replaceWith(pn(e.template.clone().merge(s[parseInt(o.value)]),void 0,!0))},n.appendChild(a)}return n}function nd(r,e,t){if(e instanceof it){const n=e.datatype;for(const i of r){const s=t.store.getQuads(i,null,null,null);for(const a of s)if(a.predicate.value===`${be}datatype`&&a.object.equals(n))return s}}else{const n=t.store.getObjects(e,qe,null);for(const i of r){const s=t.store.getQuads(i,null,null,null);for(const a of s)if(n.length>0){if(a.predicate.value===`${be}node`){for(const o of n)if(t.store.getQuads(a.object,Vr,o,null).length>0)return s}if(a.predicate.equals(zs)){for(const o of n)if(a.object.equals(o))return s}}else if(a.predicate.equals(ed)&&a.object.equals(Zc))return s}}return console.error("couldn't resolve sh:or/sh:xone on property for value",e),[]}function id(r,e,t){for(const n of r){let i=!1;const s=t.store.getObjects(n,wn,null);for(const a of s){const o=t.store.getObjects(a,`${be}path`,null);for(const l of o)if(i=t.store.countQuads(e,l,null,null)>0,i)break}if(i)return s}return console.error("couldn't resolve sh:or/sh:xone on node for value",e),[]}const sd={[`${be}name`]:(r,e)=>{const t=e;r.name=fo(r.config.languages,r.name,t)},[`${be}description`]:(r,e)=>{const t=e;r.description=fo(r.config.languages,r.description,t)},[`${be}path`]:(r,e)=>{r.path=e.value},[`${be}node`]:(r,e)=>{r.node=e},[`${be}datatype`]:(r,e)=>{r.datatype=e},[`${be}nodeKind`]:(r,e)=>{r.nodeKind=e},[`${be}minCount`]:(r,e)=>{r.minCount=parseInt(e.value)},[`${be}maxCount`]:(r,e)=>{r.maxCount=parseInt(e.value)},[`${be}minLength`]:(r,e)=>{r.minLength=parseInt(e.value)},[`${be}maxLength`]:(r,e)=>{r.maxLength=parseInt(e.value)},[`${be}minInclusive`]:(r,e)=>{r.minInclusive=parseInt(e.value)},[`${be}maxInclusive`]:(r,e)=>{r.maxInclusive=parseInt(e.value)},[`${be}minExclusive`]:(r,e)=>{r.minExclusive=parseInt(e.value)},[`${be}maxExclusive`]:(r,e)=>{r.maxExclusive=parseInt(e.value)},[`${be}pattern`]:(r,e)=>{r.pattern=e.value},[`${be}order`]:(r,e)=>{r.order=parseInt(e.value)},[`${co}singleLine`]:(r,e)=>{r.singleLine=e.value==="true"},[`${co}readonly`]:(r,e)=>{r.readonly=e.value==="true"},[`${Qc}styleClass`]:(r,e)=>{r.cssClass=e.value},[`${be}and`]:(r,e)=>{r.shaclAnd=e.value},[`${be}in`]:(r,e)=>{r.shaclIn=e.value},[`${be}languageIn`]:(r,e)=>{r.languageIn=r.config.lists[e.value],r.datatype=Ee.namedNode(Vs+"langString")},[`${be}defaultValue`]:(r,e)=>{r.defaultValue=e},[`${be}hasValue`]:(r,e)=>{r.hasValue=e},[`${be}qualifiedValueShape`]:(r,e)=>{r.qualifiedValueShape=e},[`${be}qualifiedMinCount`]:(r,e)=>{r.minCount=parseInt(e.value)},[`${be}qualifiedMaxCount`]:(r,e)=>{r.maxCount=parseInt(e.value)},[Ws.id]:(r,e)=>{r.owlImports.push(e)},[zs.id]:(r,e)=>{r.class=e;const t=r.config.store.getSubjects(Vr,e,null);t.length>0&&(r.node=t[0])},[`${be}or`]:(r,e)=>{const t=r.config.lists[e.value];t?.length?r.shaclOr=t:console.error("list for sh:or not found:",e.value,"existing lists:",r.config.lists)},[`${be}xone`]:(r,e)=>{const t=r.config.lists[e.value];t?.length?r.shaclXone=t:console.error("list for sh:xone not found:",e.value,"existing lists:",r.config.lists)}};class ad{constructor(e,t,n){this.label="",this.owlImports=[],this.extendedShapes=[],this.parent=t,this.config=n,this.merge(e),this.qualifiedValueShape&&this.merge(n.store.getQuads(this.qualifiedValueShape,null,null,null))}merge(e){for(const t of e)sd[t.predicate.id]?.call(this,this,t.object);if(this.label=this.name?.value||jn(e,this.config.languages),!this.label&&!this.shaclAnd&&(this.label=this.path?As(this.path,this.config.prefixes):"unknown"),(this.node||this.shaclAnd)&&(this.node&&this.extendedShapes.push(this.node),this.shaclAnd)){const t=this.config.lists[this.shaclAnd];if(t?.length)for(const n of t)this.extendedShapes.push(n)}return this}clone(){const e=Object.assign({},this);return e.owlImports=[...this.owlImports],this.languageIn&&(e.languageIn=[...this.languageIn]),this.shaclOr&&(e.shaclOr=[...this.shaclOr]),this.shaclXone&&(e.shaclXone=[...this.shaclXone]),e.merge=this.merge.bind(e),e.clone=this.clone.bind(e),e}}const od=`form { box-sizing: border-box; display:block; --label-width: 8em; --caret-size: 10px; }
28
+ form.mode-edit { padding-left: 1em; }
29
+ form *, form ::after, form ::before { box-sizing: inherit; }
30
+ shacl-node, .shacl-group { display: flex; flex-direction: column; width: 100%; position: relative; }
31
+ shacl-node .remove-button { margin-left: 4px; margin-top: 1px; }
32
+ shacl-node .add-button { color: #555; background-color: transparent; margin: 4px 24px 0 0; border: 0; }
33
+ shacl-node .add-button:hover { color:#222; }
34
+ shacl-node .add-button:focus { box-shadow: none; }
35
+ shacl-node h1 { font-size: 1.1rem; border-bottom: 1px solid; margin-top: 4px; color: #555; }
36
+ shacl-property { display: flex; flex-direction: column; align-items: end; position: relative; }
37
+ shacl-property:not(.may-add) > .add-button { display: none; }
38
+ shacl-property:not(.may-remove) > .property-instance > .remove-button:not(.persistent) { visibility: hidden; }
39
+ shacl-property:not(.may-remove) > .shacl-or-constraint > .remove-button:not(.persistent) { visibility: hidden; }
40
+ .mode-view .shacl-group:not(:has(shacl-property)) { display: none; }
41
+ .property-instance, .shacl-or-constraint { display: flex; align-items: flex-start; padding: 4px 0; width: 100%; position: relative; }
42
+ .shacl-or-constraint label { display: inline-block; word-break: break-word; width: var(--label-width); line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; }
43
+ .property-instance label[title] { cursor: help; text-decoration: underline dashed #AAA; }
44
+ .property-instance.linked label:after, label.linked:after { content: '\\1F517'; font-size: 0.6em; padding-left: 6px; }
45
+ .mode-edit .property-instance label.required::before { color: red; content: '\\2736'; font-size: 0.6rem; position: absolute; left: -1.4em; top: 0.15rem; }
46
+ .property-instance.valid::before { position: absolute; left: calc(var(--label-width) - 1em); top: 3px; color: green; content: '\\2713'; }
47
+ .editor:not([type='checkbox']), .shacl-or-constraint select { flex-grow: 1; }
48
+ .shacl-or-constraint select { border: 1px solid #DDD; padding: 2px 4px; }
49
+ select { overflow: hidden; text-overflow: ellipsis; }
50
+ textarea.editor { resize: vertical; }
51
+ .lang-chooser { position: absolute; top: 6px; right: 26px; border: 0; background-color: #e9e9ed; padding: 2px 4px; max-width: 40px; width: 40px; box-sizing: content-box; }
52
+ .lang-chooser+.editor { padding-right: 55px; }
53
+ .validation-error { position: absolute; left: calc(var(--label-width) - 1em); top: 3px; color: red; cursor: help; }
54
+ .validation-error::before { content: '\\26a0' }
55
+ .validation-error.node { left: -1em; }
56
+ .invalid > .editor { border-color: red !important; }
57
+ .ml-0 { margin-left: 0 !important; }
58
+ .pr-0 { padding-right: 0 !important; }
59
+ .mode-view .property-instance:not(:first-child) > label { visibility: hidden; }
60
+ .mode-view .property-instance label { width: var(--label-width); }
61
+
62
+ .d-flex { display: flex; }
63
+ .lang { opacity: 0.65; font-size: 0.6em; }
64
+ a, a:visited { color: inherit; }
65
+
66
+ .fadeIn, .fadeOut { animation: fadeIn 0.2s ease-out; }
67
+ .fadeOut { animation-direction: reverse; animation-timing-function: ease-out;}
68
+ @keyframes fadeIn {
69
+ 0% { opacity: 0; transform: scaleY(0.8); }
70
+ 100% { opacity: 1; transform: scaleY(1); }
71
+ }
72
+
73
+ .collapsible > .activator { display: flex; justify-content: space-between; align-items: center; cursor: pointer; width: 100%; border: 0; padding: 8px 0; transition: 0.2s; }
74
+ .collapsible > .activator:hover, .collapsible.open > .activator { background-color: #F5F5F5; }
75
+ .collapsible > .activator::after { content:''; width: var(--caret-size); height: var(--caret-size); border-style: none solid solid none; border-width: calc(0.3 * var(--caret-size)); transform: rotate(45deg); transition: transform .15s ease-out; margin-right: calc(0.5 * var(--caret-size)); }
76
+ .collapsible.open > .activator::after { transform: rotate(225deg); }
77
+ .collapsible > *:not(.activator) { transition: all 0.2s ease-out; opacity: 1; }
78
+ .collapsible:not(.open) > *:not(.activator) { max-height: 0; padding: 0; opacity: 0; overflow: hidden; }
79
+ .collapsible > .property-instance > shacl-node > h1 { display: none; }
80
+ .collapsible.open > .property-instance:nth-child(odd) { background-color: #F5F5F5; }
81
+ .ref-link { cursor: pointer; }
82
+ .ref-link:hover { text-decoration: underline; }
83
+ .node-id-display { color: #999; font-size: 11px; }`;class ld{constructor(e){let t=od;e&&(t+=`
84
+ `+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t)}apply(e){}createViewer(e,t,n){const i=document.createElement("div"),s=document.createElement("label");s.innerHTML=e+":",n.description&&s.setAttribute("title",n.description.value),i.appendChild(s);let a=t.value,o=null;if(t instanceof In){const d=n.config.store.getQuads(a,null,null,null);if(d.length){const h=jn(d,n.config.languages);h&&(a=h)}}else t instanceof it&&(t.language?(o=document.createElement("span"),o.classList.add("lang"),o.innerText=`@${t.language}`):t.datatype.value===`${Ct}date`?a=new Date(Date.parse(t.value)).toDateString():t.datatype.value===`${Ct}dateTime`&&(a=new Date(Date.parse(t.value)).toLocaleString()));let l;return Ls(t.value)?(l=document.createElement("a"),l.setAttribute("href",t.value)):l=document.createElement("div"),l.classList.add("d-flex"),l.innerText=a,o&&l.appendChild(o),i.appendChild(l),i}}function ud(r,e,t){if(t){const n=r.minCount!==void 0&&r.minCount>0;if(r.class)return r.config.theme.createListEditor(r.label,e,n,Js(r.class,r),r);if(r.shaclIn){const i=r.config.lists[r.shaclIn];if(i?.length){const s=Ru(i,r.config.store,r.config.languages);return r.config.theme.createListEditor(r.label,e,n,s,r)}else console.error("list not found:",r.shaclIn,"existing lists:",r.config.lists)}if(r.datatype?.value===`${Vs}langString`||r.languageIn?.length)return r.config.theme.createLangStringEditor(r.label,e,n,r);switch(r.datatype?.value.replace(Ct,"")){case"integer":case"float":case"double":case"decimal":return r.config.theme.createNumberEditor(r.label,e,n,r);case"date":case"dateTime":return r.config.theme.createDateEditor(r.label,e,n,r);case"boolean":return r.config.theme.createBooleanEditor(r.label,e,n,r);case"base64Binary":return r.config.theme.createFileEditor(r.label,e,n,r)}return r.config.theme.createTextEditor(r.label,e,n,r)}else{if(e)return r.config.theme.createViewer(r.label,e,r);const n=document.createElement("div");return n.innerHTML="No value",n}}function cd(r,e,t){if(e==="application/ld+json")return dd(r);{const n=new Bs({format:e,prefixes:t});n.addQuads(r);let i="";return n.end((s,a)=>{s&&console.error(s),i=a}),i}}function dd(r){const e=[];for(const t of r){const n={"@id":t.subject.id};if(t.predicate===qe)n["@type"]=t.object.id;else{let i=t.object.value;t.object instanceof it?t.object.language?i={"@language":t.object.language,"@value":t.object.value}:t.object.datatype&&t.object.datatype.value!==`${Ct}#string`&&(i={"@type":t.object.datatype.value,"@value":t.object.value}):i={"@id":t.object.id},n[t.predicate.value]=i}e.push(n)}return JSON.stringify(e)}function fd(r){let e=r.shaclDatatype,t=r.value;if(t){if(r.dataset.class||r.dataset.nodeKind===be+"IRI")return Ee.namedNode(t);if(r.dataset.link)return JSON.parse(r.dataset.link);if(r.dataset.lang?e=r.dataset.lang:r.type==="number"?t=parseFloat(t):r.type==="file"&&r.binaryData?t=r.binaryData:r.type==="datetime-local"&&(t=new Date(t).toISOString().slice(0,19)),!e&&typeof t=="string"){const n=t.split("^^");n.length===2&&(n[0].startsWith('"')&&n[0].endsWith('"')||n[0].startsWith("'")&&n[0].endsWith("'"))&&n[1].split(":").length===2&&(t=n[0].substring(1,n[0].length-1),e=Ee.namedNode(n[1]))}return Ee.literal(t,e)}else if((r.type==="checkbox"||r.getAttribute("type")==="checkbox")&&(r.checked||parseInt(r.dataset.minCount||"0")>0))return Ee.literal(r.checked?"true":"false",e)}const Br={};function hd(r){r.predicate===void 0&&r.datatype===void 0?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',r):Br[`${r.predicate}^${r.datatype}`]=r}function pd(){return Object.entries(Br).map(r=>r[1])}function gd(r,e){let t=Br[`${r}^${e}`];return t||(t=Br[`${r}^undefined`],t)?t:Br[`undefined^${e}`]}class yy{constructor(e,t){this.predicate=e.predicate,this.datatype=e.datatype,t&&(this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t))}createViewer(e,t){return e.config.theme.createViewer(e.label,t,e)}}/**
85
+ * @license
86
+ * Copyright 2019 Google LLC
87
+ * SPDX-License-Identifier: BSD-3-Clause
88
+ */const dn=globalThis,Qs=dn.ShadowRoot&&(dn.ShadyCSS===void 0||dn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Xs=Symbol(),ho=new WeakMap;let Au=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Xs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Qs&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=ho.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ho.set(t,e))}return e}toString(){return this.cssText}};const yd=r=>new Au(typeof r=="string"?r:r+"",void 0,Xs),vt=(r,...e)=>{const t=r.length===1?r[0]:e.reduce((n,i,s)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[s+1],r[0]);return new Au(t,r,Xs)},md=(r,e)=>{if(Qs)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const n=document.createElement("style"),i=dn.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)}},po=Qs?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return yd(t)})(r):r;/**
89
+ * @license
90
+ * Copyright 2017 Google LLC
91
+ * SPDX-License-Identifier: BSD-3-Clause
92
+ */const{is:bd,defineProperty:wd,getOwnPropertyDescriptor:vd,getOwnPropertyNames:_d,getOwnPropertySymbols:xd,getPrototypeOf:Sd}=Object,On=globalThis,go=On.trustedTypes,Ed=go?go.emptyScript:"",Id=On.reactiveElementPolyfillSupport,Fr=(r,e)=>r,js={toAttribute(r,e){switch(e){case Boolean:r=r?Ed:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Lu=(r,e)=>!bd(r,e),yo={attribute:!0,type:String,converter:js,reflect:!1,useDefault:!1,hasChanged:Lu};Symbol.metadata??=Symbol("metadata"),On.litPropertyMetadata??=new WeakMap;let Jt=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=yo){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&wd(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){const{get:i,set:s}=vd(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){const o=i?.call(this);s?.call(this,a),this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??yo}static _$Ei(){if(this.hasOwnProperty(Fr("elementProperties")))return;const e=Sd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Fr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Fr("properties"))){const t=this.properties,n=[..._d(t),...xd(t)];for(const i of n)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(po(i))}else e!==void 0&&t.push(po(e));return t}static _$Eu(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return md(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const s=(n.converter?.toAttribute!==void 0?n.converter:js).toAttribute(t,n.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,t){const n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const s=n.getPropertyOptions(i),a=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:js;this._$Em=i;const o=a.fromAttribute(t,s.type);this[i]=o??this._$Ej?.get(i)??o,this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){const i=this.constructor,s=this[e];if(n??=i.getPropertyOptions(e),!((n.hasChanged??Lu)(s,t)||n.useDefault&&n.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:i,wrapped:s},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),s!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[i,s]of n){const{wrapped:a}=s,o=this[i];a!==!0||this._$AL.has(i)||o===void 0||this.C(i,void 0,s,o)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};Jt.elementStyles=[],Jt.shadowRootOptions={mode:"open"},Jt[Fr("elementProperties")]=new Map,Jt[Fr("finalized")]=new Map,Id?.({ReactiveElement:Jt}),(On.reactiveElementVersions??=[]).push("2.1.1");/**
93
+ * @license
94
+ * Copyright 2017 Google LLC
95
+ * SPDX-License-Identifier: BSD-3-Clause
96
+ */const Ks=globalThis,vn=Ks.trustedTypes,mo=vn?vn.createPolicy("lit-html",{createHTML:r=>r}):void 0,ju="$lit$",Et=`lit$${Math.random().toFixed(9).slice(2)}$`,Ou="?"+Et,Rd=`<${Ou}>`,qt=document,Gr=()=>qt.createComment(""),Wr=r=>r===null||typeof r!="object"&&typeof r!="function",Ys=Array.isArray,Nd=r=>Ys(r)||typeof r?.[Symbol.iterator]=="function",bi=`[
97
+ \f\r]`,br=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,bo=/-->/g,wo=/>/g,jt=RegExp(`>|${bi}(?:([^\\s"'>=/]+)(${bi}*=${bi}*(?:[^
98
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),vo=/'/g,_o=/"/g,$u=/^(?:script|style|textarea|title)$/i,Td=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),ut=Td(1),Zt=Symbol.for("lit-noChange"),ke=Symbol.for("lit-nothing"),xo=new WeakMap,Mt=qt.createTreeWalker(qt,129);function ku(r,e){if(!Ys(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return mo!==void 0?mo.createHTML(e):e}const Ad=(r,e)=>{const t=r.length-1,n=[];let i,s=e===2?"<svg>":e===3?"<math>":"",a=br;for(let o=0;o<t;o++){const l=r[o];let d,h,m=-1,w=0;for(;w<l.length&&(a.lastIndex=w,h=a.exec(l),h!==null);)w=a.lastIndex,a===br?h[1]==="!--"?a=bo:h[1]!==void 0?a=wo:h[2]!==void 0?($u.test(h[2])&&(i=RegExp("</"+h[2],"g")),a=jt):h[3]!==void 0&&(a=jt):a===jt?h[0]===">"?(a=i??br,m=-1):h[1]===void 0?m=-2:(m=a.lastIndex-h[2].length,d=h[1],a=h[3]===void 0?jt:h[3]==='"'?_o:vo):a===_o||a===vo?a=jt:a===bo||a===wo?a=br:(a=jt,i=void 0);const g=a===jt&&r[o+1].startsWith("/>")?" ":"";s+=a===br?l+Rd:m>=0?(n.push(d),l.slice(0,m)+ju+l.slice(m)+Et+g):l+Et+(m===-2?o:g)}return[ku(r,s+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};let Os=class Du{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let s=0,a=0;const o=e.length-1,l=this.parts,[d,h]=Ad(e,t);if(this.el=Du.createElement(d,n),Mt.currentNode=this.el.content,t===2||t===3){const m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(i=Mt.nextNode())!==null&&l.length<o;){if(i.nodeType===1){if(i.hasAttributes())for(const m of i.getAttributeNames())if(m.endsWith(ju)){const w=h[a++],g=i.getAttribute(m).split(Et),y=/([.?@])?(.*)/.exec(w);l.push({type:1,index:s,name:y[2],strings:g,ctor:y[1]==="."?jd:y[1]==="?"?Od:y[1]==="@"?$d:$n}),i.removeAttribute(m)}else m.startsWith(Et)&&(l.push({type:6,index:s}),i.removeAttribute(m));if($u.test(i.tagName)){const m=i.textContent.split(Et),w=m.length-1;if(w>0){i.textContent=vn?vn.emptyScript:"";for(let g=0;g<w;g++)i.append(m[g],Gr()),Mt.nextNode(),l.push({type:2,index:++s});i.append(m[w],Gr())}}}else if(i.nodeType===8)if(i.data===Ou)l.push({type:2,index:s});else{let m=-1;for(;(m=i.data.indexOf(Et,m+1))!==-1;)l.push({type:7,index:s}),m+=Et.length-1}s++}}static createElement(e,t){const n=qt.createElement("template");return n.innerHTML=e,n}};function er(r,e,t=r,n){if(e===Zt)return e;let i=n!==void 0?t._$Co?.[n]:t._$Cl;const s=Wr(e)?void 0:e._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(r),i._$AT(r,t,n)),n!==void 0?(t._$Co??=[])[n]=i:t._$Cl=i),i!==void 0&&(e=er(r,i._$AS(r,e.values),i,n)),e}let Ld=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,i=(e?.creationScope??qt).importNode(t,!0);Mt.currentNode=i;let s=Mt.nextNode(),a=0,o=0,l=n[0];for(;l!==void 0;){if(a===l.index){let d;l.type===2?d=new Zs(s,s.nextSibling,this,e):l.type===1?d=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(d=new kd(s,this,e)),this._$AV.push(d),l=n[++o]}a!==l?.index&&(s=Mt.nextNode(),a++)}return Mt.currentNode=qt,i}p(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},Zs=class Mu{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=ke,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=er(this,e,t),Wr(e)?e===ke||e==null||e===""?(this._$AH!==ke&&this._$AR(),this._$AH=ke):e!==this._$AH&&e!==Zt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Nd(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==ke&&Wr(this._$AH)?this._$AA.nextSibling.data=e:this.T(qt.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Os.createElement(ku(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(t);else{const s=new Ld(i,this),a=s.u(this.options);s.p(t),this.T(a),this._$AH=s}}_$AC(e){let t=xo.get(e.strings);return t===void 0&&xo.set(e.strings,t=new Os(e)),t}k(e){Ys(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const s of e)i===t.length?t.push(n=new Mu(this.O(Gr()),this.O(Gr()),this,this.options)):n=t[i],n._$AI(s),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const n=e.nextSibling;e.remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},$n=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,s){this.type=1,this._$AH=ke,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=ke}_$AI(e,t=this,n,i){const s=this.strings;let a=!1;if(s===void 0)e=er(this,e,t,0),a=!Wr(e)||e!==this._$AH&&e!==Zt,a&&(this._$AH=e);else{const o=e;let l,d;for(e=s[0],l=0;l<s.length-1;l++)d=er(this,o[n+l],t,l),d===Zt&&(d=this._$AH[l]),a||=!Wr(d)||d!==this._$AH[l],d===ke?e=ke:e!==ke&&(e+=(d??"")+s[l+1]),this._$AH[l]=d}a&&!i&&this.j(e)}j(e){e===ke?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},jd=class extends $n{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ke?void 0:e}},Od=class extends $n{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ke)}},$d=class extends $n{constructor(e,t,n,i,s){super(e,t,n,i,s),this.type=5}_$AI(e,t=this){if((e=er(this,e,t,0)??ke)===Zt)return;const n=this._$AH,i=e===ke&&n!==ke||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==ke&&(n===ke||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},kd=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){er(this,e)}};const Dd=Ks.litHtmlPolyfillSupport;Dd?.(Os,Zs),(Ks.litHtmlVersions??=[]).push("3.3.1");const Md=(r,e,t)=>{const n=t?.renderBefore??e;let i=n._$litPart$;if(i===void 0){const s=t?.renderBefore??null;n._$litPart$=i=new Zs(e.insertBefore(Gr(),s),s,void 0,t??{})}return i._$AI(r),i};/**
99
+ * @license
100
+ * Copyright 2017 Google LLC
101
+ * SPDX-License-Identifier: BSD-3-Clause
102
+ */const ea=globalThis;class Pt extends Jt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Md(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Zt}}Pt._$litElement$=!0,Pt.finalized=!0,ea.litElementHydrateSupport?.({LitElement:Pt});const Cd=ea.litElementPolyfillSupport;Cd?.({LitElement:Pt});(ea.litElementVersions??=[]).push("4.2.1");var Cu=r=>{throw TypeError(r)},Pu=(r,e,t)=>e.has(r)||Cu("Cannot "+t),xt=(r,e,t)=>(Pu(r,e,"read from private field"),t?t.call(r):e.get(r)),Pd=(r,e,t)=>e.has(r)?Cu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),qd=(r,e,t,n)=>(Pu(r,e,"write to private field"),e.set(r,t),t);const Ht=r=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(r,e)}):customElements.define(r,e)},fn=globalThis,ta=fn.ShadowRoot&&(fn.ShadyCSS===void 0||fn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,qu=Symbol(),So=new WeakMap;let Bd=class{constructor(r,e,t){if(this._$cssResult$=!0,t!==qu)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=e}get styleSheet(){let r=this.o;const e=this.t;if(ta&&r===void 0){const t=e!==void 0&&e.length===1;t&&(r=So.get(e)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),t&&So.set(e,r))}return r}toString(){return this.cssText}};const Fd=r=>new Bd(typeof r=="string"?r:r+"",void 0,qu),Ud=(r,e)=>{if(ta)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const n=document.createElement("style"),i=fn.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)}},Eo=ta?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return Fd(t)})(r):r,{is:Hd,defineProperty:Vd,getOwnPropertyDescriptor:Gd,getOwnPropertyNames:Wd,getOwnPropertySymbols:zd,getPrototypeOf:Jd}=Object,tr=globalThis,Io=tr.trustedTypes,Qd=Io?Io.emptyScript:"",Ro=tr.reactiveElementPolyfillSupport,Ur=(r,e)=>r,_n={toAttribute(r,e){switch(e){case Boolean:r=r?Qd:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},ra=(r,e)=>!Hd(r,e),No={attribute:!0,type:String,converter:_n,reflect:!1,useDefault:!1,hasChanged:ra};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),tr.litPropertyMetadata??(tr.litPropertyMetadata=new WeakMap);class wr extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=No){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Vd(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){const{get:i,set:s}=Gd(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){const o=i?.call(this);s?.call(this,a),this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??No}static _$Ei(){if(this.hasOwnProperty(Ur("elementProperties")))return;const e=Jd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ur("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ur("properties"))){const t=this.properties,n=[...Wd(t),...zd(t)];for(const i of n)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(Eo(i))}else e!==void 0&&t.push(Eo(e));return t}static _$Eu(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ud(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostConnected)==null?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostDisconnected)==null?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){var n;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const a=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:_n).toAttribute(t,i.type);this._$Em=e,a==null?this.removeAttribute(s):this.setAttribute(s,a),this._$Em=null}}_$AK(e,t){var n,i;const s=this.constructor,a=s._$Eh.get(e);if(a!==void 0&&this._$Em!==a){const o=s.getPropertyOptions(a),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:_n;this._$Em=a,this[a]=l.fromAttribute(t,o.type)??((i=this._$Ej)==null?void 0:i.get(a))??null,this._$Em=null}}requestUpdate(e,t,n){var i;if(e!==void 0){const s=this.constructor,a=this[e];if(n??(n=s.getPropertyOptions(e)),!((n.hasChanged??ra)(a,t)||n.useDefault&&n.reflect&&a===((i=this._$Ej)==null?void 0:i.get(e))&&!this.hasAttribute(s._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:i,wrapped:s},a){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),s!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,a]of this._$Ep)this[s]=a;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,a]of i){const{wrapped:o}=a,l=this[s];o!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,a,l)}}let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdate)==null?void 0:s.call(i)}),this.update(n)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}}wr.elementStyles=[],wr.shadowRootOptions={mode:"open"},wr[Ur("elementProperties")]=new Map,wr[Ur("finalized")]=new Map,Ro?.({ReactiveElement:wr}),(tr.reactiveElementVersions??(tr.reactiveElementVersions=[])).push("2.1.0");const Xd={attribute:!0,type:String,converter:_n,reflect:!1,hasChanged:ra},Kd=(r=Xd,e,t)=>{const{kind:n,metadata:i}=t;let s=globalThis.litPropertyMetadata.get(i);if(s===void 0&&globalThis.litPropertyMetadata.set(i,s=new Map),n==="setter"&&((r=Object.create(r)).wrapped=!0),s.set(t.name,r),n==="accessor"){const{name:a}=t;return{set(o){const l=e.get.call(this);e.set.call(this,o),this.requestUpdate(a,l,r)},init(o){return o!==void 0&&this.C(a,void 0,r,o),o}}}if(n==="setter"){const{name:a}=t;return function(o){const l=this[a];e.call(this,o),this.requestUpdate(a,l,r)}}throw Error("Unsupported decorator location: "+n)};function _e(r){return(e,t)=>typeof t=="object"?Kd(r,e,t):((n,i,s)=>{const a=i.hasOwnProperty(s);return i.constructor.createProperty(s,n),a?Object.getOwnPropertyDescriptor(i,s):void 0})(r,e,t)}function na(r){return _e({...r,state:!0,attribute:!1})}const Yd=(r,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(r,e,t),t);function ct(r,e){return(t,n,i)=>{const s=a=>{var o;return((o=a.renderRoot)==null?void 0:o.querySelector(r))??null};return Yd(t,n,{get(){return s(this)}})}}var Zd=Object.defineProperty,Vt=(r,e,t,n)=>{for(var i=void 0,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=a(e,t,i)||i);return i&&Zd(e,t,i),i};const $s=class extends Pt{constructor(){super(...arguments),this.dense=!1}};$s.shadowRootOptions={...Pt.shadowRootOptions,delegatesFocus:!0},$s.styles=[vt`
103
+ :host {
104
+ color-scheme: light dark;
105
+ --rokit-primary-color-inner: var(--rokit-primary-color, #008877);
106
+ --rokit-primary-color-transparent-inner: color-mix(in srgb, var(--rokit-primary-color-inner) 20%, transparent);
107
+ --rokit-error-color-inner: var(--rokit-error-color, #F03333);
108
+ --rokit-background-color-inner: var(--rokit-background-color, #242424);
109
+ --rokit-light-background-color-inner: var(--rokit-light-background-color, color-mix(in srgb, var(--rokit-background-color-inner) 96%, currentColor));
110
+ --rokit-light-background-darker-color-inner: var(--rokit-light-background-darker-color, color-mix(in srgb, var(--rokit-light-background-color-inner) 80%, currentColor));
111
+ --rokit-shadow-color-inner: var(--rokit-shadow-color, color-mix(in srgb, currentColor 40%, transparent));
112
+ --rokit-list-indent-inner: var(--rokit-list-indent, 1em);
113
+ --rokit-list-max-height-inner: var(--rokit-list-max-height, 300);
114
+ --rokit-caret-size-inner: var(--rokit-caret-size, 0.5em);
115
+ --rokit-transition-duration-inner: var(--rokit-transition-duration, 0.2s);
116
+ }
117
+
118
+ @media (prefers-color-scheme: light) {
119
+ :host {
120
+ --rokit-background-color-inner: var(--rokit-background-color, #FFF);
121
+ }
122
+ }
123
+ `];let Gt=$s;Vt([_e({type:Boolean,reflect:!0})],Gt.prototype,"dense");var rt;const ks=class extends Gt{constructor(){super(),Pd(this,rt),this.value="",this.clearable=!1,this.required=!1,qd(this,rt,this.attachInternals())}checkValidity(){return xt(this,rt).checkValidity()}reportValidity(){const e=xt(this,rt).reportValidity();return this.classList.toggle("invalid",!e),e}get validity(){return xt(this,rt).validity}get validationMessage(){return xt(this,rt).validationMessage}setCustomValidity(e,t){e?xt(this,rt).setValidity({customError:!0},e,t):xt(this,rt).setValidity(void 0)}updateValidity(e,t,n){xt(this,rt).setValidity(e,t,n)}setFormValue(e,t){xt(this,rt).setFormValue(e,t)}};rt=new WeakMap,ks.formAssociated=!0,ks.styles=[...Gt.styles,vt`
124
+ :host { display: inline-flex; align-items: center; padding: 6px 8px; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); box-sizing: border-box; position: relative; }
125
+ :host(:focus) { border-color: var(--rokit-primary-color-inner); }
126
+ :host(.invalid) { border-color: var(--rokit-error-color-inner); }
127
+ `];let dt=ks;Vt([_e()],dt.prototype,"name");Vt([_e()],dt.prototype,"value");Vt([_e({type:Boolean})],dt.prototype,"clearable");Vt([_e({type:Boolean})],dt.prototype,"required");Vt([_e()],dt.prototype,"label");Vt([_e()],dt.prototype,"placeholder");function ef(r){const e=parseFloat(r),t=r.match(/m?s/);let n=0;if(t)switch(t[0]){case"s":n=e*1e3;break;case"ms":n=e;break;default:n=0;break}return n}var tf=(r,e,t,n)=>{for(var i=e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=a(i)||i);return i};let zr=class extends Gt{render(){return ut`<a part="link"><slot><slot></a>`}};zr.styles=[...Gt.styles,vt`
128
+ :host a { display: flex; min-width: 1em; height: 1em; padding: 0.5em; cursor: pointer; border-radius: 1em; align-items: center; justify-content: center; }
129
+ :host a:hover { font-weight: 600; background-color: var(--rokit-light-background-darker-color-inner); }
130
+ :host([dense]) { font-size: 0.65em; }
131
+ :host(.clear) a:before { content: '\u2715'; }
132
+ :host(.caret) a:before { content:''; width: var(--rokit-caret-size-inner); height: var(--rokit-caret-size-inner); border-style: none solid solid none; border-width: calc(0.3 * var(--rokit-caret-size-inner)); transform: translate(0.15em, -0.15em) rotate(45deg); transition: transform var(--rokit-transition-duration-inner) ease-out; margin-right: calc(0.5 * var(--rokit-caret-size-inner)); }
133
+ :host(.caret.down) a:before { transform: translate(0.15em, 0.15em) rotate(225deg); }
134
+ :host(.caret.right) a:before { transform: translate(0em, 0em) rotate(-45deg); }
135
+ `];zr=tf([Ht("rokit-button")],zr);var rf=Object.defineProperty,nf=Object.getOwnPropertyDescriptor,Wt=(r,e,t,n)=>{for(var i=n>1?void 0:n?nf(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&rf(e,t,i),i};let yt=class extends Gt{constructor(){super(...arguments),this.open=!1,this.transitioning=!1,this.closedBeforeTransition=!1}firstUpdated(){const r=this.shadowRoot.querySelector("header");r.addEventListener("mousedown",()=>{this.closedBeforeTransition=!this.open&&!this.transitioning}),r.addEventListener("click",()=>{this.toggle(this.closedBeforeTransition)}),this.transitionDuration=ef(getComputedStyle(this).getPropertyValue("--rokit-transition-duration-inner"))}updated(r){r.has("transitioning")&&this.classList.toggle("transitioning",this.transitioning)}updateContentHeight(){this.content.style.maxHeight=(this.maxHeight!==void 0?Math.min(this.maxHeight,this.content.scrollHeight):this.content.scrollHeight)+"px",this.classList.toggle("has-content",this.content.style.maxHeight!=="0px")}toggle(r=!this.open){this.open||this.updateContentHeight(),this.transitioning=!0,this.open=r,this.toggleButton.classList.toggle("down",r),setTimeout(()=>{this.transitioning=!1,this.open&&this.content.scrollIntoView({block:"nearest"})},this.transitionDuration)}render(){return ut`
136
+ <header part="header">
137
+ <slot name="prefix" part="prefix"></slot>
138
+ <span class="label"><slot name="label" part="label">${this.label}</slot></span>
139
+ <slot name="pre-suffix" part="suffix"></slot>
140
+ <rokit-button id="toggle" part="toggle" class="caret" ?dense="${this.dense}" title="${this.open?"Collapse":"Expand"}"></rokit-button>
141
+ <slot name="suffix" part="suffix"></slot>
142
+ </header>
143
+ <div id="content" part="content">
144
+ <slot @slotchange=${this.updateContentHeight}></slot>
145
+ </div>
146
+ `}};yt.styles=[...Gt.styles,vt`
147
+ :host { display: flex; flex-direction: column; align-items: stretch; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); }
148
+ :host header { cursor: pointer; }
149
+ :host([dense]) header { padding: 2px 4px; }
150
+ :host([maxheight]) #content { overflow:auto }
151
+ :host(:not([open])) #content { max-height: 0 !important; }
152
+ :host(:not([open])) #content, :host(.transitioning) #content { overflow: hidden !important; }
153
+ header { display: flex; align-items: center; padding: 6px 8px; background-color: var(--rokit-light-background-color-inner); user-select: none; }
154
+ .label { flex-grow: 1; }
155
+ #content { display: flex; transition: max-height var(--rokit-transition-duration-inner) ease-in-out; position: relative; scrollbar-width: thin; }
156
+ #toggle { margin-left: 3px; }
157
+ `];Wt([_e({type:Boolean,reflect:!0})],yt.prototype,"open",2);Wt([_e()],yt.prototype,"label",2);Wt([_e({reflect:!0})],yt.prototype,"maxHeight",2);Wt([ct("#content")],yt.prototype,"content",2);Wt([ct("#toggle")],yt.prototype,"toggleButton",2);Wt([na()],yt.prototype,"transitioning",2);yt=Wt([Ht("rokit-collapsible")],yt);var sf=Object.defineProperty,af=Object.getOwnPropertyDescriptor,Bu=r=>{throw TypeError(r)},Qe=(r,e,t,n)=>{for(var i=n>1?void 0:n?af(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&sf(e,t,i),i},Fu=(r,e,t)=>e.has(r)||Bu("Cannot "+t),of=(r,e,t)=>(Fu(r,e,"read from private field"),e.get(r)),lf=(r,e,t)=>e.has(r)?Bu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),To=(r,e,t,n)=>(Fu(r,e,"write to private field"),e.set(r,t),t),Dr;let De=class extends dt{constructor(){super(),this.type="text",this.disabled=!1,this.readonly=!1,this.sticky=!1,this.minWidth=80,lf(this,Dr,""),this.addEventListener("keydown",r=>{r.code==="Escape"&&this.blur()}),this.addEventListener("focus",()=>{this.classList.add("has-focus")}),this.addEventListener("blur",()=>{this.inputElement.scrollLeft=0,this.classList.remove("has-focus")})}firstUpdated(){var r,e;To(this,Dr,this.value),this.inputElement.addEventListener("change",()=>{this.value=this.inputElement.value});const t=((e=(r=this.shadowRoot)==null?void 0:r.querySelector("label"))==null?void 0:e.scrollWidth)||0,n=this.shadowRoot.querySelector(".wrapper");n.style.minWidth=`${this.minWidth>t?this.minWidth:t}px`}updated(r){r.has("label")&&this.classList.toggle("has-label",this.label!==void 0),r.has("min")&&(this.inputElement.min=this.min||""),r.has("max")&&(this.inputElement.max=this.max||""),r.has("step")&&(this.inputElement.step=this.step||""),r.has("placeholder")&&(this.inputElement.placeholder=this.placeholder||""),r.has("pattern")&&(this.inputElement.pattern=this.pattern||""),r.has("minLength")&&(this.inputElement.minLength=this.minLength===void 0?-1:this.minLength),r.has("maxLength")&&(this.inputElement.maxLength=this.maxLength===void 0?-1:this.maxLength),r.has("value")&&(this.classList.toggle("has-value",this.value!==""),this.setFormValue(this.value),this.updateValidity(this.inputElement.validity,this.inputElement.validationMessage,this.inputElement),this.value!==of(this,Dr)&&(To(this,Dr,this.value),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))))}clear(){this.inputElement.value="",this.value="",this.blur()}renderInput(){return ut`<input id="input" part="input" size="1" name="${this.name}" type="${this.type}" autocomplete="off" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.type==="file"?"":this.value}">`}render(){return ut`
158
+ <slot name="prefix" part="prefix"></slot>
159
+ <div class="wrapper">
160
+ <label for="input" part="label">${this.label}</label>
161
+ ${this.renderInput()}
162
+ ${this.clearable?ut`
163
+ <rokit-button class="clear" ?dense="${this.dense}" @click="${r=>{r.stopPropagation(),this.clear()}}" title="Clear"></rokit-button>
164
+ `:ke}
165
+ </div>
166
+ <slot name="suffix" part="suffix"></slot>
167
+ `}};Dr=new WeakMap;De.styles=[...dt.styles,vt`
168
+ :host { background-color: var(--rokit-light-background-color-inner); user-select: none; }
169
+ :host([dense]) { padding: 2px 4px; }
170
+ :host(.has-focus:not([readonly])) label, :host(.has-value) label, :host([sticky]) label { font-size: 0.75em; top: 0.5em; font-weight: 600; }
171
+ :host(.has-focus) label { color: var(--rokit-primary-color-inner); }
172
+ .wrapper { display: flex; position: relative; flex-grow: 1; align-items: center; }
173
+ label { position: absolute; top: 50%; transform: translate(0, -50%); transition-property: top, font-size; transition-duration: var(--rokit-transition-duration-inner); max-width: 100%; overflow: hidden; pointer-events: none; white-space: nowrap; }
174
+ #input { height: 1.3em; border: 0; outline: 0; flex-grow: 1; font-size: 1em; background: none; padding: 0; color: currentColor; font-family: inherit; text-overflow: ellipsis; }
175
+ #input[type='file'] { padding-bottom: 3px; }
176
+ #input[readonly] { caret-color: transparent; }
177
+ #input[readonly]::placeholder { color: transparent; }
178
+ :host(.has-label) #input { margin-top: 0.9em; }
179
+ :host(.has-label:not(.has-focus):not(.has-value):not([sticky])) #input { clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
180
+ :host(:not(.has-value)) .clear { visibility: hidden; }
181
+ `];Qe([_e()],De.prototype,"type",2);Qe([_e({type:Boolean})],De.prototype,"disabled",2);Qe([_e({type:Boolean,reflect:!0})],De.prototype,"readonly",2);Qe([_e({type:Boolean,reflect:!0})],De.prototype,"sticky",2);Qe([_e()],De.prototype,"pattern",2);Qe([_e()],De.prototype,"minLength",2);Qe([_e()],De.prototype,"maxLength",2);Qe([_e()],De.prototype,"min",2);Qe([_e()],De.prototype,"max",2);Qe([_e()],De.prototype,"step",2);Qe([_e()],De.prototype,"minWidth",2);Qe([ct("#input")],De.prototype,"inputElement",2);De=Qe([Ht("rokit-input")],De);var uf=Object.defineProperty,cf=Object.getOwnPropertyDescriptor,Uu=r=>{throw TypeError(r)},Ge=(r,e,t,n)=>{for(var i=n>1?void 0:n?cf(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&uf(e,t,i),i},Hu=(r,e,t)=>e.has(r)||Uu("Cannot "+t),Ao=(r,e,t)=>(Hu(r,e,"read from private field"),t?t.call(r):e.get(r)),Lo=(r,e,t)=>e.has(r)?Uu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),ln=(r,e,t,n)=>(Hu(r,e,"write to private field"),e.set(r,t),t),Qt,hn;let Me=class extends dt{constructor(){super(),this.emptyMessage="Nothing to select",this.collapsibleOrientationLeft="0",this.collapsibleOrientationRight="0",this.collapsibleWidth="",this.collapse=!1,this.filterableThreshold=15,this.itemCount=0,Lo(this,Qt,""),Lo(this,hn,""),this.addEventListener("focus",()=>{this.collapsible.toggle(!0)}),this.addEventListener("blur",()=>{this.checkInputValue(),this.collapsible.toggle(!1)})}firstUpdated(){ln(this,Qt,this.value),ln(this,hn,getComputedStyle(this).getPropertyValue("--rokit-list-indent-inner")),this.input.placeholder=this.placeholder===void 0?"Type to filter list...":this.placeholder,this.input.label=this.label,this.inputMinWidth!==void 0&&(this.input.minWidth=this.inputMinWidth),setTimeout(()=>{this.collapsible.maxHeight=parseInt(this.collapsibleMaxHeight!==void 0?this.collapsibleMaxHeight:getComputedStyle(this).getPropertyValue("--rokit-list-max-height-inner")),this.collapsible.content.style.width=this.collapsibleWidth,this.collapsible.content.style.left=this.collapsibleOrientationLeft,this.collapsible.content.style.right=this.collapsibleOrientationRight})}updated(r){var e;if(r.has("selectedItem")){const t=this.value;this.value=this.selectedItem?this.itemValue(this.selectedItem):"",this.input.value=this.selectedItem?this.itemText(this.selectedItem):this.value,this.input.title=this.input.value,this.classList.toggle("has-value",this.value!==""),this.setFormValue(this.value),this.required&&this.value===""?this.updateValidity({valueMissing:!0},"Please select a value",this.listContainer):this.updateValidity(),t!==this.value&&this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}r.has("value")&&this.selectItem(this.findItem(this.value)),(r.has("filterableThreshold")||r.has("itemCount"))&&(this.input.readonly=this.filterableThreshold<0||this.itemCount<this.filterableThreshold),(e=this.collapsible)!=null&&e.toggleButton&&(this.collapsible.toggleButton.style.display=this.listContainer.childElementCount===0?"none":"")}checkInputValue(r=!0){if(this.input.value){const e=this.findItem(this.input.value);if(e){this.selectItem(e);return}}r&&(this.input.value="",this.input.title="",ln(this,Qt,""),this.selectItem(null,!1))}filter(r){var e,t,n;r=r.toLowerCase();let i=!0;for(const s of this.listContainer.querySelectorAll("li"))if(s.id!=="noresult"){const a=this.itemText(s).toLowerCase().indexOf(r)==-1;s.classList.toggle("hidden",a),this.collapse&&(s.classList.remove("open"),(e=s.querySelector("ul"))==null||e.classList.remove("open")),a||(i=!1)}for(const s of this.listContainer.querySelectorAll("li:has(li:not(.hidden))"))s.classList.remove("hidden"),r&&this.collapse&&(s.classList.add("open"),(t=s.querySelector("ul"))==null||t.classList.add("open")),i=!1;this.highlightItem(null),(n=this.listContainer.querySelector("#noresult"))==null||n.classList.toggle("hidden",!i)}selectItem(r,e=!0){r?.getAttribute("disabled")!==null&&(r=null),this.selectedItem=r,this.filter(""),this.highlightItem(r,!1),e&&this.value&&ln(this,Qt,this.value),setTimeout(()=>this.blur())}findItem(r){if(r){for(const e of this.listContainer.querySelectorAll("li"))if(this.itemValue(e)===r||this.itemText(e)===r)return e}return null}highlightItem(r,e=!0){var t,n;if((t=this.listContainer.querySelector("li.active"))==null||t.classList.remove("active"),r){if(e&&this.listContainer.focus(),r.classList.add("active"),this.collapse)for(let i=r.closest("ul");i;i=i.parentElement.closest("ul"))i.classList.add("open"),(n=i.closest("li"))==null||n.classList.add("open");r.scrollIntoView({block:"nearest"})}}highlightNextItem(){const r=this.listContainer.querySelector("li.active");let e=r;const t=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");if(r){for(let n=0;n<t.length;n++)if(t[n]===r&&n<t.length-1){e=t[n+1];break}}else t.length>0&&(e=t[0]);this.highlightItem(e)}highlightPreviousItem(){const r=this.listContainer.querySelector("li.active");let e=null;if(r){const t=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");for(let n=0;n<t.length;n++)if(t[n]===r&&n>0){e=t[n-1];break}}this.highlightItem(e),e||this.input.focus()}itemValue(r){return r.dataset.value||this.itemText(r)||""}itemText(r){var e;return((e=r.querySelector("div > div"))==null?void 0:e.innerText)||""}elementText(r){var e;let t="";for(const n of r.childNodes)n.nodeType==3&&(t+=(e=n.nodeValue)==null?void 0:e.trim());return t}onSlotChange(){this.listContainer.replaceChildren(),this.itemCount=0;let r=null;const e=this.shadowRoot.querySelector("#list-container-slot").assignedElements();if(e?.length===1&&(r=Array.prototype.slice.call(e[0].querySelectorAll(":scope > li")),this.copyItems(r,this.listContainer)),this.emptyMessage){const t=document.createElement("li");t.id="noresult",t.setAttribute("disabled",""),t.innerText=this.emptyMessage,this.listContainer.appendChild(t),r&&r.length>0&&t.classList.add("hidden")}this.value=this.value||Ao(this,Qt),this.selectItem(this.findItem(this.value))}copyItems(r,e,t=0){if(this.sort!==void 0){const i=this.sort||"asc";r=r.sort((s,a)=>i==="desc"?(this.elementText(a)||this.itemValue(a)).localeCompare(this.elementText(s)||this.itemValue(s)):(this.elementText(s)||this.itemValue(s)).localeCompare(this.elementText(a)||this.itemValue(a)))}let n="";t>0&&(n=`calc(0.3em + ${t}*${Ao(this,hn)})`);for(const i of r){const s=i.cloneNode();s.replaceChildren();const a=document.createElement("div");n&&(a.style.paddingLeft=n);const o=document.createElement("div");a.appendChild(o);for(const d of i.childNodes)if(d.nodeName!=="UL"){const h=d.cloneNode(!0);h.nodeType===3&&h.nodeValue&&(h.nodeValue=h.nodeValue.trim()),o.appendChild(h)}s.appendChild(a),s.title=s.title||this.itemText(s);const l=i.querySelector("ul");if(l!=null&&l.childElementCount){const d=document.createElement("ul");if(s.appendChild(d),this.copyItems(Array.prototype.slice.call(l.children),d,t+1),this.collapse){const h=new zr;h.title="Open",h.dense=!0,h.classList.add("toggle-node","caret"),h.addEventListener("click",m=>{m.stopPropagation(),s.classList.toggle("open"),d.classList.toggle("open"),h.title=s.classList.contains("open")?"Close":"Open",this.collapsible.updateContentHeight()}),a.prepend(h)}else d.classList.add("open")}e.appendChild(s),this.itemCount++}}render(){return ut`
182
+ <rokit-collapsible ?dense="${this.dense}" part="collapsible">
183
+ <slot name="prefix" part="prefix" slot="prefix"></slot>
184
+ <slot name="suffix" part="suffix" slot="suffix"></slot>
185
+ <rokit-input id="input" slot="label"
186
+ ?clearable="${this.clearable}"
187
+ ?dense="${this.dense}"
188
+ @change="${()=>{this.checkInputValue(this.input.inputElement.value===""||!this.collapsible.open)}}"
189
+ @input="${()=>{this.filter(this.input.inputElement.value)}}"
190
+ @click="${()=>{this.collapsible.toggle(!0)}}"
191
+ @keydown="${r=>{switch(r.code){case"ArrowDown":r.preventDefault(),this.highlightNextItem();break;case"Enter":{const e=this.findItem(this.input.value);e?this.selectItem(e):this.filter(this.input.value);break}}}}"
192
+ ></rokit-input>
193
+ <ul id="list-container" tabindex="-1" part="list" class="open"
194
+ @mousedown="${r=>{r.preventDefault()}}"
195
+ @click="${r=>{const e=r.target.closest("li");e&&e.getAttribute("disabled")===null&&!e.classList.contains("divider")&&this.selectItem(e)}}"
196
+ @keydown="${r=>{var e,t;switch(r.code){case"Enter":this.selectItem(this.listContainer.querySelector("li.active"));break;case"ArrowDown":r.preventDefault(),this.highlightNextItem();break;case"ArrowUp":r.preventDefault(),this.highlightPreviousItem();break;case"ArrowRight":if(this.collapse){const n=this.listContainer.querySelector("li.active");n&&(r.preventDefault(),n.classList.add("open"),(e=n.querySelector("ul"))==null||e.classList.add("open"),this.collapsible.updateContentHeight())}break;case"ArrowLeft":if(this.collapse){const n=this.listContainer.querySelector("li.active");n&&(r.preventDefault(),n.classList.remove("open"),(t=n.querySelector("ul"))==null||t.classList.remove("open"),this.collapsible.updateContentHeight())}break;case"Escape":this.listContainer.blur();break}}}">
197
+ </ul>
198
+ <slot id="list-container-slot" @slotchange=${this.onSlotChange}></slot>
199
+ </rokit-collapsible>
200
+ `}};Qt=new WeakMap;hn=new WeakMap;Me.styles=[...dt.styles,vt`
201
+ :host { background-color: var(--rokit-light-background-color-inner); user-select: none; padding: 0; }
202
+ :host([dense]) li > div { padding: 4px 2px; }
203
+ :host([dense]) li.large > div, :host([dense]) li.header > div { padding-top: 6px; padding-bottom: 6px; }
204
+ #input { padding: 0; background-color: inherit; }
205
+ rokit-collapsible, #input { display: flex; flex-grow: 1; border: 0; }
206
+ rokit-collapsible::part(content) { display: flex; flex-direction: column; outline: 0; z-index: 1000; position: absolute; top: calc(100% + 2px); background-color: var(--rokit-background-color-inner); }
207
+ rokit-collapsible::part(header) { background-color: inherit !important; }
208
+ rokit-collapsible[open].has-content::part(content), rokit-collapsible.has-content.transitioning::part(content) { border: 2px solid var(--rokit-primary-color-transparent-inner); box-shadow: 0 0 10px var(--rokit-shadow-color-inner); clip-path: inset(0 -13px -13px 0); }
209
+ #list-container { outline: 0; }
210
+ #list-container-slot { display: none; }
211
+ ul { list-style-type: none; margin: 0; padding: 0; width: 100%; box-sizing: border-box; }
212
+ li > div, #noresult { display: flex; align-items:center; line-height: 1em; padding: 8px; white-space: nowrap; transition: all calc(0.5 * var(--rokit-transition-duration-inner)); }
213
+ li:not([disabled]):not(.divider) { cursor: pointer }
214
+ li:not([disabled]):not(.divider) > div:hover { background-color: var(--rokit-light-background-color-inner); }
215
+ li.active > div { color: var(--rokit-primary-color-inner); background-color: var(--rokit-light-background-color-inner); }
216
+ li.divider { border-top: 1px solid var(--rokit-light-background-darker-color-inner); height: 0; padding: 0; }
217
+ li.divider, li.header { pointer-events: none; }
218
+ li.header > div { font-size: 0.7rem; font-weight: bold; padding-top: 8px; }
219
+ li.large > div { padding-top: 10px; padding-bottom: 10px; }
220
+ .hidden { display: none !important; }
221
+ :host([collapse]) li > div { padding-left: 0; }
222
+ :host([collapse]) .toggle-node { position: absolute }
223
+ :host([collapse]) li > div > div { padding-left: 1.8em; }
224
+ :host([collapse]) ul:not(.open) { display: none; }
225
+ :host([collapse]) li:not(.open) > div > .toggle-node::part(link):before { transform: translate(0em, 0em) rotate(-45deg); }
226
+ `];Ge([_e()],Me.prototype,"emptyMessage",2);Ge([_e()],Me.prototype,"sort",2);Ge([_e()],Me.prototype,"collapsibleMaxHeight",2);Ge([_e()],Me.prototype,"collapsibleOrientationLeft",2);Ge([_e()],Me.prototype,"collapsibleOrientationRight",2);Ge([_e()],Me.prototype,"collapsibleWidth",2);Ge([_e()],Me.prototype,"inputMinWidth",2);Ge([_e({type:Boolean,reflect:!0})],Me.prototype,"collapse",2);Ge([_e()],Me.prototype,"filterableThreshold",2);Ge([ct("rokit-collapsible")],Me.prototype,"collapsible",2);Ge([ct("#input")],Me.prototype,"input",2);Ge([ct("#list-container")],Me.prototype,"listContainer",2);Ge([na()],Me.prototype,"selectedItem",2);Ge([na()],Me.prototype,"itemCount",2);Me=Ge([Ht("rokit-select")],Me);var df=Object.defineProperty,ff=Object.getOwnPropertyDescriptor,kn=(r,e,t,n)=>{for(var i=n>1?void 0:n?ff(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&df(e,t,i),i};let rr=class extends De{constructor(){super(...arguments),this.resize="none",this.rows=3}firstUpdated(){super.firstUpdated(),this.inputElement.rows=this.rows,this.cols!==void 0&&(this.inputElement.cols=this.cols),this.resize==="auto"?(this.inputElement.style.resize="none",this.inputElement.addEventListener("input",()=>this.autoResize())):this.inputElement.style.resize=this.resize}updated(r){super.updated(r),this.resize==="auto"&&r.has("value")&&this.autoResize()}autoResize(){this.inputElement.style.height="",this.inputElement.style.height=this.inputElement.scrollHeight+"px"}onSlotChange(){const r=this.shadowRoot.querySelector("#content").assignedNodes().map(e=>e.textContent).join("");r.trim()!==""&&(this.value=r)}renderInput(){return ut`
227
+ <textarea id="input" part="input" autocomplete="off" name="${this.name}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.value}"></textarea>
228
+ <slot id="content" @slotchange=${this.onSlotChange}></slot>
229
+ `}};rr.styles=[...De.styles,vt`
230
+ :host { align-items: last baseline; }
231
+ #input { height: initial; }
232
+ #content { display: none; }
233
+ .wrapper { align-items: flex-start; }
234
+ `];kn([_e()],rr.prototype,"resize",2);kn([_e()],rr.prototype,"rows",2);kn([_e()],rr.prototype,"cols",2);rr=kn([Ht("rokit-textarea")],rr);var hf=Object.defineProperty,pf=Object.getOwnPropertyDescriptor,Vu=r=>{throw TypeError(r)},ft=(r,e,t,n)=>{for(var i=n>1?void 0:n?pf(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&hf(e,t,i),i},Gu=(r,e,t)=>e.has(r)||Vu("Cannot "+t),Re=(r,e,t)=>(Gu(r,e,"read from private field"),t?t.call(r):e.get(r)),wi=(r,e,t)=>e.has(r)?Vu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),un=(r,e,t,n)=>(Gu(r,e,"write to private field"),e.set(r,t),t),Oe,pt,Xt;const It=18;let mt=class extends De{constructor(){super(...arguments),this.labelFormatter=r=>String(r),wi(this,Oe,[0,1]),wi(this,pt,[Re(this,Oe)[0],Re(this,Oe)[1]]),wi(this,Xt)}firstUpdated(){super.firstUpdated(),this.sliderElement.addEventListener("mousedown",r=>this.onKnobDrag(r)),this.sliderElement.addEventListener("touchstart",r=>this.onKnobDrag(r)),new ResizeObserver(()=>{this.updateKnobPositions()}).observe(this.sliderElement)}updated(r){if(super.updated(r),r.has("min")&&(Re(this,Oe)[0]=parseFloat(this.min||"0"),Re(this,Oe)[1]=Math.max(Re(this,Oe)[0],Re(this,Oe)[1])),r.has("max")&&(Re(this,Oe)[1]=parseFloat(this.max||"1"),Re(this,Oe)[0]=Math.min(Re(this,Oe)[0],Re(this,Oe)[1])),r.has("step")&&un(this,Xt,this.step?parseFloat(this.step):void 0),r.has("value")||r.has("min")||r.has("max"))if(this.value)if(this.range!==void 0){const e=JSON.parse(this.value);un(this,pt,[this.applyConstraints(e[0]),this.applyConstraints(e[1])])}else un(this,pt,[this.applyConstraints(parseFloat(this.value))]);else un(this,pt,[Re(this,Oe)[0],Re(this,Oe)[1]]);this.updateKnobPositions()}updateValidity(r,e){super.updateValidity(r,e,this.sliderElement)}chooseKnob(r){if(!this.endKnob)return this.startKnob;let e=Math.abs(r-this.startKnob.offsetLeft)<Math.abs(r-this.endKnob.offsetLeft)?this.startKnob:this.endKnob;return this.startKnob.value===this.endKnob.value&&(e.id==="start"&&e.value===Re(this,Oe)[0]?e=this.endKnob:e.id==="end"&&e.value===Re(this,Oe)[1]&&(e=this.startKnob)),e}toScreenSpace(r){return(r-Re(this,Oe)[0])/(Re(this,Oe)[1]-Re(this,Oe)[0])*this.track.offsetWidth}toValueSpace(r){return r/this.track.offsetWidth*(Re(this,Oe)[1]-Re(this,Oe)[0])+Re(this,Oe)[0]}applyConstraints(r,e){let t=Math.min(Math.max(r,Re(this,Oe)[0]),Re(this,Oe)[1]);return Re(this,Xt)&&(t=Math.round(t/Re(this,Xt))*Re(this,Xt)),e!==void 0&&this.endKnob&&(t=e?Math.min(t,this.endKnob.value):Math.max(t,this.startKnob.value)),t}updateKnob(r,e){r.value=e,r.offset=this.toScreenSpace(e),r.label=this.labelFormatter(e),this.endKnob&&(r.id==="start"?this.track.style.borderLeftWidth=r.offset+"px":this.track.style.borderRightWidth=this.track.offsetWidth-r.offset+"px")}updateKnobPositions(){this.updateKnob(this.startKnob,Re(this,pt)[0]),this.endKnob&&this.updateKnob(this.endKnob,Re(this,pt)[1])}onKnobDrag(r){if(r.target instanceof nr||this.classList.contains("has-value")||this.classList.contains("has-focus")){let e;const t=i=>{let s=0;i.type==="touchmove"||i.type==="touchstart"?s=i.touches[0].clientX:s=i.clientX,s=s-this.track.getBoundingClientRect().left,e||(e=this.chooseKnob(s),e.classList.add("focus")),this.updateKnob(e,this.applyConstraints(this.toValueSpace(s),e.id==="start"))},n=()=>{document.removeEventListener("mousemove",t),document.removeEventListener("touchmove",t),document.removeEventListener("mouseup",n),document.removeEventListener("touchend",n),e&&(e.classList.remove("focus"),this.range!==void 0?e.id==="end"?this.value=JSON.stringify([Re(this,pt)[0],e.value]):this.value=JSON.stringify([e.value,Re(this,pt)[1]]):this.value=String(e.value)),e=void 0};this.sliderElement.focus(),document.addEventListener("mousemove",t),document.addEventListener("touchmove",t),document.addEventListener("mouseup",n),document.addEventListener("touchend",n),t(r)}}renderInput(){return ut`
235
+ ${super.renderInput()}
236
+ <div id="slider" part="slider" tabindex="0" ?range="${this.range!==void 0}">
237
+ <div id="track"></div>
238
+ <rokit-slider-knob id="start"></rokit-slider-knob>
239
+ ${this.range===void 0?ke:ut`
240
+ <rokit-slider-knob id="end"></rokit-slider-knob>
241
+ `}
242
+ </div>
243
+ `}};Oe=new WeakMap;pt=new WeakMap;Xt=new WeakMap;mt.styles=[...De.styles,vt`
244
+ :host(.has-label:not(:focus):not(.has-value):not([sticky])) #slider > * { visibility: hidden; }
245
+ :host(.has-label) .wrapper { padding-top: 1em; }
246
+ :host([sticky]) #slider { margin-top: ${.25*It+22}px; }
247
+ #input { display: none; }
248
+ #slider { display: flex; position: relative; align-items: center; width: 100%; height: ${It}px; padding: 0 ${It/2}px; outline: 0; }
249
+ :host(:not([sticky])) #slider:not(:focus) rokit-slider-knob::part(label) { color: transparent; background-color: transparent; border-color: transparent; top: 0; }
250
+ #track { height: 2px; flex-grow: 1; background-color: #CCC; }
251
+ #slider[range] #track { background-color: color-mix(in srgb, var(--rokit-primary-color-inner) 60%, transparent); border-width: 0; border-color: #CCC; border-style: solid; }
252
+ `];ft([_e()],mt.prototype,"range",2);ft([_e()],mt.prototype,"labelFormatter",2);ft([ct("#slider")],mt.prototype,"sliderElement",2);ft([ct("#track")],mt.prototype,"track",2);ft([ct("#start")],mt.prototype,"startKnob",2);ft([ct("#end")],mt.prototype,"endKnob",2);mt=ft([Ht("rokit-slider")],mt);let nr=class extends Pt{constructor(){super(...arguments),this.offset=0,this.label="",this.value=0}updated(r){r.has("offset")&&(this.style.left=this.offset+"px")}render(){return ut`<label part="label">${this.label}</label>`}};nr.styles=[vt`
253
+ :host { position: absolute; width: ${It}px; height: ${It}px; border-radius: ${It}px; background-color: var(--rokit-primary-color-inner); }
254
+ :host(.focus), :host(:hover) { box-shadow: 0 0 0 ${It/2}px var(--rokit-primary-color-transparent-inner); z-index: 1; }
255
+ label {
256
+ position: absolute;
257
+ top: calc(-2em - ${It/4}px);
258
+ left: 50%;
259
+ transform: translate(-50%, 0);
260
+ white-space: nowrap;
261
+ font-size: 0.75em;
262
+ font-weight: 500;
263
+ transition-property: top color background-color;
264
+ transition-duration: var(--rokit-transition-duration-inner);
265
+ pointer-events: none;
266
+ color: white;
267
+ background-color: var(--rokit-primary-color-inner);
268
+ padding: 0 4px;
269
+ border-radius: 3px;
270
+ }
271
+ label:after {
272
+ content: '';
273
+ width: 10px;
274
+ height: 10px;
275
+ position: absolute;
276
+ left: 50%;
277
+ bottom: -4px;
278
+ transform: translate(-50%, 0);
279
+ background-color: inherit;
280
+ clip-path: polygon(50% 50%, 100% 50%, 50% 100%, 0 50%);
281
+ }
282
+ `];ft([_e()],nr.prototype,"offset",2);ft([_e()],nr.prototype,"label",2);nr=ft([Ht("rokit-slider-knob")],nr);class xn extends HTMLElement{constructor(e,t,n,i){if(super(),this.template=new ad(n.store.getQuads(e,null,null,null),t,n),this.template.order!==void 0&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),n.editMode&&!t.linked&&(this.addButton=this.createAddButton(),this.appendChild(this.addButton)),this.template.path){let s=[];i&&(t.linked?s=n.store.getQuads(i,this.template.path,null,null):s=n.store.getQuads(i,this.template.path,null,lt));let a=!1;for(const o of s)this.isValueValid(o.object)&&(this.addPropertyInstance(o.object),this.template.hasValue&&o.object.equals(this.template.hasValue)&&(a=!0));n.editMode&&this.template.hasValue&&!a&&!t.linked&&this.addPropertyInstance(this.template.hasValue)}if(n.editMode&&!t.linked&&(this.addEventListener("change",()=>{this.updateControls()}),this.updateControls()),this.template.extendedShapes.length&&this.template.config.attributes.collapse!==null&&(!this.template.maxCount||this.template.maxCount>1)&&(n.editMode&&!t.linked||this.childElementCount>0)){const s=this;s.classList.add("collapsible"),this.template.config.attributes.collapse==="open"&&s.classList.add("open");const a=document.createElement("h1");a.classList.add("activator"),a.innerText=this.template.label,a.addEventListener("click",()=>{s.classList.toggle("open")}),this.prepend(a)}}addPropertyInstance(e){let t;if(this.template.shaclOr?.length||this.template.shaclXone?.length){const n=this.template.shaclOr?.length?this.template.shaclOr:this.template.shaclXone;let i=!1;if(e){const s=nd(n,e,this.template.config);s.length&&(t=pn(this.template.clone().merge(s),e,!0),i=!0)}i||(t=Tu(n,this,this.template.config),Wu(t,""))}else{let n=!1;if(e&&!(e instanceof it)){const i=this.getRdfClassToLinkOrCreate();i&&this.template.config.store.countQuads(e,qe,i,lt)===0&&(n=!0)}t=pn(this.template,e,void 0,n||this.template.parent.linked)}return this.addButton?this.insertBefore(t,this.addButton):this.appendChild(t),t}updateControls(){let e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length;e===0&&(!this.template.extendedShapes.length||this.template.minCount!==void 0&&this.template.minCount>0)&&(this.addPropertyInstance(),e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length);let t;this.template.minCount!==void 0?t=e>this.template.minCount:t=this.template.extendedShapes.length>0||e>1;const n=this.template.maxCount===void 0||e<this.template.maxCount;this.classList.toggle("may-remove",t),this.classList.toggle("may-add",n)}toRDF(e,t){for(const n of this.querySelectorAll(":scope > .property-instance")){const i=Ee.namedNode(n.dataset.path);if(n.firstChild instanceof Rt){const s=n.firstChild.toRDF(e);e.addQuad(t,i,s,this.template.config.valuesGraphId)}else for(const s of n.querySelectorAll(":scope > .editor")){const a=fd(s);a&&e.addQuad(t,i,a,this.template.config.valuesGraphId)}}}getRdfClassToLinkOrCreate(){if(this.template.class&&this.template.node)return this.template.class;for(const e of this.template.extendedShapes){const t=this.template.config.store.getObjects(e,Vr,null);if(t.length>0)return t[0]}}isValueValid(e){if(!this.template.extendedShapes.length)return!0;for(const t of this.template.extendedShapes){const n=this.template.config.store.getObjects(t,Vr,null);for(const i of n)if(this.template.config.store.countQuads(e,qe,i,null)>0)return!0}return!1}createAddButton(){const e=new Me;e.dense=!0,e.label="+ "+this.template.label,e.title="Add "+this.template.label,e.classList.add("add-button");let t=[],n=this.getRdfClassToLinkOrCreate();if(n&&(t=Js(n,this.template)),t.length===0)e.emptyMessage="",e.inputMinWidth=0,e.addEventListener("click",i=>{e.blur();const s=this.addPropertyInstance();s.classList.add("fadeIn"),this.updateControls(),setTimeout(()=>{rd(s),s.classList.remove("fadeIn")},200)});else{const i=document.createElement("ul"),s=document.createElement("li");s.innerHTML="&#xFF0B; Create new "+this.template.label+"...",s.dataset.value="new",s.classList.add("large"),i.appendChild(s);const a=document.createElement("li");a.classList.add("divider"),i.appendChild(a);const o=document.createElement("li");o.classList.add("header"),o.innerText="Or link existing:",i.appendChild(o);for(const l of t){const d=document.createElement("li"),h=typeof l.value=="string"?l.value:l.value.value;d.innerText=l.label?l.label:h,d.dataset.value=JSON.stringify(l.value),i.appendChild(d)}e.appendChild(i),e.collapsibleWidth="250px",e.collapsibleOrientationLeft="",e.addEventListener("change",()=>{if(e.value==="new")this.addPropertyInstance();else{const l=JSON.parse(e.value);this.insertBefore(pn(this.template,l,!0,!0),e)}e.value=""})}return e}}function pn(r,e,t=!1,n=!1){let i;if(r.extendedShapes.length){i=document.createElement("div"),i.classList.add("property-instance");for(const s of r.extendedShapes)i.appendChild(new Rt(s,r.config,e,r.parent,r.nodeKind,r.label,n))}else{const s=gd(r.path,r.datatype?.value);s?r.config.editMode&&!n?i=s.createEditor(r,e):i=s.createViewer(r,e):i=ud(r,e||null,r.config.editMode&&!n),i.classList.add("property-instance"),n&&i.classList.add("linked")}return r.config.editMode&&Wu(i,r.label,t),i.dataset.path=r.path,i}function Wu(r,e,t=!1){const n=new zr;n.classList.add("remove-button","clear"),n.title="Remove "+e,n.dense=!0,n.addEventListener("click",i=>{r.classList.remove("fadeIn"),r.classList.add("fadeOut"),setTimeout(()=>{const s=r.parentElement;r.remove(),s?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),t&&n.classList.add("persistent"),r.appendChild(n)}window.customElements.define("shacl-property",xn);function gf(r,e){const t=document.createElement("div");t.dataset.subject=r,t.classList.add("shacl-group");let n=r;const i=e.store.getQuads(r,null,null,null),s=qr(i,"label",Gs,e.languages);s&&(n=s);const a=qr(i,"order");a&&(t.style.order=a);const o=document.createElement("h1");return o.innerText=n,t.appendChild(o),e.attributes.collapse!==null&&(t.classList.add("collapsible"),e.attributes.collapse==="open"&&t.classList.add("open"),o.classList.add("activator"),o.addEventListener("click",()=>{t.classList.toggle("open")})),t}const Ce=[];for(let r=0;r<256;++r)Ce.push((r+256).toString(16).slice(1));function yf(r,e=0){return(Ce[r[e+0]]+Ce[r[e+1]]+Ce[r[e+2]]+Ce[r[e+3]]+"-"+Ce[r[e+4]]+Ce[r[e+5]]+"-"+Ce[r[e+6]]+Ce[r[e+7]]+"-"+Ce[r[e+8]]+Ce[r[e+9]]+"-"+Ce[r[e+10]]+Ce[r[e+11]]+Ce[r[e+12]]+Ce[r[e+13]]+Ce[r[e+14]]+Ce[r[e+15]]).toLowerCase()}let vi;const mf=new Uint8Array(16);function bf(){if(!vi){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");vi=crypto.getRandomValues.bind(crypto)}return vi(mf)}const wf=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),jo={randomUUID:wf};function Oo(r,e,t){if(jo.randomUUID&&!r)return jo.randomUUID();r=r||{};const n=r.random??r.rng?.()??bf();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,yf(n)}class Rt extends HTMLElement{constructor(e,t,n,i,s,a,o){super(),this.owlImports=[],this.parent=i,this.config=t,this.shaclSubject=e,this.linked=o||!1;let l=n;if(!l){if(!s){const h=t.store.getObjects(e,`${be}nodeKind`,null);h.length&&(s=h[0])}s===void 0&&t.attributes.valuesNamespace||s?.value===`${be}IRI`?l=Ee.namedNode(t.attributes.valuesNamespace+Oo()):l=Ee.blankNode(Oo())}this.nodeId=l;const d=JSON.stringify([e,n]);if(n&&t.renderedNodes.has(d)){a=a||"Link";const h=document.createElement("label");h.innerText=a,h.classList.add("linked"),this.appendChild(h);const m=document.createElement("a");let w=n.termType==="BlankNode"?"_:"+n.value:n.value;m.innerText=w,m.classList.add("ref-link"),m.onclick=()=>{this.config.form.querySelector(`shacl-node[data-node-id='${w}']`)?.scrollIntoView()},this.appendChild(m),this.style.flexDirection="row"}else{if(n&&t.renderedNodes.add(d),this.dataset.nodeId=this.nodeId.id,this.config.attributes.showNodeIds!==null){const h=document.createElement("div");h.innerText=`id: ${this.nodeId.id}`,h.classList.add("node-id-display"),this.appendChild(h)}for(const h of t.store.getQuads(e,Ws,null,null))this.owlImports.push(h.object);for(const h of t.store.getQuads(e,null,null,null))switch(h.predicate.id){case wn.id:this.addPropertyInstance(h.object,t,n);break;case`${be}and`:const m=t.lists[h.object.value];if(m?.length)for(const w of m)this.prepend(new Rt(w,t,n,this));else console.error("list not found:",h.object.value,"existing lists:",t.lists);break;case`${be}node`:this.prepend(new Rt(h.object,t,n,this));break;case`${be}targetClass`:this.targetClass=h.object;break;case`${be}or`:this.tryResolve(h.object,n,t);break;case`${be}xone`:this.tryResolve(h.object,n,t);break}if(a){const h=document.createElement("h1");h.innerText=a,this.prepend(h)}}}toRDF(e,t){if(t||(t=this.nodeId),!this.linked){for(const n of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))n.toRDF(e,t);this.targetClass&&e.addQuad(t,qe,this.targetClass,this.config.valuesGraphId),this.config.attributes.generateNodeShapeReference&&!this.parent&&e.addQuad(t,Ee.namedNode(this.config.attributes.generateNodeShapeReference),this.shaclSubject,this.config.valuesGraphId)}return t}addPropertyInstance(e,t,n){let i=this;const s=t.store.getQuads(e,`${be}group`,null,null);if(s.length>0){const o=s[0].object.value;if(t.groups.indexOf(o)>-1){let l=this.querySelector(`:scope > .shacl-group[data-subject='${o}']`);l||(l=gf(o,t),this.appendChild(l)),i=l}else console.warn("ignoring unknown group reference",s[0],"existing groups:",t.groups)}const a=new xn(e,this,t,n);a.childElementCount>0&&i.appendChild(a)}tryResolve(e,t,n){const i=n.lists[e.value];if(i?.length){let s=!1;if(t){const a=id(i,t,n);if(a.length){for(const o of a)this.addPropertyInstance(o,n,t);s=!0}}s||this.appendChild(Tu(i,this,n))}else console.error("list for sh:or/sh:xone not found:",e,"existing lists:",n.lists)}}window.customElements.define("shacl-node",Rt);var _i={},xi,$o;function ia(){return $o||($o=1,xi=class zu{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:e,_existing:t,counter:n}=this;return new zu(e,new Map(t),n)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}),xi}var Si={},ko;function vf(){return ko||(ko=1,function(r,e){if(r.setImmediate)return;var t=1,n={},i=!1,s=r.document,a;function o(I){typeof I!="function"&&(I=new Function(""+I));for(var b=new Array(arguments.length-1),c=0;c<b.length;c++)b[c]=arguments[c+1];var p={callback:I,args:b};return n[t]=p,a(t),t++}function l(I){delete n[I]}function d(I){var b=I.callback,c=I.args;switch(c.length){case 0:b();break;case 1:b(c[0]);break;case 2:b(c[0],c[1]);break;case 3:b(c[0],c[1],c[2]);break;default:b.apply(e,c);break}}function h(I){if(i)setTimeout(h,0,I);else{var b=n[I];if(b){i=!0;try{d(b)}finally{l(I),i=!1}}}}function m(){a=function(I){process.nextTick(function(){h(I)})}}function w(){if(r.postMessage&&!r.importScripts){var I=!0,b=r.onmessage;return r.onmessage=function(){I=!1},r.postMessage("","*"),r.onmessage=b,I}}function g(){var I="setImmediate$"+Math.random()+"$",b=function(c){c.source===r&&typeof c.data=="string"&&c.data.indexOf(I)===0&&h(+c.data.slice(I.length))};r.addEventListener?r.addEventListener("message",b,!1):r.attachEvent("onmessage",b),a=function(c){r.postMessage(I+c,"*")}}function y(){var I=new MessageChannel;I.port1.onmessage=function(b){var c=b.data;h(c)},a=function(b){I.port2.postMessage(b)}}function _(){var I=s.documentElement;a=function(b){var c=s.createElement("script");c.onreadystatechange=function(){h(b),c.onreadystatechange=null,I.removeChild(c),c=null},I.appendChild(c)}}function x(){a=function(I){setTimeout(h,0,I)}}var S=Object.getPrototypeOf&&Object.getPrototypeOf(r);S=S&&S.setTimeout?S:r,{}.toString.call(r.process)==="[object process]"?m():w()?g():r.MessageChannel?y():s&&"onreadystatechange"in s.createElement("script")?_():x(),S.setImmediate=o,S.clearImmediate=l}(typeof self>"u"?typeof Kt>"u"?Si:Kt:self)),Si}/*!
283
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
284
+ */var Ei,Do;function Dn(){if(Do)return Ei;Do=1,vf();const r=self.crypto||self.msCrypto;return Ei=class{constructor(t){if(!(r&&r.subtle))throw new Error("crypto.subtle not found.");if(t==="sha256")this.algorithm={name:"SHA-256"};else if(t==="sha1")this.algorithm={name:"SHA-1"};else throw new Error(`Unsupported algorithm "${t}".`);this._content=""}update(t){this._content+=t}async digest(){const t=new TextEncoder().encode(this._content),n=new Uint8Array(await r.subtle.digest(this.algorithm,t));let i="";for(let s=0;s<n.length;++s)i+=n[s].toString(16).padStart(2,"0");return i}},Ei}/*!
285
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
286
+ */var Ii,Mo;function Ju(){return Mo||(Mo=1,Ii=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,n=e.slice();let i=null,s=0;const a=e.length;for(let o=0;o<a;++o){const l=e[o],d=t.get(l);(i===null||l>i)&&(d&&o>0&&l>e[o-1]||!d&&o<a-1&&l>e[o+1])&&(i=l,s=o)}if(i===null)this.done=!0;else{const o=t.get(i)?s-1:s+1;e[s]=e[o],e[o]=i;for(const l of e)l>i&&t.set(l,!t.get(l))}return n}}),Ii}/*!
287
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
288
+ */var Ri,Co;function sa(){if(Co)return Ri;Co=1;const e="http://www.w3.org/1999/02/22-rdf-syntax-ns#"+"langString",t="http://www.w3.org/2001/XMLSchema#string",n="NamedNode",i="BlankNode",s="Literal",a="DefaultGraph",o={};(()=>{const g="(?:<([^:]+:[^>]*)>)",_="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�"+"_",x=_+"0-9-·̀-ͯ‿-⁀",I="(_:(?:["+_+"0-9])(?:(?:["+x+".])*(?:["+x+"]))?)",b='"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"',c="(?:\\^\\^"+g+")",N="(?:"+b+"(?:"+c+"|"+"(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))"+")?)",D="[ \\t]+",T="[ \\t]*",q="(?:"+g+"|"+I+")"+D,R=g+D,M="(?:"+g+"|"+I+"|"+N+")"+T,B="(?:\\.|(?:(?:"+g+"|"+I+")"+T+"\\.))";o.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,o.empty=new RegExp("^"+T+"$"),o.quad=new RegExp("^"+T+q+R+M+B+T+"$")})(),Ri=class gn{static parse(y){const _=[],x={},S=y.split(o.eoln);let I=0;for(const b of S){if(I++,o.empty.test(b))continue;const c=b.match(o.quad);if(c===null)throw new Error("N-Quads parse error on line "+I+".");const p={subject:null,predicate:null,object:null,graph:null};if(c[1]!==void 0?p.subject={termType:n,value:c[1]}:p.subject={termType:i,value:c[2]},p.predicate={termType:n,value:c[3]},c[4]!==void 0?p.object={termType:n,value:c[4]}:c[5]!==void 0?p.object={termType:i,value:c[5]}:(p.object={termType:s,value:void 0,datatype:{termType:n}},c[7]!==void 0?p.object.datatype.value=c[7]:c[8]!==void 0?(p.object.datatype.value=e,p.object.language=c[8]):p.object.datatype.value=t,p.object.value=w(c[6])),c[9]!==void 0?p.graph={termType:n,value:c[9]}:c[10]!==void 0?p.graph={termType:i,value:c[10]}:p.graph={termType:a,value:""},!(p.graph.value in x))x[p.graph.value]=[p],_.push(p);else{let N=!0;const D=x[p.graph.value];for(const T of D)if(l(T,p)){N=!1;break}N&&(D.push(p),_.push(p))}}return _}static serialize(y){Array.isArray(y)||(y=gn.legacyDatasetToQuads(y));const _=[];for(const x of y)_.push(gn.serializeQuad(x));return _.sort().join("")}static serializeQuadComponents(y,_,x,S){let I="";return y.termType===n?I+=`<${y.value}>`:I+=`${y.value}`,I+=` <${_.value}> `,x.termType===n?I+=`<${x.value}>`:x.termType===i?I+=x.value:(I+=`"${h(x.value)}"`,x.datatype.value===e?x.language&&(I+=`@${x.language}`):x.datatype.value!==t&&(I+=`^^<${x.datatype.value}>`)),S.termType===n?I+=` <${S.value}>`:S.termType===i&&(I+=` ${S.value}`),I+=` .
289
+ `,I}static serializeQuad(y){return gn.serializeQuadComponents(y.subject,y.predicate,y.object,y.graph)}static legacyDatasetToQuads(y){const _=[],x={"blank node":i,IRI:n,literal:s};for(const S in y)y[S].forEach(b=>{const c={};for(const p in b){const N=b[p],D={termType:x[N.type],value:N.value};D.termType===s&&(D.datatype={termType:n},"datatype"in N&&(D.datatype.value=N.datatype),"language"in N?("datatype"in N||(D.datatype.value=e),D.language=N.language):"datatype"in N||(D.datatype.value=t)),c[p]=D}S==="@default"?c.graph={termType:a,value:""}:c.graph={termType:S.startsWith("_:")?i:n,value:S},_.push(c)});return _}};function l(g,y){return!(g.subject.termType===y.subject.termType&&g.object.termType===y.object.termType)||!(g.subject.value===y.subject.value&&g.predicate.value===y.predicate.value&&g.object.value===y.object.value)?!1:g.object.termType!==s?!0:g.object.datatype.termType===y.object.datatype.termType&&g.object.language===y.object.language&&g.object.datatype.value===y.object.datatype.value}const d=/["\\\n\r]/g;function h(g){return g.replace(d,function(y){switch(y){case'"':return'\\"';case"\\":return"\\\\";case`
290
+ `:return"\\n";case"\r":return"\\r"}})}const m=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function w(g){return g.replace(m,function(y,_,x,S){if(_)switch(_){case"t":return" ";case"b":return"\b";case"n":return`
291
+ `;case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(x)return String.fromCharCode(parseInt(x,16));if(S)throw new Error("Unsupported U escape")})}return Ri}/*!
292
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
293
+ */var Ni,Po;function Qu(){if(Po)return Ni;Po=1;const r=ia(),e=Dn(),t=Ju(),n=sa();Ni=class{constructor({createMessageDigest:a=()=>new e("sha256"),canonicalIdMap:o=new Map,maxDeepIterations:l=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",o),this.createMessageDigest=a,this.maxDeepIterations=l,this.quads=null,this.deepIterations=null}async main(a){this.deepIterations=new Map,this.quads=a;for(const g of a)this._addBlankNodeQuadInfo({quad:g,component:g.subject}),this._addBlankNodeQuadInfo({quad:g,component:g.object}),this._addBlankNodeQuadInfo({quad:g,component:g.graph});const o=new Map,l=[...this.blankNodeInfo.keys()];let d=0;for(const g of l)++d%100===0&&await this._yield(),await this._hashAndTrackBlankNode({id:g,hashToBlankNodes:o});const h=[...o.keys()].sort(),m=[];for(const g of h){const y=o.get(g);if(y.length>1){m.push(y);continue}const _=y[0];this.canonicalIssuer.getId(_)}for(const g of m){const y=[];for(const _ of g){if(this.canonicalIssuer.hasId(_))continue;const x=new r("_:b");x.getId(_);const S=await this.hashNDegreeQuads(_,x);y.push(S)}y.sort(i);for(const _ of y){const x=_.issuer.getOldIds();for(const S of x)this.canonicalIssuer.getId(S)}}const w=[];for(const g of this.quads){const y=n.serializeQuadComponents(this._componentWithCanonicalId(g.subject),g.predicate,this._componentWithCanonicalId(g.object),this._componentWithCanonicalId(g.graph));w.push(y)}return w.sort(),w.join("")}async hashFirstDegreeQuads(a){const o=[],l=this.blankNodeInfo.get(a),d=l.quads;for(const m of d){const w={subject:null,predicate:m.predicate,object:null,graph:null};w.subject=this.modifyFirstDegreeComponent(a,m.subject,"subject"),w.object=this.modifyFirstDegreeComponent(a,m.object,"object"),w.graph=this.modifyFirstDegreeComponent(a,m.graph,"graph"),o.push(n.serializeQuad(w))}o.sort();const h=this.createMessageDigest();for(const m of o)h.update(m);return l.hash=await h.digest(),l.hash}async hashRelatedBlankNode(a,o,l,d){let h;this.canonicalIssuer.hasId(a)?h=this.canonicalIssuer.getId(a):l.hasId(a)?h=l.getId(a):h=this.blankNodeInfo.get(a).hash;const m=this.createMessageDigest();return m.update(d),d!=="g"&&m.update(this.getRelatedPredicate(o)),m.update(h),m.digest()}async hashNDegreeQuads(a,o){const l=this.deepIterations.get(a)||0;if(l>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(a,l+1);const d=this.createMessageDigest(),h=await this.createHashToRelated(a,o),m=[...h.keys()].sort();for(const w of m){d.update(w);let g="",y;const _=new t(h.get(w));let x=0;for(;_.hasNext();){const S=_.next();++x%3===0&&await this._yield();let I=o.clone(),b="";const c=[];let p=!1;for(const N of S)if(this.canonicalIssuer.hasId(N)?b+=this.canonicalIssuer.getId(N):(I.hasId(N)||c.push(N),b+=I.getId(N)),g.length!==0&&b>g){p=!0;break}if(!p){for(const N of c){const D=await this.hashNDegreeQuads(N,I);if(b+=I.getId(N),b+=`<${D.hash}>`,I=D.issuer,g.length!==0&&b>g){p=!0;break}}p||(g.length===0||b<g)&&(g=b,y=I)}}d.update(g),o=y}return{hash:await d.digest(),issuer:o}}modifyFirstDegreeComponent(a,o){return o.termType!=="BlankNode"?o:{termType:"BlankNode",value:o.value===a?"_:a":"_:z"}}getRelatedPredicate(a){return`<${a.predicate.value}>`}async createHashToRelated(a,o){const l=new Map,d=this.blankNodeInfo.get(a).quads;let h=0;for(const m of d)++h%100===0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:m,component:m.subject,position:"s",id:a,issuer:o,hashToRelated:l}),this._addRelatedBlankNodeHash({quad:m,component:m.object,position:"o",id:a,issuer:o,hashToRelated:l}),this._addRelatedBlankNodeHash({quad:m,component:m.graph,position:"g",id:a,issuer:o,hashToRelated:l})]);return l}async _hashAndTrackBlankNode({id:a,hashToBlankNodes:o}){const l=await this.hashFirstDegreeQuads(a),d=o.get(l);d?d.push(a):o.set(l,[a])}_addBlankNodeQuadInfo({quad:a,component:o}){if(o.termType!=="BlankNode")return;const l=o.value,d=this.blankNodeInfo.get(l);d?d.quads.add(a):this.blankNodeInfo.set(l,{quads:new Set([a]),hash:null})}async _addRelatedBlankNodeHash({quad:a,component:o,position:l,id:d,issuer:h,hashToRelated:m}){if(!(o.termType==="BlankNode"&&o.value!==d))return;const w=o.value,g=await this.hashRelatedBlankNode(w,a,h,l),y=m.get(g);y?y.push(w):m.set(g,[w])}_componentWithCanonicalId(a){return a.termType==="BlankNode"&&!a.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(a.value)}:a}async _yield(){return new Promise(a=>setImmediate(a))}};function i(s,a){return s.hash<a.hash?-1:s.hash>a.hash?1:0}return Ni}/*!
294
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
295
+ */var Ti,qo;function _f(){if(qo)return Ti;qo=1;const r=Dn(),e=Qu();return Ti=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(n,i,s){return i.termType!=="BlankNode"?i:s==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:i.value===n?"_:a":"_:z"}}getRelatedPredicate(n){return n.predicate.value}async createHashToRelated(n,i){const s=new Map,a=this.blankNodeInfo.get(n).quads;let o=0;for(const l of a){let d,h;if(l.subject.termType==="BlankNode"&&l.subject.value!==n)h=l.subject.value,d="p";else if(l.object.termType==="BlankNode"&&l.object.value!==n)h=l.object.value,d="r";else continue;++o%100===0&&await this._yield();const m=await this.hashRelatedBlankNode(h,l,i,d),w=s.get(m);w?w.push(h):s.set(m,[h])}return s}},Ti}/*!
296
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
297
+ */var Ai,Bo;function Xu(){if(Bo)return Ai;Bo=1;const r=ia(),e=Dn(),t=Ju(),n=sa();Ai=class{constructor({createMessageDigest:a=()=>new e("sha256"),canonicalIdMap:o=new Map,maxDeepIterations:l=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",o),this.createMessageDigest=a,this.maxDeepIterations=l,this.quads=null,this.deepIterations=null}main(a){this.deepIterations=new Map,this.quads=a;for(const w of a)this._addBlankNodeQuadInfo({quad:w,component:w.subject}),this._addBlankNodeQuadInfo({quad:w,component:w.object}),this._addBlankNodeQuadInfo({quad:w,component:w.graph});const o=new Map,l=[...this.blankNodeInfo.keys()];for(const w of l)this._hashAndTrackBlankNode({id:w,hashToBlankNodes:o});const d=[...o.keys()].sort(),h=[];for(const w of d){const g=o.get(w);if(g.length>1){h.push(g);continue}const y=g[0];this.canonicalIssuer.getId(y)}for(const w of h){const g=[];for(const y of w){if(this.canonicalIssuer.hasId(y))continue;const _=new r("_:b");_.getId(y);const x=this.hashNDegreeQuads(y,_);g.push(x)}g.sort(i);for(const y of g){const _=y.issuer.getOldIds();for(const x of _)this.canonicalIssuer.getId(x)}}const m=[];for(const w of this.quads){const g=n.serializeQuadComponents(this._componentWithCanonicalId({component:w.subject}),w.predicate,this._componentWithCanonicalId({component:w.object}),this._componentWithCanonicalId({component:w.graph}));m.push(g)}return m.sort(),m.join("")}hashFirstDegreeQuads(a){const o=[],l=this.blankNodeInfo.get(a),d=l.quads;for(const m of d){const w={subject:null,predicate:m.predicate,object:null,graph:null};w.subject=this.modifyFirstDegreeComponent(a,m.subject,"subject"),w.object=this.modifyFirstDegreeComponent(a,m.object,"object"),w.graph=this.modifyFirstDegreeComponent(a,m.graph,"graph"),o.push(n.serializeQuad(w))}o.sort();const h=this.createMessageDigest();for(const m of o)h.update(m);return l.hash=h.digest(),l.hash}hashRelatedBlankNode(a,o,l,d){let h;this.canonicalIssuer.hasId(a)?h=this.canonicalIssuer.getId(a):l.hasId(a)?h=l.getId(a):h=this.blankNodeInfo.get(a).hash;const m=this.createMessageDigest();return m.update(d),d!=="g"&&m.update(this.getRelatedPredicate(o)),m.update(h),m.digest()}hashNDegreeQuads(a,o){const l=this.deepIterations.get(a)||0;if(l>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(a,l+1);const d=this.createMessageDigest(),h=this.createHashToRelated(a,o),m=[...h.keys()].sort();for(const w of m){d.update(w);let g="",y;const _=new t(h.get(w));for(;_.hasNext();){const x=_.next();let S=o.clone(),I="";const b=[];let c=!1;for(const p of x)if(this.canonicalIssuer.hasId(p)?I+=this.canonicalIssuer.getId(p):(S.hasId(p)||b.push(p),I+=S.getId(p)),g.length!==0&&I>g){c=!0;break}if(!c){for(const p of b){const N=this.hashNDegreeQuads(p,S);if(I+=S.getId(p),I+=`<${N.hash}>`,S=N.issuer,g.length!==0&&I>g){c=!0;break}}c||(g.length===0||I<g)&&(g=I,y=S)}}d.update(g),o=y}return{hash:d.digest(),issuer:o}}modifyFirstDegreeComponent(a,o){return o.termType!=="BlankNode"?o:{termType:"BlankNode",value:o.value===a?"_:a":"_:z"}}getRelatedPredicate(a){return`<${a.predicate.value}>`}createHashToRelated(a,o){const l=new Map,d=this.blankNodeInfo.get(a).quads;for(const h of d)this._addRelatedBlankNodeHash({quad:h,component:h.subject,position:"s",id:a,issuer:o,hashToRelated:l}),this._addRelatedBlankNodeHash({quad:h,component:h.object,position:"o",id:a,issuer:o,hashToRelated:l}),this._addRelatedBlankNodeHash({quad:h,component:h.graph,position:"g",id:a,issuer:o,hashToRelated:l});return l}_hashAndTrackBlankNode({id:a,hashToBlankNodes:o}){const l=this.hashFirstDegreeQuads(a),d=o.get(l);d?d.push(a):o.set(l,[a])}_addBlankNodeQuadInfo({quad:a,component:o}){if(o.termType!=="BlankNode")return;const l=o.value,d=this.blankNodeInfo.get(l);d?d.quads.add(a):this.blankNodeInfo.set(l,{quads:new Set([a]),hash:null})}_addRelatedBlankNodeHash({quad:a,component:o,position:l,id:d,issuer:h,hashToRelated:m}){if(!(o.termType==="BlankNode"&&o.value!==d))return;const w=o.value,g=this.hashRelatedBlankNode(w,a,h,l),y=m.get(g);y?y.push(w):m.set(g,[w])}_componentWithCanonicalId({component:a}){return a.termType==="BlankNode"&&!a.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(a.value)}:a}};function i(s,a){return s.hash<a.hash?-1:s.hash>a.hash?1:0}return Ai}/*!
298
+ * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.
299
+ */var Li,Fo;function xf(){if(Fo)return Li;Fo=1;const r=Dn(),e=Xu();return Li=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(n,i,s){return i.termType!=="BlankNode"?i:s==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:i.value===n?"_:a":"_:z"}}getRelatedPredicate(n){return n.predicate.value}createHashToRelated(n,i){const s=new Map,a=this.blankNodeInfo.get(n).quads;for(const o of a){let l,d;if(o.subject.termType==="BlankNode"&&o.subject.value!==n)d=o.subject.value,l="p";else if(o.object.termType==="BlankNode"&&o.object.value!==n)d=o.object.value,l="r";else continue;const h=this.hashRelatedBlankNode(d,o,i,l),m=s.get(h);m?m.push(d):s.set(h,[d])}return s}},Li}const Sf={},Ef=Object.freeze(Object.defineProperty({__proto__:null,default:Sf},Symbol.toStringTag,{value:"Module"})),If=vc(Ef);var Uo;function Rf(){return Uo||(Uo=1,function(r){const e=Qu(),t=_f(),n=Xu(),i=xf();let s;try{s=If}catch{}function a(o){return Array.isArray(o)?o:r.NQuads.legacyDatasetToQuads(o)}r.NQuads=sa(),r.IdentifierIssuer=ia(),r._rdfCanonizeNative=function(o){return o&&(s=o),s},r.canonize=async function(o,l){const d=a(o);if(l.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(l.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((h,m)=>s.canonize(d,l,(w,g)=>w?m(w):h(g)))}if(l.algorithm==="URDNA2015")return new e(l).main(d);if(l.algorithm==="URGNA2012"){if(l.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new t(l).main(d)}throw"algorithm"in l?new Error("Invalid RDF Dataset Canonicalization algorithm: "+l.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")},r._canonizeSync=function(o,l){const d=a(o);if(l.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(l.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return s.canonizeSync(d,l)}if(l.algorithm==="URDNA2015")return new n(l).main(d);if(l.algorithm==="URGNA2012"){if(l.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(l).main(d)}throw"algorithm"in l?new Error("Invalid RDF Dataset Canonicalization algorithm: "+l.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}}(_i)),_i}var ji,Ho;function aa(){return Ho||(Ho=1,ji=Rf()),ji}var Oi,Vo;function Xe(){if(Vo)return Oi;Vo=1;const r={};return Oi=r,r.isArray=Array.isArray,r.isBoolean=e=>typeof e=="boolean"||Object.prototype.toString.call(e)==="[object Boolean]",r.isDouble=e=>r.isNumber(e)&&(String(e).indexOf(".")!==-1||Math.abs(e)>=1e21),r.isEmptyObject=e=>r.isObject(e)&&Object.keys(e).length===0,r.isNumber=e=>typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]",r.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),r.isObject=e=>Object.prototype.toString.call(e)==="[object Object]",r.isString=e=>typeof e=="string"||Object.prototype.toString.call(e)==="[object String]",r.isUndefined=e=>typeof e>"u",Oi}var $i,Go;function _t(){if(Go)return $i;Go=1;const r=Xe(),e={};return $i=e,e.isSubject=t=>r.isObject(t)&&!("@value"in t||"@set"in t||"@list"in t)?Object.keys(t).length>1||!("@id"in t):!1,e.isSubjectReference=t=>r.isObject(t)&&Object.keys(t).length===1&&"@id"in t,e.isValue=t=>r.isObject(t)&&"@value"in t,e.isList=t=>r.isObject(t)&&"@list"in t,e.isGraph=t=>r.isObject(t)&&"@graph"in t&&Object.keys(t).filter(n=>n!=="@id"&&n!=="@index").length===1,e.isSimpleGraph=t=>e.isGraph(t)&&!("@id"in t),e.isBlankNode=t=>{if(r.isObject(t)){if("@id"in t){const n=t["@id"];return!r.isString(n)||n.indexOf("_:")===0}return Object.keys(t).length===0||!("@value"in t||"@set"in t||"@list"in t)}return!1},$i}var ki,Wo;function et(){return Wo||(Wo=1,ki=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}}),ki}var Di,zo;function Ye(){if(zo)return Di;zo=1;const r=_t(),e=Xe(),t=aa().IdentifierIssuer,n=et(),i=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,a=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,o=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l=/^@[a-zA-Z]+$/,d={headers:{accept:"application/ld+json, application/json"}},h={};Di=h,h.IdentifierIssuer=t,h.REGEX_BCP47=i,h.REGEX_KEYWORD=l,h.clone=function(w){if(w&&typeof w=="object"){let g;if(e.isArray(w)){g=[];for(let y=0;y<w.length;++y)g[y]=h.clone(w[y])}else if(w instanceof Map){g=new Map;for(const[y,_]of w)g.set(y,h.clone(_))}else if(w instanceof Set){g=new Set;for(const y of w)g.add(h.clone(y))}else if(e.isObject(w)){g={};for(const y in w)g[y]=h.clone(w[y])}else g=w.toString();return g}return w},h.asArray=function(w){return Array.isArray(w)?w:[w]},h.buildHeaders=(w={})=>{if(Object.keys(w).some(y=>y.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+d.headers.accept+'" is supported.');return Object.assign({Accept:d.headers.accept},w)},h.parseLinkHeader=w=>{const g={},y=w.match(s);for(let _=0;_<y.length;++_){let x=y[_].match(a);if(!x)continue;const S={target:x[1]},I=x[2];for(;x=o.exec(I);)S[x[1]]=x[2]===void 0?x[3]:x[2];const b=S.rel||"";Array.isArray(g[b])?g[b].push(S):g.hasOwnProperty(b)?g[b]=[g[b],S]:g[b]=S}return g},h.validateTypeValue=(w,g)=>{if(!e.isString(w)&&!(e.isArray(w)&&w.every(y=>e.isString(y)))){if(g&&e.isObject(w))switch(Object.keys(w).length){case 0:return;case 1:if("@default"in w&&h.asArray(w["@default"]).every(y=>e.isString(y)))return}throw new n('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:w})}},h.hasProperty=(w,g)=>{if(w.hasOwnProperty(g)){const y=w[g];return!e.isArray(y)||y.length>0}return!1},h.hasValue=(w,g,y)=>{if(h.hasProperty(w,g)){let _=w[g];const x=r.isList(_);if(e.isArray(_)||x){x&&(_=_["@list"]);for(let S=0;S<_.length;++S)if(h.compareValues(y,_[S]))return!0}else if(!e.isArray(y))return h.compareValues(y,_)}return!1},h.addValue=(w,g,y,_)=>{if(_=_||{},"propertyIsArray"in _||(_.propertyIsArray=!1),"valueIsArray"in _||(_.valueIsArray=!1),"allowDuplicate"in _||(_.allowDuplicate=!0),"prependValue"in _||(_.prependValue=!1),_.valueIsArray)w[g]=y;else if(e.isArray(y)){y.length===0&&_.propertyIsArray&&!w.hasOwnProperty(g)&&(w[g]=[]),_.prependValue&&(y=y.concat(w[g]),w[g]=[]);for(let x=0;x<y.length;++x)h.addValue(w,g,y[x],_)}else if(w.hasOwnProperty(g)){const x=!_.allowDuplicate&&h.hasValue(w,g,y);!e.isArray(w[g])&&(!x||_.propertyIsArray)&&(w[g]=[w[g]]),x||(_.prependValue?w[g].unshift(y):w[g].push(y))}else w[g]=_.propertyIsArray?[y]:y},h.getValues=(w,g)=>[].concat(w[g]||[]),h.removeProperty=(w,g)=>{delete w[g]},h.removeValue=(w,g,y,_)=>{_=_||{},"propertyIsArray"in _||(_.propertyIsArray=!1);const x=h.getValues(w,g).filter(S=>!h.compareValues(S,y));x.length===0?h.removeProperty(w,g):x.length===1&&!_.propertyIsArray?w[g]=x[0]:w[g]=x},h.relabelBlankNodes=(w,g)=>{g=g||{};const y=g.issuer||new t("_:b");return m(y,w)},h.compareValues=(w,g)=>w===g||r.isValue(w)&&r.isValue(g)&&w["@value"]===g["@value"]&&w["@type"]===g["@type"]&&w["@language"]===g["@language"]&&w["@index"]===g["@index"]?!0:e.isObject(w)&&"@id"in w&&e.isObject(g)&&"@id"in g?w["@id"]===g["@id"]:!1,h.compareShortestLeast=(w,g)=>w.length<g.length?-1:g.length<w.length?1:w===g?0:w<g?-1:1;function m(w,g){if(e.isArray(g))for(let y=0;y<g.length;++y)g[y]=m(w,g[y]);else if(r.isList(g))g["@list"]=m(w,g["@list"]);else if(e.isObject(g)){r.isBlankNode(g)&&(g["@id"]=w.getId(g["@id"]));const y=Object.keys(g).sort();for(let _=0;_<y.length;++_){const x=y[_];x!=="@id"&&(g[x]=m(w,g[x]))}}return g}return Di}var Mi,Jo;function oa(){if(Jo)return Mi;Jo=1;const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",e="http://www.w3.org/2001/XMLSchema#";return Mi={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:r,RDF_LIST:r+"List",RDF_FIRST:r+"first",RDF_REST:r+"rest",RDF_NIL:r+"nil",RDF_TYPE:r+"type",RDF_PLAIN_LITERAL:r+"PlainLiteral",RDF_XML_LITERAL:r+"XMLLiteral",RDF_JSON_LITERAL:r+"JSON",RDF_OBJECT:r+"object",RDF_LANGSTRING:r+"langString",XSD:e,XSD_BOOLEAN:e+"boolean",XSD_DOUBLE:e+"double",XSD_INTEGER:e+"integer",XSD_STRING:e+"string"},Mi}var Ci,Qo;function Ku(){return Qo||(Qo=1,Ci=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}),Ci}var Pi,Xo;function Tt(){if(Xo)return Pi;Xo=1;const r=Xe(),e={};Pi=e,e.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:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.parse=(n,i)=>{const s={},a=e.parsers[i||"full"],o=a.regex.exec(n);let l=a.keys.length;for(;l--;)s[a.keys[l]]=o[l]===void 0?null:o[l];return(s.scheme==="https"&&s.port==="443"||s.scheme==="http"&&s.port==="80")&&(s.href=s.href.replace(":"+s.port,""),s.authority=s.authority.replace(":"+s.port,""),s.port=null),s.normalizedPath=e.removeDotSegments(s.path),s},e.prependBase=(n,i)=>{if(n===null||e.isAbsolute(i))return i;(!n||r.isString(n))&&(n=e.parse(n||""));const s=e.parse(i),a={protocol:n.protocol||""};if(s.authority!==null)a.authority=s.authority,a.path=s.path,a.query=s.query;else if(a.authority=n.authority,s.path==="")a.path=n.path,s.query!==null?a.query=s.query:a.query=n.query;else{if(s.path.indexOf("/")===0)a.path=s.path;else{let l=n.path;l=l.substr(0,l.lastIndexOf("/")+1),(l.length>0||n.authority)&&l.substr(-1)!=="/"&&(l+="/"),l+=s.path,a.path=l}a.query=s.query}s.path!==""&&(a.path=e.removeDotSegments(a.path));let o=a.protocol;return a.authority!==null&&(o+="//"+a.authority),o+=a.path,a.query!==null&&(o+="?"+a.query),s.fragment!==null&&(o+="#"+s.fragment),o===""&&(o="./"),o},e.removeBase=(n,i)=>{if(n===null)return i;(!n||r.isString(n))&&(n=e.parse(n||""));let s="";if(n.href!==""?s+=(n.protocol||"")+"//"+(n.authority||""):i.indexOf("//")&&(s+="//"),i.indexOf(s)!==0)return i;const a=e.parse(i.substr(s.length)),o=n.normalizedPath.split("/"),l=a.normalizedPath.split("/"),d=a.fragment||a.query?0:1;for(;o.length>0&&l.length>d&&o[0]===l[0];)o.shift(),l.shift();let h="";if(o.length>0){o.pop();for(let m=0;m<o.length;++m)h+="../"}return h+=l.join("/"),a.query!==null&&(h+="?"+a.query),a.fragment!==null&&(h+="#"+a.fragment),h===""&&(h="./"),h},e.removeDotSegments=n=>{if(n.length===0)return"";const i=n.split("/"),s=[];for(;i.length>0;){const a=i.shift(),o=i.length===0;if(a==="."){o&&s.push("");continue}if(a===".."){s.pop(),o&&s.push("");continue}s.push(a)}return n[0]==="/"&&s.length>0&&s[0]!==""&&s.unshift(""),s.length===1&&s[0]===""?"/":s.join("/")};const t=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;return e.isAbsolute=n=>r.isString(n)&&t.test(n),e.isRelative=n=>r.isString(n),Pi}var qi,Ko;function Nf(){if(Ko)return qi;Ko=1;const{parseLinkHeader:r,buildHeaders:e}=Ye(),{LINK_HEADER_CONTEXT:t}=oa(),n=et(),i=Ku(),{prependBase:s}=Tt(),a=/(^|(\r\n))link:/i;qi=({secure:l,headers:d={},xhr:h}={headers:{}})=>{return d=e(d),new i().wrapLoader(w);async function w(g){if(g.indexOf("http:")!==0&&g.indexOf("https:")!==0)throw new n('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:g});if(l&&g.indexOf("https")!==0)throw new n(`URL could not be dereferenced; secure mode is enabled and the URL's scheme is not "https".`,"jsonld.InvalidUrl",{code:"loading document failed",url:g});let y;try{y=await o(h,g,d)}catch(b){throw new n("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:g,cause:b})}if(y.status>=400)throw new n("URL could not be dereferenced: "+y.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:g,httpStatusCode:y.status});let _={contextUrl:null,documentUrl:g,document:y.response},x=null;const S=y.getResponseHeader("Content-Type");let I;if(a.test(y.getAllResponseHeaders())&&(I=y.getResponseHeader("Link")),I&&S!=="application/ld+json"){const b=r(I),c=b[t];if(Array.isArray(c))throw new n("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:g});c&&(_.contextUrl=c.target),x=b.alternate,x&&x.type=="application/ld+json"&&!(S||"").match(/^application\/(\w*\+)?json$/)&&(_=await w(s(g,x.target)))}return _}};function o(l,d,h){l=l||XMLHttpRequest;const m=new l;return new Promise((w,g)=>{m.onload=()=>w(m),m.onerror=y=>g(y),m.open("GET",d,!0);for(const y in h)m.setRequestHeader(y,h[y]);m.send()})}return qi}var Bi,Yo;function Tf(){if(Yo)return Bi;Yo=1;const r=Nf(),e={};return Bi=e,e.setupDocumentLoaders=function(t){typeof XMLHttpRequest<"u"&&(t.documentLoaders.xhr=r,t.useDocumentLoader("xhr"))},e.setupGlobals=function(t){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t.JsonLdProcessor})},Bi}var Fi,Zo;function Af(){return Zo||(Zo=1,Fi=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Fi}var Ui,el;function Lf(){if(el)return Ui;el=1,Ui=r,r.Node=i,r.create=r;function r(s){var a=this;if(a instanceof r||(a=new r),a.tail=null,a.head=null,a.length=0,s&&typeof s.forEach=="function")s.forEach(function(d){a.push(d)});else if(arguments.length>0)for(var o=0,l=arguments.length;o<l;o++)a.push(arguments[o]);return a}r.prototype.removeNode=function(s){if(s.list!==this)throw new Error("removing node which does not belong to this list");var a=s.next,o=s.prev;return a&&(a.prev=o),o&&(o.next=a),s===this.head&&(this.head=a),s===this.tail&&(this.tail=o),s.list.length--,s.next=null,s.prev=null,s.list=null,a},r.prototype.unshiftNode=function(s){if(s!==this.head){s.list&&s.list.removeNode(s);var a=this.head;s.list=this,s.next=a,a&&(a.prev=s),this.head=s,this.tail||(this.tail=s),this.length++}},r.prototype.pushNode=function(s){if(s!==this.tail){s.list&&s.list.removeNode(s);var a=this.tail;s.list=this,s.prev=a,a&&(a.next=s),this.tail=s,this.head||(this.head=s),this.length++}},r.prototype.push=function(){for(var s=0,a=arguments.length;s<a;s++)t(this,arguments[s]);return this.length},r.prototype.unshift=function(){for(var s=0,a=arguments.length;s<a;s++)n(this,arguments[s]);return this.length},r.prototype.pop=function(){if(this.tail){var s=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,s}},r.prototype.shift=function(){if(this.head){var s=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,s}},r.prototype.forEach=function(s,a){a=a||this;for(var o=this.head,l=0;o!==null;l++)s.call(a,o.value,l,this),o=o.next},r.prototype.forEachReverse=function(s,a){a=a||this;for(var o=this.tail,l=this.length-1;o!==null;l--)s.call(a,o.value,l,this),o=o.prev},r.prototype.get=function(s){for(var a=0,o=this.head;o!==null&&a<s;a++)o=o.next;if(a===s&&o!==null)return o.value},r.prototype.getReverse=function(s){for(var a=0,o=this.tail;o!==null&&a<s;a++)o=o.prev;if(a===s&&o!==null)return o.value},r.prototype.map=function(s,a){a=a||this;for(var o=new r,l=this.head;l!==null;)o.push(s.call(a,l.value,this)),l=l.next;return o},r.prototype.mapReverse=function(s,a){a=a||this;for(var o=new r,l=this.tail;l!==null;)o.push(s.call(a,l.value,this)),l=l.prev;return o},r.prototype.reduce=function(s,a){var o,l=this.head;if(arguments.length>1)o=a;else if(this.head)l=this.head.next,o=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var d=0;l!==null;d++)o=s(o,l.value,d),l=l.next;return o},r.prototype.reduceReverse=function(s,a){var o,l=this.tail;if(arguments.length>1)o=a;else if(this.tail)l=this.tail.prev,o=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var d=this.length-1;l!==null;d--)o=s(o,l.value,d),l=l.prev;return o},r.prototype.toArray=function(){for(var s=new Array(this.length),a=0,o=this.head;o!==null;a++)s[a]=o.value,o=o.next;return s},r.prototype.toArrayReverse=function(){for(var s=new Array(this.length),a=0,o=this.tail;o!==null;a++)s[a]=o.value,o=o.prev;return s},r.prototype.slice=function(s,a){a=a||this.length,a<0&&(a+=this.length),s=s||0,s<0&&(s+=this.length);var o=new r;if(a<s||a<0)return o;s<0&&(s=0),a>this.length&&(a=this.length);for(var l=0,d=this.head;d!==null&&l<s;l++)d=d.next;for(;d!==null&&l<a;l++,d=d.next)o.push(d.value);return o},r.prototype.sliceReverse=function(s,a){a=a||this.length,a<0&&(a+=this.length),s=s||0,s<0&&(s+=this.length);var o=new r;if(a<s||a<0)return o;s<0&&(s=0),a>this.length&&(a=this.length);for(var l=this.length,d=this.tail;d!==null&&l>a;l--)d=d.prev;for(;d!==null&&l>s;l--,d=d.prev)o.push(d.value);return o},r.prototype.splice=function(s,a,...o){s>this.length&&(s=this.length-1),s<0&&(s=this.length+s);for(var l=0,d=this.head;d!==null&&l<s;l++)d=d.next;for(var h=[],l=0;d&&l<a;l++)h.push(d.value),d=this.removeNode(d);d===null&&(d=this.tail),d!==this.head&&d!==this.tail&&(d=d.prev);for(var l=0;l<o.length;l++)d=e(this,d,o[l]);return h},r.prototype.reverse=function(){for(var s=this.head,a=this.tail,o=s;o!==null;o=o.prev){var l=o.prev;o.prev=o.next,o.next=l}return this.head=a,this.tail=s,this};function e(s,a,o){var l=a===s.head?new i(o,null,a,s):new i(o,a,a.next,s);return l.next===null&&(s.tail=l),l.prev===null&&(s.head=l),s.length++,l}function t(s,a){s.tail=new i(a,s.tail,null,s),s.head||(s.head=s.tail),s.length++}function n(s,a){s.head=new i(a,null,s.head,s),s.tail||(s.tail=s.head),s.length++}function i(s,a,o,l){if(!(this instanceof i))return new i(s,a,o,l);this.list=l,this.value=s,a?(a.next=this,this.prev=a):this.prev=null,o?(o.prev=this,this.next=o):this.next=null}try{Af()(r)}catch{}return Ui}var Hi,tl;function Yu(){if(tl)return Hi;tl=1;const r=Lf(),e=Symbol("max"),t=Symbol("length"),n=Symbol("lengthCalculator"),i=Symbol("allowStale"),s=Symbol("maxAge"),a=Symbol("dispose"),o=Symbol("noDisposeOnSet"),l=Symbol("lruList"),d=Symbol("cache"),h=Symbol("updateAgeOnGet"),m=()=>1;class w{constructor(c){if(typeof c=="number"&&(c={max:c}),c||(c={}),c.max&&(typeof c.max!="number"||c.max<0))throw new TypeError("max must be a non-negative number");this[e]=c.max||1/0;const p=c.length||m;if(this[n]=typeof p!="function"?m:p,this[i]=c.stale||!1,c.maxAge&&typeof c.maxAge!="number")throw new TypeError("maxAge must be a number");this[s]=c.maxAge||0,this[a]=c.dispose,this[o]=c.noDisposeOnSet||!1,this[h]=c.updateAgeOnGet||!1,this.reset()}set max(c){if(typeof c!="number"||c<0)throw new TypeError("max must be a non-negative number");this[e]=c||1/0,_(this)}get max(){return this[e]}set allowStale(c){this[i]=!!c}get allowStale(){return this[i]}set maxAge(c){if(typeof c!="number")throw new TypeError("maxAge must be a non-negative number");this[s]=c,_(this)}get maxAge(){return this[s]}set lengthCalculator(c){typeof c!="function"&&(c=m),c!==this[n]&&(this[n]=c,this[t]=0,this[l].forEach(p=>{p.length=this[n](p.value,p.key),this[t]+=p.length})),_(this)}get lengthCalculator(){return this[n]}get length(){return this[t]}get itemCount(){return this[l].length}rforEach(c,p){p=p||this;for(let N=this[l].tail;N!==null;){const D=N.prev;I(this,c,N,p),N=D}}forEach(c,p){p=p||this;for(let N=this[l].head;N!==null;){const D=N.next;I(this,c,N,p),N=D}}keys(){return this[l].toArray().map(c=>c.key)}values(){return this[l].toArray().map(c=>c.value)}reset(){this[a]&&this[l]&&this[l].length&&this[l].forEach(c=>this[a](c.key,c.value)),this[d]=new Map,this[l]=new r,this[t]=0}dump(){return this[l].map(c=>y(this,c)?!1:{k:c.key,v:c.value,e:c.now+(c.maxAge||0)}).toArray().filter(c=>c)}dumpLru(){return this[l]}set(c,p,N){if(N=N||this[s],N&&typeof N!="number")throw new TypeError("maxAge must be a number");const D=N?Date.now():0,T=this[n](p,c);if(this[d].has(c)){if(T>this[e])return x(this,this[d].get(c)),!1;const M=this[d].get(c).value;return this[a]&&(this[o]||this[a](c,M.value)),M.now=D,M.maxAge=N,M.value=p,this[t]+=T-M.length,M.length=T,this.get(c),_(this),!0}const q=new S(c,p,T,D,N);return q.length>this[e]?(this[a]&&this[a](c,p),!1):(this[t]+=q.length,this[l].unshift(q),this[d].set(c,this[l].head),_(this),!0)}has(c){if(!this[d].has(c))return!1;const p=this[d].get(c).value;return!y(this,p)}get(c){return g(this,c,!0)}peek(c){return g(this,c,!1)}pop(){const c=this[l].tail;return c?(x(this,c),c.value):null}del(c){x(this,this[d].get(c))}load(c){this.reset();const p=Date.now();for(let N=c.length-1;N>=0;N--){const D=c[N],T=D.e||0;if(T===0)this.set(D.k,D.v);else{const q=T-p;q>0&&this.set(D.k,D.v,q)}}}prune(){this[d].forEach((c,p)=>g(this,p,!1))}}const g=(b,c,p)=>{const N=b[d].get(c);if(N){const D=N.value;if(y(b,D)){if(x(b,N),!b[i])return}else p&&(b[h]&&(N.value.now=Date.now()),b[l].unshiftNode(N));return D.value}},y=(b,c)=>{if(!c||!c.maxAge&&!b[s])return!1;const p=Date.now()-c.now;return c.maxAge?p>c.maxAge:b[s]&&p>b[s]},_=b=>{if(b[t]>b[e])for(let c=b[l].tail;b[t]>b[e]&&c!==null;){const p=c.prev;x(b,c),c=p}},x=(b,c)=>{if(c){const p=c.value;b[a]&&b[a](p.key,p.value),b[t]-=p.length,b[d].delete(p.key),b[l].removeNode(c)}};class S{constructor(c,p,N,D,T){this.key=c,this.value=p,this.length=N,this.now=D,this.maxAge=T||0}}const I=(b,c,p,N)=>{let D=p.value;y(b,D)&&(x(b,p),b[i]||(D=void 0)),D&&c.call(N,D.value,D.key,b)};return Hi=w,Hi}var Vi,rl;function jf(){if(rl)return Vi;rl=1;const r=Yu(),e=10;return Vi=class{constructor({document:n}){this.document=n,this.cache=new r({max:e})}getProcessed(n){return this.cache.get(n)}setProcessed(n,i){this.cache.set(n,i)}},Vi}var Gi,nl;function Of(){if(nl)return Gi;nl=1;const{isArray:r,isObject:e,isString:t}=Xe(),{asArray:n}=Ye(),{prependBase:i}=Tt(),s=et(),a=jf(),o=10;Gi=class{constructor({sharedCache:m}){this.perOpCache=new Map,this.sharedCache=m}async resolve({activeCtx:m,context:w,documentLoader:g,base:y,cycles:_=new Set}){w&&e(w)&&w["@context"]&&(w=w["@context"]),w=n(w);const x=[];for(const S of w){if(t(S)){let c=this._get(S);c||(c=await this._resolveRemoteContext({activeCtx:m,url:S,documentLoader:g,base:y,cycles:_})),r(c)?x.push(...c):x.push(c);continue}if(S===null){x.push(new a({document:null}));continue}e(S)||l(w);const I=JSON.stringify(S);let b=this._get(I);b||(b=new a({document:S}),this._cacheResolvedContext({key:I,resolved:b,tag:"static"})),x.push(b)}return x}_get(m){let w=this.perOpCache.get(m);if(!w){const g=this.sharedCache.get(m);g&&(w=g.get("static"),w&&this.perOpCache.set(m,w))}return w}_cacheResolvedContext({key:m,resolved:w,tag:g}){if(this.perOpCache.set(m,w),g!==void 0){let y=this.sharedCache.get(m);y||(y=new Map,this.sharedCache.set(m,y)),y.set(g,w)}return w}async _resolveRemoteContext({activeCtx:m,url:w,documentLoader:g,base:y,cycles:_}){w=i(y,w);const{context:x,remoteDoc:S}=await this._fetchContext({activeCtx:m,url:w,documentLoader:g,cycles:_});y=S.documentUrl||w,d({context:x,base:y});const I=await this.resolve({activeCtx:m,context:x,documentLoader:g,base:y,cycles:_});return this._cacheResolvedContext({key:w,resolved:I,tag:S.tag}),I}async _fetchContext({activeCtx:m,url:w,documentLoader:g,cycles:y}){if(y.size>o)throw new s("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:m.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:o});if(y.has(w))throw new s("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:m.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:w});y.add(w);let _,x;try{x=await g(w),_=x.document||null,t(_)&&(_=JSON.parse(_))}catch(S){throw new s(`Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context. URL: "${w}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:w,cause:S})}if(!e(_))throw new s(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${w}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:w});return"@context"in _?_={"@context":_["@context"]}:_={"@context":{}},x.contextUrl&&(r(_["@context"])||(_["@context"]=[_["@context"]]),_["@context"].push(x.contextUrl)),{context:_,remoteDoc:x}}};function l(h){throw new s("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:h})}function d({context:h,base:m}){if(!h)return;const w=h["@context"];if(t(w)){h["@context"]=i(m,w);return}if(r(w)){for(let g=0;g<w.length;++g){const y=w[g];if(t(y)){w[g]=i(m,y);continue}e(y)&&d({context:{"@context":y},base:m})}return}if(e(w))for(const g in w)d({context:w[g],base:m})}return Gi}var Wi,il;function $f(){return il||(il=1,Wi=aa().NQuads),Wi}var zi,sl;function Xr(){if(sl)return zi;sl=1;const r=et(),{isArray:e}=Xe(),{asArray:t}=Ye(),n={};zi=n,n.defaultEventHandler=null,n.setupEventHandler=({options:a={}})=>{const o=[].concat(a.safe?n.safeEventHandler:[],a.eventHandler?t(a.eventHandler):[],n.defaultEventHandler?n.defaultEventHandler:[]);return o.length===0?null:o},n.handleEvent=({event:a,options:o})=>{i({event:a,handlers:o.eventHandler})};function i({event:a,handlers:o}){let l=!0;for(let d=0;l&&d<o.length;++d){l=!1;const h=o[d];if(e(h))l=i({event:a,handlers:h});else if(typeof h=="function")h({event:a,next:()=>{l=!0}});else if(typeof h=="object")a.code in h?h[a.code]({event:a,next:()=>{l=!0}}):l=!0;else throw new r("Invalid event handler.","jsonld.InvalidEventHandler",{event:a})}return l}const s=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);return n.safeEventHandler=function({event:o,next:l}){if(o.level==="warning"&&s.has(o.code))throw new r("Safe mode validation error.","jsonld.ValidationError",{event:o});l()},n.logEventHandler=function({event:o,next:l}){console.log(`EVENT: ${o.message}`,{event:o}),l()},n.logWarningEventHandler=function({event:o,next:l}){o.level==="warning"&&console.warn(`WARNING: ${o.message}`,{event:o}),l()},n.unhandledEventHandler=function({event:o}){throw new r("No handler for event.","jsonld.UnhandledEvent",{event:o})},n.setDefaultEventHandler=function({eventHandler:a}={}){n.defaultEventHandler=a?t(a):null},zi}var Ji,al;function Bt(){if(al)return Ji;al=1;const r=Ye(),e=et(),{isArray:t,isObject:n,isString:i,isUndefined:s}=Xe(),{isAbsolute:a,isRelative:o,prependBase:l}=Tt(),{handleEvent:d}=Xr(),{REGEX_BCP47:h,REGEX_KEYWORD:m,asArray:w,compareShortestLeast:g}=Ye(),y=new Map,_=1e4,x={};Ji=x,x.process=async({activeCtx:b,localCtx:c,options:p,propagate:N=!0,overrideProtected:D=!1,cycles:T=new Set})=>{if(n(c)&&"@context"in c&&t(c["@context"])&&(c=c["@context"]),w(c).length===0)return b;const R=[],M=[({event:Y,next:L})=>{R.push(Y),L()}];p.eventHandler&&M.push(p.eventHandler);const B=p;p={...p,eventHandler:M};const A=await p.contextResolver.resolve({activeCtx:b,context:c,documentLoader:p.documentLoader,base:p.base});n(A[0].document)&&typeof A[0].document["@propagate"]=="boolean"&&(N=A[0].document["@propagate"]);let j=b;!N&&!j.previousContext&&(j=j.clone(),j.previousContext=b);for(const Y of A){let{document:L}=Y;if(b=j,L===null){if(!D&&Object.keys(b.protected).length!==0)throw new e("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});j=b=x.getInitialContext(p).clone();continue}const ee=Y.getProcessed(b);if(ee){if(B.eventHandler)for(const K of ee.events)d({event:K,options:B});j=b=ee.context;continue}if(n(L)&&"@context"in L&&(L=L["@context"]),!n(L))throw new e("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:L});j=j.clone();const C=new Map;if("@version"in L){if(L["@version"]!==1.1)throw new e("Unsupported JSON-LD version: "+L["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:L});if(b.processingMode&&b.processingMode==="json-ld-1.0")throw new e("@version: "+L["@version"]+" not compatible with "+b.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:L});j.processingMode="json-ld-1.1",j["@version"]=L["@version"],C.set("@version",!0)}if(j.processingMode=j.processingMode||b.processingMode,"@base"in L){let K=L["@base"];if(!(K===null||a(K)))if(o(K))K=l(j["@base"],K);else throw new e('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:L});j["@base"]=K,C.set("@base",!0)}if("@vocab"in L){const K=L["@vocab"];if(K===null)delete j["@vocab"];else if(i(K)){if(!a(K)&&x.processingMode(j,1))throw new e('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:L});{const v=S(j,K,{vocab:!0,base:!0},void 0,void 0,p);a(v)||p.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:v}},options:p}),j["@vocab"]=v}}else throw new e('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:L});C.set("@vocab",!0)}if("@language"in L){const K=L["@language"];if(K===null)delete j["@language"];else if(i(K))K.match(h)||p.eventHandler&&d({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:K}},options:p}),j["@language"]=K.toLowerCase();else throw new e('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:L});C.set("@language",!0)}if("@direction"in L){const K=L["@direction"];if(b.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @direction not compatible with "+b.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:L});if(K===null)delete j["@direction"];else{if(K!=="ltr"&&K!=="rtl")throw new e('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:L});j["@direction"]=K}C.set("@direction",!0)}if("@propagate"in L){const K=L["@propagate"];if(b.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @propagate not compatible with "+b.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:L});if(typeof K!="boolean")throw new e("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:c});C.set("@propagate",!0)}if("@import"in L){const K=L["@import"];if(b.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @import not compatible with "+b.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:L});if(!i(K))throw new e("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:c});const v=await p.contextResolver.resolve({activeCtx:b,context:K,documentLoader:p.documentLoader,base:p.base});if(v.length!==1)throw new e("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:c});const U=v[0].getProcessed(b);if(U)L=U;else{const Q=v[0].document;if("@import"in Q)throw new e("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:c});for(const z in Q)L.hasOwnProperty(z)||(L[z]=Q[z]);v[0].setProcessed(b,L)}C.set("@import",!0)}C.set("@protected",L["@protected"]||!1);for(const K in L)if(x.createTermDefinition({activeCtx:j,localCtx:L,term:K,defined:C,options:p,overrideProtected:D}),n(L[K])&&"@context"in L[K]){const v=L[K]["@context"];let U=!0;if(i(v)){const Q=l(p.base,v);T.has(Q)?U=!1:T.add(Q)}if(U)try{await x.process({activeCtx:j.clone(),localCtx:L[K]["@context"],overrideProtected:!0,options:p,cycles:T})}catch{throw new e("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:L[K]["@context"],term:K})}}Y.setProcessed(b,{context:j,events:R})}return j},x.createTermDefinition=({activeCtx:b,localCtx:c,term:p,defined:N,options:D,overrideProtected:T=!1})=>{if(N.has(p)){if(N.get(p))return;throw new e("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:c,term:p})}N.set(p,!1);let q;if(c.hasOwnProperty(p)&&(q=c[p]),p==="@type"&&n(q)&&(q["@container"]||"@set")==="@set"&&x.processingMode(b,1.1)){const L=["@container","@id","@protected"],ee=Object.keys(q);if(ee.length===0||ee.some(C=>!L.includes(C)))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:c,term:p})}else{if(x.isKeyword(p))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:c,term:p});if(p.match(m)){D.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:p}},options:D});return}else if(p==="")throw new e("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:c})}const R=b.mappings.get(p);b.mappings.has(p)&&b.mappings.delete(p);let M=!1;if((i(q)||q===null)&&(M=!0,q={"@id":q}),!n(q))throw new e("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:c});const B={};b.mappings.set(p,B),B.reverse=!1;const A=["@container","@id","@language","@reverse","@type"];x.processingMode(b,1.1)&&A.push("@context","@direction","@index","@nest","@prefix","@protected");for(const L in q)if(!A.includes(L))throw new e("Invalid JSON-LD syntax; a term definition must not contain "+L,"jsonld.SyntaxError",{code:"invalid term definition",context:c});const j=p.indexOf(":");if(B._termHasColon=j>0,"@reverse"in q){if("@id"in q)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:c});if("@nest"in q)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:c});const L=q["@reverse"];if(!i(L))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:c});if(L.match(m)){D.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:L}},options:D}),R?b.mappings.set(p,R):b.mappings.delete(p);return}const ee=S(b,L,{vocab:!0,base:!1},c,N,D);if(!a(ee))throw new e("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:c});B["@id"]=ee,B.reverse=!0}else if("@id"in q){let L=q["@id"];if(L&&!i(L))throw new e("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:c});if(L===null)B["@id"]=null;else if(!x.isKeyword(L)&&L.match(m)){D.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:L}},options:D}),R?b.mappings.set(p,R):b.mappings.delete(p);return}else if(L!==p){if(L=S(b,L,{vocab:!0,base:!1},c,N,D),!a(L)&&!x.isKeyword(L))throw new e("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:c});if(p.match(/(?::[^:])|\//)){const ee=new Map(N).set(p,!0);if(S(b,p,{vocab:!0,base:!1},c,ee,D)!==L)throw new e("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:c})}B["@id"]=L,B._prefix=M&&!B._termHasColon&&L.match(/[:\/\?#\[\]@]$/)!==null}}if(!("@id"in B))if(B._termHasColon){const L=p.substr(0,j);if(c.hasOwnProperty(L)&&x.createTermDefinition({activeCtx:b,localCtx:c,term:L,defined:N,options:D}),b.mappings.has(L)){const ee=p.substr(j+1);B["@id"]=b.mappings.get(L)["@id"]+ee}else B["@id"]=p}else if(p==="@type")B["@id"]=p;else{if(!("@vocab"in b))throw new e("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:c,term:p});B["@id"]=b["@vocab"]+p}if((q["@protected"]===!0||N.get("@protected")===!0&&q["@protected"]!==!1)&&(b.protected[p]=!0,B.protected=!0),N.set(p,!0),"@type"in q){let L=q["@type"];if(!i(L))throw new e("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:c});if(L==="@json"||L==="@none"){if(x.processingMode(b,1))throw new e(`Invalid JSON-LD syntax; an @context @type value must not be "${L}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:c})}else if(L!=="@id"&&L!=="@vocab"){if(L=S(b,L,{vocab:!0,base:!1},c,N,D),!a(L))throw new e("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:c});if(L.indexOf("_:")===0)throw new e("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:c})}B["@type"]=L}if("@container"in q){const L=i(q["@container"])?[q["@container"]]:q["@container"]||[],ee=["@list","@set","@index","@language"];let C=!0;const K=L.includes("@set");if(x.processingMode(b,1.1)){if(ee.push("@graph","@id","@type"),L.includes("@list")){if(L.length!==1)throw new e("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:c})}else if(L.includes("@graph")){if(L.some(v=>v!=="@graph"&&v!=="@id"&&v!=="@index"&&v!=="@set"))throw new e("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:c})}else C&=L.length<=(K?2:1);if(L.includes("@type")&&(B["@type"]=B["@type"]||"@id",!["@id","@vocab"].includes(B["@type"])))throw new e("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:c})}else C&=!t(q["@container"]),C&=L.length<=1;if(C&=L.every(v=>ee.includes(v)),C&=!(K&&L.includes("@list")),!C)throw new e("Invalid JSON-LD syntax; @context @container value must be one of the following: "+ee.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:c});if(B.reverse&&!L.every(v=>["@index","@set"].includes(v)))throw new e("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:c});B["@container"]=L}if("@index"in q){if(!("@container"in q)||!B["@container"].includes("@index"))throw new e(`Invalid JSON-LD syntax; @index without @index in @container: "${q["@index"]}" on term "${p}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:c});if(!i(q["@index"])||q["@index"].indexOf("@")===0)throw new e(`Invalid JSON-LD syntax; @index must expand to an IRI: "${q["@index"]}" on term "${p}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:c});B["@index"]=q["@index"]}if("@context"in q&&(B["@context"]=q["@context"]),"@language"in q&&!("@type"in q)){let L=q["@language"];if(L!==null&&!i(L))throw new e("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:c});L!==null&&(L=L.toLowerCase()),B["@language"]=L}if("@prefix"in q){if(p.match(/:|\//))throw new e("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:c});if(x.isKeyword(B["@id"]))throw new e("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:c});if(typeof q["@prefix"]=="boolean")B._prefix=q["@prefix"]===!0;else throw new e("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:c})}if("@direction"in q){const L=q["@direction"];if(L!==null&&L!=="ltr"&&L!=="rtl")throw new e('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:c});B["@direction"]=L}if("@nest"in q){const L=q["@nest"];if(!i(L)||L!=="@nest"&&L.indexOf("@")===0)throw new e("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:c});B["@nest"]=L}// disallow aliasing @context and @preserve
300
+ const Y=B["@id"];if(Y==="@context"||Y==="@preserve")throw new e("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:c});if(R&&R.protected&&!T&&(b.protected[p]=!0,B.protected=!0,!I(R,B)))throw new e("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:c,term:p})},x.expandIri=(b,c,p,N)=>S(b,c,p,void 0,void 0,N);function S(b,c,p,N,D,T){if(c===null||!i(c)||x.isKeyword(c))return c;if(c.match(m))return null;if(N&&N.hasOwnProperty(c)&&D.get(c)!==!0&&x.createTermDefinition({activeCtx:b,localCtx:N,term:c,defined:D,options:T}),p=p||{},p.vocab){const R=b.mappings.get(c);if(R===null)return null;if(n(R)&&"@id"in R)return R["@id"]}const q=c.indexOf(":");if(q>0){const R=c.substr(0,q),M=c.substr(q+1);if(R==="_"||M.indexOf("//")===0)return c;N&&N.hasOwnProperty(R)&&x.createTermDefinition({activeCtx:b,localCtx:N,term:R,defined:D,options:T});const B=b.mappings.get(R);if(B&&B._prefix)return B["@id"]+M;if(a(c))return c}if(p.vocab&&"@vocab"in b)c=b["@vocab"]+c;else if(p.base){let R,M;"@base"in b?b["@base"]?(M=l(T.base,b["@base"]),R=l(M,c)):(M=b["@base"],R=c):(M=T.base,R=l(T.base,c)),c=R}return c}x.getInitialContext=b=>{const c=JSON.stringify({processingMode:b.processingMode}),p=y.get(c);if(p)return p;const N={processingMode:b.processingMode,mappings:new Map,inverse:null,getInverse:D,clone:R,revertToPreviousContext:M,protected:{}};return y.size===_&&y.clear(),y.set(c,N),N;function D(){const B=this;if(B.inverse)return B.inverse;const A=B.inverse={},j=B.fastCurieMap={},Y={},L=(B["@language"]||"@none").toLowerCase(),ee=B["@direction"],C=B.mappings,K=[...C.keys()].sort(g);for(const v of K){const U=C.get(v);if(U===null)continue;let Q=U["@container"]||"@none";if(Q=[].concat(Q).sort().join(""),U["@id"]===null)continue;const z=w(U["@id"]);for(const ae of z){let H=A[ae];const V=x.isKeyword(ae);if(H)!V&&!U._termHasColon&&Y[ae].push(v);else if(A[ae]=H={},!V&&!U._termHasColon){Y[ae]=[v];const W={iri:ae,terms:Y[ae]};ae[0]in j?j[ae[0]].push(W):j[ae[0]]=[W]}if(H[Q]||(H[Q]={"@language":{},"@type":{},"@any":{}}),H=H[Q],q(v,H["@any"],"@none"),U.reverse)q(v,H["@type"],"@reverse");else if(U["@type"]==="@none")q(v,H["@any"],"@none"),q(v,H["@language"],"@none"),q(v,H["@type"],"@none");else if("@type"in U)q(v,H["@type"],U["@type"]);else if("@language"in U&&"@direction"in U){const W=U["@language"],F=U["@direction"];W&&F?q(v,H["@language"],`${W}_${F}`.toLowerCase()):W?q(v,H["@language"],W.toLowerCase()):F?q(v,H["@language"],`_${F}`):q(v,H["@language"],"@null")}else"@language"in U?q(v,H["@language"],(U["@language"]||"@null").toLowerCase()):"@direction"in U?U["@direction"]?q(v,H["@language"],`_${U["@direction"]}`):q(v,H["@language"],"@none"):ee?(q(v,H["@language"],`_${ee}`),q(v,H["@language"],"@none"),q(v,H["@type"],"@none")):(q(v,H["@language"],L),q(v,H["@language"],"@none"),q(v,H["@type"],"@none"))}}for(const v in j)T(j,v,1);return A}function T(B,A,j){const Y=B[A],L=B[A]={};let ee,C;for(const K of Y)ee=K.iri,j>=ee.length?C="":C=ee[j],C in L?L[C].push(K):L[C]=[K];for(const K in L)K!==""&&T(L,K,j+1)}function q(B,A,j){A.hasOwnProperty(j)||(A[j]=B)}function R(){const B={};return B.mappings=r.clone(this.mappings),B.clone=this.clone,B.inverse=null,B.getInverse=this.getInverse,B.protected=r.clone(this.protected),this.previousContext&&(B.previousContext=this.previousContext.clone()),B.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(B["@base"]=this["@base"]),"@language"in this&&(B["@language"]=this["@language"]),"@vocab"in this&&(B["@vocab"]=this["@vocab"]),B}function M(){return this.previousContext?this.previousContext.clone():this}},x.getContextValue=(b,c,p)=>{if(c===null)return p==="@context"?void 0:null;if(b.mappings.has(c)){const N=b.mappings.get(c);if(s(p))return N;if(N.hasOwnProperty(p))return N[p]}if(p==="@language"&&p in b||p==="@direction"&&p in b)return b[p];if(p!=="@context")return null},x.processingMode=(b,c)=>c.toString()>="1.1"?!b.processingMode||b.processingMode>="json-ld-"+c.toString():b.processingMode==="json-ld-1.0",x.isKeyword=b=>{if(!i(b)||b[0]!=="@")return!1;switch(b){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 I(b,c){if(!(b&&typeof b=="object")||!(c&&typeof c=="object"))return b===c;const p=Array.isArray(b);if(p!==Array.isArray(c))return!1;if(p){if(b.length!==c.length)return!1;for(let T=0;T<b.length;++T)if(!I(b[T],c[T]))return!1;return!0}const N=Object.keys(b),D=Object.keys(c);if(N.length!==D.length)return!1;for(const T in b){let q=b[T],R=c[T];if(T==="@container"&&Array.isArray(q)&&Array.isArray(R)&&(q=q.slice().sort(),R=R.slice().sort()),!I(q,R))return!1}return!0}return Ji}var Qi,ol;function kf(){if(ol)return Qi;ol=1;const r=et(),{isArray:e,isObject:t,isEmptyObject:n,isString:i,isUndefined:s}=Xe(),{isList:a,isValue:o,isGraph:l,isSubject:d}=_t(),{expandIri:h,getContextValue:m,isKeyword:w,process:g,processingMode:y}=Bt(),{isAbsolute:_}=Tt(),{REGEX_BCP47:x,REGEX_KEYWORD:S,addValue:I,asArray:b,getValues:c,validateTypeValue:p}=Ye(),{handleEvent:N}=Xr(),D={};Qi=D,D.expand=async({activeCtx:A,activeProperty:j=null,element:Y,options:L={},insideList:ee=!1,insideIndex:C=!1,typeScopedContext:K=null})=>{if(Y==null)return null;if(j==="@default"&&(L=Object.assign({},L,{isFrame:!1})),!e(Y)&&!t(Y))return!ee&&(j===null||h(A,j,{vocab:!0},L)==="@graph")?(L.eventHandler&&N({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:Y}},options:L}),null):R({activeCtx:A,activeProperty:j,value:Y,options:L});if(e(Y)){let W=[];const F=m(A,j,"@container")||[];ee=ee||F.includes("@list");for(let Z=0;Z<Y.length;++Z){let te=await D.expand({activeCtx:A,activeProperty:j,element:Y[Z],options:L,insideIndex:C,typeScopedContext:K});ee&&e(te)&&(te={"@list":te}),te!==null&&(e(te)?W=W.concat(te):W.push(te))}return W}const v=h(A,j,{vocab:!0},L),U=m(A,j,"@context");K=K||(A.previousContext?A:null);let Q=Object.keys(Y).sort(),z=!C;if(z&&K&&Q.length<=2&&!Q.includes("@context"))for(const W of Q){const F=h(K,W,{vocab:!0},L);if(F==="@value"){z=!1,A=K;break}if(F==="@id"&&Q.length===1){z=!1;break}}z&&(A=A.revertToPreviousContext()),s(U)||(A=await g({activeCtx:A,localCtx:U,propagate:!0,overrideProtected:!0,options:L})),"@context"in Y&&(A=await g({activeCtx:A,localCtx:Y["@context"],options:L})),K=A;let ae=null;for(const W of Q)if(h(A,W,{vocab:!0},L)==="@type"){ae=ae||W;const Z=Y[W],te=Array.isArray(Z)?Z.length>1?Z.slice().sort():Z:[Z];for(const ce of te){const fe=m(K,ce,"@context");s(fe)||(A=await g({activeCtx:A,localCtx:fe,options:L,propagate:!1}))}}let H={};await q({activeCtx:A,activeProperty:j,expandedActiveProperty:v,element:Y,expandedParent:H,options:L,insideList:ee,typeKey:ae,typeScopedContext:K}),Q=Object.keys(H);let V=Q.length;if("@value"in H){if("@type"in H&&("@language"in H||"@direction"in H))throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:H});let W=V-1;if("@type"in H&&(W-=1),"@index"in H&&(W-=1),"@language"in H&&(W-=1),"@direction"in H&&(W-=1),W!==0)throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:H});const F=H["@value"]===null?[]:b(H["@value"]),Z=c(H,"@type");if(!(y(A,1.1)&&Z.includes("@json")&&Z.length===1))if(F.length===0)L.eventHandler&&N({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:H}},options:L}),H=null;else{if(!F.every(te=>i(te)||n(te))&&"@language"in H)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:H});if(!Z.every(te=>_(te)&&!(i(te)&&te.indexOf("_:")===0)||n(te)))throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:H})}}else if("@type"in H&&!e(H["@type"]))H["@type"]=[H["@type"]];else if("@set"in H||"@list"in H){if(V>1&&!(V===2&&"@index"in H))throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:H});"@set"in H&&(H=H["@set"],Q=Object.keys(H),V=Q.length)}else V===1&&"@language"in H&&(L.eventHandler&&N({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:H}},options:L}),H=null);return t(H)&&!L.keepFreeFloatingNodes&&!ee&&(j===null||v==="@graph"||(m(A,j,"@container")||[]).includes("@graph"))&&(H=T({value:H,count:V,options:L})),H};function T({value:A,count:j,options:Y}){if(j===0||"@value"in A||"@list"in A||j===1&&"@id"in A){if(Y.eventHandler){let L,ee;j===0?(L="empty object",ee="Dropping empty object."):"@value"in A?(L="object with only @value",ee="Dropping object with only @value."):"@list"in A?(L="object with only @list",ee="Dropping object with only @list."):j===1&&"@id"in A&&(L="object with only @id",ee="Dropping object with only @id."),N({event:{type:["JsonLdEvent"],code:L,level:"warning",message:ee,details:{value:A}},options:Y})}return null}return A}async function q({activeCtx:A,activeProperty:j,expandedActiveProperty:Y,element:L,expandedParent:ee,options:C={},insideList:K,typeKey:v,typeScopedContext:U}){const Q=Object.keys(L).sort(),z=[];let ae;const H=L[v]&&h(A,e(L[v])?L[v][0]:L[v],{vocab:!0},{...C,typeExpansion:!0})==="@json";for(const V of Q){let W=L[V],F;if(V==="@context")continue;const Z=h(A,V,{vocab:!0},C);if(Z===null||!(_(Z)||w(Z))){C.eventHandler&&N({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:V,expandedProperty:Z}},options:C});continue}if(w(Z)){if(Y==="@reverse")throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:W});if(Z in ee&&Z!=="@included"&&Z!=="@type")throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:Z})}if(Z==="@id"){if(!i(W)){if(!C.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:W});if(t(W)){if(!n(W))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:W})}else if(e(W)){if(!W.every(O=>i(O)))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:W})}else throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:W})}I(ee,"@id",b(W).map(O=>{if(i(O)){const G=h(A,O,{base:!0},C);return C.eventHandler&&(G===null?N(O===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:O}},options:C}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:O}},options:C}):_(G)||N({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:O,expandedId:G}},options:C})),G}return O}),{propertyIsArray:C.isFrame});continue}if(Z==="@type"){t(W)&&(W=Object.fromEntries(Object.entries(W).map(([O,G])=>[h(U,O,{vocab:!0}),b(G).map(re=>h(U,re,{base:!0,vocab:!0},{...C,typeExpansion:!0}))]))),p(W,C.isFrame),I(ee,"@type",b(W).map(O=>{if(i(O)){const G=h(U,O,{base:!0,vocab:!0},{...C,typeExpansion:!0});return G!=="@json"&&!_(G)&&C.eventHandler&&N({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:O}},options:C}),G}return O}),{propertyIsArray:!!C.isFrame});continue}if(Z==="@included"&&y(A,1.1)){const O=b(await D.expand({activeCtx:A,activeProperty:j,element:W,options:C}));if(!O.every(G=>d(G)))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:W});I(ee,"@included",O,{propertyIsArray:!0});continue}if(Z==="@graph"&&!(t(W)||e(W)))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:W});if(Z==="@value"){ae=W,H&&y(A,1.1)?ee["@value"]=W:I(ee,"@value",W,{propertyIsArray:C.isFrame});continue}if(Z==="@language"){if(W===null)continue;if(!i(W)&&!C.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:W});W=b(W).map(O=>i(O)?O.toLowerCase():O);for(const O of W)i(O)&&!O.match(x)&&C.eventHandler&&N({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:O}},options:C});I(ee,"@language",W,{propertyIsArray:C.isFrame});continue}if(Z==="@direction"){if(!i(W)&&!C.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:W});W=b(W);for(const O of W)if(i(O)&&O!=="ltr"&&O!=="rtl")throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:W});I(ee,"@direction",W,{propertyIsArray:C.isFrame});continue}if(Z==="@index"){if(!i(W))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:W});I(ee,"@index",W);continue}if(Z==="@reverse"){if(!t(W))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:W});if(F=await D.expand({activeCtx:A,activeProperty:"@reverse",element:W,options:C}),"@reverse"in F)for(const G in F["@reverse"])I(ee,G,F["@reverse"][G],{propertyIsArray:!0});let O=ee["@reverse"]||null;for(const G in F){if(G==="@reverse")continue;O===null&&(O=ee["@reverse"]={}),I(O,G,[],{propertyIsArray:!0});const re=F[G];for(let ue=0;ue<re.length;++ue){const de=re[ue];if(o(de)||a(de))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:F});I(O,G,de,{propertyIsArray:!0})}}continue}if(Z==="@nest"){z.push(V);continue}let te=A;const ce=m(A,V,"@context");s(ce)||(te=await g({activeCtx:A,localCtx:ce,propagate:!0,overrideProtected:!0,options:C}));const fe=m(A,V,"@container")||[];if(fe.includes("@language")&&t(W)){const O=m(te,V,"@direction");F=M(te,W,O,C)}else if(fe.includes("@index")&&t(W)){const O=fe.includes("@graph"),G=m(te,V,"@index")||"@index",re=G!=="@index"&&h(A,G,{vocab:!0},C);F=await B({activeCtx:te,options:C,activeProperty:V,value:W,asGraph:O,indexKey:G,propertyIndex:re})}else if(fe.includes("@id")&&t(W)){const O=fe.includes("@graph");F=await B({activeCtx:te,options:C,activeProperty:V,value:W,asGraph:O,indexKey:"@id"})}else if(fe.includes("@type")&&t(W))F=await B({activeCtx:te.revertToPreviousContext(),options:C,activeProperty:V,value:W,asGraph:!1,indexKey:"@type"});else{const O=Z==="@list";if(O||Z==="@set"){let G=j;O&&Y==="@graph"&&(G=null),F=await D.expand({activeCtx:te,activeProperty:G,element:W,options:C,insideList:O})}else m(A,V,"@type")==="@json"?F={"@type":"@json","@value":W}:F=await D.expand({activeCtx:te,activeProperty:V,element:W,options:C,insideList:!1})}if(!(F===null&&Z!=="@value")){if(Z!=="@list"&&!a(F)&&fe.includes("@list")&&(F={"@list":b(F)}),fe.includes("@graph")&&!fe.some(O=>O==="@id"||O==="@index")){if(F=b(F),C.isFrame||(F=F.filter(O=>{const G=Object.keys(O).length;return T({value:O,count:G,options:C})!==null})),F.length===0)continue;F=F.map(O=>({"@graph":b(O)}))}if(te.mappings.has(V)&&te.mappings.get(V).reverse){const O=ee["@reverse"]=ee["@reverse"]||{};F=b(F);for(let G=0;G<F.length;++G){const re=F[G];if(o(re)||a(re))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:F});I(O,Z,re,{propertyIsArray:!0})}continue}I(ee,Z,F,{propertyIsArray:!0})}}if("@value"in ee&&!(ee["@type"]==="@json"&&y(A,1.1))){if((t(ae)||e(ae))&&!C.isFrame)throw new r('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:ae})}for(const V of z){const W=e(L[V])?L[V]:[L[V]];for(const F of W){if(!t(F)||Object.keys(F).some(Z=>h(A,Z,{vocab:!0},C)==="@value"))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:F});await q({activeCtx:A,activeProperty:j,expandedActiveProperty:Y,element:F,expandedParent:ee,options:C,insideList:K,typeScopedContext:U,typeKey:v})}}}function R({activeCtx:A,activeProperty:j,value:Y,options:L}){if(Y==null)return null;const ee=h(A,j,{vocab:!0},L);if(ee==="@id")return h(A,Y,{base:!0},L);if(ee==="@type")return h(A,Y,{vocab:!0,base:!0},{...L,typeExpansion:!0});const C=m(A,j,"@type");if((C==="@id"||ee==="@graph")&&i(Y)){const v=h(A,Y,{base:!0},L);return v===null&&Y.match(S)&&L.eventHandler&&N({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:j}},options:L}),{"@id":v}}if(C==="@vocab"&&i(Y))return{"@id":h(A,Y,{vocab:!0,base:!0},L)};if(w(ee))return Y;const K={};if(C&&!["@id","@vocab","@none"].includes(C))K["@type"]=C;else if(i(Y)){const v=m(A,j,"@language");v!==null&&(K["@language"]=v);const U=m(A,j,"@direction");U!==null&&(K["@direction"]=U)}return["boolean","number","string"].includes(typeof Y)||(Y=Y.toString()),K["@value"]=Y,K}function M(A,j,Y,L){const ee=[],C=Object.keys(j).sort();for(const K of C){const v=h(A,K,{vocab:!0},L);let U=j[K];e(U)||(U=[U]);for(const Q of U){if(Q===null)continue;if(!i(Q))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:j});const z={"@value":Q};v!=="@none"&&(K.match(x)||L.eventHandler&&N({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:K}},options:L}),z["@language"]=K.toLowerCase()),Y&&(z["@direction"]=Y),ee.push(z)}}return ee}async function B({activeCtx:A,options:j,activeProperty:Y,value:L,asGraph:ee,indexKey:C,propertyIndex:K}){const v=[],U=Object.keys(L).sort(),Q=C==="@type";for(let z of U){if(Q){const V=m(A,z,"@context");s(V)||(A=await g({activeCtx:A,localCtx:V,propagate:!1,options:j}))}let ae=L[z];e(ae)||(ae=[ae]),ae=await D.expand({activeCtx:A,activeProperty:Y,element:ae,options:j,insideList:!1,insideIndex:!0});let H;K?z==="@none"?H="@none":H=R({activeCtx:A,activeProperty:C,value:z,options:j}):H=h(A,z,{vocab:!0},j),C==="@id"?z=h(A,z,{base:!0},j):Q&&(z=H);for(let V of ae){if(ee&&!l(V)&&(V={"@graph":[V]}),C==="@type")H==="@none"||(V["@type"]?V["@type"]=[z].concat(V["@type"]):V["@type"]=[z]);else{if(o(V)&&!["@language","@type","@index"].includes(C))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${C}".`,"jsonld.SyntaxError",{code:"invalid value object",value:V});K?H!=="@none"&&I(V,K,H,{propertyIsArray:!0,prependValue:!0}):H!=="@none"&&!(C in V)&&(V[C]=z)}v.push(V)}}return v}return Qi}var Xi,ll;function Mn(){if(ll)return Xi;ll=1;const{isKeyword:r}=Bt(),e=_t(),t=Xe(),n=Ye(),i=et(),s={};return Xi=s,s.createMergedNodeMap=(a,o)=>{o=o||{};const l=o.issuer||new n.IdentifierIssuer("_:b"),d={"@default":{}};return s.createNodeMap(a,d,"@default",l),s.mergeNodeMaps(d)},s.createNodeMap=(a,o,l,d,h,m)=>{if(t.isArray(a)){for(const _ of a)s.createNodeMap(_,o,l,d,void 0,m);return}if(!t.isObject(a)){m&&m.push(a);return}if(e.isValue(a)){if("@type"in a){let _=a["@type"];_.indexOf("_:")===0&&(a["@type"]=_=d.getId(_))}m&&m.push(a);return}else if(m&&e.isList(a)){const _=[];s.createNodeMap(a["@list"],o,l,d,h,_),m.push({"@list":_});return}if("@type"in a){const _=a["@type"];for(const x of _)x.indexOf("_:")===0&&d.getId(x)}t.isUndefined(h)&&(h=e.isBlankNode(a)?d.getId(a["@id"]):a["@id"]),m&&m.push({"@id":h});const w=o[l],g=w[h]=w[h]||{};g["@id"]=h;const y=Object.keys(a).sort();for(let _ of y){if(_==="@id")continue;if(_==="@reverse"){const S={"@id":h},I=a["@reverse"];for(const b in I){const c=I[b];for(const p of c){let N=p["@id"];e.isBlankNode(p)&&(N=d.getId(N)),s.createNodeMap(p,o,l,d,N),n.addValue(w[N],b,S,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(_==="@graph"){h in o||(o[h]={}),s.createNodeMap(a[_],o,h,d);continue}if(_==="@included"){s.createNodeMap(a[_],o,l,d);continue}if(_!=="@type"&&r(_)){if(_==="@index"&&_ in g&&(a[_]!==g[_]||a[_]["@id"]!==g[_]["@id"]))throw new i("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:g});g[_]=a[_];continue}const x=a[_];if(_.indexOf("_:")===0&&(_=d.getId(_)),x.length===0){n.addValue(g,_,[],{propertyIsArray:!0});continue}for(let S of x)if(_==="@type"&&(S=S.indexOf("_:")===0?d.getId(S):S),e.isSubject(S)||e.isSubjectReference(S)){if("@id"in S&&!S["@id"])continue;const I=e.isBlankNode(S)?d.getId(S["@id"]):S["@id"];n.addValue(g,_,{"@id":I},{propertyIsArray:!0,allowDuplicate:!1}),s.createNodeMap(S,o,l,d,I)}else if(e.isValue(S))n.addValue(g,_,S,{propertyIsArray:!0,allowDuplicate:!1});else if(e.isList(S)){const I=[];s.createNodeMap(S["@list"],o,l,d,h,I),S={"@list":I},n.addValue(g,_,S,{propertyIsArray:!0,allowDuplicate:!1})}else s.createNodeMap(S,o,l,d,h),n.addValue(g,_,S,{propertyIsArray:!0,allowDuplicate:!1})}},s.mergeNodeMapGraphs=a=>{const o={};for(const l of Object.keys(a).sort())for(const d of Object.keys(a[l]).sort()){const h=a[l][d];d in o||(o[d]={"@id":d});const m=o[d];for(const w of Object.keys(h).sort())if(r(w)&&w!=="@type")m[w]=n.clone(h[w]);else for(const g of h[w])n.addValue(m,w,n.clone(g),{propertyIsArray:!0,allowDuplicate:!1})}return o},s.mergeNodeMaps=a=>{const o=a["@default"],l=Object.keys(a).sort();for(const d of l){if(d==="@default")continue;const h=a[d];let m=o[d];m?"@graph"in m||(m["@graph"]=[]):o[d]=m={"@id":d,"@graph":[]};const w=m["@graph"];for(const g of Object.keys(h).sort()){const y=h[g];e.isSubjectReference(y)||w.push(y)}}return o},Xi}var Ki,ul;function Df(){if(ul)return Ki;ul=1;const{isSubjectReference:r}=_t(),{createMergedNodeMap:e}=Mn(),t={};return Ki=t,t.flatten=n=>{const i=e(n),s=[],a=Object.keys(i).sort();for(let o=0;o<a.length;++o){const l=i[a[o]];r(l)||s.push(l)}return s},Ki}var Yi,cl;function Mf(){if(cl)return Yi;cl=1;const r=et(),e=_t(),t=Xe(),{REGEX_BCP47:n,addValue:i}=Ye(),{handleEvent:s}=Xr(),{RDF_LIST:a,RDF_FIRST:o,RDF_REST:l,RDF_NIL:d,RDF_TYPE:h,RDF_JSON_LITERAL:m,XSD_BOOLEAN:w,XSD_DOUBLE:g,XSD_INTEGER:y,XSD_STRING:_}=oa(),x={};Yi=x,x.fromRDF=async(I,b)=>{const{useRdfType:c=!1,useNativeTypes:p=!1,rdfDirection:N=null}=b,D={},T={"@default":D},q={};if(N){if(N==="compound-literal")throw new r("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:N});if(N!=="i18n-datatype")throw new r("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:N})}for(const B of I){const A=B.graph.termType==="DefaultGraph"?"@default":B.graph.value;A in T||(T[A]={}),A!=="@default"&&!(A in D)&&(D[A]={"@id":A});const j=T[A],Y=B.subject.value,L=B.predicate.value,ee=B.object;Y in j||(j[Y]={"@id":Y});const C=j[Y],K=ee.termType.endsWith("Node");if(K&&!(ee.value in j)&&(j[ee.value]={"@id":ee.value}),L===h&&!c&&K){i(C,"@type",ee.value,{propertyIsArray:!0});continue}const v=S(ee,p,N,b);if(i(C,L,v,{propertyIsArray:!0}),K)if(ee.value===d){const U=j[ee.value];"usages"in U||(U.usages=[]),U.usages.push({node:C,property:L,value:v})}else ee.value in q?q[ee.value]=!1:q[ee.value]={node:C,property:L,value:v}}for(const B in T){const A=T[B];if(!(d in A))continue;const j=A[d];if(j.usages){for(let Y of j.usages){let L=Y.node,ee=Y.property,C=Y.value;const K=[],v=[];let U=Object.keys(L).length;for(;ee===l&&t.isObject(q[L["@id"]])&&t.isArray(L[o])&&L[o].length===1&&t.isArray(L[l])&&L[l].length===1&&(U===3||U===4&&t.isArray(L["@type"])&&L["@type"].length===1&&L["@type"][0]===a)&&(K.push(L[o][0]),v.push(L["@id"]),Y=q[L["@id"]],L=Y.node,ee=Y.property,C=Y.value,U=Object.keys(L).length,!!e.isBlankNode(L)););delete C["@id"],C["@list"]=K.reverse();for(const Q of v)delete A[Q]}delete j.usages}}const R=[],M=Object.keys(D).sort();for(const B of M){const A=D[B];if(B in T){const j=A["@graph"]=[],Y=T[B],L=Object.keys(Y).sort();for(const ee of L){const C=Y[ee];e.isSubjectReference(C)||j.push(C)}}e.isSubjectReference(A)||R.push(A)}return R};function S(I,b,c,p){if(I.termType.endsWith("Node"))return{"@id":I.value};const N={"@value":I.value};if(I.language)I.language.match(n)||p.eventHandler&&s({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:I.language}},options:p}),N["@language"]=I.language;else{let D=I.datatype.value;if(D||(D=_),D===m){D="@json";try{N["@value"]=JSON.parse(N["@value"])}catch(T){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:N["@value"],cause:T})}}if(b){if(D===w)N["@value"]==="true"?N["@value"]=!0:N["@value"]==="false"&&(N["@value"]=!1);else if(t.isNumeric(N["@value"]))if(D===y){const T=parseInt(N["@value"],10);T.toFixed(0)===N["@value"]&&(N["@value"]=T)}else D===g&&(N["@value"]=parseFloat(N["@value"]));[w,y,g,_].includes(D)||(N["@type"]=D)}else if(c==="i18n-datatype"&&D.startsWith("https://www.w3.org/ns/i18n#")){const[,T,q]=D.split(/[#_]/);T.length>0&&(N["@language"]=T,T.match(n)||p.eventHandler&&s({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:T}},options:p})),N["@direction"]=q}else D!==_&&(N["@type"]=D)}return N}return Yi}var Zi,dl;function Cf(){return dl||(dl=1,Zi=function r(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((t,n,i)=>{const s=i===0?"":",",a=n===void 0||typeof n=="symbol"?null:n;return t+s+r(a)},"")+"]":"{"+Object.keys(e).sort().reduce((t,n,i)=>{if(e[n]===void 0||typeof e[n]=="symbol")return t;const s=t.length===0?"":",";return t+s+r(n)+":"+r(e[n])},"")+"}"}),Zi}var es,fl;function Pf(){if(fl)return es;fl=1;const{createNodeMap:r}=Mn(),{isKeyword:e}=Bt(),t=_t(),n=Cf(),i=et(),s=Xe(),a=Ye(),{handleEvent:o}=Xr(),{RDF_FIRST:l,RDF_REST:d,RDF_NIL:h,RDF_TYPE:m,RDF_JSON_LITERAL:w,RDF_LANGSTRING:g,XSD_BOOLEAN:y,XSD_DOUBLE:_,XSD_INTEGER:x,XSD_STRING:S}=oa(),{isAbsolute:I}=Tt(),b={};es=b,b.toRDF=(D,T)=>{const q=new a.IdentifierIssuer("_:b"),R={"@default":{}};r(D,R,"@default",q);const M=[],B=Object.keys(R).sort();for(const A of B){let j;if(A==="@default")j={termType:"DefaultGraph",value:""};else if(I(A))A.startsWith("_:")?j={termType:"BlankNode"}:j={termType:"NamedNode"},j.value=A;else{T.eventHandler&&o({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:A}},options:T});continue}c(M,R[A],j,q,T)}return M};function c(D,T,q,R,M){const B=Object.keys(T).sort();for(const A of B){const j=T[A],Y=Object.keys(j).sort();for(let L of Y){const ee=j[L];if(L==="@type")L=m;else if(e(L))continue;for(const C of ee){const K={termType:A.startsWith("_:")?"BlankNode":"NamedNode",value:A};if(!I(A)){M.eventHandler&&o({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:A}},options:M});continue}const v={termType:L.startsWith("_:")?"BlankNode":"NamedNode",value:L};if(!I(L)){M.eventHandler&&o({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:L}},options:M});continue}if(v.termType==="BlankNode"&&!M.produceGeneralizedRdf){M.eventHandler&&o({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:R.getOldIds().find(Q=>R.getId(Q)===L)}},options:M});continue}const U=N(C,R,D,q,M.rdfDirection,M);U&&D.push({subject:K,predicate:v,object:U,graph:q})}}}}function p(D,T,q,R,M,B){const A={termType:"NamedNode",value:l},j={termType:"NamedNode",value:d},Y={termType:"NamedNode",value:h},L=D.pop(),ee=L?{termType:"BlankNode",value:T.getId()}:Y;let C=ee;for(const K of D){const v=N(K,T,q,R,M,B),U={termType:"BlankNode",value:T.getId()};q.push({subject:C,predicate:A,object:v,graph:R}),q.push({subject:C,predicate:j,object:U,graph:R}),C=U}if(L){const K=N(L,T,q,R,M,B);q.push({subject:C,predicate:A,object:K,graph:R}),q.push({subject:C,predicate:j,object:Y,graph:R})}return ee}function N(D,T,q,R,M,B){const A={};if(t.isValue(D)){A.termType="Literal",A.value=void 0,A.datatype={termType:"NamedNode"};let j=D["@value"];const Y=D["@type"]||null;if(Y==="@json")A.value=n(j),A.datatype.value=w;else if(s.isBoolean(j))A.value=j.toString(),A.datatype.value=Y||y;else if(s.isDouble(j)||Y===_)s.isDouble(j)||(j=parseFloat(j)),A.value=j.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),A.datatype.value=Y||_;else if(s.isNumber(j))A.value=j.toFixed(0),A.datatype.value=Y||x;else if("@direction"in D&&M==="i18n-datatype"){const L=(D["@language"]||"").toLowerCase(),ee=D["@direction"],C=`https://www.w3.org/ns/i18n#${L}_${ee}`;A.datatype.value=C,A.value=j}else{if("@direction"in D&&M==="compound-literal")throw new i("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:M});if("@direction"in D&&M)throw new i("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:M});"@language"in D?("@direction"in D&&!M&&B.eventHandler&&o({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:A.value}},options:B}),A.value=j,A.datatype.value=Y||g,A.language=D["@language"]):("@direction"in D&&!M&&B.eventHandler&&o({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:A.value}},options:B}),A.value=j,A.datatype.value=Y||S)}}else if(t.isList(D)){const j=p(D["@list"],T,q,R,M,B);A.termType=j.termType,A.value=j.value}else{const j=s.isObject(D)?D["@id"]:D;A.termType=j.startsWith("_:")?"BlankNode":"NamedNode",A.value=j}return A.termType==="NamedNode"&&!I(A.value)?(B.eventHandler&&o({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:A.value}},options:B}),null):A}return es}var ts,hl;function qf(){if(hl)return ts;hl=1;const{isKeyword:r}=Bt(),e=_t(),t=Xe(),n=Ye(),i=Tt(),s=et(),{createNodeMap:a,mergeNodeMapGraphs:o}=Mn(),l={};ts=l,l.frameMergedOrDefault=(c,p,N)=>{const D={options:N,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},T=new n.IdentifierIssuer("_:b");a(c,D.graphMap,"@default",T),N.merged&&(D.graphMap["@merged"]=o(D.graphMap),D.graph="@merged"),D.subjects=D.graphMap[D.graph];const q=[];l.frame(D,Object.keys(D.subjects).sort(),p,q),N.pruneBlankNodeIdentifiers&&(N.bnodesToClear=Object.keys(D.bnodeMap).filter(R=>D.bnodeMap[R].length===1));// remove @preserve from results
301
+ return N.link={},x(q,N)},l.frame=(c,p,N,D,T=null)=>{w(N),N=N[0];const q=c.options,R={embed:m(N,q,"embed"),explicit:m(N,q,"explicit"),requireAll:m(N,q,"requireAll")};c.link.hasOwnProperty(c.graph)||(c.link[c.graph]={});const M=c.link[c.graph],B=g(c,p,N,R),A=Object.keys(B).sort();for(const j of A){const Y=B[j];if(T===null?c.uniqueEmbeds={[c.graph]:{}}:c.uniqueEmbeds[c.graph]=c.uniqueEmbeds[c.graph]||{},R.embed==="@link"&&j in M){S(D,T,M[j]);continue}const L={"@id":j};if(j.indexOf("_:")===0&&n.addValue(c.bnodeMap,j,L,{propertyIsArray:!0}),M[j]=L,(R.embed==="@first"||R.embed==="@last")&&c.is11)throw new s("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:N});if(!(!c.embedded&&c.uniqueEmbeds[c.graph].hasOwnProperty(j))){if(c.embedded&&(R.embed==="@never"||h(Y,c.graph,c.subjectStack))){S(D,T,L);continue}if(c.embedded&&(R.embed=="@first"||R.embed=="@once")&&c.uniqueEmbeds[c.graph].hasOwnProperty(j)){S(D,T,L);continue}if(R.embed==="@last"&&j in c.uniqueEmbeds[c.graph]&&_(c,j),c.uniqueEmbeds[c.graph][j]={parent:D,property:T},c.subjectStack.push({subject:Y,graph:c.graph}),j in c.graphMap){let ee=!1,C=null;"@graph"in N?(C=N["@graph"][0],ee=!(j==="@merged"||j==="@default"),t.isObject(C)||(C={})):(ee=c.graph!=="@merged",C={}),ee&&l.frame({...c,graph:j,embedded:!1},Object.keys(c.graphMap[j]).sort(),[C],L,"@graph")}"@included"in N&&l.frame({...c,embedded:!1},p,N["@included"],L,"@included");for(const ee of Object.keys(Y).sort()){if(r(ee)){if(L[ee]=n.clone(Y[ee]),ee==="@type")for(const C of Y["@type"])C.indexOf("_:")===0&&n.addValue(c.bnodeMap,C,L,{propertyIsArray:!0});continue}if(!(R.explicit&&!(ee in N)))for(const C of Y[ee]){const K=ee in N?N[ee]:d(R);if(e.isList(C)){const v=N[ee]&&N[ee][0]&&N[ee][0]["@list"]?N[ee][0]["@list"]:d(R),U={"@list":[]};S(L,ee,U);const Q=C["@list"];for(const z of Q)e.isSubjectReference(z)?l.frame({...c,embedded:!0},[z["@id"]],v,U,"@list"):S(U,"@list",n.clone(z))}else e.isSubjectReference(C)?l.frame({...c,embedded:!0},[C["@id"]],K,L,ee):b(K[0],C)&&S(L,ee,n.clone(C))}}for(const ee of Object.keys(N).sort()){if(ee==="@type"){if(!t.isObject(N[ee][0])||!("@default"in N[ee][0]))continue}else if(r(ee))continue;const C=N[ee][0]||{};if(!m(C,q,"omitDefault")&&!(ee in L)){let v="@null";"@default"in C&&(v=n.clone(C["@default"])),t.isArray(v)||(v=[v]),L[ee]=[{"@preserve":v}]}}for(const ee of Object.keys(N["@reverse"]||{}).sort()){const C=N["@reverse"][ee];for(const K of Object.keys(c.subjects))n.getValues(c.subjects[K],ee).some(U=>U["@id"]===j)&&(L["@reverse"]=L["@reverse"]||{},n.addValue(L["@reverse"],ee,[],{propertyIsArray:!0}),l.frame({...c,embedded:!0},[K],C,L["@reverse"][ee],T))}S(D,T,L),c.subjectStack.pop()}}},l.cleanupNull=(c,p)=>{if(t.isArray(c))return c.map(D=>l.cleanupNull(D,p)).filter(D=>D);if(c==="@null")return null;if(t.isObject(c)){if("@id"in c){const N=c["@id"];if(p.link.hasOwnProperty(N)){const D=p.link[N].indexOf(c);if(D!==-1)return p.link[N][D];p.link[N].push(c)}else p.link[N]=[c]}for(const N in c)c[N]=l.cleanupNull(c[N],p)}return c};function d(c){const p={};for(const N in c)c[N]!==void 0&&(p["@"+N]=[c[N]]);return[p]}function h(c,p,N){for(let D=N.length-1;D>=0;--D){const T=N[D];if(T.graph===p&&T.subject["@id"]===c["@id"])return!0}return!1}function m(c,p,N){const D="@"+N;let T=D in c?c[D][0]:p[N];if(N==="embed"){if(T===!0)T="@once";else if(T===!1)T="@never";else if(T!=="@always"&&T!=="@never"&&T!=="@link"&&T!=="@first"&&T!=="@last"&&T!=="@once")throw new s("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:c})}return T}function w(c){if(!t.isArray(c)||c.length!==1||!t.isObject(c[0]))throw new s("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:c});if("@id"in c[0]){for(const p of n.asArray(c[0]["@id"]))if(!(t.isObject(p)||i.isAbsolute(p))||t.isString(p)&&p.indexOf("_:")===0)throw new s("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:c})}if("@type"in c[0]){for(const p of n.asArray(c[0]["@type"]))if(!(t.isObject(p)||i.isAbsolute(p)||p==="@json")||t.isString(p)&&p.indexOf("_:")===0)throw new s("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:c})}}function g(c,p,N,D){const T={};for(const q of p){const R=c.graphMap[c.graph][q];y(c,R,N,D)&&(T[q]=R)}return T}function y(c,p,N,D){let T=!0,q=!1;for(const R in N){let M=!1;const B=n.getValues(p,R),A=n.getValues(N,R).length===0;if(R==="@id"){if(t.isEmptyObject(N["@id"][0]||{})?M=!0:N["@id"].length>=0&&(M=N["@id"].includes(B[0])),!D.requireAll)return M}else if(R==="@type"){if(T=!1,A){if(B.length>0)return!1;M=!0}else if(N["@type"].length===1&&t.isEmptyObject(N["@type"][0]))M=B.length>0;else for(const j of N["@type"])t.isObject(j)&&"@default"in j?M=!0:M=M||B.some(Y=>Y===j);if(!D.requireAll)return M}else{if(r(R))continue;{const j=n.getValues(N,R)[0];let Y=!1;if(j&&(w([j]),Y="@default"in j),T=!1,B.length===0&&Y)continue;if(B.length>0&&A)return!1;if(j===void 0){if(B.length>0)return!1;M=!0}else if(e.isList(j)){const L=j["@list"][0];if(e.isList(B[0])){const ee=B[0]["@list"];e.isValue(L)?M=ee.some(C=>b(L,C)):(e.isSubject(L)||e.isSubjectReference(L))&&(M=ee.some(C=>I(c,L,C,D)))}}else e.isValue(j)?M=B.some(L=>b(j,L)):e.isSubjectReference(j)?M=B.some(L=>I(c,j,L,D)):t.isObject(j)?M=B.length>0:M=!1}}if(!M&&D.requireAll)return!1;q=q||M}return T||q}function _(c,p){const N=c.uniqueEmbeds[c.graph],D=N[p],T=D.parent,q=D.property,R={"@id":p};if(t.isArray(T)){for(let B=0;B<T.length;++B)if(n.compareValues(T[B],R)){T[B]=R;break}}else{const B=t.isArray(T[q]);n.removeValue(T,q,R,{propertyIsArray:B}),n.addValue(T,q,R,{propertyIsArray:B})}const M=B=>{const A=Object.keys(N);for(const j of A)j in N&&t.isObject(N[j].parent)&&N[j].parent["@id"]===B&&(delete N[j],M(j))};M(p)}/**
302
+ * Removes the @preserve keywords from expanded result of framing.
303
+ *
304
+ * @param input the framed, framed output.
305
+ * @param options the framing options used.
306
+ *
307
+ * @return the resulting output.
308
+ */function x(c,p){if(t.isArray(c))return c.map(N=>x(N,p));if(t.isObject(c)){// remove @preserve
309
+ if("@preserve"in c)return c["@preserve"][0];if(e.isValue(c))return c;if(e.isList(c))return c["@list"]=x(c["@list"],p),c;if("@id"in c){const N=c["@id"];if(p.link.hasOwnProperty(N)){const D=p.link[N].indexOf(c);if(D!==-1)return p.link[N][D];p.link[N].push(c)}else p.link[N]=[c]}for(const N in c){if(N==="@id"&&p.bnodesToClear.includes(c[N])){delete c["@id"];continue}c[N]=x(c[N],p)}}return c}function S(c,p,N){t.isObject(c)?n.addValue(c,p,N,{propertyIsArray:!0}):c.push(N)}function I(c,p,N,D){if(!("@id"in N))return!1;const T=c.subjects[N["@id"]];return T&&y(c,T,p,D)}function b(c,p){const N=p["@value"],D=p["@type"],T=p["@language"],q=c["@value"]?t.isArray(c["@value"])?c["@value"]:[c["@value"]]:[],R=c["@type"]?t.isArray(c["@type"])?c["@type"]:[c["@type"]]:[],M=c["@language"]?t.isArray(c["@language"])?c["@language"]:[c["@language"]]:[];return q.length===0&&R.length===0&&M.length===0?!0:!(!(q.includes(N)||t.isEmptyObject(q[0]))||!(!D&&R.length===0||R.includes(D)||D&&t.isEmptyObject(R[0]))||!(!T&&M.length===0||M.includes(T)||T&&t.isEmptyObject(M[0])))}return ts}var rs,pl;function Bf(){if(pl)return rs;pl=1;const r=et(),{isArray:e,isObject:t,isString:n,isUndefined:i}=Xe(),{isList:s,isValue:a,isGraph:o,isSimpleGraph:l,isSubjectReference:d}=_t(),{expandIri:h,getContextValue:m,isKeyword:w,process:g,processingMode:y}=Bt(),{removeBase:_,prependBase:x}=Tt(),{REGEX_KEYWORD:S,addValue:I,asArray:b,compareShortestLeast:c}=Ye(),p={};rs=p,p.compact=async({activeCtx:T,activeProperty:q=null,element:R,options:M={}})=>{if(e(R)){let A=[];for(let j=0;j<R.length;++j){const Y=await p.compact({activeCtx:T,activeProperty:q,element:R[j],options:M});Y!==null&&A.push(Y)}return M.compactArrays&&A.length===1&&(m(T,q,"@container")||[]).length===0&&(A=A[0]),A}const B=m(T,q,"@context");if(i(B)||(T=await g({activeCtx:T,localCtx:B,propagate:!0,overrideProtected:!0,options:M})),t(R)){if(M.link&&"@id"in R&&M.link.hasOwnProperty(R["@id"])){const v=M.link[R["@id"]];for(let U=0;U<v.length;++U)if(v[U].expanded===R)return v[U].compacted}if(a(R)||d(R)){const v=p.compactValue({activeCtx:T,activeProperty:q,value:R,options:M});return M.link&&d(R)&&(M.link.hasOwnProperty(R["@id"])||(M.link[R["@id"]]=[]),M.link[R["@id"]].push({expanded:R,compacted:v})),v}if(s(R)&&(m(T,q,"@container")||[]).includes("@list"))return p.compact({activeCtx:T,activeProperty:q,element:R["@list"],options:M});const A=q==="@reverse",j={},Y=T;!a(R)&&!d(R)&&(T=T.revertToPreviousContext());const L=m(Y,q,"@context");i(L)||(T=await g({activeCtx:T,localCtx:L,propagate:!0,overrideProtected:!0,options:M})),M.link&&"@id"in R&&(M.link.hasOwnProperty(R["@id"])||(M.link[R["@id"]]=[]),M.link[R["@id"]].push({expanded:R,compacted:j}));let ee=R["@type"]||[];ee.length>1&&(ee=Array.from(ee).sort());const C=T;for(const v of ee){const U=p.compactIri({activeCtx:C,iri:v,relativeTo:{vocab:!0}}),Q=m(Y,U,"@context");i(Q)||(T=await g({activeCtx:T,localCtx:Q,options:M,propagate:!1}))}const K=Object.keys(R).sort();for(const v of K){const U=R[v];if(v==="@id"){let Q=b(U).map(ae=>p.compactIri({activeCtx:T,iri:ae,relativeTo:{vocab:!1},base:M.base}));Q.length===1&&(Q=Q[0]);const z=p.compactIri({activeCtx:T,iri:"@id",relativeTo:{vocab:!0}});j[z]=Q;continue}if(v==="@type"){let Q=b(U).map(W=>p.compactIri({activeCtx:Y,iri:W,relativeTo:{vocab:!0}}));Q.length===1&&(Q=Q[0]);const z=p.compactIri({activeCtx:T,iri:"@type",relativeTo:{vocab:!0}}),V=(m(T,z,"@container")||[]).includes("@set")&&y(T,1.1)||e(Q)&&U.length===0;I(j,z,Q,{propertyIsArray:V});continue}if(v==="@reverse"){const Q=await p.compact({activeCtx:T,activeProperty:"@reverse",element:U,options:M});for(const z in Q)if(T.mappings.has(z)&&T.mappings.get(z).reverse){const ae=Q[z],V=(m(T,z,"@container")||[]).includes("@set")||!M.compactArrays;I(j,z,ae,{propertyIsArray:V}),delete Q[z]}if(Object.keys(Q).length>0){const z=p.compactIri({activeCtx:T,iri:v,relativeTo:{vocab:!0}});I(j,z,Q)}continue}if(v==="@preserve"){const Q=await p.compact({activeCtx:T,activeProperty:q,element:U,options:M});e(Q)&&Q.length===0||I(j,v,Q);continue}if(v==="@index"){if((m(T,q,"@container")||[]).includes("@index"))continue;const z=p.compactIri({activeCtx:T,iri:v,relativeTo:{vocab:!0}});I(j,z,U);continue}if(v!=="@graph"&&v!=="@list"&&v!=="@included"&&w(v)){const Q=p.compactIri({activeCtx:T,iri:v,relativeTo:{vocab:!0}});I(j,Q,U);continue}if(!e(U))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(U.length===0){const Q=p.compactIri({activeCtx:T,iri:v,value:U,relativeTo:{vocab:!0},reverse:A}),z=T.mappings.has(Q)?T.mappings.get(Q)["@nest"]:null;let ae=j;z&&(D(T,z,M),t(j[z])||(j[z]={}),ae=j[z]),I(ae,Q,U,{propertyIsArray:!0})}for(const Q of U){const z=p.compactIri({activeCtx:T,iri:v,value:Q,relativeTo:{vocab:!0},reverse:A}),ae=T.mappings.has(z)?T.mappings.get(z)["@nest"]:null;let H=j;ae&&(D(T,ae,M),t(j[ae])||(j[ae]={}),H=j[ae]);const V=m(T,z,"@container")||[],W=o(Q),F=s(Q);let Z;F?Z=Q["@list"]:W&&(Z=Q["@graph"]);let te=await p.compact({activeCtx:T,activeProperty:z,element:F||W?Z:Q,options:M});if(F)if(e(te)||(te=[te]),!V.includes("@list"))te={[p.compactIri({activeCtx:T,iri:"@list",relativeTo:{vocab:!0}})]:te},"@index"in Q&&(te[p.compactIri({activeCtx:T,iri:"@index",relativeTo:{vocab:!0}})]=Q["@index"]);else{I(H,z,te,{valueIsArray:!0,allowDuplicate:!0});continue}if(W)if(V.includes("@graph")&&(V.includes("@id")||V.includes("@index")&&l(Q))){let ce;H.hasOwnProperty(z)?ce=H[z]:H[z]=ce={};const fe=(V.includes("@id")?Q["@id"]:Q["@index"])||p.compactIri({activeCtx:T,iri:"@none",relativeTo:{vocab:!0}});I(ce,fe,te,{propertyIsArray:!M.compactArrays||V.includes("@set")})}else V.includes("@graph")&&l(Q)?(e(te)&&te.length>1&&(te={"@included":te}),I(H,z,te,{propertyIsArray:!M.compactArrays||V.includes("@set")})):(e(te)&&te.length===1&&M.compactArrays&&(te=te[0]),te={[p.compactIri({activeCtx:T,iri:"@graph",relativeTo:{vocab:!0}})]:te},"@id"in Q&&(te[p.compactIri({activeCtx:T,iri:"@id",relativeTo:{vocab:!0}})]=Q["@id"]),"@index"in Q&&(te[p.compactIri({activeCtx:T,iri:"@index",relativeTo:{vocab:!0}})]=Q["@index"]),I(H,z,te,{propertyIsArray:!M.compactArrays||V.includes("@set")}));else if(V.includes("@language")||V.includes("@index")||V.includes("@id")||V.includes("@type")){let ce;H.hasOwnProperty(z)?ce=H[z]:H[z]=ce={};let fe;if(V.includes("@language"))a(te)&&(te=te["@value"]),fe=Q["@language"];else if(V.includes("@index")){const O=m(T,z,"@index")||"@index",G=p.compactIri({activeCtx:T,iri:O,relativeTo:{vocab:!0}});if(O==="@index")fe=Q["@index"],delete te[G];else{let re;if([fe,...re]=b(te[O]||[]),!n(fe))fe=null;else switch(re.length){case 0:delete te[O];break;case 1:te[O]=re[0];break;default:te[O]=re;break}}}else if(V.includes("@id")){const O=p.compactIri({activeCtx:T,iri:"@id",relativeTo:{vocab:!0}});fe=te[O],delete te[O]}else if(V.includes("@type")){const O=p.compactIri({activeCtx:T,iri:"@type",relativeTo:{vocab:!0}});let G;switch([fe,...G]=b(te[O]||[]),G.length){case 0:delete te[O];break;case 1:te[O]=G[0];break;default:te[O]=G;break}Object.keys(te).length===1&&"@id"in Q&&(te=await p.compact({activeCtx:T,activeProperty:z,element:{"@id":Q["@id"]},options:M}))}fe||(fe=p.compactIri({activeCtx:T,iri:"@none",relativeTo:{vocab:!0}})),I(ce,fe,te,{propertyIsArray:V.includes("@set")})}else{const ce=!M.compactArrays||V.includes("@set")||V.includes("@list")||e(te)&&te.length===0||v==="@list"||v==="@graph";I(H,z,te,{propertyIsArray:ce})}}}return j}return R},p.compactIri=({activeCtx:T,iri:q,value:R=null,relativeTo:M={vocab:!1},reverse:B=!1,base:A=null})=>{if(q===null)return q;T.isPropertyTermScoped&&T.previousContext&&(T=T.previousContext);const j=T.getInverse();if(w(q)&&q in j&&"@none"in j[q]&&"@type"in j[q]["@none"]&&"@none"in j[q]["@none"]["@type"])return j[q]["@none"]["@type"]["@none"];if(M.vocab&&q in j){const K=T["@language"]||"@none",v=[];t(R)&&"@index"in R&&!("@graph"in R)&&v.push("@index","@index@set"),t(R)&&"@preserve"in R&&(R=R["@preserve"][0]),o(R)?("@index"in R&&v.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in R&&v.push("@graph@id","@graph@id@set"),v.push("@graph","@graph@set","@set"),"@index"in R||v.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in R||v.push("@graph@id","@graph@id@set")):t(R)&&!a(R)&&v.push("@id","@id@set","@type","@set@type");let U="@language",Q="@null";if(B)U="@type",Q="@reverse",v.push("@set");else if(s(R)){"@index"in R||v.push("@list");const ae=R["@list"];if(ae.length===0)U="@any",Q="@none";else{let H=ae.length===0?K:null,V=null;for(let W=0;W<ae.length;++W){const F=ae[W];let Z="@none",te="@none";if(a(F))if("@direction"in F){const ce=(F["@language"]||"").toLowerCase(),fe=F["@direction"];Z=`${ce}_${fe}`}else"@language"in F?Z=F["@language"].toLowerCase():"@type"in F?te=F["@type"]:Z="@null";else te="@id";if(H===null?H=Z:Z!==H&&a(F)&&(H="@none"),V===null?V=te:te!==V&&(V="@none"),H==="@none"&&V==="@none")break}H=H||"@none",V=V||"@none",V!=="@none"?(U="@type",Q=V):Q=H}}else{if(a(R))if("@language"in R&&!("@index"in R)){v.push("@language","@language@set"),Q=R["@language"];const ae=R["@direction"];ae&&(Q=`${Q}_${ae}`)}else"@direction"in R&&!("@index"in R)?Q=`_${R["@direction"]}`:"@type"in R&&(U="@type",Q=R["@type"]);else U="@type",Q="@id";v.push("@set")}v.push("@none"),t(R)&&!("@index"in R)&&v.push("@index","@index@set"),a(R)&&Object.keys(R).length===1&&v.push("@language","@language@set");const z=N(T,q,R,v,U,Q);if(z!==null)return z}if(M.vocab&&"@vocab"in T){const K=T["@vocab"];if(q.indexOf(K)===0&&q!==K){const v=q.substr(K.length);if(!T.mappings.has(v))return v}}let Y=null;const L=[];let ee=T.fastCurieMap;const C=q.length-1;for(let K=0;K<C&&q[K]in ee;++K)ee=ee[q[K]],""in ee&&L.push(ee[""][0]);for(let K=L.length-1;K>=0;--K){const v=L[K],U=v.terms;for(const Q of U){const z=Q+":"+q.substr(v.iri.length);T.mappings.get(Q)._prefix&&(!T.mappings.has(z)||R===null&&T.mappings.get(z)["@id"]===q)&&(Y===null||c(z,Y)<0)&&(Y=z)}}if(Y!==null)return Y;for(const[K,v]of T.mappings)if(v&&v._prefix&&q.startsWith(K+":"))throw new r(`Absolute IRI "${q}" confused with prefix "${K}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:T});if(!M.vocab)if("@base"in T)if(T["@base"]){const K=_(x(A,T["@base"]),q);return S.test(K)?`./${K}`:K}else return q;else return _(A,q);return q},p.compactValue=({activeCtx:T,activeProperty:q,value:R,options:M})=>{if(a(R)){const Y=m(T,q,"@type"),L=m(T,q,"@language"),ee=m(T,q,"@direction"),C=m(T,q,"@container")||[],K="@index"in R&&!C.includes("@index");if(!K&&Y!=="@none"&&(R["@type"]===Y||"@language"in R&&R["@language"]===L&&"@direction"in R&&R["@direction"]===ee||"@language"in R&&R["@language"]===L||"@direction"in R&&R["@direction"]===ee))return R["@value"];const v=Object.keys(R).length,U=v===1||v===2&&"@index"in R&&!K,Q="@language"in T,z=n(R["@value"]),ae=T.mappings.has(q)&&T.mappings.get(q)["@language"]===null;if(U&&Y!=="@none"&&(!Q||!z||ae))return R["@value"];const H={};return K&&(H[p.compactIri({activeCtx:T,iri:"@index",relativeTo:{vocab:!0}})]=R["@index"]),"@type"in R?H[p.compactIri({activeCtx:T,iri:"@type",relativeTo:{vocab:!0}})]=p.compactIri({activeCtx:T,iri:R["@type"],relativeTo:{vocab:!0}}):"@language"in R&&(H[p.compactIri({activeCtx:T,iri:"@language",relativeTo:{vocab:!0}})]=R["@language"]),"@direction"in R&&(H[p.compactIri({activeCtx:T,iri:"@direction",relativeTo:{vocab:!0}})]=R["@direction"]),H[p.compactIri({activeCtx:T,iri:"@value",relativeTo:{vocab:!0}})]=R["@value"],H}const B=h(T,q,{vocab:!0},M),A=m(T,q,"@type"),j=p.compactIri({activeCtx:T,iri:R["@id"],relativeTo:{vocab:A==="@vocab"},base:M.base});return A==="@id"||A==="@vocab"||B==="@graph"?j:{[p.compactIri({activeCtx:T,iri:"@id",relativeTo:{vocab:!0}})]:j}};function N(T,q,R,M,B,A){A===null&&(A="@null");const j=[];if((A==="@id"||A==="@reverse")&&t(R)&&"@id"in R){A==="@reverse"&&j.push("@reverse");const L=p.compactIri({activeCtx:T,iri:R["@id"],relativeTo:{vocab:!0}});T.mappings.has(L)&&T.mappings.get(L)&&T.mappings.get(L)["@id"]===R["@id"]?j.push.apply(j,["@vocab","@id"]):j.push.apply(j,["@id","@vocab"])}else{j.push(A);const L=j.find(ee=>ee.includes("_"));L&&j.push(L.replace(/^[^_]+_/,"_"))}j.push("@none");const Y=T.inverse[q];for(const L of M){if(!(L in Y))continue;const ee=Y[L][B];for(const C of j)if(C in ee)return ee[C]}return null}function D(T,q,R){if(h(T,q,{vocab:!0},R)!=="@nest")throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}return rs}var ns,gl;function Ff(){return gl||(gl=1,ns=r=>{class e{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(e,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(e.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:e}),e.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):r.compact(t,n)},e.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):r.expand(t)},e.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):r.flatten(t)},e}),ns}/**
310
+ * A JavaScript implementation of the JSON-LD API.
311
+ *
312
+ * @author Dave Longley
313
+ *
314
+ * @license BSD 3-Clause License
315
+ * Copyright (c) 2011-2022 Digital Bazaar, Inc.
316
+ * All rights reserved.
317
+ *
318
+ * Redistribution and use in source and binary forms, with or without
319
+ * modification, are permitted provided that the following conditions are met:
320
+ *
321
+ * Redistributions of source code must retain the above copyright notice,
322
+ * this list of conditions and the following disclaimer.
323
+ *
324
+ * Redistributions in binary form must reproduce the above copyright
325
+ * notice, this list of conditions and the following disclaimer in the
326
+ * documentation and/or other materials provided with the distribution.
327
+ *
328
+ * Neither the name of the Digital Bazaar, Inc. nor the names of its
329
+ * contributors may be used to endorse or promote products derived from
330
+ * this software without specific prior written permission.
331
+ *
332
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
333
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
334
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
335
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
336
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
337
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
338
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
339
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
340
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
341
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
342
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
343
+ */var is,yl;function Uf(){if(yl)return is;yl=1;const r=aa(),e=Tf(),t=Ye(),n=Of(),i=t.IdentifierIssuer,s=et(),a=Yu(),o=$f(),{expand:l}=kf(),{flatten:d}=Df(),{fromRDF:h}=Mf(),{toRDF:m}=Pf(),{frameMergedOrDefault:w,cleanupNull:g}=qf(),{isArray:y,isObject:_,isString:x}=Xe(),{isSubjectReference:S}=_t(),{expandIri:I,getInitialContext:b,process:c,processingMode:p}=Bt(),{compact:N,compactIri:D}=Bf(),{createNodeMap:T,createMergedNodeMap:q,mergeNodeMaps:R}=Mn(),{logEventHandler:M,logWarningEventHandler:B,safeEventHandler:A,setDefaultEventHandler:j,setupEventHandler:Y,strictEventHandler:L,unhandledEventHandler:ee}=Xr(),C=function(v){const U={},z=new a({max:100});v.compact=async function(H,V,W){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(V===null)throw new s("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(H===null)return null;W=ae(W,{base:x(H)?H:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new i("_:b"),contextResolver:new n({sharedCache:z})}),W.link&&(W.skipExpansion=!0),W.compactToRelative||delete W.base;let F;W.skipExpansion?F=H:F=await v.expand(H,W);const Z=await v.processContext(b(W),V,W);let te=await N({activeCtx:Z,element:F,options:W});W.compactArrays&&!W.graph&&y(te)?te.length===1?te=te[0]:te.length===0&&(te={}):W.graph&&_(te)&&(te=[te]),_(V)&&"@context"in V&&(V=V["@context"]),V=t.clone(V),y(V)||(V=[V]);const ce=V;V=[];for(let O=0;O<ce.length;++O)(!_(ce[O])||Object.keys(ce[O]).length>0)&&V.push(ce[O]);const fe=V.length>0;if(V.length===1&&(V=V[0]),y(te)){const O=D({activeCtx:Z,iri:"@graph",relativeTo:{vocab:!0}}),G=te;te={},fe&&(te["@context"]=V),te[O]=G}else if(_(te)&&fe){const O=te;te={"@context":V};for(const G in O)te[G]=O[G]}return te},v.expand=async function(H,V){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");V=ae(V,{keepFreeFloatingNodes:!1,contextResolver:new n({sharedCache:z})});const W={},F=[];if("expandContext"in V){const fe=t.clone(V.expandContext);_(fe)&&"@context"in fe?W.expandContext=fe:W.expandContext={"@context":fe},F.push(W.expandContext)}let Z;if(!x(H))W.input=t.clone(H);else{const fe=await v.get(H,V);Z=fe.documentUrl,W.input=fe.document,fe.contextUrl&&(W.remoteContext={"@context":fe.contextUrl},F.push(W.remoteContext))}"base"in V||(V.base=Z||"");let te=b(V);for(const fe of F)te=await c({activeCtx:te,localCtx:fe,options:V});let ce=await l({activeCtx:te,element:W.input,options:V});return _(ce)&&"@graph"in ce&&Object.keys(ce).length===1?ce=ce["@graph"]:ce===null&&(ce=[]),y(ce)||(ce=[ce]),ce},v.flatten=async function(H,V,W){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");typeof V=="function"?V=null:V=V||null,W=ae(W,{base:x(H)?H:"",contextResolver:new n({sharedCache:z})});const F=await v.expand(H,W),Z=d(F);return V===null?Z:(W.graph=!0,W.skipExpansion=!0,await v.compact(Z,V,W))},v.frame=async function(H,V,W){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(W=ae(W,{base:x(H)?H:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new n({sharedCache:z})}),x(V)){const ue=await v.get(V,W);if(V=ue.document,ue.contextUrl){let de=V["@context"];de?y(de)?de.push(ue.contextUrl):de=[de,ue.contextUrl]:de=ue.contextUrl,V["@context"]=de}}const F=V?V["@context"]||{}:{},Z=await v.processContext(b(W),F,W);W.hasOwnProperty("omitGraph")||(W.omitGraph=p(Z,1.1)),W.hasOwnProperty("pruneBlankNodeIdentifiers")||(W.pruneBlankNodeIdentifiers=p(Z,1.1));const te=await v.expand(H,W),ce={...W};ce.isFrame=!0,ce.keepFreeFloatingNodes=!0;const fe=await v.expand(V,ce),O=Object.keys(V).map(ue=>I(Z,ue,{vocab:!0}));ce.merged=!O.includes("@graph"),ce.is11=p(Z,1.1);const G=w(te,fe,ce);ce.graph=!W.omitGraph,ce.skipExpansion=!0,ce.link={},ce.framing=!0;let re=await v.compact(G,F,ce);return ce.link={},re=g(re,ce),re},v.link=async function(H,V,W){const F={};return V&&(F["@context"]=V),F["@embed"]="@link",v.frame(H,F,W)},v.normalize=v.canonize=async function(H,V){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if(V=ae(V,{base:x(H)?H:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new n({sharedCache:z})}),"inputFormat"in V){if(V.inputFormat!=="application/n-quads"&&V.inputFormat!=="application/nquads")throw new s("Unknown canonicalization input format.","jsonld.CanonizeError");const Z=o.parse(H);return r.canonize(Z,V)}const W={...V};delete W.format,W.produceGeneralizedRdf=!1;const F=await v.toRDF(H,W);return r.canonize(F,V)},v.fromRDF=async function(H,V){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");V=ae(V,{format:x(H)?"application/n-quads":void 0});const{format:W}=V;let{rdfParser:F}=V;if(W){if(F=F||U[W],!F)throw new s("Unknown input format.","jsonld.UnknownFormat",{format:W})}else F=()=>H;const Z=await F(H);return h(Z,V)},v.toRDF=async function(H,V){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");V=ae(V,{base:x(H)?H:"",skipExpansion:!1,contextResolver:new n({sharedCache:z})});let W;V.skipExpansion?W=H:W=await v.expand(H,V);const F=m(W,V);if(V.format){if(V.format==="application/n-quads"||V.format==="application/nquads")return o.serialize(F);throw new s("Unknown output format.","jsonld.UnknownFormat",{format:V.format})}return F},v.createNodeMap=async function(H,V){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");V=ae(V,{base:x(H)?H:"",contextResolver:new n({sharedCache:z})});const W=await v.expand(H,V);return q(W,V)},v.merge=async function(H,V,W){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!y(H))throw new TypeError('Could not merge, "docs" must be an array.');typeof V=="function"?V=null:V=V||null,W=ae(W,{contextResolver:new n({sharedCache:z})});const F=await Promise.all(H.map(ue=>{const de={...W};return v.expand(ue,de)}));let Z=!0;"mergeNodes"in W&&(Z=W.mergeNodes);const te=W.issuer||new i("_:b"),ce={"@default":{}};for(let ue=0;ue<F.length;++ue){const de=t.relabelBlankNodes(F[ue],{issuer:new i("_:b"+ue+"-")}),pe=Z||ue===0?ce:{"@default":{}};if(T(de,pe,"@default",te),pe!==ce)for(const X in pe){const le=pe[X];if(!(X in ce)){ce[X]=le;continue}const he=ce[X];for(const se in le)se in he||(he[se]=le[se])}}const fe=R(ce),O=[],G=Object.keys(fe).sort();for(let ue=0;ue<G.length;++ue){const de=fe[G[ue]];S(de)||O.push(de)}return V===null?O:(W.graph=!0,W.skipExpansion=!0,await v.compact(O,V,W))},Object.defineProperty(v,"documentLoader",{get:()=>v._documentLoader,set:H=>v._documentLoader=H}),v.documentLoader=async H=>{throw new s("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:H})},v.get=async function(H,V){let W;typeof V.documentLoader=="function"?W=V.documentLoader:W=v.documentLoader;const F=await W(H);try{if(!F.document)throw new s("No remote document found at the given URL.","jsonld.NullRemoteDocument");x(F.document)&&(F.document=JSON.parse(F.document))}catch(Z){throw new s("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Z,remoteDoc:F})}return F},v.processContext=async function(H,V,W){return W=ae(W,{base:"",contextResolver:new n({sharedCache:z})}),V===null?b(W):(V=t.clone(V),_(V)&&"@context"in V||(V={"@context":V}),c({activeCtx:H,localCtx:V,options:W}))},v.getContextValue=Bt().getContextValue,v.documentLoaders={},v.useDocumentLoader=function(H){if(!(H in v.documentLoaders))throw new s('Unknown document loader type: "'+H+'"',"jsonld.UnknownDocumentLoader",{type:H});v.documentLoader=v.documentLoaders[H].apply(v,Array.prototype.slice.call(arguments,1))},v.registerRDFParser=function(H,V){U[H]=V},v.unregisterRDFParser=function(H){delete U[H]},v.registerRDFParser("application/n-quads",o.parse),v.registerRDFParser("application/nquads",o.parse),v.url=Tt(),v.logEventHandler=M,v.logWarningEventHandler=B,v.safeEventHandler=A,v.setDefaultEventHandler=j,v.strictEventHandler=L,v.unhandledEventHandler=ee,v.util=t,Object.assign(v,t),v.promises=v,v.RequestQueue=Ku(),v.JsonLdProcessor=Ff()(v),e.setupGlobals(v),e.setupDocumentLoaders(v);function ae(H,{documentLoader:V=v.documentLoader,...W}){if(H&&"compactionMap"in H)throw new s('"compactionMap" not supported.',"jsonld.OptionsError");if(H&&"expansionMap"in H)throw new s('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:V},W,H,{eventHandler:Y({options:H})})}return v},K=function(){return C(function(){return K()})};return C(K),is=K,is}var Hf=Uf();const ss={},as={};let Ds;class Vf{constructor(e){this.loadedExternalUrls=[],this.loadedClasses=[],this.config=e}async loadGraphs(){this.loadedExternalUrls=[],this.loadedClasses=[];let e=Ds;this.config.prefixes={};const t=[];if(e||(e=new Ue,t.push(this.importRDF(this.config.attributes.shapes?this.config.attributes.shapes:this.config.attributes.shapesUrl?this.fetchRDF(this.config.attributes.shapesUrl):"",e,bn))),t.push(this.importRDF(this.config.attributes.values?this.config.attributes.values:this.config.attributes.valuesUrl?this.fetchRDF(this.config.attributes.valuesUrl):"",e,lt,new Rs({blankNodePrefix:""}))),await Promise.all(t),!Ds&&e?.size==0&&this.config.attributes.valuesSubject){const n=[...e.getObjects(this.config.attributes.valuesSubject,qe,lt),...e.getObjects(this.config.attributes.valuesSubject,Ts,lt)],i=[];for(const s of n){const a=this.toURL(s.value);a&&this.loadedExternalUrls.indexOf(a)<0&&(this.loadedExternalUrls.push(a),i.push(this.importRDF(this.fetchRDF(a),e,bn)))}try{await Promise.allSettled(i)}catch(s){console.warn(s)}}this.config.store=e}async importRDF(e,t,n,i){const s=i||new Rs,a=async o=>{const l=[];await new Promise((d,h)=>{s.parse(o,(m,w,g)=>{if(m)return console.warn("failed parsing graph",n,m.message),h(m);if(w){if(t.add(new Rn(w.subject,w.predicate,w.object,n)),this.config.attributes.ignoreOwlImports===null&&Ws.equals(w.predicate)){const y=this.toURL(w.object.value);y&&this.loadedExternalUrls.indexOf(y)<0&&(this.loadedExternalUrls.push(y),l.push(this.importRDF(this.fetchRDF(y),t,Ee.namedNode(y),i)))}if(this.config.classInstanceProvider&&zs.equals(w.predicate)){const y=w.object.value;if(this.loadedClasses.indexOf(y)<0){let _;y in as?_=as[y]:(_=this.config.classInstanceProvider(y),as[y]=_),this.loadedClasses.push(y),l.push(this.importRDF(_,t,n,i))}}return}g&&this.config.registerPrefixes(g),d(null)})});try{await Promise.allSettled(l)}catch(d){console.warn(d)}};if(e instanceof Promise&&(e=await e),e){try{e=await Hf.toRDF(JSON.parse(e),{format:"application/n-quads"})}catch{}await a(e)}}async fetchRDF(e){if(e in ss)return ss[e];const t=fetch(e,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then(n=>n.text());return ss[e]=t,t}toURL(e){if(Ls(e))return e;if(this.config.prefixes){const t=e.split(":");if(t.length===2){const n=this.config.prefixes[t[0]];if(n&&(e=e.replace(`${t[0]}:`,n),Ls(e)))return e}}return null}}function Gf(r){Ds=r}class os{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.valuesGraph=null,this.view=null,this.language=null,this.loading="Loading…",this.ignoreOwlImports=null,this.collapse=null,this.submitButton=null,this.generateNodeShapeReference=null,this.showNodeIds=null}}class ml{constructor(e,t){this.attributes=new os,this.loader=new Vf(this),this.prefixes={},this.editMode=!0,this.lists={},this.groups=[],this.renderedNodes=new Set,this._store=new Ue,this.theme=e,this.form=t,this.languages=[...new Set(navigator.languages.flatMap(n=>n.length>2?[n.toLocaleLowerCase(),n.substring(0,2)]:n)),""]}updateAttributes(e){const t=new os;if(Object.keys(t).forEach(n=>{const i=e.dataset[n];i!==void 0&&(t[n]=i)}),this.editMode=t.view===null,this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){const n=this.languages.indexOf(t.language);n>-1&&this.languages.splice(n,1),this.languages.unshift(t.language)}t.valuesGraph&&(this.valuesGraphId=Ee.namedNode(t.valuesGraph))}static dataAttributes(){const e=new os;return Object.keys(e).map(t=>(t=t.replace(/[A-Z]/g,n=>"-"+n.toLowerCase()),"data-"+t))}get store(){return this._store}set store(e){this._store=e,this.lists=e.extractLists(),this.groups=[],e.forSubjects(t=>{this.groups.push(t.id)},qe,`${be}PropertyGroup`,null)}registerPrefixes(e){for(const t in e)t&&(this.prefixes[t]=e[t])}}function Wf(r){return"_:"+r.value}function zf(r,e){return[...r].map(t=>e(t)).join(`
344
+ `)+`
345
+ `}function Jf(){return""}function Zu(r){return"<"+r.value+">"}const Qf=/["\\\\\n\r]/,Xf=/["\\\\\n\r]/g,Kf={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function Yf(r){return Kf[r]}function Zf(r){return Qf.test(r)?r.replace(Xf,Yf):r}function eh(r){const e=Zf(r.value);return r.datatype.value==="http://www.w3.org/2001/XMLSchema#string"?'"'+e+'"':r.datatype.value==="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"?'"'+e+'"@'+r.language:'"'+e+'"^^'+Zu(r.datatype)}function th(r,e){const t=e(r.subject),n=e(r.predicate),i=e(r.object),s=e(r.graph);return`${t} ${n} ${i} ${s?s+" ":""}.`}function rh(r){return"?"+r.value}function Je(r){if(!r)return null;if(r.termType==="BlankNode")return Wf(r);if(r.termType==="DefaultGraph")return Jf();if(r.termType==="Literal")return eh(r);if(r.termType==="NamedNode")return Zu(r);if(r.termType==="Quad"||r.subject&&r.predicate&&r.object&&r.graph)return th(r,Je);if(r.termType==="Variable")return rh(r);if(r[Symbol.iterator])return zf(r,Je);throw new Error(`unknown termType ${r.termType}`)}class lr{constructor(e){if(this.index=new Map,e)for(const[t,n]of e)this.set(t,n)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(Je(e))}*entries(){for(const[,{term:e,value:t}]of this.index)yield[e,t]}forEach(e,t){for(const n of this.entries())e.call(t,n[1],n[0],this)}get(e){const t=this.index.get(Je(e));return t&&t.value}has(e){return this.index.has(Je(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,t){const n=Je(e);return this.index.set(n,{term:e,value:t}),this}*values(){for(const[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}class bl{constructor({dataset:e,end:t,quad:n,start:i}){this.dataset=e,this.end=t,this.quad=n,this.start=i}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}}function wl(r){try{return Je(r)}catch{return null}}class Ze{constructor(e){if(this.index=new Map,e)for(const t of e)this.add(t)}get size(){return this.index.size}add(e){const t=Je(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return e?this.index.delete(wl(e)):!1}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return e?this.index.has(wl(e)):!1}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}let ec=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};ec.prototype.termType="BlankNode";let la=class{equals(e){return!!e&&e.termType===this.termType}};la.prototype.termType="DefaultGraph";la.prototype.value="";function vl(r,e){if(!e)return null;if(e.termType==="BlankNode")return r.blankNode(e.value);if(e.termType==="DefaultGraph")return r.defaultGraph();if(e.termType==="Literal")return r.literal(e.value,e.language||r.namedNode(e.datatype.value));if(e.termType==="NamedNode")return r.namedNode(e.value);if(e.termType==="Quad"){const t=r.fromTerm(e.subject),n=r.fromTerm(e.predicate),i=r.fromTerm(e.object),s=r.fromTerm(e.graph);return r.quad(t,n,i,s)}if(e.termType==="Variable")return r.variable(e.value);throw new Error(`unknown termType ${e.termType}`)}let yn=class{constructor(e,t,n,i=""){this.value=e,this.language=t,this.datatype=n,this.direction=i}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)&&(e.direction||"")===this.direction}};yn.prototype.termType="Literal";let Kr=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};Kr.prototype.termType="NamedNode";let ua=class{constructor(e,t,n,i){this.subject=e,this.predicate=t,this.object=n,this.graph=i}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}};ua.prototype.termType="Quad";ua.prototype.value="";let tc=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};tc.prototype.termType="Variable";const nh=new Kr("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),_l=new Kr("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),ih=new Kr("http://www.w3.org/2001/XMLSchema#string");let rc=class{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new la}}namedNode(e){return new Kr(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new ec(e)}literal(e,t){return typeof t=="string"?new yn(e,t,_l):typeof t?.language=="string"?new yn(e,t.language,t.direction?nh:_l,t.direction):new yn(e,"",t||ih)}variable(e){return new tc(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,n,i=this.defaultGraph()){return new ua(e,t,n,i)}fromTerm(e){return vl(this,e)}fromQuad(e){return vl(this,e)}};rc.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const ca=new rc,sh={apply:(r,e,t)=>r(t[0]),get:(r,e)=>r(e)};function tt(r,{factory:e=ca}={}){const t=(n="")=>e.namedNode(`${r}${n.raw||n}`);return typeof Proxy>"u"?t:new Proxy(t,sh)}tt("http://www.w3.org/2001/XMLSchema#");const at=tt("http://www.w3.org/1999/02/22-rdf-syntax-ns#");tt("http://www.w3.org/2000/01/rdf-schema#");class Ne{static add({ptr:e,start:t,end:n,subjects:i=[null],predicates:s=[null],objects:a=[null],graphs:o,callback:l}={}){if(!e.factory)throw new Error("add operation requires a factory");let d=()=>{};l&&(d=h=>{l(new bl({dataset:e.dataset,start:t,end:n,quad:h}))});for(const h of i)for(const m of s)for(const w of a)for(const g of o){const y={subject:h,predicate:m,object:w,graph:g};y[t]=e.term;const _=e.factory.quad(y.subject,y.predicate,y.object,y.graph);e.dataset.add(_),d(_)}return e}static addList({ptr:e,predicates:t,items:n,graphs:i}){if(e.isAny())throw new Error("can't attach a list to an any ptr");for(const s of t)for(const a of i){const o=n.map(()=>e.factory.blankNode());e.dataset.add(e.factory.quad(e.term,s,o[0]||at.nil,a));for(let l=0;l<o.length;l++)e.dataset.add(e.factory.quad(o[l],at.first,n[l],a)),e.dataset.add(e.factory.quad(o[l],at.rest,o[l+1]||at.nil,a))}return e}static delete({ptr:e,start:t,subjects:n=[null],predicates:i=[null],objects:s=[null]}){for(const a of n)for(const o of i)for(const l of s){const d={subject:a,predicate:o,object:l};d[t]=e.term;const h=e.dataset.match(d.subject,d.predicate,d.object);for(const m of h)e.dataset.delete(m)}return e}static deleteList({ptr:e,predicates:t}){const n=[];for(const i of t)for(const s of e.dataset.match(e.term,i)){let a=s.object;for(n.push(s);!at.nil.equals(a);){a=n[n.length-1].object;const o=e.dataset.match(a);if(o.size===0)break;for(const l of o)n.push(l)}}for(const i of n)e.dataset.delete(i);return e}static execute({ptr:e,operation:t="traverse",quantifier:n,start:i,end:s,subjects:a,predicates:o,objects:l,graphs:d,items:h,callback:m}={}){if(t==="add")return Ne.add({ptr:e,start:i,end:s,subjects:a,predicates:o,objects:l,graphs:d,callback:m});if(t==="addList")return Ne.addList({ptr:e,predicates:o,items:h,graphs:d});if(t==="delete")return Ne.delete({ptr:e,start:i,subjects:a,predicates:o,objects:l});if(t==="deleteList")return Ne.deleteList({ptr:e,predicates:o});if(t==="isList")return Ne.isList({ptr:e});if(t==="list")return Ne.list({ptr:e});if(t==="traverse")return Ne.traverse({ptr:e,quantifier:n,start:i,end:s,subjects:a,predicates:o,objects:l,graphs:d});throw new Error(`unknown operation ${t}`)}static isList({ptr:e}){return e.isAny()?!1:!!(at.nil.equals(e.term)||Ne.traverse({ptr:e,predicates:[at.first]}).length===1)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(at.nil);){const t=e.out([at.first]);if(t.length!==1)throw new Error(`Invalid list: rdf:first count not equals one on ${e.value}`);const n=e.out([at.rest]);if(n.length!==1)throw new Error(`Invalid list: rdf:rest count not equals one on ${e.value}`);yield t[0],e=n[0]}}}}static traverse({ptr:e,quantifier:t="one",start:n="subject",end:i="object",subjects:s=[null],predicates:a=[null],objects:o=[null],graphs:l=[null],callback:d}){if(t==="one")return Ne.traverseOne({ptr:e,start:n,end:i,subjects:s,predicates:a,objects:o,graphs:l,callback:d});if(t==="oneOrMore"){const h=Ne.traverse({ptr:e,end:i,start:n,subjects:s,predicates:a,objects:o,graphs:l,callback:d});return Ne.traverseMore({ptrs:h,end:i,start:n,subjects:s,predicates:a,objects:o,graphs:l,callback:d})}if(t==="zeroOrMore")return Ne.traverseMore({ptrs:[e],end:i,start:n,subjects:s,predicates:a,objects:o,graphs:l,callback:d});if(t==="zeroOrOne")return[e,...Ne.traverse({ptr:e,end:i,start:n,subjects:s,predicates:a,objects:o,graphs:l,callback:d})];throw new Error(`unknown quantifier ${t}`)}static traverseMore({ptrs:e,end:t,start:n,subjects:i,predicates:s,objects:a,graphs:o,callback:l}={}){let d=[...e],h,m;do{h=[];for(const w of e)h=[...h,...Ne.traverseOne({ptr:w,end:t,start:n,subjects:i,predicates:s,objects:a,graphs:o,callback:l})];m&&(h=h.filter(w=>!m.has(w.term))),e=h,d=[...d,...h],m=new Ze(d.map(w=>w.term))}while(h.length>0);return d}static traverseOne({ptr:e,start:t,end:n,subjects:i,predicates:s,objects:a,graphs:o,callback:l=(d,h)=>h.extend(d)}={}){const d=[];for(const h of i)for(const m of s)for(const w of a)for(const g of o){const y={subject:h,predicate:m,object:w,graph:g};y[t]=e.term;for(const _ of e.dataset.match(y.subject,y.predicate,y.object,y.graph))d.push(l(new bl({dataset:e.dataset,end:n,quad:_,start:t}),e))}return d}}function xl(r,e){return e?t=>e(r.extend(t)):()=>{}}class Sl{constructor({dataset:e,edges:t=[],factory:n,graph:i,term:s}){if(!e&&t.length===0)throw new Error("dataset or edges is required");if(t.length===0&&typeof s>"u")throw new Error("edges or term must be given");if(t.length>0&&s)throw new Error("edges or term must be given");this.dataset=e||t[t.length-1].dataset,this.edges=t,this.factory=n,this._graph=i,t.length===0&&(this._term=s)}get edge(){return this.edges[this.edges.length-1]}get graph(){return typeof this._graph=="object"?this._graph:this.edge&&this.edge.graph}get length(){return this._term!==void 0?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return this._term!==void 0?this._term:this.edge.term}get value(){const e=this.term;return e===null?void 0:e.value}addIn(e,t,n){return Ne.add({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:xl(this,n)})}addList(e,t){return Ne.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:t})}addOut(e,t,n){return Ne.add({ptr:this,start:"subject",end:"object",predicates:e,objects:t,graphs:[this.graph||this.factory.defaultGraph()],callback:xl(this,n)})}deleteIn(e,t){return Ne.delete({ptr:this,start:"object",subjects:t,predicates:e})}deleteList(e){return Ne.deleteList({ptr:this,predicates:e})}deleteOut(e,t){return Ne.delete({ptr:this,start:"subject",predicates:e,objects:t})}execute({operation:e,quantifier:t,start:n,end:i,subjects:s,predicates:a,objects:o,graphs:l,items:d,callback:h}){return Ne.execute({ptr:this,operation:e,quantifier:t,start:n,end:i,subjects:s,predicates:a,objects:o,graphs:l,items:d,callback:h})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,t){return Ne.traverse({ptr:this,start:"object",end:"object",subjects:t,predicates:e,graphs:[this.graph]})}hasOut(e,t){return Ne.traverse({ptr:this,start:"subject",end:"subject",predicates:e,objects:t,graphs:[this.graph]})}in(e,t){return Ne.traverse({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return Ne.isList({ptr:this})}list(){return Ne.list({ptr:this})}*nodes(){for(let e=0;e<this.length;e++)this._term!==void 0?yield{dataset:this.dataset,term:this._term}:this.edges.length>e?yield{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e&&(yield{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term})}out(e,t){return Ne.traverse({ptr:this,predicates:e,objects:t,graphs:[this.graph]})}*quads(){for(const{quad:e}of this.edges)yield e}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}}function El(r,e){return r?r.equals(e):r===e}function ah(r,e){return!(r.dataset!==e.dataset||!El(r.graph,e.graph)||!El(r.term,e.term))}function Il(r,e){return e?t=>e(new r.constructor({factory:r.factory,ptrs:[t]})):()=>{}}class Sn{constructor({dataset:e,factory:t,ptrs:n,terms:i,graphs:s}){if(this.factory=t,n)this.ptrs=[...n];else{this.ptrs=[];for(const a of i||[null])for(const o of s||[null])this.ptrs.push(new Sl({dataset:e,factory:t,graph:o,term:a}))}}get dataset(){const e=new Set(this.datasets);return e.size!==1?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map(e=>e.dataset)}get term(){const e=new Ze(this.terms);if(e.size===1)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map(e=>e.term)}get value(){const e=this.term;return e?.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,t,n){const i=Il(this,n);for(const s of this.ptrs)s.addIn(e,t,i);return this}addList(e,t){if(this.isAny())throw new Error("can't attach a list to an any ptr");for(const n of this.ptrs)n.addList(e,t);return this}addOut(e,t,n){const i=Il(this,n);for(const s of this.ptrs)s.addOut(e,t,i);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,t){for(const n of this.ptrs)n.deleteIn(e,t);return this}deleteList(e){for(const t of this.ptrs)t.deleteList(e);return this}deleteOut(e,t){for(const n of this.ptrs)n.deleteOut(e,t);return this}distinct(){const e=this.ptrs.reduce((t,n)=>(t.some(i=>ah(i,n))||t.push(n.trim()),t),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap(t=>t.execute(e))})}executeAll(e){let t=this;for(const n of e)t=t.execute(n);return t}filter(e){return this.clone({ptrs:[...this].filter(e).map(t=>t.ptrs[0])})}hasIn(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.hasIn(e,t))})}hasOut(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.hasOut(e,t))})}in(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.in(e,t))})}isAny(){return this.ptrs.length>0&&this.ptrs.some(e=>e.isAny())}isList(){return this.ptrs.length!==1?!1:this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list(),t=this;return function*(){for(const n of e)yield t.clone({ptrs:[n]})}()}map(e){return[...this].map(e)}node(e){const t=this.dataset,n=[...e].map(i=>new Sl({dataset:t,factory:this.factory,term:i}));return this.clone({ptrs:n})}out(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.out(e,t))})}*quads(){for(const{edges:e}of this.ptrs)for(const{quad:t}of e)yield t}trim(){return this.clone({ptrs:this.ptrs.map(e=>e.trim())})}*[Symbol.iterator](){for(const e of this.ptrs)yield this.clone({ptrs:[e]})}}tt("http://www.w3.org/2002/07/owl#");const Ft=tt("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),oh=tt("http://www.w3.org/2000/01/rdf-schema#"),ne=tt("http://www.w3.org/ns/shacl#"),Ms=tt("https://schemas.link/shacl-next#"),da=tt("http://www.w3.org/2001/XMLSchema#");function lh(r){return r?`{${[...r.quads()].map(e=>Je(e)).join(" ")}}`:"{}"}function uh(r){return r?`{${r.map(e=>lh(e)).join(" ")}}`:"{}"}var ls,Rl;function ch(){if(Rl)return ls;Rl=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return ls=e,ls}var us,Nl;function dh(){if(Nl)return us;Nl=1;var r=ch(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return us=t,us}var cs,Tl;function fh(){if(Tl)return cs;Tl=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return cs=r,cs}var ds,Al;function hh(){if(Al)return ds;Al=1;var r=typeof Kt=="object"&&Kt&&Kt.Object===Object&&Kt;return ds=r,ds}var fs,Ll;function ph(){if(Ll)return fs;Ll=1;var r=hh(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return fs=t,fs}var hs,jl;function nc(){if(jl)return hs;jl=1;var r=ph(),e=r.Symbol;return hs=e,hs}var ps,Ol;function gh(){if(Ol)return ps;Ol=1;var r=nc(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,i=r?r.toStringTag:void 0;function s(a){var o=t.call(a,i),l=a[i];try{a[i]=void 0;var d=!0}catch{}var h=n.call(a);return d&&(o?a[i]=l:delete a[i]),h}return ps=s,ps}var gs,$l;function yh(){if($l)return gs;$l=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return gs=t,gs}var ys,kl;function mh(){if(kl)return ys;kl=1;var r=nc(),e=gh(),t=yh(),n="[object Null]",i="[object Undefined]",s=r?r.toStringTag:void 0;function a(o){return o==null?o===void 0?i:n:s&&s in Object(o)?e(o):t(o)}return ys=a,ys}var ms,Dl;function bh(){if(Dl)return ms;Dl=1;function r(e){return e!=null&&typeof e=="object"}return ms=r,ms}var bs,Ml;function wh(){if(Ml)return bs;Ml=1;var r=mh(),e=bh(),t="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&r(i)==t}return bs=n,bs}var ws,Cl;function vh(){if(Cl)return ws;Cl=1;var r=dh(),e=fh(),t=wh(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt;function l(d){if(typeof d=="number")return d;if(t(d))return n;if(e(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=e(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=r(d);var m=s.test(d);return m||a.test(d)?o(d.slice(2),m?2:8):i.test(d)?n:+d}return ws=l,ws}var vs,Pl;function _h(){if(Pl)return vs;Pl=1;var r=vh(),e=1/0,t=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=r(i),i===e||i===-e){var s=i<0?-1:1;return s*t}return i===i?i:0}return vs=n,vs}var _s,ql;function xh(){if(ql)return _s;ql=1;var r=_h();function e(t){var n=r(t),i=n%1;return n===n?i?n-i:n:0}return _s=e,_s}var xs,Bl;function Sh(){if(Bl)return xs;Bl=1;var r=xh(),e="Expected a function";function t(n,i){var s;if(typeof i!="function")throw new TypeError(e);return n=r(n),function(){return--n>0&&(s=i.apply(this,arguments)),n<=1&&(i=void 0),s}}return xs=t,xs}var Ss,Fl;function Eh(){if(Fl)return Ss;Fl=1;var r=Sh();function e(t){return r(2,t)}return Ss=e,Ss}var Ih=Eh();const nt=wc(Ih);let Ul=class{constructor({details:e,factory:t,options:n,results:i=[]}={}){this.details=e,this.factory=t,this.options=n,this.results=i,this._conforms=nt(()=>!this.results.some(s=>s.severity.equals(ne.Info)||s.severity.equals(ne.Violation)||s.severity.equals(ne.Warning))),this._ptr=nt(()=>this.build())}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){const e=new Sn({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([Ft.type],[ne.ValidationReport]).addOut([ne.conforms],[this.factory.literal(this.conforms.toString(),da.boolean)]);for(const t of this.results)e.addOut([ne.result],[this.factory.blankNode()],n=>{t.build(n,this.options)});return e}coverage(){return this.results.flatMap(e=>e.coverage())}};function Rh(r,e){return Object.entries(e).reduce((t,[n,i])=>(i&&i.termType&&(i=Je(i)),t.replace(`{$${n}}`,i).replace(`{?${n}}`,i)),r)}let Nh=class{constructor({args:e={},constraintComponent:t,factory:n,focusNode:i,message:s=[],path:a,results:o=[],severity:l,shape:d,source:h=[],value:m,valuePaths:w=[]}={}){this.args=e,this.constraintComponent=t,this.factory=n,this.focusNode=i,this.path=a||d.path,this.results=o,this.severity=l,this.shape=d,this.source=h,this.value=m,this.valuePaths=w,this._message=nt(()=>(this.shape.message.length>0&&(s=this.shape.message),s.length===0&&(s=this.shape.ptr.node([this.constraintComponent]).out([ne.message]).terms),s.map(g=>n.literal(Rh(g.value,e),g.language||null))))}get message(){return this._message()}build(e,{details:t}={}){e.addOut([Ft.type],[ne.ValidationResult]).addOut([ne.focusNode],this.focusNode.terms).addOut([ne.resultSeverity],[this.severity]).addOut([ne.sourceConstraint],this.source).addOut([ne.sourceConstraintComponent],[this.constraintComponent]).addOut([ne.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([ne.resultMessage],this.message);const n=i=>{if(i.quantifier==="one")return i.predicates.length>1?e.node([this.factory.blankNode()]).addList([ne.alternativePath],i.predicates):i.start==="object"?e.node([this.factory.blankNode()]).addOut([ne.inversePath],[i.predicates[0]]):e.node([i.predicates[0]]);if(i.quantifier==="oneOrMore")return e.node([this.factory.blankNode()]).addOut([ne.oneOrMorePath],[i.predicates[0]]);if(i.quantifier==="zeroOrMore")return e.node([this.factory.blankNode()]).addOut([ne.zeroOrMorePath],[i.predicates[0]]);if(i.quantifier==="zeroOrOne")return e.node([this.factory.blankNode()]).addOut([ne.zeroOrOnePath],[i.predicates[0]])};if(this.path&&(this.path.length===1?e.addOut([ne.resultPath],n(this.path[0]).terms):e.addList([ne.resultPath],this.path.map(i=>n(i).term))),typeof this.value<"u"&&e.addOut([ne.value],this.value.terms),t)for(const i of this.results)e.addOut([ne.detail],[this.factory.blankNode()],s=>{i.build(s,{details:t})})}coverage(){return[...this.valuePaths.flatMap(e=>[...e.quads()]),...this.results.flatMap(e=>e.coverage())]}};class fa{constructor({factory:e,focusNode:t,options:n={debug:!1,details:!1},processed:i=new Set,report:s=new Ul({factory:e,options:n}),results:a=new Map,shape:o,value:l,valueOrNode:d,valuePaths:h,values:m}={}){this.factory=e,this.focusNode=t,this.options=n,this.processed=i,this.report=s,this.results=a,this.shape=o,this.value=l,this.valuePaths=h,this.valueOrNode=d,this.values=m}create({child:e,focusNode:t=this.focusNode,shape:n=this.shape,value:i=this.value,valueOrNode:s=this.valueOrNode,valuePaths:a=this.valuePaths,values:o=this.values}={}){return new fa({factory:this.factory,focusNode:t,options:this.options,processed:this.processed,report:e?new Ul({factory:this.factory,options:this.options}):this.report,results:this.results,shape:n,value:i,valueOrNode:s,valuePaths:a,values:o})}id({shape:e=this.shape}={}){return`${Je(e.ptr.term)} - ${Je(this.focusNode.term)} - ${uh(this.valuePaths)}`}result(e){const t=new Nh({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),n=this.id();this.results.has(n)?this.results.get(n).add(t):this.results.set(n,new Set([t])),this.report.results.push(t)}debug(e,t){this.options.debug&&this.result({severity:Ms.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:Ms.Trace,constraintComponent:e,...t})}test(e,t,n){e?this.debug(t,n):this.violation(t,n)}violation(e,t){this.result({constraintComponent:e,severity:this.shape.severity||ne.Violation,...t})}}function Th(){return{generic:Ah()}}function Ah(){return r=>{r.trace(Ms.TraversalConstraintComponent,{args:{},message:[r.factory.literal("Traversal")],value:r.valueOrNode})}}class Lh{constructor(e){this.validations=new lr(e)}compile(e){const t=e.validator.options.coverage;if(e.deactivated)return[];let n=!1;const i=new Set;for(const s of e.ptr.execute({start:"subject",end:"predicate"})){const a=this.validations.get(s.term);a&&(i.add(a),s.term.equals(ne.property)&&(n=!0))}return t&&e.isPropertyShape&&!n&&i.add(Th),[...i].map(s=>s(e)).filter(Boolean)}}var Ot={},$t={},vr={},Hl;function ic(){if(Hl)return vr;Hl=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.BlankNode=void 0;let r=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&t.termType==="BlankNode"&&t.value===this.value}};return vr.BlankNode=r,vr}var _r={},xr={},Vl;function sc(){if(Vl)return xr;Vl=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.DefaultGraph=void 0;let r=class{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&t.termType==="DefaultGraph"}};return xr.DefaultGraph=r,r.INSTANCE=new r,xr}var Sr={},Er={},Gl;function ha(){if(Gl)return Er;Gl=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.NamedNode=void 0;let r=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&t.termType==="NamedNode"&&t.value===this.value}};return Er.NamedNode=r,Er}var Wl;function ac(){if(Wl)return Sr;Wl=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Literal=void 0;const r=ha();let e=class Mr{constructor(n,i){this.termType="Literal",this.value=n,typeof i=="string"?(this.language=i,this.datatype=Mr.RDF_LANGUAGE_STRING,this.direction=""):i?"termType"in i?(this.language="",this.datatype=i,this.direction=""):(this.language=i.language,this.datatype=i.direction?Mr.RDF_DIRECTIONAL_LANGUAGE_STRING:Mr.RDF_LANGUAGE_STRING,this.direction=i.direction||""):(this.language="",this.datatype=Mr.XSD_STRING,this.direction="")}equals(n){return!!n&&n.termType==="Literal"&&n.value===this.value&&n.language===this.language&&(n.direction===this.direction||!n.direction&&this.direction==="")&&this.datatype.equals(n.datatype)}};return Sr.Literal=e,e.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),e.RDF_DIRECTIONAL_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),e.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string"),Sr}var Ir={},zl;function oc(){if(zl)return Ir;zl=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.Quad=void 0;let r=class{constructor(t,n,i,s){this.termType="Quad",this.value="",this.subject=t,this.predicate=n,this.object=i,this.graph=s}equals(t){return!!t&&(t.termType==="Quad"||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}};return Ir.Quad=r,Ir}var Rr={},Jl;function lc(){if(Jl)return Rr;Jl=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.Variable=void 0;let r=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&t.termType==="Variable"&&t.value===this.value}};return Rr.Variable=r,Rr}var Ql;function jh(){if(Ql)return _r;Ql=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.DataFactory=void 0;const r=ic(),e=sc(),t=ac(),n=ha(),i=oc(),s=lc();let a=0,o=class{constructor(d){this.blankNodeCounter=0,d=d||{},this.blankNodePrefix=d.blankNodePrefix||`df_${a++}_`}namedNode(d){return new n.NamedNode(d)}blankNode(d){return new r.BlankNode(d||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(d,h){return new t.Literal(d,h)}variable(d){return new s.Variable(d)}defaultGraph(){return e.DefaultGraph.INSTANCE}quad(d,h,m,w){return new i.Quad(d,h,m,w||this.defaultGraph())}fromTerm(d){switch(d.termType){case"NamedNode":return this.namedNode(d.value);case"BlankNode":return this.blankNode(d.value);case"Literal":return d.language?this.literal(d.value,d.language):d.datatype.equals(t.Literal.XSD_STRING)?this.literal(d.value):this.literal(d.value,this.fromTerm(d.datatype));case"Variable":return this.variable(d.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(d.subject),this.fromTerm(d.predicate),this.fromTerm(d.object),this.fromTerm(d.graph))}}fromQuad(d){return this.fromTerm(d)}resetBlankNodeCounter(){this.blankNodeCounter=0}};return _r.DataFactory=o,_r}var Xl;function Oh(){return Xl||(Xl=1,function(r){var e=$t&&$t.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),t=$t&&$t.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(r,"__esModule",{value:!0}),t(ic(),r),t(jh(),r),t(sc(),r),t(ac(),r),t(ha(),r),t(oc(),r),t(lc(),r)}($t)),$t}var kt={},Nr={},Tr={},Kl;function ir(){if(Kl)return Tr;Kl=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.Translator=void 0;let r=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(t){throw new Error(`Invalid RDF ${t.datatype.value} value: '${t.value}'`)}registerHandler(t,n,i){for(const s of n)this.supportedRdfDatatypes.push(s),this.fromRdfHandlers[s.value]=t;for(const s of i){let a=this.toRdfHandlers[s];a||(this.toRdfHandlers[s]=a=[]),a.push(t)}}fromRdf(t,n){const i=this.fromRdfHandlers[t.datatype.value];return i?i.fromRdf(t,n):t.value}toRdf(t,n){const i=this.toRdfHandlers[typeof t];if(i)for(const s of i){const a=s.toRdf(t,n);if(a)return a}throw new Error(`Invalid JavaScript value: '${t}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}};return Tr.Translator=r,Tr}var Yl;function $h(){if(Yl)return Nr;Yl=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.TypeHandlerBoolean=void 0;const r=ir();let e=class uc{fromRdf(n,i){switch(n.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return i&&r.Translator.incorrectRdfDataType(n),!1}toRdf(n,{datatype:i,dataFactory:s}){return s.literal(n?"true":"false",i||s.namedNode(uc.TYPE))}};return Nr.TypeHandlerBoolean=e,e.TYPE="http://www.w3.org/2001/XMLSchema#boolean",Nr}var Ar={},Zl;function kh(){if(Zl)return Ar;Zl=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.TypeHandlerDate=void 0;const r=ir();let e=class Cs{fromRdf(n,i){switch(i&&!n.value.match(Cs.VALIDATORS[n.datatype.value.substr(33,n.datatype.value.length)])&&r.Translator.incorrectRdfDataType(n),n.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(n.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const s=n.value.split("-");return new Date(0,parseInt(s[0],10)-1,parseInt(s[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(n.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(n.value+"-01");default:return new Date(n.value)}}toRdf(n,{datatype:i,dataFactory:s}){if(i=i||s.namedNode(Cs.TYPES[0]),!(n instanceof Date))return null;const a=n;let o;switch(i.value){case"http://www.w3.org/2001/XMLSchema#gDay":o=String(a.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":o=a.getUTCMonth()+1+"-"+a.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":o=String(a.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":o=a.getUTCFullYear()+"-"+(a.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":o=a.toISOString().replace(/T.*$/,"");break;default:o=a.toISOString()}return s.literal(o,i)}};return Ar.TypeHandlerDate=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],e.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/},Ar}var Lr={},eu;function Dh(){if(eu)return Lr;eu=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.TypeHandlerNumberDouble=void 0;const r=ir();let e=class cc{fromRdf(n,i){const s=parseFloat(n.value);return i&&isNaN(s)&&r.Translator.incorrectRdfDataType(n),s}toRdf(n,{datatype:i,dataFactory:s}){return i=i||s.namedNode(cc.TYPES[0]),isNaN(n)?s.literal("NaN",i):isFinite(n)?n%1===0?null:s.literal(n.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),i):s.literal(n>0?"INF":"-INF",i)}};return Lr.TypeHandlerNumberDouble=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"],Lr}var jr={},tu;function Mh(){if(tu)return jr;tu=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.TypeHandlerNumberInteger=void 0;const r=ir();let e=class Cr{fromRdf(n,i){const s=parseInt(n.value,10);return i&&(isNaN(s)||n.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(n),s}toRdf(n,{datatype:i,dataFactory:s}){return s.literal(String(n),i||(n<=Cr.MAX_INT&&n>=Cr.MIN_INT?s.namedNode(Cr.TYPES[0]):s.namedNode(Cr.TYPES[1])))}};return jr.TypeHandlerNumberInteger=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],e.MAX_INT=2147483647,e.MIN_INT=-2147483648,jr}var Or={},ru;function Ch(){if(ru)return Or;ru=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.TypeHandlerString=void 0;let r=class{fromRdf(t){return t.value}toRdf(t,{datatype:n,dataFactory:i}){return i.literal(t,n)}};return Or.TypeHandlerString=r,r.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"],Or}var nu;function iu(){return nu||(nu=1,function(r){var e=kt&&kt.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),t=kt&&kt.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(r,"__esModule",{value:!0}),t($h(),r),t(kh(),r),t(Dh(),r),t(Mh(),r),t(Ch(),r)}(kt)),kt}var Es={},su;function Ph(){return su||(su=1,Object.defineProperty(Es,"__esModule",{value:!0})),Es}var au;function qh(){return au||(au=1,function(r){var e=Ot&&Ot.__createBinding||(Object.create?function(g,y,_,x){x===void 0&&(x=_);var S=Object.getOwnPropertyDescriptor(y,_);(!S||("get"in S?!y.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return y[_]}}),Object.defineProperty(g,x,S)}:function(g,y,_,x){x===void 0&&(x=_),g[x]=y[_]}),t=Ot&&Ot.__exportStar||function(g,y){for(var _ in g)_!=="default"&&!Object.prototype.hasOwnProperty.call(y,_)&&e(y,g,_)};Object.defineProperty(r,"__esModule",{value:!0}),r.fromRdf=l,r.toRdf=d,r.getTermRaw=h,r.getSupportedRdfDatatypes=m,r.getSupportedJavaScriptPrimitives=w;const n=Oh(),i=iu(),s=ir();t(iu(),r),t(Ph(),r),t(ir(),r);const a=new n.DataFactory,o=new s.Translator;o.registerHandler(new i.TypeHandlerString,i.TypeHandlerString.TYPES.map(g=>a.namedNode(g)),["string"]),o.registerHandler(new i.TypeHandlerBoolean,[i.TypeHandlerBoolean.TYPE].map(g=>a.namedNode(g)),["boolean"]),o.registerHandler(new i.TypeHandlerNumberDouble,i.TypeHandlerNumberDouble.TYPES.map(g=>a.namedNode(g)),["number"]),o.registerHandler(new i.TypeHandlerNumberInteger,i.TypeHandlerNumberInteger.TYPES.map(g=>a.namedNode(g)),["number"]),o.registerHandler(new i.TypeHandlerDate,i.TypeHandlerDate.TYPES.map(g=>a.namedNode(g)),["object"]);function l(g,y){return o.fromRdf(g,y)}function d(g,y){return y&&"namedNode"in y&&(y={dataFactory:y}),y=y||{},y&&!y.dataFactory&&(y.dataFactory=a),o.toRdf(g,y)}function h(g,y){return g.termType==="Literal"?l(g,y):g.value}function m(){return o.getSupportedRdfDatatypes()}function w(){return o.getSupportedJavaScriptPrimitives()}}(Ot)),Ot}var Jr=qh();function ou(r){if(r.term.termType!=="BlankNode")return{quantifier:"one",start:"subject",end:"object",predicates:[r.term]};const e=r.out([ne.alternativePath]);if(e.ptrs.length===1&&e.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...e.list()].map(a=>a.term)};const t=r.out([ne.inversePath]);if(t.term)return{quantifier:"one",start:"object",end:"subject",predicates:[t.term]};const n=r.out([ne.oneOrMorePath]);if(n.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[n.term]};const i=r.out([ne.zeroOrMorePath]);if(i.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[i.term]};const s=r.out([ne.zeroOrOnePath]);if(s.term)return{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[s.term]}}function Bh(r){return r.terms.length===0?null:r.ptrs[0].isList()?[...r.list()].map(e=>ou(e)):[ou(r)]}class Fh{constructor(e){this.shape=e,this._compiled=nt(()=>this.shape.validator.registry.compile(e))}get compiled(){return this._compiled()}async validate(e){return e.focusNode.dataset.size===0||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){const t=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(const n of this.compiled)n.node&&await n.node(t),n.generic&&await n.generic(t)}async validateProperty(e){let t;this.shape.isSparqlShape?t=e.focusNode:t=e.focusNode.executeAll(this.shape.path);const n=t.node(new Ze(t.terms)),i=[...t].reduce((a,o)=>{const l=o.term,d=t.node([l]);return a.has(l)||a.set(l,{value:d,valuePaths:[]}),a.get(l).valuePaths.push(o),a},new lr).values(),s=e.create({shape:this.shape,values:n});for(const a of this.compiled)a.property&&await a.property(s);for(const{value:a,valuePaths:o}of i){const l=e.create({shape:this.shape,value:a,valueOrNode:a,valuePaths:o});for(const d of this.compiled)d.generic&&await d.generic(l)}}}function Ps(r){const e=new Ze,n=new Sn({dataset:r.dataset,terms:r.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[oh.subClassOf]});for(const i of n.ptrs)for(const{term:s}of i.nodes())e.add(s);return e}class Uh{constructor(e){this.targetClass=new Ze([...Ps(e.hasOut([Ft.type],[ne.NodeShape])),...Ps(e.out([ne.targetClass]))]),this.targetNode=e.out([ne.targetNode]).terms,this.targetObjectsOf=e.out([ne.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([ne.targetSubjectsOf]).terms}resolve(e){const t=e.focusNode.node([null]),n=[...e.focusNode.hasOut([Ft.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...t.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...t.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs],i=e.focusNode.clone({ptrs:n});return i.node([...new Ze(i.terms)])}}class Hh{constructor(e,{validator:t}){this.ptr=e,this.validator=t,this._deactivated=nt(()=>{const n=this.ptr.out([ne.deactivated]).term;return n&&Jr.fromRdf(n)}),this._message=nt(()=>this.ptr.out([ne.message]).terms),this._path=nt(()=>Bh(this.ptr.out([ne.path]))),this._severity=nt(()=>this.ptr.out([ne.severity]).term),this._shapeValidator=nt(()=>new Fh(this)),this._sparql=nt(()=>this.ptr.out([ne.sparql])),this._targetResolver=nt(()=>new Uh(this.ptr))}get deactivated(){return this._deactivated()}get isPropertyShape(){return!!this.path}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){const t=e.id({shape:this});if(e.processed.has(t)){if(e.results.has(t))for(const n of e.results.get(t))e.report.results.push(n);return e}return e.processed.add(t),this.shapeValidator.validate(e)}}function Vh(r){const e=parseInt(r.ptr.out([ne.maxCount]).value);return{property:Gh(e)}}function Gh(r){return e=>{e.test(e.values.terms.length<=r,ne.MaxCountConstraintComponent,{args:{maxCount:r},message:[e.factory.literal("More than {$maxCount} values")]})}}function Wh(r){const e=parseInt(r.ptr.out([ne.minCount]).value);return{property:zh(e)}}function zh(r){return e=>{e.test(e.values.terms.length>=r,ne.MinCountConstraintComponent,{args:{minCount:r},message:[e.factory.literal("Less than {$minCount} values")]})}}async function Jh(r,e){for(const t of r)if(!await e(t))return!1;return!0}async function Qh(r,e){return(await Promise.all(r.map(t=>e(t)))).filter(Boolean)}async function Cn(r,e){return Promise.all(r.map(e))}async function Xh(r,e){for(const t of r)if(await e(t))return!0;return!1}function Kh(r){const e=[...r.ptr.out([ne.and])].flatMap(t=>[...t.list()]).map(t=>r.validator.shape(t));return{generic:Yh(e)}}function Yh(r){return async e=>{const t=await Cn(r,async i=>(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),n=t.every(i=>i.conforms);e.test(n,ne.AndConstraintComponent,{results:t.flatMap(i=>i.results),value:e.valueOrNode})}}function Zh(r){const e=r.validator.shape(r.ptr.out([ne.not]));return{generic:ep(e)}}function ep(r){return async e=>{const t=(await r.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report,n=!t.conforms;e.test(n,ne.NotConstraintComponent,{args:{not:r.ptr.term},message:[e.factory.literal("Value does have shape {$not}")],results:t.results,value:e.valueOrNode})}}function tp(r){const e=[...r.ptr.out([ne.or])].flatMap(t=>[...t.list()]).map(t=>r.validator.shape(t));return{generic:rp(e)}}function rp(r){return async e=>{let t=[],n;if(e.options.debug||e.options.details){const i=await Cn(r,async s=>(await s.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report);t=i.flatMap(s=>s.results),n=i.some(s=>s.conforms)}else n=await Xh(r,async i=>(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report.conforms);e.test(n,ne.OrConstraintComponent,{results:t,value:e.valueOrNode})}}function np(r){const e=[...r.ptr.out([ne.xone])].flatMap(t=>[...t.list()]).map(t=>r.validator.shape(t));return{generic:ip(e)}}function ip(r){return async e=>{const t=await Cn(r,async i=>(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),n=t.filter(i=>i.conforms).length===1;e.test(n,ne.XoneConstraintComponent,{results:t.flatMap(i=>i.results),value:e.valueOrNode})}}function sp(r){if(!Jr.fromRdf(r.ptr.out([ne.closed]).term))return null;const t=r.ptr.out([ne.property]).map(s=>r.validator.shape(s)),n=new Ze(t.filter(s=>!s.deactivated).map(s=>s.path[0].predicates[0])),i=new Ze([...r.ptr.out([ne.ignoredProperties]).list()||[]].map(s=>s.term));return{node:ap(n,i)}}function ap(r,e){return t=>{const n=t.focusNode.execute({start:"subject",end:"predicate"}).filter(i=>e.has(i.term)?!1:!r.has(i.term));if(n.ptrs.length>0)for(const i of n)t.violation(ne.ClosedConstraintComponent,{message:[t.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[i.term]}],value:t.focusNode.node([[...i.quads()][0].object])});else t.debug(ne.ClosedConstraintComponent)}}function op(r){const e=r.ptr.out([ne.hasValue]).term;return{node:lp(e),property:up(e)}}function lp(r){return e=>{e.test(r.equals(e.valueOrNode.term),ne.HasValueConstraintComponent,{args:{hasValue:r},message:[e.factory.literal("Value must be {$hasValue}")]})}}function up(r){return e=>{const t=[...e.values].some(n=>r.equals(n.term));e.test(t,ne.HasValueConstraintComponent,{args:{hasValue:r},message:[e.factory.literal("Missing expected value {$hasValue}")]})}}function cp(r){const e=new Ze([...r.ptr.out([ne.in]).list()].map(t=>t.term));return{generic:dp(e)}}function dp(r){return e=>{e.test(r.has(e.valueOrNode.term),ne.InConstraintComponent,{args:{in:[...r].map(t=>t.value).join(", ")},message:[e.factory.literal("Value is not in {$in}")],value:e.valueOrNode})}}function ur(r,e){if(!r||r.termType!=="Literal"||!e||e.termType!=="Literal"||lu(r)!==lu(e))return null;const t=Jr.fromRdf(r),n=Jr.fromRdf(e);return typeof t!=typeof n?null:typeof t=="string"?t.localeCompare(n):t-n}function lu(r){const e=/^.*(((\+|-)\d{2}:\d{2})|Z)$/;return da.dateTime.equals(r.datatype)&&e.test(r.value)}function fp(r){const e=r.ptr.out([ne.disjoint]).term;return{generic:hp(e)}}function hp(r){return e=>{const t=e.focusNode.dataset.match(e.focusNode.term,r,e.valueOrNode.term);e.test(t.size===0,ne.DisjointConstraintComponent,{args:{disjoint:r},message:[e.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:e.valueOrNode})}}function pp(r){const e=r.ptr.out([ne.equals]).term;return{node:gp(e),property:yp(e)}}function gp(r){return e=>{const t=e.focusNode.out([r]),n=t.filter(s=>!s.term.equals(e.focusNode.term)),i=t.terms.length!==0&&n.terms.length===0;e.test(i,ne.EqualsConstraintComponent,{args:{equals:r},message:[e.factory.literal("Must have same values as {$equals}")],value:n.terms[0]&&e.focusNode.node([n.terms[0]])||e.focusNode})}}function yp(r){return e=>{const t=new Ze(e.focusNode.out([r]).terms),n=new Ze(e.values.terms),i=[...n].filter(o=>!t.has(o)),s=[...t].filter(o=>!n.has(o)),a=[...i,...s];for(const o of a)e.violation(ne.EqualsConstraintComponent,{args:{equals:r},message:[e.factory.literal("Must have same values as {$equals}")],value:e.focusNode.node([o])});a.length===0&&e.debug(ne.EqualsConstraintComponent,{args:{equals:r},message:[e.factory.literal("Must have same values as {$equals}")]})}}function mp(r){const e=r.ptr.out([ne.lessThan]).term;return{property:bp(e)}}function bp(r){return e=>{const t=e.focusNode.out([r]).terms;for(const n of e.values)for(const i of t){const s=ur(n.term,i);s===null||s>=0?e.violation(ne.LessThanConstraintComponent,{args:{lessThan:r},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:n}):e.debug(ne.LessThanConstraintComponent,{args:{lessThan:r},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:n})}}}function wp(r){const e=r.ptr.out([ne.lessThanOrEquals]).term;return{property:vp(e)}}function vp(r){return e=>{const t=e.focusNode.out([r]).terms;for(const n of e.values)for(const i of t){const s=ur(n.term,i);s===null||s>0?e.violation(ne.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:r},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:n}):e.debug(ne.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:r},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:n})}}}function _p(r){const e=r.ptr.out([ne.maxExclusive]).term;return{generic:xp(e)}}function xp(r){return e=>{const t=ur(e.valueOrNode.term,r);e.test(t!==null&&t<0,ne.MaxExclusiveConstraintComponent,{args:{maxExclusive:r},message:[e.factory.literal("Value is not less than {$maxExclusive}")],value:e.valueOrNode})}}function Sp(r){const e=r.ptr.out([ne.maxInclusive]).term;return{generic:Ep(e)}}function Ep(r){return e=>{const t=ur(e.valueOrNode.term,r);e.test(t!==null&&t<=0,ne.MaxInclusiveConstraintComponent,{args:{maxInclusive:r},message:[e.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:e.valueOrNode})}}function Ip(r){const e=r.ptr.out([ne.minExclusive]).term;return{generic:Rp(e)}}function Rp(r){return e=>{const t=ur(e.valueOrNode.term,r);e.test(t!==null&&t>0,ne.MinExclusiveConstraintComponent,{args:{minExclusive:r},message:[e.factory.literal("Value is not greater than {$minExclusive}")],value:e.valueOrNode})}}function Np(r){const e=r.ptr.out([ne.minInclusive]).term;return{generic:Tp(e)}}function Tp(r){return e=>{const t=ur(e.valueOrNode.term,r);e.test(t!==null&&t>=0,ne.MinInclusiveConstraintComponent,{args:{minInclusive:r},message:[e.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:e.valueOrNode})}}function Ap(r){const e=[...r.ptr.out([ne.node])].map(t=>r.validator.shape(t));return{generic:Lp(e)}}function Lp(r){return async e=>{for(const t of r){const n=await t.validate(e.create({child:!0,focusNode:e.valueOrNode}));e.test(n.report.conforms,ne.NodeConstraintComponent,{args:{node:t.ptr.term},message:[e.factory.literal("Value does not have shape {$node}")],results:n.report.results,value:e.valueOrNode})}}}function jp(r){const e=[...r.ptr.out([ne.property])].map(t=>r.validator.shape(t));return{generic:Op(e)}}function Op(r){return async e=>{const t=e.create({focusNode:e.valueOrNode});for(const n of r)await n.validate(t)}}function $p(r){const e=r.validator.shape(r.ptr.out([ne.qualifiedValueShape])),t=r.ptr.out([ne.qualifiedValueShapesDisjoint]).term,n=t?Jr.fromRdf(t):!1,i=r.ptr.out([ne.qualifiedMaxCount]).term,s=i?parseInt(i.value):null,a=r.ptr.out([ne.qualifiedMinCount]).term,o=a?parseInt(a.value):null;return{property:kp(e,n,s,o)}}function kp(r,e,t,n){return async i=>{const s=[];let a=[];e&&(a=new Set(i.shape.ptr.in([ne.property]).out([ne.property]).out([ne.qualifiedValueShape]).filter(l=>!l.term.equals(r.ptr.term)).map(l=>i.shape.validator.shape(l))));const o=(await Qh(i.values,async l=>{const d=(await r.validate(i.create({child:!0,focusNode:l}))).report;if(s.push(d.results),!d.conforms)return!1;if(a.length===0)return!0;if(i.options.debug||i.options.details){const h=await Cn([...a],async m=>(await m.validate(i.create({child:!0,focusNode:l}))).report);return s.push(h.flatMap(m=>m.results)),!h.every(m=>m.conforms)}else return!await Jh([...a],async h=>(await h.validate(i.create({child:!0,focusNode:l}))).report.conforms)})).length;t!==null&&i.test(o<=t,ne.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:t,qualifiedValueShape:r.ptr.term,qualifiedValueShapesDisjoint:e},message:[i.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:s.flat()}),n!==null&&i.test(o>=n,ne.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:n,qualifiedValueShape:r.ptr.term,qualifiedValueShapesDisjoint:e},message:[i.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:s.flat()})}}function Dp(r,e){return e?e.slice(0,r.length)===r:!1}function Mp(r){const e=[...new Set([...r.ptr.out([ne.languageIn]).list()].map(t=>t.value))];return{generic:Cp(e)}}function Cp(r){return e=>{const t=r.some(n=>Dp(n,e.valueOrNode.term.language));e.test(t,ne.LanguageInConstraintComponent,{args:{languageIn:r.join(", ")},message:[e.factory.literal("Language does not match any of {$languageIn}")],value:e.valueOrNode})}}function Pp(r){const e=parseInt(r.ptr.out([ne.maxLength]).value);return{generic:qp(e)}}function qp(r){return e=>{const t=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length<=r;e.test(t,ne.MaxLengthConstraintComponent,{args:{maxLength:r},message:[e.factory.literal("Value has more than {$maxLength} characters")],value:e.valueOrNode})}}function Bp(r){const e=parseInt(r.ptr.out([ne.minLength]).value);return{generic:Fp(e)}}function Fp(r){return e=>{const t=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length>=r;e.test(t,ne.MinLengthConstraintComponent,{args:{minLength:r},message:[e.factory.literal("Value has less than {$minLength} characters")],value:e.valueOrNode})}}function Up(r){const e=r.ptr.out([ne.pattern]).value,t=r.ptr.out([ne.flags]).value,n=new RegExp(e,t);return{generic:Hp(e,t,n)}}function Hp(r,e,t){return n=>{n.test(t.test(n.valueOrNode.term.value),ne.PatternConstraintComponent,{args:{flags:e,pattern:r},message:[n.factory.literal('Value does not match pattern "{$pattern}"')],value:n.valueOrNode})}}function Vp(r){const e=r.ptr.out([ne.uniqueLang]).term;return e.value==="true"&&da.boolean.equals(e.datatype)?{property:Gp()}:null}function Gp(){return r=>{const t=Object.entries(r.values.terms.reduce((n,i)=>(i.language&&(n[i.language]=(n[i.language]||0)+1),n),{})).filter(([,n])=>n>1);for(const[n]of t)r.violation(ne.UniqueLangConstraintComponent,{args:{lang:n},message:[r.factory.literal('Language "{?lang}" used more than once')]});t.length===0&&r.debug(ne.UniqueLangConstraintComponent)}}const mn=tt("http://www.w3.org/ns/shacl#"),dc=tt("https://schemas.link/shacl-next#");class sr{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some(e=>e.severity.equals(mn.Info)||e.severity.equals(mn.Violation)||e.severity.equals(mn.Warning))}}function Wp(r,e){return Object.entries(e).reduce((t,[n,i])=>(i&&i.termType&&(i=Je(i)),t.replace(`{$${n}}`,i).replace(`{?${n}}`,i)),r)}class En{constructor({args:e={},factory:t,message:n=[],severity:i=mn.Violation}={}){this.severity=i,this.message=n.map(s=>t.literal(Wp(s.value,e),s.language||null))}}class pa{constructor({factory:e=ca}={}){this.factory=e}clone({factory:e}={}){return new pa({factory:e||this.factory})}validate(){return new sr}validateSimple(){return!0}}class cr extends pa{constructor({datatypes:e,factory:t}={}){super({factory:t}),this.datatypes=[];for(const n of Array.isArray(e)?e:[e])n&&this.datatypes.push(this.factory.fromTerm(n))}clone({factory:e}={}){return new cr({datatypes:this.datatypes,factory:e||this.factory})}}class zp{constructor({factory:e=ca,validations:t}={}){if(this.factory=e,this.validations=new lr,t)for(const n of Object.values(t)){const i=n.clone({factory:this.factory});for(const s of i.datatypes)this.validations.set(s,i)}}validate(e){const t=this.validations.get(e.datatype);return t?t.validate(e):new sr}validateSimple(e){const t=this.validations.get(e.datatype);return t?t.validateSimple(e):!0}}class Ae extends cr{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.message=[this.factory.literal("term value {$this} matches pattern {$pattern}")],this.patterns=Array.isArray(e)?e:[e]}clone({factory:e}={}){return new Ae(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const t=this.patterns.map(n=>{let i;n.test(e.value)&&(i=dc.Debug);const s={pattern:this.factory.literal(n.toString()),this:e};return new En({args:s,factory:this.factory,message:this.message,severity:i})});return new sr({results:t})}validateSimple(e){return this.patterns.every(t=>t.test(e.value))}}const Jp=/^([-+]?[0-9]+)$/;class We extends Ae{constructor(e=null,t=null,n,{factory:i}={}){super(Jp,n,{factory:i}),this.maxInclusive=null,this.minInclusive=null,typeof t=="string"&&(this.maxInclusive=BigInt(t)),typeof e=="string"&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){return new We(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const t=super.validate(e).results;if(!dc.Debug.equals(t[0].severity))return new sr({results:t});const n=BigInt(e.value);if(this.minInclusive!==null&&n<this.minInclusive){const i=`term value "${e.value}" is less than "${this.minInclusive.toString()}"`,s=[this.factory.literal(i)];t.push(new En({factory:this.factory,message:s}))}if(this.maxInclusive!==null&&n>this.maxInclusive){const i=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,s=[this.factory.literal(i)];t.push(new En({factory:this.factory,message:s}))}return new sr({results:t})}validateSimple(e){if(!super.validateSimple(e))return!1;const t=BigInt(e.value);return!(this.minInclusive!==null&&t<this.minInclusive||this.maxInclusive!==null&&t>this.maxInclusive)}}class ga extends cr{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.values=new Set(e)}clone({factory:e}={}){return new ga(this.values,this.datatypes,{factory:e||this.factory})}validate(e){const t=[];if(!this.values.has(e.value)){const n=`term value "${e.value}" is not included in the list: ${[...this.values].join(",")}`,i=[this.factory.literal(n)];t.push(new En({factory:this.factory,message:i}))}return new sr({results:t})}validateSimple(e){return this.values.has(e.value)}}const xe={xsd:tt("http://www.w3.org/2001/XMLSchema#")},Qp=new cr({datatypes:xe.xsd.anySimpleType}),Xp=new cr({datatypes:xe.xsd.anyAtomicType}),Pn=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,Kp=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,fc=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,ya=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,hc=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Yp=/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Zp=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,eg=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,tg=/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,rg=/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,ng=/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,ig=/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,sg=/^(([0-9a-fA-F]{2})*)$/,ag=/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,og=new Ae(Pn,xe.xsd.string),lg=new ga(["1","true","0","false"],xe.xsd.boolean),ug=new Ae(Kp,xe.xsd.decimal),cg=new Ae(fc,xe.xsd.float),dg=new Ae(fc,xe.xsd.double),fg=new Ae(ya,xe.xsd.duration),hg=new Ae(hc,xe.xsd.dateTime),pg=new Ae(Yp,xe.xsd.time),gg=new Ae(Zp,xe.xsd.date),yg=new Ae(eg,xe.xsd.gYearMonth),mg=new Ae(tg,xe.xsd.gYear),bg=new Ae(rg,xe.xsd.gMonthDay),wg=new Ae(ng,xe.xsd.gDay),vg=new Ae(ig,xe.xsd.gMonth),_g=new Ae(sg,xe.xsd.hexBinary),xg=new Ae(ag,xe.xsd.base64Binary),Sg=new Ae(Pn,xe.xsd.anyURI),pc=/^([^\u000d\u000a\u0009]*)$/,Eg=/^([^ ]+( [^ ]+)*)*$/,Ig=/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,Rg=/^([^DT]*)$/,Ng=/^([^YM]*[DT].*)$/,Tg=/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/,Ag=new Ae([Pn,pc],xe.xsd.normalizedString),Lg=new Ae([Pn,pc,Eg],xe.xsd.token),jg=new Ae(Ig,xe.xsd.language),Og=new We(null,null,xe.xsd.integer),$g=new We(null,"0",xe.xsd.nonPositiveInteger),kg=new We(null,"-1",xe.xsd.negativeInteger),Dg=new We("-9223372036854775808","9223372036854775807",xe.xsd.long),Mg=new We("-2147483648","2147483647",xe.xsd.int),Cg=new We("-32768","32767",xe.xsd.short),Pg=new We("-128","127",xe.xsd.byte),qg=new We("0",null,xe.xsd.nonNegativeInteger),Bg=new We("0","18446744073709551615",xe.xsd.unsignedLong),Fg=new We("0","4294967295",xe.xsd.unsignedInt),Ug=new We("0","65535",xe.xsd.unsignedShort),Hg=new We("0","255",xe.xsd.unsignedByte),Vg=new We("1",null,xe.xsd.positiveInteger),Gg=new Ae([ya,Rg],xe.xsd.yearMonthDuration),Wg=new Ae([ya,Ng],xe.xsd.dayTimeDuration),zg=new Ae([hc,Tg],xe.xsd.dateTimeStamp),Jg=Object.freeze(Object.defineProperty({__proto__:null,anyAtomicType:Xp,anySimpleType:Qp,anyURI:Sg,base64Binary:xg,boolean:lg,byte:Pg,date:gg,dateTime:hg,dateTimeStamp:zg,dayTimeDuration:Wg,decimal:ug,double:dg,duration:fg,float:cg,gDay:wg,gMonth:vg,gMonthDay:bg,gYear:mg,gYearMonth:yg,hexBinary:_g,int:Mg,integer:Og,language:jg,long:Dg,negativeInteger:kg,nonNegativeInteger:qg,nonPositiveInteger:$g,normalizedString:Ag,positiveInteger:Vg,short:Cg,string:og,time:pg,token:Lg,unsignedByte:Hg,unsignedInt:Fg,unsignedLong:Bg,unsignedShort:Ug,yearMonthDuration:Gg},Symbol.toStringTag,{value:"Module"}));class Qg extends zp{constructor({factory:e}={}){super({factory:e,validations:{...Jg}})}}const Xg=new lr([[ne.BlankNode,new Set(["BlankNode"])],[ne.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[ne.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[ne.IRI,new Set(["NamedNode"])],[ne.IRIOrLiteral,new Set(["NamedNode","Literal"])],[ne.Literal,new Set(["Literal"])]]);function Kg(r){const e=r.ptr.out([ne.class]).map(t=>Ps(t));return{generic:Yg(e)}}function Yg(r){return e=>{const t=new Ze(e.valueOrNode.out([Ft.type]).terms);for(const n of r){const i=[...t].some(s=>n.has(s));e.test(i,ne.ClassConstraintComponent,{value:e.valueOrNode})}}}function Zg(r){const e=r.ptr.out([ne.datatype]).term,t=new Qg;return{generic:ey(e,t)}}function ey(r,e){return t=>{const n=r.equals(t.valueOrNode.term.datatype)&&e.validateSimple(t.valueOrNode.term);t.test(n,ne.DatatypeConstraintComponent,{args:{datatype:r},message:[t.factory.literal("Value does not have datatype {$datatype}")],value:t.valueOrNode})}}function ty(r){const e=r.ptr.out([ne.nodeKind]).term,t=Xg.get(e);return{generic:ry(e,t)}}function ry(r,e){return t=>{t.test(e.has(t.valueOrNode.term.termType),ne.NodeKindConstraintComponent,{args:{nodeKind:r},message:[t.factory.literal("Value does not have node kind {$nodeKind}")],value:t.valueOrNode})}}const ny=new lr([[ne.maxCount,Vh],[ne.minCount,Wh],[ne.and,Kh],[ne.not,Zh],[ne.or,tp],[ne.xone,np],[ne.closed,sp],[ne.hasValue,op],[ne.in,cp],[ne.disjoint,fp],[ne.equals,pp],[ne.lessThan,mp],[ne.lessThanOrEquals,wp],[ne.maxExclusive,_p],[ne.maxInclusive,Sp],[ne.minExclusive,Ip],[ne.minInclusive,Np],[ne.node,Ap],[ne.property,jp],[ne.qualifiedValueShape,$p],[ne.languageIn,Mp],[ne.maxLength,Pp],[ne.minLength,Bp],[ne.pattern,Up],[ne.uniqueLang,Vp],[ne.class,Kg],[ne.datatype,Zg],[ne.nodeKind,ty]]);class iy{constructor(e,{factory:t,...n}){if(this.factory=t,this.options=n,this.registry=new Lh(ny),this.shapesPtr=new Sn({dataset:e,factory:t}),this.shapes=new lr,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[s,a]of this.options.validations)this.registry.validations.set(s,a);const i=[...this.shapesPtr.hasOut([ne.targetClass]),...this.shapesPtr.hasOut([ne.targetNode]),...this.shapesPtr.hasOut([ne.targetObjectsOf]),...this.shapesPtr.hasOut([ne.targetSubjectsOf]),...this.shapesPtr.hasOut([Ft.type],[ne.NodeShape]),...this.shapesPtr.hasOut([Ft.type],[ne.PropertyShape])];for(const s of i)this.shape(s)}shape(e){if(!e.term)return null;let t=this.shapes.get(e.term);return t||(t=new Hh(e,{validator:this}),this.shapes.set(e.term,t)),t}async validate(e,t){const n=new Sn({...e,factory:this.factory}),i=new fa({factory:this.factory,focusNode:n,options:this.options,validator:this});t?t=t.map(s=>this.shape(this.shapesPtr.node(s.terms))):t=this.shapes.values();for(const s of t){const a=i.create({shape:s});let o;n.isAny()?o=s.resolveTargets(a):o=n;for(const l of o)await s.validate(a.create({focusNode:l}))}return i.report}}let sy=class extends HTMLElement{constructor(e){super(),this.shape=null,this.attachShadow({mode:"open"}),this.form=document.createElement("form"),this.config=new ml(e,this.form),this.form.addEventListener("change",t=>{t.stopPropagation(),this.config.editMode&&this.validate(!0).then(n=>{this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,composed:!0,detail:{valid:n.conforms,report:n}}))}).catch(n=>{console.warn(n)})})}static get observedAttributes(){return ml.dataAttributes()}connectedCallback(){this.shadowRoot.prepend(this.form)}attributeChangedCallback(){this.config.updateAttributes(this),this.initialize()}initialize(){clearTimeout(this.initDebounceTimeout),this.initDebounceTimeout=setTimeout(async()=>{this.form.replaceChildren(document.createTextNode(this.config.attributes.loading));try{await this.config.loader.loadGraphs(),this.form.replaceChildren(),this.config.renderedNodes.clear();const e=this.findRootShaclShapeSubject();if(e){this.form.classList.forEach(n=>{this.form.classList.remove(n)}),this.form.classList.toggle("mode-edit",this.config.editMode),this.form.classList.toggle("mode-view",!this.config.editMode),this.config.theme.apply(this.form);const t=[this.config.theme.stylesheet];for(const n of pd())n.stylesheet&&t.push(n.stylesheet);if(this.shadowRoot.adoptedStyleSheets=t,this.shape=new Rt(e,this.config,this.config.attributes.valuesSubject?Ee.namedNode(this.config.attributes.valuesSubject):void 0),this.form.appendChild(this.shape),this.config.editMode){if(this.config.attributes.submitButton!==null){const n=this.config.theme.createButton(this.config.attributes.submitButton||"Submit",!0);n.addEventListener("click",i=>{i.preventDefault(),this.form.reportValidity()&&this.validate().then(s=>{s?.conforms?this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0})):this.form.querySelector(":scope .invalid > .editor")?.focus()})}),this.form.appendChild(n)}this.config.attributes.valuesSubject&&this.removeFromDataGraph(Ee.namedNode(this.config.attributes.valuesSubject)),await this.validate(!0)}}else if(this.config.store.countQuads(null,null,null,bn)>0)throw new Error("shacl root node shape not found")}catch(e){console.error(e);const t=document.createElement("div");t.innerText=String(e),this.form.replaceChildren(t)}},200)}serialize(e="text/turtle",t=this.toRDF()){const n=t.getQuads(null,null,null,null);return cd(n,e,this.config.prefixes)}toRDF(e=new Ue){return this.shape?.toRDF(e),e}registerPlugin(e){hd(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setSharedShapesGraph(e){Gf(e),this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}async validate(e=!1){for(const t of this.form.querySelectorAll(":scope .validation-error"))t.remove();for(const t of this.form.querySelectorAll(":scope .property-instance"))t.classList.remove("invalid"),t.querySelector(":scope > .editor")?.value?t.classList.add("valid"):t.classList.remove("valid");this.config.store.deleteGraph(this.config.valuesGraphId||""),this.shape?.toRDF(this.config.store),this.shape&&this.config.store.add(new Rn(this.shape.shaclSubject,Ee.namedNode(be+"targetNode"),this.shape.nodeId,this.config.valuesGraphId));try{const t=this.config.store,n=await new iy(t,{details:!0,factory:Ee}).validate({dataset:t});for(const i of n.results)if(i.focusNode?.ptrs?.length)for(const s of i.focusNode.ptrs){const a=s._term;if(i.path?.length){const o=i.path[0].predicates[0];let l=this.form.querySelectorAll(`:scope shacl-node[data-node-id='${a.id}'] > shacl-property > .property-instance[data-path='${o.id}'] > .editor, :scope shacl-node[data-node-id='${a.id}'] > .shacl-group > shacl-property > .property-instance[data-path='${o.id}'] > .editor`);l.length===0&&(l=this.form.querySelectorAll(`:scope [data-node-id='${a.id}'] > * > [data-path='${o.id}']`));for(const d of l)if(d.classList.contains("editor")){if(!e||d.value){let h=d.parentElement;h.classList.add("invalid"),h.classList.remove("valid"),h.appendChild(this.createValidationErrorDisplay(i));do h.classList.contains("collapsible")&&h.classList.add("open"),h=h.parentElement;while(h)}}else e||(d.classList.add("invalid"),d.classList.remove("valid"),d.appendChild(this.createValidationErrorDisplay(i,"node")))}else e||this.form.querySelector(`:scope [data-node-id='${a.id}']`)?.prepend(this.createValidationErrorDisplay(i,"node"))}return n}catch(t){return console.error(t),!1}}createValidationErrorDisplay(e,t){const n=document.createElement("span");if(n.classList.add("validation-error"),t&&n.classList.add(t),e)if(e.message?.length>0)for(const i of e.message)n.title+=i.value+`
346
+ `;else n.title=e.sourceConstraintComponent?.value;return n}findRootShaclShapeSubject(){let e=null;if(this.config.attributes.shapeSubject){if(e=Ee.namedNode(this.config.attributes.shapeSubject),this.config.store.getQuads(e,qe,on,null).length===0){console.warn(`shapes graph does not contain requested root shape ${this.config.attributes.shapeSubject}`);return}}else if(this.config.attributes.valuesSubject&&this.config.store.countQuads(null,null,null,lt)>0){const t=Ee.namedNode(this.config.attributes.valuesSubject),n=[...this.config.store.getQuads(t,qe,null,lt),...this.config.store.getQuads(t,Ts,null,lt)];if(n.length===0){console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${qe.id} nor ${Ts.id} statement`);return}for(const i of n)if(this.config.store.getQuads(i.object,qe,on,null).length>0){e=i.object;break}if(!e){const i=this.config.store.getQuads(null,Vr,n[0].object,null);if(i.length===0){console.error(`value subject '${this.config.attributes.valuesSubject}' has no shacl shape definition in the shapes graph`);return}if(i.length>1&&console.warn(`value subject '${this.config.attributes.valuesSubject}' has multiple shacl shape definitions in the shapes graph, choosing the first found (${i[0].subject})`),this.config.store.getQuads(i[0].subject,qe,on,null).length===0){console.error(`value subject '${this.config.attributes.valuesSubject}' references a shape which is not a NodeShape (${i[0].subject})`);return}e=i[0].subject}}else{const t=this.config.store.getQuads(null,qe,on,null);if(t.length==0){console.warn("shapes graph does not contain any root shapes");return}t.length>1&&(console.warn("shapes graph contains",t.length,"root shapes. choosing first found which is",t[0].subject.value),console.info('hint: set the shape to use with attribute "data-shape-subject"')),e=t[0].subject}return e}removeFromDataGraph(e){this.config.attributes.valuesSubject;for(const t of this.config.store.getQuads(e,null,null,lt))this.config.store.delete(t),(t.object.termType==="NamedNode"||t.object.termType==="BlankNode")&&this.removeFromDataGraph(t.object)}};const ay=`.editor:not([type='checkbox']) { border: 1px solid #DDD; padding: 2px 4px; }
347
+ .property-instance label { display: inline-flex; word-break: break-word; line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; }
348
+ .property-instance:not(:first-child) > label:not(.persistent) { visibility: hidden; max-height: 0; }
349
+ .mode-edit .property-instance label { width: var(--label-width); }
350
+ `;class oy extends ld{constructor(e){super(e||ay),this.idCtr=0}createDefaultTemplate(e,t,n,i,s){i.id=`e${this.idCtr++}`,i.classList.add("editor"),s?.datatype?i.shaclDatatype=s.datatype:t instanceof it&&(i.shaclDatatype=t.datatype),s?.minCount!==void 0&&(i.dataset.minCount=String(s.minCount)),s?.class&&(i.dataset.class=s.class.value),s?.nodeKind?i.dataset.nodeKind=s.nodeKind.value:t instanceof In&&(i.dataset.nodeKind=be+"IRI"),(s?.hasValue||s?.readonly)&&(i.disabled=!0),i.value=t?.value||s?.defaultValue?.value||"";const a=document.createElement("label");a.htmlFor=i.id,a.innerText=e,s?.description&&a.setAttribute("title",s.description.value);const o=s?.description?s.description.value:s?.pattern?s.pattern:null;o&&i.setAttribute("placeholder",o),n&&(i.setAttribute("required","true"),a.classList.add("required"));const l=document.createElement("div");return l.appendChild(a),l.appendChild(i),l}createDateEditor(e,t,n,i){const s=document.createElement("input");i.datatype?.value===Ct+"dateTime"?(s.type="datetime-local",s.setAttribute("step","1")):s.type="date",s.classList.add("pr-0");const a=this.createDefaultTemplate(e,null,n,s,i);if(t)try{let o=new Date(t.value).toISOString();i.datatype?.value===Ct+"dateTime"?o=o.slice(0,19):o=o.slice(0,10),s.value=o}catch(o){console.error(o,t)}return a}createTextEditor(e,t,n,i){let s;return i.singleLine===!1?(s=document.createElement("textarea"),s.rows=5):(s=document.createElement("input"),s.type="text",i.pattern&&(s.pattern=i.pattern)),i.minLength&&(s.minLength=i.minLength),i.maxLength&&(s.maxLength=i.maxLength),this.createDefaultTemplate(e,t,n,s,i)}createLangStringEditor(e,t,n,i){const s=this.createTextEditor(e,t,n,i),a=s.querySelector(":scope .editor");let o;if(i.languageIn?.length){o=document.createElement("select");for(const l of i.languageIn){const d=document.createElement("option");d.innerText=l.value,o.appendChild(d)}}else o=document.createElement("input"),o.maxLength=5,o.placeholder="lang?";return o.title="Language of the text",o.classList.add("lang-chooser"),o.addEventListener("change",l=>{l.stopPropagation(),a&&(a.dataset.lang=o.value,a.dispatchEvent(new Event("change",{bubbles:!0})))}),t instanceof it&&(o.value=t.language),a.dataset.lang=o.value,a.after(o),s}createBooleanEditor(e,t,n,i){const s=document.createElement("input");s.type="checkbox",s.classList.add("ml-0");const a=this.createDefaultTemplate(e,null,n,s,i);return s.removeAttribute("required"),a.querySelector(":scope label")?.classList.remove("required"),t instanceof it&&(s.checked=t.value==="true"),a}createFileEditor(e,t,n,i){const s=document.createElement("input");return s.type="file",s.addEventListener("change",a=>{if(s.files?.length){a.stopPropagation();const o=new FileReader;o.readAsDataURL(s.files[0]),o.onload=()=>{s.binaryData=btoa(o.result),s.parentElement?.dispatchEvent(new Event("change",{bubbles:!0}))}}else s.binaryData=void 0}),this.createDefaultTemplate(e,t,n,s,i)}createNumberEditor(e,t,n,i){const s=document.createElement("input");s.type="number",s.classList.add("pr-0");const a=i.minInclusive!==void 0?i.minInclusive:i.minExclusive!==void 0?i.minExclusive+1:void 0,o=i.maxInclusive!==void 0?i.maxInclusive:i.maxExclusive!==void 0?i.maxExclusive-1:void 0;return a!==void 0&&(s.min=String(a)),o!==void 0&&(s.max=String(o)),i.datatype?.value!==Ct+"integer"&&(s.step="0.1"),this.createDefaultTemplate(e,t,n,s,i)}createListEditor(e,t,n,i,s){const a=new Me;a.dense=!0,a.clearable=!0,a.collapse=!0;const o=this.createDefaultTemplate(e,null,n,a,s),l=document.createElement("ul"),d=(h,m)=>{const w=document.createElement("li");let g="";if(typeof h.value=="string"?g=h.value:g=h.value.id,w.innerText=h.label?h.label:g,w.dataset.value=g,m.appendChild(w),h.children?.length){const y=document.createElement("ul");w.appendChild(y);for(const _ of h.children)d(_,y)}};for(const h of i)d(h,l);return a.appendChild(l),t&&(a.value=t.value),o}createButton(e,t){const n=document.createElement("button");return n.type="button",n.innerHTML=e,n}}class ly extends sy{constructor(){super(new oy)}}window.customElements.define("shacl-form",ly);export{ml as Config,Vf as Loader,yy as Plugin,ly as ShaclForm,ad as ShaclPropertyTemplate,ld as Theme,jn as findLabel,hd as registerPlugin,Gf as setSharedShapesGraph};