@igea/oac_frontend 1.0.108 → 1.0.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igea/oac_frontend",
3
- "version": "1.0.108",
3
+ "version": "1.0.109",
4
4
  "description": "Frontend service for the OAC project",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -389,148 +389,6 @@ document.addEventListener('DOMContentLoaded', () => {
389
389
  var intervalId = setInterval(() => {
390
390
  if(_this.form.shadowRoot){
391
391
  clearInterval(intervalId);
392
- // 🔥 Fix alignment for add-property blocks
393
- const shadow = _this.form.shadowRoot;
394
-
395
- if (!shadow.querySelector('#oac-final-layout')) {
396
- const style = document.createElement('style');
397
- style.id = 'oac-final-layout';
398
- style.textContent = `
399
-
400
- /* ============================= */
401
- /* Layout moderno a 3 elementi */
402
- /* ============================= */
403
-
404
- .property-instance {
405
- display: flex !important;
406
- align-items: center !important;
407
- gap: 10px !important;
408
- }
409
-
410
- /* Label senza width fissa */
411
- .property-instance label {
412
- width: auto !important;
413
- min-width: 220px !important;
414
- white-space: nowrap !important;
415
- flex-shrink: 0 !important;
416
- }
417
-
418
- /* Editor cresce */
419
- .property-instance .editor {
420
- flex: 1 1 auto !important;
421
- }
422
-
423
- /* 🔥 Disattiva spunta originale */
424
- .property-instance.valid::before {
425
- content: none !important;
426
- }
427
-
428
- /* 🔥 Crea spunta a fine label */
429
- .property-instance.valid > label::after {
430
- content: '';
431
- display: inline-block;
432
- width: 0.9em;
433
- height: 0.9em;
434
- margin-left: 6px;
435
- vertical-align: middle;
436
-
437
- background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1024 1024" fill="green" xmlns="http://www.w3.org/2000/svg"><path d="M866.133333 258.133333L362.666667 761.6l-204.8-204.8L98.133333 618.666667 362.666667 881.066667l563.2-563.2z"/></svg>');
438
- background-size: contain;
439
- background-repeat: no-repeat;
440
- }
441
-
442
-
443
-
444
-
445
-
446
-
447
- `;
448
- shadow.appendChild(style);
449
- }
450
-
451
-
452
- function hideOnlyDuplicateRemoveButtons(shadowRoot) {
453
- shadowRoot.querySelectorAll('.property-instance').forEach(pi => {
454
-
455
- // consideriamo solo i wrapper "esterni" che contengono uno shacl-node
456
- const shaclNode = pi.querySelector(':scope > shacl-node');
457
- if (!shaclNode) return;
458
-
459
- // remove wrapper diretto del wrapper esterno (quello che sospettiamo duplicato)
460
- const directRemoveWrapper = pi.querySelector(':scope > .remove-button-wrapper');
461
- if (!directRemoveWrapper) return;
462
-
463
- const directRemoveBtn = directRemoveWrapper.querySelector('rokit-button.remove-button[title]');
464
- if (!directRemoveBtn) return;
465
-
466
- const title = directRemoveBtn.getAttribute('title');
467
- if (!title) return;
468
-
469
- // cerco un altro remove con lo stesso title *dentro* lo shacl-node
470
- // (escludo quello esterno: infatti quello esterno NON è dentro shaclNode)
471
- const duplicateInside = shaclNode.querySelector(`rokit-button.remove-button[title="${CSS.escape(title)}"]`);
472
-
473
- // se esiste, quello esterno è duplicato => nascondo SOLO quello esterno
474
- if (duplicateInside) {
475
- directRemoveWrapper.style.display = 'none';
476
- } else {
477
- // se non c'è duplicato interno, quello esterno serve => lo lascio visibile
478
- directRemoveWrapper.style.display = '';
479
- }
480
- });
481
- }
482
-
483
- // prima applicazione
484
- hideOnlyDuplicateRemoveButtons(shadow);
485
-
486
- // observer per elementi aggiunti con "+"
487
- const dupRemoveObserver = new MutationObserver(() => {
488
- hideOnlyDuplicateRemoveButtons(shadow);
489
- });
490
- dupRemoveObserver.observe(shadow, { childList: true, subtree: true });
491
-
492
-
493
-
494
- if (!shadow.querySelector('#oac-fix-add-buttons')) {
495
- const style = document.createElement('style');
496
- style.id = 'oac-fix-add-buttons';
497
- style.textContent = `
498
-
499
- /* Sposta i blocchi add a sinistra */
500
- shacl-property:not(:has(>.collapsible)),
501
- shacl-property > .collapsible::part(content) {
502
- align-items: flex-start !important;
503
- }
504
-
505
- /* Assicura che il + sia inline */
506
- shacl-property .add-button {
507
- align-self: flex-start !important;
508
- margin-right: 0 !important;
509
- }
510
-
511
- `;
512
- shadow.appendChild(style);
513
- }
514
-
515
-
516
- if (!shadow.querySelector('#oac-limit-editor-width')) {
517
- const style = document.createElement('style');
518
- style.id = 'oac-limit-editor-width';
519
- style.textContent = `
520
-
521
- .property-instance .editor {
522
- flex-grow: 0 !important;
523
- max-width: 500px !important;
524
- width: 100% !important;
525
- }
526
-
527
- `;
528
- shadow.appendChild(style);
529
- }
530
-
531
-
532
-
533
-
534
392
  if(_this.inEditing)
535
393
  _this.inputIdentifizier();
536
394
  else
@@ -30,70 +30,119 @@ var $i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"
30
30
  `),V=this.i;break;case A:pe!==void 0&&(this.text+=de.slice(V));break e;default:r(He)||(Pe=!0)}}Pe&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(V,de){var pe;const{prefix:Pe,local:He}=this.qname(V),Je={name:V,prefix:Pe,local:He,value:de};if(this.attribList.push(Je),(pe=this.attributeHandler)===null||pe===void 0||pe.call(this,Je),Pe==="xmlns"){const xt=de.trim();this.currentXMLVersion==="1.0"&&xt===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[He]=xt,wt(this,He,xt)}else if(V==="xmlns"){const xt=de.trim();this.topNS[""]=xt,wt(this,"",xt)}}pushAttribPlain(V,de){var pe;const Pe={name:V,value:de};this.attribList.push(Pe),(pe=this.attributeHandler)===null||pe===void 0||pe.call(this,Pe)}end(){var V,de;this.sawRoot||this.fail("document must contain a root element.");const{tags:pe}=this;for(;pe.length>0;){const He=pe.pop();this.fail(`unclosed tag: ${He.name}`)}this.state!==S&&this.state!==k&&this.fail("unexpected end.");const{text:Pe}=this;return Pe.length!==0&&((V=this.textHandler)===null||V===void 0||V.call(this,Pe),this.text=""),this._closed=!0,(de=this.endHandler)===null||de===void 0||de.call(this),this._init(),this}resolve(V){var de,pe;let Pe=this.topNS[V];if(Pe!==void 0)return Pe;const{tags:He}=this;for(let Je=He.length-1;Je>=0;Je--)if(Pe=He[Je].ns[V],Pe!==void 0)return Pe;return Pe=this.ns[V],Pe!==void 0?Pe:(pe=(de=this.opt).resolvePrefix)===null||pe===void 0?void 0:pe.call(de,V)}qname(V){const de=V.indexOf(":");if(de===-1)return{prefix:"",local:V};const pe=V.slice(de+1),Pe=V.slice(0,de);return(Pe===""||pe===""||pe.includes(":"))&&this.fail(`malformed name: ${V}.`),{prefix:Pe,local:pe}}processAttribsNS(){var V;const{attribList:de}=this,pe=this.tag;{const{prefix:Je,local:xt}=this.qname(pe.name);pe.prefix=Je,pe.local=xt;const nn=pe.uri=(V=this.resolve(Je))!==null&&V!==void 0?V:"";Je!==""&&(Je==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),nn===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(Je)}.`),pe.uri=Je))}if(de.length===0)return;const{attributes:Pe}=pe,He=new Set;for(const Je of de){const{name:xt,prefix:nn,local:lo}=Je;let On,Jn;nn===""?(On=xt==="xmlns"?b:"",Jn=xt):(On=this.resolve(nn),On===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(nn)}.`),On=nn),Jn=`{${On}}${lo}`),He.has(Jn)&&this.fail(`duplicate attribute: ${Jn}.`),He.add(Jn),Je.uri=On,Pe[xt]=Je}this.attribList=[]}processAttribsPlain(){const{attribList:V}=this,de=this.tag.attributes;for(const{name:pe,value:Pe}of V)de[pe]!==void 0&&this.fail(`duplicate attribute: ${pe}.`),de[pe]=Pe;this.attribList=[]}openTag(){var V;this.processAttribs();const{tags:de}=this,pe=this.tag;pe.isSelfClosing=!1,(V=this.openTagHandler)===null||V===void 0||V.call(this,pe),de.push(pe),this.state=k,this.name=""}openSelfClosingTag(){var V,de,pe;this.processAttribs();const{tags:Pe}=this,He=this.tag;He.isSelfClosing=!0,(V=this.openTagHandler)===null||V===void 0||V.call(this,He),(de=this.closeTagHandler)===null||de===void 0||de.call(this,He),(this.tag=(pe=Pe[Pe.length-1])!==null&&pe!==void 0?pe:null)===null&&(this.closedRoot=!0),this.state=k,this.name=""}closeTag(){const{tags:V,name:de}=this;if(this.state=k,this.name="",de===""){this.fail("weird empty close tag."),this.text+="</>";return}const pe=this.closeTagHandler;let Pe=V.length;for(;Pe-- >0;){const He=this.tag=V.pop();if(this.topNS=He.ns,pe?.(He),He.name===de)break;this.fail("unexpected close tag.")}Pe===0?this.closedRoot=!0:Pe<0&&(this.fail(`unmatched closing tag: ${de}.`),this.text+=`</${de}>`)}parseEntity(V){if(V[0]!=="#"){const pe=this.ENTITIES[V];return pe!==void 0?pe:(this.fail(this.isName(V)?"undefined entity.":"disallowed character in entity name."),`&${V};`)}let de=NaN;return V[1]==="x"&&/^#x[0-9a-f]+$/i.test(V)?de=parseInt(V.slice(2),16):/^#[0-9]+$/.test(V)&&(de=parseInt(V.slice(1),10)),this.isChar(de)?String.fromCodePoint(de):(this.fail("malformed character entity."),`&${V};`)}}return oi.SaxesParser=Mn,oi}var yr={},Xc;function hm(){if(Xc)return yr;Xc=1,Object.defineProperty(yr,"__esModule",{value:!0}),yr.ParseError=void 0;let i=class extends Error{constructor(n,r){const o=n.saxParser;super(n.trackPosition?`Line ${o.line} column ${o.column+1}: ${r}`:r)}};return yr.ParseError=i,yr}var ai={},vr={},Qc;function Rf(){if(Qc)return vr;Qc=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.BlankNode=void 0;class i{constructor(n){this.termType="BlankNode",this.value=n}equals(n){return!!n&&n.termType==="BlankNode"&&n.value===this.value}}return vr.BlankNode=i,vr}var br={},wr={},Jc;function Cf(){if(Jc)return wr;Jc=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.DefaultGraph=void 0;class i{constructor(){this.termType="DefaultGraph",this.value=""}equals(n){return!!n&&n.termType==="DefaultGraph"}}return wr.DefaultGraph=i,i.INSTANCE=new i,wr}var xr={},Er={},Kc;function Hl(){if(Kc)return Er;Kc=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.NamedNode=void 0;class i{constructor(n){this.termType="NamedNode",this.value=n}equals(n){return!!n&&n.termType==="NamedNode"&&n.value===this.value}}return Er.NamedNode=i,Er}var Yc;function Pf(){if(Yc)return xr;Yc=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.Literal=void 0;const i=Hl();class e{constructor(r,o){this.termType="Literal",this.value=r,typeof o=="string"?(this.language=o,this.datatype=e.RDF_LANGUAGE_STRING,this.direction=""):o?"termType"in o?(this.language="",this.datatype=o,this.direction=""):(this.language=o.language,this.datatype=o.direction?e.RDF_DIRECTIONAL_LANGUAGE_STRING:e.RDF_LANGUAGE_STRING,this.direction=o.direction||""):(this.language="",this.datatype=e.XSD_STRING,this.direction="")}equals(r){return!!r&&r.termType==="Literal"&&r.value===this.value&&r.language===this.language&&(r.direction===this.direction||!r.direction&&this.direction==="")&&this.datatype.equals(r.datatype)}}return xr.Literal=e,e.RDF_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),e.RDF_DIRECTIONAL_LANGUAGE_STRING=new i.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),e.XSD_STRING=new i.NamedNode("http://www.w3.org/2001/XMLSchema#string"),xr}var Sr={},ed;function kf(){if(ed)return Sr;ed=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Quad=void 0;class i{constructor(n,r,o,a){this.termType="Quad",this.value="",this.subject=n,this.predicate=r,this.object=o,this.graph=a}equals(n){return!!n&&(n.termType==="Quad"||!n.termType)&&this.subject.equals(n.subject)&&this.predicate.equals(n.predicate)&&this.object.equals(n.object)&&this.graph.equals(n.graph)}}return Sr.Quad=i,Sr}var Tr={},td;function Df(){if(td)return Tr;td=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.Variable=void 0;class i{constructor(n){this.termType="Variable",this.value=n}equals(n){return!!n&&n.termType==="Variable"&&n.value===this.value}}return Tr.Variable=i,Tr}var nd;function fm(){if(nd)return br;nd=1,Object.defineProperty(br,"__esModule",{value:!0}),br.DataFactory=void 0;const i=Rf(),e=Cf(),n=Pf(),r=Hl(),o=kf(),a=Df();let l=0;class u{constructor(h){this.blankNodeCounter=0,h=h||{},this.blankNodePrefix=h.blankNodePrefix||`df_${l++}_`}namedNode(h){return new r.NamedNode(h)}blankNode(h){return new i.BlankNode(h||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(h,m){return new n.Literal(h,m)}variable(h){return new a.Variable(h)}defaultGraph(){return e.DefaultGraph.INSTANCE}quad(h,m,_,d){return new o.Quad(h,m,_,d||this.defaultGraph())}fromTerm(h){switch(h.termType){case"NamedNode":return this.namedNode(h.value);case"BlankNode":return this.blankNode(h.value);case"Literal":return h.language?this.literal(h.value,h.language):h.datatype.equals(n.Literal.XSD_STRING)?this.literal(h.value):this.literal(h.value,this.fromTerm(h.datatype));case"Variable":return this.variable(h.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(h.subject),this.fromTerm(h.predicate),this.fromTerm(h.object),this.fromTerm(h.graph))}}fromQuad(h){return this.fromTerm(h)}resetBlankNodeCounter(){this.blankNodeCounter=0}}return br.DataFactory=u,br}var id;function Mf(){return id||(id=1,(function(i){var e=ai&&ai.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=ai&&ai.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(Rf(),i),n(fm(),i),n(Cf(),i),n(Pf(),i),n(Hl(),i),n(kf(),i),n(Df(),i)})(ai)),ai}var li={},fa={},rd;function pm(){return rd||(rd=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.validateIri=i.IriValidationStrategy=void 0;function e(){const u="[!$&'()*+,;=]",f="%[a-fA-F0-9]{2}",h="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",m=`${h}\\.${h}\\.${h}\\.${h}`,_="[a-fA-F0-9]{1,4}",d=`(${_}:${_}|${m})`,g=`((${_}:){6}${d}|::(${_}:){5}${d}|(${_})?::(${_}:){4}${d}|((${_}:){0,1}${_})?::(${_}:){3}${d}|((${_}:){0,2}${_})?::(${_}:){2}${d}|((${_}:){0,3}${_})?::${_}:${d}|((${_}:){0,4}${_})?::${d}|((${_}:){0,5}${_})?::${_}|((${_}:){0,6}${_})?::)`,b=`v[a-fA-F0-9]+\\.(${u}|${u}|":)+`,T=`\\[(${g}|${b})\\]`,N="[0-9]*",A="[a-zA-Z][a-zA-Z0-9+\\-.]*",S="[-󰀀-󿿽􀀀-􏿽]",D="[a-zA-Z0-9\\-._~ -퟿豈-﷏ﷰ-￯𐀀-🿽𠀀-𯿽𰀀-𿿽񀀀-񏿽񐀀-񟿽񠀀-񯿽񰀀-񿿽򀀀-򏿽򐀀-򟿽򠀀-򯿽򰀀-򿿽󀀀-󏿽󐀀-󟿽󡀀-󯿽]",U=`(${D}|${f}|${u}|[:@])*`,O=`(${U}|[\\/?])*`,Q=`(${U}|${S}|[\\/?])*`,M=`(${U})+`,$=`(${U})*`,X="",F=`${M}(\\/${$})*`,B=`\\/(${M}(\\/${$})*)?`,ue=`(\\/${$})*`,k=`(${D}|${f}|${u})*`,oe=`(${T}|${m}|${k})`,I=`(\\/\\/${`(${`(${D}|${f}|${u}|:)*`}@)?${oe}(:${N})?`}${ue}|${B}|${F}|${X})`,Z=`^${A}:${I}(\\?${Q})?(#${O})?$`;return new RegExp(Z,"u")}const n=e(),r=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u;var o;(function(l){l.Strict="strict",l.Pragmatic="pragmatic",l.None="none"})(o=i.IriValidationStrategy||(i.IriValidationStrategy={}));function a(l,u=o.Strict){switch(u){case o.Strict:return n.test(l)?void 0:new Error(`Invalid IRI according to RFC 3987: '${l}'`);case o.Pragmatic:return r.test(l)?void 0:new Error(`Invalid IRI according to RDF Turtle: '${l}'`);case o.None:return;default:return new Error(`Not supported validation strategy "${u}"`)}}i.validateIri=a})(fa)),fa}var sd;function gm(){return sd||(sd=1,(function(i){var e=li&&li.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=li&&li.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(pm(),i)})(li)),li}var od;function mm(){if(od)return ri;od=1,Object.defineProperty(ri,"__esModule",{value:!0}),ri.ParseType=ri.RdfXmlParser=void 0;const i=am(),e=dm(),n=wf(),r=hm(),o=Mf(),a=gm();let l=class et extends n.Transform{constructor(h){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},h&&(Object.assign(this,h),this.options=h),this.dataFactory||(this.dataFactory=new o.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.validateUri!==!1&&(this.validateUri=!0),this.iriValidationStrategy||(this.iriValidationStrategy=this.validateUri?a.IriValidationStrategy.Pragmatic:a.IriValidationStrategy.None),this.parseUnsupportedVersions=!!h?.parseUnsupportedVersions,this.version=h?.version,this.saxParser=new e.SaxesParser({xmlns:!0,position:this.trackPosition}),this.attachSaxListeners()}import(h){const m=new n.PassThrough({readableObjectMode:!0});h.on("error",d=>_.emit("error",d)),h.on("data",d=>m.push(d)),h.on("end",()=>m.push(null));const _=m.pipe(new et(this.options));return _}_transform(h,m,_){if(this.version){const d=this.version;if(this.version=void 0,!this.isValidVersion(d))return _(this.newParseError(`Detected unsupported version as media type parameter: ${d}`))}try{this.saxParser.write(h)}catch(d){return _(d)}_()}newParseError(h){return new r.ParseError(this,h)}valueToUri(h,m){return this.uriToNamedNode((0,i.resolve)(h,m.baseIRI))}uriToNamedNode(h){const m=(0,a.validateIri)(h,this.iriValidationStrategy);if(m instanceof Error)throw this.newParseError(m.message);return this.dataFactory.namedNode(h)}validateNcname(h){if(!et.NCNAME_MATCHER.test(h))throw this.newParseError(`Not a valid NCName: ${h}`)}createLiteral(h,m){return this.dataFactory.literal(h,m.datatype?m.datatype:m.language?{language:m.language,direction:m.rdfVersion?m.direction:void 0}:void 0)}isValidVersion(h){return this.parseUnsupportedVersions||et.SUPPORTED_VERSIONS.includes(h)}attachSaxListeners(){this.saxParser.on("error",h=>this.emit("error",h)),this.saxParser.on("opentag",this.onTag.bind(this)),this.saxParser.on("text",this.onText.bind(this)),this.saxParser.on("cdata",this.onText.bind(this)),this.saxParser.on("closetag",this.onCloseTag.bind(this)),this.saxParser.on("doctype",this.onDoctype.bind(this))}onTag(h){const m=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let _=u.RESOURCE;if(m&&(m.hadChildren=!0,_=m.childrenParseType),m&&m.childrenStringTags){const g=h.name;let b="";for(const{key:R,value:S}of m.namespaces||[])b+=` ${R}="${S}"`;for(const R in h.attributes)b+=` ${R}="${h.attributes[R].value}"`;const N=`<${`${g}${b}`}>`;m.childrenStringTags.push(N);const A={childrenStringTags:m.childrenStringTags};A.childrenStringEmitClosingTag=`</${g}>`,this.activeTagStack.push(A);return}const d={};m?(d.language=m.language,d.direction=m.direction,d.baseIRI=m.baseIRI,d.childrenTripleTerms=m.childrenTripleTerms,d.rdfVersion=m.rdfVersion):d.baseIRI=this.baseIRI,this.activeTagStack.push(d),_===u.RESOURCE?this.onTagResource(h,d,m,!m):this.onTagProperty(h,d,m);for(const g in h.attributes){const b=h.attributes[g];b.prefix==="xmlns"&&(d.namespaces||(d.namespaces=[]),d.namespaces.push({key:`${b.prefix}:${b.local}`,value:b.value}))}m&&m.namespaces&&(d.namespaces=[...d.namespaces||[],...m.namespaces])}onTagResource(h,m,_,d){m.childrenParseType=u.PROPERTY;let g=!0;if(h.uri===et.RDF){if(!d&&et.FORBIDDEN_NODE_ELEMENTS.indexOf(h.local)>=0)throw this.newParseError(`Illegal node element name: ${h.local}`);switch(h.local){case"RDF":m.childrenParseType=u.RESOURCE;case"Description":g=!1}}const b=[],T=[];let N=null,A=!1,R=!1,S=null;for(const y in h.attributes){const x=h.attributes[y];if(x.uri===et.RDF&&x.local==="version"){this.setVersion(m,x.value);continue}else if(_&&x.uri===et.RDF)switch(x.local){case"about":if(N)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${x.value} and ${N} where found.`);N=x.value;continue;case"ID":if(N)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${x.value} and ${N} where found.`);this.validateNcname(x.value),N="#"+x.value,A=!0;continue;case"nodeID":if(N)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${x.value} and ${N} where found.`);this.validateNcname(x.value),N=x.value,R=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":S=x.value;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(x.uri===et.XML){if(x.local==="lang"){m.language=x.value===""?null:x.value.toLowerCase();continue}else if(x.local==="base"){m.baseIRI=(0,i.resolve)(x.value,m.baseIRI);continue}}else if(x.uri===et.ITS&&x.local==="dir"){this.setDirection(m,x.value);continue}x.prefix!=="xml"&&x.prefix!=="xmlns"&&(x.prefix!==""||x.local!=="xmlns")&&x.uri&&(b.push(this.uriToNamedNode(x.uri+x.local)),T.push(x.value))}if(N!==null&&(m.subject=R?this.dataFactory.blankNode(N):this.valueToUri(N,m),A&&this.claimNodeId(m.subject)),m.subject||(m.subject=this.dataFactory.blankNode()),g){const y=this.uriToNamedNode(h.uri+h.local);this.emitTriple(m.subject,this.dataFactory.namedNode(et.RDF+"type"),y,_?_.reifiedStatementId:null,m.childrenTripleTerms,m.reifier)}if(_){if(_.predicate)if(_.childrenCollectionSubject){const y=this.dataFactory.blankNode(),x=this.dataFactory.namedNode(et.RDF+"rest"),D=_.childrenCollectionPredicate.equals(x);this.emitTriple(_.childrenCollectionSubject,_.childrenCollectionPredicate,y,D?null:_.reifiedStatementId,_.childrenTripleTerms,D?null:_.reifier),this.emitTriple(y,this.dataFactory.namedNode(et.RDF+"first"),m.subject,null,m.childrenTripleTerms),_.childrenCollectionSubject=y,_.childrenCollectionPredicate=x}else{_.childrenTagsToTripleTerms||(this.emitTriple(_.subject,_.predicate,m.subject,_.reifiedStatementId,_.childrenTripleTerms,_.reifier),_.predicateEmitted=!0);for(let y=0;y<_.predicateSubPredicates.length;y++)this.emitTriple(m.subject,_.predicateSubPredicates[y],_.predicateSubObjects[y],null,_.childrenTripleTerms,_.reifier);_.predicateSubPredicates=[],_.predicateSubObjects=[]}for(let y=0;y<b.length;y++){const x=this.createLiteral(T[y],m);this.emitTriple(m.subject,b[y],x,_.reifiedStatementId,_.childrenTripleTerms,_.reifier)}S&&this.emitTriple(m.subject,this.dataFactory.namedNode(et.RDF+"type"),this.uriToNamedNode(S),null,m.childrenTripleTerms,m.reifier)}}onTagProperty(h,m,_){if(m.childrenParseType=u.RESOURCE,m.subject=_.subject,h.uri===et.RDF&&h.local==="li"?(_.listItemCounter||(_.listItemCounter=1),m.predicate=this.uriToNamedNode(h.uri+"_"+_.listItemCounter++)):m.predicate=this.uriToNamedNode(h.uri+h.local),h.uri===et.RDF&&et.FORBIDDEN_PROPERTY_ELEMENTS.indexOf(h.local)>=0)throw this.newParseError(`Illegal property element name: ${h.local}`);m.predicateSubPredicates=[],m.predicateSubObjects=[];let d=!1,g=!1,b=null,T=!0;const N=[],A=[];for(const R in h.attributes){const S=h.attributes[R];if(S.uri===et.RDF&&S.local==="version"){this.setVersion(m,S.value);continue}else if(S.uri===et.RDF)switch(S.local){case"resource":if(b)throw this.newParseError(`Found both rdf:resource (${S.value}) and rdf:nodeID (${b}).`);if(d)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${S.value})`);m.hadChildren=!0,b=S.value,T=!1;continue;case"datatype":if(g)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${S.value}).`);if(d)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${S.value})`);m.datatype=this.valueToUri(S.value,m);continue;case"nodeID":if(g)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${S.value}).`);if(m.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${S.value}).`);if(d)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${S.value})`);this.validateNcname(S.value),m.hadChildren=!0,b=S.value,T=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(g)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(m.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${m.datatype.value})`);if(b)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${b})`);if(S.value==="Resource"){d=!0,m.childrenParseType=u.PROPERTY;const y=this.dataFactory.blankNode();this.emitTriple(m.subject,m.predicate,y,m.reifiedStatementId,m.childrenTripleTerms,m.reifier),m.subject=y,m.predicate=null}else S.value==="Collection"?(d=!0,m.hadChildren=!0,m.childrenCollectionSubject=m.subject,m.childrenCollectionPredicate=m.predicate,T=!1):S.value==="Literal"?(d=!0,m.childrenTagsToString=!0,m.childrenStringTags=[]):S.value==="Triple"&&(d=!0,m.childrenTagsToTripleTerms=!0,m.childrenTripleTerms=[]);continue;case"ID":this.validateNcname(S.value),m.reifiedStatementId=this.valueToUri("#"+S.value,m),this.claimNodeId(m.reifiedStatementId);continue;case"annotation":m.reifier=this.dataFactory.namedNode(S.value);continue;case"annotationNodeID":m.reifier=this.dataFactory.blankNode(S.value);continue}else if(S.uri===et.XML&&S.local==="lang"){m.language=S.value===""?null:S.value.toLowerCase();continue}else if(S.uri===et.ITS&&S.local==="dir"){this.setDirection(m,S.value);continue}else if(S.uri===et.ITS&&S.local==="version")continue;if(S.prefix!=="xml"&&S.prefix!=="xmlns"&&(S.prefix!==""||S.local!=="xmlns")&&S.uri){if(d||m.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${S.value}`);m.hadChildren=!0,g=!0,N.push(this.uriToNamedNode(S.uri+S.local)),A.push(this.createLiteral(S.value,m))}}if(b!==null){const R=m.subject;m.subject=T?this.dataFactory.blankNode(b):this.valueToUri(b,m),this.emitTriple(R,m.predicate,m.subject,m.reifiedStatementId,m.childrenTripleTerms,m.reifier);for(let S=0;S<N.length;S++)this.emitTriple(m.subject,N[S],A[S],null,m.childrenTripleTerms,m.reifier);m.predicateEmitted=!0}else T&&(m.predicateSubPredicates=N,m.predicateSubObjects=A,m.predicateEmitted=!1)}emitTriple(h,m,_,d,g,b){const T=this.dataFactory.quad(h,m,_,this.defaultGraph);g?g.push(T):this.push(T),b&&this.push(this.dataFactory.quad(b,this.dataFactory.namedNode(et.RDF+"reifies"),T)),d&&(this.push(this.dataFactory.quad(d,this.dataFactory.namedNode(et.RDF+"type"),this.dataFactory.namedNode(et.RDF+"Statement"),this.defaultGraph)),this.push(this.dataFactory.quad(d,this.dataFactory.namedNode(et.RDF+"subject"),h,this.defaultGraph)),this.push(this.dataFactory.quad(d,this.dataFactory.namedNode(et.RDF+"predicate"),m,this.defaultGraph)),this.push(this.dataFactory.quad(d,this.dataFactory.namedNode(et.RDF+"object"),_,this.defaultGraph)))}claimNodeId(h){if(!this.allowDuplicateRdfIds){if(this.nodeIds[h.value])throw this.newParseError(`Found multiple occurrences of rdf:ID='${h.value}'.`);this.nodeIds[h.value]=!0}}onText(h){const m=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;m&&(m.childrenStringTags?m.childrenStringTags.push(h):m.predicate&&(m.text=h))}onCloseTag(){const h=this.activeTagStack.pop(),m=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;if(h.childrenStringEmitClosingTag&&h.childrenStringTags.push(h.childrenStringEmitClosingTag),h.childrenTagsToString&&(h.datatype=this.dataFactory.namedNode(et.RDF+"XMLLiteral"),h.text=h.childrenStringTags.join(""),h.hadChildren=!1),h.childrenTagsToTripleTerms&&h.predicate&&h.rdfVersion){if(h.childrenTripleTerms.length!==1)throw this.newParseError(`Expected exactly one triple term in rdf:parseType="Triple" but got ${h.childrenTripleTerms.length}`);for(const _ of h.childrenTripleTerms)this.emitTriple(h.subject,h.predicate,_,null,m.childrenTripleTerms,m.reifier);h.predicateEmitted=!0}if(h.childrenCollectionSubject)this.emitTriple(h.childrenCollectionSubject,h.childrenCollectionPredicate,this.dataFactory.namedNode(et.RDF+"nil"),null,h.childrenTripleTerms);else if(h.predicate){if(!h.hadChildren&&h.childrenParseType!==u.PROPERTY)this.emitTriple(h.subject,h.predicate,this.createLiteral(h.text||"",h),h.reifiedStatementId,h.childrenTripleTerms,h.reifier);else if(!h.predicateEmitted){const _=this.dataFactory.blankNode();this.emitTriple(h.subject,h.predicate,_,h.reifiedStatementId,h.childrenTripleTerms,h.reifier);for(let d=0;d<h.predicateSubPredicates.length;d++)this.emitTriple(_,h.predicateSubPredicates[d],h.predicateSubObjects[d],null,h.childrenTripleTerms)}}}onDoctype(h){h.replace(/<!ENTITY\s+([^\s]+)\s+["']([^"']+)["']\s*>/g,(m,_,d)=>(this.saxParser.ENTITIES[_]=d,""))}setDirection(h,m){if(m){if(m!=="ltr"&&m!=="rtl")throw this.newParseError(`Base directions must either be 'ltr' or 'rtl', while '${m}' was found.`);h.direction=m}else delete h.direction}setVersion(h,m){if(h.rdfVersion=m,this.emit("version",m),!this.isValidVersion(m))throw this.newParseError(`Detected unsupported version: ${m}`)}};ri.RdfXmlParser=l,l.MIME_TYPE="application/rdf+xml",l.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",l.XML="http://www.w3.org/XML/1998/namespace",l.ITS="http://www.w3.org/2005/11/its",l.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],l.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],l.NCNAME_MATCHER=/^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u,l.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"];var u;return(function(f){f[f.RESOURCE=0]="RESOURCE",f[f.PROPERTY=1]="PROPERTY"})(u||(ri.ParseType=u={})),ri}var ad;function _m(){return ad||(ad=1,(function(i){var e=ii&&ii.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),n=ii&&ii.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(i,"__esModule",{value:!0}),n(mm(),i)})(ii)),ii}var ym=_m(),pa={},ga,ld;function Vl(){return ld||(ld=1,ga=class Of{constructor(e,n=new Map,r=0){this.prefix=e,this._existing=n,this.counter=r}clone(){const{prefix:e,_existing:n,counter:r}=this;return new Of(e,new Map(n),r)}getId(e){const n=e&&this._existing.get(e);if(n)return n;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}),ga}var ma={},ud;function vm(){return ud||(ud=1,(function(i,e){if(i.setImmediate)return;var n=1,r={},o=!1,a=i.document,l;function u(R){typeof R!="function"&&(R=new Function(""+R));for(var S=new Array(arguments.length-1),y=0;y<S.length;y++)S[y]=arguments[y+1];var x={callback:R,args:S};return r[n]=x,l(n),n++}function f(R){delete r[R]}function h(R){var S=R.callback,y=R.args;switch(y.length){case 0:S();break;case 1:S(y[0]);break;case 2:S(y[0],y[1]);break;case 3:S(y[0],y[1],y[2]);break;default:S.apply(e,y);break}}function m(R){if(o)setTimeout(m,0,R);else{var S=r[R];if(S){o=!0;try{h(S)}finally{f(R),o=!1}}}}function _(){l=function(R){process.nextTick(function(){m(R)})}}function d(){if(i.postMessage&&!i.importScripts){var R=!0,S=i.onmessage;return i.onmessage=function(){R=!1},i.postMessage("","*"),i.onmessage=S,R}}function g(){var R="setImmediate$"+Math.random()+"$",S=function(y){y.source===i&&typeof y.data=="string"&&y.data.indexOf(R)===0&&m(+y.data.slice(R.length))};i.addEventListener?i.addEventListener("message",S,!1):i.attachEvent("onmessage",S),l=function(y){i.postMessage(R+y,"*")}}function b(){var R=new MessageChannel;R.port1.onmessage=function(S){var y=S.data;m(y)},l=function(S){R.port2.postMessage(S)}}function T(){var R=a.documentElement;l=function(S){var y=a.createElement("script");y.onreadystatechange=function(){m(S),y.onreadystatechange=null,R.removeChild(y),y=null},R.appendChild(y)}}function N(){l=function(R){setTimeout(m,0,R)}}var A=Object.getPrototypeOf&&Object.getPrototypeOf(i);A=A&&A.setTimeout?A:i,{}.toString.call(i.process)==="[object process]"?_():d()?g():i.MessageChannel?b():a&&"onreadystatechange"in a.createElement("script")?T():N(),A.setImmediate=u,A.clearImmediate=f})(typeof self>"u"?typeof $i>"u"?ma:$i:self)),ma}var _a,cd;function Ys(){if(cd)return _a;cd=1,vm();const i=self.crypto||self.msCrypto;return _a=class{constructor(n){if(!(i&&i.subtle))throw new Error("crypto.subtle not found.");if(n==="sha256")this.algorithm={name:"SHA-256"};else if(n==="sha1")this.algorithm={name:"SHA-1"};else throw new Error(`Unsupported algorithm "${n}".`);this._content=""}update(n){this._content+=n}async digest(){const n=new TextEncoder().encode(this._content),r=new Uint8Array(await i.subtle.digest(this.algorithm,n));let o="";for(let a=0;a<r.length;++a)o+=r[a].toString(16).padStart(2,"0");return o}},_a}var ya,dd;function Ff(){return dd||(dd=1,ya=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let n=0;n<e.length;++n)this.dir.set(e[n],!0)}hasNext(){return!this.done}next(){const{current:e,dir:n}=this,r=e.slice();let o=null,a=0;const l=e.length;for(let u=0;u<l;++u){const f=e[u],h=n.get(f);(o===null||f>o)&&(h&&u>0&&f>e[u-1]||!h&&u<l-1&&f>e[u+1])&&(o=f,a=u)}if(o===null)this.done=!0;else{const u=n.get(o)?a-1:a+1;e[a]=e[u],e[u]=o;for(const f of e)f>o&&n.set(f,!n.get(f))}return r}}),ya}var va,hd;function Gl(){if(hd)return va;hd=1;const e="http://www.w3.org/1999/02/22-rdf-syntax-ns#"+"langString",n="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",o="BlankNode",a="Literal",l="DefaultGraph",u={};(()=>{const g="(?:<([^:]+:[^>]*)>)",T="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�"+"_",N=T+"0-9-·̀-ͯ‿-⁀",R="(_:(?:["+T+"0-9])(?:(?:["+N+".])*(?:["+N+"]))?)",S='"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"',y="(?:\\^\\^"+g+")",D="(?:"+S+"(?:"+y+"|"+"(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))"+")?)",U="[ \\t]+",O="[ \\t]*",Q="(?:"+g+"|"+R+")"+U,M=g+U,$="(?:"+g+"|"+R+"|"+D+")"+O,X="(?:\\.|(?:(?:"+g+"|"+R+")"+O+"\\.))";u.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,u.empty=new RegExp("^"+O+"$"),u.quad=new RegExp("^"+O+Q+M+$+X+O+"$")})(),va=class Is{static parse(b){const T=[],N={},A=b.split(u.eoln);let R=0;for(const S of A){if(R++,u.empty.test(S))continue;const y=S.match(u.quad);if(y===null)throw new Error("N-Quads parse error on line "+R+".");const x={subject:null,predicate:null,object:null,graph:null};if(y[1]!==void 0?x.subject={termType:r,value:y[1]}:x.subject={termType:o,value:y[2]},x.predicate={termType:r,value:y[3]},y[4]!==void 0?x.object={termType:r,value:y[4]}:y[5]!==void 0?x.object={termType:o,value:y[5]}:(x.object={termType:a,value:void 0,datatype:{termType:r}},y[7]!==void 0?x.object.datatype.value=y[7]:y[8]!==void 0?(x.object.datatype.value=e,x.object.language=y[8]):x.object.datatype.value=n,x.object.value=d(y[6])),y[9]!==void 0?x.graph={termType:r,value:y[9]}:y[10]!==void 0?x.graph={termType:o,value:y[10]}:x.graph={termType:l,value:""},!(x.graph.value in N))N[x.graph.value]=[x],T.push(x);else{let D=!0;const U=N[x.graph.value];for(const O of U)if(f(O,x)){D=!1;break}D&&(U.push(x),T.push(x))}}return T}static serialize(b){Array.isArray(b)||(b=Is.legacyDatasetToQuads(b));const T=[];for(const N of b)T.push(Is.serializeQuad(N));return T.sort().join("")}static serializeQuadComponents(b,T,N,A){let R="";return b.termType===r?R+=`<${b.value}>`:R+=`${b.value}`,R+=` <${T.value}> `,N.termType===r?R+=`<${N.value}>`:N.termType===o?R+=N.value:(R+=`"${m(N.value)}"`,N.datatype.value===e?N.language&&(R+=`@${N.language}`):N.datatype.value!==n&&(R+=`^^<${N.datatype.value}>`)),A.termType===r?R+=` <${A.value}>`:A.termType===o&&(R+=` ${A.value}`),R+=` .
31
31
  `,R}static serializeQuad(b){return Is.serializeQuadComponents(b.subject,b.predicate,b.object,b.graph)}static legacyDatasetToQuads(b){const T=[],N={"blank node":o,IRI:r,literal:a};for(const A in b)b[A].forEach(S=>{const y={};for(const x in S){const D=S[x],U={termType:N[D.type],value:D.value};U.termType===a&&(U.datatype={termType:r},"datatype"in D&&(U.datatype.value=D.datatype),"language"in D?("datatype"in D||(U.datatype.value=e),U.language=D.language):"datatype"in D||(U.datatype.value=n)),y[x]=U}A==="@default"?y.graph={termType:l,value:""}:y.graph={termType:A.startsWith("_:")?o:r,value:A},T.push(y)});return T}};function f(g,b){return!(g.subject.termType===b.subject.termType&&g.object.termType===b.object.termType)||!(g.subject.value===b.subject.value&&g.predicate.value===b.predicate.value&&g.object.value===b.object.value)?!1:g.object.termType!==a?!0:g.object.datatype.termType===b.object.datatype.termType&&g.object.language===b.object.language&&g.object.datatype.value===b.object.datatype.value}const h=/["\\\n\r]/g;function m(g){return g.replace(h,function(b){switch(b){case'"':return'\\"';case"\\":return"\\\\";case`
32
32
  `:return"\\n";case"\r":return"\\r"}})}const _=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function d(g){return g.replace(_,function(b,T,N,A){if(T)switch(T){case"t":return" ";case"b":return"\b";case"n":return`
33
- `;case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(N)return String.fromCharCode(parseInt(N,16));if(A)throw new Error("Unsupported U escape")})}return va}var ba,fd;function jf(){if(fd)return ba;fd=1;const i=Vl(),e=Ys(),n=Ff(),r=Gl();ba=class{constructor({createMessageDigest:l=()=>new e("sha256"),canonicalIdMap:u=new Map,maxDeepIterations:f=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n",u),this.createMessageDigest=l,this.maxDeepIterations=f,this.quads=null,this.deepIterations=null}async main(l){this.deepIterations=new Map,this.quads=l;for(const g of l)this._addBlankNodeQuadInfo({quad:g,component:g.subject}),this._addBlankNodeQuadInfo({quad:g,component:g.object}),this._addBlankNodeQuadInfo({quad:g,component:g.graph});const u=new Map,f=[...this.blankNodeInfo.keys()];let h=0;for(const g of f)++h%100===0&&await this._yield(),await this._hashAndTrackBlankNode({id:g,hashToBlankNodes:u});const m=[...u.keys()].sort(),_=[];for(const g of m){const b=u.get(g);if(b.length>1){_.push(b);continue}const T=b[0];this.canonicalIssuer.getId(T)}for(const g of _){const b=[];for(const T of g){if(this.canonicalIssuer.hasId(T))continue;const N=new i("_:b");N.getId(T);const A=await this.hashNDegreeQuads(T,N);b.push(A)}b.sort(o);for(const T of b){const N=T.issuer.getOldIds();for(const A of N)this.canonicalIssuer.getId(A)}}const d=[];for(const g of this.quads){const b=r.serializeQuadComponents(this._componentWithCanonicalId(g.subject),g.predicate,this._componentWithCanonicalId(g.object),this._componentWithCanonicalId(g.graph));d.push(b)}return d.sort(),d.join("")}async hashFirstDegreeQuads(l){const u=[],f=this.blankNodeInfo.get(l),h=f.quads;for(const _ of h){const d={subject:null,predicate:_.predicate,object:null,graph:null};d.subject=this.modifyFirstDegreeComponent(l,_.subject,"subject"),d.object=this.modifyFirstDegreeComponent(l,_.object,"object"),d.graph=this.modifyFirstDegreeComponent(l,_.graph,"graph"),u.push(r.serializeQuad(d))}u.sort();const m=this.createMessageDigest();for(const _ of u)m.update(_);return f.hash=await m.digest(),f.hash}async hashRelatedBlankNode(l,u,f,h){let m;this.canonicalIssuer.hasId(l)?m=this.canonicalIssuer.getId(l):f.hasId(l)?m=f.getId(l):m=this.blankNodeInfo.get(l).hash;const _=this.createMessageDigest();return _.update(h),h!=="g"&&_.update(this.getRelatedPredicate(u)),_.update(m),_.digest()}async hashNDegreeQuads(l,u){const f=this.deepIterations.get(l)||0;if(f>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(l,f+1);const h=this.createMessageDigest(),m=await this.createHashToRelated(l,u),_=[...m.keys()].sort();for(const d of _){h.update(d);let g="",b;const T=new n(m.get(d));let N=0;for(;T.hasNext();){const A=T.next();++N%3===0&&await this._yield();let R=u.clone(),S="";const y=[];let x=!1;for(const D of A)if(this.canonicalIssuer.hasId(D)?S+=this.canonicalIssuer.getId(D):(R.hasId(D)||y.push(D),S+=R.getId(D)),g.length!==0&&S>g){x=!0;break}if(!x){for(const D of y){const U=await this.hashNDegreeQuads(D,R);if(S+=R.getId(D),S+=`<${U.hash}>`,R=U.issuer,g.length!==0&&S>g){x=!0;break}}x||(g.length===0||S<g)&&(g=S,b=R)}}h.update(g),u=b}return{hash:await h.digest(),issuer:u}}modifyFirstDegreeComponent(l,u){return u.termType!=="BlankNode"?u:{termType:"BlankNode",value:u.value===l?"_:a":"_:z"}}getRelatedPredicate(l){return`<${l.predicate.value}>`}async createHashToRelated(l,u){const f=new Map,h=this.blankNodeInfo.get(l).quads;let m=0;for(const _ of h)++m%100===0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:_,component:_.subject,position:"s",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:_,component:_.object,position:"o",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:_,component:_.graph,position:"g",id:l,issuer:u,hashToRelated:f})]);return f}async _hashAndTrackBlankNode({id:l,hashToBlankNodes:u}){const f=await this.hashFirstDegreeQuads(l),h=u.get(f);h?h.push(l):u.set(f,[l])}_addBlankNodeQuadInfo({quad:l,component:u}){if(u.termType!=="BlankNode")return;const f=u.value,h=this.blankNodeInfo.get(f);h?h.quads.add(l):this.blankNodeInfo.set(f,{quads:new Set([l]),hash:null})}async _addRelatedBlankNodeHash({quad:l,component:u,position:f,id:h,issuer:m,hashToRelated:_}){if(!(u.termType==="BlankNode"&&u.value!==h))return;const d=u.value,g=await this.hashRelatedBlankNode(d,l,m,f),b=_.get(g);b?b.push(d):_.set(g,[d])}_componentWithCanonicalId(l){return l.termType==="BlankNode"&&!l.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(l.value)}:l}async _yield(){return new Promise(l=>setImmediate(l))}};function o(a,l){return a.hash<l.hash?-1:a.hash>l.hash?1:0}return ba}var wa,pd;function bm(){if(pd)return wa;pd=1;const i=Ys(),e=jf();return wa=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new i("sha1")}modifyFirstDegreeComponent(r,o,a){return o.termType!=="BlankNode"?o:a==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:o.value===r?"_:a":"_:z"}}getRelatedPredicate(r){return r.predicate.value}async createHashToRelated(r,o){const a=new Map,l=this.blankNodeInfo.get(r).quads;let u=0;for(const f of l){let h,m;if(f.subject.termType==="BlankNode"&&f.subject.value!==r)m=f.subject.value,h="p";else if(f.object.termType==="BlankNode"&&f.object.value!==r)m=f.object.value,h="r";else continue;++u%100===0&&await this._yield();const _=await this.hashRelatedBlankNode(m,f,o,h),d=a.get(_);d?d.push(m):a.set(_,[m])}return a}},wa}var xa,gd;function Bf(){if(gd)return xa;gd=1;const i=Vl(),e=Ys(),n=Ff(),r=Gl();xa=class{constructor({createMessageDigest:l=()=>new e("sha256"),canonicalIdMap:u=new Map,maxDeepIterations:f=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n",u),this.createMessageDigest=l,this.maxDeepIterations=f,this.quads=null,this.deepIterations=null}main(l){this.deepIterations=new Map,this.quads=l;for(const d of l)this._addBlankNodeQuadInfo({quad:d,component:d.subject}),this._addBlankNodeQuadInfo({quad:d,component:d.object}),this._addBlankNodeQuadInfo({quad:d,component:d.graph});const u=new Map,f=[...this.blankNodeInfo.keys()];for(const d of f)this._hashAndTrackBlankNode({id:d,hashToBlankNodes:u});const h=[...u.keys()].sort(),m=[];for(const d of h){const g=u.get(d);if(g.length>1){m.push(g);continue}const b=g[0];this.canonicalIssuer.getId(b)}for(const d of m){const g=[];for(const b of d){if(this.canonicalIssuer.hasId(b))continue;const T=new i("_:b");T.getId(b);const N=this.hashNDegreeQuads(b,T);g.push(N)}g.sort(o);for(const b of g){const T=b.issuer.getOldIds();for(const N of T)this.canonicalIssuer.getId(N)}}const _=[];for(const d of this.quads){const g=r.serializeQuadComponents(this._componentWithCanonicalId({component:d.subject}),d.predicate,this._componentWithCanonicalId({component:d.object}),this._componentWithCanonicalId({component:d.graph}));_.push(g)}return _.sort(),_.join("")}hashFirstDegreeQuads(l){const u=[],f=this.blankNodeInfo.get(l),h=f.quads;for(const _ of h){const d={subject:null,predicate:_.predicate,object:null,graph:null};d.subject=this.modifyFirstDegreeComponent(l,_.subject,"subject"),d.object=this.modifyFirstDegreeComponent(l,_.object,"object"),d.graph=this.modifyFirstDegreeComponent(l,_.graph,"graph"),u.push(r.serializeQuad(d))}u.sort();const m=this.createMessageDigest();for(const _ of u)m.update(_);return f.hash=m.digest(),f.hash}hashRelatedBlankNode(l,u,f,h){let m;this.canonicalIssuer.hasId(l)?m=this.canonicalIssuer.getId(l):f.hasId(l)?m=f.getId(l):m=this.blankNodeInfo.get(l).hash;const _=this.createMessageDigest();return _.update(h),h!=="g"&&_.update(this.getRelatedPredicate(u)),_.update(m),_.digest()}hashNDegreeQuads(l,u){const f=this.deepIterations.get(l)||0;if(f>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(l,f+1);const h=this.createMessageDigest(),m=this.createHashToRelated(l,u),_=[...m.keys()].sort();for(const d of _){h.update(d);let g="",b;const T=new n(m.get(d));for(;T.hasNext();){const N=T.next();let A=u.clone(),R="";const S=[];let y=!1;for(const x of N)if(this.canonicalIssuer.hasId(x)?R+=this.canonicalIssuer.getId(x):(A.hasId(x)||S.push(x),R+=A.getId(x)),g.length!==0&&R>g){y=!0;break}if(!y){for(const x of S){const D=this.hashNDegreeQuads(x,A);if(R+=A.getId(x),R+=`<${D.hash}>`,A=D.issuer,g.length!==0&&R>g){y=!0;break}}y||(g.length===0||R<g)&&(g=R,b=A)}}h.update(g),u=b}return{hash:h.digest(),issuer:u}}modifyFirstDegreeComponent(l,u){return u.termType!=="BlankNode"?u:{termType:"BlankNode",value:u.value===l?"_:a":"_:z"}}getRelatedPredicate(l){return`<${l.predicate.value}>`}createHashToRelated(l,u){const f=new Map,h=this.blankNodeInfo.get(l).quads;for(const m of h)this._addRelatedBlankNodeHash({quad:m,component:m.subject,position:"s",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:m,component:m.object,position:"o",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:m,component:m.graph,position:"g",id:l,issuer:u,hashToRelated:f});return f}_hashAndTrackBlankNode({id:l,hashToBlankNodes:u}){const f=this.hashFirstDegreeQuads(l),h=u.get(f);h?h.push(l):u.set(f,[l])}_addBlankNodeQuadInfo({quad:l,component:u}){if(u.termType!=="BlankNode")return;const f=u.value,h=this.blankNodeInfo.get(f);h?h.quads.add(l):this.blankNodeInfo.set(f,{quads:new Set([l]),hash:null})}_addRelatedBlankNodeHash({quad:l,component:u,position:f,id:h,issuer:m,hashToRelated:_}){if(!(u.termType==="BlankNode"&&u.value!==h))return;const d=u.value,g=this.hashRelatedBlankNode(d,l,m,f),b=_.get(g);b?b.push(d):_.set(g,[d])}_componentWithCanonicalId({component:l}){return l.termType==="BlankNode"&&!l.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(l.value)}:l}};function o(a,l){return a.hash<l.hash?-1:a.hash>l.hash?1:0}return xa}var Ea,md;function wm(){if(md)return Ea;md=1;const i=Ys(),e=Bf();return Ea=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new i("sha1")}modifyFirstDegreeComponent(r,o,a){return o.termType!=="BlankNode"?o:a==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:o.value===r?"_:a":"_:z"}}getRelatedPredicate(r){return r.predicate.value}createHashToRelated(r,o){const a=new Map,l=this.blankNodeInfo.get(r).quads;for(const u of l){let f,h;if(u.subject.termType==="BlankNode"&&u.subject.value!==r)h=u.subject.value,f="p";else if(u.object.termType==="BlankNode"&&u.object.value!==r)h=u.object.value,f="r";else continue;const m=this.hashRelatedBlankNode(h,u,o,f),_=a.get(m);_?_.push(h):a.set(m,[h])}return a}},Ea}const xm={},Em=Object.freeze(Object.defineProperty({__proto__:null,default:xm},Symbol.toStringTag,{value:"Module"})),Sm=Eg(Em);var _d;function Tm(){return _d||(_d=1,(function(i){const e=jf(),n=bm(),r=Bf(),o=wm();let a;try{a=Sm}catch{}function l(u){return Array.isArray(u)?u:i.NQuads.legacyDatasetToQuads(u)}i.NQuads=Gl(),i.IdentifierIssuer=Vl(),i._rdfCanonizeNative=function(u){return u&&(a=u),a},i.canonize=async function(u,f){const h=l(u);if(f.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(f.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((m,_)=>a.canonize(h,f,(d,g)=>d?_(d):m(g)))}if(f.algorithm==="URDNA2015")return new e(f).main(h);if(f.algorithm==="URGNA2012"){if(f.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new n(f).main(h)}throw"algorithm"in f?new Error("Invalid RDF Dataset Canonicalization algorithm: "+f.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")},i._canonizeSync=function(u,f){const h=l(u);if(f.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(f.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return a.canonizeSync(h,f)}if(f.algorithm==="URDNA2015")return new r(f).main(h);if(f.algorithm==="URGNA2012"){if(f.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new o(f).main(h)}throw"algorithm"in f?new Error("Invalid RDF Dataset Canonicalization algorithm: "+f.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}})(pa)),pa}var Sa,yd;function Wl(){return yd||(yd=1,Sa=Tm()),Sa}var Ta,vd;function zt(){if(vd)return Ta;vd=1;const i={};return Ta=i,i.isArray=Array.isArray,i.isBoolean=e=>typeof e=="boolean"||Object.prototype.toString.call(e)==="[object Boolean]",i.isDouble=e=>i.isNumber(e)&&(String(e).indexOf(".")!==-1||Math.abs(e)>=1e21),i.isEmptyObject=e=>i.isObject(e)&&Object.keys(e).length===0,i.isNumber=e=>typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]",i.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),i.isObject=e=>Object.prototype.toString.call(e)==="[object Object]",i.isString=e=>typeof e=="string"||Object.prototype.toString.call(e)==="[object String]",i.isUndefined=e=>typeof e>"u",Ta}var La,bd;function Pn(){if(bd)return La;bd=1;const i=zt(),e={};return La=e,e.isSubject=n=>i.isObject(n)&&!("@value"in n||"@set"in n||"@list"in n)?Object.keys(n).length>1||!("@id"in n):!1,e.isSubjectReference=n=>i.isObject(n)&&Object.keys(n).length===1&&"@id"in n,e.isValue=n=>i.isObject(n)&&"@value"in n,e.isList=n=>i.isObject(n)&&"@list"in n,e.isGraph=n=>i.isObject(n)&&"@graph"in n&&Object.keys(n).filter(r=>r!=="@id"&&r!=="@index").length===1,e.isSimpleGraph=n=>e.isGraph(n)&&!("@id"in n),e.isBlankNode=n=>{if(i.isObject(n)){if("@id"in n){const r=n["@id"];return!i.isString(r)||r.indexOf("_:")===0}return Object.keys(n).length===0||!("@value"in n||"@set"in n||"@list"in n)}return!1},La}var Ia,wd;function Yt(){return wd||(wd=1,Ia=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",n="jsonld.Error",r={}){super(e),this.name=n,this.message=e,this.details=r}}),Ia}var Na,xd;function Jt(){if(xd)return Na;xd=1;const i=Pn(),e=zt(),n=Wl().IdentifierIssuer,r=Yt(),o=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,u=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,f=/^@[a-zA-Z]+$/,h={headers:{accept:"application/ld+json, application/json"}},m={};Na=m,m.IdentifierIssuer=n,m.REGEX_BCP47=o,m.REGEX_KEYWORD=f,m.clone=function(d){if(d&&typeof d=="object"){let g;if(e.isArray(d)){g=[];for(let b=0;b<d.length;++b)g[b]=m.clone(d[b])}else if(d instanceof Map){g=new Map;for(const[b,T]of d)g.set(b,m.clone(T))}else if(d instanceof Set){g=new Set;for(const b of d)g.add(m.clone(b))}else if(e.isObject(d)){g={};for(const b in d)g[b]=m.clone(d[b])}else g=d.toString();return g}return d},m.asArray=function(d){return Array.isArray(d)?d:[d]},m.buildHeaders=(d={})=>{if(Object.keys(d).some(b=>b.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+h.headers.accept+'" is supported.');return Object.assign({Accept:h.headers.accept},d)},m.parseLinkHeader=d=>{const g={},b=d.match(a);for(let T=0;T<b.length;++T){let N=b[T].match(l);if(!N)continue;const A={target:N[1]},R=N[2];for(;N=u.exec(R);)A[N[1]]=N[2]===void 0?N[3]:N[2];const S=A.rel||"";Array.isArray(g[S])?g[S].push(A):g.hasOwnProperty(S)?g[S]=[g[S],A]:g[S]=A}return g},m.validateTypeValue=(d,g)=>{if(!e.isString(d)&&!(e.isArray(d)&&d.every(b=>e.isString(b)))){if(g&&e.isObject(d))switch(Object.keys(d).length){case 0:return;case 1:if("@default"in d&&m.asArray(d["@default"]).every(b=>e.isString(b)))return}throw new r('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:d})}},m.hasProperty=(d,g)=>{if(d.hasOwnProperty(g)){const b=d[g];return!e.isArray(b)||b.length>0}return!1},m.hasValue=(d,g,b)=>{if(m.hasProperty(d,g)){let T=d[g];const N=i.isList(T);if(e.isArray(T)||N){N&&(T=T["@list"]);for(let A=0;A<T.length;++A)if(m.compareValues(b,T[A]))return!0}else if(!e.isArray(b))return m.compareValues(b,T)}return!1},m.addValue=(d,g,b,T)=>{if(T=T||{},"propertyIsArray"in T||(T.propertyIsArray=!1),"valueIsArray"in T||(T.valueIsArray=!1),"allowDuplicate"in T||(T.allowDuplicate=!0),"prependValue"in T||(T.prependValue=!1),T.valueIsArray)d[g]=b;else if(e.isArray(b)){b.length===0&&T.propertyIsArray&&!d.hasOwnProperty(g)&&(d[g]=[]),T.prependValue&&(b=b.concat(d[g]),d[g]=[]);for(let N=0;N<b.length;++N)m.addValue(d,g,b[N],T)}else if(d.hasOwnProperty(g)){const N=!T.allowDuplicate&&m.hasValue(d,g,b);!e.isArray(d[g])&&(!N||T.propertyIsArray)&&(d[g]=[d[g]]),N||(T.prependValue?d[g].unshift(b):d[g].push(b))}else d[g]=T.propertyIsArray?[b]:b},m.getValues=(d,g)=>[].concat(d[g]||[]),m.removeProperty=(d,g)=>{delete d[g]},m.removeValue=(d,g,b,T)=>{T=T||{},"propertyIsArray"in T||(T.propertyIsArray=!1);const N=m.getValues(d,g).filter(A=>!m.compareValues(A,b));N.length===0?m.removeProperty(d,g):N.length===1&&!T.propertyIsArray?d[g]=N[0]:d[g]=N},m.relabelBlankNodes=(d,g)=>{g=g||{};const b=g.issuer||new n("_:b");return _(b,d)},m.compareValues=(d,g)=>d===g||i.isValue(d)&&i.isValue(g)&&d["@value"]===g["@value"]&&d["@type"]===g["@type"]&&d["@language"]===g["@language"]&&d["@index"]===g["@index"]?!0:e.isObject(d)&&"@id"in d&&e.isObject(g)&&"@id"in g?d["@id"]===g["@id"]:!1,m.compareShortestLeast=(d,g)=>d.length<g.length?-1:g.length<d.length?1:d===g?0:d<g?-1:1;function _(d,g){if(e.isArray(g))for(let b=0;b<g.length;++b)g[b]=_(d,g[b]);else if(i.isList(g))g["@list"]=_(d,g["@list"]);else if(e.isObject(g)){i.isBlankNode(g)&&(g["@id"]=d.getId(g["@id"]));const b=Object.keys(g).sort();for(let T=0;T<b.length;++T){const N=b[T];N!=="@id"&&(g[N]=_(d,g[N]))}}return g}return Na}var Aa,Ed;function Zl(){if(Ed)return Aa;Ed=1;const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",e="http://www.w3.org/2001/XMLSchema#";return Aa={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:i,RDF_LIST:i+"List",RDF_FIRST:i+"first",RDF_REST:i+"rest",RDF_NIL:i+"nil",RDF_TYPE:i+"type",RDF_PLAIN_LITERAL:i+"PlainLiteral",RDF_XML_LITERAL:i+"XMLLiteral",RDF_JSON_LITERAL:i+"JSON",RDF_OBJECT:i+"object",RDF_LANGSTRING:i+"langString",XSD:e,XSD_BOOLEAN:e+"boolean",XSD_DOUBLE:e+"double",XSD_INTEGER:e+"integer",XSD_STRING:e+"string"},Aa}var Ra,Sd;function $f(){return Sd||(Sd=1,Ra=class{constructor(){this._requests={}}wrapLoader(e){const n=this;return n._loader=e,function(){return n.add.apply(n,arguments)}}async add(e){let n=this._requests[e];if(n)return Promise.resolve(n);n=this._requests[e]=this._loader(e);try{return await n}finally{delete this._requests[e]}}}),Ra}var Ca,Td;function Wn(){if(Td)return Ca;Td=1;const i=zt(),e={};Ca=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=(r,o)=>{const a={},l=e.parsers[o||"full"],u=l.regex.exec(r);let f=l.keys.length;for(;f--;)a[l.keys[f]]=u[f]===void 0?null:u[f];return(a.scheme==="https"&&a.port==="443"||a.scheme==="http"&&a.port==="80")&&(a.href=a.href.replace(":"+a.port,""),a.authority=a.authority.replace(":"+a.port,""),a.port=null),a.normalizedPath=e.removeDotSegments(a.path),a},e.prependBase=(r,o)=>{if(r===null||e.isAbsolute(o))return o;(!r||i.isString(r))&&(r=e.parse(r||""));const a=e.parse(o),l={protocol:r.protocol||""};if(a.authority!==null)l.authority=a.authority,l.path=a.path,l.query=a.query;else if(l.authority=r.authority,a.path==="")l.path=r.path,a.query!==null?l.query=a.query:l.query=r.query;else{if(a.path.indexOf("/")===0)l.path=a.path;else{let f=r.path;f=f.substr(0,f.lastIndexOf("/")+1),(f.length>0||r.authority)&&f.substr(-1)!=="/"&&(f+="/"),f+=a.path,l.path=f}l.query=a.query}a.path!==""&&(l.path=e.removeDotSegments(l.path));let u=l.protocol;return l.authority!==null&&(u+="//"+l.authority),u+=l.path,l.query!==null&&(u+="?"+l.query),a.fragment!==null&&(u+="#"+a.fragment),u===""&&(u="./"),u},e.removeBase=(r,o)=>{if(r===null)return o;(!r||i.isString(r))&&(r=e.parse(r||""));let a="";if(r.href!==""?a+=(r.protocol||"")+"//"+(r.authority||""):o.indexOf("//")&&(a+="//"),o.indexOf(a)!==0)return o;const l=e.parse(o.substr(a.length)),u=r.normalizedPath.split("/"),f=l.normalizedPath.split("/"),h=l.fragment||l.query?0:1;for(;u.length>0&&f.length>h&&u[0]===f[0];)u.shift(),f.shift();let m="";if(u.length>0){u.pop();for(let _=0;_<u.length;++_)m+="../"}return m+=f.join("/"),l.query!==null&&(m+="?"+l.query),l.fragment!==null&&(m+="#"+l.fragment),m===""&&(m="./"),m},e.removeDotSegments=r=>{if(r.length===0)return"";const o=r.split("/"),a=[];for(;o.length>0;){const l=o.shift(),u=o.length===0;if(l==="."){u&&a.push("");continue}if(l===".."){a.pop(),u&&a.push("");continue}a.push(l)}return r[0]==="/"&&a.length>0&&a[0]!==""&&a.unshift(""),a.length===1&&a[0]===""?"/":a.join("/")};const n=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;return e.isAbsolute=r=>i.isString(r)&&n.test(r),e.isRelative=r=>i.isString(r),Ca}var Pa,Ld;function Lm(){if(Ld)return Pa;Ld=1;const{parseLinkHeader:i,buildHeaders:e}=Jt(),{LINK_HEADER_CONTEXT:n}=Zl(),r=Yt(),o=$f(),{prependBase:a}=Wn(),l=/(^|(\r\n))link:/i;Pa=({secure:f,headers:h={},xhr:m}={headers:{}})=>{return h=e(h),new o().wrapLoader(d);async function d(g){if(g.indexOf("http:")!==0&&g.indexOf("https:")!==0)throw new r('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:g});if(f&&g.indexOf("https")!==0)throw new r(`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 b;try{b=await u(m,g,h)}catch(S){throw new r("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:g,cause:S})}if(b.status>=400)throw new r("URL could not be dereferenced: "+b.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:g,httpStatusCode:b.status});let T={contextUrl:null,documentUrl:g,document:b.response},N=null;const A=b.getResponseHeader("Content-Type");let R;if(l.test(b.getAllResponseHeaders())&&(R=b.getResponseHeader("Link")),R&&A!=="application/ld+json"){const S=i(R),y=S[n];if(Array.isArray(y))throw new r("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:g});y&&(T.contextUrl=y.target),N=S.alternate,N&&N.type=="application/ld+json"&&!(A||"").match(/^application\/(\w*\+)?json$/)&&(T=await d(a(g,N.target)))}return T}};function u(f,h,m){f=f||XMLHttpRequest;const _=new f;return new Promise((d,g)=>{_.onload=()=>d(_),_.onerror=b=>g(b),_.open("GET",h,!0);for(const b in m)_.setRequestHeader(b,m[b]);_.send()})}return Pa}var ka,Id;function Im(){if(Id)return ka;Id=1;const i=Lm(),e={};return ka=e,e.setupDocumentLoaders=function(n){typeof XMLHttpRequest<"u"&&(n.documentLoaders.xhr=i,n.useDocumentLoader("xhr"))},e.setupGlobals=function(n){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:n.JsonLdProcessor})},ka}var Da,Nd;function Nm(){return Nd||(Nd=1,Da=function(i){i.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Da}var Ma,Ad;function Am(){if(Ad)return Ma;Ad=1,Ma=i,i.Node=o,i.create=i;function i(a){var l=this;if(l instanceof i||(l=new i),l.tail=null,l.head=null,l.length=0,a&&typeof a.forEach=="function")a.forEach(function(h){l.push(h)});else if(arguments.length>0)for(var u=0,f=arguments.length;u<f;u++)l.push(arguments[u]);return l}i.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var l=a.next,u=a.prev;return l&&(l.prev=u),u&&(u.next=l),a===this.head&&(this.head=l),a===this.tail&&(this.tail=u),a.list.length--,a.next=null,a.prev=null,a.list=null,l},i.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var l=this.head;a.list=this,a.next=l,l&&(l.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},i.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var l=this.tail;a.list=this,a.prev=l,l&&(l.next=a),this.tail=a,this.head||(this.head=a),this.length++}},i.prototype.push=function(){for(var a=0,l=arguments.length;a<l;a++)n(this,arguments[a]);return this.length},i.prototype.unshift=function(){for(var a=0,l=arguments.length;a<l;a++)r(this,arguments[a]);return this.length},i.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},i.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},i.prototype.forEach=function(a,l){l=l||this;for(var u=this.head,f=0;u!==null;f++)a.call(l,u.value,f,this),u=u.next},i.prototype.forEachReverse=function(a,l){l=l||this;for(var u=this.tail,f=this.length-1;u!==null;f--)a.call(l,u.value,f,this),u=u.prev},i.prototype.get=function(a){for(var l=0,u=this.head;u!==null&&l<a;l++)u=u.next;if(l===a&&u!==null)return u.value},i.prototype.getReverse=function(a){for(var l=0,u=this.tail;u!==null&&l<a;l++)u=u.prev;if(l===a&&u!==null)return u.value},i.prototype.map=function(a,l){l=l||this;for(var u=new i,f=this.head;f!==null;)u.push(a.call(l,f.value,this)),f=f.next;return u},i.prototype.mapReverse=function(a,l){l=l||this;for(var u=new i,f=this.tail;f!==null;)u.push(a.call(l,f.value,this)),f=f.prev;return u},i.prototype.reduce=function(a,l){var u,f=this.head;if(arguments.length>1)u=l;else if(this.head)f=this.head.next,u=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=0;f!==null;h++)u=a(u,f.value,h),f=f.next;return u},i.prototype.reduceReverse=function(a,l){var u,f=this.tail;if(arguments.length>1)u=l;else if(this.tail)f=this.tail.prev,u=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=this.length-1;f!==null;h--)u=a(u,f.value,h),f=f.prev;return u},i.prototype.toArray=function(){for(var a=new Array(this.length),l=0,u=this.head;u!==null;l++)a[l]=u.value,u=u.next;return a},i.prototype.toArrayReverse=function(){for(var a=new Array(this.length),l=0,u=this.tail;u!==null;l++)a[l]=u.value,u=u.prev;return a},i.prototype.slice=function(a,l){l=l||this.length,l<0&&(l+=this.length),a=a||0,a<0&&(a+=this.length);var u=new i;if(l<a||l<0)return u;a<0&&(a=0),l>this.length&&(l=this.length);for(var f=0,h=this.head;h!==null&&f<a;f++)h=h.next;for(;h!==null&&f<l;f++,h=h.next)u.push(h.value);return u},i.prototype.sliceReverse=function(a,l){l=l||this.length,l<0&&(l+=this.length),a=a||0,a<0&&(a+=this.length);var u=new i;if(l<a||l<0)return u;a<0&&(a=0),l>this.length&&(l=this.length);for(var f=this.length,h=this.tail;h!==null&&f>l;f--)h=h.prev;for(;h!==null&&f>a;f--,h=h.prev)u.push(h.value);return u},i.prototype.splice=function(a,l,...u){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var f=0,h=this.head;h!==null&&f<a;f++)h=h.next;for(var m=[],f=0;h&&f<l;f++)m.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var f=0;f<u.length;f++)h=e(this,h,u[f]);return m},i.prototype.reverse=function(){for(var a=this.head,l=this.tail,u=a;u!==null;u=u.prev){var f=u.prev;u.prev=u.next,u.next=f}return this.head=l,this.tail=a,this};function e(a,l,u){var f=l===a.head?new o(u,null,l,a):new o(u,l,l.next,a);return f.next===null&&(a.tail=f),f.prev===null&&(a.head=f),a.length++,f}function n(a,l){a.tail=new o(l,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function r(a,l){a.head=new o(l,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function o(a,l,u,f){if(!(this instanceof o))return new o(a,l,u,f);this.list=f,this.value=a,l?(l.next=this,this.prev=l):this.prev=null,u?(u.prev=this,this.next=u):this.next=null}try{Nm()(i)}catch{}return Ma}var Oa,Rd;function qf(){if(Rd)return Oa;Rd=1;const i=Am(),e=Symbol("max"),n=Symbol("length"),r=Symbol("lengthCalculator"),o=Symbol("allowStale"),a=Symbol("maxAge"),l=Symbol("dispose"),u=Symbol("noDisposeOnSet"),f=Symbol("lruList"),h=Symbol("cache"),m=Symbol("updateAgeOnGet"),_=()=>1;class d{constructor(y){if(typeof y=="number"&&(y={max:y}),y||(y={}),y.max&&(typeof y.max!="number"||y.max<0))throw new TypeError("max must be a non-negative number");this[e]=y.max||1/0;const x=y.length||_;if(this[r]=typeof x!="function"?_:x,this[o]=y.stale||!1,y.maxAge&&typeof y.maxAge!="number")throw new TypeError("maxAge must be a number");this[a]=y.maxAge||0,this[l]=y.dispose,this[u]=y.noDisposeOnSet||!1,this[m]=y.updateAgeOnGet||!1,this.reset()}set max(y){if(typeof y!="number"||y<0)throw new TypeError("max must be a non-negative number");this[e]=y||1/0,T(this)}get max(){return this[e]}set allowStale(y){this[o]=!!y}get allowStale(){return this[o]}set maxAge(y){if(typeof y!="number")throw new TypeError("maxAge must be a non-negative number");this[a]=y,T(this)}get maxAge(){return this[a]}set lengthCalculator(y){typeof y!="function"&&(y=_),y!==this[r]&&(this[r]=y,this[n]=0,this[f].forEach(x=>{x.length=this[r](x.value,x.key),this[n]+=x.length})),T(this)}get lengthCalculator(){return this[r]}get length(){return this[n]}get itemCount(){return this[f].length}rforEach(y,x){x=x||this;for(let D=this[f].tail;D!==null;){const U=D.prev;R(this,y,D,x),D=U}}forEach(y,x){x=x||this;for(let D=this[f].head;D!==null;){const U=D.next;R(this,y,D,x),D=U}}keys(){return this[f].toArray().map(y=>y.key)}values(){return this[f].toArray().map(y=>y.value)}reset(){this[l]&&this[f]&&this[f].length&&this[f].forEach(y=>this[l](y.key,y.value)),this[h]=new Map,this[f]=new i,this[n]=0}dump(){return this[f].map(y=>b(this,y)?!1:{k:y.key,v:y.value,e:y.now+(y.maxAge||0)}).toArray().filter(y=>y)}dumpLru(){return this[f]}set(y,x,D){if(D=D||this[a],D&&typeof D!="number")throw new TypeError("maxAge must be a number");const U=D?Date.now():0,O=this[r](x,y);if(this[h].has(y)){if(O>this[e])return N(this,this[h].get(y)),!1;const $=this[h].get(y).value;return this[l]&&(this[u]||this[l](y,$.value)),$.now=U,$.maxAge=D,$.value=x,this[n]+=O-$.length,$.length=O,this.get(y),T(this),!0}const Q=new A(y,x,O,U,D);return Q.length>this[e]?(this[l]&&this[l](y,x),!1):(this[n]+=Q.length,this[f].unshift(Q),this[h].set(y,this[f].head),T(this),!0)}has(y){if(!this[h].has(y))return!1;const x=this[h].get(y).value;return!b(this,x)}get(y){return g(this,y,!0)}peek(y){return g(this,y,!1)}pop(){const y=this[f].tail;return y?(N(this,y),y.value):null}del(y){N(this,this[h].get(y))}load(y){this.reset();const x=Date.now();for(let D=y.length-1;D>=0;D--){const U=y[D],O=U.e||0;if(O===0)this.set(U.k,U.v);else{const Q=O-x;Q>0&&this.set(U.k,U.v,Q)}}}prune(){this[h].forEach((y,x)=>g(this,x,!1))}}const g=(S,y,x)=>{const D=S[h].get(y);if(D){const U=D.value;if(b(S,U)){if(N(S,D),!S[o])return}else x&&(S[m]&&(D.value.now=Date.now()),S[f].unshiftNode(D));return U.value}},b=(S,y)=>{if(!y||!y.maxAge&&!S[a])return!1;const x=Date.now()-y.now;return y.maxAge?x>y.maxAge:S[a]&&x>S[a]},T=S=>{if(S[n]>S[e])for(let y=S[f].tail;S[n]>S[e]&&y!==null;){const x=y.prev;N(S,y),y=x}},N=(S,y)=>{if(y){const x=y.value;S[l]&&S[l](x.key,x.value),S[n]-=x.length,S[h].delete(x.key),S[f].removeNode(y)}};class A{constructor(y,x,D,U,O){this.key=y,this.value=x,this.length=D,this.now=U,this.maxAge=O||0}}const R=(S,y,x,D)=>{let U=x.value;b(S,U)&&(N(S,x),S[o]||(U=void 0)),U&&y.call(D,U.value,U.key,S)};return Oa=d,Oa}var Fa,Cd;function Rm(){if(Cd)return Fa;Cd=1;const i=qf(),e=10;return Fa=class{constructor({document:r}){this.document=r,this.cache=new i({max:e})}getProcessed(r){return this.cache.get(r)}setProcessed(r,o){this.cache.set(r,o)}},Fa}var ja,Pd;function Cm(){if(Pd)return ja;Pd=1;const{isArray:i,isObject:e,isString:n}=zt(),{asArray:r}=Jt(),{prependBase:o}=Wn(),a=Yt(),l=Rm(),u=10;ja=class{constructor({sharedCache:_}){this.perOpCache=new Map,this.sharedCache=_}async resolve({activeCtx:_,context:d,documentLoader:g,base:b,cycles:T=new Set}){d&&e(d)&&d["@context"]&&(d=d["@context"]),d=r(d);const N=[];for(const A of d){if(n(A)){let y=this._get(A);y||(y=await this._resolveRemoteContext({activeCtx:_,url:A,documentLoader:g,base:b,cycles:T})),i(y)?N.push(...y):N.push(y);continue}if(A===null){N.push(new l({document:null}));continue}e(A)||f(d);const R=JSON.stringify(A);let S=this._get(R);S||(S=new l({document:A}),this._cacheResolvedContext({key:R,resolved:S,tag:"static"})),N.push(S)}return N}_get(_){let d=this.perOpCache.get(_);if(!d){const g=this.sharedCache.get(_);g&&(d=g.get("static"),d&&this.perOpCache.set(_,d))}return d}_cacheResolvedContext({key:_,resolved:d,tag:g}){if(this.perOpCache.set(_,d),g!==void 0){let b=this.sharedCache.get(_);b||(b=new Map,this.sharedCache.set(_,b)),b.set(g,d)}return d}async _resolveRemoteContext({activeCtx:_,url:d,documentLoader:g,base:b,cycles:T}){d=o(b,d);const{context:N,remoteDoc:A}=await this._fetchContext({activeCtx:_,url:d,documentLoader:g,cycles:T});b=A.documentUrl||d,h({context:N,base:b});const R=await this.resolve({activeCtx:_,context:N,documentLoader:g,base:b,cycles:T});return this._cacheResolvedContext({key:d,resolved:R,tag:A.tag}),R}async _fetchContext({activeCtx:_,url:d,documentLoader:g,cycles:b}){if(b.size>u)throw new a("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:_.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:u});if(b.has(d))throw new a("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:_.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:d});b.add(d);let T,N;try{N=await g(d),T=N.document||null,n(T)&&(T=JSON.parse(T))}catch(A){throw new a(`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: "${d}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:d,cause:A})}if(!e(T))throw new a(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${d}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:d});return"@context"in T?T={"@context":T["@context"]}:T={"@context":{}},N.contextUrl&&(i(T["@context"])||(T["@context"]=[T["@context"]]),T["@context"].push(N.contextUrl)),{context:T,remoteDoc:N}}};function f(m){throw new a("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:m})}function h({context:m,base:_}){if(!m)return;const d=m["@context"];if(n(d)){m["@context"]=o(_,d);return}if(i(d)){for(let g=0;g<d.length;++g){const b=d[g];if(n(b)){d[g]=o(_,b);continue}e(b)&&h({context:{"@context":b},base:_})}return}if(e(d))for(const g in d)h({context:d[g],base:_})}return ja}var Ba,kd;function Pm(){return kd||(kd=1,Ba=Wl().NQuads),Ba}var $a,Dd;function Zr(){if(Dd)return $a;Dd=1;const i=Yt(),{isArray:e}=zt(),{asArray:n}=Jt(),r={};$a=r,r.defaultEventHandler=null,r.setupEventHandler=({options:l={}})=>{const u=[].concat(l.safe?r.safeEventHandler:[],l.eventHandler?n(l.eventHandler):[],r.defaultEventHandler?r.defaultEventHandler:[]);return u.length===0?null:u},r.handleEvent=({event:l,options:u})=>{o({event:l,handlers:u.eventHandler})};function o({event:l,handlers:u}){let f=!0;for(let h=0;f&&h<u.length;++h){f=!1;const m=u[h];if(e(m))f=o({event:l,handlers:m});else if(typeof m=="function")m({event:l,next:()=>{f=!0}});else if(typeof m=="object")l.code in m?m[l.code]({event:l,next:()=>{f=!0}}):f=!0;else throw new i("Invalid event handler.","jsonld.InvalidEventHandler",{event:l})}return f}const a=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 r.safeEventHandler=function({event:u,next:f}){if(u.level==="warning"&&a.has(u.code))throw new i("Safe mode validation error.","jsonld.ValidationError",{event:u});f()},r.logEventHandler=function({event:u,next:f}){console.log(`EVENT: ${u.message}`,{event:u}),f()},r.logWarningEventHandler=function({event:u,next:f}){u.level==="warning"&&console.warn(`WARNING: ${u.message}`,{event:u}),f()},r.unhandledEventHandler=function({event:u}){throw new i("No handler for event.","jsonld.UnhandledEvent",{event:u})},r.setDefaultEventHandler=function({eventHandler:l}={}){r.defaultEventHandler=l?n(l):null},$a}var qa,Md;function vi(){if(Md)return qa;Md=1;const i=Jt(),e=Yt(),{isArray:n,isObject:r,isString:o,isUndefined:a}=zt(),{isAbsolute:l,isRelative:u,prependBase:f}=Wn(),{handleEvent:h}=Zr(),{REGEX_BCP47:m,REGEX_KEYWORD:_,asArray:d,compareShortestLeast:g}=Jt(),b=new Map,T=1e4,N={};qa=N,N.process=async({activeCtx:S,localCtx:y,options:x,propagate:D=!0,overrideProtected:U=!1,cycles:O=new Set})=>{if(r(y)&&"@context"in y&&n(y["@context"])&&(y=y["@context"]),d(y).length===0)return S;const M=[],$=[({event:ue,next:k})=>{M.push(ue),k()}];x.eventHandler&&$.push(x.eventHandler);const X=x;x={...x,eventHandler:$};const F=await x.contextResolver.resolve({activeCtx:S,context:y,documentLoader:x.documentLoader,base:x.base});r(F[0].document)&&typeof F[0].document["@propagate"]=="boolean"&&(D=F[0].document["@propagate"]);let B=S;!D&&!B.previousContext&&(B=B.clone(),B.previousContext=S);for(const ue of F){let{document:k}=ue;if(S=B,k===null){if(!U&&Object.keys(S.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"});B=S=N.getInitialContext(x).clone();continue}const oe=ue.getProcessed(S);if(oe){if(X.eventHandler)for(const ae of oe.events)h({event:ae,options:X});B=S=oe.context;continue}if(r(k)&&"@context"in k&&(k=k["@context"]),!r(k))throw new e("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:k});B=B.clone();const j=new Map;if("@version"in k){if(k["@version"]!==1.1)throw new e("Unsupported JSON-LD version: "+k["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:k});if(S.processingMode&&S.processingMode==="json-ld-1.0")throw new e("@version: "+k["@version"]+" not compatible with "+S.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:k});B.processingMode="json-ld-1.1",B["@version"]=k["@version"],j.set("@version",!0)}if(B.processingMode=B.processingMode||S.processingMode,"@base"in k){let ae=k["@base"];if(!(ae===null||l(ae)))if(u(ae))ae=f(B["@base"],ae);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:k});B["@base"]=ae,j.set("@base",!0)}if("@vocab"in k){const ae=k["@vocab"];if(ae===null)delete B["@vocab"];else if(o(ae)){if(!l(ae)&&N.processingMode(B,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:k});{const I=A(B,ae,{vocab:!0,base:!0},void 0,void 0,x);l(I)||x.eventHandler&&h({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:I}},options:x}),B["@vocab"]=I}}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:k});j.set("@vocab",!0)}if("@language"in k){const ae=k["@language"];if(ae===null)delete B["@language"];else if(o(ae))ae.match(m)||x.eventHandler&&h({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ae}},options:x}),B["@language"]=ae.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:k});j.set("@language",!0)}if("@direction"in k){const ae=k["@direction"];if(S.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @direction not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:k});if(ae===null)delete B["@direction"];else{if(ae!=="ltr"&&ae!=="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:k});B["@direction"]=ae}j.set("@direction",!0)}if("@propagate"in k){const ae=k["@propagate"];if(S.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @propagate not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:k});if(typeof ae!="boolean")throw new e("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:y});j.set("@propagate",!0)}if("@import"in k){const ae=k["@import"];if(S.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @import not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:k});if(!o(ae))throw new e("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:y});const I=await x.contextResolver.resolve({activeCtx:S,context:ae,documentLoader:x.documentLoader,base:x.base});if(I.length!==1)throw new e("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:y});const Z=I[0].getProcessed(S);if(Z)k=Z;else{const ie=I[0].document;if("@import"in ie)throw new e("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:y});for(const ee in ie)k.hasOwnProperty(ee)||(k[ee]=ie[ee]);I[0].setProcessed(S,k)}j.set("@import",!0)}j.set("@protected",k["@protected"]||!1);for(const ae in k)if(N.createTermDefinition({activeCtx:B,localCtx:k,term:ae,defined:j,options:x,overrideProtected:U}),r(k[ae])&&"@context"in k[ae]){const I=k[ae]["@context"];let Z=!0;if(o(I)){const ie=f(x.base,I);O.has(ie)?Z=!1:O.add(ie)}if(Z)try{await N.process({activeCtx:B.clone(),localCtx:k[ae]["@context"],overrideProtected:!0,options:x,cycles:O})}catch{throw new e("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:k[ae]["@context"],term:ae})}}ue.setProcessed(S,{context:B,events:M})}return B},N.createTermDefinition=({activeCtx:S,localCtx:y,term:x,defined:D,options:U,overrideProtected:O=!1})=>{if(D.has(x)){if(D.get(x))return;throw new e("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:y,term:x})}D.set(x,!1);let Q;if(y.hasOwnProperty(x)&&(Q=y[x]),x==="@type"&&r(Q)&&(Q["@container"]||"@set")==="@set"&&N.processingMode(S,1.1)){const k=["@container","@id","@protected"],oe=Object.keys(Q);if(oe.length===0||oe.some(j=>!k.includes(j)))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:x})}else{if(N.isKeyword(x))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:x});if(x.match(_)){U.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:x}},options:U});return}else if(x==="")throw new e("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:y})}const M=S.mappings.get(x);S.mappings.has(x)&&S.mappings.delete(x);let $=!1;if((o(Q)||Q===null)&&($=!0,Q={"@id":Q}),!r(Q))throw new e("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:y});const X={};S.mappings.set(x,X),X.reverse=!1;const F=["@container","@id","@language","@reverse","@type"];N.processingMode(S,1.1)&&F.push("@context","@direction","@index","@nest","@prefix","@protected");for(const k in Q)if(!F.includes(k))throw new e("Invalid JSON-LD syntax; a term definition must not contain "+k,"jsonld.SyntaxError",{code:"invalid term definition",context:y});const B=x.indexOf(":");if(X._termHasColon=B>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:y});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:y});const k=Q["@reverse"];if(!o(k))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(k.match(_)){U.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:k}},options:U}),M?S.mappings.set(x,M):S.mappings.delete(x);return}const oe=A(S,k,{vocab:!0,base:!1},y,D,U);if(!l(oe))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:y});X["@id"]=oe,X.reverse=!0}else if("@id"in Q){let k=Q["@id"];if(k&&!o(k))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:y});if(k===null)X["@id"]=null;else if(!N.isKeyword(k)&&k.match(_)){U.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:k}},options:U}),M?S.mappings.set(x,M):S.mappings.delete(x);return}else if(k!==x){if(k=A(S,k,{vocab:!0,base:!1},y,D,U),!l(k)&&!N.isKeyword(k))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:y});if(x.match(/(?::[^:])|\//)){const oe=new Map(D).set(x,!0);if(A(S,x,{vocab:!0,base:!1},y,oe,U)!==k)throw new e("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y})}X["@id"]=k,X._prefix=$&&!X._termHasColon&&k.match(/[:\/\?#\[\]@]$/)!==null}}if(!("@id"in X))if(X._termHasColon){const k=x.substr(0,B);if(y.hasOwnProperty(k)&&N.createTermDefinition({activeCtx:S,localCtx:y,term:k,defined:D,options:U}),S.mappings.has(k)){const oe=x.substr(B+1);X["@id"]=S.mappings.get(k)["@id"]+oe}else X["@id"]=x}else if(x==="@type")X["@id"]=x;else{if(!("@vocab"in S))throw new e("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y,term:x});X["@id"]=S["@vocab"]+x}if((Q["@protected"]===!0||D.get("@protected")===!0&&Q["@protected"]!==!1)&&(S.protected[x]=!0,X.protected=!0),D.set(x,!0),"@type"in Q){let k=Q["@type"];if(!o(k))throw new e("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(k==="@json"||k==="@none"){if(N.processingMode(S,1))throw new e(`Invalid JSON-LD syntax; an @context @type value must not be "${k}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else if(k!=="@id"&&k!=="@vocab"){if(k=A(S,k,{vocab:!0,base:!1},y,D,U),!l(k))throw new e("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(k.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:y})}X["@type"]=k}if("@container"in Q){const k=o(Q["@container"])?[Q["@container"]]:Q["@container"]||[],oe=["@list","@set","@index","@language"];let j=!0;const ae=k.includes("@set");if(N.processingMode(S,1.1)){if(oe.push("@graph","@id","@type"),k.includes("@list")){if(k.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:y})}else if(k.includes("@graph")){if(k.some(I=>I!=="@graph"&&I!=="@id"&&I!=="@index"&&I!=="@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:y})}else j&=k.length<=(ae?2:1);if(k.includes("@type")&&(X["@type"]=X["@type"]||"@id",!["@id","@vocab"].includes(X["@type"])))throw new e("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else j&=!n(Q["@container"]),j&=k.length<=1;if(j&=k.every(I=>oe.includes(I)),j&=!(ae&&k.includes("@list")),!j)throw new e("Invalid JSON-LD syntax; @context @container value must be one of the following: "+oe.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:y});if(X.reverse&&!k.every(I=>["@index","@set"].includes(I)))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:y});X["@container"]=k}if("@index"in Q){if(!("@container"in Q)||!X["@container"].includes("@index"))throw new e(`Invalid JSON-LD syntax; @index without @index in @container: "${Q["@index"]}" on term "${x}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});if(!o(Q["@index"])||Q["@index"].indexOf("@")===0)throw new e(`Invalid JSON-LD syntax; @index must expand to an IRI: "${Q["@index"]}" on term "${x}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});X["@index"]=Q["@index"]}if("@context"in Q&&(X["@context"]=Q["@context"]),"@language"in Q&&!("@type"in Q)){let k=Q["@language"];if(k!==null&&!o(k))throw new e("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:y});k!==null&&(k=k.toLowerCase()),X["@language"]=k}if("@prefix"in Q){if(x.match(/:|\//))throw new e("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(N.isKeyword(X["@id"]))throw new e("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(typeof Q["@prefix"]=="boolean")X._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:y})}if("@direction"in Q){const k=Q["@direction"];if(k!==null&&k!=="ltr"&&k!=="rtl")throw new e('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:y});X["@direction"]=k}if("@nest"in Q){const k=Q["@nest"];if(!o(k)||k!=="@nest"&&k.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:y});X["@nest"]=k}const ue=X["@id"];if(ue==="@context"||ue==="@preserve")throw new e("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:y});if(M&&M.protected&&!O&&(S.protected[x]=!0,X.protected=!0,!R(M,X)))throw new e("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:y,term:x})},N.expandIri=(S,y,x,D)=>A(S,y,x,void 0,void 0,D);function A(S,y,x,D,U,O){if(y===null||!o(y)||N.isKeyword(y))return y;if(y.match(_))return null;if(D&&D.hasOwnProperty(y)&&U.get(y)!==!0&&N.createTermDefinition({activeCtx:S,localCtx:D,term:y,defined:U,options:O}),x=x||{},x.vocab){const M=S.mappings.get(y);if(M===null)return null;if(r(M)&&"@id"in M)return M["@id"]}const Q=y.indexOf(":");if(Q>0){const M=y.substr(0,Q),$=y.substr(Q+1);if(M==="_"||$.indexOf("//")===0)return y;D&&D.hasOwnProperty(M)&&N.createTermDefinition({activeCtx:S,localCtx:D,term:M,defined:U,options:O});const X=S.mappings.get(M);if(X&&X._prefix)return X["@id"]+$;if(l(y))return y}if(x.vocab&&"@vocab"in S)y=S["@vocab"]+y;else if(x.base){let M,$;"@base"in S?S["@base"]?($=f(O.base,S["@base"]),M=f($,y)):($=S["@base"],M=y):($=O.base,M=f(O.base,y)),y=M}return y}N.getInitialContext=S=>{const y=JSON.stringify({processingMode:S.processingMode}),x=b.get(y);if(x)return x;const D={processingMode:S.processingMode,mappings:new Map,inverse:null,getInverse:U,clone:M,revertToPreviousContext:$,protected:{}};return b.size===T&&b.clear(),b.set(y,D),D;function U(){const X=this;if(X.inverse)return X.inverse;const F=X.inverse={},B=X.fastCurieMap={},ue={},k=(X["@language"]||"@none").toLowerCase(),oe=X["@direction"],j=X.mappings,ae=[...j.keys()].sort(g);for(const I of ae){const Z=j.get(I);if(Z===null)continue;let ie=Z["@container"]||"@none";if(ie=[].concat(ie).sort().join(""),Z["@id"]===null)continue;const ee=d(Z["@id"]);for(const me of ee){let W=F[me];const G=N.isKeyword(me);if(W)!G&&!Z._termHasColon&&ue[me].push(I);else if(F[me]=W={},!G&&!Z._termHasColon){ue[me]=[I];const Y={iri:me,terms:ue[me]};me[0]in B?B[me[0]].push(Y):B[me[0]]=[Y]}if(W[ie]||(W[ie]={"@language":{},"@type":{},"@any":{}}),W=W[ie],Q(I,W["@any"],"@none"),Z.reverse)Q(I,W["@type"],"@reverse");else if(Z["@type"]==="@none")Q(I,W["@any"],"@none"),Q(I,W["@language"],"@none"),Q(I,W["@type"],"@none");else if("@type"in Z)Q(I,W["@type"],Z["@type"]);else if("@language"in Z&&"@direction"in Z){const Y=Z["@language"],K=Z["@direction"];Y&&K?Q(I,W["@language"],`${Y}_${K}`.toLowerCase()):Y?Q(I,W["@language"],Y.toLowerCase()):K?Q(I,W["@language"],`_${K}`):Q(I,W["@language"],"@null")}else"@language"in Z?Q(I,W["@language"],(Z["@language"]||"@null").toLowerCase()):"@direction"in Z?Z["@direction"]?Q(I,W["@language"],`_${Z["@direction"]}`):Q(I,W["@language"],"@none"):oe?(Q(I,W["@language"],`_${oe}`),Q(I,W["@language"],"@none"),Q(I,W["@type"],"@none")):(Q(I,W["@language"],k),Q(I,W["@language"],"@none"),Q(I,W["@type"],"@none"))}}for(const I in B)O(B,I,1);return F}function O(X,F,B){const ue=X[F],k=X[F]={};let oe,j;for(const ae of ue)oe=ae.iri,B>=oe.length?j="":j=oe[B],j in k?k[j].push(ae):k[j]=[ae];for(const ae in k)ae!==""&&O(k,ae,B+1)}function Q(X,F,B){F.hasOwnProperty(B)||(F[B]=X)}function M(){const X={};return X.mappings=i.clone(this.mappings),X.clone=this.clone,X.inverse=null,X.getInverse=this.getInverse,X.protected=i.clone(this.protected),this.previousContext&&(X.previousContext=this.previousContext.clone()),X.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(X["@base"]=this["@base"]),"@language"in this&&(X["@language"]=this["@language"]),"@vocab"in this&&(X["@vocab"]=this["@vocab"]),X}function $(){return this.previousContext?this.previousContext.clone():this}},N.getContextValue=(S,y,x)=>{if(y===null)return x==="@context"?void 0:null;if(S.mappings.has(y)){const D=S.mappings.get(y);if(a(x))return D;if(D.hasOwnProperty(x))return D[x]}if(x==="@language"&&x in S||x==="@direction"&&x in S)return S[x];if(x!=="@context")return null},N.processingMode=(S,y)=>y.toString()>="1.1"?!S.processingMode||S.processingMode>="json-ld-"+y.toString():S.processingMode==="json-ld-1.0",N.isKeyword=S=>{if(!o(S)||S[0]!=="@")return!1;switch(S){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 R(S,y){if(!(S&&typeof S=="object")||!(y&&typeof y=="object"))return S===y;const x=Array.isArray(S);if(x!==Array.isArray(y))return!1;if(x){if(S.length!==y.length)return!1;for(let O=0;O<S.length;++O)if(!R(S[O],y[O]))return!1;return!0}const D=Object.keys(S),U=Object.keys(y);if(D.length!==U.length)return!1;for(const O in S){let Q=S[O],M=y[O];if(O==="@container"&&Array.isArray(Q)&&Array.isArray(M)&&(Q=Q.slice().sort(),M=M.slice().sort()),!R(Q,M))return!1}return!0}return qa}var za,Od;function km(){if(Od)return za;Od=1;const i=Yt(),{isArray:e,isObject:n,isEmptyObject:r,isString:o,isUndefined:a}=zt(),{isList:l,isValue:u,isGraph:f,isSubject:h}=Pn(),{expandIri:m,getContextValue:_,isKeyword:d,process:g,processingMode:b}=vi(),{isAbsolute:T}=Wn(),{REGEX_BCP47:N,REGEX_KEYWORD:A,addValue:R,asArray:S,getValues:y,validateTypeValue:x}=Jt(),{handleEvent:D}=Zr(),U={};za=U,U.expand=async({activeCtx:F,activeProperty:B=null,element:ue,options:k={},insideList:oe=!1,insideIndex:j=!1,typeScopedContext:ae=null})=>{if(ue==null)return null;if(B==="@default"&&(k=Object.assign({},k,{isFrame:!1})),!e(ue)&&!n(ue))return!oe&&(B===null||m(F,B,{vocab:!0},k)==="@graph")?(k.eventHandler&&D({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:ue}},options:k}),null):M({activeCtx:F,activeProperty:B,value:ue,options:k});if(e(ue)){let Y=[];const K=_(F,B,"@container")||[];oe=oe||K.includes("@list");for(let le=0;le<ue.length;++le){let ce=await U.expand({activeCtx:F,activeProperty:B,element:ue[le],options:k,insideIndex:j,typeScopedContext:ae});oe&&e(ce)&&(ce={"@list":ce}),ce!==null&&(e(ce)?Y=Y.concat(ce):Y.push(ce))}return Y}const I=m(F,B,{vocab:!0},k),Z=_(F,B,"@context");ae=ae||(F.previousContext?F:null);let ie=Object.keys(ue).sort(),ee=!j;if(ee&&ae&&ie.length<=2&&!ie.includes("@context"))for(const Y of ie){const K=m(ae,Y,{vocab:!0},k);if(K==="@value"){ee=!1,F=ae;break}if(K==="@id"&&ie.length===1){ee=!1;break}}ee&&(F=F.revertToPreviousContext()),a(Z)||(F=await g({activeCtx:F,localCtx:Z,propagate:!0,overrideProtected:!0,options:k})),"@context"in ue&&(F=await g({activeCtx:F,localCtx:ue["@context"],options:k})),ae=F;let me=null;for(const Y of ie)if(m(F,Y,{vocab:!0},k)==="@type"){me=me||Y;const le=ue[Y],ce=Array.isArray(le)?le.length>1?le.slice().sort():le:[le];for(const Ee of ce){const Te=_(ae,Ee,"@context");a(Te)||(F=await g({activeCtx:F,localCtx:Te,options:k,propagate:!1}))}}let W={};await Q({activeCtx:F,activeProperty:B,expandedActiveProperty:I,element:ue,expandedParent:W,options:k,insideList:oe,typeKey:me,typeScopedContext:ae}),ie=Object.keys(W);let G=ie.length;if("@value"in W){if("@type"in W&&("@language"in W||"@direction"in W))throw new i('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:W});let Y=G-1;if("@type"in W&&(Y-=1),"@index"in W&&(Y-=1),"@language"in W&&(Y-=1),"@direction"in W&&(Y-=1),Y!==0)throw new i('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:W});const K=W["@value"]===null?[]:S(W["@value"]),le=y(W,"@type");if(!(b(F,1.1)&&le.includes("@json")&&le.length===1))if(K.length===0)k.eventHandler&&D({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:W}},options:k}),W=null;else{if(!K.every(ce=>o(ce)||r(ce))&&"@language"in W)throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:W});if(!le.every(ce=>T(ce)&&!(o(ce)&&ce.indexOf("_:")===0)||r(ce)))throw new i('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:W})}}else if("@type"in W&&!e(W["@type"]))W["@type"]=[W["@type"]];else if("@set"in W||"@list"in W){if(G>1&&!(G===2&&"@index"in W))throw new i('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:W});"@set"in W&&(W=W["@set"],ie=Object.keys(W),G=ie.length)}else G===1&&"@language"in W&&(k.eventHandler&&D({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:W}},options:k}),W=null);return n(W)&&!k.keepFreeFloatingNodes&&!oe&&(B===null||I==="@graph"||(_(F,B,"@container")||[]).includes("@graph"))&&(W=O({value:W,count:G,options:k})),W};function O({value:F,count:B,options:ue}){if(B===0||"@value"in F||"@list"in F||B===1&&"@id"in F){if(ue.eventHandler){let k,oe;B===0?(k="empty object",oe="Dropping empty object."):"@value"in F?(k="object with only @value",oe="Dropping object with only @value."):"@list"in F?(k="object with only @list",oe="Dropping object with only @list."):B===1&&"@id"in F&&(k="object with only @id",oe="Dropping object with only @id."),D({event:{type:["JsonLdEvent"],code:k,level:"warning",message:oe,details:{value:F}},options:ue})}return null}return F}async function Q({activeCtx:F,activeProperty:B,expandedActiveProperty:ue,element:k,expandedParent:oe,options:j={},insideList:ae,typeKey:I,typeScopedContext:Z}){const ie=Object.keys(k).sort(),ee=[];let me;const W=k[I]&&m(F,e(k[I])?k[I][0]:k[I],{vocab:!0},{...j,typeExpansion:!0})==="@json";for(const G of ie){let Y=k[G],K;if(G==="@context")continue;const le=m(F,G,{vocab:!0},j);if(le===null||!(T(le)||d(le))){j.eventHandler&&D({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:G,expandedProperty:le}},options:j});continue}if(d(le)){if(ue==="@reverse")throw new i("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:Y});if(le in oe&&le!=="@included"&&le!=="@type")throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:le})}if(le==="@id"){if(!o(Y)){if(!j.isFrame)throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:Y});if(n(Y)){if(!r(Y))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Y})}else if(e(Y)){if(!Y.every(q=>o(q)))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Y})}else throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Y})}R(oe,"@id",S(Y).map(q=>{if(o(q)){const te=m(F,q,{base:!0},j);return j.eventHandler&&(te===null?D(q===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:q}},options:j}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:q}},options:j}):T(te)||D({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:q,expandedId:te}},options:j})),te}return q}),{propertyIsArray:j.isFrame});continue}if(le==="@type"){n(Y)&&(Y=Object.fromEntries(Object.entries(Y).map(([q,te])=>[m(Z,q,{vocab:!0}),S(te).map(fe=>m(Z,fe,{base:!0,vocab:!0},{...j,typeExpansion:!0}))]))),x(Y,j.isFrame),R(oe,"@type",S(Y).map(q=>{if(o(q)){const te=m(Z,q,{base:!0,vocab:!0},{...j,typeExpansion:!0});return te!=="@json"&&!T(te)&&j.eventHandler&&D({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:q}},options:j}),te}return q}),{propertyIsArray:!!j.isFrame});continue}if(le==="@included"&&b(F,1.1)){const q=S(await U.expand({activeCtx:F,activeProperty:B,element:Y,options:j}));if(!q.every(te=>h(te)))throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:Y});R(oe,"@included",q,{propertyIsArray:!0});continue}if(le==="@graph"&&!(n(Y)||e(Y)))throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:Y});if(le==="@value"){me=Y,W&&b(F,1.1)?oe["@value"]=Y:R(oe,"@value",Y,{propertyIsArray:j.isFrame});continue}if(le==="@language"){if(Y===null)continue;if(!o(Y)&&!j.isFrame)throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:Y});Y=S(Y).map(q=>o(q)?q.toLowerCase():q);for(const q of Y)o(q)&&!q.match(N)&&j.eventHandler&&D({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:q}},options:j});R(oe,"@language",Y,{propertyIsArray:j.isFrame});continue}if(le==="@direction"){if(!o(Y)&&!j.isFrame)throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:Y});Y=S(Y);for(const q of Y)if(o(q)&&q!=="ltr"&&q!=="rtl")throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:Y});R(oe,"@direction",Y,{propertyIsArray:j.isFrame});continue}if(le==="@index"){if(!o(Y))throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:Y});R(oe,"@index",Y);continue}if(le==="@reverse"){if(!n(Y))throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:Y});if(K=await U.expand({activeCtx:F,activeProperty:"@reverse",element:Y,options:j}),"@reverse"in K)for(const te in K["@reverse"])R(oe,te,K["@reverse"][te],{propertyIsArray:!0});let q=oe["@reverse"]||null;for(const te in K){if(te==="@reverse")continue;q===null&&(q=oe["@reverse"]={}),R(q,te,[],{propertyIsArray:!0});const fe=K[te];for(let xe=0;xe<fe.length;++xe){const Se=fe[xe];if(u(Se)||l(Se))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:K});R(q,te,Se,{propertyIsArray:!0})}}continue}if(le==="@nest"){ee.push(G);continue}let ce=F;const Ee=_(F,G,"@context");a(Ee)||(ce=await g({activeCtx:F,localCtx:Ee,propagate:!0,overrideProtected:!0,options:j}));const Te=_(F,G,"@container")||[];if(Te.includes("@language")&&n(Y)){const q=_(ce,G,"@direction");K=$(ce,Y,q,j)}else if(Te.includes("@index")&&n(Y)){const q=Te.includes("@graph"),te=_(ce,G,"@index")||"@index",fe=te!=="@index"&&m(F,te,{vocab:!0},j);K=await X({activeCtx:ce,options:j,activeProperty:G,value:Y,asGraph:q,indexKey:te,propertyIndex:fe})}else if(Te.includes("@id")&&n(Y)){const q=Te.includes("@graph");K=await X({activeCtx:ce,options:j,activeProperty:G,value:Y,asGraph:q,indexKey:"@id"})}else if(Te.includes("@type")&&n(Y))K=await X({activeCtx:ce.revertToPreviousContext(),options:j,activeProperty:G,value:Y,asGraph:!1,indexKey:"@type"});else{const q=le==="@list";if(q||le==="@set"){let te=B;q&&ue==="@graph"&&(te=null),K=await U.expand({activeCtx:ce,activeProperty:te,element:Y,options:j,insideList:q})}else _(F,G,"@type")==="@json"?K={"@type":"@json","@value":Y}:K=await U.expand({activeCtx:ce,activeProperty:G,element:Y,options:j,insideList:!1})}if(!(K===null&&le!=="@value")){if(le!=="@list"&&!l(K)&&Te.includes("@list")&&(K={"@list":S(K)}),Te.includes("@graph")&&!Te.some(q=>q==="@id"||q==="@index")){if(K=S(K),j.isFrame||(K=K.filter(q=>{const te=Object.keys(q).length;return O({value:q,count:te,options:j})!==null})),K.length===0)continue;K=K.map(q=>({"@graph":S(q)}))}if(ce.mappings.has(G)&&ce.mappings.get(G).reverse){const q=oe["@reverse"]=oe["@reverse"]||{};K=S(K);for(let te=0;te<K.length;++te){const fe=K[te];if(u(fe)||l(fe))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:K});R(q,le,fe,{propertyIsArray:!0})}continue}R(oe,le,K,{propertyIsArray:!0})}}if("@value"in oe&&!(oe["@type"]==="@json"&&b(F,1.1))){if((n(me)||e(me))&&!j.isFrame)throw new i('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:me})}for(const G of ee){const Y=e(k[G])?k[G]:[k[G]];for(const K of Y){if(!n(K)||Object.keys(K).some(le=>m(F,le,{vocab:!0},j)==="@value"))throw new i("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:K});await Q({activeCtx:F,activeProperty:B,expandedActiveProperty:ue,element:K,expandedParent:oe,options:j,insideList:ae,typeScopedContext:Z,typeKey:I})}}}function M({activeCtx:F,activeProperty:B,value:ue,options:k}){if(ue==null)return null;const oe=m(F,B,{vocab:!0},k);if(oe==="@id")return m(F,ue,{base:!0},k);if(oe==="@type")return m(F,ue,{vocab:!0,base:!0},{...k,typeExpansion:!0});const j=_(F,B,"@type");if((j==="@id"||oe==="@graph")&&o(ue)){const I=m(F,ue,{base:!0},k);return I===null&&ue.match(A)&&k.eventHandler&&D({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:B}},options:k}),{"@id":I}}if(j==="@vocab"&&o(ue))return{"@id":m(F,ue,{vocab:!0,base:!0},k)};if(d(oe))return ue;const ae={};if(j&&!["@id","@vocab","@none"].includes(j))ae["@type"]=j;else if(o(ue)){const I=_(F,B,"@language");I!==null&&(ae["@language"]=I);const Z=_(F,B,"@direction");Z!==null&&(ae["@direction"]=Z)}return["boolean","number","string"].includes(typeof ue)||(ue=ue.toString()),ae["@value"]=ue,ae}function $(F,B,ue,k){const oe=[],j=Object.keys(B).sort();for(const ae of j){const I=m(F,ae,{vocab:!0},k);let Z=B[ae];e(Z)||(Z=[Z]);for(const ie of Z){if(ie===null)continue;if(!o(ie))throw new i("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:B});const ee={"@value":ie};I!=="@none"&&(ae.match(N)||k.eventHandler&&D({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ae}},options:k}),ee["@language"]=ae.toLowerCase()),ue&&(ee["@direction"]=ue),oe.push(ee)}}return oe}async function X({activeCtx:F,options:B,activeProperty:ue,value:k,asGraph:oe,indexKey:j,propertyIndex:ae}){const I=[],Z=Object.keys(k).sort(),ie=j==="@type";for(let ee of Z){if(ie){const G=_(F,ee,"@context");a(G)||(F=await g({activeCtx:F,localCtx:G,propagate:!1,options:B}))}let me=k[ee];e(me)||(me=[me]),me=await U.expand({activeCtx:F,activeProperty:ue,element:me,options:B,insideList:!1,insideIndex:!0});let W;ae?ee==="@none"?W="@none":W=M({activeCtx:F,activeProperty:j,value:ee,options:B}):W=m(F,ee,{vocab:!0},B),j==="@id"?ee=m(F,ee,{base:!0},B):ie&&(ee=W);for(let G of me){if(oe&&!f(G)&&(G={"@graph":[G]}),j==="@type")W==="@none"||(G["@type"]?G["@type"]=[ee].concat(G["@type"]):G["@type"]=[ee]);else{if(u(G)&&!["@language","@type","@index"].includes(j))throw new i(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${j}".`,"jsonld.SyntaxError",{code:"invalid value object",value:G});ae?W!=="@none"&&R(G,ae,W,{propertyIsArray:!0,prependValue:!0}):W!=="@none"&&!(j in G)&&(G[j]=ee)}I.push(G)}}return I}return za}var Ua,Fd;function eo(){if(Fd)return Ua;Fd=1;const{isKeyword:i}=vi(),e=Pn(),n=zt(),r=Jt(),o=Yt(),a={};return Ua=a,a.createMergedNodeMap=(l,u)=>{u=u||{};const f=u.issuer||new r.IdentifierIssuer("_:b"),h={"@default":{}};return a.createNodeMap(l,h,"@default",f),a.mergeNodeMaps(h)},a.createNodeMap=(l,u,f,h,m,_)=>{if(n.isArray(l)){for(const T of l)a.createNodeMap(T,u,f,h,void 0,_);return}if(!n.isObject(l)){_&&_.push(l);return}if(e.isValue(l)){if("@type"in l){let T=l["@type"];T.indexOf("_:")===0&&(l["@type"]=T=h.getId(T))}_&&_.push(l);return}else if(_&&e.isList(l)){const T=[];a.createNodeMap(l["@list"],u,f,h,m,T),_.push({"@list":T});return}if("@type"in l){const T=l["@type"];for(const N of T)N.indexOf("_:")===0&&h.getId(N)}n.isUndefined(m)&&(m=e.isBlankNode(l)?h.getId(l["@id"]):l["@id"]),_&&_.push({"@id":m});const d=u[f],g=d[m]=d[m]||{};g["@id"]=m;const b=Object.keys(l).sort();for(let T of b){if(T==="@id")continue;if(T==="@reverse"){const A={"@id":m},R=l["@reverse"];for(const S in R){const y=R[S];for(const x of y){let D=x["@id"];e.isBlankNode(x)&&(D=h.getId(D)),a.createNodeMap(x,u,f,h,D),r.addValue(d[D],S,A,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(T==="@graph"){m in u||(u[m]={}),a.createNodeMap(l[T],u,m,h);continue}if(T==="@included"){a.createNodeMap(l[T],u,f,h);continue}if(T!=="@type"&&i(T)){if(T==="@index"&&T in g&&(l[T]!==g[T]||l[T]["@id"]!==g[T]["@id"]))throw new o("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:g});g[T]=l[T];continue}const N=l[T];if(T.indexOf("_:")===0&&(T=h.getId(T)),N.length===0){r.addValue(g,T,[],{propertyIsArray:!0});continue}for(let A of N)if(T==="@type"&&(A=A.indexOf("_:")===0?h.getId(A):A),e.isSubject(A)||e.isSubjectReference(A)){if("@id"in A&&!A["@id"])continue;const R=e.isBlankNode(A)?h.getId(A["@id"]):A["@id"];r.addValue(g,T,{"@id":R},{propertyIsArray:!0,allowDuplicate:!1}),a.createNodeMap(A,u,f,h,R)}else if(e.isValue(A))r.addValue(g,T,A,{propertyIsArray:!0,allowDuplicate:!1});else if(e.isList(A)){const R=[];a.createNodeMap(A["@list"],u,f,h,m,R),A={"@list":R},r.addValue(g,T,A,{propertyIsArray:!0,allowDuplicate:!1})}else a.createNodeMap(A,u,f,h,m),r.addValue(g,T,A,{propertyIsArray:!0,allowDuplicate:!1})}},a.mergeNodeMapGraphs=l=>{const u={};for(const f of Object.keys(l).sort())for(const h of Object.keys(l[f]).sort()){const m=l[f][h];h in u||(u[h]={"@id":h});const _=u[h];for(const d of Object.keys(m).sort())if(i(d)&&d!=="@type")_[d]=r.clone(m[d]);else for(const g of m[d])r.addValue(_,d,r.clone(g),{propertyIsArray:!0,allowDuplicate:!1})}return u},a.mergeNodeMaps=l=>{const u=l["@default"],f=Object.keys(l).sort();for(const h of f){if(h==="@default")continue;const m=l[h];let _=u[h];_?"@graph"in _||(_["@graph"]=[]):u[h]=_={"@id":h,"@graph":[]};const d=_["@graph"];for(const g of Object.keys(m).sort()){const b=m[g];e.isSubjectReference(b)||d.push(b)}}return u},Ua}var Ha,jd;function Dm(){if(jd)return Ha;jd=1;const{isSubjectReference:i}=Pn(),{createMergedNodeMap:e}=eo(),n={};return Ha=n,n.flatten=r=>{const o=e(r),a=[],l=Object.keys(o).sort();for(let u=0;u<l.length;++u){const f=o[l[u]];i(f)||a.push(f)}return a},Ha}var Va,Bd;function Mm(){if(Bd)return Va;Bd=1;const i=Yt(),e=Pn(),n=zt(),{REGEX_BCP47:r,addValue:o}=Jt(),{handleEvent:a}=Zr(),{RDF_LIST:l,RDF_FIRST:u,RDF_REST:f,RDF_NIL:h,RDF_TYPE:m,RDF_JSON_LITERAL:_,XSD_BOOLEAN:d,XSD_DOUBLE:g,XSD_INTEGER:b,XSD_STRING:T}=Zl(),N={};Va=N,N.fromRDF=async(R,S)=>{const{useRdfType:y=!1,useNativeTypes:x=!1,rdfDirection:D=null}=S,U={},O={"@default":U},Q={};if(D){if(D==="compound-literal")throw new i("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:D});if(D!=="i18n-datatype")throw new i("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:D})}for(const X of R){const F=X.graph.termType==="DefaultGraph"?"@default":X.graph.value;F in O||(O[F]={}),F!=="@default"&&!(F in U)&&(U[F]={"@id":F});const B=O[F],ue=X.subject.value,k=X.predicate.value,oe=X.object;ue in B||(B[ue]={"@id":ue});const j=B[ue],ae=oe.termType.endsWith("Node");if(ae&&!(oe.value in B)&&(B[oe.value]={"@id":oe.value}),k===m&&!y&&ae){o(j,"@type",oe.value,{propertyIsArray:!0});continue}const I=A(oe,x,D,S);if(o(j,k,I,{propertyIsArray:!0}),ae)if(oe.value===h){const Z=B[oe.value];"usages"in Z||(Z.usages=[]),Z.usages.push({node:j,property:k,value:I})}else oe.value in Q?Q[oe.value]=!1:Q[oe.value]={node:j,property:k,value:I}}for(const X in O){const F=O[X];if(!(h in F))continue;const B=F[h];if(B.usages){for(let ue of B.usages){let k=ue.node,oe=ue.property,j=ue.value;const ae=[],I=[];let Z=Object.keys(k).length;for(;oe===f&&n.isObject(Q[k["@id"]])&&n.isArray(k[u])&&k[u].length===1&&n.isArray(k[f])&&k[f].length===1&&(Z===3||Z===4&&n.isArray(k["@type"])&&k["@type"].length===1&&k["@type"][0]===l)&&(ae.push(k[u][0]),I.push(k["@id"]),ue=Q[k["@id"]],k=ue.node,oe=ue.property,j=ue.value,Z=Object.keys(k).length,!!e.isBlankNode(k)););delete j["@id"],j["@list"]=ae.reverse();for(const ie of I)delete F[ie]}delete B.usages}}const M=[],$=Object.keys(U).sort();for(const X of $){const F=U[X];if(X in O){const B=F["@graph"]=[],ue=O[X],k=Object.keys(ue).sort();for(const oe of k){const j=ue[oe];e.isSubjectReference(j)||B.push(j)}}e.isSubjectReference(F)||M.push(F)}return M};function A(R,S,y,x){if(R.termType.endsWith("Node"))return{"@id":R.value};const D={"@value":R.value};if(R.language)R.language.match(r)||x.eventHandler&&a({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:R.language}},options:x}),D["@language"]=R.language;else{let U=R.datatype.value;if(U||(U=T),U===_){U="@json";try{D["@value"]=JSON.parse(D["@value"])}catch(O){throw new i("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:D["@value"],cause:O})}}if(S){if(U===d)D["@value"]==="true"?D["@value"]=!0:D["@value"]==="false"&&(D["@value"]=!1);else if(n.isNumeric(D["@value"]))if(U===b){const O=parseInt(D["@value"],10);O.toFixed(0)===D["@value"]&&(D["@value"]=O)}else U===g&&(D["@value"]=parseFloat(D["@value"]));[d,b,g,T].includes(U)||(D["@type"]=U)}else if(y==="i18n-datatype"&&U.startsWith("https://www.w3.org/ns/i18n#")){const[,O,Q]=U.split(/[#_]/);O.length>0&&(D["@language"]=O,O.match(r)||x.eventHandler&&a({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:O}},options:x})),D["@direction"]=Q}else U!==T&&(D["@type"]=U)}return D}return Va}var Ga,$d;function Om(){return $d||($d=1,Ga=function i(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((n,r,o)=>{const a=o===0?"":",",l=r===void 0||typeof r=="symbol"?null:r;return n+a+i(l)},"")+"]":"{"+Object.keys(e).sort().reduce((n,r,o)=>{if(e[r]===void 0||typeof e[r]=="symbol")return n;const a=n.length===0?"":",";return n+a+i(r)+":"+i(e[r])},"")+"}"}),Ga}var Wa,qd;function Fm(){if(qd)return Wa;qd=1;const{createNodeMap:i}=eo(),{isKeyword:e}=vi(),n=Pn(),r=Om(),o=Yt(),a=zt(),l=Jt(),{handleEvent:u}=Zr(),{RDF_FIRST:f,RDF_REST:h,RDF_NIL:m,RDF_TYPE:_,RDF_JSON_LITERAL:d,RDF_LANGSTRING:g,XSD_BOOLEAN:b,XSD_DOUBLE:T,XSD_INTEGER:N,XSD_STRING:A}=Zl(),{isAbsolute:R}=Wn(),S={};Wa=S,S.toRDF=(U,O)=>{const Q=new l.IdentifierIssuer("_:b"),M={"@default":{}};i(U,M,"@default",Q);const $=[],X=Object.keys(M).sort();for(const F of X){let B;if(F==="@default")B={termType:"DefaultGraph",value:""};else if(R(F))F.startsWith("_:")?B={termType:"BlankNode"}:B={termType:"NamedNode"},B.value=F;else{O.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:F}},options:O});continue}y($,M[F],B,Q,O)}return $};function y(U,O,Q,M,$){const X=Object.keys(O).sort();for(const F of X){const B=O[F],ue=Object.keys(B).sort();for(let k of ue){const oe=B[k];if(k==="@type")k=_;else if(e(k))continue;for(const j of oe){const ae={termType:F.startsWith("_:")?"BlankNode":"NamedNode",value:F};if(!R(F)){$.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:F}},options:$});continue}const I={termType:k.startsWith("_:")?"BlankNode":"NamedNode",value:k};if(!R(k)){$.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:k}},options:$});continue}if(I.termType==="BlankNode"&&!$.produceGeneralizedRdf){$.eventHandler&&u({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:M.getOldIds().find(ie=>M.getId(ie)===k)}},options:$});continue}const Z=D(j,M,U,Q,$.rdfDirection,$);Z&&U.push({subject:ae,predicate:I,object:Z,graph:Q})}}}}function x(U,O,Q,M,$,X){const F={termType:"NamedNode",value:f},B={termType:"NamedNode",value:h},ue={termType:"NamedNode",value:m},k=U.pop(),oe=k?{termType:"BlankNode",value:O.getId()}:ue;let j=oe;for(const ae of U){const I=D(ae,O,Q,M,$,X),Z={termType:"BlankNode",value:O.getId()};Q.push({subject:j,predicate:F,object:I,graph:M}),Q.push({subject:j,predicate:B,object:Z,graph:M}),j=Z}if(k){const ae=D(k,O,Q,M,$,X);Q.push({subject:j,predicate:F,object:ae,graph:M}),Q.push({subject:j,predicate:B,object:ue,graph:M})}return oe}function D(U,O,Q,M,$,X){const F={};if(n.isValue(U)){F.termType="Literal",F.value=void 0,F.datatype={termType:"NamedNode"};let B=U["@value"];const ue=U["@type"]||null;if(ue==="@json")F.value=r(B),F.datatype.value=d;else if(a.isBoolean(B))F.value=B.toString(),F.datatype.value=ue||b;else if(a.isDouble(B)||ue===T)a.isDouble(B)||(B=parseFloat(B)),F.value=B.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),F.datatype.value=ue||T;else if(a.isNumber(B))F.value=B.toFixed(0),F.datatype.value=ue||N;else if("@direction"in U&&$==="i18n-datatype"){const k=(U["@language"]||"").toLowerCase(),oe=U["@direction"],j=`https://www.w3.org/ns/i18n#${k}_${oe}`;F.datatype.value=j,F.value=B}else{if("@direction"in U&&$==="compound-literal")throw new o("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:$});if("@direction"in U&&$)throw new o("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:$});"@language"in U?("@direction"in U&&!$&&X.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:F.value}},options:X}),F.value=B,F.datatype.value=ue||g,F.language=U["@language"]):("@direction"in U&&!$&&X.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:F.value}},options:X}),F.value=B,F.datatype.value=ue||A)}}else if(n.isList(U)){const B=x(U["@list"],O,Q,M,$,X);F.termType=B.termType,F.value=B.value}else{const B=a.isObject(U)?U["@id"]:U;F.termType=B.startsWith("_:")?"BlankNode":"NamedNode",F.value=B}return F.termType==="NamedNode"&&!R(F.value)?(X.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:F.value}},options:X}),null):F}return Wa}var Za,zd;function jm(){if(zd)return Za;zd=1;const{isKeyword:i}=vi(),e=Pn(),n=zt(),r=Jt(),o=Wn(),a=Yt(),{createNodeMap:l,mergeNodeMapGraphs:u}=eo(),f={};Za=f,f.frameMergedOrDefault=(y,x,D)=>{const U={options:D,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},O=new r.IdentifierIssuer("_:b");l(y,U.graphMap,"@default",O),D.merged&&(U.graphMap["@merged"]=u(U.graphMap),U.graph="@merged"),U.subjects=U.graphMap[U.graph];const Q=[];f.frame(U,Object.keys(U.subjects).sort(),x,Q),D.pruneBlankNodeIdentifiers&&(D.bnodesToClear=Object.keys(U.bnodeMap).filter(M=>U.bnodeMap[M].length===1));return D.link={},N(Q,D)},f.frame=(y,x,D,U,O=null)=>{d(D),D=D[0];const Q=y.options,M={embed:_(D,Q,"embed"),explicit:_(D,Q,"explicit"),requireAll:_(D,Q,"requireAll")};y.link.hasOwnProperty(y.graph)||(y.link[y.graph]={});const $=y.link[y.graph],X=g(y,x,D,M),F=Object.keys(X).sort();for(const B of F){const ue=X[B];if(O===null?y.uniqueEmbeds={[y.graph]:{}}:y.uniqueEmbeds[y.graph]=y.uniqueEmbeds[y.graph]||{},M.embed==="@link"&&B in $){A(U,O,$[B]);continue}const k={"@id":B};if(B.indexOf("_:")===0&&r.addValue(y.bnodeMap,B,k,{propertyIsArray:!0}),$[B]=k,(M.embed==="@first"||M.embed==="@last")&&y.is11)throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:D});if(!(!y.embedded&&y.uniqueEmbeds[y.graph].hasOwnProperty(B))){if(y.embedded&&(M.embed==="@never"||m(ue,y.graph,y.subjectStack))){A(U,O,k);continue}if(y.embedded&&(M.embed=="@first"||M.embed=="@once")&&y.uniqueEmbeds[y.graph].hasOwnProperty(B)){A(U,O,k);continue}if(M.embed==="@last"&&B in y.uniqueEmbeds[y.graph]&&T(y,B),y.uniqueEmbeds[y.graph][B]={parent:U,property:O},y.subjectStack.push({subject:ue,graph:y.graph}),B in y.graphMap){let oe=!1,j=null;"@graph"in D?(j=D["@graph"][0],oe=!(B==="@merged"||B==="@default"),n.isObject(j)||(j={})):(oe=y.graph!=="@merged",j={}),oe&&f.frame({...y,graph:B,embedded:!1},Object.keys(y.graphMap[B]).sort(),[j],k,"@graph")}"@included"in D&&f.frame({...y,embedded:!1},x,D["@included"],k,"@included");for(const oe of Object.keys(ue).sort()){if(i(oe)){if(k[oe]=r.clone(ue[oe]),oe==="@type")for(const j of ue["@type"])j.indexOf("_:")===0&&r.addValue(y.bnodeMap,j,k,{propertyIsArray:!0});continue}if(!(M.explicit&&!(oe in D)))for(const j of ue[oe]){const ae=oe in D?D[oe]:h(M);if(e.isList(j)){const I=D[oe]&&D[oe][0]&&D[oe][0]["@list"]?D[oe][0]["@list"]:h(M),Z={"@list":[]};A(k,oe,Z);const ie=j["@list"];for(const ee of ie)e.isSubjectReference(ee)?f.frame({...y,embedded:!0},[ee["@id"]],I,Z,"@list"):A(Z,"@list",r.clone(ee))}else e.isSubjectReference(j)?f.frame({...y,embedded:!0},[j["@id"]],ae,k,oe):S(ae[0],j)&&A(k,oe,r.clone(j))}}for(const oe of Object.keys(D).sort()){if(oe==="@type"){if(!n.isObject(D[oe][0])||!("@default"in D[oe][0]))continue}else if(i(oe))continue;const j=D[oe][0]||{};if(!_(j,Q,"omitDefault")&&!(oe in k)){let I="@null";"@default"in j&&(I=r.clone(j["@default"])),n.isArray(I)||(I=[I]),k[oe]=[{"@preserve":I}]}}for(const oe of Object.keys(D["@reverse"]||{}).sort()){const j=D["@reverse"][oe];for(const ae of Object.keys(y.subjects))r.getValues(y.subjects[ae],oe).some(Z=>Z["@id"]===B)&&(k["@reverse"]=k["@reverse"]||{},r.addValue(k["@reverse"],oe,[],{propertyIsArray:!0}),f.frame({...y,embedded:!0},[ae],j,k["@reverse"][oe],O))}A(U,O,k),y.subjectStack.pop()}}},f.cleanupNull=(y,x)=>{if(n.isArray(y))return y.map(U=>f.cleanupNull(U,x)).filter(U=>U);if(y==="@null")return null;if(n.isObject(y)){if("@id"in y){const D=y["@id"];if(x.link.hasOwnProperty(D)){const U=x.link[D].indexOf(y);if(U!==-1)return x.link[D][U];x.link[D].push(y)}else x.link[D]=[y]}for(const D in y)y[D]=f.cleanupNull(y[D],x)}return y};function h(y){const x={};for(const D in y)y[D]!==void 0&&(x["@"+D]=[y[D]]);return[x]}function m(y,x,D){for(let U=D.length-1;U>=0;--U){const O=D[U];if(O.graph===x&&O.subject["@id"]===y["@id"])return!0}return!1}function _(y,x,D){const U="@"+D;let O=U in y?y[U][0]:x[D];if(D==="embed"){if(O===!0)O="@once";else if(O===!1)O="@never";else if(O!=="@always"&&O!=="@never"&&O!=="@link"&&O!=="@first"&&O!=="@last"&&O!=="@once")throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:y})}return O}function d(y){if(!n.isArray(y)||y.length!==1||!n.isObject(y[0]))throw new a("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:y});if("@id"in y[0]){for(const x of r.asArray(y[0]["@id"]))if(!(n.isObject(x)||o.isAbsolute(x))||n.isString(x)&&x.indexOf("_:")===0)throw new a("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}if("@type"in y[0]){for(const x of r.asArray(y[0]["@type"]))if(!(n.isObject(x)||o.isAbsolute(x)||x==="@json")||n.isString(x)&&x.indexOf("_:")===0)throw new a("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}}function g(y,x,D,U){const O={};for(const Q of x){const M=y.graphMap[y.graph][Q];b(y,M,D,U)&&(O[Q]=M)}return O}function b(y,x,D,U){let O=!0,Q=!1;for(const M in D){let $=!1;const X=r.getValues(x,M),F=r.getValues(D,M).length===0;if(M==="@id"){if(n.isEmptyObject(D["@id"][0]||{})?$=!0:D["@id"].length>=0&&($=D["@id"].includes(X[0])),!U.requireAll)return $}else if(M==="@type"){if(O=!1,F){if(X.length>0)return!1;$=!0}else if(D["@type"].length===1&&n.isEmptyObject(D["@type"][0]))$=X.length>0;else for(const B of D["@type"])n.isObject(B)&&"@default"in B?$=!0:$=$||X.some(ue=>ue===B);if(!U.requireAll)return $}else{if(i(M))continue;{const B=r.getValues(D,M)[0];let ue=!1;if(B&&(d([B]),ue="@default"in B),O=!1,X.length===0&&ue)continue;if(X.length>0&&F)return!1;if(B===void 0){if(X.length>0)return!1;$=!0}else if(e.isList(B)){const k=B["@list"][0];if(e.isList(X[0])){const oe=X[0]["@list"];e.isValue(k)?$=oe.some(j=>S(k,j)):(e.isSubject(k)||e.isSubjectReference(k))&&($=oe.some(j=>R(y,k,j,U)))}}else e.isValue(B)?$=X.some(k=>S(B,k)):e.isSubjectReference(B)?$=X.some(k=>R(y,B,k,U)):n.isObject(B)?$=X.length>0:$=!1}}if(!$&&U.requireAll)return!1;Q=Q||$}return O||Q}function T(y,x){const D=y.uniqueEmbeds[y.graph],U=D[x],O=U.parent,Q=U.property,M={"@id":x};if(n.isArray(O)){for(let X=0;X<O.length;++X)if(r.compareValues(O[X],M)){O[X]=M;break}}else{const X=n.isArray(O[Q]);r.removeValue(O,Q,M,{propertyIsArray:X}),r.addValue(O,Q,M,{propertyIsArray:X})}const $=X=>{const F=Object.keys(D);for(const B of F)B in D&&n.isObject(D[B].parent)&&D[B].parent["@id"]===X&&(delete D[B],$(B))};$(x)}function N(y,x){if(n.isArray(y))return y.map(D=>N(D,x));if(n.isObject(y)){if("@preserve"in y)return y["@preserve"][0];if(e.isValue(y))return y;if(e.isList(y))return y["@list"]=N(y["@list"],x),y;if("@id"in y){const D=y["@id"];if(x.link.hasOwnProperty(D)){const U=x.link[D].indexOf(y);if(U!==-1)return x.link[D][U];x.link[D].push(y)}else x.link[D]=[y]}for(const D in y){if(D==="@id"&&x.bnodesToClear.includes(y[D])){delete y["@id"];continue}y[D]=N(y[D],x)}}return y}function A(y,x,D){n.isObject(y)?r.addValue(y,x,D,{propertyIsArray:!0}):y.push(D)}function R(y,x,D,U){if(!("@id"in D))return!1;const O=y.subjects[D["@id"]];return O&&b(y,O,x,U)}function S(y,x){const D=x["@value"],U=x["@type"],O=x["@language"],Q=y["@value"]?n.isArray(y["@value"])?y["@value"]:[y["@value"]]:[],M=y["@type"]?n.isArray(y["@type"])?y["@type"]:[y["@type"]]:[],$=y["@language"]?n.isArray(y["@language"])?y["@language"]:[y["@language"]]:[];return Q.length===0&&M.length===0&&$.length===0?!0:!(!(Q.includes(D)||n.isEmptyObject(Q[0]))||!(!U&&M.length===0||M.includes(U)||U&&n.isEmptyObject(M[0]))||!(!O&&$.length===0||$.includes(O)||O&&n.isEmptyObject($[0])))}return Za}var Xa,Ud;function Bm(){if(Ud)return Xa;Ud=1;const i=Yt(),{isArray:e,isObject:n,isString:r,isUndefined:o}=zt(),{isList:a,isValue:l,isGraph:u,isSimpleGraph:f,isSubjectReference:h}=Pn(),{expandIri:m,getContextValue:_,isKeyword:d,process:g,processingMode:b}=vi(),{removeBase:T,prependBase:N}=Wn(),{REGEX_KEYWORD:A,addValue:R,asArray:S,compareShortestLeast:y}=Jt(),x={};Xa=x,x.compact=async({activeCtx:O,activeProperty:Q=null,element:M,options:$={}})=>{if(e(M)){let F=[];for(let B=0;B<M.length;++B){const ue=await x.compact({activeCtx:O,activeProperty:Q,element:M[B],options:$});ue!==null&&F.push(ue)}return $.compactArrays&&F.length===1&&(_(O,Q,"@container")||[]).length===0&&(F=F[0]),F}const X=_(O,Q,"@context");if(o(X)||(O=await g({activeCtx:O,localCtx:X,propagate:!0,overrideProtected:!0,options:$})),n(M)){if($.link&&"@id"in M&&$.link.hasOwnProperty(M["@id"])){const I=$.link[M["@id"]];for(let Z=0;Z<I.length;++Z)if(I[Z].expanded===M)return I[Z].compacted}if(l(M)||h(M)){const I=x.compactValue({activeCtx:O,activeProperty:Q,value:M,options:$});return $.link&&h(M)&&($.link.hasOwnProperty(M["@id"])||($.link[M["@id"]]=[]),$.link[M["@id"]].push({expanded:M,compacted:I})),I}if(a(M)&&(_(O,Q,"@container")||[]).includes("@list"))return x.compact({activeCtx:O,activeProperty:Q,element:M["@list"],options:$});const F=Q==="@reverse",B={},ue=O;!l(M)&&!h(M)&&(O=O.revertToPreviousContext());const k=_(ue,Q,"@context");o(k)||(O=await g({activeCtx:O,localCtx:k,propagate:!0,overrideProtected:!0,options:$})),$.link&&"@id"in M&&($.link.hasOwnProperty(M["@id"])||($.link[M["@id"]]=[]),$.link[M["@id"]].push({expanded:M,compacted:B}));let oe=M["@type"]||[];oe.length>1&&(oe=Array.from(oe).sort());const j=O;for(const I of oe){const Z=x.compactIri({activeCtx:j,iri:I,relativeTo:{vocab:!0}}),ie=_(ue,Z,"@context");o(ie)||(O=await g({activeCtx:O,localCtx:ie,options:$,propagate:!1}))}const ae=Object.keys(M).sort();for(const I of ae){const Z=M[I];if(I==="@id"){let ie=S(Z).map(me=>x.compactIri({activeCtx:O,iri:me,relativeTo:{vocab:!1},base:$.base}));ie.length===1&&(ie=ie[0]);const ee=x.compactIri({activeCtx:O,iri:"@id",relativeTo:{vocab:!0}});B[ee]=ie;continue}if(I==="@type"){let ie=S(Z).map(Y=>x.compactIri({activeCtx:ue,iri:Y,relativeTo:{vocab:!0}}));ie.length===1&&(ie=ie[0]);const ee=x.compactIri({activeCtx:O,iri:"@type",relativeTo:{vocab:!0}}),G=(_(O,ee,"@container")||[]).includes("@set")&&b(O,1.1)||e(ie)&&Z.length===0;R(B,ee,ie,{propertyIsArray:G});continue}if(I==="@reverse"){const ie=await x.compact({activeCtx:O,activeProperty:"@reverse",element:Z,options:$});for(const ee in ie)if(O.mappings.has(ee)&&O.mappings.get(ee).reverse){const me=ie[ee],G=(_(O,ee,"@container")||[]).includes("@set")||!$.compactArrays;R(B,ee,me,{propertyIsArray:G}),delete ie[ee]}if(Object.keys(ie).length>0){const ee=x.compactIri({activeCtx:O,iri:I,relativeTo:{vocab:!0}});R(B,ee,ie)}continue}if(I==="@preserve"){const ie=await x.compact({activeCtx:O,activeProperty:Q,element:Z,options:$});e(ie)&&ie.length===0||R(B,I,ie);continue}if(I==="@index"){if((_(O,Q,"@container")||[]).includes("@index"))continue;const ee=x.compactIri({activeCtx:O,iri:I,relativeTo:{vocab:!0}});R(B,ee,Z);continue}if(I!=="@graph"&&I!=="@list"&&I!=="@included"&&d(I)){const ie=x.compactIri({activeCtx:O,iri:I,relativeTo:{vocab:!0}});R(B,ie,Z);continue}if(!e(Z))throw new i("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(Z.length===0){const ie=x.compactIri({activeCtx:O,iri:I,value:Z,relativeTo:{vocab:!0},reverse:F}),ee=O.mappings.has(ie)?O.mappings.get(ie)["@nest"]:null;let me=B;ee&&(U(O,ee,$),n(B[ee])||(B[ee]={}),me=B[ee]),R(me,ie,Z,{propertyIsArray:!0})}for(const ie of Z){const ee=x.compactIri({activeCtx:O,iri:I,value:ie,relativeTo:{vocab:!0},reverse:F}),me=O.mappings.has(ee)?O.mappings.get(ee)["@nest"]:null;let W=B;me&&(U(O,me,$),n(B[me])||(B[me]={}),W=B[me]);const G=_(O,ee,"@container")||[],Y=u(ie),K=a(ie);let le;K?le=ie["@list"]:Y&&(le=ie["@graph"]);let ce=await x.compact({activeCtx:O,activeProperty:ee,element:K||Y?le:ie,options:$});if(K)if(e(ce)||(ce=[ce]),!G.includes("@list"))ce={[x.compactIri({activeCtx:O,iri:"@list",relativeTo:{vocab:!0}})]:ce},"@index"in ie&&(ce[x.compactIri({activeCtx:O,iri:"@index",relativeTo:{vocab:!0}})]=ie["@index"]);else{R(W,ee,ce,{valueIsArray:!0,allowDuplicate:!0});continue}if(Y)if(G.includes("@graph")&&(G.includes("@id")||G.includes("@index")&&f(ie))){let Ee;W.hasOwnProperty(ee)?Ee=W[ee]:W[ee]=Ee={};const Te=(G.includes("@id")?ie["@id"]:ie["@index"])||x.compactIri({activeCtx:O,iri:"@none",relativeTo:{vocab:!0}});R(Ee,Te,ce,{propertyIsArray:!$.compactArrays||G.includes("@set")})}else G.includes("@graph")&&f(ie)?(e(ce)&&ce.length>1&&(ce={"@included":ce}),R(W,ee,ce,{propertyIsArray:!$.compactArrays||G.includes("@set")})):(e(ce)&&ce.length===1&&$.compactArrays&&(ce=ce[0]),ce={[x.compactIri({activeCtx:O,iri:"@graph",relativeTo:{vocab:!0}})]:ce},"@id"in ie&&(ce[x.compactIri({activeCtx:O,iri:"@id",relativeTo:{vocab:!0}})]=ie["@id"]),"@index"in ie&&(ce[x.compactIri({activeCtx:O,iri:"@index",relativeTo:{vocab:!0}})]=ie["@index"]),R(W,ee,ce,{propertyIsArray:!$.compactArrays||G.includes("@set")}));else if(G.includes("@language")||G.includes("@index")||G.includes("@id")||G.includes("@type")){let Ee;W.hasOwnProperty(ee)?Ee=W[ee]:W[ee]=Ee={};let Te;if(G.includes("@language"))l(ce)&&(ce=ce["@value"]),Te=ie["@language"];else if(G.includes("@index")){const q=_(O,ee,"@index")||"@index",te=x.compactIri({activeCtx:O,iri:q,relativeTo:{vocab:!0}});if(q==="@index")Te=ie["@index"],delete ce[te];else{let fe;if([Te,...fe]=S(ce[q]||[]),!r(Te))Te=null;else switch(fe.length){case 0:delete ce[q];break;case 1:ce[q]=fe[0];break;default:ce[q]=fe;break}}}else if(G.includes("@id")){const q=x.compactIri({activeCtx:O,iri:"@id",relativeTo:{vocab:!0}});Te=ce[q],delete ce[q]}else if(G.includes("@type")){const q=x.compactIri({activeCtx:O,iri:"@type",relativeTo:{vocab:!0}});let te;switch([Te,...te]=S(ce[q]||[]),te.length){case 0:delete ce[q];break;case 1:ce[q]=te[0];break;default:ce[q]=te;break}Object.keys(ce).length===1&&"@id"in ie&&(ce=await x.compact({activeCtx:O,activeProperty:ee,element:{"@id":ie["@id"]},options:$}))}Te||(Te=x.compactIri({activeCtx:O,iri:"@none",relativeTo:{vocab:!0}})),R(Ee,Te,ce,{propertyIsArray:G.includes("@set")})}else{const Ee=!$.compactArrays||G.includes("@set")||G.includes("@list")||e(ce)&&ce.length===0||I==="@list"||I==="@graph";R(W,ee,ce,{propertyIsArray:Ee})}}}return B}return M},x.compactIri=({activeCtx:O,iri:Q,value:M=null,relativeTo:$={vocab:!1},reverse:X=!1,base:F=null})=>{if(Q===null)return Q;O.isPropertyTermScoped&&O.previousContext&&(O=O.previousContext);const B=O.getInverse();if(d(Q)&&Q in B&&"@none"in B[Q]&&"@type"in B[Q]["@none"]&&"@none"in B[Q]["@none"]["@type"])return B[Q]["@none"]["@type"]["@none"];if($.vocab&&Q in B){const ae=O["@language"]||"@none",I=[];n(M)&&"@index"in M&&!("@graph"in M)&&I.push("@index","@index@set"),n(M)&&"@preserve"in M&&(M=M["@preserve"][0]),u(M)?("@index"in M&&I.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in M&&I.push("@graph@id","@graph@id@set"),I.push("@graph","@graph@set","@set"),"@index"in M||I.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in M||I.push("@graph@id","@graph@id@set")):n(M)&&!l(M)&&I.push("@id","@id@set","@type","@set@type");let Z="@language",ie="@null";if(X)Z="@type",ie="@reverse",I.push("@set");else if(a(M)){"@index"in M||I.push("@list");const me=M["@list"];if(me.length===0)Z="@any",ie="@none";else{let W=me.length===0?ae:null,G=null;for(let Y=0;Y<me.length;++Y){const K=me[Y];let le="@none",ce="@none";if(l(K))if("@direction"in K){const Ee=(K["@language"]||"").toLowerCase(),Te=K["@direction"];le=`${Ee}_${Te}`}else"@language"in K?le=K["@language"].toLowerCase():"@type"in K?ce=K["@type"]:le="@null";else ce="@id";if(W===null?W=le:le!==W&&l(K)&&(W="@none"),G===null?G=ce:ce!==G&&(G="@none"),W==="@none"&&G==="@none")break}W=W||"@none",G=G||"@none",G!=="@none"?(Z="@type",ie=G):ie=W}}else{if(l(M))if("@language"in M&&!("@index"in M)){I.push("@language","@language@set"),ie=M["@language"];const me=M["@direction"];me&&(ie=`${ie}_${me}`)}else"@direction"in M&&!("@index"in M)?ie=`_${M["@direction"]}`:"@type"in M&&(Z="@type",ie=M["@type"]);else Z="@type",ie="@id";I.push("@set")}I.push("@none"),n(M)&&!("@index"in M)&&I.push("@index","@index@set"),l(M)&&Object.keys(M).length===1&&I.push("@language","@language@set");const ee=D(O,Q,M,I,Z,ie);if(ee!==null)return ee}if($.vocab&&"@vocab"in O){const ae=O["@vocab"];if(Q.indexOf(ae)===0&&Q!==ae){const I=Q.substr(ae.length);if(!O.mappings.has(I))return I}}let ue=null;const k=[];let oe=O.fastCurieMap;const j=Q.length-1;for(let ae=0;ae<j&&Q[ae]in oe;++ae)oe=oe[Q[ae]],""in oe&&k.push(oe[""][0]);for(let ae=k.length-1;ae>=0;--ae){const I=k[ae],Z=I.terms;for(const ie of Z){const ee=ie+":"+Q.substr(I.iri.length);O.mappings.get(ie)._prefix&&(!O.mappings.has(ee)||M===null&&O.mappings.get(ee)["@id"]===Q)&&(ue===null||y(ee,ue)<0)&&(ue=ee)}}if(ue!==null)return ue;for(const[ae,I]of O.mappings)if(I&&I._prefix&&Q.startsWith(ae+":"))throw new i(`Absolute IRI "${Q}" confused with prefix "${ae}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:O});if(!$.vocab)if("@base"in O)if(O["@base"]){const ae=T(N(F,O["@base"]),Q);return A.test(ae)?`./${ae}`:ae}else return Q;else return T(F,Q);return Q},x.compactValue=({activeCtx:O,activeProperty:Q,value:M,options:$})=>{if(l(M)){const ue=_(O,Q,"@type"),k=_(O,Q,"@language"),oe=_(O,Q,"@direction"),j=_(O,Q,"@container")||[],ae="@index"in M&&!j.includes("@index");if(!ae&&ue!=="@none"&&(M["@type"]===ue||"@language"in M&&M["@language"]===k&&"@direction"in M&&M["@direction"]===oe||"@language"in M&&M["@language"]===k||"@direction"in M&&M["@direction"]===oe))return M["@value"];const I=Object.keys(M).length,Z=I===1||I===2&&"@index"in M&&!ae,ie="@language"in O,ee=r(M["@value"]),me=O.mappings.has(Q)&&O.mappings.get(Q)["@language"]===null;if(Z&&ue!=="@none"&&(!ie||!ee||me))return M["@value"];const W={};return ae&&(W[x.compactIri({activeCtx:O,iri:"@index",relativeTo:{vocab:!0}})]=M["@index"]),"@type"in M?W[x.compactIri({activeCtx:O,iri:"@type",relativeTo:{vocab:!0}})]=x.compactIri({activeCtx:O,iri:M["@type"],relativeTo:{vocab:!0}}):"@language"in M&&(W[x.compactIri({activeCtx:O,iri:"@language",relativeTo:{vocab:!0}})]=M["@language"]),"@direction"in M&&(W[x.compactIri({activeCtx:O,iri:"@direction",relativeTo:{vocab:!0}})]=M["@direction"]),W[x.compactIri({activeCtx:O,iri:"@value",relativeTo:{vocab:!0}})]=M["@value"],W}const X=m(O,Q,{vocab:!0},$),F=_(O,Q,"@type"),B=x.compactIri({activeCtx:O,iri:M["@id"],relativeTo:{vocab:F==="@vocab"},base:$.base});return F==="@id"||F==="@vocab"||X==="@graph"?B:{[x.compactIri({activeCtx:O,iri:"@id",relativeTo:{vocab:!0}})]:B}};function D(O,Q,M,$,X,F){F===null&&(F="@null");const B=[];if((F==="@id"||F==="@reverse")&&n(M)&&"@id"in M){F==="@reverse"&&B.push("@reverse");const k=x.compactIri({activeCtx:O,iri:M["@id"],relativeTo:{vocab:!0}});O.mappings.has(k)&&O.mappings.get(k)&&O.mappings.get(k)["@id"]===M["@id"]?B.push.apply(B,["@vocab","@id"]):B.push.apply(B,["@id","@vocab"])}else{B.push(F);const k=B.find(oe=>oe.includes("_"));k&&B.push(k.replace(/^[^_]+_/,"_"))}B.push("@none");const ue=O.inverse[Q];for(const k of $){if(!(k in ue))continue;const oe=ue[k][X];for(const j of B)if(j in oe)return oe[j]}return null}function U(O,Q,M){if(m(O,Q,{vocab:!0},M)!=="@nest")throw new i("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}return Xa}var Qa,Hd;function $m(){return Hd||(Hd=1,Qa=i=>{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(n,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):i.compact(n,r)},e.expand=function(n){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):i.expand(n)},e.flatten=function(n){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):i.flatten(n)},e}),Qa}var Ja,Vd;function qm(){if(Vd)return Ja;Vd=1;const i=Wl(),e=Im(),n=Jt(),r=Cm(),o=n.IdentifierIssuer,a=Yt(),l=qf(),u=Pm(),{expand:f}=km(),{flatten:h}=Dm(),{fromRDF:m}=Mm(),{toRDF:_}=Fm(),{frameMergedOrDefault:d,cleanupNull:g}=jm(),{isArray:b,isObject:T,isString:N}=zt(),{isSubjectReference:A}=Pn(),{expandIri:R,getInitialContext:S,process:y,processingMode:x}=vi(),{compact:D,compactIri:U}=Bm(),{createNodeMap:O,createMergedNodeMap:Q,mergeNodeMaps:M}=eo(),{logEventHandler:$,logWarningEventHandler:X,safeEventHandler:F,setDefaultEventHandler:B,setupEventHandler:ue,strictEventHandler:k,unhandledEventHandler:oe}=Zr(),j=function(I){const Z={},ee=new l({max:100});I.compact=async function(W,G,Y){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(G===null)throw new a("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(W===null)return null;Y=me(Y,{base:N(W)?W:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new o("_:b"),contextResolver:new r({sharedCache:ee})}),Y.link&&(Y.skipExpansion=!0),Y.compactToRelative||delete Y.base;let K;Y.skipExpansion?K=W:K=await I.expand(W,Y);const le=await I.processContext(S(Y),G,Y);let ce=await D({activeCtx:le,element:K,options:Y});Y.compactArrays&&!Y.graph&&b(ce)?ce.length===1?ce=ce[0]:ce.length===0&&(ce={}):Y.graph&&T(ce)&&(ce=[ce]),T(G)&&"@context"in G&&(G=G["@context"]),G=n.clone(G),b(G)||(G=[G]);const Ee=G;G=[];for(let q=0;q<Ee.length;++q)(!T(Ee[q])||Object.keys(Ee[q]).length>0)&&G.push(Ee[q]);const Te=G.length>0;if(G.length===1&&(G=G[0]),b(ce)){const q=U({activeCtx:le,iri:"@graph",relativeTo:{vocab:!0}}),te=ce;ce={},Te&&(ce["@context"]=G),ce[q]=te}else if(T(ce)&&Te){const q=ce;ce={"@context":G};for(const te in q)ce[te]=q[te]}return ce},I.expand=async function(W,G){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");G=me(G,{keepFreeFloatingNodes:!1,contextResolver:new r({sharedCache:ee})});const Y={},K=[];if("expandContext"in G){const Te=n.clone(G.expandContext);T(Te)&&"@context"in Te?Y.expandContext=Te:Y.expandContext={"@context":Te},K.push(Y.expandContext)}let le;if(!N(W))Y.input=n.clone(W);else{const Te=await I.get(W,G);le=Te.documentUrl,Y.input=Te.document,Te.contextUrl&&(Y.remoteContext={"@context":Te.contextUrl},K.push(Y.remoteContext))}"base"in G||(G.base=le||"");let ce=S(G);for(const Te of K)ce=await y({activeCtx:ce,localCtx:Te,options:G});let Ee=await f({activeCtx:ce,element:Y.input,options:G});return T(Ee)&&"@graph"in Ee&&Object.keys(Ee).length===1?Ee=Ee["@graph"]:Ee===null&&(Ee=[]),b(Ee)||(Ee=[Ee]),Ee},I.flatten=async function(W,G,Y){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");typeof G=="function"?G=null:G=G||null,Y=me(Y,{base:N(W)?W:"",contextResolver:new r({sharedCache:ee})});const K=await I.expand(W,Y),le=h(K);return G===null?le:(Y.graph=!0,Y.skipExpansion=!0,await I.compact(le,G,Y))},I.frame=async function(W,G,Y){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Y=me(Y,{base:N(W)?W:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new r({sharedCache:ee})}),N(G)){const xe=await I.get(G,Y);if(G=xe.document,xe.contextUrl){let Se=G["@context"];Se?b(Se)?Se.push(xe.contextUrl):Se=[Se,xe.contextUrl]:Se=xe.contextUrl,G["@context"]=Se}}const K=G?G["@context"]||{}:{},le=await I.processContext(S(Y),K,Y);Y.hasOwnProperty("omitGraph")||(Y.omitGraph=x(le,1.1)),Y.hasOwnProperty("pruneBlankNodeIdentifiers")||(Y.pruneBlankNodeIdentifiers=x(le,1.1));const ce=await I.expand(W,Y),Ee={...Y};Ee.isFrame=!0,Ee.keepFreeFloatingNodes=!0;const Te=await I.expand(G,Ee),q=Object.keys(G).map(xe=>R(le,xe,{vocab:!0}));Ee.merged=!q.includes("@graph"),Ee.is11=x(le,1.1);const te=d(ce,Te,Ee);Ee.graph=!Y.omitGraph,Ee.skipExpansion=!0,Ee.link={},Ee.framing=!0;let fe=await I.compact(te,K,Ee);return Ee.link={},fe=g(fe,Ee),fe},I.link=async function(W,G,Y){const K={};return G&&(K["@context"]=G),K["@embed"]="@link",I.frame(W,K,Y)},I.normalize=I.canonize=async function(W,G){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if(G=me(G,{base:N(W)?W:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new r({sharedCache:ee})}),"inputFormat"in G){if(G.inputFormat!=="application/n-quads"&&G.inputFormat!=="application/nquads")throw new a("Unknown canonicalization input format.","jsonld.CanonizeError");const le=u.parse(W);return i.canonize(le,G)}const Y={...G};delete Y.format,Y.produceGeneralizedRdf=!1;const K=await I.toRDF(W,Y);return i.canonize(K,G)},I.fromRDF=async function(W,G){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");G=me(G,{format:N(W)?"application/n-quads":void 0});const{format:Y}=G;let{rdfParser:K}=G;if(Y){if(K=K||Z[Y],!K)throw new a("Unknown input format.","jsonld.UnknownFormat",{format:Y})}else K=()=>W;const le=await K(W);return m(le,G)},I.toRDF=async function(W,G){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");G=me(G,{base:N(W)?W:"",skipExpansion:!1,contextResolver:new r({sharedCache:ee})});let Y;G.skipExpansion?Y=W:Y=await I.expand(W,G);const K=_(Y,G);if(G.format){if(G.format==="application/n-quads"||G.format==="application/nquads")return u.serialize(K);throw new a("Unknown output format.","jsonld.UnknownFormat",{format:G.format})}return K},I.createNodeMap=async function(W,G){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");G=me(G,{base:N(W)?W:"",contextResolver:new r({sharedCache:ee})});const Y=await I.expand(W,G);return Q(Y,G)},I.merge=async function(W,G,Y){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!b(W))throw new TypeError('Could not merge, "docs" must be an array.');typeof G=="function"?G=null:G=G||null,Y=me(Y,{contextResolver:new r({sharedCache:ee})});const K=await Promise.all(W.map(xe=>{const Se={...Y};return I.expand(xe,Se)}));let le=!0;"mergeNodes"in Y&&(le=Y.mergeNodes);const ce=Y.issuer||new o("_:b"),Ee={"@default":{}};for(let xe=0;xe<K.length;++xe){const Se=n.relabelBlankNodes(K[xe],{issuer:new o("_:b"+xe+"-")}),Ie=le||xe===0?Ee:{"@default":{}};if(O(Se,Ie,"@default",ce),Ie!==Ee)for(const se in Ie){const be=Ie[se];if(!(se in Ee)){Ee[se]=be;continue}const Ne=Ee[se];for(const ve in be)ve in Ne||(Ne[ve]=be[ve])}}const Te=M(Ee),q=[],te=Object.keys(Te).sort();for(let xe=0;xe<te.length;++xe){const Se=Te[te[xe]];A(Se)||q.push(Se)}return G===null?q:(Y.graph=!0,Y.skipExpansion=!0,await I.compact(q,G,Y))},Object.defineProperty(I,"documentLoader",{get:()=>I._documentLoader,set:W=>I._documentLoader=W}),I.documentLoader=async W=>{throw new a("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:W})},I.get=async function(W,G){let Y;typeof G.documentLoader=="function"?Y=G.documentLoader:Y=I.documentLoader;const K=await Y(W);try{if(!K.document)throw new a("No remote document found at the given URL.","jsonld.NullRemoteDocument");N(K.document)&&(K.document=JSON.parse(K.document))}catch(le){throw new a("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:le,remoteDoc:K})}return K},I.processContext=async function(W,G,Y){return Y=me(Y,{base:"",contextResolver:new r({sharedCache:ee})}),G===null?S(Y):(G=n.clone(G),T(G)&&"@context"in G||(G={"@context":G}),y({activeCtx:W,localCtx:G,options:Y}))},I.getContextValue=vi().getContextValue,I.documentLoaders={},I.useDocumentLoader=function(W){if(!(W in I.documentLoaders))throw new a('Unknown document loader type: "'+W+'"',"jsonld.UnknownDocumentLoader",{type:W});I.documentLoader=I.documentLoaders[W].apply(I,Array.prototype.slice.call(arguments,1))},I.registerRDFParser=function(W,G){Z[W]=G},I.unregisterRDFParser=function(W){delete Z[W]},I.registerRDFParser("application/n-quads",u.parse),I.registerRDFParser("application/nquads",u.parse),I.url=Wn(),I.logEventHandler=$,I.logWarningEventHandler=X,I.safeEventHandler=F,I.setDefaultEventHandler=B,I.strictEventHandler=k,I.unhandledEventHandler=oe,I.util=n,Object.assign(I,n),I.promises=I,I.RequestQueue=$f(),I.JsonLdProcessor=$m()(I),e.setupGlobals(I),e.setupDocumentLoaders(I);function me(W,{documentLoader:G=I.documentLoader,...Y}){if(W&&"compactionMap"in W)throw new a('"compactionMap" not supported.',"jsonld.OptionsError");if(W&&"expansionMap"in W)throw new a('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:G},Y,W,{eventHandler:ue({options:W})})}return I},ae=function(){return j(function(){return ae()})};return j(ae),Ja=ae,Ja}var zm=qm();const Um=sf(zm),xs={},Ka={},zi={};async function Hm(i){const e={store:new It,importedUrls:[],importedClasses:[],atts:i},n=[];if(i.shapes?n.push(pi(js(i.shapes),e,gi)):i.shapesUrl&&n.push(pi(Ns(i.shapesUrl,e.atts.proxy),e,gi)),i.values?n.push(pi(js(i.values),e,$t)):i.valuesUrl&&n.push(pi(Ns(i.valuesUrl,e.atts.proxy),e,$t)),await Promise.all(n),i.valuesSubject&&e.store.countQuads(null,null,null,gi)===0){const r=[...e.store.getObjects(i.valuesSubject,Nt,$t),...e.store.getObjects(i.valuesSubject,Os,$t)],o=[];for(const a of r){const l=zf(a.value);l&&e.importedUrls.indexOf(l)<0&&(e.importedUrls.push(l),o.push(pi(Ns(l,e.atts.proxy),e,gi)))}try{await Promise.allSettled(o)}catch(a){console.warn(a)}}return e.store}async function pi(i,e,n){const r=await i,o=[];for(const a of r){let l=n;if(e.atts.valuesSubject&&$t.equals(n)&&a.graph.id&&a.graph.id!==e.atts.valuesSubject&&(l=a.graph),e.store.add(new Gs(a.subject,a.predicate,a.object,l)),zl.equals(a.predicate)&&e.atts.loadOwlImports){const u=zf(a.object.value);u&&e.importedUrls.indexOf(u)<0&&(e.importedUrls.push(u),o.push(pi(Ns(u,e.atts.proxy),e,ze.namedNode(u))))}if(e.atts.classInstanceProvider&&(Ul.equals(a.predicate)||Ks.equals(a.predicate))){const u=a.object.value;if(e.importedClasses.indexOf(u)<0){let f;u in Ka?f=Ka[u]:(f=e.atts.classInstanceProvider(u),Ka[u]=f),e.importedClasses.push(u),o.push(pi(js(await f),e,gi))}}}await Promise.allSettled(o)}async function Ns(i,e){return i in xs||(xs[i]=new Promise(async(n,r)=>{try{let o=i;e&&(o=e+encodeURIComponent(i));const a=await fetch(o,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then(l=>l.text());n(await js(a))}catch(o){r(o)}})),xs[i]}async function js(i){if(Gd(i)==="json")try{i=await Um.toRDF(JSON.parse(i),{format:"application/n-quads"})}catch(n){console.error(n)}const e=[];return await new Promise((n,r)=>{const o=Gd(i)==="xml"?new ym.RdfXmlParser:new Xg;o.on("data",a=>{e.push(new Gs(a.subject,a.predicate,a.object,a.graph))}).on("error",a=>{r(a)}).on("prefix",(a,l)=>{a&&(zi[a]=l)}).on("end",()=>{n(null)}),o.write(i),o.end()}),e}function zf(i){if(Ll(i))return i;const e=i.split(":");if(e.length===2){const n=zi[e[0]];if(n&&(i=i.replace(`${e[0]}:`,n),Ll(i)))return i}return null}function Gd(i){return/^\s*\{/.test(i)?"json":/^\s*<\?xml/.test(i)?"xml":"ttl"}const Vm={[`${Fe}name`]:(i,e)=>{const n=e;i.name=Fs(i.config.languages,i.name,n)},[`${Fe}description`]:(i,e)=>{const n=e;i.description=Fs(i.config.languages,i.description,n)},[`${Fe}path`]:(i,e)=>{i.path=e.value},[`${Fe}group`]:(i,e)=>{i.group=e.id},[`${Fe}datatype`]:(i,e)=>{i.datatype=e},[`${Fe}nodeKind`]:(i,e)=>{i.nodeKind=e},[`${Fe}minCount`]:(i,e)=>{i.minCount=parseInt(e.value)},[`${Fe}maxCount`]:(i,e)=>{i.maxCount=parseInt(e.value)},[`${Fe}minLength`]:(i,e)=>{i.minLength=parseInt(e.value)},[`${Fe}maxLength`]:(i,e)=>{i.maxLength=parseInt(e.value)},[`${Fe}minInclusive`]:(i,e)=>{i.minInclusive=parseInt(e.value)},[`${Fe}maxInclusive`]:(i,e)=>{i.maxInclusive=parseInt(e.value)},[`${Fe}minExclusive`]:(i,e)=>{i.minExclusive=parseInt(e.value)},[`${Fe}maxExclusive`]:(i,e)=>{i.maxExclusive=parseInt(e.value)},[`${Fe}pattern`]:(i,e)=>{i.pattern=e.value},[`${Fe}order`]:(i,e)=>{i.order=parseInt(e.value)},[`${qc}singleLine`]:(i,e)=>{i.singleLine=e.value==="true"},[`${qc}readonly`]:(i,e)=>{i.readonly=e.value==="true"},[`${Jg}styleClass`]:(i,e)=>{i.cssClass=e.value},[`${Fe}in`]:(i,e)=>{i.in=e.value},[`${Fe}languageIn`]:(i,e)=>{i.languageIn=i.config.lists[e.value],i.datatype=Tf},[`${Fe}defaultValue`]:(i,e)=>{i.defaultValue=e},[`${Fe}hasValue`]:(i,e)=>{i.hasValue=e},[`${Fe}node`]:(i,e)=>{i.node=e,i.nodeShapes.add(i.config.getNodeTemplate(e,i))},[`${Fe}and`]:(i,e)=>{i.and=e.value;const n=i.config.lists[i.and];if(n?.length)for(const r of n)i.nodeShapes.add(i.config.getNodeTemplate(r,i))},[`${Fe}qualifiedValueShape`]:(i,e)=>{const n=i.config.getNodeTemplate(e,i);i.qualifiedValueShape=n,i.nodeShapes.add(n)},[`${Fe}qualifiedMinCount`]:(i,e)=>{i.qualifiedMinCount=parseInt(e.value)},[`${Fe}qualifiedMaxCount`]:(i,e)=>{i.qualifiedMaxCount=parseInt(e.value)},[zl.id]:(i,e)=>{i.owlImports.add(e)},[Ul.id]:(i,e)=>{i.class=e;const n=i.config.store.getSubjects(Ks,e,null);n.length>0&&(i.node=n[0])},[`${Fe}or`]:(i,e)=>{const n=i.config.lists[e.value];n?.length?i.or=n:console.error("list for sh:or not found:",e.value,"existing lists:",i.config.lists)},[`${Fe}xone`]:(i,e)=>{const n=i.config.lists[e.value];n?.length?i.xone=n:console.error("list for sh:xone not found:",e.value,"existing lists:",i.config.lists)}};class Wd{constructor(e,n){this.label="",this.nodeShapes=new Set,this.owlImports=new Set,this.id=e,this.parent=n,this.config=n.config,this.config.registerPropertyTemplate(this),Xl(this,this.config.store.getQuads(e,null,null,null))}}function yi(i){return Math.max(i.minCount||0,i.qualifiedMinCount||0)}function Uf(i){const e=Object.assign({},i);return e.nodeShapes=new Set(i.nodeShapes),e.owlImports=new Set(i.owlImports),i.languageIn&&(e.languageIn=[...i.languageIn]),i.or&&(e.or=[...i.or]),i.xone&&(e.xone=[...i.xone]),e}function Xl(i,e){for(const n of e)Vm[n.predicate.id]?.call(i,i,n.object);return i.label=i.name?.value||Qi(e,i.config.languages),i.label||(i.label=i.path?Tl(i.path,zi):"unknown"),i}function Hf(i,e){const n=e,r=i;for(const o in e)o!=="parent"&&o!=="config"&&o!=="id"&&n[o]!==void 0&&n[o]!==""&&(Array.isArray(n[o])?r[o].push(...n[o]):n[o]instanceof Set&&n[o].size?r[o]=new Set([...r[o],...n[o]]):r[o]=n[o])}function Vf(i,e,n){const r=document.createElement("div");r.classList.add("shacl-or-constraint");const o=[];if(e instanceof Ti){const a=[];let l=!1;i.length&&(l=n.store.countQuads(i[0],Sl,null,null)>0);for(let h=0;h<i.length;h++)if(l){const m=n.store.getObjects(i[h],Sl,null),_=[];let d="";for(const g of m){const b=n.getPropertyTemplate(g,e.template),T=new zs(b,e);_.push(T),d+=(d.length>1?" / ":"")+T.template.label}a.push(_),o.push({label:d,value:h.toString()})}else{const m=i[h],_=n.getPropertyTemplate(m,e.template),d=new zs(_,e);a.push([d]),o.push({label:d.template.label,value:h.toString()})}const u=n.theme.createListEditor("Please choose",null,!1,o),f=u.querySelector(".editor");f.onchange=()=>{if(f.value){const h=a[parseInt(f.value)];let m;h.length&&(m=h[0],r.replaceWith(h[0]));for(let _=1;_<h.length;_++)m.after(h[_]),m=h[_]}},r.appendChild(u)}else{const a=[];for(let f=0;f<i.length;f++){const h=n.store.getQuads(i[f],null,null,null);h.length&&(a.push(h),o.push({label:Qi(h,n.languages)||Tl(h[0].predicate.value,zi)+" = "+Tl(h[0].object.value,zi),value:f.toString()}))}const l=n.theme.createListEditor(e.template.label+"?",null,!1,o,e.template),u=l.querySelector(".editor");u.onchange=()=>{if(u.value){const f=Xl(Uf(e.template),a[parseInt(u.value)]);r.replaceWith(Rl(f,void 0,!0))}},r.appendChild(l)}return r}function Gm(i,e,n){if(e instanceof Qt){const r=e.datatype;for(const o of i){const a=n.store.getQuads(o,null,null,null);for(const l of a)if(l.predicate.value===`${Fe}datatype`&&l.object.equals(r))return a}}else{const r=n.store.getObjects(e,Nt,null);for(const o of i){const a=n.store.getQuads(o,null,null,null);for(const l of a)if(r.length>0){if(l.predicate.value===`${Fe}node`){for(const u of r)if(n.store.getQuads(l.object,Ks,u,null).length>0)return a}if(l.predicate.equals(Ul)){for(const u of r)if(l.object.equals(u))return a}}else if(l.predicate.equals(tm)&&l.object.equals(Lf))return a}}return console.error("couldn't resolve sh:or/sh:xone on property for value",e),[]}function Wm(i,e,n){for(const r of i){let o=!1;const a=n.store.getObjects(r,Sl,null);for(const l of a){const u=n.store.getObjects(l,`${Fe}path`,null);for(const f of u)if(o=n.store.countQuads(e,f,null,null)>0,o)break}if(o)return a}return console.error("couldn't resolve sh:or/sh:xone on node for value",e),[]}const Zm=`form { display:block; --label-width: 8em; --caret-size: 10px; }
34
- form.mode-edit { padding-left: 1em; }
35
- form, form * { box-sizing: border-box; }
36
- shacl-node, .collapsible::part(content) { display: flex; flex-direction: column; width: 100%; position: relative; }
37
- shacl-node .remove-button { margin-top: 1px; }
38
- shacl-node .add-button { color: #555; background-color: transparent; margin: 4px 24px 0 0; border: 0; }
39
- shacl-node .add-button:hover { color:#222; }
40
- shacl-node .add-button:focus { box-shadow: none; }
41
- shacl-node h1 { font-size: 16px; border-bottom: 1px solid #AAA; margin-top: 4px; color: #555; }
42
- shacl-property:not(:has(>.collapsible)), shacl-property>.collapsible::part(content) { display: flex; flex-direction: column; align-items: end; position: relative; }
43
- shacl-property:not(.may-add) > .add-button, shacl-property:not(.may-add) > .collapsible > .add-button { display: none; }
44
- shacl-property:not(.may-remove) > .property-instance > .remove-button:not(.persistent) { visibility: hidden; }
45
- shacl-property:not(.may-remove) > .collapsible > .property-instance > .remove-button:not(.persistent) { visibility: hidden; }
46
- shacl-property:not(.may-remove) > .shacl-or-constraint > .remove-button:not(.persistent) { visibility: hidden; }
47
- .mode-view .shacl-group:not(:has(shacl-property)) { display: none; }
48
- .property-instance, .shacl-or-constraint { display: flex; align-items: flex-start; padding: 4px 0; width: 100%; position: relative; }
49
- .shacl-or-constraint > div { display: flex; align-items: flex-start; }
50
- .shacl-or-constraint > div:first-child { flex-grow: 1 }
51
- .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; }
52
- .property-instance label[title] { cursor: help; text-decoration: underline dashed #AAA; }
53
- .property-instance.linked label:after, label.linked:after { content: '\\1F517'; font-size: 0.6em; padding-left: 6px; }
54
- .mode-edit .property-instance label.required::before { color: red; content: '\\2736'; font-size: 0.6rem; position: absolute; left: -1.4em; top: 0.15rem; }
55
- .property-instance.valid::before { content: ''; position: absolute; left: calc(var(--label-width) - 1em); top:0.5em; width: 0.9em; height: 0.9em; background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1024 1024" fill="green" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M866.133333 258.133333L362.666667 761.6l-204.8-204.8L98.133333 618.666667 362.666667 881.066667l563.2-563.2z"/></svg>'); }
56
- .editor:not([type='checkbox']) { flex-grow: 1; }
57
- textarea.editor { resize: vertical; }
58
- .lang-chooser { border: 0; background-color: #e9e9ed; padding: 2px 4px; align-self: flex-start; }
59
- .validation-error { position: absolute; left: calc(var(--label-width) - 1em); color: red; cursor: help; }
60
- .validation-error::before { content: '\\26a0' }
61
- .validation-error.node { left: -1em; }
62
- .invalid > .editor { border-color: red !important; }
63
- .ml-0 { margin-left: 0 !important; }
64
- .pr-0 { padding-right: 0 !important; }
65
- .mode-view .property-instance:not(:first-child) > label { visibility: hidden; }
66
- .mode-view .property-instance label { width: var(--label-width); }
67
-
68
- .d-flex { display: flex; }
69
- .lang { opacity: 0.65; font-size: 0.6em; }
70
- a, a:visited { color: inherit; }
71
- h3 { margin-top: 0; }
72
-
73
- .fadeIn, .fadeOut { animation: fadeIn 0.2s ease-out; }
74
- .fadeOut { animation-direction: reverse; animation-timing-function: ease-out;}
75
- @keyframes fadeIn {
76
- 0% { opacity: 0; transform: scaleY(0.8); }
77
- 100% { opacity: 1; transform: scaleY(1); }
78
- }
79
- .collapsible::part(label) { font-weight: 600; }
80
- .collapsible > .property-instance:nth-child(even) { background-color: #F8F8F8; }
81
- .collapsible > .property-instance > shacl-node > h1 { display: none; }
82
- .ref-link { cursor: pointer; }
83
- .ref-link:hover { text-decoration: underline; }
84
- .node-id-display { color: #999; font-size: 11px; }
85
- /* hierarchy colors */
86
- .colorize { --hierarchy-color-width: 3px; padding: 0 1px 0 calc(1px + var(--hierarchy-color-width)); align-self: stretch; position: relative; }
87
- .colorize::before {
88
- content: '';
89
- position: absolute;
90
- width: var(--hierarchy-color-width);
91
- top: 0; bottom: 0; left: 0;
92
- --index: mod(var(--hierarchy-level), var(--hierarchy-colors-length));
93
- background: linear-gradient(var(--hierarchy-colors)) no-repeat 0 calc(var(--index) * 100% / (var(--hierarchy-colors-length) - 1)) / 100% calc(1px * infinity);
94
- }
95
- .property-instance:not(:has(shacl-node)) > .colorize::before { background: 0; }
96
- .mode-view .property-instance > .colorize { order: -1; padding-left: calc(8px + var(--hierarchy-color-width)); }`;class Xm{constructor(e){this.dense=!0;let n=Zm;e&&(n+=`
33
+ `;case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(N)return String.fromCharCode(parseInt(N,16));if(A)throw new Error("Unsupported U escape")})}return va}var ba,fd;function jf(){if(fd)return ba;fd=1;const i=Vl(),e=Ys(),n=Ff(),r=Gl();ba=class{constructor({createMessageDigest:l=()=>new e("sha256"),canonicalIdMap:u=new Map,maxDeepIterations:f=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n",u),this.createMessageDigest=l,this.maxDeepIterations=f,this.quads=null,this.deepIterations=null}async main(l){this.deepIterations=new Map,this.quads=l;for(const g of l)this._addBlankNodeQuadInfo({quad:g,component:g.subject}),this._addBlankNodeQuadInfo({quad:g,component:g.object}),this._addBlankNodeQuadInfo({quad:g,component:g.graph});const u=new Map,f=[...this.blankNodeInfo.keys()];let h=0;for(const g of f)++h%100===0&&await this._yield(),await this._hashAndTrackBlankNode({id:g,hashToBlankNodes:u});const m=[...u.keys()].sort(),_=[];for(const g of m){const b=u.get(g);if(b.length>1){_.push(b);continue}const T=b[0];this.canonicalIssuer.getId(T)}for(const g of _){const b=[];for(const T of g){if(this.canonicalIssuer.hasId(T))continue;const N=new i("_:b");N.getId(T);const A=await this.hashNDegreeQuads(T,N);b.push(A)}b.sort(o);for(const T of b){const N=T.issuer.getOldIds();for(const A of N)this.canonicalIssuer.getId(A)}}const d=[];for(const g of this.quads){const b=r.serializeQuadComponents(this._componentWithCanonicalId(g.subject),g.predicate,this._componentWithCanonicalId(g.object),this._componentWithCanonicalId(g.graph));d.push(b)}return d.sort(),d.join("")}async hashFirstDegreeQuads(l){const u=[],f=this.blankNodeInfo.get(l),h=f.quads;for(const _ of h){const d={subject:null,predicate:_.predicate,object:null,graph:null};d.subject=this.modifyFirstDegreeComponent(l,_.subject,"subject"),d.object=this.modifyFirstDegreeComponent(l,_.object,"object"),d.graph=this.modifyFirstDegreeComponent(l,_.graph,"graph"),u.push(r.serializeQuad(d))}u.sort();const m=this.createMessageDigest();for(const _ of u)m.update(_);return f.hash=await m.digest(),f.hash}async hashRelatedBlankNode(l,u,f,h){let m;this.canonicalIssuer.hasId(l)?m=this.canonicalIssuer.getId(l):f.hasId(l)?m=f.getId(l):m=this.blankNodeInfo.get(l).hash;const _=this.createMessageDigest();return _.update(h),h!=="g"&&_.update(this.getRelatedPredicate(u)),_.update(m),_.digest()}async hashNDegreeQuads(l,u){const f=this.deepIterations.get(l)||0;if(f>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(l,f+1);const h=this.createMessageDigest(),m=await this.createHashToRelated(l,u),_=[...m.keys()].sort();for(const d of _){h.update(d);let g="",b;const T=new n(m.get(d));let N=0;for(;T.hasNext();){const A=T.next();++N%3===0&&await this._yield();let R=u.clone(),S="";const y=[];let x=!1;for(const D of A)if(this.canonicalIssuer.hasId(D)?S+=this.canonicalIssuer.getId(D):(R.hasId(D)||y.push(D),S+=R.getId(D)),g.length!==0&&S>g){x=!0;break}if(!x){for(const D of y){const U=await this.hashNDegreeQuads(D,R);if(S+=R.getId(D),S+=`<${U.hash}>`,R=U.issuer,g.length!==0&&S>g){x=!0;break}}x||(g.length===0||S<g)&&(g=S,b=R)}}h.update(g),u=b}return{hash:await h.digest(),issuer:u}}modifyFirstDegreeComponent(l,u){return u.termType!=="BlankNode"?u:{termType:"BlankNode",value:u.value===l?"_:a":"_:z"}}getRelatedPredicate(l){return`<${l.predicate.value}>`}async createHashToRelated(l,u){const f=new Map,h=this.blankNodeInfo.get(l).quads;let m=0;for(const _ of h)++m%100===0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:_,component:_.subject,position:"s",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:_,component:_.object,position:"o",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:_,component:_.graph,position:"g",id:l,issuer:u,hashToRelated:f})]);return f}async _hashAndTrackBlankNode({id:l,hashToBlankNodes:u}){const f=await this.hashFirstDegreeQuads(l),h=u.get(f);h?h.push(l):u.set(f,[l])}_addBlankNodeQuadInfo({quad:l,component:u}){if(u.termType!=="BlankNode")return;const f=u.value,h=this.blankNodeInfo.get(f);h?h.quads.add(l):this.blankNodeInfo.set(f,{quads:new Set([l]),hash:null})}async _addRelatedBlankNodeHash({quad:l,component:u,position:f,id:h,issuer:m,hashToRelated:_}){if(!(u.termType==="BlankNode"&&u.value!==h))return;const d=u.value,g=await this.hashRelatedBlankNode(d,l,m,f),b=_.get(g);b?b.push(d):_.set(g,[d])}_componentWithCanonicalId(l){return l.termType==="BlankNode"&&!l.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(l.value)}:l}async _yield(){return new Promise(l=>setImmediate(l))}};function o(a,l){return a.hash<l.hash?-1:a.hash>l.hash?1:0}return ba}var wa,pd;function bm(){if(pd)return wa;pd=1;const i=Ys(),e=jf();return wa=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new i("sha1")}modifyFirstDegreeComponent(r,o,a){return o.termType!=="BlankNode"?o:a==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:o.value===r?"_:a":"_:z"}}getRelatedPredicate(r){return r.predicate.value}async createHashToRelated(r,o){const a=new Map,l=this.blankNodeInfo.get(r).quads;let u=0;for(const f of l){let h,m;if(f.subject.termType==="BlankNode"&&f.subject.value!==r)m=f.subject.value,h="p";else if(f.object.termType==="BlankNode"&&f.object.value!==r)m=f.object.value,h="r";else continue;++u%100===0&&await this._yield();const _=await this.hashRelatedBlankNode(m,f,o,h),d=a.get(_);d?d.push(m):a.set(_,[m])}return a}},wa}var xa,gd;function Bf(){if(gd)return xa;gd=1;const i=Vl(),e=Ys(),n=Ff(),r=Gl();xa=class{constructor({createMessageDigest:l=()=>new e("sha256"),canonicalIdMap:u=new Map,maxDeepIterations:f=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n",u),this.createMessageDigest=l,this.maxDeepIterations=f,this.quads=null,this.deepIterations=null}main(l){this.deepIterations=new Map,this.quads=l;for(const d of l)this._addBlankNodeQuadInfo({quad:d,component:d.subject}),this._addBlankNodeQuadInfo({quad:d,component:d.object}),this._addBlankNodeQuadInfo({quad:d,component:d.graph});const u=new Map,f=[...this.blankNodeInfo.keys()];for(const d of f)this._hashAndTrackBlankNode({id:d,hashToBlankNodes:u});const h=[...u.keys()].sort(),m=[];for(const d of h){const g=u.get(d);if(g.length>1){m.push(g);continue}const b=g[0];this.canonicalIssuer.getId(b)}for(const d of m){const g=[];for(const b of d){if(this.canonicalIssuer.hasId(b))continue;const T=new i("_:b");T.getId(b);const N=this.hashNDegreeQuads(b,T);g.push(N)}g.sort(o);for(const b of g){const T=b.issuer.getOldIds();for(const N of T)this.canonicalIssuer.getId(N)}}const _=[];for(const d of this.quads){const g=r.serializeQuadComponents(this._componentWithCanonicalId({component:d.subject}),d.predicate,this._componentWithCanonicalId({component:d.object}),this._componentWithCanonicalId({component:d.graph}));_.push(g)}return _.sort(),_.join("")}hashFirstDegreeQuads(l){const u=[],f=this.blankNodeInfo.get(l),h=f.quads;for(const _ of h){const d={subject:null,predicate:_.predicate,object:null,graph:null};d.subject=this.modifyFirstDegreeComponent(l,_.subject,"subject"),d.object=this.modifyFirstDegreeComponent(l,_.object,"object"),d.graph=this.modifyFirstDegreeComponent(l,_.graph,"graph"),u.push(r.serializeQuad(d))}u.sort();const m=this.createMessageDigest();for(const _ of u)m.update(_);return f.hash=m.digest(),f.hash}hashRelatedBlankNode(l,u,f,h){let m;this.canonicalIssuer.hasId(l)?m=this.canonicalIssuer.getId(l):f.hasId(l)?m=f.getId(l):m=this.blankNodeInfo.get(l).hash;const _=this.createMessageDigest();return _.update(h),h!=="g"&&_.update(this.getRelatedPredicate(u)),_.update(m),_.digest()}hashNDegreeQuads(l,u){const f=this.deepIterations.get(l)||0;if(f>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(l,f+1);const h=this.createMessageDigest(),m=this.createHashToRelated(l,u),_=[...m.keys()].sort();for(const d of _){h.update(d);let g="",b;const T=new n(m.get(d));for(;T.hasNext();){const N=T.next();let A=u.clone(),R="";const S=[];let y=!1;for(const x of N)if(this.canonicalIssuer.hasId(x)?R+=this.canonicalIssuer.getId(x):(A.hasId(x)||S.push(x),R+=A.getId(x)),g.length!==0&&R>g){y=!0;break}if(!y){for(const x of S){const D=this.hashNDegreeQuads(x,A);if(R+=A.getId(x),R+=`<${D.hash}>`,A=D.issuer,g.length!==0&&R>g){y=!0;break}}y||(g.length===0||R<g)&&(g=R,b=A)}}h.update(g),u=b}return{hash:h.digest(),issuer:u}}modifyFirstDegreeComponent(l,u){return u.termType!=="BlankNode"?u:{termType:"BlankNode",value:u.value===l?"_:a":"_:z"}}getRelatedPredicate(l){return`<${l.predicate.value}>`}createHashToRelated(l,u){const f=new Map,h=this.blankNodeInfo.get(l).quads;for(const m of h)this._addRelatedBlankNodeHash({quad:m,component:m.subject,position:"s",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:m,component:m.object,position:"o",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:m,component:m.graph,position:"g",id:l,issuer:u,hashToRelated:f});return f}_hashAndTrackBlankNode({id:l,hashToBlankNodes:u}){const f=this.hashFirstDegreeQuads(l),h=u.get(f);h?h.push(l):u.set(f,[l])}_addBlankNodeQuadInfo({quad:l,component:u}){if(u.termType!=="BlankNode")return;const f=u.value,h=this.blankNodeInfo.get(f);h?h.quads.add(l):this.blankNodeInfo.set(f,{quads:new Set([l]),hash:null})}_addRelatedBlankNodeHash({quad:l,component:u,position:f,id:h,issuer:m,hashToRelated:_}){if(!(u.termType==="BlankNode"&&u.value!==h))return;const d=u.value,g=this.hashRelatedBlankNode(d,l,m,f),b=_.get(g);b?b.push(d):_.set(g,[d])}_componentWithCanonicalId({component:l}){return l.termType==="BlankNode"&&!l.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(l.value)}:l}};function o(a,l){return a.hash<l.hash?-1:a.hash>l.hash?1:0}return xa}var Ea,md;function wm(){if(md)return Ea;md=1;const i=Ys(),e=Bf();return Ea=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new i("sha1")}modifyFirstDegreeComponent(r,o,a){return o.termType!=="BlankNode"?o:a==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:o.value===r?"_:a":"_:z"}}getRelatedPredicate(r){return r.predicate.value}createHashToRelated(r,o){const a=new Map,l=this.blankNodeInfo.get(r).quads;for(const u of l){let f,h;if(u.subject.termType==="BlankNode"&&u.subject.value!==r)h=u.subject.value,f="p";else if(u.object.termType==="BlankNode"&&u.object.value!==r)h=u.object.value,f="r";else continue;const m=this.hashRelatedBlankNode(h,u,o,f),_=a.get(m);_?_.push(h):a.set(m,[h])}return a}},Ea}const xm={},Em=Object.freeze(Object.defineProperty({__proto__:null,default:xm},Symbol.toStringTag,{value:"Module"})),Sm=Eg(Em);var _d;function Tm(){return _d||(_d=1,(function(i){const e=jf(),n=bm(),r=Bf(),o=wm();let a;try{a=Sm}catch{}function l(u){return Array.isArray(u)?u:i.NQuads.legacyDatasetToQuads(u)}i.NQuads=Gl(),i.IdentifierIssuer=Vl(),i._rdfCanonizeNative=function(u){return u&&(a=u),a},i.canonize=async function(u,f){const h=l(u);if(f.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(f.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((m,_)=>a.canonize(h,f,(d,g)=>d?_(d):m(g)))}if(f.algorithm==="URDNA2015")return new e(f).main(h);if(f.algorithm==="URGNA2012"){if(f.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new n(f).main(h)}throw"algorithm"in f?new Error("Invalid RDF Dataset Canonicalization algorithm: "+f.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")},i._canonizeSync=function(u,f){const h=l(u);if(f.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(f.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return a.canonizeSync(h,f)}if(f.algorithm==="URDNA2015")return new r(f).main(h);if(f.algorithm==="URGNA2012"){if(f.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new o(f).main(h)}throw"algorithm"in f?new Error("Invalid RDF Dataset Canonicalization algorithm: "+f.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}})(pa)),pa}var Sa,yd;function Wl(){return yd||(yd=1,Sa=Tm()),Sa}var Ta,vd;function zt(){if(vd)return Ta;vd=1;const i={};return Ta=i,i.isArray=Array.isArray,i.isBoolean=e=>typeof e=="boolean"||Object.prototype.toString.call(e)==="[object Boolean]",i.isDouble=e=>i.isNumber(e)&&(String(e).indexOf(".")!==-1||Math.abs(e)>=1e21),i.isEmptyObject=e=>i.isObject(e)&&Object.keys(e).length===0,i.isNumber=e=>typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]",i.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),i.isObject=e=>Object.prototype.toString.call(e)==="[object Object]",i.isString=e=>typeof e=="string"||Object.prototype.toString.call(e)==="[object String]",i.isUndefined=e=>typeof e>"u",Ta}var La,bd;function Pn(){if(bd)return La;bd=1;const i=zt(),e={};return La=e,e.isSubject=n=>i.isObject(n)&&!("@value"in n||"@set"in n||"@list"in n)?Object.keys(n).length>1||!("@id"in n):!1,e.isSubjectReference=n=>i.isObject(n)&&Object.keys(n).length===1&&"@id"in n,e.isValue=n=>i.isObject(n)&&"@value"in n,e.isList=n=>i.isObject(n)&&"@list"in n,e.isGraph=n=>i.isObject(n)&&"@graph"in n&&Object.keys(n).filter(r=>r!=="@id"&&r!=="@index").length===1,e.isSimpleGraph=n=>e.isGraph(n)&&!("@id"in n),e.isBlankNode=n=>{if(i.isObject(n)){if("@id"in n){const r=n["@id"];return!i.isString(r)||r.indexOf("_:")===0}return Object.keys(n).length===0||!("@value"in n||"@set"in n||"@list"in n)}return!1},La}var Ia,wd;function Yt(){return wd||(wd=1,Ia=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",n="jsonld.Error",r={}){super(e),this.name=n,this.message=e,this.details=r}}),Ia}var Na,xd;function Jt(){if(xd)return Na;xd=1;const i=Pn(),e=zt(),n=Wl().IdentifierIssuer,r=Yt(),o=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,u=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,f=/^@[a-zA-Z]+$/,h={headers:{accept:"application/ld+json, application/json"}},m={};Na=m,m.IdentifierIssuer=n,m.REGEX_BCP47=o,m.REGEX_KEYWORD=f,m.clone=function(d){if(d&&typeof d=="object"){let g;if(e.isArray(d)){g=[];for(let b=0;b<d.length;++b)g[b]=m.clone(d[b])}else if(d instanceof Map){g=new Map;for(const[b,T]of d)g.set(b,m.clone(T))}else if(d instanceof Set){g=new Set;for(const b of d)g.add(m.clone(b))}else if(e.isObject(d)){g={};for(const b in d)g[b]=m.clone(d[b])}else g=d.toString();return g}return d},m.asArray=function(d){return Array.isArray(d)?d:[d]},m.buildHeaders=(d={})=>{if(Object.keys(d).some(b=>b.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+h.headers.accept+'" is supported.');return Object.assign({Accept:h.headers.accept},d)},m.parseLinkHeader=d=>{const g={},b=d.match(a);for(let T=0;T<b.length;++T){let N=b[T].match(l);if(!N)continue;const A={target:N[1]},R=N[2];for(;N=u.exec(R);)A[N[1]]=N[2]===void 0?N[3]:N[2];const S=A.rel||"";Array.isArray(g[S])?g[S].push(A):g.hasOwnProperty(S)?g[S]=[g[S],A]:g[S]=A}return g},m.validateTypeValue=(d,g)=>{if(!e.isString(d)&&!(e.isArray(d)&&d.every(b=>e.isString(b)))){if(g&&e.isObject(d))switch(Object.keys(d).length){case 0:return;case 1:if("@default"in d&&m.asArray(d["@default"]).every(b=>e.isString(b)))return}throw new r('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:d})}},m.hasProperty=(d,g)=>{if(d.hasOwnProperty(g)){const b=d[g];return!e.isArray(b)||b.length>0}return!1},m.hasValue=(d,g,b)=>{if(m.hasProperty(d,g)){let T=d[g];const N=i.isList(T);if(e.isArray(T)||N){N&&(T=T["@list"]);for(let A=0;A<T.length;++A)if(m.compareValues(b,T[A]))return!0}else if(!e.isArray(b))return m.compareValues(b,T)}return!1},m.addValue=(d,g,b,T)=>{if(T=T||{},"propertyIsArray"in T||(T.propertyIsArray=!1),"valueIsArray"in T||(T.valueIsArray=!1),"allowDuplicate"in T||(T.allowDuplicate=!0),"prependValue"in T||(T.prependValue=!1),T.valueIsArray)d[g]=b;else if(e.isArray(b)){b.length===0&&T.propertyIsArray&&!d.hasOwnProperty(g)&&(d[g]=[]),T.prependValue&&(b=b.concat(d[g]),d[g]=[]);for(let N=0;N<b.length;++N)m.addValue(d,g,b[N],T)}else if(d.hasOwnProperty(g)){const N=!T.allowDuplicate&&m.hasValue(d,g,b);!e.isArray(d[g])&&(!N||T.propertyIsArray)&&(d[g]=[d[g]]),N||(T.prependValue?d[g].unshift(b):d[g].push(b))}else d[g]=T.propertyIsArray?[b]:b},m.getValues=(d,g)=>[].concat(d[g]||[]),m.removeProperty=(d,g)=>{delete d[g]},m.removeValue=(d,g,b,T)=>{T=T||{},"propertyIsArray"in T||(T.propertyIsArray=!1);const N=m.getValues(d,g).filter(A=>!m.compareValues(A,b));N.length===0?m.removeProperty(d,g):N.length===1&&!T.propertyIsArray?d[g]=N[0]:d[g]=N},m.relabelBlankNodes=(d,g)=>{g=g||{};const b=g.issuer||new n("_:b");return _(b,d)},m.compareValues=(d,g)=>d===g||i.isValue(d)&&i.isValue(g)&&d["@value"]===g["@value"]&&d["@type"]===g["@type"]&&d["@language"]===g["@language"]&&d["@index"]===g["@index"]?!0:e.isObject(d)&&"@id"in d&&e.isObject(g)&&"@id"in g?d["@id"]===g["@id"]:!1,m.compareShortestLeast=(d,g)=>d.length<g.length?-1:g.length<d.length?1:d===g?0:d<g?-1:1;function _(d,g){if(e.isArray(g))for(let b=0;b<g.length;++b)g[b]=_(d,g[b]);else if(i.isList(g))g["@list"]=_(d,g["@list"]);else if(e.isObject(g)){i.isBlankNode(g)&&(g["@id"]=d.getId(g["@id"]));const b=Object.keys(g).sort();for(let T=0;T<b.length;++T){const N=b[T];N!=="@id"&&(g[N]=_(d,g[N]))}}return g}return Na}var Aa,Ed;function Zl(){if(Ed)return Aa;Ed=1;const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",e="http://www.w3.org/2001/XMLSchema#";return Aa={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:i,RDF_LIST:i+"List",RDF_FIRST:i+"first",RDF_REST:i+"rest",RDF_NIL:i+"nil",RDF_TYPE:i+"type",RDF_PLAIN_LITERAL:i+"PlainLiteral",RDF_XML_LITERAL:i+"XMLLiteral",RDF_JSON_LITERAL:i+"JSON",RDF_OBJECT:i+"object",RDF_LANGSTRING:i+"langString",XSD:e,XSD_BOOLEAN:e+"boolean",XSD_DOUBLE:e+"double",XSD_INTEGER:e+"integer",XSD_STRING:e+"string"},Aa}var Ra,Sd;function $f(){return Sd||(Sd=1,Ra=class{constructor(){this._requests={}}wrapLoader(e){const n=this;return n._loader=e,function(){return n.add.apply(n,arguments)}}async add(e){let n=this._requests[e];if(n)return Promise.resolve(n);n=this._requests[e]=this._loader(e);try{return await n}finally{delete this._requests[e]}}}),Ra}var Ca,Td;function Wn(){if(Td)return Ca;Td=1;const i=zt(),e={};Ca=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=(r,o)=>{const a={},l=e.parsers[o||"full"],u=l.regex.exec(r);let f=l.keys.length;for(;f--;)a[l.keys[f]]=u[f]===void 0?null:u[f];return(a.scheme==="https"&&a.port==="443"||a.scheme==="http"&&a.port==="80")&&(a.href=a.href.replace(":"+a.port,""),a.authority=a.authority.replace(":"+a.port,""),a.port=null),a.normalizedPath=e.removeDotSegments(a.path),a},e.prependBase=(r,o)=>{if(r===null||e.isAbsolute(o))return o;(!r||i.isString(r))&&(r=e.parse(r||""));const a=e.parse(o),l={protocol:r.protocol||""};if(a.authority!==null)l.authority=a.authority,l.path=a.path,l.query=a.query;else if(l.authority=r.authority,a.path==="")l.path=r.path,a.query!==null?l.query=a.query:l.query=r.query;else{if(a.path.indexOf("/")===0)l.path=a.path;else{let f=r.path;f=f.substr(0,f.lastIndexOf("/")+1),(f.length>0||r.authority)&&f.substr(-1)!=="/"&&(f+="/"),f+=a.path,l.path=f}l.query=a.query}a.path!==""&&(l.path=e.removeDotSegments(l.path));let u=l.protocol;return l.authority!==null&&(u+="//"+l.authority),u+=l.path,l.query!==null&&(u+="?"+l.query),a.fragment!==null&&(u+="#"+a.fragment),u===""&&(u="./"),u},e.removeBase=(r,o)=>{if(r===null)return o;(!r||i.isString(r))&&(r=e.parse(r||""));let a="";if(r.href!==""?a+=(r.protocol||"")+"//"+(r.authority||""):o.indexOf("//")&&(a+="//"),o.indexOf(a)!==0)return o;const l=e.parse(o.substr(a.length)),u=r.normalizedPath.split("/"),f=l.normalizedPath.split("/"),h=l.fragment||l.query?0:1;for(;u.length>0&&f.length>h&&u[0]===f[0];)u.shift(),f.shift();let m="";if(u.length>0){u.pop();for(let _=0;_<u.length;++_)m+="../"}return m+=f.join("/"),l.query!==null&&(m+="?"+l.query),l.fragment!==null&&(m+="#"+l.fragment),m===""&&(m="./"),m},e.removeDotSegments=r=>{if(r.length===0)return"";const o=r.split("/"),a=[];for(;o.length>0;){const l=o.shift(),u=o.length===0;if(l==="."){u&&a.push("");continue}if(l===".."){a.pop(),u&&a.push("");continue}a.push(l)}return r[0]==="/"&&a.length>0&&a[0]!==""&&a.unshift(""),a.length===1&&a[0]===""?"/":a.join("/")};const n=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;return e.isAbsolute=r=>i.isString(r)&&n.test(r),e.isRelative=r=>i.isString(r),Ca}var Pa,Ld;function Lm(){if(Ld)return Pa;Ld=1;const{parseLinkHeader:i,buildHeaders:e}=Jt(),{LINK_HEADER_CONTEXT:n}=Zl(),r=Yt(),o=$f(),{prependBase:a}=Wn(),l=/(^|(\r\n))link:/i;Pa=({secure:f,headers:h={},xhr:m}={headers:{}})=>{return h=e(h),new o().wrapLoader(d);async function d(g){if(g.indexOf("http:")!==0&&g.indexOf("https:")!==0)throw new r('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:g});if(f&&g.indexOf("https")!==0)throw new r(`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 b;try{b=await u(m,g,h)}catch(S){throw new r("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:g,cause:S})}if(b.status>=400)throw new r("URL could not be dereferenced: "+b.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:g,httpStatusCode:b.status});let T={contextUrl:null,documentUrl:g,document:b.response},N=null;const A=b.getResponseHeader("Content-Type");let R;if(l.test(b.getAllResponseHeaders())&&(R=b.getResponseHeader("Link")),R&&A!=="application/ld+json"){const S=i(R),y=S[n];if(Array.isArray(y))throw new r("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:g});y&&(T.contextUrl=y.target),N=S.alternate,N&&N.type=="application/ld+json"&&!(A||"").match(/^application\/(\w*\+)?json$/)&&(T=await d(a(g,N.target)))}return T}};function u(f,h,m){f=f||XMLHttpRequest;const _=new f;return new Promise((d,g)=>{_.onload=()=>d(_),_.onerror=b=>g(b),_.open("GET",h,!0);for(const b in m)_.setRequestHeader(b,m[b]);_.send()})}return Pa}var ka,Id;function Im(){if(Id)return ka;Id=1;const i=Lm(),e={};return ka=e,e.setupDocumentLoaders=function(n){typeof XMLHttpRequest<"u"&&(n.documentLoaders.xhr=i,n.useDocumentLoader("xhr"))},e.setupGlobals=function(n){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:n.JsonLdProcessor})},ka}var Da,Nd;function Nm(){return Nd||(Nd=1,Da=function(i){i.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Da}var Ma,Ad;function Am(){if(Ad)return Ma;Ad=1,Ma=i,i.Node=o,i.create=i;function i(a){var l=this;if(l instanceof i||(l=new i),l.tail=null,l.head=null,l.length=0,a&&typeof a.forEach=="function")a.forEach(function(h){l.push(h)});else if(arguments.length>0)for(var u=0,f=arguments.length;u<f;u++)l.push(arguments[u]);return l}i.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var l=a.next,u=a.prev;return l&&(l.prev=u),u&&(u.next=l),a===this.head&&(this.head=l),a===this.tail&&(this.tail=u),a.list.length--,a.next=null,a.prev=null,a.list=null,l},i.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var l=this.head;a.list=this,a.next=l,l&&(l.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},i.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var l=this.tail;a.list=this,a.prev=l,l&&(l.next=a),this.tail=a,this.head||(this.head=a),this.length++}},i.prototype.push=function(){for(var a=0,l=arguments.length;a<l;a++)n(this,arguments[a]);return this.length},i.prototype.unshift=function(){for(var a=0,l=arguments.length;a<l;a++)r(this,arguments[a]);return this.length},i.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},i.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},i.prototype.forEach=function(a,l){l=l||this;for(var u=this.head,f=0;u!==null;f++)a.call(l,u.value,f,this),u=u.next},i.prototype.forEachReverse=function(a,l){l=l||this;for(var u=this.tail,f=this.length-1;u!==null;f--)a.call(l,u.value,f,this),u=u.prev},i.prototype.get=function(a){for(var l=0,u=this.head;u!==null&&l<a;l++)u=u.next;if(l===a&&u!==null)return u.value},i.prototype.getReverse=function(a){for(var l=0,u=this.tail;u!==null&&l<a;l++)u=u.prev;if(l===a&&u!==null)return u.value},i.prototype.map=function(a,l){l=l||this;for(var u=new i,f=this.head;f!==null;)u.push(a.call(l,f.value,this)),f=f.next;return u},i.prototype.mapReverse=function(a,l){l=l||this;for(var u=new i,f=this.tail;f!==null;)u.push(a.call(l,f.value,this)),f=f.prev;return u},i.prototype.reduce=function(a,l){var u,f=this.head;if(arguments.length>1)u=l;else if(this.head)f=this.head.next,u=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=0;f!==null;h++)u=a(u,f.value,h),f=f.next;return u},i.prototype.reduceReverse=function(a,l){var u,f=this.tail;if(arguments.length>1)u=l;else if(this.tail)f=this.tail.prev,u=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=this.length-1;f!==null;h--)u=a(u,f.value,h),f=f.prev;return u},i.prototype.toArray=function(){for(var a=new Array(this.length),l=0,u=this.head;u!==null;l++)a[l]=u.value,u=u.next;return a},i.prototype.toArrayReverse=function(){for(var a=new Array(this.length),l=0,u=this.tail;u!==null;l++)a[l]=u.value,u=u.prev;return a},i.prototype.slice=function(a,l){l=l||this.length,l<0&&(l+=this.length),a=a||0,a<0&&(a+=this.length);var u=new i;if(l<a||l<0)return u;a<0&&(a=0),l>this.length&&(l=this.length);for(var f=0,h=this.head;h!==null&&f<a;f++)h=h.next;for(;h!==null&&f<l;f++,h=h.next)u.push(h.value);return u},i.prototype.sliceReverse=function(a,l){l=l||this.length,l<0&&(l+=this.length),a=a||0,a<0&&(a+=this.length);var u=new i;if(l<a||l<0)return u;a<0&&(a=0),l>this.length&&(l=this.length);for(var f=this.length,h=this.tail;h!==null&&f>l;f--)h=h.prev;for(;h!==null&&f>a;f--,h=h.prev)u.push(h.value);return u},i.prototype.splice=function(a,l,...u){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var f=0,h=this.head;h!==null&&f<a;f++)h=h.next;for(var m=[],f=0;h&&f<l;f++)m.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var f=0;f<u.length;f++)h=e(this,h,u[f]);return m},i.prototype.reverse=function(){for(var a=this.head,l=this.tail,u=a;u!==null;u=u.prev){var f=u.prev;u.prev=u.next,u.next=f}return this.head=l,this.tail=a,this};function e(a,l,u){var f=l===a.head?new o(u,null,l,a):new o(u,l,l.next,a);return f.next===null&&(a.tail=f),f.prev===null&&(a.head=f),a.length++,f}function n(a,l){a.tail=new o(l,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function r(a,l){a.head=new o(l,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function o(a,l,u,f){if(!(this instanceof o))return new o(a,l,u,f);this.list=f,this.value=a,l?(l.next=this,this.prev=l):this.prev=null,u?(u.prev=this,this.next=u):this.next=null}try{Nm()(i)}catch{}return Ma}var Oa,Rd;function qf(){if(Rd)return Oa;Rd=1;const i=Am(),e=Symbol("max"),n=Symbol("length"),r=Symbol("lengthCalculator"),o=Symbol("allowStale"),a=Symbol("maxAge"),l=Symbol("dispose"),u=Symbol("noDisposeOnSet"),f=Symbol("lruList"),h=Symbol("cache"),m=Symbol("updateAgeOnGet"),_=()=>1;class d{constructor(y){if(typeof y=="number"&&(y={max:y}),y||(y={}),y.max&&(typeof y.max!="number"||y.max<0))throw new TypeError("max must be a non-negative number");this[e]=y.max||1/0;const x=y.length||_;if(this[r]=typeof x!="function"?_:x,this[o]=y.stale||!1,y.maxAge&&typeof y.maxAge!="number")throw new TypeError("maxAge must be a number");this[a]=y.maxAge||0,this[l]=y.dispose,this[u]=y.noDisposeOnSet||!1,this[m]=y.updateAgeOnGet||!1,this.reset()}set max(y){if(typeof y!="number"||y<0)throw new TypeError("max must be a non-negative number");this[e]=y||1/0,T(this)}get max(){return this[e]}set allowStale(y){this[o]=!!y}get allowStale(){return this[o]}set maxAge(y){if(typeof y!="number")throw new TypeError("maxAge must be a non-negative number");this[a]=y,T(this)}get maxAge(){return this[a]}set lengthCalculator(y){typeof y!="function"&&(y=_),y!==this[r]&&(this[r]=y,this[n]=0,this[f].forEach(x=>{x.length=this[r](x.value,x.key),this[n]+=x.length})),T(this)}get lengthCalculator(){return this[r]}get length(){return this[n]}get itemCount(){return this[f].length}rforEach(y,x){x=x||this;for(let D=this[f].tail;D!==null;){const U=D.prev;R(this,y,D,x),D=U}}forEach(y,x){x=x||this;for(let D=this[f].head;D!==null;){const U=D.next;R(this,y,D,x),D=U}}keys(){return this[f].toArray().map(y=>y.key)}values(){return this[f].toArray().map(y=>y.value)}reset(){this[l]&&this[f]&&this[f].length&&this[f].forEach(y=>this[l](y.key,y.value)),this[h]=new Map,this[f]=new i,this[n]=0}dump(){return this[f].map(y=>b(this,y)?!1:{k:y.key,v:y.value,e:y.now+(y.maxAge||0)}).toArray().filter(y=>y)}dumpLru(){return this[f]}set(y,x,D){if(D=D||this[a],D&&typeof D!="number")throw new TypeError("maxAge must be a number");const U=D?Date.now():0,O=this[r](x,y);if(this[h].has(y)){if(O>this[e])return N(this,this[h].get(y)),!1;const $=this[h].get(y).value;return this[l]&&(this[u]||this[l](y,$.value)),$.now=U,$.maxAge=D,$.value=x,this[n]+=O-$.length,$.length=O,this.get(y),T(this),!0}const Q=new A(y,x,O,U,D);return Q.length>this[e]?(this[l]&&this[l](y,x),!1):(this[n]+=Q.length,this[f].unshift(Q),this[h].set(y,this[f].head),T(this),!0)}has(y){if(!this[h].has(y))return!1;const x=this[h].get(y).value;return!b(this,x)}get(y){return g(this,y,!0)}peek(y){return g(this,y,!1)}pop(){const y=this[f].tail;return y?(N(this,y),y.value):null}del(y){N(this,this[h].get(y))}load(y){this.reset();const x=Date.now();for(let D=y.length-1;D>=0;D--){const U=y[D],O=U.e||0;if(O===0)this.set(U.k,U.v);else{const Q=O-x;Q>0&&this.set(U.k,U.v,Q)}}}prune(){this[h].forEach((y,x)=>g(this,x,!1))}}const g=(S,y,x)=>{const D=S[h].get(y);if(D){const U=D.value;if(b(S,U)){if(N(S,D),!S[o])return}else x&&(S[m]&&(D.value.now=Date.now()),S[f].unshiftNode(D));return U.value}},b=(S,y)=>{if(!y||!y.maxAge&&!S[a])return!1;const x=Date.now()-y.now;return y.maxAge?x>y.maxAge:S[a]&&x>S[a]},T=S=>{if(S[n]>S[e])for(let y=S[f].tail;S[n]>S[e]&&y!==null;){const x=y.prev;N(S,y),y=x}},N=(S,y)=>{if(y){const x=y.value;S[l]&&S[l](x.key,x.value),S[n]-=x.length,S[h].delete(x.key),S[f].removeNode(y)}};class A{constructor(y,x,D,U,O){this.key=y,this.value=x,this.length=D,this.now=U,this.maxAge=O||0}}const R=(S,y,x,D)=>{let U=x.value;b(S,U)&&(N(S,x),S[o]||(U=void 0)),U&&y.call(D,U.value,U.key,S)};return Oa=d,Oa}var Fa,Cd;function Rm(){if(Cd)return Fa;Cd=1;const i=qf(),e=10;return Fa=class{constructor({document:r}){this.document=r,this.cache=new i({max:e})}getProcessed(r){return this.cache.get(r)}setProcessed(r,o){this.cache.set(r,o)}},Fa}var ja,Pd;function Cm(){if(Pd)return ja;Pd=1;const{isArray:i,isObject:e,isString:n}=zt(),{asArray:r}=Jt(),{prependBase:o}=Wn(),a=Yt(),l=Rm(),u=10;ja=class{constructor({sharedCache:_}){this.perOpCache=new Map,this.sharedCache=_}async resolve({activeCtx:_,context:d,documentLoader:g,base:b,cycles:T=new Set}){d&&e(d)&&d["@context"]&&(d=d["@context"]),d=r(d);const N=[];for(const A of d){if(n(A)){let y=this._get(A);y||(y=await this._resolveRemoteContext({activeCtx:_,url:A,documentLoader:g,base:b,cycles:T})),i(y)?N.push(...y):N.push(y);continue}if(A===null){N.push(new l({document:null}));continue}e(A)||f(d);const R=JSON.stringify(A);let S=this._get(R);S||(S=new l({document:A}),this._cacheResolvedContext({key:R,resolved:S,tag:"static"})),N.push(S)}return N}_get(_){let d=this.perOpCache.get(_);if(!d){const g=this.sharedCache.get(_);g&&(d=g.get("static"),d&&this.perOpCache.set(_,d))}return d}_cacheResolvedContext({key:_,resolved:d,tag:g}){if(this.perOpCache.set(_,d),g!==void 0){let b=this.sharedCache.get(_);b||(b=new Map,this.sharedCache.set(_,b)),b.set(g,d)}return d}async _resolveRemoteContext({activeCtx:_,url:d,documentLoader:g,base:b,cycles:T}){d=o(b,d);const{context:N,remoteDoc:A}=await this._fetchContext({activeCtx:_,url:d,documentLoader:g,cycles:T});b=A.documentUrl||d,h({context:N,base:b});const R=await this.resolve({activeCtx:_,context:N,documentLoader:g,base:b,cycles:T});return this._cacheResolvedContext({key:d,resolved:R,tag:A.tag}),R}async _fetchContext({activeCtx:_,url:d,documentLoader:g,cycles:b}){if(b.size>u)throw new a("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:_.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:u});if(b.has(d))throw new a("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:_.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:d});b.add(d);let T,N;try{N=await g(d),T=N.document||null,n(T)&&(T=JSON.parse(T))}catch(A){throw new a(`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: "${d}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:d,cause:A})}if(!e(T))throw new a(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${d}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:d});return"@context"in T?T={"@context":T["@context"]}:T={"@context":{}},N.contextUrl&&(i(T["@context"])||(T["@context"]=[T["@context"]]),T["@context"].push(N.contextUrl)),{context:T,remoteDoc:N}}};function f(m){throw new a("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:m})}function h({context:m,base:_}){if(!m)return;const d=m["@context"];if(n(d)){m["@context"]=o(_,d);return}if(i(d)){for(let g=0;g<d.length;++g){const b=d[g];if(n(b)){d[g]=o(_,b);continue}e(b)&&h({context:{"@context":b},base:_})}return}if(e(d))for(const g in d)h({context:d[g],base:_})}return ja}var Ba,kd;function Pm(){return kd||(kd=1,Ba=Wl().NQuads),Ba}var $a,Dd;function Zr(){if(Dd)return $a;Dd=1;const i=Yt(),{isArray:e}=zt(),{asArray:n}=Jt(),r={};$a=r,r.defaultEventHandler=null,r.setupEventHandler=({options:l={}})=>{const u=[].concat(l.safe?r.safeEventHandler:[],l.eventHandler?n(l.eventHandler):[],r.defaultEventHandler?r.defaultEventHandler:[]);return u.length===0?null:u},r.handleEvent=({event:l,options:u})=>{o({event:l,handlers:u.eventHandler})};function o({event:l,handlers:u}){let f=!0;for(let h=0;f&&h<u.length;++h){f=!1;const m=u[h];if(e(m))f=o({event:l,handlers:m});else if(typeof m=="function")m({event:l,next:()=>{f=!0}});else if(typeof m=="object")l.code in m?m[l.code]({event:l,next:()=>{f=!0}}):f=!0;else throw new i("Invalid event handler.","jsonld.InvalidEventHandler",{event:l})}return f}const a=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 r.safeEventHandler=function({event:u,next:f}){if(u.level==="warning"&&a.has(u.code))throw new i("Safe mode validation error.","jsonld.ValidationError",{event:u});f()},r.logEventHandler=function({event:u,next:f}){console.log(`EVENT: ${u.message}`,{event:u}),f()},r.logWarningEventHandler=function({event:u,next:f}){u.level==="warning"&&console.warn(`WARNING: ${u.message}`,{event:u}),f()},r.unhandledEventHandler=function({event:u}){throw new i("No handler for event.","jsonld.UnhandledEvent",{event:u})},r.setDefaultEventHandler=function({eventHandler:l}={}){r.defaultEventHandler=l?n(l):null},$a}var qa,Md;function vi(){if(Md)return qa;Md=1;const i=Jt(),e=Yt(),{isArray:n,isObject:r,isString:o,isUndefined:a}=zt(),{isAbsolute:l,isRelative:u,prependBase:f}=Wn(),{handleEvent:h}=Zr(),{REGEX_BCP47:m,REGEX_KEYWORD:_,asArray:d,compareShortestLeast:g}=Jt(),b=new Map,T=1e4,N={};qa=N,N.process=async({activeCtx:S,localCtx:y,options:x,propagate:D=!0,overrideProtected:U=!1,cycles:O=new Set})=>{if(r(y)&&"@context"in y&&n(y["@context"])&&(y=y["@context"]),d(y).length===0)return S;const M=[],$=[({event:ue,next:k})=>{M.push(ue),k()}];x.eventHandler&&$.push(x.eventHandler);const X=x;x={...x,eventHandler:$};const F=await x.contextResolver.resolve({activeCtx:S,context:y,documentLoader:x.documentLoader,base:x.base});r(F[0].document)&&typeof F[0].document["@propagate"]=="boolean"&&(D=F[0].document["@propagate"]);let B=S;!D&&!B.previousContext&&(B=B.clone(),B.previousContext=S);for(const ue of F){let{document:k}=ue;if(S=B,k===null){if(!U&&Object.keys(S.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"});B=S=N.getInitialContext(x).clone();continue}const oe=ue.getProcessed(S);if(oe){if(X.eventHandler)for(const ae of oe.events)h({event:ae,options:X});B=S=oe.context;continue}if(r(k)&&"@context"in k&&(k=k["@context"]),!r(k))throw new e("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:k});B=B.clone();const j=new Map;if("@version"in k){if(k["@version"]!==1.1)throw new e("Unsupported JSON-LD version: "+k["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:k});if(S.processingMode&&S.processingMode==="json-ld-1.0")throw new e("@version: "+k["@version"]+" not compatible with "+S.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:k});B.processingMode="json-ld-1.1",B["@version"]=k["@version"],j.set("@version",!0)}if(B.processingMode=B.processingMode||S.processingMode,"@base"in k){let ae=k["@base"];if(!(ae===null||l(ae)))if(u(ae))ae=f(B["@base"],ae);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:k});B["@base"]=ae,j.set("@base",!0)}if("@vocab"in k){const ae=k["@vocab"];if(ae===null)delete B["@vocab"];else if(o(ae)){if(!l(ae)&&N.processingMode(B,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:k});{const I=A(B,ae,{vocab:!0,base:!0},void 0,void 0,x);l(I)||x.eventHandler&&h({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:I}},options:x}),B["@vocab"]=I}}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:k});j.set("@vocab",!0)}if("@language"in k){const ae=k["@language"];if(ae===null)delete B["@language"];else if(o(ae))ae.match(m)||x.eventHandler&&h({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ae}},options:x}),B["@language"]=ae.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:k});j.set("@language",!0)}if("@direction"in k){const ae=k["@direction"];if(S.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @direction not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:k});if(ae===null)delete B["@direction"];else{if(ae!=="ltr"&&ae!=="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:k});B["@direction"]=ae}j.set("@direction",!0)}if("@propagate"in k){const ae=k["@propagate"];if(S.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @propagate not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:k});if(typeof ae!="boolean")throw new e("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:y});j.set("@propagate",!0)}if("@import"in k){const ae=k["@import"];if(S.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @import not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:k});if(!o(ae))throw new e("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:y});const I=await x.contextResolver.resolve({activeCtx:S,context:ae,documentLoader:x.documentLoader,base:x.base});if(I.length!==1)throw new e("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:y});const Z=I[0].getProcessed(S);if(Z)k=Z;else{const ie=I[0].document;if("@import"in ie)throw new e("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:y});for(const ee in ie)k.hasOwnProperty(ee)||(k[ee]=ie[ee]);I[0].setProcessed(S,k)}j.set("@import",!0)}j.set("@protected",k["@protected"]||!1);for(const ae in k)if(N.createTermDefinition({activeCtx:B,localCtx:k,term:ae,defined:j,options:x,overrideProtected:U}),r(k[ae])&&"@context"in k[ae]){const I=k[ae]["@context"];let Z=!0;if(o(I)){const ie=f(x.base,I);O.has(ie)?Z=!1:O.add(ie)}if(Z)try{await N.process({activeCtx:B.clone(),localCtx:k[ae]["@context"],overrideProtected:!0,options:x,cycles:O})}catch{throw new e("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:k[ae]["@context"],term:ae})}}ue.setProcessed(S,{context:B,events:M})}return B},N.createTermDefinition=({activeCtx:S,localCtx:y,term:x,defined:D,options:U,overrideProtected:O=!1})=>{if(D.has(x)){if(D.get(x))return;throw new e("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:y,term:x})}D.set(x,!1);let Q;if(y.hasOwnProperty(x)&&(Q=y[x]),x==="@type"&&r(Q)&&(Q["@container"]||"@set")==="@set"&&N.processingMode(S,1.1)){const k=["@container","@id","@protected"],oe=Object.keys(Q);if(oe.length===0||oe.some(j=>!k.includes(j)))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:x})}else{if(N.isKeyword(x))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:x});if(x.match(_)){U.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:x}},options:U});return}else if(x==="")throw new e("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:y})}const M=S.mappings.get(x);S.mappings.has(x)&&S.mappings.delete(x);let $=!1;if((o(Q)||Q===null)&&($=!0,Q={"@id":Q}),!r(Q))throw new e("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:y});const X={};S.mappings.set(x,X),X.reverse=!1;const F=["@container","@id","@language","@reverse","@type"];N.processingMode(S,1.1)&&F.push("@context","@direction","@index","@nest","@prefix","@protected");for(const k in Q)if(!F.includes(k))throw new e("Invalid JSON-LD syntax; a term definition must not contain "+k,"jsonld.SyntaxError",{code:"invalid term definition",context:y});const B=x.indexOf(":");if(X._termHasColon=B>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:y});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:y});const k=Q["@reverse"];if(!o(k))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(k.match(_)){U.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:k}},options:U}),M?S.mappings.set(x,M):S.mappings.delete(x);return}const oe=A(S,k,{vocab:!0,base:!1},y,D,U);if(!l(oe))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:y});X["@id"]=oe,X.reverse=!0}else if("@id"in Q){let k=Q["@id"];if(k&&!o(k))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:y});if(k===null)X["@id"]=null;else if(!N.isKeyword(k)&&k.match(_)){U.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:k}},options:U}),M?S.mappings.set(x,M):S.mappings.delete(x);return}else if(k!==x){if(k=A(S,k,{vocab:!0,base:!1},y,D,U),!l(k)&&!N.isKeyword(k))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:y});if(x.match(/(?::[^:])|\//)){const oe=new Map(D).set(x,!0);if(A(S,x,{vocab:!0,base:!1},y,oe,U)!==k)throw new e("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y})}X["@id"]=k,X._prefix=$&&!X._termHasColon&&k.match(/[:\/\?#\[\]@]$/)!==null}}if(!("@id"in X))if(X._termHasColon){const k=x.substr(0,B);if(y.hasOwnProperty(k)&&N.createTermDefinition({activeCtx:S,localCtx:y,term:k,defined:D,options:U}),S.mappings.has(k)){const oe=x.substr(B+1);X["@id"]=S.mappings.get(k)["@id"]+oe}else X["@id"]=x}else if(x==="@type")X["@id"]=x;else{if(!("@vocab"in S))throw new e("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y,term:x});X["@id"]=S["@vocab"]+x}if((Q["@protected"]===!0||D.get("@protected")===!0&&Q["@protected"]!==!1)&&(S.protected[x]=!0,X.protected=!0),D.set(x,!0),"@type"in Q){let k=Q["@type"];if(!o(k))throw new e("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(k==="@json"||k==="@none"){if(N.processingMode(S,1))throw new e(`Invalid JSON-LD syntax; an @context @type value must not be "${k}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else if(k!=="@id"&&k!=="@vocab"){if(k=A(S,k,{vocab:!0,base:!1},y,D,U),!l(k))throw new e("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(k.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:y})}X["@type"]=k}if("@container"in Q){const k=o(Q["@container"])?[Q["@container"]]:Q["@container"]||[],oe=["@list","@set","@index","@language"];let j=!0;const ae=k.includes("@set");if(N.processingMode(S,1.1)){if(oe.push("@graph","@id","@type"),k.includes("@list")){if(k.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:y})}else if(k.includes("@graph")){if(k.some(I=>I!=="@graph"&&I!=="@id"&&I!=="@index"&&I!=="@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:y})}else j&=k.length<=(ae?2:1);if(k.includes("@type")&&(X["@type"]=X["@type"]||"@id",!["@id","@vocab"].includes(X["@type"])))throw new e("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else j&=!n(Q["@container"]),j&=k.length<=1;if(j&=k.every(I=>oe.includes(I)),j&=!(ae&&k.includes("@list")),!j)throw new e("Invalid JSON-LD syntax; @context @container value must be one of the following: "+oe.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:y});if(X.reverse&&!k.every(I=>["@index","@set"].includes(I)))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:y});X["@container"]=k}if("@index"in Q){if(!("@container"in Q)||!X["@container"].includes("@index"))throw new e(`Invalid JSON-LD syntax; @index without @index in @container: "${Q["@index"]}" on term "${x}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});if(!o(Q["@index"])||Q["@index"].indexOf("@")===0)throw new e(`Invalid JSON-LD syntax; @index must expand to an IRI: "${Q["@index"]}" on term "${x}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});X["@index"]=Q["@index"]}if("@context"in Q&&(X["@context"]=Q["@context"]),"@language"in Q&&!("@type"in Q)){let k=Q["@language"];if(k!==null&&!o(k))throw new e("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:y});k!==null&&(k=k.toLowerCase()),X["@language"]=k}if("@prefix"in Q){if(x.match(/:|\//))throw new e("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(N.isKeyword(X["@id"]))throw new e("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(typeof Q["@prefix"]=="boolean")X._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:y})}if("@direction"in Q){const k=Q["@direction"];if(k!==null&&k!=="ltr"&&k!=="rtl")throw new e('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:y});X["@direction"]=k}if("@nest"in Q){const k=Q["@nest"];if(!o(k)||k!=="@nest"&&k.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:y});X["@nest"]=k}const ue=X["@id"];if(ue==="@context"||ue==="@preserve")throw new e("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:y});if(M&&M.protected&&!O&&(S.protected[x]=!0,X.protected=!0,!R(M,X)))throw new e("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:y,term:x})},N.expandIri=(S,y,x,D)=>A(S,y,x,void 0,void 0,D);function A(S,y,x,D,U,O){if(y===null||!o(y)||N.isKeyword(y))return y;if(y.match(_))return null;if(D&&D.hasOwnProperty(y)&&U.get(y)!==!0&&N.createTermDefinition({activeCtx:S,localCtx:D,term:y,defined:U,options:O}),x=x||{},x.vocab){const M=S.mappings.get(y);if(M===null)return null;if(r(M)&&"@id"in M)return M["@id"]}const Q=y.indexOf(":");if(Q>0){const M=y.substr(0,Q),$=y.substr(Q+1);if(M==="_"||$.indexOf("//")===0)return y;D&&D.hasOwnProperty(M)&&N.createTermDefinition({activeCtx:S,localCtx:D,term:M,defined:U,options:O});const X=S.mappings.get(M);if(X&&X._prefix)return X["@id"]+$;if(l(y))return y}if(x.vocab&&"@vocab"in S)y=S["@vocab"]+y;else if(x.base){let M,$;"@base"in S?S["@base"]?($=f(O.base,S["@base"]),M=f($,y)):($=S["@base"],M=y):($=O.base,M=f(O.base,y)),y=M}return y}N.getInitialContext=S=>{const y=JSON.stringify({processingMode:S.processingMode}),x=b.get(y);if(x)return x;const D={processingMode:S.processingMode,mappings:new Map,inverse:null,getInverse:U,clone:M,revertToPreviousContext:$,protected:{}};return b.size===T&&b.clear(),b.set(y,D),D;function U(){const X=this;if(X.inverse)return X.inverse;const F=X.inverse={},B=X.fastCurieMap={},ue={},k=(X["@language"]||"@none").toLowerCase(),oe=X["@direction"],j=X.mappings,ae=[...j.keys()].sort(g);for(const I of ae){const Z=j.get(I);if(Z===null)continue;let ie=Z["@container"]||"@none";if(ie=[].concat(ie).sort().join(""),Z["@id"]===null)continue;const ee=d(Z["@id"]);for(const me of ee){let W=F[me];const G=N.isKeyword(me);if(W)!G&&!Z._termHasColon&&ue[me].push(I);else if(F[me]=W={},!G&&!Z._termHasColon){ue[me]=[I];const Y={iri:me,terms:ue[me]};me[0]in B?B[me[0]].push(Y):B[me[0]]=[Y]}if(W[ie]||(W[ie]={"@language":{},"@type":{},"@any":{}}),W=W[ie],Q(I,W["@any"],"@none"),Z.reverse)Q(I,W["@type"],"@reverse");else if(Z["@type"]==="@none")Q(I,W["@any"],"@none"),Q(I,W["@language"],"@none"),Q(I,W["@type"],"@none");else if("@type"in Z)Q(I,W["@type"],Z["@type"]);else if("@language"in Z&&"@direction"in Z){const Y=Z["@language"],K=Z["@direction"];Y&&K?Q(I,W["@language"],`${Y}_${K}`.toLowerCase()):Y?Q(I,W["@language"],Y.toLowerCase()):K?Q(I,W["@language"],`_${K}`):Q(I,W["@language"],"@null")}else"@language"in Z?Q(I,W["@language"],(Z["@language"]||"@null").toLowerCase()):"@direction"in Z?Z["@direction"]?Q(I,W["@language"],`_${Z["@direction"]}`):Q(I,W["@language"],"@none"):oe?(Q(I,W["@language"],`_${oe}`),Q(I,W["@language"],"@none"),Q(I,W["@type"],"@none")):(Q(I,W["@language"],k),Q(I,W["@language"],"@none"),Q(I,W["@type"],"@none"))}}for(const I in B)O(B,I,1);return F}function O(X,F,B){const ue=X[F],k=X[F]={};let oe,j;for(const ae of ue)oe=ae.iri,B>=oe.length?j="":j=oe[B],j in k?k[j].push(ae):k[j]=[ae];for(const ae in k)ae!==""&&O(k,ae,B+1)}function Q(X,F,B){F.hasOwnProperty(B)||(F[B]=X)}function M(){const X={};return X.mappings=i.clone(this.mappings),X.clone=this.clone,X.inverse=null,X.getInverse=this.getInverse,X.protected=i.clone(this.protected),this.previousContext&&(X.previousContext=this.previousContext.clone()),X.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(X["@base"]=this["@base"]),"@language"in this&&(X["@language"]=this["@language"]),"@vocab"in this&&(X["@vocab"]=this["@vocab"]),X}function $(){return this.previousContext?this.previousContext.clone():this}},N.getContextValue=(S,y,x)=>{if(y===null)return x==="@context"?void 0:null;if(S.mappings.has(y)){const D=S.mappings.get(y);if(a(x))return D;if(D.hasOwnProperty(x))return D[x]}if(x==="@language"&&x in S||x==="@direction"&&x in S)return S[x];if(x!=="@context")return null},N.processingMode=(S,y)=>y.toString()>="1.1"?!S.processingMode||S.processingMode>="json-ld-"+y.toString():S.processingMode==="json-ld-1.0",N.isKeyword=S=>{if(!o(S)||S[0]!=="@")return!1;switch(S){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 R(S,y){if(!(S&&typeof S=="object")||!(y&&typeof y=="object"))return S===y;const x=Array.isArray(S);if(x!==Array.isArray(y))return!1;if(x){if(S.length!==y.length)return!1;for(let O=0;O<S.length;++O)if(!R(S[O],y[O]))return!1;return!0}const D=Object.keys(S),U=Object.keys(y);if(D.length!==U.length)return!1;for(const O in S){let Q=S[O],M=y[O];if(O==="@container"&&Array.isArray(Q)&&Array.isArray(M)&&(Q=Q.slice().sort(),M=M.slice().sort()),!R(Q,M))return!1}return!0}return qa}var za,Od;function km(){if(Od)return za;Od=1;const i=Yt(),{isArray:e,isObject:n,isEmptyObject:r,isString:o,isUndefined:a}=zt(),{isList:l,isValue:u,isGraph:f,isSubject:h}=Pn(),{expandIri:m,getContextValue:_,isKeyword:d,process:g,processingMode:b}=vi(),{isAbsolute:T}=Wn(),{REGEX_BCP47:N,REGEX_KEYWORD:A,addValue:R,asArray:S,getValues:y,validateTypeValue:x}=Jt(),{handleEvent:D}=Zr(),U={};za=U,U.expand=async({activeCtx:F,activeProperty:B=null,element:ue,options:k={},insideList:oe=!1,insideIndex:j=!1,typeScopedContext:ae=null})=>{if(ue==null)return null;if(B==="@default"&&(k=Object.assign({},k,{isFrame:!1})),!e(ue)&&!n(ue))return!oe&&(B===null||m(F,B,{vocab:!0},k)==="@graph")?(k.eventHandler&&D({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:ue}},options:k}),null):M({activeCtx:F,activeProperty:B,value:ue,options:k});if(e(ue)){let Y=[];const K=_(F,B,"@container")||[];oe=oe||K.includes("@list");for(let le=0;le<ue.length;++le){let ce=await U.expand({activeCtx:F,activeProperty:B,element:ue[le],options:k,insideIndex:j,typeScopedContext:ae});oe&&e(ce)&&(ce={"@list":ce}),ce!==null&&(e(ce)?Y=Y.concat(ce):Y.push(ce))}return Y}const I=m(F,B,{vocab:!0},k),Z=_(F,B,"@context");ae=ae||(F.previousContext?F:null);let ie=Object.keys(ue).sort(),ee=!j;if(ee&&ae&&ie.length<=2&&!ie.includes("@context"))for(const Y of ie){const K=m(ae,Y,{vocab:!0},k);if(K==="@value"){ee=!1,F=ae;break}if(K==="@id"&&ie.length===1){ee=!1;break}}ee&&(F=F.revertToPreviousContext()),a(Z)||(F=await g({activeCtx:F,localCtx:Z,propagate:!0,overrideProtected:!0,options:k})),"@context"in ue&&(F=await g({activeCtx:F,localCtx:ue["@context"],options:k})),ae=F;let me=null;for(const Y of ie)if(m(F,Y,{vocab:!0},k)==="@type"){me=me||Y;const le=ue[Y],ce=Array.isArray(le)?le.length>1?le.slice().sort():le:[le];for(const Ee of ce){const Te=_(ae,Ee,"@context");a(Te)||(F=await g({activeCtx:F,localCtx:Te,options:k,propagate:!1}))}}let W={};await Q({activeCtx:F,activeProperty:B,expandedActiveProperty:I,element:ue,expandedParent:W,options:k,insideList:oe,typeKey:me,typeScopedContext:ae}),ie=Object.keys(W);let G=ie.length;if("@value"in W){if("@type"in W&&("@language"in W||"@direction"in W))throw new i('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:W});let Y=G-1;if("@type"in W&&(Y-=1),"@index"in W&&(Y-=1),"@language"in W&&(Y-=1),"@direction"in W&&(Y-=1),Y!==0)throw new i('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:W});const K=W["@value"]===null?[]:S(W["@value"]),le=y(W,"@type");if(!(b(F,1.1)&&le.includes("@json")&&le.length===1))if(K.length===0)k.eventHandler&&D({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:W}},options:k}),W=null;else{if(!K.every(ce=>o(ce)||r(ce))&&"@language"in W)throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:W});if(!le.every(ce=>T(ce)&&!(o(ce)&&ce.indexOf("_:")===0)||r(ce)))throw new i('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:W})}}else if("@type"in W&&!e(W["@type"]))W["@type"]=[W["@type"]];else if("@set"in W||"@list"in W){if(G>1&&!(G===2&&"@index"in W))throw new i('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:W});"@set"in W&&(W=W["@set"],ie=Object.keys(W),G=ie.length)}else G===1&&"@language"in W&&(k.eventHandler&&D({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:W}},options:k}),W=null);return n(W)&&!k.keepFreeFloatingNodes&&!oe&&(B===null||I==="@graph"||(_(F,B,"@container")||[]).includes("@graph"))&&(W=O({value:W,count:G,options:k})),W};function O({value:F,count:B,options:ue}){if(B===0||"@value"in F||"@list"in F||B===1&&"@id"in F){if(ue.eventHandler){let k,oe;B===0?(k="empty object",oe="Dropping empty object."):"@value"in F?(k="object with only @value",oe="Dropping object with only @value."):"@list"in F?(k="object with only @list",oe="Dropping object with only @list."):B===1&&"@id"in F&&(k="object with only @id",oe="Dropping object with only @id."),D({event:{type:["JsonLdEvent"],code:k,level:"warning",message:oe,details:{value:F}},options:ue})}return null}return F}async function Q({activeCtx:F,activeProperty:B,expandedActiveProperty:ue,element:k,expandedParent:oe,options:j={},insideList:ae,typeKey:I,typeScopedContext:Z}){const ie=Object.keys(k).sort(),ee=[];let me;const W=k[I]&&m(F,e(k[I])?k[I][0]:k[I],{vocab:!0},{...j,typeExpansion:!0})==="@json";for(const G of ie){let Y=k[G],K;if(G==="@context")continue;const le=m(F,G,{vocab:!0},j);if(le===null||!(T(le)||d(le))){j.eventHandler&&D({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:G,expandedProperty:le}},options:j});continue}if(d(le)){if(ue==="@reverse")throw new i("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:Y});if(le in oe&&le!=="@included"&&le!=="@type")throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:le})}if(le==="@id"){if(!o(Y)){if(!j.isFrame)throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:Y});if(n(Y)){if(!r(Y))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Y})}else if(e(Y)){if(!Y.every(q=>o(q)))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Y})}else throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Y})}R(oe,"@id",S(Y).map(q=>{if(o(q)){const te=m(F,q,{base:!0},j);return j.eventHandler&&(te===null?D(q===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:q}},options:j}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:q}},options:j}):T(te)||D({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:q,expandedId:te}},options:j})),te}return q}),{propertyIsArray:j.isFrame});continue}if(le==="@type"){n(Y)&&(Y=Object.fromEntries(Object.entries(Y).map(([q,te])=>[m(Z,q,{vocab:!0}),S(te).map(fe=>m(Z,fe,{base:!0,vocab:!0},{...j,typeExpansion:!0}))]))),x(Y,j.isFrame),R(oe,"@type",S(Y).map(q=>{if(o(q)){const te=m(Z,q,{base:!0,vocab:!0},{...j,typeExpansion:!0});return te!=="@json"&&!T(te)&&j.eventHandler&&D({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:q}},options:j}),te}return q}),{propertyIsArray:!!j.isFrame});continue}if(le==="@included"&&b(F,1.1)){const q=S(await U.expand({activeCtx:F,activeProperty:B,element:Y,options:j}));if(!q.every(te=>h(te)))throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:Y});R(oe,"@included",q,{propertyIsArray:!0});continue}if(le==="@graph"&&!(n(Y)||e(Y)))throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:Y});if(le==="@value"){me=Y,W&&b(F,1.1)?oe["@value"]=Y:R(oe,"@value",Y,{propertyIsArray:j.isFrame});continue}if(le==="@language"){if(Y===null)continue;if(!o(Y)&&!j.isFrame)throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:Y});Y=S(Y).map(q=>o(q)?q.toLowerCase():q);for(const q of Y)o(q)&&!q.match(N)&&j.eventHandler&&D({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:q}},options:j});R(oe,"@language",Y,{propertyIsArray:j.isFrame});continue}if(le==="@direction"){if(!o(Y)&&!j.isFrame)throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:Y});Y=S(Y);for(const q of Y)if(o(q)&&q!=="ltr"&&q!=="rtl")throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:Y});R(oe,"@direction",Y,{propertyIsArray:j.isFrame});continue}if(le==="@index"){if(!o(Y))throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:Y});R(oe,"@index",Y);continue}if(le==="@reverse"){if(!n(Y))throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:Y});if(K=await U.expand({activeCtx:F,activeProperty:"@reverse",element:Y,options:j}),"@reverse"in K)for(const te in K["@reverse"])R(oe,te,K["@reverse"][te],{propertyIsArray:!0});let q=oe["@reverse"]||null;for(const te in K){if(te==="@reverse")continue;q===null&&(q=oe["@reverse"]={}),R(q,te,[],{propertyIsArray:!0});const fe=K[te];for(let xe=0;xe<fe.length;++xe){const Se=fe[xe];if(u(Se)||l(Se))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:K});R(q,te,Se,{propertyIsArray:!0})}}continue}if(le==="@nest"){ee.push(G);continue}let ce=F;const Ee=_(F,G,"@context");a(Ee)||(ce=await g({activeCtx:F,localCtx:Ee,propagate:!0,overrideProtected:!0,options:j}));const Te=_(F,G,"@container")||[];if(Te.includes("@language")&&n(Y)){const q=_(ce,G,"@direction");K=$(ce,Y,q,j)}else if(Te.includes("@index")&&n(Y)){const q=Te.includes("@graph"),te=_(ce,G,"@index")||"@index",fe=te!=="@index"&&m(F,te,{vocab:!0},j);K=await X({activeCtx:ce,options:j,activeProperty:G,value:Y,asGraph:q,indexKey:te,propertyIndex:fe})}else if(Te.includes("@id")&&n(Y)){const q=Te.includes("@graph");K=await X({activeCtx:ce,options:j,activeProperty:G,value:Y,asGraph:q,indexKey:"@id"})}else if(Te.includes("@type")&&n(Y))K=await X({activeCtx:ce.revertToPreviousContext(),options:j,activeProperty:G,value:Y,asGraph:!1,indexKey:"@type"});else{const q=le==="@list";if(q||le==="@set"){let te=B;q&&ue==="@graph"&&(te=null),K=await U.expand({activeCtx:ce,activeProperty:te,element:Y,options:j,insideList:q})}else _(F,G,"@type")==="@json"?K={"@type":"@json","@value":Y}:K=await U.expand({activeCtx:ce,activeProperty:G,element:Y,options:j,insideList:!1})}if(!(K===null&&le!=="@value")){if(le!=="@list"&&!l(K)&&Te.includes("@list")&&(K={"@list":S(K)}),Te.includes("@graph")&&!Te.some(q=>q==="@id"||q==="@index")){if(K=S(K),j.isFrame||(K=K.filter(q=>{const te=Object.keys(q).length;return O({value:q,count:te,options:j})!==null})),K.length===0)continue;K=K.map(q=>({"@graph":S(q)}))}if(ce.mappings.has(G)&&ce.mappings.get(G).reverse){const q=oe["@reverse"]=oe["@reverse"]||{};K=S(K);for(let te=0;te<K.length;++te){const fe=K[te];if(u(fe)||l(fe))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:K});R(q,le,fe,{propertyIsArray:!0})}continue}R(oe,le,K,{propertyIsArray:!0})}}if("@value"in oe&&!(oe["@type"]==="@json"&&b(F,1.1))){if((n(me)||e(me))&&!j.isFrame)throw new i('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:me})}for(const G of ee){const Y=e(k[G])?k[G]:[k[G]];for(const K of Y){if(!n(K)||Object.keys(K).some(le=>m(F,le,{vocab:!0},j)==="@value"))throw new i("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:K});await Q({activeCtx:F,activeProperty:B,expandedActiveProperty:ue,element:K,expandedParent:oe,options:j,insideList:ae,typeScopedContext:Z,typeKey:I})}}}function M({activeCtx:F,activeProperty:B,value:ue,options:k}){if(ue==null)return null;const oe=m(F,B,{vocab:!0},k);if(oe==="@id")return m(F,ue,{base:!0},k);if(oe==="@type")return m(F,ue,{vocab:!0,base:!0},{...k,typeExpansion:!0});const j=_(F,B,"@type");if((j==="@id"||oe==="@graph")&&o(ue)){const I=m(F,ue,{base:!0},k);return I===null&&ue.match(A)&&k.eventHandler&&D({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:B}},options:k}),{"@id":I}}if(j==="@vocab"&&o(ue))return{"@id":m(F,ue,{vocab:!0,base:!0},k)};if(d(oe))return ue;const ae={};if(j&&!["@id","@vocab","@none"].includes(j))ae["@type"]=j;else if(o(ue)){const I=_(F,B,"@language");I!==null&&(ae["@language"]=I);const Z=_(F,B,"@direction");Z!==null&&(ae["@direction"]=Z)}return["boolean","number","string"].includes(typeof ue)||(ue=ue.toString()),ae["@value"]=ue,ae}function $(F,B,ue,k){const oe=[],j=Object.keys(B).sort();for(const ae of j){const I=m(F,ae,{vocab:!0},k);let Z=B[ae];e(Z)||(Z=[Z]);for(const ie of Z){if(ie===null)continue;if(!o(ie))throw new i("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:B});const ee={"@value":ie};I!=="@none"&&(ae.match(N)||k.eventHandler&&D({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ae}},options:k}),ee["@language"]=ae.toLowerCase()),ue&&(ee["@direction"]=ue),oe.push(ee)}}return oe}async function X({activeCtx:F,options:B,activeProperty:ue,value:k,asGraph:oe,indexKey:j,propertyIndex:ae}){const I=[],Z=Object.keys(k).sort(),ie=j==="@type";for(let ee of Z){if(ie){const G=_(F,ee,"@context");a(G)||(F=await g({activeCtx:F,localCtx:G,propagate:!1,options:B}))}let me=k[ee];e(me)||(me=[me]),me=await U.expand({activeCtx:F,activeProperty:ue,element:me,options:B,insideList:!1,insideIndex:!0});let W;ae?ee==="@none"?W="@none":W=M({activeCtx:F,activeProperty:j,value:ee,options:B}):W=m(F,ee,{vocab:!0},B),j==="@id"?ee=m(F,ee,{base:!0},B):ie&&(ee=W);for(let G of me){if(oe&&!f(G)&&(G={"@graph":[G]}),j==="@type")W==="@none"||(G["@type"]?G["@type"]=[ee].concat(G["@type"]):G["@type"]=[ee]);else{if(u(G)&&!["@language","@type","@index"].includes(j))throw new i(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${j}".`,"jsonld.SyntaxError",{code:"invalid value object",value:G});ae?W!=="@none"&&R(G,ae,W,{propertyIsArray:!0,prependValue:!0}):W!=="@none"&&!(j in G)&&(G[j]=ee)}I.push(G)}}return I}return za}var Ua,Fd;function eo(){if(Fd)return Ua;Fd=1;const{isKeyword:i}=vi(),e=Pn(),n=zt(),r=Jt(),o=Yt(),a={};return Ua=a,a.createMergedNodeMap=(l,u)=>{u=u||{};const f=u.issuer||new r.IdentifierIssuer("_:b"),h={"@default":{}};return a.createNodeMap(l,h,"@default",f),a.mergeNodeMaps(h)},a.createNodeMap=(l,u,f,h,m,_)=>{if(n.isArray(l)){for(const T of l)a.createNodeMap(T,u,f,h,void 0,_);return}if(!n.isObject(l)){_&&_.push(l);return}if(e.isValue(l)){if("@type"in l){let T=l["@type"];T.indexOf("_:")===0&&(l["@type"]=T=h.getId(T))}_&&_.push(l);return}else if(_&&e.isList(l)){const T=[];a.createNodeMap(l["@list"],u,f,h,m,T),_.push({"@list":T});return}if("@type"in l){const T=l["@type"];for(const N of T)N.indexOf("_:")===0&&h.getId(N)}n.isUndefined(m)&&(m=e.isBlankNode(l)?h.getId(l["@id"]):l["@id"]),_&&_.push({"@id":m});const d=u[f],g=d[m]=d[m]||{};g["@id"]=m;const b=Object.keys(l).sort();for(let T of b){if(T==="@id")continue;if(T==="@reverse"){const A={"@id":m},R=l["@reverse"];for(const S in R){const y=R[S];for(const x of y){let D=x["@id"];e.isBlankNode(x)&&(D=h.getId(D)),a.createNodeMap(x,u,f,h,D),r.addValue(d[D],S,A,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(T==="@graph"){m in u||(u[m]={}),a.createNodeMap(l[T],u,m,h);continue}if(T==="@included"){a.createNodeMap(l[T],u,f,h);continue}if(T!=="@type"&&i(T)){if(T==="@index"&&T in g&&(l[T]!==g[T]||l[T]["@id"]!==g[T]["@id"]))throw new o("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:g});g[T]=l[T];continue}const N=l[T];if(T.indexOf("_:")===0&&(T=h.getId(T)),N.length===0){r.addValue(g,T,[],{propertyIsArray:!0});continue}for(let A of N)if(T==="@type"&&(A=A.indexOf("_:")===0?h.getId(A):A),e.isSubject(A)||e.isSubjectReference(A)){if("@id"in A&&!A["@id"])continue;const R=e.isBlankNode(A)?h.getId(A["@id"]):A["@id"];r.addValue(g,T,{"@id":R},{propertyIsArray:!0,allowDuplicate:!1}),a.createNodeMap(A,u,f,h,R)}else if(e.isValue(A))r.addValue(g,T,A,{propertyIsArray:!0,allowDuplicate:!1});else if(e.isList(A)){const R=[];a.createNodeMap(A["@list"],u,f,h,m,R),A={"@list":R},r.addValue(g,T,A,{propertyIsArray:!0,allowDuplicate:!1})}else a.createNodeMap(A,u,f,h,m),r.addValue(g,T,A,{propertyIsArray:!0,allowDuplicate:!1})}},a.mergeNodeMapGraphs=l=>{const u={};for(const f of Object.keys(l).sort())for(const h of Object.keys(l[f]).sort()){const m=l[f][h];h in u||(u[h]={"@id":h});const _=u[h];for(const d of Object.keys(m).sort())if(i(d)&&d!=="@type")_[d]=r.clone(m[d]);else for(const g of m[d])r.addValue(_,d,r.clone(g),{propertyIsArray:!0,allowDuplicate:!1})}return u},a.mergeNodeMaps=l=>{const u=l["@default"],f=Object.keys(l).sort();for(const h of f){if(h==="@default")continue;const m=l[h];let _=u[h];_?"@graph"in _||(_["@graph"]=[]):u[h]=_={"@id":h,"@graph":[]};const d=_["@graph"];for(const g of Object.keys(m).sort()){const b=m[g];e.isSubjectReference(b)||d.push(b)}}return u},Ua}var Ha,jd;function Dm(){if(jd)return Ha;jd=1;const{isSubjectReference:i}=Pn(),{createMergedNodeMap:e}=eo(),n={};return Ha=n,n.flatten=r=>{const o=e(r),a=[],l=Object.keys(o).sort();for(let u=0;u<l.length;++u){const f=o[l[u]];i(f)||a.push(f)}return a},Ha}var Va,Bd;function Mm(){if(Bd)return Va;Bd=1;const i=Yt(),e=Pn(),n=zt(),{REGEX_BCP47:r,addValue:o}=Jt(),{handleEvent:a}=Zr(),{RDF_LIST:l,RDF_FIRST:u,RDF_REST:f,RDF_NIL:h,RDF_TYPE:m,RDF_JSON_LITERAL:_,XSD_BOOLEAN:d,XSD_DOUBLE:g,XSD_INTEGER:b,XSD_STRING:T}=Zl(),N={};Va=N,N.fromRDF=async(R,S)=>{const{useRdfType:y=!1,useNativeTypes:x=!1,rdfDirection:D=null}=S,U={},O={"@default":U},Q={};if(D){if(D==="compound-literal")throw new i("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:D});if(D!=="i18n-datatype")throw new i("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:D})}for(const X of R){const F=X.graph.termType==="DefaultGraph"?"@default":X.graph.value;F in O||(O[F]={}),F!=="@default"&&!(F in U)&&(U[F]={"@id":F});const B=O[F],ue=X.subject.value,k=X.predicate.value,oe=X.object;ue in B||(B[ue]={"@id":ue});const j=B[ue],ae=oe.termType.endsWith("Node");if(ae&&!(oe.value in B)&&(B[oe.value]={"@id":oe.value}),k===m&&!y&&ae){o(j,"@type",oe.value,{propertyIsArray:!0});continue}const I=A(oe,x,D,S);if(o(j,k,I,{propertyIsArray:!0}),ae)if(oe.value===h){const Z=B[oe.value];"usages"in Z||(Z.usages=[]),Z.usages.push({node:j,property:k,value:I})}else oe.value in Q?Q[oe.value]=!1:Q[oe.value]={node:j,property:k,value:I}}for(const X in O){const F=O[X];if(!(h in F))continue;const B=F[h];if(B.usages){for(let ue of B.usages){let k=ue.node,oe=ue.property,j=ue.value;const ae=[],I=[];let Z=Object.keys(k).length;for(;oe===f&&n.isObject(Q[k["@id"]])&&n.isArray(k[u])&&k[u].length===1&&n.isArray(k[f])&&k[f].length===1&&(Z===3||Z===4&&n.isArray(k["@type"])&&k["@type"].length===1&&k["@type"][0]===l)&&(ae.push(k[u][0]),I.push(k["@id"]),ue=Q[k["@id"]],k=ue.node,oe=ue.property,j=ue.value,Z=Object.keys(k).length,!!e.isBlankNode(k)););delete j["@id"],j["@list"]=ae.reverse();for(const ie of I)delete F[ie]}delete B.usages}}const M=[],$=Object.keys(U).sort();for(const X of $){const F=U[X];if(X in O){const B=F["@graph"]=[],ue=O[X],k=Object.keys(ue).sort();for(const oe of k){const j=ue[oe];e.isSubjectReference(j)||B.push(j)}}e.isSubjectReference(F)||M.push(F)}return M};function A(R,S,y,x){if(R.termType.endsWith("Node"))return{"@id":R.value};const D={"@value":R.value};if(R.language)R.language.match(r)||x.eventHandler&&a({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:R.language}},options:x}),D["@language"]=R.language;else{let U=R.datatype.value;if(U||(U=T),U===_){U="@json";try{D["@value"]=JSON.parse(D["@value"])}catch(O){throw new i("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:D["@value"],cause:O})}}if(S){if(U===d)D["@value"]==="true"?D["@value"]=!0:D["@value"]==="false"&&(D["@value"]=!1);else if(n.isNumeric(D["@value"]))if(U===b){const O=parseInt(D["@value"],10);O.toFixed(0)===D["@value"]&&(D["@value"]=O)}else U===g&&(D["@value"]=parseFloat(D["@value"]));[d,b,g,T].includes(U)||(D["@type"]=U)}else if(y==="i18n-datatype"&&U.startsWith("https://www.w3.org/ns/i18n#")){const[,O,Q]=U.split(/[#_]/);O.length>0&&(D["@language"]=O,O.match(r)||x.eventHandler&&a({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:O}},options:x})),D["@direction"]=Q}else U!==T&&(D["@type"]=U)}return D}return Va}var Ga,$d;function Om(){return $d||($d=1,Ga=function i(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((n,r,o)=>{const a=o===0?"":",",l=r===void 0||typeof r=="symbol"?null:r;return n+a+i(l)},"")+"]":"{"+Object.keys(e).sort().reduce((n,r,o)=>{if(e[r]===void 0||typeof e[r]=="symbol")return n;const a=n.length===0?"":",";return n+a+i(r)+":"+i(e[r])},"")+"}"}),Ga}var Wa,qd;function Fm(){if(qd)return Wa;qd=1;const{createNodeMap:i}=eo(),{isKeyword:e}=vi(),n=Pn(),r=Om(),o=Yt(),a=zt(),l=Jt(),{handleEvent:u}=Zr(),{RDF_FIRST:f,RDF_REST:h,RDF_NIL:m,RDF_TYPE:_,RDF_JSON_LITERAL:d,RDF_LANGSTRING:g,XSD_BOOLEAN:b,XSD_DOUBLE:T,XSD_INTEGER:N,XSD_STRING:A}=Zl(),{isAbsolute:R}=Wn(),S={};Wa=S,S.toRDF=(U,O)=>{const Q=new l.IdentifierIssuer("_:b"),M={"@default":{}};i(U,M,"@default",Q);const $=[],X=Object.keys(M).sort();for(const F of X){let B;if(F==="@default")B={termType:"DefaultGraph",value:""};else if(R(F))F.startsWith("_:")?B={termType:"BlankNode"}:B={termType:"NamedNode"},B.value=F;else{O.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:F}},options:O});continue}y($,M[F],B,Q,O)}return $};function y(U,O,Q,M,$){const X=Object.keys(O).sort();for(const F of X){const B=O[F],ue=Object.keys(B).sort();for(let k of ue){const oe=B[k];if(k==="@type")k=_;else if(e(k))continue;for(const j of oe){const ae={termType:F.startsWith("_:")?"BlankNode":"NamedNode",value:F};if(!R(F)){$.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:F}},options:$});continue}const I={termType:k.startsWith("_:")?"BlankNode":"NamedNode",value:k};if(!R(k)){$.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:k}},options:$});continue}if(I.termType==="BlankNode"&&!$.produceGeneralizedRdf){$.eventHandler&&u({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:M.getOldIds().find(ie=>M.getId(ie)===k)}},options:$});continue}const Z=D(j,M,U,Q,$.rdfDirection,$);Z&&U.push({subject:ae,predicate:I,object:Z,graph:Q})}}}}function x(U,O,Q,M,$,X){const F={termType:"NamedNode",value:f},B={termType:"NamedNode",value:h},ue={termType:"NamedNode",value:m},k=U.pop(),oe=k?{termType:"BlankNode",value:O.getId()}:ue;let j=oe;for(const ae of U){const I=D(ae,O,Q,M,$,X),Z={termType:"BlankNode",value:O.getId()};Q.push({subject:j,predicate:F,object:I,graph:M}),Q.push({subject:j,predicate:B,object:Z,graph:M}),j=Z}if(k){const ae=D(k,O,Q,M,$,X);Q.push({subject:j,predicate:F,object:ae,graph:M}),Q.push({subject:j,predicate:B,object:ue,graph:M})}return oe}function D(U,O,Q,M,$,X){const F={};if(n.isValue(U)){F.termType="Literal",F.value=void 0,F.datatype={termType:"NamedNode"};let B=U["@value"];const ue=U["@type"]||null;if(ue==="@json")F.value=r(B),F.datatype.value=d;else if(a.isBoolean(B))F.value=B.toString(),F.datatype.value=ue||b;else if(a.isDouble(B)||ue===T)a.isDouble(B)||(B=parseFloat(B)),F.value=B.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),F.datatype.value=ue||T;else if(a.isNumber(B))F.value=B.toFixed(0),F.datatype.value=ue||N;else if("@direction"in U&&$==="i18n-datatype"){const k=(U["@language"]||"").toLowerCase(),oe=U["@direction"],j=`https://www.w3.org/ns/i18n#${k}_${oe}`;F.datatype.value=j,F.value=B}else{if("@direction"in U&&$==="compound-literal")throw new o("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:$});if("@direction"in U&&$)throw new o("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:$});"@language"in U?("@direction"in U&&!$&&X.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:F.value}},options:X}),F.value=B,F.datatype.value=ue||g,F.language=U["@language"]):("@direction"in U&&!$&&X.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:F.value}},options:X}),F.value=B,F.datatype.value=ue||A)}}else if(n.isList(U)){const B=x(U["@list"],O,Q,M,$,X);F.termType=B.termType,F.value=B.value}else{const B=a.isObject(U)?U["@id"]:U;F.termType=B.startsWith("_:")?"BlankNode":"NamedNode",F.value=B}return F.termType==="NamedNode"&&!R(F.value)?(X.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:F.value}},options:X}),null):F}return Wa}var Za,zd;function jm(){if(zd)return Za;zd=1;const{isKeyword:i}=vi(),e=Pn(),n=zt(),r=Jt(),o=Wn(),a=Yt(),{createNodeMap:l,mergeNodeMapGraphs:u}=eo(),f={};Za=f,f.frameMergedOrDefault=(y,x,D)=>{const U={options:D,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},O=new r.IdentifierIssuer("_:b");l(y,U.graphMap,"@default",O),D.merged&&(U.graphMap["@merged"]=u(U.graphMap),U.graph="@merged"),U.subjects=U.graphMap[U.graph];const Q=[];f.frame(U,Object.keys(U.subjects).sort(),x,Q),D.pruneBlankNodeIdentifiers&&(D.bnodesToClear=Object.keys(U.bnodeMap).filter(M=>U.bnodeMap[M].length===1));return D.link={},N(Q,D)},f.frame=(y,x,D,U,O=null)=>{d(D),D=D[0];const Q=y.options,M={embed:_(D,Q,"embed"),explicit:_(D,Q,"explicit"),requireAll:_(D,Q,"requireAll")};y.link.hasOwnProperty(y.graph)||(y.link[y.graph]={});const $=y.link[y.graph],X=g(y,x,D,M),F=Object.keys(X).sort();for(const B of F){const ue=X[B];if(O===null?y.uniqueEmbeds={[y.graph]:{}}:y.uniqueEmbeds[y.graph]=y.uniqueEmbeds[y.graph]||{},M.embed==="@link"&&B in $){A(U,O,$[B]);continue}const k={"@id":B};if(B.indexOf("_:")===0&&r.addValue(y.bnodeMap,B,k,{propertyIsArray:!0}),$[B]=k,(M.embed==="@first"||M.embed==="@last")&&y.is11)throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:D});if(!(!y.embedded&&y.uniqueEmbeds[y.graph].hasOwnProperty(B))){if(y.embedded&&(M.embed==="@never"||m(ue,y.graph,y.subjectStack))){A(U,O,k);continue}if(y.embedded&&(M.embed=="@first"||M.embed=="@once")&&y.uniqueEmbeds[y.graph].hasOwnProperty(B)){A(U,O,k);continue}if(M.embed==="@last"&&B in y.uniqueEmbeds[y.graph]&&T(y,B),y.uniqueEmbeds[y.graph][B]={parent:U,property:O},y.subjectStack.push({subject:ue,graph:y.graph}),B in y.graphMap){let oe=!1,j=null;"@graph"in D?(j=D["@graph"][0],oe=!(B==="@merged"||B==="@default"),n.isObject(j)||(j={})):(oe=y.graph!=="@merged",j={}),oe&&f.frame({...y,graph:B,embedded:!1},Object.keys(y.graphMap[B]).sort(),[j],k,"@graph")}"@included"in D&&f.frame({...y,embedded:!1},x,D["@included"],k,"@included");for(const oe of Object.keys(ue).sort()){if(i(oe)){if(k[oe]=r.clone(ue[oe]),oe==="@type")for(const j of ue["@type"])j.indexOf("_:")===0&&r.addValue(y.bnodeMap,j,k,{propertyIsArray:!0});continue}if(!(M.explicit&&!(oe in D)))for(const j of ue[oe]){const ae=oe in D?D[oe]:h(M);if(e.isList(j)){const I=D[oe]&&D[oe][0]&&D[oe][0]["@list"]?D[oe][0]["@list"]:h(M),Z={"@list":[]};A(k,oe,Z);const ie=j["@list"];for(const ee of ie)e.isSubjectReference(ee)?f.frame({...y,embedded:!0},[ee["@id"]],I,Z,"@list"):A(Z,"@list",r.clone(ee))}else e.isSubjectReference(j)?f.frame({...y,embedded:!0},[j["@id"]],ae,k,oe):S(ae[0],j)&&A(k,oe,r.clone(j))}}for(const oe of Object.keys(D).sort()){if(oe==="@type"){if(!n.isObject(D[oe][0])||!("@default"in D[oe][0]))continue}else if(i(oe))continue;const j=D[oe][0]||{};if(!_(j,Q,"omitDefault")&&!(oe in k)){let I="@null";"@default"in j&&(I=r.clone(j["@default"])),n.isArray(I)||(I=[I]),k[oe]=[{"@preserve":I}]}}for(const oe of Object.keys(D["@reverse"]||{}).sort()){const j=D["@reverse"][oe];for(const ae of Object.keys(y.subjects))r.getValues(y.subjects[ae],oe).some(Z=>Z["@id"]===B)&&(k["@reverse"]=k["@reverse"]||{},r.addValue(k["@reverse"],oe,[],{propertyIsArray:!0}),f.frame({...y,embedded:!0},[ae],j,k["@reverse"][oe],O))}A(U,O,k),y.subjectStack.pop()}}},f.cleanupNull=(y,x)=>{if(n.isArray(y))return y.map(U=>f.cleanupNull(U,x)).filter(U=>U);if(y==="@null")return null;if(n.isObject(y)){if("@id"in y){const D=y["@id"];if(x.link.hasOwnProperty(D)){const U=x.link[D].indexOf(y);if(U!==-1)return x.link[D][U];x.link[D].push(y)}else x.link[D]=[y]}for(const D in y)y[D]=f.cleanupNull(y[D],x)}return y};function h(y){const x={};for(const D in y)y[D]!==void 0&&(x["@"+D]=[y[D]]);return[x]}function m(y,x,D){for(let U=D.length-1;U>=0;--U){const O=D[U];if(O.graph===x&&O.subject["@id"]===y["@id"])return!0}return!1}function _(y,x,D){const U="@"+D;let O=U in y?y[U][0]:x[D];if(D==="embed"){if(O===!0)O="@once";else if(O===!1)O="@never";else if(O!=="@always"&&O!=="@never"&&O!=="@link"&&O!=="@first"&&O!=="@last"&&O!=="@once")throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:y})}return O}function d(y){if(!n.isArray(y)||y.length!==1||!n.isObject(y[0]))throw new a("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:y});if("@id"in y[0]){for(const x of r.asArray(y[0]["@id"]))if(!(n.isObject(x)||o.isAbsolute(x))||n.isString(x)&&x.indexOf("_:")===0)throw new a("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}if("@type"in y[0]){for(const x of r.asArray(y[0]["@type"]))if(!(n.isObject(x)||o.isAbsolute(x)||x==="@json")||n.isString(x)&&x.indexOf("_:")===0)throw new a("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}}function g(y,x,D,U){const O={};for(const Q of x){const M=y.graphMap[y.graph][Q];b(y,M,D,U)&&(O[Q]=M)}return O}function b(y,x,D,U){let O=!0,Q=!1;for(const M in D){let $=!1;const X=r.getValues(x,M),F=r.getValues(D,M).length===0;if(M==="@id"){if(n.isEmptyObject(D["@id"][0]||{})?$=!0:D["@id"].length>=0&&($=D["@id"].includes(X[0])),!U.requireAll)return $}else if(M==="@type"){if(O=!1,F){if(X.length>0)return!1;$=!0}else if(D["@type"].length===1&&n.isEmptyObject(D["@type"][0]))$=X.length>0;else for(const B of D["@type"])n.isObject(B)&&"@default"in B?$=!0:$=$||X.some(ue=>ue===B);if(!U.requireAll)return $}else{if(i(M))continue;{const B=r.getValues(D,M)[0];let ue=!1;if(B&&(d([B]),ue="@default"in B),O=!1,X.length===0&&ue)continue;if(X.length>0&&F)return!1;if(B===void 0){if(X.length>0)return!1;$=!0}else if(e.isList(B)){const k=B["@list"][0];if(e.isList(X[0])){const oe=X[0]["@list"];e.isValue(k)?$=oe.some(j=>S(k,j)):(e.isSubject(k)||e.isSubjectReference(k))&&($=oe.some(j=>R(y,k,j,U)))}}else e.isValue(B)?$=X.some(k=>S(B,k)):e.isSubjectReference(B)?$=X.some(k=>R(y,B,k,U)):n.isObject(B)?$=X.length>0:$=!1}}if(!$&&U.requireAll)return!1;Q=Q||$}return O||Q}function T(y,x){const D=y.uniqueEmbeds[y.graph],U=D[x],O=U.parent,Q=U.property,M={"@id":x};if(n.isArray(O)){for(let X=0;X<O.length;++X)if(r.compareValues(O[X],M)){O[X]=M;break}}else{const X=n.isArray(O[Q]);r.removeValue(O,Q,M,{propertyIsArray:X}),r.addValue(O,Q,M,{propertyIsArray:X})}const $=X=>{const F=Object.keys(D);for(const B of F)B in D&&n.isObject(D[B].parent)&&D[B].parent["@id"]===X&&(delete D[B],$(B))};$(x)}function N(y,x){if(n.isArray(y))return y.map(D=>N(D,x));if(n.isObject(y)){if("@preserve"in y)return y["@preserve"][0];if(e.isValue(y))return y;if(e.isList(y))return y["@list"]=N(y["@list"],x),y;if("@id"in y){const D=y["@id"];if(x.link.hasOwnProperty(D)){const U=x.link[D].indexOf(y);if(U!==-1)return x.link[D][U];x.link[D].push(y)}else x.link[D]=[y]}for(const D in y){if(D==="@id"&&x.bnodesToClear.includes(y[D])){delete y["@id"];continue}y[D]=N(y[D],x)}}return y}function A(y,x,D){n.isObject(y)?r.addValue(y,x,D,{propertyIsArray:!0}):y.push(D)}function R(y,x,D,U){if(!("@id"in D))return!1;const O=y.subjects[D["@id"]];return O&&b(y,O,x,U)}function S(y,x){const D=x["@value"],U=x["@type"],O=x["@language"],Q=y["@value"]?n.isArray(y["@value"])?y["@value"]:[y["@value"]]:[],M=y["@type"]?n.isArray(y["@type"])?y["@type"]:[y["@type"]]:[],$=y["@language"]?n.isArray(y["@language"])?y["@language"]:[y["@language"]]:[];return Q.length===0&&M.length===0&&$.length===0?!0:!(!(Q.includes(D)||n.isEmptyObject(Q[0]))||!(!U&&M.length===0||M.includes(U)||U&&n.isEmptyObject(M[0]))||!(!O&&$.length===0||$.includes(O)||O&&n.isEmptyObject($[0])))}return Za}var Xa,Ud;function Bm(){if(Ud)return Xa;Ud=1;const i=Yt(),{isArray:e,isObject:n,isString:r,isUndefined:o}=zt(),{isList:a,isValue:l,isGraph:u,isSimpleGraph:f,isSubjectReference:h}=Pn(),{expandIri:m,getContextValue:_,isKeyword:d,process:g,processingMode:b}=vi(),{removeBase:T,prependBase:N}=Wn(),{REGEX_KEYWORD:A,addValue:R,asArray:S,compareShortestLeast:y}=Jt(),x={};Xa=x,x.compact=async({activeCtx:O,activeProperty:Q=null,element:M,options:$={}})=>{if(e(M)){let F=[];for(let B=0;B<M.length;++B){const ue=await x.compact({activeCtx:O,activeProperty:Q,element:M[B],options:$});ue!==null&&F.push(ue)}return $.compactArrays&&F.length===1&&(_(O,Q,"@container")||[]).length===0&&(F=F[0]),F}const X=_(O,Q,"@context");if(o(X)||(O=await g({activeCtx:O,localCtx:X,propagate:!0,overrideProtected:!0,options:$})),n(M)){if($.link&&"@id"in M&&$.link.hasOwnProperty(M["@id"])){const I=$.link[M["@id"]];for(let Z=0;Z<I.length;++Z)if(I[Z].expanded===M)return I[Z].compacted}if(l(M)||h(M)){const I=x.compactValue({activeCtx:O,activeProperty:Q,value:M,options:$});return $.link&&h(M)&&($.link.hasOwnProperty(M["@id"])||($.link[M["@id"]]=[]),$.link[M["@id"]].push({expanded:M,compacted:I})),I}if(a(M)&&(_(O,Q,"@container")||[]).includes("@list"))return x.compact({activeCtx:O,activeProperty:Q,element:M["@list"],options:$});const F=Q==="@reverse",B={},ue=O;!l(M)&&!h(M)&&(O=O.revertToPreviousContext());const k=_(ue,Q,"@context");o(k)||(O=await g({activeCtx:O,localCtx:k,propagate:!0,overrideProtected:!0,options:$})),$.link&&"@id"in M&&($.link.hasOwnProperty(M["@id"])||($.link[M["@id"]]=[]),$.link[M["@id"]].push({expanded:M,compacted:B}));let oe=M["@type"]||[];oe.length>1&&(oe=Array.from(oe).sort());const j=O;for(const I of oe){const Z=x.compactIri({activeCtx:j,iri:I,relativeTo:{vocab:!0}}),ie=_(ue,Z,"@context");o(ie)||(O=await g({activeCtx:O,localCtx:ie,options:$,propagate:!1}))}const ae=Object.keys(M).sort();for(const I of ae){const Z=M[I];if(I==="@id"){let ie=S(Z).map(me=>x.compactIri({activeCtx:O,iri:me,relativeTo:{vocab:!1},base:$.base}));ie.length===1&&(ie=ie[0]);const ee=x.compactIri({activeCtx:O,iri:"@id",relativeTo:{vocab:!0}});B[ee]=ie;continue}if(I==="@type"){let ie=S(Z).map(Y=>x.compactIri({activeCtx:ue,iri:Y,relativeTo:{vocab:!0}}));ie.length===1&&(ie=ie[0]);const ee=x.compactIri({activeCtx:O,iri:"@type",relativeTo:{vocab:!0}}),G=(_(O,ee,"@container")||[]).includes("@set")&&b(O,1.1)||e(ie)&&Z.length===0;R(B,ee,ie,{propertyIsArray:G});continue}if(I==="@reverse"){const ie=await x.compact({activeCtx:O,activeProperty:"@reverse",element:Z,options:$});for(const ee in ie)if(O.mappings.has(ee)&&O.mappings.get(ee).reverse){const me=ie[ee],G=(_(O,ee,"@container")||[]).includes("@set")||!$.compactArrays;R(B,ee,me,{propertyIsArray:G}),delete ie[ee]}if(Object.keys(ie).length>0){const ee=x.compactIri({activeCtx:O,iri:I,relativeTo:{vocab:!0}});R(B,ee,ie)}continue}if(I==="@preserve"){const ie=await x.compact({activeCtx:O,activeProperty:Q,element:Z,options:$});e(ie)&&ie.length===0||R(B,I,ie);continue}if(I==="@index"){if((_(O,Q,"@container")||[]).includes("@index"))continue;const ee=x.compactIri({activeCtx:O,iri:I,relativeTo:{vocab:!0}});R(B,ee,Z);continue}if(I!=="@graph"&&I!=="@list"&&I!=="@included"&&d(I)){const ie=x.compactIri({activeCtx:O,iri:I,relativeTo:{vocab:!0}});R(B,ie,Z);continue}if(!e(Z))throw new i("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(Z.length===0){const ie=x.compactIri({activeCtx:O,iri:I,value:Z,relativeTo:{vocab:!0},reverse:F}),ee=O.mappings.has(ie)?O.mappings.get(ie)["@nest"]:null;let me=B;ee&&(U(O,ee,$),n(B[ee])||(B[ee]={}),me=B[ee]),R(me,ie,Z,{propertyIsArray:!0})}for(const ie of Z){const ee=x.compactIri({activeCtx:O,iri:I,value:ie,relativeTo:{vocab:!0},reverse:F}),me=O.mappings.has(ee)?O.mappings.get(ee)["@nest"]:null;let W=B;me&&(U(O,me,$),n(B[me])||(B[me]={}),W=B[me]);const G=_(O,ee,"@container")||[],Y=u(ie),K=a(ie);let le;K?le=ie["@list"]:Y&&(le=ie["@graph"]);let ce=await x.compact({activeCtx:O,activeProperty:ee,element:K||Y?le:ie,options:$});if(K)if(e(ce)||(ce=[ce]),!G.includes("@list"))ce={[x.compactIri({activeCtx:O,iri:"@list",relativeTo:{vocab:!0}})]:ce},"@index"in ie&&(ce[x.compactIri({activeCtx:O,iri:"@index",relativeTo:{vocab:!0}})]=ie["@index"]);else{R(W,ee,ce,{valueIsArray:!0,allowDuplicate:!0});continue}if(Y)if(G.includes("@graph")&&(G.includes("@id")||G.includes("@index")&&f(ie))){let Ee;W.hasOwnProperty(ee)?Ee=W[ee]:W[ee]=Ee={};const Te=(G.includes("@id")?ie["@id"]:ie["@index"])||x.compactIri({activeCtx:O,iri:"@none",relativeTo:{vocab:!0}});R(Ee,Te,ce,{propertyIsArray:!$.compactArrays||G.includes("@set")})}else G.includes("@graph")&&f(ie)?(e(ce)&&ce.length>1&&(ce={"@included":ce}),R(W,ee,ce,{propertyIsArray:!$.compactArrays||G.includes("@set")})):(e(ce)&&ce.length===1&&$.compactArrays&&(ce=ce[0]),ce={[x.compactIri({activeCtx:O,iri:"@graph",relativeTo:{vocab:!0}})]:ce},"@id"in ie&&(ce[x.compactIri({activeCtx:O,iri:"@id",relativeTo:{vocab:!0}})]=ie["@id"]),"@index"in ie&&(ce[x.compactIri({activeCtx:O,iri:"@index",relativeTo:{vocab:!0}})]=ie["@index"]),R(W,ee,ce,{propertyIsArray:!$.compactArrays||G.includes("@set")}));else if(G.includes("@language")||G.includes("@index")||G.includes("@id")||G.includes("@type")){let Ee;W.hasOwnProperty(ee)?Ee=W[ee]:W[ee]=Ee={};let Te;if(G.includes("@language"))l(ce)&&(ce=ce["@value"]),Te=ie["@language"];else if(G.includes("@index")){const q=_(O,ee,"@index")||"@index",te=x.compactIri({activeCtx:O,iri:q,relativeTo:{vocab:!0}});if(q==="@index")Te=ie["@index"],delete ce[te];else{let fe;if([Te,...fe]=S(ce[q]||[]),!r(Te))Te=null;else switch(fe.length){case 0:delete ce[q];break;case 1:ce[q]=fe[0];break;default:ce[q]=fe;break}}}else if(G.includes("@id")){const q=x.compactIri({activeCtx:O,iri:"@id",relativeTo:{vocab:!0}});Te=ce[q],delete ce[q]}else if(G.includes("@type")){const q=x.compactIri({activeCtx:O,iri:"@type",relativeTo:{vocab:!0}});let te;switch([Te,...te]=S(ce[q]||[]),te.length){case 0:delete ce[q];break;case 1:ce[q]=te[0];break;default:ce[q]=te;break}Object.keys(ce).length===1&&"@id"in ie&&(ce=await x.compact({activeCtx:O,activeProperty:ee,element:{"@id":ie["@id"]},options:$}))}Te||(Te=x.compactIri({activeCtx:O,iri:"@none",relativeTo:{vocab:!0}})),R(Ee,Te,ce,{propertyIsArray:G.includes("@set")})}else{const Ee=!$.compactArrays||G.includes("@set")||G.includes("@list")||e(ce)&&ce.length===0||I==="@list"||I==="@graph";R(W,ee,ce,{propertyIsArray:Ee})}}}return B}return M},x.compactIri=({activeCtx:O,iri:Q,value:M=null,relativeTo:$={vocab:!1},reverse:X=!1,base:F=null})=>{if(Q===null)return Q;O.isPropertyTermScoped&&O.previousContext&&(O=O.previousContext);const B=O.getInverse();if(d(Q)&&Q in B&&"@none"in B[Q]&&"@type"in B[Q]["@none"]&&"@none"in B[Q]["@none"]["@type"])return B[Q]["@none"]["@type"]["@none"];if($.vocab&&Q in B){const ae=O["@language"]||"@none",I=[];n(M)&&"@index"in M&&!("@graph"in M)&&I.push("@index","@index@set"),n(M)&&"@preserve"in M&&(M=M["@preserve"][0]),u(M)?("@index"in M&&I.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in M&&I.push("@graph@id","@graph@id@set"),I.push("@graph","@graph@set","@set"),"@index"in M||I.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in M||I.push("@graph@id","@graph@id@set")):n(M)&&!l(M)&&I.push("@id","@id@set","@type","@set@type");let Z="@language",ie="@null";if(X)Z="@type",ie="@reverse",I.push("@set");else if(a(M)){"@index"in M||I.push("@list");const me=M["@list"];if(me.length===0)Z="@any",ie="@none";else{let W=me.length===0?ae:null,G=null;for(let Y=0;Y<me.length;++Y){const K=me[Y];let le="@none",ce="@none";if(l(K))if("@direction"in K){const Ee=(K["@language"]||"").toLowerCase(),Te=K["@direction"];le=`${Ee}_${Te}`}else"@language"in K?le=K["@language"].toLowerCase():"@type"in K?ce=K["@type"]:le="@null";else ce="@id";if(W===null?W=le:le!==W&&l(K)&&(W="@none"),G===null?G=ce:ce!==G&&(G="@none"),W==="@none"&&G==="@none")break}W=W||"@none",G=G||"@none",G!=="@none"?(Z="@type",ie=G):ie=W}}else{if(l(M))if("@language"in M&&!("@index"in M)){I.push("@language","@language@set"),ie=M["@language"];const me=M["@direction"];me&&(ie=`${ie}_${me}`)}else"@direction"in M&&!("@index"in M)?ie=`_${M["@direction"]}`:"@type"in M&&(Z="@type",ie=M["@type"]);else Z="@type",ie="@id";I.push("@set")}I.push("@none"),n(M)&&!("@index"in M)&&I.push("@index","@index@set"),l(M)&&Object.keys(M).length===1&&I.push("@language","@language@set");const ee=D(O,Q,M,I,Z,ie);if(ee!==null)return ee}if($.vocab&&"@vocab"in O){const ae=O["@vocab"];if(Q.indexOf(ae)===0&&Q!==ae){const I=Q.substr(ae.length);if(!O.mappings.has(I))return I}}let ue=null;const k=[];let oe=O.fastCurieMap;const j=Q.length-1;for(let ae=0;ae<j&&Q[ae]in oe;++ae)oe=oe[Q[ae]],""in oe&&k.push(oe[""][0]);for(let ae=k.length-1;ae>=0;--ae){const I=k[ae],Z=I.terms;for(const ie of Z){const ee=ie+":"+Q.substr(I.iri.length);O.mappings.get(ie)._prefix&&(!O.mappings.has(ee)||M===null&&O.mappings.get(ee)["@id"]===Q)&&(ue===null||y(ee,ue)<0)&&(ue=ee)}}if(ue!==null)return ue;for(const[ae,I]of O.mappings)if(I&&I._prefix&&Q.startsWith(ae+":"))throw new i(`Absolute IRI "${Q}" confused with prefix "${ae}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:O});if(!$.vocab)if("@base"in O)if(O["@base"]){const ae=T(N(F,O["@base"]),Q);return A.test(ae)?`./${ae}`:ae}else return Q;else return T(F,Q);return Q},x.compactValue=({activeCtx:O,activeProperty:Q,value:M,options:$})=>{if(l(M)){const ue=_(O,Q,"@type"),k=_(O,Q,"@language"),oe=_(O,Q,"@direction"),j=_(O,Q,"@container")||[],ae="@index"in M&&!j.includes("@index");if(!ae&&ue!=="@none"&&(M["@type"]===ue||"@language"in M&&M["@language"]===k&&"@direction"in M&&M["@direction"]===oe||"@language"in M&&M["@language"]===k||"@direction"in M&&M["@direction"]===oe))return M["@value"];const I=Object.keys(M).length,Z=I===1||I===2&&"@index"in M&&!ae,ie="@language"in O,ee=r(M["@value"]),me=O.mappings.has(Q)&&O.mappings.get(Q)["@language"]===null;if(Z&&ue!=="@none"&&(!ie||!ee||me))return M["@value"];const W={};return ae&&(W[x.compactIri({activeCtx:O,iri:"@index",relativeTo:{vocab:!0}})]=M["@index"]),"@type"in M?W[x.compactIri({activeCtx:O,iri:"@type",relativeTo:{vocab:!0}})]=x.compactIri({activeCtx:O,iri:M["@type"],relativeTo:{vocab:!0}}):"@language"in M&&(W[x.compactIri({activeCtx:O,iri:"@language",relativeTo:{vocab:!0}})]=M["@language"]),"@direction"in M&&(W[x.compactIri({activeCtx:O,iri:"@direction",relativeTo:{vocab:!0}})]=M["@direction"]),W[x.compactIri({activeCtx:O,iri:"@value",relativeTo:{vocab:!0}})]=M["@value"],W}const X=m(O,Q,{vocab:!0},$),F=_(O,Q,"@type"),B=x.compactIri({activeCtx:O,iri:M["@id"],relativeTo:{vocab:F==="@vocab"},base:$.base});return F==="@id"||F==="@vocab"||X==="@graph"?B:{[x.compactIri({activeCtx:O,iri:"@id",relativeTo:{vocab:!0}})]:B}};function D(O,Q,M,$,X,F){F===null&&(F="@null");const B=[];if((F==="@id"||F==="@reverse")&&n(M)&&"@id"in M){F==="@reverse"&&B.push("@reverse");const k=x.compactIri({activeCtx:O,iri:M["@id"],relativeTo:{vocab:!0}});O.mappings.has(k)&&O.mappings.get(k)&&O.mappings.get(k)["@id"]===M["@id"]?B.push.apply(B,["@vocab","@id"]):B.push.apply(B,["@id","@vocab"])}else{B.push(F);const k=B.find(oe=>oe.includes("_"));k&&B.push(k.replace(/^[^_]+_/,"_"))}B.push("@none");const ue=O.inverse[Q];for(const k of $){if(!(k in ue))continue;const oe=ue[k][X];for(const j of B)if(j in oe)return oe[j]}return null}function U(O,Q,M){if(m(O,Q,{vocab:!0},M)!=="@nest")throw new i("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}return Xa}var Qa,Hd;function $m(){return Hd||(Hd=1,Qa=i=>{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(n,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):i.compact(n,r)},e.expand=function(n){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):i.expand(n)},e.flatten=function(n){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):i.flatten(n)},e}),Qa}var Ja,Vd;function qm(){if(Vd)return Ja;Vd=1;const i=Wl(),e=Im(),n=Jt(),r=Cm(),o=n.IdentifierIssuer,a=Yt(),l=qf(),u=Pm(),{expand:f}=km(),{flatten:h}=Dm(),{fromRDF:m}=Mm(),{toRDF:_}=Fm(),{frameMergedOrDefault:d,cleanupNull:g}=jm(),{isArray:b,isObject:T,isString:N}=zt(),{isSubjectReference:A}=Pn(),{expandIri:R,getInitialContext:S,process:y,processingMode:x}=vi(),{compact:D,compactIri:U}=Bm(),{createNodeMap:O,createMergedNodeMap:Q,mergeNodeMaps:M}=eo(),{logEventHandler:$,logWarningEventHandler:X,safeEventHandler:F,setDefaultEventHandler:B,setupEventHandler:ue,strictEventHandler:k,unhandledEventHandler:oe}=Zr(),j=function(I){const Z={},ee=new l({max:100});I.compact=async function(W,G,Y){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(G===null)throw new a("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(W===null)return null;Y=me(Y,{base:N(W)?W:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new o("_:b"),contextResolver:new r({sharedCache:ee})}),Y.link&&(Y.skipExpansion=!0),Y.compactToRelative||delete Y.base;let K;Y.skipExpansion?K=W:K=await I.expand(W,Y);const le=await I.processContext(S(Y),G,Y);let ce=await D({activeCtx:le,element:K,options:Y});Y.compactArrays&&!Y.graph&&b(ce)?ce.length===1?ce=ce[0]:ce.length===0&&(ce={}):Y.graph&&T(ce)&&(ce=[ce]),T(G)&&"@context"in G&&(G=G["@context"]),G=n.clone(G),b(G)||(G=[G]);const Ee=G;G=[];for(let q=0;q<Ee.length;++q)(!T(Ee[q])||Object.keys(Ee[q]).length>0)&&G.push(Ee[q]);const Te=G.length>0;if(G.length===1&&(G=G[0]),b(ce)){const q=U({activeCtx:le,iri:"@graph",relativeTo:{vocab:!0}}),te=ce;ce={},Te&&(ce["@context"]=G),ce[q]=te}else if(T(ce)&&Te){const q=ce;ce={"@context":G};for(const te in q)ce[te]=q[te]}return ce},I.expand=async function(W,G){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");G=me(G,{keepFreeFloatingNodes:!1,contextResolver:new r({sharedCache:ee})});const Y={},K=[];if("expandContext"in G){const Te=n.clone(G.expandContext);T(Te)&&"@context"in Te?Y.expandContext=Te:Y.expandContext={"@context":Te},K.push(Y.expandContext)}let le;if(!N(W))Y.input=n.clone(W);else{const Te=await I.get(W,G);le=Te.documentUrl,Y.input=Te.document,Te.contextUrl&&(Y.remoteContext={"@context":Te.contextUrl},K.push(Y.remoteContext))}"base"in G||(G.base=le||"");let ce=S(G);for(const Te of K)ce=await y({activeCtx:ce,localCtx:Te,options:G});let Ee=await f({activeCtx:ce,element:Y.input,options:G});return T(Ee)&&"@graph"in Ee&&Object.keys(Ee).length===1?Ee=Ee["@graph"]:Ee===null&&(Ee=[]),b(Ee)||(Ee=[Ee]),Ee},I.flatten=async function(W,G,Y){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");typeof G=="function"?G=null:G=G||null,Y=me(Y,{base:N(W)?W:"",contextResolver:new r({sharedCache:ee})});const K=await I.expand(W,Y),le=h(K);return G===null?le:(Y.graph=!0,Y.skipExpansion=!0,await I.compact(le,G,Y))},I.frame=async function(W,G,Y){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Y=me(Y,{base:N(W)?W:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new r({sharedCache:ee})}),N(G)){const xe=await I.get(G,Y);if(G=xe.document,xe.contextUrl){let Se=G["@context"];Se?b(Se)?Se.push(xe.contextUrl):Se=[Se,xe.contextUrl]:Se=xe.contextUrl,G["@context"]=Se}}const K=G?G["@context"]||{}:{},le=await I.processContext(S(Y),K,Y);Y.hasOwnProperty("omitGraph")||(Y.omitGraph=x(le,1.1)),Y.hasOwnProperty("pruneBlankNodeIdentifiers")||(Y.pruneBlankNodeIdentifiers=x(le,1.1));const ce=await I.expand(W,Y),Ee={...Y};Ee.isFrame=!0,Ee.keepFreeFloatingNodes=!0;const Te=await I.expand(G,Ee),q=Object.keys(G).map(xe=>R(le,xe,{vocab:!0}));Ee.merged=!q.includes("@graph"),Ee.is11=x(le,1.1);const te=d(ce,Te,Ee);Ee.graph=!Y.omitGraph,Ee.skipExpansion=!0,Ee.link={},Ee.framing=!0;let fe=await I.compact(te,K,Ee);return Ee.link={},fe=g(fe,Ee),fe},I.link=async function(W,G,Y){const K={};return G&&(K["@context"]=G),K["@embed"]="@link",I.frame(W,K,Y)},I.normalize=I.canonize=async function(W,G){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if(G=me(G,{base:N(W)?W:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new r({sharedCache:ee})}),"inputFormat"in G){if(G.inputFormat!=="application/n-quads"&&G.inputFormat!=="application/nquads")throw new a("Unknown canonicalization input format.","jsonld.CanonizeError");const le=u.parse(W);return i.canonize(le,G)}const Y={...G};delete Y.format,Y.produceGeneralizedRdf=!1;const K=await I.toRDF(W,Y);return i.canonize(K,G)},I.fromRDF=async function(W,G){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");G=me(G,{format:N(W)?"application/n-quads":void 0});const{format:Y}=G;let{rdfParser:K}=G;if(Y){if(K=K||Z[Y],!K)throw new a("Unknown input format.","jsonld.UnknownFormat",{format:Y})}else K=()=>W;const le=await K(W);return m(le,G)},I.toRDF=async function(W,G){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");G=me(G,{base:N(W)?W:"",skipExpansion:!1,contextResolver:new r({sharedCache:ee})});let Y;G.skipExpansion?Y=W:Y=await I.expand(W,G);const K=_(Y,G);if(G.format){if(G.format==="application/n-quads"||G.format==="application/nquads")return u.serialize(K);throw new a("Unknown output format.","jsonld.UnknownFormat",{format:G.format})}return K},I.createNodeMap=async function(W,G){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");G=me(G,{base:N(W)?W:"",contextResolver:new r({sharedCache:ee})});const Y=await I.expand(W,G);return Q(Y,G)},I.merge=async function(W,G,Y){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!b(W))throw new TypeError('Could not merge, "docs" must be an array.');typeof G=="function"?G=null:G=G||null,Y=me(Y,{contextResolver:new r({sharedCache:ee})});const K=await Promise.all(W.map(xe=>{const Se={...Y};return I.expand(xe,Se)}));let le=!0;"mergeNodes"in Y&&(le=Y.mergeNodes);const ce=Y.issuer||new o("_:b"),Ee={"@default":{}};for(let xe=0;xe<K.length;++xe){const Se=n.relabelBlankNodes(K[xe],{issuer:new o("_:b"+xe+"-")}),Ie=le||xe===0?Ee:{"@default":{}};if(O(Se,Ie,"@default",ce),Ie!==Ee)for(const se in Ie){const be=Ie[se];if(!(se in Ee)){Ee[se]=be;continue}const Ne=Ee[se];for(const ve in be)ve in Ne||(Ne[ve]=be[ve])}}const Te=M(Ee),q=[],te=Object.keys(Te).sort();for(let xe=0;xe<te.length;++xe){const Se=Te[te[xe]];A(Se)||q.push(Se)}return G===null?q:(Y.graph=!0,Y.skipExpansion=!0,await I.compact(q,G,Y))},Object.defineProperty(I,"documentLoader",{get:()=>I._documentLoader,set:W=>I._documentLoader=W}),I.documentLoader=async W=>{throw new a("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:W})},I.get=async function(W,G){let Y;typeof G.documentLoader=="function"?Y=G.documentLoader:Y=I.documentLoader;const K=await Y(W);try{if(!K.document)throw new a("No remote document found at the given URL.","jsonld.NullRemoteDocument");N(K.document)&&(K.document=JSON.parse(K.document))}catch(le){throw new a("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:le,remoteDoc:K})}return K},I.processContext=async function(W,G,Y){return Y=me(Y,{base:"",contextResolver:new r({sharedCache:ee})}),G===null?S(Y):(G=n.clone(G),T(G)&&"@context"in G||(G={"@context":G}),y({activeCtx:W,localCtx:G,options:Y}))},I.getContextValue=vi().getContextValue,I.documentLoaders={},I.useDocumentLoader=function(W){if(!(W in I.documentLoaders))throw new a('Unknown document loader type: "'+W+'"',"jsonld.UnknownDocumentLoader",{type:W});I.documentLoader=I.documentLoaders[W].apply(I,Array.prototype.slice.call(arguments,1))},I.registerRDFParser=function(W,G){Z[W]=G},I.unregisterRDFParser=function(W){delete Z[W]},I.registerRDFParser("application/n-quads",u.parse),I.registerRDFParser("application/nquads",u.parse),I.url=Wn(),I.logEventHandler=$,I.logWarningEventHandler=X,I.safeEventHandler=F,I.setDefaultEventHandler=B,I.strictEventHandler=k,I.unhandledEventHandler=oe,I.util=n,Object.assign(I,n),I.promises=I,I.RequestQueue=$f(),I.JsonLdProcessor=$m()(I),e.setupGlobals(I),e.setupDocumentLoaders(I);function me(W,{documentLoader:G=I.documentLoader,...Y}){if(W&&"compactionMap"in W)throw new a('"compactionMap" not supported.',"jsonld.OptionsError");if(W&&"expansionMap"in W)throw new a('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:G},Y,W,{eventHandler:ue({options:W})})}return I},ae=function(){return j(function(){return ae()})};return j(ae),Ja=ae,Ja}var zm=qm();const Um=sf(zm),xs={},Ka={},zi={};async function Hm(i){const e={store:new It,importedUrls:[],importedClasses:[],atts:i},n=[];if(i.shapes?n.push(pi(js(i.shapes),e,gi)):i.shapesUrl&&n.push(pi(Ns(i.shapesUrl,e.atts.proxy),e,gi)),i.values?n.push(pi(js(i.values),e,$t)):i.valuesUrl&&n.push(pi(Ns(i.valuesUrl,e.atts.proxy),e,$t)),await Promise.all(n),i.valuesSubject&&e.store.countQuads(null,null,null,gi)===0){const r=[...e.store.getObjects(i.valuesSubject,Nt,$t),...e.store.getObjects(i.valuesSubject,Os,$t)],o=[];for(const a of r){const l=zf(a.value);l&&e.importedUrls.indexOf(l)<0&&(e.importedUrls.push(l),o.push(pi(Ns(l,e.atts.proxy),e,gi)))}try{await Promise.allSettled(o)}catch(a){console.warn(a)}}return e.store}async function pi(i,e,n){const r=await i,o=[];for(const a of r){let l=n;if(e.atts.valuesSubject&&$t.equals(n)&&a.graph.id&&a.graph.id!==e.atts.valuesSubject&&(l=a.graph),e.store.add(new Gs(a.subject,a.predicate,a.object,l)),zl.equals(a.predicate)&&e.atts.loadOwlImports){const u=zf(a.object.value);u&&e.importedUrls.indexOf(u)<0&&(e.importedUrls.push(u),o.push(pi(Ns(u,e.atts.proxy),e,ze.namedNode(u))))}if(e.atts.classInstanceProvider&&(Ul.equals(a.predicate)||Ks.equals(a.predicate))){const u=a.object.value;if(e.importedClasses.indexOf(u)<0){let f;u in Ka?f=Ka[u]:(f=e.atts.classInstanceProvider(u),Ka[u]=f),e.importedClasses.push(u),o.push(pi(js(await f),e,gi))}}}await Promise.allSettled(o)}async function Ns(i,e){return i in xs||(xs[i]=new Promise(async(n,r)=>{try{let o=i;e&&(o=e+encodeURIComponent(i));const a=await fetch(o,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then(l=>l.text());n(await js(a))}catch(o){r(o)}})),xs[i]}async function js(i){if(Gd(i)==="json")try{i=await Um.toRDF(JSON.parse(i),{format:"application/n-quads"})}catch(n){console.error(n)}const e=[];return await new Promise((n,r)=>{const o=Gd(i)==="xml"?new ym.RdfXmlParser:new Xg;o.on("data",a=>{e.push(new Gs(a.subject,a.predicate,a.object,a.graph))}).on("error",a=>{r(a)}).on("prefix",(a,l)=>{a&&(zi[a]=l)}).on("end",()=>{n(null)}),o.write(i),o.end()}),e}function zf(i){if(Ll(i))return i;const e=i.split(":");if(e.length===2){const n=zi[e[0]];if(n&&(i=i.replace(`${e[0]}:`,n),Ll(i)))return i}return null}function Gd(i){return/^\s*\{/.test(i)?"json":/^\s*<\?xml/.test(i)?"xml":"ttl"}const Vm={[`${Fe}name`]:(i,e)=>{const n=e;i.name=Fs(i.config.languages,i.name,n)},[`${Fe}description`]:(i,e)=>{const n=e;i.description=Fs(i.config.languages,i.description,n)},[`${Fe}path`]:(i,e)=>{i.path=e.value},[`${Fe}group`]:(i,e)=>{i.group=e.id},[`${Fe}datatype`]:(i,e)=>{i.datatype=e},[`${Fe}nodeKind`]:(i,e)=>{i.nodeKind=e},[`${Fe}minCount`]:(i,e)=>{i.minCount=parseInt(e.value)},[`${Fe}maxCount`]:(i,e)=>{i.maxCount=parseInt(e.value)},[`${Fe}minLength`]:(i,e)=>{i.minLength=parseInt(e.value)},[`${Fe}maxLength`]:(i,e)=>{i.maxLength=parseInt(e.value)},[`${Fe}minInclusive`]:(i,e)=>{i.minInclusive=parseInt(e.value)},[`${Fe}maxInclusive`]:(i,e)=>{i.maxInclusive=parseInt(e.value)},[`${Fe}minExclusive`]:(i,e)=>{i.minExclusive=parseInt(e.value)},[`${Fe}maxExclusive`]:(i,e)=>{i.maxExclusive=parseInt(e.value)},[`${Fe}pattern`]:(i,e)=>{i.pattern=e.value},[`${Fe}order`]:(i,e)=>{i.order=parseInt(e.value)},[`${qc}singleLine`]:(i,e)=>{i.singleLine=e.value==="true"},[`${qc}readonly`]:(i,e)=>{i.readonly=e.value==="true"},[`${Jg}styleClass`]:(i,e)=>{i.cssClass=e.value},[`${Fe}in`]:(i,e)=>{i.in=e.value},[`${Fe}languageIn`]:(i,e)=>{i.languageIn=i.config.lists[e.value],i.datatype=Tf},[`${Fe}defaultValue`]:(i,e)=>{i.defaultValue=e},[`${Fe}hasValue`]:(i,e)=>{i.hasValue=e},[`${Fe}node`]:(i,e)=>{i.node=e,i.nodeShapes.add(i.config.getNodeTemplate(e,i))},[`${Fe}and`]:(i,e)=>{i.and=e.value;const n=i.config.lists[i.and];if(n?.length)for(const r of n)i.nodeShapes.add(i.config.getNodeTemplate(r,i))},[`${Fe}qualifiedValueShape`]:(i,e)=>{const n=i.config.getNodeTemplate(e,i);i.qualifiedValueShape=n,i.nodeShapes.add(n)},[`${Fe}qualifiedMinCount`]:(i,e)=>{i.qualifiedMinCount=parseInt(e.value)},[`${Fe}qualifiedMaxCount`]:(i,e)=>{i.qualifiedMaxCount=parseInt(e.value)},[zl.id]:(i,e)=>{i.owlImports.add(e)},[Ul.id]:(i,e)=>{i.class=e;const n=i.config.store.getSubjects(Ks,e,null);n.length>0&&(i.node=n[0])},[`${Fe}or`]:(i,e)=>{const n=i.config.lists[e.value];n?.length?i.or=n:console.error("list for sh:or not found:",e.value,"existing lists:",i.config.lists)},[`${Fe}xone`]:(i,e)=>{const n=i.config.lists[e.value];n?.length?i.xone=n:console.error("list for sh:xone not found:",e.value,"existing lists:",i.config.lists)}};class Wd{constructor(e,n){this.label="",this.nodeShapes=new Set,this.owlImports=new Set,this.id=e,this.parent=n,this.config=n.config,this.config.registerPropertyTemplate(this),Xl(this,this.config.store.getQuads(e,null,null,null))}}function yi(i){return Math.max(i.minCount||0,i.qualifiedMinCount||0)}function Uf(i){const e=Object.assign({},i);return e.nodeShapes=new Set(i.nodeShapes),e.owlImports=new Set(i.owlImports),i.languageIn&&(e.languageIn=[...i.languageIn]),i.or&&(e.or=[...i.or]),i.xone&&(e.xone=[...i.xone]),e}function Xl(i,e){for(const n of e)Vm[n.predicate.id]?.call(i,i,n.object);return i.label=i.name?.value||Qi(e,i.config.languages),i.label||(i.label=i.path?Tl(i.path,zi):"unknown"),i}function Hf(i,e){const n=e,r=i;for(const o in e)o!=="parent"&&o!=="config"&&o!=="id"&&n[o]!==void 0&&n[o]!==""&&(Array.isArray(n[o])?r[o].push(...n[o]):n[o]instanceof Set&&n[o].size?r[o]=new Set([...r[o],...n[o]]):r[o]=n[o])}function Vf(i,e,n){const r=document.createElement("div");r.classList.add("shacl-or-constraint");const o=[];if(e instanceof Ti){const a=[];let l=!1;i.length&&(l=n.store.countQuads(i[0],Sl,null,null)>0);for(let h=0;h<i.length;h++)if(l){const m=n.store.getObjects(i[h],Sl,null),_=[];let d="";for(const g of m){const b=n.getPropertyTemplate(g,e.template),T=new zs(b,e);_.push(T),d+=(d.length>1?" / ":"")+T.template.label}a.push(_),o.push({label:d,value:h.toString()})}else{const m=i[h],_=n.getPropertyTemplate(m,e.template),d=new zs(_,e);a.push([d]),o.push({label:d.template.label,value:h.toString()})}const u=n.theme.createListEditor("Please choose",null,!1,o),f=u.querySelector(".editor");f.onchange=()=>{if(f.value){const h=a[parseInt(f.value)];let m;h.length&&(m=h[0],r.replaceWith(h[0]));for(let _=1;_<h.length;_++)m.after(h[_]),m=h[_]}},r.appendChild(u)}else{const a=[];for(let f=0;f<i.length;f++){const h=n.store.getQuads(i[f],null,null,null);h.length&&(a.push(h),o.push({label:Qi(h,n.languages)||Tl(h[0].predicate.value,zi)+" = "+Tl(h[0].object.value,zi),value:f.toString()}))}const l=n.theme.createListEditor(e.template.label+"?",null,!1,o,e.template),u=l.querySelector(".editor");u.onchange=()=>{if(u.value){const f=Xl(Uf(e.template),a[parseInt(u.value)]);r.replaceWith(Rl(f,void 0,!0))}},r.appendChild(l)}return r}function Gm(i,e,n){if(e instanceof Qt){const r=e.datatype;for(const o of i){const a=n.store.getQuads(o,null,null,null);for(const l of a)if(l.predicate.value===`${Fe}datatype`&&l.object.equals(r))return a}}else{const r=n.store.getObjects(e,Nt,null);for(const o of i){const a=n.store.getQuads(o,null,null,null);for(const l of a)if(r.length>0){if(l.predicate.value===`${Fe}node`){for(const u of r)if(n.store.getQuads(l.object,Ks,u,null).length>0)return a}if(l.predicate.equals(Ul)){for(const u of r)if(l.object.equals(u))return a}}else if(l.predicate.equals(tm)&&l.object.equals(Lf))return a}}return console.error("couldn't resolve sh:or/sh:xone on property for value",e),[]}function Wm(i,e,n){for(const r of i){let o=!1;const a=n.store.getObjects(r,Sl,null);for(const l of a){const u=n.store.getObjects(l,`${Fe}path`,null);for(const f of u)if(o=n.store.countQuads(e,f,null,null)>0,o)break}if(o)return a}return console.error("couldn't resolve sh:or/sh:xone on node for value",e),[]}const Zm=`form { display:block; --label-width: 16em; --caret-size: 10px; }\r
34
+ form.mode-edit { padding-left: 1em; }\r
35
+ form, form * { box-sizing: border-box; }\r
36
+ shacl-node, .collapsible::part(content) {\r
37
+ display: flex;\r
38
+ flex-direction: column;\r
39
+ width: 100%;\r
40
+ position: relative;\r
41
+ gap: 10px;\r
42
+ }\r
43
+ shacl-node .remove-button { margin-top: 1px; }\r
44
+ shacl-node .add-button { color: #555; background-color: transparent; margin: 4px 24px 0 0; border: 0; }\r
45
+ shacl-node .add-button:hover { color:#222; }\r
46
+ shacl-node .add-button:focus { box-shadow: none; }\r
47
+ shacl-node h1 { font-size: 16px; border-bottom: 1px solid #AAA; margin-top: 4px; color: #555; }\r
48
+ shacl-property:not(:has(>.collapsible)), \r
49
+ shacl-property>.collapsible::part(content) {\r
50
+ display: flex;\r
51
+ flex-direction: column;\r
52
+ align-items: flex-start;\r
53
+ position: relative;\r
54
+ }shacl-property:not(.may-add) > .add-button, shacl-property:not(.may-add) > .collapsible > .add-button { display: none; }\r
55
+ shacl-property:not(.may-remove) > .property-instance > .remove-button:not(.persistent) { visibility: hidden; }\r
56
+ shacl-property:not(.may-remove) > .collapsible > .property-instance > .remove-button:not(.persistent) { visibility: hidden; }\r
57
+ shacl-property:not(.may-remove) > .shacl-or-constraint > .remove-button:not(.persistent) { visibility: hidden; }\r
58
+ .mode-view .shacl-group:not(:has(shacl-property)) { display: none; }\r
59
+ .property-instance,\r
60
+ .shacl-or-constraint {\r
61
+ display: flex;\r
62
+ align-items: flex-start;\r
63
+ width: 100%;\r
64
+ }\r
65
+ \r
66
+ /* L’editor deve riempire la colonna */\r
67
+ .editor:not([type='checkbox']) {\r
68
+ width: 100%;\r
69
+ min-width: 0; /* IMPORTANTISSIMO con grid */\r
70
+ }/*.shacl-or-constraint > div { display: flex; align-items: flex-start; }\r
71
+ .shacl-or-constraint > div:first-child { flex-grow: 1 }*/\r
72
+ .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; }\r
73
+ .property-instance label[title] { cursor: help; text-decoration: underline dashed #AAA; }\r
74
+ .property-instance label,\r
75
+ .shacl-or-constraint label {\r
76
+ width: var(--label-width);\r
77
+ flex-shrink: 0;\r
78
+ text-align: left;\r
79
+ }\r
80
+ .property-instance.linked label:after, label.linked:after { content: '\\1F517'; font-size: 0.6em; padding-left: 6px; }\r
81
+ .mode-edit .property-instance label.required::before { color: red; content: '\\2736'; font-size: 0.6rem; position: absolute; left: -1.4em; top: 0.15rem; }\r
82
+ .property-instance.valid::before { content: ''; position: absolute; left: calc(var(--label-width) - 1em); top:0.5em; width: 0.9em; height: 0.9em; background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1024 1024" fill="green" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M866.133333 258.133333L362.666667 761.6l-204.8-204.8L98.133333 618.666667 362.666667 881.066667l563.2-563.2z"/></svg>'); }\r
83
+ \r
84
+ textarea.editor { resize: vertical; }\r
85
+ .lang-chooser { border: 0; background-color: #e9e9ed; padding: 2px 4px; align-self: flex-start; }\r
86
+ .validation-error { position: absolute; left: calc(var(--label-width) - 1em); color: red; cursor: help; }\r
87
+ .validation-error::before { content: '\\26a0' }\r
88
+ .validation-error.node { left: -1em; }\r
89
+ .invalid > .editor { border-color: red !important; }\r
90
+ .ml-0 { margin-left: 0 !important; }\r
91
+ .pr-0 { padding-right: 0 !important; }\r
92
+ .mode-view .property-instance:not(:first-child) > label { visibility: hidden; }\r
93
+ .mode-view .property-instance label { width: var(--label-width); }\r
94
+ \r
95
+ .d-flex { display: flex; }\r
96
+ .lang { opacity: 0.65; font-size: 0.6em; }\r
97
+ a, a:visited { color: inherit; }\r
98
+ h3 { margin-top: 0; }\r
99
+ \r
100
+ .fadeIn, .fadeOut { animation: fadeIn 0.2s ease-out; }\r
101
+ .fadeOut { animation-direction: reverse; animation-timing-function: ease-out;}\r
102
+ @keyframes fadeIn {\r
103
+ 0% { opacity: 0; transform: scaleY(0.8); }\r
104
+ 100% { opacity: 1; transform: scaleY(1); }\r
105
+ }\r
106
+ .collapsible::part(label) { font-weight: 600; }\r
107
+ .collapsible > .property-instance:nth-child(even) { background-color: #F8F8F8; }\r
108
+ .collapsible > .property-instance > shacl-node > h1 { display: none; }\r
109
+ .ref-link { cursor: pointer; }\r
110
+ .ref-link:hover { text-decoration: underline; }\r
111
+ .node-id-display { color: #999; font-size: 11px; }\r
112
+ /* hierarchy colors */\r
113
+ .colorize { --hierarchy-color-width: 3px; padding: 0 1px 0 calc(1px + var(--hierarchy-color-width)); align-self: stretch; position: relative; }\r
114
+ .colorize::before {\r
115
+ content: '';\r
116
+ position: absolute;\r
117
+ width: var(--hierarchy-color-width);\r
118
+ top: 0; bottom: 0; left: 0;\r
119
+ --index: mod(var(--hierarchy-level), var(--hierarchy-colors-length));\r
120
+ background: linear-gradient(var(--hierarchy-colors)) no-repeat 0 calc(var(--index) * 100% / (var(--hierarchy-colors-length) - 1)) / 100% calc(1px * infinity);\r
121
+ }\r
122
+ .property-instance:not(:has(shacl-node)) > .colorize::before { background: 0; }\r
123
+ .mode-view .property-instance > .colorize { order: -1; padding-left: calc(8px + var(--hierarchy-color-width)); }\r
124
+ \r
125
+ .property-instance > :not(label):not(.remove-button),\r
126
+ .shacl-or-constraint > :not(label):not(.remove-button) {\r
127
+ flex: 1 1 auto;\r
128
+ min-width: 0;\r
129
+ }\r
130
+ \r
131
+ .property-instance rokit-input,\r
132
+ .property-instance rokit-input.editor {\r
133
+ display: block;\r
134
+ width: 100%;\r
135
+ min-width: 0;\r
136
+ }\r
137
+ .property-instance rokit-input::part(input) {\r
138
+ width: 100% !important;\r
139
+ min-width: 0;\r
140
+ }\r
141
+ .property-instance rokit-input {\r
142
+ display: block;\r
143
+ width: 100%;\r
144
+ }\r
145
+ `;class Xm{constructor(e){this.dense=!0;let n=Zm;e&&(n+=`
97
146
  `+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(n)}apply(e){}setDense(e){this.dense=e}createViewer(e,n,r){const o=document.createElement("div"),a=document.createElement("label");a.innerHTML=e+":",r.description&&a.setAttribute("title",r.description.value),o.appendChild(a);let l=n.value,u=null;if(n instanceof _i){const h=r.config.store.getQuads(l,null,null,null);if(h.length){const m=Qi(h,r.config.languages);m&&(l=m)}}else n instanceof Qt&&(n.language?(u=document.createElement("span"),u.classList.add("lang"),u.innerText=`@${n.language}`):n.datatype.value===`${Un}date`?l=new Date(Date.parse(n.value)).toDateString():n.datatype.value===`${Un}dateTime`&&(l=new Date(Date.parse(n.value)).toLocaleString()));let f;return Ll(n.value)?(f=document.createElement("a"),f.setAttribute("href",n.value)):f=document.createElement("div"),f.classList.add("d-flex"),f.innerText=l,u&&f.appendChild(u),o.appendChild(f),o}}function Gf(i,e,n){if(n){const r=yi(i)>0;if(i.class&&!i.hasValue)return i.config.theme.createListEditor(i.label,e,r,Af(i.class,i),i);if(i.in){const o=i.config.lists[i.in];if(o?.length){const a=If(o,i.config.store,i.config.languages);return i.config.theme.createListEditor(i.label,e,r,a,i)}else console.error("list not found:",i.in,"existing lists:",i.config.lists)}if(i.datatype?.equals(Tf)||i.languageIn?.length||i.datatype===void 0&&e instanceof Qt&&e.language)return i.config.theme.createLangStringEditor(i.label,e,r,i);switch(i.datatype?.value.replace(Un,"")){case"integer":case"float":case"double":case"decimal":return i.config.theme.createNumberEditor(i.label,e,r,i);case"date":case"dateTime":return i.config.theme.createDateEditor(i.label,e,r,i);case"boolean":return i.config.theme.createBooleanEditor(i.label,e,r,i);case"base64Binary":return i.config.theme.createFileEditor(i.label,e,r,i)}return i.config.theme.createTextEditor(i.label,e,r,i)}else return e?i.config.theme.createViewer(i.label,e,i):document.createElement("div")}function Qm(i,e,n){if(e==="application/ld+json")return Jm(i);{const r=new Ol({format:e,prefixes:n});r.addQuads(i);let o="";return r.end((a,l)=>{a&&console.error(a),o=l}),o}}function Jm(i){const e=[];for(const n of i){const r={"@id":n.subject.id};if(n.predicate===Nt)r["@type"]=n.object.id;else{let o=n.object.value;n.object instanceof Qt?n.object.language?o={"@language":n.object.language,"@value":n.object.value}:n.object.datatype&&n.object.datatype.value!==`${Un}#string`&&(o={"@type":n.object.datatype.value,"@value":n.object.value}):o={"@id":n.object.id},r[n.predicate.value]=o}e.push(r)}return JSON.stringify(e)}function Km(i){let e=i.shaclDatatype,n=i.dataset.value||i.value;if(n){if(n.startsWith("<")&&n.endsWith(">")&&n.indexOf(":")>-1)return ze.namedNode(n.substring(1,n.length-1));if(i.dataset.class||i.dataset.nodeKind===Fe+"IRI")return ze.namedNode(n);if(i.dataset.link)return JSON.parse(i.dataset.link);if(i.dataset.lang?e=i.dataset.lang:i.type==="number"?n=parseFloat(n):i.type==="file"&&i.binaryData?n=i.binaryData:i.type==="datetime-local"&&(n=new Date(n).toISOString().slice(0,19)),(!e||e instanceof _i&&nm.equals(e))&&typeof n=="string"){let r=n.split("^^");r.length===2&&r[0].startsWith('"')&&r[0].endsWith('"')&&r[1].split(":").length===2?(n=r[0].substring(1,r[0].length-1),e=ze.namedNode(r[1])):(r=n.split("@"),r.length===2&&r[0].startsWith('"')&&r[0].endsWith('"')?(n=r[0].substring(1,r[0].length-1),e=r[1]):n.startsWith('"')&&n.endsWith('"')&&(n=n.substring(1,n.length-1)))}return ze.literal(n,e)}else if((i.type==="checkbox"||i.getAttribute("type")==="checkbox")&&(i.checked||parseInt(i.dataset.minCount||"0")>0))return ze.literal(i.checked?"true":"false",e)}const $r={};function Ym(i){i.predicate===void 0&&i.datatype===void 0?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',i):$r[`${i.predicate}^${i.datatype}`]=i}function e_(){return Object.entries($r).map(i=>i[1])}function t_(i,e){let n=$r[`${i}^${e}`];return n||(n=$r[`${i}^undefined`],n)?n:$r[`undefined^${e}`]}class Wf{constructor(e,n){this.predicate=e.predicate,this.datatype=e.datatype,n&&(this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(n))}createViewer(e,n){return e.config.theme.createViewer(e.label,n,e)}}const As=globalThis,Ql=As.ShadowRoot&&(As.ShadyCSS===void 0||As.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Jl=Symbol(),Zd=new WeakMap;let Zf=class{constructor(e,n,r){if(this._$cssResult$=!0,r!==Jl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(Ql&&e===void 0){const r=n!==void 0&&n.length===1;r&&(e=Zd.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Zd.set(n,e))}return e}toString(){return this.cssText}};const Xf=i=>new Zf(typeof i=="string"?i:i+"",void 0,Jl),Ut=(i,...e)=>{const n=i.length===1?i[0]:e.reduce((r,o,a)=>r+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[a+1],i[0]);return new Zf(n,i,Jl)},n_=(i,e)=>{if(Ql)i.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const r=document.createElement("style"),o=As.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=n.cssText,i.appendChild(r)}},Xd=Ql?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let n="";for(const r of e.cssRules)n+=r.cssText;return Xf(n)})(i):i;const{is:i_,defineProperty:r_,getOwnPropertyDescriptor:s_,getOwnPropertyNames:o_,getOwnPropertySymbols:a_,getPrototypeOf:l_}=Object,to=globalThis,Qd=to.trustedTypes,u_=Qd?Qd.emptyScript:"",c_=to.reactiveElementPolyfillSupport,qr=(i,e)=>i,Bs={toAttribute(i,e){switch(e){case Boolean:i=i?u_:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let n=i;switch(e){case Boolean:n=i!==null;break;case Number:n=i===null?null:Number(i);break;case Object:case Array:try{n=JSON.parse(i)}catch{n=null}}return n}},Kl=(i,e)=>!i_(i,e),Jd={attribute:!0,type:String,converter:Bs,reflect:!1,useDefault:!1,hasChanged:Kl};Symbol.metadata??=Symbol("metadata"),to.litPropertyMetadata??=new WeakMap;let Fi=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,n=Jd){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const r=Symbol(),o=this.getPropertyDescriptor(e,r,n);o!==void 0&&r_(this.prototype,e,o)}}static getPropertyDescriptor(e,n,r){const{get:o,set:a}=s_(this.prototype,e)??{get(){return this[n]},set(l){this[n]=l}};return{get:o,set(l){const u=o?.call(this);a?.call(this,l),this.requestUpdate(e,u,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Jd}static _$Ei(){if(this.hasOwnProperty(qr("elementProperties")))return;const e=l_(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(qr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(qr("properties"))){const n=this.properties,r=[...o_(n),...a_(n)];for(const o of r)this.createProperty(o,n[o])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[r,o]of n)this.elementProperties.set(r,o)}this._$Eh=new Map;for(const[n,r]of this.elementProperties){const o=this._$Eu(n,r);o!==void 0&&this._$Eh.set(o,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const o of r)n.unshift(Xd(o))}else e!==void 0&&n.push(Xd(e));return n}static _$Eu(e,n){const r=n.attribute;return r===!1?void 0:typeof r=="string"?r: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,n=this.constructor.elementProperties;for(const r of n.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return n_(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,n,r){this._$AK(e,r)}_$ET(e,n){const r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){const a=(r.converter?.toAttribute!==void 0?r.converter:Bs).toAttribute(n,r.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,n){const r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const a=r.getPropertyOptions(o),l=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:Bs;this._$Em=o;const u=l.fromAttribute(n,a.type);this[o]=u??this._$Ej?.get(o)??u,this._$Em=null}}requestUpdate(e,n,r,o=!1,a){if(e!==void 0){const l=this.constructor;if(o===!1&&(a=this[e]),r??=l.getPropertyOptions(e),!((r.hasChanged??Kl)(a,n)||r.useDefault&&r.reflect&&a===this._$Ej?.get(e)&&!this.hasAttribute(l._$Eu(e,r))))return;this.C(e,n,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:r,reflect:o,wrapped:a},l){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,l??n??this[e]),a!==!0||l!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(n=void 0),this._$AL.set(e,n)),o===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}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[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[o,a]of r){const{wrapped:l}=a,u=this[o];l!==!0||this._$AL.has(o)||u===void 0||this.C(o,void 0,a,u)}}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(n)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.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(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};Fi.elementStyles=[],Fi.shadowRootOptions={mode:"open"},Fi[qr("elementProperties")]=new Map,Fi[qr("finalized")]=new Map,c_?.({ReactiveElement:Fi}),(to.reactiveElementVersions??=[]).push("2.1.2");const Yl=globalThis,Kd=i=>i,$s=Yl.trustedTypes,Yd=$s?$s.createPolicy("lit-html",{createHTML:i=>i}):void 0,Qf="$lit$",qn=`lit$${Math.random().toFixed(9).slice(2)}$`,Jf="?"+qn,d_=`<${Jf}>`,bi=document,Ur=()=>bi.createComment(""),Hr=i=>i===null||typeof i!="object"&&typeof i!="function",eu=Array.isArray,h_=i=>eu(i)||typeof i?.[Symbol.iterator]=="function",Ya=`[
98
147
  \f\r]`,Lr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,eh=/-->/g,th=/>/g,ui=RegExp(`>|${Ya}(?:([^\\s"'>=/]+)(${Ya}*=${Ya}*(?:[^
99
148
  \f\r"'\`<>=]|("|')|))|$)`,"g"),nh=/'/g,ih=/"/g,Kf=/^(?:script|style|textarea|title)$/i,f_=i=>(e,...n)=>({_$litType$:i,strings:e,values:n}),Ct=f_(1),Ui=Symbol.for("lit-noChange"),gt=Symbol.for("lit-nothing"),rh=new WeakMap,mi=bi.createTreeWalker(bi,129);function Yf(i,e){if(!eu(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yd!==void 0?Yd.createHTML(e):e}const p_=(i,e)=>{const n=i.length-1,r=[];let o,a=e===2?"<svg>":e===3?"<math>":"",l=Lr;for(let u=0;u<n;u++){const f=i[u];let h,m,_=-1,d=0;for(;d<f.length&&(l.lastIndex=d,m=l.exec(f),m!==null);)d=l.lastIndex,l===Lr?m[1]==="!--"?l=eh:m[1]!==void 0?l=th:m[2]!==void 0?(Kf.test(m[2])&&(o=RegExp("</"+m[2],"g")),l=ui):m[3]!==void 0&&(l=ui):l===ui?m[0]===">"?(l=o??Lr,_=-1):m[1]===void 0?_=-2:(_=l.lastIndex-m[2].length,h=m[1],l=m[3]===void 0?ui:m[3]==='"'?ih:nh):l===ih||l===nh?l=ui:l===eh||l===th?l=Lr:(l=ui,o=void 0);const g=l===ui&&i[u+1].startsWith("/>")?" ":"";a+=l===Lr?f+d_:_>=0?(r.push(h),f.slice(0,_)+Qf+f.slice(_)+qn+g):f+qn+(_===-2?u:g)}return[Yf(i,a+(i[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};let Il=class ep{constructor({strings:e,_$litType$:n},r){let o;this.parts=[];let a=0,l=0;const u=e.length-1,f=this.parts,[h,m]=p_(e,n);if(this.el=ep.createElement(h,r),mi.currentNode=this.el.content,n===2||n===3){const _=this.el.content.firstChild;_.replaceWith(..._.childNodes)}for(;(o=mi.nextNode())!==null&&f.length<u;){if(o.nodeType===1){if(o.hasAttributes())for(const _ of o.getAttributeNames())if(_.endsWith(Qf)){const d=m[l++],g=o.getAttribute(_).split(qn),b=/([.?@])?(.*)/.exec(d);f.push({type:1,index:a,name:b[2],strings:g,ctor:b[1]==="."?m_:b[1]==="?"?__:b[1]==="@"?y_:no}),o.removeAttribute(_)}else _.startsWith(qn)&&(f.push({type:6,index:a}),o.removeAttribute(_));if(Kf.test(o.tagName)){const _=o.textContent.split(qn),d=_.length-1;if(d>0){o.textContent=$s?$s.emptyScript:"";for(let g=0;g<d;g++)o.append(_[g],Ur()),mi.nextNode(),f.push({type:2,index:++a});o.append(_[d],Ur())}}}else if(o.nodeType===8)if(o.data===Jf)f.push({type:2,index:a});else{let _=-1;for(;(_=o.data.indexOf(qn,_+1))!==-1;)f.push({type:7,index:a}),_+=qn.length-1}a++}}static createElement(e,n){const r=bi.createElement("template");return r.innerHTML=e,r}};function Hi(i,e,n=i,r){if(e===Ui)return e;let o=r!==void 0?n._$Co?.[r]:n._$Cl;const a=Hr(e)?void 0:e._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),a===void 0?o=void 0:(o=new a(i),o._$AT(i,n,r)),r!==void 0?(n._$Co??=[])[r]=o:n._$Cl=o),o!==void 0&&(e=Hi(i,o._$AS(i,e.values),o,r)),e}let g_=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:r}=this._$AD,o=(e?.creationScope??bi).importNode(n,!0);mi.currentNode=o;let a=mi.nextNode(),l=0,u=0,f=r[0];for(;f!==void 0;){if(l===f.index){let h;f.type===2?h=new tu(a,a.nextSibling,this,e):f.type===1?h=new f.ctor(a,f.name,f.strings,this,e):f.type===6&&(h=new v_(a,this,e)),this._$AV.push(h),f=r[++u]}l!==f?.index&&(a=mi.nextNode(),l++)}return mi.currentNode=bi,o}p(e){let n=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,n),n+=r.strings.length-2):r._$AI(e[n])),n++}},tu=class tp{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,r,o){this.type=2,this._$AH=gt,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=Hi(this,e,n),Hr(e)?e===gt||e==null||e===""?(this._$AH!==gt&&this._$AR(),this._$AH=gt):e!==this._$AH&&e!==Ui&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):h_(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!==gt&&Hr(this._$AH)?this._$AA.nextSibling.data=e:this.T(bi.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Il.createElement(Yf(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===o)this._$AH.p(n);else{const a=new g_(o,this),l=a.u(this.options);a.p(n),this.T(l),this._$AH=a}}_$AC(e){let n=rh.get(e.strings);return n===void 0&&rh.set(e.strings,n=new Il(e)),n}k(e){eu(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let r,o=0;for(const a of e)o===n.length?n.push(r=new tp(this.O(Ur()),this.O(Ur()),this,this.options)):r=n[o],r._$AI(a),o++;o<n.length&&(this._$AR(r&&r._$AB.nextSibling,o),n.length=o)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const r=Kd(e).nextSibling;Kd(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},no=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,r,o,a){this.type=1,this._$AH=gt,this._$AN=void 0,this.element=e,this.name=n,this._$AM=o,this.options=a,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=gt}_$AI(e,n=this,r,o){const a=this.strings;let l=!1;if(a===void 0)e=Hi(this,e,n,0),l=!Hr(e)||e!==this._$AH&&e!==Ui,l&&(this._$AH=e);else{const u=e;let f,h;for(e=a[0],f=0;f<a.length-1;f++)h=Hi(this,u[r+f],n,f),h===Ui&&(h=this._$AH[f]),l||=!Hr(h)||h!==this._$AH[f],h===gt?e=gt:e!==gt&&(e+=(h??"")+a[f+1]),this._$AH[f]=h}l&&!o&&this.j(e)}j(e){e===gt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},m_=class extends no{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===gt?void 0:e}},__=class extends no{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==gt)}},y_=class extends no{constructor(e,n,r,o,a){super(e,n,r,o,a),this.type=5}_$AI(e,n=this){if((e=Hi(this,e,n,0)??gt)===Ui)return;const r=this._$AH,o=e===gt&&r!==gt||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,a=e!==gt&&(r===gt||o);o&&this.element.removeEventListener(this.name,this,r),a&&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)}};class v_{constructor(e,n,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Hi(this,e)}}const b_=Yl.litHtmlPolyfillSupport;b_?.(Il,tu),(Yl.litHtmlVersions??=[]).push("3.3.2");const w_=(i,e,n)=>{const r=n?.renderBefore??e;let o=r._$litPart$;if(o===void 0){const a=n?.renderBefore??null;r._$litPart$=o=new tu(e.insertBefore(Ur(),a),a,void 0,n??{})}return o._$AI(i),o};const nu=globalThis;class Hn extends Fi{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 n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=w_(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ui}}Hn._$litElement$=!0,Hn.finalized=!0,nu.litElementHydrateSupport?.({LitElement:Hn});const x_=nu.litElementPolyfillSupport;x_?.({LitElement:Hn});(nu.litElementVersions??=[]).push("4.2.2");const un=i=>(e,n)=>{n!==void 0?n.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};const E_={attribute:!0,type:String,converter:Bs,reflect:!1,hasChanged:Kl},S_=(i=E_,e,n)=>{const{kind:r,metadata:o}=n;let a=globalThis.litPropertyMetadata.get(o);if(a===void 0&&globalThis.litPropertyMetadata.set(o,a=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),a.set(n.name,i),r==="accessor"){const{name:l}=n;return{set(u){const f=e.get.call(this);e.set.call(this,u),this.requestUpdate(l,f,i,!0,u)},init(u){return u!==void 0&&this.C(l,void 0,i,u),u}}}if(r==="setter"){const{name:l}=n;return function(u){const f=this[l];e.call(this,u),this.requestUpdate(l,f,i,!0,u)}}throw Error("Unsupported decorator location: "+r)};function Me(i){return(e,n)=>typeof n=="object"?S_(i,e,n):((r,o,a)=>{const l=o.hasOwnProperty(a);return o.constructor.createProperty(a,r),l?Object.getOwnPropertyDescriptor(o,a):void 0})(i,e,n)}function io(i){return Me({...i,state:!0,attribute:!1})}const T_=(i,e,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(i,e,n),n);function Ht(i,e){return(n,r,o)=>{const a=l=>l.renderRoot?.querySelector(i)??null;return T_(n,r,{get(){return a(this)}})}}var np=i=>{throw TypeError(i)},ip=(i,e,n)=>e.has(i)||np("Cannot "+n),Bn=(i,e,n)=>(ip(i,e,"read from private field"),n?n.call(i):e.get(i)),L_=(i,e,n)=>e.has(i)?np("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,n),I_=(i,e,n,r)=>(ip(i,e,"write to private field"),e.set(i,n),n),N_=Object.defineProperty,Zn=(i,e,n,r)=>{for(var o=void 0,a=i.length-1,l;a>=0;a--)(l=i[a])&&(o=l(e,n,o)||o);return o&&N_(e,n,o),o};const Nl=class extends Hn{constructor(){super(...arguments),this.dense=!1}};Nl.shadowRootOptions={...Hn.shadowRootOptions,delegatesFocus:!0},Nl.styles=[Ut`
@@ -112,7 +112,7 @@
112
112
  {% endif %}
113
113
 
114
114
  <div id="shacl-container"
115
- style="border:dashed 2px gray; padding:10px; border-radius:5px; max-width: 60%; margin: 0 auto; margin-top:20px;">
115
+ style=" border:dashed 2px gray; padding:10px; border-radius:5px; max-width: 60%; margin: auto;margin-top:10px;">
116
116
  <shacl-form shadow="false" id="shacl-form" data-collapse="open"
117
117
  data-values-namespace="indagine:"
118
118
  data-shapes-url="/backend/ontology/schema/editing"
@@ -124,7 +124,8 @@
124
124
  style="margin-top:15px;
125
125
  border:dashed 2px gray;
126
126
  padding:15px;
127
- border-radius:6px;">
127
+ border-radius:6px;
128
+ max-width: 60%;">
128
129
 
129
130
  <shacl-form id="shacl-form"
130
131
  data-collapse="open"