solid-shim 0.1.3 → 0.1.4

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.
@@ -0,0 +1,2 @@
1
+ "use strict";(this.webpackChunkMashlib=this.webpackChunkMashlib||[]).push([[529],{2494(e,t,n){n.r(t),n.d(t,{socialPane:()=>r});var a=n(3383),o=n(2404),i=n(9755);const r={icon:a.icons.originalIconBase+"foaf/foafTiny.gif",name:"social",label:function(e,t){const n=t.session.store.findTypeURIs(e);return n[a.ns.foaf("Person").uri]||n[a.ns.vcard("Individual").uri]?"Friends":null},render:function(e,t){const n=t.dom,r=function(e){console.log(e);const t=n.createElement("p");t.textContent=e,w.appendChild(t)},l=function(e,t){if(!t)return e;const a=n.createElement("a");return a.setAttribute("href",t),a.appendChild(e),a},c=function(e){return n.createTextNode(e)},s=t.getOutliner(n),d=t.session.store,p=n.createElement("div");p.setAttribute("class","socialPane");const h=a.ns.foaf,u=a.ns.vcard,f="background-color: #eee; width: 25%; border: 0; padding: 0.5em; margin: 0;",m=p.appendChild(n.createElement("table")).appendChild(n.createElement("tr")),g=m.appendChild(n.createElement("td")),C=m.appendChild(n.createElement("td")),b=m.appendChild(n.createElement("td")),y=g;y.style.cssText=f;const k=C.appendChild(n.createElement("table"));k.style.cssText="background-color: #fff; color: #000; width: 46%; margin: 0; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 0;";const w=b;w.style.cssText=f;const E=d.any(e,h("img"))||d.any(e,h("depiction"));if(E){const e=n.createElement("IMG");e.setAttribute("src",E.uri),e.style.cssText=" width: 100% ; border: none; margin: 0; padding: 0;",y.appendChild(e)}const x=d.anyValue(e,h("name"))||"???";let T=n.createElement("H3");T.appendChild(n.createTextNode(x));let N=o.authn.currentUser();const v=N?N.uri:null,I=a.login.loginStatusBox(n,e=>{N=d.sym(e),a.widgets.refreshTree(p)});w.appendChild(I);const M=N&&d.sameThings(N,e),q=h("knows"),j=d.anyValue(e,h("givenname"))||d.anyValue(e,h("firstName"))||d.anyValue(e,h("nick"))||d.anyValue(e,h("name"))||d.anyValue(e,u("fn")),A=d.each(e,q);let P,U,V=null,Y=!1;if(N){const t=d.each(void 0,h("primaryTopic"),N);let o="";for(let e=0;e<t.length;e++)if(d.whether(t[e],a.ns.rdf("type"),h("PersonalProfileDocument"))){if(Y=s.UserInput.sparqler.editable(t[e].uri,d),Y){V=t[e];break}o+="Your profile <"+a.utils.escapeForXML(t[e].uri)+"> is not remotely editable."}if(V?(r("Editing your profile "+V+"."),Y=s.UserInput.sparqler.editable(V.uri,d)):r(o+"\nI couldn't find your editable personal profile document."),M);else{T=n.createElement("h3"),T.appendChild(n.createTextNode("You and "+j)),y.appendChild(T);const t=d.canon(N);P=d.whether(e,q,t),U=!1;const o=d.statementsMatching(t,q,e);o.length&&(U=!0,V||(V=o[0].why));const r=n.createElement("tr");y.appendChild(r);const p=function(){r.appendChild(l(c("You"),v)),r.appendChild(c(" and ")),r.appendChild(l(c(j),e.uri))};if(P?U?(p(),r.appendChild(c(" say you know each other."))):(r.appendChild(l(c(j),e.uri)),r.appendChild(c(" knows ")),r.appendChild(l(c("you"),v)),r.appendChild(c(" (unconfirmed).")),r.appendChild(c(" confirm you know ")),r.appendChild(l(c(j),e.uri)),r.appendChild(c("."))):U?(r.appendChild(l(c("You"),v)),r.appendChild(c(" know ")),r.appendChild(l(c(j),e.uri)),r.appendChild(c(" (unconfirmed)"))):(p(),r.appendChild(c(" have not said you know each other."))),Y){const t=function(e,t,o){const i=n.createElement("form"),r=n.createElement("input");i.appendChild(r);const l=n.createTextNode(e);return l.className="question",i.appendChild(l),r.setAttribute("type","checkbox"),r.checked=o,r.addEventListener("click",function(e){if(l.className="pendingedit",this.checked)try{s.UserInput.sparqler.insert_statement(t,function(e,n,o){if(l.className="question",!n)return a.log.alert(null,"Message","Error occurs while inserting "+t+"\n\n"+o),void(r.checked=!1);d.add(t.subject,t.predicate,t.object,t.why)})}catch(e){a.log.error("Data write fails:"+e),a.log.alert("Data write fails:"+e),r.checked=!1,l.className="question"}else try{s.UserInput.sparqler.delete_statement(t,function(e,n,o){l.className="question",n?d.removeMany(t.subject,t.predicate,t.object,t.why):(a.log.alert("Error occurs while deleting "+t+"\n\n"+o),this.checked=!0)})}catch(e){a.log.alert("Delete fails:"+e),this.checked=!0}},!1),i}("You know "+j,new i.A(N,q,e,V),U);y.appendChild(t)}if(A){const e=d.each(N,h("knows"));if(e.length){const t=function(e,t){const n=[];for(let a=0;a<e.length;a++)for(let o=0;o<t.length;o++)if(t[o].sameTerm(e[a])){n.push(t[o]);break}return n}(A,e),o=n.createElement("tr");if(y.appendChild(o),o.appendChild(n.createTextNode("You"+(j?" and "+j:"")+" know"+function(e){let t=" ";return t+=e||"no",1===e?t+" person":t+" people"}(t.length)+" found in common")),t)for(let e=0;e<t.length;e++)o.appendChild(n.createTextNode(", "+a.utils.label(t[e])))}const t=n.createElement("tr");y.appendChild(t)}}}a.widgets.attachmentList(n,e,k,{doc:V,modify:!!Y,predicate:h("knows"),noun:"friend"}),T=n.createElement("h3"),T.appendChild(n.createTextNode("Basic Information")),y.appendChild(T);const D=[a.ns.foaf("homepage"),a.ns.foaf("weblog"),a.ns.foaf("workplaceHomepage"),a.ns.foaf("schoolHomepage")];for(let t=0;t<D.length;t++){const o=D[t],i=d.statementsMatching(e,o);if(0===i.length);else{const e=[];for(let t=0;t<i.length;t++){const n=i[t];n.object.uri&&e.push(n.object.uri)}e.sort();let t,r="";for(let i=0;i<e.length;i++){const l=e[i];if(l===r)continue;r=l;let c="";if(t=a.utils.label(o),e.length>1){const e=l.indexOf("//");if(e>0){let t=l.indexOf("/",e+2);const n=l.lastIndexOf(".",t);n>0&&(t=n),c=l.slice(e+2,t)}}c&&(t=c+" "+t);const s=n.createTextNode(t),d=n.createElement("a");d.appendChild(s),d.setAttribute("href",l);const p=n.createElement("div");p.style.cssText="width: 80%; background-color: #fff; border: solid 0.05em #ccc; margin-top: 0.1em; margin-bottom: 0.1em; padding: 0.1em; text-align: center;",p.appendChild(d),y.appendChild(p)}}}const O=[a.ns.foaf("openid"),a.ns.foaf("nick")];for(let t=0;t<O.length;t++){const n=O[t],a=d.statementsMatching(e,n);0===a.length||s.appendPropertyTRs(y,a,!1,function(e){return!0})}return p}}}}]);
2
+ //# sourceMappingURL=529.mashlib.min.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";(this.webpackChunkMashlib=this.webpackChunkMashlib||[]).push([[587],{1002(e,t,n){n.r(t),n.d(t,{default:()=>i});var r=n(3383),o=n(9676);const i={icon:r.icons.originalIconBase+"tango/22-emblem-system.png",name:"internal",label:function(){return"under the hood"},render:function(e,t){const n=t.dom,i=t.session.store,s=i.canon(e),l=i.findTypeURIs(s);function c(e){if(l["http://www.w3.org/2007/ont/link#ProtocolEvent"])return!0;const n=t.session.paneRegistry.byName("internal");return n&&n.predicates&&!(void 0===n.predicates[e.uri])}const w=n.createElement("div");function a(e,t){const n=e.fetcher;if(n)return new Promise(function(o,i){n.load(t).then(function(){const s=e.each(t,r.ns.ldp("contains")).map(t=>e.holds(t,r.ns.rdf("type"),r.ns.ldp("BasicContainer"))?a(e,t):(console.log("deleteRecursive leaf file: "+t),n.webOperation("DELETE",t.uri)));Promise.all(s).then(()=>{console.log("deleteRecursive empty folder: "+t),n.webOperation("DELETE",t.uri).then(()=>{console.log("Deleted Ok: "+t),o(void 0)}).catch(e=>{const n="Unable to delete "+t+": "+e;console.log(n),i(new Error(n))}),o(void 0)},e=>{alert(e),i(e)})})});console.error("No fetcher available")}w.setAttribute("class","internalPane"),w.setAttribute("style","background-color: #ddddff; padding: 0.5em; border-radius: 1em;");if(e.uri&&!e.uri.includes("#")){const t=w.appendChild(n.createElement("table"));t.style.width="100%",t.style.margin="1em";const o=t.appendChild(n.createElement("tr")),s=o.appendChild(n.createElement("td")),l=e.uri&&e.uri.endsWith("/")||i.holds(e,r.ns.rdf("type"),r.ns.ldp("Container")),c=l?"folder":"file";if(!function(e){const t=e.site().uri;return e.uri===t||e.uri===t+"profile/"||e.uri===t+"profile/card"||e.uri===t+"settings/"||e.uri===t+"settings/prefs.ttl"||e.uri===t+"settings/privateTypeIndex.ttl"||e.uri===t+"settings/publicTypeIndex.ttl"||e.uri===t+"settings/serverSide.ttl"}(e)){console.log(e);const t=r.widgets.deleteButtonWithCheck(n,s,c,function(){if(!confirm(`Are you sure you want to delete ${e}? This cannot be undone.`))return;if(!i.fetcher)throw new Error("Store has no fetcher");(l?a(i,e)||Promise.resolve():i.fetcher.webOperation("DELETE",e.uri)||Promise.resolve()).then(()=>{const t="Deleted: "+e;console.log(t)}).catch(t=>{const n="Unable to delete "+e+": "+t;console.log(n),alert(n)})});t.style="height: 2em;",t.class="",s.appendChild(t)}const d=o.appendChild(n.createElement("td")),h=r.widgets.button(n,r.icons.iconBase+"noun_479395.svg","refresh");d.appendChild(h),h.addEventListener("click",()=>{if(!i.fetcher)throw new Error("Store has no fetcher");i.fetcher.refresh(e,function(t,n){let r;r=t?"Refreshed OK: "+e:"Error refreshing: "+e+": "+n,console.log(r),alert(r)})})}let d=i.statementsMatching(e),h="";if(!i.fetcher)throw new Error("Store has no fetcher");if(e.uri&&(d.push((0,o.st)(e,(0,o.sym)("http://www.w3.org/2007/ont/link#uri"),e.uri,i.fetcher.appNode)),e.uri.indexOf("#")>=0?(h=e.uri.split("#")[0],d.push((0,o.st)(e,(0,o.sym)("http://www.w3.org/2007/ont/link#documentURI"),e.uri.split("#")[0],i.fetcher.appNode)),d.push((0,o.st)(e,(0,o.sym)("http://www.w3.org/2007/ont/link#document"),(0,o.sym)(e.uri.split("#")[0]),i.fetcher.appNode))):h=e.uri),h){if(!i.updater)throw new Error("Store has no updater");const t=i.updater.editable(h);t&&d.push((0,o.st)(e,(0,o.sym)("http://www.w3.org/ns/rww#editable"),(0,o.literal)(t.toString()),i.fetcher.appNode))}const p=t.getOutliner(n);return p.appendPropertyTRs(w,d,!1,c),d=i.statementsMatching(void 0,void 0,e),p.appendPropertyTRs(w,d,!0,c),w},predicates:{"http://www.w3.org/2007/ont/link#request":1,"http://www.w3.org/2007/ont/link#requestedBy":1,"http://www.w3.org/2007/ont/link#source":1,"http://www.w3.org/2007/ont/link#session":2,"http://www.w3.org/2007/ont/link#uri":1,"http://www.w3.org/2007/ont/link#documentURI":1,"http://www.w3.org/2007/ont/link#document":1,"http://www.w3.org/2007/ont/link#all":1,"http://www.w3.org/2007/ont/link#Document":1,"http://www.w3.org/ns/rww#editable":1,"http://www.w3.org/2000/01/rdf-schema#seeAlso":1,"http://www.w3.org/2002/07/owl#":1},classes:{"http://www.w3.org/2007/ont/link#ProtocolEvent":1}}}}]);
2
+ //# sourceMappingURL=587.mashlib.min.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";(this.webpackChunkMashlib=this.webpackChunkMashlib||[]).push([[711],{8958(e,t,n){n.r(t),n.d(t,{schedulePane:()=>h});var i=n(3383),o=n(2404),a=n(9676),s=n(4940),r=n(3581),l=n(5796),c=n(6046),u=n(480);const d=i.ns,p=[d.sched("No"),d.sched("Maybe"),d.sched("Yes")],h={icon:i.icons.iconBase+"noun_346777.svg",name:"schedule",audience:[d.solid("PowerUser")],label:function(e,t){return t.session.store.findTypeURIs(e)["http://www.w3.org/ns/pim/schedule#SchedulableEvent"]?"Scheduling poll":null},mintClass:d.sched("SchedulableEvent"),mintNew:function(e,t){return new Promise(function(n,s){const l=i.ns,c=e.session.store;let d=t.newBase;const p=t.useExisting||a.sym(t.newBase+"index.ttl#this"),h=function(e,t){e||(console.log("Error in Schedule Pane: Error constructing new scheduler: "+t),s(new Error(t)))},m=function(e,t,n){const o=a.graph(),s=r.A("http://www.w3.org/ns/auth/acl#");let c=o.sym(t+"#a1");const d=o.sym(t),p=o.sym(e);return o.add(c,i.ns.rdf("type"),s("Authorization"),d),o.add(c,s("accessTo"),p,d),o.add(c,s("agent"),b,d),o.add(c,s("mode"),s("Read"),d),o.add(c,s("mode"),s("Write"),d),o.add(c,s("mode"),s("Control"),d),c=o.sym(t+"#a2"),o.add(c,i.ns.rdf("type"),s("Authorization"),d),o.add(c,s("accessTo"),p,d),o.add(c,s("agentClass"),l.foaf("Agent"),d),o.add(c,s("mode"),s("Read"),d),n&&o.add(c,s("mode"),s("Write"),d),u.A(d,o,t,"text/turtle")},f=function(e,t,n){const i=c.any(c.sym(e),c.sym("http://www.iana.org/assignments/link-relations/acl"));if(i){const o=m(e,i.uri,t);return y.webOperation("PUT",i.uri,{data:o,contentType:"text/turtle"}).then(e=>n(!0)).catch(e=>{n(!1,e.message)})}return y.load(e).catch(e=>{n(!1,"Getting headers for ACL: "+e)}).then(()=>{const n=c.any(c.sym(e),c.sym("http://www.iana.org/assignments/link-relations/acl"));if(!n)throw new Error("No Link rel=ACL header for "+e);const i=m(e,n.uri,t);return y.webOperation("PUT",n.uri,{data:i,contentType:"text/turtle"})}).then(e=>n(!0)).catch(e=>{n(!1,e.message)})},y=c.fetcher,g=c.updater;let b=t.me||o.authn.currentUser();if(!b)return console.log("MUST BE LOGGED IN"),void alert("NOT LOGGED IN");const w=p.dir().uri;let v,C;if(t.useExisting){if(C=t.useExisting,d=p.dir().uri,v=C.doc(),t.newBase)throw new Error("mint new scheduler: Illegal - have both new base and existing event")}else v=c.sym(d+"details.ttl"),C=c.sym(v.uri+"#event");const E=c.sym(d+"results.ttl"),A=t.noIndexHTML?{}:[{local:"index.html",contentType:"text/html"}],x=[];for(let e=0;e<A.length;e++){const t=function(e){x.push(function(){const t=d+e.local;console.log("Copying "+w+e.local+" to "+t);c.fetcher.webCopy(w+e.local,d+e.local,e.contentType).then(()=>o.authn.checkUser()).then(e=>{b=e,f(t,!1,function(e,n){e?x.shift()():(h(e,"FAILED to set ACL "+t+" : "+n),console.log("FAILED to set ACL "+t+" : "+n))})}).catch(t=>{console.log("FAILED to copy "+w+e.local+" : "+t.message),h(!1,"FAILED to copy "+w+e.local+" : "+t.message)})})};t(A[e])}x.push(function(){c.add(C,l.rdf("type"),l.sched("SchedulableEvent"),v),b&&(c.add(C,l.dc("author"),b,v),c.add(C,l.foaf("maker"),b,v)),c.add(C,l.dc("created"),new Date,v),c.add(C,l.sched("resultsDocument"),v),g.put(v,c.statementsMatching(void 0,void 0,void 0,v),"text/turtle",function(e,t,n){t?x.shift()():(h(t,"FAILED to save new scheduler at: "+v+" : "+n),console.log("FAILED to save new scheduler at: "+v+" : "+n))})}),x.push(function(){c.fetcher.webOperation("PUT",E.uri,{data:"",contentType:"text/turtle"}).then(()=>{x.shift()()}).catch(e=>{h(!1,"Failed to initialize empty results file: "+e.message)})}),x.push(function(){f(E.uri,!0,function(e,t){h(e,"Failed to set Read-Write ACL on results file: "+t),e&&x.shift()()})}),x.push(function(){f(v.uri,!1,function(e,t){h(e,"Failed to set read ACL on configuration file: "+t),e&&x.shift()()})}),x.push(function(){console.log("Finished minting new scheduler"),t.newInstance=C,n(t)}),x.shift()()})},render:function(e,t){const n=t.dom,r=t.session.store,u=i.ns,d=e,h="app-when-can-we.w3.org",m=r.fetcher,f=r.updater;let y=!1;const g=e,b=e.doc(),w=b.dir().uri,v=a.sym(w+"results.ttl"),C="https://solidos.github.io/solid-panes/schedule/formsForSchedule.ttl",E=r.sym(C+"#form1"),A=r.sym(C+"#form2"),x=r.sym(C+"#form3");l.A('@prefix dc: <http://purl.org/dc/elements/1.1/>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix cal: <http://www.w3.org/2002/12/cal/ical#>.\n@prefix ui: <http://www.w3.org/ns/ui#>.\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.\n@prefix sched: <http://www.w3.org/ns/pim/schedule#>.\n\n cal:Vevent ui:annotationForm <#form2>, <#form3>; ui:creationForm <#form1> .\n\n<#bigForm>\n dc:title\n "Schedule event (single form).";\n a ui:Group;\n ui:parts ( <#form1> <#form2> <#form3> ).\n\n<#form1>\n dc:title\n "Schedule an event (wizard)";\n a ui:Form;\n ui:parts (\n <#form1header>\n <#eventTitle>\n <#eventLocation>\n <#eventType>\n <#eventSwitch>\n <#eventComment>\n <#eventAuthor> ).\n\n<#form1header> a ui:Heading; ui:contents "Schedule an event" .\n\n<#eventTitle>\n a ui:SingleLineTextField;\n ui:maxLength\n "128";\n ui:property\n cal:summary;\n ui:size\n "40".\n\n<#eventLocation>\n a ui:SingleLineTextField;\n ui:maxLength\n "512";\n ui:property\n cal:location;\n ui:size\n "40".\n\n<#eventType> a ui:BooleanField;\n ui:property sched:allDay;\n ui:default true . # Used to be the only way\n\n<#eventSwitch> a ui:Options;\n ui:dependingOn sched:allDay;\n ui:case [ ui:for true; ui:use <#AllDayForm> ];\n ui:case [ ui:for false; ui:use <#NotAllDayForm> ].\n\n <#AllDayForm> a ui:IntegerField ;\n ui:property sched:durationInDays;\n ui:label "How many days?";\n ui:min 1;\n ui:default 1 .\n\n <#NotAllDayForm> a ui:IntegerField ;\n ui:property sched:durationInMinutes;\n ui:label "Duration (mins)";\n ui:min 5;\n ui:default 55 .\n\n<#eventComment>\n a ui:MultiLineTextField;\n# ui:maxLength\n# "1048";\n# ui:size\n# "40".\n ui:property\n cal:comment.\n\n<#eventAuthor>\n a ui:Multiple; ui:min 1; ui:part <#eventAuthorGroup>; ui:property dc:author.\n\n <#eventAuthorGroup> a ui:Group; ui:parts ( <#authorName> <#authorEmail> ) .\n <#authorName> a ui:SingleLineTextField; ui:property foaf:name .\n <#authorEmail> a ui:EmailField; ui:label "email"; ui:property foaf:mbox .\n\n\n#####################\n\n<#form2> dc:title "Select possible days or times"; a ui:Form;\n ui:parts ( <#id1118132113134> <#possibleSwitch> ).\n\n <#id1118132113134> a ui:Heading; ui:contents "Time proposals" .\n\n <#possibleSwitch> a ui:Options;\n ui:dependingOn sched:allDay;\n ui:case [ ui:for true; ui:use <#AllDayForm2> ];\n ui:case [ ui:for false; ui:use <#NotAllDayForm2> ].\n\n <#AllDayForm2>\n a ui:Multiple; ui:min 2; ui:part <#posssibleDate>; ui:property sched:option.\n <#posssibleDate> a ui:DateField; ui:property cal:dtstart; ui:label "date".\n\n <#NotAllDayForm2>\n a ui:Multiple; ui:min 2; ui:part <#posssibleTime>; ui:property sched:option.\n <#posssibleTime> a ui:DateTimeField; ui:property cal:dtstart; ui:label "date and time".\n\n ##################################\n\n <#form3> dc:title "Select invited people"; a ui:Form; ui:parts ( <#id1118132113135> <#id1417314641301b> ) .\n<#id1417314641301b>\n a ui:Multiple; ui:min 1; ui:part <#id1417314674292b>; ui:property sched:invitee.\n <#id1417314674292b> a ui:EmailField; ui:label "email"; ui:property foaf:mbox .\n <#id1118132113135> a ui:Heading; ui:contents "Who to invite" .\n\n# ENDS\n',r,C,"text/turtle");const F="background-color: #eef; padding: 0.5em; border: .5em solid white; font-size: 100%",L="width: 1.8em; height: 1.8em;",T=function(e,t){e||W.appendChild(i.widgets.errorMessageBlock(n,t,"pink"))},D=function(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},I=function(e,t){const n=r.any(t,i.ns.ui("backgroundColor"));n&&e.setAttribute("style","padding: 0.3em; text-align: center; background-color: "+n+";")};let k;o.authn.checkUser().then(e=>{k=e,V&&V.refresh(),e&&y&&(y=!1,U())}),console.log("me: "+k);const S=function(e){let t=r.any(e,u.space("uriPrefix"));t=t?t.value:e.uri.split("#")[0],"/"!==t.slice(-1)&&(s.A.error(h+": No / at end of uriPrefix "+t),t+="/");const n=new Date;t+=h+"/id"+n.getTime()+"/",N(g,t)},N=function(e,i){const o={thisInstance:e,newBase:i};this.mintNew(t,o).then(function(e){const t=W.appendChild(n.createElement("p"));t.setAttribute("style","font-size: 140%;"),t.innerHTML="Your <a href='"+e.newInstance.uri+"'><b>new scheduler</b></a> is ready to be set up. <br/><br/><a href='"+e.newInstance.uri+"'>Say when you what days work for you.</a>"}).catch(function(e){T(!1,"Error createing new scheduler at "+o.newInstance+": "+e)})},M=function(){console.log("getDetails()"),m.nowOrWhenFetched(b.uri,void 0,function(e,t){if(console.log("getDetails() ok? "+e),!e)return T(e,t);U()})},U=function(){console.log("showAppropriateDisplay()"),o.authn.checkUser().then(t=>{if(!t)return O();if(!r.updater.editable(b.uri,r)||r.holds(e,u.rdf("type"),u.wf("TemplateInstance")))return void _(W);r.any(e,u.sched("ready"))?G():B()})},O=function(){D(Y);const e={div:W,dom:n};i.login.ensureLoggedIn(e).then(e=>{k=e.me,y=!1,U()})},_=function(){const e=D(Y);e.appendChild(i.login.newAppInstance(n,{noun:"poll"},S)),e.appendChild(n.createElement("hr"));e.appendChild(n.createElement("p")).textContent="Where would you like to store the data for the poll? Give the URL of the directory where you would like the data stored.";const t=e.appendChild(n.createElement("input"));t.setAttribute("type","text"),t.size=80,t.label="base URL",t.autocomplete="on",e.appendChild(n.createElement("br"));const o=e.appendChild(n.createElement("button"));o.setAttribute("style",F),o.textContent="Start new poll at this URI",o.addEventListener("click",function(e){let n=t.value;"/"!==n.slice(-1)&&(n+="/"),N(g,n)})},z=n.createElement("button"),B=function(){D(X);let t=0,o=!1;{const a=[E,A,x],s=[];t=0;for(let t=0;t<a.length;t++){const o=n.createElement("div");i.widgets.appendForm(document,o,{},e,a[t],b,T),s.push(o)}const r=function(){D(Y).appendChild(s[t]),0===t?c.setAttribute("disabled",""):c.removeAttribute("disabled"),t===s.length-1?(u.setAttribute("disabled",""),o||(X.appendChild(l),X.appendChild(z),o=!0)):u.removeAttribute("disabled")},c=D(Q).appendChild(n.createElement("button"));c.setAttribute("style",F),c.textContent="<- go back",c.addEventListener("click",function(e){t>0&&(t-=1,r())},!1);const u=D(q).appendChild(n.createElement("button"));u.setAttribute("style",F),u.textContent="continue ->",u.addEventListener("click",function(e){t<s.length-1&&(t+=1,r())},!1),r()}const s=[];s.push(a.st(e,u.sched("availabilityOptions"),u.sched("YesNoMaybe"),b)),s.push(a.st(e,u.sched("ready"),new Date,b)),s.push(a.st(e,u.sched("results"),v,b)),z.setAttribute("style",F),z.textContent="Go to poll",z.addEventListener("click",function(t){r.any(e,u.sched("ready"))?(G(),q.appendChild(l)):(q.appendChild(l),r.updater.update([],s,function(e,t,n){t?G():T(t,n)}))},!1);const l=n.createElement("button");l.setAttribute("style",F);const c=l.appendChild(n.createElement("img"));c.setAttribute("src",i.icons.iconBase+"noun_480183.svg"),c.setAttribute("style",L),l.addEventListener("click",function(t){const n=r.anyValue(e,u.cal("summary"))||r.anyValue(e,u.dc("title"))||"",i="mailto:"+r.each(e,u.sched("invitee")).map(function(e){const t=r.any(e,u.foaf("mbox"));return t?t.uri.replace("mailto:",""):""}).join(",")+"?subject="+encodeURIComponent(n+"-- When can we meet?")+"&body="+encodeURIComponent(n+"\n\nWhen can you?\n\nSee "+e+"\n");console.log("Mail: "+i),window.location.href=i},!1)};function G(){m.nowOrWhenFetched(v.uri,(e,t,n)=>{e?(D(Y),R()):404===n.status?(console.log("Initializing details file "+v),f.put(v,[],"text/turtle",function(e,t,n){t?(D(Y),R()):(T(t,"FAILED to create results file at: "+v.uri+" : "+n),console.log("FAILED to craete results file at: "+v.uri+" : "+n))})):T(e,"FAILED to read results file: "+t)})}function R(){const t=r.any(d,u.cal("summary")),o=r.any(d,u.cal("comment")),s=r.any(d,u.cal("location")),l=Y;t&&(l.appendChild(n.createElement("h3")).textContent=t),s&&(l.appendChild(n.createElement("address")).textContent=s.value),o&&(l.appendChild(n.createElement("p")).textContent=o.value);const h=r.any(d,u.dc("author"));if(h){const e=r.any(h,u.foaf("name"));e&&(l.appendChild(n.createElement("p")).textContent=e)}const m=new c.X("Responses"),f={};["time","author","value","resp","cell"].forEach(function(e){m.vars.push(f[e]=a.variable(e))}),m.pat.add(d,u.sched("response"),f.resp),m.pat.add(f.resp,u.dc("author"),f.author),m.pat.add(f.resp,u.sched("cell"),f.cell),m.pat.add(f.cell,u.sched("availabilty"),f.value),m.pat.add(f.cell,u.cal("dtstart"),f.time);const y={};y.set_x=r.each(e,u.sched("option")),y.set_x=y.set_x.map(function(e){return r.any(e,u.cal("dtstart"))}),y.set_y=r.each(e,u.sched("response")),y.set_y=y.set_y.map(function(e){return r.any(e,u.dc("author"))});const g=r.each(d,u.sched("option")).map(function(e){return r.any(e,u.cal("dtstart"))}),b=function(){const e=l.appendChild(i.matrix.matrixForQuery(n,m,f.time,f.author,f.value,y,function(){}));e.setAttribute("class","matrix");const t=n.createElement("button");t.setAttribute("style",F);const o=n.createElement("img");o.setAttribute("src",i.icons.iconBase+"noun_479395.svg"),o.setAttribute("style",L),t.appendChild(o),t.addEventListener("click",function(n){t.disabled=!0,r.fetcher.refresh(v,function(n,i){n?(e.refresh(),t.disabled=!1):console.log("Cant refresh matrix"+i)})},!1),D(X),X.appendChild(t)},w=[],C={div:X,dom:n};i.login.ensureLoggedIn(C).then(e=>{const t=e.me,o=v;y.set_y=y.set_y.filter(function(e){return!e.sameTerm(t)}),y.set_y.push(t),y.cellFunction=function(e,o,a,s){if(null!==s&&r.fetcher.nowOrWhenFetched(s.uri.split("#")[0],void 0,function(t,n){t&&I(e,s)}),a.sameTerm(t)){const t=function(){I(e,s)},a={},l=u.sched("availabilty"),c=w[o.toNT()],d=i.widgets.makeSelectForOptions(n,r,c,l,p,a,v,t);e.appendChild(d)}else null!==s&&(e.textContent=i.utils.label(s))};const s=r.each(d,u.sched("response"));let l=null;s.forEach(function(e){r.holds(e,u.dc("author"),t)&&(l=e)});const c=[],h=i.widgets.newThing(o).uri;if(null===l)l=a.sym(h+"_response"),c.push(a.st(d,u.sched("response"),l,o)),c.push(a.st(l,u.dc("author"),t,o));else{r.each(l,u.sched("cell")).forEach(function(e){const t=r.any(e,u.cal("dtstart"));w[t.toNT()]=e})}for(let e=0;e<g.length;e++){if(w[g[e].toNT()])continue;const t=a.sym(h+"_"+e);c.push(a.st(l,u.sched("cell"),t,o)),c.push(a.st(t,u.cal("dtstart"),g[e],o)),w[g[e].toNT()]=t}c.length?r.updater.update([],c,function(e,t,n){t?b():T(t,n)}):b()});const E=r.any(e,u.foaf("maker"));if(!E||E.sameTerm(k)){const e=n.createElement("button");e.setAttribute("style",F);const t=n.createElement("img");t.setAttribute("src",i.icons.iconBase+"noun_344563.svg"),t.setAttribute("style",L),e.appendChild(t),e.addEventListener("click",function(e){D(l),B()},!1),D(Q),Q.appendChild(e)}D(q),q.appendChild(function(){const e=i.login.newAppInstance(n,{noun:"scheduler"},S);return e.firstChild.setAttribute("style",F),e}())}const W=n.createElement("div"),P=W.appendChild(n.createElement("table"));P.setAttribute("style","background-color: white; min-width: 40em; min-height: 13em;");const H=P.appendChild(n.createElement("tr"));H.appendChild(n.createElement("td")),H.appendChild(n.createElement("td")),H.appendChild(n.createElement("td"));const V=null,Y=P.appendChild(n.createElement("tr")).appendChild(n.createElement("td"));Y.setAttribute("colspan","3");const j=P.appendChild(n.createElement("tr"));j.setAttribute("class","naviMenu"),j.setAttribute("style"," text-align: middle; vertical-align: middle; padding-top: 4em; ");const Q=j.appendChild(n.createElement("td")),X=j.appendChild(n.createElement("td")),q=j.appendChild(n.createElement("td"));return console.log("getforms()"),M(),W}}}}]);
2
+ //# sourceMappingURL=711.mashlib.min.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";(this.webpackChunkMashlib=this.webpackChunkMashlib||[]).push([[712],{8302(e,t,n){n.r(t),n.d(t,{formPane:()=>a});var o=n(3383),i=n(2404),r=n(2727);const s=o.ns,a={icon:o.icons.iconBase+"noun_122196.svg",name:"form",audience:[s.solid("PowerUser")],label:function(e){const t=o.widgets.formsFor(e).length;return o.log.debug("Form pane: forms for "+e+": "+t),t?t+" forms":null},render:function(e,t){const n=t.session.store,a=t.dom,c=function(e,t){const n=a.createElement("p");return n.setAttribute("style",t||"color: grey; background-color: white"),h.appendChild(n).textContent=e,n},l=function(e,t){c(e,"style")},u=function(e,t){e||l("Sorry, failed to save your change:\n"+t)},d=i.authn.currentUser(),h=a.createElement("div");if(h.setAttribute("class","formPane"),d){0===n.each(d,s.ui("workspace")).length&&c("You don't seem to have any workspaces defined. A workspace is a place on the web (http://..) or in the file system (file:///) to store application data.\n")}else c("You are not logged in. If you log in and have workspaces then you would be able to select workspace in which to put this new information");const f=function(e,t){n.fetcher.nowOrWhenFetched(e.uri,t,function(n,i){if(!n)return l("Cannot load store "+e.uri+": "+i);const s=o.widgets.formsFor(t);for(let n=0;n<s.length;n++){const i=s[n],c=a.createElement("h4");if(h.appendChild(c),i.uri){const e=r.document(i.uri);if(e.uri!==i.uri){h.appendChild(o.widgets.editFormButton(a,h,i,e,u)).setAttribute("style","float: right;")}}const l=a.createElement("a");l.setAttribute("href",i.uri),c.appendChild(l),l.textContent=o.utils.label(i,!0),o.widgets.appendForm(a,h,{},t,i,e,u)}})};let p=null;const m=r.docpart(e.uri);if(e.uri!==m&&n.updater.editable(m,n)&&(p=e.doc()),p=p||n.any(n.sym(m),s.link("annotationStore")),!p){const t={},n=[];p.statementsMatching(e).forEach(function(e){t[e.why.uri]=1}),p.statementsMatching(void 0,void 0,e).forEach(function(e){t[e.why.uri]=2});for(const e in t)n.push(t[e],e);n.sort();for(let e=0;e<n.length;e++){const t=n[e][1];if(t&&p.updater.editable(t)){p=p.sym(t);break}}}const g="2014";if(p)f(p,e);else{l("No suitable store is known, to edit <"+e.uri+">.");const t=o.login.selectWorkspace(a,function(t){c("Workspace selected OK: "+t);const n=p.each(void 0,s.space("workspace"),t);for(let o=0;o<n.length;o++){const i=n[o],r=p.any(t,s.space("store")),a=p.any(t,s.cal("dtstart")).value(),c=p.any(t,s.cal("dtend")).value();if(r&&a&&c&&a<=g&&c>g){f(r,e);break}l("Note no suitable annotation store in activity: "+i)}});h.appendChild(t)}return h}}}}]);
2
+ //# sourceMappingURL=712.mashlib.min.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";(this.webpackChunkMashlib=this.webpackChunkMashlib||[]).push([[714],{5777(e,t,n){n.r(t),n.d(t,{default:()=>o});var s=n(2404),i=n(3383);const o={icon:i.icons.iconBase+"noun_973694_expanded.svg",name:"folder",mintNew:function(e,t){const n=e.session.store,s=t.newInstance||n.sym(t.newBase);let i=s.uri;return i.endsWith("/")&&(i=i.slice(0,-1)),t.newInstance=n.sym(i+"/"),n.fetcher.webOperation("PUT",s.uri).then(function(){return console.log("New container created: "+s.uri),t})},label:function(e,t){const n=t.session.store,s=n.each(e,i.ns.ldp("contains")).length;return s>0?"Contents ("+s+")":n.holds(e,i.ns.rdf("type"),i.ns.ldp("Container"))?"Container (0)":null},render:function(e,t){function n(e){const t=e.uri.slice(e.dir().uri.length);return!(t.startsWith(".")||t.endsWith(".acl")||t.endsWith("~"))}function o(){let t=a.each(e,i.ns.ldp("contains")).filter(n);t=t.map(e=>[i.utils.label(e).toLowerCase(),e]),t.sort(),t=t.map(e=>e[1]),i.utils.syncTableToArray(c,t,function(t){const n=a.statementsMatching(e,i.ns.ldp("contains"),t)[0],s=l.VIEWAS_boring_default,o=l.propertyTR(r,n,!1);return o.firstChild.textContent="",o.firstChild.style.cssText+="min-width: 3em;",o.appendChild(l.outlineObjectTD(t,s,void 0,n)),o})}const r=t.dom,l=t.getOutliner(r),a=t.session.store;let c;const d=r.createElement("div");d.setAttribute("class","instancePane");const u=i.style.folderPaneStyle||"border-top: solid 1px #777; border-bottom: solid 1px #777; margin-top: 0.5em; margin-bottom: 0.5em;";d.setAttribute("style",u);const h=e.uri.endsWith("/")?e.uri:e.uri+"/",p=a.sym(h+"index.ttl#this");if(a.holds(e,i.ns.ldp("contains"),p.doc())){console.log("View of folder will be view of indexThing. Loading "+p);const e=d.appendChild(r.createElement("div"));return e.style.cssText="border-top: 0.2em solid #ccc;",a.fetcher.load(p.doc()).then(function(){c=e.appendChild(r.createElement("table")),t.getOutliner(r).GotoSubject(p,!0,void 0,!1,void 0,c)}),d}c=d.appendChild(r.createElement("table")),c.refresh=o,o(),a.updater.addDownstreamChangeListener(e,o);const f=d.appendChild(r.createElement("div")),m=s.authn.currentUser();if(!m)return d;const b={folder:e,div:f,dom:r,statusArea:f,me:m};return b.refreshTarget=c,i.login.filterAvailablePanes(t.session.paneRegistry.list).then(function(e){i.create.newThingUI(b,t,e),i.aclControl.preventBrowserDropEvents(r);let n;n=f.firstChild,i.widgets.makeDropTarget(n,null,g)}),d;function g(t){i.widgets.uploadFiles(a.fetcher,t,e.uri,e.uri,function(t,n){const s=a.sym(n);console.log(" Upload: put OK: "+s),a.add(e,i.ns.ldp("contains"),s,e.doc()),c.refresh()})}}}}}]);
2
+ //# sourceMappingURL=714.mashlib.min.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";(this.webpackChunkMashlib=this.webpackChunkMashlib||[]).push([[751],{2293(t,e,o){o.r(e),o.d(e,{default:()=>p});var n=o(3383),s=o(4011),i=o(9676);const r={html:"text/html",htm:"text/html",css:"text/css",js:"text/javascript",json:"application/json",xml:"text/xml",txt:"text/plain",md:"text/markdown",ttl:"text/turtle",n3:"text/n3",rdf:"application/rdf+xml",jsonld:"application/ld+json",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",svg:"image/svg+xml",webp:"image/webp",mp3:"audio/mpeg",mp4:"video/mp4",webm:"video/webm",pdf:"application/pdf"};function l(t){const e=t.split(".").pop()?.toLowerCase();return e&&r[e]||!1}const p={icon:n.icons.iconBase+"dokieli-logo.png",name:"Dokieli",mintClass:n.ns.solid("DokieliDocument"),label:function(t,e){const o=e.session.store,i=n.ns,r=["text/html","application/xhtml+xml"];if(!t.uri)return null;return o.findTypeURIs(t)[i.link("WebPage").uri]?"view":function(t,e,o){const n=t.fetcher.getHeader(e,"content-type");if(n)for(let t=0;t<n.length;t++)for(let e=0;e<o.length;e++)if(n[t].indexOf(o[e])>=0)return!0;return!1}(o,t,r)||function(t,e,o){const n=t.findTypeURIs(e);for(let t=0;t<o.length;t++)if(s.mediaTypeClass(o[t]).uri in n)return!0;return!1}(o,t,r)?"Dok":null},mintNew:function(t,e){const o=t.session.store;let n=e.newInstance;if(!n){let t=e.newBase;t.endsWith("/")&&(t=t.slice(0,-1),e.newBase=t),n=o.sym(t)}const s=l(n.uri);s&&s.includes("html")||(n=i.sym(n.uri+".html")),e.newInstance=n;let r='\n<!DOCTYPE html>\n<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">\n <head>\n <meta charset="utf-8" />\n <title></title>\n <meta content="width=device-width, initial-scale=1" name="viewport" />\n <link href="https://dokie.li/media/css/basic.css" media="all" rel="stylesheet" title="Basic" />\n <link href="https://dokie.li/media/css/dokieli.css" media="all" rel="stylesheet" />\n <script src="https://dokie.li/scripts/dokieli.js"><\/script>\n </head>\n\n <body about="" prefix="rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs: http://www.w3.org/2000/01/rdf-schema# owl: http://www.w3.org/2002/07/owl# xsd: http://www.w3.org/2001/XMLSchema# rdfa: http://www.w3.org/ns/rdfa# dcterms: http://purl.org/dc/terms/ dctypes: http://purl.org/dc/dcmitype/ foaf: http://xmlns.com/foaf/0.1/ pimspace: http://www.w3.org/ns/pim/space# skos: http://www.w3.org/2004/02/skos/core# prov: http://www.w3.org/ns/prov# mem: http://mementoweb.org/ns# qb: http://purl.org/linked-data/cube# schema: http://schema.org/ void: http://rdfs.org/ns/void# rsa: http://www.w3.org/ns/auth/rsa# cert: http://www.w3.org/ns/auth/cert# wgs: http://www.w3.org/2003/01/geo/wgs84_pos# bibo: http://purl.org/ontology/bibo/ sioc: http://rdfs.org/sioc/ns# doap: http://usefulinc.com/ns/doap# dbr: http://dbpedia.org/resource/ dbp: http://dbpedia.org/property/ sio: http://semanticscience.org/resource/ opmw: http://www.opmw.org/ontology/ deo: http://purl.org/spar/deo/ doco: http://purl.org/spar/doco/ cito: http://purl.org/spar/cito/ fabio: http://purl.org/spar/fabio/ oa: http://www.w3.org/ns/oa# as: https://www.w3.org/ns/activitystreams# ldp: http://www.w3.org/ns/ldp# solid: http://www.w3.org/ns/solid/terms# acl: http://www.w3.org/ns/auth/acl# earl: http://www.w3.org/ns/earl# spec: http://www.w3.org/ns/spec# odrl: http://www.w3.org/ns/odrl/2/ dio: https://w3id.org/dio# rel: https://www.w3.org/ns/iana/link-relations/relation#" typeof="schema:CreativeWork prov:Entity">\n <main>\n <article about="" typeof="schema:Article">\n\n </article>\n </main>\n </body>\n</html>',p=n.uri.split("/").slice(-1)[0];p=decodeURIComponent(p.split(".")[0]);const a=p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return r=r.replace("<title>","<title>"+a),r=r.replace("</article>","<h1>"+a+"</h1></article>"),new Promise(function(t){o.fetcher.webOperation("PUT",n.uri,{data:r,contentType:"text/html"}).then(function(){console.log("new Dokieli document created at "+e.newInstance),t(e)}).catch(function(t){console.log("Error creating dokieli doc at "+e.newInstance+": "+t)})})},render:function(t,e){const o=e.dom,n=o.createElement("div"),s=e.session.store;n.setAttribute("class","docView");const i=o.createElement("IFRAME");s.fetcher._fetch(t.uri).then(t=>t.blob()).then(t=>(t.type.startsWith("text")?t.text():Promise.resolve("")).then(e=>({blob:t,blobText:e}))).then(({blob:t,blobText:e})=>{const o=e.includes('<script src="https://dokie.li/scripts/dokieli.js">')?-10:5,n=Math.min(30,e.split(/\n/).length+o);((t,e,o)=>{const n=URL.createObjectURL(e);t.setAttribute("src",n),t.setAttribute("type",e.type),t.setAttribute("class","doc"),t.setAttribute("style",`border: 1px solid; padding: 1em; height:${o}em; width:800px; resize: both; overflow: auto;`),"text/html"!==e.type&&"application/xhtml+xml"!==e.type||t.setAttribute("sandbox","allow-scripts allow-same-origin")})(i,t,n)}).catch(t=>{console.log("Error fetching or processing blob:",t)});const r=s.fetcher.getHeader(t.doc(),"content-type"),l=r?r[0].split(";",1)[0].trim():null;l?console.log("dokieliPane: c-t:"+l):console.log("dokieliPane: unknown content-type?");const p=o.createElement("tr");return p.appendChild(i),n.appendChild(p),n}}}}]);
2
+ //# sourceMappingURL=751.mashlib.min.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";(this.webpackChunkMashlib=this.webpackChunkMashlib||[]).push([[758],{5124(e,n,t){t.d(n,{mintNew:()=>k,render:()=>c});var o=t(3383),a=t(9676),r=t(3581),i=t(2404);const d=o.ns,s=r.A("http://schema.org/"),m=document;function l(e,n,t){const o=n.session.store,a=m.createElement("div");a.className="bookmark-item";const r=o.anyValue(e,s("name"))||"Untitled",d=o.any(e,s("url")),l=o.anyValue(e,s("description")),c=o.anyValue(e,s("dateCreated")),k=m.createElement("h3");if(k.className="bookmark-title",d){const e=m.createElement("a");e.href=d.uri||d.value,e.target="_blank",e.rel="noopener noreferrer",e.textContent=r,k.appendChild(e)}else k.textContent=r;if(a.appendChild(k),d){const e=m.createElement("div");e.className="bookmark-url",e.textContent=d.uri||d.value,a.appendChild(e)}if(l){const e=m.createElement("p");e.className="bookmark-description",e.textContent=l,a.appendChild(e)}if(c){const e=m.createElement("div");e.className="bookmark-date",e.textContent="Added: "+new Date(c).toLocaleDateString(),a.appendChild(e)}const p=m.createElement("button");return p.className="bookmark-delete",p.textContent="×",p.title="Delete bookmark",p.onclick=async()=>{if(confirm("Delete this bookmark?"))try{const n=o.statementsMatching(e,null,null,e.doc());await i.store.updater.update(n,[]),a.remove()}catch(e){alert("Failed to delete: "+e.message)}},a.appendChild(p),a}function c(e,n,t){const o=n.session.store,r=m.createElement("div");r.className="bookmark-pane";const c=m.createElement("style");c.textContent="\n .bookmark-pane {\n padding: 1em;\n font-family: system-ui, sans-serif;\n }\n .bookmark-item {\n border: 1px solid #ddd;\n border-radius: 8px;\n padding: 1em;\n margin-bottom: 1em;\n position: relative;\n background: #fafafa;\n }\n .bookmark-title {\n margin: 0 0 0.5em 0;\n font-size: 1.2em;\n }\n .bookmark-title a {\n color: #0066cc;\n text-decoration: none;\n }\n .bookmark-title a:hover {\n text-decoration: underline;\n }\n .bookmark-url {\n color: #666;\n font-size: 0.9em;\n margin-bottom: 0.5em;\n }\n .bookmark-description {\n margin: 0.5em 0;\n color: #333;\n }\n .bookmark-date {\n font-size: 0.8em;\n color: #999;\n }\n .bookmark-delete {\n position: absolute;\n top: 0.5em;\n right: 0.5em;\n background: #ff4444;\n color: white;\n border: none;\n border-radius: 50%;\n width: 24px;\n height: 24px;\n cursor: pointer;\n font-size: 16px;\n line-height: 1;\n }\n .bookmark-delete:hover {\n background: #cc0000;\n }\n .bookmark-add-form {\n border: 2px dashed #ccc;\n border-radius: 8px;\n padding: 1em;\n margin-top: 1em;\n }\n .bookmark-add-form h4 {\n margin: 0 0 1em 0;\n }\n .bookmark-add-form input,\n .bookmark-add-form textarea {\n display: block;\n width: 100%;\n padding: 0.5em;\n margin-bottom: 0.5em;\n border: 1px solid #ccc;\n border-radius: 4px;\n box-sizing: border-box;\n }\n .bookmark-add-form button {\n background: #0066cc;\n color: white;\n border: none;\n padding: 0.5em 1em;\n border-radius: 4px;\n cursor: pointer;\n }\n .bookmark-add-form button:hover {\n background: #0055aa;\n }\n .bookmark-empty {\n color: #666;\n font-style: italic;\n padding: 2em;\n text-align: center;\n }\n ",r.appendChild(c);const k=m.createElement("h2");k.textContent="🔖 Bookmarks",r.appendChild(k);const p=o.findTypeURIs(e),b=p[d.ldp("Container").uri]||p[d.ldp("BasicContainer").uri],u=p[s("Bookmark").uri],h=m.createElement("div");if(h.className="bookmark-list",r.appendChild(h),u)h.appendChild(l(e,n));else if(b){const t=o.each(e,d.ldp("contains")).filter(e=>o.findTypeURIs(e)[s("Bookmark").uri]);if(0===t.length){const e=m.createElement("div");e.className="bookmark-empty",e.textContent="No bookmarks yet. Add one below!",h.appendChild(e)}else t.forEach(e=>{h.appendChild(l(e,n))});const c=function(e,n,t){const o=m.createElement("form");return o.className="bookmark-add-form",o.innerHTML='\n <h4>Add Bookmark</h4>\n <input type="text" name="name" placeholder="Title" required />\n <input type="url" name="url" placeholder="https://example.com" required />\n <textarea name="description" placeholder="Description (optional)"></textarea>\n <button type="submit">Add Bookmark</button>\n ',o.onsubmit=async n=>{n.preventDefault();const r=new FormData(o),m=r.get("name"),l=r.get("url"),c=r.get("description");try{const n="bookmark-"+Date.now(),r=e+"#"+n,k=a.sym(r),p=a.sym(e),b=[a.st(k,d.rdf("type"),s("Bookmark"),p),a.st(k,s("name"),m,p),a.st(k,s("url"),a.sym(l),p),a.st(k,s("dateCreated"),(new Date).toISOString(),p)];c&&b.push(a.st(k,s("description"),c,p)),await i.store.updater.update([],b),o.reset(),t&&t(k)}catch(n){alert("Failed to add bookmark: "+n.message)}},o}(e.uri,0,e=>{const t=h.querySelector(".bookmark-empty");t&&t.remove(),h.appendChild(l(e,n))});r.appendChild(c)}return r}async function k(e,n){const t=n.newBase||e.session.store.any(null,d.space("preferencesFile"))?.uri;if(!t)throw new Error("No location specified for new bookmark");const o=t+"bookmarks.ttl",r=a.sym(o+"#bookmark-"+Date.now()),m=a.sym(o),l=[a.st(r,d.rdf("type"),s("Bookmark"),m),a.st(r,s("name"),"New Bookmark",m),a.st(r,s("dateCreated"),(new Date).toISOString(),m)];return await i.store.updater.update([],l),r}}}]);
2
+ //# sourceMappingURL=758.mashlib.min.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";(this.webpackChunkMashlib=this.webpackChunkMashlib||[]).push([[804],{4862(e,t,n){n.r(t),n.d(t,{dashboardPane:()=>i,default:()=>l});var s=n(3383),r=n(2404),o=n(9676);async function a(e,t,n){const r=await async function(e,t){const n=e.site().uri,s=(0,o.sym)(`${n}profile/card#me`);return await t.load(s),s}(e,n),a=function(e,t){return e.anyValue(t,s.ns.vcard("fn"),null,t.doc())||e.anyValue(t,s.ns.foaf("name"),null,t.doc())||new URL(t.uri).host.split(".")[0]}(t,r),i=document.createElement("div");return i.classList.add("container"),i.appendChild(function(e,t){const n=document.createElement("a");n.href=e,n.innerText=t;const s=document.createElement("span");s.innerText="'s Pod";const r=document.createElement("h1");return r.appendChild(n),r.appendChild(s),r}(r.uri,a)),i.appendChild(function(e){const t=document.createElement("section"),n=document.createElement("h2");n.innerText="Data",t.appendChild(n);const s=document.createElement("div");s.classList.add("list-group"),t.appendChild(s);const r=document.createElement("a");return r.classList.add("list-group-item"),r.href=window.document.location.href+"public/",r.innerText=`View ${e}'s files`,s.appendChild(r),t}(a)),i}const i={icon:s.icons.iconBase+"noun_547570.svg",name:"dashboard",label:e=>(console.log(),e.uri===e.site().uri?"Dashboard":null),render:(e,t)=>{console.log("Dashboard Pane Render");const n=t.dom.createElement("div"),s=()=>{n.innerHTML="",function(e,t,n,s){const o=new URL(window.location.href).searchParams.get("uri");if(t&&(o||t.site().uri===s.site().uri))return function(e,t){const n=t.getOutliner(t.dom);n.getDashboard().then(t=>e.appendChild(t))}(e,n);(function(e,t){const n=document.createElement("div");e.appendChild(n);const s=n.attachShadow({mode:"open"}),o=document.createElement("link");o.rel="stylesheet",o.href="/common/css/bootstrap.min.css",s.appendChild(o),a(t,r.store,r.store.fetcher).then(e=>s.appendChild(e))})(e,s)}(n,r.authn.currentUser()||null,t,e)};return r.authSession.events.on("login",()=>{s()}),r.authSession.events.on("sessionRestore",()=>{s()}),s(),n}};const l=i},5808(e,t,n){n.r(t),n.d(t,{default:()=>m});var s=n(3383),r=n(2404),o=n(9676),a=n(8921);function i(e,t,n,s){return n.statementsMatching(null,s.acl("origin"),e).reduce((e,r)=>e.concat(n.statementsMatching(t,s.acl("trustedApp"),r.subject)).concat(n.statementsMatching(r.subject)),[])}function l(e){const t=c("table",{class:"results"}),n=u("tr",[p("th","Application URL"),p("th","Access modes"),p("th","Actions")]);return t.appendChild(n),r.store.each(e,s.ns.acl("trustedApp"),void 0,void 0).flatMap(e=>r.store.each(e,s.ns.acl("origin"),void 0,void 0).map(t=>({appModes:r.store.each(e,s.ns.acl("mode"),void 0,void 0),origin:t}))).sort((e,t)=>e.origin.value<t.origin.value?-1:1).forEach(({appModes:n,origin:s})=>t.appendChild(d(e,s,n,o))),t.appendChild(d(e,null,[s.ns.acl("Read")],o)),t;function o(){t.parentElement.replaceChild(l(e),t)}}function d(e,t,n,l){const d={origin:t,appModes:n,formElements:{modes:[],origin:void 0}};return u("tr",[u("td",[u("form",[c("input",{class:"textinput",placeholder:"Write new URL here",value:t?t.value:""},{},e=>{d.formElements.origin=e})],{},{submit:m})]),u("td",[u("form",h(d),{},{submit:m})]),u("td",[u("form",t?[p("button","Update",{class:"controlButton",style:"background: LightGreen;"}),p("button","Delete",{class:"controlButton",style:"background: LightCoral;"},{click:function(t){let n;t.preventDefault();try{n=(0,o.sym)(d.formElements.origin.value)}catch(e){return alert("Please provide an application URL you want to remove trust from")}const a=i(n,e,r.store,s.ns);if(!r.store.updater)throw new Error("Store has no updater");r.store.updater.update(a,[],f)}})]:[p("button","Add",{class:"controlButton",style:"background: LightGreen;"})],{},{submit:m})])]);function m(t){let n;t.preventDefault();try{n=(0,o.sym)(d.formElements.origin.value)}catch(e){return alert("Please provide an application URL you want to trust")}const l=d.formElements.modes.filter(e=>e.checked).map(e=>e.value),c=i(d.origin||n,e,r.store,s.ns),u=function(e,t,n,s,r){const i=new a.A(`bn_${t}`);return[(0,o.st)(s,r.acl("trustedApp"),i,s.doc()),(0,o.st)(i,r.acl("origin"),e,s.doc()),...n.map(e=>(0,o.sym)(e)).map(e=>(0,o.st)(i,r.acl("mode"),e,s.doc()))]}(n,Math.random().toString(36).substr(2,5),l,e,s.ns);if(!r.store.updater)throw new Error("Store has no updater");r.store.updater.update(c,u,f)}function f(e,t,n){if(t)return l()}}function c(e,t={},n={},s=null){const r=document.createElement(e);return s&&s(r),Object.keys(t).forEach(e=>{r.setAttribute(e,t[e])}),Object.keys(n).forEach(e=>{r.addEventListener(e,n[e])}),r}function u(e,t,n={},s={},r=null){const o=c(e,n,s,r);return t.forEach(e=>o.appendChild(e)),o}function p(e,t,n={},s={},r=null){const o=c(e,n,s,r);return o.textContent=t,o}function h({appModes:e,formElements:t}){return["Read","Write","Append","Control"].map(n=>u("label",[c("input",{type:"checkbox",...e.some(e=>e.value===s.ns.acl(n).value)?{checked:""}:{},value:s.ns.acl(n).uri},{},e=>t.modes.push(e)),p("span",n)]))}const m={global:!0,icon:`${s.icons.iconBase}noun_15177.svg`,name:"trustedApplications",label:()=>null,render:(e,t)=>{const n=t.dom,o=n.createElement("div");o.classList.add("trusted-applications-pane"),o.setAttribute("style","border: 0.3em solid #418d99; border-radius: 0.5em; padding: 0.7em; margin-top:0.7em;");const a=o.appendChild(n.createElement("table")),i=a.appendChild(n.createElement("tr")),d=a.appendChild(n.createElement("tr")).appendChild(n.createElement("div"));return d.setAttribute("style","padding: 0.7em;"),async function(e,t,n){const o=await s.login.ensureLoadedProfile({dom:e,div:t,statusArea:n,me:null}),a=o.me,i=a.doc();if(!r.store.updater)throw new Error("Store has no updater");const d=r.store.updater.editable(i.uri,r.store);if(t.appendChild(p("h3","Manage your trusted applications")),!d)return void t.appendChild(s.widgets.errorMessageBlock(e,`Your profile ${a.doc().uri} is not editable, so we cannot do much here.`));t.appendChild(p("p","Here you can manage the applications you trust."));const c=l(a);t.appendChild(c),t.appendChild(p("h4","Notes")),t.appendChild(u("ol",[t.appendChild(p("li","Trusted applications will get access to all resources that you have access to.")),t.appendChild(p("li","You can limit which modes they have by default.")),t.appendChild(p("li","They will not gain more access than you have."))])),t.appendChild(p("p","Application URLs must be valid URL. Examples are http://localhost:3000, https://trusted.app, and https://sub.trusted.app."))}(n,i,d).catch(e=>d.appendChild(s.widgets.errorMessageBlock(n,e))),o}}},6290(e,t,n){n.r(t),n.d(t,{basicPreferencesPane:()=>o,default:()=>a});var s=n(5796),r=n(3383);const o={icon:r.icons.iconBase+"noun_Sliders_341315_000000.svg",name:"basicPreferences",label:e=>null,render:(e,t)=>{const n=t.dom,o=t.session.store;function a(e,t){e||l.appendChild(r.widgets.errorMessageBlock(n,t,"#fee"))}const l=n.createElement("div"),d=function(e,t){const n=i(e,t,"User types"),s=n.appendChild(t.createElement("p"));s.innerText="Here you can self-assign user types to help the data browser know which views you would like to access.";const r=n.appendChild(t.createElement("a"));r.href="https://github.com/solidos/userguide/#role",r.innerText="Read more";const o=n.appendChild(t.createElement("div"));return o}(l,n);function c(e,t){e=e.doc(),o.holds(void 0,void 0,void 0,e)||(0,s.A)(t,o,e.uri,"text/turtle",null)}const u=o.sym("urn:uuid:93774ba1-d3b6-41f2-85b6-4ae27ffd2597#this");c(u,'@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix ui: <http://www.w3.org/ns/ui#>.\n@prefix : <#>.\n\n:this <http://purl.org/dc/elements/1.1/title> "Basic preferences" ;\n a ui:Form ;\n ui:part :categorizeUser, :privateComment, :personalInformationHeading;\n ui:parts ( :personalInformationHeading :privateComment :categorizeUser ).\n\n:personalInformationHeading a ui:Heading;\n ui:contents "Personal information".\n\n:privateComment a ui:Comment;\n ui:contents "This information is private.".\n\n:categorizeUser a ui:Classifier;\n ui:label "Level of user"; ui:property rdf:type ; ui:category solid:User.\n');return c(o.sym("urn:uuid:93774ba1-d3b6-41f2-85b6-4ae27ffd2597-ONT"),'@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix schema: <http:/schema.org/>.\n@prefix ui: <http://www.w3.org/ns/ui#>.\n@prefix vcard: <http://www.w3.org/2006/vcard/ns#>.\n@prefix : <#>.\n\nsolid:User a rdfs:Class;\n rdfs:label "user"@en, "utilisateur"@fr;\n rdfs:comment """Any person who might use a Solid-based system""";\n rdfs:subClassOf foaf:Person, schema:Person, vcard:Individual.\n\n# Since these options are opt-in, it is a bit strange to have new users opt in\n# That they are new users - also we do not use this class for anything specific\n# yet\n# solid:NewUser a rdfs:Class;\n# rdfs:label "new user"@en;\n# rdfs:comment """A person who might use a Solid-based system who has a low\n# level of familiarity with technical details.""";\n# rdfs:subClassOf solid:User.\n\nsolid:PowerUser a rdfs:Class;\n rdfs:label "power user"@en;\n rdfs:comment """A person who might use a Solid-based system\n who is prepared to be given a more complex interface in order\n to be provided with more pwerful features.""";\n rdfs:subClassOf solid:User.\n\n solid:Developer a rdfs:Class;\n rdfs:label "Developer";\n rdfs:comment """Any person who might use a Solid-based system,\n who has software development skills.""";\n rdfs:subClassOf solid:User.\n'),async function(){const e=await r.login.ensureLoadedPreferences({dom:n,div:l});if(!e.preferencesFile)return void console.log("Not doing private class preferences as no access to preferences file. "+e.preferencesFileError);r.widgets.appendForm(n,d,{},e.me,u,e.preferencesFile,a).style.borderStyle="none";const s=t.session.paneRegistry.byName("trustedApplications");s&&l.appendChild(s.render(null,t)),function(e,t,n,s){const o=i(e,s,"Delete account"),a=t.each(n,r.ns.space("storage"),null,n.doc()),l=a.map(e=>e.value),d=o.appendChild(s.createElement("ul"));l.forEach(async e=>{const t=await async function(e,t){const n=t.createElement("a");n.textContent=`Delete your account at ${e}`;const s=await async function(e){const t=new URL(e),n=new URL(e);n.pathname=t.pathname="/account/delete";const s=n.hostname.split(".");n.hostname=s.slice(1).join(".");if((await fetch(n.href,{method:"HEAD"})).ok)return n.href;if((await fetch(t.href,{method:"HEAD"})).ok)return t.href;return null}(e);if("string"!=typeof s)return null;return n.href=s,n}(e,s);if(t){d.appendChild(s.createElement("li")).appendChild(t)}})}(l,o,e.me,n)}(),l}};const a=o;function i(e,t,n){const s=e.appendChild(t.createElement("div"));s.style.border="0.3em solid #418d99",s.style.borderRadius="0.5em",s.style.padding="0.7em",s.style.marginTop="0.7em";return s.appendChild(t.createElement("h3")).innerText=n,s}}}]);
2
+ //# sourceMappingURL=804.mashlib.min.js.map
@@ -1,7 +1,7 @@
1
1
  (this.webpackChunkMashlib=this.webpackChunkMashlib||[]).push([[841],{202(e,t,n){"use strict";
2
2
  /*!
3
3
  * Copyright (c) 2016-2023 Digital Bazaar, Inc. All rights reserved.
4
- */const o=n(2985),i=n(7920),r=n(9925),a=n(1227);function s(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=null,messageDigestAlgorithm:t="sha256",canonicalIdMap:n=new Map,maxWorkFactor:r=1,maxDeepIterations:a=-1,timeout:s=0}={}){this.name="RDFC-1.0",this.blankNodeInfo=new Map,this.canonicalIssuer=new o("c14n",n),this.createMessageDigest=e||(()=>new i(t)),this.maxWorkFactor=r,this.maxDeepIterations=a,this.remainingDeepIterations=0,this.timeout=s,s>0&&(this.startTime=Date.now()),this.quads=null}main(e){this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const e of n)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),r=[];for(const e of i){const n=t.get(e);if(n.length>1){r.push(n);continue}const o=n[0];this.canonicalIssuer.getId(o)}if(this.maxDeepIterations<0)if(0===this.maxWorkFactor)this.maxDeepIterations=0;else if(this.maxWorkFactor===1/0)this.maxDeepIterations=1/0;else{const e=r.reduce((e,t)=>e+t.length,0);this.maxDeepIterations=e**this.maxWorkFactor}this.maxDeepIterations>Number.MAX_SAFE_INTEGER&&(this.maxDeepIterations=1/0),this.remainingDeepIterations=this.maxDeepIterations;for(const e of r){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new o("b");e.getId(n);const i=this.hashNDegreeQuads(n,e);t.push(i)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=a.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),o=n.quads;for(const n of o)t.push(a.serializeQuadComponents(this.modifyFirstDegreeComponent(e,n.subject,"subject"),n.predicate,this.modifyFirstDegreeComponent(e,n.object,"object"),this.modifyFirstDegreeComponent(e,n.graph,"graph")));t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return n.hash=i.digest(),n.hash}hashRelatedBlankNode(e,t,n,o){const i=this.createMessageDigest();let r;return i.update(o),"g"!==o&&i.update(this.getRelatedPredicate(t)),r=this.canonicalIssuer.hasId(e)?"_:"+this.canonicalIssuer.getId(e):n.hasId(e)?"_:"+n.getId(e):this.blankNodeInfo.get(e).hash,i.update(r),i.digest()}hashNDegreeQuads(e,t){if(0===this.remainingDeepIterations)throw new Error(`Maximum deep iterations exceeded (${this.maxDeepIterations}).`);this.remainingDeepIterations--;const n=this.createMessageDigest(),o=this.createHashToRelated(e,t),i=[...o.keys()].sort();for(const e of i){n.update(e);let i,a="";const s=new r(o.get(e));let l=0;for(;s.hasNext();){const e=s.next();if(++l%3==0&&this.timeout>0&&Date.now()-this.startTime>this.timeout)throw new Error("Canonize timeout.");let n=t.clone(),o="";const r=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?o+="_:"+this.canonicalIssuer.getId(t):(n.hasId(t)||r.push(t),o+="_:"+n.getId(t)),0!==a.length&&o>a){c=!0;break}if(!c){for(const e of r){const t=this.hashNDegreeQuads(e,n);if(o+="_:"+n.getId(e),o+=`<${t.hash}>`,n=t.issuer,0!==a.length&&o>a){c=!0;break}}c||(0===a.length||o<a)&&(a=o,i=n)}}n.update(a),t=i}return{hash:n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"a":"z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;for(const i of o)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=this.hashFirstDegreeQuads(e),o=t.get(n);o?o.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,o=this.blankNodeInfo.get(n);o?o.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:o,issuer:i,hashToRelated:r}){if("BlankNode"!==t.termType||t.value===o)return;const a=t.value,s=this.hashRelatedBlankNode(a,e,i,n),l=r.get(s);l?l.push(a):r.set(s,[a])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},259(e){"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},470(e,t,n){"use strict";const o=n(7382),i={};e.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const n={},o=i.parsers[t||"full"],r=o.regex.exec(e);let a=o.keys.length;for(;a--;)n[o.keys[a]]=void 0===r[a]?null:r[a];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!o.isString(e)||(e=i.parse(e||""));const n=i.parse(t),r={protocol:e.protocol||""};if(null!==n.authority)r.authority=n.authority,r.path=n.path,r.query=n.query;else if(r.authority=e.authority,""===n.path)r.path=e.path,null!==n.query?r.query=n.query:r.query=e.query;else{if(0===n.path.indexOf("/"))r.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,r.path=t}r.query=n.query}""!==n.path&&(r.path=i.removeDotSegments(r.path));let a=r.protocol;return null!==r.authority&&(a+="//"+r.authority),a+=r.path,null!==r.query&&(a+="?"+r.query),null!==n.fragment&&(a+="#"+n.fragment),""===a&&(a="./"),a},i.removeBase=(e,t)=>{if(null===e)return t;e&&!o.isString(e)||(e=i.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const r=i.parse(t.substr(n.length)),a=e.normalizedPath.split("/"),s=r.normalizedPath.split("/"),l=r.fragment||r.query?0:1;for(;a.length>0&&s.length>l&&a[0]===s[0];)a.shift(),s.shift();let c="";if(a.length>0){a.pop();for(let e=0;e<a.length;++e)c+="../"}return c+=s.join("/"),null!==r.query&&(c+="?"+r.query),null!==r.fragment&&(c+="#"+r.fragment),""===c&&(c="./"),c},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),o=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),o&&n.push("")):o&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const r=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>o.isString(e)&&r.test(e),i.isRelative=e=>o.isString(e)},701(e,t,n){"use strict";const o=n(6957),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=o,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},989(e,t,n){e.exports=n(4005)},1227(e){"use strict";
4
+ */const o=n(2985),i=n(7920),r=n(9925),a=n(1227);function s(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=null,messageDigestAlgorithm:t="sha256",canonicalIdMap:n=new Map,maxWorkFactor:r=1,maxDeepIterations:a=-1,timeout:s=0}={}){this.name="RDFC-1.0",this.blankNodeInfo=new Map,this.canonicalIssuer=new o("c14n",n),this.createMessageDigest=e||(()=>new i(t)),this.maxWorkFactor=r,this.maxDeepIterations=a,this.remainingDeepIterations=0,this.timeout=s,s>0&&(this.startTime=Date.now()),this.quads=null}main(e){this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const e of n)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),r=[];for(const e of i){const n=t.get(e);if(n.length>1){r.push(n);continue}const o=n[0];this.canonicalIssuer.getId(o)}if(this.maxDeepIterations<0)if(0===this.maxWorkFactor)this.maxDeepIterations=0;else if(this.maxWorkFactor===1/0)this.maxDeepIterations=1/0;else{const e=r.reduce((e,t)=>e+t.length,0);this.maxDeepIterations=e**this.maxWorkFactor}this.maxDeepIterations>Number.MAX_SAFE_INTEGER&&(this.maxDeepIterations=1/0),this.remainingDeepIterations=this.maxDeepIterations;for(const e of r){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new o("b");e.getId(n);const i=this.hashNDegreeQuads(n,e);t.push(i)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=a.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),o=n.quads;for(const n of o)t.push(a.serializeQuadComponents(this.modifyFirstDegreeComponent(e,n.subject,"subject"),n.predicate,this.modifyFirstDegreeComponent(e,n.object,"object"),this.modifyFirstDegreeComponent(e,n.graph,"graph")));t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return n.hash=i.digest(),n.hash}hashRelatedBlankNode(e,t,n,o){const i=this.createMessageDigest();let r;return i.update(o),"g"!==o&&i.update(this.getRelatedPredicate(t)),r=this.canonicalIssuer.hasId(e)?"_:"+this.canonicalIssuer.getId(e):n.hasId(e)?"_:"+n.getId(e):this.blankNodeInfo.get(e).hash,i.update(r),i.digest()}hashNDegreeQuads(e,t){if(0===this.remainingDeepIterations)throw new Error(`Maximum deep iterations exceeded (${this.maxDeepIterations}).`);this.remainingDeepIterations--;const n=this.createMessageDigest(),o=this.createHashToRelated(e,t),i=[...o.keys()].sort();for(const e of i){n.update(e);let i,a="";const s=new r(o.get(e));let l=0;for(;s.hasNext();){const e=s.next();if(++l%3==0&&this.timeout>0&&Date.now()-this.startTime>this.timeout)throw new Error("Canonize timeout.");let n=t.clone(),o="";const r=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?o+="_:"+this.canonicalIssuer.getId(t):(n.hasId(t)||r.push(t),o+="_:"+n.getId(t)),0!==a.length&&o>a){c=!0;break}if(!c){for(const e of r){const t=this.hashNDegreeQuads(e,n);if(o+="_:"+n.getId(e),o+=`<${t.hash}>`,n=t.issuer,0!==a.length&&o>a){c=!0;break}}c||(0===a.length||o<a)&&(a=o,i=n)}}n.update(a),t=i}return{hash:n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"a":"z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;for(const i of o)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=this.hashFirstDegreeQuads(e),o=t.get(n);o?o.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,o=this.blankNodeInfo.get(n);o?o.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:o,issuer:i,hashToRelated:r}){if("BlankNode"!==t.termType||t.value===o)return;const a=t.value,s=this.hashRelatedBlankNode(a,e,i,n),l=r.get(s);l?l.push(a):r.set(s,[a])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},259(e){"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},470(e,t,n){"use strict";const o=n(7382),i={};e.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const n={},o=i.parsers[t||"full"],r=o.regex.exec(e);let a=o.keys.length;for(;a--;)n[o.keys[a]]=void 0===r[a]?null:r[a];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!o.isString(e)||(e=i.parse(e||""));const n=i.parse(t),r={protocol:e.protocol||""};if(null!==n.authority)r.authority=n.authority,r.path=n.path,r.query=n.query;else if(r.authority=e.authority,""===n.path)r.path=e.path,null!==n.query?r.query=n.query:r.query=e.query;else{if(0===n.path.indexOf("/"))r.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,r.path=t}r.query=n.query}""!==n.path&&(r.path=i.removeDotSegments(r.path));let a=r.protocol;return null!==r.authority&&(a+="//"+r.authority),a+=r.path,null!==r.query&&(a+="?"+r.query),null!==n.fragment&&(a+="#"+n.fragment),""===a&&(a="./"),a},i.removeBase=(e,t)=>{if(null===e)return t;e&&!o.isString(e)||(e=i.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const r=i.parse(t.substr(n.length)),a=e.normalizedPath.split("/"),s=r.normalizedPath.split("/"),l=r.fragment||r.query?0:1;for(;a.length>0&&s.length>l&&a[0]===s[0];)a.shift(),s.shift();let c="";if(a.length>0){a.pop();for(let e=0;e<a.length;++e)c+="../"}return c+=s.join("/"),null!==r.query&&(c+="?"+r.query),null!==r.fragment&&(c+="#"+r.fragment),""===c&&(c="./"),c},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),o=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),o&&n.push("")):o&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const r=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>o.isString(e)&&r.test(e),i.isRelative=e=>o.isString(e)},701(e,t,n){"use strict";const o=n(6957),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=o,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},989(e,t,n){e.exports=n(4005)},1058(e,t,n){"use strict";const o=n(2207),{isArray:i,isObject:r,isString:a,isUndefined:s}=n(7382),{isList:l,isValue:c,isGraph:d,isSimpleGraph:u,isSubjectReference:p}=n(3978),{expandIri:h,getContextValue:f,isKeyword:v,process:g,processingMode:y}=n(1972),{removeBase:m,prependBase:x}=n(470),{REGEX_KEYWORD:b,addValue:w,asArray:I,compareShortestLeast:j}=n(9263),S={};function O(e,t,n){if("@nest"!==h(e,t,{vocab:!0},n))throw new o("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=S,S.compact=async({activeCtx:e,activeProperty:t=null,element:n,options:h={}})=>{if(i(n)){let o=[];for(let i=0;i<n.length;++i){const r=await S.compact({activeCtx:e,activeProperty:t,element:n[i],options:h});null!==r&&o.push(r)}if(h.compactArrays&&1===o.length){0===(f(e,t,"@container")||[]).length&&(o=o[0])}return o}const m=f(e,t,"@context");if(s(m)||(e=await g({activeCtx:e,localCtx:m,propagate:!0,overrideProtected:!0,options:h})),r(n)){if(h.link&&"@id"in n&&h.link.hasOwnProperty(n["@id"])){const e=h.link[n["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===n)return e[t].compacted}if(c(n)||p(n)){const o=S.compactValue({activeCtx:e,activeProperty:t,value:n,options:h});return h.link&&p(n)&&(h.link.hasOwnProperty(n["@id"])||(h.link[n["@id"]]=[]),h.link[n["@id"]].push({expanded:n,compacted:o})),o}if(l(n)){if((f(e,t,"@container")||[]).includes("@list"))return S.compact({activeCtx:e,activeProperty:t,element:n["@list"],options:h})}const m="@reverse"===t,x={},b=e;c(n)||p(n)||(e=e.revertToPreviousContext());const j=f(b,t,"@context");s(j)||(e=await g({activeCtx:e,localCtx:j,propagate:!0,overrideProtected:!0,options:h})),h.link&&"@id"in n&&(h.link.hasOwnProperty(n["@id"])||(h.link[n["@id"]]=[]),h.link[n["@id"]].push({expanded:n,compacted:x}));let D=n["@type"]||[];D.length>1&&(D=Array.from(D).sort());const E=e;for(const t of D){const n=S.compactIri({activeCtx:E,iri:t,relativeTo:{vocab:!0}}),o=f(b,n,"@context");s(o)||(e=await g({activeCtx:e,localCtx:o,options:h,propagate:!1}))}const N=Object.keys(n).sort();for(const s of N){const p=n[s];if("@id"===s){let t=I(p).map(t=>S.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:h.base}));1===t.length&&(t=t[0]);x[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t;continue}if("@type"===s){let t=I(p).map(e=>S.compactIri({activeCtx:b,iri:e,relativeTo:{vocab:!0}}));1===t.length&&(t=t[0]);const n=S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),o=(f(e,n,"@container")||[]).includes("@set")&&y(e,1.1)||i(t)&&0===p.length;w(x,n,t,{propertyIsArray:o});continue}if("@reverse"===s){const t=await S.compact({activeCtx:e,activeProperty:"@reverse",element:p,options:h});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const o=t[n],i=(f(e,n,"@container")||[]).includes("@set")||!h.compactArrays;w(x,n,o,{propertyIsArray:i}),delete t[n]}if(Object.keys(t).length>0){const n=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,n,t)}continue}if("@preserve"===s){const n=await S.compact({activeCtx:e,activeProperty:t,element:p,options:h});i(n)&&0===n.length||w(x,s,n);continue}if("@index"===s){if((f(e,t,"@container")||[]).includes("@index"))continue;const n=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,n,p);continue}if("@graph"!==s&&"@list"!==s&&"@included"!==s&&v(s)){const t=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,t,p);continue}if(!i(p))throw new o("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===p.length){const t=S.compactIri({activeCtx:e,iri:s,value:p,relativeTo:{vocab:!0},reverse:m}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let o=x;n&&(O(e,n,h),r(x[n])||(x[n]={}),o=x[n]),w(o,t,p,{propertyIsArray:!0})}for(const t of p){const n=S.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:m}),o=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let p=x;o&&(O(e,o,h),r(x[o])||(x[o]={}),p=x[o]);const v=f(e,n,"@container")||[],g=d(t),y=l(t);let b;y?b=t["@list"]:g&&(b=t["@graph"]);let j=await S.compact({activeCtx:e,activeProperty:n,element:y||g?b:t,options:h});if(y){if(i(j)||(j=[j]),v.includes("@list")){w(p,n,j,{valueIsArray:!0,allowDuplicate:!0});continue}j={[S.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:j},"@index"in t&&(j[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(g)if(v.includes("@graph")&&(v.includes("@id")||v.includes("@index")&&u(t))){let o;p.hasOwnProperty(n)?o=p[n]:p[n]=o={};const i=(v.includes("@id")?t["@id"]:t["@index"])||S.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});w(o,i,j,{propertyIsArray:!h.compactArrays||v.includes("@set")})}else v.includes("@graph")&&u(t)?(i(j)&&j.length>1&&(j={"@included":j}),w(p,n,j,{propertyIsArray:!h.compactArrays||v.includes("@set")})):(i(j)&&1===j.length&&h.compactArrays&&(j=j[0]),j={[S.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:j},"@id"in t&&(j[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(j[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),w(p,n,j,{propertyIsArray:!h.compactArrays||v.includes("@set")}));else if(v.includes("@language")||v.includes("@index")||v.includes("@id")||v.includes("@type")){let o,i;if(p.hasOwnProperty(n)?o=p[n]:p[n]=o={},v.includes("@language"))c(j)&&(j=j["@value"]),i=t["@language"];else if(v.includes("@index")){const o=f(e,n,"@index")||"@index",r=S.compactIri({activeCtx:e,iri:o,relativeTo:{vocab:!0}});if("@index"===o)i=t["@index"],delete j[r];else{let e;if([i,...e]=I(j[o]||[]),a(i))switch(e.length){case 0:delete j[o];break;case 1:j[o]=e[0];break;default:j[o]=e}else i=null}}else if(v.includes("@id")){const t=S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=j[t],delete j[t]}else if(v.includes("@type")){const o=S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let r;switch([i,...r]=I(j[o]||[]),r.length){case 0:delete j[o];break;case 1:j[o]=r[0];break;default:j[o]=r}1===Object.keys(j).length&&"@id"in t&&(j=await S.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:h}))}i||(i=S.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),w(o,i,j,{propertyIsArray:v.includes("@set")})}else{const e=!h.compactArrays||v.includes("@set")||v.includes("@list")||i(j)&&0===j.length||"@list"===s||"@graph"===s;w(p,n,j,{propertyIsArray:e})}}}return x}return n},S.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:i={vocab:!1},reverse:a=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const u=e.getInverse();if(v(t)&&t in u&&"@none"in u[t]&&"@type"in u[t]["@none"]&&"@none"in u[t]["@none"]["@type"])return u[t]["@none"]["@type"]["@none"];if(i.vocab&&t in u){const o=e["@language"]||"@none",i=[];r(n)&&"@index"in n&&!("@graph"in n)&&i.push("@index","@index@set"),r(n)&&"@preserve"in n&&(n=n["@preserve"][0]),d(n)?("@index"in n&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in n||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||i.push("@graph@id","@graph@id@set")):r(n)&&!c(n)&&i.push("@id","@id@set","@type","@set@type");let s="@language",u="@null";if(a)s="@type",u="@reverse",i.push("@set");else if(l(n)){"@index"in n||i.push("@list");const e=n["@list"];if(0===e.length)s="@any",u="@none";else{let t=0===e.length?o:null,n=null;for(let o=0;o<e.length;++o){const i=e[o];let r="@none",a="@none";if(c(i))if("@direction"in i){r=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`}else"@language"in i?r=i["@language"].toLowerCase():"@type"in i?a=i["@type"]:r="@null";else a="@id";if(null===t?t=r:r!==t&&c(i)&&(t="@none"),null===n?n=a:a!==n&&(n="@none"),"@none"===t&&"@none"===n)break}t=t||"@none",n=n||"@none","@none"!==n?(s="@type",u=n):u=t}}else{if(c(n))if("@language"in n&&!("@index"in n)){i.push("@language","@language@set"),u=n["@language"];const e=n["@direction"];e&&(u=`${u}_${e}`)}else"@direction"in n&&!("@index"in n)?u=`_${n["@direction"]}`:"@type"in n&&(s="@type",u=n["@type"]);else s="@type",u="@id";i.push("@set")}i.push("@none"),r(n)&&!("@index"in n)&&i.push("@index","@index@set"),c(n)&&1===Object.keys(n).length&&i.push("@language","@language@set");const p=function(e,t,n,o,i,a){null===a&&(a="@null");const s=[];if(("@id"===a||"@reverse"===a)&&r(n)&&"@id"in n){"@reverse"===a&&s.push("@reverse");const t=S.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===n["@id"]?s.push.apply(s,["@vocab","@id"]):s.push.apply(s,["@id","@vocab"])}else{s.push(a);const e=s.find(e=>e.includes("_"));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const l=e.inverse[t];for(const e of o){if(!(e in l))continue;const t=l[e][i];for(const e of s)if(e in t)return t[e]}return null}(e,t,n,i,s,u);if(null!==p)return p}if(i.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const o=t.substr(n.length);if(!e.mappings.has(o))return o}}let p=null;const h=[];let f=e.fastCurieMap;const g=t.length-1;for(let e=0;e<g&&t[e]in f;++e)f=f[t[e]],""in f&&h.push(f[""][0]);for(let o=h.length-1;o>=0;--o){const i=h[o],r=i.terms;for(const o of r){const r=o+":"+t.substr(i.iri.length);e.mappings.get(o)._prefix&&(!e.mappings.has(r)||null===n&&e.mappings.get(r)["@id"]===t)&&(null===p||j(r,p)<0)&&(p=r)}}if(null!==p)return p;for(const[n,i]of e.mappings)if(i&&i._prefix&&t.startsWith(n+":"))throw new o(`Absolute IRI "${t}" confused with prefix "${n}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!i.vocab){if("@base"in e){if(e["@base"]){const n=m(x(s,e["@base"]),t);return b.test(n)?`./${n}`:n}return t}return m(s,t)}return t},S.compactValue=({activeCtx:e,activeProperty:t,value:n,options:o})=>{if(c(n)){const o=f(e,t,"@type"),i=f(e,t,"@language"),r=f(e,t,"@direction"),s=f(e,t,"@container")||[],l="@index"in n&&!s.includes("@index");if(!l&&"@none"!==o){if(n["@type"]===o)return n["@value"];if("@language"in n&&n["@language"]===i&&"@direction"in n&&n["@direction"]===r)return n["@value"];if("@language"in n&&n["@language"]===i)return n["@value"];if("@direction"in n&&n["@direction"]===r)return n["@value"]}const c=Object.keys(n).length,d=1===c||2===c&&"@index"in n&&!l,u="@language"in e,p=a(n["@value"]),h=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(d&&"@none"!==o&&(!u||!p||h))return n["@value"];const v={};return l&&(v[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?v[S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=S.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(v[S.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(v[S.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),v[S.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],v}const i=h(e,t,{vocab:!0},o),r=f(e,t,"@type"),s=S.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===r},base:o.base});return"@id"===r||"@vocab"===r||"@graph"===i?s:{[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:s}}},1227(e){"use strict";
5
5
  /*!
6
6
  * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
7
7
  */const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",n="http://www.w3.org/2001/XMLSchema#string",o="NamedNode",i="BlankNode",r="Literal",a={};function s(e,t){return e.subject.termType===t.subject.termType&&e.object.termType===t.object.termType&&(e.subject.value===t.subject.value&&e.predicate.value===t.predicate.value&&e.object.value===t.object.value&&(e.object.termType!==r||e.object.datatype.termType===t.object.datatype.termType&&e.object.language===t.object.language&&e.object.datatype.value===t.object.datatype.value))}(()=>{const e="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",t=e+"0-9-·̀-ͯ‿-⁀",n="_:((?:["+e+"0-9])(?:(?:["+t+".])*(?:["+t+"]))?)",o='(?:<((?:[^\0- <>"{}|^`\\\\]|\\\\u[0-9A-Fa-f]{4}|\\\\U[0-9A-Fa-f]{8})*)>)',i="[ \\t]+",r="[ \\t]*",s="(?:"+o+"|"+n+")"+i,l=o+i,c="(?:"+o+"|"+n+"|"+('(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:'+("(?:\\^\\^"+o+")")+"|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?)")+")"+r,d="(?:\\.|(?:(?:"+o+"|"+n+")"+r+"\\.))";a.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,a.empty=new RegExp("^"+r+"$"),a.quad=new RegExp("^"+r+s+l+c+d+r+"$")})(),e.exports=class e{static parse(e){const l=[],c={},d=e.split(a.eoln);let p=0;for(const e of d){if(p++,a.empty.test(e))continue;const d=e.match(a.quad);if(null===d)throw new Error("N-Quads parse error on line "+p+".");const h={subject:null,predicate:null,object:null,graph:null};if(void 0!==d[1]?h.subject={termType:o,value:g(d[1])}:h.subject={termType:i,value:d[2]},h.predicate={termType:o,value:g(d[3])},void 0!==d[4]?h.object={termType:o,value:g(d[4])}:void 0!==d[5]?h.object={termType:i,value:d[5]}:(h.object={termType:r,value:void 0,datatype:{termType:o}},void 0!==d[7]?h.object.datatype.value=g(d[7]):void 0!==d[8]?(h.object.datatype.value=t,h.object.language=d[8]):h.object.datatype.value=n,h.object.value=u(d[6])),void 0!==d[9]?h.graph={termType:o,value:g(d[9])}:void 0!==d[10]?h.graph={termType:i,value:d[10]}:h.graph={termType:"DefaultGraph",value:""},h.graph.value in c){let e=!0;const t=c[h.graph.value];for(const n of t)if(s(n,h)){e=!1;break}e&&(t.push(h),l.push(h))}else c[h.graph.value]=[h],l.push(h)}return l}static serialize(t){const n=[];for(const o of t)n.push(e.serializeQuad(o));return n.sort().join("")}static serializeQuadComponents(e,r,a,s){let d="";return e.termType===o?d+=`<${f(e.value)}>`:d+=`_:${e.value}`,r.termType===o?d+=` <${f(r.value)}> `:d+=` _:${r.value} `,a.termType===o?d+=`<${f(a.value)}>`:a.termType===i?d+=`_:${a.value}`:(d+=`"${function(e){if(!l.test(e))return e;return e.replace(l,function(e){return c[e.codePointAt(0)]})}(a.value)}"`,a.datatype.value===t?a.language&&(d+=`@${a.language}`):a.datatype.value!==n&&(d+=`^^<${f(a.datatype.value)}>`)),s.termType===o?d+=` <${f(s.value)}>`:s.termType===i&&(d+=` _:${s.value}`),d+=" .\n",d}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}};const l=/[\u0000-\u001F\u007F"\\]/g,c=[];for(let e=0;e<=127;++e)l.test(String.fromCharCode(e))&&(c[e]="\\u"+e.toString(16).toUpperCase().padStart(4,"0"),l.lastIndex=0);c["\b".codePointAt(0)]="\\b",c["\t".codePointAt(0)]="\\t",c["\n".codePointAt(0)]="\\n",c["\f".codePointAt(0)]="\\f",c["\r".codePointAt(0)]="\\r",c['"'.codePointAt(0)]='\\"',c["\\".codePointAt(0)]="\\\\";const d=/(?:\\([btnfr"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function u(e){return d.test(e)?e.replace(d,function(e,t,n,o){if(t)switch(t){case"b":return"\b";case"t":return"\t";case"n":return"\n";case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"\\":return"\\"}return n?String.fromCharCode(parseInt(n,16)):o?String.fromCodePoint(parseInt(o,16)):void 0}):e}const p=/[\u0000-\u0020<>"{}|^`\\]/g,h=[];for(let e=0;e<=127;++e)p.test(String.fromCharCode(e))&&(h[e]="\\u"+e.toString(16).toUpperCase().padStart(4,"0"),p.lastIndex=0);function f(e){return p.test(e)?e.replace(p,function(e){return h[e.codePointAt(0)]}):e}const v=/(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function g(e){return v.test(e)?e.replace(v,function(e,t,n){return t?String.fromCharCode(parseInt(t,16)):n?String.fromCodePoint(parseInt(n,16)):void 0}):e}},1972(e,t,n){"use strict";const o=n(9263),i=n(2207),{isArray:r,isObject:a,isString:s,isUndefined:l}=n(7382),{isAbsolute:c,isRelative:d,prependBase:u}=n(470),{handleEvent:p}=n(2246),{REGEX_BCP47:h,REGEX_KEYWORD:f,asArray:v,compareShortestLeast:g}=n(9263),y=new Map,m={};function x(e,t,n,o,i,r){if(null===t||!s(t)||m.isKeyword(t))return t;if(t.match(f))return null;if(o&&o.hasOwnProperty(t)&&!0!==i.get(t)&&m.createTermDefinition({activeCtx:e,localCtx:o,term:t,defined:i,options:r}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(a(n)&&"@id"in n)return n["@id"]}const l=t.indexOf(":");if(l>0){const n=t.substr(0,l),a=t.substr(l+1);if("_"===n||0===a.indexOf("//"))return t;o&&o.hasOwnProperty(n)&&m.createTermDefinition({activeCtx:e,localCtx:o,term:n,defined:i,options:r});const s=e.mappings.get(n);if(s&&s._prefix)return s["@id"]+a;if(c(t))return t}if(n.vocab&&"@vocab"in e){t=e["@vocab"]+t}else if(n.base){let n,o;"@base"in e?e["@base"]?(o=u(r.base,e["@base"]),n=u(o,t)):(o=e["@base"],n=t):(o=r.base,n=u(r.base,t)),t=n}return t}function b(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!b(e[n],t[n]))return!1;return!0}const o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;for(const n in e){let o=e[n],i=t[n];if("@container"===n&&Array.isArray(o)&&Array.isArray(i)&&(o=o.slice().sort(),i=i.slice().sort()),!b(o,i))return!1}return!0}e.exports=m,m.process=async({activeCtx:e,localCtx:t,options:n,propagate:o=!0,overrideProtected:l=!1,cycles:f=new Set})=>{a(t)&&"@context"in t&&r(t["@context"])&&(t=t["@context"]);if(0===v(t).length)return e;const g=[],y=[({event:e,next:t})=>{g.push(e),t()}];n.eventHandler&&y.push(n.eventHandler);const b=n;n={...n,eventHandler:y};const w=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});a(w[0].document)&&"boolean"==typeof w[0].document["@propagate"]&&(o=w[0].document["@propagate"]);let I=e;o||I.previousContext||(I=I.clone(),I.previousContext=e);for(const o of w){let{document:r}=o;if(e=I,null===r){if(!l&&0!==Object.keys(e.protected).length)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});I=e=m.getInitialContext(n).clone();continue}const v=o.getProcessed(e);if(v){if(b.eventHandler)for(const e of v.events)p({event:e,options:b});I=e=v.context;continue}if(a(r)&&"@context"in r&&(r=r["@context"]),!a(r))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:r});I=I.clone();const y=new Map;if("@version"in r){if(1.1!==r["@version"])throw new i("Unsupported JSON-LD version: "+r["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:r});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+r["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:r});I.processingMode="json-ld-1.1",I["@version"]=r["@version"],y.set("@version",!0)}if(I.processingMode=I.processingMode||e.processingMode,"@base"in r){let e=r["@base"];if(null===e||c(e));else{if(!d(e))throw new i('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:r});e=u(I["@base"],e)}I["@base"]=e,y.set("@base",!0)}if("@vocab"in r){const e=r["@vocab"];if(null===e)delete I["@vocab"];else{if(!s(e))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:r});if(!c(e)&&m.processingMode(I,1))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:r});{const t=x(I,e,{vocab:!0,base:!0},void 0,void 0,n);c(t)||n.eventHandler&&p({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:n}),I["@vocab"]=t}}y.set("@vocab",!0)}if("@language"in r){const e=r["@language"];if(null===e)delete I["@language"];else{if(!s(e))throw new i('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:r});e.match(h)||n.eventHandler&&p({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:n}),I["@language"]=e.toLowerCase()}y.set("@language",!0)}if("@direction"in r){const t=r["@direction"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:r});if(null===t)delete I["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new i('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:r});I["@direction"]=t}y.set("@direction",!0)}if("@propagate"in r){const n=r["@propagate"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:r});if("boolean"!=typeof n)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});y.set("@propagate",!0)}if("@import"in r){const o=r["@import"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:r});if(!s(o))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const a=await n.contextResolver.resolve({activeCtx:e,context:o,documentLoader:n.documentLoader,base:n.base});if(1!==a.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const l=a[0].getProcessed(e);if(l)r=l;else{const n=a[0].document;if("@import"in n)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in n)r.hasOwnProperty(e)||(r[e]=n[e]);a[0].setProcessed(e,r)}y.set("@import",!0)}y.set("@protected",r["@protected"]||!1);for(const e in r)if(m.createTermDefinition({activeCtx:I,localCtx:r,term:e,defined:y,options:n,overrideProtected:l}),a(r[e])&&"@context"in r[e]){const t=r[e]["@context"];let o=!0;if(s(t)){const e=u(n.base,t);f.has(e)?o=!1:f.add(e)}if(o)try{await m.process({activeCtx:I.clone(),localCtx:r[e]["@context"],overrideProtected:!0,options:n,cycles:f})}catch(t){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:r[e]["@context"],term:e})}}o.setProcessed(e,{context:I,events:g})}return I},m.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:o,options:l,overrideProtected:d=!1})=>{if(o.has(n)){if(o.get(n))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let u;if(o.set(n,!1),t.hasOwnProperty(n)&&(u=t[n]),"@type"===n&&a(u)&&"@set"===(u["@container"]||"@set")&&m.processingMode(e,1.1)){const e=["@container","@id","@protected"],o=Object.keys(u);if(0===o.length||o.some(t=>!e.includes(t)))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(m.isKeyword(n))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(f))return void(l.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:n}},options:l}));if(""===n)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const h=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let v=!1;if((s(u)||null===u)&&(v=!0,u={"@id":u}),!a(u))throw new i("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const g={};e.mappings.set(n,g),g.reverse=!1;const y=["@container","@id","@language","@reverse","@type"];m.processingMode(e,1.1)&&y.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in u)if(!y.includes(e))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const w=n.indexOf(":");if(g._termHasColon=w>0,"@reverse"in u){if("@id"in u)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in u)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const r=u["@reverse"];if(!s(r))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(r.match(f))return l.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:r}},options:l}),void(h?e.mappings.set(n,h):e.mappings.delete(n));const a=x(e,r,{vocab:!0,base:!1},t,o,l);if(!c(a))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});g["@id"]=a,g.reverse=!0}else if("@id"in u){let r=u["@id"];if(r&&!s(r))throw new i("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===r)g["@id"]=null;else{if(!m.isKeyword(r)&&r.match(f))return l.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:r}},options:l}),void(h?e.mappings.set(n,h):e.mappings.delete(n));if(r!==n){if(r=x(e,r,{vocab:!0,base:!1},t,o,l),!c(r)&&!m.isKeyword(r))throw new i("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)){if(x(e,n,{vocab:!0,base:!1},t,new Map(o).set(n,!0),l)!==r)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t})}g["@id"]=r,g._prefix=v&&!g._termHasColon&&null!==r.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in g))if(g._termHasColon){const i=n.substr(0,w);if(t.hasOwnProperty(i)&&m.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:o,options:l}),e.mappings.has(i)){const t=n.substr(w+1);g["@id"]=e.mappings.get(i)["@id"]+t}else g["@id"]=n}else if("@type"===n)g["@id"]=n;else{if(!("@vocab"in e))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});g["@id"]=e["@vocab"]+n}if((!0===u["@protected"]||!0===o.get("@protected")&&!1!==u["@protected"])&&(e.protected[n]=!0,g.protected=!0),o.set(n,!0),"@type"in u){let n=u["@type"];if(!s(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(m.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=x(e,n,{vocab:!0,base:!1},t,o,l),!c(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new i("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}g["@type"]=n}if("@container"in u){const n=s(u["@container"])?[u["@container"]]:u["@container"]||[],o=["@list","@set","@index","@language"];let a=!0;const l=n.includes("@set");if(m.processingMode(e,1.1)){if(o.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(n.includes("@graph")){if(n.some(e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e))throw new i("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else a&=n.length<=(l?2:1);if(n.includes("@type")&&(g["@type"]=g["@type"]||"@id",!["@id","@vocab"].includes(g["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else a&=!r(u["@container"]),a&=n.length<=1;if(a&=n.every(e=>o.includes(e)),a&=!(l&&n.includes("@list")),!a)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+o.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(g.reverse&&!n.every(e=>["@index","@set"].includes(e)))throw new i("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});g["@container"]=n}if("@index"in u){if(!("@container"in u)||!g["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${u["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!s(u["@index"])||0===u["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${u["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});g["@index"]=u["@index"]}if("@context"in u&&(g["@context"]=u["@context"]),"@language"in u&&!("@type"in u)){let e=u["@language"];if(null!==e&&!s(e))throw new i("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),g["@language"]=e}if("@prefix"in u){if(n.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(m.isKeyword(g["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof u["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});g._prefix=!0===u["@prefix"]}if("@direction"in u){const e=u["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});g["@direction"]=e}if("@nest"in u){const e=u["@nest"];if(!s(e)||"@nest"!==e&&0===e.indexOf("@"))throw new i("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});g["@nest"]=e}
@@ -45,7 +45,7 @@ const I=g["@id"];if("@context"===I||"@preserve"===I)throw new i("Invalid JSON-LD
45
45
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
46
46
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47
47
  */
48
- const o=n(989),i=n(701),r=n(9263),a=n(7034),s=r.IdentifierIssuer,l=n(2207),c=n(9749),d=n(8229),{expand:u}=n(4019),{flatten:p}=n(5229),{fromRDF:h}=n(3947),{toRDF:f}=n(9180),{frameMergedOrDefault:v,cleanupNull:g}=n(7946),{isArray:y,isObject:m,isString:x}=n(7382),{isSubjectReference:b}=n(3978),{expandIri:w,getInitialContext:I,process:j,processingMode:S}=n(1972),{compact:O,compactIri:D}=n(8677),{createNodeMap:E,createMergedNodeMap:N,mergeNodeMaps:C}=n(9233),{logEventHandler:k,logWarningEventHandler:L,safeEventHandler:A,setDefaultEventHandler:R,setupEventHandler:T,strictEventHandler:_,unhandledEventHandler:P}=n(2246),J=function(e){const t={},J=new c({max:100});function M(t,{documentLoader:n=e.documentLoader,...o}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:n},o,t,{eventHandler:T({options:t})})}return e.compact=async function(t,n,o){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(o=M(o,{base:x(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new a({sharedCache:J})})).link&&(o.skipExpansion=!0),o.compactToRelative||delete o.base,i=o.skipExpansion?t:await e.expand(t,o);const c=await e.processContext(I(o),n,o);let d=await O({activeCtx:c,element:i,options:o});o.compactArrays&&!o.graph&&y(d)?1===d.length?d=d[0]:0===d.length&&(d={}):o.graph&&m(d)&&(d=[d]),m(n)&&"@context"in n&&(n=n["@context"]),n=r.clone(n),y(n)||(n=[n]);const u=n;n=[];for(let e=0;e<u.length;++e)(!m(u[e])||Object.keys(u[e]).length>0)&&n.push(u[e]);const p=n.length>0;if(1===n.length&&(n=n[0]),y(d)){const e=D({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=d;d={},p&&(d["@context"]=n),d[e]=t}else if(m(d)&&p){const e=d;d={"@context":n};for(const t in e)d[t]=e[t]}return d},e.expand=async function(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const o={},i=[];if("expandContext"in(n=M(n,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:J})}))){const e=r.clone(n.expandContext);m(e)&&"@context"in e?o.expandContext=e:o.expandContext={"@context":e},i.push(o.expandContext)}let s;if(x(t)){const r=await e.get(t,n);s=r.documentUrl,o.input=r.document,r.contextUrl&&(o.remoteContext={"@context":r.contextUrl},i.push(o.remoteContext))}else o.input=r.clone(t);"base"in n||(n.base=s||"");let l=I(n);for(const e of i)l=await j({activeCtx:l,localCtx:e,options:n});let c=await u({activeCtx:l,element:o.input,options:n});return m(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),y(c)||(c=[c]),c},e.flatten=async function(t,n,o){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,o=M(o,{base:x(t)?t:"",contextResolver:new a({sharedCache:J})});const i=await e.expand(t,o),r=p(i);if(null===n)return r;o.graph=!0,o.skipExpansion=!0;return await e.compact(r,n,o)},e.frame=async function(t,n,o){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(o=M(o,{base:x(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:J})}),x(n)){const t=await e.get(n,o);if(n=t.document,t.contextUrl){let e=n["@context"];e?y(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const i=n&&n["@context"]||{},r=await e.processContext(I(o),i,o);o.hasOwnProperty("omitGraph")||(o.omitGraph=S(r,1.1)),o.hasOwnProperty("pruneBlankNodeIdentifiers")||(o.pruneBlankNodeIdentifiers=S(r,1.1));const s=await e.expand(t,o),l={...o};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(n,l),d=Object.keys(n).map(e=>w(r,e,{vocab:!0}));l.merged=!d.includes("@graph"),l.is11=S(r,1.1);const u=v(s,c,l);l.graph=!o.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let p=await e.compact(u,i,l);return l.link={},p=g(p,l),p},e.link=async function(t,n,o){const i={};return n&&(i["@context"]=n),i["@embed"]="@link",e.frame(t,i,o)},e.normalize=e.canonize=async function(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");n=M(n,{skipExpansion:!1,safe:!0,contextResolver:new a({sharedCache:J})});const i=Object.assign({},{algorithm:"RDFC-1.0"},n.canonizeOptions||null);if("inputFormat"in n){if("application/n-quads"!==n.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=d.parse(t);return o.canonize(e,i)}const r={...n};delete r.format,delete r.canonizeOptions,r.produceGeneralizedRdf=!1;const s=await e.toRDF(t,r);return o.canonize(s,i)},e.fromRDF=async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=M(n,{format:x(e)?"application/n-quads":void 0});const{format:o}=n;let{rdfParser:i}=n;if(o){if(i=i||t[o],!i)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:o})}else i=()=>e;const r=await i(e);return h(r,n)},e.toRDF=async function(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let o;o=(n=M(n,{skipExpansion:!1,contextResolver:new a({sharedCache:J})})).skipExpansion?t:await e.expand(t,n);const i=f(o,n);if(n.format){if("application/n-quads"===n.format)return d.serialize(i);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return i},e.createNodeMap=async function(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=M(n,{base:x(t)?t:"",contextResolver:new a({sharedCache:J})});const o=await e.expand(t,n);return N(o,n)},e.merge=async function(t,n,o){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!y(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,o=M(o,{contextResolver:new a({sharedCache:J})});const i=await Promise.all(t.map(t=>{const n={...o};return e.expand(t,n)}));let l=!0;"mergeNodes"in o&&(l=o.mergeNodes);const c=o.issuer||new s("_:b"),d={"@default":{}};for(let e=0;e<i.length;++e){const t=r.relabelBlankNodes(i[e],{issuer:new s("_:b"+e+"-")}),n=l||0===e?d:{"@default":{}};if(E(t,n,"@default",c),n!==d)for(const e in n){const t=n[e];if(!(e in d)){d[e]=t;continue}const o=d[e];for(const e in t)e in o||(o[e]=t[e])}}const u=C(d),p=[],h=Object.keys(u).sort();for(let e=0;e<h.length;++e){const t=u[h[e]];b(t)||p.push(t)}if(null===n)return p;o.graph=!0,o.skipExpansion=!0;return await e.compact(p,n,o)},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,n){let o;o="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const i=await o(t);try{if(!i.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");x(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new l("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,n){return n=M(n,{base:"",contextResolver:new a({sharedCache:J})}),null===t?I(n):(t=r.clone(t),m(t)&&"@context"in t||(t={"@context":t}),j({activeCtx:e,localCtx:t,options:n}))},e.getContextValue=n(1972).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,n){t[e]=n},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",d.parse),e.url=n(470),e.logEventHandler=k,e.logWarningEventHandler=L,e.safeEventHandler=A,e.setDefaultEventHandler=R,e.strictEventHandler=_,e.unhandledEventHandler=P,e.util=r,Object.assign(e,r),e.promises=e,e.RequestQueue=n(3743),e.JsonLdProcessor=n(5445)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},M=function(){return J(function(){return M()})};J(M),e.exports=M},4991(e,t,n){"use strict";
48
+ const o=n(989),i=n(701),r=n(9263),a=n(7034),s=r.IdentifierIssuer,l=n(2207),c=n(9749),d=n(8229),{expand:u}=n(4019),{flatten:p}=n(5229),{fromRDF:h}=n(3947),{toRDF:f}=n(9180),{frameMergedOrDefault:v,cleanupNull:g}=n(7946),{isArray:y,isObject:m,isString:x}=n(7382),{isSubjectReference:b}=n(3978),{expandIri:w,getInitialContext:I,process:j,processingMode:S}=n(1972),{compact:O,compactIri:D}=n(1058),{createNodeMap:E,createMergedNodeMap:N,mergeNodeMaps:C}=n(9233),{logEventHandler:k,logWarningEventHandler:L,safeEventHandler:A,setDefaultEventHandler:R,setupEventHandler:T,strictEventHandler:_,unhandledEventHandler:P}=n(2246),J=function(e){const t={},J=new c({max:100});function M(t,{documentLoader:n=e.documentLoader,...o}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:n},o,t,{eventHandler:T({options:t})})}return e.compact=async function(t,n,o){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(o=M(o,{base:x(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new a({sharedCache:J})})).link&&(o.skipExpansion=!0),o.compactToRelative||delete o.base,i=o.skipExpansion?t:await e.expand(t,o);const c=await e.processContext(I(o),n,o);let d=await O({activeCtx:c,element:i,options:o});o.compactArrays&&!o.graph&&y(d)?1===d.length?d=d[0]:0===d.length&&(d={}):o.graph&&m(d)&&(d=[d]),m(n)&&"@context"in n&&(n=n["@context"]),n=r.clone(n),y(n)||(n=[n]);const u=n;n=[];for(let e=0;e<u.length;++e)(!m(u[e])||Object.keys(u[e]).length>0)&&n.push(u[e]);const p=n.length>0;if(1===n.length&&(n=n[0]),y(d)){const e=D({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=d;d={},p&&(d["@context"]=n),d[e]=t}else if(m(d)&&p){const e=d;d={"@context":n};for(const t in e)d[t]=e[t]}return d},e.expand=async function(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const o={},i=[];if("expandContext"in(n=M(n,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:J})}))){const e=r.clone(n.expandContext);m(e)&&"@context"in e?o.expandContext=e:o.expandContext={"@context":e},i.push(o.expandContext)}let s;if(x(t)){const r=await e.get(t,n);s=r.documentUrl,o.input=r.document,r.contextUrl&&(o.remoteContext={"@context":r.contextUrl},i.push(o.remoteContext))}else o.input=r.clone(t);"base"in n||(n.base=s||"");let l=I(n);for(const e of i)l=await j({activeCtx:l,localCtx:e,options:n});let c=await u({activeCtx:l,element:o.input,options:n});return m(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),y(c)||(c=[c]),c},e.flatten=async function(t,n,o){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,o=M(o,{base:x(t)?t:"",contextResolver:new a({sharedCache:J})});const i=await e.expand(t,o),r=p(i);if(null===n)return r;o.graph=!0,o.skipExpansion=!0;return await e.compact(r,n,o)},e.frame=async function(t,n,o){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(o=M(o,{base:x(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:J})}),x(n)){const t=await e.get(n,o);if(n=t.document,t.contextUrl){let e=n["@context"];e?y(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const i=n&&n["@context"]||{},r=await e.processContext(I(o),i,o);o.hasOwnProperty("omitGraph")||(o.omitGraph=S(r,1.1)),o.hasOwnProperty("pruneBlankNodeIdentifiers")||(o.pruneBlankNodeIdentifiers=S(r,1.1));const s=await e.expand(t,o),l={...o};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(n,l),d=Object.keys(n).map(e=>w(r,e,{vocab:!0}));l.merged=!d.includes("@graph"),l.is11=S(r,1.1);const u=v(s,c,l);l.graph=!o.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let p=await e.compact(u,i,l);return l.link={},p=g(p,l),p},e.link=async function(t,n,o){const i={};return n&&(i["@context"]=n),i["@embed"]="@link",e.frame(t,i,o)},e.normalize=e.canonize=async function(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");n=M(n,{skipExpansion:!1,safe:!0,contextResolver:new a({sharedCache:J})});const i=Object.assign({},{algorithm:"RDFC-1.0"},n.canonizeOptions||null);if("inputFormat"in n){if("application/n-quads"!==n.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=d.parse(t);return o.canonize(e,i)}const r={...n};delete r.format,delete r.canonizeOptions,r.produceGeneralizedRdf=!1;const s=await e.toRDF(t,r);return o.canonize(s,i)},e.fromRDF=async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=M(n,{format:x(e)?"application/n-quads":void 0});const{format:o}=n;let{rdfParser:i}=n;if(o){if(i=i||t[o],!i)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:o})}else i=()=>e;const r=await i(e);return h(r,n)},e.toRDF=async function(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let o;o=(n=M(n,{skipExpansion:!1,contextResolver:new a({sharedCache:J})})).skipExpansion?t:await e.expand(t,n);const i=f(o,n);if(n.format){if("application/n-quads"===n.format)return d.serialize(i);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return i},e.createNodeMap=async function(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=M(n,{base:x(t)?t:"",contextResolver:new a({sharedCache:J})});const o=await e.expand(t,n);return N(o,n)},e.merge=async function(t,n,o){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!y(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,o=M(o,{contextResolver:new a({sharedCache:J})});const i=await Promise.all(t.map(t=>{const n={...o};return e.expand(t,n)}));let l=!0;"mergeNodes"in o&&(l=o.mergeNodes);const c=o.issuer||new s("_:b"),d={"@default":{}};for(let e=0;e<i.length;++e){const t=r.relabelBlankNodes(i[e],{issuer:new s("_:b"+e+"-")}),n=l||0===e?d:{"@default":{}};if(E(t,n,"@default",c),n!==d)for(const e in n){const t=n[e];if(!(e in d)){d[e]=t;continue}const o=d[e];for(const e in t)e in o||(o[e]=t[e])}}const u=C(d),p=[],h=Object.keys(u).sort();for(let e=0;e<h.length;++e){const t=u[h[e]];b(t)||p.push(t)}if(null===n)return p;o.graph=!0,o.skipExpansion=!0;return await e.compact(p,n,o)},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,n){let o;o="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const i=await o(t);try{if(!i.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");x(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new l("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,n){return n=M(n,{base:"",contextResolver:new a({sharedCache:J})}),null===t?I(n):(t=r.clone(t),m(t)&&"@context"in t||(t={"@context":t}),j({activeCtx:e,localCtx:t,options:n}))},e.getContextValue=n(1972).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,n){t[e]=n},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",d.parse),e.url=n(470),e.logEventHandler=k,e.logWarningEventHandler=L,e.safeEventHandler=A,e.setDefaultEventHandler=R,e.strictEventHandler=_,e.unhandledEventHandler=P,e.util=r,Object.assign(e,r),e.promises=e,e.RequestQueue=n(3743),e.JsonLdProcessor=n(5445)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},M=function(){return J(function(){return M()})};J(M),e.exports=M},4991(e,t,n){"use strict";
49
49
  /*!
50
50
  * Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved.
51
51
  */n(2791),t.setImmediate=setImmediate,t.crypto=globalThis.crypto;const o=[];for(let e=0;e<=255;++e)o.push(e.toString(16).padStart(2,"0"));t.bufferToHex=function(e){let t="";const n=new Uint8Array(e);for(let e=0;e<n.length;++e)t+=o[n[e]];return t}},5229(e,t,n){"use strict";const{isSubjectReference:o}=n(3978),{createMergedNodeMap:i}=n(9233),r={};e.exports=r,r.flatten=e=>{const t=i(e),n=[],r=Object.keys(t).sort();for(let e=0;e<r.length;++e){const i=t[r[e]];o(i)||n.push(i)}return n}},5445(e){"use strict";e.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},6957(e,t,n){"use strict";const{parseLinkHeader:o,buildHeaders:i}=n(9263),{LINK_HEADER_CONTEXT:r}=n(9378),a=n(2207),s=n(3743),{prependBase:l}=n(470),c=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:n}={headers:{}})=>{t=i(t);return(new s).wrapLoader(async function i(s){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new a('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(e&&0!==s.indexOf("https"))throw new a('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s});let d;try{d=await function(e,t,n){e=e||XMLHttpRequest;const o=new e;return new Promise((e,i)=>{o.onload=()=>e(o),o.onerror=e=>i(e),o.open("GET",t,!0);for(const e in n)o.setRequestHeader(e,n[e]);o.send()})}(n,s,t)}catch(e){throw new a("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:e})}if(d.status>=400)throw new a("URL could not be dereferenced: "+d.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:s,httpStatusCode:d.status});let u={contextUrl:null,documentUrl:s,document:d.response},p=null;const h=d.getResponseHeader("Content-Type");let f;c.test(d.getAllResponseHeaders())&&(f=d.getResponseHeader("Link"));if(f&&"application/ld+json"!==h){const e=o(f),t=e[r];if(Array.isArray(t))throw new a("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});t&&(u.contextUrl=t.target),p=e.alternate,p&&"application/ld+json"==p.type&&!(h||"").match(/^application\/(\w*\+)?json$/)&&(u=await i(l(s,p.target)))}return u})}},7034(e,t,n){"use strict";const{isArray:o,isObject:i,isString:r}=n(7382),{asArray:a}=n(9263),{prependBase:s}=n(470),l=n(2207),c=n(7532);function d(e){throw new l("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function u({context:e,base:t}){if(!e)return;const n=e["@context"];if(r(n))e["@context"]=s(t,n);else if(o(n))for(let e=0;e<n.length;++e){const o=n[e];r(o)?n[e]=s(t,o):i(o)&&u({context:{"@context":o},base:t})}else if(i(n))for(const e in n)u({context:n[e],base:t})}e.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:n,base:s,cycles:l=new Set}){t&&i(t)&&t["@context"]&&(t=t["@context"]),t=a(t);const u=[];for(const a of t){if(r(a)){let t=this._get(a);t||(t=await this._resolveRemoteContext({activeCtx:e,url:a,documentLoader:n,base:s,cycles:l})),o(t)?u.push(...t):u.push(t);continue}if(null===a){u.push(new c({document:null}));continue}i(a)||d(t);const p=JSON.stringify(a);let h=this._get(p);h||(h=new c({document:a}),this._cacheResolvedContext({key:p,resolved:h,tag:"static"})),u.push(h)}return u}_get(e){let t=this.perOpCache.get(e);if(!t){const n=this.sharedCache.get(e);n&&(t=n.get("static"),t&&this.perOpCache.set(e,t))}return t}_cacheResolvedContext({key:e,resolved:t,tag:n}){if(this.perOpCache.set(e,t),void 0!==n){let o=this.sharedCache.get(e);o||(o=new Map,this.sharedCache.set(e,o)),o.set(n,t)}return t}async _resolveRemoteContext({activeCtx:e,url:t,documentLoader:n,base:o,cycles:i}){t=s(o,t);const{context:r,remoteDoc:a}=await this._fetchContext({activeCtx:e,url:t,documentLoader:n,cycles:i});u({context:r,base:o=a.documentUrl||t});const l=await this.resolve({activeCtx:e,context:r,documentLoader:n,base:o,cycles:i});return this._cacheResolvedContext({key:t,resolved:l,tag:a.tag}),l}async _fetchContext({activeCtx:e,url:t,documentLoader:n,cycles:a}){if(a.size>10)throw new l("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(a.has(t))throw new l("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let s,c;a.add(t);try{c=await n(t),s=c.document||null,r(s)&&(s=JSON.parse(s))}catch(e){throw new l(`Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context. URL: "${t}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:e})}if(!i(s))throw new l(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${t}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:t});return s="@context"in s?{"@context":s["@context"]}:{"@context":{}},c.contextUrl&&(o(s["@context"])||(s["@context"]=[s["@context"]]),s["@context"].push(c.contextUrl)),{context:s,remoteDoc:c}}}},7382(e){"use strict";const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},7532(e,t,n){"use strict";const o=n(9749);e.exports=class{constructor({document:e}){this.document=e,this.cache=new o({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},7920(e,t,n){"use strict";
@@ -63,7 +63,7 @@ const o=n(989),i=n(701),r=n(9263),a=n(7034),s=r.IdentifierIssuer,l=n(2207),c=n(9
63
63
  // remove @preserve
64
64
  if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=m(e["@list"],t),e;if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const o=t.link[n].indexOf(e);if(-1!==o)return t.link[n][o];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)"@id"===n&&t.bnodesToClear.includes(e[n])?delete e["@id"]:e[n]=m(e[n],t)}return e}function x(e,t,n){r.isObject(e)?a.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function b(e,t,n,o){if(!("@id"in n))return!1;const i=e.subjects[n["@id"]];return i&&g(e,i,t,o)}function w(e,t){const n=t["@value"],o=t["@type"],i=t["@language"],a=e["@value"]?r.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?r.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],l=e["@language"]?r.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===a.length&&0===s.length&&0===l.length||!(!a.includes(n)&&!r.isEmptyObject(a[0]))&&(!!(!o&&0===s.length||s.includes(o)||o&&r.isEmptyObject(s[0]))&&!!(!i&&0===l.length||l.includes(i)||i&&r.isEmptyObject(l[0])))}e.exports=u,u.frameMergedOrDefault=(e,t,n)=>{const o={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new a.IdentifierIssuer("_:b");c(e,o.graphMap,"@default",i),n.merged&&(o.graphMap["@merged"]=d(o.graphMap),o.graph="@merged"),o.subjects=o.graphMap[o.graph];const r=[];return u.frame(o,Object.keys(o.subjects).sort(),t,r),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(o.bnodeMap).filter(e=>1===o.bnodeMap[e].length)),
65
65
  // remove @preserve from results
66
- n.link={},m(r,n)},u.frame=(e,t,n,s,c=null)=>{v(n),n=n[0];const d=e.options,m={embed:f(n,d,"embed"),explicit:f(n,d,"explicit"),requireAll:f(n,d,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const b=e.link[e.graph],I=function(e,t,n,o){const i={};for(const r of t){const t=e.graphMap[e.graph][r];g(e,t,n,o)&&(i[r]=t)}return i}(e,t,n,m),j=Object.keys(I).sort();for(const v of j){const g=I[v];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===m.embed&&v in b){x(s,c,b[v]);continue}const j={"@id":v};if(0===v.indexOf("_:")&&a.addValue(e.bnodeMap,v,j,{propertyIsArray:!0}),b[v]=j,("@first"===m.embed||"@last"===m.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(v))if(!e.embedded||"@never"!==m.embed&&!h(g,e.graph,e.subjectStack))if(!e.embedded||"@first"!=m.embed&&"@once"!=m.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(v)){if("@last"===m.embed&&v in e.uniqueEmbeds[e.graph]&&y(e,v),e.uniqueEmbeds[e.graph][v]={parent:s,property:c},e.subjectStack.push({subject:g,graph:e.graph}),v in e.graphMap){let t=!1,o=null;"@graph"in n?(o=n["@graph"][0],t=!("@merged"===v||"@default"===v),r.isObject(o)||(o={})):(t="@merged"!==e.graph,o={}),t&&u.frame({...e,graph:v,embedded:!1},Object.keys(e.graphMap[v]).sort(),[o],j,"@graph")}"@included"in n&&u.frame({...e,embedded:!1},t,n["@included"],j,"@included");for(const t of Object.keys(g).sort())if(o(t)){if(j[t]=a.clone(g[t]),"@type"===t)for(const t of g["@type"])0===t.indexOf("_:")&&a.addValue(e.bnodeMap,t,j,{propertyIsArray:!0})}else if(!m.explicit||t in n)for(const o of g[t]){const r=t in n?n[t]:p(m);if(i.isList(o)){const r=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:p(m),s={"@list":[]};x(j,t,s);const l=o["@list"];for(const t of l)i.isSubjectReference(t)?u.frame({...e,embedded:!0},[t["@id"]],r,s,"@list"):x(s,"@list",a.clone(t))}else i.isSubjectReference(o)?u.frame({...e,embedded:!0},[o["@id"]],r,j,t):w(r[0],o)&&x(j,t,a.clone(o))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!r.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(o(e))continue;const t=n[e][0]||{};if(!f(t,d,"omitDefault")&&!(e in j)){let n="@null";"@default"in t&&(n=a.clone(t["@default"])),r.isArray(n)||(n=[n]),j[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const o=n["@reverse"][t];for(const n of Object.keys(e.subjects)){a.getValues(e.subjects[n],t).some(e=>e["@id"]===v)&&(j["@reverse"]=j["@reverse"]||{},a.addValue(j["@reverse"],t,[],{propertyIsArray:!0}),u.frame({...e,embedded:!0},[n],o,j["@reverse"][t],c))}}x(s,c,j),e.subjectStack.pop()}else x(s,c,j);else x(s,c,j)}},u.cleanupNull=(e,t)=>{if(r.isArray(e)){return e.map(e=>u.cleanupNull(e,t)).filter(e=>e)}if("@null"===e)return null;if(r.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const o=t.link[n].indexOf(e);if(-1!==o)return t.link[n][o];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=u.cleanupNull(e[n],t)}return e}},8229(e,t,n){"use strict";e.exports=n(989).NQuads},8677(e,t,n){"use strict";const o=n(2207),{isArray:i,isObject:r,isString:a,isUndefined:s}=n(7382),{isList:l,isValue:c,isGraph:d,isSimpleGraph:u,isSubjectReference:p}=n(3978),{expandIri:h,getContextValue:f,isKeyword:v,process:g,processingMode:y}=n(1972),{removeBase:m,prependBase:x}=n(470),{REGEX_KEYWORD:b,addValue:w,asArray:I,compareShortestLeast:j}=n(9263),S={};function O(e,t,n){if("@nest"!==h(e,t,{vocab:!0},n))throw new o("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=S,S.compact=async({activeCtx:e,activeProperty:t=null,element:n,options:h={}})=>{if(i(n)){let o=[];for(let i=0;i<n.length;++i){const r=await S.compact({activeCtx:e,activeProperty:t,element:n[i],options:h});null!==r&&o.push(r)}if(h.compactArrays&&1===o.length){0===(f(e,t,"@container")||[]).length&&(o=o[0])}return o}const m=f(e,t,"@context");if(s(m)||(e=await g({activeCtx:e,localCtx:m,propagate:!0,overrideProtected:!0,options:h})),r(n)){if(h.link&&"@id"in n&&h.link.hasOwnProperty(n["@id"])){const e=h.link[n["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===n)return e[t].compacted}if(c(n)||p(n)){const o=S.compactValue({activeCtx:e,activeProperty:t,value:n,options:h});return h.link&&p(n)&&(h.link.hasOwnProperty(n["@id"])||(h.link[n["@id"]]=[]),h.link[n["@id"]].push({expanded:n,compacted:o})),o}if(l(n)){if((f(e,t,"@container")||[]).includes("@list"))return S.compact({activeCtx:e,activeProperty:t,element:n["@list"],options:h})}const m="@reverse"===t,x={},b=e;c(n)||p(n)||(e=e.revertToPreviousContext());const j=f(b,t,"@context");s(j)||(e=await g({activeCtx:e,localCtx:j,propagate:!0,overrideProtected:!0,options:h})),h.link&&"@id"in n&&(h.link.hasOwnProperty(n["@id"])||(h.link[n["@id"]]=[]),h.link[n["@id"]].push({expanded:n,compacted:x}));let D=n["@type"]||[];D.length>1&&(D=Array.from(D).sort());const E=e;for(const t of D){const n=S.compactIri({activeCtx:E,iri:t,relativeTo:{vocab:!0}}),o=f(b,n,"@context");s(o)||(e=await g({activeCtx:e,localCtx:o,options:h,propagate:!1}))}const N=Object.keys(n).sort();for(const s of N){const p=n[s];if("@id"===s){let t=I(p).map(t=>S.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:h.base}));1===t.length&&(t=t[0]);x[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t;continue}if("@type"===s){let t=I(p).map(e=>S.compactIri({activeCtx:b,iri:e,relativeTo:{vocab:!0}}));1===t.length&&(t=t[0]);const n=S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),o=(f(e,n,"@container")||[]).includes("@set")&&y(e,1.1)||i(t)&&0===p.length;w(x,n,t,{propertyIsArray:o});continue}if("@reverse"===s){const t=await S.compact({activeCtx:e,activeProperty:"@reverse",element:p,options:h});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const o=t[n],i=(f(e,n,"@container")||[]).includes("@set")||!h.compactArrays;w(x,n,o,{propertyIsArray:i}),delete t[n]}if(Object.keys(t).length>0){const n=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,n,t)}continue}if("@preserve"===s){const n=await S.compact({activeCtx:e,activeProperty:t,element:p,options:h});i(n)&&0===n.length||w(x,s,n);continue}if("@index"===s){if((f(e,t,"@container")||[]).includes("@index"))continue;const n=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,n,p);continue}if("@graph"!==s&&"@list"!==s&&"@included"!==s&&v(s)){const t=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,t,p);continue}if(!i(p))throw new o("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===p.length){const t=S.compactIri({activeCtx:e,iri:s,value:p,relativeTo:{vocab:!0},reverse:m}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let o=x;n&&(O(e,n,h),r(x[n])||(x[n]={}),o=x[n]),w(o,t,p,{propertyIsArray:!0})}for(const t of p){const n=S.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:m}),o=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let p=x;o&&(O(e,o,h),r(x[o])||(x[o]={}),p=x[o]);const v=f(e,n,"@container")||[],g=d(t),y=l(t);let b;y?b=t["@list"]:g&&(b=t["@graph"]);let j=await S.compact({activeCtx:e,activeProperty:n,element:y||g?b:t,options:h});if(y){if(i(j)||(j=[j]),v.includes("@list")){w(p,n,j,{valueIsArray:!0,allowDuplicate:!0});continue}j={[S.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:j},"@index"in t&&(j[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(g)if(v.includes("@graph")&&(v.includes("@id")||v.includes("@index")&&u(t))){let o;p.hasOwnProperty(n)?o=p[n]:p[n]=o={};const i=(v.includes("@id")?t["@id"]:t["@index"])||S.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});w(o,i,j,{propertyIsArray:!h.compactArrays||v.includes("@set")})}else v.includes("@graph")&&u(t)?(i(j)&&j.length>1&&(j={"@included":j}),w(p,n,j,{propertyIsArray:!h.compactArrays||v.includes("@set")})):(i(j)&&1===j.length&&h.compactArrays&&(j=j[0]),j={[S.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:j},"@id"in t&&(j[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(j[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),w(p,n,j,{propertyIsArray:!h.compactArrays||v.includes("@set")}));else if(v.includes("@language")||v.includes("@index")||v.includes("@id")||v.includes("@type")){let o,i;if(p.hasOwnProperty(n)?o=p[n]:p[n]=o={},v.includes("@language"))c(j)&&(j=j["@value"]),i=t["@language"];else if(v.includes("@index")){const o=f(e,n,"@index")||"@index",r=S.compactIri({activeCtx:e,iri:o,relativeTo:{vocab:!0}});if("@index"===o)i=t["@index"],delete j[r];else{let e;if([i,...e]=I(j[o]||[]),a(i))switch(e.length){case 0:delete j[o];break;case 1:j[o]=e[0];break;default:j[o]=e}else i=null}}else if(v.includes("@id")){const t=S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=j[t],delete j[t]}else if(v.includes("@type")){const o=S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let r;switch([i,...r]=I(j[o]||[]),r.length){case 0:delete j[o];break;case 1:j[o]=r[0];break;default:j[o]=r}1===Object.keys(j).length&&"@id"in t&&(j=await S.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:h}))}i||(i=S.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),w(o,i,j,{propertyIsArray:v.includes("@set")})}else{const e=!h.compactArrays||v.includes("@set")||v.includes("@list")||i(j)&&0===j.length||"@list"===s||"@graph"===s;w(p,n,j,{propertyIsArray:e})}}}return x}return n},S.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:i={vocab:!1},reverse:a=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const u=e.getInverse();if(v(t)&&t in u&&"@none"in u[t]&&"@type"in u[t]["@none"]&&"@none"in u[t]["@none"]["@type"])return u[t]["@none"]["@type"]["@none"];if(i.vocab&&t in u){const o=e["@language"]||"@none",i=[];r(n)&&"@index"in n&&!("@graph"in n)&&i.push("@index","@index@set"),r(n)&&"@preserve"in n&&(n=n["@preserve"][0]),d(n)?("@index"in n&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in n||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||i.push("@graph@id","@graph@id@set")):r(n)&&!c(n)&&i.push("@id","@id@set","@type","@set@type");let s="@language",u="@null";if(a)s="@type",u="@reverse",i.push("@set");else if(l(n)){"@index"in n||i.push("@list");const e=n["@list"];if(0===e.length)s="@any",u="@none";else{let t=0===e.length?o:null,n=null;for(let o=0;o<e.length;++o){const i=e[o];let r="@none",a="@none";if(c(i))if("@direction"in i){r=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`}else"@language"in i?r=i["@language"].toLowerCase():"@type"in i?a=i["@type"]:r="@null";else a="@id";if(null===t?t=r:r!==t&&c(i)&&(t="@none"),null===n?n=a:a!==n&&(n="@none"),"@none"===t&&"@none"===n)break}t=t||"@none",n=n||"@none","@none"!==n?(s="@type",u=n):u=t}}else{if(c(n))if("@language"in n&&!("@index"in n)){i.push("@language","@language@set"),u=n["@language"];const e=n["@direction"];e&&(u=`${u}_${e}`)}else"@direction"in n&&!("@index"in n)?u=`_${n["@direction"]}`:"@type"in n&&(s="@type",u=n["@type"]);else s="@type",u="@id";i.push("@set")}i.push("@none"),r(n)&&!("@index"in n)&&i.push("@index","@index@set"),c(n)&&1===Object.keys(n).length&&i.push("@language","@language@set");const p=function(e,t,n,o,i,a){null===a&&(a="@null");const s=[];if(("@id"===a||"@reverse"===a)&&r(n)&&"@id"in n){"@reverse"===a&&s.push("@reverse");const t=S.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===n["@id"]?s.push.apply(s,["@vocab","@id"]):s.push.apply(s,["@id","@vocab"])}else{s.push(a);const e=s.find(e=>e.includes("_"));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const l=e.inverse[t];for(const e of o){if(!(e in l))continue;const t=l[e][i];for(const e of s)if(e in t)return t[e]}return null}(e,t,n,i,s,u);if(null!==p)return p}if(i.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const o=t.substr(n.length);if(!e.mappings.has(o))return o}}let p=null;const h=[];let f=e.fastCurieMap;const g=t.length-1;for(let e=0;e<g&&t[e]in f;++e)f=f[t[e]],""in f&&h.push(f[""][0]);for(let o=h.length-1;o>=0;--o){const i=h[o],r=i.terms;for(const o of r){const r=o+":"+t.substr(i.iri.length);e.mappings.get(o)._prefix&&(!e.mappings.has(r)||null===n&&e.mappings.get(r)["@id"]===t)&&(null===p||j(r,p)<0)&&(p=r)}}if(null!==p)return p;for(const[n,i]of e.mappings)if(i&&i._prefix&&t.startsWith(n+":"))throw new o(`Absolute IRI "${t}" confused with prefix "${n}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!i.vocab){if("@base"in e){if(e["@base"]){const n=m(x(s,e["@base"]),t);return b.test(n)?`./${n}`:n}return t}return m(s,t)}return t},S.compactValue=({activeCtx:e,activeProperty:t,value:n,options:o})=>{if(c(n)){const o=f(e,t,"@type"),i=f(e,t,"@language"),r=f(e,t,"@direction"),s=f(e,t,"@container")||[],l="@index"in n&&!s.includes("@index");if(!l&&"@none"!==o){if(n["@type"]===o)return n["@value"];if("@language"in n&&n["@language"]===i&&"@direction"in n&&n["@direction"]===r)return n["@value"];if("@language"in n&&n["@language"]===i)return n["@value"];if("@direction"in n&&n["@direction"]===r)return n["@value"]}const c=Object.keys(n).length,d=1===c||2===c&&"@index"in n&&!l,u="@language"in e,p=a(n["@value"]),h=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(d&&"@none"!==o&&(!u||!p||h))return n["@value"];const v={};return l&&(v[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?v[S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=S.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(v[S.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(v[S.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),v[S.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],v}const i=h(e,t,{vocab:!0},o),r=f(e,t,"@type"),s=S.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===r},base:o.base});return"@id"===r||"@vocab"===r||"@graph"===i?s:{[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:s}}},8799(e,t,n){"use strict";function o(e){var t=this;if(t instanceof o||(t=new o),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}function i(e,t,n){var o=t===e.head?new s(n,null,t,e):new s(n,t,t.next,e);return null===o.next&&(e.tail=o),null===o.prev&&(e.head=o),e.length++,o}function r(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function a(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,n,o){if(!(this instanceof s))return new s(e,t,n,o);this.list=o,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=o,o.Node=s,o.create=o,o.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},o.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},o.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},o.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},o.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)a(this,arguments[e]);return this.length},o.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},o.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},o.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,o=0;null!==n;o++)e.call(t,n.value,o,this),n=n.next},o.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,o=this.length-1;null!==n;o--)e.call(t,n.value,o,this),n=n.prev},o.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},o.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},o.prototype.map=function(e,t){t=t||this;for(var n=new o,i=this.head;null!==i;)n.push(e.call(t,i.value,this)),i=i.next;return n},o.prototype.mapReverse=function(e,t){t=t||this;for(var n=new o,i=this.tail;null!==i;)n.push(e.call(t,i.value,this)),i=i.prev;return n},o.prototype.reduce=function(e,t){var n,o=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");o=this.head.next,n=this.head.value}for(var i=0;null!==o;i++)n=e(n,o.value,i),o=o.next;return n},o.prototype.reduceReverse=function(e,t){var n,o=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");o=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==o;i--)n=e(n,o.value,i),o=o.prev;return n},o.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},o.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},o.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new o;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,r=this.head;null!==r&&i<e;i++)r=r.next;for(;null!==r&&i<t;i++,r=r.next)n.push(r.value);return n},o.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new o;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,r=this.tail;null!==r&&i>t;i--)r=r.prev;for(;null!==r&&i>e;i--,r=r.prev)n.push(r.value);return n},o.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var o=0,r=this.head;null!==r&&o<e;o++)r=r.next;var a=[];for(o=0;r&&o<t;o++)a.push(r.value),r=this.removeNode(r);null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(o=0;o<n.length;o++)r=i(this,r,n[o]);return a},o.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var o=n.prev;n.prev=n.next,n.next=o}return this.head=t,this.tail=e,this};try{n(259)(o)}catch(e){}},9180(e,t,n){"use strict";const{createNodeMap:o}=n(9233),{isKeyword:i}=n(1972),r=n(3978),a=n(2341),s=n(2207),l=n(7382),c=n(9263),{handleEvent:d}=n(2246),{RDF_FIRST:u,RDF_REST:p,RDF_NIL:h,RDF_TYPE:f,RDF_JSON_LITERAL:v,RDF_LANGSTRING:g,XSD_BOOLEAN:y,XSD_DOUBLE:m,XSD_INTEGER:x,XSD_STRING:b}=n(9378),{isAbsolute:w}=n(470),I={};function j(e,t,n,o,r){const a=Object.keys(t).sort();for(const s of a){const a=t[s],l=Object.keys(a).sort();for(let t of l){const l=a[t];if("@type"===t)t=f;else if(i(t))continue;for(const i of l){const a=O(s);if(!w(s)){r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:s}},options:r});continue}const l=O(t);if(!w(t)){r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:r});continue}if("BlankNode"===l.termType&&!r.produceGeneralizedRdf){r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:o.getOldIds().find(e=>o.getId(e)===t)}},options:r});continue}const c=S(i,o,e,n,r.rdfDirection,r);c&&e.push({subject:a,predicate:l,object:c,graph:n})}}}}function S(e,t,n,o,i,c){let f;if(r.isValue(e)){f={termType:"Literal",value:void 0,datatype:{termType:"NamedNode"}};let t=e["@value"];const n=e["@type"]||null;if("@json"===n)f.value=a(t),f.datatype.value=v;else if(l.isBoolean(t))f.value=t.toString(),f.datatype.value=n||y;else if(l.isDouble(t)||n===m)l.isDouble(t)||(t=parseFloat(t)),f.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),f.datatype.value=n||m;else if(l.isNumber(t))f.value=t.toFixed(0),f.datatype.value=n||x;else if("@direction"in e&&"i18n-datatype"===i){const n=`https://www.w3.org/ns/i18n#${(e["@language"]||"").toLowerCase()}_${e["@direction"]}`;f.datatype.value=n,f.value=t}else{if("@direction"in e&&"compound-literal"===i)throw new s("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:i});if("@direction"in e&&i)throw new s("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:i});"@language"in e?("@direction"in e&&!i&&c.eventHandler&&d({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:f.value}},options:c}),f.value=t,f.datatype.value=n||g,f.language=e["@language"]):("@direction"in e&&!i&&c.eventHandler&&d({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:f.value}},options:c}),f.value=t,f.datatype.value=n||b)}}else if(r.isList(e)){const r=function(e,t,n,o,i,r){const a={termType:"NamedNode",value:u},s={termType:"NamedNode",value:p},l={termType:"NamedNode",value:h},c=e.pop(),d=c?{termType:"BlankNode",value:t.getId().slice(2)}:l;let f=d;for(const l of e){const e=S(l,t,n,o,i,r),c={termType:"BlankNode",value:t.getId().slice(2)};n.push({subject:f,predicate:a,object:e,graph:o}),n.push({subject:f,predicate:s,object:c,graph:o}),f=c}if(c){const e=S(c,t,n,o,i,r);n.push({subject:f,predicate:a,object:e,graph:o}),n.push({subject:f,predicate:s,object:l,graph:o})}return d}(e["@list"],t,n,o,i,c);f={termType:r.termType,value:r.value}}else{f=O(l.isObject(e)?e["@id"]:e)}return"NamedNode"!==f.termType||w(f.value)?f:(c.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:f.value}},options:c}),null)}function O(e){return e.startsWith("_:")?{termType:"BlankNode",value:e.slice(2)}:{termType:"NamedNode",value:e}}e.exports=I,I.toRDF=(e,t)=>{const n=new c.IdentifierIssuer("_:b"),i={"@default":{}};o(e,i,"@default",n);const r=[],a=Object.keys(i).sort();for(const e of a){let o;if("@default"===e)o={termType:"DefaultGraph",value:""};else{if(!w(e)){t.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}o=O(e)}j(r,i[e],o,n,t)}return r}},9233(e,t,n){"use strict";const{isKeyword:o}=n(1972),i=n(3978),r=n(7382),a=n(9263),s=n(2207),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new a.IdentifierIssuer("_:b"),o={"@default":{}};return l.createNodeMap(e,o,"@default",n),l.mergeNodeMaps(o)},l.createNodeMap=(e,t,n,c,d,u)=>{if(r.isArray(e)){for(const o of e)l.createNodeMap(o,t,n,c,void 0,u);return}if(!r.isObject(e))return void(u&&u.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(u&&u.push(e))}if(u&&i.isList(e)){const o=[];return l.createNodeMap(e["@list"],t,n,c,d,o),void u.push({"@list":o})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}r.isUndefined(d)&&(d=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),u&&u.push({"@id":d});const p=t[n],h=p[d]=p[d]||{};h["@id"]=d;const f=Object.keys(e).sort();for(let r of f){if("@id"===r)continue;if("@reverse"===r){const o={"@id":d},r=e["@reverse"];for(const e in r){const s=r[e];for(const r of s){let s=r["@id"];i.isBlankNode(r)&&(s=c.getId(s)),l.createNodeMap(r,t,n,c,s),a.addValue(p[s],e,o,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===r){d in t||(t[d]={}),l.createNodeMap(e[r],t,d,c);continue}if("@included"===r){l.createNodeMap(e[r],t,n,c);continue}if("@type"!==r&&o(r)){if("@index"===r&&r in h&&(e[r]!==h[r]||e[r]["@id"]!==h[r]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:h});h[r]=e[r];continue}const u=e[r];if(0===r.indexOf("_:")&&(r=c.getId(r)),0!==u.length)for(let e of u)if("@type"===r&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const o=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];a.addValue(h,r,{"@id":o},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,n,c,o)}else if(i.isValue(e))a.addValue(h,r,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const o=[];l.createNodeMap(e["@list"],t,n,c,d,o),e={"@list":o},a.addValue(h,r,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,n,c,d),a.addValue(h,r,e,{propertyIsArray:!0,allowDuplicate:!1});else a.addValue(h,r,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const i of Object.keys(e[n]).sort()){const r=e[n][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(r).sort())if(o(e)&&"@type"!==e)s[e]=a.clone(r[e]);else for(const t of r[e])a.addValue(s,e,a.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const o of n){if("@default"===o)continue;const n=e[o];let r=t[o];r?"@graph"in r||(r["@graph"]=[]):t[o]=r={"@id":o,"@graph":[]};const a=r["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];i.isSubjectReference(t)||a.push(t)}}return t}},9263(e,t,n){"use strict";const o=n(3978),i=n(7382),r=n(989).IdentifierIssuer,a=n(2207),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,d={accept:"application/ld+json, application/json"},u={};function p(e,t){if(i.isArray(t))for(let n=0;n<t.length;++n)t[n]=p(e,t[n]);else if(o.isList(t))t["@list"]=p(e,t["@list"]);else if(i.isObject(t)){o.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const n=Object.keys(t).sort();for(let o=0;o<n.length;++o){const i=n[o];"@id"!==i&&(t[i]=p(e,t[i]))}}return t}e.exports=u,u.IdentifierIssuer=r,u.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,u.REGEX_KEYWORD=/^@[a-zA-Z]+$/,u.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let n=0;n<e.length;++n)t[n]=u.clone(e[n])}else if(e instanceof Map){t=new Map;for(const[n,o]of e)t.set(n,u.clone(o))}else if(e instanceof Set){t=new Set;for(const n of e)t.add(u.clone(n))}else if(i.isObject(e)){t={};for(const n in e)t[n]=u.clone(e[n])}else t=e.toString();return t}return e},u.asArray=function(e){return Array.isArray(e)?e:[e]},u.buildHeaders=(e={})=>{if(Object.keys(e).some(e=>"accept"===e.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+d.accept+'" is supported.');return Object.assign({Accept:d.accept},e)},u.parseLinkHeader=e=>{const t={},n=e.match(s);for(let e=0;e<n.length;++e){let o=n[e].match(l);if(!o)continue;const i={target:o[1]},r=o[2];for(;o=c.exec(r);)i[o[1]]=void 0===o[2]?o[3]:o[2];const a=i.rel||"";Array.isArray(t[a])?t[a].push(i):t.hasOwnProperty(a)?t[a]=[t[a],i]:t[a]=i}return t},u.validateTypeValue=(e,t)=>{if(!(i.isString(e)||i.isArray(e)&&e.every(e=>i.isString(e)))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&u.asArray(e["@default"]).every(e=>i.isString(e)))return}throw new a('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},u.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!i.isArray(n)||n.length>0}return!1},u.hasValue=(e,t,n)=>{if(u.hasProperty(e,t)){let r=e[t];const a=o.isList(r);if(i.isArray(r)||a){a&&(r=r["@list"]);for(let e=0;e<r.length;++e)if(u.compareValues(n,r[e]))return!0}else if(!i.isArray(n))return u.compareValues(n,r)}return!1},u.addValue=(e,t,n,o)=>{if("propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1),"valueIsArray"in o||(o.valueIsArray=!1),"allowDuplicate"in o||(o.allowDuplicate=!0),"prependValue"in o||(o.prependValue=!1),o.valueIsArray)e[t]=n;else if(i.isArray(n)){0===n.length&&o.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),o.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let i=0;i<n.length;++i)u.addValue(e,t,n[i],o)}else if(e.hasOwnProperty(t)){const r=!o.allowDuplicate&&u.hasValue(e,t,n);i.isArray(e[t])||r&&!o.propertyIsArray||(e[t]=[e[t]]),r||(o.prependValue?e[t].unshift(n):e[t].push(n))}else e[t]=o.propertyIsArray?[n]:n},u.getValues=(e,t)=>[].concat(e[t]||[]),u.removeProperty=(e,t)=>{delete e[t]},u.removeValue=(e,t,n,o)=>{"propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1);const i=u.getValues(e,t).filter(e=>!u.compareValues(e,n));0===i.length?u.removeProperty(e,t):1!==i.length||o.propertyIsArray?e[t]=i:e[t]=i[0]},u.relabelBlankNodes=(e,t)=>p((t=t||{}).issuer||new r("_:b"),e),u.compareValues=(e,t)=>e===t||(!(!o.isValue(e)||!o.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"]),u.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},9378(e){"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",n="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:n,XSD_BOOLEAN:n+"boolean",XSD_DOUBLE:n+"double",XSD_INTEGER:n+"integer",XSD_STRING:n+"string"}},9749(e,t,n){"use strict";const o=n(8799),i=Symbol("max"),r=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),d=Symbol("noDisposeOnSet"),u=Symbol("lruList"),p=Symbol("cache"),h=Symbol("updateAgeOnGet"),f=()=>1;const v=(e,t,n)=>{const o=e[p].get(t);if(o){const t=o.value;if(g(e,t)){if(m(e,o),!e[s])return}else n&&(e[h]&&(o.value.now=Date.now()),e[u].unshiftNode(o));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},y=e=>{if(e[r]>e[i])for(let t=e[u].tail;e[r]>e[i]&&null!==t;){const n=t.prev;m(e,t),t=n}},m=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[r]-=n.length,e[p].delete(n.key),e[u].removeNode(t)}};class x{constructor(e,t,n,o,i){this.key=e,this.value=t,this.length=n,this.now=o,this.maxAge=i||0}}const b=(e,t,n,o)=>{let i=n.value;g(e,i)&&(m(e,n),e[s]||(i=void 0)),i&&t.call(o,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||f;if(this[a]="function"!=typeof t?f:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[d]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,y(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,y(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[a]&&(this[a]=e,this[r]=0,this[u].forEach(e=>{e.length=this[a](e.value,e.key),this[r]+=e.length})),y(this)}get lengthCalculator(){return this[a]}get length(){return this[r]}get itemCount(){return this[u].length}rforEach(e,t){t=t||this;for(let n=this[u].tail;null!==n;){const o=n.prev;b(this,e,n,t),n=o}}forEach(e,t){t=t||this;for(let n=this[u].head;null!==n;){const o=n.next;b(this,e,n,t),n=o}}keys(){return this[u].toArray().map(e=>e.key)}values(){return this[u].toArray().map(e=>e.value)}reset(){this[c]&&this[u]&&this[u].length&&this[u].forEach(e=>this[c](e.key,e.value)),this[p]=new Map,this[u]=new o,this[r]=0}dump(){return this[u].map(e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[u]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const o=n?Date.now():0,s=this[a](t,e);if(this[p].has(e)){if(s>this[i])return m(this,this[p].get(e)),!1;const a=this[p].get(e).value;return this[c]&&(this[d]||this[c](e,a.value)),a.now=o,a.maxAge=n,a.value=t,this[r]+=s-a.length,a.length=s,this.get(e),y(this),!0}const h=new x(e,t,s,o,n);return h.length>this[i]?(this[c]&&this[c](e,t),!1):(this[r]+=h.length,this[u].unshift(h),this[p].set(e,this[u].head),y(this),!0)}has(e){if(!this[p].has(e))return!1;const t=this[p].get(e).value;return!g(this,t)}get(e){return v(this,e,!0)}peek(e){return v(this,e,!1)}pop(){const e=this[u].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[p].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const o=e[n],i=o.e||0;if(0===i)this.set(o.k,o.v);else{const e=i-t;e>0&&this.set(o.k,o.v,e)}}}prune(){this[p].forEach((e,t)=>v(this,t,!1))}}},9925(e){"use strict";
66
+ n.link={},m(r,n)},u.frame=(e,t,n,s,c=null)=>{v(n),n=n[0];const d=e.options,m={embed:f(n,d,"embed"),explicit:f(n,d,"explicit"),requireAll:f(n,d,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const b=e.link[e.graph],I=function(e,t,n,o){const i={};for(const r of t){const t=e.graphMap[e.graph][r];g(e,t,n,o)&&(i[r]=t)}return i}(e,t,n,m),j=Object.keys(I).sort();for(const v of j){const g=I[v];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===m.embed&&v in b){x(s,c,b[v]);continue}const j={"@id":v};if(0===v.indexOf("_:")&&a.addValue(e.bnodeMap,v,j,{propertyIsArray:!0}),b[v]=j,("@first"===m.embed||"@last"===m.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(v))if(!e.embedded||"@never"!==m.embed&&!h(g,e.graph,e.subjectStack))if(!e.embedded||"@first"!=m.embed&&"@once"!=m.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(v)){if("@last"===m.embed&&v in e.uniqueEmbeds[e.graph]&&y(e,v),e.uniqueEmbeds[e.graph][v]={parent:s,property:c},e.subjectStack.push({subject:g,graph:e.graph}),v in e.graphMap){let t=!1,o=null;"@graph"in n?(o=n["@graph"][0],t=!("@merged"===v||"@default"===v),r.isObject(o)||(o={})):(t="@merged"!==e.graph,o={}),t&&u.frame({...e,graph:v,embedded:!1},Object.keys(e.graphMap[v]).sort(),[o],j,"@graph")}"@included"in n&&u.frame({...e,embedded:!1},t,n["@included"],j,"@included");for(const t of Object.keys(g).sort())if(o(t)){if(j[t]=a.clone(g[t]),"@type"===t)for(const t of g["@type"])0===t.indexOf("_:")&&a.addValue(e.bnodeMap,t,j,{propertyIsArray:!0})}else if(!m.explicit||t in n)for(const o of g[t]){const r=t in n?n[t]:p(m);if(i.isList(o)){const r=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:p(m),s={"@list":[]};x(j,t,s);const l=o["@list"];for(const t of l)i.isSubjectReference(t)?u.frame({...e,embedded:!0},[t["@id"]],r,s,"@list"):x(s,"@list",a.clone(t))}else i.isSubjectReference(o)?u.frame({...e,embedded:!0},[o["@id"]],r,j,t):w(r[0],o)&&x(j,t,a.clone(o))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!r.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(o(e))continue;const t=n[e][0]||{};if(!f(t,d,"omitDefault")&&!(e in j)){let n="@null";"@default"in t&&(n=a.clone(t["@default"])),r.isArray(n)||(n=[n]),j[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const o=n["@reverse"][t];for(const n of Object.keys(e.subjects)){a.getValues(e.subjects[n],t).some(e=>e["@id"]===v)&&(j["@reverse"]=j["@reverse"]||{},a.addValue(j["@reverse"],t,[],{propertyIsArray:!0}),u.frame({...e,embedded:!0},[n],o,j["@reverse"][t],c))}}x(s,c,j),e.subjectStack.pop()}else x(s,c,j);else x(s,c,j)}},u.cleanupNull=(e,t)=>{if(r.isArray(e)){return e.map(e=>u.cleanupNull(e,t)).filter(e=>e)}if("@null"===e)return null;if(r.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const o=t.link[n].indexOf(e);if(-1!==o)return t.link[n][o];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=u.cleanupNull(e[n],t)}return e}},8229(e,t,n){"use strict";e.exports=n(989).NQuads},8799(e,t,n){"use strict";function o(e){var t=this;if(t instanceof o||(t=new o),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}function i(e,t,n){var o=t===e.head?new s(n,null,t,e):new s(n,t,t.next,e);return null===o.next&&(e.tail=o),null===o.prev&&(e.head=o),e.length++,o}function r(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function a(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,n,o){if(!(this instanceof s))return new s(e,t,n,o);this.list=o,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=o,o.Node=s,o.create=o,o.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},o.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},o.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},o.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},o.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)a(this,arguments[e]);return this.length},o.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},o.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},o.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,o=0;null!==n;o++)e.call(t,n.value,o,this),n=n.next},o.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,o=this.length-1;null!==n;o--)e.call(t,n.value,o,this),n=n.prev},o.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},o.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},o.prototype.map=function(e,t){t=t||this;for(var n=new o,i=this.head;null!==i;)n.push(e.call(t,i.value,this)),i=i.next;return n},o.prototype.mapReverse=function(e,t){t=t||this;for(var n=new o,i=this.tail;null!==i;)n.push(e.call(t,i.value,this)),i=i.prev;return n},o.prototype.reduce=function(e,t){var n,o=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");o=this.head.next,n=this.head.value}for(var i=0;null!==o;i++)n=e(n,o.value,i),o=o.next;return n},o.prototype.reduceReverse=function(e,t){var n,o=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");o=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==o;i--)n=e(n,o.value,i),o=o.prev;return n},o.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},o.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},o.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new o;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,r=this.head;null!==r&&i<e;i++)r=r.next;for(;null!==r&&i<t;i++,r=r.next)n.push(r.value);return n},o.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new o;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,r=this.tail;null!==r&&i>t;i--)r=r.prev;for(;null!==r&&i>e;i--,r=r.prev)n.push(r.value);return n},o.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var o=0,r=this.head;null!==r&&o<e;o++)r=r.next;var a=[];for(o=0;r&&o<t;o++)a.push(r.value),r=this.removeNode(r);null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(o=0;o<n.length;o++)r=i(this,r,n[o]);return a},o.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var o=n.prev;n.prev=n.next,n.next=o}return this.head=t,this.tail=e,this};try{n(259)(o)}catch(e){}},9180(e,t,n){"use strict";const{createNodeMap:o}=n(9233),{isKeyword:i}=n(1972),r=n(3978),a=n(2341),s=n(2207),l=n(7382),c=n(9263),{handleEvent:d}=n(2246),{RDF_FIRST:u,RDF_REST:p,RDF_NIL:h,RDF_TYPE:f,RDF_JSON_LITERAL:v,RDF_LANGSTRING:g,XSD_BOOLEAN:y,XSD_DOUBLE:m,XSD_INTEGER:x,XSD_STRING:b}=n(9378),{isAbsolute:w}=n(470),I={};function j(e,t,n,o,r){const a=Object.keys(t).sort();for(const s of a){const a=t[s],l=Object.keys(a).sort();for(let t of l){const l=a[t];if("@type"===t)t=f;else if(i(t))continue;for(const i of l){const a=O(s);if(!w(s)){r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:s}},options:r});continue}const l=O(t);if(!w(t)){r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:r});continue}if("BlankNode"===l.termType&&!r.produceGeneralizedRdf){r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:o.getOldIds().find(e=>o.getId(e)===t)}},options:r});continue}const c=S(i,o,e,n,r.rdfDirection,r);c&&e.push({subject:a,predicate:l,object:c,graph:n})}}}}function S(e,t,n,o,i,c){let f;if(r.isValue(e)){f={termType:"Literal",value:void 0,datatype:{termType:"NamedNode"}};let t=e["@value"];const n=e["@type"]||null;if("@json"===n)f.value=a(t),f.datatype.value=v;else if(l.isBoolean(t))f.value=t.toString(),f.datatype.value=n||y;else if(l.isDouble(t)||n===m)l.isDouble(t)||(t=parseFloat(t)),f.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),f.datatype.value=n||m;else if(l.isNumber(t))f.value=t.toFixed(0),f.datatype.value=n||x;else if("@direction"in e&&"i18n-datatype"===i){const n=`https://www.w3.org/ns/i18n#${(e["@language"]||"").toLowerCase()}_${e["@direction"]}`;f.datatype.value=n,f.value=t}else{if("@direction"in e&&"compound-literal"===i)throw new s("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:i});if("@direction"in e&&i)throw new s("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:i});"@language"in e?("@direction"in e&&!i&&c.eventHandler&&d({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:f.value}},options:c}),f.value=t,f.datatype.value=n||g,f.language=e["@language"]):("@direction"in e&&!i&&c.eventHandler&&d({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:f.value}},options:c}),f.value=t,f.datatype.value=n||b)}}else if(r.isList(e)){const r=function(e,t,n,o,i,r){const a={termType:"NamedNode",value:u},s={termType:"NamedNode",value:p},l={termType:"NamedNode",value:h},c=e.pop(),d=c?{termType:"BlankNode",value:t.getId().slice(2)}:l;let f=d;for(const l of e){const e=S(l,t,n,o,i,r),c={termType:"BlankNode",value:t.getId().slice(2)};n.push({subject:f,predicate:a,object:e,graph:o}),n.push({subject:f,predicate:s,object:c,graph:o}),f=c}if(c){const e=S(c,t,n,o,i,r);n.push({subject:f,predicate:a,object:e,graph:o}),n.push({subject:f,predicate:s,object:l,graph:o})}return d}(e["@list"],t,n,o,i,c);f={termType:r.termType,value:r.value}}else{f=O(l.isObject(e)?e["@id"]:e)}return"NamedNode"!==f.termType||w(f.value)?f:(c.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:f.value}},options:c}),null)}function O(e){return e.startsWith("_:")?{termType:"BlankNode",value:e.slice(2)}:{termType:"NamedNode",value:e}}e.exports=I,I.toRDF=(e,t)=>{const n=new c.IdentifierIssuer("_:b"),i={"@default":{}};o(e,i,"@default",n);const r=[],a=Object.keys(i).sort();for(const e of a){let o;if("@default"===e)o={termType:"DefaultGraph",value:""};else{if(!w(e)){t.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}o=O(e)}j(r,i[e],o,n,t)}return r}},9233(e,t,n){"use strict";const{isKeyword:o}=n(1972),i=n(3978),r=n(7382),a=n(9263),s=n(2207),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new a.IdentifierIssuer("_:b"),o={"@default":{}};return l.createNodeMap(e,o,"@default",n),l.mergeNodeMaps(o)},l.createNodeMap=(e,t,n,c,d,u)=>{if(r.isArray(e)){for(const o of e)l.createNodeMap(o,t,n,c,void 0,u);return}if(!r.isObject(e))return void(u&&u.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(u&&u.push(e))}if(u&&i.isList(e)){const o=[];return l.createNodeMap(e["@list"],t,n,c,d,o),void u.push({"@list":o})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}r.isUndefined(d)&&(d=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),u&&u.push({"@id":d});const p=t[n],h=p[d]=p[d]||{};h["@id"]=d;const f=Object.keys(e).sort();for(let r of f){if("@id"===r)continue;if("@reverse"===r){const o={"@id":d},r=e["@reverse"];for(const e in r){const s=r[e];for(const r of s){let s=r["@id"];i.isBlankNode(r)&&(s=c.getId(s)),l.createNodeMap(r,t,n,c,s),a.addValue(p[s],e,o,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===r){d in t||(t[d]={}),l.createNodeMap(e[r],t,d,c);continue}if("@included"===r){l.createNodeMap(e[r],t,n,c);continue}if("@type"!==r&&o(r)){if("@index"===r&&r in h&&(e[r]!==h[r]||e[r]["@id"]!==h[r]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:h});h[r]=e[r];continue}const u=e[r];if(0===r.indexOf("_:")&&(r=c.getId(r)),0!==u.length)for(let e of u)if("@type"===r&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const o=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];a.addValue(h,r,{"@id":o},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,n,c,o)}else if(i.isValue(e))a.addValue(h,r,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const o=[];l.createNodeMap(e["@list"],t,n,c,d,o),e={"@list":o},a.addValue(h,r,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,n,c,d),a.addValue(h,r,e,{propertyIsArray:!0,allowDuplicate:!1});else a.addValue(h,r,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const i of Object.keys(e[n]).sort()){const r=e[n][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(r).sort())if(o(e)&&"@type"!==e)s[e]=a.clone(r[e]);else for(const t of r[e])a.addValue(s,e,a.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const o of n){if("@default"===o)continue;const n=e[o];let r=t[o];r?"@graph"in r||(r["@graph"]=[]):t[o]=r={"@id":o,"@graph":[]};const a=r["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];i.isSubjectReference(t)||a.push(t)}}return t}},9263(e,t,n){"use strict";const o=n(3978),i=n(7382),r=n(989).IdentifierIssuer,a=n(2207),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,d={accept:"application/ld+json, application/json"},u={};function p(e,t){if(i.isArray(t))for(let n=0;n<t.length;++n)t[n]=p(e,t[n]);else if(o.isList(t))t["@list"]=p(e,t["@list"]);else if(i.isObject(t)){o.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const n=Object.keys(t).sort();for(let o=0;o<n.length;++o){const i=n[o];"@id"!==i&&(t[i]=p(e,t[i]))}}return t}e.exports=u,u.IdentifierIssuer=r,u.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,u.REGEX_KEYWORD=/^@[a-zA-Z]+$/,u.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let n=0;n<e.length;++n)t[n]=u.clone(e[n])}else if(e instanceof Map){t=new Map;for(const[n,o]of e)t.set(n,u.clone(o))}else if(e instanceof Set){t=new Set;for(const n of e)t.add(u.clone(n))}else if(i.isObject(e)){t={};for(const n in e)t[n]=u.clone(e[n])}else t=e.toString();return t}return e},u.asArray=function(e){return Array.isArray(e)?e:[e]},u.buildHeaders=(e={})=>{if(Object.keys(e).some(e=>"accept"===e.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+d.accept+'" is supported.');return Object.assign({Accept:d.accept},e)},u.parseLinkHeader=e=>{const t={},n=e.match(s);for(let e=0;e<n.length;++e){let o=n[e].match(l);if(!o)continue;const i={target:o[1]},r=o[2];for(;o=c.exec(r);)i[o[1]]=void 0===o[2]?o[3]:o[2];const a=i.rel||"";Array.isArray(t[a])?t[a].push(i):t.hasOwnProperty(a)?t[a]=[t[a],i]:t[a]=i}return t},u.validateTypeValue=(e,t)=>{if(!(i.isString(e)||i.isArray(e)&&e.every(e=>i.isString(e)))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&u.asArray(e["@default"]).every(e=>i.isString(e)))return}throw new a('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},u.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!i.isArray(n)||n.length>0}return!1},u.hasValue=(e,t,n)=>{if(u.hasProperty(e,t)){let r=e[t];const a=o.isList(r);if(i.isArray(r)||a){a&&(r=r["@list"]);for(let e=0;e<r.length;++e)if(u.compareValues(n,r[e]))return!0}else if(!i.isArray(n))return u.compareValues(n,r)}return!1},u.addValue=(e,t,n,o)=>{if("propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1),"valueIsArray"in o||(o.valueIsArray=!1),"allowDuplicate"in o||(o.allowDuplicate=!0),"prependValue"in o||(o.prependValue=!1),o.valueIsArray)e[t]=n;else if(i.isArray(n)){0===n.length&&o.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),o.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let i=0;i<n.length;++i)u.addValue(e,t,n[i],o)}else if(e.hasOwnProperty(t)){const r=!o.allowDuplicate&&u.hasValue(e,t,n);i.isArray(e[t])||r&&!o.propertyIsArray||(e[t]=[e[t]]),r||(o.prependValue?e[t].unshift(n):e[t].push(n))}else e[t]=o.propertyIsArray?[n]:n},u.getValues=(e,t)=>[].concat(e[t]||[]),u.removeProperty=(e,t)=>{delete e[t]},u.removeValue=(e,t,n,o)=>{"propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1);const i=u.getValues(e,t).filter(e=>!u.compareValues(e,n));0===i.length?u.removeProperty(e,t):1!==i.length||o.propertyIsArray?e[t]=i:e[t]=i[0]},u.relabelBlankNodes=(e,t)=>p((t=t||{}).issuer||new r("_:b"),e),u.compareValues=(e,t)=>e===t||(!(!o.isValue(e)||!o.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"]),u.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},9378(e){"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",n="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:n,XSD_BOOLEAN:n+"boolean",XSD_DOUBLE:n+"double",XSD_INTEGER:n+"integer",XSD_STRING:n+"string"}},9749(e,t,n){"use strict";const o=n(8799),i=Symbol("max"),r=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),d=Symbol("noDisposeOnSet"),u=Symbol("lruList"),p=Symbol("cache"),h=Symbol("updateAgeOnGet"),f=()=>1;const v=(e,t,n)=>{const o=e[p].get(t);if(o){const t=o.value;if(g(e,t)){if(m(e,o),!e[s])return}else n&&(e[h]&&(o.value.now=Date.now()),e[u].unshiftNode(o));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},y=e=>{if(e[r]>e[i])for(let t=e[u].tail;e[r]>e[i]&&null!==t;){const n=t.prev;m(e,t),t=n}},m=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[r]-=n.length,e[p].delete(n.key),e[u].removeNode(t)}};class x{constructor(e,t,n,o,i){this.key=e,this.value=t,this.length=n,this.now=o,this.maxAge=i||0}}const b=(e,t,n,o)=>{let i=n.value;g(e,i)&&(m(e,n),e[s]||(i=void 0)),i&&t.call(o,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||f;if(this[a]="function"!=typeof t?f:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[d]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,y(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,y(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[a]&&(this[a]=e,this[r]=0,this[u].forEach(e=>{e.length=this[a](e.value,e.key),this[r]+=e.length})),y(this)}get lengthCalculator(){return this[a]}get length(){return this[r]}get itemCount(){return this[u].length}rforEach(e,t){t=t||this;for(let n=this[u].tail;null!==n;){const o=n.prev;b(this,e,n,t),n=o}}forEach(e,t){t=t||this;for(let n=this[u].head;null!==n;){const o=n.next;b(this,e,n,t),n=o}}keys(){return this[u].toArray().map(e=>e.key)}values(){return this[u].toArray().map(e=>e.value)}reset(){this[c]&&this[u]&&this[u].length&&this[u].forEach(e=>this[c](e.key,e.value)),this[p]=new Map,this[u]=new o,this[r]=0}dump(){return this[u].map(e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[u]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const o=n?Date.now():0,s=this[a](t,e);if(this[p].has(e)){if(s>this[i])return m(this,this[p].get(e)),!1;const a=this[p].get(e).value;return this[c]&&(this[d]||this[c](e,a.value)),a.now=o,a.maxAge=n,a.value=t,this[r]+=s-a.length,a.length=s,this.get(e),y(this),!0}const h=new x(e,t,s,o,n);return h.length>this[i]?(this[c]&&this[c](e,t),!1):(this[r]+=h.length,this[u].unshift(h),this[p].set(e,this[u].head),y(this),!0)}has(e){if(!this[p].has(e))return!1;const t=this[p].get(e).value;return!g(this,t)}get(e){return v(this,e,!0)}peek(e){return v(this,e,!1)}pop(){const e=this[u].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[p].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const o=e[n],i=o.e||0;if(0===i)this.set(o.k,o.v);else{const e=i-t;e>0&&this.set(o.k,o.v,e)}}}prune(){this[p].forEach((e,t)=>v(this,t,!1))}}},9925(e){"use strict";
67
67
  /*!
68
68
  * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
69
69
  */e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,n=e.slice();let o=null,i=0;const r=e.length;for(let n=0;n<r;++n){const a=e[n],s=t.get(a);(null===o||a>o)&&(s&&n>0&&a>e[n-1]||!s&&n<r-1&&a>e[n+1])&&(o=a,i=n)}if(null===o)this.done=!0;else{const n=t.get(o)?i-1:i+1;e[i]=e[n],e[n]=o;for(const n of e)n>o&&t.set(n,!t.get(n))}return n}}}}]);